@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | $sql = "SELECT t.rowid, t.ref, t.ref_ext"; |
| 191 | 191 | $sql .= " FROM ".$this->db->prefix()."product as t"; |
| 192 | - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_extrafields AS ef ON ef.fk_object = t.rowid"; // So we will be able to filter on extrafields |
|
| 192 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_extrafields AS ef ON ef.fk_object = t.rowid"; // So we will be able to filter on extrafields |
|
| 193 | 193 | if ($category > 0) { |
| 194 | 194 | $sql .= ", ".$this->db->prefix()."categorie_product as c"; |
| 195 | 195 | } |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | //this query will return total products with the filters given |
| 232 | - $sqlTotals = str_replace('SELECT t.rowid, t.ref, t.ref_ext', 'SELECT count(t.rowid) as total', $sql); |
|
| 232 | + $sqlTotals = str_replace('SELECT t.rowid, t.ref, t.ref_ext', 'SELECT count(t.rowid) as total', $sql); |
|
| 233 | 233 | |
| 234 | 234 | $sql .= $this->db->order($sortfield, $sortorder); |
| 235 | 235 | if ($limit) { |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | $obj_ret['pagination'] = array( |
| 293 | 293 | 'total' => (int) $total, |
| 294 | 294 | 'page' => $page, //count starts from 0 |
| 295 | - 'page_count' => ceil((int) $total/$limit), |
|
| 295 | + 'page_count' => ceil((int) $total / $limit), |
|
| 296 | 296 | 'limit' => $limit |
| 297 | 297 | ); |
| 298 | 298 | } |
@@ -1980,7 +1980,7 @@ discard block |
||
| 1980 | 1980 | unset($object->fk_bank); |
| 1981 | 1981 | unset($object->fk_account); |
| 1982 | 1982 | |
| 1983 | - unset($object->supplierprices); // Mut use another API to get them |
|
| 1983 | + unset($object->supplierprices); // Mut use another API to get them |
|
| 1984 | 1984 | |
| 1985 | 1985 | if (empty(DolibarrApiAccess::$user->rights->stock->lire)) { |
| 1986 | 1986 | unset($object->stock_reel); |
@@ -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 | } |
@@ -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')) { |
@@ -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; |
@@ -39,8 +39,8 @@ |
||
| 39 | 39 | |
| 40 | 40 | $id = GETPOST('id', 'int'); |
| 41 | 41 | $ref = GETPOST('ref', 'alpha'); |
| 42 | -$batch = GETPOST('batch', 'alpha'); |
|
| 43 | -$objectid = GETPOST('productid', 'int'); |
|
| 42 | +$batch = GETPOST('batch', 'alpha'); |
|
| 43 | +$objectid = GETPOST('productid', 'int'); |
|
| 44 | 44 | |
| 45 | 45 | // Security check |
| 46 | 46 | $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : '')); |
@@ -39,8 +39,8 @@ |
||
| 39 | 39 | |
| 40 | 40 | $id = GETPOST('id', 'int'); |
| 41 | 41 | $ref = GETPOST('ref', 'alpha'); |
| 42 | -$batch = GETPOST('batch', 'alpha'); |
|
| 43 | -$objectid = GETPOST('productid', 'int'); |
|
| 42 | +$batch = GETPOST('batch', 'alpha'); |
|
| 43 | +$objectid = GETPOST('productid', 'int'); |
|
| 44 | 44 | |
| 45 | 45 | // Security check |
| 46 | 46 | $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : '')); |