dolibarr 21.0.0-beta
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
47// Protection to avoid direct call of template
48if (empty($object) || !is_object($object)) {
49 print "Error, template page can't be called as URL";
50 exit(1);
51}
52
53'@phan-var-force CommonObject $this
54 @phan-var-force CommonObject $object
55 @phan-var-force int $num';
56
57// add html5 elements
58$domData = ' data-element="'.$line->element.'"';
59$domData .= ' data-id="'.$line->id.'"';
60
61$coldisplay = 0;
62?>
63<!-- BEGIN PHP TEMPLATE productattributevalueline_view.tpl.php -->
64<tr id="row-<?php print $line->id?>" class="drag drop oddeven" <?php print $domData; ?> >
65<?php if (getDolGlobalString('MAIN_VIEW_LINE_NUMBER')) { ?>
66 <td class="linecolnum center"><span class="opacitymedium"><?php $coldisplay++; ?><?php print($i + 1); ?></span></td>
67<?php } ?>
68 <td class="linecolref nowrap"><?php $coldisplay++; ?><div id="line_<?php print $line->id; ?>"></div>
69 <?php print $line->ref ?>
70 </td>
71
72 <td class="linecolvalue nowrap"><?php $coldisplay++;
73 print $line->value ?></td>
74<?php
75if ($user->hasRight('variants', 'write') && $action != 'selectlines') {
76 print '<td class="linecoledit center width25">';
77 $coldisplay++;
78 if (empty($disableedit)) { ?>
79 <a class="editfielda reposition" href="<?php print $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=editline&token='.newToken().'&lineid='.$line->id.'#line_'.$line->id; ?>">
80 <?php print img_edit(); ?>
81 </a>
82 <?php }
83 print '</td>';
84
85 print '<td class="linecoldelete center width25">';
86 $coldisplay++;
87 if (empty($disableremove)) { // For situation invoice, deletion is not possible if there is a parent company.
88 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&action=ask_deleteline&token='.newToken().'&lineid='.$line->id.'">';
89 print img_delete();
90 print '</a>';
91 }
92 print '</td>';
93
94 if ($num > 1 && $conf->browser->layout != 'phone' && empty($disablemove)) {
95 print '<td class="linecolmove tdlineupdown center width25">';
96 $coldisplay++;
97 if ($i > 0) { ?>
98 <a class="lineupdown reposition" href="<?php print $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=up&token='.newToken().'&rowid='.$line->id; ?>">
99 <?php print img_up('default', 0, 'imgupforline'); ?>
100 </a>
101 <?php }
102 if ($i < $num - 1) { ?>
103 <a class="lineupdown reposition" href="<?php print $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=down&token='.newToken().'&rowid='.$line->id; ?>">
104 <?php print img_down('default', 0, 'imgdownforline'); ?>
105 </a>
106 <?php }
107 print '</td>';
108 } else {
109 print '<td '.(($conf->browser->layout != 'phone' && empty($disablemove)) ? ' class="linecolmove tdlineupdown center"' : ' class="linecolmove center"').'></td>';
110 $coldisplay++;
111 }
112} else {
113 print '<td colspan="3"></td>';
114 $coldisplay += 3;
115}
116
117if ($action == 'selectlines') { ?>
118 <td class="linecolcheck center"><input type="checkbox" class="linecheckbox" name="line_checkbox[<?php print $i + 1; ?>]" value="<?php print $line->id; ?>"></td>
119<?php }
120
121print "</tr>\n";
122
123print "<!-- END PHP TEMPLATE productattributevalueline_view.tpl.php -->\n";
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:66
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.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
Definition repair.php:149
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:152