@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | */ |
| 149 | 149 | public $price; |
| 150 | 150 | |
| 151 | - public $price_formated; // used by takepos/ajax/ajax.php |
|
| 151 | + public $price_formated; // used by takepos/ajax/ajax.php |
|
| 152 | 152 | |
| 153 | 153 | /** |
| 154 | 154 | * Selling price with tax |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | */ |
| 158 | 158 | public $price_ttc; |
| 159 | 159 | |
| 160 | - public $price_ttc_formated; // used by takepos/ajax/ajax.php |
|
| 160 | + public $price_ttc_formated; // used by takepos/ajax/ajax.php |
|
| 161 | 161 | |
| 162 | 162 | /** |
| 163 | 163 | * Minimum price net |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | public $packaging; |
| 237 | 237 | |
| 238 | 238 | |
| 239 | - public $lifetime; // In seconds |
|
| 239 | + public $lifetime; // In seconds |
|
| 240 | 240 | |
| 241 | 241 | public $qc_frequency; |
| 242 | 242 | |
@@ -397,20 +397,20 @@ discard block |
||
| 397 | 397 | |
| 398 | 398 | //! Metric of products |
| 399 | 399 | public $weight; |
| 400 | - public $weight_units; // scale -3, 0, 3, 6 |
|
| 400 | + public $weight_units; // scale -3, 0, 3, 6 |
|
| 401 | 401 | public $length; |
| 402 | - public $length_units; // scale -3, 0, 3, 6 |
|
| 402 | + public $length_units; // scale -3, 0, 3, 6 |
|
| 403 | 403 | public $width; |
| 404 | - public $width_units; // scale -3, 0, 3, 6 |
|
| 404 | + public $width_units; // scale -3, 0, 3, 6 |
|
| 405 | 405 | public $height; |
| 406 | - public $height_units; // scale -3, 0, 3, 6 |
|
| 406 | + public $height_units; // scale -3, 0, 3, 6 |
|
| 407 | 407 | public $surface; |
| 408 | - public $surface_units; // scale -3, 0, 3, 6 |
|
| 408 | + public $surface_units; // scale -3, 0, 3, 6 |
|
| 409 | 409 | public $volume; |
| 410 | - public $volume_units; // scale -3, 0, 3, 6 |
|
| 410 | + public $volume_units; // scale -3, 0, 3, 6 |
|
| 411 | 411 | |
| 412 | 412 | public $net_measure; |
| 413 | - public $net_measure_units; // scale -3, 0, 3, 6 |
|
| 413 | + public $net_measure_units; // scale -3, 0, 3, 6 |
|
| 414 | 414 | |
| 415 | 415 | public $accountancy_code_sell; |
| 416 | 416 | public $accountancy_code_sell_intra; |
@@ -598,7 +598,7 @@ discard block |
||
| 598 | 598 | 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000), |
| 599 | 599 | //'tosell' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')), |
| 600 | 600 | //'tobuy' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')), |
| 601 | - 'mandatory_period' => array('type'=>'integer', 'label'=>'mandatoryperiod', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>1000), |
|
| 601 | + 'mandatory_period' => array('type'=>'integer', 'label'=>'mandatoryperiod', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>1000), |
|
| 602 | 602 | ); |
| 603 | 603 | |
| 604 | 604 | /** |
@@ -889,9 +889,9 @@ discard block |
||
| 889 | 889 | |
| 890 | 890 | // update accountancy for this entity |
| 891 | 891 | if (!$error && getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
| 892 | - $this->db->query("DELETE FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = " .((int) $this->id) . " AND entity = " . ((int) $conf->entity)); |
|
| 892 | + $this->db->query("DELETE FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $this->id)." AND entity = ".((int) $conf->entity)); |
|
| 893 | 893 | |
| 894 | - $sql = "INSERT INTO " . $this->db->prefix() . "product_perentity ("; |
|
| 894 | + $sql = "INSERT INTO ".$this->db->prefix()."product_perentity ("; |
|
| 895 | 895 | $sql .= " fk_product"; |
| 896 | 896 | $sql .= ", entity"; |
| 897 | 897 | $sql .= ", accountancy_code_buy"; |
@@ -902,13 +902,13 @@ discard block |
||
| 902 | 902 | $sql .= ", accountancy_code_sell_export"; |
| 903 | 903 | $sql .= ") VALUES ("; |
| 904 | 904 | $sql .= $this->id; |
| 905 | - $sql .= ", " . $conf->entity; |
|
| 906 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'"; |
|
| 907 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_intra) . "'"; |
|
| 908 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_export) . "'"; |
|
| 909 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'"; |
|
| 910 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_intra) . "'"; |
|
| 911 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_export) . "'"; |
|
| 905 | + $sql .= ", ".$conf->entity; |
|
| 906 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'"; |
|
| 907 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_intra)."'"; |
|
| 908 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_export)."'"; |
|
| 909 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'"; |
|
| 910 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_intra)."'"; |
|
| 911 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_export)."'"; |
|
| 912 | 912 | $sql .= ")"; |
| 913 | 913 | $result = $this->db->query($sql); |
| 914 | 914 | if (!$result) { |
@@ -1286,12 +1286,12 @@ discard block |
||
| 1286 | 1286 | $sql .= ", note_public = ".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : 'null'); |
| 1287 | 1287 | $sql .= ", duration = '".$this->db->escape($this->duration_value.$this->duration_unit)."'"; |
| 1288 | 1288 | if (!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
| 1289 | - $sql .= ", accountancy_code_buy = '" . $this->db->escape($this->accountancy_code_buy) . "'"; |
|
| 1290 | - $sql .= ", accountancy_code_buy_intra = '" . $this->db->escape($this->accountancy_code_buy_intra) . "'"; |
|
| 1291 | - $sql .= ", accountancy_code_buy_export = '" . $this->db->escape($this->accountancy_code_buy_export) . "'"; |
|
| 1292 | - $sql .= ", accountancy_code_sell= '" . $this->db->escape($this->accountancy_code_sell) . "'"; |
|
| 1293 | - $sql .= ", accountancy_code_sell_intra= '" . $this->db->escape($this->accountancy_code_sell_intra) . "'"; |
|
| 1294 | - $sql .= ", accountancy_code_sell_export= '" . $this->db->escape($this->accountancy_code_sell_export) . "'"; |
|
| 1289 | + $sql .= ", accountancy_code_buy = '".$this->db->escape($this->accountancy_code_buy)."'"; |
|
| 1290 | + $sql .= ", accountancy_code_buy_intra = '".$this->db->escape($this->accountancy_code_buy_intra)."'"; |
|
| 1291 | + $sql .= ", accountancy_code_buy_export = '".$this->db->escape($this->accountancy_code_buy_export)."'"; |
|
| 1292 | + $sql .= ", accountancy_code_sell= '".$this->db->escape($this->accountancy_code_sell)."'"; |
|
| 1293 | + $sql .= ", accountancy_code_sell_intra= '".$this->db->escape($this->accountancy_code_sell_intra)."'"; |
|
| 1294 | + $sql .= ", accountancy_code_sell_export= '".$this->db->escape($this->accountancy_code_sell_export)."'"; |
|
| 1295 | 1295 | } |
| 1296 | 1296 | $sql .= ", desiredstock = ".((isset($this->desiredstock) && is_numeric($this->desiredstock)) ? (float) $this->desiredstock : "null"); |
| 1297 | 1297 | $sql .= ", cost_price = ".($this->cost_price != '' ? $this->db->escape($this->cost_price) : 'null'); |
@@ -1321,9 +1321,9 @@ discard block |
||
| 1321 | 1321 | |
| 1322 | 1322 | // update accountancy for this entity |
| 1323 | 1323 | if (!$error && getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
| 1324 | - $this->db->query("DELETE FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = " . ((int) $this->id) . " AND entity = " . ((int) $conf->entity)); |
|
| 1324 | + $this->db->query("DELETE FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $this->id)." AND entity = ".((int) $conf->entity)); |
|
| 1325 | 1325 | |
| 1326 | - $sql = "INSERT INTO " . $this->db->prefix() . "product_perentity ("; |
|
| 1326 | + $sql = "INSERT INTO ".$this->db->prefix()."product_perentity ("; |
|
| 1327 | 1327 | $sql .= " fk_product"; |
| 1328 | 1328 | $sql .= ", entity"; |
| 1329 | 1329 | $sql .= ", accountancy_code_buy"; |
@@ -1334,13 +1334,13 @@ discard block |
||
| 1334 | 1334 | $sql .= ", accountancy_code_sell_export"; |
| 1335 | 1335 | $sql .= ") VALUES ("; |
| 1336 | 1336 | $sql .= $this->id; |
| 1337 | - $sql .= ", " . $conf->entity; |
|
| 1338 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'"; |
|
| 1339 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_intra) . "'"; |
|
| 1340 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_export) . "'"; |
|
| 1341 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'"; |
|
| 1342 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_intra) . "'"; |
|
| 1343 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_export) . "'"; |
|
| 1337 | + $sql .= ", ".$conf->entity; |
|
| 1338 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'"; |
|
| 1339 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_intra)."'"; |
|
| 1340 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_export)."'"; |
|
| 1341 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'"; |
|
| 1342 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_intra)."'"; |
|
| 1343 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_export)."'"; |
|
| 1344 | 1344 | $sql .= ")"; |
| 1345 | 1345 | $result = $this->db->query($sql); |
| 1346 | 1346 | if (!$result) { |
@@ -1352,8 +1352,8 @@ discard block |
||
| 1352 | 1352 | if (!$this->hasbatch() && $this->oldcopy->hasbatch()) { |
| 1353 | 1353 | // Selection of all product stock movements that contains batchs |
| 1354 | 1354 | $sql = 'SELECT pb.qty, pb.fk_entrepot, pb.batch FROM '.MAIN_DB_PREFIX.'product_batch as pb'; |
| 1355 | - $sql.= ' INNER JOIN '.MAIN_DB_PREFIX.'product_stock as ps ON (ps.rowid = batch.fk_product_stock)'; |
|
| 1356 | - $sql.= ' WHERE ps.fk_product = '.(int) $this->id; |
|
| 1355 | + $sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'product_stock as ps ON (ps.rowid = batch.fk_product_stock)'; |
|
| 1356 | + $sql .= ' WHERE ps.fk_product = '.(int) $this->id; |
|
| 1357 | 1357 | |
| 1358 | 1358 | $resql = $this->db->query($sql); |
| 1359 | 1359 | if ($resql) { |
@@ -1711,7 +1711,7 @@ discard block |
||
| 1711 | 1711 | } |
| 1712 | 1712 | } elseif (isset($this->multilangs[$key])) { |
| 1713 | 1713 | if (empty($this->multilangs["$key"]["label"])) { |
| 1714 | - $this->errors[] = $key . ' : ' . $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")); |
|
| 1714 | + $this->errors[] = $key.' : '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")); |
|
| 1715 | 1715 | return -1; |
| 1716 | 1716 | } |
| 1717 | 1717 | |
@@ -1906,7 +1906,7 @@ discard block |
||
| 1906 | 1906 | */ |
| 1907 | 1907 | private function getArrayForPriceCompare($level = 0) |
| 1908 | 1908 | { |
| 1909 | - $testExit = array('multiprices','multiprices_ttc','multiprices_base_type','multiprices_min','multiprices_min_ttc','multiprices_tva_tx','multiprices_recuperableonly'); |
|
| 1909 | + $testExit = array('multiprices', 'multiprices_ttc', 'multiprices_base_type', 'multiprices_min', 'multiprices_min_ttc', 'multiprices_tva_tx', 'multiprices_recuperableonly'); |
|
| 1910 | 1910 | |
| 1911 | 1911 | foreach ($testExit as $field) { |
| 1912 | 1912 | if (!isset($this->$field)) { |
@@ -2549,20 +2549,20 @@ discard block |
||
| 2549 | 2549 | |
| 2550 | 2550 | //For MultiCompany |
| 2551 | 2551 | //PMP per entity & Stocks Sharings stock_reel includes only stocks shared with this entity |
| 2552 | - $separatedEntityPMP = false; // Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product. |
|
| 2553 | - $separatedStock = false; // Set to true will count stock from subtable llx_product_stock. It is slower than using denormalized field 'stock', but it is required when using multientity and shared warehouses. |
|
| 2552 | + $separatedEntityPMP = false; // Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product. |
|
| 2553 | + $separatedStock = false; // Set to true will count stock from subtable llx_product_stock. It is slower than using denormalized field 'stock', but it is required when using multientity and shared warehouses. |
|
| 2554 | 2554 | $visibleWarehousesEntities = $conf->entity; |
| 2555 | 2555 | if (getDolGlobalString('MULTICOMPANY_PRODUCT_SHARING_ENABLED')) { |
| 2556 | 2556 | if (getDolGlobalString('MULTICOMPANY_PMP_PER_ENTITY_ENABLED')) { |
| 2557 | - $checkPMPPerEntity = $this->db->query("SELECT pmp FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = ".((int) $id)." AND entity = ".(int) $conf->entity); |
|
| 2558 | - if ($this->db->num_rows($checkPMPPerEntity)>0) { |
|
| 2557 | + $checkPMPPerEntity = $this->db->query("SELECT pmp FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $id)." AND entity = ".(int) $conf->entity); |
|
| 2558 | + if ($this->db->num_rows($checkPMPPerEntity) > 0) { |
|
| 2559 | 2559 | $separatedEntityPMP = true; |
| 2560 | 2560 | } |
| 2561 | 2561 | } |
| 2562 | 2562 | global $mc; |
| 2563 | 2563 | $separatedStock = true; |
| 2564 | 2564 | if (isset($mc->sharings['stock']) && !empty($mc->sharings['stock'])) { |
| 2565 | - $visibleWarehousesEntities .= "," . implode(",", $mc->sharings['stock']); |
|
| 2565 | + $visibleWarehousesEntities .= ",".implode(",", $mc->sharings['stock']); |
|
| 2566 | 2566 | } |
| 2567 | 2567 | } |
| 2568 | 2568 | if ($separatedEntityPMP) { |
@@ -2579,10 +2579,10 @@ discard block |
||
| 2579 | 2579 | } |
| 2580 | 2580 | $sql .= " FROM ".$this->db->prefix()."product as p"; |
| 2581 | 2581 | if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED') || $separatedEntityPMP) { |
| 2582 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity); |
|
| 2582 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity); |
|
| 2583 | 2583 | } |
| 2584 | 2584 | if ($separatedStock) { |
| 2585 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as sp ON sp.fk_product = p.rowid AND sp.fk_entrepot IN (SELECT rowid FROM ".$this->db->prefix()."entrepot WHERE entity IN (".$this->db->sanitize($visibleWarehousesEntities)."))"; |
|
| 2585 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as sp ON sp.fk_product = p.rowid AND sp.fk_entrepot IN (SELECT rowid FROM ".$this->db->prefix()."entrepot WHERE entity IN (".$this->db->sanitize($visibleWarehousesEntities)."))"; |
|
| 2586 | 2586 | } |
| 2587 | 2587 | |
| 2588 | 2588 | if ($id) { |
@@ -2738,15 +2738,15 @@ discard block |
||
| 2738 | 2738 | $sql .= " WHERE entity IN (".getEntity('productprice').")"; |
| 2739 | 2739 | $sql .= " AND price_level=".((int) $i); |
| 2740 | 2740 | $sql .= " AND fk_product = ".((int) $this->id); |
| 2741 | - $sql .= " ORDER BY date_price DESC, rowid DESC"; // Get the most recent line |
|
| 2742 | - $sql .= " LIMIT 1"; // Only the first one |
|
| 2741 | + $sql .= " ORDER BY date_price DESC, rowid DESC"; // Get the most recent line |
|
| 2742 | + $sql .= " LIMIT 1"; // Only the first one |
|
| 2743 | 2743 | $resql = $this->db->query($sql); |
| 2744 | 2744 | if ($resql) { |
| 2745 | 2745 | $result = $this->db->fetch_array($resql); |
| 2746 | 2746 | |
| 2747 | 2747 | $this->multiprices[$i] = $result ? $result["price"] : null; |
| 2748 | 2748 | $this->multiprices_ttc[$i] = $result ? $result["price_ttc"] : null; |
| 2749 | - $this->multiprices_min[$i] = $result ? $result["price_min"] : null; |
|
| 2749 | + $this->multiprices_min[$i] = $result ? $result["price_min"] : null; |
|
| 2750 | 2750 | $this->multiprices_min_ttc[$i] = $result ? $result["price_min_ttc"] : null; |
| 2751 | 2751 | $this->multiprices_base_type[$i] = $result ? $result["price_base_type"] : null; |
| 2752 | 2752 | // Next two fields are used only if PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL is on |
@@ -2966,7 +2966,7 @@ discard block |
||
| 2966 | 2966 | $obj = $this->db->fetch_object($result); |
| 2967 | 2967 | $this->stats_mo['customers_'.$role] = $obj->nb_customers ? $obj->nb_customers : 0; |
| 2968 | 2968 | $this->stats_mo['nb_'.$role] = $obj->nb ? $obj->nb : 0; |
| 2969 | - $this->stats_mo['qty_'.$role] = $obj->qty ? price2num($obj->qty, 'MS') : 0; // qty may be a float due to the SUM() |
|
| 2969 | + $this->stats_mo['qty_'.$role] = $obj->qty ? price2num($obj->qty, 'MS') : 0; // qty may be a float due to the SUM() |
|
| 2970 | 2970 | } else { |
| 2971 | 2971 | $this->error = $this->db->error(); |
| 2972 | 2972 | $error++; |
@@ -3565,7 +3565,7 @@ discard block |
||
| 3565 | 3565 | $sql .= "AND EXISTS (SELECT p.rowid FROM ".$this->db->prefix()."product AS p WHERE p.rowid = ".((int) $this->id)." AND p.fk_product_type IN (0))"; |
| 3566 | 3566 | } |
| 3567 | 3567 | if (!empty($warehouseid)) { |
| 3568 | - $sql.= " AND m.fk_warehouse = ".((int) $warehouseid); |
|
| 3568 | + $sql .= " AND m.fk_warehouse = ".((int) $warehouseid); |
|
| 3569 | 3569 | } |
| 3570 | 3570 | $sql .= " GROUP BY role"; |
| 3571 | 3571 | |
@@ -4470,7 +4470,7 @@ discard block |
||
| 4470 | 4470 | //Addition of a product with the highest rank +1 |
| 4471 | 4471 | $sql = "INSERT INTO ".$this->db->prefix()."product_association(fk_product_pere,fk_product_fils,qty,incdec,rang)"; |
| 4472 | 4472 | $sql .= " VALUES (".((int) $id_pere).", ".((int) $id_fils).", ".price2num($qty, 'MS').", ".price2num($incdec, 'MS').", ".((int) $rank).")"; |
| 4473 | - if (! $this->db->query($sql)) { |
|
| 4473 | + if (!$this->db->query($sql)) { |
|
| 4474 | 4474 | dol_print_error($this->db); |
| 4475 | 4475 | return -1; |
| 4476 | 4476 | } else { |
@@ -4581,17 +4581,17 @@ discard block |
||
| 4581 | 4581 | |
| 4582 | 4582 | // Updated ranks so that none are missing |
| 4583 | 4583 | $sqlrank = "SELECT rowid, rang FROM ".$this->db->prefix()."product_association"; |
| 4584 | - $sqlrank.= " WHERE fk_product_pere = ".((int) $fk_parent); |
|
| 4585 | - $sqlrank.= " ORDER BY rang"; |
|
| 4584 | + $sqlrank .= " WHERE fk_product_pere = ".((int) $fk_parent); |
|
| 4585 | + $sqlrank .= " ORDER BY rang"; |
|
| 4586 | 4586 | $resqlrank = $this->db->query($sqlrank); |
| 4587 | 4587 | if ($resqlrank) { |
| 4588 | 4588 | $cpt = 0; |
| 4589 | 4589 | while ($objrank = $this->db->fetch_object($resqlrank)) { |
| 4590 | 4590 | $cpt++; |
| 4591 | 4591 | $sql = "UPDATE ".$this->db->prefix()."product_association"; |
| 4592 | - $sql.= " SET rang = ".((int) $cpt); |
|
| 4593 | - $sql.= " WHERE rowid = ".((int) $objrank->rowid); |
|
| 4594 | - if (! $this->db->query($sql)) { |
|
| 4592 | + $sql .= " SET rang = ".((int) $cpt); |
|
| 4593 | + $sql .= " WHERE rowid = ".((int) $objrank->rowid); |
|
| 4594 | + if (!$this->db->query($sql)) { |
|
| 4595 | 4595 | dol_print_error($this->db); |
| 4596 | 4596 | return -1; |
| 4597 | 4597 | } |
@@ -5024,7 +5024,7 @@ discard block |
||
| 5024 | 5024 | if (isset($this->sousprods) && is_array($this->sousprods)) { |
| 5025 | 5025 | foreach ($this->sousprods as $prod_name => $desc_product) { |
| 5026 | 5026 | if (is_array($desc_product)) { |
| 5027 | - $this->fetch_prod_arbo($desc_product, "", $multiply, 1, $this->id, $ignore_stock_load); // This set $this->res |
|
| 5027 | + $this->fetch_prod_arbo($desc_product, "", $multiply, 1, $this->id, $ignore_stock_load); // This set $this->res |
|
| 5028 | 5028 | } |
| 5029 | 5029 | } |
| 5030 | 5030 | } |
@@ -5179,9 +5179,9 @@ discard block |
||
| 5179 | 5179 | $sql .= " WHERE p.rowid = pa.fk_product_fils"; |
| 5180 | 5180 | $sql .= " AND pa.fk_product_pere = ".((int) $id); |
| 5181 | 5181 | $sql .= " AND pa.fk_product_fils <> ".((int) $id); // This should not happens, it is to avoid infinite loop if it happens |
| 5182 | - $sql.= " ORDER BY pa.rang"; |
|
| 5182 | + $sql .= " ORDER BY pa.rang"; |
|
| 5183 | 5183 | |
| 5184 | - dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level. ' parents='.(is_array($parents) ? implode(',', $parents) : $parents), LOG_DEBUG); |
|
| 5184 | + dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level.' parents='.(is_array($parents) ? implode(',', $parents) : $parents), LOG_DEBUG); |
|
| 5185 | 5185 | |
| 5186 | 5186 | if ($level == 1) { |
| 5187 | 5187 | $alreadyfound = array($id=>1); // We init array of found object to start of tree, so if we found it later (should not happened), we stop immediately |
@@ -5272,41 +5272,41 @@ discard block |
||
| 5272 | 5272 | if (!empty($this->entity)) { |
| 5273 | 5273 | $tmpphoto = $this->show_photos('product', $conf->product->multidir_output[$this->entity], 1, 1, 0, 0, 0, 80, 0, 0, 0, 0, 1); |
| 5274 | 5274 | if ($this->nbphoto > 0) { |
| 5275 | - $datas['photo'] = '<div class="photointooltip floatright">'."\n" . $tmpphoto . '</div>'; |
|
| 5275 | + $datas['photo'] = '<div class="photointooltip floatright">'."\n".$tmpphoto.'</div>'; |
|
| 5276 | 5276 | } |
| 5277 | 5277 | } |
| 5278 | 5278 | |
| 5279 | 5279 | if ($this->type == Product::TYPE_PRODUCT) { |
| 5280 | 5280 | $datas['picto'] = img_picto('', 'product').' <u class="paddingrightonly">'.$langs->trans("Product").'</u>'; |
| 5281 | 5281 | } elseif ($this->type == Product::TYPE_SERVICE) { |
| 5282 | - $datas['picto']= img_picto('', 'service').' <u class="paddingrightonly">'.$langs->trans("Service").'</u>'; |
|
| 5282 | + $datas['picto'] = img_picto('', 'service').' <u class="paddingrightonly">'.$langs->trans("Service").'</u>'; |
|
| 5283 | 5283 | } |
| 5284 | 5284 | if (isset($this->status) && isset($this->status_buy)) { |
| 5285 | - $datas['status']= ' '.$this->getLibStatut(5, 0) . ' '.$this->getLibStatut(5, 1); |
|
| 5285 | + $datas['status'] = ' '.$this->getLibStatut(5, 0).' '.$this->getLibStatut(5, 1); |
|
| 5286 | 5286 | } |
| 5287 | 5287 | |
| 5288 | 5288 | if (!empty($this->ref)) { |
| 5289 | - $datas['ref']= '<br><b>'.$langs->trans('ProductRef').':</b> '.$this->ref; |
|
| 5289 | + $datas['ref'] = '<br><b>'.$langs->trans('ProductRef').':</b> '.$this->ref; |
|
| 5290 | 5290 | } |
| 5291 | 5291 | if (!empty($this->label)) { |
| 5292 | - $datas['label']= '<br><b>'.$langs->trans('ProductLabel').':</b> '.$this->label; |
|
| 5292 | + $datas['label'] = '<br><b>'.$langs->trans('ProductLabel').':</b> '.$this->label; |
|
| 5293 | 5293 | } |
| 5294 | 5294 | if (!empty($this->description)) { |
| 5295 | - $datas['description']= '<br><b>'.$langs->trans('ProductDescription').':</b> '.dolGetFirstLineOfText($this->description, 5); |
|
| 5295 | + $datas['description'] = '<br><b>'.$langs->trans('ProductDescription').':</b> '.dolGetFirstLineOfText($this->description, 5); |
|
| 5296 | 5296 | } |
| 5297 | 5297 | if ($this->type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { |
| 5298 | 5298 | if (isModEnabled('productbatch')) { |
| 5299 | 5299 | $langs->load("productbatch"); |
| 5300 | - $datas['batchstatus']= "<br><b>".$langs->trans("ManageLotSerial").'</b>: '.$this->getLibStatut(0, 2); |
|
| 5300 | + $datas['batchstatus'] = "<br><b>".$langs->trans("ManageLotSerial").'</b>: '.$this->getLibStatut(0, 2); |
|
| 5301 | 5301 | } |
| 5302 | 5302 | } |
| 5303 | 5303 | if (isModEnabled('barcode')) { |
| 5304 | - $datas['barcode']= '<br><b>'.$langs->trans('BarCode').':</b> '.$this->barcode; |
|
| 5304 | + $datas['barcode'] = '<br><b>'.$langs->trans('BarCode').':</b> '.$this->barcode; |
|
| 5305 | 5305 | } |
| 5306 | 5306 | |
| 5307 | 5307 | if ($this->type == Product::TYPE_PRODUCT) { |
| 5308 | 5308 | if ($this->weight) { |
| 5309 | - $datas['weight']= "<br><b>".$langs->trans("Weight").'</b>: '.$this->weight.' '.measuringUnitString(0, "weight", $this->weight_units); |
|
| 5309 | + $datas['weight'] = "<br><b>".$langs->trans("Weight").'</b>: '.$this->weight.' '.measuringUnitString(0, "weight", $this->weight_units); |
|
| 5310 | 5310 | } |
| 5311 | 5311 | $labelsize = ""; |
| 5312 | 5312 | if ($this->length) { |
@@ -5319,7 +5319,7 @@ discard block |
||
| 5319 | 5319 | $labelsize .= ($labelsize ? " - " : "")."<b>".$langs->trans("Height").'</b>: '.$this->height.' '.measuringUnitString(0, 'size', $this->height_units); |
| 5320 | 5320 | } |
| 5321 | 5321 | if ($labelsize) { |
| 5322 | - $datas['size']= "<br>".$labelsize; |
|
| 5322 | + $datas['size'] = "<br>".$labelsize; |
|
| 5323 | 5323 | } |
| 5324 | 5324 | |
| 5325 | 5325 | $labelsurfacevolume = ""; |
@@ -5330,7 +5330,7 @@ discard block |
||
| 5330 | 5330 | $labelsurfacevolume .= ($labelsurfacevolume ? " - " : "")."<b>".$langs->trans("Volume").'</b>: '.$this->volume.' '.measuringUnitString(0, 'volume', $this->volume_units); |
| 5331 | 5331 | } |
| 5332 | 5332 | if ($labelsurfacevolume) { |
| 5333 | - $datas['surface'] = "<br>" . $labelsurfacevolume; |
|
| 5333 | + $datas['surface'] = "<br>".$labelsurfacevolume; |
|
| 5334 | 5334 | } |
| 5335 | 5335 | } |
| 5336 | 5336 | if ($this->type == Product::TYPE_SERVICE && !empty($this->duration_value)) { |
@@ -5372,9 +5372,9 @@ discard block |
||
| 5372 | 5372 | } |
| 5373 | 5373 | // show categories for this record only in ajax to not overload lists |
| 5374 | 5374 | if (isModEnabled('category') && !$nofetch) { |
| 5375 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 5375 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 5376 | 5376 | $form = new Form($this->db); |
| 5377 | - $datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_PRODUCT, 1); |
|
| 5377 | + $datas['categories'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_PRODUCT, 1); |
|
| 5378 | 5378 | } |
| 5379 | 5379 | |
| 5380 | 5380 | return $datas; |
@@ -5895,7 +5895,7 @@ discard block |
||
| 5895 | 5895 | if (isModEnabled("supplier_order")) { |
| 5896 | 5896 | $filterStatus = !getDolGlobalString('SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK') ? '3,4' : $conf->global->SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK; |
| 5897 | 5897 | if (isset($includedraftpoforvirtual)) { |
| 5898 | - $filterStatus = '0,1,2,'.$filterStatus; // 1,2 may have already been inside $filterStatus but it is better to have twice than missing $filterStatus does not include them |
|
| 5898 | + $filterStatus = '0,1,2,'.$filterStatus; // 1,2 may have already been inside $filterStatus but it is better to have twice than missing $filterStatus does not include them |
|
| 5899 | 5899 | } |
| 5900 | 5900 | $result = $this->load_stats_commande_fournisseur(0, $filterStatus, 1, $dateofvirtualstock); |
| 5901 | 5901 | if ($result < 0) { |
@@ -6327,7 +6327,7 @@ discard block |
||
| 6327 | 6327 | if (getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')) { |
| 6328 | 6328 | $dirsociete = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']); |
| 6329 | 6329 | foreach ($dirsociete as $dirroot) { |
| 6330 | - $res = dol_include_once($dirroot . getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM').'.php'); |
|
| 6330 | + $res = dol_include_once($dirroot.getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM').'.php'); |
|
| 6331 | 6331 | if ($res) { |
| 6332 | 6332 | break; |
| 6333 | 6333 | } |
@@ -6617,7 +6617,7 @@ discard block |
||
| 6617 | 6617 | global $langs; |
| 6618 | 6618 | |
| 6619 | 6619 | if (empty($this->duration_value)) { |
| 6620 | - $this->errors[]='ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice'; |
|
| 6620 | + $this->errors[] = 'ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice'; |
|
| 6621 | 6621 | return -1; |
| 6622 | 6622 | } |
| 6623 | 6623 | |
@@ -6654,7 +6654,7 @@ discard block |
||
| 6654 | 6654 | */ |
| 6655 | 6655 | public function getKanbanView($option = '', $arraydata = null) |
| 6656 | 6656 | { |
| 6657 | - global $langs,$conf; |
|
| 6657 | + global $langs, $conf; |
|
| 6658 | 6658 | |
| 6659 | 6659 | $selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']); |
| 6660 | 6660 | |
@@ -44,13 +44,13 @@ discard block |
||
| 44 | 44 | require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; |
| 45 | 45 | |
| 46 | 46 | // Load translation files required by the page |
| 47 | -$langsArray=array("errors", "admin", "mails", "languages"); |
|
| 47 | +$langsArray = array("errors", "admin", "mails", "languages"); |
|
| 48 | 48 | |
| 49 | 49 | if (isModEnabled('member')) { |
| 50 | - $langsArray[]='members'; |
|
| 50 | + $langsArray[] = 'members'; |
|
| 51 | 51 | } |
| 52 | 52 | if (isModEnabled('eventorganization')) { |
| 53 | - $langsArray[]='eventorganization'; |
|
| 53 | + $langsArray[] = 'eventorganization'; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | $langs->loadLangs($langsArray); |
@@ -1040,7 +1040,7 @@ discard block |
||
| 1040 | 1040 | } |
| 1041 | 1041 | $sortfieldtouse = ($sortable ? $fieldlist[$field] : ''); |
| 1042 | 1042 | if ($sortfieldtouse == 'type_template') { |
| 1043 | - $sortfieldtouse.= 'type_template,lang,position,label'; |
|
| 1043 | + $sortfieldtouse .= 'type_template,lang,position,label'; |
|
| 1044 | 1044 | } |
| 1045 | 1045 | print getTitleFieldOfList($valuetoshow, 0, $_SERVER["PHP_SELF"], $sortfieldtouse, ($page ? 'page='.$page.'&' : ''), $param, '', $sortfield, $sortorder, $css.' '); |
| 1046 | 1046 | } |
@@ -1103,7 +1103,7 @@ discard block |
||
| 1103 | 1103 | print '<tr class="oddeven nohover'.(in_array($tmpfieldlist, array('topic', 'joinfiles')) ? ' nobottom' : '').'" id="tr-'.$tmpfieldlist.'-'.$rowid.'">'; |
| 1104 | 1104 | print '<td colspan="10">'; |
| 1105 | 1105 | |
| 1106 | - $fieldsforcontent = array('topic', 'email_from','joinfiles', 'content'); |
|
| 1106 | + $fieldsforcontent = array('topic', 'email_from', 'joinfiles', 'content'); |
|
| 1107 | 1107 | if (getDolGlobalString('MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES')) { |
| 1108 | 1108 | $fieldsforcontent[] = 'content_lines'; |
| 1109 | 1109 | } |
@@ -1176,7 +1176,7 @@ discard block |
||
| 1176 | 1176 | continue; // It means this is a type of template not into elementList (may be because enabled condition of this type is false because module is not enabled) |
| 1177 | 1177 | } |
| 1178 | 1178 | // Test on 'enabled' |
| 1179 | - if (! (int) dol_eval($obj->enabled, 1, 1, '1')) { |
|
| 1179 | + if (!(int) dol_eval($obj->enabled, 1, 1, '1')) { |
|
| 1180 | 1180 | $i++; |
| 1181 | 1181 | continue; // Email template not qualified |
| 1182 | 1182 | } |
@@ -1466,7 +1466,7 @@ discard block |
||
| 1466 | 1466 | print $form->selectyesno($value, (isset($obj->$value) ? $obj->$value : ''), 1); |
| 1467 | 1467 | } |
| 1468 | 1468 | } else { |
| 1469 | - print '<input type="text" '.$size.'class="flat'.($class ? ' '.$class : '').'" value="'.(isset($obj->$value) ? $obj->$value : '').'" name="'. $value .'"'.($context == 'preview' ? ' disabled' : '').'>'; |
|
| 1469 | + print '<input type="text" '.$size.'class="flat'.($class ? ' '.$class : '').'" value="'.(isset($obj->$value) ? $obj->$value : '').'" name="'.$value.'"'.($context == 'preview' ? ' disabled' : '').'>'; |
|
| 1470 | 1470 | } |
| 1471 | 1471 | print '</td>'; |
| 1472 | 1472 | } |
@@ -206,10 +206,10 @@ discard block |
||
| 206 | 206 | 'parent', 'photo', 'socialnetworks', 'webservices_url', 'webservices_key'))) { |
| 207 | 207 | continue; |
| 208 | 208 | } |
| 209 | - if (isset($val['enabled']) && ! (int) dol_eval($val['enabled'], 1, 1, '1')) { |
|
| 209 | + if (isset($val['enabled']) && !(int) dol_eval($val['enabled'], 1, 1, '1')) { |
|
| 210 | 210 | continue; |
| 211 | 211 | } |
| 212 | - if (isset($val['visible']) && ! (int) dol_eval($val['visible'], 1, 1, '1')) { |
|
| 212 | + if (isset($val['visible']) && !(int) dol_eval($val['visible'], 1, 1, '1')) { |
|
| 213 | 213 | continue; |
| 214 | 214 | } |
| 215 | 215 | if (preg_match('/^fk_/', $key) && !preg_match('/^fk_statu/', $key)) { |
@@ -371,10 +371,10 @@ discard block |
||
| 371 | 371 | 'parent', 'photo', 'socialnetworks', 'webservices_url', 'webservices_key'))) { |
| 372 | 372 | continue; |
| 373 | 373 | } |
| 374 | - if (isset($val['enabled']) && ! (int) dol_eval($val['enabled'], 1, 1, '1')) { |
|
| 374 | + if (isset($val['enabled']) && !(int) dol_eval($val['enabled'], 1, 1, '1')) { |
|
| 375 | 375 | continue; |
| 376 | 376 | } |
| 377 | - if (isset($val['visible']) && ! (int) dol_eval($val['visible'], 1, 1, '1')) { |
|
| 377 | + if (isset($val['visible']) && !(int) dol_eval($val['visible'], 1, 1, '1')) { |
|
| 378 | 378 | continue; |
| 379 | 379 | } |
| 380 | 380 | if (preg_match('/^fk_/', $key) && !preg_match('/^fk_statu/', $key)) { |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !preg_match('/^select;/', $typeofdata)) { |
| 120 | 120 | if (!empty($perm)) { |
| 121 | 121 | $tmp = explode(':', $typeofdata); |
| 122 | - $ret .= '<div class="editkey_' . $tmp[0] . (!empty($tmp[1]) ? ' ' . $tmp[1] : '') . '" id="' . $htmlname . '">'; |
|
| 122 | + $ret .= '<div class="editkey_'.$tmp[0].(!empty($tmp[1]) ? ' '.$tmp[1] : '').'" id="'.$htmlname.'">'; |
|
| 123 | 123 | if ($fieldrequired) { |
| 124 | 124 | $ret .= '<span class="fieldrequired">'; |
| 125 | 125 | } |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | if ($fieldrequired) { |
| 132 | 132 | $ret .= '</span>'; |
| 133 | 133 | } |
| 134 | - $ret .= '</div>' . "\n"; |
|
| 134 | + $ret .= '</div>'."\n"; |
|
| 135 | 135 | } else { |
| 136 | 136 | if ($fieldrequired) { |
| 137 | 137 | $ret .= '<span class="fieldrequired">'; |
@@ -169,8 +169,8 @@ discard block |
||
| 169 | 169 | if (empty($notabletag) && $perm) { |
| 170 | 170 | $ret .= '<td class="right">'; |
| 171 | 171 | } |
| 172 | - if ($htmlname && GETPOST('action', 'aZ09') != 'edit' . $htmlname && $perm) { |
|
| 173 | - $ret .= '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?action=edit' . $htmlname . '&token=' . newToken() . '&' . $paramid . '=' . $object->id . $moreparam . '">' . img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)) . '</a>'; |
|
| 172 | + if ($htmlname && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) { |
|
| 173 | + $ret .= '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=edit'.$htmlname.'&token='.newToken().'&'.$paramid.'='.$object->id.$moreparam.'">'.img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)).'</a>'; |
|
| 174 | 174 | } |
| 175 | 175 | if (!empty($notabletag) && $notabletag == 1) { |
| 176 | 176 | if ($text) { |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | } elseif ($reg[1] == 'int') { |
| 238 | 238 | $typeofdata = 'numeric'; |
| 239 | 239 | } else { |
| 240 | - return 'ErrorBadParameter ' . $typeofdata; |
|
| 240 | + return 'ErrorBadParameter '.$typeofdata; |
|
| 241 | 241 | } |
| 242 | 242 | } |
| 243 | 243 | |
@@ -248,13 +248,13 @@ discard block |
||
| 248 | 248 | if ($editaction == '') { |
| 249 | 249 | $editaction = GETPOST('action', 'aZ09'); |
| 250 | 250 | } |
| 251 | - $editmode = ($editaction == 'edit' . $htmlname); |
|
| 251 | + $editmode = ($editaction == 'edit'.$htmlname); |
|
| 252 | 252 | if ($editmode) { // edit mode |
| 253 | 253 | $ret .= "\n"; |
| 254 | - $ret .= '<form method="post" action="' . $_SERVER["PHP_SELF"] . ($moreparam ? '?' . $moreparam : '') . '">'; |
|
| 255 | - $ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
| 256 | - $ret .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 257 | - $ret .= '<input type="hidden" name="' . $paramid . '" value="' . $object->id . '">'; |
|
| 254 | + $ret .= '<form method="post" action="'.$_SERVER["PHP_SELF"].($moreparam ? '?'.$moreparam : '').'">'; |
|
| 255 | + $ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
| 256 | + $ret .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 257 | + $ret .= '<input type="hidden" name="'.$paramid.'" value="'.$object->id.'">'; |
|
| 258 | 258 | if (empty($notabletag)) { |
| 259 | 259 | $ret .= '<table class="nobordernopadding centpercent">'; |
| 260 | 260 | } |
@@ -263,28 +263,28 @@ discard block |
||
| 263 | 263 | } |
| 264 | 264 | if (preg_match('/^(string|safehtmlstring|email|phone|url)/', $typeofdata)) { |
| 265 | 265 | $tmp = explode(':', $typeofdata); |
| 266 | - $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($editvalue ? $editvalue : $value) . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
| 266 | + $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
|
| 267 | 267 | } elseif (preg_match('/^(integer)/', $typeofdata)) { |
| 268 | 268 | $tmp = explode(':', $typeofdata); |
| 269 | 269 | $valuetoshow = price2num($editvalue ? $editvalue : $value, 0); |
| 270 | - $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . $valuetoshow . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
| 270 | + $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.$valuetoshow.'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
|
| 271 | 271 | } elseif (preg_match('/^(numeric|amount)/', $typeofdata)) { |
| 272 | 272 | $tmp = explode(':', $typeofdata); |
| 273 | 273 | $valuetoshow = price2num($editvalue ? $editvalue : $value); |
| 274 | - $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($valuetoshow != '' ? price($valuetoshow) : '') . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
| 274 | + $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ? price($valuetoshow) : '').'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
|
| 275 | 275 | } elseif (preg_match('/^(checkbox)/', $typeofdata)) { |
| 276 | 276 | $tmp = explode(':', $typeofdata); |
| 277 | - $ret .= '<input type="checkbox" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($value ? $value : 'on') . '"' . ($value ? ' checked' : '') . (empty($tmp[1]) ? '' : $tmp[1]) . '/>'; |
|
| 277 | + $ret .= '<input type="checkbox" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($value ? $value : 'on').'"'.($value ? ' checked' : '').(empty($tmp[1]) ? '' : $tmp[1]).'/>'; |
|
| 278 | 278 | } elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) { // if wysiwyg is enabled $typeofdata = 'ckeditor' |
| 279 | 279 | $tmp = explode(':', $typeofdata); |
| 280 | 280 | $cols = (empty($tmp[2]) ? '' : $tmp[2]); |
| 281 | 281 | $morealt = ''; |
| 282 | 282 | if (preg_match('/%/', $cols)) { |
| 283 | - $morealt = ' style="width: ' . $cols . '"'; |
|
| 283 | + $morealt = ' style="width: '.$cols.'"'; |
|
| 284 | 284 | $cols = ''; |
| 285 | 285 | } |
| 286 | 286 | $valuetoshow = ($editvalue ? $editvalue : $value); |
| 287 | - $ret .= '<textarea id="' . $htmlname . '" name="' . $htmlname . '" wrap="soft" rows="' . (empty($tmp[1]) ? '20' : $tmp[1]) . '"' . ($cols ? ' cols="' . $cols . '"' : 'class="quatrevingtpercent"') . $morealt . '" autofocus>'; |
|
| 287 | + $ret .= '<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.(empty($tmp[1]) ? '20' : $tmp[1]).'"'.($cols ? ' cols="'.$cols.'"' : 'class="quatrevingtpercent"').$morealt.'" autofocus>'; |
|
| 288 | 288 | // textarea convert automatically entities chars into simple chars. |
| 289 | 289 | // So we convert & into & so a string like 'a < <b>b</b><br>é<br><script>alert('X');<script>' stay a correct html and is not converted by textarea component when wysiwig is off. |
| 290 | 290 | $valuetoshow = str_replace('&', '&', $valuetoshow); |
@@ -294,12 +294,12 @@ discard block |
||
| 294 | 294 | $addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink']; |
| 295 | 295 | $adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof']; |
| 296 | 296 | $labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof']; |
| 297 | - $ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
| 297 | + $ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
| 298 | 298 | } elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') { |
| 299 | 299 | $addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink']; |
| 300 | 300 | $adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof']; |
| 301 | 301 | $labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof']; |
| 302 | - $ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
| 302 | + $ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
| 303 | 303 | } elseif (preg_match('/^select;/', $typeofdata)) { |
| 304 | 304 | $arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata)); |
| 305 | 305 | $arraylist = array(); |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | // TODO Not yet implemented. See code for extrafields |
| 314 | 314 | } elseif (preg_match('/^ckeditor/', $typeofdata)) { |
| 315 | 315 | $tmp = explode(':', $typeofdata); // Example: ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols:uselocalbrowser |
| 316 | - require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; |
|
| 316 | + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
|
| 317 | 317 | $doleditor = new DolEditor($htmlname, ($editvalue ? $editvalue : $value), (empty($tmp[2]) ? '' : $tmp[2]), (empty($tmp[3]) ? '100' : $tmp[3]), (empty($tmp[1]) ? 'dolibarr_notes' : $tmp[1]), 'In', (empty($tmp[5]) ? 0 : $tmp[5]), (isset($tmp[8]) ? ($tmp[8] ? true : false) : true), true, (empty($tmp[6]) ? '20' : $tmp[6]), (empty($tmp[7]) ? '100' : $tmp[7])); |
| 318 | 318 | $ret .= $doleditor->Create(1); |
| 319 | 319 | } elseif ($typeofdata == 'asis') { |
@@ -328,19 +328,19 @@ discard block |
||
| 328 | 328 | $ret .= '<td>'; |
| 329 | 329 | } |
| 330 | 330 | //else $ret.='<div class="clearboth"></div>'; |
| 331 | - $ret .= '<input type="submit" class="smallpaddingimp button' . (empty($notabletag) ? '' : ' ') . '" name="modify" value="' . $langs->trans("Modify") . '">'; |
|
| 331 | + $ret .= '<input type="submit" class="smallpaddingimp button'.(empty($notabletag) ? '' : ' ').'" name="modify" value="'.$langs->trans("Modify").'">'; |
|
| 332 | 332 | if (preg_match('/ckeditor|textarea/', $typeofdata) && empty($notabletag)) { |
| 333 | - $ret .= '<br>' . "\n"; |
|
| 333 | + $ret .= '<br>'."\n"; |
|
| 334 | 334 | } |
| 335 | - $ret .= '<input type="submit" class="smallpaddingimp button button-cancel' . (empty($notabletag) ? '' : ' ') . '" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
| 335 | + $ret .= '<input type="submit" class="smallpaddingimp button button-cancel'.(empty($notabletag) ? '' : ' ').'" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
| 336 | 336 | if (empty($notabletag)) { |
| 337 | 337 | $ret .= '</td>'; |
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | if (empty($notabletag)) { |
| 341 | - $ret .= '</tr></table>' . "\n"; |
|
| 341 | + $ret .= '</tr></table>'."\n"; |
|
| 342 | 342 | } |
| 343 | - $ret .= '</form>' . "\n"; |
|
| 343 | + $ret .= '</form>'."\n"; |
|
| 344 | 344 | } else { // view mode |
| 345 | 345 | if (preg_match('/^email/', $typeofdata)) { |
| 346 | 346 | $ret .= dol_print_email($value, 0, 0, 0, 0, 1); |
@@ -352,15 +352,15 @@ discard block |
||
| 352 | 352 | $ret .= ($value != '' ? price($value, '', $langs, 0, -1, -1, $conf->currency) : ''); |
| 353 | 353 | } elseif (preg_match('/^checkbox/', $typeofdata)) { |
| 354 | 354 | $tmp = explode(':', $typeofdata); |
| 355 | - $ret .= '<input type="checkbox" disabled id="' . $htmlname . '" name="' . $htmlname . '" value="' . $value . '"' . ($value ? ' checked' : '') . ($tmp[1] ? $tmp[1] : '') . '/>'; |
|
| 355 | + $ret .= '<input type="checkbox" disabled id="'.$htmlname.'" name="'.$htmlname.'" value="'.$value.'"'.($value ? ' checked' : '').($tmp[1] ? $tmp[1] : '').'/>'; |
|
| 356 | 356 | } elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) { |
| 357 | 357 | $ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($value), 1, 1, 1)); |
| 358 | 358 | } elseif (preg_match('/^(safehtmlstring|restricthtml)/', $typeofdata)) { // 'restricthtml' is not an allowed type for editfieldval. Value is 'safehtmlstring' |
| 359 | 359 | $ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags($value)); |
| 360 | 360 | } elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') { |
| 361 | - $ret .= '<span class="valuedate">' . dol_print_date($value, 'day', $gm) . '</span>'; |
|
| 361 | + $ret .= '<span class="valuedate">'.dol_print_date($value, 'day', $gm).'</span>'; |
|
| 362 | 362 | } elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') { |
| 363 | - $ret .= '<span class="valuedate">' . dol_print_date($value, 'dayhour', $gm) . '</span>'; |
|
| 363 | + $ret .= '<span class="valuedate">'.dol_print_date($value, 'dayhour', $gm).'</span>'; |
|
| 364 | 364 | } elseif (preg_match('/^select;/', $typeofdata)) { |
| 365 | 365 | $arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata)); |
| 366 | 366 | $arraylist = array(); |
@@ -371,9 +371,9 @@ discard block |
||
| 371 | 371 | $ret .= $arraylist[$value]; |
| 372 | 372 | if ($htmlname == 'fk_product_type') { |
| 373 | 373 | if ($value == 0) { |
| 374 | - $ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret; |
|
| 374 | + $ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"').$ret; |
|
| 375 | 375 | } else { |
| 376 | - $ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret; |
|
| 376 | + $ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"').$ret; |
|
| 377 | 377 | } |
| 378 | 378 | } |
| 379 | 379 | } elseif (preg_match('/^ckeditor/', $typeofdata)) { |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) { |
| 382 | 382 | $firstline = preg_replace('/<br>.*/', '', $tmpcontent); |
| 383 | 383 | $firstline = preg_replace('/[\n\r].*/', '', $firstline); |
| 384 | - $tmpcontent = $firstline . ((strlen($firstline) != strlen($tmpcontent)) ? '...' : ''); |
|
| 384 | + $tmpcontent = $firstline.((strlen($firstline) != strlen($tmpcontent)) ? '...' : ''); |
|
| 385 | 385 | } |
| 386 | 386 | // We don't use dol_escape_htmltag to get the html formatting active, but this need we must also |
| 387 | 387 | // clean data from some dangerous html |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | if (empty($moreoptions['valuealreadyhtmlescaped'])) { |
| 391 | 391 | $ret .= dol_escape_htmltag($value); |
| 392 | 392 | } else { |
| 393 | - $ret .= $value; // $value must be already html escaped. |
|
| 393 | + $ret .= $value; // $value must be already html escaped. |
|
| 394 | 394 | } |
| 395 | 395 | } |
| 396 | 396 | |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | |
| 429 | 429 | if (is_array($arrayoflangcode) && count($arrayoflangcode)) { |
| 430 | 430 | if (!is_object($extralanguages)) { |
| 431 | - include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php'; |
|
| 431 | + include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php'; |
|
| 432 | 432 | $extralanguages = new ExtraLanguages($this->db); |
| 433 | 433 | } |
| 434 | 434 | $extralanguages->fetch_name_extralanguages('societe'); |
@@ -437,17 +437,17 @@ discard block |
||
| 437 | 437 | return ''; // No extralang field to show |
| 438 | 438 | } |
| 439 | 439 | |
| 440 | - $result .= '<!-- Widget for translation -->' . "\n"; |
|
| 441 | - $result .= '<div class="inline-block paddingleft image-' . $object->element . '-' . $fieldname . '">'; |
|
| 440 | + $result .= '<!-- Widget for translation -->'."\n"; |
|
| 441 | + $result .= '<div class="inline-block paddingleft image-'.$object->element.'-'.$fieldname.'">'; |
|
| 442 | 442 | $s = img_picto($langs->trans("ShowOtherLanguages"), 'language', '', false, 0, 0, '', 'fa-15 editfieldlang'); |
| 443 | 443 | $result .= $s; |
| 444 | 444 | $result .= '</div>'; |
| 445 | 445 | |
| 446 | - $result .= '<div class="inline-block hidden field-' . $object->element . '-' . $fieldname . '">'; |
|
| 446 | + $result .= '<div class="inline-block hidden field-'.$object->element.'-'.$fieldname.'">'; |
|
| 447 | 447 | |
| 448 | 448 | $resultforextrlang = ''; |
| 449 | 449 | foreach ($arrayoflangcode as $langcode) { |
| 450 | - $valuetoshow = GETPOSTISSET('field-' . $object->element . "-" . $fieldname . "-" . $langcode) ? GETPOST('field-' . $object->element . '-' . $fieldname . "-" . $langcode, $check) : ''; |
|
| 450 | + $valuetoshow = GETPOSTISSET('field-'.$object->element."-".$fieldname."-".$langcode) ? GETPOST('field-'.$object->element.'-'.$fieldname."-".$langcode, $check) : ''; |
|
| 451 | 451 | if (empty($valuetoshow)) { |
| 452 | 452 | $object->fetchValuesForExtraLanguages(); |
| 453 | 453 | //var_dump($object->array_languages); |
@@ -459,17 +459,17 @@ discard block |
||
| 459 | 459 | |
| 460 | 460 | // TODO Use the showInputField() method of ExtraLanguages object |
| 461 | 461 | if ($typeofdata == 'textarea') { |
| 462 | - $resultforextrlang .= '<textarea name="field-' . $object->element . "-" . $fieldname . "-" . $langcode . '" id="' . $fieldname . "-" . $langcode . '" class="' . $morecss . '" rows="' . ROWS_2 . '" wrap="soft">'; |
|
| 462 | + $resultforextrlang .= '<textarea name="field-'.$object->element."-".$fieldname."-".$langcode.'" id="'.$fieldname."-".$langcode.'" class="'.$morecss.'" rows="'.ROWS_2.'" wrap="soft">'; |
|
| 463 | 463 | $resultforextrlang .= $valuetoshow; |
| 464 | 464 | $resultforextrlang .= '</textarea>'; |
| 465 | 465 | } else { |
| 466 | - $resultforextrlang .= '<input type="text" class="inputfieldforlang ' . ($morecss ? ' ' . $morecss : '') . '" name="field-' . $object->element . '-' . $fieldname . '-' . $langcode . '" value="' . $valuetoshow . '">'; |
|
| 466 | + $resultforextrlang .= '<input type="text" class="inputfieldforlang '.($morecss ? ' '.$morecss : '').'" name="field-'.$object->element.'-'.$fieldname.'-'.$langcode.'" value="'.$valuetoshow.'">'; |
|
| 467 | 467 | } |
| 468 | 468 | } |
| 469 | 469 | $result .= $resultforextrlang; |
| 470 | 470 | |
| 471 | 471 | $result .= '</div>'; |
| 472 | - $result .= '<script nonce="' . getNonce() . '">$(".image-' . $object->element . '-' . $fieldname . '").click(function() { console.log("Toggle lang widget"); jQuery(".field-' . $object->element . '-' . $fieldname . '").toggle(); });</script>'; |
|
| 472 | + $result .= '<script nonce="'.getNonce().'">$(".image-'.$object->element.'-'.$fieldname.'").click(function() { console.log("Toggle lang widget"); jQuery(".field-'.$object->element.'-'.$fieldname.'").toggle(); });</script>'; |
|
| 473 | 473 | } |
| 474 | 474 | |
| 475 | 475 | return $result; |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | if (!empty($tmp[2])) { |
| 535 | 535 | $savemethod = $tmp[2]; |
| 536 | 536 | } |
| 537 | - $out .= '<input id="width_' . $htmlname . '" value="' . $inputOption . '" type="hidden"/>' . "\n"; |
|
| 537 | + $out .= '<input id="width_'.$htmlname.'" value="'.$inputOption.'" type="hidden"/>'."\n"; |
|
| 538 | 538 | } elseif ((preg_match('/^day$/', $inputType)) || (preg_match('/^datepicker/', $inputType)) || (preg_match('/^datehourpicker/', $inputType))) { |
| 539 | 539 | $tmp = explode(':', $inputType); |
| 540 | 540 | $inputType = $tmp[0]; |
@@ -545,7 +545,7 @@ discard block |
||
| 545 | 545 | $savemethod = $tmp[2]; |
| 546 | 546 | } |
| 547 | 547 | |
| 548 | - $out .= '<input id="timestamp" type="hidden"/>' . "\n"; // Use for timestamp format |
|
| 548 | + $out .= '<input id="timestamp" type="hidden"/>'."\n"; // Use for timestamp format |
|
| 549 | 549 | } elseif (preg_match('/^(select|autocomplete)/', $inputType)) { |
| 550 | 550 | $tmp = explode(':', $inputType); |
| 551 | 551 | $inputType = $tmp[0]; |
@@ -576,40 +576,40 @@ discard block |
||
| 576 | 576 | } |
| 577 | 577 | |
| 578 | 578 | if (isModEnabled('fckeditor')) { |
| 579 | - $out .= '<input id="ckeditor_toolbar" value="' . $toolbar . '" type="hidden"/>' . "\n"; |
|
| 579 | + $out .= '<input id="ckeditor_toolbar" value="'.$toolbar.'" type="hidden"/>'."\n"; |
|
| 580 | 580 | } else { |
| 581 | 581 | $inputType = 'textarea'; |
| 582 | 582 | } |
| 583 | 583 | } |
| 584 | 584 | |
| 585 | - $out .= '<input id="element_' . $htmlname . '" value="' . $element . '" type="hidden"/>' . "\n"; |
|
| 586 | - $out .= '<input id="table_element_' . $htmlname . '" value="' . $table_element . '" type="hidden"/>' . "\n"; |
|
| 587 | - $out .= '<input id="fk_element_' . $htmlname . '" value="' . $fk_element . '" type="hidden"/>' . "\n"; |
|
| 588 | - $out .= '<input id="loadmethod_' . $htmlname . '" value="' . $loadmethod . '" type="hidden"/>' . "\n"; |
|
| 585 | + $out .= '<input id="element_'.$htmlname.'" value="'.$element.'" type="hidden"/>'."\n"; |
|
| 586 | + $out .= '<input id="table_element_'.$htmlname.'" value="'.$table_element.'" type="hidden"/>'."\n"; |
|
| 587 | + $out .= '<input id="fk_element_'.$htmlname.'" value="'.$fk_element.'" type="hidden"/>'."\n"; |
|
| 588 | + $out .= '<input id="loadmethod_'.$htmlname.'" value="'.$loadmethod.'" type="hidden"/>'."\n"; |
|
| 589 | 589 | if (!empty($savemethod)) { |
| 590 | - $out .= '<input id="savemethod_' . $htmlname . '" value="' . $savemethod . '" type="hidden"/>' . "\n"; |
|
| 590 | + $out .= '<input id="savemethod_'.$htmlname.'" value="'.$savemethod.'" type="hidden"/>'."\n"; |
|
| 591 | 591 | } |
| 592 | 592 | if (!empty($ext_element)) { |
| 593 | - $out .= '<input id="ext_element_' . $htmlname . '" value="' . $ext_element . '" type="hidden"/>' . "\n"; |
|
| 593 | + $out .= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n"; |
|
| 594 | 594 | } |
| 595 | 595 | if (!empty($custommsg)) { |
| 596 | 596 | if (is_array($custommsg)) { |
| 597 | 597 | if (!empty($custommsg['success'])) { |
| 598 | - $out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg['success'] . '" type="hidden"/>' . "\n"; |
|
| 598 | + $out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg['success'].'" type="hidden"/>'."\n"; |
|
| 599 | 599 | } |
| 600 | 600 | if (!empty($custommsg['error'])) { |
| 601 | - $out .= '<input id="errormsg_' . $htmlname . '" value="' . $custommsg['error'] . '" type="hidden"/>' . "\n"; |
|
| 601 | + $out .= '<input id="errormsg_'.$htmlname.'" value="'.$custommsg['error'].'" type="hidden"/>'."\n"; |
|
| 602 | 602 | } |
| 603 | 603 | } else { |
| 604 | - $out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg . '" type="hidden"/>' . "\n"; |
|
| 604 | + $out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg.'" type="hidden"/>'."\n"; |
|
| 605 | 605 | } |
| 606 | 606 | } |
| 607 | 607 | if ($inputType == 'textarea') { |
| 608 | - $out .= '<input id="textarea_' . $htmlname . '_rows" value="' . $rows . '" type="hidden"/>' . "\n"; |
|
| 609 | - $out .= '<input id="textarea_' . $htmlname . '_cols" value="' . $cols . '" type="hidden"/>' . "\n"; |
|
| 608 | + $out .= '<input id="textarea_'.$htmlname.'_rows" value="'.$rows.'" type="hidden"/>'."\n"; |
|
| 609 | + $out .= '<input id="textarea_'.$htmlname.'_cols" value="'.$cols.'" type="hidden"/>'."\n"; |
|
| 610 | 610 | } |
| 611 | - $out .= '<span id="viewval_' . $htmlname . '" class="viewval_' . $inputType . ($button_only ? ' inactive' : ' active') . '">' . $value . '</span>' . "\n"; |
|
| 612 | - $out .= '<span id="editval_' . $htmlname . '" class="editval_' . $inputType . ($button_only ? ' inactive' : ' active') . ' hideobject">' . (!empty($editvalue) ? $editvalue : $value) . '</span>' . "\n"; |
|
| 611 | + $out .= '<span id="viewval_'.$htmlname.'" class="viewval_'.$inputType.($button_only ? ' inactive' : ' active').'">'.$value.'</span>'."\n"; |
|
| 612 | + $out .= '<span id="editval_'.$htmlname.'" class="editval_'.$inputType.($button_only ? ' inactive' : ' active').' hideobject">'.(!empty($editvalue) ? $editvalue : $value).'</span>'."\n"; |
|
| 613 | 613 | } else { |
| 614 | 614 | $out = $value; |
| 615 | 615 | } |
@@ -638,12 +638,12 @@ discard block |
||
| 638 | 638 | public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 3, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0) |
| 639 | 639 | { |
| 640 | 640 | if ($incbefore) { |
| 641 | - $text = $incbefore . $text; |
|
| 641 | + $text = $incbefore.$text; |
|
| 642 | 642 | } |
| 643 | 643 | if (!$htmltext) { |
| 644 | 644 | return $text; |
| 645 | 645 | } |
| 646 | - $direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0 |
|
| 646 | + $direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0 |
|
| 647 | 647 | |
| 648 | 648 | $tag = 'td'; |
| 649 | 649 | if ($notabs == 2) { |
@@ -657,11 +657,11 @@ discard block |
||
| 657 | 657 | |
| 658 | 658 | $extrastyle = ''; |
| 659 | 659 | if ($direction < 0) { |
| 660 | - $extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : ''); |
|
| 660 | + $extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : ''); |
|
| 661 | 661 | $extrastyle = 'padding: 0px; padding-left: 3px;'; |
| 662 | 662 | } |
| 663 | 663 | if ($direction > 0) { |
| 664 | - $extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : ''); |
|
| 664 | + $extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : ''); |
|
| 665 | 665 | $extrastyle = 'padding: 0px; padding-right: 3px;'; |
| 666 | 666 | } |
| 667 | 667 | |
@@ -674,53 +674,53 @@ discard block |
||
| 674 | 674 | $htmltext = str_replace('"', '"', $htmltext); |
| 675 | 675 | } else { |
| 676 | 676 | $classfortooltip = 'classfortooltiponclick'; |
| 677 | - $textfordialog .= '<div style="display: none;" id="idfortooltiponclick_' . $tooltiptrigger . '" class="classfortooltiponclicktext">' . $htmltext . '</div>'; |
|
| 677 | + $textfordialog .= '<div style="display: none;" id="idfortooltiponclick_'.$tooltiptrigger.'" class="classfortooltiponclicktext">'.$htmltext.'</div>'; |
|
| 678 | 678 | } |
| 679 | 679 | if ($tooltipon == 2 || $tooltipon == 3) { |
| 680 | - $paramfortooltipimg = ' class="' . $classfortooltip . ($notabs != 3 ? ' inline-block' : '') . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '"'; |
|
| 680 | + $paramfortooltipimg = ' class="'.$classfortooltip.($notabs != 3 ? ' inline-block' : '').($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'"'; |
|
| 681 | 681 | if ($tooltiptrigger == '') { |
| 682 | - $paramfortooltipimg .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on img tag to store tooltip |
|
| 682 | + $paramfortooltipimg .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on img tag to store tooltip |
|
| 683 | 683 | } else { |
| 684 | - $paramfortooltipimg .= ' dolid="' . $tooltiptrigger . '"'; |
|
| 684 | + $paramfortooltipimg .= ' dolid="'.$tooltiptrigger.'"'; |
|
| 685 | 685 | } |
| 686 | 686 | } else { |
| 687 | - $paramfortooltipimg = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag |
|
| 687 | + $paramfortooltipimg = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag |
|
| 688 | 688 | } |
| 689 | 689 | if ($tooltipon == 1 || $tooltipon == 3) { |
| 690 | - $paramfortooltiptd = ' class="' . ($tooltipon == 3 ? 'cursorpointer ' : '') . $classfortooltip . ' inline-block' . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '" '; |
|
| 690 | + $paramfortooltiptd = ' class="'.($tooltipon == 3 ? 'cursorpointer ' : '').$classfortooltip.' inline-block'.($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'" '; |
|
| 691 | 691 | if ($tooltiptrigger == '') { |
| 692 | - $paramfortooltiptd .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on td tag to store tooltip |
|
| 692 | + $paramfortooltiptd .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on td tag to store tooltip |
|
| 693 | 693 | } else { |
| 694 | - $paramfortooltiptd .= ' dolid="' . $tooltiptrigger . '"'; |
|
| 694 | + $paramfortooltiptd .= ' dolid="'.$tooltiptrigger.'"'; |
|
| 695 | 695 | } |
| 696 | 696 | } else { |
| 697 | - $paramfortooltiptd = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag |
|
| 697 | + $paramfortooltiptd = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag |
|
| 698 | 698 | } |
| 699 | 699 | if (empty($notabs)) { |
| 700 | 700 | $s .= '<table class="nobordernopadding"><tr style="height: auto;">'; |
| 701 | 701 | } elseif ($notabs == 2) { |
| 702 | - $s .= '<div class="inline-block' . ($forcenowrap ? ' nowrap' : '') . '">'; |
|
| 702 | + $s .= '<div class="inline-block'.($forcenowrap ? ' nowrap' : '').'">'; |
|
| 703 | 703 | } |
| 704 | 704 | // Define value if value is before |
| 705 | 705 | if ($direction < 0) { |
| 706 | - $s .= '<' . $tag . $paramfortooltipimg; |
|
| 706 | + $s .= '<'.$tag.$paramfortooltipimg; |
|
| 707 | 707 | if ($tag == 'td') { |
| 708 | 708 | $s .= ' class="valigntop" width="14"'; |
| 709 | 709 | } |
| 710 | - $s .= '>' . $textfordialog . $img . '</' . $tag . '>'; |
|
| 710 | + $s .= '>'.$textfordialog.$img.'</'.$tag.'>'; |
|
| 711 | 711 | } |
| 712 | 712 | // Use another method to help avoid having a space in value in order to use this value with jquery |
| 713 | 713 | // Define label |
| 714 | 714 | if ((string) $text != '') { |
| 715 | - $s .= '<' . $tag . $paramfortooltiptd . '>' . $text . '</' . $tag . '>'; |
|
| 715 | + $s .= '<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>'; |
|
| 716 | 716 | } |
| 717 | 717 | // Define value if value is after |
| 718 | 718 | if ($direction > 0) { |
| 719 | - $s .= '<' . $tag . $paramfortooltipimg; |
|
| 719 | + $s .= '<'.$tag.$paramfortooltipimg; |
|
| 720 | 720 | if ($tag == 'td') { |
| 721 | 721 | $s .= ' class="valignmiddle" width="14"'; |
| 722 | 722 | } |
| 723 | - $s .= '>' . $textfordialog . $img . '</' . $tag . '>'; |
|
| 723 | + $s .= '>'.$textfordialog.$img.'</'.$tag.'>'; |
|
| 724 | 724 | } |
| 725 | 725 | if (empty($notabs)) { |
| 726 | 726 | $s .= '</tr></table>'; |
@@ -824,7 +824,7 @@ discard block |
||
| 824 | 824 | |
| 825 | 825 | $disabled = 0; |
| 826 | 826 | $ret = '<div class="centpercent center">'; |
| 827 | - $ret .= '<select class="flat' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'select valignmiddle alignstart" id="' . $name . '" name="' . $name . '"' . ($disabled ? ' disabled="disabled"' : '') . '>'; |
|
| 827 | + $ret .= '<select class="flat'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'select valignmiddle alignstart" id="'.$name.'" name="'.$name.'"'.($disabled ? ' disabled="disabled"' : '').'>'; |
|
| 828 | 828 | |
| 829 | 829 | // Complete list with data from external modules. THe module can use $_SERVER['PHP_SELF'] to know on which page we are, or use the $parameters['currentcontext'] completed by executeHooks. |
| 830 | 830 | $parameters = array(); |
@@ -834,9 +834,9 @@ discard block |
||
| 834 | 834 | return; |
| 835 | 835 | } |
| 836 | 836 | if (empty($reshook)) { |
| 837 | - $ret .= '<option value="0"' . ($disabled ? ' disabled="disabled"' : '') . '>-- ' . $langs->trans("SelectAction") . ' --</option>'; |
|
| 837 | + $ret .= '<option value="0"'.($disabled ? ' disabled="disabled"' : '').'>-- '.$langs->trans("SelectAction").' --</option>'; |
|
| 838 | 838 | foreach ($arrayofaction as $code => $label) { |
| 839 | - $ret .= '<option value="' . $code . '"' . ($disabled ? ' disabled="disabled"' : '') . ' data-html="' . dol_escape_htmltag($label) . '">' . $label . '</option>'; |
|
| 839 | + $ret .= '<option value="'.$code.'"'.($disabled ? ' disabled="disabled"' : '').' data-html="'.dol_escape_htmltag($label).'">'.$label.'</option>'; |
|
| 840 | 840 | } |
| 841 | 841 | } |
| 842 | 842 | $ret .= $hookmanager->resPrint; |
@@ -844,17 +844,17 @@ discard block |
||
| 844 | 844 | $ret .= '</select>'; |
| 845 | 845 | |
| 846 | 846 | if (empty($conf->dol_optimize_smallscreen)) { |
| 847 | - $ret .= ajax_combobox('.' . $name . 'select'); |
|
| 847 | + $ret .= ajax_combobox('.'.$name.'select'); |
|
| 848 | 848 | } |
| 849 | 849 | |
| 850 | 850 | // Warning: if you set submit button to disabled, post using 'Enter' will no more work if there is no another input submit. So we add a hidden button |
| 851 | 851 | $ret .= '<input type="submit" name="confirmmassactioninvisible" style="display: none" tabindex="-1">'; // Hidden button BEFORE so it is the one used when we submit with ENTER. |
| 852 | - $ret .= '<input type="submit" disabled name="confirmmassaction"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display: none"') . ' class="reposition button smallpaddingimp' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'confirmed" value="' . dol_escape_htmltag($langs->trans("Confirm")) . '">'; |
|
| 852 | + $ret .= '<input type="submit" disabled name="confirmmassaction"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display: none"').' class="reposition button smallpaddingimp'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'confirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">'; |
|
| 853 | 853 | $ret .= '</div>'; |
| 854 | 854 | |
| 855 | 855 | if (!empty($conf->use_javascript_ajax)) { |
| 856 | 856 | $ret .= '<!-- JS CODE TO ENABLE mass action select --> |
| 857 | - <script nonce="' . getNonce() . '"> |
|
| 857 | + <script nonce="' . getNonce().'"> |
|
| 858 | 858 | function initCheckForSelect(mode, name, cssclass) /* mode is 0 during init of page or click all, 1 when we click on 1 checkboxi, "name" refers to the class of the massaction button, "cssclass" to the class of the checkfor select boxes */ |
| 859 | 859 | { |
| 860 | 860 | atleastoneselected=0; |
@@ -865,11 +865,11 @@ discard block |
||
| 865 | 865 | |
| 866 | 866 | console.log("initCheckForSelect mode="+mode+" name="+name+" cssclass="+cssclass+" atleastoneselected="+atleastoneselected); |
| 867 | 867 | |
| 868 | - if (atleastoneselected || ' . $alwaysvisible . ') |
|
| 868 | + if (atleastoneselected || ' . $alwaysvisible.') |
|
| 869 | 869 | { |
| 870 | 870 | jQuery("."+name).show(); |
| 871 | - ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("' . $selected . '").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '') . ' |
|
| 872 | - ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '') . ' |
|
| 871 | + ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("'.$selected.'").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '').' |
|
| 872 | + ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '').' |
|
| 873 | 873 | } |
| 874 | 874 | else |
| 875 | 875 | { |
@@ -879,11 +879,11 @@ discard block |
||
| 879 | 879 | } |
| 880 | 880 | |
| 881 | 881 | jQuery(document).ready(function () { |
| 882 | - initCheckForSelect(0, "' . $name . '", "' . $cssclass . '"); |
|
| 883 | - jQuery(".' . $cssclass . '").click(function() { |
|
| 884 | - initCheckForSelect(1, "' . $name . '", "' . $cssclass . '"); |
|
| 882 | + initCheckForSelect(0, "' . $name.'", "'.$cssclass.'"); |
|
| 883 | + jQuery(".' . $cssclass.'").click(function() { |
|
| 884 | + initCheckForSelect(1, "' . $name.'", "'.$cssclass.'"); |
|
| 885 | 885 | }); |
| 886 | - jQuery(".' . $name . 'select").change(function() { |
|
| 886 | + jQuery(".' . $name.'select").change(function() { |
|
| 887 | 887 | var massaction = $( this ).val(); |
| 888 | 888 | var urlform = $( this ).closest("form").attr("action").replace("#show_files",""); |
| 889 | 889 | if (massaction == "builddoc") |
@@ -891,18 +891,18 @@ discard block |
||
| 891 | 891 | urlform = urlform + "#show_files"; |
| 892 | 892 | } |
| 893 | 893 | $( this ).closest("form").attr("action", urlform); |
| 894 | - console.log("we select a mass action name=' . $name . ' massaction="+massaction+" - "+urlform); |
|
| 894 | + console.log("we select a mass action name=' . $name.' massaction="+massaction+" - "+urlform); |
|
| 895 | 895 | /* Warning: if you set submit button to disabled, post using Enter will no more work if there is no other button */ |
| 896 | 896 | if ($(this).val() != \'0\') |
| 897 | 897 | { |
| 898 | - jQuery(".' . $name . 'confirmed").prop(\'disabled\', false); |
|
| 899 | - jQuery(".' . $name . 'other").hide(); /* To disable if another div was open */ |
|
| 900 | - jQuery(".' . $name . '"+massaction).show(); |
|
| 898 | + jQuery(".' . $name.'confirmed").prop(\'disabled\', false); |
|
| 899 | + jQuery(".' . $name.'other").hide(); /* To disable if another div was open */ |
|
| 900 | + jQuery(".' . $name.'"+massaction).show(); |
|
| 901 | 901 | } |
| 902 | 902 | else |
| 903 | 903 | { |
| 904 | - jQuery(".' . $name . 'confirmed").prop(\'disabled\', true); |
|
| 905 | - jQuery(".' . $name . 'other").hide(); /* To disable any div open */ |
|
| 904 | + jQuery(".' . $name.'confirmed").prop(\'disabled\', true); |
|
| 905 | + jQuery(".' . $name.'other").hide(); /* To disable any div open */ |
|
| 906 | 906 | } |
| 907 | 907 | }); |
| 908 | 908 | }); |
@@ -945,14 +945,14 @@ discard block |
||
| 945 | 945 | $atleastonefavorite = 0; |
| 946 | 946 | |
| 947 | 947 | $sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite, eec"; |
| 948 | - $sql .= " FROM " . $this->db->prefix() . "c_country"; |
|
| 948 | + $sql .= " FROM ".$this->db->prefix()."c_country"; |
|
| 949 | 949 | $sql .= " WHERE active > 0"; |
| 950 | 950 | //$sql.= " ORDER BY code ASC"; |
| 951 | 951 | |
| 952 | - dol_syslog(get_class($this) . "::select_country", LOG_DEBUG); |
|
| 952 | + dol_syslog(get_class($this)."::select_country", LOG_DEBUG); |
|
| 953 | 953 | $resql = $this->db->query($sql); |
| 954 | 954 | if ($resql) { |
| 955 | - $out .= '<select id="select' . $htmlname . '" class="flat maxwidth200onsmartphone selectcountry' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" ' . $htmloption . '>'; |
|
| 955 | + $out .= '<select id="select'.$htmlname.'" class="flat maxwidth200onsmartphone selectcountry'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" '.$htmloption.'>'; |
|
| 956 | 956 | $num = $this->db->num_rows($resql); |
| 957 | 957 | $i = 0; |
| 958 | 958 | if ($num) { |
@@ -962,7 +962,7 @@ discard block |
||
| 962 | 962 | $countryArray[$i]['rowid'] = $obj->rowid; |
| 963 | 963 | $countryArray[$i]['code_iso'] = $obj->code_iso; |
| 964 | 964 | $countryArray[$i]['code_iso3'] = $obj->code_iso3; |
| 965 | - $countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country" . $obj->code_iso) != "Country" . $obj->code_iso ? $langs->transnoentitiesnoconv("Country" . $obj->code_iso) : ($obj->label != '-' ? $obj->label : '')); |
|
| 965 | + $countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country".$obj->code_iso) != "Country".$obj->code_iso ? $langs->transnoentitiesnoconv("Country".$obj->code_iso) : ($obj->label != '-' ? $obj->label : '')); |
|
| 966 | 966 | $countryArray[$i]['favorite'] = $obj->favorite; |
| 967 | 967 | $countryArray[$i]['eec'] = $obj->eec; |
| 968 | 968 | $favorite[$i] = $obj->favorite; |
@@ -980,20 +980,20 @@ discard block |
||
| 980 | 980 | |
| 981 | 981 | if ($showempty) { |
| 982 | 982 | if (is_numeric($showempty)) { |
| 983 | - $out .= '<option value=""> </option>' . "\n"; |
|
| 983 | + $out .= '<option value=""> </option>'."\n"; |
|
| 984 | 984 | } else { |
| 985 | - $out .= '<option value="-1">' . $langs->trans($showempty) . '</option>' . "\n"; |
|
| 985 | + $out .= '<option value="-1">'.$langs->trans($showempty).'</option>'."\n"; |
|
| 986 | 986 | } |
| 987 | 987 | } |
| 988 | 988 | |
| 989 | 989 | if ($addspecialentries) { // Add dedicated entries for groups of countries |
| 990 | 990 | //if ($showempty) $out.= '<option value="" disabled class="selectoptiondisabledwhite">--------------</option>'; |
| 991 | - $out .= '<option value="special_allnotme"' . ($selected == 'special_allnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>'; |
|
| 992 | - $out .= '<option value="special_eec"' . ($selected == 'special_eec' ? ' selected' : '') . '>' . $langs->trans("CountriesInEEC") . '</option>'; |
|
| 991 | + $out .= '<option value="special_allnotme"'.($selected == 'special_allnotme' ? ' selected' : '').'>'.$langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>'; |
|
| 992 | + $out .= '<option value="special_eec"'.($selected == 'special_eec' ? ' selected' : '').'>'.$langs->trans("CountriesInEEC").'</option>'; |
|
| 993 | 993 | if ($mysoc->isInEEC()) { |
| 994 | - $out .= '<option value="special_eecnotme"' . ($selected == 'special_eecnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>'; |
|
| 994 | + $out .= '<option value="special_eecnotme"'.($selected == 'special_eecnotme' ? ' selected' : '').'>'.$langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>'; |
|
| 995 | 995 | } |
| 996 | - $out .= '<option value="special_noteec"' . ($selected == 'special_noteec' ? ' selected' : '') . '>' . $langs->trans("CountriesNotInEEC") . '</option>'; |
|
| 996 | + $out .= '<option value="special_noteec"'.($selected == 'special_noteec' ? ' selected' : '').'>'.$langs->trans("CountriesNotInEEC").'</option>'; |
|
| 997 | 997 | $out .= '<option value="" disabled class="selectoptiondisabledwhite">------------</option>'; |
| 998 | 998 | } |
| 999 | 999 | |
@@ -1021,20 +1021,20 @@ discard block |
||
| 1021 | 1021 | $labeltoshow .= ' '; |
| 1022 | 1022 | } |
| 1023 | 1023 | if ($row['code_iso']) { |
| 1024 | - $labeltoshow .= ' <span class="opacitymedium">(' . $row['code_iso'] . ')</span>'; |
|
| 1024 | + $labeltoshow .= ' <span class="opacitymedium">('.$row['code_iso'].')</span>'; |
|
| 1025 | 1025 | if (empty($hideflags)) { |
| 1026 | 1026 | $tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium paddingrightonly"', 1); |
| 1027 | - $labeltoshow = $tmpflag . ' ' . $labeltoshow; |
|
| 1027 | + $labeltoshow = $tmpflag.' '.$labeltoshow; |
|
| 1028 | 1028 | } |
| 1029 | 1029 | } |
| 1030 | 1030 | |
| 1031 | 1031 | if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label'])) { |
| 1032 | - $out .= '<option value="' . ($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']) . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '" data-eec="' . ((int) $row['eec']) . '">'; |
|
| 1032 | + $out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" selected data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">'; |
|
| 1033 | 1033 | } else { |
| 1034 | - $out .= '<option value="' . ($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']) . '" data-html="' . dol_escape_htmltag($labeltoshow) . '" data-eec="' . ((int) $row['eec']) . '">'; |
|
| 1034 | + $out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">'; |
|
| 1035 | 1035 | } |
| 1036 | 1036 | $out .= $labeltoshow; |
| 1037 | - $out .= '</option>' . "\n"; |
|
| 1037 | + $out .= '</option>'."\n"; |
|
| 1038 | 1038 | } |
| 1039 | 1039 | } |
| 1040 | 1040 | $out .= '</select>'; |
@@ -1043,8 +1043,8 @@ discard block |
||
| 1043 | 1043 | } |
| 1044 | 1044 | |
| 1045 | 1045 | // Make select dynamic |
| 1046 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1047 | - $out .= ajax_combobox('select' . $htmlname, array(), 0, 0, 'resolve'); |
|
| 1046 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1047 | + $out .= ajax_combobox('select'.$htmlname, array(), 0, 0, 'resolve'); |
|
| 1048 | 1048 | |
| 1049 | 1049 | return $out; |
| 1050 | 1050 | } |
@@ -1076,25 +1076,25 @@ discard block |
||
| 1076 | 1076 | $incotermArray = array(); |
| 1077 | 1077 | |
| 1078 | 1078 | $sql = "SELECT rowid, code"; |
| 1079 | - $sql .= " FROM " . $this->db->prefix() . "c_incoterms"; |
|
| 1079 | + $sql .= " FROM ".$this->db->prefix()."c_incoterms"; |
|
| 1080 | 1080 | $sql .= " WHERE active > 0"; |
| 1081 | 1081 | $sql .= " ORDER BY code ASC"; |
| 1082 | 1082 | |
| 1083 | - dol_syslog(get_class($this) . "::select_incoterm", LOG_DEBUG); |
|
| 1083 | + dol_syslog(get_class($this)."::select_incoterm", LOG_DEBUG); |
|
| 1084 | 1084 | $resql = $this->db->query($sql); |
| 1085 | 1085 | if ($resql) { |
| 1086 | 1086 | if ($conf->use_javascript_ajax && !$forcecombo) { |
| 1087 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1087 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1088 | 1088 | $out .= ajax_combobox($htmlname, $events); |
| 1089 | 1089 | } |
| 1090 | 1090 | |
| 1091 | 1091 | if (!empty($page)) { |
| 1092 | - $out .= '<form method="post" action="' . $page . '">'; |
|
| 1092 | + $out .= '<form method="post" action="'.$page.'">'; |
|
| 1093 | 1093 | $out .= '<input type="hidden" name="action" value="set_incoterms">'; |
| 1094 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 1094 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 1095 | 1095 | } |
| 1096 | 1096 | |
| 1097 | - $out .= '<select id="' . $htmlname . '" class="flat selectincoterm width75" name="' . $htmlname . '" ' . $htmloption . '>'; |
|
| 1097 | + $out .= '<select id="'.$htmlname.'" class="flat selectincoterm width75" name="'.$htmlname.'" '.$htmloption.'>'; |
|
| 1098 | 1098 | $out .= '<option value="0"> </option>'; |
| 1099 | 1099 | $num = $this->db->num_rows($resql); |
| 1100 | 1100 | $i = 0; |
@@ -1108,9 +1108,9 @@ discard block |
||
| 1108 | 1108 | |
| 1109 | 1109 | foreach ($incotermArray as $row) { |
| 1110 | 1110 | if ($selected && ($selected == $row['rowid'] || $selected == $row['code'])) { |
| 1111 | - $out .= '<option value="' . $row['rowid'] . '" selected>'; |
|
| 1111 | + $out .= '<option value="'.$row['rowid'].'" selected>'; |
|
| 1112 | 1112 | } else { |
| 1113 | - $out .= '<option value="' . $row['rowid'] . '">'; |
|
| 1113 | + $out .= '<option value="'.$row['rowid'].'">'; |
|
| 1114 | 1114 | } |
| 1115 | 1115 | |
| 1116 | 1116 | if ($row['code']) { |
@@ -1123,13 +1123,13 @@ discard block |
||
| 1123 | 1123 | $out .= '</select>'; |
| 1124 | 1124 | |
| 1125 | 1125 | if ($conf->use_javascript_ajax && empty($disableautocomplete)) { |
| 1126 | - $out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT . '/core/ajax/locationincoterms.php') . "\n"; |
|
| 1126 | + $out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT.'/core/ajax/locationincoterms.php')."\n"; |
|
| 1127 | 1127 | $moreattrib .= ' autocomplete="off"'; |
| 1128 | 1128 | } |
| 1129 | - $out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="' . $location_incoterms . '">' . "\n"; |
|
| 1129 | + $out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="'.$location_incoterms.'">'."\n"; |
|
| 1130 | 1130 | |
| 1131 | 1131 | if (!empty($page)) { |
| 1132 | - $out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="' . $langs->trans("Modify") . '"></form>'; |
|
| 1132 | + $out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="'.$langs->trans("Modify").'"></form>'; |
|
| 1133 | 1133 | } |
| 1134 | 1134 | } else { |
| 1135 | 1135 | dol_print_error($this->db); |
@@ -1160,9 +1160,9 @@ discard block |
||
| 1160 | 1160 | if ($forceall == 1 || (empty($forceall) && isModEnabled("product") && isModEnabled("service")) |
| 1161 | 1161 | || (empty($forceall) && !isModEnabled('product') && !isModEnabled('service'))) { |
| 1162 | 1162 | if (empty($hidetext)) { |
| 1163 | - print $langs->trans("Type") . ': '; |
|
| 1163 | + print $langs->trans("Type").': '; |
|
| 1164 | 1164 | } |
| 1165 | - print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 1165 | + print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 1166 | 1166 | if ($showempty) { |
| 1167 | 1167 | print '<option value="-1"'; |
| 1168 | 1168 | if ($selected == -1) { |
@@ -1175,28 +1175,28 @@ discard block |
||
| 1175 | 1175 | if (0 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'product')) { |
| 1176 | 1176 | print ' selected'; |
| 1177 | 1177 | } |
| 1178 | - print '>' . $langs->trans("Product"); |
|
| 1178 | + print '>'.$langs->trans("Product"); |
|
| 1179 | 1179 | |
| 1180 | 1180 | print '<option value="1"'; |
| 1181 | 1181 | if (1 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'service')) { |
| 1182 | 1182 | print ' selected'; |
| 1183 | 1183 | } |
| 1184 | - print '>' . $langs->trans("Service"); |
|
| 1184 | + print '>'.$langs->trans("Service"); |
|
| 1185 | 1185 | |
| 1186 | 1186 | print '</select>'; |
| 1187 | - print ajax_combobox('select_' . $htmlname); |
|
| 1187 | + print ajax_combobox('select_'.$htmlname); |
|
| 1188 | 1188 | //if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); |
| 1189 | 1189 | } |
| 1190 | 1190 | if ((empty($forceall) && !isModEnabled('product') && isModEnabled("service")) || $forceall == 3) { |
| 1191 | 1191 | print $langs->trans("Service"); |
| 1192 | - print '<input type="hidden" name="' . $htmlname . '" value="1">'; |
|
| 1192 | + print '<input type="hidden" name="'.$htmlname.'" value="1">'; |
|
| 1193 | 1193 | } |
| 1194 | 1194 | if ((empty($forceall) && isModEnabled("product") && !isModEnabled('service')) || $forceall == 2) { |
| 1195 | 1195 | print $langs->trans("Product"); |
| 1196 | - print '<input type="hidden" name="' . $htmlname . '" value="0">'; |
|
| 1196 | + print '<input type="hidden" name="'.$htmlname.'" value="0">'; |
|
| 1197 | 1197 | } |
| 1198 | 1198 | if ($forceall < 0) { // This should happened only for contracts when both predefined product and service are disabled. |
| 1199 | - print '<input type="hidden" name="' . $htmlname . '" value="1">'; // By default we set on service for contract. If CONTRACT_SUPPORT_PRODUCTS is set, forceall should be 1 not -1 |
|
| 1199 | + print '<input type="hidden" name="'.$htmlname.'" value="1">'; // By default we set on service for contract. If CONTRACT_SUPPORT_PRODUCTS is set, forceall should be 1 not -1 |
|
| 1200 | 1200 | } |
| 1201 | 1201 | } |
| 1202 | 1202 | |
@@ -1222,7 +1222,7 @@ discard block |
||
| 1222 | 1222 | $langs->load("trips"); |
| 1223 | 1223 | |
| 1224 | 1224 | $sql = "SELECT c.code, c.label"; |
| 1225 | - $sql .= " FROM " . $this->db->prefix() . "c_type_fees as c"; |
|
| 1225 | + $sql .= " FROM ".$this->db->prefix()."c_type_fees as c"; |
|
| 1226 | 1226 | $sql .= " WHERE active > 0"; |
| 1227 | 1227 | |
| 1228 | 1228 | $resql = $this->db->query($sql); |
@@ -1263,11 +1263,11 @@ discard block |
||
| 1263 | 1263 | // phpcs:enable |
| 1264 | 1264 | global $user, $langs; |
| 1265 | 1265 | |
| 1266 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 1266 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 1267 | 1267 | |
| 1268 | 1268 | $this->load_cache_types_fees(); |
| 1269 | 1269 | |
| 1270 | - print '<select id="select_' . $htmlname . '" class="flat" name="' . $htmlname . '">'; |
|
| 1270 | + print '<select id="select_'.$htmlname.'" class="flat" name="'.$htmlname.'">'; |
|
| 1271 | 1271 | if ($showempty) { |
| 1272 | 1272 | print '<option value="-1"'; |
| 1273 | 1273 | if ($selected == -1) { |
@@ -1277,7 +1277,7 @@ discard block |
||
| 1277 | 1277 | } |
| 1278 | 1278 | |
| 1279 | 1279 | foreach ($this->cache_types_fees as $key => $value) { |
| 1280 | - print '<option value="' . $key . '"'; |
|
| 1280 | + print '<option value="'.$key.'"'; |
|
| 1281 | 1281 | if ($key == $selected) { |
| 1282 | 1282 | print ' selected'; |
| 1283 | 1283 | } |
@@ -1328,12 +1328,12 @@ discard block |
||
| 1328 | 1328 | $ajaxoptions = array(); |
| 1329 | 1329 | } |
| 1330 | 1330 | |
| 1331 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1331 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1332 | 1332 | |
| 1333 | 1333 | // No immediate load of all database |
| 1334 | 1334 | $placeholder = ''; |
| 1335 | 1335 | if ($selected && empty($selected_input_value)) { |
| 1336 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 1336 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 1337 | 1337 | $societetmp = new Societe($this->db); |
| 1338 | 1338 | $societetmp->fetch($selected); |
| 1339 | 1339 | $selected_input_value = $societetmp->name; |
@@ -1341,25 +1341,25 @@ discard block |
||
| 1341 | 1341 | } |
| 1342 | 1342 | |
| 1343 | 1343 | // mode 1 |
| 1344 | - $urloption = 'htmlname=' . urlencode(str_replace('.', '_', $htmlname)) . '&outjson=1&filter=' . urlencode($filter) . (empty($excludeids) ? '' : '&excludeids=' . implode(',', $excludeids)) . ($showtype ? '&showtype=' . urlencode($showtype) : '') . ($showcode ? '&showcode=' . urlencode($showcode) : ''); |
|
| 1344 | + $urloption = 'htmlname='.urlencode(str_replace('.', '_', $htmlname)).'&outjson=1&filter='.urlencode($filter).(empty($excludeids) ? '' : '&excludeids='.implode(',', $excludeids)).($showtype ? '&showtype='.urlencode($showtype) : '').($showcode ? '&showcode='.urlencode($showcode) : ''); |
|
| 1345 | 1345 | |
| 1346 | 1346 | $out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
| 1347 | 1347 | if (empty($hidelabel)) { |
| 1348 | - print $langs->trans("RefOrLabel") . ' : '; |
|
| 1348 | + print $langs->trans("RefOrLabel").' : '; |
|
| 1349 | 1349 | } elseif ($hidelabel > 1) { |
| 1350 | 1350 | $placeholder = $langs->trans("RefOrLabel"); |
| 1351 | 1351 | if ($hidelabel == 2) { |
| 1352 | 1352 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 1353 | 1353 | } |
| 1354 | 1354 | } |
| 1355 | - $out .= '<input type="text" class="' . $morecss . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' ' . (getDolGlobalString('THIRDPARTY_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 1355 | + $out .= '<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' '.(getDolGlobalString('THIRDPARTY_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 1356 | 1356 | if ($hidelabel == 3) { |
| 1357 | 1357 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 1358 | 1358 | } |
| 1359 | 1359 | |
| 1360 | 1360 | $out .= ajax_event($htmlname, $events); |
| 1361 | 1361 | |
| 1362 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); |
|
| 1362 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); |
|
| 1363 | 1363 | } else { |
| 1364 | 1364 | // Immediate load of all database |
| 1365 | 1365 | $out .= $this->select_thirdparty_list($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, '', 0, $limit, $morecss, $moreparam, $multiple, $excludeids, $showcode); |
@@ -1443,30 +1443,30 @@ discard block |
||
| 1443 | 1443 | $sql .= ", s.address, s.zip, s.town"; |
| 1444 | 1444 | $sql .= ", dictp.code as country_code"; |
| 1445 | 1445 | } |
| 1446 | - $sql .= " FROM " . $this->db->prefix() . "societe as s"; |
|
| 1446 | + $sql .= " FROM ".$this->db->prefix()."societe as s"; |
|
| 1447 | 1447 | if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) { |
| 1448 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays"; |
|
| 1448 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_country as dictp ON dictp.rowid = s.fk_pays"; |
|
| 1449 | 1449 | } |
| 1450 | 1450 | if (!$user->hasRight('societe', 'client', 'voir')) { |
| 1451 | - $sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc"; |
|
| 1451 | + $sql .= ", ".$this->db->prefix()."societe_commerciaux as sc"; |
|
| 1452 | 1452 | } |
| 1453 | - $sql .= " WHERE s.entity IN (" . getEntity('societe') . ")"; |
|
| 1453 | + $sql .= " WHERE s.entity IN (".getEntity('societe').")"; |
|
| 1454 | 1454 | if (!empty($user->socid)) { |
| 1455 | - $sql .= " AND s.rowid = " . ((int) $user->socid); |
|
| 1455 | + $sql .= " AND s.rowid = ".((int) $user->socid); |
|
| 1456 | 1456 | } |
| 1457 | 1457 | if ($filter) { |
| 1458 | 1458 | // $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria() |
| 1459 | 1459 | // if not, by testSqlAndScriptInject() only. |
| 1460 | - $sql .= " AND (" . $filter . ")"; |
|
| 1460 | + $sql .= " AND (".$filter.")"; |
|
| 1461 | 1461 | } |
| 1462 | 1462 | if (!$user->hasRight('societe', 'client', 'voir')) { |
| 1463 | - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id); |
|
| 1463 | + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); |
|
| 1464 | 1464 | } |
| 1465 | 1465 | if (getDolGlobalString('COMPANY_HIDE_INACTIVE_IN_COMBOBOX')) { |
| 1466 | 1466 | $sql .= " AND s.status <> 0"; |
| 1467 | 1467 | } |
| 1468 | 1468 | if (!empty($excludeids)) { |
| 1469 | - $sql .= " AND s.rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeids)) . ")"; |
|
| 1469 | + $sql .= " AND s.rowid NOT IN (".$this->db->sanitize(implode(',', $excludeids)).")"; |
|
| 1470 | 1470 | } |
| 1471 | 1471 | // Add where from hooks |
| 1472 | 1472 | $parameters = array(); |
@@ -1486,17 +1486,17 @@ discard block |
||
| 1486 | 1486 | if ($i > 0) { |
| 1487 | 1487 | $sql .= " AND "; |
| 1488 | 1488 | } |
| 1489 | - $sql .= "(s.nom LIKE '" . $this->db->escape($prefix . $crit) . "%')"; |
|
| 1489 | + $sql .= "(s.nom LIKE '".$this->db->escape($prefix.$crit)."%')"; |
|
| 1490 | 1490 | $i++; |
| 1491 | 1491 | } |
| 1492 | 1492 | if (count($search_crit) > 1) { |
| 1493 | 1493 | $sql .= ")"; |
| 1494 | 1494 | } |
| 1495 | 1495 | if (isModEnabled('barcode')) { |
| 1496 | - $sql .= " OR s.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 1496 | + $sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 1497 | 1497 | } |
| 1498 | - $sql .= " OR s.code_client LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.code_fournisseur LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 1499 | - $sql .= " OR s.name_alias LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.tva_intra LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 1498 | + $sql .= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 1499 | + $sql .= " OR s.name_alias LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.tva_intra LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 1500 | 1500 | $sql .= ")"; |
| 1501 | 1501 | } |
| 1502 | 1502 | $sql .= $this->db->order("nom", "ASC"); |
@@ -1507,12 +1507,12 @@ discard block |
||
| 1507 | 1507 | $resql = $this->db->query($sql); |
| 1508 | 1508 | if ($resql) { |
| 1509 | 1509 | if (!$forcecombo) { |
| 1510 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1510 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1511 | 1511 | $out .= ajax_combobox($htmlname, $events, getDolGlobalString("COMPANY_USE_SEARCH_TO_SELECT")); |
| 1512 | 1512 | } |
| 1513 | 1513 | |
| 1514 | 1514 | // Construct $out and $outarray |
| 1515 | - $out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($moreparam ? ' ' . $moreparam : '') . ' name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . '>' . "\n"; |
|
| 1515 | + $out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').'>'."\n"; |
|
| 1516 | 1516 | |
| 1517 | 1517 | $textifempty = (($showempty && !is_numeric($showempty)) ? $langs->trans($showempty) : ''); |
| 1518 | 1518 | if (getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT')) { |
@@ -1525,7 +1525,7 @@ discard block |
||
| 1525 | 1525 | } |
| 1526 | 1526 | } |
| 1527 | 1527 | if ($showempty) { |
| 1528 | - $out .= '<option value="-1" data-html="' . dol_escape_htmltag('<span class="opacitymedium">' . ($textifempty ? $textifempty : ' ') . '</span>') . '">' . $textifempty . '</option>' . "\n"; |
|
| 1528 | + $out .= '<option value="-1" data-html="'.dol_escape_htmltag('<span class="opacitymedium">'.($textifempty ? $textifempty : ' ').'</span>').'">'.$textifempty.'</option>'."\n"; |
|
| 1529 | 1529 | } |
| 1530 | 1530 | |
| 1531 | 1531 | $companytemp = new Societe($this->db); |
@@ -1538,18 +1538,18 @@ discard block |
||
| 1538 | 1538 | $label = ''; |
| 1539 | 1539 | if ($showcode || getDolGlobalString('SOCIETE_ADD_REF_IN_LIST')) { |
| 1540 | 1540 | if (($obj->client) && (!empty($obj->code_client))) { |
| 1541 | - $label = $obj->code_client . ' - '; |
|
| 1541 | + $label = $obj->code_client.' - '; |
|
| 1542 | 1542 | } |
| 1543 | 1543 | if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) { |
| 1544 | - $label .= $obj->code_fournisseur . ' - '; |
|
| 1544 | + $label .= $obj->code_fournisseur.' - '; |
|
| 1545 | 1545 | } |
| 1546 | - $label .= ' ' . $obj->name; |
|
| 1546 | + $label .= ' '.$obj->name; |
|
| 1547 | 1547 | } else { |
| 1548 | 1548 | $label = $obj->name; |
| 1549 | 1549 | } |
| 1550 | 1550 | |
| 1551 | 1551 | if (!empty($obj->name_alias)) { |
| 1552 | - $label .= ' (' . $obj->name_alias . ')'; |
|
| 1552 | + $label .= ' ('.$obj->name_alias.')'; |
|
| 1553 | 1553 | } |
| 1554 | 1554 | |
| 1555 | 1555 | if (getDolGlobalString('SOCIETE_SHOW_VAT_IN_LIST') && !empty($obj->tva_intra)) { |
@@ -1564,7 +1564,7 @@ discard block |
||
| 1564 | 1564 | $companytemp->fournisseur = $obj->fournisseur; |
| 1565 | 1565 | $tmptype = $companytemp->getTypeUrl(1, '', 0, 'span'); |
| 1566 | 1566 | if ($tmptype) { |
| 1567 | - $labelhtml .= ' ' . $tmptype; |
|
| 1567 | + $labelhtml .= ' '.$tmptype; |
|
| 1568 | 1568 | } |
| 1569 | 1569 | |
| 1570 | 1570 | if ($obj->client || $obj->fournisseur) { |
@@ -1574,10 +1574,10 @@ discard block |
||
| 1574 | 1574 | $label .= $langs->trans("Customer"); |
| 1575 | 1575 | } |
| 1576 | 1576 | if ($obj->client == 2 || $obj->client == 3) { |
| 1577 | - $label .= ($obj->client == 3 ? ', ' : '') . $langs->trans("Prospect"); |
|
| 1577 | + $label .= ($obj->client == 3 ? ', ' : '').$langs->trans("Prospect"); |
|
| 1578 | 1578 | } |
| 1579 | 1579 | if ($obj->fournisseur) { |
| 1580 | - $label .= ($obj->client ? ', ' : '') . $langs->trans("Supplier"); |
|
| 1580 | + $label .= ($obj->client ? ', ' : '').$langs->trans("Supplier"); |
|
| 1581 | 1581 | } |
| 1582 | 1582 | if ($obj->client || $obj->fournisseur) { |
| 1583 | 1583 | $label .= ')'; |
@@ -1585,9 +1585,9 @@ discard block |
||
| 1585 | 1585 | } |
| 1586 | 1586 | |
| 1587 | 1587 | if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) { |
| 1588 | - $s = ($obj->address ? ' - ' . $obj->address : '') . ($obj->zip ? ' - ' . $obj->zip : '') . ($obj->town ? ' ' . $obj->town : ''); |
|
| 1588 | + $s = ($obj->address ? ' - '.$obj->address : '').($obj->zip ? ' - '.$obj->zip : '').($obj->town ? ' '.$obj->town : ''); |
|
| 1589 | 1589 | if (!empty($obj->country_code)) { |
| 1590 | - $s .= ', ' . $langs->trans('Country' . $obj->country_code); |
|
| 1590 | + $s .= ', '.$langs->trans('Country'.$obj->country_code); |
|
| 1591 | 1591 | } |
| 1592 | 1592 | $label .= $s; |
| 1593 | 1593 | $labelhtml .= $s; |
@@ -1595,9 +1595,9 @@ discard block |
||
| 1595 | 1595 | |
| 1596 | 1596 | if (empty($outputmode)) { |
| 1597 | 1597 | if (in_array($obj->rowid, $selected)) { |
| 1598 | - $out .= '<option value="' . $obj->rowid . '" selected data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
| 1598 | + $out .= '<option value="'.$obj->rowid.'" selected data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
| 1599 | 1599 | } else { |
| 1600 | - $out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
| 1600 | + $out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
| 1601 | 1601 | } |
| 1602 | 1602 | } else { |
| 1603 | 1603 | array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label, 'labelhtml' => $labelhtml)); |
@@ -1609,7 +1609,7 @@ discard block |
||
| 1609 | 1609 | } |
| 1610 | 1610 | } |
| 1611 | 1611 | } |
| 1612 | - $out .= '</select>' . "\n"; |
|
| 1612 | + $out .= '</select>'."\n"; |
|
| 1613 | 1613 | } else { |
| 1614 | 1614 | dol_print_error($this->db); |
| 1615 | 1615 | } |
@@ -1643,18 +1643,18 @@ discard block |
||
| 1643 | 1643 | // On recherche les remises |
| 1644 | 1644 | $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; |
| 1645 | 1645 | $sql .= " re.description, re.fk_facture_source"; |
| 1646 | - $sql .= " FROM " . $this->db->prefix() . "societe_remise_except as re"; |
|
| 1647 | - $sql .= " WHERE re.fk_soc = " . (int) $socid; |
|
| 1648 | - $sql .= " AND re.entity = " . $conf->entity; |
|
| 1646 | + $sql .= " FROM ".$this->db->prefix()."societe_remise_except as re"; |
|
| 1647 | + $sql .= " WHERE re.fk_soc = ".(int) $socid; |
|
| 1648 | + $sql .= " AND re.entity = ".$conf->entity; |
|
| 1649 | 1649 | if ($filter) { |
| 1650 | - $sql .= " AND " . $filter; |
|
| 1650 | + $sql .= " AND ".$filter; |
|
| 1651 | 1651 | } |
| 1652 | 1652 | $sql .= " ORDER BY re.description ASC"; |
| 1653 | 1653 | |
| 1654 | - dol_syslog(get_class($this) . "::select_remises", LOG_DEBUG); |
|
| 1654 | + dol_syslog(get_class($this)."::select_remises", LOG_DEBUG); |
|
| 1655 | 1655 | $resql = $this->db->query($sql); |
| 1656 | 1656 | if ($resql) { |
| 1657 | - print '<select id="select_' . $htmlname . '" class="flat maxwidthonsmartphone" name="' . $htmlname . '">'; |
|
| 1657 | + print '<select id="select_'.$htmlname.'" class="flat maxwidthonsmartphone" name="'.$htmlname.'">'; |
|
| 1658 | 1658 | $num = $this->db->num_rows($resql); |
| 1659 | 1659 | |
| 1660 | 1660 | $qualifiedlines = $num; |
@@ -1692,16 +1692,16 @@ discard block |
||
| 1692 | 1692 | if (getDolGlobalString('MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST') && !empty($obj->fk_facture_source)) { |
| 1693 | 1693 | $tmpfac = new Facture($this->db); |
| 1694 | 1694 | if ($tmpfac->fetch($obj->fk_facture_source) > 0) { |
| 1695 | - $desc = $desc . ' - ' . $tmpfac->ref; |
|
| 1695 | + $desc = $desc.' - '.$tmpfac->ref; |
|
| 1696 | 1696 | } |
| 1697 | 1697 | } |
| 1698 | 1698 | |
| 1699 | - print '<option value="' . $obj->rowid . '"' . $selectstring . $disabled . '>' . $desc . ' (' . price($obj->amount_ht) . ' ' . $langs->trans("HT") . ' - ' . price($obj->amount_ttc) . ' ' . $langs->trans("TTC") . ')</option>'; |
|
| 1699 | + print '<option value="'.$obj->rowid.'"'.$selectstring.$disabled.'>'.$desc.' ('.price($obj->amount_ht).' '.$langs->trans("HT").' - '.price($obj->amount_ttc).' '.$langs->trans("TTC").')</option>'; |
|
| 1700 | 1700 | $i++; |
| 1701 | 1701 | } |
| 1702 | 1702 | } |
| 1703 | 1703 | print '</select>'; |
| 1704 | - print ajax_combobox('select_' . $htmlname); |
|
| 1704 | + print ajax_combobox('select_'.$htmlname); |
|
| 1705 | 1705 | |
| 1706 | 1706 | return $qualifiedlines; |
| 1707 | 1707 | } else { |
@@ -1782,7 +1782,7 @@ discard block |
||
| 1782 | 1782 | $out = ''; |
| 1783 | 1783 | |
| 1784 | 1784 | if (!is_object($hookmanager)) { |
| 1785 | - include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; |
|
| 1785 | + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; |
|
| 1786 | 1786 | $hookmanager = new HookManager($this->db); |
| 1787 | 1787 | } |
| 1788 | 1788 | |
@@ -1791,13 +1791,13 @@ discard block |
||
| 1791 | 1791 | if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) { |
| 1792 | 1792 | $sql .= ", s.nom as company, s.town AS company_town"; |
| 1793 | 1793 | } |
| 1794 | - $sql .= " FROM " . $this->db->prefix() . "socpeople as sp"; |
|
| 1794 | + $sql .= " FROM ".$this->db->prefix()."socpeople as sp"; |
|
| 1795 | 1795 | if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) { |
| 1796 | - $sql .= " LEFT OUTER JOIN " . $this->db->prefix() . "societe as s ON s.rowid=sp.fk_soc"; |
|
| 1796 | + $sql .= " LEFT OUTER JOIN ".$this->db->prefix()."societe as s ON s.rowid=sp.fk_soc"; |
|
| 1797 | 1797 | } |
| 1798 | - $sql .= " WHERE sp.entity IN (" . getEntity('contact') . ")"; |
|
| 1798 | + $sql .= " WHERE sp.entity IN (".getEntity('contact').")"; |
|
| 1799 | 1799 | if ($socid > 0 || $socid == -1) { |
| 1800 | - $sql .= " AND sp.fk_soc = " . ((int) $socid); |
|
| 1800 | + $sql .= " AND sp.fk_soc = ".((int) $socid); |
|
| 1801 | 1801 | } |
| 1802 | 1802 | if (getDolGlobalString('CONTACT_HIDE_INACTIVE_IN_COMBOBOX')) { |
| 1803 | 1803 | $sql .= " AND sp.statut <> 0"; |
@@ -1808,30 +1808,30 @@ discard block |
||
| 1808 | 1808 | $sql .= $hookmanager->resPrint; |
| 1809 | 1809 | $sql .= " ORDER BY sp.lastname ASC"; |
| 1810 | 1810 | |
| 1811 | - dol_syslog(get_class($this) . "::selectcontacts", LOG_DEBUG); |
|
| 1811 | + dol_syslog(get_class($this)."::selectcontacts", LOG_DEBUG); |
|
| 1812 | 1812 | $resql = $this->db->query($sql); |
| 1813 | 1813 | if ($resql) { |
| 1814 | 1814 | $num = $this->db->num_rows($resql); |
| 1815 | 1815 | |
| 1816 | 1816 | if ($htmlname != 'none' && !$options_only) { |
| 1817 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlid . '" name="' . $htmlname . (($num || empty($disableifempty)) ? '' : ' disabled') . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . (!empty($moreparam) ? $moreparam : '') . '>'; |
|
| 1817 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlid.'" name="'.$htmlname.(($num || empty($disableifempty)) ? '' : ' disabled').($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>'; |
|
| 1818 | 1818 | } |
| 1819 | 1819 | |
| 1820 | 1820 | if ($showempty && !is_numeric($showempty)) { |
| 1821 | 1821 | $textforempty = $showempty; |
| 1822 | - $out .= '<option class="optiongrey" value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>' . $textforempty . '</option>'; |
|
| 1822 | + $out .= '<option class="optiongrey" value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>'.$textforempty.'</option>'; |
|
| 1823 | 1823 | } else { |
| 1824 | 1824 | if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) { |
| 1825 | - $out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '> </option>'; |
|
| 1825 | + $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'> </option>'; |
|
| 1826 | 1826 | } |
| 1827 | 1827 | if ($showempty == 2) { |
| 1828 | - $out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>-- ' . $langs->trans("Internal") . ' --</option>'; |
|
| 1828 | + $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>'; |
|
| 1829 | 1829 | } |
| 1830 | 1830 | } |
| 1831 | 1831 | |
| 1832 | 1832 | $i = 0; |
| 1833 | 1833 | if ($num) { |
| 1834 | - include_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
| 1834 | + include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
| 1835 | 1835 | $contactstatic = new Contact($this->db); |
| 1836 | 1836 | |
| 1837 | 1837 | while ($i < $num) { |
@@ -1867,7 +1867,7 @@ discard block |
||
| 1867 | 1867 | } |
| 1868 | 1868 | $extendedInfos = implode(' - ', $extendedInfos); |
| 1869 | 1869 | if (!empty($extendedInfos)) { |
| 1870 | - $extendedInfos = ' - ' . $extendedInfos; |
|
| 1870 | + $extendedInfos = ' - '.$extendedInfos; |
|
| 1871 | 1871 | } |
| 1872 | 1872 | } |
| 1873 | 1873 | |
@@ -1884,42 +1884,42 @@ discard block |
||
| 1884 | 1884 | $disabled = 1; |
| 1885 | 1885 | } |
| 1886 | 1886 | if (!empty($selected) && in_array($obj->rowid, $selected)) { |
| 1887 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 1887 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 1888 | 1888 | if ($disabled) { |
| 1889 | 1889 | $out .= ' disabled'; |
| 1890 | 1890 | } |
| 1891 | 1891 | $out .= ' selected>'; |
| 1892 | - $out .= $contactstatic->getFullName($langs) . $extendedInfos; |
|
| 1892 | + $out .= $contactstatic->getFullName($langs).$extendedInfos; |
|
| 1893 | 1893 | if ($showfunction && $obj->poste) { |
| 1894 | - $out .= ' (' . $obj->poste . ')'; |
|
| 1894 | + $out .= ' ('.$obj->poste.')'; |
|
| 1895 | 1895 | } |
| 1896 | 1896 | if (($showsoc > 0) && $obj->company) { |
| 1897 | - $out .= ' - (' . $obj->company . ')'; |
|
| 1897 | + $out .= ' - ('.$obj->company.')'; |
|
| 1898 | 1898 | } |
| 1899 | 1899 | $out .= '</option>'; |
| 1900 | 1900 | } else { |
| 1901 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 1901 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 1902 | 1902 | if ($disabled) { |
| 1903 | 1903 | $out .= ' disabled'; |
| 1904 | 1904 | } |
| 1905 | 1905 | $out .= '>'; |
| 1906 | - $out .= $contactstatic->getFullName($langs) . $extendedInfos; |
|
| 1906 | + $out .= $contactstatic->getFullName($langs).$extendedInfos; |
|
| 1907 | 1907 | if ($showfunction && $obj->poste) { |
| 1908 | - $out .= ' (' . $obj->poste . ')'; |
|
| 1908 | + $out .= ' ('.$obj->poste.')'; |
|
| 1909 | 1909 | } |
| 1910 | 1910 | if (($showsoc > 0) && $obj->company) { |
| 1911 | - $out .= ' - (' . $obj->company . ')'; |
|
| 1911 | + $out .= ' - ('.$obj->company.')'; |
|
| 1912 | 1912 | } |
| 1913 | 1913 | $out .= '</option>'; |
| 1914 | 1914 | } |
| 1915 | 1915 | } else { |
| 1916 | 1916 | if (in_array($obj->rowid, $selected)) { |
| 1917 | - $out .= $contactstatic->getFullName($langs) . $extendedInfos; |
|
| 1917 | + $out .= $contactstatic->getFullName($langs).$extendedInfos; |
|
| 1918 | 1918 | if ($showfunction && $obj->poste) { |
| 1919 | - $out .= ' (' . $obj->poste . ')'; |
|
| 1919 | + $out .= ' ('.$obj->poste.')'; |
|
| 1920 | 1920 | } |
| 1921 | 1921 | if (($showsoc > 0) && $obj->company) { |
| 1922 | - $out .= ' - (' . $obj->company . ')'; |
|
| 1922 | + $out .= ' - ('.$obj->company.')'; |
|
| 1923 | 1923 | } |
| 1924 | 1924 | } |
| 1925 | 1925 | } |
@@ -1928,7 +1928,7 @@ discard block |
||
| 1928 | 1928 | } |
| 1929 | 1929 | } else { |
| 1930 | 1930 | $labeltoshow = ($socid != -1) ? ($langs->trans($socid ? "NoContactDefinedForThirdParty" : "NoContactDefined")) : $langs->trans('SelectAThirdPartyFirst'); |
| 1931 | - $out .= '<option class="disabled" value="-1"' . (($showempty == 2 || $multiple) ? '' : ' selected') . ' disabled="disabled">'; |
|
| 1931 | + $out .= '<option class="disabled" value="-1"'.(($showempty == 2 || $multiple) ? '' : ' selected').' disabled="disabled">'; |
|
| 1932 | 1932 | $out .= $labeltoshow; |
| 1933 | 1933 | $out .= '</option>'; |
| 1934 | 1934 | } |
@@ -1949,7 +1949,7 @@ discard block |
||
| 1949 | 1949 | } |
| 1950 | 1950 | |
| 1951 | 1951 | if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) { |
| 1952 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1952 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1953 | 1953 | $out .= ajax_combobox($htmlid, $events, getDolGlobalString("CONTACT_USE_SEARCH_TO_SELECT")); |
| 1954 | 1954 | } |
| 1955 | 1955 | |
@@ -2054,11 +2054,11 @@ discard block |
||
| 2054 | 2054 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
| 2055 | 2055 | $sql .= ", e.label"; |
| 2056 | 2056 | } |
| 2057 | - $sql .= " FROM " . $this->db->prefix() . "user as u"; |
|
| 2057 | + $sql .= " FROM ".$this->db->prefix()."user as u"; |
|
| 2058 | 2058 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
| 2059 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid = u.entity"; |
|
| 2059 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid = u.entity"; |
|
| 2060 | 2060 | if (!empty($force_entity)) { |
| 2061 | - $sql .= " WHERE u.entity IN (0, " . $this->db->sanitize($force_entity) . ")"; |
|
| 2061 | + $sql .= " WHERE u.entity IN (0, ".$this->db->sanitize($force_entity).")"; |
|
| 2062 | 2062 | } else { |
| 2063 | 2063 | $sql .= " WHERE u.entity IS NOT NULL"; |
| 2064 | 2064 | } |
@@ -2066,17 +2066,17 @@ discard block |
||
| 2066 | 2066 | if (isModEnabled('multicompany') && getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE')) { |
| 2067 | 2067 | $sql .= " WHERE u.rowid IN (SELECT ug.fk_user FROM ".$this->db->prefix()."usergroup_user as ug WHERE ug.entity IN (".getEntity('usergroup')."))"; |
| 2068 | 2068 | } else { |
| 2069 | - $sql .= " WHERE u.entity IN (" . getEntity('user') . ")"; |
|
| 2069 | + $sql .= " WHERE u.entity IN (".getEntity('user').")"; |
|
| 2070 | 2070 | } |
| 2071 | 2071 | } |
| 2072 | 2072 | if (!empty($user->socid)) { |
| 2073 | - $sql .= " AND u.fk_soc = " . ((int) $user->socid); |
|
| 2073 | + $sql .= " AND u.fk_soc = ".((int) $user->socid); |
|
| 2074 | 2074 | } |
| 2075 | 2075 | if (is_array($exclude) && $excludeUsers) { |
| 2076 | - $sql .= " AND u.rowid NOT IN (" . $this->db->sanitize($excludeUsers) . ")"; |
|
| 2076 | + $sql .= " AND u.rowid NOT IN (".$this->db->sanitize($excludeUsers).")"; |
|
| 2077 | 2077 | } |
| 2078 | 2078 | if ($includeUsers) { |
| 2079 | - $sql .= " AND u.rowid IN (" . $this->db->sanitize($includeUsers) . ")"; |
|
| 2079 | + $sql .= " AND u.rowid IN (".$this->db->sanitize($includeUsers).")"; |
|
| 2080 | 2080 | } |
| 2081 | 2081 | if (getDolGlobalString('USER_HIDE_INACTIVE_IN_COMBOBOX') || $notdisabled) { |
| 2082 | 2082 | $sql .= " AND u.statut <> 0"; |
@@ -2088,7 +2088,7 @@ discard block |
||
| 2088 | 2088 | $sql .= " AND u.fk_soc IS NULL"; |
| 2089 | 2089 | } |
| 2090 | 2090 | if (!empty($morefilter)) { |
| 2091 | - $sql .= " " . $morefilter; |
|
| 2091 | + $sql .= " ".$morefilter; |
|
| 2092 | 2092 | } |
| 2093 | 2093 | |
| 2094 | 2094 | //Add hook to filter on user (for example on usergroup define in custom modules) |
@@ -2103,7 +2103,7 @@ discard block |
||
| 2103 | 2103 | $sql .= " ORDER BY u.statut DESC, u.lastname ASC, u.firstname ASC"; |
| 2104 | 2104 | } |
| 2105 | 2105 | |
| 2106 | - dol_syslog(get_class($this) . "::select_dolusers", LOG_DEBUG); |
|
| 2106 | + dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG); |
|
| 2107 | 2107 | |
| 2108 | 2108 | $resql = $this->db->query($sql); |
| 2109 | 2109 | if ($resql) { |
@@ -2111,7 +2111,7 @@ discard block |
||
| 2111 | 2111 | $i = 0; |
| 2112 | 2112 | if ($num) { |
| 2113 | 2113 | // do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined |
| 2114 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : ' minwidth200') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>'; |
|
| 2114 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>'; |
|
| 2115 | 2115 | if ($show_empty && !$multiple) { |
| 2116 | 2116 | $textforempty = ' '; |
| 2117 | 2117 | if (!empty($conf->use_javascript_ajax)) { |
@@ -2120,10 +2120,10 @@ discard block |
||
| 2120 | 2120 | if (!is_numeric($show_empty)) { |
| 2121 | 2121 | $textforempty = $show_empty; |
| 2122 | 2122 | } |
| 2123 | - $out .= '<option class="optiongrey" value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ((empty($selected) || in_array(-1, $selected)) ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n"; |
|
| 2123 | + $out .= '<option class="optiongrey" value="'.($show_empty < 0 ? $show_empty : -1).'"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'>'.$textforempty.'</option>'."\n"; |
|
| 2124 | 2124 | } |
| 2125 | 2125 | if ($show_every) { |
| 2126 | - $out .= '<option value="-2"' . ((in_array(-2, $selected)) ? ' selected' : '') . '>-- ' . $langs->trans("Everybody") . ' --</option>' . "\n"; |
|
| 2126 | + $out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n"; |
|
| 2127 | 2127 | } |
| 2128 | 2128 | |
| 2129 | 2129 | $userstatic = new User($this->db); |
@@ -2170,22 +2170,22 @@ discard block |
||
| 2170 | 2170 | } |
| 2171 | 2171 | if ($showstatus >= 0) { |
| 2172 | 2172 | if ($obj->status == 1 && $showstatus == 1) { |
| 2173 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Enabled'); |
|
| 2174 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Enabled'); |
|
| 2173 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled'); |
|
| 2174 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Enabled'); |
|
| 2175 | 2175 | } |
| 2176 | 2176 | if ($obj->status == 0 && $showstatus == 1) { |
| 2177 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Disabled'); |
|
| 2178 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Disabled'); |
|
| 2177 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled'); |
|
| 2178 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Disabled'); |
|
| 2179 | 2179 | } |
| 2180 | 2180 | } |
| 2181 | 2181 | if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1 && !empty($user->admin) && empty($user->entity)) { |
| 2182 | 2182 | if (empty($obj->entity)) { |
| 2183 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans("AllEntities"); |
|
| 2184 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans("AllEntities"); |
|
| 2183 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities"); |
|
| 2184 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans("AllEntities"); |
|
| 2185 | 2185 | } else { |
| 2186 | 2186 | if ($obj->entity != $conf->entity) { |
| 2187 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
| 2188 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
| 2187 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
| 2188 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
| 2189 | 2189 | } |
| 2190 | 2190 | } |
| 2191 | 2191 | } |
@@ -2193,13 +2193,13 @@ discard block |
||
| 2193 | 2193 | $moreinfohtml .= (!empty($moreinfohtml) ? ')</span>' : ''); |
| 2194 | 2194 | if (!empty($disableline) && $disableline != '1') { |
| 2195 | 2195 | // Add text from $enableonlytext parameter |
| 2196 | - $moreinfo .= ' - ' . $disableline; |
|
| 2197 | - $moreinfohtml .= ' - ' . $disableline; |
|
| 2196 | + $moreinfo .= ' - '.$disableline; |
|
| 2197 | + $moreinfohtml .= ' - '.$disableline; |
|
| 2198 | 2198 | } |
| 2199 | 2199 | $labeltoshow .= $moreinfo; |
| 2200 | 2200 | $labeltoshowhtml .= $moreinfohtml; |
| 2201 | 2201 | |
| 2202 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 2202 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 2203 | 2203 | if (!empty($disableline)) { |
| 2204 | 2204 | $out .= ' disabled'; |
| 2205 | 2205 | } |
@@ -2207,7 +2207,7 @@ discard block |
||
| 2207 | 2207 | $out .= ' selected'; |
| 2208 | 2208 | } |
| 2209 | 2209 | $out .= ' data-html="'; |
| 2210 | - $outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1) . ' '; |
|
| 2210 | + $outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' '; |
|
| 2211 | 2211 | if ($showstatus >= 0 && $obj->status == 0) { |
| 2212 | 2212 | $outhtml .= '<strike class="opacitymediumxxx">'; |
| 2213 | 2213 | } |
@@ -2220,7 +2220,7 @@ discard block |
||
| 2220 | 2220 | $out .= $labeltoshow; |
| 2221 | 2221 | $out .= '</option>'; |
| 2222 | 2222 | |
| 2223 | - $outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength) . $moreinfo; |
|
| 2223 | + $outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength).$moreinfo; |
|
| 2224 | 2224 | $outarray2[$userstatic->id] = array( |
| 2225 | 2225 | 'id'=>$userstatic->id, |
| 2226 | 2226 | 'label'=>$labeltoshow, |
@@ -2232,14 +2232,14 @@ discard block |
||
| 2232 | 2232 | $i++; |
| 2233 | 2233 | } |
| 2234 | 2234 | } else { |
| 2235 | - $out .= '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '" disabled>'; |
|
| 2236 | - $out .= '<option value="">' . $langs->trans("None") . '</option>'; |
|
| 2235 | + $out .= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'" disabled>'; |
|
| 2236 | + $out .= '<option value="">'.$langs->trans("None").'</option>'; |
|
| 2237 | 2237 | } |
| 2238 | 2238 | $out .= '</select>'; |
| 2239 | 2239 | |
| 2240 | 2240 | if ($num && !$forcecombo) { |
| 2241 | 2241 | // Enhance with select2 |
| 2242 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 2242 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 2243 | 2243 | $out .= ajax_combobox($htmlname); |
| 2244 | 2244 | } |
| 2245 | 2245 | } else { |
@@ -2309,16 +2309,16 @@ discard block |
||
| 2309 | 2309 | $out .= $userstatic->getNomUrl(-1); |
| 2310 | 2310 | if ($i == 0) { |
| 2311 | 2311 | $ownerid = $value['id']; |
| 2312 | - $out .= ' (' . $langs->trans("Owner") . ')'; |
|
| 2312 | + $out .= ' ('.$langs->trans("Owner").')'; |
|
| 2313 | 2313 | } |
| 2314 | 2314 | if ($nbassignetouser > 1 && $action != 'view') { |
| 2315 | - $out .= ' <input type="image" style="border: 0px;" src="' . img_picto($langs->trans("Remove"), 'delete', '', 0, 1) . '" value="' . $userstatic->id . '" class="removedassigned reposition" id="removedassigned_' . $userstatic->id . '" name="removedassigned_' . $userstatic->id . '">'; |
|
| 2315 | + $out .= ' <input type="image" style="border: 0px;" src="'.img_picto($langs->trans("Remove"), 'delete', '', 0, 1).'" value="'.$userstatic->id.'" class="removedassigned reposition" id="removedassigned_'.$userstatic->id.'" name="removedassigned_'.$userstatic->id.'">'; |
|
| 2316 | 2316 | } |
| 2317 | 2317 | // Show my availability |
| 2318 | 2318 | if ($showproperties) { |
| 2319 | 2319 | if ($ownerid == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($ownerid, array_keys($listofuserid))) { |
| 2320 | 2320 | $out .= '<div class="myavailability inline-block">'; |
| 2321 | - $out .= '<span class="hideonsmartphone"> - <span class="opacitymedium">' . $langs->trans("Availability") . ':</span> </span><input id="transparency" class="paddingrightonly" ' . ($action == 'view' ? 'disabled' : '') . ' type="checkbox" name="transparency"' . ($listofuserid[$ownerid]['transparency'] ? ' checked' : '') . '><label for="transparency">' . $langs->trans("Busy") . '</label>'; |
|
| 2321 | + $out .= '<span class="hideonsmartphone"> - <span class="opacitymedium">'.$langs->trans("Availability").':</span> </span><input id="transparency" class="paddingrightonly" '.($action == 'view' ? 'disabled' : '').' type="checkbox" name="transparency"'.($listofuserid[$ownerid]['transparency'] ? ' checked' : '').'><label for="transparency">'.$langs->trans("Busy").'</label>'; |
|
| 2322 | 2322 | $out .= '</div>'; |
| 2323 | 2323 | } |
| 2324 | 2324 | } |
@@ -2335,15 +2335,15 @@ discard block |
||
| 2335 | 2335 | // Method with no ajax |
| 2336 | 2336 | if ($action != 'view') { |
| 2337 | 2337 | $out .= '<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">'; |
| 2338 | - $out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2338 | + $out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2339 | 2339 | $out .= 'jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });'; |
| 2340 | 2340 | $out .= 'jQuery(".assignedtouser").change(function() { console.log(jQuery(".assignedtouser option:selected").val());'; |
| 2341 | - $out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#' . $action . 'assignedtouser").attr("disabled", false); }'; |
|
| 2342 | - $out .= ' else { jQuery("#' . $action . 'assignedtouser").attr("disabled", true); }'; |
|
| 2341 | + $out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#'.$action.'assignedtouser").attr("disabled", false); }'; |
|
| 2342 | + $out .= ' else { jQuery("#'.$action.'assignedtouser").attr("disabled", true); }'; |
|
| 2343 | 2343 | $out .= '});'; |
| 2344 | 2344 | $out .= '})</script>'; |
| 2345 | 2345 | $out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); |
| 2346 | - $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtouser" name="' . $action . 'assignedtouser" value="' . dol_escape_htmltag($langs->trans("Add")) . '">'; |
|
| 2346 | + $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">'; |
|
| 2347 | 2347 | $out .= '<br>'; |
| 2348 | 2348 | } |
| 2349 | 2349 | |
@@ -2398,13 +2398,13 @@ discard block |
||
| 2398 | 2398 | $resourcestatic->fetch($value['id']); |
| 2399 | 2399 | $out .= $resourcestatic->getNomUrl(-1); |
| 2400 | 2400 | if ($nbassignetoresource > 1 && $action != 'view') { |
| 2401 | - $out .= ' <input type="image" style="border: 0px;" src="' . img_picto($langs->trans("Remove"), 'delete', '', 0, 1) . '" value="' . $resourcestatic->id . '" class="removedassigned reposition" id="removedassignedresource_' . $resourcestatic->id . '" name="removedassignedresource_' . $resourcestatic->id . '">'; |
|
| 2401 | + $out .= ' <input type="image" style="border: 0px;" src="'.img_picto($langs->trans("Remove"), 'delete', '', 0, 1).'" value="'.$resourcestatic->id.'" class="removedassigned reposition" id="removedassignedresource_'.$resourcestatic->id.'" name="removedassignedresource_'.$resourcestatic->id.'">'; |
|
| 2402 | 2402 | } |
| 2403 | 2403 | // Show my availability |
| 2404 | 2404 | if ($showproperties) { |
| 2405 | 2405 | if (is_array($listofresourceid) && count($listofresourceid)) { |
| 2406 | 2406 | $out .= '<div class="myavailability inline-block">'; |
| 2407 | - $out .= '<span class="hideonsmartphone"> - <span class="opacitymedium">' . $langs->trans("Availability") . ':</span> </span><input id="transparencyresource" class="paddingrightonly" ' . ($action == 'view' ? 'disabled' : '') . ' type="checkbox" name="transparency"' . ($listofresourceid[$value['id']]['transparency'] ? ' checked' : '') . '><label for="transparency">' . $langs->trans("Busy") . '</label>'; |
|
| 2407 | + $out .= '<span class="hideonsmartphone"> - <span class="opacitymedium">'.$langs->trans("Availability").':</span> </span><input id="transparencyresource" class="paddingrightonly" '.($action == 'view' ? 'disabled' : '').' type="checkbox" name="transparency"'.($listofresourceid[$value['id']]['transparency'] ? ' checked' : '').'><label for="transparency">'.$langs->trans("Busy").'</label>'; |
|
| 2408 | 2408 | $out .= '</div>'; |
| 2409 | 2409 | } |
| 2410 | 2410 | } |
@@ -2421,11 +2421,11 @@ discard block |
||
| 2421 | 2421 | // Method with no ajax |
| 2422 | 2422 | if ($action != 'view') { |
| 2423 | 2423 | $out .= '<input type="hidden" class="removedassignedhidden" name="removedassignedresource" value="">'; |
| 2424 | - $out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2424 | + $out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2425 | 2425 | $out .= 'jQuery(".removedassignedresource").click(function() { jQuery(".removedassignedresourcehidden").val(jQuery(this).val()); });'; |
| 2426 | 2426 | $out .= 'jQuery(".assignedtoresource").change(function() { console.log(jQuery(".assignedtoresource option:selected").val());'; |
| 2427 | - $out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#' . $action . 'assignedtoresource").attr("disabled", false); }'; |
|
| 2428 | - $out .= ' else { jQuery("#' . $action . 'assignedtoresource").attr("disabled", true); }'; |
|
| 2427 | + $out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#'.$action.'assignedtoresource").attr("disabled", false); }'; |
|
| 2428 | + $out .= ' else { jQuery("#'.$action.'assignedtoresource").attr("disabled", true); }'; |
|
| 2429 | 2429 | $out .= '});'; |
| 2430 | 2430 | $out .= '})</script>'; |
| 2431 | 2431 | |
@@ -2433,7 +2433,7 @@ discard block |
||
| 2433 | 2433 | $out .= img_picto('', 'resource', 'class="pictofixedwidth"'); |
| 2434 | 2434 | $out .= $formresources->select_resource_list(0, $htmlname, [], 1, 1, 0, $events, '', 2, 0); |
| 2435 | 2435 | //$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); |
| 2436 | - $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtoresource" name="' . $action . 'assignedtoresource" value="' . dol_escape_htmltag($langs->trans("Add")) . '">'; |
|
| 2436 | + $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtoresource" name="'.$action.'assignedtoresource" value="'.dol_escape_htmltag($langs->trans("Add")).'">'; |
|
| 2437 | 2437 | $out .= '<br>'; |
| 2438 | 2438 | } |
| 2439 | 2439 | |
@@ -2494,7 +2494,7 @@ discard block |
||
| 2494 | 2494 | $placeholder = ''; |
| 2495 | 2495 | |
| 2496 | 2496 | if ($selected && empty($selected_input_value)) { |
| 2497 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 2497 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 2498 | 2498 | $producttmpselect = new Product($this->db); |
| 2499 | 2499 | $producttmpselect->fetch($selected); |
| 2500 | 2500 | $selected_input_value = $producttmpselect->ref; |
@@ -2509,17 +2509,17 @@ discard block |
||
| 2509 | 2509 | } |
| 2510 | 2510 | } |
| 2511 | 2511 | // mode=1 means customers products |
| 2512 | - $urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=1&status=' . $status . '&status_purchase=' . $status_purchase . '&finished=' . $finished . '&hidepriceinlabel=' . $hidepriceinlabel . '&warehousestatus=' . $warehouseStatus; |
|
| 2513 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 2512 | + $urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&status_purchase='.$status_purchase.'&finished='.$finished.'&hidepriceinlabel='.$hidepriceinlabel.'&warehousestatus='.$warehouseStatus; |
|
| 2513 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 2514 | 2514 | |
| 2515 | 2515 | if (isModEnabled('variants') && is_array($selected_combinations)) { |
| 2516 | 2516 | // Code to automatically insert with javascript the select of attributes under the select of product |
| 2517 | 2517 | // when a parent of variant has been selected. |
| 2518 | 2518 | $out .= ' |
| 2519 | 2519 | <!-- script to auto show attributes select tags if a variant was selected --> |
| 2520 | - <script nonce="' . getNonce() . '"> |
|
| 2520 | + <script nonce="' . getNonce().'"> |
|
| 2521 | 2521 | // auto show attributes fields |
| 2522 | - selected = ' . json_encode($selected_combinations) . '; |
|
| 2522 | + selected = ' . json_encode($selected_combinations).'; |
|
| 2523 | 2523 | combvalues = {}; |
| 2524 | 2524 | |
| 2525 | 2525 | jQuery(document).ready(function () { |
@@ -2530,7 +2530,7 @@ discard block |
||
| 2530 | 2530 | } |
| 2531 | 2531 | }); |
| 2532 | 2532 | |
| 2533 | - jQuery("input#' . $htmlname . '").change(function () { |
|
| 2533 | + jQuery("input#' . $htmlname.'").change(function () { |
|
| 2534 | 2534 | |
| 2535 | 2535 | if (!jQuery(this).val()) { |
| 2536 | 2536 | jQuery(\'div#attributes_box\').empty(); |
@@ -2539,7 +2539,7 @@ discard block |
||
| 2539 | 2539 | |
| 2540 | 2540 | console.log("A change has started. We get variants fields to inject html select"); |
| 2541 | 2541 | |
| 2542 | - jQuery.getJSON("' . DOL_URL_ROOT . '/variants/ajax/getCombinations.php", { |
|
| 2542 | + jQuery.getJSON("' . DOL_URL_ROOT.'/variants/ajax/getCombinations.php", { |
|
| 2543 | 2543 | id: jQuery(this).val() |
| 2544 | 2544 | }, function (data) { |
| 2545 | 2545 | jQuery(\'div#attributes_box\').empty(); |
@@ -2582,21 +2582,21 @@ discard block |
||
| 2582 | 2582 | }) |
| 2583 | 2583 | }); |
| 2584 | 2584 | |
| 2585 | - ' . ($selected ? 'jQuery("input#' . $htmlname . '").change();' : '') . ' |
|
| 2585 | + ' . ($selected ? 'jQuery("input#'.$htmlname.'").change();' : '').' |
|
| 2586 | 2586 | }); |
| 2587 | 2587 | </script> |
| 2588 | 2588 | '; |
| 2589 | 2589 | } |
| 2590 | 2590 | |
| 2591 | 2591 | if (empty($hidelabel)) { |
| 2592 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 2592 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
| 2593 | 2593 | } elseif ($hidelabel > 1) { |
| 2594 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
| 2594 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
| 2595 | 2595 | if ($hidelabel == 2) { |
| 2596 | 2596 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 2597 | 2597 | } |
| 2598 | 2598 | } |
| 2599 | - $out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 2599 | + $out .= '<input type="text" class="minwidth100'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 2600 | 2600 | if ($hidelabel == 3) { |
| 2601 | 2601 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 2602 | 2602 | } |
@@ -2633,33 +2633,33 @@ discard block |
||
| 2633 | 2633 | // phpcs:enable |
| 2634 | 2634 | global $conf, $user, $langs, $db; |
| 2635 | 2635 | |
| 2636 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 2636 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 2637 | 2637 | |
| 2638 | 2638 | $error = 0; |
| 2639 | 2639 | $out = ''; |
| 2640 | 2640 | |
| 2641 | 2641 | if (!$forcecombo) { |
| 2642 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 2642 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 2643 | 2643 | $events = array(); |
| 2644 | 2644 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT")); |
| 2645 | 2645 | } |
| 2646 | 2646 | |
| 2647 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 2647 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 2648 | 2648 | |
| 2649 | 2649 | $sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product'; |
| 2650 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'bom_bom as b'; |
|
| 2651 | - $sql .= ' WHERE b.entity IN (' . getEntity('bom') . ')'; |
|
| 2650 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'bom_bom as b'; |
|
| 2651 | + $sql .= ' WHERE b.entity IN ('.getEntity('bom').')'; |
|
| 2652 | 2652 | if (!empty($status)) { |
| 2653 | - $sql .= ' AND status = ' . (int) $status; |
|
| 2653 | + $sql .= ' AND status = '.(int) $status; |
|
| 2654 | 2654 | } |
| 2655 | 2655 | if (!empty($type)) { |
| 2656 | - $sql .= ' AND bomtype = ' . (int) $type; |
|
| 2656 | + $sql .= ' AND bomtype = '.(int) $type; |
|
| 2657 | 2657 | } |
| 2658 | 2658 | if (!empty($TProducts)) { |
| 2659 | - $sql .= ' AND fk_product IN (' . $this->db->sanitize(implode(',', $TProducts)) . ')'; |
|
| 2659 | + $sql .= ' AND fk_product IN ('.$this->db->sanitize(implode(',', $TProducts)).')'; |
|
| 2660 | 2660 | } |
| 2661 | 2661 | if (!empty($limit)) { |
| 2662 | - $sql .= ' LIMIT ' . (int) $limit; |
|
| 2662 | + $sql .= ' LIMIT '.(int) $limit; |
|
| 2663 | 2663 | } |
| 2664 | 2664 | $resql = $db->query($sql); |
| 2665 | 2665 | if ($resql) { |
@@ -2673,11 +2673,11 @@ discard block |
||
| 2673 | 2673 | while ($obj = $db->fetch_object($resql)) { |
| 2674 | 2674 | $product = new Product($db); |
| 2675 | 2675 | $res = $product->fetch($obj->fk_product); |
| 2676 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 2676 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 2677 | 2677 | if ($obj->rowid == $selected) { |
| 2678 | 2678 | $out .= 'selected'; |
| 2679 | 2679 | } |
| 2680 | - $out .= '>' . $obj->ref . ' - ' . $product->label . ' - ' . $obj->label . '</option>'; |
|
| 2680 | + $out .= '>'.$obj->ref.' - '.$product->label.' - '.$obj->label.'</option>'; |
|
| 2681 | 2681 | } |
| 2682 | 2682 | } else { |
| 2683 | 2683 | $error++; |
@@ -2734,7 +2734,7 @@ discard block |
||
| 2734 | 2734 | |
| 2735 | 2735 | $warehouseStatusArray = array(); |
| 2736 | 2736 | if (!empty($warehouseStatus)) { |
| 2737 | - require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php'; |
|
| 2737 | + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; |
|
| 2738 | 2738 | if (preg_match('/warehouseclosed/', $warehouseStatus)) { |
| 2739 | 2739 | $warehouseStatusArray[] = Entrepot::STATUS_CLOSED; |
| 2740 | 2740 | } |
@@ -2748,9 +2748,9 @@ discard block |
||
| 2748 | 2748 | |
| 2749 | 2749 | $selectFields = " p.rowid, p.ref, p.label, p.description, p.barcode, p.fk_country, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.default_vat_code, p.duration, p.fk_price_expression"; |
| 2750 | 2750 | if (count($warehouseStatusArray)) { |
| 2751 | - $selectFieldsGrouped = ", sum(" . $this->db->ifsql("e.statut IS NULL", "0", "ps.reel") . ") as stock"; // e.statut is null if there is no record in stock |
|
| 2751 | + $selectFieldsGrouped = ", sum(".$this->db->ifsql("e.statut IS NULL", "0", "ps.reel").") as stock"; // e.statut is null if there is no record in stock |
|
| 2752 | 2752 | } else { |
| 2753 | - $selectFieldsGrouped = ", " . $this->db->ifsql("p.stock IS NULL", 0, "p.stock") . " AS stock"; |
|
| 2753 | + $selectFieldsGrouped = ", ".$this->db->ifsql("p.stock IS NULL", 0, "p.stock")." AS stock"; |
|
| 2754 | 2754 | } |
| 2755 | 2755 | |
| 2756 | 2756 | $sql = "SELECT "; |
@@ -2766,9 +2766,9 @@ discard block |
||
| 2766 | 2766 | |
| 2767 | 2767 | if (getDolGlobalString('PRODUCT_SORT_BY_CATEGORY')) { |
| 2768 | 2768 | //Product category |
| 2769 | - $sql .= ", (SELECT " . $this->db->prefix() . "categorie_product.fk_categorie |
|
| 2770 | - FROM " . $this->db->prefix() . "categorie_product |
|
| 2771 | - WHERE " . $this->db->prefix() . "categorie_product.fk_product=p.rowid |
|
| 2769 | + $sql .= ", (SELECT ".$this->db->prefix()."categorie_product.fk_categorie |
|
| 2770 | + FROM " . $this->db->prefix()."categorie_product |
|
| 2771 | + WHERE " . $this->db->prefix()."categorie_product.fk_product=p.rowid |
|
| 2772 | 2772 | LIMIT 1 |
| 2773 | 2773 | ) AS categorie_product_id "; |
| 2774 | 2774 | } |
@@ -2794,15 +2794,15 @@ discard block |
||
| 2794 | 2794 | } |
| 2795 | 2795 | // Price by quantity |
| 2796 | 2796 | if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { |
| 2797 | - $sql .= ", (SELECT pp.rowid FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid"; |
|
| 2797 | + $sql .= ", (SELECT pp.rowid FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid"; |
|
| 2798 | 2798 | if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { |
| 2799 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
| 2799 | + $sql .= " AND price_level = ".((int) $price_level); |
|
| 2800 | 2800 | } |
| 2801 | 2801 | $sql .= " ORDER BY date_price"; |
| 2802 | 2802 | $sql .= " DESC LIMIT 1) as price_rowid"; |
| 2803 | - $sql .= ", (SELECT pp.price_by_qty FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid"; // price_by_qty is 1 if some prices by qty exists in subtable |
|
| 2803 | + $sql .= ", (SELECT pp.price_by_qty FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid"; // price_by_qty is 1 if some prices by qty exists in subtable |
|
| 2804 | 2804 | if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { |
| 2805 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
| 2805 | + $sql .= " AND price_level = ".((int) $price_level); |
|
| 2806 | 2806 | } |
| 2807 | 2807 | $sql .= " ORDER BY date_price"; |
| 2808 | 2808 | $sql .= " DESC LIMIT 1) as price_by_qty"; |
@@ -2816,53 +2816,53 @@ discard block |
||
| 2816 | 2816 | $sql .= $hookmanager->resPrint; |
| 2817 | 2817 | |
| 2818 | 2818 | if (count($warehouseStatusArray)) { |
| 2819 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as ps on ps.fk_product = p.rowid"; |
|
| 2820 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (" . getEntity('stock') . ")"; |
|
| 2821 | - $sql .= ' AND e.statut IN (' . $this->db->sanitize($this->db->escape(implode(',', $warehouseStatusArray))) . ')'; // Return line if product is inside the selected stock. If not, an empty line will be returned so we will count 0. |
|
| 2819 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as ps on ps.fk_product = p.rowid"; |
|
| 2820 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")"; |
|
| 2821 | + $sql .= ' AND e.statut IN ('.$this->db->sanitize($this->db->escape(implode(',', $warehouseStatusArray))).')'; // Return line if product is inside the selected stock. If not, an empty line will be returned so we will count 0. |
|
| 2822 | 2822 | } |
| 2823 | 2823 | |
| 2824 | 2824 | // include search in supplier ref |
| 2825 | 2825 | if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) { |
| 2826 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
| 2826 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
| 2827 | 2827 | } |
| 2828 | 2828 | |
| 2829 | 2829 | //Price by customer |
| 2830 | 2830 | if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) { |
| 2831 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_customer_price as pcp ON pcp.fk_soc=" . ((int) $socid) . " AND pcp.fk_product=p.rowid"; |
|
| 2831 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_customer_price as pcp ON pcp.fk_soc=".((int) $socid)." AND pcp.fk_product=p.rowid"; |
|
| 2832 | 2832 | } |
| 2833 | 2833 | // Units |
| 2834 | 2834 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 2835 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit"; |
|
| 2835 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit"; |
|
| 2836 | 2836 | } |
| 2837 | 2837 | // Multilang : we add translation |
| 2838 | 2838 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
| 2839 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_lang as pl ON pl.fk_product = p.rowid "; |
|
| 2839 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid "; |
|
| 2840 | 2840 | if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE') && !empty($socid)) { |
| 2841 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 2841 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 2842 | 2842 | $soc = new Societe($this->db); |
| 2843 | 2843 | $result = $soc->fetch($socid); |
| 2844 | 2844 | if ($result > 0 && !empty($soc->default_lang)) { |
| 2845 | - $sql .= " AND pl.lang = '" . $this->db->escape($soc->default_lang) . "'"; |
|
| 2845 | + $sql .= " AND pl.lang = '".$this->db->escape($soc->default_lang)."'"; |
|
| 2846 | 2846 | } else { |
| 2847 | - $sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'"; |
|
| 2847 | + $sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'"; |
|
| 2848 | 2848 | } |
| 2849 | 2849 | } else { |
| 2850 | - $sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'"; |
|
| 2850 | + $sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'"; |
|
| 2851 | 2851 | } |
| 2852 | 2852 | } |
| 2853 | 2853 | |
| 2854 | 2854 | if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) { |
| 2855 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_attribute_combination pac ON pac.fk_product_child = p.rowid"; |
|
| 2855 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_attribute_combination pac ON pac.fk_product_child = p.rowid"; |
|
| 2856 | 2856 | } |
| 2857 | 2857 | |
| 2858 | - $sql .= ' WHERE p.entity IN (' . getEntity('product') . ')'; |
|
| 2858 | + $sql .= ' WHERE p.entity IN ('.getEntity('product').')'; |
|
| 2859 | 2859 | |
| 2860 | 2860 | if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) { |
| 2861 | 2861 | $sql .= " AND pac.rowid IS NULL"; |
| 2862 | 2862 | } |
| 2863 | 2863 | |
| 2864 | 2864 | if ($finished == 0) { |
| 2865 | - $sql .= " AND p.finished = " . ((int) $finished); |
|
| 2865 | + $sql .= " AND p.finished = ".((int) $finished); |
|
| 2866 | 2866 | } elseif ($finished == 1) { |
| 2867 | 2867 | $sql .= " AND p.finished = ".((int) $finished); |
| 2868 | 2868 | } |
@@ -2870,11 +2870,11 @@ discard block |
||
| 2870 | 2870 | $sql .= " AND p.tosell = ".((int) $status); |
| 2871 | 2871 | } |
| 2872 | 2872 | if ($status_purchase >= 0) { |
| 2873 | - $sql .= " AND p.tobuy = " . ((int) $status_purchase); |
|
| 2873 | + $sql .= " AND p.tobuy = ".((int) $status_purchase); |
|
| 2874 | 2874 | } |
| 2875 | 2875 | // Filter by product type |
| 2876 | 2876 | if (strval($filtertype) != '') { |
| 2877 | - $sql .= " AND p.fk_product_type = " . ((int) $filtertype); |
|
| 2877 | + $sql .= " AND p.fk_product_type = ".((int) $filtertype); |
|
| 2878 | 2878 | } elseif (!isModEnabled('product')) { // when product module is disabled, show services only |
| 2879 | 2879 | $sql .= " AND p.fk_product_type = 1"; |
| 2880 | 2880 | } elseif (!isModEnabled('service')) { // when service module is disabled, show products only |
@@ -2898,21 +2898,21 @@ discard block |
||
| 2898 | 2898 | if ($i > 0) { |
| 2899 | 2899 | $sql .= " AND "; |
| 2900 | 2900 | } |
| 2901 | - $sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 2901 | + $sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 2902 | 2902 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
| 2903 | - $sql .= " OR pl.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 2903 | + $sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 2904 | 2904 | } |
| 2905 | 2905 | if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) { |
| 2906 | - $sql .= " OR pcp.ref_customer LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 2906 | + $sql .= " OR pcp.ref_customer LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 2907 | 2907 | } |
| 2908 | 2908 | if (getDolGlobalString('PRODUCT_AJAX_SEARCH_ON_DESCRIPTION')) { |
| 2909 | - $sql .= " OR p.description LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 2909 | + $sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 2910 | 2910 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
| 2911 | - $sql .= " OR pl.description LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 2911 | + $sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 2912 | 2912 | } |
| 2913 | 2913 | } |
| 2914 | 2914 | if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) { |
| 2915 | - $sql .= " OR pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 2915 | + $sql .= " OR pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 2916 | 2916 | } |
| 2917 | 2917 | $sql .= ")"; |
| 2918 | 2918 | $i++; |
@@ -2921,12 +2921,12 @@ discard block |
||
| 2921 | 2921 | $sql .= ")"; |
| 2922 | 2922 | } |
| 2923 | 2923 | if (isModEnabled('barcode')) { |
| 2924 | - $sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 2924 | + $sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 2925 | 2925 | } |
| 2926 | 2926 | $sql .= ')'; |
| 2927 | 2927 | } |
| 2928 | 2928 | if (count($warehouseStatusArray)) { |
| 2929 | - $sql .= " GROUP BY " . $selectFields; |
|
| 2929 | + $sql .= " GROUP BY ".$selectFields; |
|
| 2930 | 2930 | } |
| 2931 | 2931 | |
| 2932 | 2932 | //Sort by category |
@@ -2941,23 +2941,23 @@ discard block |
||
| 2941 | 2941 | $sql .= $this->db->plimit($limit, 0); |
| 2942 | 2942 | |
| 2943 | 2943 | // Build output string |
| 2944 | - dol_syslog(get_class($this) . "::select_produits_list search products", LOG_DEBUG); |
|
| 2944 | + dol_syslog(get_class($this)."::select_produits_list search products", LOG_DEBUG); |
|
| 2945 | 2945 | $result = $this->db->query($sql); |
| 2946 | 2946 | if ($result) { |
| 2947 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 2948 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 2949 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php'; |
|
| 2947 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 2948 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 2949 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; |
|
| 2950 | 2950 | |
| 2951 | 2951 | $num = $this->db->num_rows($result); |
| 2952 | 2952 | |
| 2953 | 2953 | $events = null; |
| 2954 | 2954 | |
| 2955 | 2955 | if (!$forcecombo) { |
| 2956 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 2956 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 2957 | 2957 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT")); |
| 2958 | 2958 | } |
| 2959 | 2959 | |
| 2960 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 2960 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 2961 | 2961 | |
| 2962 | 2962 | $textifempty = ''; |
| 2963 | 2963 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -2974,7 +2974,7 @@ discard block |
||
| 2974 | 2974 | } |
| 2975 | 2975 | } |
| 2976 | 2976 | if ($showempty) { |
| 2977 | - $out .= '<option value="-1" selected>' . ($textifempty ? $textifempty : ' ') . '</option>'; |
|
| 2977 | + $out .= '<option value="-1" selected>'.($textifempty ? $textifempty : ' ').'</option>'; |
|
| 2978 | 2978 | } |
| 2979 | 2979 | |
| 2980 | 2980 | $i = 0; |
@@ -2985,11 +2985,11 @@ discard block |
||
| 2985 | 2985 | |
| 2986 | 2986 | if ((getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) && !empty($objp->price_by_qty) && $objp->price_by_qty == 1) { // Price by quantity will return many prices for the same product |
| 2987 | 2987 | $sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise, price_base_type"; |
| 2988 | - $sql .= " FROM " . $this->db->prefix() . "product_price_by_qty"; |
|
| 2989 | - $sql .= " WHERE fk_product_price = " . ((int) $objp->price_rowid); |
|
| 2988 | + $sql .= " FROM ".$this->db->prefix()."product_price_by_qty"; |
|
| 2989 | + $sql .= " WHERE fk_product_price = ".((int) $objp->price_rowid); |
|
| 2990 | 2990 | $sql .= " ORDER BY quantity ASC"; |
| 2991 | 2991 | |
| 2992 | - dol_syslog(get_class($this) . "::select_produits_list search prices by qty", LOG_DEBUG); |
|
| 2992 | + dol_syslog(get_class($this)."::select_produits_list search prices by qty", LOG_DEBUG); |
|
| 2993 | 2993 | $result2 = $this->db->query($sql); |
| 2994 | 2994 | if ($result2) { |
| 2995 | 2995 | $nb_prices = $this->db->num_rows($result2); |
@@ -3027,7 +3027,7 @@ discard block |
||
| 3027 | 3027 | $price_product = new Product($this->db); |
| 3028 | 3028 | $price_product->fetch($objp->rowid, '', '', 1); |
| 3029 | 3029 | |
| 3030 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3030 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3031 | 3031 | $priceparser = new PriceParser($this->db); |
| 3032 | 3032 | $price_result = $priceparser->parseProduct($price_product); |
| 3033 | 3033 | if ($price_result >= 0) { |
@@ -3111,7 +3111,7 @@ discard block |
||
| 3111 | 3111 | $label = $objp->label_translated; |
| 3112 | 3112 | } |
| 3113 | 3113 | if (!empty($filterkey) && $filterkey != '') { |
| 3114 | - $label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1); |
|
| 3114 | + $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1); |
|
| 3115 | 3115 | } |
| 3116 | 3116 | |
| 3117 | 3117 | $outkey = $objp->rowid; |
@@ -3132,32 +3132,32 @@ discard block |
||
| 3132 | 3132 | $outdurationunit = $outtype == Product::TYPE_SERVICE ? substr($objp->duration, -1) : ''; |
| 3133 | 3133 | |
| 3134 | 3134 | if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) { |
| 3135 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
| 3135 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
| 3136 | 3136 | } |
| 3137 | 3137 | |
| 3138 | 3138 | // Units |
| 3139 | 3139 | $outvalUnits = ''; |
| 3140 | 3140 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3141 | 3141 | if (!empty($objp->unit_short)) { |
| 3142 | - $outvalUnits .= ' - ' . $objp->unit_short; |
|
| 3142 | + $outvalUnits .= ' - '.$objp->unit_short; |
|
| 3143 | 3143 | } |
| 3144 | 3144 | } |
| 3145 | 3145 | if (getDolGlobalString('PRODUCT_SHOW_DIMENSIONS_IN_COMBO')) { |
| 3146 | 3146 | if (!empty($objp->weight) && $objp->weight_units !== null) { |
| 3147 | 3147 | $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); |
| 3148 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3148 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3149 | 3149 | } |
| 3150 | 3150 | if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) { |
| 3151 | - $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units); |
|
| 3152 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3151 | + $unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units); |
|
| 3152 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3153 | 3153 | } |
| 3154 | 3154 | if (!empty($objp->surface) && $objp->surface_units !== null) { |
| 3155 | 3155 | $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); |
| 3156 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3156 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3157 | 3157 | } |
| 3158 | 3158 | if (!empty($objp->volume) && $objp->volume_units !== null) { |
| 3159 | 3159 | $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); |
| 3160 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3160 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3161 | 3161 | } |
| 3162 | 3162 | } |
| 3163 | 3163 | if ($outdurationvalue && $outdurationunit) { |
@@ -3169,14 +3169,14 @@ discard block |
||
| 3169 | 3169 | 'y' => $langs->trans('Year') |
| 3170 | 3170 | ); |
| 3171 | 3171 | if (isset($da[$outdurationunit])) { |
| 3172 | - $outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : '')); |
|
| 3172 | + $outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : '')); |
|
| 3173 | 3173 | } |
| 3174 | 3174 | } |
| 3175 | 3175 | |
| 3176 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 3176 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 3177 | 3177 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 3178 | 3178 | if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) { |
| 3179 | - $opt .= ' pbq="' . $objp->price_by_qty_rowid . '" data-pbq="' . $objp->price_by_qty_rowid . '" data-pbqup="' . $objp->price_by_qty_unitprice . '" data-pbqbase="' . $objp->price_by_qty_price_base_type . '" data-pbqqty="' . $objp->price_by_qty_quantity . '" data-pbqpercent="' . $objp->price_by_qty_remise_percent . '"'; |
|
| 3179 | + $opt .= ' pbq="'.$objp->price_by_qty_rowid.'" data-pbq="'.$objp->price_by_qty_rowid.'" data-pbqup="'.$objp->price_by_qty_unitprice.'" data-pbqbase="'.$objp->price_by_qty_price_base_type.'" data-pbqqty="'.$objp->price_by_qty_quantity.'" data-pbqpercent="'.$objp->price_by_qty_remise_percent.'"'; |
|
| 3180 | 3180 | } |
| 3181 | 3181 | if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) { |
| 3182 | 3182 | if ($user->hasRight('stock', 'lire')) { |
@@ -3188,36 +3188,36 @@ discard block |
||
| 3188 | 3188 | } |
| 3189 | 3189 | } |
| 3190 | 3190 | if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE')) { |
| 3191 | - $opt .= ' data-labeltrans="' . $outlabel_translated . '"'; |
|
| 3192 | - $opt .= ' data-desctrans="' . dol_escape_htmltag($outdesc_translated) . '"'; |
|
| 3191 | + $opt .= ' data-labeltrans="'.$outlabel_translated.'"'; |
|
| 3192 | + $opt .= ' data-desctrans="'.dol_escape_htmltag($outdesc_translated).'"'; |
|
| 3193 | 3193 | } |
| 3194 | 3194 | $opt .= '>'; |
| 3195 | 3195 | $opt .= $objp->ref; |
| 3196 | 3196 | if (!empty($objp->custref)) { |
| 3197 | - $opt .= ' (' . $objp->custref . ')'; |
|
| 3197 | + $opt .= ' ('.$objp->custref.')'; |
|
| 3198 | 3198 | } |
| 3199 | 3199 | if ($outbarcode) { |
| 3200 | - $opt .= ' (' . $outbarcode . ')'; |
|
| 3200 | + $opt .= ' ('.$outbarcode.')'; |
|
| 3201 | 3201 | } |
| 3202 | - $opt .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3202 | + $opt .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3203 | 3203 | if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) { |
| 3204 | - $opt .= ' (' . getCountry($outorigin, 1) . ')'; |
|
| 3204 | + $opt .= ' ('.getCountry($outorigin, 1).')'; |
|
| 3205 | 3205 | } |
| 3206 | 3206 | |
| 3207 | 3207 | $objRef = $objp->ref; |
| 3208 | 3208 | if (!empty($objp->custref)) { |
| 3209 | - $objRef .= ' (' . $objp->custref . ')'; |
|
| 3209 | + $objRef .= ' ('.$objp->custref.')'; |
|
| 3210 | 3210 | } |
| 3211 | 3211 | if (!empty($filterkey) && $filterkey != '') { |
| 3212 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 3212 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 3213 | 3213 | } |
| 3214 | 3214 | $outval .= $objRef; |
| 3215 | 3215 | if ($outbarcode) { |
| 3216 | - $outval .= ' (' . $outbarcode . ')'; |
|
| 3216 | + $outval .= ' ('.$outbarcode.')'; |
|
| 3217 | 3217 | } |
| 3218 | - $outval .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3218 | + $outval .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3219 | 3219 | if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) { |
| 3220 | - $outval .= ' (' . getCountry($outorigin, 1) . ')'; |
|
| 3220 | + $outval .= ' ('.getCountry($outorigin, 1).')'; |
|
| 3221 | 3221 | } |
| 3222 | 3222 | |
| 3223 | 3223 | // Units |
@@ -3230,35 +3230,35 @@ discard block |
||
| 3230 | 3230 | // If we need a particular price level (from 1 to n) |
| 3231 | 3231 | if (empty($hidepriceinlabel) && $price_level >= 1 && (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'))) { |
| 3232 | 3232 | $sql = "SELECT price, price_ttc, price_base_type, tva_tx, default_vat_code"; |
| 3233 | - $sql .= " FROM " . $this->db->prefix() . "product_price"; |
|
| 3234 | - $sql .= " WHERE fk_product = " . ((int) $objp->rowid); |
|
| 3235 | - $sql .= " AND entity IN (" . getEntity('productprice') . ")"; |
|
| 3236 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
| 3233 | + $sql .= " FROM ".$this->db->prefix()."product_price"; |
|
| 3234 | + $sql .= " WHERE fk_product = ".((int) $objp->rowid); |
|
| 3235 | + $sql .= " AND entity IN (".getEntity('productprice').")"; |
|
| 3236 | + $sql .= " AND price_level = ".((int) $price_level); |
|
| 3237 | 3237 | $sql .= " ORDER BY date_price DESC, rowid DESC"; // Warning DESC must be both on date_price and rowid. |
| 3238 | 3238 | $sql .= " LIMIT 1"; |
| 3239 | 3239 | |
| 3240 | - dol_syslog(get_class($this) . '::constructProductListOption search price for product ' . $objp->rowid . ' AND level ' . $price_level, LOG_DEBUG); |
|
| 3240 | + dol_syslog(get_class($this).'::constructProductListOption search price for product '.$objp->rowid.' AND level '.$price_level, LOG_DEBUG); |
|
| 3241 | 3241 | $result2 = $this->db->query($sql); |
| 3242 | 3242 | if ($result2) { |
| 3243 | 3243 | $objp2 = $this->db->fetch_object($result2); |
| 3244 | 3244 | if ($objp2) { |
| 3245 | 3245 | $found = 1; |
| 3246 | 3246 | if ($objp2->price_base_type == 'HT') { |
| 3247 | - $opt .= ' - ' . price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
| 3248 | - $outval .= ' - ' . price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
| 3247 | + $opt .= ' - '.price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
| 3248 | + $outval .= ' - '.price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
| 3249 | 3249 | } else { |
| 3250 | - $opt .= ' - ' . price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
| 3251 | - $outval .= ' - ' . price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
| 3250 | + $opt .= ' - '.price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
| 3251 | + $outval .= ' - '.price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
| 3252 | 3252 | } |
| 3253 | 3253 | $outprice_ht = price($objp2->price); |
| 3254 | 3254 | $outprice_ttc = price($objp2->price_ttc); |
| 3255 | 3255 | $outpricebasetype = $objp2->price_base_type; |
| 3256 | 3256 | if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) { // using this option is a bug. kept for backward compatibility |
| 3257 | - $outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice |
|
| 3258 | - $outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice |
|
| 3257 | + $outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice |
|
| 3258 | + $outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice |
|
| 3259 | 3259 | } else { |
| 3260 | - $outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice |
|
| 3261 | - $outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice |
|
| 3260 | + $outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice |
|
| 3261 | + $outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice |
|
| 3262 | 3262 | } |
| 3263 | 3263 | } |
| 3264 | 3264 | } else { |
@@ -3272,13 +3272,13 @@ discard block |
||
| 3272 | 3272 | $outqty = $objp->quantity; |
| 3273 | 3273 | $outdiscount = $objp->remise_percent; |
| 3274 | 3274 | if ($objp->quantity == 1) { |
| 3275 | - $opt .= ' - ' . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3276 | - $outval .= ' - ' . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3275 | + $opt .= ' - '.price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3276 | + $outval .= ' - '.price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3277 | 3277 | $opt .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding |
| 3278 | 3278 | $outval .= $langs->transnoentities("Unit"); |
| 3279 | 3279 | } else { |
| 3280 | - $opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3281 | - $outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3280 | + $opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3281 | + $outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3282 | 3282 | $opt .= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
| 3283 | 3283 | $outval .= $langs->transnoentities("Units"); |
| 3284 | 3284 | } |
@@ -3286,16 +3286,16 @@ discard block |
||
| 3286 | 3286 | $outprice_ht = price($objp->unitprice); |
| 3287 | 3287 | $outprice_ttc = price($objp->unitprice * (1 + ($objp->tva_tx / 100))); |
| 3288 | 3288 | $outpricebasetype = $objp->price_base_type; |
| 3289 | - $outtva_tx = $objp->tva_tx; // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty |
|
| 3290 | - $outdefault_vat_code = $objp->default_vat_code; // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty |
|
| 3289 | + $outtva_tx = $objp->tva_tx; // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty |
|
| 3290 | + $outdefault_vat_code = $objp->default_vat_code; // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty |
|
| 3291 | 3291 | } |
| 3292 | 3292 | if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1) { |
| 3293 | - $opt .= " (" . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3294 | - $outval .= " (" . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3293 | + $opt .= " (".price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3294 | + $outval .= " (".price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3295 | 3295 | } |
| 3296 | 3296 | if (empty($hidepriceinlabel) && !empty($objp->remise_percent) && $objp->remise_percent >= 1) { |
| 3297 | - $opt .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 3298 | - $outval .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 3297 | + $opt .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 3298 | + $outval .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 3299 | 3299 | } |
| 3300 | 3300 | |
| 3301 | 3301 | // Price by customer |
@@ -3304,11 +3304,11 @@ discard block |
||
| 3304 | 3304 | $found = 1; |
| 3305 | 3305 | |
| 3306 | 3306 | if ($objp->custprice_base_type == 'HT') { |
| 3307 | - $opt .= ' - ' . price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
| 3308 | - $outval .= ' - ' . price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
| 3307 | + $opt .= ' - '.price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
| 3308 | + $outval .= ' - '.price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
| 3309 | 3309 | } else { |
| 3310 | - $opt .= ' - ' . price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
| 3311 | - $outval .= ' - ' . price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
| 3310 | + $opt .= ' - '.price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
| 3311 | + $outval .= ' - '.price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
| 3312 | 3312 | } |
| 3313 | 3313 | |
| 3314 | 3314 | $outprice_ht = price($objp->custprice); |
@@ -3322,11 +3322,11 @@ discard block |
||
| 3322 | 3322 | // If level no defined or multiprice not found, we used the default price |
| 3323 | 3323 | if (empty($hidepriceinlabel) && !$found) { |
| 3324 | 3324 | if ($objp->price_base_type == 'HT') { |
| 3325 | - $opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
| 3326 | - $outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
| 3325 | + $opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
| 3326 | + $outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
| 3327 | 3327 | } else { |
| 3328 | - $opt .= ' - ' . price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
| 3329 | - $outval .= ' - ' . price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
| 3328 | + $opt .= ' - '.price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
| 3329 | + $outval .= ' - '.price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
| 3330 | 3330 | } |
| 3331 | 3331 | $outprice_ht = price($objp->price); |
| 3332 | 3332 | $outprice_ttc = price($objp->price_ttc); |
@@ -3337,14 +3337,14 @@ discard block |
||
| 3337 | 3337 | |
| 3338 | 3338 | if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) { |
| 3339 | 3339 | if ($user->hasRight('stock', 'lire')) { |
| 3340 | - $opt .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS')); |
|
| 3340 | + $opt .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS')); |
|
| 3341 | 3341 | |
| 3342 | 3342 | if ($objp->stock > 0) { |
| 3343 | 3343 | $outval .= ' - <span class="product_line_stock_ok">'; |
| 3344 | 3344 | } elseif ($objp->stock <= 0) { |
| 3345 | 3345 | $outval .= ' - <span class="product_line_stock_too_low">'; |
| 3346 | 3346 | } |
| 3347 | - $outval .= $langs->transnoentities("Stock") . ': ' . price(price2num($objp->stock, 'MS')); |
|
| 3347 | + $outval .= $langs->transnoentities("Stock").': '.price(price2num($objp->stock, 'MS')); |
|
| 3348 | 3348 | $outval .= '</span>'; |
| 3349 | 3349 | if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) { // Warning, this option may slow down combo list generation |
| 3350 | 3350 | $langs->load("stocks"); |
@@ -3354,9 +3354,9 @@ discard block |
||
| 3354 | 3354 | $tmpproduct->load_virtual_stock(); |
| 3355 | 3355 | $virtualstock = $tmpproduct->stock_theorique; |
| 3356 | 3356 | |
| 3357 | - $opt .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock; |
|
| 3357 | + $opt .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock; |
|
| 3358 | 3358 | |
| 3359 | - $outval .= ' - ' . $langs->transnoentities("VirtualStock") . ':'; |
|
| 3359 | + $outval .= ' - '.$langs->transnoentities("VirtualStock").':'; |
|
| 3360 | 3360 | if ($virtualstock > 0) { |
| 3361 | 3361 | $outval .= '<span class="product_line_stock_ok">'; |
| 3362 | 3362 | } elseif ($virtualstock <= 0) { |
@@ -3434,7 +3434,7 @@ discard block |
||
| 3434 | 3434 | $selected_input_value = ''; |
| 3435 | 3435 | if (!empty($conf->use_javascript_ajax) && getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) { |
| 3436 | 3436 | if ($selected > 0) { |
| 3437 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 3437 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 3438 | 3438 | $producttmpselect = new Product($this->db); |
| 3439 | 3439 | $producttmpselect->fetch($selected); |
| 3440 | 3440 | $selected_input_value = $producttmpselect->ref; |
@@ -3442,10 +3442,10 @@ discard block |
||
| 3442 | 3442 | } |
| 3443 | 3443 | |
| 3444 | 3444 | // mode=2 means suppliers products |
| 3445 | - $urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=2&status=' . $status . '&finished=' . $finished . '&alsoproductwithnosupplierprice=' . $alsoproductwithnosupplierprice; |
|
| 3446 | - print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); |
|
| 3445 | + $urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice; |
|
| 3446 | + print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); |
|
| 3447 | 3447 | |
| 3448 | - print($hidelabel ? '' : $langs->trans("RefOrLabel") . ' : ') . '<input type="text" class="minwidth300" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . $placeholder . '"' : '') . '>'; |
|
| 3448 | + print($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" class="minwidth300" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.$placeholder.'"' : '').'>'; |
|
| 3449 | 3449 | } else { |
| 3450 | 3450 | print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', $status, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder); |
| 3451 | 3451 | } |
@@ -3508,25 +3508,25 @@ discard block |
||
| 3508 | 3508 | if (isModEnabled('barcode')) { |
| 3509 | 3509 | $sql .= ", pfp.barcode"; |
| 3510 | 3510 | } |
| 3511 | - $sql .= " FROM " . $this->db->prefix() . "product as p"; |
|
| 3512 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (" . getEntity('product') . ") )"; |
|
| 3511 | + $sql .= " FROM ".$this->db->prefix()."product as p"; |
|
| 3512 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )"; |
|
| 3513 | 3513 | if ($socid > 0) { |
| 3514 | - $sql .= " AND pfp.fk_soc = " . ((int) $socid); |
|
| 3514 | + $sql .= " AND pfp.fk_soc = ".((int) $socid); |
|
| 3515 | 3515 | } |
| 3516 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid"; |
|
| 3516 | + $sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid"; |
|
| 3517 | 3517 | // Units |
| 3518 | 3518 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3519 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit"; |
|
| 3519 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit"; |
|
| 3520 | 3520 | } |
| 3521 | - $sql .= " WHERE p.entity IN (" . getEntity('product') . ")"; |
|
| 3521 | + $sql .= " WHERE p.entity IN (".getEntity('product').")"; |
|
| 3522 | 3522 | if ($statut != -1) { |
| 3523 | - $sql .= " AND p.tobuy = " . ((int) $statut); |
|
| 3523 | + $sql .= " AND p.tobuy = ".((int) $statut); |
|
| 3524 | 3524 | } |
| 3525 | 3525 | if (strval($filtertype) != '') { |
| 3526 | - $sql .= " AND p.fk_product_type = " . ((int) $filtertype); |
|
| 3526 | + $sql .= " AND p.fk_product_type = ".((int) $filtertype); |
|
| 3527 | 3527 | } |
| 3528 | 3528 | if (!empty($filtre)) { |
| 3529 | - $sql .= " " . $filtre; |
|
| 3529 | + $sql .= " ".$filtre; |
|
| 3530 | 3530 | } |
| 3531 | 3531 | // Add where from hooks |
| 3532 | 3532 | $parameters = array(); |
@@ -3546,9 +3546,9 @@ discard block |
||
| 3546 | 3546 | if ($i > 0) { |
| 3547 | 3547 | $sql .= " AND "; |
| 3548 | 3548 | } |
| 3549 | - $sql .= "(pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3549 | + $sql .= "(pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%' OR p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3550 | 3550 | if (getDolGlobalString('PRODUIT_FOURN_TEXTS')) { |
| 3551 | - $sql .= " OR pfp.desc_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3551 | + $sql .= " OR pfp.desc_fourn LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3552 | 3552 | } |
| 3553 | 3553 | $sql .= ")"; |
| 3554 | 3554 | $i++; |
@@ -3557,8 +3557,8 @@ discard block |
||
| 3557 | 3557 | $sql .= ")"; |
| 3558 | 3558 | } |
| 3559 | 3559 | if (isModEnabled('barcode')) { |
| 3560 | - $sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 3561 | - $sql .= " OR pfp.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 3560 | + $sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 3561 | + $sql .= " OR pfp.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 3562 | 3562 | } |
| 3563 | 3563 | $sql .= ')'; |
| 3564 | 3564 | } |
@@ -3567,20 +3567,20 @@ discard block |
||
| 3567 | 3567 | |
| 3568 | 3568 | // Build output string |
| 3569 | 3569 | |
| 3570 | - dol_syslog(get_class($this) . "::select_produits_fournisseurs_list", LOG_DEBUG); |
|
| 3570 | + dol_syslog(get_class($this)."::select_produits_fournisseurs_list", LOG_DEBUG); |
|
| 3571 | 3571 | $result = $this->db->query($sql); |
| 3572 | 3572 | if ($result) { |
| 3573 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3574 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php'; |
|
| 3573 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3574 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; |
|
| 3575 | 3575 | |
| 3576 | 3576 | $num = $this->db->num_rows($result); |
| 3577 | 3577 | |
| 3578 | 3578 | //$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">'; // remove select to have id same with combo and ajax |
| 3579 | - $out .= '<select class="flat ' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 3579 | + $out .= '<select class="flat '.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 3580 | 3580 | if (!$selected) { |
| 3581 | - $out .= '<option value="-1" selected>' . ($placeholder ? $placeholder : ' ') . '</option>'; |
|
| 3581 | + $out .= '<option value="-1" selected>'.($placeholder ? $placeholder : ' ').'</option>'; |
|
| 3582 | 3582 | } else { |
| 3583 | - $out .= '<option value="-1">' . ($placeholder ? $placeholder : ' ') . '</option>'; |
|
| 3583 | + $out .= '<option value="-1">'.($placeholder ? $placeholder : ' ').'</option>'; |
|
| 3584 | 3584 | } |
| 3585 | 3585 | |
| 3586 | 3586 | $i = 0; |
@@ -3595,7 +3595,7 @@ discard block |
||
| 3595 | 3595 | |
| 3596 | 3596 | $outkey = $objp->idprodfournprice; // id in table of price |
| 3597 | 3597 | if (!$outkey && $alsoproductwithnosupplierprice) { |
| 3598 | - $outkey = 'idprod_' . $objp->rowid; // id of product |
|
| 3598 | + $outkey = 'idprod_'.$objp->rowid; // id of product |
|
| 3599 | 3599 | } |
| 3600 | 3600 | |
| 3601 | 3601 | $outref = $objp->ref; |
@@ -3610,23 +3610,23 @@ discard block |
||
| 3610 | 3610 | $outvalUnits = ''; |
| 3611 | 3611 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3612 | 3612 | if (!empty($objp->unit_short)) { |
| 3613 | - $outvalUnits .= ' - ' . $objp->unit_short; |
|
| 3613 | + $outvalUnits .= ' - '.$objp->unit_short; |
|
| 3614 | 3614 | } |
| 3615 | 3615 | if (!empty($objp->weight) && $objp->weight_units !== null) { |
| 3616 | 3616 | $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); |
| 3617 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3617 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3618 | 3618 | } |
| 3619 | 3619 | if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) { |
| 3620 | - $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units); |
|
| 3621 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3620 | + $unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units); |
|
| 3621 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3622 | 3622 | } |
| 3623 | 3623 | if (!empty($objp->surface) && $objp->surface_units !== null) { |
| 3624 | 3624 | $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); |
| 3625 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3625 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3626 | 3626 | } |
| 3627 | 3627 | if (!empty($objp->volume) && $objp->volume_units !== null) { |
| 3628 | 3628 | $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); |
| 3629 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3629 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3630 | 3630 | } |
| 3631 | 3631 | if ($outdurationvalue && $outdurationunit) { |
| 3632 | 3632 | $da = array( |
@@ -3637,22 +3637,22 @@ discard block |
||
| 3637 | 3637 | 'y' => $langs->trans('Year') |
| 3638 | 3638 | ); |
| 3639 | 3639 | if (isset($da[$outdurationunit])) { |
| 3640 | - $outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : '')); |
|
| 3640 | + $outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : '')); |
|
| 3641 | 3641 | } |
| 3642 | 3642 | } |
| 3643 | 3643 | } |
| 3644 | 3644 | |
| 3645 | 3645 | $objRef = $objp->ref; |
| 3646 | 3646 | if ($filterkey && $filterkey != '') { |
| 3647 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 3647 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 3648 | 3648 | } |
| 3649 | 3649 | $objRefFourn = $objp->ref_fourn; |
| 3650 | 3650 | if ($filterkey && $filterkey != '') { |
| 3651 | - $objRefFourn = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRefFourn, 1); |
|
| 3651 | + $objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRefFourn, 1); |
|
| 3652 | 3652 | } |
| 3653 | 3653 | $label = $objp->label; |
| 3654 | 3654 | if ($filterkey && $filterkey != '') { |
| 3655 | - $label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1); |
|
| 3655 | + $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1); |
|
| 3656 | 3656 | } |
| 3657 | 3657 | |
| 3658 | 3658 | switch ($objp->fk_product_type) { |
@@ -3675,21 +3675,21 @@ discard block |
||
| 3675 | 3675 | |
| 3676 | 3676 | $optlabel .= $objp->ref; |
| 3677 | 3677 | if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { |
| 3678 | - $optlabel .= ' <span class="opacitymedium">(' . $objp->ref_fourn . ')</span>'; |
|
| 3678 | + $optlabel .= ' <span class="opacitymedium">('.$objp->ref_fourn.')</span>'; |
|
| 3679 | 3679 | } |
| 3680 | 3680 | if (isModEnabled('barcode') && !empty($objp->barcode)) { |
| 3681 | - $optlabel .= ' (' . $outbarcode . ')'; |
|
| 3681 | + $optlabel .= ' ('.$outbarcode.')'; |
|
| 3682 | 3682 | } |
| 3683 | - $optlabel .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3683 | + $optlabel .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3684 | 3684 | |
| 3685 | 3685 | $outvallabel = $objRef; |
| 3686 | 3686 | if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { |
| 3687 | - $outvallabel .= ' (' . $objRefFourn . ')'; |
|
| 3687 | + $outvallabel .= ' ('.$objRefFourn.')'; |
|
| 3688 | 3688 | } |
| 3689 | 3689 | if (isModEnabled('barcode') && !empty($objp->barcode)) { |
| 3690 | - $outvallabel .= ' (' . $outbarcode . ')'; |
|
| 3690 | + $outvallabel .= ' ('.$outbarcode.')'; |
|
| 3691 | 3691 | } |
| 3692 | - $outvallabel .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3692 | + $outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3693 | 3693 | |
| 3694 | 3694 | // Units |
| 3695 | 3695 | $optlabel .= $outvalUnits; |
@@ -3706,7 +3706,7 @@ discard block |
||
| 3706 | 3706 | $prod_supplier->fourn_tva_tx = $objp->tva_tx; |
| 3707 | 3707 | $prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression; |
| 3708 | 3708 | |
| 3709 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3709 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3710 | 3710 | $priceparser = new PriceParser($this->db); |
| 3711 | 3711 | $price_result = $priceparser->parseProductSupplier($prod_supplier); |
| 3712 | 3712 | if ($price_result >= 0) { |
@@ -3717,47 +3717,47 @@ discard block |
||
| 3717 | 3717 | } |
| 3718 | 3718 | } |
| 3719 | 3719 | if ($objp->quantity == 1) { |
| 3720 | - $optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3721 | - $outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3720 | + $optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3721 | + $outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3722 | 3722 | $optlabel .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding |
| 3723 | 3723 | $outvallabel .= $langs->transnoentities("Unit"); |
| 3724 | 3724 | } else { |
| 3725 | - $optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3726 | - $outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3727 | - $optlabel .= ' ' . $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
|
| 3728 | - $outvallabel .= ' ' . $langs->transnoentities("Units"); |
|
| 3725 | + $optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3726 | + $outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3727 | + $optlabel .= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
|
| 3728 | + $outvallabel .= ' '.$langs->transnoentities("Units"); |
|
| 3729 | 3729 | } |
| 3730 | 3730 | |
| 3731 | 3731 | if ($objp->quantity > 1) { |
| 3732 | - $optlabel .= " (" . price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3733 | - $outvallabel .= " (" . price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3732 | + $optlabel .= " (".price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3733 | + $outvallabel .= " (".price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3734 | 3734 | } |
| 3735 | 3735 | if ($objp->remise_percent >= 1) { |
| 3736 | - $optlabel .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 3737 | - $outvallabel .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 3736 | + $optlabel .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 3737 | + $outvallabel .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 3738 | 3738 | } |
| 3739 | 3739 | if ($objp->duration) { |
| 3740 | - $optlabel .= " - " . $objp->duration; |
|
| 3741 | - $outvallabel .= " - " . $objp->duration; |
|
| 3740 | + $optlabel .= " - ".$objp->duration; |
|
| 3741 | + $outvallabel .= " - ".$objp->duration; |
|
| 3742 | 3742 | } |
| 3743 | 3743 | if (!$socid) { |
| 3744 | - $optlabel .= " - " . dol_trunc($objp->name, 8); |
|
| 3745 | - $outvallabel .= " - " . dol_trunc($objp->name, 8); |
|
| 3744 | + $optlabel .= " - ".dol_trunc($objp->name, 8); |
|
| 3745 | + $outvallabel .= " - ".dol_trunc($objp->name, 8); |
|
| 3746 | 3746 | } |
| 3747 | 3747 | if ($objp->supplier_reputation) { |
| 3748 | 3748 | //TODO dictionary |
| 3749 | 3749 | $reputations = array('' => $langs->trans('Standard'), 'FAVORITE' => $langs->trans('Favorite'), 'NOTTHGOOD' => $langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER' => $langs->trans('DoNotOrderThisProductToThisSupplier')); |
| 3750 | 3750 | |
| 3751 | - $optlabel .= " - " . $reputations[$objp->supplier_reputation]; |
|
| 3752 | - $outvallabel .= " - " . $reputations[$objp->supplier_reputation]; |
|
| 3751 | + $optlabel .= " - ".$reputations[$objp->supplier_reputation]; |
|
| 3752 | + $outvallabel .= " - ".$reputations[$objp->supplier_reputation]; |
|
| 3753 | 3753 | } |
| 3754 | 3754 | } else { |
| 3755 | 3755 | if (empty($alsoproductwithnosupplierprice)) { // No supplier price defined for couple product/supplier |
| 3756 | - $optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>'; |
|
| 3757 | - $outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
| 3756 | + $optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>'; |
|
| 3757 | + $outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
| 3758 | 3758 | } else { // No supplier price defined for product, even on other suppliers |
| 3759 | - $optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>'; |
|
| 3760 | - $outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
| 3759 | + $optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>'; |
|
| 3760 | + $outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
| 3761 | 3761 | } |
| 3762 | 3762 | } |
| 3763 | 3763 | |
@@ -3765,14 +3765,14 @@ discard block |
||
| 3765 | 3765 | $novirtualstock = ($showstockinlist == 2); |
| 3766 | 3766 | |
| 3767 | 3767 | if ($user->hasRight('stock', 'lire')) { |
| 3768 | - $outvallabel .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS')); |
|
| 3768 | + $outvallabel .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS')); |
|
| 3769 | 3769 | |
| 3770 | 3770 | if ($objp->stock > 0) { |
| 3771 | 3771 | $optlabel .= ' - <span class="product_line_stock_ok">'; |
| 3772 | 3772 | } elseif ($objp->stock <= 0) { |
| 3773 | 3773 | $optlabel .= ' - <span class="product_line_stock_too_low">'; |
| 3774 | 3774 | } |
| 3775 | - $optlabel .= $langs->transnoentities("Stock") . ':' . price(price2num($objp->stock, 'MS')); |
|
| 3775 | + $optlabel .= $langs->transnoentities("Stock").':'.price(price2num($objp->stock, 'MS')); |
|
| 3776 | 3776 | $optlabel .= '</span>'; |
| 3777 | 3777 | if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) { // Warning, this option may slow down combo list generation |
| 3778 | 3778 | $langs->load("stocks"); |
@@ -3782,9 +3782,9 @@ discard block |
||
| 3782 | 3782 | $tmpproduct->load_virtual_stock(); |
| 3783 | 3783 | $virtualstock = $tmpproduct->stock_theorique; |
| 3784 | 3784 | |
| 3785 | - $outvallabel .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock; |
|
| 3785 | + $outvallabel .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock; |
|
| 3786 | 3786 | |
| 3787 | - $optlabel .= ' - ' . $langs->transnoentities("VirtualStock") . ':'; |
|
| 3787 | + $optlabel .= ' - '.$langs->transnoentities("VirtualStock").':'; |
|
| 3788 | 3788 | if ($virtualstock > 0) { |
| 3789 | 3789 | $optlabel .= '<span class="product_line_stock_ok">'; |
| 3790 | 3790 | } elseif ($virtualstock <= 0) { |
@@ -3798,7 +3798,7 @@ discard block |
||
| 3798 | 3798 | } |
| 3799 | 3799 | } |
| 3800 | 3800 | |
| 3801 | - $optstart = '<option value="' . $outkey . '"'; |
|
| 3801 | + $optstart = '<option value="'.$outkey.'"'; |
|
| 3802 | 3802 | if ($selected && $selected == $objp->idprodfournprice) { |
| 3803 | 3803 | $optstart .= ' selected'; |
| 3804 | 3804 | } |
@@ -3807,31 +3807,31 @@ discard block |
||
| 3807 | 3807 | } |
| 3808 | 3808 | |
| 3809 | 3809 | if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) { |
| 3810 | - $optstart .= ' data-product-id="' . dol_escape_htmltag($objp->rowid) . '"'; |
|
| 3811 | - $optstart .= ' data-price-id="' . dol_escape_htmltag($objp->idprodfournprice) . '"'; |
|
| 3812 | - $optstart .= ' data-qty="' . dol_escape_htmltag($objp->quantity) . '"'; |
|
| 3813 | - $optstart .= ' data-up="' . dol_escape_htmltag(price2num($objp->unitprice)) . '"'; |
|
| 3814 | - $optstart .= ' data-up-locale="' . dol_escape_htmltag(price($objp->unitprice)) . '"'; |
|
| 3815 | - $optstart .= ' data-discount="' . dol_escape_htmltag($outdiscount) . '"'; |
|
| 3816 | - $optstart .= ' data-tvatx="' . dol_escape_htmltag(price2num($objp->tva_tx)) . '"'; |
|
| 3817 | - $optstart .= ' data-tvatx-formated="' . dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)) . '"'; |
|
| 3818 | - $optstart .= ' data-default-vat-code="' . dol_escape_htmltag($objp->default_vat_code) . '"'; |
|
| 3819 | - $optstart .= ' data-supplier-ref="' . dol_escape_htmltag($objp->ref_fourn) . '"'; |
|
| 3810 | + $optstart .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'"'; |
|
| 3811 | + $optstart .= ' data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'"'; |
|
| 3812 | + $optstart .= ' data-qty="'.dol_escape_htmltag($objp->quantity).'"'; |
|
| 3813 | + $optstart .= ' data-up="'.dol_escape_htmltag(price2num($objp->unitprice)).'"'; |
|
| 3814 | + $optstart .= ' data-up-locale="'.dol_escape_htmltag(price($objp->unitprice)).'"'; |
|
| 3815 | + $optstart .= ' data-discount="'.dol_escape_htmltag($outdiscount).'"'; |
|
| 3816 | + $optstart .= ' data-tvatx="'.dol_escape_htmltag(price2num($objp->tva_tx)).'"'; |
|
| 3817 | + $optstart .= ' data-tvatx-formated="'.dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)).'"'; |
|
| 3818 | + $optstart .= ' data-default-vat-code="'.dol_escape_htmltag($objp->default_vat_code).'"'; |
|
| 3819 | + $optstart .= ' data-supplier-ref="'.dol_escape_htmltag($objp->ref_fourn).'"'; |
|
| 3820 | 3820 | if (isModEnabled('multicurrency')) { |
| 3821 | - $optstart .= ' data-multicurrency-code="' . dol_escape_htmltag($objp->multicurrency_code) . '"'; |
|
| 3822 | - $optstart .= ' data-multicurrency-up="' . dol_escape_htmltag($objp->multicurrency_unitprice) . '"'; |
|
| 3821 | + $optstart .= ' data-multicurrency-code="'.dol_escape_htmltag($objp->multicurrency_code).'"'; |
|
| 3822 | + $optstart .= ' data-multicurrency-up="'.dol_escape_htmltag($objp->multicurrency_unitprice).'"'; |
|
| 3823 | 3823 | } |
| 3824 | 3824 | } |
| 3825 | - $optstart .= ' data-description="' . dol_escape_htmltag($objp->description, 0, 1) . '"'; |
|
| 3825 | + $optstart .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"'; |
|
| 3826 | 3826 | |
| 3827 | 3827 | $outarrayentry = array( |
| 3828 | 3828 | 'key' => $outkey, |
| 3829 | 3829 | 'value' => $outref, |
| 3830 | 3830 | 'label' => $outvallabel, |
| 3831 | 3831 | 'qty' => $outqty, |
| 3832 | - 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 3833 | - 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 3834 | - 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 3832 | + 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 3833 | + 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 3834 | + 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 3835 | 3835 | 'tva_tx_formated' => price($objp->tva_tx, 0, $langs, 1, -1, 2), |
| 3836 | 3836 | 'tva_tx' => price2num($objp->tva_tx), |
| 3837 | 3837 | 'default_vat_code' => $objp->default_vat_code, |
@@ -3860,17 +3860,17 @@ discard block |
||
| 3860 | 3860 | // Add new entry |
| 3861 | 3861 | // "key" value of json key array is used by jQuery automatically as selected value. Example: 'type' = product or service, 'price_ht' = unit price without tax |
| 3862 | 3862 | // "label" value of json key array is used by jQuery automatically as text for combo box |
| 3863 | - $out .= $optstart . ' data-html="' . dol_escape_htmltag($optlabel) . '">' . $optlabel . "</option>\n"; |
|
| 3863 | + $out .= $optstart.' data-html="'.dol_escape_htmltag($optlabel).'">'.$optlabel."</option>\n"; |
|
| 3864 | 3864 | $outarraypush = array( |
| 3865 | 3865 | 'key' => $outkey, |
| 3866 | 3866 | 'value' => $outref, |
| 3867 | 3867 | 'label' => $outvallabel, |
| 3868 | 3868 | 'qty' => $outqty, |
| 3869 | - 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 3869 | + 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 3870 | 3870 | 'price_qty_ht_locale' => price($objp->fprice), |
| 3871 | - 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 3871 | + 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 3872 | 3872 | 'price_unit_ht_locale' => price($objp->unitprice), |
| 3873 | - 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 3873 | + 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 3874 | 3874 | 'tva_tx_formated' => price($objp->tva_tx), |
| 3875 | 3875 | 'tva_tx' => price2num($objp->tva_tx), |
| 3876 | 3876 | 'default_vat_code' => $objp->default_vat_code, |
@@ -3902,7 +3902,7 @@ discard block |
||
| 3902 | 3902 | |
| 3903 | 3903 | $this->db->free($result); |
| 3904 | 3904 | |
| 3905 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 3905 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 3906 | 3906 | $out .= ajax_combobox($htmlname); |
| 3907 | 3907 | } else { |
| 3908 | 3908 | dol_print_error($this->db); |
@@ -3934,43 +3934,43 @@ discard block |
||
| 3934 | 3934 | $sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, pfp.fk_soc,"; |
| 3935 | 3935 | $sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,"; |
| 3936 | 3936 | $sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name"; |
| 3937 | - $sql .= " FROM " . $this->db->prefix() . "product as p"; |
|
| 3938 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
| 3939 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid"; |
|
| 3940 | - $sql .= " WHERE pfp.entity IN (" . getEntity('productsupplierprice') . ")"; |
|
| 3937 | + $sql .= " FROM ".$this->db->prefix()."product as p"; |
|
| 3938 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
| 3939 | + $sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid"; |
|
| 3940 | + $sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")"; |
|
| 3941 | 3941 | $sql .= " AND p.tobuy = 1"; |
| 3942 | 3942 | $sql .= " AND s.fournisseur = 1"; |
| 3943 | - $sql .= " AND p.rowid = " . ((int) $productid); |
|
| 3943 | + $sql .= " AND p.rowid = ".((int) $productid); |
|
| 3944 | 3944 | if (!getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED')) { |
| 3945 | 3945 | $sql .= " ORDER BY s.nom, pfp.ref_fourn DESC"; |
| 3946 | 3946 | } else { |
| 3947 | 3947 | $sql .= " ORDER BY pfp.unitprice ASC"; |
| 3948 | 3948 | } |
| 3949 | 3949 | |
| 3950 | - dol_syslog(get_class($this) . "::select_product_fourn_price", LOG_DEBUG); |
|
| 3950 | + dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG); |
|
| 3951 | 3951 | $result = $this->db->query($sql); |
| 3952 | 3952 | |
| 3953 | 3953 | if ($result) { |
| 3954 | 3954 | $num = $this->db->num_rows($result); |
| 3955 | 3955 | |
| 3956 | - $form = '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 3956 | + $form = '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 3957 | 3957 | |
| 3958 | 3958 | if (!$num) { |
| 3959 | - $form .= '<option value="0">-- ' . $langs->trans("NoSupplierPriceDefinedForThisProduct") . ' --</option>'; |
|
| 3959 | + $form .= '<option value="0">-- '.$langs->trans("NoSupplierPriceDefinedForThisProduct").' --</option>'; |
|
| 3960 | 3960 | } else { |
| 3961 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3961 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3962 | 3962 | $form .= '<option value="0"> </option>'; |
| 3963 | 3963 | |
| 3964 | 3964 | $i = 0; |
| 3965 | 3965 | while ($i < $num) { |
| 3966 | 3966 | $objp = $this->db->fetch_object($result); |
| 3967 | 3967 | |
| 3968 | - $opt = '<option value="' . $objp->idprodfournprice . '"'; |
|
| 3968 | + $opt = '<option value="'.$objp->idprodfournprice.'"'; |
|
| 3969 | 3969 | //if there is only one supplier, preselect it |
| 3970 | 3970 | if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier) || ($i == 0 && getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED'))) { |
| 3971 | 3971 | $opt .= ' selected'; |
| 3972 | 3972 | } |
| 3973 | - $opt .= '>' . $objp->name . ' - ' . $objp->ref_fourn . ' - '; |
|
| 3973 | + $opt .= '>'.$objp->name.' - '.$objp->ref_fourn.' - '; |
|
| 3974 | 3974 | |
| 3975 | 3975 | if (isModEnabled('dynamicprices') && !empty($objp->fk_supplier_price_expression)) { |
| 3976 | 3976 | $prod_supplier = new ProductFournisseur($this->db); |
@@ -3980,7 +3980,7 @@ discard block |
||
| 3980 | 3980 | $prod_supplier->fourn_tva_tx = $objp->tva_tx; |
| 3981 | 3981 | $prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression; |
| 3982 | 3982 | |
| 3983 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3983 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3984 | 3984 | $priceparser = new PriceParser($this->db); |
| 3985 | 3985 | $price_result = $priceparser->parseProductSupplier($prod_supplier); |
| 3986 | 3986 | if ($price_result >= 0) { |
@@ -3991,10 +3991,10 @@ discard block |
||
| 3991 | 3991 | } |
| 3992 | 3992 | } |
| 3993 | 3993 | if ($objp->quantity == 1) { |
| 3994 | - $opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3994 | + $opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3995 | 3995 | } |
| 3996 | 3996 | |
| 3997 | - $opt .= $objp->quantity . ' '; |
|
| 3997 | + $opt .= $objp->quantity.' '; |
|
| 3998 | 3998 | |
| 3999 | 3999 | if ($objp->quantity == 1) { |
| 4000 | 4000 | $opt .= $langs->trans("Unit"); |
@@ -4003,10 +4003,10 @@ discard block |
||
| 4003 | 4003 | } |
| 4004 | 4004 | if ($objp->quantity > 1) { |
| 4005 | 4005 | $opt .= " - "; |
| 4006 | - $opt .= price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit"); |
|
| 4006 | + $opt .= price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit"); |
|
| 4007 | 4007 | } |
| 4008 | 4008 | if ($objp->duration) { |
| 4009 | - $opt .= " - " . $objp->duration; |
|
| 4009 | + $opt .= " - ".$objp->duration; |
|
| 4010 | 4010 | } |
| 4011 | 4011 | $opt .= "</option>\n"; |
| 4012 | 4012 | |
@@ -4044,8 +4044,8 @@ discard block |
||
| 4044 | 4044 | dol_syslog(__METHOD__, LOG_DEBUG); |
| 4045 | 4045 | |
| 4046 | 4046 | $sql = "SELECT rowid, code, libelle as label, deposit_percent"; |
| 4047 | - $sql .= " FROM " . $this->db->prefix() . 'c_payment_term'; |
|
| 4048 | - $sql .= " WHERE entity IN (" . getEntity('c_payment_term') . ")"; |
|
| 4047 | + $sql .= " FROM ".$this->db->prefix().'c_payment_term'; |
|
| 4048 | + $sql .= " WHERE entity IN (".getEntity('c_payment_term').")"; |
|
| 4049 | 4049 | $sql .= " AND active > 0"; |
| 4050 | 4050 | $sql .= " ORDER BY sortorder"; |
| 4051 | 4051 | |
@@ -4057,7 +4057,7 @@ discard block |
||
| 4057 | 4057 | $obj = $this->db->fetch_object($resql); |
| 4058 | 4058 | |
| 4059 | 4059 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
| 4060 | - $label = ($langs->trans("PaymentConditionShort" . $obj->code) != "PaymentConditionShort" . $obj->code ? $langs->trans("PaymentConditionShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4060 | + $label = ($langs->trans("PaymentConditionShort".$obj->code) != "PaymentConditionShort".$obj->code ? $langs->trans("PaymentConditionShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4061 | 4061 | $this->cache_conditions_paiements[$obj->rowid]['code'] = $obj->code; |
| 4062 | 4062 | $this->cache_conditions_paiements[$obj->rowid]['label'] = $label; |
| 4063 | 4063 | $this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = $obj->deposit_percent; |
@@ -4085,7 +4085,7 @@ discard block |
||
| 4085 | 4085 | // phpcs:enable |
| 4086 | 4086 | global $langs; |
| 4087 | 4087 | |
| 4088 | - $num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability |
|
| 4088 | + $num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability |
|
| 4089 | 4089 | if ($num > 0) { |
| 4090 | 4090 | return 0; // Cache already loaded |
| 4091 | 4091 | } |
@@ -4095,7 +4095,7 @@ discard block |
||
| 4095 | 4095 | $langs->load('propal'); |
| 4096 | 4096 | |
| 4097 | 4097 | $sql = "SELECT rowid, code, label, position"; |
| 4098 | - $sql .= " FROM " . $this->db->prefix() . 'c_availability'; |
|
| 4098 | + $sql .= " FROM ".$this->db->prefix().'c_availability'; |
|
| 4099 | 4099 | $sql .= " WHERE active > 0"; |
| 4100 | 4100 | |
| 4101 | 4101 | $resql = $this->db->query($sql); |
@@ -4106,7 +4106,7 @@ discard block |
||
| 4106 | 4106 | $obj = $this->db->fetch_object($resql); |
| 4107 | 4107 | |
| 4108 | 4108 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
| 4109 | - $label = ($langs->trans("AvailabilityType" . $obj->code) != "AvailabilityType" . $obj->code ? $langs->trans("AvailabilityType" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4109 | + $label = ($langs->trans("AvailabilityType".$obj->code) != "AvailabilityType".$obj->code ? $langs->trans("AvailabilityType".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4110 | 4110 | $this->cache_availability[$obj->rowid]['code'] = $obj->code; |
| 4111 | 4111 | $this->cache_availability[$obj->rowid]['label'] = $label; |
| 4112 | 4112 | $this->cache_availability[$obj->rowid]['position'] = $obj->position; |
@@ -4138,17 +4138,17 @@ discard block |
||
| 4138 | 4138 | |
| 4139 | 4139 | $this->load_cache_availability(); |
| 4140 | 4140 | |
| 4141 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 4141 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 4142 | 4142 | |
| 4143 | - print '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4143 | + print '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4144 | 4144 | if ($addempty) { |
| 4145 | 4145 | print '<option value="0"> </option>'; |
| 4146 | 4146 | } |
| 4147 | 4147 | foreach ($this->cache_availability as $id => $arrayavailability) { |
| 4148 | 4148 | if ($selected == $id) { |
| 4149 | - print '<option value="' . $id . '" selected>'; |
|
| 4149 | + print '<option value="'.$id.'" selected>'; |
|
| 4150 | 4150 | } else { |
| 4151 | - print '<option value="' . $id . '">'; |
|
| 4151 | + print '<option value="'.$id.'">'; |
|
| 4152 | 4152 | } |
| 4153 | 4153 | print dol_escape_htmltag($arrayavailability['label']); |
| 4154 | 4154 | print '</option>'; |
@@ -4169,13 +4169,13 @@ discard block |
||
| 4169 | 4169 | { |
| 4170 | 4170 | global $langs; |
| 4171 | 4171 | |
| 4172 | - $num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason |
|
| 4172 | + $num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason |
|
| 4173 | 4173 | if ($num > 0) { |
| 4174 | 4174 | return 0; // Cache already loaded |
| 4175 | 4175 | } |
| 4176 | 4176 | |
| 4177 | 4177 | $sql = "SELECT rowid, code, label"; |
| 4178 | - $sql .= " FROM " . $this->db->prefix() . 'c_input_reason'; |
|
| 4178 | + $sql .= " FROM ".$this->db->prefix().'c_input_reason'; |
|
| 4179 | 4179 | $sql .= " WHERE active > 0"; |
| 4180 | 4180 | |
| 4181 | 4181 | $resql = $this->db->query($sql); |
@@ -4188,8 +4188,8 @@ discard block |
||
| 4188 | 4188 | |
| 4189 | 4189 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
| 4190 | 4190 | $label = ($obj->label != '-' ? $obj->label : ''); |
| 4191 | - if ($langs->trans("DemandReasonType" . $obj->code) != "DemandReasonType" . $obj->code) { |
|
| 4192 | - $label = $langs->trans("DemandReasonType" . $obj->code); // So translation key DemandReasonTypeSRC_XXX will work |
|
| 4191 | + if ($langs->trans("DemandReasonType".$obj->code) != "DemandReasonType".$obj->code) { |
|
| 4192 | + $label = $langs->trans("DemandReasonType".$obj->code); // So translation key DemandReasonTypeSRC_XXX will work |
|
| 4193 | 4193 | } |
| 4194 | 4194 | if ($langs->trans($obj->code) != $obj->code) { |
| 4195 | 4195 | $label = $langs->trans($obj->code); // So translation key SRC_XXX will work |
@@ -4229,9 +4229,9 @@ discard block |
||
| 4229 | 4229 | |
| 4230 | 4230 | $this->loadCacheInputReason(); |
| 4231 | 4231 | |
| 4232 | - print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 4232 | + print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 4233 | 4233 | if ($addempty) { |
| 4234 | - print '<option value="0"' . (empty($selected) ? ' selected' : '') . '> </option>'; |
|
| 4234 | + print '<option value="0"'.(empty($selected) ? ' selected' : '').'> </option>'; |
|
| 4235 | 4235 | } |
| 4236 | 4236 | foreach ($this->cache_demand_reason as $id => $arraydemandreason) { |
| 4237 | 4237 | if ($arraydemandreason['code'] == $exclude) { |
@@ -4239,9 +4239,9 @@ discard block |
||
| 4239 | 4239 | } |
| 4240 | 4240 | |
| 4241 | 4241 | if ($selected && ($selected == $arraydemandreason['id'] || $selected == $arraydemandreason['code'])) { |
| 4242 | - print '<option value="' . $arraydemandreason['id'] . '" selected>'; |
|
| 4242 | + print '<option value="'.$arraydemandreason['id'].'" selected>'; |
|
| 4243 | 4243 | } else { |
| 4244 | - print '<option value="' . $arraydemandreason['id'] . '">'; |
|
| 4244 | + print '<option value="'.$arraydemandreason['id'].'">'; |
|
| 4245 | 4245 | } |
| 4246 | 4246 | $label = $arraydemandreason['label']; // Translation of label was already done into the ->loadCacheInputReason |
| 4247 | 4247 | print $langs->trans($label); |
@@ -4251,7 +4251,7 @@ discard block |
||
| 4251 | 4251 | if ($user->admin && empty($notooltip)) { |
| 4252 | 4252 | print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
| 4253 | 4253 | } |
| 4254 | - print ajax_combobox('select_' . $htmlname); |
|
| 4254 | + print ajax_combobox('select_'.$htmlname); |
|
| 4255 | 4255 | } |
| 4256 | 4256 | |
| 4257 | 4257 | // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
@@ -4266,7 +4266,7 @@ discard block |
||
| 4266 | 4266 | // phpcs:enable |
| 4267 | 4267 | global $langs; |
| 4268 | 4268 | |
| 4269 | - $num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements |
|
| 4269 | + $num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements |
|
| 4270 | 4270 | if ($num > 0) { |
| 4271 | 4271 | return $num; // Cache already loaded |
| 4272 | 4272 | } |
@@ -4276,8 +4276,8 @@ discard block |
||
| 4276 | 4276 | $this->cache_types_paiements = array(); |
| 4277 | 4277 | |
| 4278 | 4278 | $sql = "SELECT id, code, libelle as label, type, active"; |
| 4279 | - $sql .= " FROM " . $this->db->prefix() . "c_paiement"; |
|
| 4280 | - $sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")"; |
|
| 4279 | + $sql .= " FROM ".$this->db->prefix()."c_paiement"; |
|
| 4280 | + $sql .= " WHERE entity IN (".getEntity('c_paiement').")"; |
|
| 4281 | 4281 | |
| 4282 | 4282 | $resql = $this->db->query($sql); |
| 4283 | 4283 | if ($resql) { |
@@ -4287,7 +4287,7 @@ discard block |
||
| 4287 | 4287 | $obj = $this->db->fetch_object($resql); |
| 4288 | 4288 | |
| 4289 | 4289 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
| 4290 | - $label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4290 | + $label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4291 | 4291 | $this->cache_types_paiements[$obj->id]['id'] = $obj->id; |
| 4292 | 4292 | $this->cache_types_paiements[$obj->id]['code'] = $obj->code; |
| 4293 | 4293 | $this->cache_types_paiements[$obj->id]['label'] = $label; |
@@ -4359,17 +4359,17 @@ discard block |
||
| 4359 | 4359 | global $langs, $user, $conf; |
| 4360 | 4360 | |
| 4361 | 4361 | $out = ''; |
| 4362 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 4362 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 4363 | 4363 | |
| 4364 | 4364 | $this->load_cache_conditions_paiements(); |
| 4365 | 4365 | |
| 4366 | 4366 | // Set default value if not already set by caller |
| 4367 | 4367 | if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID')) { |
| 4368 | - dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE); |
|
| 4368 | + dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE); |
|
| 4369 | 4369 | $selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID'); |
| 4370 | 4370 | } |
| 4371 | 4371 | |
| 4372 | - $out .= '<select id="' . $htmlname . '" class="flat selectpaymentterms' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4372 | + $out .= '<select id="'.$htmlname.'" class="flat selectpaymentterms'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4373 | 4373 | if ($addempty) { |
| 4374 | 4374 | $out .= '<option value="0"> </option>'; |
| 4375 | 4375 | } |
@@ -4383,9 +4383,9 @@ discard block |
||
| 4383 | 4383 | |
| 4384 | 4384 | if ($selected == $id) { |
| 4385 | 4385 | $selectedDepositPercent = $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent']; |
| 4386 | - $out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '" selected>'; |
|
| 4386 | + $out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'" selected>'; |
|
| 4387 | 4387 | } else { |
| 4388 | - $out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '">'; |
|
| 4388 | + $out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'">'; |
|
| 4389 | 4389 | } |
| 4390 | 4390 | $label = $arrayconditions['label']; |
| 4391 | 4391 | |
@@ -4403,21 +4403,21 @@ discard block |
||
| 4403 | 4403 | $out .= ajax_combobox($htmlname); |
| 4404 | 4404 | |
| 4405 | 4405 | if ($deposit_percent >= 0) { |
| 4406 | - $out .= ' <span id="' . $htmlname . '_deposit_percent_container"' . (empty($selectedDepositPercent) ? ' style="display: none"' : '') . '>'; |
|
| 4407 | - $out .= $langs->trans('DepositPercent') . ' : '; |
|
| 4408 | - $out .= '<input id="' . $htmlname . '_deposit_percent" name="' . $htmlname . '_deposit_percent" class="maxwidth50" value="' . $deposit_percent . '" />'; |
|
| 4406 | + $out .= ' <span id="'.$htmlname.'_deposit_percent_container"'.(empty($selectedDepositPercent) ? ' style="display: none"' : '').'>'; |
|
| 4407 | + $out .= $langs->trans('DepositPercent').' : '; |
|
| 4408 | + $out .= '<input id="'.$htmlname.'_deposit_percent" name="'.$htmlname.'_deposit_percent" class="maxwidth50" value="'.$deposit_percent.'" />'; |
|
| 4409 | 4409 | $out .= '</span>'; |
| 4410 | 4410 | $out .= ' |
| 4411 | - <script nonce="' . getNonce() . '"> |
|
| 4411 | + <script nonce="' . getNonce().'"> |
|
| 4412 | 4412 | $(document).ready(function () { |
| 4413 | - $("#' . $htmlname . '").change(function () { |
|
| 4413 | + $("#' . $htmlname.'").change(function () { |
|
| 4414 | 4414 | let $selected = $(this).find("option:selected"); |
| 4415 | 4415 | let depositPercent = $selected.attr("data-deposit_percent"); |
| 4416 | 4416 | |
| 4417 | 4417 | if (depositPercent.length > 0) { |
| 4418 | - $("#' . $htmlname . '_deposit_percent_container").show().find("#' . $htmlname . '_deposit_percent").val(depositPercent); |
|
| 4418 | + $("#' . $htmlname.'_deposit_percent_container").show().find("#'.$htmlname.'_deposit_percent").val(depositPercent); |
|
| 4419 | 4419 | } else { |
| 4420 | - $("#' . $htmlname . '_deposit_percent_container").hide(); |
|
| 4420 | + $("#' . $htmlname.'_deposit_percent_container").hide(); |
|
| 4421 | 4421 | } |
| 4422 | 4422 | |
| 4423 | 4423 | return true; |
@@ -4455,7 +4455,7 @@ discard block |
||
| 4455 | 4455 | |
| 4456 | 4456 | $out = ''; |
| 4457 | 4457 | |
| 4458 | - dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $filtertype . ", " . $format, LOG_DEBUG); |
|
| 4458 | + dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG); |
|
| 4459 | 4459 | |
| 4460 | 4460 | $filterarray = array(); |
| 4461 | 4461 | if ($filtertype == 'CRDT') { |
@@ -4470,11 +4470,11 @@ discard block |
||
| 4470 | 4470 | |
| 4471 | 4471 | // Set default value if not already set by caller |
| 4472 | 4472 | if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID')) { |
| 4473 | - dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE); |
|
| 4473 | + dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE); |
|
| 4474 | 4474 | $selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID'); |
| 4475 | 4475 | } |
| 4476 | 4476 | |
| 4477 | - $out .= '<select id="select' . $htmlname . '" class="flat selectpaymenttypes' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4477 | + $out .= '<select id="select'.$htmlname.'" class="flat selectpaymenttypes'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4478 | 4478 | if ($empty) { |
| 4479 | 4479 | $out .= '<option value=""> </option>'; |
| 4480 | 4480 | } |
@@ -4495,13 +4495,13 @@ discard block |
||
| 4495 | 4495 | } |
| 4496 | 4496 | |
| 4497 | 4497 | if ($format == 0) { |
| 4498 | - $out .= '<option value="' . $id . '"'; |
|
| 4498 | + $out .= '<option value="'.$id.'"'; |
|
| 4499 | 4499 | } elseif ($format == 1) { |
| 4500 | - $out .= '<option value="' . $arraytypes['code'] . '"'; |
|
| 4500 | + $out .= '<option value="'.$arraytypes['code'].'"'; |
|
| 4501 | 4501 | } elseif ($format == 2) { |
| 4502 | - $out .= '<option value="' . $arraytypes['code'] . '"'; |
|
| 4502 | + $out .= '<option value="'.$arraytypes['code'].'"'; |
|
| 4503 | 4503 | } elseif ($format == 3) { |
| 4504 | - $out .= '<option value="' . $id . '"'; |
|
| 4504 | + $out .= '<option value="'.$id.'"'; |
|
| 4505 | 4505 | } |
| 4506 | 4506 | // Print attribute selected or not |
| 4507 | 4507 | if ($format == 1 || $format == 2) { |
@@ -4531,7 +4531,7 @@ discard block |
||
| 4531 | 4531 | if ($user->admin && !$noadmininfo) { |
| 4532 | 4532 | $out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
| 4533 | 4533 | } |
| 4534 | - $out .= ajax_combobox('select' . $htmlname); |
|
| 4534 | + $out .= ajax_combobox('select'.$htmlname); |
|
| 4535 | 4535 | |
| 4536 | 4536 | if (empty($nooutput)) { |
| 4537 | 4537 | print $out; |
@@ -4553,22 +4553,22 @@ discard block |
||
| 4553 | 4553 | { |
| 4554 | 4554 | global $langs; |
| 4555 | 4555 | |
| 4556 | - $return = '<select class="flat maxwidth100" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 4556 | + $return = '<select class="flat maxwidth100" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 4557 | 4557 | $options = array( |
| 4558 | 4558 | 'HT' => $langs->trans("HT"), |
| 4559 | 4559 | 'TTC' => $langs->trans("TTC") |
| 4560 | 4560 | ); |
| 4561 | 4561 | foreach ($options as $id => $value) { |
| 4562 | 4562 | if ($selected == $id) { |
| 4563 | - $return .= '<option value="' . $id . '" selected>' . $value; |
|
| 4563 | + $return .= '<option value="'.$id.'" selected>'.$value; |
|
| 4564 | 4564 | } else { |
| 4565 | - $return .= '<option value="' . $id . '">' . $value; |
|
| 4565 | + $return .= '<option value="'.$id.'">'.$value; |
|
| 4566 | 4566 | } |
| 4567 | 4567 | $return .= '</option>'; |
| 4568 | 4568 | } |
| 4569 | 4569 | $return .= '</select>'; |
| 4570 | 4570 | if ($addjscombo) { |
| 4571 | - $return .= ajax_combobox('select_' . $htmlname); |
|
| 4571 | + $return .= ajax_combobox('select_'.$htmlname); |
|
| 4572 | 4572 | } |
| 4573 | 4573 | |
| 4574 | 4574 | return $return; |
@@ -4586,7 +4586,7 @@ discard block |
||
| 4586 | 4586 | // phpcs:enable |
| 4587 | 4587 | global $langs; |
| 4588 | 4588 | |
| 4589 | - $num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode |
|
| 4589 | + $num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode |
|
| 4590 | 4590 | if ($num > 0) { |
| 4591 | 4591 | return $num; // Cache already loaded |
| 4592 | 4592 | } |
@@ -4596,8 +4596,8 @@ discard block |
||
| 4596 | 4596 | $this->cache_transport_mode = array(); |
| 4597 | 4597 | |
| 4598 | 4598 | $sql = "SELECT rowid, code, label, active"; |
| 4599 | - $sql .= " FROM " . $this->db->prefix() . "c_transport_mode"; |
|
| 4600 | - $sql .= " WHERE entity IN (" . getEntity('c_transport_mode') . ")"; |
|
| 4599 | + $sql .= " FROM ".$this->db->prefix()."c_transport_mode"; |
|
| 4600 | + $sql .= " WHERE entity IN (".getEntity('c_transport_mode').")"; |
|
| 4601 | 4601 | |
| 4602 | 4602 | $resql = $this->db->query($sql); |
| 4603 | 4603 | if ($resql) { |
@@ -4607,7 +4607,7 @@ discard block |
||
| 4607 | 4607 | $obj = $this->db->fetch_object($resql); |
| 4608 | 4608 | |
| 4609 | 4609 | // If traduction exist, we use it else we take the default label |
| 4610 | - $label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4610 | + $label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4611 | 4611 | $this->cache_transport_mode[$obj->rowid]['rowid'] = $obj->rowid; |
| 4612 | 4612 | $this->cache_transport_mode[$obj->rowid]['code'] = $obj->code; |
| 4613 | 4613 | $this->cache_transport_mode[$obj->rowid]['label'] = $label; |
@@ -4641,11 +4641,11 @@ discard block |
||
| 4641 | 4641 | { |
| 4642 | 4642 | global $langs, $user; |
| 4643 | 4643 | |
| 4644 | - dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $format, LOG_DEBUG); |
|
| 4644 | + dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$format, LOG_DEBUG); |
|
| 4645 | 4645 | |
| 4646 | 4646 | $this->load_cache_transport_mode(); |
| 4647 | 4647 | |
| 4648 | - print '<select id="select' . $htmlname . '" class="flat selectmodetransport' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4648 | + print '<select id="select'.$htmlname.'" class="flat selectmodetransport'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4649 | 4649 | if ($empty) { |
| 4650 | 4650 | print '<option value=""> </option>'; |
| 4651 | 4651 | } |
@@ -4661,13 +4661,13 @@ discard block |
||
| 4661 | 4661 | } |
| 4662 | 4662 | |
| 4663 | 4663 | if ($format == 0) { |
| 4664 | - print '<option value="' . $id . '"'; |
|
| 4664 | + print '<option value="'.$id.'"'; |
|
| 4665 | 4665 | } elseif ($format == 1) { |
| 4666 | - print '<option value="' . $arraytypes['code'] . '"'; |
|
| 4666 | + print '<option value="'.$arraytypes['code'].'"'; |
|
| 4667 | 4667 | } elseif ($format == 2) { |
| 4668 | - print '<option value="' . $arraytypes['code'] . '"'; |
|
| 4668 | + print '<option value="'.$arraytypes['code'].'"'; |
|
| 4669 | 4669 | } elseif ($format == 3) { |
| 4670 | - print '<option value="' . $id . '"'; |
|
| 4670 | + print '<option value="'.$id.'"'; |
|
| 4671 | 4671 | } |
| 4672 | 4672 | // If text is selected, we compare with code, else with id |
| 4673 | 4673 | if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) { |
@@ -4715,31 +4715,31 @@ discard block |
||
| 4715 | 4715 | $langs->load("deliveries"); |
| 4716 | 4716 | |
| 4717 | 4717 | $sql = "SELECT rowid, code, libelle as label"; |
| 4718 | - $sql .= " FROM " . $this->db->prefix() . "c_shipment_mode"; |
|
| 4718 | + $sql .= " FROM ".$this->db->prefix()."c_shipment_mode"; |
|
| 4719 | 4719 | $sql .= " WHERE active > 0"; |
| 4720 | 4720 | if ($filtre) { |
| 4721 | - $sql .= " AND " . $filtre; |
|
| 4721 | + $sql .= " AND ".$filtre; |
|
| 4722 | 4722 | } |
| 4723 | 4723 | $sql .= " ORDER BY libelle ASC"; |
| 4724 | 4724 | |
| 4725 | - dol_syslog(get_class($this) . "::selectShippingMode", LOG_DEBUG); |
|
| 4725 | + dol_syslog(get_class($this)."::selectShippingMode", LOG_DEBUG); |
|
| 4726 | 4726 | $result = $this->db->query($sql); |
| 4727 | 4727 | if ($result) { |
| 4728 | 4728 | $num = $this->db->num_rows($result); |
| 4729 | 4729 | $i = 0; |
| 4730 | 4730 | if ($num) { |
| 4731 | - print '<select id="select' . $htmlname . '" class="flat selectshippingmethod' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
| 4731 | + print '<select id="select'.$htmlname.'" class="flat selectshippingmethod'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
| 4732 | 4732 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
| 4733 | 4733 | print '<option value="-1"> </option>'; |
| 4734 | 4734 | } |
| 4735 | 4735 | while ($i < $num) { |
| 4736 | 4736 | $obj = $this->db->fetch_object($result); |
| 4737 | 4737 | if ($selected == $obj->rowid) { |
| 4738 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
| 4738 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
| 4739 | 4739 | } else { |
| 4740 | - print '<option value="' . $obj->rowid . '">'; |
|
| 4740 | + print '<option value="'.$obj->rowid.'">'; |
|
| 4741 | 4741 | } |
| 4742 | - print ($langs->trans("SendingMethod" . strtoupper($obj->code)) != "SendingMethod" . strtoupper($obj->code)) ? $langs->trans("SendingMethod" . strtoupper($obj->code)) : $obj->label; |
|
| 4742 | + print ($langs->trans("SendingMethod".strtoupper($obj->code)) != "SendingMethod".strtoupper($obj->code)) ? $langs->trans("SendingMethod".strtoupper($obj->code)) : $obj->label; |
|
| 4743 | 4743 | print '</option>'; |
| 4744 | 4744 | $i++; |
| 4745 | 4745 | } |
@@ -4748,7 +4748,7 @@ discard block |
||
| 4748 | 4748 | print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
| 4749 | 4749 | } |
| 4750 | 4750 | |
| 4751 | - print ajax_combobox('select' . $htmlname); |
|
| 4751 | + print ajax_combobox('select'.$htmlname); |
|
| 4752 | 4752 | } else { |
| 4753 | 4753 | print $langs->trans("NoShippingMethodDefined"); |
| 4754 | 4754 | } |
@@ -4773,16 +4773,16 @@ discard block |
||
| 4773 | 4773 | $langs->load("deliveries"); |
| 4774 | 4774 | |
| 4775 | 4775 | if ($htmlname != "none") { |
| 4776 | - print '<form method="POST" action="' . $page . '">'; |
|
| 4776 | + print '<form method="POST" action="'.$page.'">'; |
|
| 4777 | 4777 | print '<input type="hidden" name="action" value="setshippingmethod">'; |
| 4778 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 4778 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 4779 | 4779 | $this->selectShippingMethod($selected, $htmlname, '', $addempty); |
| 4780 | - print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 4780 | + print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 4781 | 4781 | print '</form>'; |
| 4782 | 4782 | } else { |
| 4783 | 4783 | if ($selected) { |
| 4784 | 4784 | $code = $langs->getLabelFromKey($this->db, $selected, 'c_shipment_mode', 'rowid', 'code'); |
| 4785 | - print $langs->trans("SendingMethod" . strtoupper($code)); |
|
| 4785 | + print $langs->trans("SendingMethod".strtoupper($code)); |
|
| 4786 | 4786 | } else { |
| 4787 | 4787 | print " "; |
| 4788 | 4788 | } |
@@ -4805,10 +4805,10 @@ discard block |
||
| 4805 | 4805 | |
| 4806 | 4806 | $opt = '<option value="" selected></option>'; |
| 4807 | 4807 | $sql = "SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc"; |
| 4808 | - $sql .= ' FROM ' . $this->db->prefix() . 'facture'; |
|
| 4809 | - $sql .= ' WHERE entity IN (' . getEntity('invoice') . ')'; |
|
| 4808 | + $sql .= ' FROM '.$this->db->prefix().'facture'; |
|
| 4809 | + $sql .= ' WHERE entity IN ('.getEntity('invoice').')'; |
|
| 4810 | 4810 | $sql .= ' AND situation_counter >= 1'; |
| 4811 | - $sql .= ' AND fk_soc = ' . (int) $socid; |
|
| 4811 | + $sql .= ' AND fk_soc = '.(int) $socid; |
|
| 4812 | 4812 | $sql .= ' AND type <> 2'; |
| 4813 | 4813 | $sql .= ' ORDER by situation_cycle_ref, situation_counter desc'; |
| 4814 | 4814 | $resql = $this->db->query($sql); |
@@ -4826,19 +4826,19 @@ discard block |
||
| 4826 | 4826 | //Not prov? |
| 4827 | 4827 | if (substr($obj->ref, 1, 4) != 'PROV') { |
| 4828 | 4828 | if ($selected == $obj->rowid) { |
| 4829 | - $opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->ref . '</option>'; |
|
| 4829 | + $opt .= '<option value="'.$obj->rowid.'" selected>'.$obj->ref.'</option>'; |
|
| 4830 | 4830 | } else { |
| 4831 | - $opt .= '<option value="' . $obj->rowid . '">' . $obj->ref . '</option>'; |
|
| 4831 | + $opt .= '<option value="'.$obj->rowid.'">'.$obj->ref.'</option>'; |
|
| 4832 | 4832 | } |
| 4833 | 4833 | } |
| 4834 | 4834 | } |
| 4835 | 4835 | } |
| 4836 | 4836 | } |
| 4837 | 4837 | } else { |
| 4838 | - dol_syslog("Error sql=" . $sql . ", error=" . $this->error, LOG_ERR); |
|
| 4838 | + dol_syslog("Error sql=".$sql.", error=".$this->error, LOG_ERR); |
|
| 4839 | 4839 | } |
| 4840 | 4840 | if ($opt == '<option value ="" selected></option>') { |
| 4841 | - $opt = '<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>'; |
|
| 4841 | + $opt = '<option value ="0" selected>'.$langs->trans('NoSituations').'</option>'; |
|
| 4842 | 4842 | } |
| 4843 | 4843 | return $opt; |
| 4844 | 4844 | } |
@@ -4858,12 +4858,12 @@ discard block |
||
| 4858 | 4858 | |
| 4859 | 4859 | $langs->load('products'); |
| 4860 | 4860 | |
| 4861 | - $return = '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 4861 | + $return = '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 4862 | 4862 | |
| 4863 | - $sql = "SELECT rowid, label, code FROM " . $this->db->prefix() . "c_units"; |
|
| 4863 | + $sql = "SELECT rowid, label, code FROM ".$this->db->prefix()."c_units"; |
|
| 4864 | 4864 | $sql .= ' WHERE active > 0'; |
| 4865 | 4865 | if (!empty($unit_type)) { |
| 4866 | - $sql .= " AND unit_type = '" . $this->db->escape($unit_type) . "'"; |
|
| 4866 | + $sql .= " AND unit_type = '".$this->db->escape($unit_type)."'"; |
|
| 4867 | 4867 | } |
| 4868 | 4868 | $sql .= " ORDER BY sortorder"; |
| 4869 | 4869 | |
@@ -4875,14 +4875,14 @@ discard block |
||
| 4875 | 4875 | |
| 4876 | 4876 | while ($res = $this->db->fetch_object($resql)) { |
| 4877 | 4877 | $unitLabel = $res->label; |
| 4878 | - if (!empty($langs->tab_translate['unit' . $res->code])) { // check if Translation is available before |
|
| 4879 | - $unitLabel = $langs->trans('unit' . $res->code) != $res->label ? $langs->trans('unit' . $res->code) : $res->label; |
|
| 4878 | + if (!empty($langs->tab_translate['unit'.$res->code])) { // check if Translation is available before |
|
| 4879 | + $unitLabel = $langs->trans('unit'.$res->code) != $res->label ? $langs->trans('unit'.$res->code) : $res->label; |
|
| 4880 | 4880 | } |
| 4881 | 4881 | |
| 4882 | 4882 | if ($selected == $res->rowid) { |
| 4883 | - $return .= '<option value="' . $res->rowid . '" selected>' . $unitLabel . '</option>'; |
|
| 4883 | + $return .= '<option value="'.$res->rowid.'" selected>'.$unitLabel.'</option>'; |
|
| 4884 | 4884 | } else { |
| 4885 | - $return .= '<option value="' . $res->rowid . '">' . $unitLabel . '</option>'; |
|
| 4885 | + $return .= '<option value="'.$res->rowid.'">'.$unitLabel.'</option>'; |
|
| 4886 | 4886 | } |
| 4887 | 4887 | } |
| 4888 | 4888 | $return .= '</select>'; |
@@ -4917,23 +4917,23 @@ discard block |
||
| 4917 | 4917 | $num = 0; |
| 4918 | 4918 | |
| 4919 | 4919 | $sql = "SELECT rowid, label, bank, clos as status, currency_code"; |
| 4920 | - $sql .= " FROM " . $this->db->prefix() . "bank_account"; |
|
| 4921 | - $sql .= " WHERE entity IN (" . getEntity('bank_account') . ")"; |
|
| 4920 | + $sql .= " FROM ".$this->db->prefix()."bank_account"; |
|
| 4921 | + $sql .= " WHERE entity IN (".getEntity('bank_account').")"; |
|
| 4922 | 4922 | if ($status != 2) { |
| 4923 | - $sql .= " AND clos = " . (int) $status; |
|
| 4923 | + $sql .= " AND clos = ".(int) $status; |
|
| 4924 | 4924 | } |
| 4925 | 4925 | if ($filtre) { |
| 4926 | - $sql .= " AND " . $filtre; |
|
| 4926 | + $sql .= " AND ".$filtre; |
|
| 4927 | 4927 | } |
| 4928 | 4928 | $sql .= " ORDER BY label"; |
| 4929 | 4929 | |
| 4930 | - dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG); |
|
| 4930 | + dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG); |
|
| 4931 | 4931 | $result = $this->db->query($sql); |
| 4932 | 4932 | if ($result) { |
| 4933 | 4933 | $num = $this->db->num_rows($result); |
| 4934 | 4934 | $i = 0; |
| 4935 | 4935 | if ($num) { |
| 4936 | - $out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
| 4936 | + $out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
| 4937 | 4937 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
| 4938 | 4938 | $out .= '<option value="-1"> </option>'; |
| 4939 | 4939 | } |
@@ -4941,27 +4941,27 @@ discard block |
||
| 4941 | 4941 | while ($i < $num) { |
| 4942 | 4942 | $obj = $this->db->fetch_object($result); |
| 4943 | 4943 | if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) { |
| 4944 | - $out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" selected>'; |
|
| 4944 | + $out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" selected>'; |
|
| 4945 | 4945 | } else { |
| 4946 | - $out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '">'; |
|
| 4946 | + $out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'">'; |
|
| 4947 | 4947 | } |
| 4948 | 4948 | $out .= trim($obj->label); |
| 4949 | 4949 | if ($showcurrency) { |
| 4950 | - $out .= ' (' . $obj->currency_code . ')'; |
|
| 4950 | + $out .= ' ('.$obj->currency_code.')'; |
|
| 4951 | 4951 | } |
| 4952 | 4952 | if ($status == 2 && $obj->status == 1) { |
| 4953 | - $out .= ' (' . $langs->trans("Closed") . ')'; |
|
| 4953 | + $out .= ' ('.$langs->trans("Closed").')'; |
|
| 4954 | 4954 | } |
| 4955 | 4955 | $out .= '</option>'; |
| 4956 | 4956 | $i++; |
| 4957 | 4957 | } |
| 4958 | 4958 | $out .= "</select>"; |
| 4959 | - $out .= ajax_combobox('select' . $htmlname); |
|
| 4959 | + $out .= ajax_combobox('select'.$htmlname); |
|
| 4960 | 4960 | } else { |
| 4961 | 4961 | if ($status == 0) { |
| 4962 | - $out .= '<span class="opacitymedium">' . $langs->trans("NoActiveBankAccountDefined") . '</span>'; |
|
| 4962 | + $out .= '<span class="opacitymedium">'.$langs->trans("NoActiveBankAccountDefined").'</span>'; |
|
| 4963 | 4963 | } else { |
| 4964 | - $out .= '<span class="opacitymedium">' . $langs->trans("NoBankAccountFound") . '</span>'; |
|
| 4964 | + $out .= '<span class="opacitymedium">'.$langs->trans("NoBankAccountFound").'</span>'; |
|
| 4965 | 4965 | } |
| 4966 | 4966 | } |
| 4967 | 4967 | } else { |
@@ -4997,23 +4997,23 @@ discard block |
||
| 4997 | 4997 | $num = 0; |
| 4998 | 4998 | |
| 4999 | 4999 | $sql = "SELECT rowid, name, fk_country, status, entity"; |
| 5000 | - $sql .= " FROM " . $this->db->prefix() . "establishment"; |
|
| 5000 | + $sql .= " FROM ".$this->db->prefix()."establishment"; |
|
| 5001 | 5001 | $sql .= " WHERE 1=1"; |
| 5002 | 5002 | if ($status != 2) { |
| 5003 | - $sql .= " AND status = " . (int) $status; |
|
| 5003 | + $sql .= " AND status = ".(int) $status; |
|
| 5004 | 5004 | } |
| 5005 | 5005 | if ($filtre) { |
| 5006 | - $sql .= " AND " . $filtre; |
|
| 5006 | + $sql .= " AND ".$filtre; |
|
| 5007 | 5007 | } |
| 5008 | 5008 | $sql .= " ORDER BY name"; |
| 5009 | 5009 | |
| 5010 | - dol_syslog(get_class($this) . "::select_establishment", LOG_DEBUG); |
|
| 5010 | + dol_syslog(get_class($this)."::select_establishment", LOG_DEBUG); |
|
| 5011 | 5011 | $result = $this->db->query($sql); |
| 5012 | 5012 | if ($result) { |
| 5013 | 5013 | $num = $this->db->num_rows($result); |
| 5014 | 5014 | $i = 0; |
| 5015 | 5015 | if ($num) { |
| 5016 | - print '<select id="select' . $htmlname . '" class="flat selectestablishment" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
| 5016 | + print '<select id="select'.$htmlname.'" class="flat selectestablishment" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
| 5017 | 5017 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
| 5018 | 5018 | print '<option value="-1"> </option>'; |
| 5019 | 5019 | } |
@@ -5021,13 +5021,13 @@ discard block |
||
| 5021 | 5021 | while ($i < $num) { |
| 5022 | 5022 | $obj = $this->db->fetch_object($result); |
| 5023 | 5023 | if ($selected == $obj->rowid) { |
| 5024 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
| 5024 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
| 5025 | 5025 | } else { |
| 5026 | - print '<option value="' . $obj->rowid . '">'; |
|
| 5026 | + print '<option value="'.$obj->rowid.'">'; |
|
| 5027 | 5027 | } |
| 5028 | 5028 | print trim($obj->name); |
| 5029 | 5029 | if ($status == 2 && $obj->status == 1) { |
| 5030 | - print ' (' . $langs->trans("Closed") . ')'; |
|
| 5030 | + print ' ('.$langs->trans("Closed").')'; |
|
| 5031 | 5031 | } |
| 5032 | 5032 | print '</option>'; |
| 5033 | 5033 | $i++; |
@@ -5035,9 +5035,9 @@ discard block |
||
| 5035 | 5035 | print "</select>"; |
| 5036 | 5036 | } else { |
| 5037 | 5037 | if ($status == 0) { |
| 5038 | - print '<span class="opacitymedium">' . $langs->trans("NoActiveEstablishmentDefined") . '</span>'; |
|
| 5038 | + print '<span class="opacitymedium">'.$langs->trans("NoActiveEstablishmentDefined").'</span>'; |
|
| 5039 | 5039 | } else { |
| 5040 | - print '<span class="opacitymedium">' . $langs->trans("NoEstablishmentFound") . '</span>'; |
|
| 5040 | + print '<span class="opacitymedium">'.$langs->trans("NoEstablishmentFound").'</span>'; |
|
| 5041 | 5041 | } |
| 5042 | 5042 | } |
| 5043 | 5043 | |
@@ -5061,20 +5061,20 @@ discard block |
||
| 5061 | 5061 | { |
| 5062 | 5062 | global $langs; |
| 5063 | 5063 | if ($htmlname != "none") { |
| 5064 | - print '<form method="POST" action="' . $page . '">'; |
|
| 5064 | + print '<form method="POST" action="'.$page.'">'; |
|
| 5065 | 5065 | print '<input type="hidden" name="action" value="setbankaccount">'; |
| 5066 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5066 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5067 | 5067 | print img_picto('', 'bank_account', 'class="pictofixedwidth"'); |
| 5068 | 5068 | $nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty); |
| 5069 | 5069 | if ($nbaccountfound > 0) { |
| 5070 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 5070 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 5071 | 5071 | } |
| 5072 | 5072 | print '</form>'; |
| 5073 | 5073 | } else { |
| 5074 | 5074 | $langs->load('banks'); |
| 5075 | 5075 | |
| 5076 | 5076 | if ($selected) { |
| 5077 | - require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; |
|
| 5077 | + require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; |
|
| 5078 | 5078 | $bankstatic = new Account($this->db); |
| 5079 | 5079 | $result = $bankstatic->fetch($selected); |
| 5080 | 5080 | if ($result) { |
@@ -5112,19 +5112,19 @@ discard block |
||
| 5112 | 5112 | global $conf, $langs; |
| 5113 | 5113 | $langs->load("categories"); |
| 5114 | 5114 | |
| 5115 | - include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 5115 | + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 5116 | 5116 | |
| 5117 | 5117 | // For backward compatibility |
| 5118 | 5118 | if (is_numeric($type)) { |
| 5119 | - dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING); |
|
| 5119 | + dol_syslog(__METHOD__.': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING); |
|
| 5120 | 5120 | } |
| 5121 | 5121 | |
| 5122 | 5122 | if ($type === Categorie::TYPE_BANK_LINE) { |
| 5123 | 5123 | // TODO Move this into common category feature |
| 5124 | 5124 | $cate_arbo = array(); |
| 5125 | 5125 | $sql = "SELECT c.label, c.rowid"; |
| 5126 | - $sql .= " FROM " . $this->db->prefix() . "bank_categ as c"; |
|
| 5127 | - $sql .= " WHERE entity = " . $conf->entity; |
|
| 5126 | + $sql .= " FROM ".$this->db->prefix()."bank_categ as c"; |
|
| 5127 | + $sql .= " WHERE entity = ".$conf->entity; |
|
| 5128 | 5128 | $sql .= " ORDER BY c.label"; |
| 5129 | 5129 | $result = $this->db->query($sql); |
| 5130 | 5130 | if ($result) { |
@@ -5149,10 +5149,10 @@ discard block |
||
| 5149 | 5149 | $outarray = array(); |
| 5150 | 5150 | $outarrayrichhtml = array(); |
| 5151 | 5151 | |
| 5152 | - $output = '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 5152 | + $output = '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 5153 | 5153 | if (is_array($cate_arbo)) { |
| 5154 | 5154 | if (!count($cate_arbo)) { |
| 5155 | - $output .= '<option value="-1" disabled>' . $langs->trans("NoCategoriesDefined") . '</option>'; |
|
| 5155 | + $output .= '<option value="-1" disabled>'.$langs->trans("NoCategoriesDefined").'</option>'; |
|
| 5156 | 5156 | } else { |
| 5157 | 5157 | $output .= '<option value="-1"> </option>'; |
| 5158 | 5158 | foreach ($cate_arbo as $key => $value) { |
@@ -5162,15 +5162,15 @@ discard block |
||
| 5162 | 5162 | $add = ''; |
| 5163 | 5163 | } |
| 5164 | 5164 | |
| 5165 | - $labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #' . $cate_arbo[$key]['color'] . '"'); |
|
| 5165 | + $labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #'.$cate_arbo[$key]['color'].'"'); |
|
| 5166 | 5166 | $labeltoshow .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle'); |
| 5167 | 5167 | |
| 5168 | 5168 | $outarray[$cate_arbo[$key]['id']] = $cate_arbo[$key]['fulllabel']; |
| 5169 | 5169 | |
| 5170 | 5170 | $outarrayrichhtml[$cate_arbo[$key]['id']] = $labeltoshow; |
| 5171 | 5171 | |
| 5172 | - $output .= '<option ' . $add . 'value="' . $cate_arbo[$key]['id'] . '"'; |
|
| 5173 | - $output .= ' data-html="' . dol_escape_htmltag($labeltoshow) . '"'; |
|
| 5172 | + $output .= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'"'; |
|
| 5173 | + $output .= ' data-html="'.dol_escape_htmltag($labeltoshow).'"'; |
|
| 5174 | 5174 | $output .= '>'; |
| 5175 | 5175 | $output .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle'); |
| 5176 | 5176 | $output .= '</option>'; |
@@ -5211,7 +5211,7 @@ discard block |
||
| 5211 | 5211 | public function form_confirm($page, $title, $question, $action, $formquestion = array(), $selectedchoice = "", $useajax = 0, $height = 170, $width = 500) |
| 5212 | 5212 | { |
| 5213 | 5213 | // phpcs:enable |
| 5214 | - dol_syslog(__METHOD__ . ': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING); |
|
| 5214 | + dol_syslog(__METHOD__.': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING); |
|
| 5215 | 5215 | print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width); |
| 5216 | 5216 | } |
| 5217 | 5217 | |
@@ -5246,7 +5246,7 @@ discard block |
||
| 5246 | 5246 | { |
| 5247 | 5247 | global $langs, $conf; |
| 5248 | 5248 | |
| 5249 | - $more = '<!-- formconfirm - before call, page=' . dol_escape_htmltag($page) . ' -->'; |
|
| 5249 | + $more = '<!-- formconfirm - before call, page='.dol_escape_htmltag($page).' -->'; |
|
| 5250 | 5250 | $formconfirm = ''; |
| 5251 | 5251 | $inputok = array(); |
| 5252 | 5252 | $inputko = array(); |
@@ -5270,27 +5270,27 @@ discard block |
||
| 5270 | 5270 | foreach ($formquestion as $key => $input) { |
| 5271 | 5271 | if (is_array($input) && !empty($input)) { |
| 5272 | 5272 | if ($input['type'] == 'hidden') { |
| 5273 | - $moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : ''); |
|
| 5274 | - $morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : ''); |
|
| 5273 | + $moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : ''); |
|
| 5274 | + $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); |
|
| 5275 | 5275 | |
| 5276 | - $more .= '<input type="hidden" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '" value="' . dol_escape_htmltag($input['value']) . '" class="' . $morecss . '"' . $moreattr . '>' . "\n"; |
|
| 5276 | + $more .= '<input type="hidden" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'" value="'.dol_escape_htmltag($input['value']).'" class="'.$morecss.'"'.$moreattr.'>'."\n"; |
|
| 5277 | 5277 | } |
| 5278 | 5278 | } |
| 5279 | 5279 | } |
| 5280 | 5280 | |
| 5281 | 5281 | // Now add questions |
| 5282 | 5282 | $moreonecolumn = ''; |
| 5283 | - $more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">' . "\n"; |
|
| 5283 | + $more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">'."\n"; |
|
| 5284 | 5284 | foreach ($formquestion as $key => $input) { |
| 5285 | 5285 | if (is_array($input) && !empty($input)) { |
| 5286 | - $size = (!empty($input['size']) ? ' size="' . $input['size'] . '"' : ''); // deprecated. Use morecss instead. |
|
| 5287 | - $moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : ''); |
|
| 5288 | - $morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : ''); |
|
| 5286 | + $size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead. |
|
| 5287 | + $moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : ''); |
|
| 5288 | + $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); |
|
| 5289 | 5289 | |
| 5290 | 5290 | if ($input['type'] == 'text') { |
| 5291 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div><div class="tagtd"><input type="text" class="flat' . $morecss . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $size . ' value="' . (empty($input['value']) ? '' : $input['value']) . '"' . $moreattr . ' /></div></div>' . "\n"; |
|
| 5291 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="text" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$size.' value="'.(empty($input['value']) ? '' : $input['value']).'"'.$moreattr.' /></div></div>'."\n"; |
|
| 5292 | 5292 | } elseif ($input['type'] == 'password') { |
| 5293 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div><div class="tagtd"><input type="password" class="flat' . $morecss . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $size . ' value="' . (empty($input['value']) ? '' : $input['value']) . '"' . $moreattr . ' /></div></div>' . "\n"; |
|
| 5293 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="password" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$size.' value="'.(empty($input['value']) ? '' : $input['value']).'"'.$moreattr.' /></div></div>'."\n"; |
|
| 5294 | 5294 | } elseif ($input['type'] == 'textarea') { |
| 5295 | 5295 | /*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">'; |
| 5296 | 5296 | $more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>'; |
@@ -5298,8 +5298,8 @@ discard block |
||
| 5298 | 5298 | $more .= '</textarea>'; |
| 5299 | 5299 | $more .= '</div></div>'."\n";*/ |
| 5300 | 5300 | $moreonecolumn .= '<div class="margintoponly">'; |
| 5301 | - $moreonecolumn .= $input['label'] . '<br>'; |
|
| 5302 | - $moreonecolumn .= '<textarea name="' . dol_escape_htmltag($input['name']) . '" id="' . dol_escape_htmltag($input['name']) . '" class="' . $morecss . '"' . $moreattr . '>'; |
|
| 5301 | + $moreonecolumn .= $input['label'].'<br>'; |
|
| 5302 | + $moreonecolumn .= '<textarea name="'.dol_escape_htmltag($input['name']).'" id="'.dol_escape_htmltag($input['name']).'" class="'.$morecss.'"'.$moreattr.'>'; |
|
| 5303 | 5303 | $moreonecolumn .= $input['value']; |
| 5304 | 5304 | $moreonecolumn .= '</textarea>'; |
| 5305 | 5305 | $moreonecolumn .= '</div>'; |
@@ -5316,20 +5316,20 @@ discard block |
||
| 5316 | 5316 | $disabled = isset($input['select_disabled']) ? $input['select_disabled'] : 0; |
| 5317 | 5317 | $sort = isset($input['select_sort']) ? $input['select_sort'] : ''; |
| 5318 | 5318 | |
| 5319 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">'; |
|
| 5319 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'; |
|
| 5320 | 5320 | if (!empty($input['label'])) { |
| 5321 | - $more .= $input['label'] . '</div><div class="tagtd left">'; |
|
| 5321 | + $more .= $input['label'].'</div><div class="tagtd left">'; |
|
| 5322 | 5322 | } |
| 5323 | 5323 | if ($input['type'] == 'select') { |
| 5324 | 5324 | $more .= $this->selectarray($input['name'], $input['values'], isset($input['default']) ? $input['default'] : '-1', $show_empty, $key_in_label, $value_as_key, $moreattr, $translate, $maxlen, $disabled, $sort, $morecss); |
| 5325 | 5325 | } else { |
| 5326 | 5326 | $more .= $this->multiselectarray($input['name'], $input['values'], is_array($input['default']) ? $input['default'] : [$input['default']], $key_in_label, $value_as_key, $morecss, $translate, $maxlen, $moreattr); |
| 5327 | 5327 | } |
| 5328 | - $more .= '</div></div>' . "\n"; |
|
| 5328 | + $more .= '</div></div>'."\n"; |
|
| 5329 | 5329 | } elseif ($input['type'] == 'checkbox') { |
| 5330 | 5330 | $more .= '<div class="tagtr">'; |
| 5331 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '"><label for="' . dol_escape_htmltag($input['name']) . '">' . $input['label'] . '</label></div><div class="tagtd">'; |
|
| 5332 | - $more .= '<input type="checkbox" class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $moreattr; |
|
| 5331 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'"><label for="'.dol_escape_htmltag($input['name']).'">'.$input['label'].'</label></div><div class="tagtd">'; |
|
| 5332 | + $more .= '<input type="checkbox" class="flat'.($morecss ? ' '.$morecss : '').'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr; |
|
| 5333 | 5333 | if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') { |
| 5334 | 5334 | $more .= ' checked'; |
| 5335 | 5335 | } |
@@ -5340,19 +5340,19 @@ discard block |
||
| 5340 | 5340 | $more .= ' disabled'; |
| 5341 | 5341 | } |
| 5342 | 5342 | $more .= ' /></div>'; |
| 5343 | - $more .= '</div>' . "\n"; |
|
| 5343 | + $more .= '</div>'."\n"; |
|
| 5344 | 5344 | } elseif ($input['type'] == 'radio') { |
| 5345 | 5345 | $i = 0; |
| 5346 | 5346 | foreach ($input['values'] as $selkey => $selval) { |
| 5347 | 5347 | $more .= '<div class="tagtr">'; |
| 5348 | 5348 | if (isset($input['label'])) { |
| 5349 | 5349 | if ($i == 0) { |
| 5350 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? ' tdtop' : (' tdtop ' . $input['tdclass'])) . '">' . $input['label'] . '</div>'; |
|
| 5350 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? ' tdtop' : (' tdtop '.$input['tdclass'])).'">'.$input['label'].'</div>'; |
|
| 5351 | 5351 | } else { |
| 5352 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' "' . $input['tdclass'])) . '"> </div>'; |
|
| 5352 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'"> </div>'; |
|
| 5353 | 5353 | } |
| 5354 | 5354 | } |
| 5355 | - $more .= '<div class="tagtd' . ($i == 0 ? ' tdtop' : '') . '"><input type="radio" class="flat' . $morecss . '" id="' . dol_escape_htmltag($input['name'] . $selkey) . '" name="' . dol_escape_htmltag($input['name']) . '" value="' . $selkey . '"' . $moreattr; |
|
| 5355 | + $more .= '<div class="tagtd'.($i == 0 ? ' tdtop' : '').'"><input type="radio" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name'].$selkey).'" name="'.dol_escape_htmltag($input['name']).'" value="'.$selkey.'"'.$moreattr; |
|
| 5356 | 5356 | if (!empty($input['disabled'])) { |
| 5357 | 5357 | $more .= ' disabled'; |
| 5358 | 5358 | } |
@@ -5360,12 +5360,12 @@ discard block |
||
| 5360 | 5360 | $more .= ' checked="checked"'; |
| 5361 | 5361 | } |
| 5362 | 5362 | $more .= ' /> '; |
| 5363 | - $more .= '<label for="' . dol_escape_htmltag($input['name'] . $selkey) . '" class="valignmiddle">' . $selval . '</label>'; |
|
| 5364 | - $more .= '</div></div>' . "\n"; |
|
| 5363 | + $more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'" class="valignmiddle">'.$selval.'</label>'; |
|
| 5364 | + $more .= '</div></div>'."\n"; |
|
| 5365 | 5365 | $i++; |
| 5366 | 5366 | } |
| 5367 | 5367 | } elseif ($input['type'] == 'date' || $input['type'] == 'datetime') { |
| 5368 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div>'; |
|
| 5368 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>'; |
|
| 5369 | 5369 | $more .= '<div class="tagtd">'; |
| 5370 | 5370 | $addnowlink = (empty($input['datenow']) ? 0 : 1); |
| 5371 | 5371 | $h = $m = 0; |
@@ -5383,24 +5383,24 @@ discard block |
||
| 5383 | 5383 | } elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not |
| 5384 | 5384 | $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'; |
| 5385 | 5385 | if (!empty($input['label'])) { |
| 5386 | - $more .= $input['label'] . '</div><div class="tagtd">'; |
|
| 5386 | + $more .= $input['label'].'</div><div class="tagtd">'; |
|
| 5387 | 5387 | } |
| 5388 | 5388 | $more .= $input['value']; |
| 5389 | - $more .= '</div></div>' . "\n"; |
|
| 5389 | + $more .= '</div></div>'."\n"; |
|
| 5390 | 5390 | } elseif ($input['type'] == 'onecolumn') { |
| 5391 | 5391 | $moreonecolumn .= '<div class="margintoponly">'; |
| 5392 | 5392 | $moreonecolumn .= $input['value']; |
| 5393 | - $moreonecolumn .= '</div>' . "\n"; |
|
| 5393 | + $moreonecolumn .= '</div>'."\n"; |
|
| 5394 | 5394 | } elseif ($input['type'] == 'hidden') { |
| 5395 | 5395 | // Do nothing more, already added by a previous loop |
| 5396 | 5396 | } elseif ($input['type'] == 'separator') { |
| 5397 | 5397 | $more .= '<br>'; |
| 5398 | 5398 | } else { |
| 5399 | - $more .= 'Error type ' . $input['type'] . ' for the confirm box is not a supported type'; |
|
| 5399 | + $more .= 'Error type '.$input['type'].' for the confirm box is not a supported type'; |
|
| 5400 | 5400 | } |
| 5401 | 5401 | } |
| 5402 | 5402 | } |
| 5403 | - $more .= '</div>' . "\n"; |
|
| 5403 | + $more .= '</div>'."\n"; |
|
| 5404 | 5404 | $more .= $moreonecolumn; |
| 5405 | 5405 | } |
| 5406 | 5406 | |
@@ -5422,10 +5422,10 @@ discard block |
||
| 5422 | 5422 | $button = $useajax; |
| 5423 | 5423 | $useajax = 1; |
| 5424 | 5424 | $autoOpen = false; |
| 5425 | - $dialogconfirm .= '-' . $button; |
|
| 5425 | + $dialogconfirm .= '-'.$button; |
|
| 5426 | 5426 | } |
| 5427 | - $pageyes = $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=yes'; |
|
| 5428 | - $pageno = ($useajax == 2 ? $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=no' : ''); |
|
| 5427 | + $pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=yes'; |
|
| 5428 | + $pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=no' : ''); |
|
| 5429 | 5429 | |
| 5430 | 5430 | // Add input fields into list of fields to read during submit (inputok and inputko) |
| 5431 | 5431 | if (is_array($formquestion)) { |
@@ -5447,24 +5447,24 @@ discard block |
||
| 5447 | 5447 | } |
| 5448 | 5448 | |
| 5449 | 5449 | // Show JQuery confirm box. |
| 5450 | - $formconfirm .= '<div id="' . $dialogconfirm . '" title="' . dol_escape_htmltag($title) . '" style="display: none;">'; |
|
| 5450 | + $formconfirm .= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">'; |
|
| 5451 | 5451 | if (is_array($formquestion) && !empty($formquestion['text'])) { |
| 5452 | - $formconfirm .= '<div class="confirmtext">' . $formquestion['text'] . '</div>' . "\n"; |
|
| 5452 | + $formconfirm .= '<div class="confirmtext">'.$formquestion['text'].'</div>'."\n"; |
|
| 5453 | 5453 | } |
| 5454 | 5454 | if (!empty($more)) { |
| 5455 | - $formconfirm .= '<div class="confirmquestions">' . $more . '</div>' . "\n"; |
|
| 5455 | + $formconfirm .= '<div class="confirmquestions">'.$more.'</div>'."\n"; |
|
| 5456 | 5456 | } |
| 5457 | - $formconfirm .= ($question ? '<div class="confirmmessage">' . img_help('', '') . ' ' . $question . '</div>' : ''); |
|
| 5458 | - $formconfirm .= '</div>' . "\n"; |
|
| 5457 | + $formconfirm .= ($question ? '<div class="confirmmessage">'.img_help('', '').' '.$question.'</div>' : ''); |
|
| 5458 | + $formconfirm .= '</div>'."\n"; |
|
| 5459 | 5459 | |
| 5460 | - $formconfirm .= "\n<!-- begin code of popup for formconfirm page=" . $page . " -->\n"; |
|
| 5461 | - $formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n"; |
|
| 5460 | + $formconfirm .= "\n<!-- begin code of popup for formconfirm page=".$page." -->\n"; |
|
| 5461 | + $formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n"; |
|
| 5462 | 5462 | $formconfirm .= "/* Code for the jQuery('#dialogforpopup').dialog() */\n"; |
| 5463 | 5463 | $formconfirm .= 'jQuery(document).ready(function() { |
| 5464 | 5464 | $(function() { |
| 5465 | - $( "#' . $dialogconfirm . '" ).dialog( |
|
| 5465 | + $( "#' . $dialogconfirm.'" ).dialog( |
|
| 5466 | 5466 | { |
| 5467 | - autoOpen: ' . ($autoOpen ? "true" : "false") . ','; |
|
| 5467 | + autoOpen: ' . ($autoOpen ? "true" : "false").','; |
|
| 5468 | 5468 | if ($newselectedchoice == 'no') { |
| 5469 | 5469 | $formconfirm .= ' |
| 5470 | 5470 | open: function() { |
@@ -5474,24 +5474,24 @@ discard block |
||
| 5474 | 5474 | |
| 5475 | 5475 | $jsforcursor = ''; |
| 5476 | 5476 | if ($useajax == 1) { |
| 5477 | - $jsforcursor = '// The call to urljump can be slow, so we set the wait cursor' . "\n"; |
|
| 5478 | - $jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");' . "\n"; |
|
| 5477 | + $jsforcursor = '// The call to urljump can be slow, so we set the wait cursor'."\n"; |
|
| 5478 | + $jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n"; |
|
| 5479 | 5479 | } |
| 5480 | 5480 | |
| 5481 | 5481 | $postconfirmas = 'GET'; |
| 5482 | 5482 | |
| 5483 | 5483 | $formconfirm .= ' |
| 5484 | 5484 | resizable: false, |
| 5485 | - height: "' . $height . '", |
|
| 5486 | - width: "' . $width . '", |
|
| 5485 | + height: "' . $height.'", |
|
| 5486 | + width: "' . $width.'", |
|
| 5487 | 5487 | modal: true, |
| 5488 | 5488 | closeOnEscape: false, |
| 5489 | 5489 | buttons: { |
| 5490 | - "' . dol_escape_js($langs->transnoentities($labelbuttonyes)) . '": function() { |
|
| 5491 | - var options = "token=' . urlencode(newToken()) . '"; |
|
| 5492 | - var inputok = ' . json_encode($inputok) . '; /* List of fields into form */ |
|
| 5493 | - var page = "' . dol_escape_js(!empty($page) ? $page : '') . '"; |
|
| 5494 | - var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '') . '"; |
|
| 5490 | + "' . dol_escape_js($langs->transnoentities($labelbuttonyes)).'": function() { |
|
| 5491 | + var options = "token=' . urlencode(newToken()).'"; |
|
| 5492 | + var inputok = ' . json_encode($inputok).'; /* List of fields into form */ |
|
| 5493 | + var page = "' . dol_escape_js(!empty($page) ? $page : '').'"; |
|
| 5494 | + var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '').'"; |
|
| 5495 | 5495 | |
| 5496 | 5496 | if (inputok.length > 0) { |
| 5497 | 5497 | $.each(inputok, function(i, inputname) { |
@@ -5525,11 +5525,11 @@ discard block |
||
| 5525 | 5525 | } |
| 5526 | 5526 | $(this).dialog("close"); |
| 5527 | 5527 | }, |
| 5528 | - "' . dol_escape_js($langs->transnoentities($labelbuttonno)) . '": function() { |
|
| 5529 | - var options = "token=' . urlencode(newToken()) . '"; |
|
| 5530 | - var inputko = ' . json_encode($inputko) . '; /* List of fields into form */ |
|
| 5531 | - var page = "' . dol_escape_js(!empty($page) ? $page : '') . '"; |
|
| 5532 | - var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '') . '"; |
|
| 5528 | + "' . dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() { |
|
| 5529 | + var options = "token=' . urlencode(newToken()).'"; |
|
| 5530 | + var inputko = ' . json_encode($inputko).'; /* List of fields into form */ |
|
| 5531 | + var page = "' . dol_escape_js(!empty($page) ? $page : '').'"; |
|
| 5532 | + var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '').'"; |
|
| 5533 | 5533 | if (inputko.length > 0) { |
| 5534 | 5534 | $.each(inputko, function(i, inputname) { |
| 5535 | 5535 | var more = ""; |
@@ -5561,10 +5561,10 @@ discard block |
||
| 5561 | 5561 | } |
| 5562 | 5562 | ); |
| 5563 | 5563 | |
| 5564 | - var button = "' . $button . '"; |
|
| 5564 | + var button = "' . $button.'"; |
|
| 5565 | 5565 | if (button.length > 0) { |
| 5566 | 5566 | $( "#" + button ).click(function() { |
| 5567 | - $("#' . $dialogconfirm . '").dialog("open"); |
|
| 5567 | + $("#' . $dialogconfirm.'").dialog("open"); |
|
| 5568 | 5568 | }); |
| 5569 | 5569 | } |
| 5570 | 5570 | }); |
@@ -5572,44 +5572,44 @@ discard block |
||
| 5572 | 5572 | </script>'; |
| 5573 | 5573 | $formconfirm .= "<!-- end ajax formconfirm -->\n"; |
| 5574 | 5574 | } else { |
| 5575 | - $formconfirm .= "\n<!-- begin formconfirm page=" . dol_escape_htmltag($page) . " -->\n"; |
|
| 5575 | + $formconfirm .= "\n<!-- begin formconfirm page=".dol_escape_htmltag($page)." -->\n"; |
|
| 5576 | 5576 | |
| 5577 | 5577 | if (empty($disableformtag)) { |
| 5578 | - $formconfirm .= '<form method="POST" action="' . $page . '" class="notoptoleftroright">' . "\n"; |
|
| 5578 | + $formconfirm .= '<form method="POST" action="'.$page.'" class="notoptoleftroright">'."\n"; |
|
| 5579 | 5579 | } |
| 5580 | 5580 | |
| 5581 | - $formconfirm .= '<input type="hidden" name="action" value="' . $action . '">' . "\n"; |
|
| 5582 | - $formconfirm .= '<input type="hidden" name="token" value="' . newToken() . '">' . "\n"; |
|
| 5581 | + $formconfirm .= '<input type="hidden" name="action" value="'.$action.'">'."\n"; |
|
| 5582 | + $formconfirm .= '<input type="hidden" name="token" value="'.newToken().'">'."\n"; |
|
| 5583 | 5583 | |
| 5584 | - $formconfirm .= '<table class="valid centpercent">' . "\n"; |
|
| 5584 | + $formconfirm .= '<table class="valid centpercent">'."\n"; |
|
| 5585 | 5585 | |
| 5586 | 5586 | // Line title |
| 5587 | 5587 | $formconfirm .= '<tr class="validtitre"><td class="validtitre" colspan="2">'; |
| 5588 | - $formconfirm .= img_picto('', 'pictoconfirm') . ' ' . $title; |
|
| 5589 | - $formconfirm .= '</td></tr>' . "\n"; |
|
| 5588 | + $formconfirm .= img_picto('', 'pictoconfirm').' '.$title; |
|
| 5589 | + $formconfirm .= '</td></tr>'."\n"; |
|
| 5590 | 5590 | |
| 5591 | 5591 | // Line text |
| 5592 | 5592 | if (is_array($formquestion) && !empty($formquestion['text'])) { |
| 5593 | - $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . $formquestion['text'] . '</td></tr>' . "\n"; |
|
| 5593 | + $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'.$formquestion['text'].'</td></tr>'."\n"; |
|
| 5594 | 5594 | } |
| 5595 | 5595 | |
| 5596 | 5596 | // Line form fields |
| 5597 | 5597 | if ($more) { |
| 5598 | - $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . "\n"; |
|
| 5598 | + $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'."\n"; |
|
| 5599 | 5599 | $formconfirm .= $more; |
| 5600 | - $formconfirm .= '</td></tr>' . "\n"; |
|
| 5600 | + $formconfirm .= '</td></tr>'."\n"; |
|
| 5601 | 5601 | } |
| 5602 | 5602 | |
| 5603 | 5603 | // Line with question |
| 5604 | 5604 | $formconfirm .= '<tr class="valid">'; |
| 5605 | - $formconfirm .= '<td class="valid">' . $question . '</td>'; |
|
| 5605 | + $formconfirm .= '<td class="valid">'.$question.'</td>'; |
|
| 5606 | 5606 | $formconfirm .= '<td class="valid center">'; |
| 5607 | 5607 | $formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly', $labelbuttonyes, $labelbuttonno); |
| 5608 | - $formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="' . $langs->trans("Validate") . '">'; |
|
| 5608 | + $formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">'; |
|
| 5609 | 5609 | $formconfirm .= '</td>'; |
| 5610 | - $formconfirm .= '</tr>' . "\n"; |
|
| 5610 | + $formconfirm .= '</tr>'."\n"; |
|
| 5611 | 5611 | |
| 5612 | - $formconfirm .= '</table>' . "\n"; |
|
| 5612 | + $formconfirm .= '</table>'."\n"; |
|
| 5613 | 5613 | |
| 5614 | 5614 | if (empty($disableformtag)) { |
| 5615 | 5615 | $formconfirm .= "</form>\n"; |
@@ -5618,7 +5618,7 @@ discard block |
||
| 5618 | 5618 | |
| 5619 | 5619 | if (!empty($conf->use_javascript_ajax)) { |
| 5620 | 5620 | $formconfirm .= '<!-- code to disable button to avoid double clic -->'; |
| 5621 | - $formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n"; |
|
| 5621 | + $formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n"; |
|
| 5622 | 5622 | $formconfirm .= ' |
| 5623 | 5623 | $(document).ready(function () { |
| 5624 | 5624 | $(".confirmvalidatebutton").on("click", function() { |
@@ -5630,7 +5630,7 @@ discard block |
||
| 5630 | 5630 | }); |
| 5631 | 5631 | }); |
| 5632 | 5632 | '; |
| 5633 | - $formconfirm .= '</script>' . "\n"; |
|
| 5633 | + $formconfirm .= '</script>'."\n"; |
|
| 5634 | 5634 | } |
| 5635 | 5635 | |
| 5636 | 5636 | $formconfirm .= "<!-- end formconfirm -->\n"; |
@@ -5662,8 +5662,8 @@ discard block |
||
| 5662 | 5662 | // phpcs:enable |
| 5663 | 5663 | global $langs; |
| 5664 | 5664 | |
| 5665 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
| 5666 | - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
| 5665 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
| 5666 | + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
| 5667 | 5667 | |
| 5668 | 5668 | $out = ''; |
| 5669 | 5669 | |
@@ -5671,11 +5671,11 @@ discard block |
||
| 5671 | 5671 | |
| 5672 | 5672 | $langs->load("project"); |
| 5673 | 5673 | if ($htmlname != "none") { |
| 5674 | - $out .= '<form method="post" action="' . $page . '">'; |
|
| 5674 | + $out .= '<form method="post" action="'.$page.'">'; |
|
| 5675 | 5675 | $out .= '<input type="hidden" name="action" value="classin">'; |
| 5676 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5676 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5677 | 5677 | $out .= $formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1, 0, $morecss); |
| 5678 | - $out .= '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 5678 | + $out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 5679 | 5679 | $out .= '</form>'; |
| 5680 | 5680 | } else { |
| 5681 | 5681 | $out .= '<span class="project_head_block">'; |
@@ -5684,7 +5684,7 @@ discard block |
||
| 5684 | 5684 | $projet->fetch($selected); |
| 5685 | 5685 | $out .= $projet->getNomUrl(0, '', 1); |
| 5686 | 5686 | } else { |
| 5687 | - $out .= '<span class="opacitymedium">' . $textifnoproject . '</span>'; |
|
| 5687 | + $out .= '<span class="opacitymedium">'.$textifnoproject.'</span>'; |
|
| 5688 | 5688 | } |
| 5689 | 5689 | $out .= '</span>'; |
| 5690 | 5690 | } |
@@ -5721,14 +5721,14 @@ discard block |
||
| 5721 | 5721 | $out = ''; |
| 5722 | 5722 | |
| 5723 | 5723 | if ($htmlname != "none") { |
| 5724 | - $out .= '<form method="POST" action="' . $page . '">'; |
|
| 5724 | + $out .= '<form method="POST" action="'.$page.'">'; |
|
| 5725 | 5725 | $out .= '<input type="hidden" name="action" value="setconditions">'; |
| 5726 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5726 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5727 | 5727 | if ($type) { |
| 5728 | - $out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
| 5728 | + $out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
| 5729 | 5729 | } |
| 5730 | 5730 | $out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent); |
| 5731 | - $out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 5731 | + $out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 5732 | 5732 | $out .= '</form>'; |
| 5733 | 5733 | } else { |
| 5734 | 5734 | if ($selected) { |
@@ -5773,12 +5773,12 @@ discard block |
||
| 5773 | 5773 | // phpcs:enable |
| 5774 | 5774 | global $langs; |
| 5775 | 5775 | if ($htmlname != "none") { |
| 5776 | - print '<form method="post" action="' . $page . '">'; |
|
| 5776 | + print '<form method="post" action="'.$page.'">'; |
|
| 5777 | 5777 | print '<input type="hidden" name="action" value="setavailability">'; |
| 5778 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5778 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5779 | 5779 | $this->selectAvailabilityDelay($selected, $htmlname, -1, $addempty); |
| 5780 | - print '<input type="submit" name="modify" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 5781 | - print '<input type="submit" name="cancel" class="button smallpaddingimp" value="' . $langs->trans("Cancel") . '">'; |
|
| 5780 | + print '<input type="submit" name="modify" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 5781 | + print '<input type="submit" name="cancel" class="button smallpaddingimp" value="'.$langs->trans("Cancel").'">'; |
|
| 5782 | 5782 | print '</form>'; |
| 5783 | 5783 | } else { |
| 5784 | 5784 | if ($selected) { |
@@ -5804,11 +5804,11 @@ discard block |
||
| 5804 | 5804 | { |
| 5805 | 5805 | global $langs; |
| 5806 | 5806 | if ($htmlname != "none") { |
| 5807 | - print '<form method="post" action="' . $page . '">'; |
|
| 5807 | + print '<form method="post" action="'.$page.'">'; |
|
| 5808 | 5808 | print '<input type="hidden" name="action" value="setdemandreason">'; |
| 5809 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5809 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5810 | 5810 | $this->selectInputReason($selected, $htmlname, -1, $addempty); |
| 5811 | - print '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 5811 | + print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 5812 | 5812 | print '</form>'; |
| 5813 | 5813 | } else { |
| 5814 | 5814 | if ($selected) { |
@@ -5848,17 +5848,17 @@ discard block |
||
| 5848 | 5848 | $ret = ''; |
| 5849 | 5849 | |
| 5850 | 5850 | if ($htmlname != "none") { |
| 5851 | - $ret .= '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">'; |
|
| 5852 | - $ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
| 5853 | - $ret .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5851 | + $ret .= '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">'; |
|
| 5852 | + $ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
| 5853 | + $ret .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5854 | 5854 | if ($type) { |
| 5855 | - $ret .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
| 5855 | + $ret .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
| 5856 | 5856 | } |
| 5857 | 5857 | $ret .= '<table class="nobordernopadding">'; |
| 5858 | 5858 | $ret .= '<tr><td>'; |
| 5859 | - $ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form' . $htmlname, 1, 0); |
|
| 5859 | + $ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form'.$htmlname, 1, 0); |
|
| 5860 | 5860 | $ret .= '</td>'; |
| 5861 | - $ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>'; |
|
| 5861 | + $ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>'; |
|
| 5862 | 5862 | $ret .= '</tr></table></form>'; |
| 5863 | 5863 | } else { |
| 5864 | 5864 | if ($displayhour) { |
@@ -5893,15 +5893,15 @@ discard block |
||
| 5893 | 5893 | global $langs; |
| 5894 | 5894 | |
| 5895 | 5895 | if ($htmlname != "none") { |
| 5896 | - print '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">'; |
|
| 5897 | - print '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
| 5898 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5896 | + print '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">'; |
|
| 5897 | + print '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
| 5898 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5899 | 5899 | print $this->select_dolusers($selected, $htmlname, 1, $exclude, 0, $include); |
| 5900 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 5900 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 5901 | 5901 | print '</form>'; |
| 5902 | 5902 | } else { |
| 5903 | 5903 | if ($selected) { |
| 5904 | - require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php'; |
|
| 5904 | + require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; |
|
| 5905 | 5905 | $theuser = new User($this->db); |
| 5906 | 5906 | $theuser->fetch($selected); |
| 5907 | 5907 | print $theuser->getNomUrl(1); |
@@ -5934,14 +5934,14 @@ discard block |
||
| 5934 | 5934 | |
| 5935 | 5935 | $out = ''; |
| 5936 | 5936 | if ($htmlname != "none") { |
| 5937 | - $out .= '<form method="POST" action="' . $page . '">'; |
|
| 5937 | + $out .= '<form method="POST" action="'.$page.'">'; |
|
| 5938 | 5938 | $out .= '<input type="hidden" name="action" value="setmode">'; |
| 5939 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5939 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5940 | 5940 | if ($type) { |
| 5941 | - $out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
| 5941 | + $out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
| 5942 | 5942 | } |
| 5943 | 5943 | $out .= $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1); |
| 5944 | - $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 5944 | + $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 5945 | 5945 | $out .= '</form>'; |
| 5946 | 5946 | } else { |
| 5947 | 5947 | if ($selected) { |
@@ -5974,11 +5974,11 @@ discard block |
||
| 5974 | 5974 | { |
| 5975 | 5975 | global $langs; |
| 5976 | 5976 | if ($htmlname != "none") { |
| 5977 | - print '<form method="POST" action="' . $page . '">'; |
|
| 5977 | + print '<form method="POST" action="'.$page.'">'; |
|
| 5978 | 5978 | print '<input type="hidden" name="action" value="settransportmode">'; |
| 5979 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5979 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5980 | 5980 | $this->selectTransportMode($selected, $htmlname, 0, $addempty, 0, 0, $active); |
| 5981 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 5981 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 5982 | 5982 | print '</form>'; |
| 5983 | 5983 | } else { |
| 5984 | 5984 | if ($selected) { |
@@ -6005,11 +6005,11 @@ discard block |
||
| 6005 | 6005 | // phpcs:enable |
| 6006 | 6006 | global $langs; |
| 6007 | 6007 | if ($htmlname != "none") { |
| 6008 | - print '<form method="POST" action="' . $page . '">'; |
|
| 6008 | + print '<form method="POST" action="'.$page.'">'; |
|
| 6009 | 6009 | print '<input type="hidden" name="action" value="setmulticurrencycode">'; |
| 6010 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6010 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6011 | 6011 | print $this->selectMultiCurrency($selected, $htmlname, 0); |
| 6012 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6012 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6013 | 6013 | print '</form>'; |
| 6014 | 6014 | } else { |
| 6015 | 6015 | dol_include_once('/core/lib/company.lib.php'); |
@@ -6034,21 +6034,21 @@ discard block |
||
| 6034 | 6034 | global $langs, $mysoc, $conf; |
| 6035 | 6035 | |
| 6036 | 6036 | if ($htmlname != "none") { |
| 6037 | - print '<form method="POST" action="' . $page . '">'; |
|
| 6037 | + print '<form method="POST" action="'.$page.'">'; |
|
| 6038 | 6038 | print '<input type="hidden" name="action" value="setmulticurrencyrate">'; |
| 6039 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6040 | - print '<input type="text" class="maxwidth100" name="' . $htmlname . '" value="' . (!empty($rate) ? price(price2num($rate, 'CU')) : 1) . '" /> '; |
|
| 6039 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6040 | + print '<input type="text" class="maxwidth100" name="'.$htmlname.'" value="'.(!empty($rate) ? price(price2num($rate, 'CU')) : 1).'" /> '; |
|
| 6041 | 6041 | print '<select name="calculation_mode">'; |
| 6042 | - print '<option value="1">Change ' . $langs->trans("PriceUHT") . ' of lines</option>'; |
|
| 6043 | - print '<option value="2">Change ' . $langs->trans("PriceUHTCurrency") . ' of lines</option>'; |
|
| 6042 | + print '<option value="1">Change '.$langs->trans("PriceUHT").' of lines</option>'; |
|
| 6043 | + print '<option value="2">Change '.$langs->trans("PriceUHTCurrency").' of lines</option>'; |
|
| 6044 | 6044 | print '</select> '; |
| 6045 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6045 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6046 | 6046 | print '</form>'; |
| 6047 | 6047 | } else { |
| 6048 | 6048 | if (!empty($rate)) { |
| 6049 | 6049 | print price($rate, 1, $langs, 0, 0); |
| 6050 | 6050 | if ($currency && $rate != 1) { |
| 6051 | - print ' (' . price($rate, 1, $langs, 0, 0) . ' ' . $currency . ' = 1 ' . $conf->currency . ')'; |
|
| 6051 | + print ' ('.price($rate, 1, $langs, 0, 0).' '.$currency.' = 1 '.$conf->currency.')'; |
|
| 6052 | 6052 | } |
| 6053 | 6053 | } else { |
| 6054 | 6054 | print 1; |
@@ -6079,9 +6079,9 @@ discard block |
||
| 6079 | 6079 | // phpcs:enable |
| 6080 | 6080 | global $conf, $langs; |
| 6081 | 6081 | if ($htmlname != "none") { |
| 6082 | - print '<form method="post" action="' . $page . '">'; |
|
| 6082 | + print '<form method="post" action="'.$page.'">'; |
|
| 6083 | 6083 | print '<input type="hidden" name="action" value="setabsolutediscount">'; |
| 6084 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6084 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6085 | 6085 | print '<div class="inline-block">'; |
| 6086 | 6086 | if (!empty($discount_type)) { |
| 6087 | 6087 | if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) { |
@@ -6119,24 +6119,24 @@ discard block |
||
| 6119 | 6119 | print '</div>'; |
| 6120 | 6120 | if (empty($hidelist)) { |
| 6121 | 6121 | print '<div class="inline-block" style="padding-right: 10px">'; |
| 6122 | - $newfilter = 'discount_type=' . intval($discount_type); |
|
| 6122 | + $newfilter = 'discount_type='.intval($discount_type); |
|
| 6123 | 6123 | if (!empty($discount_type)) { |
| 6124 | 6124 | $newfilter .= ' AND fk_invoice_supplier IS NULL AND fk_invoice_supplier_line IS NULL'; // Supplier discounts available |
| 6125 | 6125 | } else { |
| 6126 | 6126 | $newfilter .= ' AND fk_facture IS NULL AND fk_facture_line IS NULL'; // Customer discounts available |
| 6127 | 6127 | } |
| 6128 | 6128 | if ($filter) { |
| 6129 | - $newfilter .= ' AND (' . $filter . ')'; |
|
| 6129 | + $newfilter .= ' AND ('.$filter.')'; |
|
| 6130 | 6130 | } |
| 6131 | 6131 | // output the combo of discounts |
| 6132 | 6132 | $nbqualifiedlines = $this->select_remises($selected, $htmlname, $newfilter, $socid, $maxvalue); |
| 6133 | 6133 | if ($nbqualifiedlines > 0) { |
| 6134 | - print ' <input type="submit" class="button smallpaddingimp" value="' . dol_escape_htmltag($langs->trans("UseLine")) . '"'; |
|
| 6134 | + print ' <input type="submit" class="button smallpaddingimp" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"'; |
|
| 6135 | 6135 | if (!empty($discount_type) && $filter && $filter != "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')") { |
| 6136 | - print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"'; |
|
| 6136 | + print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"'; |
|
| 6137 | 6137 | } |
| 6138 | 6138 | if (empty($discount_type) && $filter && $filter != "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')") { |
| 6139 | - print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"'; |
|
| 6139 | + print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"'; |
|
| 6140 | 6140 | } |
| 6141 | 6141 | |
| 6142 | 6142 | print '>'; |
@@ -6176,23 +6176,23 @@ discard block |
||
| 6176 | 6176 | global $langs, $conf; |
| 6177 | 6177 | |
| 6178 | 6178 | if ($htmlname != "none") { |
| 6179 | - print '<form method="post" action="' . $page . '">'; |
|
| 6179 | + print '<form method="post" action="'.$page.'">'; |
|
| 6180 | 6180 | print '<input type="hidden" name="action" value="set_contact">'; |
| 6181 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6181 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6182 | 6182 | print '<table class="nobordernopadding">'; |
| 6183 | 6183 | print '<tr><td>'; |
| 6184 | 6184 | print $this->selectcontacts($societe->id, $selected, $htmlname); |
| 6185 | 6185 | $num = $this->num; |
| 6186 | 6186 | if ($num == 0) { |
| 6187 | 6187 | $addcontact = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("AddContact") : $langs->trans("AddContactAddress")); |
| 6188 | - print '<a href="' . DOL_URL_ROOT . '/contact/card.php?socid=' . $societe->id . '&action=create&backtoreferer=1">' . $addcontact . '</a>'; |
|
| 6188 | + print '<a href="'.DOL_URL_ROOT.'/contact/card.php?socid='.$societe->id.'&action=create&backtoreferer=1">'.$addcontact.'</a>'; |
|
| 6189 | 6189 | } |
| 6190 | 6190 | print '</td>'; |
| 6191 | - print '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>'; |
|
| 6191 | + print '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>'; |
|
| 6192 | 6192 | print '</tr></table></form>'; |
| 6193 | 6193 | } else { |
| 6194 | 6194 | if ($selected) { |
| 6195 | - require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
| 6195 | + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
| 6196 | 6196 | $contact = new Contact($this->db); |
| 6197 | 6197 | $contact->fetch($selected); |
| 6198 | 6198 | print $contact->getFullName($langs); |
@@ -6227,20 +6227,20 @@ discard block |
||
| 6227 | 6227 | |
| 6228 | 6228 | $out = ''; |
| 6229 | 6229 | if ($htmlname != "none") { |
| 6230 | - $out .= '<form method="post" action="' . $page . '">'; |
|
| 6230 | + $out .= '<form method="post" action="'.$page.'">'; |
|
| 6231 | 6231 | $out .= '<input type="hidden" name="action" value="set_thirdparty">'; |
| 6232 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6232 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6233 | 6233 | $out .= $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, 0, 'minwidth100', '', '', 1, array(), false, $excludeids); |
| 6234 | - $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6234 | + $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6235 | 6235 | $out .= '</form>'; |
| 6236 | 6236 | } else { |
| 6237 | 6237 | if ($selected) { |
| 6238 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 6238 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 6239 | 6239 | $soc = new Societe($this->db); |
| 6240 | 6240 | $soc->fetch($selected); |
| 6241 | 6241 | $out .= $soc->getNomUrl(0, ''); |
| 6242 | 6242 | } else { |
| 6243 | - $out .= '<span class="opacitymedium">' . $textifnothirdparty . '</span>'; |
|
| 6243 | + $out .= '<span class="opacitymedium">'.$textifnothirdparty.'</span>'; |
|
| 6244 | 6244 | } |
| 6245 | 6245 | } |
| 6246 | 6246 | |
@@ -6290,22 +6290,22 @@ discard block |
||
| 6290 | 6290 | $selected = 'EUR'; // Pour compatibilite |
| 6291 | 6291 | } |
| 6292 | 6292 | |
| 6293 | - $out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 6293 | + $out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 6294 | 6294 | if ($useempty) { |
| 6295 | 6295 | $out .= '<option value="-1" selected></option>'; |
| 6296 | 6296 | } |
| 6297 | 6297 | foreach ($langs->cache_currencies as $code_iso => $currency) { |
| 6298 | 6298 | $labeltoshow = $currency['label']; |
| 6299 | 6299 | if ($mode == 1) { |
| 6300 | - $labeltoshow .= ' <span class="opacitymedium">(' . $code_iso . ')</span>'; |
|
| 6300 | + $labeltoshow .= ' <span class="opacitymedium">('.$code_iso.')</span>'; |
|
| 6301 | 6301 | } else { |
| 6302 | - $labeltoshow .= ' <span class="opacitymedium">(' . $langs->getCurrencySymbol($code_iso) . ')</span>'; |
|
| 6302 | + $labeltoshow .= ' <span class="opacitymedium">('.$langs->getCurrencySymbol($code_iso).')</span>'; |
|
| 6303 | 6303 | } |
| 6304 | 6304 | |
| 6305 | 6305 | if ($selected && $selected == $code_iso) { |
| 6306 | - $out .= '<option value="' . $code_iso . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '">'; |
|
| 6306 | + $out .= '<option value="'.$code_iso.'" selected data-html="'.dol_escape_htmltag($labeltoshow).'">'; |
|
| 6307 | 6307 | } else { |
| 6308 | - $out .= '<option value="' . $code_iso . '" data-html="' . dol_escape_htmltag($labeltoshow) . '">'; |
|
| 6308 | + $out .= '<option value="'.$code_iso.'" data-html="'.dol_escape_htmltag($labeltoshow).'">'; |
|
| 6309 | 6309 | } |
| 6310 | 6310 | $out .= $labeltoshow; |
| 6311 | 6311 | $out .= '</option>'; |
@@ -6316,7 +6316,7 @@ discard block |
||
| 6316 | 6316 | } |
| 6317 | 6317 | |
| 6318 | 6318 | // Make select dynamic |
| 6319 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 6319 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 6320 | 6320 | $out .= ajax_combobox($htmlname); |
| 6321 | 6321 | |
| 6322 | 6322 | return $out; |
@@ -6342,10 +6342,10 @@ discard block |
||
| 6342 | 6342 | |
| 6343 | 6343 | $TCurrency = array(); |
| 6344 | 6344 | |
| 6345 | - $sql = "SELECT code FROM " . $this->db->prefix() . "multicurrency"; |
|
| 6346 | - $sql .= " WHERE entity IN ('" . getEntity('mutlicurrency') . "')"; |
|
| 6345 | + $sql = "SELECT code FROM ".$this->db->prefix()."multicurrency"; |
|
| 6346 | + $sql .= " WHERE entity IN ('".getEntity('mutlicurrency')."')"; |
|
| 6347 | 6347 | if ($filter) { |
| 6348 | - $sql .= " AND " . $filter; |
|
| 6348 | + $sql .= " AND ".$filter; |
|
| 6349 | 6349 | } |
| 6350 | 6350 | $resql = $this->db->query($sql); |
| 6351 | 6351 | if ($resql) { |
@@ -6355,7 +6355,7 @@ discard block |
||
| 6355 | 6355 | } |
| 6356 | 6356 | |
| 6357 | 6357 | $out = ''; |
| 6358 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 6358 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 6359 | 6359 | if ($useempty) { |
| 6360 | 6360 | $out .= '<option value=""> </option>'; |
| 6361 | 6361 | } |
@@ -6367,13 +6367,13 @@ discard block |
||
| 6367 | 6367 | foreach ($langs->cache_currencies as $code_iso => $currency) { |
| 6368 | 6368 | if (isset($TCurrency[$code_iso])) { |
| 6369 | 6369 | if (!empty($selected) && $selected == $code_iso) { |
| 6370 | - $out .= '<option value="' . $code_iso . '" selected="selected">'; |
|
| 6370 | + $out .= '<option value="'.$code_iso.'" selected="selected">'; |
|
| 6371 | 6371 | } else { |
| 6372 | - $out .= '<option value="' . $code_iso . '">'; |
|
| 6372 | + $out .= '<option value="'.$code_iso.'">'; |
|
| 6373 | 6373 | } |
| 6374 | 6374 | |
| 6375 | 6375 | $out .= $currency['label']; |
| 6376 | - $out .= ' (' . $langs->getCurrencySymbol($code_iso) . ')'; |
|
| 6376 | + $out .= ' ('.$langs->getCurrencySymbol($code_iso).')'; |
|
| 6377 | 6377 | $out .= '</option>'; |
| 6378 | 6378 | } |
| 6379 | 6379 | } |
@@ -6382,7 +6382,7 @@ discard block |
||
| 6382 | 6382 | $out .= '</select>'; |
| 6383 | 6383 | |
| 6384 | 6384 | // Make select dynamic |
| 6385 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 6385 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 6386 | 6386 | $out .= ajax_combobox($htmlname); |
| 6387 | 6387 | |
| 6388 | 6388 | return $out; |
@@ -6413,7 +6413,7 @@ discard block |
||
| 6413 | 6413 | $sql .= " WHERE t.fk_pays = c.rowid"; |
| 6414 | 6414 | $sql .= " AND t.active > 0"; |
| 6415 | 6415 | $sql .= " AND t.entity IN (".getEntity('c_tva').")"; |
| 6416 | - $sql .= " AND c.code IN (" . $this->db->sanitize($country_code, 1) . ")"; |
|
| 6416 | + $sql .= " AND c.code IN (".$this->db->sanitize($country_code, 1).")"; |
|
| 6417 | 6417 | $sql .= " ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC"; |
| 6418 | 6418 | |
| 6419 | 6419 | $resql = $this->db->query($sql); |
@@ -6425,30 +6425,30 @@ discard block |
||
| 6425 | 6425 | |
| 6426 | 6426 | $tmparray = array(); |
| 6427 | 6427 | $tmparray['rowid'] = $obj->rowid; |
| 6428 | - $tmparray['type_vat'] = $obj->type_vat; |
|
| 6429 | - $tmparray['code'] = $obj->code; |
|
| 6428 | + $tmparray['type_vat'] = $obj->type_vat; |
|
| 6429 | + $tmparray['code'] = $obj->code; |
|
| 6430 | 6430 | $tmparray['txtva'] = $obj->taux; |
| 6431 | - $tmparray['nprtva'] = $obj->recuperableonly; |
|
| 6431 | + $tmparray['nprtva'] = $obj->recuperableonly; |
|
| 6432 | 6432 | $tmparray['localtax1'] = $obj->localtax1; |
| 6433 | 6433 | $tmparray['localtax1_type'] = $obj->localtax1_type; |
| 6434 | 6434 | $tmparray['localtax2'] = $obj->localtax2; |
| 6435 | 6435 | $tmparray['localtax2_type'] = $obj->localtax1_type; |
| 6436 | - $tmparray['label'] = $obj->taux . '%' . ($obj->code ? ' (' . $obj->code . ')' : ''); // Label must contains only 0-9 , . % or * |
|
| 6437 | - $tmparray['labelallrates'] = $obj->taux . '/' . ($obj->localtax1 ? $obj->localtax1 : '0') . '/' . ($obj->localtax2 ? $obj->localtax2 : '0') . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label |
|
| 6436 | + $tmparray['label'] = $obj->taux.'%'.($obj->code ? ' ('.$obj->code.')' : ''); // Label must contains only 0-9 , . % or * |
|
| 6437 | + $tmparray['labelallrates'] = $obj->taux.'/'.($obj->localtax1 ? $obj->localtax1 : '0').'/'.($obj->localtax2 ? $obj->localtax2 : '0').($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label |
|
| 6438 | 6438 | $positiverates = ''; |
| 6439 | 6439 | if ($obj->taux) { |
| 6440 | - $positiverates .= ($positiverates ? '/' : '') . $obj->taux; |
|
| 6440 | + $positiverates .= ($positiverates ? '/' : '').$obj->taux; |
|
| 6441 | 6441 | } |
| 6442 | 6442 | if ($obj->localtax1) { |
| 6443 | - $positiverates .= ($positiverates ? '/' : '') . $obj->localtax1; |
|
| 6443 | + $positiverates .= ($positiverates ? '/' : '').$obj->localtax1; |
|
| 6444 | 6444 | } |
| 6445 | 6445 | if ($obj->localtax2) { |
| 6446 | - $positiverates .= ($positiverates ? '/' : '') . $obj->localtax2; |
|
| 6446 | + $positiverates .= ($positiverates ? '/' : '').$obj->localtax2; |
|
| 6447 | 6447 | } |
| 6448 | 6448 | if (empty($positiverates)) { |
| 6449 | 6449 | $positiverates = '0'; |
| 6450 | 6450 | } |
| 6451 | - $tmparray['labelpositiverates'] = $positiverates . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label |
|
| 6451 | + $tmparray['labelpositiverates'] = $positiverates.($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label |
|
| 6452 | 6452 | |
| 6453 | 6453 | $this->cache_vatrates[$obj->rowid] = $tmparray; |
| 6454 | 6454 | } |
@@ -6468,7 +6468,7 @@ discard block |
||
| 6468 | 6468 | return -1; |
| 6469 | 6469 | } |
| 6470 | 6470 | } else { |
| 6471 | - $this->error = '<span class="error">' . $this->db->error() . '</span>'; |
|
| 6471 | + $this->error = '<span class="error">'.$this->db->error().'</span>'; |
|
| 6472 | 6472 | return -2; |
| 6473 | 6473 | } |
| 6474 | 6474 | } |
@@ -6521,9 +6521,9 @@ discard block |
||
| 6521 | 6521 | // Check parameters |
| 6522 | 6522 | if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) { |
| 6523 | 6523 | if ($societe_vendeuse->id == $mysoc->id) { |
| 6524 | - $return .= '<span class="error">' . $langs->trans("ErrorYourCountryIsNotDefined") . '</span>'; |
|
| 6524 | + $return .= '<span class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</span>'; |
|
| 6525 | 6525 | } else { |
| 6526 | - $return .= '<span class="error">' . $langs->trans("ErrorSupplierCountryIsNotDefined") . '</span>'; |
|
| 6526 | + $return .= '<span class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</span>'; |
|
| 6527 | 6527 | } |
| 6528 | 6528 | return $return; |
| 6529 | 6529 | } |
@@ -6535,12 +6535,12 @@ discard block |
||
| 6535 | 6535 | // Define list of countries to use to search VAT rates to show |
| 6536 | 6536 | // First we defined code_country to use to find list |
| 6537 | 6537 | if (is_object($societe_vendeuse)) { |
| 6538 | - $code_country = "'" . $societe_vendeuse->country_code . "'"; |
|
| 6538 | + $code_country = "'".$societe_vendeuse->country_code."'"; |
|
| 6539 | 6539 | } else { |
| 6540 | - $code_country = "'" . $mysoc->country_code . "'"; // Pour compatibilite ascendente |
|
| 6540 | + $code_country = "'".$mysoc->country_code."'"; // Pour compatibilite ascendente |
|
| 6541 | 6541 | } |
| 6542 | 6542 | if (getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC')) { // If option to have vat for end customer for services is on |
| 6543 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
| 6543 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
| 6544 | 6544 | // If SERVICE_ARE_ECOMMERCE_200238EC=1 combo list vat rate of purchaser and seller countries |
| 6545 | 6545 | // If SERVICE_ARE_ECOMMERCE_200238EC=2 combo list only the vat rate of the purchaser country |
| 6546 | 6546 | $selectVatComboMode = getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC'); |
@@ -6550,27 +6550,27 @@ discard block |
||
| 6550 | 6550 | if ($type == 1) { // We know product is a service |
| 6551 | 6551 | switch ($selectVatComboMode) { |
| 6552 | 6552 | case '1': |
| 6553 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
| 6553 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
| 6554 | 6554 | break; |
| 6555 | 6555 | case '2': |
| 6556 | - $code_country = "'" . $societe_acheteuse->country_code . "'"; |
|
| 6556 | + $code_country = "'".$societe_acheteuse->country_code."'"; |
|
| 6557 | 6557 | break; |
| 6558 | 6558 | } |
| 6559 | 6559 | } |
| 6560 | 6560 | } elseif (!$idprod) { // We don't know type of product |
| 6561 | 6561 | switch ($selectVatComboMode) { |
| 6562 | 6562 | case '1': |
| 6563 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
| 6563 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
| 6564 | 6564 | break; |
| 6565 | 6565 | case '2': |
| 6566 | - $code_country = "'" . $societe_acheteuse->country_code . "'"; |
|
| 6566 | + $code_country = "'".$societe_acheteuse->country_code."'"; |
|
| 6567 | 6567 | break; |
| 6568 | 6568 | } |
| 6569 | 6569 | } else { |
| 6570 | 6570 | $prodstatic = new Product($this->db); |
| 6571 | 6571 | $prodstatic->fetch($idprod); |
| 6572 | 6572 | if ($prodstatic->type == Product::TYPE_SERVICE) { // We know product is a service |
| 6573 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
| 6573 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
| 6574 | 6574 | } |
| 6575 | 6575 | } |
| 6576 | 6576 | } |
@@ -6632,13 +6632,13 @@ discard block |
||
| 6632 | 6632 | // Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses instead |
| 6633 | 6633 | // of using supplier invoices (this is a very bad idea !) |
| 6634 | 6634 | if (!getDolGlobalString('EXPENSEREPORT_OVERRIDE_VAT')) { |
| 6635 | - $title = ' title="' . dol_escape_htmltag($langs->trans('VATIsNotUsed')) . '"'; |
|
| 6635 | + $title = ' title="'.dol_escape_htmltag($langs->trans('VATIsNotUsed')).'"'; |
|
| 6636 | 6636 | $disabled = true; |
| 6637 | 6637 | } |
| 6638 | 6638 | } |
| 6639 | 6639 | |
| 6640 | 6640 | if (!$options_only) { |
| 6641 | - $return .= '<select class="flat minwidth50imp maxwidth100" id="' . $htmlname . '" name="' . $htmlname . '"' . ($disabled ? ' disabled' : '') . $title . '>'; |
|
| 6641 | + $return .= '<select class="flat minwidth50imp maxwidth100" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled ? ' disabled' : '').$title.'>'; |
|
| 6642 | 6642 | } |
| 6643 | 6643 | |
| 6644 | 6644 | $selectedfound = false; |
@@ -6652,13 +6652,13 @@ discard block |
||
| 6652 | 6652 | $key = $rate['txtva']; |
| 6653 | 6653 | $key .= $rate['nprtva'] ? '*' : ''; |
| 6654 | 6654 | if ($mode > 0 && $rate['code']) { |
| 6655 | - $key .= ' (' . $rate['code'] . ')'; |
|
| 6655 | + $key .= ' ('.$rate['code'].')'; |
|
| 6656 | 6656 | } |
| 6657 | 6657 | if ($mode < 0) { |
| 6658 | 6658 | $key = $rate['rowid']; |
| 6659 | 6659 | } |
| 6660 | 6660 | |
| 6661 | - $return .= '<option value="' . $key . '"'; |
|
| 6661 | + $return .= '<option value="'.$key.'"'; |
|
| 6662 | 6662 | if (!$selectedfound) { |
| 6663 | 6663 | if ($defaultcode) { // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag |
| 6664 | 6664 | if ($defaultcode == $rate['code']) { |
@@ -6729,7 +6729,7 @@ discard block |
||
| 6729 | 6729 | public function select_date($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $nooutput = 0, $disabled = 0, $fullday = 0, $addplusone = '', $adddateof = '') |
| 6730 | 6730 | { |
| 6731 | 6731 | // phpcs:enable |
| 6732 | - dol_syslog(__METHOD__ . ': using select_date is deprecated. Use selectDate instead.', LOG_WARNING); |
|
| 6732 | + dol_syslog(__METHOD__.': using select_date is deprecated. Use selectDate instead.', LOG_WARNING); |
|
| 6733 | 6733 | $retstring = $this->selectDate($set_time, $prefix, $h, $m, $empty, $form_name, $d, $addnowlink, $disabled, $fullday, $addplusone, $adddateof); |
| 6734 | 6734 | if (!empty($nooutput)) { |
| 6735 | 6735 | return $retstring; |
@@ -6758,11 +6758,11 @@ discard block |
||
| 6758 | 6758 | { |
| 6759 | 6759 | global $langs; |
| 6760 | 6760 | |
| 6761 | - $ret = $this->selectDate($set_time, $prefix . '_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel'); |
|
| 6761 | + $ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel'); |
|
| 6762 | 6762 | if ($forcenewline) { |
| 6763 | 6763 | $ret .= '<br>'; |
| 6764 | 6764 | } |
| 6765 | - $ret .= $this->selectDate($set_time_end, $prefix . '_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
|
| 6765 | + $ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
|
| 6766 | 6766 | return $ret; |
| 6767 | 6767 | } |
| 6768 | 6768 | |
@@ -6828,7 +6828,7 @@ discard block |
||
| 6828 | 6828 | $orig_set_time = $set_time; |
| 6829 | 6829 | |
| 6830 | 6830 | if ($set_time === '' && $emptydate == 0) { |
| 6831 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
| 6831 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
| 6832 | 6832 | if ($gm == 'tzuser' || $gm == 'tzuserrel') { |
| 6833 | 6833 | $set_time = dol_now($gm); |
| 6834 | 6834 | } else { |
@@ -6900,38 +6900,38 @@ discard block |
||
| 6900 | 6900 | // Calendrier popup version eldy |
| 6901 | 6901 | if ($usecalendar == "eldy") { |
| 6902 | 6902 | // Input area to enter date manually |
| 6903 | - $retstring .= '<input id="' . $prefix . '" name="' . $prefix . '" type="text" class="maxwidthdate" maxlength="11" value="' . $formated_date . '"'; |
|
| 6903 | + $retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"'; |
|
| 6904 | 6904 | $retstring .= ($disabled ? ' disabled' : ''); |
| 6905 | - $retstring .= ' onChange="dpChangeDay(\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 6905 | + $retstring .= ' onChange="dpChangeDay(\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 6906 | 6906 | $retstring .= ' autocomplete="off">'; |
| 6907 | 6907 | |
| 6908 | 6908 | // Icon calendar |
| 6909 | 6909 | $retstringbuttom = ''; |
| 6910 | 6910 | if (!$disabled) { |
| 6911 | - $retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons"'; |
|
| 6912 | - $base = DOL_URL_ROOT . '/core/'; |
|
| 6913 | - $retstringbuttom .= ' onClick="showDP(\'' . $base . '\',\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\',\'' . $langs->defaultlang . '\');"'; |
|
| 6914 | - $retstringbuttom .= '>' . img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
| 6911 | + $retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"'; |
|
| 6912 | + $base = DOL_URL_ROOT.'/core/'; |
|
| 6913 | + $retstringbuttom .= ' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\',\''.$langs->defaultlang.'\');"'; |
|
| 6914 | + $retstringbuttom .= '>'.img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"').'</button>'; |
|
| 6915 | 6915 | } else { |
| 6916 | - $retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
| 6916 | + $retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>'; |
|
| 6917 | 6917 | } |
| 6918 | - $retstring = $retstringbuttom . $retstring; |
|
| 6918 | + $retstring = $retstringbuttom.$retstring; |
|
| 6919 | 6919 | |
| 6920 | - $retstring .= '<input type="hidden" id="' . $prefix . 'day" name="' . $prefix . 'day" value="' . $sday . '">' . "\n"; |
|
| 6921 | - $retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n"; |
|
| 6922 | - $retstring .= '<input type="hidden" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">' . "\n"; |
|
| 6920 | + $retstring .= '<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n"; |
|
| 6921 | + $retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n"; |
|
| 6922 | + $retstring .= '<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n"; |
|
| 6923 | 6923 | } elseif ($usecalendar == 'jquery' || $usecalendar == 'html') { |
| 6924 | 6924 | if (!$disabled && $usecalendar != 'html') { |
| 6925 | 6925 | // Output javascript for datepicker |
| 6926 | 6926 | $minYear = getDolGlobalInt('MIN_YEAR_SELECT_DATE', (date('Y') - 100)); |
| 6927 | 6927 | $maxYear = getDolGlobalInt('MAX_YEAR_SELECT_DATE', (date('Y') + 100)); |
| 6928 | 6928 | |
| 6929 | - $retstring .= '<script nonce="' . getNonce() . '" type="text/javascript">'; |
|
| 6930 | - $retstring .= "$(function(){ $('#" . $prefix . "').datepicker({ |
|
| 6931 | - dateFormat: '" . $langs->trans("FormatDateShortJQueryInput") . "', |
|
| 6929 | + $retstring .= '<script nonce="'.getNonce().'" type="text/javascript">'; |
|
| 6930 | + $retstring .= "$(function(){ $('#".$prefix."').datepicker({ |
|
| 6931 | + dateFormat: '" . $langs->trans("FormatDateShortJQueryInput")."', |
|
| 6932 | 6932 | autoclose: true, |
| 6933 | 6933 | todayHighlight: true, |
| 6934 | - yearRange: '" . $minYear . ":" . $maxYear . "',"; |
|
| 6934 | + yearRange: '" . $minYear.":".$maxYear."',"; |
|
| 6935 | 6935 | if (!empty($conf->dol_use_jmobile)) { |
| 6936 | 6936 | $retstring .= " |
| 6937 | 6937 | beforeShow: function (input, datePicker) { |
@@ -6946,7 +6946,7 @@ discard block |
||
| 6946 | 6946 | if (!getDolGlobalString('MAIN_POPUP_CALENDAR_ON_FOCUS')) { |
| 6947 | 6947 | $retstring .= " |
| 6948 | 6948 | showOn: 'button', /* both has problem with autocompletion */ |
| 6949 | - buttonImage: '" . DOL_URL_ROOT . "/theme/" . dol_escape_js($conf->theme) . "/img/object_calendarday.png', |
|
| 6949 | + buttonImage: '" . DOL_URL_ROOT."/theme/".dol_escape_js($conf->theme)."/img/object_calendarday.png', |
|
| 6950 | 6950 | buttonImageOnly: true"; |
| 6951 | 6951 | } |
| 6952 | 6952 | $retstring .= " |
@@ -6958,46 +6958,46 @@ discard block |
||
| 6958 | 6958 | $retstring .= '<div class="nowraponall inline-block divfordateinput">'; |
| 6959 | 6959 | $retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"'; |
| 6960 | 6960 | $retstring .= ($disabled ? ' disabled' : ''); |
| 6961 | - $retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : ''); |
|
| 6962 | - $retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 6961 | + $retstring .= ($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : ''); |
|
| 6962 | + $retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 6963 | 6963 | $retstring .= ' autocomplete="off">'; |
| 6964 | 6964 | |
| 6965 | 6965 | // Icone calendrier |
| 6966 | 6966 | if ($disabled) { |
| 6967 | - $retstringbutton = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
| 6968 | - $retstring = $retstringbutton . $retstring; |
|
| 6967 | + $retstringbutton = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>'; |
|
| 6968 | + $retstring = $retstringbutton.$retstring; |
|
| 6969 | 6969 | } |
| 6970 | 6970 | |
| 6971 | 6971 | $retstring .= '</div>'; |
| 6972 | - $retstring .= '<input type="hidden" id="' . $prefix . 'day" name="' . $prefix . 'day" value="' . $sday . '">' . "\n"; |
|
| 6973 | - $retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n"; |
|
| 6974 | - $retstring .= '<input type="hidden" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">' . "\n"; |
|
| 6972 | + $retstring .= '<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n"; |
|
| 6973 | + $retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n"; |
|
| 6974 | + $retstring .= '<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n"; |
|
| 6975 | 6975 | } else { |
| 6976 | 6976 | $retstring .= "Bad value of MAIN_POPUP_CALENDAR"; |
| 6977 | 6977 | } |
| 6978 | 6978 | } else { |
| 6979 | 6979 | // Show date with combo selects |
| 6980 | 6980 | // Day |
| 6981 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50imp" id="' . $prefix . 'day" name="' . $prefix . 'day">'; |
|
| 6981 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50imp" id="'.$prefix.'day" name="'.$prefix.'day">'; |
|
| 6982 | 6982 | |
| 6983 | 6983 | if ($emptydate || $set_time == -1) { |
| 6984 | 6984 | $retstring .= '<option value="0" selected> </option>'; |
| 6985 | 6985 | } |
| 6986 | 6986 | |
| 6987 | 6987 | for ($day = 1; $day <= 31; $day++) { |
| 6988 | - $retstring .= '<option value="' . $day . '"' . ($day == $sday ? ' selected' : '') . '>' . $day . '</option>'; |
|
| 6988 | + $retstring .= '<option value="'.$day.'"'.($day == $sday ? ' selected' : '').'>'.$day.'</option>'; |
|
| 6989 | 6989 | } |
| 6990 | 6990 | |
| 6991 | 6991 | $retstring .= "</select>"; |
| 6992 | 6992 | |
| 6993 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'month" name="' . $prefix . 'month">'; |
|
| 6993 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'month" name="'.$prefix.'month">'; |
|
| 6994 | 6994 | if ($emptydate || $set_time == -1) { |
| 6995 | 6995 | $retstring .= '<option value="0" selected> </option>'; |
| 6996 | 6996 | } |
| 6997 | 6997 | |
| 6998 | 6998 | // Month |
| 6999 | 6999 | for ($month = 1; $month <= 12; $month++) { |
| 7000 | - $retstring .= '<option value="' . $month . '"' . ($month == $smonth ? ' selected' : '') . '>'; |
|
| 7000 | + $retstring .= '<option value="'.$month.'"'.($month == $smonth ? ' selected' : '').'>'; |
|
| 7001 | 7001 | $retstring .= dol_print_date(mktime(12, 0, 0, $month, 1, 2000), "%b"); |
| 7002 | 7002 | $retstring .= "</option>"; |
| 7003 | 7003 | } |
@@ -7005,12 +7005,12 @@ discard block |
||
| 7005 | 7005 | |
| 7006 | 7006 | // Year |
| 7007 | 7007 | if ($emptydate || $set_time == -1) { |
| 7008 | - $retstring .= '<input' . ($disabled ? ' disabled' : '') . ' placeholder="' . dol_escape_htmltag($langs->trans("Year")) . '" class="flat maxwidth50imp valignmiddle" type="number" min="0" max="3000" maxlength="4" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">'; |
|
| 7008 | + $retstring .= '<input'.($disabled ? ' disabled' : '').' placeholder="'.dol_escape_htmltag($langs->trans("Year")).'" class="flat maxwidth50imp valignmiddle" type="number" min="0" max="3000" maxlength="4" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'; |
|
| 7009 | 7009 | } else { |
| 7010 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'year" name="' . $prefix . 'year">'; |
|
| 7010 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'year" name="'.$prefix.'year">'; |
|
| 7011 | 7011 | |
| 7012 | 7012 | for ($year = $syear - 10; $year < $syear + 10; $year++) { |
| 7013 | - $retstring .= '<option value="' . $year . '"' . ($year == $syear ? ' selected' : '') . '>' . $year . '</option>'; |
|
| 7013 | + $retstring .= '<option value="'.$year.'"'.($year == $syear ? ' selected' : '').'>'.$year.'</option>'; |
|
| 7014 | 7014 | } |
| 7015 | 7015 | $retstring .= "</select>\n"; |
| 7016 | 7016 | } |
@@ -7034,15 +7034,15 @@ discard block |
||
| 7034 | 7034 | } |
| 7035 | 7035 | } |
| 7036 | 7036 | // Show hour |
| 7037 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'hour' : '') . '" id="' . $prefix . 'hour" name="' . $prefix . 'hour">'; |
|
| 7037 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'hour' : '').'" id="'.$prefix.'hour" name="'.$prefix.'hour">'; |
|
| 7038 | 7038 | if ($emptyhours) { |
| 7039 | 7039 | $retstring .= '<option value="-1"> </option>'; |
| 7040 | 7040 | } |
| 7041 | 7041 | for ($hour = $hourstart; $hour < $hourend; $hour++) { |
| 7042 | 7042 | if (strlen($hour) < 2) { |
| 7043 | - $hour = "0" . $hour; |
|
| 7043 | + $hour = "0".$hour; |
|
| 7044 | 7044 | } |
| 7045 | - $retstring .= '<option value="' . $hour . '"' . (($hour == $shour) ? ' selected' : '') . '>' . $hour; |
|
| 7045 | + $retstring .= '<option value="'.$hour.'"'.(($hour == $shour) ? ' selected' : '').'>'.$hour; |
|
| 7046 | 7046 | //$retstring .= (empty($conf->dol_optimize_smallscreen) ? '' : 'H'); |
| 7047 | 7047 | $retstring .= '</option>'; |
| 7048 | 7048 | } |
@@ -7055,19 +7055,19 @@ discard block |
||
| 7055 | 7055 | |
| 7056 | 7056 | if ($m) { |
| 7057 | 7057 | // Show minutes |
| 7058 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'min' : '') . '" id="' . $prefix . 'min" name="' . $prefix . 'min">'; |
|
| 7058 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'min' : '').'" id="'.$prefix.'min" name="'.$prefix.'min">'; |
|
| 7059 | 7059 | if ($emptyhours) { |
| 7060 | 7060 | $retstring .= '<option value="-1"> </option>'; |
| 7061 | 7061 | } |
| 7062 | 7062 | for ($min = 0; $min < 60; $min += $stepminutes) { |
| 7063 | 7063 | if (strlen($min) < 2) { |
| 7064 | - $min = "0" . $min; |
|
| 7064 | + $min = "0".$min; |
|
| 7065 | 7065 | } |
| 7066 | - $retstring .= '<option value="' . $min . '"' . (($min == $smin) ? ' selected' : '') . '>' . $min . (empty($conf->dol_optimize_smallscreen) ? '' : '') . '</option>'; |
|
| 7066 | + $retstring .= '<option value="'.$min.'"'.(($min == $smin) ? ' selected' : '').'>'.$min.(empty($conf->dol_optimize_smallscreen) ? '' : '').'</option>'; |
|
| 7067 | 7067 | } |
| 7068 | 7068 | $retstring .= '</select>'; |
| 7069 | 7069 | |
| 7070 | - $retstring .= '<input type="hidden" name="' . $prefix . 'sec" value="' . $ssec . '">'; |
|
| 7070 | + $retstring .= '<input type="hidden" name="'.$prefix.'sec" value="'.$ssec.'">'; |
|
| 7071 | 7071 | } |
| 7072 | 7072 | |
| 7073 | 7073 | if ($d && $h) { |
@@ -7090,10 +7090,10 @@ discard block |
||
| 7090 | 7090 | |
| 7091 | 7091 | // Generate the date part, depending on the use or not of the javascript calendar |
| 7092 | 7092 | if ($addnowlink == 1) { // server time expressed in user time setup |
| 7093 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');'; |
|
| 7094 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
| 7095 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
| 7096 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
| 7093 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');'; |
|
| 7094 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
| 7095 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
| 7096 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
| 7097 | 7097 | } elseif ($addnowlink == 2) { |
| 7098 | 7098 | /* Disabled because the output does not use the string format defined by FormatDateShort key to forge the value into #prefix. |
| 7099 | 7099 | * This break application for foreign languages. |
@@ -7102,10 +7102,10 @@ discard block |
||
| 7102 | 7102 | $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(parseInt(d.getMonth().pad()) + 1);'; |
| 7103 | 7103 | $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(d.getFullYear());'; |
| 7104 | 7104 | */ |
| 7105 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');'; |
|
| 7106 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
| 7107 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
| 7108 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
| 7105 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');'; |
|
| 7106 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
| 7107 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
| 7108 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
| 7109 | 7109 | } |
| 7110 | 7110 | /*if ($usecalendar == "eldy") |
| 7111 | 7111 | { |
@@ -7125,11 +7125,11 @@ discard block |
||
| 7125 | 7125 | } |
| 7126 | 7126 | //$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); '; |
| 7127 | 7127 | if ($addnowlink == 1) { |
| 7128 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');'; |
|
| 7129 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();'; |
|
| 7128 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');'; |
|
| 7129 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();'; |
|
| 7130 | 7130 | } elseif ($addnowlink == 2) { |
| 7131 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(d.getHours().pad());'; |
|
| 7132 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();'; |
|
| 7131 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(d.getHours().pad());'; |
|
| 7132 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();'; |
|
| 7133 | 7133 | } |
| 7134 | 7134 | |
| 7135 | 7135 | if ($fullday) { |
@@ -7143,11 +7143,11 @@ discard block |
||
| 7143 | 7143 | } |
| 7144 | 7144 | //$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); '; |
| 7145 | 7145 | if ($addnowlink == 1) { |
| 7146 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');'; |
|
| 7147 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();'; |
|
| 7146 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');'; |
|
| 7147 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();'; |
|
| 7148 | 7148 | } elseif ($addnowlink == 2) { |
| 7149 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(d.getMinutes().pad());'; |
|
| 7150 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();'; |
|
| 7149 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(d.getMinutes().pad());'; |
|
| 7150 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();'; |
|
| 7151 | 7151 | } |
| 7152 | 7152 | if ($fullday) { |
| 7153 | 7153 | $reset_scripts .= ' } '; |
@@ -7155,7 +7155,7 @@ discard block |
||
| 7155 | 7155 | } |
| 7156 | 7156 | // If reset_scripts is not empty, print the link with the reset_scripts in the onClick |
| 7157 | 7157 | if ($reset_scripts && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { |
| 7158 | - $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonNow" type="button" name="_useless" value="now" onClick="' . $reset_scripts . '">'; |
|
| 7158 | + $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="now" onClick="'.$reset_scripts.'">'; |
|
| 7159 | 7159 | $retstring .= $langs->trans("Now"); |
| 7160 | 7160 | $retstring .= '</button> '; |
| 7161 | 7161 | } |
@@ -7167,16 +7167,16 @@ discard block |
||
| 7167 | 7167 | $reset_scripts = ""; |
| 7168 | 7168 | |
| 7169 | 7169 | // Generate the date part, depending on the use or not of the javascript calendar |
| 7170 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel') . '\');'; |
|
| 7171 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
| 7172 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
| 7173 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
| 7170 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel').'\');'; |
|
| 7171 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
| 7172 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
| 7173 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
| 7174 | 7174 | // Update the hour part |
| 7175 | 7175 | if ($h) { |
| 7176 | 7176 | if ($fullday) { |
| 7177 | 7177 | $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {"; |
| 7178 | 7178 | } |
| 7179 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');'; |
|
| 7179 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');'; |
|
| 7180 | 7180 | if ($fullday) { |
| 7181 | 7181 | $reset_scripts .= ' } '; |
| 7182 | 7182 | } |
@@ -7186,14 +7186,14 @@ discard block |
||
| 7186 | 7186 | if ($fullday) { |
| 7187 | 7187 | $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {"; |
| 7188 | 7188 | } |
| 7189 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');'; |
|
| 7189 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');'; |
|
| 7190 | 7190 | if ($fullday) { |
| 7191 | 7191 | $reset_scripts .= ' } '; |
| 7192 | 7192 | } |
| 7193 | 7193 | } |
| 7194 | 7194 | // If reset_scripts is not empty, print the link with the reset_scripts in the onClick |
| 7195 | 7195 | if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) { |
| 7196 | - $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="' . $reset_scripts . '">'; |
|
| 7196 | + $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="'.$reset_scripts.'">'; |
|
| 7197 | 7197 | $retstring .= $langs->trans("DateStartPlusOne"); |
| 7198 | 7198 | $retstring .= '</button> '; |
| 7199 | 7199 | } |
@@ -7251,17 +7251,17 @@ discard block |
||
| 7251 | 7251 | unset($TDurationTypes[$value]); |
| 7252 | 7252 | } |
| 7253 | 7253 | |
| 7254 | - $retstring = '<select class="flat minwidth75 maxwidth100" id="select_' . $prefix . 'type_duration" name="' . $prefix . 'type_duration">'; |
|
| 7254 | + $retstring = '<select class="flat minwidth75 maxwidth100" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">'; |
|
| 7255 | 7255 | foreach ($TDurationTypes as $key => $typeduration) { |
| 7256 | - $retstring .= '<option value="' . $key . '"'; |
|
| 7256 | + $retstring .= '<option value="'.$key.'"'; |
|
| 7257 | 7257 | if ($key == $selected) { |
| 7258 | 7258 | $retstring .= " selected"; |
| 7259 | 7259 | } |
| 7260 | - $retstring .= ">" . $typeduration . "</option>"; |
|
| 7260 | + $retstring .= ">".$typeduration."</option>"; |
|
| 7261 | 7261 | } |
| 7262 | 7262 | $retstring .= "</select>"; |
| 7263 | 7263 | |
| 7264 | - $retstring .= ajax_combobox('select_' . $prefix . 'type_duration'); |
|
| 7264 | + $retstring .= ajax_combobox('select_'.$prefix.'type_duration'); |
|
| 7265 | 7265 | |
| 7266 | 7266 | return $retstring; |
| 7267 | 7267 | } |
@@ -7293,30 +7293,30 @@ discard block |
||
| 7293 | 7293 | |
| 7294 | 7294 | // Hours |
| 7295 | 7295 | if ($iSecond != '') { |
| 7296 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
| 7296 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
| 7297 | 7297 | |
| 7298 | 7298 | $hourSelected = convertSecondToTime($iSecond, 'allhour'); |
| 7299 | 7299 | $minSelected = convertSecondToTime($iSecond, 'min'); |
| 7300 | 7300 | } |
| 7301 | 7301 | |
| 7302 | 7302 | if ($typehour == 'select') { |
| 7303 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'hour" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . '>'; |
|
| 7303 | + $retstring .= '<select class="flat" id="select_'.$prefix.'hour" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').'>'; |
|
| 7304 | 7304 | for ($hour = 0; $hour < 25; $hour++) { // For a duration, we allow 24 hours |
| 7305 | - $retstring .= '<option value="' . $hour . '"'; |
|
| 7305 | + $retstring .= '<option value="'.$hour.'"'; |
|
| 7306 | 7306 | if (is_numeric($hourSelected) && $hourSelected == $hour) { |
| 7307 | 7307 | $retstring .= " selected"; |
| 7308 | 7308 | } |
| 7309 | - $retstring .= ">" . $hour . "</option>"; |
|
| 7309 | + $retstring .= ">".$hour."</option>"; |
|
| 7310 | 7310 | } |
| 7311 | 7311 | $retstring .= "</select>"; |
| 7312 | 7312 | } elseif ($typehour == 'text' || $typehour == 'textselect') { |
| 7313 | - $retstring .= '<input placeholder="' . $langs->trans('HourShort') . '" type="number" min="0" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputhour right" value="' . (($hourSelected != '') ? ((int) $hourSelected) : '') . '">'; |
|
| 7313 | + $retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour right" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">'; |
|
| 7314 | 7314 | } else { |
| 7315 | 7315 | return 'BadValueForParameterTypeHour'; |
| 7316 | 7316 | } |
| 7317 | 7317 | |
| 7318 | 7318 | if ($typehour != 'text') { |
| 7319 | - $retstring .= ' ' . $langs->trans('HourShort'); |
|
| 7319 | + $retstring .= ' '.$langs->trans('HourShort'); |
|
| 7320 | 7320 | } else { |
| 7321 | 7321 | $retstring .= '<span class="">:</span>'; |
| 7322 | 7322 | } |
@@ -7331,21 +7331,21 @@ discard block |
||
| 7331 | 7331 | } |
| 7332 | 7332 | |
| 7333 | 7333 | if ($typehour == 'select' || $typehour == 'textselect') { |
| 7334 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'min" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . '>'; |
|
| 7334 | + $retstring .= '<select class="flat" id="select_'.$prefix.'min" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').'>'; |
|
| 7335 | 7335 | for ($min = 0; $min <= 55; $min = $min + 5) { |
| 7336 | - $retstring .= '<option value="' . $min . '"'; |
|
| 7336 | + $retstring .= '<option value="'.$min.'"'; |
|
| 7337 | 7337 | if (is_numeric($minSelected) && $minSelected == $min) { |
| 7338 | 7338 | $retstring .= ' selected'; |
| 7339 | 7339 | } |
| 7340 | - $retstring .= '>' . $min . '</option>'; |
|
| 7340 | + $retstring .= '>'.$min.'</option>'; |
|
| 7341 | 7341 | } |
| 7342 | 7342 | $retstring .= "</select>"; |
| 7343 | 7343 | } elseif ($typehour == 'text') { |
| 7344 | - $retstring .= '<input placeholder="' . $langs->trans('MinuteShort') . '" type="number" min="0" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputminute right" value="' . (($minSelected != '') ? ((int) $minSelected) : '') . '">'; |
|
| 7344 | + $retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute right" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">'; |
|
| 7345 | 7345 | } |
| 7346 | 7346 | |
| 7347 | 7347 | if ($typehour != 'text') { |
| 7348 | - $retstring .= ' ' . $langs->trans('MinuteShort'); |
|
| 7348 | + $retstring .= ' '.$langs->trans('MinuteShort'); |
|
| 7349 | 7349 | } |
| 7350 | 7350 | |
| 7351 | 7351 | $retstring .= "</span>"; |
@@ -7393,7 +7393,7 @@ discard block |
||
| 7393 | 7393 | $placeholder = ''; |
| 7394 | 7394 | |
| 7395 | 7395 | if ($selected && empty($selected_input_value)) { |
| 7396 | - require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php'; |
|
| 7396 | + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; |
|
| 7397 | 7397 | $tickettmpselect = new Ticket($this->db); |
| 7398 | 7398 | $tickettmpselect->fetch($selected); |
| 7399 | 7399 | $selected_input_value = $tickettmpselect->ref; |
@@ -7401,17 +7401,17 @@ discard block |
||
| 7401 | 7401 | } |
| 7402 | 7402 | |
| 7403 | 7403 | $urloption = ''; |
| 7404 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7404 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7405 | 7405 | |
| 7406 | 7406 | if (empty($hidelabel)) { |
| 7407 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 7407 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
| 7408 | 7408 | } elseif ($hidelabel > 1) { |
| 7409 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
| 7409 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
| 7410 | 7410 | if ($hidelabel == 2) { |
| 7411 | 7411 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7412 | 7412 | } |
| 7413 | 7413 | } |
| 7414 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 7414 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 7415 | 7415 | if ($hidelabel == 3) { |
| 7416 | 7416 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7417 | 7417 | } |
@@ -7455,8 +7455,8 @@ discard block |
||
| 7455 | 7455 | |
| 7456 | 7456 | $sql = "SELECT "; |
| 7457 | 7457 | $sql .= $selectFields; |
| 7458 | - $sql .= " FROM " . $this->db->prefix() . "ticket as p"; |
|
| 7459 | - $sql .= ' WHERE p.entity IN (' . getEntity('ticket') . ')'; |
|
| 7458 | + $sql .= " FROM ".$this->db->prefix()."ticket as p"; |
|
| 7459 | + $sql .= ' WHERE p.entity IN ('.getEntity('ticket').')'; |
|
| 7460 | 7460 | |
| 7461 | 7461 | // Add criteria on ref/label |
| 7462 | 7462 | if ($filterkey != '') { |
@@ -7472,7 +7472,7 @@ discard block |
||
| 7472 | 7472 | if ($i > 0) { |
| 7473 | 7473 | $sql .= " AND "; |
| 7474 | 7474 | } |
| 7475 | - $sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.subject LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 7475 | + $sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.subject LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 7476 | 7476 | $sql .= ")"; |
| 7477 | 7477 | $i++; |
| 7478 | 7478 | } |
@@ -7485,22 +7485,22 @@ discard block |
||
| 7485 | 7485 | $sql .= $this->db->plimit($limit, 0); |
| 7486 | 7486 | |
| 7487 | 7487 | // Build output string |
| 7488 | - dol_syslog(get_class($this) . "::selectTicketsList search tickets", LOG_DEBUG); |
|
| 7488 | + dol_syslog(get_class($this)."::selectTicketsList search tickets", LOG_DEBUG); |
|
| 7489 | 7489 | $result = $this->db->query($sql); |
| 7490 | 7490 | if ($result) { |
| 7491 | - require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php'; |
|
| 7492 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php'; |
|
| 7491 | + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; |
|
| 7492 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php'; |
|
| 7493 | 7493 | |
| 7494 | 7494 | $num = $this->db->num_rows($result); |
| 7495 | 7495 | |
| 7496 | 7496 | $events = null; |
| 7497 | 7497 | |
| 7498 | 7498 | if (!$forcecombo) { |
| 7499 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 7499 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 7500 | 7500 | $out .= ajax_combobox($htmlname, $events, $conf->global->TICKET_USE_SEARCH_TO_SELECT); |
| 7501 | 7501 | } |
| 7502 | 7502 | |
| 7503 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 7503 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 7504 | 7504 | |
| 7505 | 7505 | $textifempty = ''; |
| 7506 | 7506 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -7517,7 +7517,7 @@ discard block |
||
| 7517 | 7517 | } |
| 7518 | 7518 | } |
| 7519 | 7519 | if ($showempty) { |
| 7520 | - $out .= '<option value="0" selected>' . $textifempty . '</option>'; |
|
| 7520 | + $out .= '<option value="0" selected>'.$textifempty.'</option>'; |
|
| 7521 | 7521 | } |
| 7522 | 7522 | |
| 7523 | 7523 | $i = 0; |
@@ -7572,13 +7572,13 @@ discard block |
||
| 7572 | 7572 | $outref = $objp->ref; |
| 7573 | 7573 | $outtype = $objp->fk_product_type; |
| 7574 | 7574 | |
| 7575 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 7575 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 7576 | 7576 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 7577 | 7577 | $opt .= '>'; |
| 7578 | 7578 | $opt .= $objp->ref; |
| 7579 | 7579 | $objRef = $objp->ref; |
| 7580 | 7580 | if (!empty($filterkey) && $filterkey != '') { |
| 7581 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 7581 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 7582 | 7582 | } |
| 7583 | 7583 | |
| 7584 | 7584 | $opt .= "</option>\n"; |
@@ -7619,7 +7619,7 @@ discard block |
||
| 7619 | 7619 | $placeholder = ''; |
| 7620 | 7620 | |
| 7621 | 7621 | if ($selected && empty($selected_input_value)) { |
| 7622 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 7622 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 7623 | 7623 | $projecttmpselect = new Project($this->db); |
| 7624 | 7624 | $projecttmpselect->fetch($selected); |
| 7625 | 7625 | $selected_input_value = $projecttmpselect->ref; |
@@ -7627,17 +7627,17 @@ discard block |
||
| 7627 | 7627 | } |
| 7628 | 7628 | |
| 7629 | 7629 | $urloption = ''; |
| 7630 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7630 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7631 | 7631 | |
| 7632 | 7632 | if (empty($hidelabel)) { |
| 7633 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 7633 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
| 7634 | 7634 | } elseif ($hidelabel > 1) { |
| 7635 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
| 7635 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
| 7636 | 7636 | if ($hidelabel == 2) { |
| 7637 | 7637 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7638 | 7638 | } |
| 7639 | 7639 | } |
| 7640 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 7640 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 7641 | 7641 | if ($hidelabel == 3) { |
| 7642 | 7642 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7643 | 7643 | } |
@@ -7680,8 +7680,8 @@ discard block |
||
| 7680 | 7680 | |
| 7681 | 7681 | $sql = "SELECT "; |
| 7682 | 7682 | $sql .= $selectFields; |
| 7683 | - $sql .= " FROM " . $this->db->prefix() . "projet as p"; |
|
| 7684 | - $sql .= ' WHERE p.entity IN (' . getEntity('project') . ')'; |
|
| 7683 | + $sql .= " FROM ".$this->db->prefix()."projet as p"; |
|
| 7684 | + $sql .= ' WHERE p.entity IN ('.getEntity('project').')'; |
|
| 7685 | 7685 | |
| 7686 | 7686 | // Add criteria on ref/label |
| 7687 | 7687 | if ($filterkey != '') { |
@@ -7697,7 +7697,7 @@ discard block |
||
| 7697 | 7697 | if ($i > 0) { |
| 7698 | 7698 | $sql .= " AND "; |
| 7699 | 7699 | } |
| 7700 | - $sql .= "p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 7700 | + $sql .= "p.ref LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 7701 | 7701 | $sql .= ""; |
| 7702 | 7702 | $i++; |
| 7703 | 7703 | } |
@@ -7710,22 +7710,22 @@ discard block |
||
| 7710 | 7710 | $sql .= $this->db->plimit($limit, 0); |
| 7711 | 7711 | |
| 7712 | 7712 | // Build output string |
| 7713 | - dol_syslog(get_class($this) . "::selectProjectsList search projects", LOG_DEBUG); |
|
| 7713 | + dol_syslog(get_class($this)."::selectProjectsList search projects", LOG_DEBUG); |
|
| 7714 | 7714 | $result = $this->db->query($sql); |
| 7715 | 7715 | if ($result) { |
| 7716 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 7717 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
| 7716 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 7717 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
| 7718 | 7718 | |
| 7719 | 7719 | $num = $this->db->num_rows($result); |
| 7720 | 7720 | |
| 7721 | 7721 | $events = null; |
| 7722 | 7722 | |
| 7723 | 7723 | if (!$forcecombo) { |
| 7724 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 7724 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 7725 | 7725 | $out .= ajax_combobox($htmlname, $events, $conf->global->PROJECT_USE_SEARCH_TO_SELECT); |
| 7726 | 7726 | } |
| 7727 | 7727 | |
| 7728 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 7728 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 7729 | 7729 | |
| 7730 | 7730 | $textifempty = ''; |
| 7731 | 7731 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -7742,7 +7742,7 @@ discard block |
||
| 7742 | 7742 | } |
| 7743 | 7743 | } |
| 7744 | 7744 | if ($showempty) { |
| 7745 | - $out .= '<option value="0" selected>' . $textifempty . '</option>'; |
|
| 7745 | + $out .= '<option value="0" selected>'.$textifempty.'</option>'; |
|
| 7746 | 7746 | } |
| 7747 | 7747 | |
| 7748 | 7748 | $i = 0; |
@@ -7800,13 +7800,13 @@ discard block |
||
| 7800 | 7800 | $outlabel = $objp->label; |
| 7801 | 7801 | $outtype = $objp->fk_product_type; |
| 7802 | 7802 | |
| 7803 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 7803 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 7804 | 7804 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 7805 | 7805 | $opt .= '>'; |
| 7806 | 7806 | $opt .= $objp->ref; |
| 7807 | 7807 | $objRef = $objp->ref; |
| 7808 | 7808 | if (!empty($filterkey) && $filterkey != '') { |
| 7809 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 7809 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 7810 | 7810 | } |
| 7811 | 7811 | |
| 7812 | 7812 | $opt .= "</option>\n"; |
@@ -7849,7 +7849,7 @@ discard block |
||
| 7849 | 7849 | $urloption = ''; |
| 7850 | 7850 | |
| 7851 | 7851 | if ($selected && empty($selected_input_value)) { |
| 7852 | - require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
| 7852 | + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
| 7853 | 7853 | $adherenttmpselect = new Adherent($this->db); |
| 7854 | 7854 | $adherenttmpselect->fetch($selected); |
| 7855 | 7855 | $selected_input_value = $adherenttmpselect->ref; |
@@ -7858,17 +7858,17 @@ discard block |
||
| 7858 | 7858 | |
| 7859 | 7859 | $urloption = ''; |
| 7860 | 7860 | |
| 7861 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7861 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7862 | 7862 | |
| 7863 | 7863 | if (empty($hidelabel)) { |
| 7864 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 7864 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
| 7865 | 7865 | } elseif ($hidelabel > 1) { |
| 7866 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
| 7866 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
| 7867 | 7867 | if ($hidelabel == 2) { |
| 7868 | 7868 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7869 | 7869 | } |
| 7870 | 7870 | } |
| 7871 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 7871 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 7872 | 7872 | if ($hidelabel == 3) { |
| 7873 | 7873 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7874 | 7874 | } |
@@ -7913,8 +7913,8 @@ discard block |
||
| 7913 | 7913 | |
| 7914 | 7914 | $sql = "SELECT "; |
| 7915 | 7915 | $sql .= $selectFields; |
| 7916 | - $sql .= " FROM " . $this->db->prefix() . "adherent as p"; |
|
| 7917 | - $sql .= ' WHERE p.entity IN (' . getEntity('adherent') . ')'; |
|
| 7916 | + $sql .= " FROM ".$this->db->prefix()."adherent as p"; |
|
| 7917 | + $sql .= ' WHERE p.entity IN ('.getEntity('adherent').')'; |
|
| 7918 | 7918 | |
| 7919 | 7919 | // Add criteria on ref/label |
| 7920 | 7920 | if ($filterkey != '') { |
@@ -7930,8 +7930,8 @@ discard block |
||
| 7930 | 7930 | if ($i > 0) { |
| 7931 | 7931 | $sql .= " AND "; |
| 7932 | 7932 | } |
| 7933 | - $sql .= "(p.firstname LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 7934 | - $sql .= " OR p.lastname LIKE '" . $this->db->escape($prefix . $crit) . "%')"; |
|
| 7933 | + $sql .= "(p.firstname LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 7934 | + $sql .= " OR p.lastname LIKE '".$this->db->escape($prefix.$crit)."%')"; |
|
| 7935 | 7935 | $i++; |
| 7936 | 7936 | } |
| 7937 | 7937 | if (count($search_crit) > 1) { |
@@ -7940,27 +7940,27 @@ discard block |
||
| 7940 | 7940 | $sql .= ')'; |
| 7941 | 7941 | } |
| 7942 | 7942 | if ($status != -1) { |
| 7943 | - $sql .= ' AND statut = ' . ((int) $status); |
|
| 7943 | + $sql .= ' AND statut = '.((int) $status); |
|
| 7944 | 7944 | } |
| 7945 | 7945 | $sql .= $this->db->plimit($limit, 0); |
| 7946 | 7946 | |
| 7947 | 7947 | // Build output string |
| 7948 | - dol_syslog(get_class($this) . "::selectMembersList search adherents", LOG_DEBUG); |
|
| 7948 | + dol_syslog(get_class($this)."::selectMembersList search adherents", LOG_DEBUG); |
|
| 7949 | 7949 | $result = $this->db->query($sql); |
| 7950 | 7950 | if ($result) { |
| 7951 | - require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
| 7952 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/member.lib.php'; |
|
| 7951 | + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
| 7952 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; |
|
| 7953 | 7953 | |
| 7954 | 7954 | $num = $this->db->num_rows($result); |
| 7955 | 7955 | |
| 7956 | 7956 | $events = null; |
| 7957 | 7957 | |
| 7958 | 7958 | if (!$forcecombo) { |
| 7959 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 7959 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 7960 | 7960 | $out .= ajax_combobox($htmlname, $events, getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT') ? $conf->global->PROJECT_USE_SEARCH_TO_SELECT : ''); |
| 7961 | 7961 | } |
| 7962 | 7962 | |
| 7963 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 7963 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 7964 | 7964 | |
| 7965 | 7965 | $textifempty = ''; |
| 7966 | 7966 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -7977,7 +7977,7 @@ discard block |
||
| 7977 | 7977 | } |
| 7978 | 7978 | } |
| 7979 | 7979 | if ($showempty) { |
| 7980 | - $out .= '<option value="-1" selected>' . $textifempty . '</option>'; |
|
| 7980 | + $out .= '<option value="-1" selected>'.$textifempty.'</option>'; |
|
| 7981 | 7981 | } |
| 7982 | 7982 | |
| 7983 | 7983 | $i = 0; |
@@ -8033,11 +8033,11 @@ discard block |
||
| 8033 | 8033 | $outlabel = dolGetFirstLastname($objp->firstname, $objp->lastname); |
| 8034 | 8034 | $outtype = $objp->fk_adherent_type; |
| 8035 | 8035 | |
| 8036 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 8036 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 8037 | 8037 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 8038 | 8038 | $opt .= '>'; |
| 8039 | 8039 | if (!empty($filterkey) && $filterkey != '') { |
| 8040 | - $outlabel = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $outlabel, 1); |
|
| 8040 | + $outlabel = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $outlabel, 1); |
|
| 8041 | 8041 | } |
| 8042 | 8042 | $opt .= $outlabel; |
| 8043 | 8043 | $opt .= "</option>\n"; |
@@ -8110,9 +8110,9 @@ discard block |
||
| 8110 | 8110 | $vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]); |
| 8111 | 8111 | $reg = array(); |
| 8112 | 8112 | if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) { |
| 8113 | - $InfoFieldList[4] = $reg[1]; // take the sort field |
|
| 8113 | + $InfoFieldList[4] = $reg[1]; // take the sort field |
|
| 8114 | 8114 | } |
| 8115 | - $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
| 8115 | + $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
| 8116 | 8116 | |
| 8117 | 8117 | $classname = $InfoFieldList[0]; |
| 8118 | 8118 | $classpath = $InfoFieldList[1]; |
@@ -8143,8 +8143,8 @@ discard block |
||
| 8143 | 8143 | ); |
| 8144 | 8144 | |
| 8145 | 8145 | if (!is_object($objecttmp)) { |
| 8146 | - dol_syslog('selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield, LOG_WARNING); |
|
| 8147 | - return 'selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield; |
|
| 8146 | + dol_syslog('selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield, LOG_WARNING); |
|
| 8147 | + return 'selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield; |
|
| 8148 | 8148 | } |
| 8149 | 8149 | |
| 8150 | 8150 | //var_dump($filter); |
@@ -8155,9 +8155,9 @@ discard block |
||
| 8155 | 8155 | if ($prefixforautocompletemode == 'product') { |
| 8156 | 8156 | $prefixforautocompletemode = 'produit'; |
| 8157 | 8157 | } |
| 8158 | - $confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8158 | + $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8159 | 8159 | |
| 8160 | - dol_syslog(get_class($this) . "::selectForForms filter=" . $filter, LOG_DEBUG); |
|
| 8160 | + dol_syslog(get_class($this)."::selectForForms filter=".$filter, LOG_DEBUG); |
|
| 8161 | 8161 | |
| 8162 | 8162 | // Generate the combo HTML component |
| 8163 | 8163 | $out = ''; |
@@ -8184,13 +8184,13 @@ discard block |
||
| 8184 | 8184 | } |
| 8185 | 8185 | |
| 8186 | 8186 | // Set url and param to call to get json of the search results |
| 8187 | - $urlforajaxcall = DOL_URL_ROOT . '/core/ajax/selectobject.php'; |
|
| 8188 | - $urloption = 'htmlname=' . urlencode($htmlname) . '&outjson=1&objectdesc=' . urlencode($objectdescorig) . '&objectfield='.urlencode($objectfield) . ($sortfield ? '&sortfield=' . urlencode($sortfield) : ''); |
|
| 8187 | + $urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php'; |
|
| 8188 | + $urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&objectdesc='.urlencode($objectdescorig).'&objectfield='.urlencode($objectfield).($sortfield ? '&sortfield='.urlencode($sortfield) : ''); |
|
| 8189 | 8189 | |
| 8190 | 8190 | // Activate the auto complete using ajax call. |
| 8191 | 8191 | $out .= ajax_autocompleter($preSelectedValue, $htmlname, $urlforajaxcall, $urloption, getDolGlobalString($confkeyforautocompletemode), 0); |
| 8192 | 8192 | $out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
| 8193 | - $out .= '<input type="text" class="' . $morecss . '"' . ($disabled ? ' disabled="disabled"' : '') . ' name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' />'; |
|
| 8193 | + $out .= '<input type="text" class="'.$morecss.'"'.($disabled ? ' disabled="disabled"' : '').' name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' />'; |
|
| 8194 | 8194 | } else { |
| 8195 | 8195 | // Immediate load of table record. |
| 8196 | 8196 | $out .= $this->selectForFormsList($objecttmp, $htmlname, $preSelectedValue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter); |
@@ -8230,16 +8230,16 @@ discard block |
||
| 8230 | 8230 | if ($prefixforautocompletemode == 'societe') { |
| 8231 | 8231 | $prefixforautocompletemode = 'company'; |
| 8232 | 8232 | } |
| 8233 | - $confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8233 | + $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8234 | 8234 | |
| 8235 | 8235 | if (!empty($objecttmp->fields)) { // For object that declare it, it is better to use declared fields (like societe, contact, ...) |
| 8236 | 8236 | $tmpfieldstoshow = ''; |
| 8237 | 8237 | foreach ($objecttmp->fields as $key => $val) { |
| 8238 | - if (! (int) dol_eval($val['enabled'], 1, 1, '1')) { |
|
| 8238 | + if (!(int) dol_eval($val['enabled'], 1, 1, '1')) { |
|
| 8239 | 8239 | continue; |
| 8240 | 8240 | } |
| 8241 | 8241 | if (!empty($val['showoncombobox'])) { |
| 8242 | - $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key; |
|
| 8242 | + $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key; |
|
| 8243 | 8243 | } |
| 8244 | 8244 | } |
| 8245 | 8245 | if ($tmpfieldstoshow) { |
@@ -8267,18 +8267,18 @@ discard block |
||
| 8267 | 8267 | $num = 0; |
| 8268 | 8268 | |
| 8269 | 8269 | // Search data |
| 8270 | - $sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t"; |
|
| 8270 | + $sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$objecttmp->table_element." as t"; |
|
| 8271 | 8271 | if (!empty($objecttmp->isextrafieldmanaged)) { |
| 8272 | - $sql .= " LEFT JOIN " . $this->db->prefix() . $objecttmp->table_element . "_extrafields as e ON t.rowid=e.fk_object"; |
|
| 8272 | + $sql .= " LEFT JOIN ".$this->db->prefix().$objecttmp->table_element."_extrafields as e ON t.rowid=e.fk_object"; |
|
| 8273 | 8273 | } |
| 8274 | 8274 | if (isset($objecttmp->ismultientitymanaged)) { |
| 8275 | 8275 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
| 8276 | 8276 | $tmparray = explode('@', $objecttmp->ismultientitymanaged); |
| 8277 | - $sql .= " INNER JOIN " . $this->db->prefix() . $tmparray[1] . " as parenttable ON parenttable.rowid = t." . $tmparray[0]; |
|
| 8277 | + $sql .= " INNER JOIN ".$this->db->prefix().$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0]; |
|
| 8278 | 8278 | } |
| 8279 | 8279 | if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { |
| 8280 | 8280 | if (!$user->hasRight('societe', 'client', 'voir')) { |
| 8281 | - $sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc"; |
|
| 8281 | + $sql .= ", ".$this->db->prefix()."societe_commerciaux as sc"; |
|
| 8282 | 8282 | } |
| 8283 | 8283 | } |
| 8284 | 8284 | } |
@@ -8298,21 +8298,21 @@ discard block |
||
| 8298 | 8298 | $sql .= " WHERE 1=1"; |
| 8299 | 8299 | if (isset($objecttmp->ismultientitymanaged)) { |
| 8300 | 8300 | if ($objecttmp->ismultientitymanaged == 1) { |
| 8301 | - $sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")"; |
|
| 8301 | + $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")"; |
|
| 8302 | 8302 | } |
| 8303 | 8303 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
| 8304 | - $sql .= " AND parenttable.entity = t." . $tmparray[0]; |
|
| 8304 | + $sql .= " AND parenttable.entity = t.".$tmparray[0]; |
|
| 8305 | 8305 | } |
| 8306 | 8306 | if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) { |
| 8307 | 8307 | if ($objecttmp->element == 'societe') { |
| 8308 | - $sql .= " AND t.rowid = " . ((int) $user->socid); |
|
| 8308 | + $sql .= " AND t.rowid = ".((int) $user->socid); |
|
| 8309 | 8309 | } else { |
| 8310 | - $sql .= " AND t.fk_soc = " . ((int) $user->socid); |
|
| 8310 | + $sql .= " AND t.fk_soc = ".((int) $user->socid); |
|
| 8311 | 8311 | } |
| 8312 | 8312 | } |
| 8313 | 8313 | if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { |
| 8314 | 8314 | if (!$user->hasRight('societe', 'client', 'voir')) { |
| 8315 | - $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id); |
|
| 8315 | + $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); |
|
| 8316 | 8316 | } |
| 8317 | 8317 | } |
| 8318 | 8318 | } |
@@ -8324,7 +8324,7 @@ discard block |
||
| 8324 | 8324 | $errormessage = ''; |
| 8325 | 8325 | $sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage); |
| 8326 | 8326 | if ($errormessage) { |
| 8327 | - return 'Error forging a SQL request from an universal criteria: ' . $errormessage; |
|
| 8327 | + return 'Error forging a SQL request from an universal criteria: '.$errormessage; |
|
| 8328 | 8328 | } |
| 8329 | 8329 | } |
| 8330 | 8330 | } |
@@ -8336,7 +8336,7 @@ discard block |
||
| 8336 | 8336 | $resql = $this->db->query($sql); |
| 8337 | 8337 | if ($resql) { |
| 8338 | 8338 | // Construct $out and $outarray |
| 8339 | - $out .= '<select id="' . $htmlname . '" class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n"; |
|
| 8339 | + $out .= '<select id="'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n"; |
|
| 8340 | 8340 | |
| 8341 | 8341 | // Warning: Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. Seems it is no more true with selec2 v4 |
| 8342 | 8342 | $textifempty = ' '; |
@@ -8350,7 +8350,7 @@ discard block |
||
| 8350 | 8350 | } |
| 8351 | 8351 | } |
| 8352 | 8352 | if ($showempty) { |
| 8353 | - $out .= '<option value="-1">' . $textifempty . '</option>' . "\n"; |
|
| 8353 | + $out .= '<option value="-1">'.$textifempty.'</option>'."\n"; |
|
| 8354 | 8354 | } |
| 8355 | 8355 | |
| 8356 | 8356 | $num = $this->db->num_rows($resql); |
@@ -8373,9 +8373,9 @@ discard block |
||
| 8373 | 8373 | } |
| 8374 | 8374 | if (empty($outputmode)) { |
| 8375 | 8375 | if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) { |
| 8376 | - $out .= '<option value="' . $obj->rowid . '" selected data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
| 8376 | + $out .= '<option value="'.$obj->rowid.'" selected data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
| 8377 | 8377 | } else { |
| 8378 | - $out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
| 8378 | + $out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
| 8379 | 8379 | } |
| 8380 | 8380 | } else { |
| 8381 | 8381 | array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label)); |
@@ -8388,10 +8388,10 @@ discard block |
||
| 8388 | 8388 | } |
| 8389 | 8389 | } |
| 8390 | 8390 | |
| 8391 | - $out .= '</select>' . "\n"; |
|
| 8391 | + $out .= '</select>'."\n"; |
|
| 8392 | 8392 | |
| 8393 | 8393 | if (!$forcecombo) { |
| 8394 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 8394 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 8395 | 8395 | $out .= ajax_combobox($htmlname, null, getDolGlobalInt($confkeyforautocompletemode, 0)); |
| 8396 | 8396 | } |
| 8397 | 8397 | } else { |
@@ -8453,8 +8453,8 @@ discard block |
||
| 8453 | 8453 | } |
| 8454 | 8454 | } |
| 8455 | 8455 | $idname = str_replace(array('[', ']'), array('', ''), $htmlname); |
| 8456 | - $out .= '<select id="' . preg_replace('/^\./', '', $idname) . '" ' . ($disabled ? 'disabled="disabled" ' : '') . 'class="flat ' . (preg_replace('/^\./', '', $htmlname)) . ($morecss ? ' ' . $morecss : '') . ' selectformat"'; |
|
| 8457 | - $out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '" ' . ($moreparam ? $moreparam : ''); |
|
| 8456 | + $out .= '<select id="'.preg_replace('/^\./', '', $idname).'" '.($disabled ? 'disabled="disabled" ' : '').'class="flat '.(preg_replace('/^\./', '', $htmlname)).($morecss ? ' '.$morecss : '').' selectformat"'; |
|
| 8457 | + $out .= ' name="'.preg_replace('/^\./', '', $htmlname).'" '.($moreparam ? $moreparam : ''); |
|
| 8458 | 8458 | $out .= '>'."\n"; |
| 8459 | 8459 | |
| 8460 | 8460 | if ($show_empty) { |
@@ -8465,7 +8465,7 @@ discard block |
||
| 8465 | 8465 | if (!is_numeric($show_empty)) { |
| 8466 | 8466 | $textforempty = $show_empty; |
| 8467 | 8467 | } |
| 8468 | - $out .= '<option class="optiongrey" ' . ($moreparamonempty ? $moreparamonempty . ' ' : '') . 'value="' . (((int) $show_empty) < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n"; |
|
| 8468 | + $out .= '<option class="optiongrey" '.($moreparamonempty ? $moreparamonempty.' ' : '').'value="'.(((int) $show_empty) < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n"; |
|
| 8469 | 8469 | } |
| 8470 | 8470 | if (is_array($array)) { |
| 8471 | 8471 | // Translate |
@@ -8488,7 +8488,7 @@ discard block |
||
| 8488 | 8488 | if (is_array($tmpvalue)) { |
| 8489 | 8489 | $value = $tmpvalue['label']; |
| 8490 | 8490 | $disabled = empty($tmpvalue['disabled']) ? '' : ' disabled'; |
| 8491 | - $style = empty($tmpvalue['css']) ? '' : ' class="' . $tmpvalue['css'] . '"'; |
|
| 8491 | + $style = empty($tmpvalue['css']) ? '' : ' class="'.$tmpvalue['css'].'"'; |
|
| 8492 | 8492 | } else { |
| 8493 | 8493 | $value = $tmpvalue; |
| 8494 | 8494 | $disabled = ''; |
@@ -8503,9 +8503,9 @@ discard block |
||
| 8503 | 8503 | } |
| 8504 | 8504 | if ($key_in_label) { |
| 8505 | 8505 | if (empty($nohtmlescape)) { |
| 8506 | - $selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
| 8506 | + $selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
| 8507 | 8507 | } else { |
| 8508 | - $selectOptionValue = $key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value); |
|
| 8508 | + $selectOptionValue = $key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value); |
|
| 8509 | 8509 | } |
| 8510 | 8510 | } else { |
| 8511 | 8511 | if (empty($nohtmlescape)) { |
@@ -8517,8 +8517,8 @@ discard block |
||
| 8517 | 8517 | $selectOptionValue = ' '; |
| 8518 | 8518 | } |
| 8519 | 8519 | } |
| 8520 | - $out .= '<option value="' . $key . '"'; |
|
| 8521 | - $out .= $style . $disabled; |
|
| 8520 | + $out .= '<option value="'.$key.'"'; |
|
| 8521 | + $out .= $style.$disabled; |
|
| 8522 | 8522 | if (is_array($id)) { |
| 8523 | 8523 | if (in_array($key, $id) && !$disabled) { |
| 8524 | 8524 | $out .= ' selected'; // To preselect a value |
@@ -8530,7 +8530,7 @@ discard block |
||
| 8530 | 8530 | } |
| 8531 | 8531 | } |
| 8532 | 8532 | if (!empty($nohtmlescape)) { |
| 8533 | - $out .= ' data-html="' . dol_escape_htmltag($selectOptionValue) . '"'; |
|
| 8533 | + $out .= ' data-html="'.dol_escape_htmltag($selectOptionValue).'"'; |
|
| 8534 | 8534 | } |
| 8535 | 8535 | if (is_array($tmpvalue)) { |
| 8536 | 8536 | foreach ($tmpvalue as $keyforvalue => $valueforvalue) { |
@@ -8548,7 +8548,7 @@ discard block |
||
| 8548 | 8548 | // Add code for jquery to use multiselect |
| 8549 | 8549 | if ($addjscombo && $jsbeautify) { |
| 8550 | 8550 | // Enhance with select2 |
| 8551 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 8551 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 8552 | 8552 | $out .= ajax_combobox($idname, array(), 0, 0, 'resolve', (((int) $show_empty) < 0 ? (string) $show_empty : '-1'), $morecss); |
| 8553 | 8553 | } |
| 8554 | 8554 | |
@@ -8576,28 +8576,28 @@ discard block |
||
| 8576 | 8576 | public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0) |
| 8577 | 8577 | { |
| 8578 | 8578 | global $conf, $langs; |
| 8579 | - global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 8579 | + global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 8580 | 8580 | |
| 8581 | 8581 | // TODO Use an internal dolibarr component instead of select2 |
| 8582 | 8582 | if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) { |
| 8583 | 8583 | return ''; |
| 8584 | 8584 | } |
| 8585 | 8585 | |
| 8586 | - $out = '<select type="text" class="' . $htmlname . ($morecss ? ' ' . $morecss : '') . '" ' . ($moreparam ? $moreparam . ' ' : '') . 'name="' . $htmlname . '"></select>'; |
|
| 8586 | + $out = '<select type="text" class="'.$htmlname.($morecss ? ' '.$morecss : '').'" '.($moreparam ? $moreparam.' ' : '').'name="'.$htmlname.'"></select>'; |
|
| 8587 | 8587 | |
| 8588 | 8588 | $outdelayed = ''; |
| 8589 | 8589 | if (!empty($conf->use_javascript_ajax)) { |
| 8590 | 8590 | $tmpplugin = 'select2'; |
| 8591 | - $outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' --> |
|
| 8592 | - <script nonce="' . getNonce() . '"> |
|
| 8591 | + $outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' --> |
|
| 8592 | + <script nonce="' . getNonce().'"> |
|
| 8593 | 8593 | $(document).ready(function () { |
| 8594 | 8594 | |
| 8595 | - ' . ($callurlonselect ? 'var saveRemoteData = [];' : '') . ' |
|
| 8595 | + ' . ($callurlonselect ? 'var saveRemoteData = [];' : '').' |
|
| 8596 | 8596 | |
| 8597 | - $(".' . $htmlname . '").select2({ |
|
| 8597 | + $(".' . $htmlname.'").select2({ |
|
| 8598 | 8598 | ajax: { |
| 8599 | 8599 | dir: "ltr", |
| 8600 | - url: "' . $url . '", |
|
| 8600 | + url: "' . $url.'", |
|
| 8601 | 8601 | dataType: \'json\', |
| 8602 | 8602 | delay: 250, |
| 8603 | 8603 | data: function (params) { |
@@ -8624,9 +8624,9 @@ discard block |
||
| 8624 | 8624 | }, |
| 8625 | 8625 | language: select2arrayoflanguage, |
| 8626 | 8626 | containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */ |
| 8627 | - placeholder: "' . dol_escape_js($placeholder) . '", |
|
| 8627 | + placeholder: "' . dol_escape_js($placeholder).'", |
|
| 8628 | 8628 | escapeMarkup: function (markup) { return markup; }, // let our custom formatter work |
| 8629 | - minimumInputLength: ' . ((int) $minimumInputLength) . ', |
|
| 8629 | + minimumInputLength: ' . ((int) $minimumInputLength).', |
|
| 8630 | 8630 | formatResult: function (result, container, query, escapeMarkup) { |
| 8631 | 8631 | return escapeMarkup(result.text); |
| 8632 | 8632 | }, |
@@ -8634,10 +8634,10 @@ discard block |
||
| 8634 | 8634 | |
| 8635 | 8635 | ' . ($callurlonselect ? ' |
| 8636 | 8636 | /* Code to execute a GET when we select a value */ |
| 8637 | - $(".' . $htmlname . '").change(function() { |
|
| 8638 | - var selected = $(".' . $htmlname . '").val(); |
|
| 8637 | + $(".' . $htmlname.'").change(function() { |
|
| 8638 | + var selected = $(".' . $htmlname.'").val(); |
|
| 8639 | 8639 | console.log("We select in selectArrayAjax the entry "+selected) |
| 8640 | - $(".' . $htmlname . '").val(""); /* reset visible combo value */ |
|
| 8640 | + $(".' . $htmlname.'").val(""); /* reset visible combo value */ |
|
| 8641 | 8641 | $.each( saveRemoteData, function( key, value ) { |
| 8642 | 8642 | if (key == selected) |
| 8643 | 8643 | { |
@@ -8645,7 +8645,7 @@ discard block |
||
| 8645 | 8645 | location.assign(value.url); |
| 8646 | 8646 | } |
| 8647 | 8647 | }); |
| 8648 | - });' : '') . ' |
|
| 8648 | + });' : '').' |
|
| 8649 | 8649 | |
| 8650 | 8650 | }); |
| 8651 | 8651 | </script>'; |
@@ -8681,14 +8681,14 @@ discard block |
||
| 8681 | 8681 | public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0, $textfortitle = '') |
| 8682 | 8682 | { |
| 8683 | 8683 | global $conf, $langs; |
| 8684 | - global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 8684 | + global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 8685 | 8685 | |
| 8686 | 8686 | // TODO Use an internal dolibarr component instead of select2 |
| 8687 | 8687 | if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) { |
| 8688 | 8688 | return ''; |
| 8689 | 8689 | } |
| 8690 | 8690 | |
| 8691 | - $out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' ' . $morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>'; |
|
| 8691 | + $out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>'; |
|
| 8692 | 8692 | |
| 8693 | 8693 | $formattedarrayresult = array(); |
| 8694 | 8694 | |
@@ -8703,20 +8703,20 @@ discard block |
||
| 8703 | 8703 | $outdelayed = ''; |
| 8704 | 8704 | if (!empty($conf->use_javascript_ajax)) { |
| 8705 | 8705 | $tmpplugin = 'select2'; |
| 8706 | - $outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' --> |
|
| 8707 | - <script nonce="' . getNonce() . '"> |
|
| 8706 | + $outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' --> |
|
| 8707 | + <script nonce="' . getNonce().'"> |
|
| 8708 | 8708 | $(document).ready(function () { |
| 8709 | - var data = ' . json_encode($formattedarrayresult) . '; |
|
| 8709 | + var data = ' . json_encode($formattedarrayresult).'; |
|
| 8710 | 8710 | |
| 8711 | - ' . ($callurlonselect ? 'var saveRemoteData = ' . json_encode($array) . ';' : '') . ' |
|
| 8711 | + ' . ($callurlonselect ? 'var saveRemoteData = '.json_encode($array).';' : '').' |
|
| 8712 | 8712 | |
| 8713 | - $(".' . $htmlname . '").select2({ |
|
| 8713 | + $(".' . $htmlname.'").select2({ |
|
| 8714 | 8714 | data: data, |
| 8715 | 8715 | language: select2arrayoflanguage, |
| 8716 | 8716 | containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */ |
| 8717 | - placeholder: "' . dol_escape_js($placeholder) . '", |
|
| 8717 | + placeholder: "' . dol_escape_js($placeholder).'", |
|
| 8718 | 8718 | escapeMarkup: function (markup) { return markup; }, // let our custom formatter work |
| 8719 | - minimumInputLength: ' . $minimumInputLength . ', |
|
| 8719 | + minimumInputLength: ' . $minimumInputLength.', |
|
| 8720 | 8720 | formatResult: function (result, container, query, escapeMarkup) { |
| 8721 | 8721 | return escapeMarkup(result.text); |
| 8722 | 8722 | }, |
@@ -8755,11 +8755,11 @@ discard block |
||
| 8755 | 8755 | |
| 8756 | 8756 | ' . ($callurlonselect ? ' |
| 8757 | 8757 | /* Code to execute a GET when we select a value */ |
| 8758 | - $(".' . $htmlname . '").change(function() { |
|
| 8759 | - var selected = $(".' . $htmlname . '").val(); |
|
| 8758 | + $(".' . $htmlname.'").change(function() { |
|
| 8759 | + var selected = $(".' . $htmlname.'").val(); |
|
| 8760 | 8760 | console.log("We select "+selected) |
| 8761 | 8761 | |
| 8762 | - $(".' . $htmlname . '").val(""); /* reset visible combo value */ |
|
| 8762 | + $(".' . $htmlname.'").val(""); /* reset visible combo value */ |
|
| 8763 | 8763 | $.each( saveRemoteData, function( key, value ) { |
| 8764 | 8764 | if (key == selected) |
| 8765 | 8765 | { |
@@ -8767,7 +8767,7 @@ discard block |
||
| 8767 | 8767 | location.assign(value.url); |
| 8768 | 8768 | } |
| 8769 | 8769 | }); |
| 8770 | - });' : '') . ' |
|
| 8770 | + });' : '').' |
|
| 8771 | 8771 | |
| 8772 | 8772 | }); |
| 8773 | 8773 | </script>'; |
@@ -8816,7 +8816,7 @@ discard block |
||
| 8816 | 8816 | $useenhancedmultiselect = 0; |
| 8817 | 8817 | if (!empty($conf->use_javascript_ajax) && !defined('MAIN_DO_NOT_USE_JQUERY_MULTISELECT') && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) { |
| 8818 | 8818 | if ($addjscombo) { |
| 8819 | - $useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0. |
|
| 8819 | + $useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0. |
|
| 8820 | 8820 | } |
| 8821 | 8821 | } |
| 8822 | 8822 | |
@@ -8825,7 +8825,7 @@ discard block |
||
| 8825 | 8825 | // submitted to nothing. |
| 8826 | 8826 | $out .= '<input type="hidden" name="'.$htmlname.'_multiselect" value="1">'; |
| 8827 | 8827 | // Output select component |
| 8828 | - $out .= '<select id="' . $htmlname . '" class="multiselect' . ($useenhancedmultiselect ? ' multiselectononeline' : '') . ($morecss ? ' ' . $morecss : '') . '" multiple name="' . $htmlname . '[]"' . ($moreattrib ? ' ' . $moreattrib : '') . ($width ? ' style="width: ' . (preg_match('/%/', $width) ? $width : $width . 'px') . '"' : '') . '>' . "\n"; |
|
| 8828 | + $out .= '<select id="'.$htmlname.'" class="multiselect'.($useenhancedmultiselect ? ' multiselectononeline' : '').($morecss ? ' '.$morecss : '').'" multiple name="'.$htmlname.'[]"'.($moreattrib ? ' '.$moreattrib : '').($width ? ' style="width: '.(preg_match('/%/', $width) ? $width : $width.'px').'"' : '').'>'."\n"; |
|
| 8829 | 8829 | if (is_array($array) && !empty($array)) { |
| 8830 | 8830 | if ($value_as_key) { |
| 8831 | 8831 | $array = array_combine($array, $array); |
@@ -8846,33 +8846,33 @@ discard block |
||
| 8846 | 8846 | $tmplabelhtml = empty($value['labelhtml']) ? '' : $value['labelhtml']; |
| 8847 | 8847 | } |
| 8848 | 8848 | $newval = ($translate ? $langs->trans($tmpvalue) : $tmpvalue); |
| 8849 | - $newval = ($key_in_label ? $tmpkey . ' - ' . $newval : $newval); |
|
| 8849 | + $newval = ($key_in_label ? $tmpkey.' - '.$newval : $newval); |
|
| 8850 | 8850 | |
| 8851 | - $out .= '<option value="' . $tmpkey . '"'; |
|
| 8851 | + $out .= '<option value="'.$tmpkey.'"'; |
|
| 8852 | 8852 | if (is_array($selected) && !empty($selected) && in_array((string) $tmpkey, $selected) && ((string) $tmpkey != '')) { |
| 8853 | 8853 | $out .= ' selected'; |
| 8854 | 8854 | } |
| 8855 | 8855 | if (!empty($tmplabelhtml)) { |
| 8856 | - $out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"'; |
|
| 8856 | + $out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"'; |
|
| 8857 | 8857 | } else { |
| 8858 | - $tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #' . $tmpcolor . '"') : '') . $newval; |
|
| 8859 | - $out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"'; |
|
| 8858 | + $tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #'.$tmpcolor.'"') : '').$newval; |
|
| 8859 | + $out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"'; |
|
| 8860 | 8860 | } |
| 8861 | 8861 | $out .= '>'; |
| 8862 | 8862 | $out .= dol_htmlentitiesbr($newval); |
| 8863 | - $out .= '</option>' . "\n"; |
|
| 8863 | + $out .= '</option>'."\n"; |
|
| 8864 | 8864 | } |
| 8865 | 8865 | } |
| 8866 | 8866 | } |
| 8867 | - $out .= '</select>' . "\n"; |
|
| 8867 | + $out .= '</select>'."\n"; |
|
| 8868 | 8868 | |
| 8869 | 8869 | // Add code for jquery to use multiselect |
| 8870 | 8870 | if (!empty($conf->use_javascript_ajax) && getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT')) { |
| 8871 | - $out .= "\n" . '<!-- JS CODE TO ENABLE select for id ' . $htmlname . ', addjscombo=' . $addjscombo . ' -->'; |
|
| 8872 | - $out .= "\n" . '<script nonce="' . getNonce() . '">' . "\n"; |
|
| 8871 | + $out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->'; |
|
| 8872 | + $out .= "\n".'<script nonce="'.getNonce().'">'."\n"; |
|
| 8873 | 8873 | if ($addjscombo == 1) { |
| 8874 | 8874 | $tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT; |
| 8875 | - $out .= 'function formatResult(record, container) {' . "\n"; |
|
| 8875 | + $out .= 'function formatResult(record, container) {'."\n"; |
|
| 8876 | 8876 | // If property data-html set, we decode html entities and use this. |
| 8877 | 8877 | // Note that HTML content must have been sanitized from js with dol_escape_htmltag(xxx, 0, 0, '', 0, 1) when building the select option. |
| 8878 | 8878 | $out .= ' if ($(record.element).attr("data-html") != undefined && typeof htmlEntityDecodeJs === "function") {'; |
@@ -8880,26 +8880,26 @@ discard block |
||
| 8880 | 8880 | $out .= ' return htmlEntityDecodeJs($(record.element).attr("data-html"));'; |
| 8881 | 8881 | $out .= ' }'."\n"; |
| 8882 | 8882 | $out .= ' return record.text;'; |
| 8883 | - $out .= '}' . "\n"; |
|
| 8884 | - $out .= 'function formatSelection(record) {' . "\n"; |
|
| 8883 | + $out .= '}'."\n"; |
|
| 8884 | + $out .= 'function formatSelection(record) {'."\n"; |
|
| 8885 | 8885 | if ($elemtype == 'category') { |
| 8886 | - $out .= 'return \'<span><img src="' . DOL_URL_ROOT . '/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';'; |
|
| 8886 | + $out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';'; |
|
| 8887 | 8887 | } else { |
| 8888 | 8888 | $out .= 'return record.text;'; |
| 8889 | 8889 | } |
| 8890 | - $out .= '}' . "\n"; |
|
| 8890 | + $out .= '}'."\n"; |
|
| 8891 | 8891 | $out .= '$(document).ready(function () { |
| 8892 | - $(\'#' . $htmlname . '\').' . $tmpplugin . '({'; |
|
| 8892 | + $(\'#' . $htmlname.'\').'.$tmpplugin.'({'; |
|
| 8893 | 8893 | if ($placeholder) { |
| 8894 | 8894 | $out .= ' |
| 8895 | 8895 | placeholder: { |
| 8896 | 8896 | id: \'-1\', |
| 8897 | - text: \'' . dol_escape_js($placeholder) . '\' |
|
| 8897 | + text: \'' . dol_escape_js($placeholder).'\' |
|
| 8898 | 8898 | },'; |
| 8899 | 8899 | } |
| 8900 | 8900 | $out .= ' dir: \'ltr\', |
| 8901 | 8901 | containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag (ko with multiselect) */ |
| 8902 | - dropdownCssClass: \'' . $morecss . '\', /* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */ |
|
| 8902 | + dropdownCssClass: \'' . $morecss.'\', /* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */ |
|
| 8903 | 8903 | // Specify format function for dropdown item |
| 8904 | 8904 | formatResult: formatResult, |
| 8905 | 8905 | templateResult: formatResult, /* For 4.0 */ |
@@ -8911,21 +8911,21 @@ discard block |
||
| 8911 | 8911 | |
| 8912 | 8912 | /* Add also morecss to the css .select2 that is after the #htmlname, for component that are show dynamically after load, because select2 set |
| 8913 | 8913 | the size only if component is not hidden by default on load */ |
| 8914 | - $(\'#' . $htmlname . ' + .select2\').addClass(\'' . $morecss . '\'); |
|
| 8914 | + $(\'#' . $htmlname.' + .select2\').addClass(\''.$morecss.'\'); |
|
| 8915 | 8915 | });' . "\n"; |
| 8916 | 8916 | } elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT')) { |
| 8917 | 8917 | // Add other js lib |
| 8918 | 8918 | // TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin |
| 8919 | 8919 | // ... |
| 8920 | - $out .= 'console.log(\'addjscombo=2 for htmlname=' . $htmlname . '\');'; |
|
| 8920 | + $out .= 'console.log(\'addjscombo=2 for htmlname='.$htmlname.'\');'; |
|
| 8921 | 8921 | $out .= '$(document).ready(function () { |
| 8922 | - $(\'#' . $htmlname . '\').multiSelect({ |
|
| 8922 | + $(\'#' . $htmlname.'\').multiSelect({ |
|
| 8923 | 8923 | containerHTML: \'<div class="multi-select-container">\', |
| 8924 | 8924 | menuHTML: \'<div class="multi-select-menu">\', |
| 8925 | - buttonHTML: \'<span class="multi-select-button ' . $morecss . '">\', |
|
| 8925 | + buttonHTML: \'<span class="multi-select-button ' . $morecss.'">\', |
|
| 8926 | 8926 | menuItemHTML: \'<label class="multi-select-menuitem">\', |
| 8927 | 8927 | activeClass: \'multi-select-container--open\', |
| 8928 | - noneText: \'' . $placeholder . '\' |
|
| 8928 | + noneText: \'' . $placeholder.'\' |
|
| 8929 | 8929 | }); |
| 8930 | 8930 | })'; |
| 8931 | 8931 | } |
@@ -8957,7 +8957,7 @@ discard block |
||
| 8957 | 8957 | return ''; |
| 8958 | 8958 | } |
| 8959 | 8959 | |
| 8960 | - $tmpvar = "MAIN_SELECTEDFIELDS_" . $varpage; // To get list of saved selected fields to show |
|
| 8960 | + $tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show |
|
| 8961 | 8961 | |
| 8962 | 8962 | if (!empty($user->conf->$tmpvar)) { // A list of fields was already customized for user |
| 8963 | 8963 | $tmparray = explode(',', $user->conf->$tmpvar); |
@@ -9000,19 +9000,19 @@ discard block |
||
| 9000 | 9000 | } |
| 9001 | 9001 | |
| 9002 | 9002 | // Note: $val['checked'] <> 0 means we must show the field into the combo list |
| 9003 | - $listoffieldsforselection .= '<li><input type="checkbox" id="checkbox' . $key . '" value="' . $key . '"' . ((empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"') . '/><label for="checkbox' . $key . '">' . dol_escape_htmltag($langs->trans($val['label'])) . '</label></li>'; |
|
| 9004 | - $listcheckedstring .= (empty($val['checked']) ? '' : $key . ','); |
|
| 9003 | + $listoffieldsforselection .= '<li><input type="checkbox" id="checkbox'.$key.'" value="'.$key.'"'.((empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"').'/><label for="checkbox'.$key.'">'.dol_escape_htmltag($langs->trans($val['label'])).'</label></li>'; |
|
| 9004 | + $listcheckedstring .= (empty($val['checked']) ? '' : $key.','); |
|
| 9005 | 9005 | } |
| 9006 | 9006 | } |
| 9007 | 9007 | |
| 9008 | - $out = '<!-- Component multiSelectArrayWithCheckbox ' . $htmlname . ' --> |
|
| 9008 | + $out = '<!-- Component multiSelectArrayWithCheckbox '.$htmlname.' --> |
|
| 9009 | 9009 | |
| 9010 | 9010 | <dl class="dropdown"> |
| 9011 | 9011 | <dt> |
| 9012 | - <a href="#' . $htmlname . '"> |
|
| 9013 | - ' . img_picto('', 'list') . ' |
|
| 9012 | + <a href="#' . $htmlname.'"> |
|
| 9013 | + ' . img_picto('', 'list').' |
|
| 9014 | 9014 | </a> |
| 9015 | - <input type="hidden" class="' . $htmlname . '" name="' . $htmlname . '" value="' . $listcheckedstring . '"> |
|
| 9015 | + <input type="hidden" class="' . $htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'"> |
|
| 9016 | 9016 | </dt> |
| 9017 | 9017 | <dd class="dropdowndd"> |
| 9018 | 9018 | <div class="multiselectcheckbox'.$htmlname.'"> |
@@ -9024,19 +9024,19 @@ discard block |
||
| 9024 | 9024 | </dd> |
| 9025 | 9025 | </dl> |
| 9026 | 9026 | |
| 9027 | - <script nonce="' . getNonce() . '" type="text/javascript"> |
|
| 9027 | + <script nonce="' . getNonce().'" type="text/javascript"> |
|
| 9028 | 9028 | jQuery(document).ready(function () { |
| 9029 | - $(\'.multiselectcheckbox' . $htmlname . ' input[type="checkbox"]\').on(\'click\', function () { |
|
| 9029 | + $(\'.multiselectcheckbox' . $htmlname.' input[type="checkbox"]\').on(\'click\', function () { |
|
| 9030 | 9030 | console.log("A new field was added/removed, we edit field input[name=formfilteraction]"); |
| 9031 | 9031 | |
| 9032 | 9032 | $("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\'); // Update field so we know we changed something on selected fields after POST |
| 9033 | 9033 | |
| 9034 | 9034 | var title = $(this).val() + ","; |
| 9035 | 9035 | if ($(this).is(\':checked\')) { |
| 9036 | - $(\'.' . $htmlname . '\').val(title + $(\'.' . $htmlname . '\').val()); |
|
| 9036 | + $(\'.' . $htmlname.'\').val(title + $(\'.'.$htmlname.'\').val()); |
|
| 9037 | 9037 | } |
| 9038 | 9038 | else { |
| 9039 | - $(\'.' . $htmlname . '\').val( $(\'.' . $htmlname . '\').val().replace(title, \'\') ) |
|
| 9039 | + $(\'.' . $htmlname.'\').val( $(\'.'.$htmlname.'\').val().replace(title, \'\') ) |
|
| 9040 | 9040 | } |
| 9041 | 9041 | // Now, we submit page |
| 9042 | 9042 | //$(this).parents(\'form:first\').submit(); |
@@ -9067,7 +9067,7 @@ discard block |
||
| 9067 | 9067 | */ |
| 9068 | 9068 | public function showCategories($id, $type, $rendermode = 0, $nolink = 0) |
| 9069 | 9069 | { |
| 9070 | - include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 9070 | + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 9071 | 9071 | |
| 9072 | 9072 | $cat = new Categorie($this->db); |
| 9073 | 9073 | $categories = $cat->containing($id, $type); |
@@ -9077,10 +9077,10 @@ discard block |
||
| 9077 | 9077 | foreach ($categories as $c) { |
| 9078 | 9078 | $ways = $c->print_all_ways(' >> ', ($nolink ? 'none' : ''), 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
| 9079 | 9079 | foreach ($ways as $way) { |
| 9080 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>'; |
|
| 9080 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>'; |
|
| 9081 | 9081 | } |
| 9082 | 9082 | } |
| 9083 | - return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>'; |
|
| 9083 | + return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
| 9084 | 9084 | } |
| 9085 | 9085 | |
| 9086 | 9086 | if ($rendermode == 0) { |
@@ -9128,15 +9128,15 @@ discard block |
||
| 9128 | 9128 | |
| 9129 | 9129 | |
| 9130 | 9130 | print '<div class="div-table-responsive-no-min">'; |
| 9131 | - print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="' . $object->element . '" data-elementid="' . $object->id . '" >'; |
|
| 9131 | + print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="'.$object->element.'" data-elementid="'.$object->id.'" >'; |
|
| 9132 | 9132 | |
| 9133 | 9133 | print '<tr class="liste_titre">'; |
| 9134 | - print '<td>' . $langs->trans("Type") . '</td>'; |
|
| 9135 | - print '<td>' . $langs->trans("Ref") . '</td>'; |
|
| 9134 | + print '<td>'.$langs->trans("Type").'</td>'; |
|
| 9135 | + print '<td>'.$langs->trans("Ref").'</td>'; |
|
| 9136 | 9136 | print '<td class="center"></td>'; |
| 9137 | - print '<td class="center">' . $langs->trans("Date") . '</td>'; |
|
| 9138 | - print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>'; |
|
| 9139 | - print '<td class="right">' . $langs->trans("Status") . '</td>'; |
|
| 9137 | + print '<td class="center">'.$langs->trans("Date").'</td>'; |
|
| 9138 | + print '<td class="right">'.$langs->trans("AmountHTShort").'</td>'; |
|
| 9139 | + print '<td class="right">'.$langs->trans("Status").'</td>'; |
|
| 9140 | 9140 | print '<td></td>'; |
| 9141 | 9141 | print '</tr>'; |
| 9142 | 9142 | |
@@ -9155,13 +9155,13 @@ discard block |
||
| 9155 | 9155 | if ($objecttype != 'supplier_proposal' && preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) { |
| 9156 | 9156 | $element = $regs[1]; |
| 9157 | 9157 | $subelement = $regs[2]; |
| 9158 | - $tplpath = $element . '/' . $subelement; |
|
| 9158 | + $tplpath = $element.'/'.$subelement; |
|
| 9159 | 9159 | } |
| 9160 | 9160 | $tplname = 'linkedobjectblock'; |
| 9161 | 9161 | |
| 9162 | 9162 | // To work with non standard path |
| 9163 | 9163 | if ($objecttype == 'facture') { |
| 9164 | - $tplpath = 'compta/' . $element; |
|
| 9164 | + $tplpath = 'compta/'.$element; |
|
| 9165 | 9165 | if (!isModEnabled('invoice')) { |
| 9166 | 9166 | continue; // Do not show if module disabled |
| 9167 | 9167 | } |
@@ -9172,7 +9172,7 @@ discard block |
||
| 9172 | 9172 | continue; // Do not show if module disabled |
| 9173 | 9173 | } |
| 9174 | 9174 | } elseif ($objecttype == 'propal') { |
| 9175 | - $tplpath = 'comm/' . $element; |
|
| 9175 | + $tplpath = 'comm/'.$element; |
|
| 9176 | 9176 | if (!isModEnabled('propal')) { |
| 9177 | 9177 | continue; // Do not show if module disabled |
| 9178 | 9178 | } |
@@ -9223,7 +9223,7 @@ discard block |
||
| 9223 | 9223 | $linkedObjectBlock = $objects; |
| 9224 | 9224 | |
| 9225 | 9225 | // Output template part (modules that overwrite templates must declare this into descriptor) |
| 9226 | - $dirtpls = array_merge($conf->modules_parts['tpl'], array('/' . $tplpath . '/tpl')); |
|
| 9226 | + $dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl')); |
|
| 9227 | 9227 | foreach ($dirtpls as $reldir) { |
| 9228 | 9228 | $reldir = rtrim($reldir, '/'); |
| 9229 | 9229 | if ($nboftypesoutput == ($nbofdifferenttypes - 1)) { // No more type to show after |
@@ -9231,7 +9231,7 @@ discard block |
||
| 9231 | 9231 | $noMoreLinkedObjectBlockAfter = 1; |
| 9232 | 9232 | } |
| 9233 | 9233 | |
| 9234 | - $res = @include dol_buildpath($reldir . '/' . $tplname . '.tpl.php'); |
|
| 9234 | + $res = @include dol_buildpath($reldir.'/'.$tplname.'.tpl.php'); |
|
| 9235 | 9235 | if ($res) { |
| 9236 | 9236 | $nboftypesoutput++; |
| 9237 | 9237 | break; |
@@ -9240,7 +9240,7 @@ discard block |
||
| 9240 | 9240 | } |
| 9241 | 9241 | |
| 9242 | 9242 | if (!$nboftypesoutput) { |
| 9243 | - print '<tr><td class="impair" colspan="7"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>'; |
|
| 9243 | + print '<tr><td class="impair" colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>'; |
|
| 9244 | 9244 | } |
| 9245 | 9245 | |
| 9246 | 9246 | print '</table>'; |
@@ -9280,14 +9280,14 @@ discard block |
||
| 9280 | 9280 | if (is_object($object->thirdparty) && !empty($object->thirdparty->id) && $object->thirdparty->id > 0) { |
| 9281 | 9281 | $listofidcompanytoscan = $object->thirdparty->id; |
| 9282 | 9282 | if (($object->thirdparty->parent > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PARENT_IN_LINKTO')) { |
| 9283 | - $listofidcompanytoscan .= ',' . $object->thirdparty->parent; |
|
| 9283 | + $listofidcompanytoscan .= ','.$object->thirdparty->parent; |
|
| 9284 | 9284 | } |
| 9285 | 9285 | if (($object->fk_project > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO')) { |
| 9286 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 9286 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 9287 | 9287 | $tmpproject = new Project($this->db); |
| 9288 | 9288 | $tmpproject->fetch($object->fk_project); |
| 9289 | 9289 | if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) { |
| 9290 | - $listofidcompanytoscan .= ',' . $tmpproject->socid; |
|
| 9290 | + $listofidcompanytoscan .= ','.$tmpproject->socid; |
|
| 9291 | 9291 | } |
| 9292 | 9292 | unset($tmpproject); |
| 9293 | 9293 | } |
@@ -9297,63 +9297,63 @@ discard block |
||
| 9297 | 9297 | 'enabled' => isModEnabled('propal'), |
| 9298 | 9298 | 'perms' => 1, |
| 9299 | 9299 | 'label' => 'LinkToProposal', |
| 9300 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('propal') . ')'), |
|
| 9300 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('propal').')'), |
|
| 9301 | 9301 | 'shipping' => array( |
| 9302 | 9302 | 'enabled' => isModEnabled('delivery_note'), |
| 9303 | 9303 | 'perms' => 1, |
| 9304 | 9304 | 'label' => 'LinkToExpedition', |
| 9305 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "expedition as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('shipping') . ')'), |
|
| 9305 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."expedition as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('shipping').')'), |
|
| 9306 | 9306 | 'order' => array( |
| 9307 | 9307 | 'enabled' => isModEnabled('order'), |
| 9308 | 9308 | 'perms' => 1, |
| 9309 | 9309 | 'label' => 'LinkToOrder', |
| 9310 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('commande') . ')'), |
|
| 9310 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande').')'), |
|
| 9311 | 9311 | 'invoice' => array( |
| 9312 | 9312 | 'enabled' => isModEnabled('invoice'), |
| 9313 | 9313 | 'perms' => 1, |
| 9314 | 9314 | 'label' => 'LinkToInvoice', |
| 9315 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('invoice') . ')'), |
|
| 9315 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'), |
|
| 9316 | 9316 | 'invoice_template' => array( |
| 9317 | 9317 | 'enabled' => isModEnabled('invoice'), |
| 9318 | 9318 | 'perms' => 1, |
| 9319 | 9319 | 'label' => 'LinkToTemplateInvoice', |
| 9320 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('invoice') . ')'), |
|
| 9320 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'), |
|
| 9321 | 9321 | 'contrat' => array( |
| 9322 | 9322 | 'enabled' => isModEnabled('contract'), |
| 9323 | 9323 | 'perms' => 1, |
| 9324 | 9324 | 'label' => 'LinkToContract', |
| 9325 | 9325 | 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, SUM(td.total_ht) as total_ht |
| 9326 | - FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "contrat as t, " . $this->db->prefix() . "contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('contract') . ') GROUP BY s.rowid, s.nom, s.client, t.rowid, t.ref, t.ref_customer, t.ref_supplier' |
|
| 9326 | + FROM " . $this->db->prefix()."societe as s, ".$this->db->prefix()."contrat as t, ".$this->db->prefix()."contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('contract').') GROUP BY s.rowid, s.nom, s.client, t.rowid, t.ref, t.ref_customer, t.ref_supplier' |
|
| 9327 | 9327 | ), |
| 9328 | 9328 | 'fichinter' => array( |
| 9329 | 9329 | 'enabled' => isModEnabled('intervention'), |
| 9330 | 9330 | 'perms' => 1, |
| 9331 | 9331 | 'label' => 'LinkToIntervention', |
| 9332 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('intervention') . ')'), |
|
| 9332 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('intervention').')'), |
|
| 9333 | 9333 | 'supplier_proposal' => array( |
| 9334 | 9334 | 'enabled' => isModEnabled('supplier_proposal'), |
| 9335 | 9335 | 'perms' => 1, |
| 9336 | 9336 | 'label' => 'LinkToSupplierProposal', |
| 9337 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('supplier_proposal') . ')'), |
|
| 9337 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('supplier_proposal').')'), |
|
| 9338 | 9338 | 'order_supplier' => array( |
| 9339 | 9339 | 'enabled' => isModEnabled("supplier_order"), |
| 9340 | 9340 | 'perms' => 1, |
| 9341 | 9341 | 'label' => 'LinkToSupplierOrder', |
| 9342 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('commande_fournisseur') . ')'), |
|
| 9342 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande_fournisseur').')'), |
|
| 9343 | 9343 | 'invoice_supplier' => array( |
| 9344 | 9344 | 'enabled' => isModEnabled("supplier_invoice"), |
| 9345 | 9345 | 'perms' => 1, 'label' => 'LinkToSupplierInvoice', |
| 9346 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('facture_fourn') . ')'), |
|
| 9346 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('facture_fourn').')'), |
|
| 9347 | 9347 | 'ticket' => array( |
| 9348 | 9348 | 'enabled' => isModEnabled('ticket'), |
| 9349 | 9349 | 'perms' => 1, |
| 9350 | 9350 | 'label' => 'LinkToTicket', |
| 9351 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('ticket') . ')'), |
|
| 9351 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('ticket').')'), |
|
| 9352 | 9352 | 'mo' => array( |
| 9353 | 9353 | 'enabled' => isModEnabled('mrp'), |
| 9354 | 9354 | 'perms' => 1, |
| 9355 | 9355 | 'label' => 'LinkToMo', |
| 9356 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.rowid, '0' as total_ht FROM " . $this->db->prefix() . "societe as s INNER JOIN " . $this->db->prefix() . "mrp_mo as t ON t.fk_soc = s.rowid WHERE t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('mo') . ')') |
|
| 9356 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.rowid, '0' as total_ht FROM ".$this->db->prefix()."societe as s INNER JOIN ".$this->db->prefix()."mrp_mo as t ON t.fk_soc = s.rowid WHERE t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('mo').')') |
|
| 9357 | 9357 | ); |
| 9358 | 9358 | } |
| 9359 | 9359 | |
@@ -9388,22 +9388,22 @@ discard block |
||
| 9388 | 9388 | } |
| 9389 | 9389 | |
| 9390 | 9390 | if (!empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || !in_array($key, $excludelinksto))) { |
| 9391 | - print '<div id="' . $key . 'list"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display:none"') . '>'; |
|
| 9391 | + print '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display:none"').'>'; |
|
| 9392 | 9392 | |
| 9393 | 9393 | if (getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) { |
| 9394 | 9394 | print '<br>'."\n"; |
| 9395 | 9395 | print '<!-- form to add a link from anywhere -->'."\n"; |
| 9396 | - print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">'; |
|
| 9397 | - print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
| 9396 | + print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinkedbyref'.$key.'">'; |
|
| 9397 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
| 9398 | 9398 | print '<input type="hidden" name="action" value="addlinkbyref">'; |
| 9399 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 9400 | - print '<input type="hidden" name="addlink" value="' . $key . '">'; |
|
| 9399 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 9400 | + print '<input type="hidden" name="addlink" value="'.$key.'">'; |
|
| 9401 | 9401 | print '<table class="noborder">'; |
| 9402 | 9402 | print '<tr>'; |
| 9403 | 9403 | //print '<td>' . $langs->trans("Ref") . '</td>'; |
| 9404 | - print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '"> '; |
|
| 9405 | - print '<input type="submit" class="button small valignmiddle" value="' . $langs->trans('ToLink') . '"> '; |
|
| 9406 | - print '<input type="submit" class="button small" name="cancel" value="' . $langs->trans('Cancel') . '"></td>'; |
|
| 9404 | + print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="'.dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')).'"> '; |
|
| 9405 | + print '<input type="submit" class="button small valignmiddle" value="'.$langs->trans('ToLink').'"> '; |
|
| 9406 | + print '<input type="submit" class="button small" name="cancel" value="'.$langs->trans('Cancel').'"></td>'; |
|
| 9407 | 9407 | print '</tr>'; |
| 9408 | 9408 | print '</table>'; |
| 9409 | 9409 | print '</form>'; |
@@ -9418,48 +9418,48 @@ discard block |
||
| 9418 | 9418 | |
| 9419 | 9419 | print '<br>'; |
| 9420 | 9420 | print '<!-- form to add a link from object to same thirdparty -->'."\n"; |
| 9421 | - print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinked' . $key . '">'; |
|
| 9421 | + print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinked'.$key.'">'; |
|
| 9422 | 9422 | print '<input type="hidden" name="action" value="addlink">'; |
| 9423 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 9424 | - print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
| 9425 | - print '<input type="hidden" name="addlink" value="' . $key . '">'; |
|
| 9423 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 9424 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
| 9425 | + print '<input type="hidden" name="addlink" value="'.$key.'">'; |
|
| 9426 | 9426 | print '<table class="noborder">'; |
| 9427 | 9427 | print '<tr class="liste_titre">'; |
| 9428 | 9428 | print '<td class="nowrap"></td>'; |
| 9429 | - print '<td class="center">' . $langs->trans("Ref") . '</td>'; |
|
| 9430 | - print '<td class="left">' . $langs->trans("RefCustomer") . '</td>'; |
|
| 9431 | - print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>'; |
|
| 9432 | - print '<td class="left">' . $langs->trans("Company") . '</td>'; |
|
| 9429 | + print '<td class="center">'.$langs->trans("Ref").'</td>'; |
|
| 9430 | + print '<td class="left">'.$langs->trans("RefCustomer").'</td>'; |
|
| 9431 | + print '<td class="right">'.$langs->trans("AmountHTShort").'</td>'; |
|
| 9432 | + print '<td class="left">'.$langs->trans("Company").'</td>'; |
|
| 9433 | 9433 | print '</tr>'; |
| 9434 | 9434 | while ($i < $num) { |
| 9435 | 9435 | $objp = $this->db->fetch_object($resqllist); |
| 9436 | 9436 | |
| 9437 | 9437 | print '<tr class="oddeven">'; |
| 9438 | 9438 | print '<td class="left">'; |
| 9439 | - print '<input type="radio" name="idtolinkto" id="' . $key . '_' . $objp->rowid . '" value="' . $objp->rowid . '">'; |
|
| 9439 | + print '<input type="radio" name="idtolinkto" id="'.$key.'_'.$objp->rowid.'" value="'.$objp->rowid.'">'; |
|
| 9440 | 9440 | print '</td>'; |
| 9441 | - print '<td class="center"><label for="' . $key . '_' . $objp->rowid . '">' . $objp->ref . '</label></td>'; |
|
| 9442 | - print '<td>' . (!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')) . '</td>'; |
|
| 9441 | + print '<td class="center"><label for="'.$key.'_'.$objp->rowid.'">'.$objp->ref.'</label></td>'; |
|
| 9442 | + print '<td>'.(!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')).'</td>'; |
|
| 9443 | 9443 | print '<td class="right">'; |
| 9444 | 9444 | if ($possiblelink['label'] == 'LinkToContract') { |
| 9445 | 9445 | $form = new Form($this->db); |
| 9446 | - print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")) . ' '; |
|
| 9446 | + print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' '; |
|
| 9447 | 9447 | } |
| 9448 | - print '<span class="amount">' . (isset($objp->total_ht) ? price($objp->total_ht) : '') . '</span>'; |
|
| 9448 | + print '<span class="amount">'.(isset($objp->total_ht) ? price($objp->total_ht) : '').'</span>'; |
|
| 9449 | 9449 | print '</td>'; |
| 9450 | - print '<td>' . $objp->name . '</td>'; |
|
| 9450 | + print '<td>'.$objp->name.'</td>'; |
|
| 9451 | 9451 | print '</tr>'; |
| 9452 | 9452 | $i++; |
| 9453 | 9453 | } |
| 9454 | 9454 | print '</table>'; |
| 9455 | 9455 | print '<div class="center">'; |
| 9456 | 9456 | if ($num) { |
| 9457 | - print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="' . $langs->trans('ToLink') . '">'; |
|
| 9457 | + print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="'.$langs->trans('ToLink').'">'; |
|
| 9458 | 9458 | } |
| 9459 | 9459 | if (empty($conf->use_javascript_ajax)) { |
| 9460 | - print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>'; |
|
| 9460 | + print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>'; |
|
| 9461 | 9461 | } else { |
| 9462 | - print '<input type="submit" onclick="jQuery(\'#' . $key . 'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>'; |
|
| 9462 | + print '<input type="submit" onclick="jQuery(\'#'.$key.'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>'; |
|
| 9463 | 9463 | } |
| 9464 | 9464 | print '</form>'; |
| 9465 | 9465 | $this->db->free($resqllist); |
@@ -9470,10 +9470,10 @@ discard block |
||
| 9470 | 9470 | |
| 9471 | 9471 | //$linktoelem.=($linktoelem?' ':''); |
| 9472 | 9472 | if ($num > 0 || getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) { |
| 9473 | - $linktoelemlist .= '<li><a href="#linkto' . $key . '" class="linkto dropdowncloseonclick" rel="' . $key . '">' . $langs->trans($possiblelink['label']) . ' (' . $num . ')</a></li>'; |
|
| 9473 | + $linktoelemlist .= '<li><a href="#linkto'.$key.'" class="linkto dropdowncloseonclick" rel="'.$key.'">'.$langs->trans($possiblelink['label']).' ('.$num.')</a></li>'; |
|
| 9474 | 9474 | // } else $linktoelem.=$langs->trans($possiblelink['label']); |
| 9475 | 9475 | } else { |
| 9476 | - $linktoelemlist .= '<li><span class="linktodisabled">' . $langs->trans($possiblelink['label']) . ' (0)</span></li>'; |
|
| 9476 | + $linktoelemlist .= '<li><span class="linktodisabled">'.$langs->trans($possiblelink['label']).' (0)</span></li>'; |
|
| 9477 | 9477 | } |
| 9478 | 9478 | } |
| 9479 | 9479 | } |
@@ -9483,11 +9483,11 @@ discard block |
||
| 9483 | 9483 | <dl class="dropdown" id="linktoobjectname"> |
| 9484 | 9484 | '; |
| 9485 | 9485 | if (!empty($conf->use_javascript_ajax)) { |
| 9486 | - $linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>' . $langs->trans("LinkTo") . '...</a></dt>'; |
|
| 9486 | + $linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>'.$langs->trans("LinkTo").'...</a></dt>'; |
|
| 9487 | 9487 | } |
| 9488 | 9488 | $linktoelem .= '<dd> |
| 9489 | 9489 | <div class="multiselectlinkto"> |
| 9490 | - <ul class="ulselectedfields">' . $linktoelemlist . ' |
|
| 9490 | + <ul class="ulselectedfields">' . $linktoelemlist.' |
|
| 9491 | 9491 | </ul> |
| 9492 | 9492 | </div> |
| 9493 | 9493 | </dd> |
@@ -9498,7 +9498,7 @@ discard block |
||
| 9498 | 9498 | |
| 9499 | 9499 | if (!empty($conf->use_javascript_ajax)) { |
| 9500 | 9500 | print '<!-- Add js to show linkto box --> |
| 9501 | - <script nonce="' . getNonce() . '"> |
|
| 9501 | + <script nonce="' . getNonce().'"> |
|
| 9502 | 9502 | jQuery(document).ready(function() { |
| 9503 | 9503 | jQuery(".linkto").click(function() { |
| 9504 | 9504 | console.log("We choose to show/hide links for rel="+jQuery(this).attr(\'rel\')+" so #"+jQuery(this).attr(\'rel\')+"list"); |
@@ -9539,19 +9539,19 @@ discard block |
||
| 9539 | 9539 | |
| 9540 | 9540 | $disabled = ($disabled ? ' disabled' : ''); |
| 9541 | 9541 | |
| 9542 | - $resultyesno = '<select class="flat width75' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"' . $disabled . '>' . "\n"; |
|
| 9542 | + $resultyesno = '<select class="flat width75'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n"; |
|
| 9543 | 9543 | if ($useempty) { |
| 9544 | - $resultyesno .= '<option value="-1"' . (($value < 0) ? ' selected' : '') . '> </option>' . "\n"; |
|
| 9544 | + $resultyesno .= '<option value="-1"'.(($value < 0) ? ' selected' : '').'> </option>'."\n"; |
|
| 9545 | 9545 | } |
| 9546 | 9546 | if (("$value" == 'yes') || ($value == 1)) { |
| 9547 | - $resultyesno .= '<option value="' . $yes . '" selected>' . $langs->trans($labelyes) . '</option>' . "\n"; |
|
| 9548 | - $resultyesno .= '<option value="' . $no . '">' . $langs->trans($labelno) . '</option>' . "\n"; |
|
| 9547 | + $resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans($labelyes).'</option>'."\n"; |
|
| 9548 | + $resultyesno .= '<option value="'.$no.'">'.$langs->trans($labelno).'</option>'."\n"; |
|
| 9549 | 9549 | } else { |
| 9550 | 9550 | $selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected'); |
| 9551 | - $resultyesno .= '<option value="' . $yes . '">' . $langs->trans($labelyes) . '</option>' . "\n"; |
|
| 9552 | - $resultyesno .= '<option value="' . $no . '"' . $selected . '>' . $langs->trans($labelno) . '</option>' . "\n"; |
|
| 9551 | + $resultyesno .= '<option value="'.$yes.'">'.$langs->trans($labelyes).'</option>'."\n"; |
|
| 9552 | + $resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans($labelno).'</option>'."\n"; |
|
| 9553 | 9553 | } |
| 9554 | - $resultyesno .= '</select>' . "\n"; |
|
| 9554 | + $resultyesno .= '</select>'."\n"; |
|
| 9555 | 9555 | |
| 9556 | 9556 | if ($addjscombo) { |
| 9557 | 9557 | $resultyesno .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', ($useempty < 0 ? (string) $useempty : '-1'), $morecss); |
@@ -9575,12 +9575,12 @@ discard block |
||
| 9575 | 9575 | { |
| 9576 | 9576 | // phpcs:enable |
| 9577 | 9577 | $sql = "SELECT rowid, label"; |
| 9578 | - $sql .= " FROM " . $this->db->prefix() . "export_model"; |
|
| 9579 | - $sql .= " WHERE type = '" . $this->db->escape($type) . "'"; |
|
| 9578 | + $sql .= " FROM ".$this->db->prefix()."export_model"; |
|
| 9579 | + $sql .= " WHERE type = '".$this->db->escape($type)."'"; |
|
| 9580 | 9580 | $sql .= " ORDER BY rowid"; |
| 9581 | 9581 | $result = $this->db->query($sql); |
| 9582 | 9582 | if ($result) { |
| 9583 | - print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 9583 | + print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 9584 | 9584 | if ($useempty) { |
| 9585 | 9585 | print '<option value="-1"> </option>'; |
| 9586 | 9586 | } |
@@ -9590,9 +9590,9 @@ discard block |
||
| 9590 | 9590 | while ($i < $num) { |
| 9591 | 9591 | $obj = $this->db->fetch_object($result); |
| 9592 | 9592 | if ($selected == $obj->rowid) { |
| 9593 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
| 9593 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
| 9594 | 9594 | } else { |
| 9595 | - print '<option value="' . $obj->rowid . '">'; |
|
| 9595 | + print '<option value="'.$obj->rowid.'">'; |
|
| 9596 | 9596 | } |
| 9597 | 9597 | print $obj->label; |
| 9598 | 9598 | print '</option>'; |
@@ -9682,8 +9682,8 @@ discard block |
||
| 9682 | 9682 | $stringforfirstkey .= ' CTL +'; |
| 9683 | 9683 | } |
| 9684 | 9684 | |
| 9685 | - $previous_ref = $object->ref_previous ? '<a accesskey="p" title="' . $stringforfirstkey . ' p" class="classfortooltip" href="' . $navurl . '?' . $paramid . '=' . urlencode($object->ref_previous) . $moreparam . '"><i class="fa fa-chevron-left"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-left opacitymedium"></i></span>'; |
|
| 9686 | - $next_ref = $object->ref_next ? '<a accesskey="n" title="' . $stringforfirstkey . ' n" class="classfortooltip" href="' . $navurl . '?' . $paramid . '=' . urlencode($object->ref_next) . $moreparam . '"><i class="fa fa-chevron-right"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-right opacitymedium"></i></span>'; |
|
| 9685 | + $previous_ref = $object->ref_previous ? '<a accesskey="p" title="'.$stringforfirstkey.' p" class="classfortooltip" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'"><i class="fa fa-chevron-left"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-left opacitymedium"></i></span>'; |
|
| 9686 | + $next_ref = $object->ref_next ? '<a accesskey="n" title="'.$stringforfirstkey.' n" class="classfortooltip" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'"><i class="fa fa-chevron-right"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-right opacitymedium"></i></span>'; |
|
| 9687 | 9687 | } |
| 9688 | 9688 | |
| 9689 | 9689 | //print "xx".$previous_ref."x".$next_ref; |
@@ -9691,18 +9691,18 @@ discard block |
||
| 9691 | 9691 | |
| 9692 | 9692 | // Right part of banner |
| 9693 | 9693 | if ($morehtmlright) { |
| 9694 | - $ret .= '<div class="inline-block floatleft">' . $morehtmlright . '</div>'; |
|
| 9694 | + $ret .= '<div class="inline-block floatleft">'.$morehtmlright.'</div>'; |
|
| 9695 | 9695 | } |
| 9696 | 9696 | |
| 9697 | 9697 | if ($previous_ref || $next_ref || $morehtml) { |
| 9698 | 9698 | $ret .= '<div class="pagination paginationref"><ul class="right">'; |
| 9699 | 9699 | } |
| 9700 | 9700 | if ($morehtml) { |
| 9701 | - $ret .= '<li class="noborder litext' . (($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '') . '">' . $morehtml . '</li>'; |
|
| 9701 | + $ret .= '<li class="noborder litext'.(($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '').'">'.$morehtml.'</li>'; |
|
| 9702 | 9702 | } |
| 9703 | 9703 | if ($shownav && ($previous_ref || $next_ref)) { |
| 9704 | - $ret .= '<li class="pagination">' . $previous_ref . '</li>'; |
|
| 9705 | - $ret .= '<li class="pagination">' . $next_ref . '</li>'; |
|
| 9704 | + $ret .= '<li class="pagination">'.$previous_ref.'</li>'; |
|
| 9705 | + $ret .= '<li class="pagination">'.$next_ref.'</li>'; |
|
| 9706 | 9706 | } |
| 9707 | 9707 | if ($previous_ref || $next_ref || $morehtml) { |
| 9708 | 9708 | $ret .= '</ul></div>'; |
@@ -9717,7 +9717,7 @@ discard block |
||
| 9717 | 9717 | $morehtmlstatus = $hookmanager->resPrint; |
| 9718 | 9718 | } |
| 9719 | 9719 | if ($morehtmlstatus) { |
| 9720 | - $ret .= '<div class="statusref">' . $morehtmlstatus . '</div>'; |
|
| 9720 | + $ret .= '<div class="statusref">'.$morehtmlstatus.'</div>'; |
|
| 9721 | 9721 | } |
| 9722 | 9722 | |
| 9723 | 9723 | $parameters = array(); |
@@ -9731,14 +9731,14 @@ discard block |
||
| 9731 | 9731 | // Left part of banner |
| 9732 | 9732 | if ($morehtmlleft) { |
| 9733 | 9733 | if ($conf->browser->layout == 'phone') { |
| 9734 | - $ret .= '<!-- morehtmlleft --><div class="floatleft">' . $morehtmlleft . '</div>'; |
|
| 9734 | + $ret .= '<!-- morehtmlleft --><div class="floatleft">'.$morehtmlleft.'</div>'; |
|
| 9735 | 9735 | } else { |
| 9736 | - $ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">' . $morehtmlleft . '</div>'; |
|
| 9736 | + $ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">'.$morehtmlleft.'</div>'; |
|
| 9737 | 9737 | } |
| 9738 | 9738 | } |
| 9739 | 9739 | |
| 9740 | 9740 | //if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>'; |
| 9741 | - $ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid' . (($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '') . '">'; |
|
| 9741 | + $ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid'.(($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '').'">'; |
|
| 9742 | 9742 | |
| 9743 | 9743 | // For thirdparty, contact, user, member, the ref is the id, so we show something else |
| 9744 | 9744 | if ($object->element == 'societe') { |
@@ -9752,7 +9752,7 @@ discard block |
||
| 9752 | 9752 | |
| 9753 | 9753 | if (is_array($arrayoflangcode) && count($arrayoflangcode)) { |
| 9754 | 9754 | if (!is_object($extralanguages)) { |
| 9755 | - include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php'; |
|
| 9755 | + include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php'; |
|
| 9756 | 9756 | $extralanguages = new ExtraLanguages($this->db); |
| 9757 | 9757 | } |
| 9758 | 9758 | $extralanguages->fetch_name_extralanguages('societe'); |
@@ -9767,27 +9767,27 @@ discard block |
||
| 9767 | 9767 | if ($object->array_languages['name'][$extralangcode]) { |
| 9768 | 9768 | $htmltext .= $object->array_languages['name'][$extralangcode]; |
| 9769 | 9769 | } else { |
| 9770 | - $htmltext .= '<span class="opacitymedium">' . $langs->trans("SwitchInEditModeToAddTranslation") . '</span>'; |
|
| 9770 | + $htmltext .= '<span class="opacitymedium">'.$langs->trans("SwitchInEditModeToAddTranslation").'</span>'; |
|
| 9771 | 9771 | } |
| 9772 | 9772 | } |
| 9773 | - $ret .= '<!-- Show translations of name -->' . "\n"; |
|
| 9773 | + $ret .= '<!-- Show translations of name -->'."\n"; |
|
| 9774 | 9774 | $ret .= $this->textwithpicto('', $htmltext, -1, 'language', 'opacitymedium paddingleft'); |
| 9775 | 9775 | } |
| 9776 | 9776 | } |
| 9777 | 9777 | } elseif ($object->element == 'member') { |
| 9778 | - $ret .= $object->ref . '<br>'; |
|
| 9778 | + $ret .= $object->ref.'<br>'; |
|
| 9779 | 9779 | $fullname = $object->getFullName($langs); |
| 9780 | 9780 | if ($object->morphy == 'mor' && $object->societe) { |
| 9781 | - $ret .= dol_htmlentities($object->societe) . ((!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : ''); |
|
| 9781 | + $ret .= dol_htmlentities($object->societe).((!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : ''); |
|
| 9782 | 9782 | } else { |
| 9783 | - $ret .= dol_htmlentities($fullname) . $addgendertxt . ((!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : ''); |
|
| 9783 | + $ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : ''); |
|
| 9784 | 9784 | } |
| 9785 | 9785 | } elseif (in_array($object->element, array('contact', 'user'))) { |
| 9786 | - $ret .= dol_htmlentities($object->getFullName($langs)) . $addgendertxt; |
|
| 9786 | + $ret .= dol_htmlentities($object->getFullName($langs)).$addgendertxt; |
|
| 9787 | 9787 | } elseif ($object->element == 'usergroup') { |
| 9788 | 9788 | $ret .= dol_htmlentities($object->name); |
| 9789 | 9789 | } elseif (in_array($object->element, array('action', 'agenda'))) { |
| 9790 | - $ret .= $object->ref . '<br>' . $object->label; |
|
| 9790 | + $ret .= $object->ref.'<br>'.$object->label; |
|
| 9791 | 9791 | } elseif (in_array($object->element, array('adherent_type'))) { |
| 9792 | 9792 | $ret .= $object->label; |
| 9793 | 9793 | } elseif ($object->element == 'ecm_directories') { |
@@ -9839,9 +9839,9 @@ discard block |
||
| 9839 | 9839 | } |
| 9840 | 9840 | |
| 9841 | 9841 | // Barcode image |
| 9842 | - $url = DOL_URL_ROOT . '/viewimage.php?modulepart=barcode&generator=' . urlencode($object->barcode_type_coder) . '&code=' . urlencode($object->barcode) . '&encoding=' . urlencode($object->barcode_type_code); |
|
| 9843 | - $out = '<!-- url barcode = ' . $url . ' -->'; |
|
| 9844 | - $out .= '<img src="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . '>'; |
|
| 9842 | + $url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code); |
|
| 9843 | + $out = '<!-- url barcode = '.$url.' -->'; |
|
| 9844 | + $out .= '<img src="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').'>'; |
|
| 9845 | 9845 | |
| 9846 | 9846 | return $out; |
| 9847 | 9847 | } |
@@ -9881,28 +9881,28 @@ discard block |
||
| 9881 | 9881 | if (!empty($object->logo)) { |
| 9882 | 9882 | if (dolIsAllowedForPreview($object->logo)) { |
| 9883 | 9883 | if ((string) $imagesize == 'mini') { |
| 9884 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs |
|
| 9884 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs |
|
| 9885 | 9885 | } elseif ((string) $imagesize == 'small') { |
| 9886 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_small'); |
|
| 9886 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small'); |
|
| 9887 | 9887 | } else { |
| 9888 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo; |
|
| 9888 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo; |
|
| 9889 | 9889 | } |
| 9890 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo; |
|
| 9890 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo; |
|
| 9891 | 9891 | } |
| 9892 | 9892 | } |
| 9893 | 9893 | $email = $object->email; |
| 9894 | 9894 | } elseif ($modulepart == 'contact') { |
| 9895 | - $dir = $conf->societe->multidir_output[$entity] . '/contact'; |
|
| 9895 | + $dir = $conf->societe->multidir_output[$entity].'/contact'; |
|
| 9896 | 9896 | if (!empty($object->photo)) { |
| 9897 | 9897 | if (dolIsAllowedForPreview($object->photo)) { |
| 9898 | 9898 | if ((string) $imagesize == 'mini') { |
| 9899 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
| 9899 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
| 9900 | 9900 | } elseif ((string) $imagesize == 'small') { |
| 9901 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
| 9901 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
| 9902 | 9902 | } else { |
| 9903 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo; |
|
| 9903 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo; |
|
| 9904 | 9904 | } |
| 9905 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo; |
|
| 9905 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo; |
|
| 9906 | 9906 | } |
| 9907 | 9907 | } |
| 9908 | 9908 | $email = $object->email; |
@@ -9912,17 +9912,17 @@ discard block |
||
| 9912 | 9912 | if (!empty($object->photo)) { |
| 9913 | 9913 | if (dolIsAllowedForPreview($object->photo)) { |
| 9914 | 9914 | if ((string) $imagesize == 'mini') { |
| 9915 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
| 9915 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
| 9916 | 9916 | } elseif ((string) $imagesize == 'small') { |
| 9917 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
| 9917 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
| 9918 | 9918 | } else { |
| 9919 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo; |
|
| 9919 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo; |
|
| 9920 | 9920 | } |
| 9921 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo; |
|
| 9921 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo; |
|
| 9922 | 9922 | } |
| 9923 | 9923 | } |
| 9924 | 9924 | if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) { |
| 9925 | - $altfile = $object->id . ".jpg"; // For backward compatibility |
|
| 9925 | + $altfile = $object->id.".jpg"; // For backward compatibility |
|
| 9926 | 9926 | } |
| 9927 | 9927 | $email = $object->email; |
| 9928 | 9928 | $capture = 'user'; |
@@ -9931,17 +9931,17 @@ discard block |
||
| 9931 | 9931 | if (!empty($object->photo)) { |
| 9932 | 9932 | if (dolIsAllowedForPreview($object->photo)) { |
| 9933 | 9933 | if ((string) $imagesize == 'mini') { |
| 9934 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
| 9934 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
| 9935 | 9935 | } elseif ((string) $imagesize == 'small') { |
| 9936 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
| 9936 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
| 9937 | 9937 | } else { |
| 9938 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo; |
|
| 9938 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; |
|
| 9939 | 9939 | } |
| 9940 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo; |
|
| 9940 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; |
|
| 9941 | 9941 | } |
| 9942 | 9942 | } |
| 9943 | 9943 | if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) { |
| 9944 | - $altfile = $object->id . ".jpg"; // For backward compatibility |
|
| 9944 | + $altfile = $object->id.".jpg"; // For backward compatibility |
|
| 9945 | 9945 | } |
| 9946 | 9946 | $email = $object->email; |
| 9947 | 9947 | $capture = 'user'; |
@@ -9967,35 +9967,35 @@ discard block |
||
| 9967 | 9967 | $ret = ''; |
| 9968 | 9968 | |
| 9969 | 9969 | if ($dir) { |
| 9970 | - if ($file && file_exists($dir . "/" . $file)) { |
|
| 9970 | + if ($file && file_exists($dir."/".$file)) { |
|
| 9971 | 9971 | if ($addlinktofullsize) { |
| 9972 | - $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity); |
|
| 9972 | + $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity); |
|
| 9973 | 9973 | if ($urladvanced) { |
| 9974 | - $ret .= '<a href="' . $urladvanced . '">'; |
|
| 9974 | + $ret .= '<a href="'.$urladvanced.'">'; |
|
| 9975 | 9975 | } else { |
| 9976 | - $ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">'; |
|
| 9976 | + $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">'; |
|
| 9977 | 9977 | } |
| 9978 | 9978 | } |
| 9979 | - $ret .= '<img alt="" class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . ' photologo' . (preg_replace('/[^a-z]/i', '_', $file)) . '" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($file) . '&cache=' . $cache . '">'; |
|
| 9979 | + $ret .= '<img alt="" class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').' photologo'.(preg_replace('/[^a-z]/i', '_', $file)).'" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">'; |
|
| 9980 | 9980 | if ($addlinktofullsize) { |
| 9981 | 9981 | $ret .= '</a>'; |
| 9982 | 9982 | } |
| 9983 | - } elseif ($altfile && file_exists($dir . "/" . $altfile)) { |
|
| 9983 | + } elseif ($altfile && file_exists($dir."/".$altfile)) { |
|
| 9984 | 9984 | if ($addlinktofullsize) { |
| 9985 | - $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity); |
|
| 9985 | + $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity); |
|
| 9986 | 9986 | if ($urladvanced) { |
| 9987 | - $ret .= '<a href="' . $urladvanced . '">'; |
|
| 9987 | + $ret .= '<a href="'.$urladvanced.'">'; |
|
| 9988 | 9988 | } else { |
| 9989 | - $ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">'; |
|
| 9989 | + $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">'; |
|
| 9990 | 9990 | } |
| 9991 | 9991 | } |
| 9992 | - $ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="Photo alt" id="photologo' . (preg_replace('/[^a-z]/i', '_', $file)) . '" class="' . $cssclass . '" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($altfile) . '&cache=' . $cache . '">'; |
|
| 9992 | + $ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="Photo alt" id="photologo'.(preg_replace('/[^a-z]/i', '_', $file)).'" class="'.$cssclass.'" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($altfile).'&cache='.$cache.'">'; |
|
| 9993 | 9993 | if ($addlinktofullsize) { |
| 9994 | 9994 | $ret .= '</a>'; |
| 9995 | 9995 | } |
| 9996 | 9996 | } else { |
| 9997 | 9997 | $nophoto = '/public/theme/common/nophoto.png'; |
| 9998 | - $defaultimg = 'identicon'; // For gravatar |
|
| 9998 | + $defaultimg = 'identicon'; // For gravatar |
|
| 9999 | 9999 | if (in_array($modulepart, array('societe', 'userphoto', 'contact', 'memberphoto'))) { // For modules that need a special image when photo not found |
| 10000 | 10000 | if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && !empty($object->morphy) && strpos($object->morphy, 'mor')) !== false) { |
| 10001 | 10001 | $nophoto = 'company'; |
@@ -10013,13 +10013,13 @@ discard block |
||
| 10013 | 10013 | if (isModEnabled('gravatar') && $email && empty($noexternsourceoverwrite)) { |
| 10014 | 10014 | // see https://gravatar.com/site/implement/images/php/ |
| 10015 | 10015 | $ret .= '<!-- Put link to gravatar -->'; |
| 10016 | - $ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" title="' . $email . ' Gravatar avatar" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="https://www.gravatar.com/avatar/' . dol_hash(strtolower(trim($email)), 'sha256', 1) . '?s=' . $width . '&d=' . $defaultimg . '">'; // gravatar need md5 hash |
|
| 10016 | + $ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" title="'.$email.' Gravatar avatar" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="https://www.gravatar.com/avatar/'.dol_hash(strtolower(trim($email)), 'sha256', 1).'?s='.$width.'&d='.$defaultimg.'">'; // gravatar need md5 hash |
|
| 10017 | 10017 | } else { |
| 10018 | 10018 | if ($nophoto == 'company') { |
| 10019 | - $ret .= '<div class="divforspanimg photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . '>' . img_picto('', 'company') . '</div>'; |
|
| 10019 | + $ret .= '<div class="divforspanimg photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'>'.img_picto('', 'company').'</div>'; |
|
| 10020 | 10020 | $ret .= '<div class="difforspanimgright"></div>'; |
| 10021 | 10021 | } else { |
| 10022 | - $ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '">'; |
|
| 10022 | + $ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">'; |
|
| 10023 | 10023 | } |
| 10024 | 10024 | } |
| 10025 | 10025 | } |
@@ -10030,15 +10030,15 @@ discard block |
||
| 10030 | 10030 | } |
| 10031 | 10031 | $ret .= '<table class="nobordernopadding centpercent">'; |
| 10032 | 10032 | if ($object->photo) { |
| 10033 | - $ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">' . $langs->trans("Delete") . '</label><br><br></td></tr>'; |
|
| 10033 | + $ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">'.$langs->trans("Delete").'</label><br><br></td></tr>'; |
|
| 10034 | 10034 | } |
| 10035 | 10035 | $ret .= '<tr><td class="tdoverflow">'; |
| 10036 | 10036 | $maxfilesizearray = getMaxFileSizeArray(); |
| 10037 | 10037 | $maxmin = $maxfilesizearray['maxmin']; |
| 10038 | 10038 | if ($maxmin > 0) { |
| 10039 | - $ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 10039 | + $ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 10040 | 10040 | } |
| 10041 | - $ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"' . ($capture ? ' capture="' . $capture . '"' : '') . '>'; |
|
| 10041 | + $ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'>'; |
|
| 10042 | 10042 | $ret .= '</td></tr>'; |
| 10043 | 10043 | $ret .= '</table>'; |
| 10044 | 10044 | } |
@@ -10092,38 +10092,38 @@ discard block |
||
| 10092 | 10092 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
| 10093 | 10093 | $sql .= ", e.label"; |
| 10094 | 10094 | } |
| 10095 | - $sql .= " FROM " . $this->db->prefix() . "usergroup as ug "; |
|
| 10095 | + $sql .= " FROM ".$this->db->prefix()."usergroup as ug "; |
|
| 10096 | 10096 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
| 10097 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid=ug.entity"; |
|
| 10097 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid=ug.entity"; |
|
| 10098 | 10098 | if ($force_entity) { |
| 10099 | - $sql .= " WHERE ug.entity IN (0, " . $force_entity . ")"; |
|
| 10099 | + $sql .= " WHERE ug.entity IN (0, ".$force_entity.")"; |
|
| 10100 | 10100 | } else { |
| 10101 | 10101 | $sql .= " WHERE ug.entity IS NOT NULL"; |
| 10102 | 10102 | } |
| 10103 | 10103 | } else { |
| 10104 | - $sql .= " WHERE ug.entity IN (0, " . $conf->entity . ")"; |
|
| 10104 | + $sql .= " WHERE ug.entity IN (0, ".$conf->entity.")"; |
|
| 10105 | 10105 | } |
| 10106 | 10106 | if (is_array($exclude) && $excludeGroups) { |
| 10107 | - $sql .= " AND ug.rowid NOT IN (" . $this->db->sanitize($excludeGroups) . ")"; |
|
| 10107 | + $sql .= " AND ug.rowid NOT IN (".$this->db->sanitize($excludeGroups).")"; |
|
| 10108 | 10108 | } |
| 10109 | 10109 | if (is_array($include) && $includeGroups) { |
| 10110 | - $sql .= " AND ug.rowid IN (" . $this->db->sanitize($includeGroups) . ")"; |
|
| 10110 | + $sql .= " AND ug.rowid IN (".$this->db->sanitize($includeGroups).")"; |
|
| 10111 | 10111 | } |
| 10112 | 10112 | $sql .= " ORDER BY ug.nom ASC"; |
| 10113 | 10113 | |
| 10114 | - dol_syslog(get_class($this) . "::select_dolgroups", LOG_DEBUG); |
|
| 10114 | + dol_syslog(get_class($this)."::select_dolgroups", LOG_DEBUG); |
|
| 10115 | 10115 | $resql = $this->db->query($sql); |
| 10116 | 10116 | if ($resql) { |
| 10117 | 10117 | // Enhance with select2 |
| 10118 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 10118 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 10119 | 10119 | |
| 10120 | - $out .= '<select class="flat minwidth200' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>'; |
|
| 10120 | + $out .= '<select class="flat minwidth200'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>'; |
|
| 10121 | 10121 | |
| 10122 | 10122 | $num = $this->db->num_rows($resql); |
| 10123 | 10123 | $i = 0; |
| 10124 | 10124 | if ($num) { |
| 10125 | 10125 | if ($show_empty && !$multiple) { |
| 10126 | - $out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '> </option>' . "\n"; |
|
| 10126 | + $out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'> </option>'."\n"; |
|
| 10127 | 10127 | } |
| 10128 | 10128 | |
| 10129 | 10129 | while ($i < $num) { |
@@ -10136,11 +10136,11 @@ discard block |
||
| 10136 | 10136 | $label = $obj->name; |
| 10137 | 10137 | $labelhtml = $obj->name; |
| 10138 | 10138 | if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1) { |
| 10139 | - $label .= " (" . $obj->label . ")"; |
|
| 10140 | - $labelhtml .= ' <span class="opacitymedium">(' . $obj->label . ')</span>'; |
|
| 10139 | + $label .= " (".$obj->label.")"; |
|
| 10140 | + $labelhtml .= ' <span class="opacitymedium">('.$obj->label.')</span>'; |
|
| 10141 | 10141 | } |
| 10142 | 10142 | |
| 10143 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 10143 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 10144 | 10144 | if ($disableline) { |
| 10145 | 10145 | $out .= ' disabled'; |
| 10146 | 10146 | } |
@@ -10156,9 +10156,9 @@ discard block |
||
| 10156 | 10156 | } |
| 10157 | 10157 | } else { |
| 10158 | 10158 | if ($show_empty) { |
| 10159 | - $out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '></option>' . "\n"; |
|
| 10159 | + $out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'></option>'."\n"; |
|
| 10160 | 10160 | } |
| 10161 | - $out .= '<option value="" disabled>' . $langs->trans("NoUserGroupDefined") . '</option>'; |
|
| 10161 | + $out .= '<option value="" disabled>'.$langs->trans("NoUserGroupDefined").'</option>'; |
|
| 10162 | 10162 | } |
| 10163 | 10163 | $out .= '</select>'; |
| 10164 | 10164 | |
@@ -10207,25 +10207,25 @@ discard block |
||
| 10207 | 10207 | $out = ''; |
| 10208 | 10208 | |
| 10209 | 10209 | if (!empty($conf->use_javascript_ajax)) { |
| 10210 | - $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="' . $cssclass . 's" name="' . $cssclass . 's" class="checkallactions"></div>'; |
|
| 10210 | + $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="'.$cssclass.'s" name="'.$cssclass.'s" class="checkallactions"></div>'; |
|
| 10211 | 10211 | } |
| 10212 | - $out .= '<script nonce="' . getNonce() . '"> |
|
| 10212 | + $out .= '<script nonce="'.getNonce().'"> |
|
| 10213 | 10213 | $(document).ready(function() { |
| 10214 | - $("#' . $cssclass . 's").click(function() { |
|
| 10214 | + $("#' . $cssclass.'s").click(function() { |
|
| 10215 | 10215 | if($(this).is(\':checked\')){ |
| 10216 | - console.log("We check all ' . $cssclass . ' and trigger the change method"); |
|
| 10217 | - $(".' . $cssclass . '").prop(\'checked\', true).trigger(\'change\'); |
|
| 10216 | + console.log("We check all ' . $cssclass.' and trigger the change method"); |
|
| 10217 | + $(".' . $cssclass.'").prop(\'checked\', true).trigger(\'change\'); |
|
| 10218 | 10218 | } |
| 10219 | 10219 | else |
| 10220 | 10220 | { |
| 10221 | 10221 | console.log("We uncheck all"); |
| 10222 | - $(".' . $cssclass . '").prop(\'checked\', false).trigger(\'change\'); |
|
| 10222 | + $(".' . $cssclass.'").prop(\'checked\', false).trigger(\'change\'); |
|
| 10223 | 10223 | }' . "\n"; |
| 10224 | 10224 | if ($calljsfunction) { |
| 10225 | - $out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "' . $massactionname . '", "' . $cssclass . '"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }'; |
|
| 10225 | + $out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "'.$massactionname.'", "'.$cssclass.'"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }'; |
|
| 10226 | 10226 | } |
| 10227 | 10227 | $out .= ' }); |
| 10228 | - $(".' . $cssclass . '").change(function() { |
|
| 10228 | + $(".' . $cssclass.'").change(function() { |
|
| 10229 | 10229 | $(this).closest("tr").toggleClass("highlight", this.checked); |
| 10230 | 10230 | }); |
| 10231 | 10231 | }); |
@@ -10270,67 +10270,67 @@ discard block |
||
| 10270 | 10270 | global $langs, $user; |
| 10271 | 10271 | |
| 10272 | 10272 | $out = ''; |
| 10273 | - $sql = "SELECT rowid, label FROM " . $this->db->prefix() . "c_exp_tax_cat WHERE active = 1"; |
|
| 10274 | - $sql .= " AND entity IN (0," . getEntity('exp_tax_cat') . ")"; |
|
| 10273 | + $sql = "SELECT rowid, label FROM ".$this->db->prefix()."c_exp_tax_cat WHERE active = 1"; |
|
| 10274 | + $sql .= " AND entity IN (0,".getEntity('exp_tax_cat').")"; |
|
| 10275 | 10275 | if (!empty($excludeid)) { |
| 10276 | - $sql .= " AND rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeid)) . ")"; |
|
| 10276 | + $sql .= " AND rowid NOT IN (".$this->db->sanitize(implode(',', $excludeid)).")"; |
|
| 10277 | 10277 | } |
| 10278 | 10278 | $sql .= " ORDER BY label"; |
| 10279 | 10279 | |
| 10280 | 10280 | $resql = $this->db->query($sql); |
| 10281 | 10281 | if ($resql) { |
| 10282 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp maxwidth200">'; |
|
| 10282 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp maxwidth200">'; |
|
| 10283 | 10283 | if ($useempty) { |
| 10284 | 10284 | $out .= '<option value="0"> </option>'; |
| 10285 | 10285 | } |
| 10286 | 10286 | |
| 10287 | 10287 | while ($obj = $this->db->fetch_object($resql)) { |
| 10288 | - $out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . $langs->trans($obj->label) . '</option>'; |
|
| 10288 | + $out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>'; |
|
| 10289 | 10289 | } |
| 10290 | 10290 | $out .= '</select>'; |
| 10291 | - $out .= ajax_combobox('select_' . $htmlname); |
|
| 10291 | + $out .= ajax_combobox('select_'.$htmlname); |
|
| 10292 | 10292 | |
| 10293 | 10293 | if (!empty($htmlname) && $user->admin && $info_admin) { |
| 10294 | - $out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
| 10294 | + $out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
| 10295 | 10295 | } |
| 10296 | 10296 | |
| 10297 | 10297 | if (!empty($target)) { |
| 10298 | - $sql = "SELECT c.id FROM " . $this->db->prefix() . "c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1"; |
|
| 10298 | + $sql = "SELECT c.id FROM ".$this->db->prefix()."c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1"; |
|
| 10299 | 10299 | $resql = $this->db->query($sql); |
| 10300 | 10300 | if ($resql) { |
| 10301 | 10301 | if ($this->db->num_rows($resql) > 0) { |
| 10302 | 10302 | $obj = $this->db->fetch_object($resql); |
| 10303 | - $out .= '<script nonce="' . getNonce() . '"> |
|
| 10303 | + $out .= '<script nonce="'.getNonce().'"> |
|
| 10304 | 10304 | $(function() { |
| 10305 | - $("select[name=' . $target . ']").on("change", function() { |
|
| 10305 | + $("select[name=' . $target.']").on("change", function() { |
|
| 10306 | 10306 | var current_val = $(this).val(); |
| 10307 | - if (current_val == ' . $obj->id . ') {'; |
|
| 10307 | + if (current_val == ' . $obj->id.') {'; |
|
| 10308 | 10308 | if (!empty($default_selected) || !empty($selected)) { |
| 10309 | - $out .= '$("select[name=' . $htmlname . ']").val("' . ($default_selected > 0 ? $default_selected : $selected) . '");'; |
|
| 10309 | + $out .= '$("select[name='.$htmlname.']").val("'.($default_selected > 0 ? $default_selected : $selected).'");'; |
|
| 10310 | 10310 | } |
| 10311 | 10311 | |
| 10312 | 10312 | $out .= ' |
| 10313 | - $("select[name=' . $htmlname . ']").change(); |
|
| 10313 | + $("select[name=' . $htmlname.']").change(); |
|
| 10314 | 10314 | } |
| 10315 | 10315 | }); |
| 10316 | 10316 | |
| 10317 | - $("select[name=' . $htmlname . ']").change(function() { |
|
| 10317 | + $("select[name=' . $htmlname.']").change(function() { |
|
| 10318 | 10318 | |
| 10319 | - if ($("select[name=' . $target . ']").val() == ' . $obj->id . ') { |
|
| 10319 | + if ($("select[name=' . $target.']").val() == '.$obj->id.') { |
|
| 10320 | 10320 | // get price of kilometer to fill the unit price |
| 10321 | 10321 | $.ajax({ |
| 10322 | 10322 | method: "POST", |
| 10323 | 10323 | dataType: "json", |
| 10324 | - data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken() . '\' }, |
|
| 10325 | - url: "' . (DOL_URL_ROOT . '/expensereport/ajax/ajaxik.php?' . implode('&', $params)) . '", |
|
| 10324 | + data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken().'\' }, |
|
| 10325 | + url: "' . (DOL_URL_ROOT.'/expensereport/ajax/ajaxik.php?'.implode('&', $params)).'", |
|
| 10326 | 10326 | }).done(function( data, textStatus, jqXHR ) { |
| 10327 | 10327 | console.log(data); |
| 10328 | 10328 | if (typeof data.up != "undefined") { |
| 10329 | 10329 | $("input[name=value_unit]").val(data.up); |
| 10330 | - $("select[name=' . $htmlname . ']").attr("title", data.title); |
|
| 10330 | + $("select[name=' . $htmlname.']").attr("title", data.title); |
|
| 10331 | 10331 | } else { |
| 10332 | 10332 | $("input[name=value_unit]").val(""); |
| 10333 | - $("select[name=' . $htmlname . ']").attr("title", ""); |
|
| 10333 | + $("select[name=' . $htmlname.']").attr("title", ""); |
|
| 10334 | 10334 | } |
| 10335 | 10335 | }); |
| 10336 | 10336 | } |
@@ -10360,18 +10360,18 @@ discard block |
||
| 10360 | 10360 | global $conf, $langs; |
| 10361 | 10361 | |
| 10362 | 10362 | $out = ''; |
| 10363 | - $sql = "SELECT rowid, range_ik FROM " . $this->db->prefix() . "c_exp_tax_range"; |
|
| 10364 | - $sql .= " WHERE entity = " . $conf->entity . " AND active = 1"; |
|
| 10363 | + $sql = "SELECT rowid, range_ik FROM ".$this->db->prefix()."c_exp_tax_range"; |
|
| 10364 | + $sql .= " WHERE entity = ".$conf->entity." AND active = 1"; |
|
| 10365 | 10365 | |
| 10366 | 10366 | $resql = $this->db->query($sql); |
| 10367 | 10367 | if ($resql) { |
| 10368 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">'; |
|
| 10368 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">'; |
|
| 10369 | 10369 | if ($useempty) { |
| 10370 | 10370 | $out .= '<option value="0"></option>'; |
| 10371 | 10371 | } |
| 10372 | 10372 | |
| 10373 | 10373 | while ($obj = $this->db->fetch_object($resql)) { |
| 10374 | - $out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . price($obj->range_ik, 0, $langs, 1, 0) . '</option>'; |
|
| 10374 | + $out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.price($obj->range_ik, 0, $langs, 1, 0).'</option>'; |
|
| 10375 | 10375 | } |
| 10376 | 10376 | $out .= '</select>'; |
| 10377 | 10377 | } else { |
@@ -10402,12 +10402,12 @@ discard block |
||
| 10402 | 10402 | |
| 10403 | 10403 | $resql = $this->db->query($sql); |
| 10404 | 10404 | if ($resql) { |
| 10405 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">'; |
|
| 10405 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">'; |
|
| 10406 | 10406 | if ($useempty) { |
| 10407 | 10407 | $out .= '<option value="0"></option>'; |
| 10408 | 10408 | } |
| 10409 | 10409 | if ($allchoice) { |
| 10410 | - $out .= '<option value="-1">' . $langs->trans('AllExpenseReport') . '</option>'; |
|
| 10410 | + $out .= '<option value="-1">'.$langs->trans('AllExpenseReport').'</option>'; |
|
| 10411 | 10411 | } |
| 10412 | 10412 | |
| 10413 | 10413 | $field = 'code'; |
@@ -10417,7 +10417,7 @@ discard block |
||
| 10417 | 10417 | |
| 10418 | 10418 | while ($obj = $this->db->fetch_object($resql)) { |
| 10419 | 10419 | $key = $langs->trans($obj->code); |
| 10420 | - $out .= '<option ' . ($selected == $obj->{$field} ? 'selected="selected"' : '') . ' value="' . $obj->{$field} . '">' . ($key != $obj->code ? $key : $obj->label) . '</option>'; |
|
| 10420 | + $out .= '<option '.($selected == $obj->{$field} ? 'selected="selected"' : '').' value="'.$obj->{$field}.'">'.($key != $obj->code ? $key : $obj->label).'</option>'; |
|
| 10421 | 10421 | } |
| 10422 | 10422 | $out .= '</select>'; |
| 10423 | 10423 | |
@@ -10451,7 +10451,7 @@ discard block |
||
| 10451 | 10451 | { |
| 10452 | 10452 | global $user, $conf, $langs; |
| 10453 | 10453 | |
| 10454 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 10454 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 10455 | 10455 | |
| 10456 | 10456 | if (is_null($usertofilter)) { |
| 10457 | 10457 | $usertofilter = $user; |
@@ -10475,10 +10475,10 @@ discard block |
||
| 10475 | 10475 | $sql = "SELECT f.rowid, f.ref as fref, 'nolabel' as flabel, p.rowid as pid, f.ref, |
| 10476 | 10476 | p.title, p.fk_soc, p.fk_statut, p.public,"; |
| 10477 | 10477 | $sql .= ' s.nom as name'; |
| 10478 | - $sql .= ' FROM ' . $this->db->prefix() . 'projet as p'; |
|
| 10479 | - $sql .= ' LEFT JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc,'; |
|
| 10480 | - $sql .= ' ' . $this->db->prefix() . 'facture as f'; |
|
| 10481 | - $sql .= " WHERE p.entity IN (" . getEntity('project') . ")"; |
|
| 10478 | + $sql .= ' FROM '.$this->db->prefix().'projet as p'; |
|
| 10479 | + $sql .= ' LEFT JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc,'; |
|
| 10480 | + $sql .= ' '.$this->db->prefix().'facture as f'; |
|
| 10481 | + $sql .= " WHERE p.entity IN (".getEntity('project').")"; |
|
| 10482 | 10482 | $sql .= " AND f.fk_projet = p.rowid AND f.fk_statut=0"; //Brouillons seulement |
| 10483 | 10483 | //if ($projectsListId) $sql.= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")"; |
| 10484 | 10484 | //if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)"; |
@@ -10489,14 +10489,14 @@ discard block |
||
| 10489 | 10489 | if ($resql) { |
| 10490 | 10490 | // Use select2 selector |
| 10491 | 10491 | if (!empty($conf->use_javascript_ajax)) { |
| 10492 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 10492 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 10493 | 10493 | $comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus); |
| 10494 | 10494 | $out .= $comboenhancement; |
| 10495 | 10495 | $morecss = 'minwidth200imp maxwidth500'; |
| 10496 | 10496 | } |
| 10497 | 10497 | |
| 10498 | 10498 | if (empty($option_only)) { |
| 10499 | - $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 10499 | + $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 10500 | 10500 | } |
| 10501 | 10501 | if (!empty($show_empty)) { |
| 10502 | 10502 | $out .= '<option value="0" class="optiongrey">'; |
@@ -10526,33 +10526,33 @@ discard block |
||
| 10526 | 10526 | if ($showproject == 'all') { |
| 10527 | 10527 | $labeltoshow .= dol_trunc($obj->ref, 18); // Invoice ref |
| 10528 | 10528 | if ($obj->name) { |
| 10529 | - $labeltoshow .= ' - ' . $obj->name; // Soc name |
|
| 10529 | + $labeltoshow .= ' - '.$obj->name; // Soc name |
|
| 10530 | 10530 | } |
| 10531 | 10531 | |
| 10532 | 10532 | $disabled = 0; |
| 10533 | 10533 | if ($obj->fk_statut == Project::STATUS_DRAFT) { |
| 10534 | 10534 | $disabled = 1; |
| 10535 | - $labeltoshow .= ' - ' . $langs->trans("Draft"); |
|
| 10535 | + $labeltoshow .= ' - '.$langs->trans("Draft"); |
|
| 10536 | 10536 | } elseif ($obj->fk_statut == Project::STATUS_CLOSED) { |
| 10537 | 10537 | if ($discard_closed == 2) { |
| 10538 | 10538 | $disabled = 1; |
| 10539 | 10539 | } |
| 10540 | - $labeltoshow .= ' - ' . $langs->trans("Closed"); |
|
| 10540 | + $labeltoshow .= ' - '.$langs->trans("Closed"); |
|
| 10541 | 10541 | } elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) { |
| 10542 | 10542 | $disabled = 1; |
| 10543 | - $labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany"); |
|
| 10543 | + $labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany"); |
|
| 10544 | 10544 | } |
| 10545 | 10545 | } |
| 10546 | 10546 | |
| 10547 | 10547 | if (!empty($selected) && $selected == $obj->rowid) { |
| 10548 | - $out .= '<option value="' . $obj->rowid . '" selected'; |
|
| 10548 | + $out .= '<option value="'.$obj->rowid.'" selected'; |
|
| 10549 | 10549 | //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled |
| 10550 | - $out .= '>' . $labeltoshow . '</option>'; |
|
| 10550 | + $out .= '>'.$labeltoshow.'</option>'; |
|
| 10551 | 10551 | } else { |
| 10552 | 10552 | if ($hideunselectables && $disabled && ($selected != $obj->rowid)) { |
| 10553 | 10553 | $resultat = ''; |
| 10554 | 10554 | } else { |
| 10555 | - $resultat = '<option value="' . $obj->rowid . '"'; |
|
| 10555 | + $resultat = '<option value="'.$obj->rowid.'"'; |
|
| 10556 | 10556 | if ($disabled) { |
| 10557 | 10557 | $resultat .= ' disabled'; |
| 10558 | 10558 | } |
@@ -10604,22 +10604,22 @@ discard block |
||
| 10604 | 10604 | |
| 10605 | 10605 | $sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc'; |
| 10606 | 10606 | //$sql.= ', el.fk_source'; |
| 10607 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as f'; |
|
| 10608 | - $sql .= " WHERE f.entity IN (" . getEntity('invoice') . ")"; |
|
| 10607 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'facture_rec as f'; |
|
| 10608 | + $sql .= " WHERE f.entity IN (".getEntity('invoice').")"; |
|
| 10609 | 10609 | $sql .= " ORDER BY f.titre ASC"; |
| 10610 | 10610 | |
| 10611 | 10611 | $resql = $this->db->query($sql); |
| 10612 | 10612 | if ($resql) { |
| 10613 | 10613 | // Use select2 selector |
| 10614 | 10614 | if (!empty($conf->use_javascript_ajax)) { |
| 10615 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 10615 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 10616 | 10616 | $comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus); |
| 10617 | 10617 | $out .= $comboenhancement; |
| 10618 | 10618 | $morecss = 'minwidth200imp maxwidth500'; |
| 10619 | 10619 | } |
| 10620 | 10620 | |
| 10621 | 10621 | if (empty($option_only)) { |
| 10622 | - $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 10622 | + $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 10623 | 10623 | } |
| 10624 | 10624 | if (!empty($show_empty)) { |
| 10625 | 10625 | $out .= '<option value="0" class="optiongrey">'; |
@@ -10638,19 +10638,19 @@ discard block |
||
| 10638 | 10638 | $disabled = 0; |
| 10639 | 10639 | if (!empty($obj->suspended)) { |
| 10640 | 10640 | $disabled = 1; |
| 10641 | - $labeltoshow .= ' - ' . $langs->trans("Closed"); |
|
| 10641 | + $labeltoshow .= ' - '.$langs->trans("Closed"); |
|
| 10642 | 10642 | } |
| 10643 | 10643 | |
| 10644 | 10644 | |
| 10645 | 10645 | if (!empty($selected) && $selected == $obj->rowid) { |
| 10646 | - $out .= '<option value="' . $obj->rowid . '" selected'; |
|
| 10646 | + $out .= '<option value="'.$obj->rowid.'" selected'; |
|
| 10647 | 10647 | //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled |
| 10648 | - $out .= '>' . $labeltoshow . '</option>'; |
|
| 10648 | + $out .= '>'.$labeltoshow.'</option>'; |
|
| 10649 | 10649 | } else { |
| 10650 | 10650 | if ($disabled && ($selected != $obj->rowid)) { |
| 10651 | 10651 | $resultat = ''; |
| 10652 | 10652 | } else { |
| 10653 | - $resultat = '<option value="' . $obj->rowid . '"'; |
|
| 10653 | + $resultat = '<option value="'.$obj->rowid.'"'; |
|
| 10654 | 10654 | if ($disabled) { |
| 10655 | 10655 | $resultat .= ' disabled'; |
| 10656 | 10656 | } |
@@ -10690,14 +10690,14 @@ discard block |
||
| 10690 | 10690 | global $langs; |
| 10691 | 10691 | |
| 10692 | 10692 | if ($search_component_params_hidden != '' && !preg_match('/^\(.*\)$/', $search_component_params_hidden)) { // If $search_component_params_hidden does not start and end with () |
| 10693 | - $search_component_params_hidden = '(' . $search_component_params_hidden . ')'; |
|
| 10693 | + $search_component_params_hidden = '('.$search_component_params_hidden.')'; |
|
| 10694 | 10694 | } |
| 10695 | 10695 | |
| 10696 | 10696 | $ret = ''; |
| 10697 | 10697 | |
| 10698 | 10698 | $ret .= '<div class="divadvancedsearchfieldcomp inline-block">'; |
| 10699 | 10699 | $ret .= '<a href="#" class="dropdownsearch-toggle unsetcolor">'; |
| 10700 | - $ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="' . dol_escape_htmltag($langs->trans("Filters")) . '" id="idsubimgproductdistribution"></span>'; |
|
| 10700 | + $ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("Filters")).'" id="idsubimgproductdistribution"></span>'; |
|
| 10701 | 10701 | $ret .= '</a>'; |
| 10702 | 10702 | |
| 10703 | 10703 | $ret .= '<div class="divadvancedsearchfieldcompinput inline-block minwidth500 maxwidth300onsmartphone">'; |
@@ -10723,8 +10723,8 @@ discard block |
||
| 10723 | 10723 | include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
| 10724 | 10724 | $searchtags = removeGlobalParenthesis($searchtags); |
| 10725 | 10725 | |
| 10726 | - $ret .= '<span class="marginleftonlyshort valignmiddle tagsearch" data-ufilterid="'.($tmpkey+1).'" data-ufilter="'.dol_escape_htmltag($tmpval).'">'; |
|
| 10727 | - $ret .= '<span class="tagsearchdelete select2-selection__choice__remove" data-ufilterid="'.($tmpkey+1).'">x</span> '; |
|
| 10726 | + $ret .= '<span class="marginleftonlyshort valignmiddle tagsearch" data-ufilterid="'.($tmpkey + 1).'" data-ufilter="'.dol_escape_htmltag($tmpval).'">'; |
|
| 10727 | + $ret .= '<span class="tagsearchdelete select2-selection__choice__remove" data-ufilterid="'.($tmpkey + 1).'">x</span> '; |
|
| 10728 | 10728 | $ret .= dol_escape_htmltag($searchtags); |
| 10729 | 10729 | $ret .= '</span>'; |
| 10730 | 10730 | } |
@@ -10741,29 +10741,29 @@ discard block |
||
| 10741 | 10741 | $ret .= '<input type="hidden" name="show_search_component_params_hidden" value="1">'; |
| 10742 | 10742 | } |
| 10743 | 10743 | $ret .= "<!-- We store the full Universal Search String into this field. For example: (t.ref:like:'SO-%') AND ((t.ref:like:'CO-%') OR (t.ref:like:'AA%')) -->"; |
| 10744 | - $ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="' . dol_escape_htmltag($search_component_params_hidden) . '">'; |
|
| 10744 | + $ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="'.dol_escape_htmltag($search_component_params_hidden).'">'; |
|
| 10745 | 10745 | // $ret .= "<!-- sql= ".forgeSQLFromUniversalSearchCriteria($search_component_params_hidden, $errormessage)." -->"; |
| 10746 | 10746 | |
| 10747 | 10747 | // For compatibility with forms that show themself the search criteria in addition of this component, we output these fields |
| 10748 | 10748 | foreach ($arrayofcriterias as $criteria) { |
| 10749 | 10749 | foreach ($criteria as $criteriafamilykey => $criteriafamilyval) { |
| 10750 | - if (in_array('search_' . $criteriafamilykey, $arrayofinputfieldsalreadyoutput)) { |
|
| 10750 | + if (in_array('search_'.$criteriafamilykey, $arrayofinputfieldsalreadyoutput)) { |
|
| 10751 | 10751 | continue; |
| 10752 | 10752 | } |
| 10753 | 10753 | if (in_array($criteriafamilykey, array('rowid', 'ref_ext', 'entity', 'extraparams'))) { |
| 10754 | 10754 | continue; |
| 10755 | 10755 | } |
| 10756 | 10756 | if (in_array($criteriafamilyval['type'], array('date', 'datetime', 'timestamp'))) { |
| 10757 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_start">'; |
|
| 10758 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startyear">'; |
|
| 10759 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startmonth">'; |
|
| 10760 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startday">'; |
|
| 10761 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_end">'; |
|
| 10762 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endyear">'; |
|
| 10763 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endmonth">'; |
|
| 10764 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endday">'; |
|
| 10757 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_start">'; |
|
| 10758 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startyear">'; |
|
| 10759 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startmonth">'; |
|
| 10760 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startday">'; |
|
| 10761 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_end">'; |
|
| 10762 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endyear">'; |
|
| 10763 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endmonth">'; |
|
| 10764 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endday">'; |
|
| 10765 | 10765 | } else { |
| 10766 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '">'; |
|
| 10766 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'">'; |
|
| 10767 | 10767 | } |
| 10768 | 10768 | } |
| 10769 | 10769 | } |
@@ -10771,7 +10771,7 @@ discard block |
||
| 10771 | 10771 | $ret .= '</div>'; |
| 10772 | 10772 | |
| 10773 | 10773 | $ret .= "<!-- Field to enter a generic filter string: t.ref:like:'SO-%', t.date_creation:<:'20160101', t.date_creation:<:'2016-01-01 12:30:00', t.nature:is:NULL, t.field2:isnot:NULL -->\n"; |
| 10774 | - $ret .= '<input type="text" placeholder="' . $langs->trans("Filters") . '" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">'; |
|
| 10774 | + $ret .= '<input type="text" placeholder="'.$langs->trans("Filters").'" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">'; |
|
| 10775 | 10775 | |
| 10776 | 10776 | $ret .= '</div>'; |
| 10777 | 10777 | $ret .= '</div>'; |
@@ -10824,7 +10824,7 @@ discard block |
||
| 10824 | 10824 | |
| 10825 | 10825 | $TModels = array(); |
| 10826 | 10826 | |
| 10827 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
| 10827 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
|
| 10828 | 10828 | $formmail = new FormMail($this->db); |
| 10829 | 10829 | $result = $formmail->fetchAllEMailTemplate($modelType, $user, $langs); |
| 10830 | 10830 | |
@@ -10837,17 +10837,17 @@ discard block |
||
| 10837 | 10837 | } |
| 10838 | 10838 | } |
| 10839 | 10839 | |
| 10840 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'model_mail" name="' . $prefix . 'model_mail">'; |
|
| 10840 | + $retstring .= '<select class="flat" id="select_'.$prefix.'model_mail" name="'.$prefix.'model_mail">'; |
|
| 10841 | 10841 | |
| 10842 | 10842 | foreach ($TModels as $id_model => $label_model) { |
| 10843 | - $retstring .= '<option value="' . $id_model . '"'; |
|
| 10844 | - $retstring .= ">" . $label_model . "</option>"; |
|
| 10843 | + $retstring .= '<option value="'.$id_model.'"'; |
|
| 10844 | + $retstring .= ">".$label_model."</option>"; |
|
| 10845 | 10845 | } |
| 10846 | 10846 | |
| 10847 | 10847 | $retstring .= "</select>"; |
| 10848 | 10848 | |
| 10849 | 10849 | if ($addjscombo) { |
| 10850 | - $retstring .= ajax_combobox('select_' . $prefix . 'model_mail'); |
|
| 10850 | + $retstring .= ajax_combobox('select_'.$prefix.'model_mail'); |
|
| 10851 | 10851 | } |
| 10852 | 10852 | |
| 10853 | 10853 | return $retstring; |
@@ -10898,16 +10898,16 @@ discard block |
||
| 10898 | 10898 | |
| 10899 | 10899 | foreach ($buttons as $button) { |
| 10900 | 10900 | $addclass = empty($button['addclass']) ? '' : $button['addclass']; |
| 10901 | - $retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->trans($button['label_key'])) . '">'; |
|
| 10901 | + $retstring .= '<input type="submit" class="button button-'.$button['name'].($morecss ? ' '.$morecss : '').' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->trans($button['label_key'])).'">'; |
|
| 10902 | 10902 | } |
| 10903 | 10903 | $retstring .= $withoutdiv ? '' : '</div>'; |
| 10904 | 10904 | |
| 10905 | 10905 | if ($dol_openinpopup) { |
| 10906 | - $retstring .= '<!-- buttons are shown into a $dol_openinpopup=' . $dol_openinpopup . ' context, so we enable the close of dialog on cancel -->' . "\n"; |
|
| 10907 | - $retstring .= '<script nonce="' . getNonce() . '">'; |
|
| 10906 | + $retstring .= '<!-- buttons are shown into a $dol_openinpopup='.$dol_openinpopup.' context, so we enable the close of dialog on cancel -->'."\n"; |
|
| 10907 | + $retstring .= '<script nonce="'.getNonce().'">'; |
|
| 10908 | 10908 | $retstring .= 'jQuery(".button-cancel").click(function(e) { |
| 10909 | - e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup . '\'); |
|
| 10910 | - window.parent.jQuery(\'#idfordialog' . $dol_openinpopup . '\').dialog(\'close\'); |
|
| 10909 | + e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup.'\'); |
|
| 10910 | + window.parent.jQuery(\'#idfordialog' . $dol_openinpopup.'\').dialog(\'close\'); |
|
| 10911 | 10911 | });'; |
| 10912 | 10912 | $retstring .= '</script>'; |
| 10913 | 10913 | } |
@@ -10936,7 +10936,7 @@ discard block |
||
| 10936 | 10936 | dol_syslog(__METHOD__, LOG_DEBUG); |
| 10937 | 10937 | |
| 10938 | 10938 | $sql = "SELECT rowid, code, label as label"; |
| 10939 | - $sql .= " FROM " . MAIN_DB_PREFIX . 'c_invoice_subtype'; |
|
| 10939 | + $sql .= " FROM ".MAIN_DB_PREFIX.'c_invoice_subtype'; |
|
| 10940 | 10940 | $sql .= " WHERE active = 1"; |
| 10941 | 10941 | |
| 10942 | 10942 | $resql = $this->db->query($sql); |
@@ -10947,7 +10947,7 @@ discard block |
||
| 10947 | 10947 | $obj = $this->db->fetch_object($resql); |
| 10948 | 10948 | |
| 10949 | 10949 | // If translation exists, we use it, otherwise we take the default wording |
| 10950 | - $label = ($langs->trans("InvoiceSubtype" . $obj->rowid) != "InvoiceSubtype" . $obj->rowid) ? $langs->trans("InvoiceSubtype" . $obj->rowid) : (($obj->label != '-') ? $obj->label : ''); |
|
| 10950 | + $label = ($langs->trans("InvoiceSubtype".$obj->rowid) != "InvoiceSubtype".$obj->rowid) ? $langs->trans("InvoiceSubtype".$obj->rowid) : (($obj->label != '-') ? $obj->label : ''); |
|
| 10951 | 10951 | $this->cache_invoice_subtype[$obj->rowid]['rowid'] = $obj->rowid; |
| 10952 | 10952 | $this->cache_invoice_subtype[$obj->rowid]['code'] = $obj->code; |
| 10953 | 10953 | $this->cache_invoice_subtype[$obj->rowid]['label'] = $label; |
@@ -10979,18 +10979,18 @@ discard block |
||
| 10979 | 10979 | global $langs, $user; |
| 10980 | 10980 | |
| 10981 | 10981 | $out = ''; |
| 10982 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 10982 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 10983 | 10983 | |
| 10984 | 10984 | $this->load_cache_invoice_subtype(); |
| 10985 | 10985 | |
| 10986 | - $out .= '<select id="' . $htmlname . '" class="flat selectsubtype' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 10986 | + $out .= '<select id="'.$htmlname.'" class="flat selectsubtype'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 10987 | 10987 | if ($addempty) { |
| 10988 | 10988 | $out .= '<option value="0"> </option>'; |
| 10989 | 10989 | } |
| 10990 | 10990 | |
| 10991 | 10991 | foreach ($this->cache_invoice_subtype as $rowid => $subtype) { |
| 10992 | 10992 | $label = $subtype['label']; |
| 10993 | - $out .= '<option value="' . $subtype['rowid'] . '"'; |
|
| 10993 | + $out .= '<option value="'.$subtype['rowid'].'"'; |
|
| 10994 | 10994 | if ($selected == $subtype['rowid']) { |
| 10995 | 10995 | $out .= ' selected="selected"'; |
| 10996 | 10996 | } |
@@ -8171,7 +8171,9 @@ |
||
| 8171 | 8171 | |
| 8172 | 8172 | $oldValueForShowOnCombobox = 0; |
| 8173 | 8173 | foreach ($objecttmp->fields as $fieldK => $fielV) { |
| 8174 | - if (!$fielV['showoncombobox'] || empty($objecttmp->$fieldK)) continue; |
|
| 8174 | + if (!$fielV['showoncombobox'] || empty($objecttmp->$fieldK)) { |
|
| 8175 | + continue; |
|
| 8176 | + } |
|
| 8175 | 8177 | |
| 8176 | 8178 | if (!$oldValueForShowOnCombobox) { |
| 8177 | 8179 | $selected_input_value = ''; |
@@ -29,15 +29,15 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | // Load Dolibarr environment |
| 31 | 31 | require '../main.inc.php'; |
| 32 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; |
|
| 33 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; |
|
| 34 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
| 35 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php'; |
|
| 36 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_skill.lib.php'; |
|
| 32 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; |
|
| 33 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
|
| 34 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
| 35 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/skill.class.php'; |
|
| 36 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_skill.lib.php'; |
|
| 37 | 37 | |
| 38 | 38 | |
| 39 | 39 | // Load translation files required by the page |
| 40 | -$langs->loadLangs(array('hrm', 'other', 'products')); // why products? |
|
| 40 | +$langs->loadLangs(array('hrm', 'other', 'products')); // why products? |
|
| 41 | 41 | |
| 42 | 42 | // Get parameters |
| 43 | 43 | $id = GETPOSTINT('id'); |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'skillcard'; // To manage different context of search |
| 49 | 49 | $backtopage = GETPOST('backtopage', 'alpha'); |
| 50 | 50 | $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); |
| 51 | -$lineid = GETPOSTINT('lineid'); |
|
| 51 | +$lineid = GETPOSTINT('lineid'); |
|
| 52 | 52 | |
| 53 | 53 | // Initialize technical objects |
| 54 | 54 | $object = new Skill($db); |
@@ -66,8 +66,8 @@ discard block |
||
| 66 | 66 | $search_all = GETPOST("search_all", 'alpha'); |
| 67 | 67 | $search = array(); |
| 68 | 68 | foreach ($object->fields as $key => $val) { |
| 69 | - if (GETPOST('search_' . $key, 'alpha')) { |
|
| 70 | - $search[$key] = GETPOST('search_' . $key, 'alpha'); |
|
| 69 | + if (GETPOST('search_'.$key, 'alpha')) { |
|
| 70 | + $search[$key] = GETPOST('search_'.$key, 'alpha'); |
|
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | |
@@ -76,13 +76,13 @@ discard block |
||
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | // Load object |
| 79 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. |
|
| 79 | +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. |
|
| 80 | 80 | |
| 81 | 81 | // Permissions |
| 82 | 82 | $permissiontoread = $user->hasRight('hrm', 'all', 'read'); |
| 83 | 83 | $permissiontoadd = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
| 84 | 84 | $permissiontodelete = $user->hasRight('hrm', 'all', 'delete'); |
| 85 | -$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/skill'; |
|
| 85 | +$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1].'/skill'; |
|
| 86 | 86 | |
| 87 | 87 | // Security check (enable the most restrictive one) |
| 88 | 88 | //if ($user->socid > 0) accessforbidden(); |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { |
| 120 | 120 | $backtopage = $backurlforlist; |
| 121 | 121 | } else { |
| 122 | - $backtopage = DOL_URL_ROOT.'/hrm/skill_card.php?id=' . ($id > 0 ? $id : '__ID__'); |
|
| 122 | + $backtopage = DOL_URL_ROOT.'/hrm/skill_card.php?id='.($id > 0 ? $id : '__ID__'); |
|
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | 125 | } |
@@ -152,16 +152,16 @@ discard block |
||
| 152 | 152 | |
| 153 | 153 | |
| 154 | 154 | // Actions when linking object each other |
| 155 | - include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; |
|
| 155 | + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; |
|
| 156 | 156 | |
| 157 | 157 | // Actions when printing a doc from card |
| 158 | - include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php'; |
|
| 158 | + include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; |
|
| 159 | 159 | |
| 160 | 160 | // Action to move up and down lines of object |
| 161 | 161 | //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; |
| 162 | 162 | |
| 163 | 163 | // Action to build doc |
| 164 | - include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php'; |
|
| 164 | + include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; |
|
| 165 | 165 | |
| 166 | 166 | if ($action == 'set_thirdparty' && $permissiontoadd) { |
| 167 | 167 | $object->setValueFrom('fk_soc', GETPOSTINT('fk_soc'), '', '', 'date', '', $user, $triggermodname); |
@@ -173,8 +173,8 @@ discard block |
||
| 173 | 173 | // Actions to send emails |
| 174 | 174 | $triggersendname = 'HRM_SKILL_SENTBYMAIL'; |
| 175 | 175 | $autocopy = 'MAIN_MAIL_AUTOCOPY_SKILL_TO'; |
| 176 | - $trackid = 'skill' . $object->id; |
|
| 177 | - include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php'; |
|
| 176 | + $trackid = 'skill'.$object->id; |
|
| 177 | + include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; |
|
| 178 | 178 | |
| 179 | 179 | if ($action == 'confirm_clone' && $confirm != 'yes') { |
| 180 | 180 | $action = ''; |
@@ -203,25 +203,25 @@ discard block |
||
| 203 | 203 | |
| 204 | 204 | // Part to create |
| 205 | 205 | if ($action == 'create') { |
| 206 | - print load_fiche_titre($langs->trans("NewSkill"), '', 'object_' . $object->picto); |
|
| 206 | + print load_fiche_titre($langs->trans("NewSkill"), '', 'object_'.$object->picto); |
|
| 207 | 207 | |
| 208 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
| 209 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 208 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
| 209 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 210 | 210 | print '<input type="hidden" name="action" value="add">'; |
| 211 | - $backtopage .= (strpos($backtopage, '?') > 0 ? '&' : '?') ."objecttype=job"; |
|
| 211 | + $backtopage .= (strpos($backtopage, '?') > 0 ? '&' : '?')."objecttype=job"; |
|
| 212 | 212 | if ($backtopage) { |
| 213 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
| 213 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
| 214 | 214 | } |
| 215 | 215 | if ($backtopageforcancel) { |
| 216 | - print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
| 216 | + print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | print dol_get_fiche_head(array(), ''); |
| 220 | 220 | |
| 221 | - print '<table class="border centpercent tableforfieldcreate">' . "\n"; |
|
| 221 | + print '<table class="border centpercent tableforfieldcreate">'."\n"; |
|
| 222 | 222 | |
| 223 | 223 | // Common attributes |
| 224 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php'; |
|
| 224 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; |
|
| 225 | 225 | |
| 226 | 226 | // Other attributes |
| 227 | 227 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; |
@@ -231,15 +231,15 @@ discard block |
||
| 231 | 231 | //@todo je stop ici ... à continuer (affichage des 5 skilled input pour create action |
| 232 | 232 | //print $object->showInputField($val, $key, $value, '', '['']', '', 0); |
| 233 | 233 | |
| 234 | - print '</table>' . "\n"; |
|
| 234 | + print '</table>'."\n"; |
|
| 235 | 235 | |
| 236 | 236 | print dol_get_fiche_end(); |
| 237 | 237 | |
| 238 | 238 | print '<div class="center">'; |
| 239 | - print '<input type="submit" class="button" name="add" value="' . dol_escape_htmltag($langs->trans("Create")) . '">'; |
|
| 239 | + print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans("Create")).'">'; |
|
| 240 | 240 | print ' '; |
| 241 | 241 | |
| 242 | - print '<input type="' . ($backtopage ? "submit" : "button") . '" class="button button-cancel" name="cancel" value="' . dol_escape_htmltag($langs->trans("Cancel")) . '"' . ($backtopage ? '' : ' onclick="history.go(-1)"') . '>'; // Cancel for create does not post form if we don't know the backtopage |
|
| 242 | + print '<input type="'.($backtopage ? "submit" : "button").'" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'"'.($backtopage ? '' : ' onclick="history.go(-1)"').'>'; // Cancel for create does not post form if we don't know the backtopage |
|
| 243 | 243 | print '</div>'; |
| 244 | 244 | |
| 245 | 245 | print '</form>'; |
@@ -250,25 +250,25 @@ discard block |
||
| 250 | 250 | // Part to edit record |
| 251 | 251 | // and skilldet edition |
| 252 | 252 | if (($id || $ref) && $action == 'edit') { |
| 253 | - print load_fiche_titre($langs->trans("Skill"), '', 'object_' . $object->picto); |
|
| 253 | + print load_fiche_titre($langs->trans("Skill"), '', 'object_'.$object->picto); |
|
| 254 | 254 | |
| 255 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
| 256 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 255 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
| 256 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 257 | 257 | print '<input type="hidden" name="action" value="update">'; |
| 258 | - print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
| 258 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
| 259 | 259 | if ($backtopage) { |
| 260 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
| 260 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
| 261 | 261 | } |
| 262 | 262 | if ($backtopageforcancel) { |
| 263 | - print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
| 263 | + print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | print dol_get_fiche_head(); |
| 267 | 267 | |
| 268 | - print '<table class="border centpercent tableforfieldedit">' . "\n"; |
|
| 268 | + print '<table class="border centpercent tableforfieldedit">'."\n"; |
|
| 269 | 269 | |
| 270 | 270 | // Common attributes |
| 271 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php'; |
|
| 271 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; |
|
| 272 | 272 | |
| 273 | 273 | // Other attributes |
| 274 | 274 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | continue; |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | - print '<table class="border centpercent =">' . "\n"; |
|
| 294 | + print '<table class="border centpercent =">'."\n"; |
|
| 295 | 295 | $sk->fields = dol_sort_array($sk->fields, 'position'); |
| 296 | 296 | foreach ($sk->fields as $key => $val) { |
| 297 | 297 | if (abs($val['visible']) != 1 && abs($val['visible']) != 3 && abs($val['visible']) != 4) { |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | continue; // We don't want this field |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | - print '<tr class="field_' . $key . '"><td'; |
|
| 305 | + print '<tr class="field_'.$key.'"><td'; |
|
| 306 | 306 | print ' class="titlefieldcreate'; |
| 307 | 307 | if (isset($val['notnull']) && $val['notnull'] > 0) { |
| 308 | 308 | print ' fieldrequired'; |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | if (empty($skilldetArray)) { |
| 338 | 338 | $value = GETPOSTISSET($key) ? GETPOST($key, $check) : $sk->$key; |
| 339 | 339 | } else { |
| 340 | - $value=$skilldetArray[$sk->id]; |
|
| 340 | + $value = $skilldetArray[$sk->id]; |
|
| 341 | 341 | } |
| 342 | 342 | // |
| 343 | 343 | // } elseif ($val['type'] == 'price') { |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | print $sk->showOutputField($val, $key, $value, '', '', '', 0); |
| 351 | 351 | } else { |
| 352 | 352 | /** @var Skilldet $sk */ |
| 353 | - print $sk->showInputField($val, $key, $value, "", "line[" . $sk->id . "]", "", ""); |
|
| 353 | + print $sk->showInputField($val, $key, $value, "", "line[".$sk->id."]", "", ""); |
|
| 354 | 354 | } |
| 355 | 355 | print '</td>'; |
| 356 | 356 | print '</tr>'; |
@@ -362,8 +362,8 @@ discard block |
||
| 362 | 362 | |
| 363 | 363 | print dol_get_fiche_end(); |
| 364 | 364 | |
| 365 | - print '<div class="center"><input type="submit" class="button button-save" name="save" value="' . $langs->trans("Save") . '">'; |
|
| 366 | - print ' <input type="submit" class="button button-cancel" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
| 365 | + print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">'; |
|
| 366 | + print ' <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
| 367 | 367 | print '</div>'; |
| 368 | 368 | |
| 369 | 369 | print '</form>'; |
@@ -381,11 +381,11 @@ discard block |
||
| 381 | 381 | |
| 382 | 382 | // Confirmation to delete |
| 383 | 383 | if ($action == 'delete') { |
| 384 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteSkill'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); |
|
| 384 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteSkill'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); |
|
| 385 | 385 | } |
| 386 | 386 | // Confirmation to delete line |
| 387 | 387 | if ($action == 'deleteline') { |
| 388 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1); |
|
| 388 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1); |
|
| 389 | 389 | } |
| 390 | 390 | // Confirmation clone |
| 391 | 391 | if ($action === 'clone') { |
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo)) |
| 409 | 409 | ); |
| 410 | 410 | */ |
| 411 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); |
|
| 411 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); |
|
| 412 | 412 | } |
| 413 | 413 | |
| 414 | 414 | // Call Hook formConfirm |
@@ -426,11 +426,11 @@ discard block |
||
| 426 | 426 | |
| 427 | 427 | // Object card |
| 428 | 428 | // ------------------------------------------------------------ |
| 429 | - $linkback = '<a href="' . DOL_URL_ROOT.'/hrm/skill_list.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; |
|
| 429 | + $linkback = '<a href="'.DOL_URL_ROOT.'/hrm/skill_list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; |
|
| 430 | 430 | |
| 431 | 431 | |
| 432 | 432 | $morehtmlref = '<div class="refid">'; |
| 433 | - $morehtmlref.= $object->label; |
|
| 433 | + $morehtmlref .= $object->label; |
|
| 434 | 434 | $morehtmlref .= '</div>'; |
| 435 | 435 | dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref); |
| 436 | 436 | |
@@ -438,10 +438,10 @@ discard block |
||
| 438 | 438 | print '<div class="fichecenter">'; |
| 439 | 439 | print '<div class="fichehalfleft">'; |
| 440 | 440 | print '<div class="underbanner clearboth"></div>'; |
| 441 | - print '<table class="border centpercent tableforfield">' . "\n"; |
|
| 441 | + print '<table class="border centpercent tableforfield">'."\n"; |
|
| 442 | 442 | |
| 443 | - $object->fields['label']['visible']=0; // Already in banner |
|
| 444 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; |
|
| 443 | + $object->fields['label']['visible'] = 0; // Already in banner |
|
| 444 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; |
|
| 445 | 445 | |
| 446 | 446 | // Other attributes. Fields from hook formObjectOptions and Extrafields. |
| 447 | 447 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | // Buttons for actions |
| 462 | 462 | |
| 463 | 463 | if ($action != 'presend' && $action != 'editline') { |
| 464 | - print '<div class="tabsAction">' . "\n"; |
|
| 464 | + print '<div class="tabsAction">'."\n"; |
|
| 465 | 465 | $parameters = array(); |
| 466 | 466 | $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
| 467 | 467 | if ($reshook < 0) { |
@@ -471,19 +471,19 @@ discard block |
||
| 471 | 471 | if (empty($reshook)) { |
| 472 | 472 | // Back to draft |
| 473 | 473 | if ($object->status == $object::STATUS_VALIDATED) { |
| 474 | - print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=confirm_setdraft&confirm=yes&token=' . newToken(), '', $permissiontoadd); |
|
| 474 | + print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd); |
|
| 475 | 475 | } |
| 476 | 476 | |
| 477 | - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd); |
|
| 477 | + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); |
|
| 478 | 478 | |
| 479 | 479 | // Clone |
| 480 | 480 | if ($permissiontoadd) { |
| 481 | 481 | print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER["PHP_SELF"].'?action=clone&token='.newToken().'&id='.$object->id, ''); |
| 482 | 482 | } |
| 483 | 483 | // Delete (need delete permission, or if draft, just need create/modify permission) |
| 484 | - print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete); |
|
| 484 | + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete); |
|
| 485 | 485 | } |
| 486 | - print '</div>' . "\n"; |
|
| 486 | + print '</div>'."\n"; |
|
| 487 | 487 | } |
| 488 | 488 | } |
| 489 | 489 | |
@@ -491,12 +491,12 @@ discard block |
||
| 491 | 491 | //*--------------------------------------------------------------------------- |
| 492 | 492 | |
| 493 | 493 | if ($action != "create" && $action != "edit") { |
| 494 | - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; |
|
| 495 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
| 496 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
| 494 | + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; |
|
| 495 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
| 496 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
| 497 | 497 | |
| 498 | 498 | // load hrm libraries |
| 499 | - require_once __DIR__ . '/class/skilldet.class.php'; |
|
| 499 | + require_once __DIR__.'/class/skilldet.class.php'; |
|
| 500 | 500 | |
| 501 | 501 | // for other modules |
| 502 | 502 | //dol_include_once('/othermodule/class/otherobject.class.php'); |
@@ -533,8 +533,8 @@ discard block |
||
| 533 | 533 | |
| 534 | 534 | // Default sort order (if not yet defined by previous GETPOST) |
| 535 | 535 | if (!$sortfield) { |
| 536 | - reset($objectline->fields); // Reset is required to avoid key() to return null. |
|
| 537 | - $sortfield = "t." . key($objectline->fields); // Set here default search field. By default 1st field in definition. |
|
| 536 | + reset($objectline->fields); // Reset is required to avoid key() to return null. |
|
| 537 | + $sortfield = "t.".key($objectline->fields); // Set here default search field. By default 1st field in definition. |
|
| 538 | 538 | } |
| 539 | 539 | if (!$sortorder) { |
| 540 | 540 | $sortorder = "ASC"; |
@@ -544,12 +544,12 @@ discard block |
||
| 544 | 544 | $search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); |
| 545 | 545 | $search = array(); |
| 546 | 546 | foreach ($objectline->fields as $key => $val) { |
| 547 | - if (GETPOST('search_' . $key, 'alpha') !== '') { |
|
| 548 | - $search[$key] = GETPOST('search_' . $key, 'alpha'); |
|
| 547 | + if (GETPOST('search_'.$key, 'alpha') !== '') { |
|
| 548 | + $search[$key] = GETPOST('search_'.$key, 'alpha'); |
|
| 549 | 549 | } |
| 550 | 550 | if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
| 551 | - $search[$key . '_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_' . $key . '_dtstartmonth'), GETPOSTINT('search_' . $key . '_dtstartday'), GETPOSTINT('search_' . $key . '_dtstartyear')); |
|
| 552 | - $search[$key . '_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_' . $key . '_dtendmonth'), GETPOSTINT('search_' . $key . '_dtendday'), GETPOSTINT('search_' . $key . '_dtendyear')); |
|
| 551 | + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear')); |
|
| 552 | + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear')); |
|
| 553 | 553 | } |
| 554 | 554 | } |
| 555 | 555 | |
@@ -557,7 +557,7 @@ discard block |
||
| 557 | 557 | $fieldstosearchall = array(); |
| 558 | 558 | foreach ($objectline->fields as $key => $val) { |
| 559 | 559 | if (!empty($val['searchall'])) { |
| 560 | - $fieldstosearchall['t.' . $key] = $val['label']; |
|
| 560 | + $fieldstosearchall['t.'.$key] = $val['label']; |
|
| 561 | 561 | } |
| 562 | 562 | } |
| 563 | 563 | |
@@ -567,7 +567,7 @@ discard block |
||
| 567 | 567 | // If $val['visible']==0, then we never show the field |
| 568 | 568 | if (!empty($val['visible'])) { |
| 569 | 569 | $visible = (int) dol_eval($val['visible'], 1, 1, '1'); |
| 570 | - $arrayfields['t.' . $key] = array( |
|
| 570 | + $arrayfields['t.'.$key] = array( |
|
| 571 | 571 | 'label' => $val['label'], |
| 572 | 572 | 'checked' => (($visible < 0) ? 0 : 1), |
| 573 | 573 | 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), |
@@ -599,9 +599,9 @@ discard block |
||
| 599 | 599 | // -------------------------------------------------------------------- |
| 600 | 600 | $sql = 'SELECT '; |
| 601 | 601 | $sql .= $objectline->getFieldList('t'); |
| 602 | - $sql .= " FROM " . MAIN_DB_PREFIX . $objectline->table_element . " as t"; |
|
| 602 | + $sql .= " FROM ".MAIN_DB_PREFIX.$objectline->table_element." as t"; |
|
| 603 | 603 | if ($objectline->ismultientitymanaged == 1) { |
| 604 | - $sql .= " WHERE t.entity IN (" . getEntity($objectline->element) . ")"; |
|
| 604 | + $sql .= " WHERE t.entity IN (".getEntity($objectline->element).")"; |
|
| 605 | 605 | } else { |
| 606 | 606 | $sql .= " WHERE 1 = 1 "; |
| 607 | 607 | } |
@@ -611,41 +611,41 @@ discard block |
||
| 611 | 611 | $nbtotalofrecords = $db->num_rows($resql); |
| 612 | 612 | $num = $db->num_rows($resql); |
| 613 | 613 | |
| 614 | - print '<form method="POST" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '">' . "\n"; |
|
| 614 | + print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n"; |
|
| 615 | 615 | if ($optioncss != '') { |
| 616 | - print '<input type="hidden" name="optioncss" value="' . $optioncss . '">'; |
|
| 616 | + print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; |
|
| 617 | 617 | } |
| 618 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 618 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 619 | 619 | print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; |
| 620 | 620 | print '<input type="hidden" name="action" value="list">'; |
| 621 | - print '<input type="hidden" name="sortfield" value="' . $sortfield . '">'; |
|
| 622 | - print '<input type="hidden" name="sortorder" value="' . $sortorder . '">'; |
|
| 623 | - print '<input type="hidden" name="page" value="' . $page . '">'; |
|
| 624 | - print '<input type="hidden" name="contextpage" value="' . $contextpage . '">'; |
|
| 621 | + print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; |
|
| 622 | + print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; |
|
| 623 | + print '<input type="hidden" name="page" value="'.$page.'">'; |
|
| 624 | + print '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; |
|
| 625 | 625 | if (!empty($id)) { |
| 626 | - print '<input type="hidden" name="id" value="' . $id . '">'; |
|
| 626 | + print '<input type="hidden" name="id" value="'.$id.'">'; |
|
| 627 | 627 | } |
| 628 | 628 | |
| 629 | - $param_fk = "&fk_skill=" . $id . "&fk_user_creat=" . (!empty($user->rowid) ? $user->rowid : 0); |
|
| 630 | - $backtopage = dol_buildpath('/hrm/skill_card.php', 1) . '?id=' . $id; |
|
| 629 | + $param_fk = "&fk_skill=".$id."&fk_user_creat=".(!empty($user->rowid) ? $user->rowid : 0); |
|
| 630 | + $backtopage = dol_buildpath('/hrm/skill_card.php', 1).'?id='.$id; |
|
| 631 | 631 | $param = ""; |
| 632 | 632 | $massactionbutton = ""; |
| 633 | 633 | //$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/hrm/skilldet_card.php', 1) . '?action=create&backtopage=' . urlencode($_SERVER['PHP_SELF']) . $param_fk . '&backtopage=' . $backtopage, '', $permissiontoadd); |
| 634 | 634 | |
| 635 | - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_' . $object->picto, 0, "", '', '', 0, 0, 1); |
|
| 635 | + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, "", '', '', 0, 0, 1); |
|
| 636 | 636 | |
| 637 | 637 | // Add code for pre mass action (confirmation or email presend form) |
| 638 | 638 | $topicmail = "SendSkilldetRef"; |
| 639 | 639 | $modelmail = "skilldet"; |
| 640 | 640 | $objecttmp = new Skilldet($db); |
| 641 | - $trackid = 'xxxx' . $object->id; |
|
| 641 | + $trackid = 'xxxx'.$object->id; |
|
| 642 | 642 | //include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; |
| 643 | 643 | |
| 644 | 644 | if ($search_all) { |
| 645 | 645 | foreach ($fieldstosearchall as $key => $val) { |
| 646 | 646 | $fieldstosearchall[$key] = $langs->trans($val); |
| 647 | 647 | } |
| 648 | - print '<div class="divsearchfieldfilter">' . $langs->trans("FilterOnInto", $search_all) . implode(', ', $fieldstosearchall) . '</div>'; |
|
| 648 | + print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).implode(', ', $fieldstosearchall).'</div>'; |
|
| 649 | 649 | } |
| 650 | 650 | |
| 651 | 651 | $moreforfilter = ''; |
@@ -672,7 +672,7 @@ discard block |
||
| 672 | 672 | // $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
| 673 | 673 | |
| 674 | 674 | print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table |
| 675 | - print '<table class="tagtable nobottomiftotal liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n"; |
|
| 675 | + print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n"; |
|
| 676 | 676 | |
| 677 | 677 | |
| 678 | 678 | // Fields title label |
@@ -689,13 +689,13 @@ discard block |
||
| 689 | 689 | // } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { |
| 690 | 690 | // $cssforfield .= ($cssforfield ? ' ' : '') . 'right'; |
| 691 | 691 | // } |
| 692 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
| 693 | - print getTitleFieldOfList($arrayfields['t.' . $key]['label'], 0, $_SERVER['PHP_SELF'], 't.' . $key, '', $param, (!empty($cssforfield) ? 'class="' . $cssforfield . '"' : ''), $sortfield, $sortorder, (!empty($cssforfield) ? $cssforfield . ' ' : '')) . "\n"; |
|
| 692 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
| 693 | + print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, (!empty($cssforfield) ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, (!empty($cssforfield) ? $cssforfield.' ' : ''))."\n"; |
|
| 694 | 694 | } |
| 695 | 695 | } |
| 696 | 696 | //print '<td></td>'; |
| 697 | 697 | print '<td></td>'; |
| 698 | - print '</tr>' . "\n"; |
|
| 698 | + print '</tr>'."\n"; |
|
| 699 | 699 | |
| 700 | 700 | |
| 701 | 701 | // Display all ranks of skill |
@@ -738,14 +738,14 @@ discard block |
||
| 738 | 738 | // } |
| 739 | 739 | //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; |
| 740 | 740 | |
| 741 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
| 742 | - print '<td' . (empty($cssforfield) ? '' : ' class="' . $cssforfield . '"') . '>'; |
|
| 741 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
| 742 | + print '<td'.(empty($cssforfield) ? '' : ' class="'.$cssforfield.'"').'>'; |
|
| 743 | 743 | if ($key == 'status') { |
| 744 | 744 | print $objectline->getLibStatut(5); |
| 745 | 745 | } elseif ($key == 'rowid') { |
| 746 | 746 | print $objectline->showOutputField($val, $key, $objectline->id, ''); |
| 747 | 747 | // ajout pencil |
| 748 | - print '<a class="timeline-btn" href="' . DOL_MAIN_URL_ROOT . '/comm/action/skilldet_card.php?action=edit&id=' . $objectline->id . '"><i class="fa fa-pencil" title="' . $langs->trans("Modify") . '" ></i></a>'; |
|
| 748 | + print '<a class="timeline-btn" href="'.DOL_MAIN_URL_ROOT.'/comm/action/skilldet_card.php?action=edit&id='.$objectline->id.'"><i class="fa fa-pencil" title="'.$langs->trans("Modify").'" ></i></a>'; |
|
| 749 | 749 | } else { |
| 750 | 750 | print $objectline->showOutputField($val, $key, $objectline->$key, ''); |
| 751 | 751 | } |
@@ -757,15 +757,15 @@ discard block |
||
| 757 | 757 | } |
| 758 | 758 | if (!empty($val['isameasure']) && $val['isameasure'] == 1) { |
| 759 | 759 | if (!$i) { |
| 760 | - $totalarray['pos'][$totalarray['nbfield']] = 't.' . $key; |
|
| 760 | + $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; |
|
| 761 | 761 | } |
| 762 | 762 | if (!isset($totalarray['val'])) { |
| 763 | 763 | $totalarray['val'] = array(); |
| 764 | 764 | } |
| 765 | - if (!isset($totalarray['val']['t.' . $key])) { |
|
| 766 | - $totalarray['val']['t.' . $key] = 0; |
|
| 765 | + if (!isset($totalarray['val']['t.'.$key])) { |
|
| 766 | + $totalarray['val']['t.'.$key] = 0; |
|
| 767 | 767 | } |
| 768 | - $totalarray['val']['t.' . $key] += $objectline->$key; |
|
| 768 | + $totalarray['val']['t.'.$key] += $objectline->$key; |
|
| 769 | 769 | } |
| 770 | 770 | } |
| 771 | 771 | } |
@@ -798,7 +798,7 @@ discard block |
||
| 798 | 798 | $totalarray['nbfield']++; |
| 799 | 799 | } |
| 800 | 800 | |
| 801 | - print '</tr>' . "\n"; |
|
| 801 | + print '</tr>'."\n"; |
|
| 802 | 802 | |
| 803 | 803 | $i++; |
| 804 | 804 | } |
@@ -813,7 +813,7 @@ discard block |
||
| 813 | 813 | $colspan++; |
| 814 | 814 | } |
| 815 | 815 | } |
| 816 | - print '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>'; |
|
| 816 | + print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>'; |
|
| 817 | 817 | } |
| 818 | 818 | |
| 819 | 819 | if (!empty($resql)) { |
@@ -824,10 +824,10 @@ discard block |
||
| 824 | 824 | $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $objectline); // Note that $action and $objectline may have been modified by hook |
| 825 | 825 | print $hookmanager->resPrint; |
| 826 | 826 | |
| 827 | - print '</table>' . "\n"; |
|
| 828 | - print '</div>' . "\n"; |
|
| 827 | + print '</table>'."\n"; |
|
| 828 | + print '</div>'."\n"; |
|
| 829 | 829 | |
| 830 | - print '</form>' . "\n"; |
|
| 830 | + print '</form>'."\n"; |
|
| 831 | 831 | |
| 832 | 832 | // if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { |
| 833 | 833 | // $hidegeneratedfilelistifempty = 1; |
@@ -862,9 +862,9 @@ discard block |
||
| 862 | 862 | $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/hrm/skill_agenda.php?id='.$object->id); |
| 863 | 863 | |
| 864 | 864 | // List of actions on element |
| 865 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; |
|
| 865 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; |
|
| 866 | 866 | $formactions = new FormActions($db); |
| 867 | - $somethingshown = $formactions->showactions($object, $object->element . '@' . $object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter); |
|
| 867 | + $somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter); |
|
| 868 | 868 | |
| 869 | 869 | print '</div></div>'; |
| 870 | 870 | } |
@@ -27,33 +27,33 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | // Load Dolibarr environment |
| 29 | 29 | require '../main.inc.php'; |
| 30 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; |
|
| 31 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; |
|
| 32 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
| 33 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php'; |
|
| 34 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; |
|
| 35 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php'; |
|
| 36 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php'; |
|
| 37 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
| 38 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
| 30 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; |
|
| 31 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
|
| 32 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
| 33 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/position.class.php'; |
|
| 34 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php'; |
|
| 35 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_position.lib.php'; |
|
| 36 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_job.lib.php'; |
|
| 37 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
| 38 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
| 39 | 39 | |
| 40 | 40 | |
| 41 | 41 | // Load translation files required by the page |
| 42 | 42 | $langs->loadLangs(array("hrm", "other", 'products')); |
| 43 | 43 | |
| 44 | -$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... |
|
| 44 | +$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... |
|
| 45 | 45 | $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) |
| 46 | 46 | $show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? |
| 47 | -$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation |
|
| 48 | -$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button |
|
| 49 | -$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list |
|
| 47 | +$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation |
|
| 48 | +$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button |
|
| 49 | +$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list |
|
| 50 | 50 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'jobpositionlist'; // To manage different context of search |
| 51 | 51 | $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') |
| 52 | 52 | $backtopage = GETPOST('backtopage', 'alpha'); |
| 53 | 53 | $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); |
| 54 | 54 | |
| 55 | -$id = GETPOSTINT('id'); |
|
| 56 | -$ref = GETPOST('ref', 'alpha'); |
|
| 55 | +$id = GETPOSTINT('id'); |
|
| 56 | +$ref = GETPOST('ref', 'alpha'); |
|
| 57 | 57 | $fk_job = (GETPOSTISSET('fk_job') ? GETPOSTINT('fk_job') : $id); |
| 58 | 58 | $fk_user = GETPOSTINT('fk_user'); |
| 59 | 59 | //$start_date = date('Y-m-d', GETPOST('date_startyear', 'int').'-'.GETPOST('date_startmonth', 'int').'-'.GETPOST('date_startday', 'int')); |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; |
| 65 | 65 | $sortfield = GETPOST('sortfield', 'aZ09comma'); |
| 66 | 66 | $sortorder = GETPOST('sortorder', 'aZ09comma'); |
| 67 | -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); |
|
| 67 | +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); |
|
| 68 | 68 | if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { |
| 69 | 69 | // If $page is not defined, or '' or -1 or if we click on clear filters |
| 70 | 70 | $page = 0; |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $object = new Job($db); |
| 79 | 79 | $objectposition = new Position($db); |
| 80 | 80 | $extrafields = new ExtraFields($db); |
| 81 | -$diroutputmassaction = $conf->hrm->dir_output . '/temp/massgeneration/' . $user->id; |
|
| 81 | +$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; |
|
| 82 | 82 | $hookmanager->initHooks(array('jobpositioncard', 'globalcard')); // Note that conf->hooks_modules contains array |
| 83 | 83 | |
| 84 | 84 | |
@@ -90,8 +90,8 @@ discard block |
||
| 90 | 90 | |
| 91 | 91 | // Default sort order (if not yet defined by previous GETPOST) |
| 92 | 92 | if (!$sortfield) { |
| 93 | - reset($objectposition->fields); // Reset is required to avoid key() to return null. |
|
| 94 | - $sortfield = "t." . key($objectposition->fields); // Set here default search field. By default 1st field in definition. |
|
| 93 | + reset($objectposition->fields); // Reset is required to avoid key() to return null. |
|
| 94 | + $sortfield = "t.".key($objectposition->fields); // Set here default search field. By default 1st field in definition. |
|
| 95 | 95 | } |
| 96 | 96 | if (!$sortorder) { |
| 97 | 97 | $sortorder = "ASC"; |
@@ -101,12 +101,12 @@ discard block |
||
| 101 | 101 | $search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); |
| 102 | 102 | $search = array(); |
| 103 | 103 | foreach ($objectposition->fields as $key => $val) { |
| 104 | - if (GETPOST('search_' . $key, 'alpha') !== '') { |
|
| 105 | - $search[$key] = GETPOST('search_' . $key, 'alpha'); |
|
| 104 | + if (GETPOST('search_'.$key, 'alpha') !== '') { |
|
| 105 | + $search[$key] = GETPOST('search_'.$key, 'alpha'); |
|
| 106 | 106 | } |
| 107 | 107 | if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
| 108 | - $search[$key . '_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_' . $key . '_dtstartmonth'), GETPOSTINT('search_' . $key . '_dtstartday'), GETPOSTINT('search_' . $key . '_dtstartyear')); |
|
| 109 | - $search[$key . '_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_' . $key . '_dtendmonth'), GETPOSTINT('search_' . $key . '_dtendday'), GETPOSTINT('search_' . $key . '_dtendyear')); |
|
| 108 | + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear')); |
|
| 109 | + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear')); |
|
| 110 | 110 | } |
| 111 | 111 | } |
| 112 | 112 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | $fieldstosearchall = array(); |
| 115 | 115 | foreach ($objectposition->fields as $key => $val) { |
| 116 | 116 | if (!empty($val['searchall'])) { |
| 117 | - $fieldstosearchall['t.' . $key] = $val['label']; |
|
| 117 | + $fieldstosearchall['t.'.$key] = $val['label']; |
|
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | 120 | |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | // If $val['visible']==0, then we never show the field |
| 125 | 125 | if (!empty($val['visible'])) { |
| 126 | 126 | $visible = (int) dol_eval($val['visible'], 1, 1, '1'); |
| 127 | - $arrayfields['t.' . $key] = array( |
|
| 127 | + $arrayfields['t.'.$key] = array( |
|
| 128 | 128 | 'label' => $val['label'], |
| 129 | 129 | 'checked' => (($visible < 0) ? 0 : 1), |
| 130 | 130 | 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | 136 | // Extra fields |
| 137 | -include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; |
|
| 137 | +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; |
|
| 138 | 138 | |
| 139 | 139 | $objectposition->fields = dol_sort_array($objectposition->fields, 'position'); |
| 140 | 140 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
@@ -143,13 +143,13 @@ discard block |
||
| 143 | 143 | |
| 144 | 144 | |
| 145 | 145 | // Load object |
| 146 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. |
|
| 146 | +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. |
|
| 147 | 147 | |
| 148 | 148 | // Permissions |
| 149 | 149 | $permissiontoread = $user->hasRight('hrm', 'all', 'read'); |
| 150 | 150 | $permissiontoadd = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
| 151 | 151 | $permissiontodelete = $user->hasRight('hrm', 'all', 'delete'); |
| 152 | -$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/position'; |
|
| 152 | +$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1].'/position'; |
|
| 153 | 153 | |
| 154 | 154 | // Security check (enable the most restrictive one) |
| 155 | 155 | //if ($user->socid > 0) accessforbidden(); |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | $backurlforlist = dol_buildpath('/hrm/position_list.php', 1); |
| 180 | 180 | $idBacktoPage = GETPOST('fk_job', 'aZ09'); |
| 181 | 181 | if ($idBacktoPage > 0) { |
| 182 | - $backtopage = dol_buildpath('/hrm/position.php', 1) . '?id=' . $idBacktoPage; |
|
| 182 | + $backtopage = dol_buildpath('/hrm/position.php', 1).'?id='.$idBacktoPage; |
|
| 183 | 183 | } |
| 184 | 184 | if (empty($backtopage) || ($cancel && empty($id))) { |
| 185 | 185 | if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { |
@@ -187,9 +187,9 @@ discard block |
||
| 187 | 187 | $backtopage = $backurlforlist; |
| 188 | 188 | } else { |
| 189 | 189 | if ($fk_job > 0) { |
| 190 | - $backtopage = dol_buildpath('/hrm/position.php', 1) . '?fk_job=' . ($fk_job > 0 ? $fk_job : '__ID__'); |
|
| 190 | + $backtopage = dol_buildpath('/hrm/position.php', 1).'?fk_job='.($fk_job > 0 ? $fk_job : '__ID__'); |
|
| 191 | 191 | } else { |
| 192 | - $backtopage = dol_buildpath('/hrm/position_card.php', 1) . '?id=__ID__'; |
|
| 192 | + $backtopage = dol_buildpath('/hrm/position_card.php', 1).'?id=__ID__'; |
|
| 193 | 193 | } |
| 194 | 194 | } |
| 195 | 195 | } |
@@ -202,15 +202,15 @@ discard block |
||
| 202 | 202 | $object = new Position($db); |
| 203 | 203 | |
| 204 | 204 | // Selection of new fields |
| 205 | - include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php'; |
|
| 205 | + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; |
|
| 206 | 206 | |
| 207 | 207 | // Purge search criteria |
| 208 | 208 | if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers |
| 209 | 209 | foreach ($object->fields as $key => $val) { |
| 210 | 210 | $search[$key] = ''; |
| 211 | 211 | if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
| 212 | - $search[$key . '_dtstart'] = ''; |
|
| 213 | - $search[$key . '_dtend'] = ''; |
|
| 212 | + $search[$key.'_dtstart'] = ''; |
|
| 213 | + $search[$key.'_dtend'] = ''; |
|
| 214 | 214 | } |
| 215 | 215 | } |
| 216 | 216 | $toselect = array(); |
@@ -225,9 +225,9 @@ discard block |
||
| 225 | 225 | $objectclass = 'Position'; |
| 226 | 226 | $objectlabel = 'Position'; |
| 227 | 227 | $uploaddir = $conf->hrm->dir_output; |
| 228 | - include DOL_DOCUMENT_ROOT . '/core/actions_massactions.inc.php'; |
|
| 228 | + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; |
|
| 229 | 229 | |
| 230 | - include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php'; |
|
| 230 | + include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; |
|
| 231 | 231 | |
| 232 | 232 | $object = $job; |
| 233 | 233 | } |
@@ -249,29 +249,29 @@ discard block |
||
| 249 | 249 | $object = new Position($db); |
| 250 | 250 | // Fetch optionals attributes and labels |
| 251 | 251 | $extrafields->fetch_name_optionals_label($object->table_element); |
| 252 | - print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Position")), '', 'object_' . $object->picto); |
|
| 252 | + print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Position")), '', 'object_'.$object->picto); |
|
| 253 | 253 | |
| 254 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
| 255 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 254 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
| 255 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 256 | 256 | print '<input type="hidden" name="action" value="add">'; |
| 257 | 257 | if ($backtopage) { |
| 258 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
| 258 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
| 259 | 259 | } |
| 260 | 260 | if ($backtopageforcancel) { |
| 261 | - print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
| 261 | + print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | print dol_get_fiche_head(array(), ''); |
| 265 | 265 | |
| 266 | - print '<table class="border centpercent tableforfieldcreate">' . "\n"; |
|
| 266 | + print '<table class="border centpercent tableforfieldcreate">'."\n"; |
|
| 267 | 267 | |
| 268 | 268 | // Common attributes |
| 269 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php'; |
|
| 269 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; |
|
| 270 | 270 | |
| 271 | 271 | // Other attributes |
| 272 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php'; |
|
| 272 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; |
|
| 273 | 273 | |
| 274 | - print '</table>' . "\n"; |
|
| 274 | + print '</table>'."\n"; |
|
| 275 | 275 | |
| 276 | 276 | print dol_get_fiche_end(); |
| 277 | 277 | |
@@ -283,10 +283,10 @@ discard block |
||
| 283 | 283 | } |
| 284 | 284 | if ($job->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { |
| 285 | 285 | if ($backtopage) { |
| 286 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
| 286 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
| 287 | 287 | } |
| 288 | 288 | if ($backtopageforcancel) { |
| 289 | - print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
| 289 | + print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | // Part to show record |
@@ -299,10 +299,10 @@ discard block |
||
| 299 | 299 | |
| 300 | 300 | // Object card |
| 301 | 301 | // ------------------------------------------------------------ |
| 302 | - $linkback = '<a href="' . dol_buildpath('/hrm/position_list.php', 1) . '?restore_lastsearch_values=1' . (!empty($fk_job) ? '&fk_job=' . $fk_job : '') . '">' . $langs->trans("BackToList") . '</a>'; |
|
| 302 | + $linkback = '<a href="'.dol_buildpath('/hrm/position_list.php', 1).'?restore_lastsearch_values=1'.(!empty($fk_job) ? '&fk_job='.$fk_job : '').'">'.$langs->trans("BackToList").'</a>'; |
|
| 303 | 303 | |
| 304 | 304 | $morehtmlref = '<div class="refid">'; |
| 305 | - $morehtmlref.= $object->label; |
|
| 305 | + $morehtmlref .= $object->label; |
|
| 306 | 306 | $morehtmlref .= '</div>'; |
| 307 | 307 | |
| 308 | 308 | dol_banner_tab($object, 'fk_job', $linkback, 1, 'rowid', 'rowid', $morehtmlref); |
@@ -311,17 +311,17 @@ discard block |
||
| 311 | 311 | print '<div class="fichecenter">'; |
| 312 | 312 | print '<div class="fichehalfleft">'; |
| 313 | 313 | print '<div class="underbanner clearboth"></div>'; |
| 314 | - print '<table class="border centpercent tableforfield">' . "\n"; |
|
| 314 | + print '<table class="border centpercent tableforfield">'."\n"; |
|
| 315 | 315 | |
| 316 | 316 | // Common attributes |
| 317 | 317 | //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field |
| 318 | 318 | //unset($object->fields['fk_project']); // Hide field already shown in banner |
| 319 | 319 | //unset($object->fields['fk_soc']); // Hide field already shown in banner |
| 320 | - $object->fields['label']['visible']=0; // Already in banner |
|
| 321 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; |
|
| 320 | + $object->fields['label']['visible'] = 0; // Already in banner |
|
| 321 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; |
|
| 322 | 322 | |
| 323 | 323 | // Other attributes. Fields from hook formObjectOptions and Extrafields. |
| 324 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
| 324 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
| 325 | 325 | |
| 326 | 326 | print '</table>'; |
| 327 | 327 | print '</div>'; |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | // Add fields from extrafields |
| 345 | 345 | if (!empty($extrafields->attributes[$object->table_element]['label'])) { |
| 346 | 346 | foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { |
| 347 | - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef." . $key . " as options_" . $key . ', ' : ''); |
|
| 347 | + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key.', ' : ''); |
|
| 348 | 348 | } |
| 349 | 349 | } |
| 350 | 350 | // Add fields from hooks |
@@ -352,20 +352,20 @@ discard block |
||
| 352 | 352 | $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook |
| 353 | 353 | $sql .= $hookmanager->resPrint; |
| 354 | 354 | $sql = preg_replace('/,\s*$/', '', $sql); |
| 355 | - $sql .= " FROM " . MAIN_DB_PREFIX . $object->table_element . " as t"; |
|
| 355 | + $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; |
|
| 356 | 356 | if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { |
| 357 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . $object->table_element . "_extrafields as ef on (t.rowid = ef.fk_object)"; |
|
| 357 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; |
|
| 358 | 358 | } |
| 359 | 359 | // Add table from hooks |
| 360 | 360 | $parameters = array(); |
| 361 | 361 | $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook |
| 362 | 362 | $sql .= $hookmanager->resPrint; |
| 363 | 363 | if ($object->ismultientitymanaged == 1) { |
| 364 | - $sql .= " WHERE t.entity IN (" . getEntity($object->element) . ")"; |
|
| 364 | + $sql .= " WHERE t.entity IN (".getEntity($object->element).")"; |
|
| 365 | 365 | } else { |
| 366 | 366 | $sql .= " WHERE 1 = 1"; |
| 367 | 367 | } |
| 368 | - $sql .= " AND t.fk_job = " . ((int) $fk_job) . " "; |
|
| 368 | + $sql .= " AND t.fk_job = ".((int) $fk_job)." "; |
|
| 369 | 369 | |
| 370 | 370 | foreach ($search as $key => $val) { |
| 371 | 371 | if (array_key_exists($key, $object->fields)) { |
@@ -387,10 +387,10 @@ discard block |
||
| 387 | 387 | $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key); |
| 388 | 388 | if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { |
| 389 | 389 | if (preg_match('/_dtstart$/', $key)) { |
| 390 | - $sql .= " AND t." . $columnName . " >= '" . $db->idate($search[$key]) . "'"; |
|
| 390 | + $sql .= " AND t.".$columnName." >= '".$db->idate($search[$key])."'"; |
|
| 391 | 391 | } |
| 392 | 392 | if (preg_match('/_dtend$/', $key)) { |
| 393 | - $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; |
|
| 393 | + $sql .= " AND t.".$columnName." <= '".$db->idate($search[$key])."'"; |
|
| 394 | 394 | } |
| 395 | 395 | } |
| 396 | 396 | } |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | } |
| 402 | 402 | //$sql.= dolSqlDateFilter("t.field", $search_xxxday, $search_xxxmonth, $search_xxxyear); |
| 403 | 403 | // Add where from extra fields |
| 404 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_sql.tpl.php'; |
|
| 404 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; |
|
| 405 | 405 | // Add where from hooks |
| 406 | 406 | $parameters = array(); |
| 407 | 407 | $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook |
@@ -440,15 +440,15 @@ discard block |
||
| 440 | 440 | if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) { |
| 441 | 441 | $obj = $db->fetch_object($resql); |
| 442 | 442 | $id = $obj->rowid; |
| 443 | - header("Location: " . dol_buildpath('/hrm/position.php', 1) . '?id=' . $id); |
|
| 443 | + header("Location: ".dol_buildpath('/hrm/position.php', 1).'?id='.$id); |
|
| 444 | 444 | exit; |
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | $arrayofselected = is_array($toselect) ? $toselect : array(); |
| 448 | 448 | |
| 449 | - $param = 'fk_job=' . $fk_job; |
|
| 449 | + $param = 'fk_job='.$fk_job; |
|
| 450 | 450 | if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { |
| 451 | - $param .= '&contextpage=' . urlencode($contextpage); |
|
| 451 | + $param .= '&contextpage='.urlencode($contextpage); |
|
| 452 | 452 | } |
| 453 | 453 | if ($limit > 0 && $limit != $conf->liste_limit) { |
| 454 | 454 | $param .= '&limit='.((int) $limit); |
@@ -456,17 +456,17 @@ discard block |
||
| 456 | 456 | foreach ($search as $key => $val) { |
| 457 | 457 | if (is_array($search[$key]) && count($search[$key])) { |
| 458 | 458 | foreach ($search[$key] as $skey) { |
| 459 | - $param .= '&search_' . $key . '[]=' . urlencode($skey); |
|
| 459 | + $param .= '&search_'.$key.'[]='.urlencode($skey); |
|
| 460 | 460 | } |
| 461 | 461 | } else { |
| 462 | - $param .= '&search_' . $key . '=' . urlencode($search[$key]); |
|
| 462 | + $param .= '&search_'.$key.'='.urlencode($search[$key]); |
|
| 463 | 463 | } |
| 464 | 464 | } |
| 465 | 465 | if ($optioncss != '') { |
| 466 | - $param .= '&optioncss=' . urlencode($optioncss); |
|
| 466 | + $param .= '&optioncss='.urlencode($optioncss); |
|
| 467 | 467 | } |
| 468 | 468 | // Add $param from extra fields |
| 469 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_param.tpl.php'; |
|
| 469 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; |
|
| 470 | 470 | // Add $param from hooks |
| 471 | 471 | $parameters = array(); |
| 472 | 472 | $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook |
@@ -480,43 +480,43 @@ discard block |
||
| 480 | 480 | //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), |
| 481 | 481 | ); |
| 482 | 482 | if ($permissiontodelete) { |
| 483 | - $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"') . $langs->trans("Delete"); |
|
| 483 | + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); |
|
| 484 | 484 | } |
| 485 | 485 | if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { |
| 486 | 486 | $arrayofmassactions = array(); |
| 487 | 487 | } |
| 488 | 488 | $massactionbutton = $form->selectMassAction('', $arrayofmassactions); |
| 489 | 489 | |
| 490 | - print '<form method="POST" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '?fk_job=' . $fk_job . '">' . "\n"; |
|
| 490 | + print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'?fk_job='.$fk_job.'">'."\n"; |
|
| 491 | 491 | if ($optioncss != '') { |
| 492 | - print '<input type="hidden" name="optioncss" value="' . $optioncss . '">'; |
|
| 492 | + print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; |
|
| 493 | 493 | } |
| 494 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 494 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 495 | 495 | print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; |
| 496 | 496 | print '<input type="hidden" name="action" value="list">'; |
| 497 | - print '<input type="hidden" name="massaction" value="' . $massaction . '">'; |
|
| 498 | - print '<input type="hidden" name="sortfield" value="' . $sortfield . '">'; |
|
| 499 | - print '<input type="hidden" name="sortorder" value="' . $sortorder . '">'; |
|
| 500 | - print '<input type="hidden" name="page" value="' . $page . '">'; |
|
| 501 | - print '<input type="hidden" name="contextpage" value="' . $contextpage . '">'; |
|
| 497 | + print '<input type="hidden" name="massaction" value="'.$massaction.'">'; |
|
| 498 | + print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; |
|
| 499 | + print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; |
|
| 500 | + print '<input type="hidden" name="page" value="'.$page.'">'; |
|
| 501 | + print '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; |
|
| 502 | 502 | |
| 503 | 503 | $newcardbutton = ''; |
| 504 | 504 | $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/hrm/position.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']).'&fk_job='.((int) $fk_job), '', $permissiontoadd); |
| 505 | 505 | |
| 506 | - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_' . $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); |
|
| 506 | + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); |
|
| 507 | 507 | |
| 508 | 508 | // Add code for pre mass action (confirmation or email presend form) |
| 509 | 509 | $topicmail = "SendPositionRef"; |
| 510 | 510 | $modelmail = "position"; |
| 511 | 511 | $objecttmp = new Position($db); |
| 512 | - $trackid = 'xxxx' . $object->id; |
|
| 513 | - include DOL_DOCUMENT_ROOT . '/core/tpl/massactions_pre.tpl.php'; |
|
| 512 | + $trackid = 'xxxx'.$object->id; |
|
| 513 | + include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; |
|
| 514 | 514 | |
| 515 | 515 | if ($search_all) { |
| 516 | 516 | foreach ($fieldstosearchall as $key => $val) { |
| 517 | 517 | $fieldstosearchall[$key] = $langs->trans($val); |
| 518 | 518 | } |
| 519 | - print '<div class="divsearchfieldfilter">' . $langs->trans("FilterOnInto", $search_all) . implode(', ', $fieldstosearchall) . '</div>'; |
|
| 519 | + print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).implode(', ', $fieldstosearchall).'</div>'; |
|
| 520 | 520 | } |
| 521 | 521 | |
| 522 | 522 | $moreforfilter = ''; |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
| 544 | 544 | |
| 545 | 545 | print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table |
| 546 | - print '<table class="tagtable nobottomiftotal liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n"; |
|
| 546 | + print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n"; |
|
| 547 | 547 | |
| 548 | 548 | // Fields title search |
| 549 | 549 | // -------------------------------------------------------------------- |
@@ -551,35 +551,35 @@ discard block |
||
| 551 | 551 | foreach ($object->fields as $key => $val) { |
| 552 | 552 | $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); |
| 553 | 553 | if ($key == 'status') { |
| 554 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; |
|
| 554 | + $cssforfield .= ($cssforfield ? ' ' : '').'center'; |
|
| 555 | 555 | } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { |
| 556 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; |
|
| 556 | + $cssforfield .= ($cssforfield ? ' ' : '').'center'; |
|
| 557 | 557 | } elseif (in_array($val['type'], array('timestamp'))) { |
| 558 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'nowrap'; |
|
| 558 | + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; |
|
| 559 | 559 | } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { |
| 560 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'right'; |
|
| 560 | + $cssforfield .= ($cssforfield ? ' ' : '').'right'; |
|
| 561 | 561 | } |
| 562 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
| 563 | - print '<td class="liste_titre' . ($cssforfield ? ' ' . $cssforfield : '') . '">'; |
|
| 562 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
| 563 | + print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">'; |
|
| 564 | 564 | if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { |
| 565 | - print $form->selectarray('search_' . $key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); |
|
| 565 | + print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); |
|
| 566 | 566 | } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) { |
| 567 | 567 | print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', 'maxwidth125', 1); |
| 568 | 568 | } elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
| 569 | - print '<input type="text" class="flat maxwidth75" name="search_' . $key . '" value="' . dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '') . '">'; |
|
| 569 | + print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">'; |
|
| 570 | 570 | } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
| 571 | 571 | print '<div class="nowrap">'; |
| 572 | - print $form->selectDate($search[$key . '_dtstart'] ? $search[$key . '_dtstart'] : '', "search_" . $key . "_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); |
|
| 572 | + print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); |
|
| 573 | 573 | print '</div>'; |
| 574 | 574 | print '<div class="nowrap">'; |
| 575 | - print $form->selectDate($search[$key . '_dtend'] ? $search[$key . '_dtend'] : '', "search_" . $key . "_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); |
|
| 575 | + print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); |
|
| 576 | 576 | print '</div>'; |
| 577 | 577 | } |
| 578 | 578 | print '</td>'; |
| 579 | 579 | } |
| 580 | 580 | } |
| 581 | 581 | // Extra fields |
| 582 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_input.tpl.php'; |
|
| 582 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; |
|
| 583 | 583 | |
| 584 | 584 | // Fields from hook |
| 585 | 585 | $parameters = array('arrayfields' => $arrayfields); |
@@ -590,7 +590,7 @@ discard block |
||
| 590 | 590 | $searchpicto = $form->showFilterButtons(); |
| 591 | 591 | print $searchpicto; |
| 592 | 592 | print '</td>'; |
| 593 | - print '</tr>' . "\n"; |
|
| 593 | + print '</tr>'."\n"; |
|
| 594 | 594 | |
| 595 | 595 | |
| 596 | 596 | // Fields title label |
@@ -599,27 +599,27 @@ discard block |
||
| 599 | 599 | foreach ($object->fields as $key => $val) { |
| 600 | 600 | $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); |
| 601 | 601 | if ($key == 'status') { |
| 602 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; |
|
| 602 | + $cssforfield .= ($cssforfield ? ' ' : '').'center'; |
|
| 603 | 603 | } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { |
| 604 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; |
|
| 604 | + $cssforfield .= ($cssforfield ? ' ' : '').'center'; |
|
| 605 | 605 | } elseif (in_array($val['type'], array('timestamp'))) { |
| 606 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'nowrap'; |
|
| 606 | + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; |
|
| 607 | 607 | } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { |
| 608 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'right'; |
|
| 608 | + $cssforfield .= ($cssforfield ? ' ' : '').'right'; |
|
| 609 | 609 | } |
| 610 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
| 611 | - print getTitleFieldOfList($arrayfields['t.' . $key]['label'], 0, $_SERVER['PHP_SELF'], 't.' . $key, '', $param, ($cssforfield ? 'class="' . $cssforfield . '"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield . ' ' : '')) . "\n"; |
|
| 610 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
| 611 | + print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n"; |
|
| 612 | 612 | } |
| 613 | 613 | } |
| 614 | 614 | // Extra fields |
| 615 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_title.tpl.php'; |
|
| 615 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; |
|
| 616 | 616 | // Hook fields |
| 617 | 617 | $parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder); |
| 618 | 618 | $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook |
| 619 | 619 | print $hookmanager->resPrint; |
| 620 | 620 | // Action column |
| 621 | - print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ') . "\n"; |
|
| 622 | - print '</tr>' . "\n"; |
|
| 621 | + print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; |
|
| 622 | + print '</tr>'."\n"; |
|
| 623 | 623 | |
| 624 | 624 | // Detect if we need a fetch on each output line |
| 625 | 625 | $needToFetchEachLine = 0; |
@@ -651,24 +651,24 @@ discard block |
||
| 651 | 651 | foreach ($object->fields as $key => $val) { |
| 652 | 652 | $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); |
| 653 | 653 | if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { |
| 654 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; |
|
| 654 | + $cssforfield .= ($cssforfield ? ' ' : '').'center'; |
|
| 655 | 655 | } elseif ($key == 'status') { |
| 656 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; |
|
| 656 | + $cssforfield .= ($cssforfield ? ' ' : '').'center'; |
|
| 657 | 657 | } |
| 658 | 658 | |
| 659 | 659 | if (in_array($val['type'], array('timestamp'))) { |
| 660 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'nowrap'; |
|
| 660 | + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; |
|
| 661 | 661 | } elseif ($key == 'ref') { |
| 662 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'nowrap'; |
|
| 662 | + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; |
|
| 663 | 663 | } |
| 664 | 664 | |
| 665 | 665 | if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) { |
| 666 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'right'; |
|
| 666 | + $cssforfield .= ($cssforfield ? ' ' : '').'right'; |
|
| 667 | 667 | } |
| 668 | 668 | //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; |
| 669 | 669 | |
| 670 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
| 671 | - print '<td' . ($cssforfield ? ' class="' . $cssforfield . '"' : '') . '>'; |
|
| 670 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
| 671 | + print '<td'.($cssforfield ? ' class="'.$cssforfield.'"' : '').'>'; |
|
| 672 | 672 | if ($key == 'status') { |
| 673 | 673 | print $object->getLibStatut(5); |
| 674 | 674 | } elseif ($key == 'rowid') { |
@@ -682,20 +682,20 @@ discard block |
||
| 682 | 682 | } |
| 683 | 683 | if (!empty($val['isameasure']) && $val['isameasure'] == 1) { |
| 684 | 684 | if (!$i) { |
| 685 | - $totalarray['pos'][$totalarray['nbfield']] = 't.' . $key; |
|
| 685 | + $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; |
|
| 686 | 686 | } |
| 687 | 687 | if (!isset($totalarray['val'])) { |
| 688 | 688 | $totalarray['val'] = array(); |
| 689 | 689 | } |
| 690 | - if (!isset($totalarray['val']['t.' . $key])) { |
|
| 691 | - $totalarray['val']['t.' . $key] = 0; |
|
| 690 | + if (!isset($totalarray['val']['t.'.$key])) { |
|
| 691 | + $totalarray['val']['t.'.$key] = 0; |
|
| 692 | 692 | } |
| 693 | - $totalarray['val']['t.' . $key] += $object->$key; |
|
| 693 | + $totalarray['val']['t.'.$key] += $object->$key; |
|
| 694 | 694 | } |
| 695 | 695 | } |
| 696 | 696 | } |
| 697 | 697 | // Extra fields |
| 698 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_print_fields.tpl.php'; |
|
| 698 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; |
|
| 699 | 699 | // Fields from hook |
| 700 | 700 | $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); |
| 701 | 701 | $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook |
@@ -707,20 +707,20 @@ discard block |
||
| 707 | 707 | if (in_array($object->id, $arrayofselected)) { |
| 708 | 708 | $selected = 1; |
| 709 | 709 | } |
| 710 | - print '<input id="cb' . $object->id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $object->id . '"' . ($selected ? ' checked="checked"' : '') . '>'; |
|
| 710 | + print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>'; |
|
| 711 | 711 | } |
| 712 | 712 | print '</td>'; |
| 713 | 713 | if (!$i) { |
| 714 | 714 | $totalarray['nbfield']++; |
| 715 | 715 | } |
| 716 | 716 | |
| 717 | - print '</tr>' . "\n"; |
|
| 717 | + print '</tr>'."\n"; |
|
| 718 | 718 | |
| 719 | 719 | $i++; |
| 720 | 720 | } |
| 721 | 721 | |
| 722 | 722 | // Show total line |
| 723 | - include DOL_DOCUMENT_ROOT . '/core/tpl/list_print_total.tpl.php'; |
|
| 723 | + include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; |
|
| 724 | 724 | |
| 725 | 725 | // If no record found |
| 726 | 726 | if ($num == 0) { |
@@ -730,7 +730,7 @@ discard block |
||
| 730 | 730 | $colspan++; |
| 731 | 731 | } |
| 732 | 732 | } |
| 733 | - print '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>'; |
|
| 733 | + print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>'; |
|
| 734 | 734 | } |
| 735 | 735 | |
| 736 | 736 | |
@@ -740,10 +740,10 @@ discard block |
||
| 740 | 740 | $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook |
| 741 | 741 | print $hookmanager->resPrint; |
| 742 | 742 | |
| 743 | - print '</table>' . "\n"; |
|
| 744 | - print '</div>' . "\n"; |
|
| 743 | + print '</table>'."\n"; |
|
| 744 | + print '</div>'."\n"; |
|
| 745 | 745 | |
| 746 | - print '</form>' . "\n"; |
|
| 746 | + print '</form>'."\n"; |
|
| 747 | 747 | |
| 748 | 748 | if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { |
| 749 | 749 | $hidegeneratedfilelistifempty = 1; |
@@ -751,11 +751,11 @@ discard block |
||
| 751 | 751 | $hidegeneratedfilelistifempty = 0; |
| 752 | 752 | } |
| 753 | 753 | |
| 754 | - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; |
|
| 754 | + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
|
| 755 | 755 | $formfile = new FormFile($db); |
| 756 | 756 | |
| 757 | 757 | // Show list of available documents |
| 758 | - $urlsource = $_SERVER['PHP_SELF'] . '?sortfield=' . $sortfield . '&sortorder=' . $sortorder; |
|
| 758 | + $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; |
|
| 759 | 759 | $urlsource .= str_replace('&', '&', $param); |
| 760 | 760 | |
| 761 | 761 | $filedir = $diroutputmassaction; |
@@ -182,12 +182,12 @@ discard block |
||
| 182 | 182 | if (!empty($user->email)) { |
| 183 | 183 | $sendto = dolGetFirstLastname($user->firstname, $user->lastname)." <".$user->email.">"; |
| 184 | 184 | } else { |
| 185 | - $sendto = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL') . '" <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; |
|
| 185 | + $sendto = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'" <'.getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; |
|
| 186 | 186 | } |
| 187 | 187 | $replyto = $sendto; |
| 188 | 188 | $sendtocc = ''; |
| 189 | 189 | if (getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL')) { |
| 190 | - $sendtocc = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL') . '" <' . getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'>'; |
|
| 190 | + $sendtocc = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'" <'.getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'>'; |
|
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | $message = "A bank transfer of ".price2num($event->data->object->amount / 100)." ".$event->data->object->currency." should arrive in your account the ".dol_print_date($event->data->object->arrival_date, 'dayhour'); |
@@ -272,12 +272,12 @@ discard block |
||
| 272 | 272 | if (!empty($user->email)) { |
| 273 | 273 | $sendto = dolGetFirstLastname($user->firstname, $user->lastname)." <".$user->email.">"; |
| 274 | 274 | } else { |
| 275 | - $sendto = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL') . '" <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; |
|
| 275 | + $sendto = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'" <'.getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; |
|
| 276 | 276 | } |
| 277 | 277 | $replyto = $sendto; |
| 278 | 278 | $sendtocc = ''; |
| 279 | 279 | if (getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL')) { |
| 280 | - $sendtocc = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL') . '" <' . getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'>'; |
|
| 280 | + $sendtocc = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'" <'.getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'>'; |
|
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | $message = "A bank transfer of ".price2num($event->data->object->amount / 100)." ".$event->data->object->currency." has been done to your account the ".dol_print_date($event->data->object->arrival_date, 'dayhour'); |
@@ -317,19 +317,19 @@ discard block |
||
| 317 | 317 | $db->commit(); |
| 318 | 318 | } elseif ($event->type == 'payment_intent.succeeded') { // Called when making payment with PaymentIntent method ($conf->global->STRIPE_USE_NEW_CHECKOUT is on). |
| 319 | 319 | //dol_syslog("object = ".var_export($event->data, true)); |
| 320 | - include_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php'; |
|
| 320 | + include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; |
|
| 321 | 321 | global $stripearrayofkeysbyenv; |
| 322 | 322 | $error = 0; |
| 323 | 323 | $object = $event->data->object; |
| 324 | - $TRANSACTIONID = $object->id; // Example pi_123456789... |
|
| 324 | + $TRANSACTIONID = $object->id; // Example pi_123456789... |
|
| 325 | 325 | $ipaddress = $object->metadata->ipaddress; |
| 326 | 326 | $now = dol_now(); |
| 327 | 327 | $currencyCodeType = strtoupper($object->currency); |
| 328 | 328 | $paymentmethodstripeid = $object->payment_method; |
| 329 | 329 | $customer_id = $object->customer; |
| 330 | 330 | $invoice_id = ""; |
| 331 | - $paymentTypeId = ""; // payment type according to Stripe |
|
| 332 | - $paymentTypeIdInDolibarr = ""; // payment type according to Dolibarr |
|
| 331 | + $paymentTypeId = ""; // payment type according to Stripe |
|
| 332 | + $paymentTypeIdInDolibarr = ""; // payment type according to Dolibarr |
|
| 333 | 333 | $payment_amount = 0; |
| 334 | 334 | $payment_amountInDolibarr = 0; |
| 335 | 335 | |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | $s = new \Stripe\StripeClient($stripeacc); |
| 395 | 395 | |
| 396 | 396 | $paymentmethodstripe = $s->paymentMethods->retrieve($paymentmethodstripeid); |
| 397 | - $paymentTypeId = $paymentmethodstripe->type; |
|
| 397 | + $paymentTypeId = $paymentmethodstripe->type; |
|
| 398 | 398 | if ($paymentTypeId == "ban" || $paymentTypeId == "sepa_debit") { |
| 399 | 399 | $paymentTypeId = "PRE"; |
| 400 | 400 | } elseif ($paymentTypeId == "card") { |
@@ -420,9 +420,9 @@ discard block |
||
| 420 | 420 | $paiement->datepaye = $now; |
| 421 | 421 | $paiement->date = $now; |
| 422 | 422 | if ($currencyCodeType == $conf->currency) { |
| 423 | - $paiement->amounts = [$invoice_id => $payment_amount]; // Array with all payments dispatching with invoice id |
|
| 423 | + $paiement->amounts = [$invoice_id => $payment_amount]; // Array with all payments dispatching with invoice id |
|
| 424 | 424 | } else { |
| 425 | - $paiement->multicurrency_amounts = [$invoice_id => $payment_amount]; // Array with all payments dispatching |
|
| 425 | + $paiement->multicurrency_amounts = [$invoice_id => $payment_amount]; // Array with all payments dispatching |
|
| 426 | 426 | |
| 427 | 427 | $postactionmessages[] = 'Payment was done in a currency ('.$currencyCodeType.') other than the expected currency of company ('.$conf->currency.')'; |
| 428 | 428 | $ispostactionok = -1; |
@@ -432,8 +432,8 @@ discard block |
||
| 432 | 432 | $paiement->paiementid = $paymentTypeId; |
| 433 | 433 | $paiement->num_payment = ''; |
| 434 | 434 | $paiement->note_public = ''; |
| 435 | - $paiement->note_private = 'StripeSepa payment ' . dol_print_date($now, 'standard') . ' using ' . $servicestatus . ($ipaddress ? ' from ip ' . $ipaddress : '') . ' - Transaction ID = ' . $TRANSACTIONID; |
|
| 436 | - $paiement->ext_payment_id = $TRANSACTIONID.':'.$customer_id.'@'.$stripearrayofkeysbyenv[$servicestatus]['publishable_key']; // May be we should store py_... instead of pi_... but we started with pi_... so we continue. |
|
| 435 | + $paiement->note_private = 'StripeSepa payment '.dol_print_date($now, 'standard').' using '.$servicestatus.($ipaddress ? ' from ip '.$ipaddress : '').' - Transaction ID = '.$TRANSACTIONID; |
|
| 436 | + $paiement->ext_payment_id = $TRANSACTIONID.':'.$customer_id.'@'.$stripearrayofkeysbyenv[$servicestatus]['publishable_key']; // May be we should store py_... instead of pi_... but we started with pi_... so we continue. |
|
| 437 | 437 | $paiement->ext_payment_site = $service; |
| 438 | 438 | |
| 439 | 439 | $ispaymentdone = 0; |
@@ -451,20 +451,20 @@ discard block |
||
| 451 | 451 | $db->begin(); |
| 452 | 452 | |
| 453 | 453 | if (!$error && !$ispaymentdone) { |
| 454 | - dol_syslog('* Record payment for invoice id ' . $invoice_id . '. It includes closing of invoice and regenerating document'); |
|
| 454 | + dol_syslog('* Record payment for invoice id '.$invoice_id.'. It includes closing of invoice and regenerating document'); |
|
| 455 | 455 | |
| 456 | 456 | // This include closing invoices to 'paid' (and trigger including unsuspending) and regenerating document |
| 457 | 457 | $paiement_id = $paiement->create($user, 1); |
| 458 | 458 | if ($paiement_id < 0) { |
| 459 | - $postactionmessages[] = $paiement->error . ($paiement->error ? ' ' : '') . implode("<br>\n", $paiement->errors); |
|
| 459 | + $postactionmessages[] = $paiement->error.($paiement->error ? ' ' : '').implode("<br>\n", $paiement->errors); |
|
| 460 | 460 | $ispostactionok = -1; |
| 461 | 461 | $error++; |
| 462 | 462 | |
| 463 | - dol_syslog("Failed to create the payment for invoice id " . $invoice_id); |
|
| 463 | + dol_syslog("Failed to create the payment for invoice id ".$invoice_id); |
|
| 464 | 464 | } else { |
| 465 | 465 | $postactionmessages[] = 'Payment created'; |
| 466 | 466 | |
| 467 | - dol_syslog("The payment has been created for invoice id " . $invoice_id); |
|
| 467 | + dol_syslog("The payment has been created for invoice id ".$invoice_id); |
|
| 468 | 468 | } |
| 469 | 469 | } |
| 470 | 470 | |
@@ -494,14 +494,14 @@ discard block |
||
| 494 | 494 | $label = '(CustomerInvoicePayment)'; |
| 495 | 495 | $result = $paiement->addPaymentToBank($user, 'payment', $label, $bankaccountid, $customer_id, ''); |
| 496 | 496 | if ($result < 0) { |
| 497 | - $postactionmessages[] = $paiement->error . ($paiement->error ? ' ' : '') . implode("<br>\n", $paiement->errors); |
|
| 497 | + $postactionmessages[] = $paiement->error.($paiement->error ? ' ' : '').implode("<br>\n", $paiement->errors); |
|
| 498 | 498 | $ispostactionok = -1; |
| 499 | 499 | $error++; |
| 500 | 500 | } else { |
| 501 | 501 | $postactionmessages[] = 'Bank transaction of payment created (by ipn.php file)'; |
| 502 | 502 | } |
| 503 | 503 | } else { |
| 504 | - $postactionmessages[] = 'Setup of bank account to use in module ' . $paymentmethod . ' was not set. No way to record the payment.'; |
|
| 504 | + $postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.'; |
|
| 505 | 505 | $ispostactionok = -1; |
| 506 | 506 | $error++; |
| 507 | 507 | } |
@@ -665,7 +665,7 @@ discard block |
||
| 665 | 665 | $error++; |
| 666 | 666 | } |
| 667 | 667 | |
| 668 | - if (! $error) { |
|
| 668 | + if (!$error) { |
|
| 669 | 669 | $db->commit(); |
| 670 | 670 | } else { |
| 671 | 671 | $db->rollback(); |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | * \brief File of class with all html predefined components for WebPortal |
| 25 | 25 | */ |
| 26 | 26 | |
| 27 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php'; |
|
| 27 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; |
|
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * Class to manage generation of HTML components |
@@ -70,19 +70,19 @@ discard block |
||
| 70 | 70 | { |
| 71 | 71 | $out = ''; |
| 72 | 72 | if ($label != '') { |
| 73 | - $out .= '<label for="' . $id . '">'; |
|
| 73 | + $out .= '<label for="'.$id.'">'; |
|
| 74 | 74 | } |
| 75 | - $out .= '<input type="' . $type . '"'; |
|
| 76 | - $out .= ($morecss ? ' class="' . $morecss . '"' : ''); |
|
| 75 | + $out .= '<input type="'.$type.'"'; |
|
| 76 | + $out .= ($morecss ? ' class="'.$morecss.'"' : ''); |
|
| 77 | 77 | if ($id != '') { |
| 78 | - $out .= ' id="' . $id . '"'; |
|
| 78 | + $out .= ' id="'.$id.'"'; |
|
| 79 | 79 | } |
| 80 | - $out .= ' name="' . $name . '"'; |
|
| 81 | - $out .= ' value="' . $value . '"'; |
|
| 82 | - $out .= ($moreparam ? ' ' . $moreparam : ''); |
|
| 83 | - $out .= ' />' . $addInputLabel; |
|
| 80 | + $out .= ' name="'.$name.'"'; |
|
| 81 | + $out .= ' value="'.$value.'"'; |
|
| 82 | + $out .= ($moreparam ? ' '.$moreparam : ''); |
|
| 83 | + $out .= ' />'.$addInputLabel; |
|
| 84 | 84 | if ($label != '') { |
| 85 | - $out .= $label . '</label>'; |
|
| 85 | + $out .= $label.'</label>'; |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | return $out; |
@@ -106,17 +106,17 @@ discard block |
||
| 106 | 106 | $out .= '<input'; |
| 107 | 107 | if ($placeholder != '' && $value == '') { |
| 108 | 108 | // to show a placeholder on date input |
| 109 | - $out .= ' type="text" placeholder="' . $placeholder . '" onfocus="(this.type=\'date\')"'; |
|
| 109 | + $out .= ' type="text" placeholder="'.$placeholder.'" onfocus="(this.type=\'date\')"'; |
|
| 110 | 110 | } else { |
| 111 | 111 | $out .= ' type="date"'; |
| 112 | 112 | } |
| 113 | - $out .= ($morecss ? ' class="' . $morecss . '"' : ''); |
|
| 113 | + $out .= ($morecss ? ' class="'.$morecss.'"' : ''); |
|
| 114 | 114 | if ($id != '') { |
| 115 | - $out .= ' id="' . $id . '"'; |
|
| 115 | + $out .= ' id="'.$id.'"'; |
|
| 116 | 116 | } |
| 117 | - $out .= ' name="' . $name . '"'; |
|
| 118 | - $out .= ' value="' . $value . '"'; |
|
| 119 | - $out .= ($moreparam ? ' ' . $moreparam : ''); |
|
| 117 | + $out .= ' name="'.$name.'"'; |
|
| 118 | + $out .= ' value="'.$value.'"'; |
|
| 119 | + $out .= ($moreparam ? ' '.$moreparam : ''); |
|
| 120 | 120 | |
| 121 | 121 | $out .= '>'; |
| 122 | 122 | |
@@ -156,16 +156,16 @@ discard block |
||
| 156 | 156 | $out = ''; |
| 157 | 157 | |
| 158 | 158 | $idname = str_replace(array('[', ']'), array('', ''), $htmlname); |
| 159 | - $out .= '<select id="' . preg_replace('/^\./', '', $idname) . '"' . ($disabled ? ' disabled="disabled"' : '') . ' class="' . ($morecss ? ' ' . $morecss : '') . '"'; |
|
| 160 | - $out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '"' . ($moreparam ? ' ' . $moreparam : ''); |
|
| 161 | - $out .= '>' . "\n"; |
|
| 159 | + $out .= '<select id="'.preg_replace('/^\./', '', $idname).'"'.($disabled ? ' disabled="disabled"' : '').' class="'.($morecss ? ' '.$morecss : '').'"'; |
|
| 160 | + $out .= ' name="'.preg_replace('/^\./', '', $htmlname).'"'.($moreparam ? ' '.$moreparam : ''); |
|
| 161 | + $out .= '>'."\n"; |
|
| 162 | 162 | |
| 163 | 163 | if ($show_empty) { |
| 164 | 164 | $textforempty = ' '; |
| 165 | 165 | if (!is_numeric($show_empty)) { |
| 166 | 166 | $textforempty = $show_empty; |
| 167 | 167 | } |
| 168 | - $out .= '<option value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n"; |
|
| 168 | + $out .= '<option value="'.($show_empty < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n"; |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | if (is_array($array)) { |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | if ($key_in_label) { |
| 200 | - $selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
| 200 | + $selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
| 201 | 201 | } else { |
| 202 | 202 | $selectOptionValue = dol_escape_htmltag($maxlen ? dol_trunc($value, $maxlen) : $value); |
| 203 | 203 | if ($value == '' || $value == '-') { |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | } |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | - $out .= '<option value="' . $key . '"'; |
|
| 208 | + $out .= '<option value="'.$key.'"'; |
|
| 209 | 209 | $out .= $disabled; |
| 210 | 210 | if (is_array($id)) { |
| 211 | 211 | if (in_array($key, $id) && !$disabled) { |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | if (is_array($tmpvalue)) { |
| 221 | 221 | foreach ($tmpvalue as $keyforvalue => $valueforvalue) { |
| 222 | 222 | if (preg_match('/^data-/', $keyforvalue)) { |
| 223 | - $out .= ' ' . $keyforvalue . '="' . dol_escape_htmltag($valueforvalue) . '"'; |
|
| 223 | + $out .= ' '.$keyforvalue.'="'.dol_escape_htmltag($valueforvalue).'"'; |
|
| 224 | 224 | } |
| 225 | 225 | } |
| 226 | 226 | } |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | { |
| 253 | 253 | global $conf; |
| 254 | 254 | |
| 255 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; |
|
| 255 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
| 256 | 256 | |
| 257 | 257 | $out = ''; |
| 258 | 258 | |
@@ -268,21 +268,21 @@ discard block |
||
| 268 | 268 | // Get object entity |
| 269 | 269 | if (isModEnabled('multicompany')) { |
| 270 | 270 | $regs = array(); |
| 271 | - preg_match('/\/([0-9]+)\/[^\/]+\/' . preg_quote($modulesubdir, '/') . '$/', $filedir, $regs); |
|
| 271 | + preg_match('/\/([0-9]+)\/[^\/]+\/'.preg_quote($modulesubdir, '/').'$/', $filedir, $regs); |
|
| 272 | 272 | $entity = ((!empty($regs[1]) && $regs[1] > 1) ? $regs[1] : 1); // If entity id not found in $filedir this is entity 1 by default |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | // Get list of files starting with name of ref (Note: files with '^ref\.extension' are generated files, files with '^ref-...' are uploaded files) |
| 276 | 276 | if ($allfiles || getDolGlobalString('MAIN_SHOW_ALL_FILES_ON_DOCUMENT_TOOLTIP')) { |
| 277 | - $filterforfilesearch = '^' . preg_quote(basename($modulesubdir), '/'); |
|
| 277 | + $filterforfilesearch = '^'.preg_quote(basename($modulesubdir), '/'); |
|
| 278 | 278 | } else { |
| 279 | - $filterforfilesearch = '^' . preg_quote(basename($modulesubdir), '/') . '\.'; |
|
| 279 | + $filterforfilesearch = '^'.preg_quote(basename($modulesubdir), '/').'\.'; |
|
| 280 | 280 | } |
| 281 | 281 | $file_list = dol_dir_list($filedir, 'files', 0, $filterforfilesearch, '\.meta$|\.png$'); // We also discard .meta and .png preview |
| 282 | 282 | |
| 283 | 283 | //var_dump($file_list); |
| 284 | 284 | // For ajax treatment |
| 285 | - $out .= '<!-- html.formfile::getDocumentsLink -->' . "\n"; |
|
| 285 | + $out .= '<!-- html.formfile::getDocumentsLink -->'."\n"; |
|
| 286 | 286 | if (!empty($file_list)) { |
| 287 | 287 | $out = ''; |
| 288 | 288 | $tmpout = ''; |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | $i = 0; |
| 293 | 293 | foreach ($file_list as $file) { |
| 294 | 294 | $i++; |
| 295 | - if ($filter && !preg_match('/' . $filter . '/i', $file["name"])) { |
|
| 295 | + if ($filter && !preg_match('/'.$filter.'/i', $file["name"])) { |
|
| 296 | 296 | continue; // Discard this. It does not match provided filter. |
| 297 | 297 | } |
| 298 | 298 | |
@@ -300,11 +300,11 @@ discard block |
||
| 300 | 300 | // Define relative path for download link (depends on module) |
| 301 | 301 | $relativepath = $file["name"]; // Cas general |
| 302 | 302 | if ($modulesubdir) { |
| 303 | - $relativepath = $modulesubdir . "/" . $file["name"]; // Cas propal, facture... |
|
| 303 | + $relativepath = $modulesubdir."/".$file["name"]; // Cas propal, facture... |
|
| 304 | 304 | } |
| 305 | 305 | // Autre cas |
| 306 | 306 | if ($modulepart == 'donation') { |
| 307 | - $relativepath = get_exdir($modulesubdir, 2, 0, 0, null, 'donation') . $file["name"]; |
|
| 307 | + $relativepath = get_exdir($modulesubdir, 2, 0, 0, null, 'donation').$file["name"]; |
|
| 308 | 308 | } |
| 309 | 309 | if ($modulepart == 'export') { |
| 310 | 310 | $relativepath = $file["name"]; |
@@ -320,8 +320,8 @@ discard block |
||
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | // Download |
| 323 | - $url = $context->getControllerUrl('document') . '&modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($relativepath) . '&soc_id=' . $context->logged_thirdparty->id; |
|
| 324 | - $tmpout .= '<a href="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . ' role="button"'; |
|
| 323 | + $url = $context->getControllerUrl('document').'&modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($relativepath).'&soc_id='.$context->logged_thirdparty->id; |
|
| 324 | + $tmpout .= '<a href="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').' role="button"'; |
|
| 325 | 325 | $mime = dol_mimetype($relativepath, '', 0); |
| 326 | 326 | if (preg_match('/text/', $mime)) { |
| 327 | 327 | $tmpout .= ' target="_blank" rel="noopener noreferrer"'; |
@@ -374,9 +374,9 @@ discard block |
||
| 374 | 374 | $vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]); |
| 375 | 375 | $reg = array(); |
| 376 | 376 | if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) { |
| 377 | - $InfoFieldList[4] = $reg[1]; // take the sort field |
|
| 377 | + $InfoFieldList[4] = $reg[1]; // take the sort field |
|
| 378 | 378 | } |
| 379 | - $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
| 379 | + $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
| 380 | 380 | |
| 381 | 381 | $classname = $InfoFieldList[0]; |
| 382 | 382 | $classpath = $InfoFieldList[1]; |
@@ -399,11 +399,11 @@ discard block |
||
| 399 | 399 | } |
| 400 | 400 | } |
| 401 | 401 | if (!is_object($objecttmp)) { |
| 402 | - dol_syslog('Error bad setup of type for field ' . implode(',', $InfoFieldList), LOG_WARNING); |
|
| 403 | - return 'Error bad setup of type for field ' . implode(',', $InfoFieldList); |
|
| 402 | + dol_syslog('Error bad setup of type for field '.implode(',', $InfoFieldList), LOG_WARNING); |
|
| 403 | + return 'Error bad setup of type for field '.implode(',', $InfoFieldList); |
|
| 404 | 404 | } |
| 405 | 405 | |
| 406 | - dol_syslog(__METHOD__ . ' filter=' . $filter, LOG_DEBUG); |
|
| 406 | + dol_syslog(__METHOD__.' filter='.$filter, LOG_DEBUG); |
|
| 407 | 407 | $out = ''; |
| 408 | 408 | // Immediate load of table record. |
| 409 | 409 | $out .= $this->selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter); |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | if ($prefixforautocompletemode == 'societe') { |
| 440 | 440 | $prefixforautocompletemode = 'company'; |
| 441 | 441 | } |
| 442 | - $confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 442 | + $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 443 | 443 | |
| 444 | 444 | if (in_array($objecttmp->element, array('adherent_type'))) { |
| 445 | 445 | $fieldstoshow = 't.libelle'; |
@@ -447,11 +447,11 @@ discard block |
||
| 447 | 447 | if (!empty($objecttmp->fields)) { // For object that declare it, it is better to use declared fields (like societe, contact, ...) |
| 448 | 448 | $tmpfieldstoshow = ''; |
| 449 | 449 | foreach ($objecttmp->fields as $key => $val) { |
| 450 | - if (! (int) dol_eval($val['enabled'], 1, 1, '1')) { |
|
| 450 | + if (!(int) dol_eval($val['enabled'], 1, 1, '1')) { |
|
| 451 | 451 | continue; |
| 452 | 452 | } |
| 453 | 453 | if (!empty($val['showoncombobox'])) { |
| 454 | - $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key; |
|
| 454 | + $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key; |
|
| 455 | 455 | } |
| 456 | 456 | } |
| 457 | 457 | if ($tmpfieldstoshow) { |
@@ -479,11 +479,11 @@ discard block |
||
| 479 | 479 | $num = 0; |
| 480 | 480 | |
| 481 | 481 | // Search data |
| 482 | - $sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t"; |
|
| 482 | + $sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$objecttmp->table_element." as t"; |
|
| 483 | 483 | if (isset($objecttmp->ismultientitymanaged)) { |
| 484 | 484 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
| 485 | 485 | $tmparray = explode('@', $objecttmp->ismultientitymanaged); |
| 486 | - $sql .= " INNER JOIN " . $this->db->prefix() . $tmparray[1] . " as parenttable ON parenttable.rowid = t." . $tmparray[0]; |
|
| 486 | + $sql .= " INNER JOIN ".$this->db->prefix().$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0]; |
|
| 487 | 487 | } |
| 488 | 488 | } |
| 489 | 489 | |
@@ -502,10 +502,10 @@ discard block |
||
| 502 | 502 | $sql .= " WHERE 1=1"; |
| 503 | 503 | if (isset($objecttmp->ismultientitymanaged)) { |
| 504 | 504 | if ($objecttmp->ismultientitymanaged == 1) { |
| 505 | - $sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")"; |
|
| 505 | + $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")"; |
|
| 506 | 506 | } |
| 507 | 507 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
| 508 | - $sql .= " AND parenttable.entity = t." . $tmparray[0]; |
|
| 508 | + $sql .= " AND parenttable.entity = t.".$tmparray[0]; |
|
| 509 | 509 | } |
| 510 | 510 | } |
| 511 | 511 | if ($searchkey != '') { |
@@ -516,7 +516,7 @@ discard block |
||
| 516 | 516 | $errormessage = ''; |
| 517 | 517 | $sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage); |
| 518 | 518 | if ($errormessage) { |
| 519 | - return 'Error forging a SQL request from an universal criteria: ' . $errormessage; |
|
| 519 | + return 'Error forging a SQL request from an universal criteria: '.$errormessage; |
|
| 520 | 520 | } |
| 521 | 521 | } |
| 522 | 522 | } |
@@ -526,7 +526,7 @@ discard block |
||
| 526 | 526 | $resql = $this->db->query($sql); |
| 527 | 527 | if ($resql) { |
| 528 | 528 | // Construct $out and $outarray |
| 529 | - $out .= '<select id="' . $htmlname . '" class="' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n"; |
|
| 529 | + $out .= '<select id="'.$htmlname.'" class="'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n"; |
|
| 530 | 530 | |
| 531 | 531 | // Warning: Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. Seems it is no more true with selec2 v4 |
| 532 | 532 | $textifempty = ' '; |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | } |
| 541 | 541 | } |
| 542 | 542 | if ($showempty) { |
| 543 | - $out .= '<option value="-1">' . $textifempty . '</option>' . "\n"; |
|
| 543 | + $out .= '<option value="-1">'.$textifempty.'</option>'."\n"; |
|
| 544 | 544 | } |
| 545 | 545 | |
| 546 | 546 | $num = $this->db->num_rows($resql); |
@@ -563,9 +563,9 @@ discard block |
||
| 563 | 563 | } |
| 564 | 564 | if (empty($outputmode)) { |
| 565 | 565 | if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) { |
| 566 | - $out .= '<option value="' . $obj->rowid . '" selected data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
| 566 | + $out .= '<option value="'.$obj->rowid.'" selected data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
| 567 | 567 | } else { |
| 568 | - $out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
| 568 | + $out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
| 569 | 569 | } |
| 570 | 570 | } else { |
| 571 | 571 | array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label)); |
@@ -578,7 +578,7 @@ discard block |
||
| 578 | 578 | } |
| 579 | 579 | } |
| 580 | 580 | |
| 581 | - $out .= '</select>' . "\n"; |
|
| 581 | + $out .= '</select>'."\n"; |
|
| 582 | 582 | } else { |
| 583 | 583 | dol_print_error($this->db); |
| 584 | 584 | } |
@@ -615,22 +615,22 @@ discard block |
||
| 615 | 615 | $size = !empty($val['size']) ? $val['size'] : 0; |
| 616 | 616 | // see common object class |
| 617 | 617 | if (preg_match('/^(integer|link):(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) { |
| 618 | - $param['options'] = array($reg[2] . ':' . $reg[3] . ':' . $reg[4] . ':' . $reg[5] => 'N'); |
|
| 618 | + $param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4].':'.$reg[5] => 'N'); |
|
| 619 | 619 | $type = 'link'; |
| 620 | 620 | } elseif (preg_match('/^(integer|link):(.*):(.*):(.*)/i', $val['type'], $reg)) { |
| 621 | - $param['options'] = array($reg[2] . ':' . $reg[3] . ':' . $reg[4] => 'N'); |
|
| 621 | + $param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4] => 'N'); |
|
| 622 | 622 | $type = 'link'; |
| 623 | 623 | } elseif (preg_match('/^(integer|link):(.*):(.*)/i', $val['type'], $reg)) { |
| 624 | - $param['options'] = array($reg[2] . ':' . $reg[3] => 'N'); |
|
| 624 | + $param['options'] = array($reg[2].':'.$reg[3] => 'N'); |
|
| 625 | 625 | $type = 'link'; |
| 626 | 626 | } elseif (preg_match('/^(sellist):(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) { |
| 627 | - $param['options'] = array($reg[2] . ':' . $reg[3] . ':' . $reg[4] . ':' . $reg[5] => 'N'); |
|
| 627 | + $param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4].':'.$reg[5] => 'N'); |
|
| 628 | 628 | $type = 'sellist'; |
| 629 | 629 | } elseif (preg_match('/^(sellist):(.*):(.*):(.*)/i', $val['type'], $reg)) { |
| 630 | - $param['options'] = array($reg[2] . ':' . $reg[3] . ':' . $reg[4] => 'N'); |
|
| 630 | + $param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4] => 'N'); |
|
| 631 | 631 | $type = 'sellist'; |
| 632 | 632 | } elseif (preg_match('/^(sellist):(.*):(.*)/i', $val['type'], $reg)) { |
| 633 | - $param['options'] = array($reg[2] . ':' . $reg[3] => 'N'); |
|
| 633 | + $param['options'] = array($reg[2].':'.$reg[3] => 'N'); |
|
| 634 | 634 | $type = 'sellist'; |
| 635 | 635 | } elseif (preg_match('/^varchar\((\d+)\)/', $val['type'], $reg)) { |
| 636 | 636 | $param['options'] = array(); |
@@ -668,7 +668,7 @@ discard block |
||
| 668 | 668 | |
| 669 | 669 | if ($computed) { |
| 670 | 670 | if (!preg_match('/^search_/', $keyprefix)) { |
| 671 | - return '<span>' . $langs->trans("AutomaticallyCalculated") . '</span>'; |
|
| 671 | + return '<span>'.$langs->trans("AutomaticallyCalculated").'</span>'; |
|
| 672 | 672 | } else { |
| 673 | 673 | return ''; |
| 674 | 674 | } |
@@ -679,7 +679,7 @@ discard block |
||
| 679 | 679 | $morecss = $val['css']; |
| 680 | 680 | } |
| 681 | 681 | |
| 682 | - $htmlName = $keyprefix . $key . $keysuffix; |
|
| 682 | + $htmlName = $keyprefix.$key.$keysuffix; |
|
| 683 | 683 | $htmlId = $htmlName; |
| 684 | 684 | //$moreparam .= (!empty($required) ? ' required' : ''); |
| 685 | 685 | switch ($type) { |
@@ -699,7 +699,7 @@ discard block |
||
| 699 | 699 | |
| 700 | 700 | if ($type == 'datetime') { |
| 701 | 701 | //$moreparam .= ' step="1"'; to show seconds |
| 702 | - $out .= ' ' . $this->inputType('time', $htmlName.'_time', $valueTime, $htmlId, $morecss, $moreparam); |
|
| 702 | + $out .= ' '.$this->inputType('time', $htmlName.'_time', $valueTime, $htmlId, $morecss, $moreparam); |
|
| 703 | 703 | } |
| 704 | 704 | break; |
| 705 | 705 | |
@@ -709,7 +709,7 @@ discard block |
||
| 709 | 709 | |
| 710 | 710 | case 'text' : |
| 711 | 711 | case 'html' : |
| 712 | - $moreparam .= ($size > 0 ? ' maxlength="' . $size . '"' : ''); |
|
| 712 | + $moreparam .= ($size > 0 ? ' maxlength="'.$size.'"' : ''); |
|
| 713 | 713 | $out = $this->inputType('text', $htmlName, dol_escape_htmltag($value), $htmlId, $morecss, $moreparam); |
| 714 | 714 | break; |
| 715 | 715 | |
@@ -729,7 +729,7 @@ discard block |
||
| 729 | 729 | if (!empty($value)) { |
| 730 | 730 | $value = price($value); // $value in memory is a php numeric, we format it into user number format. |
| 731 | 731 | } |
| 732 | - $addInputLabel = ' ' . $langs->getCurrencySymbol($conf->currency); |
|
| 732 | + $addInputLabel = ' '.$langs->getCurrencySymbol($conf->currency); |
|
| 733 | 733 | $out = $this->inputType('text', $htmlName, $value, $htmlId, $morecss, $moreparam, $addInputLabel); |
| 734 | 734 | break; |
| 735 | 735 | |
@@ -746,14 +746,14 @@ discard block |
||
| 746 | 746 | |
| 747 | 747 | case 'radio' : |
| 748 | 748 | foreach ($param['options'] as $keyopt => $valopt) { |
| 749 | - $htmlId = $htmlName . '_' . $keyopt; |
|
| 750 | - $htmlMoreParam = $moreparam . ($value == $keyopt ? ' checked' : ''); |
|
| 751 | - $out .= $this->inputType('radio', $htmlName, $keyopt, $htmlId, $morecss, $htmlMoreParam, $valopt) . '<br>'; |
|
| 749 | + $htmlId = $htmlName.'_'.$keyopt; |
|
| 750 | + $htmlMoreParam = $moreparam.($value == $keyopt ? ' checked' : ''); |
|
| 751 | + $out .= $this->inputType('radio', $htmlName, $keyopt, $htmlId, $morecss, $htmlMoreParam, $valopt).'<br>'; |
|
| 752 | 752 | } |
| 753 | 753 | break; |
| 754 | 754 | |
| 755 | 755 | case 'select' : |
| 756 | - $out = '<select class="' . $morecss . '" name="' . $htmlName . '" id="' . $htmlId . '"' . ($moreparam ? ' ' . $moreparam : '') . ' >'; |
|
| 756 | + $out = '<select class="'.$morecss.'" name="'.$htmlName.'" id="'.$htmlId.'"'.($moreparam ? ' '.$moreparam : '').' >'; |
|
| 757 | 757 | if ($default == '' || $notNull != 1) { |
| 758 | 758 | $out .= '<option value="0"> </option>'; |
| 759 | 759 | } |
@@ -764,15 +764,15 @@ discard block |
||
| 764 | 764 | if (strpos($valb, "|") !== false) { |
| 765 | 765 | list($valb, $parent) = explode('|', $valb); |
| 766 | 766 | } |
| 767 | - $out .= '<option value="' . $keyb . '"'; |
|
| 767 | + $out .= '<option value="'.$keyb.'"'; |
|
| 768 | 768 | $out .= (((string) $value == $keyb) ? ' selected' : ''); |
| 769 | - $out .= (!empty($parent) ? ' parent="' . $parent . '"' : ''); |
|
| 770 | - $out .= '>' . $valb . '</option>'; |
|
| 769 | + $out .= (!empty($parent) ? ' parent="'.$parent.'"' : ''); |
|
| 770 | + $out .= '>'.$valb.'</option>'; |
|
| 771 | 771 | } |
| 772 | 772 | $out .= '</select>'; |
| 773 | 773 | break; |
| 774 | 774 | case 'sellist' : |
| 775 | - $out = '<select class="' . $morecss . '" name="' . $htmlName . '" id="' . $htmlId . '"' . ($moreparam ? ' ' . $moreparam : '') . '>'; |
|
| 775 | + $out = '<select class="'.$morecss.'" name="'.$htmlName.'" id="'.$htmlId.'"'.($moreparam ? ' '.$moreparam : '').'>'; |
|
| 776 | 776 | |
| 777 | 777 | $param_list = array_keys($param['options']); |
| 778 | 778 | $InfoFieldList = explode(":", $param_list[0]); |
@@ -785,18 +785,18 @@ discard block |
||
| 785 | 785 | // 4 : where clause filter on column or table extrafield, syntax field='value' or extra.field=value |
| 786 | 786 | // 5 : id category type |
| 787 | 787 | // 6 : ids categories list separated by comma for category root |
| 788 | - $keyList = (empty($InfoFieldList[2]) ? 'rowid' : $InfoFieldList[2] . ' as rowid'); |
|
| 788 | + $keyList = (empty($InfoFieldList[2]) ? 'rowid' : $InfoFieldList[2].' as rowid'); |
|
| 789 | 789 | |
| 790 | 790 | if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) { |
| 791 | 791 | if (strpos($InfoFieldList[4], 'extra.') !== false) { |
| 792 | - $keyList = 'main.' . $InfoFieldList[2] . ' as rowid'; |
|
| 792 | + $keyList = 'main.'.$InfoFieldList[2].' as rowid'; |
|
| 793 | 793 | } else { |
| 794 | - $keyList = $InfoFieldList[2] . ' as rowid'; |
|
| 794 | + $keyList = $InfoFieldList[2].' as rowid'; |
|
| 795 | 795 | } |
| 796 | 796 | } |
| 797 | 797 | if (count($InfoFieldList) > 3 && !empty($InfoFieldList[3])) { |
| 798 | 798 | list($parentName, $parentField) = explode('|', $InfoFieldList[3]); |
| 799 | - $keyList .= ', ' . $parentField; |
|
| 799 | + $keyList .= ', '.$parentField; |
|
| 800 | 800 | } |
| 801 | 801 | |
| 802 | 802 | $filter_categorie = false; |
@@ -814,8 +814,8 @@ discard block |
||
| 814 | 814 | } |
| 815 | 815 | |
| 816 | 816 | $sqlwhere = ''; |
| 817 | - $sql = "SELECT " . $keyList; |
|
| 818 | - $sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0]; |
|
| 817 | + $sql = "SELECT ".$keyList; |
|
| 818 | + $sql .= " FROM ".$this->db->prefix().$InfoFieldList[0]; |
|
| 819 | 819 | if (!empty($InfoFieldList[4])) { |
| 820 | 820 | // can use SELECT request |
| 821 | 821 | if (strpos($InfoFieldList[4], '$SEL$') !== false) { |
@@ -827,24 +827,24 @@ discard block |
||
| 827 | 827 | |
| 828 | 828 | //We have to join on extrafield table |
| 829 | 829 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
| 830 | - $sql .= " as main, " . $this->db->prefix() . $InfoFieldList[0] . "_extrafields as extra"; |
|
| 831 | - $sqlwhere .= " WHERE extra.fk_object=main." . $InfoFieldList[2] . " AND " . $InfoFieldList[4]; |
|
| 830 | + $sql .= " as main, ".$this->db->prefix().$InfoFieldList[0]."_extrafields as extra"; |
|
| 831 | + $sqlwhere .= " WHERE extra.fk_object=main.".$InfoFieldList[2]." AND ".$InfoFieldList[4]; |
|
| 832 | 832 | } else { |
| 833 | - $sqlwhere .= " WHERE " . $InfoFieldList[4]; |
|
| 833 | + $sqlwhere .= " WHERE ".$InfoFieldList[4]; |
|
| 834 | 834 | } |
| 835 | 835 | } else { |
| 836 | 836 | $sqlwhere .= ' WHERE 1=1'; |
| 837 | 837 | } |
| 838 | 838 | // Some tables may have field, some other not. For the moment we disable it. |
| 839 | 839 | if (in_array($InfoFieldList[0], array('tablewithentity'))) { |
| 840 | - $sqlwhere .= " AND entity = " . ((int) $conf->entity); |
|
| 840 | + $sqlwhere .= " AND entity = ".((int) $conf->entity); |
|
| 841 | 841 | } |
| 842 | 842 | $sql .= $sqlwhere; |
| 843 | 843 | //print $sql; |
| 844 | 844 | |
| 845 | - $sql .= ' ORDER BY ' . implode(', ', $fields_label); |
|
| 845 | + $sql .= ' ORDER BY '.implode(', ', $fields_label); |
|
| 846 | 846 | |
| 847 | - dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG); |
|
| 847 | + dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG); |
|
| 848 | 848 | $resql = $this->db->query($sql); |
| 849 | 849 | if ($resql) { |
| 850 | 850 | $out .= '<option value="0"> </option>'; |
@@ -860,7 +860,7 @@ discard block |
||
| 860 | 860 | if (count($fields_label) > 1) { |
| 861 | 861 | $notrans = true; |
| 862 | 862 | foreach ($fields_label as $field_toshow) { |
| 863 | - $labeltoshow .= $obj->$field_toshow . ' '; |
|
| 863 | + $labeltoshow .= $obj->$field_toshow.' '; |
|
| 864 | 864 | } |
| 865 | 865 | } else { |
| 866 | 866 | $labeltoshow = $obj->{$InfoFieldList[1]}; |
@@ -871,12 +871,12 @@ discard block |
||
| 871 | 871 | foreach ($fields_label as $field_toshow) { |
| 872 | 872 | $translabel = $langs->trans($obj->$field_toshow); |
| 873 | 873 | if ($translabel != $obj->$field_toshow) { |
| 874 | - $labeltoshow = dol_trunc($translabel) . ' '; |
|
| 874 | + $labeltoshow = dol_trunc($translabel).' '; |
|
| 875 | 875 | } else { |
| 876 | - $labeltoshow = dol_trunc($obj->$field_toshow) . ' '; |
|
| 876 | + $labeltoshow = dol_trunc($obj->$field_toshow).' '; |
|
| 877 | 877 | } |
| 878 | 878 | } |
| 879 | - $out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>'; |
|
| 879 | + $out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>'; |
|
| 880 | 880 | } else { |
| 881 | 881 | if (!$notrans) { |
| 882 | 882 | $translabel = $langs->trans($obj->{$InfoFieldList[1]}); |
@@ -890,34 +890,34 @@ discard block |
||
| 890 | 890 | $labeltoshow = '(not defined)'; |
| 891 | 891 | } |
| 892 | 892 | if ($value == $obj->rowid) { |
| 893 | - $out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>'; |
|
| 893 | + $out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>'; |
|
| 894 | 894 | } |
| 895 | 895 | |
| 896 | 896 | if (!empty($InfoFieldList[3]) && $parentField) { |
| 897 | - $parent = $parentName . ':' . $obj->{$parentField}; |
|
| 897 | + $parent = $parentName.':'.$obj->{$parentField}; |
|
| 898 | 898 | $isDependList = 1; |
| 899 | 899 | } |
| 900 | 900 | |
| 901 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 901 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 902 | 902 | $out .= ($value == $obj->rowid ? ' selected' : ''); |
| 903 | - $out .= (!empty($parent) ? ' parent="' . $parent . '"' : ''); |
|
| 904 | - $out .= '>' . $labeltoshow . '</option>'; |
|
| 903 | + $out .= (!empty($parent) ? ' parent="'.$parent.'"' : ''); |
|
| 904 | + $out .= '>'.$labeltoshow.'</option>'; |
|
| 905 | 905 | } |
| 906 | 906 | |
| 907 | 907 | $i++; |
| 908 | 908 | } |
| 909 | 909 | $this->db->free($resql); |
| 910 | 910 | } else { |
| 911 | - $out .= 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>'; |
|
| 911 | + $out .= 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>'; |
|
| 912 | 912 | } |
| 913 | 913 | } else { |
| 914 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 914 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 915 | 915 | $data = $this->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1); |
| 916 | 916 | $out .= '<option value="0"> </option>'; |
| 917 | 917 | foreach ($data as $data_key => $data_value) { |
| 918 | - $out .= '<option value="' . $data_key . '"'; |
|
| 918 | + $out .= '<option value="'.$data_key.'"'; |
|
| 919 | 919 | $out .= ($value == $data_key ? ' selected' : ''); |
| 920 | - $out .= '>' . $data_value . '</option>'; |
|
| 920 | + $out .= '>'.$data_value.'</option>'; |
|
| 921 | 921 | } |
| 922 | 922 | } |
| 923 | 923 | $out .= '</select>'; |
@@ -989,19 +989,19 @@ discard block |
||
| 989 | 989 | } |
| 990 | 990 | if (preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg)) { |
| 991 | 991 | $type = 'link'; |
| 992 | - $stringforoptions = $reg[1] . ':' . $reg[2]; |
|
| 992 | + $stringforoptions = $reg[1].':'.$reg[2]; |
|
| 993 | 993 | if ($reg[1] == 'User') { |
| 994 | 994 | $stringforoptions .= ':-1'; |
| 995 | 995 | } |
| 996 | 996 | $param['options'] = array($stringforoptions => $stringforoptions); |
| 997 | 997 | } elseif (preg_match('/^sellist:(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) { |
| 998 | - $param['options'] = array($reg[1] . ':' . $reg[2] . ':' . $reg[3] . ':' . $reg[4] => 'N'); |
|
| 998 | + $param['options'] = array($reg[1].':'.$reg[2].':'.$reg[3].':'.$reg[4] => 'N'); |
|
| 999 | 999 | $type = 'sellist'; |
| 1000 | 1000 | } elseif (preg_match('/^sellist:(.*):(.*):(.*)/i', $val['type'], $reg)) { |
| 1001 | - $param['options'] = array($reg[1] . ':' . $reg[2] . ':' . $reg[3] => 'N'); |
|
| 1001 | + $param['options'] = array($reg[1].':'.$reg[2].':'.$reg[3] => 'N'); |
|
| 1002 | 1002 | $type = 'sellist'; |
| 1003 | 1003 | } elseif (preg_match('/^sellist:(.*):(.*)/i', $val['type'], $reg)) { |
| 1004 | - $param['options'] = array($reg[1] . ':' . $reg[2] => 'N'); |
|
| 1004 | + $param['options'] = array($reg[1].':'.$reg[2] => 'N'); |
|
| 1005 | 1005 | $type = 'sellist'; |
| 1006 | 1006 | } elseif (preg_match('/^chkbxlst:(.*)/i', $val['type'], $reg)) { |
| 1007 | 1007 | $param['options'] = array($reg[1] => 'N'); |
@@ -1037,7 +1037,7 @@ discard block |
||
| 1037 | 1037 | $value = $object->getLibStatut(3); |
| 1038 | 1038 | } elseif ($type == 'date') { |
| 1039 | 1039 | if (!empty($value)) { |
| 1040 | - $value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output) |
|
| 1040 | + $value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output) |
|
| 1041 | 1041 | } else { |
| 1042 | 1042 | $value = ''; |
| 1043 | 1043 | } |
@@ -1048,7 +1048,7 @@ discard block |
||
| 1048 | 1048 | $value = ''; |
| 1049 | 1049 | } |
| 1050 | 1050 | } elseif ($type == 'duration') { |
| 1051 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
| 1051 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
| 1052 | 1052 | if (!is_null($value) && $value !== '') { |
| 1053 | 1053 | $value = convertSecondToTime($value, 'allhourmin'); |
| 1054 | 1054 | } |
@@ -1061,7 +1061,7 @@ discard block |
||
| 1061 | 1061 | if (!empty($value)) { |
| 1062 | 1062 | $checked = ' checked '; |
| 1063 | 1063 | } |
| 1064 | - $value = '<input type="checkbox" ' . $checked . ' ' . ($moreparam ? $moreparam : '') . ' readonly disabled>'; |
|
| 1064 | + $value = '<input type="checkbox" '.$checked.' '.($moreparam ? $moreparam : '').' readonly disabled>'; |
|
| 1065 | 1065 | } elseif ($type == 'mail' || $type == 'email') { |
| 1066 | 1066 | $value = dol_print_email($value, 0, 0, 0, 64, 1, 1); |
| 1067 | 1067 | } elseif ($type == 'url') { |
@@ -1085,7 +1085,7 @@ discard block |
||
| 1085 | 1085 | |
| 1086 | 1086 | if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) { |
| 1087 | 1087 | $selectkey = $InfoFieldList[2]; |
| 1088 | - $keyList = $InfoFieldList[2] . ' as rowid'; |
|
| 1088 | + $keyList = $InfoFieldList[2].' as rowid'; |
|
| 1089 | 1089 | } |
| 1090 | 1090 | |
| 1091 | 1091 | $fields_label = explode('|', $InfoFieldList[1]); |
@@ -1101,20 +1101,20 @@ discard block |
||
| 1101 | 1101 | } |
| 1102 | 1102 | } |
| 1103 | 1103 | |
| 1104 | - $sql = "SELECT " . $keyList; |
|
| 1105 | - $sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0]; |
|
| 1104 | + $sql = "SELECT ".$keyList; |
|
| 1105 | + $sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0]; |
|
| 1106 | 1106 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
| 1107 | 1107 | $sql .= ' as main'; |
| 1108 | 1108 | } |
| 1109 | 1109 | if ($selectkey == 'rowid' && empty($value)) { |
| 1110 | - $sql .= " WHERE " . $selectkey . " = 0"; |
|
| 1110 | + $sql .= " WHERE ".$selectkey." = 0"; |
|
| 1111 | 1111 | } elseif ($selectkey == 'rowid') { |
| 1112 | - $sql .= " WHERE " . $selectkey . " = " . ((int) $value); |
|
| 1112 | + $sql .= " WHERE ".$selectkey." = ".((int) $value); |
|
| 1113 | 1113 | } else { |
| 1114 | - $sql .= " WHERE " . $selectkey . " = '" . $this->db->escape($value) . "'"; |
|
| 1114 | + $sql .= " WHERE ".$selectkey." = '".$this->db->escape($value)."'"; |
|
| 1115 | 1115 | } |
| 1116 | 1116 | |
| 1117 | - dol_syslog(__METHOD__ . ' type=sellist', LOG_DEBUG); |
|
| 1117 | + dol_syslog(__METHOD__.' type=sellist', LOG_DEBUG); |
|
| 1118 | 1118 | $resql = $this->db->query($sql); |
| 1119 | 1119 | if ($resql) { |
| 1120 | 1120 | if ($filter_categorie === false) { |
@@ -1133,9 +1133,9 @@ discard block |
||
| 1133 | 1133 | $translabel = $langs->trans($obj->$field_toshow); |
| 1134 | 1134 | } |
| 1135 | 1135 | if ($translabel != $field_toshow) { |
| 1136 | - $value .= dol_trunc($translabel, 18) . ' '; |
|
| 1136 | + $value .= dol_trunc($translabel, 18).' '; |
|
| 1137 | 1137 | } else { |
| 1138 | - $value .= $obj->$field_toshow . ' '; |
|
| 1138 | + $value .= $obj->$field_toshow.' '; |
|
| 1139 | 1139 | } |
| 1140 | 1140 | } |
| 1141 | 1141 | } else { |
@@ -1151,7 +1151,7 @@ discard block |
||
| 1151 | 1151 | } |
| 1152 | 1152 | } |
| 1153 | 1153 | } else { |
| 1154 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 1154 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 1155 | 1155 | |
| 1156 | 1156 | $toprint = array(); |
| 1157 | 1157 | $obj = $this->db->fetch_object($resql); |
@@ -1159,12 +1159,12 @@ discard block |
||
| 1159 | 1159 | $c->fetch($obj->rowid); |
| 1160 | 1160 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
| 1161 | 1161 | foreach ($ways as $way) { |
| 1162 | - $toprint[] = '<li>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
| 1162 | + $toprint[] = '<li>'.img_object('', 'category').' '.$way.'</li>'; |
|
| 1163 | 1163 | } |
| 1164 | - $value = '<div><ul>' . implode(' ', $toprint) . '</ul></div>'; |
|
| 1164 | + $value = '<div><ul>'.implode(' ', $toprint).'</ul></div>'; |
|
| 1165 | 1165 | } |
| 1166 | 1166 | } else { |
| 1167 | - dol_syslog(__METHOD__ . ' error ' . $this->db->lasterror(), LOG_WARNING); |
|
| 1167 | + dol_syslog(__METHOD__.' error '.$this->db->lasterror(), LOG_WARNING); |
|
| 1168 | 1168 | } |
| 1169 | 1169 | } elseif ($type == 'radio') { |
| 1170 | 1170 | $value = $param['options'][$value]; |
@@ -1175,11 +1175,11 @@ discard block |
||
| 1175 | 1175 | $toprint = array(); |
| 1176 | 1176 | foreach ($value_arr as $valueval) { |
| 1177 | 1177 | if (!empty($valueval)) { |
| 1178 | - $toprint[] = '<li>' . $param['options'][$valueval] . '</li>'; |
|
| 1178 | + $toprint[] = '<li>'.$param['options'][$valueval].'</li>'; |
|
| 1179 | 1179 | } |
| 1180 | 1180 | } |
| 1181 | 1181 | if (!empty($toprint)) { |
| 1182 | - $value = '<div><ul>' . implode(' ', $toprint) . '</ul></div>'; |
|
| 1182 | + $value = '<div><ul>'.implode(' ', $toprint).'</ul></div>'; |
|
| 1183 | 1183 | } |
| 1184 | 1184 | } |
| 1185 | 1185 | } elseif ($type == 'chkbxlst') { |
@@ -1193,7 +1193,7 @@ discard block |
||
| 1193 | 1193 | |
| 1194 | 1194 | if (count($InfoFieldList) >= 3) { |
| 1195 | 1195 | $selectkey = $InfoFieldList[2]; |
| 1196 | - $keyList = $InfoFieldList[2] . ' as rowid'; |
|
| 1196 | + $keyList = $InfoFieldList[2].' as rowid'; |
|
| 1197 | 1197 | } |
| 1198 | 1198 | |
| 1199 | 1199 | $fields_label = explode('|', $InfoFieldList[1]); |
@@ -1209,15 +1209,15 @@ discard block |
||
| 1209 | 1209 | } |
| 1210 | 1210 | } |
| 1211 | 1211 | |
| 1212 | - $sql = "SELECT " . $keyList; |
|
| 1213 | - $sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0]; |
|
| 1212 | + $sql = "SELECT ".$keyList; |
|
| 1213 | + $sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0]; |
|
| 1214 | 1214 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
| 1215 | 1215 | $sql .= ' as main'; |
| 1216 | 1216 | } |
| 1217 | 1217 | // $sql.= " WHERE ".$selectkey."='".$this->db->escape($value)."'"; |
| 1218 | 1218 | // $sql.= ' AND entity = '.$conf->entity; |
| 1219 | 1219 | |
| 1220 | - dol_syslog(__METHOD__ . ' type=chkbxlst', LOG_DEBUG); |
|
| 1220 | + dol_syslog(__METHOD__.' type=chkbxlst', LOG_DEBUG); |
|
| 1221 | 1221 | $resql = $this->db->query($sql); |
| 1222 | 1222 | if ($resql) { |
| 1223 | 1223 | if ($filter_categorie === false) { |
@@ -1234,9 +1234,9 @@ discard block |
||
| 1234 | 1234 | $translabel = $langs->trans($obj->$field_toshow); |
| 1235 | 1235 | } |
| 1236 | 1236 | if ($translabel != $field_toshow) { |
| 1237 | - $toprint[] = '<li>' . dol_trunc($translabel, 18) . '</li>'; |
|
| 1237 | + $toprint[] = '<li>'.dol_trunc($translabel, 18).'</li>'; |
|
| 1238 | 1238 | } else { |
| 1239 | - $toprint[] = '<li>' . $obj->$field_toshow . '</li>'; |
|
| 1239 | + $toprint[] = '<li>'.$obj->$field_toshow.'</li>'; |
|
| 1240 | 1240 | } |
| 1241 | 1241 | } |
| 1242 | 1242 | } else { |
@@ -1245,15 +1245,15 @@ discard block |
||
| 1245 | 1245 | $translabel = $langs->trans($obj->{$InfoFieldList[1]}); |
| 1246 | 1246 | } |
| 1247 | 1247 | if ($translabel != $obj->{$InfoFieldList[1]}) { |
| 1248 | - $toprint[] = '<li>' . dol_trunc($translabel, 18) . '</li>'; |
|
| 1248 | + $toprint[] = '<li>'.dol_trunc($translabel, 18).'</li>'; |
|
| 1249 | 1249 | } else { |
| 1250 | - $toprint[] = '<li>' . $obj->{$InfoFieldList[1]} . '</li>'; |
|
| 1250 | + $toprint[] = '<li>'.$obj->{$InfoFieldList[1]}.'</li>'; |
|
| 1251 | 1251 | } |
| 1252 | 1252 | } |
| 1253 | 1253 | } |
| 1254 | 1254 | } |
| 1255 | 1255 | } else { |
| 1256 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 1256 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 1257 | 1257 | |
| 1258 | 1258 | $toprint = array(); |
| 1259 | 1259 | while ($obj = $this->db->fetch_object($resql)) { |
@@ -1262,14 +1262,14 @@ discard block |
||
| 1262 | 1262 | $c->fetch($obj->rowid); |
| 1263 | 1263 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
| 1264 | 1264 | foreach ($ways as $way) { |
| 1265 | - $toprint[] = '<li>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
| 1265 | + $toprint[] = '<li>'.img_object('', 'category').' '.$way.'</li>'; |
|
| 1266 | 1266 | } |
| 1267 | 1267 | } |
| 1268 | 1268 | } |
| 1269 | 1269 | } |
| 1270 | - $value = '<div><ul>' . implode(' ', $toprint) . '</ul></div>'; |
|
| 1270 | + $value = '<div><ul>'.implode(' ', $toprint).'</ul></div>'; |
|
| 1271 | 1271 | } else { |
| 1272 | - dol_syslog(__METHOD__ . ' error ' . $this->db->lasterror(), LOG_WARNING); |
|
| 1272 | + dol_syslog(__METHOD__.' error '.$this->db->lasterror(), LOG_WARNING); |
|
| 1273 | 1273 | } |
| 1274 | 1274 | } elseif ($type == 'link') { |
| 1275 | 1275 | // only if something to display (perf) |
@@ -1296,7 +1296,7 @@ discard block |
||
| 1296 | 1296 | } |
| 1297 | 1297 | } |
| 1298 | 1298 | } else { |
| 1299 | - dol_syslog(__METHOD__ . ' Error bad setup of field', LOG_WARNING); |
|
| 1299 | + dol_syslog(__METHOD__.' Error bad setup of field', LOG_WARNING); |
|
| 1300 | 1300 | return 'Error bad setup of field'; |
| 1301 | 1301 | } |
| 1302 | 1302 | } else { |
@@ -24,8 +24,8 @@ discard block |
||
| 24 | 24 | * \brief File of class with all html predefined components for WebPortal |
| 25 | 25 | */ |
| 26 | 26 | |
| 27 | -require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 28 | -require_once DOL_DOCUMENT_ROOT . '/core/class/discount.class.php'; |
|
| 27 | +require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 28 | +require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; |
|
| 29 | 29 | dol_include_once('/webportal/class/html.formwebportal.class.php'); |
| 30 | 30 | |
| 31 | 31 | /** |
@@ -133,10 +133,10 @@ discard block |
||
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | // load module libraries |
| 136 | - dol_include_once('/webportal/class/webportal' . $elementEn . '.class.php'); |
|
| 136 | + dol_include_once('/webportal/class/webportal'.$elementEn.'.class.php'); |
|
| 137 | 137 | |
| 138 | 138 | // Initialize technical objects |
| 139 | - $objectclass = 'WebPortal' . ucfirst($elementEn); |
|
| 139 | + $objectclass = 'WebPortal'.ucfirst($elementEn); |
|
| 140 | 140 | $object = new $objectclass($this->db); |
| 141 | 141 | |
| 142 | 142 | // set form list |
@@ -146,18 +146,18 @@ discard block |
||
| 146 | 146 | $this->sortfield = GETPOST('sortfield', 'aZ09comma'); |
| 147 | 147 | $this->sortorder = GETPOST('sortorder', 'aZ09comma'); |
| 148 | 148 | $this->page = GETPOSTISSET('page') ? GETPOSTINT('page') : 1; |
| 149 | - $this->titleKey = $objectclass . 'ListTitle'; |
|
| 149 | + $this->titleKey = $objectclass.'ListTitle'; |
|
| 150 | 150 | |
| 151 | 151 | // Initialize array of search criteria |
| 152 | 152 | //$search_all = GETPOST('search_all', 'alphanohtml'); |
| 153 | 153 | $search = array(); |
| 154 | 154 | foreach ($object->fields as $key => $val) { |
| 155 | - if (GETPOST('search_' . $key, 'alpha') !== '') { |
|
| 156 | - $search[$key] = GETPOST('search_' . $key, 'alpha'); |
|
| 155 | + if (GETPOST('search_'.$key, 'alpha') !== '') { |
|
| 156 | + $search[$key] = GETPOST('search_'.$key, 'alpha'); |
|
| 157 | 157 | } |
| 158 | 158 | if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
| 159 | - $postDateStart = GETPOST('search_' . $key . '_dtstart', 'alphanohtml'); |
|
| 160 | - $postDateEnd = GETPOST('search_' . $key . '_dtend', 'alphanohtml'); |
|
| 159 | + $postDateStart = GETPOST('search_'.$key.'_dtstart', 'alphanohtml'); |
|
| 160 | + $postDateEnd = GETPOST('search_'.$key.'_dtend', 'alphanohtml'); |
|
| 161 | 161 | // extract date YYYY-MM-DD for year, month and day |
| 162 | 162 | $dateStartArr = explode('-', $postDateStart); |
| 163 | 163 | $dateEndArr = explode('-', $postDateEnd); |
@@ -165,13 +165,13 @@ discard block |
||
| 165 | 165 | $dateStartYear = (int) $dateStartArr[0]; |
| 166 | 166 | $dateStartMonth = (int) $dateStartArr[1]; |
| 167 | 167 | $dateStartDay = (int) $dateStartArr[2]; |
| 168 | - $search[$key . '_dtstart'] = dol_mktime(0, 0, 0, $dateStartMonth, $dateStartDay, $dateStartYear); |
|
| 168 | + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, $dateStartMonth, $dateStartDay, $dateStartYear); |
|
| 169 | 169 | } |
| 170 | 170 | if (count($dateEndArr) == 3) { |
| 171 | 171 | $dateEndYear = (int) $dateEndArr[0]; |
| 172 | 172 | $dateEndMonth = (int) $dateEndArr[1]; |
| 173 | 173 | $dateEndDay = (int) $dateEndArr[2]; |
| 174 | - $search[$key . '_dtend'] = dol_mktime(23, 59, 59, $dateEndMonth, $dateEndDay, $dateEndYear); |
|
| 174 | + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, $dateEndMonth, $dateEndDay, $dateEndYear); |
|
| 175 | 175 | } |
| 176 | 176 | } |
| 177 | 177 | } |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | // If $val['visible']==0, then we never show the field |
| 187 | 187 | if (!empty($val['visible'])) { |
| 188 | 188 | $visible = (int) dol_eval($val['visible'], 1); |
| 189 | - $arrayfields['t.' . $key] = array( |
|
| 189 | + $arrayfields['t.'.$key] = array( |
|
| 190 | 190 | 'label' => $val['label'], |
| 191 | 191 | 'checked' => (($visible < 0) ? 0 : 1), |
| 192 | 192 | 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), |
@@ -222,8 +222,8 @@ discard block |
||
| 222 | 222 | foreach ($object->fields as $key => $val) { |
| 223 | 223 | $search[$key] = ''; |
| 224 | 224 | if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
| 225 | - $search[$key . '_dtstart'] = ''; |
|
| 226 | - $search[$key . '_dtend'] = ''; |
|
| 225 | + $search[$key.'_dtstart'] = ''; |
|
| 226 | + $search[$key.'_dtend'] = ''; |
|
| 227 | 227 | } |
| 228 | 228 | } |
| 229 | 229 | $this->search = $search; |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | $offset = $limit * ($page - 1); |
| 279 | 279 | if (!$sortfield) { |
| 280 | 280 | reset($object->fields); // Reset is required to avoid key() to return null. |
| 281 | - $sortfield = 't.' . key($object->fields); // Set here default search field. By default 1st field in definition. |
|
| 281 | + $sortfield = 't.'.key($object->fields); // Set here default search field. By default 1st field in definition. |
|
| 282 | 282 | } |
| 283 | 283 | if (!$sortorder) { |
| 284 | 284 | $sortorder = 'DESC'; |
@@ -297,18 +297,18 @@ discard block |
||
| 297 | 297 | |
| 298 | 298 | $sqlfields = $sql; // $sql fields to remove for count total |
| 299 | 299 | |
| 300 | - $sql .= " FROM " . $this->db->prefix() . $object->table_element . " as t"; |
|
| 300 | + $sql .= " FROM ".$this->db->prefix().$object->table_element." as t"; |
|
| 301 | 301 | // Add table from hooks |
| 302 | 302 | $parameters = array(); |
| 303 | 303 | $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
| 304 | 304 | $sql .= $hookmanager->resPrint; |
| 305 | 305 | if ($object->ismultientitymanaged == 1) { |
| 306 | - $sql .= " WHERE t.entity IN (" . getEntity($object->element, (GETPOSTINT('search_current_entity') ? 0 : 1)) . ")"; |
|
| 306 | + $sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOSTINT('search_current_entity') ? 0 : 1)).")"; |
|
| 307 | 307 | } else { |
| 308 | 308 | $sql .= " WHERE 1 = 1"; |
| 309 | 309 | } |
| 310 | 310 | // filter on logged third-party |
| 311 | - $sql .= " AND t.fk_soc = " . (int) $context->logged_thirdparty->id; |
|
| 311 | + $sql .= " AND t.fk_soc = ".(int) $context->logged_thirdparty->id; |
|
| 312 | 312 | foreach ($search as $key => $val) { |
| 313 | 313 | if (array_key_exists($key, $object->fields)) { |
| 314 | 314 | if (($key == 'status' || $key == 'fk_statut') && $search[$key] == $emptyValueKey) { |
@@ -322,17 +322,17 @@ discard block |
||
| 322 | 322 | $mode_search = 2; |
| 323 | 323 | } |
| 324 | 324 | if ($search[$key] != '') { |
| 325 | - $sql .= natural_search("t." . $this->db->escape($key), $search[$key], (($key == 'status' || $key == 'fk_statut') ? ($search[$key] < 0 ? 1 : 2) : $mode_search)); |
|
| 325 | + $sql .= natural_search("t.".$this->db->escape($key), $search[$key], (($key == 'status' || $key == 'fk_statut') ? ($search[$key] < 0 ? 1 : 2) : $mode_search)); |
|
| 326 | 326 | } |
| 327 | 327 | } else { |
| 328 | 328 | if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { |
| 329 | 329 | $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key); |
| 330 | 330 | if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { |
| 331 | 331 | if (preg_match('/_dtstart$/', $key)) { |
| 332 | - $sql .= " AND t." . $this->db->escape($columnName) . " >= '" . $this->db->idate($search[$key]) . "'"; |
|
| 332 | + $sql .= " AND t.".$this->db->escape($columnName)." >= '".$this->db->idate($search[$key])."'"; |
|
| 333 | 333 | } |
| 334 | 334 | if (preg_match('/_dtend$/', $key)) { |
| 335 | - $sql .= " AND t." . $this->db->escape($columnName) . " <= '" . $this->db->idate($search[$key]) . "'"; |
|
| 335 | + $sql .= " AND t.".$this->db->escape($columnName)." <= '".$this->db->idate($search[$key])."'"; |
|
| 336 | 336 | } |
| 337 | 337 | } |
| 338 | 338 | } |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | $nbtotalofrecords = 0; |
| 351 | 351 | if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { |
| 352 | 352 | /* The fast and low memory method to get and count full list converts the sql into a sql count */ |
| 353 | - $sqlforcount = preg_replace('/^' . preg_quote($sqlfields, '/') . '/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); |
|
| 353 | + $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); |
|
| 354 | 354 | $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); |
| 355 | 355 | $resql = $this->db->query($sqlforcount); |
| 356 | 356 | if ($resql) { |
@@ -403,21 +403,21 @@ discard block |
||
| 403 | 403 | } |
| 404 | 404 | |
| 405 | 405 | $param = ''; |
| 406 | - $param .= '&contextpage=' . urlencode($contextpage); |
|
| 407 | - $param .= '&limit=' . $limit; |
|
| 406 | + $param .= '&contextpage='.urlencode($contextpage); |
|
| 407 | + $param .= '&limit='.$limit; |
|
| 408 | 408 | foreach ($search as $key => $val) { |
| 409 | 409 | if (is_array($search[$key])) { |
| 410 | 410 | foreach ($search[$key] as $skey) { |
| 411 | 411 | if ($skey != '') { |
| 412 | - $param .= '&search_' . $key . '[]=' . urlencode($skey); |
|
| 412 | + $param .= '&search_'.$key.'[]='.urlencode($skey); |
|
| 413 | 413 | } |
| 414 | 414 | } |
| 415 | 415 | } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) { |
| 416 | - $param .= '&search_' . $key . 'month=' . (GETPOSTINT('search_' . $key . 'month')); |
|
| 417 | - $param .= '&search_' . $key . 'day=' . (GETPOSTINT('search_' . $key . 'day')); |
|
| 418 | - $param .= '&search_' . $key . 'year=' . (GETPOSTINT('search_' . $key . 'year')); |
|
| 416 | + $param .= '&search_'.$key.'month='.(GETPOSTINT('search_'.$key.'month')); |
|
| 417 | + $param .= '&search_'.$key.'day='.(GETPOSTINT('search_'.$key.'day')); |
|
| 418 | + $param .= '&search_'.$key.'year='.(GETPOSTINT('search_'.$key.'year')); |
|
| 419 | 419 | } elseif ($search[$key] != '') { |
| 420 | - $param .= '&search_' . $key . '=' . urlencode($search[$key]); |
|
| 420 | + $param .= '&search_'.$key.'='.urlencode($search[$key]); |
|
| 421 | 421 | } |
| 422 | 422 | } |
| 423 | 423 | // Add $param from hooks |
@@ -426,29 +426,29 @@ discard block |
||
| 426 | 426 | $param .= $hookmanager->resPrint; |
| 427 | 427 | |
| 428 | 428 | $url_file = $context->getControllerUrl($context->controller); |
| 429 | - $html .= '<form method="POST" id="searchFormList" action="' . $url_file . '">' . "\n"; |
|
| 429 | + $html .= '<form method="POST" id="searchFormList" action="'.$url_file.'">'."\n"; |
|
| 430 | 430 | $html .= $context->getFormToken(); |
| 431 | 431 | $html .= '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; |
| 432 | 432 | $html .= '<input type="hidden" name="action" value="list">'; |
| 433 | - $html .= '<input type="hidden" name="sortfield" value="' . $sortfield . '">'; |
|
| 434 | - $html .= '<input type="hidden" name="sortorder" value="' . $sortorder . '">'; |
|
| 435 | - $html .= '<input type="hidden" name="page" value="' . $page . '">'; |
|
| 436 | - $html .= '<input type="hidden" name="contextpage" value="' . $contextpage . '">'; |
|
| 433 | + $html .= '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; |
|
| 434 | + $html .= '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; |
|
| 435 | + $html .= '<input type="hidden" name="page" value="'.$page.'">'; |
|
| 436 | + $html .= '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; |
|
| 437 | 437 | |
| 438 | 438 | // pagination |
| 439 | - $pagination_param = $param . '&sortfield=' . $sortfield . '&sortorder=' . $sortorder; |
|
| 440 | - $html .= '<nav id="webportal-' . $elementEn . '-pagination">'; |
|
| 439 | + $pagination_param = $param.'&sortfield='.$sortfield.'&sortorder='.$sortorder; |
|
| 440 | + $html .= '<nav id="webportal-'.$elementEn.'-pagination">'; |
|
| 441 | 441 | $html .= '<ul>'; |
| 442 | - $html .= '<li><strong>' . $langs->trans($titleKey) . '</strong> (' . $nbtotalofrecords . ')</li>'; |
|
| 442 | + $html .= '<li><strong>'.$langs->trans($titleKey).'</strong> ('.$nbtotalofrecords.')</li>'; |
|
| 443 | 443 | $html .= '</ul>'; |
| 444 | 444 | |
| 445 | 445 | /* Generate pagination list */ |
| 446 | - $html .= static::generatePageListNav($url_file . $pagination_param, $nbpages, $page); |
|
| 446 | + $html .= static::generatePageListNav($url_file.$pagination_param, $nbpages, $page); |
|
| 447 | 447 | |
| 448 | 448 | $html .= '</nav>'; |
| 449 | 449 | |
| 450 | 450 | // table with search filters and column titles |
| 451 | - $html .= '<table id="webportal-' . $elementEn . '-list" responsive="scroll" role="grid">'; |
|
| 451 | + $html .= '<table id="webportal-'.$elementEn.'-list" responsive="scroll" role="grid">'; |
|
| 452 | 452 | // title and desc for table |
| 453 | 453 | //if ($titleKey != '') { |
| 454 | 454 | // $html .= '<caption id="table-collapse-responsive">'; |
@@ -472,22 +472,22 @@ discard block |
||
| 472 | 472 | $html .= '</td>'; |
| 473 | 473 | // } |
| 474 | 474 | foreach ($object->fields as $key => $val) { |
| 475 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
| 476 | - $html .= '<td data-label="' . $arrayfields['t.' . $key]['label'] . '" data-col="'.dol_escape_htmltag($key).'" >'; |
|
| 475 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
| 476 | + $html .= '<td data-label="'.$arrayfields['t.'.$key]['label'].'" data-col="'.dol_escape_htmltag($key).'" >'; |
|
| 477 | 477 | if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { |
| 478 | - $html .= $this->form->selectarray('search_' . $key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', ''); |
|
| 478 | + $html .= $this->form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', ''); |
|
| 479 | 479 | } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
| 480 | - $postDateStart = GETPOST('search_' . $key . '_dtstart', 'alphanohtml'); |
|
| 481 | - $postDateEnd = GETPOST('search_' . $key . '_dtend', 'alphanohtml'); |
|
| 480 | + $postDateStart = GETPOST('search_'.$key.'_dtstart', 'alphanohtml'); |
|
| 481 | + $postDateEnd = GETPOST('search_'.$key.'_dtend', 'alphanohtml'); |
|
| 482 | 482 | |
| 483 | 483 | $html .= '<div class="grid">'; |
| 484 | - $html .= $this->form->inputDate('search_' . $key . '_dtstart', $postDateStart ? $postDateStart : '', $langs->trans('From')); |
|
| 484 | + $html .= $this->form->inputDate('search_'.$key.'_dtstart', $postDateStart ? $postDateStart : '', $langs->trans('From')); |
|
| 485 | 485 | $html .= '</div>'; |
| 486 | 486 | $html .= '<div class="grid">'; |
| 487 | - $html .= $this->form->inputDate('search_' . $key . '_dtend', $postDateEnd ? $postDateEnd : '', $langs->trans('to')); |
|
| 487 | + $html .= $this->form->inputDate('search_'.$key.'_dtend', $postDateEnd ? $postDateEnd : '', $langs->trans('to')); |
|
| 488 | 488 | $html .= '</div>'; |
| 489 | 489 | } else { |
| 490 | - $html .= '<input type="text" name="search_' . $key . '" value="' . dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '') . '">'; |
|
| 490 | + $html .= '<input type="text" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">'; |
|
| 491 | 491 | } |
| 492 | 492 | $html .= '</td>'; |
| 493 | 493 | } |
@@ -498,12 +498,12 @@ discard block |
||
| 498 | 498 | $html .= $hookmanager->resPrint; |
| 499 | 499 | // Remain to pay |
| 500 | 500 | if (!empty($arrayfields['remain_to_pay']['checked'])) { |
| 501 | - $html .= '<td data-label="' . $arrayfields['remain_to_pay']['label'] . '">'; |
|
| 501 | + $html .= '<td data-label="'.$arrayfields['remain_to_pay']['label'].'">'; |
|
| 502 | 502 | $html .= '</td>'; |
| 503 | 503 | } |
| 504 | 504 | // Download link |
| 505 | 505 | if (!empty($arrayfields['download_link']['checked'])) { |
| 506 | - $html .= '<td data-label="' . $arrayfields['download_link']['label'] . '">'; |
|
| 506 | + $html .= '<td data-label="'.$arrayfields['download_link']['label'].'">'; |
|
| 507 | 507 | $html .= '</td>'; |
| 508 | 508 | } |
| 509 | 509 | $html .= '</tr>'; |
@@ -521,16 +521,16 @@ discard block |
||
| 521 | 521 | $totalarray['nbfield']++; |
| 522 | 522 | // } |
| 523 | 523 | foreach ($object->fields as $key => $val) { |
| 524 | - $tableKey = 't.' . $key; |
|
| 524 | + $tableKey = 't.'.$key; |
|
| 525 | 525 | if (!empty($arrayfields[$tableKey]['checked'])) { |
| 526 | 526 | $tableOrder = ''; |
| 527 | 527 | if (array_key_exists($tableKey, $sortList)) { |
| 528 | 528 | $tableOrder = strtolower($sortList[$tableKey]); |
| 529 | 529 | } |
| 530 | - $url_param = $url_file . '&sortfield=' . $tableKey . '&sortorder=' . ($tableOrder == 'desc' ? 'asc' : 'desc') . $param; |
|
| 531 | - $html .= '<th data-col="'.dol_escape_htmltag($key).'" scope="col"' . ($tableOrder != '' ? ' table-order="' . $tableOrder . '"' : '') . '>'; |
|
| 532 | - $html .= '<a href="' . $url_param . '">'; |
|
| 533 | - $html .= $langs->trans($arrayfields['t.' . $key]['label']); |
|
| 530 | + $url_param = $url_file.'&sortfield='.$tableKey.'&sortorder='.($tableOrder == 'desc' ? 'asc' : 'desc').$param; |
|
| 531 | + $html .= '<th data-col="'.dol_escape_htmltag($key).'" scope="col"'.($tableOrder != '' ? ' table-order="'.$tableOrder.'"' : '').'>'; |
|
| 532 | + $html .= '<a href="'.$url_param.'">'; |
|
| 533 | + $html .= $langs->trans($arrayfields['t.'.$key]['label']); |
|
| 534 | 534 | $html .= '</a>'; |
| 535 | 535 | $html .= '</th>'; |
| 536 | 536 | $totalarray['nbfield']++; |
@@ -539,14 +539,14 @@ discard block |
||
| 539 | 539 | // Remain to pay |
| 540 | 540 | if (!empty($arrayfields['remain_to_pay']['checked'])) { |
| 541 | 541 | $html .= '<th scope="col">'; |
| 542 | - $html .= $langs->trans($arrayfields['remain_to_pay']['label']);; |
|
| 542 | + $html .= $langs->trans($arrayfields['remain_to_pay']['label']); ; |
|
| 543 | 543 | $html .= '</th>'; |
| 544 | 544 | $totalarray['nbfield']++; |
| 545 | 545 | } |
| 546 | 546 | // Download link |
| 547 | 547 | if (!empty($arrayfields['download_link']['checked'])) { |
| 548 | 548 | $html .= '<th scope="col">'; |
| 549 | - $html .= $langs->trans($arrayfields['download_link']['label']);; |
|
| 549 | + $html .= $langs->trans($arrayfields['download_link']['label']); ; |
|
| 550 | 550 | $html .= '</th>'; |
| 551 | 551 | $totalarray['nbfield']++; |
| 552 | 552 | } |
@@ -599,13 +599,13 @@ discard block |
||
| 599 | 599 | $remaintopay = 0; |
| 600 | 600 | } |
| 601 | 601 | if ($object->type == Facture::TYPE_CREDIT_NOTE && $obj->paye == 1 && $discount) { |
| 602 | - $remaincreditnote = $discount->getAvailableDiscounts($companyStatic, '', 'rc.fk_facture_source=' . $object->id); |
|
| 602 | + $remaincreditnote = $discount->getAvailableDiscounts($companyStatic, '', 'rc.fk_facture_source='.$object->id); |
|
| 603 | 603 | $remaintopay = -$remaincreditnote; |
| 604 | 604 | } |
| 605 | 605 | } |
| 606 | 606 | |
| 607 | 607 | // Show line of result |
| 608 | - $html .= '<tr data-rowid="' . $object->id . '">'; |
|
| 608 | + $html .= '<tr data-rowid="'.$object->id.'">'; |
|
| 609 | 609 | // if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
| 610 | 610 | $html .= '<td class="nowraponall">'; |
| 611 | 611 | $html .= '</td>'; |
@@ -614,8 +614,8 @@ discard block |
||
| 614 | 614 | } |
| 615 | 615 | // } |
| 616 | 616 | foreach ($object->fields as $key => $val) { |
| 617 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
| 618 | - $html .= '<td class="nowraponall" data-label="' . $arrayfields['t.' . $key]['label'] . '">'; |
|
| 617 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
| 618 | + $html .= '<td class="nowraponall" data-label="'.$arrayfields['t.'.$key]['label'].'">'; |
|
| 619 | 619 | if ($key == 'status' || $key == 'fk_statut') { |
| 620 | 620 | if ($elementEn == 'invoice') { |
| 621 | 621 | // specific to get invoice status (depends on payment) |
@@ -636,21 +636,21 @@ discard block |
||
| 636 | 636 | } |
| 637 | 637 | if (!empty($val['isameasure']) && $val['isameasure'] == 1) { |
| 638 | 638 | if (!$i) { |
| 639 | - $totalarray['pos'][$totalarray['nbfield']] = 't.' . $key; |
|
| 639 | + $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; |
|
| 640 | 640 | } |
| 641 | 641 | if (!isset($totalarray['val'])) { |
| 642 | 642 | $totalarray['val'] = array(); |
| 643 | 643 | } |
| 644 | - if (!isset($totalarray['val']['t.' . $key])) { |
|
| 645 | - $totalarray['val']['t.' . $key] = 0; |
|
| 644 | + if (!isset($totalarray['val']['t.'.$key])) { |
|
| 645 | + $totalarray['val']['t.'.$key] = 0; |
|
| 646 | 646 | } |
| 647 | - $totalarray['val']['t.' . $key] += $object->$key; |
|
| 647 | + $totalarray['val']['t.'.$key] += $object->$key; |
|
| 648 | 648 | } |
| 649 | 649 | } |
| 650 | 650 | } |
| 651 | 651 | // Remain to pay |
| 652 | 652 | if (!empty($arrayfields['remain_to_pay']['checked'])) { |
| 653 | - $html .= '<td class="nowraponall" data-label="' . $arrayfields['remain_to_pay']['label'] . '">'; |
|
| 653 | + $html .= '<td class="nowraponall" data-label="'.$arrayfields['remain_to_pay']['label'].'">'; |
|
| 654 | 654 | $html .= $this->form->showOutputFieldForObject($object, $arrayfields['remain_to_pay'], 'remain_to_pay', $remaintopay, ''); |
| 655 | 655 | //$html .= price($remaintopay); |
| 656 | 656 | $html .= '</td>'; |
@@ -661,9 +661,9 @@ discard block |
||
| 661 | 661 | // Download link |
| 662 | 662 | if (!empty($arrayfields['download_link']['checked'])) { |
| 663 | 663 | $element = $object->element; |
| 664 | - $html .= '<td class="nowraponall" data-label="' . $arrayfields['download_link']['label'] . '">'; |
|
| 664 | + $html .= '<td class="nowraponall" data-label="'.$arrayfields['download_link']['label'].'">'; |
|
| 665 | 665 | $filename = dol_sanitizeFileName($obj->ref); |
| 666 | - $filedir = $conf->{$element}->multidir_output[$obj->element_entity] . '/' . dol_sanitizeFileName($obj->ref); |
|
| 666 | + $filedir = $conf->{$element}->multidir_output[$obj->element_entity].'/'.dol_sanitizeFileName($obj->ref); |
|
| 667 | 667 | $html .= $this->form->getDocumentsLink($element, $filename, $filedir); |
| 668 | 668 | $html .= '</td>'; |
| 669 | 669 | if (!$i) { |
@@ -700,7 +700,7 @@ discard block |
||
| 700 | 700 | $html .= '</td>'; |
| 701 | 701 | } else { |
| 702 | 702 | if ($i == 1) { |
| 703 | - $html .= '<td>' . $langs->trans("Total") . '</td>'; |
|
| 703 | + $html .= '<td>'.$langs->trans("Total").'</td>'; |
|
| 704 | 704 | } else { |
| 705 | 705 | $html .= '<td></td>'; |
| 706 | 706 | } |
@@ -717,7 +717,7 @@ discard block |
||
| 717 | 717 | $colspan++; |
| 718 | 718 | } |
| 719 | 719 | } |
| 720 | - $html .= '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>'; |
|
| 720 | + $html .= '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>'; |
|
| 721 | 721 | } |
| 722 | 722 | |
| 723 | 723 | $html .= '</tbody>'; |
@@ -752,7 +752,7 @@ discard block |
||
| 752 | 752 | $html = '<ul class="pages-nav-list">'; |
| 753 | 753 | |
| 754 | 754 | if ($currentPage > 1) { |
| 755 | - $html .= '<li><a class="pages-nav-list__icon --prev" aria-label="' . dol_escape_htmltag($langs->trans('AriaPrevPage')) . '" href="' . $url . $pSep . 'page=' . ($currentPage - 1) . '" ' . ($currentPage <= 1 ? ' disabled' : '') . '></a></li>'; |
|
| 755 | + $html .= '<li><a class="pages-nav-list__icon --prev" aria-label="'.dol_escape_htmltag($langs->trans('AriaPrevPage')).'" href="'.$url.$pSep.'page='.($currentPage - 1).'" '.($currentPage <= 1 ? ' disabled' : '').'></a></li>'; |
|
| 756 | 756 | } |
| 757 | 757 | |
| 758 | 758 | $maxPaginItem = min($nbPages, 5); |
@@ -760,21 +760,21 @@ discard block |
||
| 760 | 760 | $maxPageNum = min($nbPages, $currentPage + 3); |
| 761 | 761 | |
| 762 | 762 | if ($minPageNum > 1) { |
| 763 | - $html .= '<li><a class="pages-nav-list__link ' . ($currentPage == 1 ? '--active' : '') . '" aria-label="' . dol_escape_htmltag($langs->trans('AriaPageX', 1)) . '" href="' . $url . $pSep . 'page=1" >1</a></li>'; |
|
| 763 | + $html .= '<li><a class="pages-nav-list__link '.($currentPage == 1 ? '--active' : '').'" aria-label="'.dol_escape_htmltag($langs->trans('AriaPageX', 1)).'" href="'.$url.$pSep.'page=1" >1</a></li>'; |
|
| 764 | 764 | $html .= '<li>…</li>'; |
| 765 | 765 | } |
| 766 | 766 | |
| 767 | 767 | for ($p = $minPageNum; $p <= $maxPageNum; $p++) { |
| 768 | - $html .= '<li><a class="pages-nav-list__link ' . ($currentPage === $p ? '--active' : '') . '" aria-label="' . dol_escape_htmltag($langs->trans('AriaPageX', $p)) . '" href="' . $url . $pSep . 'page=' . $p . '">' . $p . '</a></li>'; |
|
| 768 | + $html .= '<li><a class="pages-nav-list__link '.($currentPage === $p ? '--active' : '').'" aria-label="'.dol_escape_htmltag($langs->trans('AriaPageX', $p)).'" href="'.$url.$pSep.'page='.$p.'">'.$p.'</a></li>'; |
|
| 769 | 769 | } |
| 770 | 770 | |
| 771 | 771 | if ($maxPaginItem < $nbPages) { |
| 772 | 772 | $html .= '<li>…</li>'; |
| 773 | - $html .= '<li><a class="pages-nav-list__link ' . ($currentPage == $nbPages ? '--active' : '') . '" aria-label="' . dol_escape_htmltag($langs->trans('AriaPageX', $nbPages)) . '" href="' . $url . $pSep . 'page=' . $nbPages . '">' . $nbPages . '</a></li>'; |
|
| 773 | + $html .= '<li><a class="pages-nav-list__link '.($currentPage == $nbPages ? '--active' : '').'" aria-label="'.dol_escape_htmltag($langs->trans('AriaPageX', $nbPages)).'" href="'.$url.$pSep.'page='.$nbPages.'">'.$nbPages.'</a></li>'; |
|
| 774 | 774 | } |
| 775 | 775 | |
| 776 | 776 | if ($currentPage < $nbPages) { |
| 777 | - $html .= '<li><a class="pages-nav-list__icon --next" aria-label="' . dol_escape_htmltag($langs->trans('AriaNextPage')) . '" href="' . $url . $pSep . 'page=' . ($currentPage + 1) . '" ' . ($currentPage >= $nbPages ? ' disabled' : '') . '></a></li>'; |
|
| 777 | + $html .= '<li><a class="pages-nav-list__icon --next" aria-label="'.dol_escape_htmltag($langs->trans('AriaNextPage')).'" href="'.$url.$pSep.'page='.($currentPage + 1).'" '.($currentPage >= $nbPages ? ' disabled' : '').'></a></li>'; |
|
| 778 | 778 | } |
| 779 | 779 | |
| 780 | 780 | $html .= '</ul>'; |