dolibarr 21.0.0-beta
productattributevalueline_create.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 * $dateSelector
23 * $forceall (0 by default, 1 for supplier invoices/orders)
24 * $senderissupplier (0 by default, 1 or 2 for supplier invoices/orders)
25 * $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax)
26 */
27
37// Protection to avoid direct call of template
38if (empty($object) || !is_object($object)) {
39 print "Error: this template page cannot be called directly as an URL";
40 exit;
41}
42
43'@phan-var-force CommonObject $object
44 @phan-var-force CommonObject $this';
45
46global $forcetoshowtitlelines;
47
48// Define colspan for the button 'Add'
49$colspan = 3; // Columns: col edit + col delete + move button
50
51// Lines for extrafield
52$objectline = null;
53
54print "<!-- BEGIN PHP TEMPLATE productattributevalueline_create.tpl.php -->\n";
55$nolinesbefore = (count($this->lines) == 0 || $forcetoshowtitlelines);
56?>
57<tr class="pair nodrag nodrop nohoverpair<?php echo $nolinesbefore ? '' : ' liste_titre_create'; ?>">
58 <?php
59 $coldisplay = 0;
60 // Adds a line numbering column
61 if (getDolGlobalString('MAIN_VIEW_LINE_NUMBER')) {
62 $coldisplay++;
63 echo '<td class="nobottom linecolnum center"></td>';
64 }
65 $coldisplay++;
66 ?>
67 <td class="nobottom linecolref">
68 <?php $coldisplay++; if ($nolinesbefore) {
69 echo $langs->trans('Ref') . ': ';
70 } ?>
71 <input type="text" name="line_ref" id="line_ref" class="flat" value="<?php echo(GETPOSTISSET("line_ref") ? GETPOST("line_ref", 'alpha', 2) : ''); ?>" autofocus>
72 <?php
73 if (is_object($hookmanager)) {
74 $parameters = array();
75 $reshook = $hookmanager->executeHooks('formCreateValueOptions', $parameters, $object, $action);
76 if (!empty($hookmanager->resPrint)) {
77 print $hookmanager->resPrint;
78 }
79 }
80 ?>
81 </td>
82
83 <td class="nobottom linecolvalue"><?php $coldisplay++; ?>
84 <input type="text" name="line_value" id="line_value" class="flat" value="<?php echo(GETPOSTISSET("line_value") ? GETPOST("line_value", 'alpha', 2) : ''); ?>">
85 </td>
86
87 <td class="nobottom linecoledit center valignmiddle" colspan="<?php echo $colspan; ?>"><?php $coldisplay += $colspan; ?>
88 <input type="submit" class="button reposition small" value="<?php echo $langs->trans('Add'); ?>" name="addline" id="addline">
89 </td>
90</tr>
91
92<!-- END PHP TEMPLATE productattributevalueline_create.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