@@ -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(); |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | $sql_del = "SELECT " . $this->db->decrypt('value') . " as value"; |
532 | 532 | $sql_del .= " FROM " . MAIN_DB_PREFIX . "const"; |
533 | 533 | $sql_del .= " WHERE " . $this->db->decrypt('name') . " = '" . $this->db->escape($this->const_name) . "'"; |
534 | - $sql_del .= " AND entity IN (0," . ((int)$entity) . ")"; |
|
534 | + $sql_del .= " AND entity IN (0," . ((int) $entity) . ")"; |
|
535 | 535 | |
536 | 536 | $resql = $this->db->query($sql_del); |
537 | 537 | |
@@ -554,9 +554,9 @@ discard block |
||
554 | 554 | |
555 | 555 | // If the module is active |
556 | 556 | foreach ($this->rights as $key => $value) { |
557 | - $r_id = $this->rights[$key][self::KEY_ID]; // permission id in llx_rights_def (not unique because primary key is couple id-entity) |
|
557 | + $r_id = $this->rights[$key][self::KEY_ID]; // permission id in llx_rights_def (not unique because primary key is couple id-entity) |
|
558 | 558 | $r_label = $this->rights[$key][self::KEY_LABEL]; |
559 | - $r_type = $this->rights[$key][self::KEY_TYPE] ?? 'w'; // TODO deprecated |
|
559 | + $r_type = $this->rights[$key][self::KEY_TYPE] ?? 'w'; // TODO deprecated |
|
560 | 560 | $r_default = $this->rights[$key][self::KEY_DEFAULT] ?? 0; |
561 | 561 | $r_perms = $this->rights[$key][self::KEY_FIRST_LEVEL] ?? ''; |
562 | 562 | $r_subperms = $this->rights[$key][self::KEY_SECOND_LEVEL] ?? ''; |
@@ -584,8 +584,8 @@ discard block |
||
584 | 584 | |
585 | 585 | // Search if perm already present |
586 | 586 | $sql = "SELECT count(*) as nb FROM " . MAIN_DB_PREFIX . "rights_def"; |
587 | - $sql .= " WHERE entity = " . ((int)$entity); |
|
588 | - $sql .= " AND id = " . ((int)$r_id); |
|
587 | + $sql .= " WHERE entity = " . ((int) $entity); |
|
588 | + $sql .= " AND id = " . ((int) $r_id); |
|
589 | 589 | |
590 | 590 | $resqlselect = $this->db->query($sql); |
591 | 591 | if ($resqlselect) { |
@@ -597,19 +597,19 @@ discard block |
||
597 | 597 | $sql .= ", libelle"; |
598 | 598 | $sql .= ", module"; |
599 | 599 | $sql .= ", module_origin"; |
600 | - $sql .= ", type"; // TODO deprecated |
|
600 | + $sql .= ", type"; // TODO deprecated |
|
601 | 601 | $sql .= ", bydefault"; |
602 | 602 | $sql .= ", perms"; |
603 | 603 | $sql .= ", subperms"; |
604 | 604 | $sql .= ", enabled"; |
605 | 605 | $sql .= ") VALUES ("; |
606 | - $sql .= ((int)$r_id); |
|
607 | - $sql .= ", " . ((int)$entity); |
|
606 | + $sql .= ((int) $r_id); |
|
607 | + $sql .= ", " . ((int) $entity); |
|
608 | 608 | $sql .= ", '" . $this->db->escape($r_label) . "'"; |
609 | 609 | $sql .= ", '" . $this->db->escape($r_module) . "'"; |
610 | 610 | $sql .= ", '" . $this->db->escape($r_module_origin) . "'"; |
611 | - $sql .= ", '" . $this->db->escape($r_type) . "'"; // TODO deprecated |
|
612 | - $sql .= ", " . ((int)$r_default); |
|
611 | + $sql .= ", '" . $this->db->escape($r_type) . "'"; // TODO deprecated |
|
612 | + $sql .= ", " . ((int) $r_default); |
|
613 | 613 | $sql .= ", '" . $this->db->escape($r_perms) . "'"; |
614 | 614 | $sql .= ", '" . $this->db->escape($r_subperms) . "'"; |
615 | 615 | $sql .= ", '" . $this->db->escape($r_enabled) . "'"; |
@@ -851,7 +851,7 @@ discard block |
||
851 | 851 | } |
852 | 852 | |
853 | 853 | // Run complementary sql requests |
854 | - $num = count((array)$array_sql); |
|
854 | + $num = count((array) $array_sql); |
|
855 | 855 | for ($i = 0; $i < $num; $i++) { |
856 | 856 | if (!$err) { |
857 | 857 | dol_syslog(get_class($this) . "::_remove", LOG_DEBUG); |
@@ -876,7 +876,7 @@ discard block |
||
876 | 876 | $moduleNameInConf = 'supplier_proposal'; |
877 | 877 | } |
878 | 878 | |
879 | - unset($conf->modules[$moduleNameInConf]); // Add this module in list of enabled modules so isModEnabled() will work (conf->module->enabled must no more be used) |
|
879 | + unset($conf->modules[$moduleNameInConf]); // Add this module in list of enabled modules so isModEnabled() will work (conf->module->enabled must no more be used) |
|
880 | 880 | |
881 | 881 | return 1; |
882 | 882 | } else { |
@@ -964,7 +964,7 @@ discard block |
||
964 | 964 | |
965 | 965 | $sql = "DELETE FROM " . MAIN_DB_PREFIX . "const"; |
966 | 966 | $sql .= " WHERE " . $this->db->decrypt('name') . " LIKE '" . $this->db->escape($this->const_name) . "_" . strtoupper($key) . "'"; |
967 | - $sql .= " AND entity = " . ((int)$entity); |
|
967 | + $sql .= " AND entity = " . ((int) $entity); |
|
968 | 968 | |
969 | 969 | if (!$this->db->query($sql)) { |
970 | 970 | $this->error = $this->db->lasterror(); |
@@ -1069,7 +1069,7 @@ discard block |
||
1069 | 1069 | |
1070 | 1070 | $sql = "DELETE FROM " . MAIN_DB_PREFIX . "boxes_def"; |
1071 | 1071 | $sql .= " WHERE file = '" . $this->db->escape($file) . "'"; |
1072 | - $sql .= " AND entity = " . $conf->entity; // Do not use getEntity here, we want to delete only in current company |
|
1072 | + $sql .= " AND entity = " . $conf->entity; // Do not use getEntity here, we want to delete only in current company |
|
1073 | 1073 | |
1074 | 1074 | dol_syslog(get_class($this) . "::delete_boxes", LOG_DEBUG); |
1075 | 1075 | $resql = $this->db->query($sql); |
@@ -1132,7 +1132,7 @@ discard block |
||
1132 | 1132 | |
1133 | 1133 | // Delete all entities if core module |
1134 | 1134 | if (empty($this->core_enabled)) { |
1135 | - $sql .= " AND entity = " . ((int)$conf->entity); |
|
1135 | + $sql .= " AND entity = " . ((int) $conf->entity); |
|
1136 | 1136 | } |
1137 | 1137 | |
1138 | 1138 | dol_syslog(get_class($this) . "::delete_permissions", LOG_DEBUG); |
@@ -1161,7 +1161,7 @@ discard block |
||
1161 | 1161 | |
1162 | 1162 | $sql = "DELETE FROM " . MAIN_DB_PREFIX . "menu"; |
1163 | 1163 | $sql .= " WHERE module = '" . $this->db->escape($module) . "'"; |
1164 | - $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' |
|
1164 | + $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' |
|
1165 | 1165 | $sql .= " AND entity IN (0, " . $conf->entity . ")"; |
1166 | 1166 | |
1167 | 1167 | dol_syslog(get_class($this) . "::delete_menus", LOG_DEBUG); |
@@ -1219,7 +1219,7 @@ discard block |
||
1219 | 1219 | if ($pathoffile) { // Mostly for external modules |
1220 | 1220 | $content = file_get_contents($pathoffile, false, null, 0, 1024 * 1024); // Max size loaded 1Mb |
1221 | 1221 | |
1222 | - if ((float)DOL_VERSION >= 6.0) { |
|
1222 | + if ((float) DOL_VERSION >= 6.0) { |
|
1223 | 1223 | @include_once DOL_DOCUMENT_ROOT . '/core/lib/parsemd.lib.php'; |
1224 | 1224 | |
1225 | 1225 | $content = dolMd2Html( |
@@ -1319,7 +1319,7 @@ discard block |
||
1319 | 1319 | if ($filefound) { // Mostly for external modules |
1320 | 1320 | $content = file_get_contents($pathoffile); |
1321 | 1321 | |
1322 | - if ((float)DOL_VERSION >= 6.0) { |
|
1322 | + if ((float) DOL_VERSION >= 6.0) { |
|
1323 | 1323 | @include_once DOL_DOCUMENT_ROOT . '/core/lib/parsemd.lib.php'; |
1324 | 1324 | |
1325 | 1325 | $content = dolMd2Html($content, 'parsedown', array('doc/' => dol_buildpath(strtolower($this->name) . '/doc/', 1))); |
@@ -1458,7 +1458,7 @@ discard block |
||
1458 | 1458 | |
1459 | 1459 | $sql = "SELECT tms FROM " . MAIN_DB_PREFIX . "const"; |
1460 | 1460 | $sql .= " WHERE " . $this->db->decrypt('name') . " = '" . $this->db->escape($this->const_name) . "'"; |
1461 | - $sql .= " AND entity IN (0, " . ((int)$conf->entity) . ")"; |
|
1461 | + $sql .= " AND entity IN (0, " . ((int) $conf->entity) . ")"; |
|
1462 | 1462 | |
1463 | 1463 | dol_syslog(get_class($this) . "::getLastActiveDate", LOG_DEBUG); |
1464 | 1464 | $resql = $this->db->query($sql); |
@@ -1607,7 +1607,7 @@ discard block |
||
1607 | 1607 | $ignoreerror = $val['ignoreerror']; |
1608 | 1608 | } |
1609 | 1609 | // Add current entity id |
1610 | - $sql = str_replace('__ENTITY__', (string)$conf->entity, $sql); |
|
1610 | + $sql = str_replace('__ENTITY__', (string) $conf->entity, $sql); |
|
1611 | 1611 | |
1612 | 1612 | dol_syslog(get_class($this) . "::_init ignoreerror=" . $ignoreerror, LOG_DEBUG); |
1613 | 1613 | $result = $this->db->query($sql, $ignoreerror); |
@@ -1681,7 +1681,7 @@ discard block |
||
1681 | 1681 | $sql = "INSERT INTO " . MAIN_DB_PREFIX . "const (name, value, visible, entity, note) VALUES"; |
1682 | 1682 | $sql .= " (" . $this->db->encrypt($this->const_name); |
1683 | 1683 | $sql .= ", " . $this->db->encrypt('1'); |
1684 | - $sql .= ", 0, " . ((int)$entity); |
|
1684 | + $sql .= ", 0, " . ((int) $entity); |
|
1685 | 1685 | $sql .= ", '" . $this->db->escape($note) . "')"; |
1686 | 1686 | |
1687 | 1687 | dol_syslog(get_class($this) . "::_active insert activation constant", LOG_DEBUG); |
@@ -1741,7 +1741,7 @@ discard block |
||
1741 | 1741 | $sql .= ", " . $this->db->encrypt($newvalue); |
1742 | 1742 | $sql .= ", null"; |
1743 | 1743 | $sql .= ", '0'"; |
1744 | - $sql .= ", " . ((int)$entity); |
|
1744 | + $sql .= ", " . ((int) $entity); |
|
1745 | 1745 | $sql .= ")"; |
1746 | 1746 | |
1747 | 1747 | $resql = $this->db->query($sql); |
@@ -1857,7 +1857,7 @@ discard block |
||
1857 | 1857 | $sql .= ", " . $this->db->encrypt($newvalue, 1); |
1858 | 1858 | $sql .= ", null"; |
1859 | 1859 | $sql .= ", '0'"; |
1860 | - $sql .= ", " . ((int)$entity); |
|
1860 | + $sql .= ", " . ((int) $entity); |
|
1861 | 1861 | $sql .= ")"; |
1862 | 1862 | |
1863 | 1863 | dol_syslog(get_class($this) . "::insert_module_parts for key=" . $this->const_name . "_" . strtoupper($key), LOG_DEBUG); |
@@ -1917,7 +1917,7 @@ discard block |
||
1917 | 1917 | $sql = "SELECT count(*) as nb"; |
1918 | 1918 | $sql .= " FROM " . MAIN_DB_PREFIX . "const"; |
1919 | 1919 | $sql .= " WHERE " . $this->db->decrypt('name') . " = '" . $this->db->escape($name) . "'"; |
1920 | - $sql .= " AND entity = " . ((int)$entity); |
|
1920 | + $sql .= " AND entity = " . ((int) $entity); |
|
1921 | 1921 | |
1922 | 1922 | $result = $this->db->query($sql); |
1923 | 1923 | if ($result) { |
@@ -2021,7 +2021,7 @@ discard block |
||
2021 | 2021 | } |
2022 | 2022 | |
2023 | 2023 | $sql = "INSERT INTO " . MAIN_DB_PREFIX . "boxes (box_id, position, box_order, fk_user, entity)"; |
2024 | - $sql .= " VALUES (" . ((int)$lastid) . ", " . ((int)$key2) . ", '0', 0, " . ((int)$conf->entity) . ")"; |
|
2024 | + $sql .= " VALUES (" . ((int) $lastid) . ", " . ((int) $key2) . ", '0', 0, " . ((int) $conf->entity) . ")"; |
|
2025 | 2025 | |
2026 | 2026 | dol_syslog(get_class($this) . "::insert_boxes onto page " . $key2 . "=" . $val2, LOG_DEBUG); |
2027 | 2027 | $resql = $this->db->query($sql); |
@@ -2105,7 +2105,7 @@ discard block |
||
2105 | 2105 | if ($parameters) { |
2106 | 2106 | $sql .= " AND params = '".$this->db->escape($parameters)."'"; |
2107 | 2107 | }*/ |
2108 | - $sql .= " AND entity = " . ((int)$entity); // Must be exact entity |
|
2108 | + $sql .= " AND entity = " . ((int) $entity); // Must be exact entity |
|
2109 | 2109 | |
2110 | 2110 | $now = dol_now(); |
2111 | 2111 | |
@@ -2153,7 +2153,7 @@ discard block |
||
2153 | 2153 | $sql .= "'" . $this->db->escape($priority) . "', "; |
2154 | 2154 | } |
2155 | 2155 | if (is_int($status)) { |
2156 | - $sql .= ((int)$status) . ", "; |
|
2156 | + $sql .= ((int) $status) . ", "; |
|
2157 | 2157 | } |
2158 | 2158 | $sql .= $entity . ","; |
2159 | 2159 | $sql .= "'" . $this->db->escape($test) . "'"; |
@@ -2381,7 +2381,7 @@ discard block |
||
2381 | 2381 | |
2382 | 2382 | if ($row[0] == 0) { |
2383 | 2383 | $sql = "INSERT INTO " . MAIN_DB_PREFIX . "const (name, type, value, note, visible, entity)"; |
2384 | - $sql .= " VALUES (" . $this->db->encrypt($name) . ", 'chaine', " . $this->db->encrypt($dir) . ", '" . $this->db->escape("Directory for module " . $this->name) . "', '0', " . ((int)$conf->entity) . ")"; |
|
2384 | + $sql .= " VALUES (" . $this->db->encrypt($name) . ", 'chaine', " . $this->db->encrypt($dir) . ", '" . $this->db->escape("Directory for module " . $this->name) . "', '0', " . ((int) $conf->entity) . ")"; |
|
2385 | 2385 | |
2386 | 2386 | dol_syslog(get_class($this) . "::insert_dirs", LOG_DEBUG); |
2387 | 2387 | $this->db->query($sql); |
@@ -2467,7 +2467,7 @@ discard block |
||
2467 | 2467 | |
2468 | 2468 | $return .= '<div class="valignmiddle inline-block info-box-more">'; |
2469 | 2469 | //if ($versiontrans) print img_warning($langs->trans("Version").' '.$this->getVersion(1)).' '; |
2470 | - $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>'; |
|
2470 | + $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>'; |
|
2471 | 2471 | $return .= '</div><br>'; |
2472 | 2472 | |
2473 | 2473 | $return .= '<div class="valignmiddle inline-block info-box-actions">'; |
@@ -2623,7 +2623,7 @@ discard block |
||
2623 | 2623 | { |
2624 | 2624 | require_once constant('DOL_DOCUMENT_ROOT') . '/core/lib/geturl.lib.php'; |
2625 | 2625 | if (!empty($this->url_last_version)) { |
2626 | - $lastVersion = getURLContent($this->url_last_version, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only |
|
2626 | + $lastVersion = getURLContent($this->url_last_version, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only |
|
2627 | 2627 | if (isset($lastVersion['content']) && strlen($lastVersion['content']) < 30) { |
2628 | 2628 | // 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 _ . - |
2629 | 2629 | $this->lastVersion = preg_replace("/[^a-zA-Z0-9_\.\-]+/", "", $lastVersion['content']); |
@@ -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 | } |
@@ -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 |
@@ -635,7 +635,7 @@ |
||
635 | 635 | * @param mixed $v Feature information of a product. |
636 | 636 | * @return bool |
637 | 637 | */ |
638 | - static function ($v) { |
|
638 | + static function($v) { |
|
639 | 639 | return !empty($v); |
640 | 640 | } |
641 | 641 | ); |
@@ -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 | } |
@@ -2545,14 +2545,14 @@ |
||
2545 | 2545 | } |
2546 | 2546 | |
2547 | 2547 | /** |
2548 | - * Export format : iSuite Expert |
|
2549 | - * |
|
2550 | - * by OpenSolus [https://opensolus.fr] |
|
2551 | - * |
|
2548 | + * Export format : iSuite Expert |
|
2549 | + * |
|
2550 | + * by OpenSolus [https://opensolus.fr] |
|
2551 | + * |
|
2552 | 2552 | * @param array $objectLines data |
2553 | 2553 | * @param resource $exportFile [=null] File resource to export or print if null |
2554 | 2554 | * @return void |
2555 | - */ |
|
2555 | + */ |
|
2556 | 2556 | public function exportiSuiteExpert($objectLines, $exportFile = null) |
2557 | 2557 | { |
2558 | 2558 | $separator = ';'; |
@@ -335,8 +335,8 @@ discard block |
||
335 | 335 | */ |
336 | 336 | public function export(&$TData, $formatexportset, $withAttachment = 0, $downloadMode = 0, $outputMode = 0, $noouput = 0) |
337 | 337 | { |
338 | - global $db, $conf, $langs; // The tpl file use $db |
|
339 | - global $search_date_end; // Used into /accountancy/tpl/export_journal.tpl.php |
|
338 | + global $db, $conf, $langs; // The tpl file use $db |
|
339 | + global $search_date_end; // Used into /accountancy/tpl/export_journal.tpl.php |
|
340 | 340 | |
341 | 341 | // Define name of file to save |
342 | 342 | $filename = 'general_ledger-' . $this->getFormatCode($formatexportset); |
@@ -2001,7 +2001,7 @@ discard block |
||
2001 | 2001 | // MOPM |
2002 | 2002 | $tab[] = ""; |
2003 | 2003 | // BONP |
2004 | - $tab[] = ""; |
|
2004 | + $tab[] = ""; |
|
2005 | 2005 | // BQAF |
2006 | 2006 | $tab[] = ""; |
2007 | 2007 | // ECES |
@@ -2207,7 +2207,7 @@ discard block |
||
2207 | 2207 | } |
2208 | 2208 | } elseif ($line->doc_type == 'customer_invoice') { |
2209 | 2209 | if (($line->amount) < 0) { |
2210 | - $nature_piece = 'AC'; // Currently, only the sign of amount allows to know the type of invoice (standard or credit note). Other solution is to analyse debit/credit/role of account. TODO Add column doc_type_long or make amount mandatory with rule on sign. |
|
2210 | + $nature_piece = 'AC'; // Currently, only the sign of amount allows to know the type of invoice (standard or credit note). Other solution is to analyse debit/credit/role of account. TODO Add column doc_type_long or make amount mandatory with rule on sign. |
|
2211 | 2211 | } else { |
2212 | 2212 | $nature_piece = 'FC'; |
2213 | 2213 | } |
@@ -1987,7 +1987,7 @@ discard block |
||
1987 | 1987 | return 1; |
1988 | 1988 | } |
1989 | 1989 | |
1990 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1990 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1991 | 1991 | /** |
1992 | 1992 | * Export bookkeeping |
1993 | 1993 | * |
@@ -1996,7 +1996,7 @@ discard block |
||
1996 | 1996 | */ |
1997 | 1997 | public function export_bookkeeping($model = 'ebp') |
1998 | 1998 | { |
1999 | - // phpcs:enable |
|
1999 | + // phpcs:enable |
|
2000 | 2000 | global $conf; |
2001 | 2001 | |
2002 | 2002 | $sql = "SELECT rowid, doc_date, doc_type,"; |
@@ -2180,7 +2180,7 @@ discard block |
||
2180 | 2180 | */ |
2181 | 2181 | } |
2182 | 2182 | |
2183 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2183 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2184 | 2184 | /** |
2185 | 2185 | * Return list of accounts with label by chart of accounts |
2186 | 2186 | * |
@@ -2195,7 +2195,7 @@ discard block |
||
2195 | 2195 | */ |
2196 | 2196 | public function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $aabase = '') |
2197 | 2197 | { |
2198 | - // phpcs:enable |
|
2198 | + // phpcs:enable |
|
2199 | 2199 | global $conf; |
2200 | 2200 | |
2201 | 2201 | require_once constant('DOL_DOCUMENT_ROOT') . '/core/lib/accounting.lib.php'; |
@@ -2292,7 +2292,7 @@ discard block |
||
2292 | 2292 | } |
2293 | 2293 | } |
2294 | 2294 | |
2295 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2295 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2296 | 2296 | /** |
2297 | 2297 | * Description of accounting account |
2298 | 2298 | * |
@@ -2301,7 +2301,7 @@ discard block |
||
2301 | 2301 | */ |
2302 | 2302 | public function get_compte_desc($account = null) |
2303 | 2303 | { |
2304 | - // phpcs:enable |
|
2304 | + // phpcs:enable |
|
2305 | 2305 | global $conf; |
2306 | 2306 | |
2307 | 2307 | $pcgver = getDolGlobalInt('CHARTOFACCOUNTS'); |
@@ -1731,7 +1731,7 @@ |
||
1731 | 1731 | $sql = "DELETE"; |
1732 | 1732 | $sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element . $mode; |
1733 | 1733 | $sql .= " WHERE piece_num = " . (int) $piecenum; |
1734 | - $sql .= " AND date_validated IS NULL"; // For security, exclusion of validated entries at the time of deletion |
|
1734 | + $sql .= " AND date_validated IS NULL"; // For security, exclusion of validated entries at the time of deletion |
|
1735 | 1735 | $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
1736 | 1736 | $sql .= $sql_filter; |
1737 | 1737 |
@@ -698,7 +698,7 @@ discard block |
||
698 | 698 | return $this->LibStatut($this->status, $mode); |
699 | 699 | } |
700 | 700 | |
701 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
701 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
702 | 702 | /** |
703 | 703 | * Return the label of a given status |
704 | 704 | * |
@@ -708,7 +708,7 @@ discard block |
||
708 | 708 | */ |
709 | 709 | public function LibStatut($status, $mode = 0) |
710 | 710 | { |
711 | - // phpcs:enable |
|
711 | + // phpcs:enable |
|
712 | 712 | if (empty($this->labelStatus) || empty($this->labelStatusShort)) { |
713 | 713 | global $langs; |
714 | 714 | $langs->load("users"); |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | $hookmanager->initHooks(array('accountancyBindingCalculation')); |
745 | 745 | |
746 | 746 | // Execute hook accountancyBindingCalculation |
747 | - $parameters = array('buyer' => $buyer, 'seller' => $seller, 'product' => $product, 'facture' => $facture, 'factureDet' => $factureDet ,'accountingAccount' => $accountingAccount, 0 => $type); |
|
747 | + $parameters = array('buyer' => $buyer, 'seller' => $seller, 'product' => $product, 'facture' => $facture, 'factureDet' => $factureDet, 'accountingAccount' => $accountingAccount, 0 => $type); |
|
748 | 748 | $reshook = $hookmanager->executeHooks('accountancyBindingCalculation', $parameters); // Note that $action and $object may have been modified by some hooks |
749 | 749 | |
750 | 750 | if (empty($reshook)) { |
@@ -758,9 +758,9 @@ discard block |
||
758 | 758 | require_once constant('DOL_DOCUMENT_ROOT') . '/core/lib/company.lib.php'; |
759 | 759 | $isBuyerInEEC = isInEEC($buyer); |
760 | 760 | $isSellerInEEC = isInEEC($seller); |
761 | - $code_l = ''; // Default value for generic product/service |
|
762 | - $code_p = ''; // Value for the product/service in parameter ($product) |
|
763 | - $code_t = ''; // Default value of product account for the thirdparty |
|
761 | + $code_l = ''; // Default value for generic product/service |
|
762 | + $code_p = ''; // Value for the product/service in parameter ($product) |
|
763 | + $code_t = ''; // Default value of product account for the thirdparty |
|
764 | 764 | $suggestedid = ''; |
765 | 765 | |
766 | 766 | // Level 1 (define $code_l): Search suggested default account for product/service |
@@ -639,7 +639,7 @@ |
||
639 | 639 | if (is_array($cpt)) { |
640 | 640 | $listofaccount = ''; |
641 | 641 | foreach ($cpt as $cptcursor) { |
642 | - if (! is_null($cptcursor)) { |
|
642 | + if (!is_null($cptcursor)) { |
|
643 | 643 | if ($listofaccount) { |
644 | 644 | $listofaccount .= ","; |
645 | 645 | } |