dolibarr 18.0.6
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)) $filtertype = 0;
51
52$formproduct = new FormProduct($object->db);
53
54
55// Define colspan for the button 'Add'
56$colspan = 3; // Columns: total ht + col edit + col delete
57
58// Lines for extrafield
59$objectline = new BOMLine($this->db);
60
61print "<!-- BEGIN PHP TEMPLATE objectline_edit.tpl.php -->\n";
62
63$coldisplay = 0;
64print '<tr class="oddeven tredited">';
65// Adds a line numbering column
66if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
67 print '<td class="linecolnum center">'.($i + 1).'</td>';
68 $coldisplay++;
69}
70
71$coldisplay++;
72?>
73 <td>
74 <div id="line_<?php echo $line->id; ?>"></div>
75
76 <input type="hidden" name="lineid" value="<?php echo $line->id; ?>">
77 <input type="hidden" id="product_type" name="type" value="<?php echo $line->product_type; ?>">
78 <input type="hidden" id="product_id" name="productid" value="<?php echo (!empty($line->fk_product) ? $line->fk_product : 0); ?>" />
79 <input type="hidden" id="special_code" name="special_code" value="<?php echo $line->special_code; ?>">
80 <input type="hidden" id="fk_parent_line" name="fk_parent_line" value="<?php echo $line->fk_parent_line; ?>">
81
82<?php
83// Predefined product/service
84if ($line->fk_product > 0) {
85 $tmpproduct = new Product($object->db);
86 $tmpproduct->fetch($line->fk_product);
87 print $tmpproduct->getNomUrl(1);
88}
89
90if (is_object($hookmanager)) {
91 $fk_parent_line = (GETPOST('fk_parent_line') ? GETPOST('fk_parent_line') : $line->fk_parent_line);
92 $parameters = array('line'=>$line, 'fk_parent_line'=>$fk_parent_line, 'var'=>$var, 'dateSelector'=>$dateSelector, 'seller'=>$seller, 'buyer'=>$buyer);
93 $reshook = $hookmanager->executeHooks('formEditProductOptions', $parameters, $this, $action);
94}
95
96//Line extrafield
97if (is_object($objectline) && !empty($extrafields)) {
98 $temps = $line->showOptionals($extrafields, 'edit', array('class'=>'tredited'), '', '', 1, 'line');
99 if (!empty($temps)) {
100 print '<div style="padding-top: 10px" id="extrafield_lines_area_edit" name="extrafield_lines_area_edit">';
101 print $temps;
102 print '</div>';
103 }
104}
105
106print '</td>';
107
108/*if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines
109{
110 $coldisplay++;
111?>
112 <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>
113<?php
114*/
115
116$coldisplay++;
117
118print '<td class="nobottom linecolqty right">';
119if (($line->info_bits & 2) != 2) {
120 // I comment this because it shows info even when not required
121 // 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
122 // must also not be output for most entities (proposal, intervention, ...)
123 //if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." ";
124 print '<input size="3" type="text" class="flat right" name="qty" id="qty" value="'.$line->qty.'">';
125}
126print '</td>';
127
128if ($filtertype != 1) {
129 if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
130 $coldisplay++;
131 print '<td class="nobottom linecoluseunit left">';
132 print '</td>';
133 }
134
135 $coldisplay++;
136 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"' : '')) . '>';
137 print '</td>';
138
139 $coldisplay++;
140 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"' : '')) . '">';
141 print '</td>';
142
143 $coldisplay++;
144 print '<td class="nobottom nowrap linecollost right">';
145 print '<input type="text" size="2" name="efficiency" id="efficiency" class="flat right" value="' . $line->efficiency . '"></td>';
146
147 $coldisplay++;
148 print '<td class="nobottom nowrap linecolcostprice right">';
149 print '</td>';
150} else {
151 $coldisplay++;
152 print '<td class="nobottom nowrap linecolunit right">';
153 print $formproduct->selectMeasuringUnits("fk_unit", "time", ($line->fk_unit) ? $line->fk_unit : '', 0, 0);
154 print '</td>';
155
156 $coldisplay++;
157 print '<td class="nobottom nowrap linecolworkstation right">';
158 print '</td>';
159
160 $coldisplay++;
161 print '<td class="nobottom nowrap linecolcostprice right">';
162 print '</td>';
163}
164
165$coldisplay += $colspan;
166print '<td class="nobottom linecoledit center valignmiddle" colspan="'.$colspan.'">';
167$coldisplay += $colspan;
168print '<input type="submit" class="reposition button buttongen margintoponly marginbottomonly button-save" id="savelinebutton" name="save" value="'.$langs->trans("Save").'">';
169print '<input type="submit" class="reposition button buttongen margintoponly marginbottomonly button-cancel" id="cancellinebutton" name="cancel" value="'.$langs->trans("Cancel").'">';
170print '</td>';
171print '</tr>';
172
173print "<!-- 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 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.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
Definition repair.php:120
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:123