dolibarr 21.0.0-alpha
productattributevalueline_create.tpl.php
1<?php
2/* Copyright (C) 2022 Open-Dsi <support@open-dsi.fr>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 *
17 * Need to have the following variables defined:
18 * $object (invoice, order, ...)
19 * $conf
20 * $langs
21 * $dateSelector
22 * $forceall (0 by default, 1 for supplier invoices/orders)
23 * $senderissupplier (0 by default, 1 or 2 for supplier invoices/orders)
24 * $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax)
25 */
26
27// Protection to avoid direct call of template
28if (empty($object) || !is_object($object)) {
29 print "Error: this template page cannot be called directly as an URL";
30 exit;
31}
32
33'@phan-var-force CommonObject $this
34 @phan-var-force CommonObject $this';
35
36global $forcetoshowtitlelines;
37
38// Define colspan for the button 'Add'
39$colspan = 3; // Columns: col edit + col delete + move button
40
41// Lines for extrafield
42$objectline = null;
43
44print "<!-- BEGIN PHP TEMPLATE productattributevalueline_create.tpl.php -->\n";
45$nolinesbefore = (count($this->lines) == 0 || $forcetoshowtitlelines);
46?>
47<tr class="pair nodrag nodrop nohoverpair<?php echo $nolinesbefore ? '' : ' liste_titre_create'; ?>">
48 <?php
49 $coldisplay = 0;
50 // Adds a line numbering column
51 if (getDolGlobalString('MAIN_VIEW_LINE_NUMBER')) {
52 $coldisplay++;
53 echo '<td class="nobottom linecolnum center"></td>';
54 }
55 $coldisplay++;
56 ?>
57 <td class="nobottom linecolref">
58 <?php $coldisplay++; if ($nolinesbefore) {
59 echo $langs->trans('Ref') . ': ';
60 } ?>
61 <input type="text" name="line_ref" id="line_ref" class="flat" value="<?php echo(GETPOSTISSET("line_ref") ? GETPOST("line_ref", 'alpha', 2) : ''); ?>" autofocus>
62 <?php
63 if (is_object($hookmanager)) {
64 $parameters = array();
65 $reshook = $hookmanager->executeHooks('formCreateValueOptions', $parameters, $object, $action);
66 if (!empty($hookmanager->resPrint)) {
67 print $hookmanager->resPrint;
68 }
69 }
70 ?>
71 </td>
72
73 <td class="nobottom linecolvalue"><?php $coldisplay++; ?>
74 <input type="text" name="line_value" id="line_value" class="flat" value="<?php echo(GETPOSTISSET("line_value") ? GETPOST("line_value", 'alpha', 2) : ''); ?>">
75 </td>
76
77 <td class="nobottom linecoledit center valignmiddle" colspan="<?php echo $colspan; ?>"><?php $coldisplay += $colspan; ?>
78 <input type="submit" class="button reposition small" value="<?php echo $langs->trans('Add'); ?>" name="addline" id="addline">
79 </td>
80</tr>
81
82<!-- END PHP TEMPLATE productattributevalueline_create.tpl.php -->
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:58
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:137
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:140