dolibarr 21.0.0-alpha
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 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 *
19 * Need to have the following variables defined:
20 * $object (invoice, order, ...)
21 * $conf
22 * $langs
23 * $dateSelector
24 * $forceall (0 by default, 1 for supplier invoices/orders)
25 * $element (used to 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 * $disableedit, $disablemove, $disableremove
31 *
32 * $text, $description, $line
33 */
34
35// Protection to avoid direct call of template
36if (empty($object) || !is_object($object)) {
37 print "Error, template page can't be called as URL";
38 exit(1);
39}
40
41'@phan-var-force CommonObject $this
42 @phan-var-force CommonObject $object
43 @phan-var-force int $num';
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++;
61 print $line->value ?></td>
62<?php
63if ($user->hasRight('variants', 'write') && $action != 'selectlines') {
64 print '<td class="linecoledit center width25">';
65 $coldisplay++;
66 if (empty($disableedit)) { ?>
67 <a class="editfielda reposition" href="<?php print $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=editline&token='.newToken().'&lineid='.$line->id.'#line_'.$line->id; ?>">
68 <?php print img_edit(); ?>
69 </a>
70 <?php }
71 print '</td>';
72
73 print '<td class="linecoldelete center width25">';
74 $coldisplay++;
75 if (empty($disableremove)) { // For situation invoice, deletion is not possible if there is a parent company.
76 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&action=ask_deleteline&token='.newToken().'&lineid='.$line->id.'">';
77 print img_delete();
78 print '</a>';
79 }
80 print '</td>';
81
82 if ($num > 1 && $conf->browser->layout != 'phone' && empty($disablemove)) {
83 print '<td class="linecolmove tdlineupdown center width25">';
84 $coldisplay++;
85 if ($i > 0) { ?>
86 <a class="lineupdown reposition" href="<?php print $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=up&token='.newToken().'&rowid='.$line->id; ?>">
87 <?php print img_up('default', 0, 'imgupforline'); ?>
88 </a>
89 <?php }
90 if ($i < $num - 1) { ?>
91 <a class="lineupdown reposition" href="<?php print $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=down&token='.newToken().'&rowid='.$line->id; ?>">
92 <?php print img_down('default', 0, 'imgdownforline'); ?>
93 </a>
94 <?php }
95 print '</td>';
96 } else {
97 print '<td '.(($conf->browser->layout != 'phone' && empty($disablemove)) ? ' class="linecolmove tdlineupdown center"' : ' class="linecolmove center"').'></td>';
98 $coldisplay++;
99 }
100} else {
101 print '<td colspan="3"></td>';
102 $coldisplay += 3;
103}
104
105if ($action == 'selectlines') { ?>
106 <td class="linecolcheck center"><input type="checkbox" class="linecheckbox" name="line_checkbox[<?php print $i + 1; ?>]" value="<?php print $line->id; ?>"></td>
107<?php }
108
109print "</tr>\n";
110
111print "<!-- 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 a 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