@@ -466,7 +466,7 @@ |
||
466 | 466 | $sql = 'SELECT rowid, date_creation as datec, tms as datem,'; |
467 | 467 | $sql .= ' fk_user_creat, fk_user_modif'; |
468 | 468 | $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t'; |
469 | - $sql .= ' WHERE t.rowid = ' . ((int)$id); |
|
469 | + $sql .= ' WHERE t.rowid = ' . ((int) $id); |
|
470 | 470 | $result = $this->db->query($sql); |
471 | 471 | if ($result) { |
472 | 472 | if ($this->db->num_rows($result)) { |
@@ -63,7 +63,7 @@ |
||
63 | 63 | */ |
64 | 64 | public function writeBarCode($code, $encoding, $readable = 'Y', $scale = 1, $nooutputiferror = 0) |
65 | 65 | { |
66 | - return -1; // Error by default, this method must be implemented by the driver |
|
66 | + return -1; // Error by default, this method must be implemented by the driver |
|
67 | 67 | } |
68 | 68 | } |
69 | 69 |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | $action = GETPOST('action', 'aZ09'); |
53 | 53 | $value = GETPOST('value', 'alpha'); |
54 | -$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
54 | +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
55 | 55 | |
56 | 56 | $label = GETPOST('label', 'alpha'); |
57 | 57 | $scandir = GETPOST('scan_dir', 'alpha'); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | // Search template files |
91 | 91 | $file = ''; |
92 | 92 | $classname = ''; |
93 | - $dirmodels = array_merge(array('/'), (array)$conf->modules_parts['models']); |
|
93 | + $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); |
|
94 | 94 | foreach ($dirmodels as $reldir) { |
95 | 95 | $file = dol_buildpath($reldir . "core/modules/expensereport/doc/pdf_" . $modele . ".modules.php", 0); |
96 | 96 | if (file_exists($file)) { |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | * View |
189 | 189 | */ |
190 | 190 | |
191 | -$dirmodels = array_merge(array('/'), (array)$conf->modules_parts['models']); |
|
191 | +$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); |
|
192 | 192 | |
193 | 193 | llxHeader('', $langs->trans("ExpenseReportsSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-expensereport'); |
194 | 194 |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $arrayofexistingboxid = array(); |
99 | 99 | $nbboxonleft = $nbboxonright = 0; |
100 | 100 | $sql = "SELECT box_id, box_order FROM " . MAIN_DB_PREFIX . "boxes"; |
101 | - $sql .= " WHERE position = " . ((int)$pos) . " AND fk_user = " . ((int)$fk_user) . " AND entity = " . ((int)$conf->entity); |
|
101 | + $sql .= " WHERE position = " . ((int) $pos) . " AND fk_user = " . ((int) $fk_user) . " AND entity = " . ((int) $conf->entity); |
|
102 | 102 | dol_syslog("boxes.php activate box", LOG_DEBUG); |
103 | 103 | $resql = $db->query($sql); |
104 | 104 | if ($resql) { |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $sql = "INSERT INTO " . MAIN_DB_PREFIX . "boxes ("; |
121 | 121 | $sql .= "box_id, position, box_order, fk_user, entity"; |
122 | 122 | $sql .= ") VALUES ("; |
123 | - $sql .= ((int)$boxid['value']) . ", " . ((int)$pos) . ", '" . (($nbboxonleft > $nbboxonright) ? 'B01' : 'A01') . "', " . ((int)$fk_user) . ", " . $conf->entity; |
|
123 | + $sql .= ((int) $boxid['value']) . ", " . ((int) $pos) . ", '" . (($nbboxonleft > $nbboxonright) ? 'B01' : 'A01') . "', " . ((int) $fk_user) . ", " . $conf->entity; |
|
124 | 124 | $sql .= ")"; |
125 | 125 | |
126 | 126 | dol_syslog("boxes.php activate box", LOG_DEBUG); |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | |
148 | 148 | if ($action == 'delete') { |
149 | 149 | $sql = "SELECT box_id FROM " . MAIN_DB_PREFIX . "boxes"; |
150 | - $sql .= " WHERE rowid=" . ((int)$rowid); |
|
150 | + $sql .= " WHERE rowid=" . ((int) $rowid); |
|
151 | 151 | |
152 | 152 | $resql = $db->query($sql); |
153 | 153 | $obj = $db->fetch_object($resql); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | |
157 | 157 | $sql = "DELETE FROM " . MAIN_DB_PREFIX . "boxes"; |
158 | 158 | $sql .= " WHERE entity = " . $conf->entity; |
159 | - $sql .= " AND box_id=" . ((int)$obj->box_id); |
|
159 | + $sql .= " AND box_id=" . ((int) $obj->box_id); |
|
160 | 160 | |
161 | 161 | $resql = $db->query($sql); |
162 | 162 | |
@@ -181,18 +181,18 @@ discard block |
||
181 | 181 | $newsecond = $objfrom->box_order; |
182 | 182 | if ($newfirst == $newsecond) { |
183 | 183 | $newsecondchar = preg_replace('/[0-9]+/', '', $newsecond); |
184 | - $newsecondnum = (int)preg_replace('/[a-zA-Z]+/', '', $newsecond); |
|
184 | + $newsecondnum = (int) preg_replace('/[a-zA-Z]+/', '', $newsecond); |
|
185 | 185 | $newsecond = sprintf("%s%02d", $newsecondchar ? $newsecondchar : 'A', $newsecondnum + 1); |
186 | 186 | } |
187 | 187 | |
188 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "boxes SET box_order='" . $db->escape($newfirst) . "' WHERE rowid=" . ((int)$objfrom->rowid); |
|
188 | + $sql = "UPDATE " . MAIN_DB_PREFIX . "boxes SET box_order='" . $db->escape($newfirst) . "' WHERE rowid=" . ((int) $objfrom->rowid); |
|
189 | 189 | dol_syslog($sql); |
190 | 190 | $resultupdatefrom = $db->query($sql); |
191 | 191 | if (!$resultupdatefrom) { |
192 | 192 | dol_print_error($db); |
193 | 193 | } |
194 | 194 | |
195 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "boxes SET box_order='" . $db->escape($newsecond) . "' WHERE rowid=" . ((int)$objto->rowid); |
|
195 | + $sql = "UPDATE " . MAIN_DB_PREFIX . "boxes SET box_order='" . $db->escape($newsecond) . "' WHERE rowid=" . ((int) $objto->rowid); |
|
196 | 196 | dol_syslog($sql); |
197 | 197 | $resultupdateto = $db->query($sql); |
198 | 198 | if (!$resultupdateto) { |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | // We renumber the order of the boxes if one of them is in '' |
259 | 259 | // This occurs just after an insert. |
260 | 260 | if ($decalage) { |
261 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "boxes SET box_order='" . $db->escape($decalage) . "' WHERE rowid=" . ((int)$obj->rowid); |
|
261 | + $sql = "UPDATE " . MAIN_DB_PREFIX . "boxes SET box_order='" . $db->escape($decalage) . "' WHERE rowid=" . ((int) $obj->rowid); |
|
262 | 262 | $db->query($sql); |
263 | 263 | } |
264 | 264 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | $value = GETPOST('value', 'alpha'); |
53 | 53 | $label = GETPOST('label', 'alpha'); |
54 | -$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
54 | +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
55 | 55 | |
56 | 56 | $scandir = GETPOST('scan_dir', 'alpha'); |
57 | 57 | $type = 'myobject'; |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $error = 0; |
77 | 77 | $setupnotempty = 0; |
78 | 78 | |
79 | -$dirmodels = array_merge(array('/'), (array)$conf->modules_parts['models']); |
|
79 | +$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); |
|
80 | 80 | |
81 | 81 | // Access control |
82 | 82 | if (empty($user->admin)) { |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | $this->emetteur->country_code |
187 | 187 | ); |
188 | 188 | if (!$address->isValid()) { |
189 | - $this->error = $langs->transnoentities("SwissQrCreditorAddressInvalid", (string)$address->getViolations()); |
|
189 | + $this->error = $langs->transnoentities("SwissQrCreditorAddressInvalid", (string) $address->getViolations()); |
|
190 | 190 | return false; |
191 | 191 | } |
192 | 192 | $qrBill->setCreditor($address); |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | $creditorInformation = SwissQrBill\DataGroup\Element\CreditorInformation::create($account->iban); |
198 | 198 | if (!$creditorInformation->isValid()) { |
199 | 199 | $langs->load("errors"); |
200 | - $this->error = $langs->transnoentities("SwissQrCreditorInformationInvalid", $account->iban, (string)$creditorInformation->getViolations()); |
|
200 | + $this->error = $langs->transnoentities("SwissQrCreditorInformationInvalid", $account->iban, (string) $creditorInformation->getViolations()); |
|
201 | 201 | return false; |
202 | 202 | } |
203 | 203 | $qrBill->setCreditorInformation($creditorInformation); |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | // Add payment amount, with currency |
221 | 221 | $pai = SwissQrBill\DataGroup\Element\PaymentAmountInformation::create($currencyinvoicecode, $object->total_ttc); |
222 | 222 | if (!$pai->isValid()) { |
223 | - $this->error = $langs->transnoentities("SwissQrPaymentInformationInvalid", $object->total_ttc, (string)$pai->getViolations()); |
|
223 | + $this->error = $langs->transnoentities("SwissQrPaymentInformationInvalid", $object->total_ttc, (string) $pai->getViolations()); |
|
224 | 224 | return false; |
225 | 225 | } |
226 | 226 | $qrBill->setPaymentAmountInformation($pai); |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | $object->thirdparty->country_code |
242 | 242 | ); |
243 | 243 | if (!$address->isValid()) { |
244 | - $this->error = $langs->transnoentities("SwissQrDebitorAddressInvalid", (string)$address->getViolations()); |
|
244 | + $this->error = $langs->transnoentities("SwissQrDebitorAddressInvalid", (string) $address->getViolations()); |
|
245 | 245 | return false; |
246 | 246 | } |
247 | 247 | $qrBill->setUltimateDebtor($address); |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | */ |
234 | 234 | public function create(User $user, $notrigger = 0) |
235 | 235 | { |
236 | - $this->status = (int)$this->status; |
|
236 | + $this->status = (int) $this->status; |
|
237 | 237 | if ($this->fk_warehouse_source <= 0) { |
238 | 238 | $this->fk_warehouse_source = 0; |
239 | 239 | } |
@@ -580,9 +580,9 @@ discard block |
||
580 | 580 | $sql .= ", date_validation = '" . $this->db->idate($now) . "',"; |
581 | 581 | } |
582 | 582 | if (!empty($this->fields['fk_user_valid'])) { |
583 | - $sql .= ", fk_user_valid = " . ((int)$user->id); |
|
583 | + $sql .= ", fk_user_valid = " . ((int) $user->id); |
|
584 | 584 | } |
585 | - $sql .= " WHERE rowid = " . ((int)$this->id); |
|
585 | + $sql .= " WHERE rowid = " . ((int) $this->id); |
|
586 | 586 | |
587 | 587 | dol_syslog(get_class($this) . "::validate()", LOG_DEBUG); |
588 | 588 | $resql = $this->db->query($sql); |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | if (preg_match('/^[\(]?PROV/i', $this->ref)) { |
610 | 610 | // Now we rename also files into index |
611 | 611 | $sql = 'UPDATE ' . MAIN_DB_PREFIX . "ecm_files set filename = CONCAT('" . $this->db->escape($this->newref) . "', SUBSTR(filename, " . (strlen($this->ref) + 1) . ")), filepath = 'stocktransfer/" . $this->db->escape($this->newref) . "'"; |
612 | - $sql .= " WHERE filename LIKE '" . $this->db->escape($this->ref) . "%' AND filepath = 'stocktransfer/" . $this->db->escape($this->ref) . "' and entity = " . ((int)$conf->entity); |
|
612 | + $sql .= " WHERE filename LIKE '" . $this->db->escape($this->ref) . "%' AND filepath = 'stocktransfer/" . $this->db->escape($this->ref) . "' and entity = " . ((int) $conf->entity); |
|
613 | 613 | $resql = $this->db->query($sql); |
614 | 614 | if (!$resql) { |
615 | 615 | $error++; |
@@ -898,7 +898,7 @@ discard block |
||
898 | 898 | $sql = 'SELECT rowid, date_creation as datec, tms as datem,'; |
899 | 899 | $sql .= ' fk_user_creat, fk_user_modif'; |
900 | 900 | $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t'; |
901 | - $sql .= ' WHERE t.rowid = ' . ((int)$id); |
|
901 | + $sql .= ' WHERE t.rowid = ' . ((int) $id); |
|
902 | 902 | $result = $this->db->query($sql); |
903 | 903 | if ($result) { |
904 | 904 | if ($this->db->num_rows($result)) { |
@@ -938,7 +938,7 @@ discard block |
||
938 | 938 | $this->lines = array(); |
939 | 939 | |
940 | 940 | $objectline = new StockTransferLine($this->db); |
941 | - $result = $objectline->fetchAll('ASC', 'rang', 0, 0, "(fk_stocktransfer:=:" . ((int)$this->id) . ")"); |
|
941 | + $result = $objectline->fetchAll('ASC', 'rang', 0, 0, "(fk_stocktransfer:=:" . ((int) $this->id) . ")"); |
|
942 | 942 | |
943 | 943 | if (is_numeric($result)) { |
944 | 944 | $this->error = $objectline->error; |
@@ -971,12 +971,12 @@ discard block |
||
971 | 971 | $classname = getDolGlobalString('STOCKTRANSFER_STOCKTRANSFER_ADDON'); |
972 | 972 | |
973 | 973 | // Include file with class |
974 | - $dirmodels = array_merge(array('/'), (array)$conf->modules_parts['models']); |
|
974 | + $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); |
|
975 | 975 | foreach ($dirmodels as $reldir) { |
976 | 976 | $dir = dol_buildpath($reldir . "core/modules/stocktransfer/"); |
977 | 977 | |
978 | 978 | // Load file with numbering class (if found) |
979 | - $mybool = ((bool)@include_once $dir . $file) || $mybool; |
|
979 | + $mybool = ((bool) @include_once $dir . $file) || $mybool; |
|
980 | 980 | } |
981 | 981 | |
982 | 982 | if ($mybool === false) { |
@@ -433,8 +433,8 @@ discard block |
||
433 | 433 | $p->fetch($this->fk_product); |
434 | 434 | |
435 | 435 | $op = array(); |
436 | - $op[0] = "+" . trim((string)$this->qty); |
|
437 | - $op[1] = "-" . trim((string)$this->qty); |
|
436 | + $op[0] = "+" . trim((string) $this->qty); |
|
437 | + $op[1] = "-" . trim((string) $this->qty); |
|
438 | 438 | $movementstock = new MouvementStock($this->db); |
439 | 439 | $st = new StockTransfer($this->db); |
440 | 440 | $movementstock->origin_type = $st->origin_type; |
@@ -547,9 +547,9 @@ discard block |
||
547 | 547 | $sql .= ", date_validation = '" . $this->db->idate($now) . "',"; |
548 | 548 | } |
549 | 549 | if (!empty($this->fields['fk_user_valid'])) { |
550 | - $sql .= ", fk_user_valid = " . ((int)$user->id); |
|
550 | + $sql .= ", fk_user_valid = " . ((int) $user->id); |
|
551 | 551 | } |
552 | - $sql .= " WHERE rowid = " . ((int)$this->id); |
|
552 | + $sql .= " WHERE rowid = " . ((int) $this->id); |
|
553 | 553 | |
554 | 554 | dol_syslog(get_class($this) . "::validate()", LOG_DEBUG); |
555 | 555 | $resql = $this->db->query($sql); |
@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | if (preg_match('/^[\(]?PROV/i', $this->ref)) { |
577 | 577 | // Now we rename also files into index |
578 | 578 | $sql = 'UPDATE ' . MAIN_DB_PREFIX . "ecm_files set filename = CONCAT('" . $this->db->escape($this->newref) . "', SUBSTR(filename, " . (strlen($this->ref) + 1) . ")), filepath = 'stocktransferline/" . $this->db->escape($this->newref) . "'"; |
579 | - $sql .= " WHERE filename LIKE '" . $this->db->escape($this->ref) . "%' AND filepath = 'stocktransferline/" . $this->db->escape($this->ref) . "' and entity = " . ((int)$conf->entity); |
|
579 | + $sql .= " WHERE filename LIKE '" . $this->db->escape($this->ref) . "%' AND filepath = 'stocktransferline/" . $this->db->escape($this->ref) . "' and entity = " . ((int) $conf->entity); |
|
580 | 580 | $resql = $this->db->query($sql); |
581 | 581 | if (!$resql) { |
582 | 582 | $error++; |
@@ -863,7 +863,7 @@ discard block |
||
863 | 863 | $sql = 'SELECT rowid, date_creation as datec, tms as datem,'; |
864 | 864 | $sql .= ' fk_user_creat, fk_user_modif'; |
865 | 865 | $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t'; |
866 | - $sql .= ' WHERE t.rowid = ' . ((int)$id); |
|
866 | + $sql .= ' WHERE t.rowid = ' . ((int) $id); |
|
867 | 867 | $result = $this->db->query($sql); |
868 | 868 | if ($result) { |
869 | 869 | if ($this->db->num_rows($result)) { |
@@ -914,12 +914,12 @@ discard block |
||
914 | 914 | $classname = getDolGlobalString('STOCKTRANSFER_STOCKTRANSFERLINE_ADDON'); |
915 | 915 | |
916 | 916 | // Include file with class |
917 | - $dirmodels = array_merge(array('/'), (array)$conf->modules_parts['models']); |
|
917 | + $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); |
|
918 | 918 | foreach ($dirmodels as $reldir) { |
919 | 919 | $dir = dol_buildpath($reldir . "core/modules/stocktransfer/"); |
920 | 920 | |
921 | 921 | // Load file with numbering class (if found) |
922 | - $mybool = ((bool)@include_once $dir . $file) || $mybool; |
|
922 | + $mybool = ((bool) @include_once $dir . $file) || $mybool; |
|
923 | 923 | } |
924 | 924 | |
925 | 925 | if ($mybool === false) { |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $action = GETPOST('action', 'aZ09'); |
50 | 50 | $backtopage = GETPOST('backtopage', 'alpha'); |
51 | 51 | $value = GETPOST('value', 'alpha'); |
52 | -$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
52 | +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
53 | 53 | |
54 | 54 | $label = GETPOST('label', 'alpha'); |
55 | 55 | $scandir = GETPOST('scan_dir', 'alpha'); |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | // Search template files |
120 | 120 | $file = ''; |
121 | 121 | $className = ''; |
122 | - $dirmodels = array_merge(array('/'), (array)$conf->modules_parts['models']); |
|
122 | + $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); |
|
123 | 123 | foreach ($dirmodels as $reldir) { |
124 | 124 | $file = dol_buildpath($reldir . "core/modules/knowledgemanagement/doc/pdf_" . $modele . "_" . strtolower($tmpobjectkey) . ".modules.php", 0); |
125 | 125 | if (file_exists($file)) { |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | |
196 | 196 | $form = new Form($db); |
197 | 197 | |
198 | -$dirmodels = array_merge(array('/'), (array)$conf->modules_parts['models']); |
|
198 | +$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); |
|
199 | 199 | |
200 | 200 | $page_name = "KnowledgeManagementSetup"; |
201 | 201 | llxHeader('', $langs->trans($page_name), '', '', 0, 0, '', '', '', 'mod-admin page-knowledgemanagement'); |