@@ -211,8 +211,8 @@ discard block |
||
| 211 | 211 | $ko++; |
| 212 | 212 | } else { |
| 213 | 213 | if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
| 214 | - $sql_exists = "SELECT rowid FROM " . MAIN_DB_PREFIX . "product_perentity"; |
|
| 215 | - $sql_exists .= " WHERE fk_product = " . ((int) $productid) . " AND entity = " . ((int) $conf->entity); |
|
| 214 | + $sql_exists = "SELECT rowid FROM ".MAIN_DB_PREFIX."product_perentity"; |
|
| 215 | + $sql_exists .= " WHERE fk_product = ".((int) $productid)." AND entity = ".((int) $conf->entity); |
|
| 216 | 216 | $resql_exists = $db->query($sql_exists); |
| 217 | 217 | if (!$resql_exists) { |
| 218 | 218 | $msg .= '<div><span class="error">'.$langs->trans("ErrorDB").' : '.$langs->trans("Product").' '.$productid.' '.$langs->trans("NotVentilatedinAccount").' : id='.$accounting_account_id.'<br> <pre>'.json_encode($resql_exists).'</pre></span></div>'; |
@@ -221,14 +221,14 @@ discard block |
||
| 221 | 221 | $nb_exists = $db->num_rows($resql_exists); |
| 222 | 222 | if ($nb_exists <= 0) { |
| 223 | 223 | // insert |
| 224 | - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "product_perentity (fk_product, entity, " . $db->sanitize($accountancy_field_name) . ")"; |
|
| 225 | - $sql .= " VALUES (" . ((int) $productid) . ", " . ((int) $conf->entity) . ", '" . $db->escape($accounting->account_number) . "')"; |
|
| 224 | + $sql = "INSERT INTO ".MAIN_DB_PREFIX."product_perentity (fk_product, entity, ".$db->sanitize($accountancy_field_name).")"; |
|
| 225 | + $sql .= " VALUES (".((int) $productid).", ".((int) $conf->entity).", '".$db->escape($accounting->account_number)."')"; |
|
| 226 | 226 | } else { |
| 227 | 227 | $obj_exists = $db->fetch_object($resql_exists); |
| 228 | 228 | // update |
| 229 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "product_perentity"; |
|
| 230 | - $sql .= " SET " . $db->sanitize($accountancy_field_name) . " = '" . $db->escape($accounting->account_number) . "'"; |
|
| 231 | - $sql .= " WHERE rowid = " . ((int) $obj_exists->rowid); |
|
| 229 | + $sql = "UPDATE ".MAIN_DB_PREFIX."product_perentity"; |
|
| 230 | + $sql .= " SET ".$db->sanitize($accountancy_field_name)." = '".$db->escape($accounting->account_number)."'"; |
|
| 231 | + $sql .= " WHERE rowid = ".((int) $obj_exists->rowid); |
|
| 232 | 232 | } |
| 233 | 233 | } |
| 234 | 234 | } else { |
@@ -331,17 +331,17 @@ discard block |
||
| 331 | 331 | $sql .= " aa.rowid as aaid"; |
| 332 | 332 | $sql .= " FROM ".MAIN_DB_PREFIX."product as p"; |
| 333 | 333 | if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
| 334 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity); |
|
| 335 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.account_number = ppe." . $db->sanitize($accountancy_field_name) . " AND aa.fk_pcg_version = '" . $db->escape($pcgvercode) . "'"; |
|
| 334 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity); |
|
| 335 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.account_number = ppe.".$db->sanitize($accountancy_field_name)." AND aa.fk_pcg_version = '".$db->escape($pcgvercode)."'"; |
|
| 336 | 336 | } else { |
| 337 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.account_number = p." . $db->sanitize($accountancy_field_name) . " AND aa.fk_pcg_version = '" . $db->escape($pcgvercode) . "'"; |
|
| 337 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.account_number = p.".$db->sanitize($accountancy_field_name)." AND aa.fk_pcg_version = '".$db->escape($pcgvercode)."'"; |
|
| 338 | 338 | } |
| 339 | 339 | if (!empty($searchCategoryProductList)) { |
| 340 | 340 | $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; // We'll need this table joined to the select in order to filter by categ |
| 341 | 341 | } |
| 342 | 342 | $sql .= ' WHERE p.entity IN ('.getEntity('product').')'; |
| 343 | 343 | if (strlen(trim($search_current_account))) { |
| 344 | - $sql .= natural_search((!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED') ? "p." : "ppe.") . $db->sanitize($accountancy_field_name), $search_current_account); |
|
| 344 | + $sql .= natural_search((!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED') ? "p." : "ppe.").$db->sanitize($accountancy_field_name), $search_current_account); |
|
| 345 | 345 | } |
| 346 | 346 | if ($search_current_account_valid == 'withoutvalidaccount') { |
| 347 | 347 | $sql .= " AND aa.account_number IS NULL"; |
@@ -630,7 +630,7 @@ discard block |
||
| 630 | 630 | } else { |
| 631 | 631 | print_liste_field_titre("OnBuy", $_SERVER["PHP_SELF"], "p.tobuy", "", $param, '', $sortfield, $sortorder, 'center '); |
| 632 | 632 | } |
| 633 | - print_liste_field_titre("CurrentDedicatedAccountingAccount", $_SERVER["PHP_SELF"], (!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED') ? "p." : "ppe.") . $accountancy_field_name, "", $param, '', $sortfield, $sortorder); |
|
| 633 | + print_liste_field_titre("CurrentDedicatedAccountingAccount", $_SERVER["PHP_SELF"], (!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED') ? "p." : "ppe.").$accountancy_field_name, "", $param, '', $sortfield, $sortorder); |
|
| 634 | 634 | print_liste_field_titre("AssignDedicatedAccountingAccount"); |
| 635 | 635 | // Action column |
| 636 | 636 | if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
@@ -25,8 +25,8 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | // Load Dolibarr environment |
| 27 | 27 | require_once "../../main.inc.php"; |
| 28 | -require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php"; |
|
| 29 | -require_once DOL_DOCUMENT_ROOT . "/webportal/lib/webportal.lib.php"; |
|
| 28 | +require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; |
|
| 29 | +require_once DOL_DOCUMENT_ROOT."/webportal/lib/webportal.lib.php"; |
|
| 30 | 30 | |
| 31 | 31 | // Translations |
| 32 | 32 | $langs->loadLangs(array("admin", "webportal", "website")); |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | // Parameters |
| 38 | 38 | $action = GETPOST('action', 'aZ09'); |
| 39 | 39 | $backtopage = GETPOST('backtopage', 'alpha'); |
| 40 | -$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
| 40 | +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
| 41 | 41 | |
| 42 | 42 | $value = GETPOST('value', 'alpha'); |
| 43 | 43 | $label = GETPOST('label', 'alpha'); |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | $useFormSetup = 1; |
| 57 | 57 | |
| 58 | 58 | if (!class_exists('FormSetup')) { |
| 59 | - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formsetup.class.php'; |
|
| 59 | + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsetup.class.php'; |
|
| 60 | 60 | } |
| 61 | 61 | $formSetup = new FormSetup($db); |
| 62 | 62 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | $item->nameText = $langs->transnoentities('UrlPublicInterfaceLabelAdmin'); |
| 66 | 66 | $item->fieldAttr = array('placeholder' => 'https://'); |
| 67 | 67 | $item->helpText = $langs->transnoentities('UrlPublicInterfaceHelpAdmin'); |
| 68 | -require_once __DIR__ . '/../class/context.class.php'; |
|
| 68 | +require_once __DIR__.'/../class/context.class.php'; |
|
| 69 | 69 | //$context = Context::getInstance(); |
| 70 | 70 | //$item->fieldOutputOverride = '<a target="_blank" href="'.Context::getRootConfigUrl().'" >'.img_picto('', 'globe', 'class="pictofixedwidth"').Context::getRootConfigUrl().'</a>'; |
| 71 | 71 | |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | * Actions |
| 128 | 128 | */ |
| 129 | 129 | |
| 130 | -include DOL_DOCUMENT_ROOT . '/core/actions_setmoduleoptions.inc.php'; |
|
| 130 | +include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; |
|
| 131 | 131 | |
| 132 | 132 | // Force always edit mode |
| 133 | 133 | if (empty($action) || $action == 'update') { |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | llxHeader('', $langs->trans($title), $help_url); |
| 148 | 148 | |
| 149 | 149 | // Subheader |
| 150 | -$linkback = '<a href="' . ($backtopage ? $backtopage : DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1') . '">' . $langs->trans("BackToModuleList") . '</a>'; |
|
| 150 | +$linkback = '<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1').'">'.$langs->trans("BackToModuleList").'</a>'; |
|
| 151 | 151 | |
| 152 | 152 | print load_fiche_titre($langs->trans($title), $linkback, 'title_setup'); |
| 153 | 153 | |
@@ -188,10 +188,10 @@ discard block |
||
| 188 | 188 | } elseif (!empty($formSetup->items)) { |
| 189 | 189 | print $formSetup->generateOutput(); |
| 190 | 190 | print '<div class="tabsAction">'; |
| 191 | - print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=edit&token=' . newToken() . '">' . $langs->trans("Modify") . '</a>'; |
|
| 191 | + print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>'; |
|
| 192 | 192 | print '</div>'; |
| 193 | 193 | } else { |
| 194 | - print '<br>' . $langs->trans("NothingToSetup"); |
|
| 194 | + print '<br>'.$langs->trans("NothingToSetup"); |
|
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | // Page end |
@@ -37,17 +37,17 @@ |
||
| 37 | 37 | $h = 0; |
| 38 | 38 | $head = array(); |
| 39 | 39 | |
| 40 | - $head[$h][0] = DOL_URL_ROOT . '/webportal/admin/setup.php'; |
|
| 40 | + $head[$h][0] = DOL_URL_ROOT.'/webportal/admin/setup.php'; |
|
| 41 | 41 | $head[$h][1] = $langs->trans("Settings"); |
| 42 | 42 | $head[$h][2] = 'settings'; |
| 43 | 43 | $h++; |
| 44 | 44 | |
| 45 | - $head[$h][0] = DOL_URL_ROOT . '/webportal/admin/setup_theme.php'; |
|
| 45 | + $head[$h][0] = DOL_URL_ROOT.'/webportal/admin/setup_theme.php'; |
|
| 46 | 46 | $head[$h][1] = $langs->trans("SkinAndColors"); |
| 47 | 47 | $head[$h][2] = 'themesettings'; |
| 48 | 48 | $h++; |
| 49 | 49 | |
| 50 | - $head[$h][0] = DOL_URL_ROOT . '/webportal/admin/configcss.php'; |
|
| 50 | + $head[$h][0] = DOL_URL_ROOT.'/webportal/admin/configcss.php'; |
|
| 51 | 51 | $head[$h][1] = $langs->trans("CSSPage"); |
| 52 | 52 | $head[$h][2] = 'css'; |
| 53 | 53 | $h++; |
@@ -633,7 +633,7 @@ discard block |
||
| 633 | 633 | * @param mixed $v Feature information of a product. |
| 634 | 634 | * @return bool |
| 635 | 635 | */ |
| 636 | - static function ($v) { |
|
| 636 | + static function($v) { |
|
| 637 | 637 | return !empty($v); |
| 638 | 638 | } |
| 639 | 639 | ); |
@@ -830,7 +830,7 @@ discard block |
||
| 830 | 830 | |
| 831 | 831 | if ($forced_refvar === false) { |
| 832 | 832 | if (isset($conf->global->PRODUIT_ATTRIBUTES_SEPARATOR)) { |
| 833 | - $newproduct->ref .= getDolGlobalString('PRODUIT_ATTRIBUTES_SEPARATOR') . $prodattrval->ref; |
|
| 833 | + $newproduct->ref .= getDolGlobalString('PRODUIT_ATTRIBUTES_SEPARATOR').$prodattrval->ref; |
|
| 834 | 834 | } else { |
| 835 | 835 | $newproduct->ref .= '_'.$prodattrval->ref; |
| 836 | 836 | } |
@@ -72,10 +72,10 @@ |
||
| 72 | 72 | if (!empty($generatedContent['code']) && $generatedContent['code'] == 429) { |
| 73 | 73 | print "Quota or allowed period exceeded. Retry Later !"; |
| 74 | 74 | } elseif ($generatedContent['code'] >= 400) { |
| 75 | - print "Error : " . $generatedContent['message']; |
|
| 75 | + print "Error : ".$generatedContent['message']; |
|
| 76 | 76 | print '<br><a href="'.DOL_MAIN_URL_ROOT.'/ai/admin/setup.php">'.$langs->trans('ErrorGoToModuleSetup').'</a>'; |
| 77 | 77 | } else { |
| 78 | - print "Error returned by API call: " . $generatedContent['message']; |
|
| 78 | + print "Error returned by API call: ".$generatedContent['message']; |
|
| 79 | 79 | } |
| 80 | 80 | } else { |
| 81 | 81 | print $generatedContent; |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | ]); |
| 130 | 130 | |
| 131 | 131 | $headers = ([ |
| 132 | - 'Authorization: Bearer ' . $this->apiKey, |
|
| 132 | + 'Authorization: Bearer '.$this->apiKey, |
|
| 133 | 133 | 'Content-Type: application/json' |
| 134 | 134 | ]); |
| 135 | 135 | $response = getURLContent($this->apiEndpoint, 'POST', $payload, 1, $headers); |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | throw new Exception('API request failed. No http received'); |
| 139 | 139 | } |
| 140 | 140 | if (!empty($response['http_code']) && $response['http_code'] != 200) { |
| 141 | - throw new Exception('API request failed with status code ' . $response['http_code']); |
|
| 141 | + throw new Exception('API request failed with status code '.$response['http_code']); |
|
| 142 | 142 | } |
| 143 | 143 | // Decode JSON response |
| 144 | 144 | $decodedResponse = json_decode($response['content'], true); |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | |
| 200 | 200 | // Exports |
| 201 | 201 | //-------- |
| 202 | - $r = 0; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 202 | + $r = 0; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 203 | 203 | |
| 204 | 204 | // Export warehouses |
| 205 | 205 | $r++; |
@@ -217,8 +217,8 @@ discard block |
||
| 217 | 217 | 'd.code_departement' => 'List:c_departements:code_departement:code_departement:', 'c.code' => 'List:c_country:code:code:', |
| 218 | 218 | 'e.phone' => 'Text', 'e.fax' => 'Text', 'e.statut' => 'Text', 'pe.rowid' => 'List:entrepot:ref:rowid:stock', 'pe.ref' => 'Text' |
| 219 | 219 | ); |
| 220 | - $this->export_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into export_icon |
|
| 221 | - $this->export_aggregate_array[$r] = array(); // TODO Not used yet |
|
| 220 | + $this->export_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into export_icon |
|
| 221 | + $this->export_aggregate_array[$r] = array(); // TODO Not used yet |
|
| 222 | 222 | $keyforselect = 'warehouse'; |
| 223 | 223 | $keyforelement = 'warehouse'; |
| 224 | 224 | $keyforaliasextra = 'extra'; |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | 'p.datec' => 'product', 'p.tms' => 'product', 'p.pmp' => 'product', 'p.cost_price' => 'product', |
| 266 | 266 | 'ps.reel' => 'stock', |
| 267 | 267 | 'p.seuil_stock_alerte' => 'product', 'p.barcode' => 'product', 'bt.libelle' => 'product', |
| 268 | - ); // We define here only fields that use another icon that the one defined into export_icon |
|
| 268 | + ); // We define here only fields that use another icon that the one defined into export_icon |
|
| 269 | 269 | if (isModEnabled('barcode')) { |
| 270 | 270 | $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.barcode' => 'product')); |
| 271 | 271 | } |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | $this->export_dependencies_array[$r] = array('stock' => array('p.rowid', 'e.rowid')); // We must keep this until the aggregate_array is used. To have a unique key, if we ask a field of a child, to avoid the DISTINCT to discard them. |
| 274 | 274 | $keyforselect = 'product'; |
| 275 | 275 | $keyforelement = 'product'; |
| 276 | - $keyforaliasextra = 'extra'; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 276 | + $keyforaliasextra = 'extra'; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 277 | 277 | include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; |
| 278 | 278 | $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('ps.reel' => 'Stock')); |
| 279 | 279 | |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | 'p.datec' => 'product', 'p.tms' => 'product', 'p.pmp' => 'product', 'p.cost_price' => 'product', |
| 325 | 325 | 'pb.rowid' => 'batch', 'pb.batch' => 'batch', 'pb.qty' => 'batch', |
| 326 | 326 | 'pl.eatby' => 'batch', 'pl.sellby' => 'batch' |
| 327 | - ); // We define here only fields that use another icon that the one defined into export_icon |
|
| 327 | + ); // We define here only fields that use another icon that the one defined into export_icon |
|
| 328 | 328 | if (isModEnabled('barcode')) { |
| 329 | 329 | $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.barcode' => 'product')); |
| 330 | 330 | } |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | $this->export_dependencies_array[$r] = array('stockbatch' => array('pb.rowid'), 'batch' => array('pb.rowid')); // We must keep this until the aggregate_array is used. To add unique key if we ask a field of a child to avoid the DISTINCT to discard them. |
| 333 | 333 | $keyforselect = 'product_lot'; |
| 334 | 334 | $keyforelement = 'batch'; |
| 335 | - $keyforaliasextra = 'extra'; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 335 | + $keyforaliasextra = 'extra'; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 336 | 336 | include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; |
| 337 | 337 | |
| 338 | 338 | $this->export_sql_start[$r] = 'SELECT DISTINCT '; |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | 'e.rowid' => 'warehouse', 'e.ref' => 'warehouse', 'e.description' => 'warehouse', 'e.lieu' => 'warehouse', 'e.address' => 'warehouse', 'e.zip' => 'warehouse', 'e.town' => 'warehouse', |
| 375 | 375 | 'p.rowid' => "product", 'p.ref' => "product", 'p.fk_product_type' => "product", 'p.label' => "product", 'p.description' => "product", 'p.note' => "product", |
| 376 | 376 | 'p.price' => "product", 'p.tva_tx' => 'product', 'p.tosell' => "product", 'p.tobuy' => "product", 'p.duration' => "product", 'p.datec' => 'product', 'p.tms' => 'product' |
| 377 | - ); // We define here only fields that use another icon that the one defined into export_icon |
|
| 377 | + ); // We define here only fields that use another icon that the one defined into export_icon |
|
| 378 | 378 | if (isModEnabled('productbatch')) { |
| 379 | 379 | $this->export_fields_array[$r]['sm.batch'] = 'Batch'; |
| 380 | 380 | $this->export_TypeFields_array[$r]['sm.batch'] = 'Text'; |
@@ -92,8 +92,8 @@ |
||
| 92 | 92 | $task->fk_project = $object->id; |
| 93 | 93 | $defaultref = ''; |
| 94 | 94 | $obj = !getDolGlobalString('PROJECT_TASK_ADDON') ? 'mod_task_simple' : $conf->global->PROJECT_TASK_ADDON; |
| 95 | - if (getDolGlobalString('PROJECT_TASK_ADDON') && is_readable(DOL_DOCUMENT_ROOT . "/core/modules/project/task/" . getDolGlobalString('PROJECT_TASK_ADDON') . ".php")) { |
|
| 96 | - require_once DOL_DOCUMENT_ROOT . "/core/modules/project/task/" . getDolGlobalString('PROJECT_TASK_ADDON') . '.php'; |
|
| 95 | + if (getDolGlobalString('PROJECT_TASK_ADDON') && is_readable(DOL_DOCUMENT_ROOT."/core/modules/project/task/".getDolGlobalString('PROJECT_TASK_ADDON').".php")) { |
|
| 96 | + require_once DOL_DOCUMENT_ROOT."/core/modules/project/task/".getDolGlobalString('PROJECT_TASK_ADDON').'.php'; |
|
| 97 | 97 | $modTask = new $obj(); |
| 98 | 98 | $defaultref = $modTask->getNextValue($object->thirdparty, null); |
| 99 | 99 | } |