@@ -248,8 +248,8 @@ |
||
248 | 248 | } |
249 | 249 | |
250 | 250 | $sql = array( |
251 | - "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[1][2]) . "' AND type = 'contract' AND entity = " . ((int)$conf->entity), |
|
252 | - "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[1][2]) . "', 'contract', " . ((int)$conf->entity) . ")" |
|
251 | + "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[1][2]) . "' AND type = 'contract' AND entity = " . ((int) $conf->entity), |
|
252 | + "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[1][2]) . "', 'contract', " . ((int) $conf->entity) . ")" |
|
253 | 253 | ); |
254 | 254 | |
255 | 255 | return $this->_init($sql, $options); |
@@ -163,7 +163,7 @@ |
||
163 | 163 | 'priority' => 61, |
164 | 164 | 'label' => 'MutltiCurrencyAutoUpdateCurrencies', |
165 | 165 | 'jobtype' => 'method', |
166 | - 'class' => 'multicurrency/class/multicurrency.class.php', // TODO: Review. Is correct? The file no longer exists! |
|
166 | + 'class' => 'multicurrency/class/multicurrency.class.php', // TODO: Review. Is correct? The file no longer exists! |
|
167 | 167 | 'objectname' => 'MultiCurrency', |
168 | 168 | 'method' => 'syncRates', |
169 | 169 | 'parameters' => '0,0,cron', |
@@ -656,7 +656,7 @@ discard block |
||
656 | 656 | $this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'facturedet_extrafields as extra2 on fd.rowid = extra2.fk_object'; |
657 | 657 | $this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product as p on (fd.fk_product = p.rowid)'; |
658 | 658 | if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
659 | - $this->export_sql_end[$r] .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int)$conf->entity); |
|
659 | + $this->export_sql_end[$r] .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity); |
|
660 | 660 | } |
661 | 661 | $this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product_extrafields as extra3 on p.rowid = extra3.fk_object'; |
662 | 662 | $this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'accounting_account as aa on fd.fk_code_ventilation = aa.rowid'; |
@@ -793,8 +793,8 @@ discard block |
||
793 | 793 | } |
794 | 794 | |
795 | 795 | $sql = array( |
796 | - "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[1][2]) . "' AND type = 'invoice' AND entity = " . ((int)$conf->entity), |
|
797 | - "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[1][2]) . "','invoice'," . ((int)$conf->entity) . ")" |
|
796 | + "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[1][2]) . "' AND type = 'invoice' AND entity = " . ((int) $conf->entity), |
|
797 | + "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[1][2]) . "','invoice'," . ((int) $conf->entity) . ")" |
|
798 | 798 | ); |
799 | 799 | |
800 | 800 | return $this->_init($sql, $options); |
@@ -266,8 +266,8 @@ |
||
266 | 266 | $this->remove($options); |
267 | 267 | |
268 | 268 | $sql = array( |
269 | - "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'standard' AND type='expensereport' AND entity = " . ((int)$conf->entity), |
|
270 | - "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('standard','expensereport'," . ((int)$conf->entity) . ")" |
|
269 | + "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'standard' AND type='expensereport' AND entity = " . ((int) $conf->entity), |
|
270 | + "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('standard','expensereport'," . ((int) $conf->entity) . ")" |
|
271 | 271 | ); |
272 | 272 | |
273 | 273 | return $this->_init($sql, $options); |
@@ -436,7 +436,7 @@ |
||
436 | 436 | 'linkedObjectsIds', |
437 | 437 | 'linkedObjects', |
438 | 438 | 'fk_delivery_address', |
439 | - 'projet', // There is already ->fk_project |
|
439 | + 'projet', // There is already ->fk_project |
|
440 | 440 | 'restrictiononfksoc', |
441 | 441 | 'specimen', |
442 | 442 | ); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | { |
125 | 125 | global $conf; |
126 | 126 | |
127 | - $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "multicurrency WHERE code = '" . $dbs->escape($code) . "' AND entity = " . ((int)$conf->entity); |
|
127 | + $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "multicurrency WHERE code = '" . $dbs->escape($code) . "' AND entity = " . ((int) $conf->entity); |
|
128 | 128 | |
129 | 129 | dol_syslog(__METHOD__, LOG_DEBUG); |
130 | 130 | $resql = $dbs->query($sql); |
@@ -198,9 +198,9 @@ discard block |
||
198 | 198 | |
199 | 199 | if ($multicurrency_tx) { |
200 | 200 | if ($way == 'dolibarr') { |
201 | - return (float)price2num($amount * $multicurrency_tx, 'MU'); |
|
201 | + return (float) price2num($amount * $multicurrency_tx, 'MU'); |
|
202 | 202 | } else { |
203 | - return (float)price2num($amount / $multicurrency_tx, 'MU'); |
|
203 | + return (float) price2num($amount / $multicurrency_tx, 'MU'); |
|
204 | 204 | } |
205 | 205 | } else { |
206 | 206 | return false; |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | { |
219 | 219 | global $db; |
220 | 220 | |
221 | - $sql = "SELECT multicurrency_tx FROM " . MAIN_DB_PREFIX . $table . " WHERE rowid = " . ((int)$fk_facture); |
|
221 | + $sql = "SELECT multicurrency_tx FROM " . MAIN_DB_PREFIX . $table . " WHERE rowid = " . ((int) $fk_facture); |
|
222 | 222 | |
223 | 223 | dol_syslog(__METHOD__, LOG_DEBUG); |
224 | 224 | $resql = $db->query($sql); |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | $sql = "UPDATE " . MAIN_DB_PREFIX . $this->table_element . " SET"; |
259 | 259 | $sql .= " name = '" . $this->db->escape($this->name) . "',"; |
260 | 260 | $sql .= " code = '" . $this->db->escape($this->code) . "'"; |
261 | - $sql .= " WHERE rowid = " . ((int)$this->id); |
|
261 | + $sql .= " WHERE rowid = " . ((int) $this->id); |
|
262 | 262 | |
263 | 263 | $this->db->begin(); |
264 | 264 | |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | } |
320 | 320 | |
321 | 321 | $sql = "DELETE FROM " . MAIN_DB_PREFIX . $this->table_element; |
322 | - $sql .= " WHERE rowid = " . ((int)$this->id); |
|
322 | + $sql .= " WHERE rowid = " . ((int) $this->id); |
|
323 | 323 | |
324 | 324 | dol_syslog(__METHOD__, LOG_DEBUG); |
325 | 325 | $resql = $this->db->query($sql); |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | if (!empty($code)) { |
480 | 480 | $sql .= ' WHERE c.code = \'' . $this->db->escape($code) . '\' AND c.entity = ' . $conf->entity; |
481 | 481 | } else { |
482 | - $sql .= ' WHERE c.rowid = ' . ((int)$id); |
|
482 | + $sql .= ' WHERE c.rowid = ' . ((int) $id); |
|
483 | 483 | } |
484 | 484 | |
485 | 485 | dol_syslog(__METHOD__, LOG_DEBUG); |
@@ -524,7 +524,7 @@ discard block |
||
524 | 524 | { |
525 | 525 | $sql = "SELECT cr.rowid"; |
526 | 526 | $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element_line . ' as cr'; |
527 | - $sql .= ' WHERE cr.fk_multicurrency = ' . ((int)$this->id); |
|
527 | + $sql .= ' WHERE cr.fk_multicurrency = ' . ((int) $this->id); |
|
528 | 528 | $sql .= ' ORDER BY cr.date_sync DESC'; |
529 | 529 | |
530 | 530 | $this->rates = array(); |
@@ -560,8 +560,8 @@ discard block |
||
560 | 560 | { |
561 | 561 | $sql = "SELECT cr.rowid"; |
562 | 562 | $sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element_line . " as cr"; |
563 | - $sql .= " WHERE cr.fk_multicurrency = " . ((int)$this->id); |
|
564 | - $sql .= " AND cr.date_sync = (SELECT MAX(cr2.date_sync) FROM " . MAIN_DB_PREFIX . $this->table_element_line . " AS cr2 WHERE cr2.fk_multicurrency = " . ((int)$this->id) . ")"; |
|
563 | + $sql .= " WHERE cr.fk_multicurrency = " . ((int) $this->id); |
|
564 | + $sql .= " AND cr.date_sync = (SELECT MAX(cr2.date_sync) FROM " . MAIN_DB_PREFIX . $this->table_element_line . " AS cr2 WHERE cr2.fk_multicurrency = " . ((int) $this->id) . ")"; |
|
565 | 565 | |
566 | 566 | dol_syslog(__METHOD__, LOG_DEBUG); |
567 | 567 | $resql = $this->db->query($sql); |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | global $user; |
596 | 596 | |
597 | 597 | $currencyRate = new CurrencyRate($this->db); |
598 | - $currencyRate->rate = (float)price2num($rate); |
|
598 | + $currencyRate->rate = (float) price2num($rate); |
|
599 | 599 | |
600 | 600 | if ($currencyRate->create($user, $this->id) > 0) { |
601 | 601 | $this->rate = $currencyRate; |
@@ -643,9 +643,9 @@ discard block |
||
643 | 643 | $sql .= ') VALUES ('; |
644 | 644 | $sql .= " '" . $this->db->escape($this->code) . "',"; |
645 | 645 | $sql .= " '" . $this->db->escape($this->name) . "',"; |
646 | - $sql .= " " . ((int)$this->entity) . ","; |
|
646 | + $sql .= " " . ((int) $this->entity) . ","; |
|
647 | 647 | $sql .= " '" . $this->db->idate($now) . "',"; |
648 | - $sql .= " " . ((int)$user->id); |
|
648 | + $sql .= " " . ((int) $user->id); |
|
649 | 649 | $sql .= ')'; |
650 | 650 | |
651 | 651 | $this->db->begin(); |
@@ -2663,6 +2663,8 @@ |
||
2663 | 2663 | $this->dictionaries['tab' . $field][] = $dictionaryArray[$field]; |
2664 | 2664 | } |
2665 | 2665 | } |
2666 | - if ($langs && !in_array($langs, $this->dictionaries[$langs])) $this->dictionaries['langs'][] = $langs; |
|
2666 | + if ($langs && !in_array($langs, $this->dictionaries[$langs])) { |
|
2667 | + $this->dictionaries['langs'][] = $langs; |
|
2668 | + } |
|
2667 | 2669 | } |
2668 | 2670 | } |
@@ -540,7 +540,7 @@ discard block |
||
540 | 540 | $sql_del = "SELECT " . $this->db->decrypt('value') . " as value"; |
541 | 541 | $sql_del .= " FROM " . MAIN_DB_PREFIX . "const"; |
542 | 542 | $sql_del .= " WHERE " . $this->db->decrypt('name') . " = '" . $this->db->escape($this->const_name) . "'"; |
543 | - $sql_del .= " AND entity IN (0," . ((int)$entity) . ")"; |
|
543 | + $sql_del .= " AND entity IN (0," . ((int) $entity) . ")"; |
|
544 | 544 | |
545 | 545 | $resql = $this->db->query($sql_del); |
546 | 546 | |
@@ -562,9 +562,9 @@ discard block |
||
562 | 562 | |
563 | 563 | // If the module is active |
564 | 564 | foreach ($this->rights as $key => $value) { |
565 | - $r_id = $this->rights[$key][self::KEY_ID]; // permission id in llx_rights_def (not unique because primary key is couple id-entity) |
|
565 | + $r_id = $this->rights[$key][self::KEY_ID]; // permission id in llx_rights_def (not unique because primary key is couple id-entity) |
|
566 | 566 | $r_label = $this->rights[$key][self::KEY_LABEL]; |
567 | - $r_type = $this->rights[$key][self::KEY_TYPE] ?? 'w'; // TODO deprecated |
|
567 | + $r_type = $this->rights[$key][self::KEY_TYPE] ?? 'w'; // TODO deprecated |
|
568 | 568 | $r_default = $this->rights[$key][self::KEY_DEFAULT] ?? 0; |
569 | 569 | $r_perms = $this->rights[$key][self::KEY_FIRST_LEVEL] ?? ''; |
570 | 570 | $r_subperms = $this->rights[$key][self::KEY_SECOND_LEVEL] ?? ''; |
@@ -592,8 +592,8 @@ discard block |
||
592 | 592 | |
593 | 593 | // Search if perm already present |
594 | 594 | $sql = "SELECT count(*) as nb FROM " . MAIN_DB_PREFIX . "rights_def"; |
595 | - $sql .= " WHERE entity = " . ((int)$entity); |
|
596 | - $sql .= " AND id = " . ((int)$r_id); |
|
595 | + $sql .= " WHERE entity = " . ((int) $entity); |
|
596 | + $sql .= " AND id = " . ((int) $r_id); |
|
597 | 597 | |
598 | 598 | $resqlselect = $this->db->query($sql); |
599 | 599 | if ($resqlselect) { |
@@ -605,19 +605,19 @@ discard block |
||
605 | 605 | $sql .= ", libelle"; |
606 | 606 | $sql .= ", module"; |
607 | 607 | $sql .= ", module_origin"; |
608 | - $sql .= ", type"; // TODO deprecated |
|
608 | + $sql .= ", type"; // TODO deprecated |
|
609 | 609 | $sql .= ", bydefault"; |
610 | 610 | $sql .= ", perms"; |
611 | 611 | $sql .= ", subperms"; |
612 | 612 | $sql .= ", enabled"; |
613 | 613 | $sql .= ") VALUES ("; |
614 | - $sql .= ((int)$r_id); |
|
615 | - $sql .= ", " . ((int)$entity); |
|
614 | + $sql .= ((int) $r_id); |
|
615 | + $sql .= ", " . ((int) $entity); |
|
616 | 616 | $sql .= ", '" . $this->db->escape($r_label) . "'"; |
617 | 617 | $sql .= ", '" . $this->db->escape($r_module) . "'"; |
618 | 618 | $sql .= ", '" . $this->db->escape($r_module_origin) . "'"; |
619 | - $sql .= ", '" . $this->db->escape($r_type) . "'"; // TODO deprecated |
|
620 | - $sql .= ", " . ((int)$r_default); |
|
619 | + $sql .= ", '" . $this->db->escape($r_type) . "'"; // TODO deprecated |
|
620 | + $sql .= ", " . ((int) $r_default); |
|
621 | 621 | $sql .= ", '" . $this->db->escape($r_perms) . "'"; |
622 | 622 | $sql .= ", '" . $this->db->escape($r_subperms) . "'"; |
623 | 623 | $sql .= ", '" . $this->db->escape($r_enabled) . "'"; |
@@ -859,7 +859,7 @@ discard block |
||
859 | 859 | } |
860 | 860 | |
861 | 861 | // Run complementary sql requests |
862 | - $num = count((array)$array_sql); |
|
862 | + $num = count((array) $array_sql); |
|
863 | 863 | for ($i = 0; $i < $num; $i++) { |
864 | 864 | if (!$err) { |
865 | 865 | dol_syslog(get_only_class($this) . "::_remove", LOG_DEBUG); |
@@ -884,7 +884,7 @@ discard block |
||
884 | 884 | $moduleNameInConf = 'supplier_proposal'; |
885 | 885 | } |
886 | 886 | |
887 | - unset($conf->modules[$moduleNameInConf]); // Add this module in list of enabled modules so isModEnabled() will work (conf->module->enabled must no more be used) |
|
887 | + unset($conf->modules[$moduleNameInConf]); // Add this module in list of enabled modules so isModEnabled() will work (conf->module->enabled must no more be used) |
|
888 | 888 | |
889 | 889 | return 1; |
890 | 890 | } else { |
@@ -972,7 +972,7 @@ discard block |
||
972 | 972 | |
973 | 973 | $sql = "DELETE FROM " . MAIN_DB_PREFIX . "const"; |
974 | 974 | $sql .= " WHERE " . $this->db->decrypt('name') . " LIKE '" . $this->db->escape($this->const_name) . "_" . strtoupper($key) . "'"; |
975 | - $sql .= " AND entity = " . ((int)$entity); |
|
975 | + $sql .= " AND entity = " . ((int) $entity); |
|
976 | 976 | |
977 | 977 | if (!$this->db->query($sql)) { |
978 | 978 | $this->error = $this->db->lasterror(); |
@@ -1077,7 +1077,7 @@ discard block |
||
1077 | 1077 | |
1078 | 1078 | $sql = "DELETE FROM " . MAIN_DB_PREFIX . "boxes_def"; |
1079 | 1079 | $sql .= " WHERE file = '" . $this->db->escape($file) . "'"; |
1080 | - $sql .= " AND entity = " . $conf->entity; // Do not use getEntity here, we want to delete only in current company |
|
1080 | + $sql .= " AND entity = " . $conf->entity; // Do not use getEntity here, we want to delete only in current company |
|
1081 | 1081 | |
1082 | 1082 | dol_syslog(get_only_class($this) . "::delete_boxes", LOG_DEBUG); |
1083 | 1083 | $resql = $this->db->query($sql); |
@@ -1140,7 +1140,7 @@ discard block |
||
1140 | 1140 | |
1141 | 1141 | // Delete all entities if core module |
1142 | 1142 | if (empty($this->core_enabled)) { |
1143 | - $sql .= " AND entity = " . ((int)$conf->entity); |
|
1143 | + $sql .= " AND entity = " . ((int) $conf->entity); |
|
1144 | 1144 | } |
1145 | 1145 | |
1146 | 1146 | dol_syslog(get_only_class($this) . "::delete_permissions", LOG_DEBUG); |
@@ -1169,7 +1169,7 @@ discard block |
||
1169 | 1169 | |
1170 | 1170 | $sql = "DELETE FROM " . MAIN_DB_PREFIX . "menu"; |
1171 | 1171 | $sql .= " WHERE module = '" . $this->db->escape($module) . "'"; |
1172 | - $sql .= " AND menu_handler = 'all'"; // We delete only lines that were added manually or by the module activation. We keep entry added by menuhandler like 'auguria' |
|
1172 | + $sql .= " AND menu_handler = 'all'"; // We delete only lines that were added manually or by the module activation. We keep entry added by menuhandler like 'auguria' |
|
1173 | 1173 | $sql .= " AND entity IN (0, " . $conf->entity . ")"; |
1174 | 1174 | |
1175 | 1175 | dol_syslog(get_only_class($this) . "::delete_menus", LOG_DEBUG); |
@@ -1227,7 +1227,7 @@ discard block |
||
1227 | 1227 | if ($pathoffile) { // Mostly for external modules |
1228 | 1228 | $content = file_get_contents($pathoffile, false, null, 0, 1024 * 1024); // Max size loaded 1Mb |
1229 | 1229 | |
1230 | - if ((float)DOL_VERSION >= 6.0) { |
|
1230 | + if ((float) DOL_VERSION >= 6.0) { |
|
1231 | 1231 | @include_once DOL_DOCUMENT_ROOT . '/core/lib/parsemd.lib.php'; |
1232 | 1232 | |
1233 | 1233 | $content = dolMd2Html( |
@@ -1327,7 +1327,7 @@ discard block |
||
1327 | 1327 | if ($filefound) { // Mostly for external modules |
1328 | 1328 | $content = file_get_contents($pathoffile); |
1329 | 1329 | |
1330 | - if ((float)DOL_VERSION >= 6.0) { |
|
1330 | + if ((float) DOL_VERSION >= 6.0) { |
|
1331 | 1331 | @include_once DOL_DOCUMENT_ROOT . '/core/lib/parsemd.lib.php'; |
1332 | 1332 | |
1333 | 1333 | $content = dolMd2Html($content, 'parsedown', array('doc/' => dol_buildpath(strtolower($this->name) . '/doc/', 1))); |
@@ -1466,7 +1466,7 @@ discard block |
||
1466 | 1466 | |
1467 | 1467 | $sql = "SELECT tms FROM " . MAIN_DB_PREFIX . "const"; |
1468 | 1468 | $sql .= " WHERE " . $this->db->decrypt('name') . " = '" . $this->db->escape($this->const_name) . "'"; |
1469 | - $sql .= " AND entity IN (0, " . ((int)$conf->entity) . ")"; |
|
1469 | + $sql .= " AND entity IN (0, " . ((int) $conf->entity) . ")"; |
|
1470 | 1470 | |
1471 | 1471 | dol_syslog(get_only_class($this) . "::getLastActiveDate", LOG_DEBUG); |
1472 | 1472 | $resql = $this->db->query($sql); |
@@ -1615,7 +1615,7 @@ discard block |
||
1615 | 1615 | $ignoreerror = $val['ignoreerror']; |
1616 | 1616 | } |
1617 | 1617 | // Add current entity id |
1618 | - $sql = str_replace('__ENTITY__', (string)$conf->entity, $sql); |
|
1618 | + $sql = str_replace('__ENTITY__', (string) $conf->entity, $sql); |
|
1619 | 1619 | |
1620 | 1620 | dol_syslog(get_only_class($this) . "::_init ignoreerror=" . $ignoreerror, LOG_DEBUG); |
1621 | 1621 | $result = $this->db->query($sql, $ignoreerror); |
@@ -1689,7 +1689,7 @@ discard block |
||
1689 | 1689 | $sql = "INSERT INTO " . MAIN_DB_PREFIX . "const (name, value, visible, entity, note) VALUES"; |
1690 | 1690 | $sql .= " (" . $this->db->encrypt($this->const_name); |
1691 | 1691 | $sql .= ", " . $this->db->encrypt('1'); |
1692 | - $sql .= ", 0, " . ((int)$entity); |
|
1692 | + $sql .= ", 0, " . ((int) $entity); |
|
1693 | 1693 | $sql .= ", '" . $this->db->escape($note) . "')"; |
1694 | 1694 | |
1695 | 1695 | dol_syslog(get_only_class($this) . "::_active insert activation constant", LOG_DEBUG); |
@@ -1749,7 +1749,7 @@ discard block |
||
1749 | 1749 | $sql .= ", " . $this->db->encrypt($newvalue); |
1750 | 1750 | $sql .= ", null"; |
1751 | 1751 | $sql .= ", '0'"; |
1752 | - $sql .= ", " . ((int)$entity); |
|
1752 | + $sql .= ", " . ((int) $entity); |
|
1753 | 1753 | $sql .= ")"; |
1754 | 1754 | |
1755 | 1755 | $resql = $this->db->query($sql); |
@@ -1865,7 +1865,7 @@ discard block |
||
1865 | 1865 | $sql .= ", " . $this->db->encrypt($newvalue, 1); |
1866 | 1866 | $sql .= ", null"; |
1867 | 1867 | $sql .= ", '0'"; |
1868 | - $sql .= ", " . ((int)$entity); |
|
1868 | + $sql .= ", " . ((int) $entity); |
|
1869 | 1869 | $sql .= ")"; |
1870 | 1870 | |
1871 | 1871 | dol_syslog(get_only_class($this) . "::insert_module_parts for key=" . $this->const_name . "_" . strtoupper($key), LOG_DEBUG); |
@@ -1925,7 +1925,7 @@ discard block |
||
1925 | 1925 | $sql = "SELECT count(*) as nb"; |
1926 | 1926 | $sql .= " FROM " . MAIN_DB_PREFIX . "const"; |
1927 | 1927 | $sql .= " WHERE " . $this->db->decrypt('name') . " = '" . $this->db->escape($name) . "'"; |
1928 | - $sql .= " AND entity = " . ((int)$entity); |
|
1928 | + $sql .= " AND entity = " . ((int) $entity); |
|
1929 | 1929 | |
1930 | 1930 | $result = $this->db->query($sql); |
1931 | 1931 | if ($result) { |
@@ -2028,7 +2028,7 @@ discard block |
||
2028 | 2028 | } |
2029 | 2029 | |
2030 | 2030 | $sql = "INSERT INTO " . MAIN_DB_PREFIX . "boxes (box_id, position, box_order, fk_user, entity)"; |
2031 | - $sql .= " VALUES (" . ((int)$lastid) . ", " . ((int)$key2) . ", '0', 0, " . ((int)$conf->entity) . ")"; |
|
2031 | + $sql .= " VALUES (" . ((int) $lastid) . ", " . ((int) $key2) . ", '0', 0, " . ((int) $conf->entity) . ")"; |
|
2032 | 2032 | |
2033 | 2033 | dol_syslog(get_only_class($this) . "::insert_boxes onto page " . $key2 . "=" . $val2, LOG_DEBUG); |
2034 | 2034 | $resql = $this->db->query($sql); |
@@ -2111,7 +2111,7 @@ discard block |
||
2111 | 2111 | if ($parameters) { |
2112 | 2112 | $sql .= " AND params = '".$this->db->escape($parameters)."'"; |
2113 | 2113 | }*/ |
2114 | - $sql .= " AND entity = " . ((int)$entity); // Must be exact entity |
|
2114 | + $sql .= " AND entity = " . ((int) $entity); // Must be exact entity |
|
2115 | 2115 | |
2116 | 2116 | $now = dol_now(); |
2117 | 2117 | |
@@ -2159,7 +2159,7 @@ discard block |
||
2159 | 2159 | $sql .= "'" . $this->db->escape($priority) . "', "; |
2160 | 2160 | } |
2161 | 2161 | if (is_int($status)) { |
2162 | - $sql .= ((int)$status) . ", "; |
|
2162 | + $sql .= ((int) $status) . ", "; |
|
2163 | 2163 | } |
2164 | 2164 | $sql .= $entity . ","; |
2165 | 2165 | $sql .= "'" . $this->db->escape($test) . "'"; |
@@ -2387,7 +2387,7 @@ discard block |
||
2387 | 2387 | |
2388 | 2388 | if ($row[0] == 0) { |
2389 | 2389 | $sql = "INSERT INTO " . MAIN_DB_PREFIX . "const (name, type, value, note, visible, entity)"; |
2390 | - $sql .= " VALUES (" . $this->db->encrypt($name) . ", 'chaine', " . $this->db->encrypt($dir) . ", '" . $this->db->escape("Directory for module " . $this->name) . "', '0', " . ((int)$conf->entity) . ")"; |
|
2390 | + $sql .= " VALUES (" . $this->db->encrypt($name) . ", 'chaine', " . $this->db->encrypt($dir) . ", '" . $this->db->escape("Directory for module " . $this->name) . "', '0', " . ((int) $conf->entity) . ")"; |
|
2391 | 2391 | |
2392 | 2392 | dol_syslog(get_only_class($this) . "::insert_dirs", LOG_DEBUG); |
2393 | 2393 | $this->db->query($sql); |
@@ -2473,7 +2473,7 @@ discard block |
||
2473 | 2473 | |
2474 | 2474 | $return .= '<div class="valignmiddle inline-block info-box-more">'; |
2475 | 2475 | //if ($versiontrans) print img_warning($langs->trans("Version").' '.$this->getVersion(1)).' '; |
2476 | - $return .= '<a class="valignmiddle inline-block" href="javascript:document_preview(\'' . constant('BASE_URL') . '/admin/modulehelp.php?id=' . ((int)$this->numero) . '\',\'text/html\',\'' . dol_escape_js($langs->trans("Module")) . '\')">' . img_picto(($this->isCoreOrExternalModule() == 'external' ? $langs->trans("ExternalModule") . ' - ' : '') . $langs->trans("ClickToShowDescription"), $imginfo) . '</a>'; |
|
2476 | + $return .= '<a class="valignmiddle inline-block" href="javascript:document_preview(\'' . constant('BASE_URL') . '/admin/modulehelp.php?id=' . ((int) $this->numero) . '\',\'text/html\',\'' . dol_escape_js($langs->trans("Module")) . '\')">' . img_picto(($this->isCoreOrExternalModule() == 'external' ? $langs->trans("ExternalModule") . ' - ' : '') . $langs->trans("ClickToShowDescription"), $imginfo) . '</a>'; |
|
2477 | 2477 | $return .= '</div><br>'; |
2478 | 2478 | |
2479 | 2479 | $return .= '<div class="valignmiddle inline-block info-box-actions">'; |
@@ -2629,7 +2629,7 @@ discard block |
||
2629 | 2629 | { |
2630 | 2630 | require_once constant('DOL_DOCUMENT_ROOT') . '/core/lib/geturl.lib.php'; |
2631 | 2631 | if (!empty($this->url_last_version)) { |
2632 | - $lastVersion = getURLContent($this->url_last_version, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only |
|
2632 | + $lastVersion = getURLContent($this->url_last_version, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only |
|
2633 | 2633 | if (isset($lastVersion['content']) && strlen($lastVersion['content']) < 30) { |
2634 | 2634 | // Security warning : be careful with remote data content, the module editor could be hacked (or evil) so limit to a-z A-Z 0-9 _ . - |
2635 | 2635 | $this->lastVersion = preg_replace("/[^a-zA-Z0-9_\.\-]+/", "", $lastVersion['content']); |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | } |
514 | 514 | } |
515 | 515 | |
516 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
516 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
517 | 517 | /** |
518 | 518 | * Load array lines |
519 | 519 | * |
@@ -522,7 +522,7 @@ discard block |
||
522 | 522 | */ |
523 | 523 | public function fetch_lines($filters = '') |
524 | 524 | { |
525 | - // phpcs:enable |
|
525 | + // phpcs:enable |
|
526 | 526 | global $langs; |
527 | 527 | |
528 | 528 | $this->lines = array(); |
@@ -1242,7 +1242,7 @@ discard block |
||
1242 | 1242 | return $this->LibStatut(0, $mode); |
1243 | 1243 | } |
1244 | 1244 | |
1245 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1245 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1246 | 1246 | /** |
1247 | 1247 | * Return label of a status |
1248 | 1248 | * |
@@ -1252,7 +1252,7 @@ discard block |
||
1252 | 1252 | */ |
1253 | 1253 | public function LibStatut($status, $mode = 1) |
1254 | 1254 | { |
1255 | - // phpcs:enable |
|
1255 | + // phpcs:enable |
|
1256 | 1256 | return ''; |
1257 | 1257 | } |
1258 | 1258 |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | return $this->LibType($this->nature, $mode); |
338 | 338 | } |
339 | 339 | |
340 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
340 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
341 | 341 | /** |
342 | 342 | * Return type of an accounting journal |
343 | 343 | * |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | */ |
348 | 348 | public function LibType($nature, $mode = 0) |
349 | 349 | { |
350 | - // phpcs:enable |
|
350 | + // phpcs:enable |
|
351 | 351 | global $langs; |
352 | 352 | |
353 | 353 | $langs->loadLangs(array("accountancy")); |
@@ -613,12 +613,12 @@ discard block |
||
613 | 613 | } |
614 | 614 | } else { // $type == 'csv' |
615 | 615 | $blocks[] = array( |
616 | - $depreciation_date, // Date |
|
617 | - $element_static->ref, // Piece |
|
618 | - $account_infos['code_formatted_1'], // AccountAccounting |
|
619 | - $element_name_formatted_0 . ' - ' . $depreciation_ref, // LabelOperation |
|
620 | - $mt < 0 ? price(-$mt) : '', // Debit |
|
621 | - $mt >= 0 ? price($mt) : '', // Credit |
|
616 | + $depreciation_date, // Date |
|
617 | + $element_static->ref, // Piece |
|
618 | + $account_infos['code_formatted_1'], // AccountAccounting |
|
619 | + $element_name_formatted_0 . ' - ' . $depreciation_ref, // LabelOperation |
|
620 | + $mt < 0 ? price(-$mt) : '', // Debit |
|
621 | + $mt >= 0 ? price($mt) : '', // Credit |
|
622 | 622 | ); |
623 | 623 | } |
624 | 624 | } |
@@ -734,12 +734,12 @@ discard block |
||
734 | 734 | } |
735 | 735 | } else { // $type == 'csv' |
736 | 736 | $blocks[] = array( |
737 | - $disposal_date, // Date |
|
738 | - $element_static->ref, // Piece |
|
739 | - $account_infos['code_formatted_1'], // AccountAccounting |
|
737 | + $disposal_date, // Date |
|
738 | + $element_static->ref, // Piece |
|
739 | + $account_infos['code_formatted_1'], // AccountAccounting |
|
740 | 740 | $element_name_formatted_0 . ' - ' . $disposal_ref, // LabelOperation |
741 | - $mt < 0 ? price(-$mt) : '', // Debit |
|
742 | - $mt >= 0 ? price($mt) : '', // Credit |
|
741 | + $mt < 0 ? price(-$mt) : '', // Debit |
|
742 | + $mt >= 0 ? price($mt) : '', // Credit |
|
743 | 743 | ); |
744 | 744 | } |
745 | 745 | } |