@@ -134,15 +134,15 @@ discard block |
||
134 | 134 | |
135 | 135 | foreach ($object->multilangs as $key => $value) { // enregistrement des nouvelles valeurs dans l'objet |
136 | 136 | if ($key == $current_lang) { |
137 | - $object->label = GETPOST("libelle-" . $key); |
|
138 | - $object->description = dol_htmlcleanlastbr(GETPOST("desc-" . $key, 'restricthtml')); |
|
139 | - $object->other = dol_htmlcleanlastbr(GETPOST("other-" . $key, 'restricthtml')); |
|
137 | + $object->label = GETPOST("libelle-".$key); |
|
138 | + $object->description = dol_htmlcleanlastbr(GETPOST("desc-".$key, 'restricthtml')); |
|
139 | + $object->other = dol_htmlcleanlastbr(GETPOST("other-".$key, 'restricthtml')); |
|
140 | 140 | |
141 | 141 | $object->update($object->id, $user); |
142 | 142 | } else { |
143 | - $object->multilangs[$key]["label"] = GETPOST("libelle-" . $key); |
|
144 | - $object->multilangs[$key]["description"] = dol_htmlcleanlastbr(GETPOST("desc-" . $key, 'restricthtml')); |
|
145 | - $object->multilangs[$key]["other"] = dol_htmlcleanlastbr(GETPOST("other-" . $key, 'restricthtml')); |
|
143 | + $object->multilangs[$key]["label"] = GETPOST("libelle-".$key); |
|
144 | + $object->multilangs[$key]["description"] = dol_htmlcleanlastbr(GETPOST("desc-".$key, 'restricthtml')); |
|
145 | + $object->multilangs[$key]["other"] = dol_htmlcleanlastbr(GETPOST("other-".$key, 'restricthtml')); |
|
146 | 146 | } |
147 | 147 | } |
148 | 148 | |
@@ -235,9 +235,9 @@ discard block |
||
235 | 235 | if (empty($reshook)) { |
236 | 236 | if ($action == '') { |
237 | 237 | if ($user->hasRight('produit', 'creer') || $user->hasRight('service', 'creer')) { |
238 | - print '<a class="butAction" href="' . DOL_URL_ROOT . '/product/traduction.php?action=add&token='.newToken().'&id=' . $object->id . '">' . $langs->trans("Add") . '</a>'; |
|
238 | + print '<a class="butAction" href="'.DOL_URL_ROOT.'/product/traduction.php?action=add&token='.newToken().'&id='.$object->id.'">'.$langs->trans("Add").'</a>'; |
|
239 | 239 | if ($cnt_trans > 0) { |
240 | - print '<a class="butAction" href="' . DOL_URL_ROOT . '/product/traduction.php?action=edit&token='.newToken().'&id=' . $object->id . '">' . $langs->trans("Modify") . '</a>'; |
|
240 | + print '<a class="butAction" href="'.DOL_URL_ROOT.'/product/traduction.php?action=edit&token='.newToken().'&id='.$object->id.'">'.$langs->trans("Modify").'</a>'; |
|
241 | 241 | } |
242 | 242 | } |
243 | 243 | } |
@@ -155,7 +155,7 @@ |
||
155 | 155 | )); |
156 | 156 | |
157 | 157 | // Retrieve all extrafields if not already not know (should not happen) |
158 | - if (! is_object($extrafields)) { |
|
158 | + if (!is_object($extrafields)) { |
|
159 | 159 | $extrafields = new ExtraFields($this->db); |
160 | 160 | $extrafields->fetch_name_optionals_label($product->table_element); |
161 | 161 | } |
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | $socid = GETPOST('socid', 'int'); |
47 | 47 | $type = GETPOST('type', 'int'); |
48 | 48 | $mode = GETPOST('mode', 'int'); |
49 | -$status = ((GETPOST('status', 'int') >= 0) ? GETPOST('status', 'int') : - 1); // status buy when mode = customer , status purchase when mode = supplier |
|
50 | -$status_purchase = ((GETPOST('status_purchase', 'int') >= 0) ? GETPOST('status_purchase', 'int') : - 1); // status purchase when mode = customer |
|
49 | +$status = ((GETPOST('status', 'int') >= 0) ? GETPOST('status', 'int') : - 1); // status buy when mode = customer , status purchase when mode = supplier |
|
50 | +$status_purchase = ((GETPOST('status_purchase', 'int') >= 0) ? GETPOST('status_purchase', 'int') : - 1); // status purchase when mode = customer |
|
51 | 51 | $outjson = (GETPOST('outjson', 'int') ? GETPOST('outjson', 'int') : 0); |
52 | 52 | $price_level = GETPOST('price_level', 'int'); |
53 | 53 | $action = GETPOST('action', 'aZ09'); |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | // Multiprice (1 price per level) |
162 | 162 | if (!$found && isset($price_level) && $price_level >= 1 && (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))) { // If we need a particular price level (from 1 to 6) |
163 | 163 | $sql = "SELECT price, price_ttc, price_base_type,"; |
164 | - $sql .= " tva_tx, default_vat_code"; // Vat rate and code will be used if PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL is on. |
|
164 | + $sql .= " tva_tx, default_vat_code"; // Vat rate and code will be used if PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL is on. |
|
165 | 165 | $sql .= " FROM ".MAIN_DB_PREFIX."product_price "; |
166 | 166 | $sql .= " WHERE fk_product = ".((int) $id); |
167 | 167 | $sql .= " AND entity IN (".getEntity('productprice').")"; |
@@ -174,12 +174,12 @@ discard block |
||
174 | 174 | $objp = $db->fetch_object($result); |
175 | 175 | if ($objp) { |
176 | 176 | $found = true; |
177 | - $outprice_ht = price($objp->price); // formated for langage user because is inserted into input field |
|
178 | - $outprice_ttc = price($objp->price_ttc); // formated for langage user because is inserted into input field |
|
177 | + $outprice_ht = price($objp->price); // formated for langage user because is inserted into input field |
|
178 | + $outprice_ttc = price($objp->price_ttc); // formated for langage user because is inserted into input field |
|
179 | 179 | $outpricebasetype = $objp->price_base_type; |
180 | 180 | if (!empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) { |
181 | - $outtva_tx_formated = price($objp->tva_tx); // formated for langage user because is inserted into input field |
|
182 | - $outtva_tx = price2num($objp->tva_tx); // international numeric |
|
181 | + $outtva_tx_formated = price($objp->tva_tx); // formated for langage user because is inserted into input field |
|
182 | + $outtva_tx = price2num($objp->tva_tx); // international numeric |
|
183 | 183 | $outdefault_vat_code = $objp->default_vat_code; |
184 | 184 | } else { |
185 | 185 | // The common and default behaviour. |
@@ -223,8 +223,8 @@ discard block |
||
223 | 223 | } |
224 | 224 | |
225 | 225 | // VAT to use and default VAT for product are set to same value by default |
226 | - $product_outtva_tx_formated = $outtva_tx_formated; |
|
227 | - $product_outtva_tx = $outtva_tx; |
|
226 | + $product_outtva_tx_formated = $outtva_tx_formated; |
|
227 | + $product_outtva_tx = $outtva_tx; |
|
228 | 228 | $product_outdefault_vat_code = $outdefault_vat_code; |
229 | 229 | |
230 | 230 | // If we ask the price according to buyer, we change it. |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | $tmpvatwithcode = get_default_tva($mysoc, $thirdparty_buyer, $id, 0); |
236 | 236 | |
237 | 237 | if (!is_numeric($tmpvatwithcode) || $tmpvatwithcode != -1) { |
238 | - $reg =array(); |
|
238 | + $reg = array(); |
|
239 | 239 | if (preg_match('/(.+)\s\((.+)\)/', $tmpvatwithcode, $reg)) { |
240 | 240 | $outtva_tx = price2num($reg[1]); |
241 | 241 | $outtva_tx_formated = price($outtva_tx); |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | $match = preg_grep('/('.preg_quote($htmlname, '/').'[0-9]+)/', array_keys($_GET)); |
293 | 293 | sort($match); |
294 | 294 | |
295 | - $idprod = (empty($match[0]) ? '' : $match[0]); // Take first key found into GET array with matching $htmlname123 |
|
295 | + $idprod = (empty($match[0]) ? '' : $match[0]); // Take first key found into GET array with matching $htmlname123 |
|
296 | 296 | |
297 | 297 | if (GETPOST($htmlname, 'alpha') == '' && (!$idprod || !GETPOST($idprod, 'alpha'))) { |
298 | 298 | print json_encode(array()); |
@@ -246,7 +246,7 @@ |
||
246 | 246 | $supplierinvoicestatic->id = $objp->facid; |
247 | 247 | $supplierinvoicestatic->ref = $objp->ref; |
248 | 248 | $supplierinvoicestatic->ref_supplier = $objp->ref_supplier; |
249 | - $supplierinvoicestatic->libelle = $objp->label; // deprecated |
|
249 | + $supplierinvoicestatic->libelle = $objp->label; // deprecated |
|
250 | 250 | $supplierinvoicestatic->label = $objp->label; |
251 | 251 | $supplierinvoicestatic->total_ht = $objp->total_ht; |
252 | 252 | $supplierinvoicestatic->total_ttc = $objp->total_ttc; |
@@ -113,10 +113,10 @@ discard block |
||
113 | 113 | $filefound = 0; |
114 | 114 | $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); |
115 | 115 | foreach ($dirmodels as $reldir) { |
116 | - $file = dol_buildpath($reldir . "core/modules/product_batch/doc/pdf_" . $modele . ".modules.php", 0); |
|
116 | + $file = dol_buildpath($reldir."core/modules/product_batch/doc/pdf_".$modele.".modules.php", 0); |
|
117 | 117 | if (file_exists($file)) { |
118 | 118 | $filefound = 1; |
119 | - $classname = "pdf_" . $modele; |
|
119 | + $classname = "pdf_".$modele; |
|
120 | 120 | break; |
121 | 121 | } |
122 | 122 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | $module = new $classname($db); |
128 | 128 | |
129 | 129 | if ($module->write_file($product_batch, $langs) > 0) { |
130 | - header("Location: " . DOL_URL_ROOT . "/document.php?modulepart=product_batch&file=SPECIMEN.pdf"); |
|
130 | + header("Location: ".DOL_URL_ROOT."/document.php?modulepart=product_batch&file=SPECIMEN.pdf"); |
|
131 | 131 | return; |
132 | 132 | } else { |
133 | 133 | setEventMessages($module->error, $module->errors, 'errors'); |
@@ -364,9 +364,9 @@ discard block |
||
364 | 364 | // Module to build doc |
365 | 365 | $def = array(); |
366 | 366 | $sql = "SELECT nom"; |
367 | -$sql .= " FROM " . MAIN_DB_PREFIX . "document_model"; |
|
368 | -$sql .= " WHERE type = '" . $db->escape($type) . "'"; |
|
369 | -$sql .= " AND entity = " . $conf->entity; |
|
367 | +$sql .= " FROM ".MAIN_DB_PREFIX."document_model"; |
|
368 | +$sql .= " WHERE type = '".$db->escape($type)."'"; |
|
369 | +$sql .= " AND entity = ".$conf->entity; |
|
370 | 370 | $resql = $db->query($sql); |
371 | 371 | if ($resql) { |
372 | 372 | $i = 0; |
@@ -387,19 +387,19 @@ discard block |
||
387 | 387 | print '<div class="div-table-responsive-no-min">'; |
388 | 388 | print '<table class="noborder centpercent">'; |
389 | 389 | print '<tr class="liste_titre">'; |
390 | -print '<td>' . $langs->trans("Name") . '</td>'; |
|
391 | -print '<td>' . $langs->trans("Description") . '</td>'; |
|
392 | -print '<td class="center" width="60">' . $langs->trans("Status") . "</td>\n"; |
|
393 | -print '<td class="center" width="60">' . $langs->trans("Default") . "</td>\n"; |
|
390 | +print '<td>'.$langs->trans("Name").'</td>'; |
|
391 | +print '<td>'.$langs->trans("Description").'</td>'; |
|
392 | +print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n"; |
|
393 | +print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n"; |
|
394 | 394 | print '<td class="center"></td>'; |
395 | -print '<td class="center" width="80">' . $langs->trans("Preview") . '</td>'; |
|
395 | +print '<td class="center" width="80">'.$langs->trans("Preview").'</td>'; |
|
396 | 396 | print "</tr>\n"; |
397 | 397 | |
398 | 398 | clearstatcache(); |
399 | 399 | |
400 | 400 | foreach ($dirmodels as $reldir) { |
401 | 401 | foreach (array('', '/doc') as $valdir) { |
402 | - $dir = dol_buildpath($reldir . "core/modules/product_batch" . $valdir); |
|
402 | + $dir = dol_buildpath($reldir."core/modules/product_batch".$valdir); |
|
403 | 403 | if (is_dir($dir)) { |
404 | 404 | $handle = opendir($dir); |
405 | 405 | if (is_resource($handle)) { |
@@ -411,11 +411,11 @@ discard block |
||
411 | 411 | |
412 | 412 | foreach ($filelist as $file) { |
413 | 413 | if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) { |
414 | - if (file_exists($dir . '/' . $file)) { |
|
414 | + if (file_exists($dir.'/'.$file)) { |
|
415 | 415 | $name = substr($file, 4, dol_strlen($file) - 16); |
416 | 416 | $classname = substr($file, 0, dol_strlen($file) - 12); |
417 | 417 | |
418 | - require_once $dir . '/' . $file; |
|
418 | + require_once $dir.'/'.$file; |
|
419 | 419 | $module = new $classname($db); |
420 | 420 | |
421 | 421 | $modulequalified = 1; |
@@ -439,14 +439,14 @@ discard block |
||
439 | 439 | |
440 | 440 | // Active |
441 | 441 | if (in_array($name, $def)) { |
442 | - print '<td class="center">' . "\n"; |
|
443 | - print '<a href="' . $_SERVER["PHP_SELF"] . '?action=del&token=' . newToken() . '&value=' . urlencode($name) . '">'; |
|
442 | + print '<td class="center">'."\n"; |
|
443 | + print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'">'; |
|
444 | 444 | print img_picto($langs->trans("Enabled"), 'switch_on'); |
445 | 445 | print '</a>'; |
446 | 446 | print '</td>'; |
447 | 447 | } else { |
448 | - print '<td class="center">' . "\n"; |
|
449 | - print '<a href="' . $_SERVER["PHP_SELF"] . '?action=set&token=' . newToken() . '&value=' . urlencode($name) . '&scan_dir=' . urlencode($module->scandir) . '&label=' . urlencode($module->name) . '">' . img_picto($langs->trans("Disabled"), 'switch_off') . '</a>'; |
|
448 | + print '<td class="center">'."\n"; |
|
449 | + print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; |
|
450 | 450 | print "</td>"; |
451 | 451 | } |
452 | 452 | |
@@ -455,19 +455,19 @@ discard block |
||
455 | 455 | if (getDolGlobalString('PRODUCT_BATCH_ADDON_PDF') == $name) { |
456 | 456 | print img_picto($langs->trans("Default"), 'on'); |
457 | 457 | } else { |
458 | - print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setdoc&token=' . newToken() . '&value=' . urlencode($name) . '&scan_dir=' . urlencode($module->scandir) . '&label=' . urlencode($module->name) . '" alt="' . $langs->trans("Default") . '">' . img_picto($langs->trans("Disabled"), 'off') . '</a>'; |
|
458 | + print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>'; |
|
459 | 459 | } |
460 | 460 | print '</td>'; |
461 | 461 | |
462 | 462 | // Info |
463 | - $htmltooltip = '' . $langs->trans("Name") . ': ' . $module->name; |
|
464 | - $htmltooltip .= '<br>' . $langs->trans("Type") . ': ' . ($module->type ? $module->type : $langs->trans("Unknown")); |
|
463 | + $htmltooltip = ''.$langs->trans("Name").': '.$module->name; |
|
464 | + $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown")); |
|
465 | 465 | if ($module->type == 'pdf') { |
466 | - $htmltooltip .= '<br>' . $langs->trans("Width") . '/' . $langs->trans("Height") . ': ' . $module->page_largeur . '/' . $module->page_hauteur; |
|
466 | + $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; |
|
467 | 467 | } |
468 | - $htmltooltip .= '<br><br><u>' . $langs->trans("FeaturesSupported") . ':</u>'; |
|
469 | - $htmltooltip .= '<br>' . $langs->trans("Logo") . ': ' . yn($module->option_logo, 1, 1); |
|
470 | - $htmltooltip .= '<br>' . $langs->trans("MultiLanguage") . ': ' . yn($module->option_multilang, 1, 1); |
|
468 | + $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>'; |
|
469 | + $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); |
|
470 | + $htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); |
|
471 | 471 | |
472 | 472 | |
473 | 473 | print '<td class="center">'; |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | // Preview |
478 | 478 | print '<td class="center">'; |
479 | 479 | if ($module->type == 'pdf') { |
480 | - print '<a href="' . $_SERVER["PHP_SELF"] . '?action=specimen&module=' . $name . '">' . img_object($langs->trans("Preview"), 'contract') . '</a>'; |
|
480 | + print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'contract').'</a>'; |
|
481 | 481 | } else { |
482 | 482 | print img_object($langs->trans("PreviewNotAvailable"), 'generic'); |
483 | 483 | } |
@@ -131,7 +131,7 @@ |
||
131 | 131 | $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); |
132 | 132 | // Thirdparty |
133 | 133 | if (!empty($object->thirdparty)) { |
134 | - $morehtmlref .= '<br>' . $langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1, 'customer'); |
|
134 | + $morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); |
|
135 | 135 | } |
136 | 136 | // Project |
137 | 137 | if (isModEnabled('project')) { |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | |
184 | 184 | if (empty($error)) { |
185 | 185 | $line = new StockTransferLine($db); |
186 | - $records = $line->fetchAll('', '', 0, 0, array('customsql'=>' fk_stocktransfer = '.((int) $id).' AND fk_product = '.((int) $fk_product).' AND fk_warehouse_source = '.((int) $fk_warehouse_source).' AND fk_warehouse_destination = '.((int) $fk_warehouse_destination).' AND ('.(empty($batch) ? 'batch = "" or batch IS NULL' : "batch = '".$db->escape($batch)."'" ).')')); |
|
186 | + $records = $line->fetchAll('', '', 0, 0, array('customsql'=>' fk_stocktransfer = '.((int) $id).' AND fk_product = '.((int) $fk_product).' AND fk_warehouse_source = '.((int) $fk_warehouse_source).' AND fk_warehouse_destination = '.((int) $fk_warehouse_destination).' AND ('.(empty($batch) ? 'batch = "" or batch IS NULL' : "batch = '".$db->escape($batch)."'").')')); |
|
187 | 187 | if (!empty($records[key($records)])) $line = $records[key($records)]; |
188 | 188 | $line->fk_stocktransfer = $id; |
189 | 189 | $line->qty += $qty; |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | // Affichage alerte date prévue de départ si transfert concerné |
369 | 369 | $date_prevue_depart = $object->date_prevue_depart; |
370 | 370 | $date_prevue_depart_plus_delai = $date_prevue_depart; |
371 | -if ($object->lead_time_for_warning > 0) $date_prevue_depart_plus_delai = strtotime(date('Y-m-d', $date_prevue_depart) . ' + '.$object->lead_time_for_warning.' day'); |
|
371 | +if ($object->lead_time_for_warning > 0) $date_prevue_depart_plus_delai = strtotime(date('Y-m-d', $date_prevue_depart).' + '.$object->lead_time_for_warning.' day'); |
|
372 | 372 | if (!empty($date_prevue_depart) && $date_prevue_depart_plus_delai < strtotime(date('Y-m-d'))) { |
373 | 373 | print "$('.valuefield.fieldname_date_prevue_depart').append('"; |
374 | 374 | print img_warning($langs->trans('Alert').' - '.$langs->trans('Late')); |
@@ -437,31 +437,31 @@ discard block |
||
437 | 437 | // Part to edit record |
438 | 438 | if (($id || $ref) && $action == 'edit') { |
439 | 439 | //if($object->status < 3) { |
440 | - print load_fiche_titre($langs->trans("StockTransfer"), '', 'object_' . $object->picto); |
|
440 | + print load_fiche_titre($langs->trans("StockTransfer"), '', 'object_'.$object->picto); |
|
441 | 441 | |
442 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
443 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
442 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
443 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
444 | 444 | print '<input type="hidden" name="action" value="update">'; |
445 | - print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
446 | - if ($backtopage) print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
447 | - if ($backtopageforcancel) print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
445 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
446 | + if ($backtopage) print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
447 | + if ($backtopageforcancel) print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
448 | 448 | |
449 | 449 | print dol_get_fiche_head(); |
450 | 450 | |
451 | - print '<table class="border centpercent tableforfieldedit">' . "\n"; |
|
451 | + print '<table class="border centpercent tableforfieldedit">'."\n"; |
|
452 | 452 | |
453 | 453 | // Common attributes |
454 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php'; |
|
454 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; |
|
455 | 455 | |
456 | 456 | // Other attributes |
457 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php'; |
|
457 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; |
|
458 | 458 | |
459 | 459 | print '</table>'; |
460 | 460 | |
461 | 461 | print dol_get_fiche_end(); |
462 | 462 | |
463 | - print '<div class="center"><input type="submit" class="button" name="save" value="' . $langs->trans("Save") . '">'; |
|
464 | - print ' <input type="submit" class="button" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
463 | + print '<div class="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">'; |
|
464 | + print ' <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
465 | 465 | print '</div>'; |
466 | 466 | |
467 | 467 | print '</form>'; |
@@ -492,28 +492,28 @@ discard block |
||
492 | 492 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); |
493 | 493 | } elseif ($action == 'destock') { // Destock confirmation |
494 | 494 | // Create an array for form |
495 | - $formquestion = array( 'text' => '', |
|
495 | + $formquestion = array('text' => '', |
|
496 | 496 | array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label"), 'value' => $langs->trans('ConfirmDestock', $object->ref), 'size'=>40), |
497 | 497 | array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size'=>25) |
498 | 498 | ); |
499 | 499 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DestockAllProduct'), '', 'confirm_destock', $formquestion, 'yes', 1); |
500 | 500 | } elseif ($action == 'destockcancel') { // Destock confirmation cancel |
501 | 501 | // Create an array for form |
502 | - $formquestion = array( 'text' => '', |
|
502 | + $formquestion = array('text' => '', |
|
503 | 503 | array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label"), 'value' => $langs->trans('ConfirmDestockCancel', $object->ref), 'size'=>40), |
504 | 504 | array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size'=>25) |
505 | 505 | ); |
506 | 506 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DestockAllProductCancel'), '', 'confirm_destockcancel', $formquestion, 'yes', 1); |
507 | 507 | } elseif ($action == 'addstock') { // Addstock confirmation |
508 | 508 | // Create an array for form |
509 | - $formquestion = array( 'text' => '', |
|
509 | + $formquestion = array('text' => '', |
|
510 | 510 | array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label").' :', 'value' => $langs->trans('ConfirmAddStock', $object->ref), 'size'=>40), |
511 | 511 | array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size'=>25) |
512 | 512 | ); |
513 | 513 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('AddStockAllProduct'), '', 'confirm_addstock', $formquestion, 'yes', 1); |
514 | 514 | } elseif ($action == 'addstockcancel') { // Addstock confirmation cancel |
515 | 515 | // Create an array for form |
516 | - $formquestion = array( 'text' => '', |
|
516 | + $formquestion = array('text' => '', |
|
517 | 517 | array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label").' :', 'value' => $langs->trans('ConfirmAddStockCancel', $object->ref), 'size'=>40), |
518 | 518 | array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size'=>25) |
519 | 519 | ); |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | |
539 | 539 | |
540 | 540 | if ($action == 'valid' && $permissiontoadd) { |
541 | - $nextref=$object->getNextNumRef(); |
|
541 | + $nextref = $object->getNextNumRef(); |
|
542 | 542 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('Validate'), $langs->transnoentities('ConfirmValidateStockTransfer', $nextref), 'confirm_validate', $formquestion, 0, 2); |
543 | 543 | } |
544 | 544 | |
@@ -560,25 +560,25 @@ discard block |
||
560 | 560 | |
561 | 561 | // Thirdparty |
562 | 562 | if (isModEnabled('societe')) { |
563 | - $morehtmlref .= $langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '').'<br>'; |
|
563 | + $morehtmlref .= $langs->trans('ThirdParty').' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '').'<br>'; |
|
564 | 564 | } |
565 | 565 | // Project |
566 | 566 | if (isModEnabled('project')) { |
567 | 567 | $langs->load("projects"); |
568 | - $morehtmlref.=$langs->trans('Project') . ' '; |
|
568 | + $morehtmlref .= $langs->trans('Project').' '; |
|
569 | 569 | if ($permissiontoadd) { |
570 | 570 | //if ($action != 'classify') $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> '; |
571 | - $morehtmlref.=' : '; |
|
571 | + $morehtmlref .= ' : '; |
|
572 | 572 | if ($action == 'classify') { |
573 | 573 | //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); |
574 | - $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; |
|
575 | - $morehtmlref.='<input type="hidden" name="action" value="classin">'; |
|
576 | - $morehtmlref.='<input type="hidden" name="token" value="'.newToken().'">'; |
|
577 | - $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); |
|
578 | - $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
579 | - $morehtmlref.='</form>'; |
|
574 | + $morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; |
|
575 | + $morehtmlref .= '<input type="hidden" name="action" value="classin">'; |
|
576 | + $morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
577 | + $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); |
|
578 | + $morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
579 | + $morehtmlref .= '</form>'; |
|
580 | 580 | } else { |
581 | - $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); |
|
581 | + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); |
|
582 | 582 | } |
583 | 583 | } else { |
584 | 584 | if (!empty($object->fk_project)) { |
@@ -606,8 +606,8 @@ discard block |
||
606 | 606 | //unset($object->fields['fk_project']); // Hide field already shown in banner |
607 | 607 | //unset($object->fields['fk_soc']); // Hide field already shown in banner |
608 | 608 | |
609 | - $object->fields['fk_soc']['visible']=0; // Already available in banner |
|
610 | - $object->fields['fk_project']['visible']=0; // Already available in banner |
|
609 | + $object->fields['fk_soc']['visible'] = 0; // Already available in banner |
|
610 | + $object->fields['fk_project']['visible'] = 0; // Already available in banner |
|
611 | 611 | include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; |
612 | 612 | |
613 | 613 | // Incoterms |
@@ -712,7 +712,7 @@ discard block |
||
712 | 712 | |
713 | 713 | $param = ''; |
714 | 714 | |
715 | - $conf->global->MAIN_DISABLE_WRAPPING_ON_COLUMN_TITLE=true; // Full display needed to see all column title details |
|
715 | + $conf->global->MAIN_DISABLE_WRAPPING_ON_COLUMN_TITLE = true; // Full display needed to see all column title details |
|
716 | 716 | |
717 | 717 | print '<tr class="liste_titre">'; |
718 | 718 | print getTitleFieldOfList($langs->trans('ProductRef'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone '); |
@@ -802,11 +802,11 @@ discard block |
||
802 | 802 | print '<input type="submit" class="button buttongen marginbottomonly" id="cancellinebutton" name="cancel" value="'.$langs->trans("Cancel").'"></td>'; |
803 | 803 | } else { |
804 | 804 | print '<td class="right">'; |
805 | - print '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=editline&lineid=' . $line->id . '#line_' . $line->id . '">'; |
|
806 | - print img_edit() . '</a>'; |
|
805 | + print '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=editline&lineid='.$line->id.'#line_'.$line->id.'">'; |
|
806 | + print img_edit().'</a>'; |
|
807 | 807 | print '</td>'; |
808 | 808 | print '<td class="right">'; |
809 | - print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $id . '&action=deleteline&lineid=' . $line->id . '">' . img_delete($langs->trans("Remove")) . '</a>'; |
|
809 | + print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=deleteline&lineid='.$line->id.'">'.img_delete($langs->trans("Remove")).'</a>'; |
|
810 | 810 | print '</td>'; |
811 | 811 | } |
812 | 812 | |
@@ -859,7 +859,7 @@ discard block |
||
859 | 859 | $formproduct->loadWarehouses(); // Pour charger la totalité des entrepôts |
860 | 860 | |
861 | 861 | // On stock ceux qui ne doivent pas être proposés dans la liste |
862 | - $TExcludedWarehouseSource=array(); |
|
862 | + $TExcludedWarehouseSource = array(); |
|
863 | 863 | if (!empty($object->fk_warehouse_source)) { |
864 | 864 | $source_ent = new Entrepot($db); |
865 | 865 | $source_ent->fetch($object->fk_warehouse_source); |
@@ -869,7 +869,7 @@ discard block |
||
869 | 869 | } |
870 | 870 | |
871 | 871 | // On stock ceux qui ne doivent pas être proposés dans la liste |
872 | - $TExcludedWarehouseDestination=array(); |
|
872 | + $TExcludedWarehouseDestination = array(); |
|
873 | 873 | if (!empty($object->fk_warehouse_destination)) { |
874 | 874 | $dest_ent = new Entrepot($db); |
875 | 875 | $dest_ent->fetch($object->fk_warehouse_destination); |
@@ -879,14 +879,14 @@ discard block |
||
879 | 879 | } |
880 | 880 | |
881 | 881 | // On vide le tableau pour qu'il se charge tout seul lors de l'appel à la fonction select_warehouses |
882 | - $formproduct->cache_warehouses=array(); |
|
882 | + $formproduct->cache_warehouses = array(); |
|
883 | 883 | // In warehouse |
884 | 884 | print '<td>'; |
885 | 885 | print $formproduct->selectWarehouses(empty($fk_warehouse_source) ? $object->fk_warehouse_source : $fk_warehouse_source, 'fk_warehouse_source', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, array(), 'minwidth200imp maxwidth200', $TExcludedWarehouseSource); |
886 | 886 | print '</td>'; |
887 | 887 | |
888 | 888 | // On vide le tableau pour qu'il se charge tout seul lors de l'appel à la fonction select_warehouses |
889 | - $formproduct->cache_warehouses=array(); |
|
889 | + $formproduct->cache_warehouses = array(); |
|
890 | 890 | // Out warehouse |
891 | 891 | print '<td>'; |
892 | 892 | print $formproduct->selectWarehouses(empty($fk_warehouse_destination) ? $object->fk_warehouse_destination : $fk_warehouse_destination, 'fk_warehouse_destination', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, array(), 'minwidth200imp maxwidth200', $TExcludedWarehouseDestination); |
@@ -903,7 +903,7 @@ discard block |
||
903 | 903 | // PMP * Qty |
904 | 904 | print '<td></td>'; |
905 | 905 | // Button to add line |
906 | - print '<td class="right" colspan="2"><input type="submit" class="button" name="addline" value="' . dol_escape_htmltag($langs->trans('Add')) . '"></td>'; |
|
906 | + print '<td class="right" colspan="2"><input type="submit" class="button" name="addline" value="'.dol_escape_htmltag($langs->trans('Add')).'"></td>'; |
|
907 | 907 | // Grad and drop lines |
908 | 908 | print '<td></td>'; |
909 | 909 | print '</tr>'; |
@@ -1013,11 +1013,11 @@ discard block |
||
1013 | 1013 | // Documents |
1014 | 1014 | if ($includedocgeneration) { |
1015 | 1015 | $objref = dol_sanitizeFileName($object->ref); |
1016 | - $relativepath = $objref . '/' . $objref . '.pdf'; |
|
1016 | + $relativepath = $objref.'/'.$objref.'.pdf'; |
|
1017 | 1017 | $filedir = $conf->stocktransfer->dir_output.'/'.$object->element.'/'.$objref; |
1018 | - $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; |
|
1019 | - $genallowed = $user->rights->stocktransfer->stocktransfer->read; // If you can read, you can build the PDF to read content |
|
1020 | - $delallowed = $user->rights->stocktransfer->stocktransfer->write; // If you can create/edit, you can remove a file on card |
|
1018 | + $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; |
|
1019 | + $genallowed = $user->rights->stocktransfer->stocktransfer->read; // If you can read, you can build the PDF to read content |
|
1020 | + $delallowed = $user->rights->stocktransfer->stocktransfer->write; // If you can create/edit, you can remove a file on card |
|
1021 | 1021 | print $formfile->showdocuments('stocktransfer:StockTransfer', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang); |
1022 | 1022 | } |
1023 | 1023 |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | if ($productid > 0) { |
155 | 155 | $sql .= " AND ps.fk_product = ".((int) $productid); |
156 | 156 | } |
157 | - if (! empty($search_fk_warehouse)) { |
|
157 | + if (!empty($search_fk_warehouse)) { |
|
158 | 158 | $sql .= " AND ps.fk_entrepot IN (".$db->sanitize(join(",", $search_fk_warehouse)).")"; |
159 | 159 | } |
160 | 160 | if ($search_ref) { |
@@ -562,9 +562,9 @@ discard block |
||
562 | 562 | |
563 | 563 | if ($mode == 'future') { |
564 | 564 | $prod->load_stock('warehouseopen,warehouseinternal,nobatch', 0, $dateendofday); |
565 | - $stock = $prod->stock_theorique; // virtual stock at a date |
|
565 | + $stock = $prod->stock_theorique; // virtual stock at a date |
|
566 | 566 | $prod->load_stock('warehouseopen,warehouseinternal,nobatch', 0); |
567 | - $virtualstock = $prod->stock_theorique; // virtual stock in infinite future |
|
567 | + $virtualstock = $prod->stock_theorique; // virtual stock in infinite future |
|
568 | 568 | } else { |
569 | 569 | $stock = $currentstock; |
570 | 570 | $nbofmovement = 0; |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | /** |
163 | 163 | * Warehouse open and any operations are allowed, but warehouse is not included into calculation of stock. |
164 | 164 | */ |
165 | - const STATUS_OPENEXT_ALL = 3; // TODO Implement this |
|
165 | + const STATUS_OPENEXT_ALL = 3; // TODO Implement this |
|
166 | 166 | |
167 | 167 | |
168 | 168 | |
@@ -652,7 +652,7 @@ discard block |
||
652 | 652 | } |
653 | 653 | $sql .= " WHERE ps.fk_entrepot = ".((int) $this->id); |
654 | 654 | if ($separatedPMP) { |
655 | - $sql .= " AND pa.fk_product = p.rowid AND pa.entity = ". (int) $conf->entity; |
|
655 | + $sql .= " AND pa.fk_product = p.rowid AND pa.entity = ".(int) $conf->entity; |
|
656 | 656 | } |
657 | 657 | $sql .= " AND ps.fk_product = p.rowid"; |
658 | 658 | //print $sql; |
@@ -737,9 +737,9 @@ discard block |
||
737 | 737 | } |
738 | 738 | // show categories for this record only in ajax to not overload lists |
739 | 739 | if (!$nofetch && isModEnabled('categorie')) { |
740 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
740 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
741 | 741 | $form = new Form($this->db); |
742 | - $datas['categories_warehouse'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_WAREHOUSE, 1, 1); |
|
742 | + $datas['categories_warehouse'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_WAREHOUSE, 1, 1); |
|
743 | 743 | } |
744 | 744 | |
745 | 745 | return $datas; |
@@ -805,7 +805,7 @@ discard block |
||
805 | 805 | $label = $langs->trans("Warehouse"); |
806 | 806 | $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; |
807 | 807 | } |
808 | - $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
808 | + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
809 | 809 | $linkclose .= $dataparams.' class="'.$classfortooltip.'"'; |
810 | 810 | } |
811 | 811 |