dolibarr 20.0.2
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(); ?>
68 </a>
69 <?php }
70 print '</td>';
71
72 print '<td class="linecoldelete center width25">';
73 $coldisplay++;
74 if (empty($disableremove)) { // For situation invoice, deletion is not possible if there is a parent company.
75 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&action=ask_deleteline&token='.newToken().'&lineid='.$line->id.'">';
76 print img_delete();
77 print '</a>';
78 }
79 print '</td>';
80
81 if ($num > 1 && $conf->browser->layout != 'phone' && empty($disablemove)) {
82 print '<td class="linecolmove tdlineupdown center width25">';
83 $coldisplay++;
84 if ($i > 0) { ?>
85 <a class="lineupdown reposition" href="<?php print $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=up&token='.newToken().'&rowid='.$line->id; ?>">
86 <?php print img_up('default', 0, 'imgupforline'); ?>
87 </a>
88 <?php }
89 if ($i < $num - 1) { ?>
90 <a class="lineupdown reposition" href="<?php print $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=down&token='.newToken().'&rowid='.$line->id; ?>">
91 <?php print img_down('default', 0, 'imgdownforline'); ?>
92 </a>
93 <?php }
94 print '</td>';
95 } else {
96 print '<td '.(($conf->browser->layout != 'phone' && empty($disablemove)) ? ' class="linecolmove tdlineupdown center"' : ' class="linecolmove center"').'></td>';
97 $coldisplay++;
98 }
99} else {
100 print '<td colspan="3"></td>';
101 $coldisplay = $coldisplay + 3;
102}
103
104if ($action == 'selectlines') { ?>
105 <td class="linecolcheck center"><input type="checkbox" class="linecheckbox" name="line_checkbox[<?php print $i + 1; ?>]" value="<?php print $line->id; ?>"></td>
106<?php }
107
108print "</tr>\n";
109
110print "<!-- 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:137
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:140