@@ -116,7 +116,7 @@ |
||
116 | 116 | setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BarcodeValue")), null, 'errors'); |
117 | 117 | $error++; |
118 | 118 | } |
119 | - $MAXLENGTH = 51200; // Limit set to 50Ko |
|
119 | + $MAXLENGTH = 51200; // Limit set to 50Ko |
|
120 | 120 | if (dol_strlen($forbarcode) > $MAXLENGTH) { // barcode value |
121 | 121 | setEventMessages($langs->trans("ErrorFieldTooLong", $langs->transnoentitiesnoconv("BarcodeValue")).' ('.$langs->trans("RequireXStringMax", $MAXLENGTH).')', null, 'errors'); |
122 | 122 | $error++; |
@@ -39,8 +39,8 @@ |
||
39 | 39 | |
40 | 40 | $id = GETPOST('id', 'int'); |
41 | 41 | $ref = GETPOST('ref', 'alpha'); |
42 | -$batch = GETPOST('batch', 'alpha'); |
|
43 | -$objectid = GETPOST('productid', 'int'); |
|
42 | +$batch = GETPOST('batch', 'alpha'); |
|
43 | +$objectid = GETPOST('productid', 'int'); |
|
44 | 44 | |
45 | 45 | // Security check |
46 | 46 | $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : '')); |
@@ -81,7 +81,9 @@ |
||
81 | 81 | $search_year = ''; |
82 | 82 | } |
83 | 83 | |
84 | -if (!$user->hasRight('produit', 'lire')) accessforbidden(); |
|
84 | +if (!$user->hasRight('produit', 'lire')) { |
|
85 | + accessforbidden(); |
|
86 | +} |
|
85 | 87 | |
86 | 88 | |
87 | 89 | /* |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | |
260 | 260 | $motmp = new Mo($db); |
261 | 261 | |
262 | - $total_consumed=$total_produced=0; |
|
262 | + $total_consumed = $total_produced = 0; |
|
263 | 263 | |
264 | 264 | if ($num > 0) { |
265 | 265 | while ($i < min($num, $limit)) { |
@@ -269,8 +269,8 @@ discard block |
||
269 | 269 | $motmp->ref = $objp->ref; |
270 | 270 | $motmp->status = $objp->status; |
271 | 271 | |
272 | - $total_consumed+=$objp->nb_consumed; |
|
273 | - $total_produced+=$objp->nb_produced; |
|
272 | + $total_consumed += $objp->nb_consumed; |
|
273 | + $total_produced += $objp->nb_produced; |
|
274 | 274 | |
275 | 275 | print '<tr class="oddeven">'; |
276 | 276 | print '<td>'; |
@@ -81,7 +81,9 @@ |
||
81 | 81 | $search_year = ''; |
82 | 82 | } |
83 | 83 | |
84 | -if (!$user->hasRight('produit', 'lire')) accessforbidden(); |
|
84 | +if (!$user->hasRight('produit', 'lire')) { |
|
85 | + accessforbidden(); |
|
86 | +} |
|
85 | 87 | |
86 | 88 | |
87 | 89 | /* |
@@ -306,10 +306,10 @@ discard block |
||
306 | 306 | public $finished; |
307 | 307 | |
308 | 308 | /** |
309 | - * fk_default_bom indicates the default bom |
|
310 | - * |
|
311 | - * @var int |
|
312 | - */ |
|
309 | + * fk_default_bom indicates the default bom |
|
310 | + * |
|
311 | + * @var int |
|
312 | + */ |
|
313 | 313 | public $fk_default_bom; |
314 | 314 | |
315 | 315 | /** |
@@ -6360,12 +6360,12 @@ discard block |
||
6360 | 6360 | |
6361 | 6361 | |
6362 | 6362 | /** |
6363 | - * Return clicable link of object (with eventually picto) |
|
6364 | - * |
|
6365 | - * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) |
|
6366 | - * @param array $arraydata Array of data |
|
6367 | - * @return string HTML Code for Kanban thumb. |
|
6368 | - */ |
|
6363 | + * Return clicable link of object (with eventually picto) |
|
6364 | + * |
|
6365 | + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) |
|
6366 | + * @param array $arraydata Array of data |
|
6367 | + * @return string HTML Code for Kanban thumb. |
|
6368 | + */ |
|
6369 | 6369 | public function getKanbanView($option = '', $arraydata = null) |
6370 | 6370 | { |
6371 | 6371 | global $langs,$conf; |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | */ |
140 | 140 | public $price; |
141 | 141 | |
142 | - public $price_formated; // used by takepos/ajax/ajax.php |
|
142 | + public $price_formated; // used by takepos/ajax/ajax.php |
|
143 | 143 | |
144 | 144 | /** |
145 | 145 | * Selling price with tax |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | */ |
149 | 149 | public $price_ttc; |
150 | 150 | |
151 | - public $price_ttc_formated; // used by takepos/ajax/ajax.php |
|
151 | + public $price_ttc_formated; // used by takepos/ajax/ajax.php |
|
152 | 152 | |
153 | 153 | /** |
154 | 154 | * Minimum price net |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | public $packaging; |
228 | 228 | |
229 | 229 | |
230 | - public $lifetime; // In seconds |
|
230 | + public $lifetime; // In seconds |
|
231 | 231 | |
232 | 232 | public $qc_frequency; |
233 | 233 | |
@@ -359,20 +359,20 @@ discard block |
||
359 | 359 | |
360 | 360 | //! Metric of products |
361 | 361 | public $weight; |
362 | - public $weight_units; // scale -3, 0, 3, 6 |
|
362 | + public $weight_units; // scale -3, 0, 3, 6 |
|
363 | 363 | public $length; |
364 | - public $length_units; // scale -3, 0, 3, 6 |
|
364 | + public $length_units; // scale -3, 0, 3, 6 |
|
365 | 365 | public $width; |
366 | - public $width_units; // scale -3, 0, 3, 6 |
|
366 | + public $width_units; // scale -3, 0, 3, 6 |
|
367 | 367 | public $height; |
368 | - public $height_units; // scale -3, 0, 3, 6 |
|
368 | + public $height_units; // scale -3, 0, 3, 6 |
|
369 | 369 | public $surface; |
370 | - public $surface_units; // scale -3, 0, 3, 6 |
|
370 | + public $surface_units; // scale -3, 0, 3, 6 |
|
371 | 371 | public $volume; |
372 | - public $volume_units; // scale -3, 0, 3, 6 |
|
372 | + public $volume_units; // scale -3, 0, 3, 6 |
|
373 | 373 | |
374 | 374 | public $net_measure; |
375 | - public $net_measure_units; // scale -3, 0, 3, 6 |
|
375 | + public $net_measure_units; // scale -3, 0, 3, 6 |
|
376 | 376 | |
377 | 377 | public $accountancy_code_sell; |
378 | 378 | public $accountancy_code_sell_intra; |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000), |
560 | 560 | //'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')), |
561 | 561 | //'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')), |
562 | - 'mandatory_period' => array('type'=>'integer', 'label'=>'mandatoryperiod', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>1000), |
|
562 | + 'mandatory_period' => array('type'=>'integer', 'label'=>'mandatoryperiod', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>1000), |
|
563 | 563 | ); |
564 | 564 | |
565 | 565 | /** |
@@ -849,9 +849,9 @@ discard block |
||
849 | 849 | |
850 | 850 | // update accountancy for this entity |
851 | 851 | if (!$error && !empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) { |
852 | - $this->db->query("DELETE FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = " .((int) $this->id) . " AND entity = " . ((int) $conf->entity)); |
|
852 | + $this->db->query("DELETE FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $this->id)." AND entity = ".((int) $conf->entity)); |
|
853 | 853 | |
854 | - $sql = "INSERT INTO " . $this->db->prefix() . "product_perentity ("; |
|
854 | + $sql = "INSERT INTO ".$this->db->prefix()."product_perentity ("; |
|
855 | 855 | $sql .= " fk_product"; |
856 | 856 | $sql .= ", entity"; |
857 | 857 | $sql .= ", accountancy_code_buy"; |
@@ -862,13 +862,13 @@ discard block |
||
862 | 862 | $sql .= ", accountancy_code_sell_export"; |
863 | 863 | $sql .= ") VALUES ("; |
864 | 864 | $sql .= $this->id; |
865 | - $sql .= ", " . $conf->entity; |
|
866 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'"; |
|
867 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_intra) . "'"; |
|
868 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_export) . "'"; |
|
869 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'"; |
|
870 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_intra) . "'"; |
|
871 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_export) . "'"; |
|
865 | + $sql .= ", ".$conf->entity; |
|
866 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'"; |
|
867 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_intra)."'"; |
|
868 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_export)."'"; |
|
869 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'"; |
|
870 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_intra)."'"; |
|
871 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_export)."'"; |
|
872 | 872 | $sql .= ")"; |
873 | 873 | $result = $this->db->query($sql); |
874 | 874 | if (!$result) { |
@@ -1233,12 +1233,12 @@ discard block |
||
1233 | 1233 | $sql .= ", note_public = ".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : 'null'); |
1234 | 1234 | $sql .= ", duration = '".$this->db->escape($this->duration_value.$this->duration_unit)."'"; |
1235 | 1235 | if (empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) { |
1236 | - $sql .= ", accountancy_code_buy = '" . $this->db->escape($this->accountancy_code_buy) . "'"; |
|
1237 | - $sql .= ", accountancy_code_buy_intra = '" . $this->db->escape($this->accountancy_code_buy_intra) . "'"; |
|
1238 | - $sql .= ", accountancy_code_buy_export = '" . $this->db->escape($this->accountancy_code_buy_export) . "'"; |
|
1239 | - $sql .= ", accountancy_code_sell= '" . $this->db->escape($this->accountancy_code_sell) . "'"; |
|
1240 | - $sql .= ", accountancy_code_sell_intra= '" . $this->db->escape($this->accountancy_code_sell_intra) . "'"; |
|
1241 | - $sql .= ", accountancy_code_sell_export= '" . $this->db->escape($this->accountancy_code_sell_export) . "'"; |
|
1236 | + $sql .= ", accountancy_code_buy = '".$this->db->escape($this->accountancy_code_buy)."'"; |
|
1237 | + $sql .= ", accountancy_code_buy_intra = '".$this->db->escape($this->accountancy_code_buy_intra)."'"; |
|
1238 | + $sql .= ", accountancy_code_buy_export = '".$this->db->escape($this->accountancy_code_buy_export)."'"; |
|
1239 | + $sql .= ", accountancy_code_sell= '".$this->db->escape($this->accountancy_code_sell)."'"; |
|
1240 | + $sql .= ", accountancy_code_sell_intra= '".$this->db->escape($this->accountancy_code_sell_intra)."'"; |
|
1241 | + $sql .= ", accountancy_code_sell_export= '".$this->db->escape($this->accountancy_code_sell_export)."'"; |
|
1242 | 1242 | } |
1243 | 1243 | $sql .= ", desiredstock = ".((isset($this->desiredstock) && is_numeric($this->desiredstock)) ? (float) $this->desiredstock : "null"); |
1244 | 1244 | $sql .= ", cost_price = ".($this->cost_price != '' ? $this->db->escape($this->cost_price) : 'null'); |
@@ -1246,7 +1246,7 @@ discard block |
||
1246 | 1246 | $sql .= ", price_autogen = ".(!$this->price_autogen ? 0 : 1); |
1247 | 1247 | $sql .= ", fk_price_expression = ".($this->fk_price_expression != 0 ? (int) $this->fk_price_expression : 'NULL'); |
1248 | 1248 | $sql .= ", fk_user_modif = ".($user->id > 0 ? $user->id : 'NULL'); |
1249 | - $sql .= ", mandatory_period = ".($this->mandatory_period ); |
|
1249 | + $sql .= ", mandatory_period = ".($this->mandatory_period); |
|
1250 | 1250 | // stock field is not here because it is a denormalized value from product_stock. |
1251 | 1251 | $sql .= " WHERE rowid = ".((int) $id); |
1252 | 1252 | |
@@ -1268,9 +1268,9 @@ discard block |
||
1268 | 1268 | |
1269 | 1269 | // update accountancy for this entity |
1270 | 1270 | if (!$error && !empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) { |
1271 | - $this->db->query("DELETE FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = " . ((int) $this->id) . " AND entity = " . ((int) $conf->entity)); |
|
1271 | + $this->db->query("DELETE FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $this->id)." AND entity = ".((int) $conf->entity)); |
|
1272 | 1272 | |
1273 | - $sql = "INSERT INTO " . $this->db->prefix() . "product_perentity ("; |
|
1273 | + $sql = "INSERT INTO ".$this->db->prefix()."product_perentity ("; |
|
1274 | 1274 | $sql .= " fk_product"; |
1275 | 1275 | $sql .= ", entity"; |
1276 | 1276 | $sql .= ", accountancy_code_buy"; |
@@ -1281,13 +1281,13 @@ discard block |
||
1281 | 1281 | $sql .= ", accountancy_code_sell_export"; |
1282 | 1282 | $sql .= ") VALUES ("; |
1283 | 1283 | $sql .= $this->id; |
1284 | - $sql .= ", " . $conf->entity; |
|
1285 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'"; |
|
1286 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_intra) . "'"; |
|
1287 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_export) . "'"; |
|
1288 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'"; |
|
1289 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_intra) . "'"; |
|
1290 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_export) . "'"; |
|
1284 | + $sql .= ", ".$conf->entity; |
|
1285 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'"; |
|
1286 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_intra)."'"; |
|
1287 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_export)."'"; |
|
1288 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'"; |
|
1289 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_intra)."'"; |
|
1290 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_export)."'"; |
|
1291 | 1291 | $sql .= ")"; |
1292 | 1292 | $result = $this->db->query($sql); |
1293 | 1293 | if (!$result) { |
@@ -1299,8 +1299,8 @@ discard block |
||
1299 | 1299 | if (!$this->hasbatch() && $this->oldcopy->hasbatch()) { |
1300 | 1300 | // Selection of all product stock mouvements that contains batchs |
1301 | 1301 | $sql = 'SELECT pb.qty, pb.fk_entrepot, pb.batch FROM '.MAIN_DB_PREFIX.'product_batch as pb'; |
1302 | - $sql.= ' INNER JOIN '.MAIN_DB_PREFIX.'product_stock as ps ON (ps.rowid = batch.fk_product_stock)'; |
|
1303 | - $sql.= ' WHERE ps.fk_product = '.(int) $this->id; |
|
1302 | + $sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'product_stock as ps ON (ps.rowid = batch.fk_product_stock)'; |
|
1303 | + $sql .= ' WHERE ps.fk_product = '.(int) $this->id; |
|
1304 | 1304 | |
1305 | 1305 | $resql = $this->db->query($sql); |
1306 | 1306 | if ($resql) { |
@@ -1621,7 +1621,7 @@ discard block |
||
1621 | 1621 | } |
1622 | 1622 | } elseif (isset($this->multilangs[$key])) { |
1623 | 1623 | if (empty($this->multilangs["$key"]["label"])) { |
1624 | - $this->errors[] = $key . ' : ' . $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")); |
|
1624 | + $this->errors[] = $key.' : '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")); |
|
1625 | 1625 | return -1; |
1626 | 1626 | } |
1627 | 1627 | |
@@ -1817,7 +1817,7 @@ discard block |
||
1817 | 1817 | private function getArrayForPriceCompare($level = 0) |
1818 | 1818 | { |
1819 | 1819 | |
1820 | - $testExit = array('multiprices','multiprices_ttc','multiprices_base_type','multiprices_min','multiprices_min_ttc','multiprices_tva_tx','multiprices_recuperableonly'); |
|
1820 | + $testExit = array('multiprices', 'multiprices_ttc', 'multiprices_base_type', 'multiprices_min', 'multiprices_min_ttc', 'multiprices_tva_tx', 'multiprices_recuperableonly'); |
|
1821 | 1821 | |
1822 | 1822 | foreach ($testExit as $field) { |
1823 | 1823 | if (!isset($this->$field)) { |
@@ -2440,20 +2440,20 @@ discard block |
||
2440 | 2440 | |
2441 | 2441 | //For MultiCompany |
2442 | 2442 | //PMP per entity & Stocks Sharings stock_reel includes only stocks shared with this entity |
2443 | - $separatedEntityPMP = false; // Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product. |
|
2444 | - $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. |
|
2443 | + $separatedEntityPMP = false; // Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product. |
|
2444 | + $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. |
|
2445 | 2445 | $visibleWarehousesEntities = $conf->entity; |
2446 | 2446 | if (!empty($conf->global->MULTICOMPANY_PRODUCT_SHARING_ENABLED)) { |
2447 | 2447 | if (!empty($conf->global->MULTICOMPANY_PMP_PER_ENTITY_ENABLED)) { |
2448 | - $checkPMPPerEntity = $this->db->query("SELECT pmp FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = ".((int) $id)." AND entity = ".(int) $conf->entity); |
|
2449 | - if ($this->db->num_rows($checkPMPPerEntity)>0) { |
|
2448 | + $checkPMPPerEntity = $this->db->query("SELECT pmp FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $id)." AND entity = ".(int) $conf->entity); |
|
2449 | + if ($this->db->num_rows($checkPMPPerEntity) > 0) { |
|
2450 | 2450 | $separatedEntityPMP = true; |
2451 | 2451 | } |
2452 | 2452 | } |
2453 | 2453 | global $mc; |
2454 | 2454 | $separatedStock = true; |
2455 | 2455 | if (isset($mc->sharings['stock']) && !empty($mc->sharings['stock'])) { |
2456 | - $visibleWarehousesEntities .= "," . implode(",", $mc->sharings['stock']); |
|
2456 | + $visibleWarehousesEntities .= ",".implode(",", $mc->sharings['stock']); |
|
2457 | 2457 | } |
2458 | 2458 | } |
2459 | 2459 | if ($separatedEntityPMP) { |
@@ -2470,10 +2470,10 @@ discard block |
||
2470 | 2470 | } |
2471 | 2471 | $sql .= " FROM ".$this->db->prefix()."product as p"; |
2472 | 2472 | if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED) || $separatedEntityPMP) { |
2473 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity); |
|
2473 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity); |
|
2474 | 2474 | } |
2475 | 2475 | if ($separatedStock) { |
2476 | - $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)."))"; |
|
2476 | + $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)."))"; |
|
2477 | 2477 | } |
2478 | 2478 | |
2479 | 2479 | if ($id) { |
@@ -2627,15 +2627,15 @@ discard block |
||
2627 | 2627 | $sql .= " WHERE entity IN (".getEntity('productprice').")"; |
2628 | 2628 | $sql .= " AND price_level=".((int) $i); |
2629 | 2629 | $sql .= " AND fk_product = ".((int) $this->id); |
2630 | - $sql .= " ORDER BY date_price DESC, rowid DESC"; // Get the most recent line |
|
2631 | - $sql .= " LIMIT 1"; // Only the first one |
|
2630 | + $sql .= " ORDER BY date_price DESC, rowid DESC"; // Get the most recent line |
|
2631 | + $sql .= " LIMIT 1"; // Only the first one |
|
2632 | 2632 | $resql = $this->db->query($sql); |
2633 | 2633 | if ($resql) { |
2634 | 2634 | $result = $this->db->fetch_array($resql); |
2635 | 2635 | |
2636 | 2636 | $this->multiprices[$i] = $result ? $result["price"] : null; |
2637 | 2637 | $this->multiprices_ttc[$i] = $result ? $result["price_ttc"] : null; |
2638 | - $this->multiprices_min[$i] = $result ? $result["price_min"] : null; |
|
2638 | + $this->multiprices_min[$i] = $result ? $result["price_min"] : null; |
|
2639 | 2639 | $this->multiprices_min_ttc[$i] = $result ? $result["price_min_ttc"] : null; |
2640 | 2640 | $this->multiprices_base_type[$i] = $result ? $result["price_base_type"] : null; |
2641 | 2641 | // Next two fields are used only if PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL is on |
@@ -2855,7 +2855,7 @@ discard block |
||
2855 | 2855 | $obj = $this->db->fetch_object($result); |
2856 | 2856 | $this->stats_mo['customers_'.$role] = $obj->nb_customers ? $obj->nb_customers : 0; |
2857 | 2857 | $this->stats_mo['nb_'.$role] = $obj->nb ? $obj->nb : 0; |
2858 | - $this->stats_mo['qty_'.$role] = $obj->qty ? price2num($obj->qty, 'MS') : 0; // qty may be a float due to the SUM() |
|
2858 | + $this->stats_mo['qty_'.$role] = $obj->qty ? price2num($obj->qty, 'MS') : 0; // qty may be a float due to the SUM() |
|
2859 | 2859 | } else { |
2860 | 2860 | $this->error = $this->db->error(); |
2861 | 2861 | $error++; |
@@ -4332,7 +4332,7 @@ discard block |
||
4332 | 4332 | //Addition of a product with the highest rank +1 |
4333 | 4333 | $sql = "INSERT INTO ".$this->db->prefix()."product_association(fk_product_pere,fk_product_fils,qty,incdec,rang)"; |
4334 | 4334 | $sql .= " VALUES (".((int) $id_pere).", ".((int) $id_fils).", ".price2num($qty, 'MS').", ".price2num($incdec, 'MS').", ".((int) $rank).")"; |
4335 | - if (! $this->db->query($sql)) { |
|
4335 | + if (!$this->db->query($sql)) { |
|
4336 | 4336 | dol_print_error($this->db); |
4337 | 4337 | return -1; |
4338 | 4338 | } else { |
@@ -4443,17 +4443,17 @@ discard block |
||
4443 | 4443 | |
4444 | 4444 | // Updated ranks so that none are missing |
4445 | 4445 | $sqlrank = "SELECT rowid, rang FROM ".$this->db->prefix()."product_association"; |
4446 | - $sqlrank.= " WHERE fk_product_pere = ".((int) $fk_parent); |
|
4447 | - $sqlrank.= " ORDER BY rang"; |
|
4446 | + $sqlrank .= " WHERE fk_product_pere = ".((int) $fk_parent); |
|
4447 | + $sqlrank .= " ORDER BY rang"; |
|
4448 | 4448 | $resqlrank = $this->db->query($sqlrank); |
4449 | 4449 | if ($resqlrank) { |
4450 | 4450 | $cpt = 0; |
4451 | 4451 | while ($objrank = $this->db->fetch_object($resqlrank)) { |
4452 | 4452 | $cpt++; |
4453 | 4453 | $sql = "UPDATE ".$this->db->prefix()."product_association"; |
4454 | - $sql.= " SET rang = ".((int) $cpt); |
|
4455 | - $sql.= " WHERE rowid = ".((int) $objrank->rowid); |
|
4456 | - if (! $this->db->query($sql)) { |
|
4454 | + $sql .= " SET rang = ".((int) $cpt); |
|
4455 | + $sql .= " WHERE rowid = ".((int) $objrank->rowid); |
|
4456 | + if (!$this->db->query($sql)) { |
|
4457 | 4457 | dol_print_error($this->db); |
4458 | 4458 | return -1; |
4459 | 4459 | } |
@@ -4886,7 +4886,7 @@ discard block |
||
4886 | 4886 | if (isset($this->sousprods) && is_array($this->sousprods)) { |
4887 | 4887 | foreach ($this->sousprods as $prod_name => $desc_product) { |
4888 | 4888 | if (is_array($desc_product)) { |
4889 | - $this->fetch_prod_arbo($desc_product, "", $multiply, 1, $this->id, $ignore_stock_load); // This set $this->res |
|
4889 | + $this->fetch_prod_arbo($desc_product, "", $multiply, 1, $this->id, $ignore_stock_load); // This set $this->res |
|
4890 | 4890 | } |
4891 | 4891 | } |
4892 | 4892 | } |
@@ -5041,9 +5041,9 @@ discard block |
||
5041 | 5041 | $sql .= " WHERE p.rowid = pa.fk_product_fils"; |
5042 | 5042 | $sql .= " AND pa.fk_product_pere = ".((int) $id); |
5043 | 5043 | $sql .= " AND pa.fk_product_fils <> ".((int) $id); // This should not happens, it is to avoid infinite loop if it happens |
5044 | - $sql.= " ORDER BY pa.rang"; |
|
5044 | + $sql .= " ORDER BY pa.rang"; |
|
5045 | 5045 | |
5046 | - dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level. ' parents='.(is_array($parents)?implode(',', $parents):$parents), LOG_DEBUG); |
|
5046 | + dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level.' parents='.(is_array($parents) ?implode(',', $parents) : $parents), LOG_DEBUG); |
|
5047 | 5047 | |
5048 | 5048 | if ($level == 1) { |
5049 | 5049 | $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 immediatly |
@@ -5133,41 +5133,41 @@ discard block |
||
5133 | 5133 | if (!empty($this->entity)) { |
5134 | 5134 | $tmpphoto = $this->show_photos('product', $conf->product->multidir_output[$this->entity], 1, 1, 0, 0, 0, 80, 0, 0, 0, 0, 1); |
5135 | 5135 | if ($this->nbphoto > 0) { |
5136 | - $datas['photo'] = '<div class="photointooltip floatright">'."\n" . $tmpphoto . '</div>'; |
|
5136 | + $datas['photo'] = '<div class="photointooltip floatright">'."\n".$tmpphoto.'</div>'; |
|
5137 | 5137 | } |
5138 | 5138 | } |
5139 | 5139 | |
5140 | 5140 | if ($this->type == Product::TYPE_PRODUCT) { |
5141 | 5141 | $datas['picto'] = img_picto('', 'product').' <u class="paddingrightonly">'.$langs->trans("Product").'</u>'; |
5142 | 5142 | } elseif ($this->type == Product::TYPE_SERVICE) { |
5143 | - $datas['picto']= img_picto('', 'service').' <u class="paddingrightonly">'.$langs->trans("Service").'</u>'; |
|
5143 | + $datas['picto'] = img_picto('', 'service').' <u class="paddingrightonly">'.$langs->trans("Service").'</u>'; |
|
5144 | 5144 | } |
5145 | 5145 | if (isset($this->status) && isset($this->status_buy)) { |
5146 | - $datas['status']= ' '.$this->getLibStatut(5, 0) . ' '.$this->getLibStatut(5, 1); |
|
5146 | + $datas['status'] = ' '.$this->getLibStatut(5, 0).' '.$this->getLibStatut(5, 1); |
|
5147 | 5147 | } |
5148 | 5148 | |
5149 | 5149 | if (!empty($this->ref)) { |
5150 | - $datas['ref']= '<br><b>'.$langs->trans('ProductRef').':</b> '.$this->ref; |
|
5150 | + $datas['ref'] = '<br><b>'.$langs->trans('ProductRef').':</b> '.$this->ref; |
|
5151 | 5151 | } |
5152 | 5152 | if (!empty($this->label)) { |
5153 | - $datas['label']= '<br><b>'.$langs->trans('ProductLabel').':</b> '.$this->label; |
|
5153 | + $datas['label'] = '<br><b>'.$langs->trans('ProductLabel').':</b> '.$this->label; |
|
5154 | 5154 | } |
5155 | 5155 | if (!empty($this->description)) { |
5156 | - $datas['description']= '<br><b>'.$langs->trans('ProductDescription').':</b> '.dolGetFirstLineofText($this->description, 5); |
|
5156 | + $datas['description'] = '<br><b>'.$langs->trans('ProductDescription').':</b> '.dolGetFirstLineofText($this->description, 5); |
|
5157 | 5157 | } |
5158 | 5158 | if ($this->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { |
5159 | 5159 | if (isModEnabled('productbatch')) { |
5160 | 5160 | $langs->load("productbatch"); |
5161 | - $datas['batchstatus']= "<br><b>".$langs->trans("ManageLotSerial").'</b>: '.$this->getLibStatut(0, 2); |
|
5161 | + $datas['batchstatus'] = "<br><b>".$langs->trans("ManageLotSerial").'</b>: '.$this->getLibStatut(0, 2); |
|
5162 | 5162 | } |
5163 | 5163 | } |
5164 | 5164 | if (isModEnabled('barcode')) { |
5165 | - $datas['barcode']= '<br><b>'.$langs->trans('BarCode').':</b> '.$this->barcode; |
|
5165 | + $datas['barcode'] = '<br><b>'.$langs->trans('BarCode').':</b> '.$this->barcode; |
|
5166 | 5166 | } |
5167 | 5167 | |
5168 | 5168 | if ($this->type == Product::TYPE_PRODUCT) { |
5169 | 5169 | if ($this->weight) { |
5170 | - $datas['weight']= "<br><b>".$langs->trans("Weight").'</b>: '.$this->weight.' '.measuringUnitString(0, "weight", $this->weight_units); |
|
5170 | + $datas['weight'] = "<br><b>".$langs->trans("Weight").'</b>: '.$this->weight.' '.measuringUnitString(0, "weight", $this->weight_units); |
|
5171 | 5171 | } |
5172 | 5172 | $labelsize = ""; |
5173 | 5173 | if ($this->length) { |
@@ -5180,7 +5180,7 @@ discard block |
||
5180 | 5180 | $labelsize .= ($labelsize ? " - " : "")."<b>".$langs->trans("Height").'</b>: '.$this->height.' '.measuringUnitString(0, 'size', $this->height_units); |
5181 | 5181 | } |
5182 | 5182 | if ($labelsize) { |
5183 | - $datas['size']= "<br>".$labelsize; |
|
5183 | + $datas['size'] = "<br>".$labelsize; |
|
5184 | 5184 | } |
5185 | 5185 | |
5186 | 5186 | $labelsurfacevolume = ""; |
@@ -5191,7 +5191,7 @@ discard block |
||
5191 | 5191 | $labelsurfacevolume .= ($labelsurfacevolume ? " - " : "")."<b>".$langs->trans("Volume").'</b>: '.$this->volume.' '.measuringUnitString(0, 'volume', $this->volume_units); |
5192 | 5192 | } |
5193 | 5193 | if ($labelsurfacevolume) { |
5194 | - $datas['surface']= "<br>" . $labelsurfacevolume; |
|
5194 | + $datas['surface'] = "<br>".$labelsurfacevolume; |
|
5195 | 5195 | } |
5196 | 5196 | } |
5197 | 5197 | if (!empty($this->pmp) && $this->pmp) { |
@@ -5221,9 +5221,9 @@ discard block |
||
5221 | 5221 | } |
5222 | 5222 | // show categories for this record only in ajax to not overload lists |
5223 | 5223 | if (isModEnabled('categorie') && !$nofetch) { |
5224 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
5224 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
5225 | 5225 | $form = new Form($this->db); |
5226 | - $datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_PRODUCT, 1); |
|
5226 | + $datas['categories'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_PRODUCT, 1); |
|
5227 | 5227 | } |
5228 | 5228 | |
5229 | 5229 | return $datas; |
@@ -5275,7 +5275,7 @@ discard block |
||
5275 | 5275 | $label = $langs->trans("ShowProduct"); |
5276 | 5276 | $linkclose .= ' alt="'.dol_escape_htmltag($label, 1, 1).'"'; |
5277 | 5277 | } |
5278 | - $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1, 1).'"' : ' title="tocomplete"'); |
|
5278 | + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1, 1).'"' : ' title="tocomplete"'); |
|
5279 | 5279 | $linkclose .= $dataparams.' class="nowraponall '.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; |
5280 | 5280 | } else { |
5281 | 5281 | $linkclose = ' class="nowraponall'.($morecss ? ' '.$morecss : '').'"'; |
@@ -5452,7 +5452,7 @@ discard block |
||
5452 | 5452 | $labelStatus = ($status == 1 ? $langs->transnoentitiesnoconv('ProductStatusOnBatch') : $langs->transnoentitiesnoconv('ProductStatusOnSerial')); |
5453 | 5453 | $labelStatusShort = ($status == 1 ? $langs->transnoentitiesnoconv('ProductStatusOnBatchShort') : $langs->transnoentitiesnoconv('ProductStatusOnSerialShort')); |
5454 | 5454 | } |
5455 | - } elseif ( $type == 2 && $status == 2 ) { |
|
5455 | + } elseif ($type == 2 && $status == 2) { |
|
5456 | 5456 | $labelStatus = $langs->transnoentitiesnoconv('ProductStatusOnSerial'); |
5457 | 5457 | $labelStatusShort = $langs->transnoentitiesnoconv('ProductStatusOnSerialShort'); |
5458 | 5458 | } |
@@ -5663,7 +5663,7 @@ discard block |
||
5663 | 5663 | $sql .= " AND w.statut IN (".$this->db->sanitize(implode(',', $warehouseStatus)).")"; |
5664 | 5664 | } |
5665 | 5665 | |
5666 | - $sql .= " ORDER BY ps.reel ".(!empty($conf->global->DO_NOT_TRY_TO_DEFRAGMENT_STOCKS_WAREHOUSE)?'DESC':'ASC'); // Note : qty ASC is important for expedition card, to avoid stock fragmentation; |
|
5666 | + $sql .= " ORDER BY ps.reel ".(!empty($conf->global->DO_NOT_TRY_TO_DEFRAGMENT_STOCKS_WAREHOUSE) ? 'DESC' : 'ASC'); // Note : qty ASC is important for expedition card, to avoid stock fragmentation; |
|
5667 | 5667 | |
5668 | 5668 | dol_syslog(get_class($this)."::load_stock", LOG_DEBUG); |
5669 | 5669 | $result = $this->db->query($sql); |
@@ -5744,7 +5744,7 @@ discard block |
||
5744 | 5744 | if (isModEnabled("supplier_order")) { |
5745 | 5745 | $filterStatus = empty($conf->global->SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK) ? '3,4' : $conf->global->SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK; |
5746 | 5746 | if (isset($includedraftpoforvirtual)) { |
5747 | - $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 |
|
5747 | + $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 |
|
5748 | 5748 | } |
5749 | 5749 | $result = $this->load_stats_commande_fournisseur(0, $filterStatus, 1, $dateofvirtualstock); |
5750 | 5750 | if ($result < 0) { |
@@ -6138,7 +6138,7 @@ discard block |
||
6138 | 6138 | if (!empty($conf->global->BARCODE_PRODUCT_ADDON_NUM)) { |
6139 | 6139 | $dirsociete = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']); |
6140 | 6140 | foreach ($dirsociete as $dirroot) { |
6141 | - $res = dol_include_once($dirroot . getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM').'.php'); |
|
6141 | + $res = dol_include_once($dirroot.getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM').'.php'); |
|
6142 | 6142 | if ($res) { |
6143 | 6143 | break; |
6144 | 6144 | } |
@@ -6437,7 +6437,7 @@ discard block |
||
6437 | 6437 | global $langs; |
6438 | 6438 | |
6439 | 6439 | if (empty($this->duration_value)) { |
6440 | - $this->errors[]='ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice'; |
|
6440 | + $this->errors[] = 'ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice'; |
|
6441 | 6441 | return -1; |
6442 | 6442 | } |
6443 | 6443 | |
@@ -6474,7 +6474,7 @@ discard block |
||
6474 | 6474 | */ |
6475 | 6475 | public function getKanbanView($option = '', $arraydata = null) |
6476 | 6476 | { |
6477 | - global $langs,$conf; |
|
6477 | + global $langs, $conf; |
|
6478 | 6478 | |
6479 | 6479 | $selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']); |
6480 | 6480 | |
@@ -6515,7 +6515,7 @@ discard block |
||
6515 | 6515 | $return .= '<br><span class="info-box-status opacitymedium">'.$langs->trans('PhysicalStock').' : <span class="bold">'.$this->stock_reel.'</span></span>'; |
6516 | 6516 | } |
6517 | 6517 | if (method_exists($this, 'getLibStatut')) { |
6518 | - $return .='<br><span class="info-box-status margintoponly">'.$this->getLibStatut(3, 1).' '.$this->getLibStatut(3, 0).'</span>'; |
|
6518 | + $return .= '<br><span class="info-box-status margintoponly">'.$this->getLibStatut(3, 1).' '.$this->getLibStatut(3, 0).'</span>'; |
|
6519 | 6519 | } |
6520 | 6520 | $return .= '</div>'; |
6521 | 6521 | $return .= '</div>'; |
@@ -89,7 +89,9 @@ discard block |
||
89 | 89 | |
90 | 90 | $managedfor = getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR', 'thirdparty'); |
91 | 91 | |
92 | -if ($managedfor != 'member' && $sortfield == 'd.datefin') $sortfield = ''; |
|
92 | +if ($managedfor != 'member' && $sortfield == 'd.datefin') { |
|
93 | + $sortfield = ''; |
|
94 | +} |
|
93 | 95 | |
94 | 96 | // Default sort order (if not yet defined by previous GETPOST) |
95 | 97 | if (!$sortfield) { |
@@ -155,10 +157,18 @@ discard block |
||
155 | 157 | //if ($user->socid > 0) accessforbidden(); |
156 | 158 | //if ($user->socid > 0) $socid = $user->socid; |
157 | 159 | //$result = restrictedArea($user, 'partnership', $object->id); |
158 | -if (empty($conf->partnership->enabled)) accessforbidden(); |
|
159 | -if (empty($permissiontoread)) accessforbidden(); |
|
160 | -if ($object->id > 0 && !($object->fk_member > 0) && $managedfor == 'member') accessforbidden(); |
|
161 | -if ($object->id > 0 && !($object->fk_soc > 0) && $managedfor == 'thirdparty') accessforbidden(); |
|
160 | +if (empty($conf->partnership->enabled)) { |
|
161 | + accessforbidden(); |
|
162 | +} |
|
163 | +if (empty($permissiontoread)) { |
|
164 | + accessforbidden(); |
|
165 | +} |
|
166 | +if ($object->id > 0 && !($object->fk_member > 0) && $managedfor == 'member') { |
|
167 | + accessforbidden(); |
|
168 | +} |
|
169 | +if ($object->id > 0 && !($object->fk_soc > 0) && $managedfor == 'thirdparty') { |
|
170 | + accessforbidden(); |
|
171 | +} |
|
162 | 172 | |
163 | 173 | |
164 | 174 | /* |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | $error = 0; |
89 | 89 | |
90 | -$managedfor = getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR', 'thirdparty'); |
|
90 | +$managedfor = getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR', 'thirdparty'); |
|
91 | 91 | |
92 | 92 | if ($managedfor != 'member' && $sortfield == 'd.datefin') $sortfield = ''; |
93 | 93 | |
@@ -797,7 +797,7 @@ discard block |
||
797 | 797 | print '<tr class="liste_titre">'; |
798 | 798 | if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
799 | 799 | print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; |
800 | - $totalarray['nbfield']++; // For the column action |
|
800 | + $totalarray['nbfield']++; // For the column action |
|
801 | 801 | } |
802 | 802 | foreach ($object->fields as $key => $val) { |
803 | 803 | $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); |
@@ -810,7 +810,7 @@ discard block |
||
810 | 810 | } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { |
811 | 811 | $cssforfield .= ($cssforfield ? ' ' : '').'right'; |
812 | 812 | } |
813 | - $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
813 | + $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
814 | 814 | if (!empty($arrayfields['t.'.$key]['checked'])) { |
815 | 815 | print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist']))."\n"; |
816 | 816 | $totalarray['nbfield']++; |
@@ -831,7 +831,7 @@ discard block |
||
831 | 831 | // Action column |
832 | 832 | if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
833 | 833 | print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; |
834 | - $totalarray['nbfield']++; // For the column action |
|
834 | + $totalarray['nbfield']++; // For the column action |
|
835 | 835 | } |
836 | 836 | print '</tr>'."\n"; |
837 | 837 |
@@ -206,7 +206,9 @@ |
||
206 | 206 | $triggersendname = 'TICKET_SENTBYMAIL'; |
207 | 207 | $paramname = 'id'; |
208 | 208 | $autocopy = 'MAIN_MAIL_AUTOCOPY_TICKET_TO'; // used to know the automatic BCC to add |
209 | -if (!empty($object->dao->id)) $trackid = 'tic'.$object->dao->id; |
|
209 | +if (!empty($object->dao->id)) { |
|
210 | + $trackid = 'tic'.$object->dao->id; |
|
211 | +} |
|
210 | 212 | include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; |
211 | 213 | |
212 | 214 |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | if ($object->dao->close($user)) { |
173 | 173 | setEventMessages($langs->trans('TicketMarkedAsClosed'), null, 'mesgs'); |
174 | 174 | |
175 | - $url = 'view.php?action=view_ticket&track_id='.GETPOST('track_id', 'alpha').(!empty($entity) && isModEnabled('multicompany')?'&entity='.$entity:'').'&token='.newToken(); |
|
175 | + $url = 'view.php?action=view_ticket&track_id='.GETPOST('track_id', 'alpha').(!empty($entity) && isModEnabled('multicompany') ? '&entity='.$entity : '').'&token='.newToken(); |
|
176 | 176 | header("Location: ".$url); |
177 | 177 | exit; |
178 | 178 | } else { |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | |
247 | 247 | // Confirmation close |
248 | 248 | if ($action == 'close') { |
249 | - print $form->formconfirm($_SERVER["PHP_SELF"]."?track_id=".$track_id.(!empty($entity) && isModEnabled('multicompany')?'&entity='.$entity:''), $langs->trans("CloseATicket"), $langs->trans("ConfirmCloseAticket"), "confirm_public_close", '', '', 1); |
|
249 | + print $form->formconfirm($_SERVER["PHP_SELF"]."?track_id=".$track_id.(!empty($entity) && isModEnabled('multicompany') ? '&entity='.$entity : ''), $langs->trans("CloseATicket"), $langs->trans("ConfirmCloseAticket"), "confirm_public_close", '', '', 1); |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | print '<div id="form_view_ticket" class="margintoponly">'; |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | $formticket->trackid = 'tic'.$object->dao->id; |
391 | 391 | |
392 | 392 | $formticket->param = array('track_id' => $object->dao->track_id, 'fk_user_create' => '-1', |
393 | - 'returnurl' => DOL_URL_ROOT.'/public/ticket/view.php'.(!empty($entity) && isModEnabled('multicompany')?'?entity='.$entity:'')); |
|
393 | + 'returnurl' => DOL_URL_ROOT.'/public/ticket/view.php'.(!empty($entity) && isModEnabled('multicompany') ? '?entity='.$entity : '')); |
|
394 | 394 | |
395 | 395 | $formticket->withfile = 2; |
396 | 396 | $formticket->withcancel = 1; |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | } |
400 | 400 | |
401 | 401 | if ($action != 'presend') { |
402 | - print '<form method="post" id="form_view_ticket_list" name="form_view_ticket_list" action="'.DOL_URL_ROOT.'/public/ticket/list.php'.(!empty($entity) && isModEnabled('multicompany')?'?entity='.$entity:'').'">'; |
|
402 | + print '<form method="post" id="form_view_ticket_list" name="form_view_ticket_list" action="'.DOL_URL_ROOT.'/public/ticket/list.php'.(!empty($entity) && isModEnabled('multicompany') ? '?entity='.$entity : '').'">'; |
|
403 | 403 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
404 | 404 | print '<input type="hidden" name="action" value="view_ticketlist">'; |
405 | 405 | print '<input type="hidden" name="track_id" value="'.$object->dao->track_id.'">'; |
@@ -414,11 +414,11 @@ discard block |
||
414 | 414 | |
415 | 415 | if ($object->dao->fk_statut < Ticket::STATUS_CLOSED) { |
416 | 416 | // New message |
417 | - print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=presend&mode=init&track_id='.$object->dao->track_id.(!empty($entity) && isModEnabled('multicompany')?'&entity='.$entity:'').'&token='.newToken().'">'.$langs->trans('TicketAddMessage').'</a></div>'; |
|
417 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=presend&mode=init&track_id='.$object->dao->track_id.(!empty($entity) && isModEnabled('multicompany') ? '&entity='.$entity : '').'&token='.newToken().'">'.$langs->trans('TicketAddMessage').'</a></div>'; |
|
418 | 418 | |
419 | 419 | // Close ticket |
420 | 420 | if ($object->dao->fk_statut >= Ticket::STATUS_NOT_READ && $object->dao->fk_statut < Ticket::STATUS_CLOSED) { |
421 | - print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=close&track_id='.$object->dao->track_id.(!empty($entity) && isModEnabled('multicompany')?'&entity='.$entity:'').'&token='.newToken().'">'.$langs->trans('CloseTicket').'</a></div>'; |
|
421 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=close&track_id='.$object->dao->track_id.(!empty($entity) && isModEnabled('multicompany') ? '&entity='.$entity : '').'&token='.newToken().'">'.$langs->trans('CloseTicket').'</a></div>'; |
|
422 | 422 | } |
423 | 423 | } |
424 | 424 | |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | print '<!-- public view ticket -->'; |
438 | 438 | print '<div class="ticketpublicarea ticketlargemargin centpercent">'; |
439 | 439 | |
440 | - print '<div class="error">Not Allowed<br><a href="'.$_SERVER['PHP_SELF'].'?track_id='.$object->dao->track_id.(!empty($entity) && isModEnabled('multicompany')?'?entity='.$entity:'').'" rel="nofollow noopener">'.$langs->trans('Back').'</a></div>'; |
|
440 | + print '<div class="error">Not Allowed<br><a href="'.$_SERVER['PHP_SELF'].'?track_id='.$object->dao->track_id.(!empty($entity) && isModEnabled('multicompany') ? '?entity='.$entity : '').'" rel="nofollow noopener">'.$langs->trans('Back').'</a></div>'; |
|
441 | 441 | |
442 | 442 | print '</div>'; |
443 | 443 | } |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | print '<div class="center opacitymedium margintoponly marginbottomonly ticketlargemargin">'.$langs->trans("TicketPublicMsgViewLogIn").'</div>'; |
449 | 449 | |
450 | 450 | print '<div id="form_view_ticket">'; |
451 | - print '<form method="post" name="form_view_ticket" action="'.$_SERVER['PHP_SELF'].(!empty($entity) && isModEnabled('multicompany')?'?entity='.$entity:'').'">'; |
|
451 | + print '<form method="post" name="form_view_ticket" action="'.$_SERVER['PHP_SELF'].(!empty($entity) && isModEnabled('multicompany') ? '?entity='.$entity : '').'">'; |
|
452 | 452 | |
453 | 453 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
454 | 454 | print '<input type="hidden" name="action" value="view_ticket">'; |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | $langs->loadLangs(array("mrp", "other")); |
39 | 39 | |
40 | 40 | // Get parameters |
41 | -$id = GETPOST('id', 'int'); |
|
41 | +$id = GETPOST('id', 'int'); |
|
42 | 42 | $ref = GETPOST('ref', 'alpha'); |
43 | -$action = GETPOST('action', 'aZ09'); |
|
43 | +$action = GETPOST('action', 'aZ09'); |
|
44 | 44 | $cancel = GETPOST('cancel', 'aZ09'); |
45 | 45 | $backtopage = GETPOST('backtopage', 'alpha'); |
46 | 46 | |
@@ -55,10 +55,10 @@ discard block |
||
55 | 55 | $search_rowid = GETPOST('search_rowid'); |
56 | 56 | $search_agenda_label = GETPOST('search_agenda_label'); |
57 | 57 | |
58 | -$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; |
|
58 | +$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; |
|
59 | 59 | $sortfield = GETPOST('sortfield', 'aZ09comma'); |
60 | 60 | $sortorder = GETPOST('sortorder', 'aZ09comma'); |
61 | -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); |
|
61 | +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); |
|
62 | 62 | if (empty($page) || $page == -1) { |
63 | 63 | $page = 0; |
64 | 64 | } // If $page is not defined, or '' or -1 |
@@ -36,7 +36,7 @@ |
||
36 | 36 | |
37 | 37 | $langs->load("bookmarks"); |
38 | 38 | |
39 | - $authorized_var=array('limit','optioncss','contextpage'); |
|
39 | + $authorized_var = array('limit', 'optioncss', 'contextpage'); |
|
40 | 40 | $url = $_SERVER["PHP_SELF"]; |
41 | 41 | $url_param = array(); |
42 | 42 | if (!empty($_SERVER["QUERY_STRING"])) { |
@@ -916,7 +916,7 @@ |
||
916 | 916 | * Latest orders |
917 | 917 | */ |
918 | 918 | if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) { |
919 | - $param =""; |
|
919 | + $param = ""; |
|
920 | 920 | |
921 | 921 | $sql = "SELECT s.nom, s.rowid"; |
922 | 922 | $sql .= ", c.rowid as cid, c.entity, c.total_ht"; |