dolibarr 22.0.5
productattributevalueline_edit.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) 2025 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 * $seller, $buyer
24 * $dateSelector
25 * $forceall (0 by default, 1 for supplier invoices/orders)
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 * $canchangeproduct (0 by default, 1 to allow to change the product if it is a predefined product)
29 */
30
45'
46@phan-var-force string $action
47@phan-var-force int $i
48@phan-var-force int $num
49';
50
51// Protection to avoid direct call of template
52if (empty($object) || !is_object($object)) {
53 print "Error, template page can't be called as URL";
54 exit(1);
55}
56
57// Define colspan for the button 'Add'
58$colspan = 3; // Column: col edit + col delete + move button
59
60print "<!-- BEGIN PHP TEMPLATE productattributevalueline_edit.tpl.php -->\n";
61
62$coldisplay = 0;
63?>
64<tr class="oddeven tredited">
65<?php if (getDolGlobalString('MAIN_VIEW_LINE_NUMBER')) { ?>
66 <td class="linecolnum center"><?php $coldisplay++; ?><?php echo($i + 1); ?></td>
67<?php }
68
69$coldisplay++;
70?>
71 <td class="nobottom linecolref">
72 <div id="line_<?php echo $line->id; ?>"></div>
73 <input type="hidden" name="lineid" value="<?php echo $line->id; ?>">
74
75 <?php $coldisplay++; ?>
76 <input type="text" name="line_ref" id="line_ref" class="flat" value="<?php echo(GETPOSTISSET("line_ref") ? GETPOST("line_ref", 'alpha', 2) : $line->ref); ?>">
77 <?php
78 if (is_object($hookmanager)) {
79 $parameters = array('line' => $line);
80 $reshook = $hookmanager->executeHooks('formEditProductOptions', $parameters, $object, $action);
81 if (!empty($hookmanager->resPrint)) {
82 print $hookmanager->resPrint;
83 }
84 }
85 ?>
86 </td>
87
88 <td class="nobottom linecolvalue"><?php $coldisplay++; ?>
89 <input type="text" name="line_value" id="line_value" class="flat" value="<?php echo(GETPOSTISSET("line_value") ? GETPOST("line_value", 'alpha', 2) : $line->value); ?>">
90 </td>
91
92 <!-- colspan for this td because it replace td for buttons+... -->
93 <td class="center valignmiddle" colspan="<?php echo $colspan; ?>"><?php $coldisplay += $colspan; ?>
94 <input type="submit" class="button buttongen marginbottomonly button-save" id="savelinebutton marginbottomonly" name="save" value="<?php echo $langs->trans("Save"); ?>"><br>
95 <input type="submit" class="button buttongen marginbottomonly button-cancel" id="cancellinebutton" name="cancel" value="<?php echo $langs->trans("Cancel"); ?>">
96 </td>
97</tr>
98
99<!-- END PHP TEMPLATE productattributevalueline_edit.tpl.php -->
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:67
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
if(preg_match('/(crypted|dolcrypt):/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
Definition repair.php:158
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:161