@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $error = 0; |
79 | 79 | $setupnotempty = 0; |
80 | 80 | |
81 | -$dirmodels = array_merge(array('/'), (array)$conf->modules_parts['models']); |
|
81 | +$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); |
|
82 | 82 | |
83 | 83 | $moduledir = 'asset'; |
84 | 84 | $myTmpObjects = array(); |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | // Search template files |
123 | 123 | $file = ''; |
124 | 124 | $classname = ''; |
125 | - $dirmodels = array_merge(array('/'), (array)$conf->modules_parts['models']); |
|
125 | + $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); |
|
126 | 126 | foreach ($dirmodels as $reldir) { |
127 | 127 | $file = dol_buildpath($reldir . "core/modules/asset/doc/pdf_" . $modele . "_" . strtolower($tmpobjectkey) . ".modules.php", 0); |
128 | 128 | if (file_exists($file)) { |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | $accountsystem->fetch(getDolGlobalInt('CHARTOFACCOUNTS')); |
559 | 559 | $sql = 'SELECT DISTINCT pcg_type FROM ' . MAIN_DB_PREFIX . 'accounting_account'; |
560 | 560 | $sql .= " WHERE fk_pcg_version = '" . $db->escape($accountsystem->ref) . "'"; |
561 | - $sql .= ' AND entity in (' . getEntity('accounting_account', 0) . ')'; // Always limit to current entity. No sharing in accountancy. |
|
561 | + $sql .= ' AND entity in (' . getEntity('accounting_account', 0) . ')'; // Always limit to current entity. No sharing in accountancy. |
|
562 | 562 | $sql .= ' LIMIT 50000'; // just as a sanity check |
563 | 563 | $resql = $db->query($sql); |
564 | 564 | if ($resql) { |
@@ -229,7 +229,7 @@ |
||
229 | 229 | print '<td class="left">' . $langs->trans('ProducedBy') . '</td>'; |
230 | 230 | } |
231 | 231 | print '<td class="linecolqty right">' . $langs->trans('Quantity') . '</td>'; |
232 | - print '<td></td>'; // For unit |
|
232 | + print '<td></td>'; // For unit |
|
233 | 233 | print '<td class="linecolstock right">' . $form->textwithpicto($langs->trans("PhysicalStock"), $text_stock_options, 1) . '</td>'; |
234 | 234 | print '<td class="linecoltheoricalstock right">' . $form->textwithpicto($langs->trans("VirtualStock"), $langs->trans("VirtualStockDesc")) . '</td>'; |
235 | 235 | print '</tr>'; |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | $fk_default_workstation = GETPOSTINT('idworkstations'); |
289 | 289 | } |
290 | 290 | |
291 | - $result = $object->updateLine($lineid, $qty, (int)$qty_frozen, (int)$disable_stock_change, $efficiency, $bomline->position, $bomline->import_key, $fk_unit, $array_options, $fk_default_workstation); |
|
291 | + $result = $object->updateLine($lineid, $qty, (int) $qty_frozen, (int) $disable_stock_change, $efficiency, $bomline->position, $bomline->import_key, $fk_unit, $array_options, $fk_default_workstation); |
|
292 | 292 | |
293 | 293 | if ($result <= 0) { |
294 | 294 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -592,7 +592,7 @@ discard block |
||
592 | 592 | if (!empty($object->table_element_line)) { |
593 | 593 | // Products |
594 | 594 | |
595 | - $res = $object->fetchLinesbytypeproduct(0); // Load all lines products into ->lines |
|
595 | + $res = $object->fetchLinesbytypeproduct(0); // Load all lines products into ->lines |
|
596 | 596 | $object->calculateCosts(); |
597 | 597 | |
598 | 598 | print ($res == 0 && $object->status >= $object::STATUS_VALIDATED) ? '' : load_fiche_titre($langs->trans('BOMProductsList'), '', 'product'); |
@@ -646,7 +646,7 @@ discard block |
||
646 | 646 | // Services |
647 | 647 | |
648 | 648 | $filtertype = 1; |
649 | - $res = $object->fetchLinesbytypeproduct(1); // Load all lines services into ->lines |
|
649 | + $res = $object->fetchLinesbytypeproduct(1); // Load all lines services into ->lines |
|
650 | 650 | $object->calculateCosts(); |
651 | 651 | |
652 | 652 | print ($res == 0 && $object->status >= $object::STATUS_VALIDATED) ? '' : load_fiche_titre($langs->trans('BOMServicesList'), '', 'service'); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | // Load Dolibarr environment |
40 | 40 | require constant('DOL_DOCUMENT_ROOT') . '/main.inc.php'; |
41 | -require_once constant('DOL_DOCUMENT_ROOT') . '/core/class/fileupload.class.php'; // Class to upload common files |
|
41 | +require_once constant('DOL_DOCUMENT_ROOT') . '/core/class/fileupload.class.php'; // Class to upload common files |
|
42 | 42 | require_once constant('DOL_DOCUMENT_ROOT') . '/core/lib/geturl.lib.php'; |
43 | 43 | |
44 | 44 | $id = GETPOSTINT('fk_element'); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | if (!empty($user->socid)) { |
63 | 63 | $socid = $user->socid; |
64 | 64 | if (!empty($object->socid) && $socid != $object->socid) { |
65 | - httponly_accessforbidden("Access on object not allowed for this external user."); // This includes the exit. |
|
65 | + httponly_accessforbidden("Access on object not allowed for this external user."); // This includes the exit. |
|
66 | 66 | } |
67 | 67 | } |
68 | 68 |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | if (intval($searchCategory) == -2) { |
358 | 358 | $searchCategorySqlList[] = " cp.fk_categorie IS NULL"; |
359 | 359 | } elseif (intval($searchCategory) > 0) { |
360 | - $searchCategorySqlList[] = " " . $rowIdName . " IN (SELECT fk_" . $type . " FROM " . MAIN_DB_PREFIX . "categorie_" . $type . " WHERE fk_categorie = " . ((int)$searchCategory) . ")"; |
|
360 | + $searchCategorySqlList[] = " " . $rowIdName . " IN (SELECT fk_" . $type . " FROM " . MAIN_DB_PREFIX . "categorie_" . $type . " WHERE fk_categorie = " . ((int) $searchCategory) . ")"; |
|
361 | 361 | } |
362 | 362 | } |
363 | 363 | |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | $this->label = trim($this->label); |
421 | 421 | $this->description = trim($this->description); |
422 | 422 | $this->color = trim($this->color); |
423 | - $this->position = (int)$this->position; |
|
423 | + $this->position = (int) $this->position; |
|
424 | 424 | $this->import_key = trim($this->import_key); |
425 | 425 | $this->ref_ext = trim($this->ref_ext); |
426 | 426 | if (empty($this->visible)) { |
@@ -454,21 +454,21 @@ discard block |
||
454 | 454 | $sql .= " date_creation,"; |
455 | 455 | $sql .= " fk_user_creat"; |
456 | 456 | $sql .= ") VALUES ("; |
457 | - $sql .= (int)$this->fk_parent . ","; |
|
457 | + $sql .= (int) $this->fk_parent . ","; |
|
458 | 458 | $sql .= "'" . $this->db->escape($this->label) . "', "; |
459 | 459 | $sql .= "'" . $this->db->escape($this->description) . "', "; |
460 | 460 | $sql .= "'" . $this->db->escape($this->color) . "', "; |
461 | - $sql .= (int)$this->position . ","; |
|
461 | + $sql .= (int) $this->position . ","; |
|
462 | 462 | if (getDolGlobalString('CATEGORY_ASSIGNED_TO_A_CUSTOMER')) { |
463 | 463 | $sql .= ($this->socid > 0 ? $this->socid : 'null') . ", "; |
464 | 464 | } |
465 | 465 | $sql .= "'" . $this->db->escape($this->visible) . "', "; |
466 | - $sql .= ((int)$type) . ", "; |
|
466 | + $sql .= ((int) $type) . ", "; |
|
467 | 467 | $sql .= (!empty($this->import_key) ? "'" . $this->db->escape($this->import_key) . "'" : 'null') . ", "; |
468 | 468 | $sql .= (!empty($this->ref_ext) ? "'" . $this->db->escape($this->ref_ext) . "'" : 'null') . ", "; |
469 | - $sql .= (int)$conf->entity . ", "; |
|
469 | + $sql .= (int) $conf->entity . ", "; |
|
470 | 470 | $sql .= "'" . $this->db->idate($now) . "', "; |
471 | - $sql .= (int)$user->id; |
|
471 | + $sql .= (int) $user->id; |
|
472 | 472 | $sql .= ")"; |
473 | 473 | |
474 | 474 | $res = $this->db->query($sql); |
@@ -537,8 +537,8 @@ discard block |
||
537 | 537 | $sql = "SELECT c.rowid"; |
538 | 538 | $sql .= " FROM " . MAIN_DB_PREFIX . "categorie as c "; |
539 | 539 | $sql .= " WHERE c.entity IN (" . getEntity('category') . ")"; |
540 | - $sql .= " AND c.type = " . ((int)$type); |
|
541 | - $sql .= " AND c.fk_parent = " . ((int)$this->fk_parent); |
|
540 | + $sql .= " AND c.type = " . ((int) $type); |
|
541 | + $sql .= " AND c.fk_parent = " . ((int) $this->fk_parent); |
|
542 | 542 | $sql .= " AND c.label = '" . $this->db->escape($this->label) . "'"; |
543 | 543 | |
544 | 544 | dol_syslog(get_class($this) . "::already_exists", LOG_DEBUG); |
@@ -601,14 +601,14 @@ discard block |
||
601 | 601 | $sql .= " description = '" . $this->db->escape($this->description) . "',"; |
602 | 602 | $sql .= " ref_ext = '" . $this->db->escape($this->ref_ext) . "',"; |
603 | 603 | $sql .= " color = '" . $this->db->escape($this->color) . "'"; |
604 | - $sql .= ", position = " . (int)$this->position; |
|
604 | + $sql .= ", position = " . (int) $this->position; |
|
605 | 605 | if (getDolGlobalString('CATEGORY_ASSIGNED_TO_A_CUSTOMER')) { |
606 | 606 | $sql .= ", fk_soc = " . ($this->socid > 0 ? $this->socid : 'null'); |
607 | 607 | } |
608 | - $sql .= ", visible = " . (int)$this->visible; |
|
609 | - $sql .= ", fk_parent = " . (int)$this->fk_parent; |
|
610 | - $sql .= ", fk_user_modif = " . (int)$user->id; |
|
611 | - $sql .= " WHERE rowid = " . ((int)$this->id); |
|
608 | + $sql .= ", visible = " . (int) $this->visible; |
|
609 | + $sql .= ", fk_parent = " . (int) $this->fk_parent; |
|
610 | + $sql .= ", fk_user_modif = " . (int) $user->id; |
|
611 | + $sql .= " WHERE rowid = " . ((int) $this->id); |
|
612 | 612 | |
613 | 613 | dol_syslog(get_class($this) . "::update", LOG_DEBUG); |
614 | 614 | if ($this->db->query($sql)) { |
@@ -675,8 +675,8 @@ discard block |
||
675 | 675 | /* FIX #1317 : Check for child category and move up 1 level*/ |
676 | 676 | if (!$error) { |
677 | 677 | $sql = "UPDATE " . MAIN_DB_PREFIX . "categorie"; |
678 | - $sql .= " SET fk_parent = " . ((int)$this->fk_parent); |
|
679 | - $sql .= " WHERE fk_parent = " . ((int)$this->id); |
|
678 | + $sql .= " SET fk_parent = " . ((int) $this->fk_parent); |
|
679 | + $sql .= " WHERE fk_parent = " . ((int) $this->id); |
|
680 | 680 | |
681 | 681 | if (!$this->db->query($sql)) { |
682 | 682 | $this->error = $this->db->lasterror(); |
@@ -710,7 +710,7 @@ discard block |
||
710 | 710 | $value = $value['field']; |
711 | 711 | } |
712 | 712 | $sql = "DELETE FROM " . MAIN_DB_PREFIX . $key; |
713 | - $sql .= " WHERE " . $value . " = " . ((int)$this->id); |
|
713 | + $sql .= " WHERE " . $value . " = " . ((int) $this->id); |
|
714 | 714 | if (!$this->db->query($sql)) { |
715 | 715 | $this->errors[] = $this->db->lasterror(); |
716 | 716 | dol_syslog("Error sql=" . $sql . " " . $this->error, LOG_ERR); |
@@ -765,12 +765,12 @@ discard block |
||
765 | 765 | |
766 | 766 | $sql = "INSERT INTO " . MAIN_DB_PREFIX . "categorie_" . (empty($this->MAP_CAT_TABLE[$type]) ? $type : $this->MAP_CAT_TABLE[$type]); |
767 | 767 | $sql .= " (fk_categorie, fk_" . (empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type]) . ")"; |
768 | - $sql .= " VALUES (" . ((int)$this->id) . ", " . ((int)$obj->id) . ")"; |
|
768 | + $sql .= " VALUES (" . ((int) $this->id) . ", " . ((int) $obj->id) . ")"; |
|
769 | 769 | |
770 | 770 | if ($this->db->query($sql)) { |
771 | 771 | if (getDolGlobalString('CATEGORIE_RECURSIV_ADD')) { |
772 | 772 | $sql = 'SELECT fk_parent FROM ' . MAIN_DB_PREFIX . 'categorie'; |
773 | - $sql .= " WHERE rowid = " . ((int)$this->id); |
|
773 | + $sql .= " WHERE rowid = " . ((int) $this->id); |
|
774 | 774 | |
775 | 775 | dol_syslog(get_class($this) . "::add_type", LOG_DEBUG); |
776 | 776 | $resql = $this->db->query($sql); |
@@ -839,7 +839,7 @@ discard block |
||
839 | 839 | public function containsObject($type, $object_id) |
840 | 840 | { |
841 | 841 | $sql = "SELECT COUNT(*) as nb FROM " . MAIN_DB_PREFIX . "categorie_" . (empty($this->MAP_CAT_TABLE[$type]) ? $type : $this->MAP_CAT_TABLE[$type]); |
842 | - $sql .= " WHERE fk_categorie = " . ((int)$this->id) . " AND fk_" . (empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type]) . " = " . ((int)$object_id); |
|
842 | + $sql .= " WHERE fk_categorie = " . ((int) $this->id) . " AND fk_" . (empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type]) . " = " . ((int) $object_id); |
|
843 | 843 | |
844 | 844 | dol_syslog(get_class($this) . "::containsObject", LOG_DEBUG); |
845 | 845 | |
@@ -881,8 +881,8 @@ discard block |
||
881 | 881 | $this->db->begin(); |
882 | 882 | |
883 | 883 | $sql = "DELETE FROM " . MAIN_DB_PREFIX . "categorie_" . (empty($this->MAP_CAT_TABLE[$type]) ? $type : $this->MAP_CAT_TABLE[$type]); |
884 | - $sql .= " WHERE fk_categorie = " . ((int)$this->id); |
|
885 | - $sql .= " AND fk_" . (empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type]) . " = " . ((int)$obj->id); |
|
884 | + $sql .= " WHERE fk_categorie = " . ((int) $this->id); |
|
885 | + $sql .= " AND fk_" . (empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type]) . " = " . ((int) $obj->id); |
|
886 | 886 | |
887 | 887 | dol_syslog(get_class($this) . '::del_type', LOG_DEBUG); |
888 | 888 | if ($this->db->query($sql)) { |
@@ -938,7 +938,7 @@ discard block |
||
938 | 938 | $sql .= " FROM " . MAIN_DB_PREFIX . "categorie_" . (empty($this->MAP_CAT_TABLE[$type]) ? $type : $this->MAP_CAT_TABLE[$type]) . " as c"; |
939 | 939 | $sql .= ", " . MAIN_DB_PREFIX . (empty($this->MAP_OBJ_TABLE[$type]) ? $type : $this->MAP_OBJ_TABLE[$type]) . " as o"; |
940 | 940 | $sql .= " WHERE o.entity IN (" . getEntity($obj->element) . ")"; |
941 | - $sql .= " AND c.fk_categorie = " . ((int)$this->id); |
|
941 | + $sql .= " AND c.fk_categorie = " . ((int) $this->id); |
|
942 | 942 | // Compatibility with actioncomm table which has id instead of rowid |
943 | 943 | if ((array_key_exists($type, $this->MAP_OBJ_TABLE) && $this->MAP_OBJ_TABLE[$type] == "actioncomm") || $type == "actioncomm") { |
944 | 944 | $sql .= " AND c.fk_" . (empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type]) . " = o.id"; |
@@ -947,7 +947,7 @@ discard block |
||
947 | 947 | } |
948 | 948 | // Protection for external users |
949 | 949 | if (($type == 'customer' || $type == 'supplier') && $user->socid > 0) { |
950 | - $sql .= " AND o.rowid = " . ((int)$user->socid); |
|
950 | + $sql .= " AND o.rowid = " . ((int) $user->socid); |
|
951 | 951 | } |
952 | 952 | |
953 | 953 | $errormessage = ''; |
@@ -1013,13 +1013,13 @@ discard block |
||
1013 | 1013 | $sql .= ", date_creation, tms, fk_user_creat, fk_user_modif"; |
1014 | 1014 | $sql .= " FROM " . MAIN_DB_PREFIX . "categorie"; |
1015 | 1015 | if ($id) { |
1016 | - $sql .= " WHERE rowid = " . ((int)$id); |
|
1016 | + $sql .= " WHERE rowid = " . ((int) $id); |
|
1017 | 1017 | } elseif (!empty($ref_ext)) { |
1018 | 1018 | $sql .= " WHERE ref_ext LIKE '" . $this->db->escape($ref_ext) . "'"; |
1019 | 1019 | } else { |
1020 | 1020 | $sql .= " WHERE label = '" . $this->db->escape($label) . "' AND entity IN (" . getEntity('category') . ")"; |
1021 | 1021 | if (!is_null($type)) { |
1022 | - $sql .= " AND type = " . ((int)$type); |
|
1022 | + $sql .= " AND type = " . ((int) $type); |
|
1023 | 1023 | } |
1024 | 1024 | } |
1025 | 1025 | |
@@ -1029,20 +1029,20 @@ discard block |
||
1029 | 1029 | if ($this->db->num_rows($resql) > 0 && $res = $this->db->fetch_array($resql)) { |
1030 | 1030 | $this->id = $res['rowid']; |
1031 | 1031 | //$this->ref = $res['rowid']; |
1032 | - $this->fk_parent = (int)$res['fk_parent']; |
|
1032 | + $this->fk_parent = (int) $res['fk_parent']; |
|
1033 | 1033 | $this->label = $res['label']; |
1034 | 1034 | $this->description = $res['description']; |
1035 | 1035 | $this->color = $res['color']; |
1036 | 1036 | $this->position = $res['position']; |
1037 | - $this->socid = (int)$res['fk_soc']; |
|
1038 | - $this->visible = (int)$res['visible']; |
|
1037 | + $this->socid = (int) $res['fk_soc']; |
|
1038 | + $this->visible = (int) $res['visible']; |
|
1039 | 1039 | $this->type = $res['type']; |
1040 | 1040 | $this->ref_ext = $res['ref_ext']; |
1041 | - $this->entity = (int)$res['entity']; |
|
1041 | + $this->entity = (int) $res['entity']; |
|
1042 | 1042 | $this->date_creation = $this->db->jdate($res['date_creation']); |
1043 | 1043 | $this->date_modification = $this->db->jdate($res['tms']); |
1044 | - $this->user_creation_id = (int)$res['fk_user_creat']; |
|
1045 | - $this->user_modification_id = (int)$res['fk_user_modif']; |
|
1044 | + $this->user_creation_id = (int) $res['fk_user_creat']; |
|
1045 | + $this->user_modification_id = (int) $res['fk_user_modif']; |
|
1046 | 1046 | |
1047 | 1047 | // Retrieve all extrafield |
1048 | 1048 | // fetch optionals attributes and labels |
@@ -1081,7 +1081,7 @@ discard block |
||
1081 | 1081 | |
1082 | 1082 | $sql = "SELECT lang, label, description"; |
1083 | 1083 | $sql .= " FROM " . MAIN_DB_PREFIX . "categorie_lang"; |
1084 | - $sql .= " WHERE fk_category=" . ((int)$this->id); |
|
1084 | + $sql .= " WHERE fk_category=" . ((int) $this->id); |
|
1085 | 1085 | |
1086 | 1086 | $result = $this->db->query($sql); |
1087 | 1087 | if ($result) { |
@@ -1122,7 +1122,7 @@ discard block |
||
1122 | 1122 | foreach ($langs_available as $key => $value) { |
1123 | 1123 | $sql = "SELECT rowid"; |
1124 | 1124 | $sql .= " FROM " . MAIN_DB_PREFIX . "categorie_lang"; |
1125 | - $sql .= " WHERE fk_category=" . ((int)$this->id); |
|
1125 | + $sql .= " WHERE fk_category=" . ((int) $this->id); |
|
1126 | 1126 | $sql .= " AND lang = '" . $this->db->escape($key) . "'"; |
1127 | 1127 | |
1128 | 1128 | $result = $this->db->query($sql); |
@@ -1133,10 +1133,10 @@ discard block |
||
1133 | 1133 | $sql2 = "UPDATE " . MAIN_DB_PREFIX . "categorie_lang"; |
1134 | 1134 | $sql2 .= " SET label = '" . $this->db->escape($this->label) . "',"; |
1135 | 1135 | $sql2 .= " description = '" . $this->db->escape($this->description) . "'"; |
1136 | - $sql2 .= " WHERE fk_category = " . ((int)$this->id) . " AND lang = '" . $this->db->escape($key) . "'"; |
|
1136 | + $sql2 .= " WHERE fk_category = " . ((int) $this->id) . " AND lang = '" . $this->db->escape($key) . "'"; |
|
1137 | 1137 | } elseif (isset($this->multilangs[$key])) { |
1138 | 1138 | $sql2 = "INSERT INTO " . MAIN_DB_PREFIX . "categorie_lang (fk_category, lang, label, description)"; |
1139 | - $sql2 .= " VALUES(" . ((int)$this->id) . ", '" . $this->db->escape($key) . "', '" . $this->db->escape($this->label) . "'"; |
|
1139 | + $sql2 .= " VALUES(" . ((int) $this->id) . ", '" . $this->db->escape($key) . "', '" . $this->db->escape($this->label) . "'"; |
|
1140 | 1140 | $sql2 .= ", '" . $this->db->escape($this->multilangs[$key]["description"]) . "')"; |
1141 | 1141 | } |
1142 | 1142 | dol_syslog(get_class($this) . '::setMultiLangs', LOG_DEBUG); |
@@ -1149,10 +1149,10 @@ discard block |
||
1149 | 1149 | $sql2 = "UPDATE " . MAIN_DB_PREFIX . "categorie_lang"; |
1150 | 1150 | $sql2 .= " SET label='" . $this->db->escape($this->multilangs[$key]["label"]) . "',"; |
1151 | 1151 | $sql2 .= " description='" . $this->db->escape($this->multilangs[$key]["description"]) . "'"; |
1152 | - $sql2 .= " WHERE fk_category=" . ((int)$this->id) . " AND lang='" . $this->db->escape($key) . "'"; |
|
1152 | + $sql2 .= " WHERE fk_category=" . ((int) $this->id) . " AND lang='" . $this->db->escape($key) . "'"; |
|
1153 | 1153 | } else { |
1154 | 1154 | $sql2 = "INSERT INTO " . MAIN_DB_PREFIX . "categorie_lang (fk_category, lang, label, description)"; |
1155 | - $sql2 .= " VALUES(" . ((int)$this->id) . ", '" . $this->db->escape($key) . "', '" . $this->db->escape($this->multilangs[$key]["label"]) . "'"; |
|
1155 | + $sql2 .= " VALUES(" . ((int) $this->id) . ", '" . $this->db->escape($key) . "', '" . $this->db->escape($this->multilangs[$key]["label"]) . "'"; |
|
1156 | 1156 | $sql2 .= ",'" . $this->db->escape($this->multilangs[$key]["description"]) . "')"; |
1157 | 1157 | } |
1158 | 1158 | |
@@ -1218,9 +1218,9 @@ discard block |
||
1218 | 1218 | $sql = "SELECT s.rowid"; |
1219 | 1219 | $sql .= " FROM " . MAIN_DB_PREFIX . "categorie as s, " . MAIN_DB_PREFIX . "categorie_" . $sub_type . " as sub"; |
1220 | 1220 | $sql .= ' WHERE s.entity IN (' . getEntity('category') . ')'; |
1221 | - $sql .= ' AND s.type=' . ((int)$idoftype); |
|
1221 | + $sql .= ' AND s.type=' . ((int) $idoftype); |
|
1222 | 1222 | $sql .= ' AND s.rowid = sub.fk_categorie'; |
1223 | - $sql .= " AND sub." . $subcol_name . " = " . ((int)$id); |
|
1223 | + $sql .= " AND sub." . $subcol_name . " = " . ((int) $id); |
|
1224 | 1224 | |
1225 | 1225 | $sql .= $this->db->order($sortfield, $sortorder); |
1226 | 1226 | |
@@ -1295,7 +1295,7 @@ discard block |
||
1295 | 1295 | { |
1296 | 1296 | // phpcs:enable |
1297 | 1297 | $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "categorie"; |
1298 | - $sql .= " WHERE fk_parent = " . ((int)$this->id); |
|
1298 | + $sql .= " WHERE fk_parent = " . ((int) $this->id); |
|
1299 | 1299 | $sql .= " AND entity IN (" . getEntity('category') . ")"; |
1300 | 1300 | |
1301 | 1301 | $res = $this->db->query($sql); |
@@ -1377,7 +1377,7 @@ discard block |
||
1377 | 1377 | $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "categorie_lang as t ON t.fk_category=c.rowid AND t.lang='" . $this->db->escape($current_lang) . "'"; |
1378 | 1378 | } |
1379 | 1379 | $sql .= " WHERE c.entity IN (" . getEntity('category') . ")"; |
1380 | - $sql .= " AND c.type = " . (int)$type; |
|
1380 | + $sql .= " AND c.type = " . (int) $type; |
|
1381 | 1381 | |
1382 | 1382 | dol_syslog(get_class($this) . "::get_full_arbo get category list", LOG_DEBUG); |
1383 | 1383 | $resql = $this->db->query($sql); |
@@ -1423,7 +1423,7 @@ discard block |
||
1423 | 1423 | $keyfilter3 = '^' . $keyfiltercatid . '_'; |
1424 | 1424 | $keyfilter4 = '_' . $keyfiltercatid . '_'; |
1425 | 1425 | foreach (array_keys($this->cats) as $key) { |
1426 | - $fullpath = (string)$this->cats[$key]['fullpath']; |
|
1426 | + $fullpath = (string) $this->cats[$key]['fullpath']; |
|
1427 | 1427 | $test = (preg_match('/' . $keyfilter1 . '/', $fullpath) || preg_match('/' . $keyfilter2 . '/', $fullpath) |
1428 | 1428 | || preg_match('/' . $keyfilter3 . '/', $fullpath) || preg_match('/' . $keyfilter4 . '/', $fullpath)); |
1429 | 1429 | |
@@ -1550,7 +1550,7 @@ discard block |
||
1550 | 1550 | $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "categorie"; |
1551 | 1551 | $sql .= " WHERE entity IN (" . getEntity('category') . ")"; |
1552 | 1552 | if (!is_null($type)) { |
1553 | - $sql .= " AND type = " . (int)$type; |
|
1553 | + $sql .= " AND type = " . (int) $type; |
|
1554 | 1554 | } |
1555 | 1555 | if ($parent) { |
1556 | 1556 | $sql .= " AND fk_parent = 0"; |
@@ -1668,7 +1668,7 @@ discard block |
||
1668 | 1668 | $parents = array(); |
1669 | 1669 | |
1670 | 1670 | $sql = "SELECT fk_parent FROM " . MAIN_DB_PREFIX . "categorie"; |
1671 | - $sql .= " WHERE rowid = " . ((int)$this->id); |
|
1671 | + $sql .= " WHERE rowid = " . ((int) $this->id); |
|
1672 | 1672 | |
1673 | 1673 | $res = $this->db->query($sql); |
1674 | 1674 | |
@@ -1712,7 +1712,7 @@ discard block |
||
1712 | 1712 | // Load bank categories |
1713 | 1713 | $sql = "SELECT c.label, c.rowid"; |
1714 | 1714 | $sql .= " FROM " . MAIN_DB_PREFIX . "bank_class as a, " . MAIN_DB_PREFIX . "bank_categ as c"; |
1715 | - $sql .= " WHERE a.lineid=" . ((int)$id) . " AND a.fk_categ = c.rowid"; |
|
1715 | + $sql .= " WHERE a.lineid=" . ((int) $id) . " AND a.fk_categ = c.rowid"; |
|
1716 | 1716 | $sql .= " AND c.entity IN (" . getEntity('category') . ")"; |
1717 | 1717 | $sql .= " ORDER BY c.label"; |
1718 | 1718 | |
@@ -1737,7 +1737,7 @@ discard block |
||
1737 | 1737 | } else { |
1738 | 1738 | $sql = "SELECT ct.fk_categorie, c.label, c.rowid"; |
1739 | 1739 | $sql .= " FROM " . MAIN_DB_PREFIX . "categorie_" . (empty($this->MAP_CAT_TABLE[$type]) ? $type : $this->MAP_CAT_TABLE[$type]) . " as ct, " . MAIN_DB_PREFIX . "categorie as c"; |
1740 | - $sql .= " WHERE ct.fk_categorie = c.rowid AND ct.fk_" . (empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type]) . " = " . (int)$id; |
|
1740 | + $sql .= " WHERE ct.fk_categorie = c.rowid AND ct.fk_" . (empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type]) . " = " . (int) $id; |
|
1741 | 1741 | // This seems useless because the table already contains id of category of 1 unique type. So commented. |
1742 | 1742 | // So now it works also with external added categories. |
1743 | 1743 | //$sql .= " AND c.type = ".((int) $this->MAP_ID[$type]); |
@@ -1797,7 +1797,7 @@ discard block |
||
1797 | 1797 | |
1798 | 1798 | // Generation requete recherche |
1799 | 1799 | $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "categorie"; |
1800 | - $sql .= " WHERE type = " . ((int)$this->MAP_ID[$type]); |
|
1800 | + $sql .= " WHERE type = " . ((int) $this->MAP_ID[$type]); |
|
1801 | 1801 | $sql .= " AND entity IN (" . getEntity('category') . ")"; |
1802 | 1802 | if ($nom) { |
1803 | 1803 | if (!$exact) { |
@@ -1810,7 +1810,7 @@ discard block |
||
1810 | 1810 | } |
1811 | 1811 | } |
1812 | 1812 | if ($id) { |
1813 | - $sql .= " AND rowid = " . ((int)$id); |
|
1813 | + $sql .= " AND rowid = " . ((int) $id); |
|
1814 | 1814 | } |
1815 | 1815 | |
1816 | 1816 | $res = $this->db->query($sql); |
@@ -57,9 +57,9 @@ |
||
57 | 57 | $urlfrom = GETPOST('urlfrom', 'alpha'); |
58 | 58 | $backtopage = GETPOST('backtopage', 'alpha'); |
59 | 59 | |
60 | -$label = (string)GETPOST('label', 'alphanohtml'); |
|
61 | -$description = (string)GETPOST('description', 'restricthtml'); |
|
62 | -$color = preg_replace('/[^0-9a-f#]/i', '', (string)GETPOST('color', 'alphanohtml')); |
|
60 | +$label = (string) GETPOST('label', 'alphanohtml'); |
|
61 | +$description = (string) GETPOST('description', 'restricthtml'); |
|
62 | +$color = preg_replace('/[^0-9a-f#]/i', '', (string) GETPOST('color', 'alphanohtml')); |
|
63 | 63 | $position = GETPOSTINT('position'); |
64 | 64 | $visible = GETPOSTINT('visible'); |
65 | 65 | $parent = GETPOSTINT('parent'); |
@@ -38,7 +38,7 @@ |
||
38 | 38 | |
39 | 39 | $langs->load("bookmarks"); |
40 | 40 | |
41 | - $authorized_var = array('limit','optioncss','contextpage'); |
|
41 | + $authorized_var = array('limit', 'optioncss', 'contextpage'); |
|
42 | 42 | $url = $_SERVER["PHP_SELF"]; |
43 | 43 | $url_param = array(); |
44 | 44 | if (!empty($_SERVER["QUERY_STRING"])) { |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | $maxphptoshow = $maxfilesizearray['maxphptoshow']; |
210 | 210 | $maxphptoshowparam = $maxfilesizearray['maxphptoshowparam']; |
211 | 211 | if ($maxmin > 0) { |
212 | - $out .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">'; // MAX_FILE_SIZE must precede the field type=file |
|
212 | + $out .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">'; // MAX_FILE_SIZE must precede the field type=file |
|
213 | 213 | } |
214 | 214 | $out .= '<input class="flat minwidth400 maxwidth200onsmartphone" type="file"'; |
215 | 215 | $out .= ((getDolGlobalString('MAIN_DISABLE_MULTIPLE_FILEUPLOAD') || $disablemulti) ? ' name="userfile"' : ' name="userfile[]" multiple'); |
@@ -2231,7 +2231,7 @@ discard block |
||
2231 | 2231 | print '<td class="right">'; |
2232 | 2232 | print '<a href="' . $_SERVER['PHP_SELF'] . '?action=update&linkid=' . $link->id . $param . '&token=' . newToken() . '" class="editfilelink editfielda reposition" >' . img_edit() . '</a>'; // id= is included into $param |
2233 | 2233 | if ($permissiontodelete) { |
2234 | - print ' <a class="deletefilelink reposition" href="' . $_SERVER['PHP_SELF'] . '?action=deletelink&token=' . newToken() . '&linkid=' . ((int)$link->id) . $param . '">' . img_delete() . '</a>'; // id= is included into $param |
|
2234 | + print ' <a class="deletefilelink reposition" href="' . $_SERVER['PHP_SELF'] . '?action=deletelink&token=' . newToken() . '&linkid=' . ((int) $link->id) . $param . '">' . img_delete() . '</a>'; // id= is included into $param |
|
2235 | 2235 | } else { |
2236 | 2236 | print ' '; |
2237 | 2237 | } |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | if (count($filter) > 0) { |
252 | 252 | foreach ($filter as $key => $value) { |
253 | 253 | if ($key == 't.rowid') { |
254 | - $sql .= " AND " . $this->db->sanitize($key) . " = " . ((int)$value); |
|
254 | + $sql .= " AND " . $this->db->sanitize($key) . " = " . ((int) $value); |
|
255 | 255 | } else { |
256 | 256 | $sql .= " AND " . $this->db->sanitize($key) . " LIKE '%" . $this->db->escape($this->db->escapeforlike($value)) . "%'"; |
257 | 257 | } |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | $this->db->begin(); |
351 | 351 | |
352 | 352 | $sql = "DELETE FROM " . MAIN_DB_PREFIX . "cronjob"; |
353 | - $sql .= " WHERE rowid=" . ((int)$this->id); |
|
353 | + $sql .= " WHERE rowid=" . ((int) $this->id); |
|
354 | 354 | |
355 | 355 | dol_syslog(get_class($this) . "::delete", LOG_DEBUG); |
356 | 356 | $resql = $this->db->query($sql); |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | $sql .= " t.test"; |
474 | 474 | $sql .= " FROM " . MAIN_DB_PREFIX . "cronjob as t"; |
475 | 475 | if ($id > 0) { |
476 | - $sql .= " WHERE t.rowid = " . ((int)$id); |
|
476 | + $sql .= " WHERE t.rowid = " . ((int) $id); |
|
477 | 477 | } else { |
478 | 478 | $sql .= " WHERE t.entity IN(0, " . getEntity('cron') . ")"; |
479 | 479 | $sql .= " AND t.objectname = '" . $this->db->escape($objectname) . "'"; |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | $this->datenextrun = $this->db->jdate($obj->datenextrun); |
506 | 506 | $this->dateend = $this->db->jdate($obj->dateend); |
507 | 507 | $this->datestart = $this->db->jdate($obj->datestart); |
508 | - $this->lastresult = (string)$obj->lastresult; |
|
508 | + $this->lastresult = (string) $obj->lastresult; |
|
509 | 509 | $this->lastoutput = $obj->lastoutput; |
510 | 510 | $this->datelastresult = $this->db->jdate($obj->datelastresult); |
511 | 511 | $this->unitfrequency = $obj->unitfrequency; |
@@ -586,19 +586,19 @@ discard block |
||
586 | 586 | $this->unitfrequency = trim($this->unitfrequency); |
587 | 587 | } |
588 | 588 | if (isset($this->frequency)) { |
589 | - $this->frequency = (int)$this->frequency; |
|
589 | + $this->frequency = (int) $this->frequency; |
|
590 | 590 | } |
591 | 591 | if (isset($this->status)) { |
592 | - $this->status = (int)$this->status; |
|
592 | + $this->status = (int) $this->status; |
|
593 | 593 | } |
594 | 594 | if (isset($this->note_private)) { |
595 | 595 | $this->note_private = trim($this->note_private); |
596 | 596 | } |
597 | 597 | if (isset($this->nbrun)) { |
598 | - $this->nbrun = (int)$this->nbrun; |
|
598 | + $this->nbrun = (int) $this->nbrun; |
|
599 | 599 | } |
600 | 600 | if (isset($this->maxrun)) { |
601 | - $this->maxrun = (int)$this->maxrun; |
|
601 | + $this->maxrun = (int) $this->maxrun; |
|
602 | 602 | } |
603 | 603 | if (isset($this->libname)) { |
604 | 604 | $this->libname = trim($this->libname); |
@@ -698,13 +698,13 @@ discard block |
||
698 | 698 | $sql .= " " . (!isset($this->datelastresult) || dol_strlen($this->datelastresult) == 0 ? 'NULL' : "'" . $this->db->idate($this->datelastresult) . "'") . ","; |
699 | 699 | $sql .= " " . (!isset($this->lastoutput) ? 'NULL' : "'" . $this->db->escape($this->lastoutput) . "'") . ","; |
700 | 700 | $sql .= " " . (!isset($this->unitfrequency) ? 'NULL' : "'" . $this->db->escape($this->unitfrequency) . "'") . ","; |
701 | - $sql .= " " . (!isset($this->frequency) ? '0' : ((int)$this->frequency)) . ","; |
|
702 | - $sql .= " " . (!isset($this->status) ? '0' : ((int)$this->status)) . ","; |
|
703 | - $sql .= " " . ($user->id ? (int)$user->id : "NULL") . ","; |
|
704 | - $sql .= " " . ($user->id ? (int)$user->id : "NULL") . ","; |
|
701 | + $sql .= " " . (!isset($this->frequency) ? '0' : ((int) $this->frequency)) . ","; |
|
702 | + $sql .= " " . (!isset($this->status) ? '0' : ((int) $this->status)) . ","; |
|
703 | + $sql .= " " . ($user->id ? (int) $user->id : "NULL") . ","; |
|
704 | + $sql .= " " . ($user->id ? (int) $user->id : "NULL") . ","; |
|
705 | 705 | $sql .= " " . (!isset($this->note_private) ? 'NULL' : "'" . $this->db->escape($this->note_private) . "'") . ","; |
706 | - $sql .= " " . (!isset($this->nbrun) ? '0' : ((int)$this->nbrun)) . ","; |
|
707 | - $sql .= " " . (empty($this->maxrun) ? '0' : ((int)$this->maxrun)) . ","; |
|
706 | + $sql .= " " . (!isset($this->nbrun) ? '0' : ((int) $this->nbrun)) . ","; |
|
707 | + $sql .= " " . (empty($this->maxrun) ? '0' : ((int) $this->maxrun)) . ","; |
|
708 | 708 | $sql .= " " . (!isset($this->libname) ? 'NULL' : "'" . $this->db->escape($this->libname) . "'") . ","; |
709 | 709 | $sql .= " " . (!isset($this->test) ? 'NULL' : "'" . $this->db->escape($this->test) . "'"); |
710 | 710 | $sql .= ")"; |
@@ -969,7 +969,7 @@ discard block |
||
969 | 969 | $sql = "SELECT"; |
970 | 970 | $sql .= " f.rowid, f.datec, f.tms, f.fk_user_mod, f.fk_user_author"; |
971 | 971 | $sql .= " FROM " . MAIN_DB_PREFIX . "cronjob as f"; |
972 | - $sql .= " WHERE f.rowid = " . ((int)$id); |
|
972 | + $sql .= " WHERE f.rowid = " . ((int) $id); |
|
973 | 973 | |
974 | 974 | dol_syslog(get_class($this) . "::fetch", LOG_DEBUG); |
975 | 975 | $resql = $this->db->query($sql); |
@@ -1144,7 +1144,7 @@ discard block |
||
1144 | 1144 | dol_syslog(get_class($this) . "::run_jobs START " . $this->objectname . "->" . $this->methodename . "(" . $this->params . "); (Note: Log for cron jobs may be into a different log file)", LOG_DEBUG); |
1145 | 1145 | |
1146 | 1146 | // Create Object for the called module |
1147 | - $nameofclass = (string)$this->objectname; |
|
1147 | + $nameofclass = (string) $this->objectname; |
|
1148 | 1148 | $object = Misc::getCodeLibClass($this->objectname, $this->db); |
1149 | 1149 | // $object = new $nameofclass($this->db); |
1150 | 1150 | if ($this->entity > 0) { |
@@ -1280,7 +1280,7 @@ discard block |
||
1280 | 1280 | $msg = $langs->trans("ErrorInBatch", $this->label); |
1281 | 1281 | $from = getDolGlobalString('MAIN_MAIL_EMAIL_FROM'); |
1282 | 1282 | $cmailfile = new CMailFile($subject, $this->email_alert, $from, $msg); |
1283 | - $result = $cmailfile->sendfile(); // Do not test result |
|
1283 | + $result = $cmailfile->sendfile(); // Do not test result |
|
1284 | 1284 | } |
1285 | 1285 | |
1286 | 1286 | return $error ? -1 : 1; |
@@ -1342,16 +1342,16 @@ discard block |
||
1342 | 1342 | $this->unitfrequency = trim($this->unitfrequency); |
1343 | 1343 | } |
1344 | 1344 | if (isset($this->frequency)) { |
1345 | - $this->frequency = (int)$this->frequency; |
|
1345 | + $this->frequency = (int) $this->frequency; |
|
1346 | 1346 | } |
1347 | 1347 | if (isset($this->status)) { |
1348 | - $this->status = (int)$this->status; |
|
1348 | + $this->status = (int) $this->status; |
|
1349 | 1349 | } |
1350 | 1350 | if (isset($this->note_private)) { |
1351 | 1351 | $this->note_private = trim($this->note_private); |
1352 | 1352 | } |
1353 | 1353 | if (isset($this->nbrun)) { |
1354 | - $this->nbrun = (is_numeric($this->nbrun)) ? (int)trim((string)$this->nbrun) : 0; |
|
1354 | + $this->nbrun = (is_numeric($this->nbrun)) ? (int) trim((string) $this->nbrun) : 0; |
|
1355 | 1355 | } |
1356 | 1356 | if (isset($this->libname)) { |
1357 | 1357 | $this->libname = trim($this->libname); |
@@ -1419,7 +1419,7 @@ discard block |
||
1419 | 1419 | |
1420 | 1420 | // Update request |
1421 | 1421 | $sql = "UPDATE " . MAIN_DB_PREFIX . "cronjob SET"; |
1422 | - $sql .= " entity=" . (isset($this->entity) ? ((int)$this->entity) : $conf->entity) . ","; |
|
1422 | + $sql .= " entity=" . (isset($this->entity) ? ((int) $this->entity) : $conf->entity) . ","; |
|
1423 | 1423 | $sql .= " label=" . (isset($this->label) ? "'" . $this->db->escape($this->label) . "'" : "null") . ","; |
1424 | 1424 | $sql .= " jobtype=" . (isset($this->jobtype) ? "'" . $this->db->escape($this->jobtype) . "'" : "null") . ","; |
1425 | 1425 | $sql .= " command=" . (isset($this->command) ? "'" . $this->db->escape($this->command) . "'" : "null") . ","; |
@@ -1429,7 +1429,7 @@ discard block |
||
1429 | 1429 | $sql .= " params=" . (isset($this->params) ? "'" . $this->db->escape($this->params) . "'" : "null") . ","; |
1430 | 1430 | $sql .= " md5params=" . (isset($this->md5params) ? "'" . $this->db->escape($this->md5params) . "'" : "null") . ","; |
1431 | 1431 | $sql .= " module_name=" . (isset($this->module_name) ? "'" . $this->db->escape($this->module_name) . "'" : "null") . ","; |
1432 | - $sql .= " priority=" . (isset($this->priority) ? ((int)$this->priority) : "null") . ","; |
|
1432 | + $sql .= " priority=" . (isset($this->priority) ? ((int) $this->priority) : "null") . ","; |
|
1433 | 1433 | $sql .= " datelastrun=" . (dol_strlen($this->datelastrun) != 0 ? "'" . $this->db->idate($this->datelastrun) . "'" : 'null') . ","; |
1434 | 1434 | $sql .= " datenextrun=" . (dol_strlen($this->datenextrun) != 0 ? "'" . $this->db->idate($this->datenextrun) . "'" : 'null') . ","; |
1435 | 1435 | $sql .= " dateend=" . (dol_strlen($this->dateend) != 0 ? "'" . $this->db->idate($this->dateend) . "'" : 'null') . ","; |
@@ -1438,18 +1438,18 @@ discard block |
||
1438 | 1438 | $sql .= " lastresult=" . (isset($this->lastresult) ? "'" . $this->db->escape($this->lastresult) . "'" : "null") . ","; |
1439 | 1439 | $sql .= " lastoutput=" . (isset($this->lastoutput) ? "'" . $this->db->escape($this->lastoutput) . "'" : "null") . ","; |
1440 | 1440 | $sql .= " unitfrequency=" . (isset($this->unitfrequency) ? "'" . $this->db->escape($this->unitfrequency) . "'" : "null") . ","; |
1441 | - $sql .= " frequency=" . (isset($this->frequency) ? ((int)$this->frequency) : "null") . ","; |
|
1442 | - $sql .= " status=" . (isset($this->status) ? ((int)$this->status) : "null") . ","; |
|
1441 | + $sql .= " frequency=" . (isset($this->frequency) ? ((int) $this->frequency) : "null") . ","; |
|
1442 | + $sql .= " status=" . (isset($this->status) ? ((int) $this->status) : "null") . ","; |
|
1443 | 1443 | $sql .= " processing=" . ((isset($this->processing) && $this->processing > 0) ? $this->processing : "0") . ","; |
1444 | - $sql .= " pid=" . (isset($this->pid) ? ((int)$this->pid) : "null") . ","; |
|
1444 | + $sql .= " pid=" . (isset($this->pid) ? ((int) $this->pid) : "null") . ","; |
|
1445 | 1445 | $sql .= " email_alert = " . (isset($this->email_alert) ? "'" . $this->db->escape($this->email_alert) . "'" : "null") . ","; |
1446 | - $sql .= " fk_user_mod = " . ((int)$user->id) . ","; |
|
1446 | + $sql .= " fk_user_mod = " . ((int) $user->id) . ","; |
|
1447 | 1447 | $sql .= " note=" . (isset($this->note_private) ? "'" . $this->db->escape($this->note_private) . "'" : "null") . ","; |
1448 | 1448 | $sql .= " nbrun=" . ((isset($this->nbrun) && $this->nbrun > 0) ? $this->nbrun : "null") . ","; |
1449 | 1449 | $sql .= " maxrun=" . ((isset($this->maxrun) && $this->maxrun > 0) ? $this->maxrun : "0") . ","; |
1450 | 1450 | $sql .= " libname=" . (isset($this->libname) ? "'" . $this->db->escape($this->libname) . "'" : "null") . ","; |
1451 | 1451 | $sql .= " test=" . (isset($this->test) ? "'" . $this->db->escape($this->test) . "'" : "null"); |
1452 | - $sql .= " WHERE rowid=" . ((int)$this->id); |
|
1452 | + $sql .= " WHERE rowid=" . ((int) $this->id); |
|
1453 | 1453 | |
1454 | 1454 | $this->db->begin(); |
1455 | 1455 | |
@@ -1506,16 +1506,16 @@ discard block |
||
1506 | 1506 | |
1507 | 1507 | if (empty($this->datenextrun)) { |
1508 | 1508 | if (empty($this->datestart)) { |
1509 | - if (!is_numeric($this->frequency) || (int)$this->unitfrequency == 2678400) { |
|
1509 | + if (!is_numeric($this->frequency) || (int) $this->unitfrequency == 2678400) { |
|
1510 | 1510 | $this->datenextrun = dol_time_plus_duree($now, $this->frequency, 'm'); |
1511 | 1511 | } else { |
1512 | - $this->datenextrun = $now + ($this->frequency * (int)$this->unitfrequency); |
|
1512 | + $this->datenextrun = $now + ($this->frequency * (int) $this->unitfrequency); |
|
1513 | 1513 | } |
1514 | 1514 | } else { |
1515 | - if (!is_numeric($this->frequency) || (int)$this->unitfrequency == 2678400) { |
|
1515 | + if (!is_numeric($this->frequency) || (int) $this->unitfrequency == 2678400) { |
|
1516 | 1516 | $this->datenextrun = dol_time_plus_duree($this->datestart, $this->frequency, 'm'); |
1517 | 1517 | } else { |
1518 | - $this->datenextrun = $this->datestart + ($this->frequency * (int)$this->unitfrequency); |
|
1518 | + $this->datenextrun = $this->datestart + ($this->frequency * (int) $this->unitfrequency); |
|
1519 | 1519 | } |
1520 | 1520 | } |
1521 | 1521 | } |
@@ -1523,10 +1523,10 @@ discard block |
||
1523 | 1523 | if ($this->datenextrun < $now && $this->frequency > 0 && !empty($this->unitfrequency)) { |
1524 | 1524 | // Loop until date is after future |
1525 | 1525 | while ($this->datenextrun < $now) { |
1526 | - if (!is_numeric($this->unitfrequency) || (int)$this->unitfrequency == 2678400 || (int)$this->unitfrequency <= 0) { |
|
1526 | + if (!is_numeric($this->unitfrequency) || (int) $this->unitfrequency == 2678400 || (int) $this->unitfrequency <= 0) { |
|
1527 | 1527 | $this->datenextrun = dol_time_plus_duree($this->datenextrun, $this->frequency, 'm'); |
1528 | 1528 | } else { |
1529 | - $this->datenextrun += ($this->frequency * (int)$this->unitfrequency); |
|
1529 | + $this->datenextrun += ($this->frequency * (int) $this->unitfrequency); |
|
1530 | 1530 | } |
1531 | 1531 | } |
1532 | 1532 | } else { |