dolibarr 21.0.0-beta
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 *
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 the following variables defined:
19 * $object (invoice, order, ...)
20 * $conf
21 * $langs
22 * $seller, $buyer
23 * $dateSelector
24 * $forceall (0 by default, 1 for supplier invoices/orders)
25 * $senderissupplier (0 by default, 1 for supplier invoices/orders)
26 * $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax)
27 * $canchangeproduct (0 by default, 1 to allow to change the product if it is a predefined product)
28 */
29
44// Protection to avoid direct call of template
45if (empty($object) || !is_object($object)) {
46 print "Error, template page can't be called as URL";
47 exit(1);
48}
49
50// Define colspan for the button 'Add'
51$colspan = 3; // Column: col edit + col delete + move button
52
53print "<!-- BEGIN PHP TEMPLATE productattributevalueline_edit.tpl.php -->\n";
54
55$coldisplay = 0;
56?>
57<tr class="oddeven tredited">
58<?php if (getDolGlobalString('MAIN_VIEW_LINE_NUMBER')) { ?>
59 <td class="linecolnum center"><?php $coldisplay++; ?><?php echo($i + 1); ?></td>
60<?php }
61
62$coldisplay++;
63?>
64 <td class="nobottom linecolref">
65 <div id="line_<?php echo $line->id; ?>"></div>
66 <input type="hidden" name="lineid" value="<?php echo $line->id; ?>">
67
68 <?php $coldisplay++; ?>
69 <input type="text" name="line_ref" id="line_ref" class="flat" value="<?php echo(GETPOSTISSET("line_ref") ? GETPOST("line_ref", 'alpha', 2) : $line->ref); ?>">
70 <?php
71 if (is_object($hookmanager)) {
72 $parameters = array('line' => $line);
73 $reshook = $hookmanager->executeHooks('formEditProductOptions', $parameters, $object, $action);
74 if (!empty($hookmanager->resPrint)) {
75 print $hookmanager->resPrint;
76 }
77 }
78 ?>
79 </td>
80
81 <td class="nobottom linecolvalue"><?php $coldisplay++; ?>
82 <input type="text" name="line_value" id="line_value" class="flat" value="<?php echo(GETPOSTISSET("line_value") ? GETPOST("line_value", 'alpha', 2) : $line->value); ?>">
83 </td>
84
85 <!-- colspan for this td because it replace td for buttons+... -->
86 <td class="center valignmiddle" colspan="<?php echo $colspan; ?>"><?php $coldisplay += $colspan; ?>
87 <input type="submit" class="button buttongen marginbottomonly button-save" id="savelinebutton marginbottomonly" name="save" value="<?php echo $langs->trans("Save"); ?>"><br>
88 <input type="submit" class="button buttongen marginbottomonly button-cancel" id="cancellinebutton" name="cancel" value="<?php echo $langs->trans("Cancel"); ?>">
89 </td>
90</tr>
91
92<!-- END PHP TEMPLATE productattributevalueline_edit.tpl.php -->
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:66
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
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