dolibarr 20.0.0
productattributevalueline_view.tpl.php
1<?php
2/* Copyright (C) 2022 Open-Dsi <support@open-dsi.fr>
3 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 *
18 * Need to have following variables defined:
19 * $object (invoice, order, ...)
20 * $conf
21 * $langs
22 * $dateSelector
23 * $forceall (0 by default, 1 for supplier invoices/orders)
24 * $element (used to test $user->hasRight($element, 'creer'))
25 * $permtoedit (used to replace test $user->hasRight($element, 'creer'))
26 * $senderissupplier (0 by default, 1 for supplier invoices/orders)
27 * $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax)
28 * $outputalsopricetotalwithtax
29 * $usemargins (0 to disable all margins columns, 1 to show according to margin setup)
30 * $object_rights->creer initialized from = $object->getRights()
31 * $disableedit, $disablemove, $disableremove
32 *
33 * $text, $description, $line
34 */
35
36// Protection to avoid direct call of template
37if (empty($object) || !is_object($object)) {
38 print "Error, template page can't be called as URL";
39 exit(1);
40}
41
42'@phan-var-force CommonObject $this
43 @phan-var-force CommonObject $object';
44
45// add html5 elements
46$domData = ' data-element="'.$line->element.'"';
47$domData .= ' data-id="'.$line->id.'"';
48
49$coldisplay = 0;
50?>
51<!-- BEGIN PHP TEMPLATE productattributevalueline_view.tpl.php -->
52<tr id="row-<?php print $line->id?>" class="drag drop oddeven" <?php print $domData; ?> >
53<?php if (getDolGlobalString('MAIN_VIEW_LINE_NUMBER')) { ?>
54 <td class="linecolnum center"><span class="opacitymedium"><?php $coldisplay++; ?><?php print($i + 1); ?></span></td>
55<?php } ?>
56 <td class="linecolref nowrap"><?php $coldisplay++; ?><div id="line_<?php print $line->id; ?>"></div>
57 <?php print $line->ref ?>
58 </td>
59
60 <td class="linecolvalue nowrap"><?php $coldisplay++; print $line->value ?></td>
61<?php
62if (!empty($object_rights->write) && $action != 'selectlines') {
63 print '<td class="linecoledit center width25">';
64 $coldisplay++;
65 if (empty($disableedit)) { ?>
66 <a class="editfielda reposition" href="<?php print $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=editline&token='.newToken().'&lineid='.$line->id.'#line_'.$line->id; ?>">
67 <?php print img_edit().'</a>';
68 }
69 print '</td>';
70
71 print '<td class="linecoldelete center width25">';
72 $coldisplay++;
73 if (empty($disableremove)) { // For situation invoice, deletion is not possible if there is a parent company.
74 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&action=ask_deleteline&token='.newToken().'&lineid='.$line->id.'">';
75 print img_delete();
76 print '</a>';
77 }
78 print '</td>';
79
80 if ($num > 1 && $conf->browser->layout != 'phone' && empty($disablemove)) {
81 print '<td class="linecolmove tdlineupdown center width25">';
82 $coldisplay++;
83 if ($i > 0) { ?>
84 <a class="lineupdown reposition" href="<?php print $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=up&token='.newToken().'&rowid='.$line->id; ?>">
85 <?php print img_up('default', 0, 'imgupforline'); ?>
86 </a>
87 <?php }
88 if ($i < $num - 1) { ?>
89 <a class="lineupdown reposition" href="<?php print $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=down&token='.newToken().'&rowid='.$line->id; ?>">
90 <?php print img_down('default', 0, 'imgdownforline'); ?>
91 </a>
92 <?php }
93 print '</td>';
94 } else {
95 print '<td '.(($conf->browser->layout != 'phone' && empty($disablemove)) ? ' class="linecolmove tdlineupdown center"' : ' class="linecolmove center"').'></td>';
96 $coldisplay++;
97 }
98} else {
99 print '<td colspan="3"></td>';
100 $coldisplay = $coldisplay + 3;
101}
102
103if ($action == 'selectlines') { ?>
104 <td class="linecolcheck center"><input type="checkbox" class="linecheckbox" name="line_checkbox[<?php print $i + 1; ?>]" value="<?php print $line->id; ?>" ></td>
105<?php }
106
107print "</tr>\n";
108
109print "<!-- END PHP TEMPLATE productattributevalueline_view.tpl.php -->\n";
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:58
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
img_down($titlealt='default', $selected=0, $moreclass='')
Show down arrow logo.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
img_up($titlealt='default', $selected=0, $moreclass='')
Show top arrow logo.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
Definition repair.php:139
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:142