dolibarr 19.0.4
objectline_edit.tpl.php
1<?php
2/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
3 * Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
5 * Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
6 * Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
7 * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
8 * Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 *
23 * Need to have following variables defined:
24 * $object (invoice, order, ...)
25 * $conf
26 * $langs
27 * $seller, $buyer
28 * $dateSelector
29 * $forceall (0 by default, 1 for supplier invoices/orders)
30 * $senderissupplier (0 by default, 1 for supplier invoices/orders)
31 * $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax)
32 */
33
34require_once DOL_DOCUMENT_ROOT."/product/class/html.formproduct.class.php";
35
36
37// Protection to avoid direct call of template
38if (empty($object) || !is_object($object)) {
39 print "Error, template page can't be called as URL";
40 exit;
41}
42
43
44global $forceall, $filtertype;
45
46if (empty($forceall)) {
47 $forceall = 0;
48}
49
50if (empty($filtertype)) {
51 $filtertype = 0;
52}
53
54$formproduct = new FormProduct($object->db);
55
56
57// Define colspan for the button 'Add'
58$colspan = 3; // Columns: total ht + col edit + col delete
59
60// Lines for extrafield
61$objectline = new BOMLine($this->db);
62
63print "<!-- BEGIN PHP TEMPLATE objectline_edit.tpl.php -->\n";
64
65$coldisplay = 0;
66print '<tr class="oddeven tredited">';
67// Adds a line numbering column
68if (getDolGlobalString('MAIN_VIEW_LINE_NUMBER')) {
69 print '<td class="linecolnum center">'.($i + 1).'</td>';
70 $coldisplay++;
71}
72
73$coldisplay++;
74?>
75 <td>
76 <div id="line_<?php echo $line->id; ?>"></div>
77
78 <input type="hidden" name="lineid" value="<?php echo $line->id; ?>">
79 <input type="hidden" id="product_type" name="type" value="<?php echo $line->product_type; ?>">
80 <input type="hidden" id="product_id" name="productid" value="<?php echo(!empty($line->fk_product) ? $line->fk_product : 0); ?>" />
81 <input type="hidden" id="special_code" name="special_code" value="<?php echo $line->special_code; ?>">
82 <input type="hidden" id="fk_parent_line" name="fk_parent_line" value="<?php echo $line->fk_parent_line; ?>">
83
84<?php
85// Predefined product/service
86if ($line->fk_product > 0) {
87 $tmpproduct = new Product($object->db);
88 $tmpproduct->fetch($line->fk_product);
89 print $tmpproduct->getNomUrl(1);
90}
91
92if (is_object($hookmanager)) {
93 $fk_parent_line = (GETPOST('fk_parent_line') ? GETPOST('fk_parent_line') : $line->fk_parent_line);
94 $parameters = array('line'=>$line, 'fk_parent_line'=>$fk_parent_line, 'var'=>$var, 'dateSelector'=>$dateSelector, 'seller'=>$seller, 'buyer'=>$buyer);
95 $reshook = $hookmanager->executeHooks('formEditProductOptions', $parameters, $this, $action);
96}
97
98//Line extrafield
99if (is_object($objectline) && !empty($extrafields)) {
100 $temps = $line->showOptionals($extrafields, 'edit', array('class'=>'tredited'), '', '', 1, 'line');
101 if (!empty($temps)) {
102 print '<div style="padding-top: 10px" id="extrafield_lines_area_edit" name="extrafield_lines_area_edit">';
103 print $temps;
104 print '</div>';
105 }
106}
107
108print '</td>';
109
110/*if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines
111{
112 $coldisplay++;
113?>
114 <td class="right"><input id="fourn_ref" name="fourn_ref" class="flat minwidth75" value="<?php echo ($line->ref_supplier ? $line->ref_supplier : $line->ref_fourn); ?>"></td>
115<?php
116*/
117
118$coldisplay++;
119
120print '<td class="nobottom linecolqty right">';
121if (($line->info_bits & 2) != 2) {
122 // I comment this because it shows info even when not required
123 // for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated
124 // must also not be output for most entities (proposal, intervention, ...)
125 //if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." ";
126 print '<input size="3" type="text" class="flat right" name="qty" id="qty" value="'.$line->qty.'">';
127}
128print '</td>';
129
130if ($filtertype != 1) {
131 if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
132 $coldisplay++;
133 print '<td class="nobottom nowrap linecolunit right">';
134 print $formproduct->selectMeasuringUnits("fk_unit", '', (($line->fk_unit) ? $line->fk_unit : ''), 0, 0);
135 print '</td>';
136 }
137
138 $coldisplay++;
139 print '<td class="nobottom linecolqtyfrozen right"><input type="checkbox" name="qty_frozen" id="qty_frozen" class="flat right" value="1"' . (GETPOSTISSET("qty_frozen") ? (GETPOST('qty_frozen', 'int') ? ' checked="checked"' : '') : ($line->qty_frozen ? ' checked="checked"' : '')) . '>';
140 print '</td>';
141
142 $coldisplay++;
143 print '<td class="nobottom linecoldisablestockchange right"><input type="checkbox" name="disable_stock_change" id="disable_stock_change" class="flat right" value="1"' . (GETPOSTISSET('disablestockchange') ? (GETPOST("disable_stock_change", 'int') ? ' checked="checked"' : '') : ($line->disable_stock_change ? ' checked="checked"' : '')) . '">';
144 print '</td>';
145
146 $coldisplay++;
147 print '<td class="nobottom nowrap linecollost right">';
148 print '<input type="text" size="2" name="efficiency" id="efficiency" class="flat right" value="' . $line->efficiency . '"></td>';
149
150 $coldisplay++;
151 print '<td class="nobottom nowrap linecolcostprice right">';
152 print '</td>';
153} else {
154 $coldisplay++;
155 print '<td class="nobottom nowrap linecolunit right">';
156 print $formproduct->selectMeasuringUnits("fk_unit", "time", ($line->fk_unit) ? $line->fk_unit : '', 0, 0);
157 print '</td>';
158
159 $coldisplay++;
160 print '<td class="nobottom nowrap linecolworkstation right">';
161 print $formproduct->selectWorkstations($line->fk_default_workstation, 'idworkstations', 1);
162 print '</td>';
163
164 $coldisplay++;
165 print '<td class="nobottom nowrap linecolcostprice right">';
166 print '</td>';
167}
168
169$coldisplay += $colspan;
170print '<td class="nobottom linecoledit center valignmiddle" colspan="'.$colspan.'">';
171$coldisplay += $colspan;
172print '<input type="submit" class="reposition button buttongen margintoponly marginbottomonly button-save" id="savelinebutton" name="save" value="'.$langs->trans("Save").'">';
173print '<input type="submit" class="reposition button buttongen margintoponly marginbottomonly button-cancel" id="cancellinebutton" name="cancel" value="'.$langs->trans("Cancel").'">';
174print '</td>';
175print '</tr>';
176
177print "<!-- END PHP TEMPLATE objectline_edit.tpl.php -->\n";
Class for BOMLine.
Class with static methods for building HTML components related to products Only components common to ...
Class to manage products or services.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getDolGlobalString($key, $default='')
Return 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:121
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:124