33 if (empty($object) || !is_object($object)) {
34 print "Error: this template page cannot be called directly as an URL";
39 global $forceall, $forcetoshowtitlelines;
41 if (empty($forceall)) $forceall = 0;
51 print "<!-- BEGIN PHP TEMPLATE objectline_create.tpl.php -->\n";
53 $nolinesbefore = (count($this->lines) == 0 || $forcetoshowtitlelines);
55 print '<tr class="liste_titre nodrag nodrop">';
56 if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
57 print '<td class="linecolnum center"></td>';
59 print '<td class="linecoldescription minwidth500imp">';
60 print '<div id="add"></div><span class="hideonsmartphone">'.$langs->trans(
'AddNewLine').
'</span>';
62 print '<td class="linecolqty right">'.$langs->trans(
'Qty').
'</td>';
63 if (!empty($conf->global->PRODUCT_USE_UNITS))
65 print '<td class="linecoluseunit left">';
66 print '<span id="title_units">';
67 print $langs->trans(
'Unit');
70 print '<td class="linecolqtyfrozen right">'.$form->textwithpicto($langs->trans(
'QtyFrozen'), $langs->trans(
"QuantityConsumedInvariable")).
'</td>';
71 print '<td class="linecoldisablestockchange right">'.$form->textwithpicto($langs->trans(
'DisableStockChange'), $langs->trans(
'DisableStockChangeHelp')).
'</td>';
72 print '<td class="linecollost right">'.$form->textwithpicto($langs->trans(
'ManufacturingEfficiency'), $langs->trans(
'ValueOfMeansLoss')).
'</td>';
73 print '<td class="linecoledit" colspan="'.$colspan.
'"> </td>';
76 print '<tr class="pair nodrag nodrop nohoverpair'.(($nolinesbefore || $object->element ==
'contrat') ?
'' :
' liste_titre_create').
'">';
80 if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
82 echo
'<td class="bordertop nobottom linecolnum center"></td>';
86 print '<td class="bordertop nobottom linecoldescription minwidth500imp">';
89 if (!empty($conf->product->enabled) || !empty($conf->service->enabled))
91 if ($forceall >= 0 && $freelines) echo
'<br>';
92 echo
'<span class="prod_entry_mode_predef">';
94 if (!empty($object->element) && $object->element ==
'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $filtertype =
'1';
97 if (!empty($conf->global->ENTREPOT_EXTRA_STATUS))
100 $form->select_produits(
GETPOST(
'idprod',
'int'),
'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2,
'', 1, array(), $buyer->id,
'1', 0,
'maxwidth500', 0,
'warehouseopen,warehouseinternal',
GETPOST(
'combinations',
'array'));
102 $form->select_produits(
GETPOST(
'idprod',
'int'),
'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2,
'', 1, array(), $buyer->id,
'1', 0,
'maxwidth500', 0,
'',
GETPOST(
'combinations',
'array'));
109 print '<td class="bordertop nobottom linecolqty right"><input type="text" size="2" name="qty" id="qty" class="flat right" value="'.(GETPOSTISSET(
"qty") ?
GETPOST(
"qty",
'alpha', 2) : 1).
'">';
112 if (!empty($conf->global->PRODUCT_USE_UNITS))
115 print '<td class="nobottom linecoluseunit left">';
120 print '<td class="bordertop nobottom linecolqtyfrozen right"><input type="checkbox" name="qty_frozen" id="qty_frozen" class="flat right" value="1"'.(GETPOST(
"qty_frozen",
'alpha') ?
' checked="checked"' :
'').
'>';
124 print
'<td class="bordertop nobottom linecoldisablestockchange right"><input type="checkbox" name="disable_stock_change" id="disable_stock_change" class="flat right" value="1"'.(GETPOST(
"disable_stock_change",
'alpha') ?
' checked="checked"' :
'').
'">';
128 print
'<td class="bordertop nobottom nowrap linecollost right">';
129 print
'<input type="text" size="1" name="efficiency" id="efficiency" class="flat right" value="'.(GETPOSTISSET(
"efficiency") ?
GETPOST(
"efficiency",
'alpha') : 1).
'">';
133 print
'<td class="bordertop nobottom nowrap linecolcost right">';
137 $coldisplay += $colspan;
138 print
'<td class="bordertop nobottom linecoledit center valignmiddle" colspan="'.$colspan.
'">';
139 print
'<input type="submit" class="button" value="'.$langs->trans(
'Add').
'" name="addline" id="addline">';
143 if (is_object($objectline)) {
144 print $objectline->showOptionals($extrafields,
'edit', array(
'style'=>$bcnd[$var],
'colspan'=>$coldisplay),
'',
'', 1);
151 jQuery(document).ready(
function() {
153 $(
"#idprod").change(
function()
155 console.log(
"#idprod change triggered");
158 if (jQuery(
'#idprod').val() > 0)
161 jQuery(
'#dp_desc').focus();
163 if (typeof CKEDITOR ==
"object" && typeof CKEDITOR.instances !=
"undefined")
165 var editor = CKEDITOR.instances[
'dp_desc'];
166 if (editor) { editor.focus(); }
174 <!-- END PHP TEMPLATE objectline_create.tpl.php -->
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
$conf db
API class for accounts.
print
Draft customers invoices.