@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | print '<td>'; |
| 385 | 385 | $s = picto_from_langcode(getDolGlobalString('MAIN_LANG_DEFAULT')); |
| 386 | 386 | print $s ? $s.' ' : ''; |
| 387 | - print(getDolGlobalString('MAIN_LANG_DEFAULT') == 'auto' ? $form->textwithpicto($langs->trans("Automatic"), $langs->trans("AutoDetectLang")) : $langs->trans("Language_" . getDolGlobalString('MAIN_LANG_DEFAULT'))); |
|
| 387 | + print(getDolGlobalString('MAIN_LANG_DEFAULT') == 'auto' ? $form->textwithpicto($langs->trans("Automatic"), $langs->trans("AutoDetectLang")) : $langs->trans("Language_".getDolGlobalString('MAIN_LANG_DEFAULT'))); |
|
| 388 | 388 | print '</td>'; |
| 389 | 389 | print '<td class="nowrap" width="20%"><input class="oddeven" name="check_MAIN_LANG_DEFAULT" id="check_MAIN_LANG_DEFAULT" type="checkbox" '.(!empty($object->conf->MAIN_LANG_DEFAULT) ? " checked" : ""); |
| 390 | 390 | print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | |
| 438 | 438 | // Max size of short lists |
| 439 | 439 | print '<tr class="oddeven"><td>'.$langs->trans("MaxSizeShortList").'</td>'; |
| 440 | - print '<td>' . getDolGlobalString('MAIN_SIZE_SHORTLIST_LIMIT').'</td>'; |
|
| 440 | + print '<td>'.getDolGlobalString('MAIN_SIZE_SHORTLIST_LIMIT').'</td>'; |
|
| 441 | 441 | print '<td class="nowrap" width="20%"><input class="oddeven" name="check_MAIN_SIZE_SHORTLIST_LIMIT" id="check_MAIN_SIZE_SHORTLIST_LIMIT" type="checkbox" '.(!empty($object->conf->MAIN_SIZE_SHORTLIST_LIMIT) ? " checked" : ""); |
| 442 | 442 | print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo |
| 443 | 443 | print '> <label for="check_MAIN_SIZE_SHORTLIST_LIMIT">'.$langs->trans("UsePersonalValue").'</label></td>'; |
@@ -506,7 +506,7 @@ discard block |
||
| 506 | 506 | print '<td>'; |
| 507 | 507 | $s = picto_from_langcode(getDolGlobalString('MAIN_LANG_DEFAULT')); |
| 508 | 508 | print($s ? $s.' ' : ''); |
| 509 | - print(getDolGlobalString('MAIN_LANG_DEFAULT') == 'auto' ? $form->textwithpicto($langs->trans("Automatic"), $langs->trans("AutoDetectLang")) : $langs->trans("Language_" . getDolGlobalString('MAIN_LANG_DEFAULT'))); |
|
| 509 | + print(getDolGlobalString('MAIN_LANG_DEFAULT') == 'auto' ? $form->textwithpicto($langs->trans("Automatic"), $langs->trans("AutoDetectLang")) : $langs->trans("Language_".getDolGlobalString('MAIN_LANG_DEFAULT'))); |
|
| 510 | 510 | print '</td>'; |
| 511 | 511 | print '<td class="nowrap"><input class="oddeven" type="checkbox" disabled '.(!empty($object->conf->MAIN_LANG_DEFAULT) ? " checked" : "").'> '.$langs->trans("UsePersonalValue").'</td>'; |
| 512 | 512 | print '<td>'; |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | |
| 144 | 144 | const KEY_ID = 0; |
| 145 | 145 | const KEY_LABEL = 1; |
| 146 | - const KEY_TYPE = 2; // deprecated |
|
| 146 | + const KEY_TYPE = 2; // deprecated |
|
| 147 | 147 | const KEY_DEFAULT = 3; |
| 148 | 148 | const KEY_FIRST_LEVEL = 4; |
| 149 | 149 | const KEY_SECOND_LEVEL = 5; |
@@ -723,7 +723,7 @@ discard block |
||
| 723 | 723 | $moduleNameInConf = 'supplier_proposal'; |
| 724 | 724 | } |
| 725 | 725 | |
| 726 | - unset($conf->modules[$moduleNameInConf]); // Add this module in list of enabled modules so isModEnabled() will work (conf->module->enabled must no more be used) |
|
| 726 | + unset($conf->modules[$moduleNameInConf]); // Add this module in list of enabled modules so isModEnabled() will work (conf->module->enabled must no more be used) |
|
| 727 | 727 | |
| 728 | 728 | return 1; |
| 729 | 729 | } else { |
@@ -819,7 +819,7 @@ discard block |
||
| 819 | 819 | $pathoffile = $this->getDescLongReadmeFound(); |
| 820 | 820 | |
| 821 | 821 | if ($pathoffile) { // Mostly for external modules |
| 822 | - $content = file_get_contents($pathoffile, false, null, 0, 1024 * 1024); // Max size loaded 1Mb |
|
| 822 | + $content = file_get_contents($pathoffile, false, null, 0, 1024 * 1024); // Max size loaded 1Mb |
|
| 823 | 823 | |
| 824 | 824 | if ((float) DOL_VERSION >= 6.0) { // @phpstan-ignore-line |
| 825 | 825 | @include_once DOL_DOCUMENT_ROOT.'/core/lib/parsemd.lib.php'; |
@@ -1583,7 +1583,7 @@ discard block |
||
| 1583 | 1583 | |
| 1584 | 1584 | $sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes_def"; |
| 1585 | 1585 | $sql .= " WHERE file = '".$this->db->escape($file)."'"; |
| 1586 | - $sql .= " AND entity = ".$conf->entity; // Do not use getEntity here, we want to delete only in current company |
|
| 1586 | + $sql .= " AND entity = ".$conf->entity; // Do not use getEntity here, we want to delete only in current company |
|
| 1587 | 1587 | |
| 1588 | 1588 | dol_syslog(get_class($this)."::delete_boxes", LOG_DEBUG); |
| 1589 | 1589 | $resql = $this->db->query($sql); |
@@ -1606,9 +1606,9 @@ discard block |
||
| 1606 | 1606 | public function insert_cronjobs() |
| 1607 | 1607 | { |
| 1608 | 1608 | // phpcs:enable |
| 1609 | - include_once DOL_DOCUMENT_ROOT . '/core/class/infobox.class.php'; |
|
| 1610 | - include_once DOL_DOCUMENT_ROOT . '/cron/class/cronjob.class.php'; |
|
| 1611 | - include_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php'; |
|
| 1609 | + include_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php'; |
|
| 1610 | + include_once DOL_DOCUMENT_ROOT.'/cron/class/cronjob.class.php'; |
|
| 1611 | + include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; |
|
| 1612 | 1612 | |
| 1613 | 1613 | global $conf, $user; |
| 1614 | 1614 | |
@@ -1619,7 +1619,7 @@ discard block |
||
| 1619 | 1619 | $err = 0; |
| 1620 | 1620 | |
| 1621 | 1621 | if (is_array($this->cronjobs)) { |
| 1622 | - dol_syslog(get_class($this) . "::insert_cronjobs", LOG_DEBUG); |
|
| 1622 | + dol_syslog(get_class($this)."::insert_cronjobs", LOG_DEBUG); |
|
| 1623 | 1623 | |
| 1624 | 1624 | foreach ($this->cronjobs as $key => $value) { |
| 1625 | 1625 | $now = dol_now(); |
@@ -1646,7 +1646,7 @@ discard block |
||
| 1646 | 1646 | $test = isset($value['test']) ? $value['test'] : ''; // Line must be enabled or not (so visible or not) |
| 1647 | 1647 | |
| 1648 | 1648 | // Search if cron entry already present |
| 1649 | - $sql = "SELECT count(*) as nb FROM " . MAIN_DB_PREFIX . "cronjob"; |
|
| 1649 | + $sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."cronjob"; |
|
| 1650 | 1650 | //$sql .= " WHERE module_name = '" . $this->db->escape(empty($this->rights_class) ? strtolower($this->name) : $this->rights_class) . "'"; |
| 1651 | 1651 | $sql .= " WHERE label = '".$this->db->escape($label)."'"; |
| 1652 | 1652 | /* unique key is on label,entity so no need for this test |
@@ -1666,7 +1666,7 @@ discard block |
||
| 1666 | 1666 | $sql .= " AND params = '" . $this->db->escape($params) . "'"; |
| 1667 | 1667 | } |
| 1668 | 1668 | */ |
| 1669 | - $sql .= " AND entity = " . ((int) $entity); // Must be exact entity |
|
| 1669 | + $sql .= " AND entity = ".((int) $entity); // Must be exact entity |
|
| 1670 | 1670 | |
| 1671 | 1671 | $result = $this->db->query($sql); |
| 1672 | 1672 | if (!$result) { |
@@ -1992,9 +1992,9 @@ discard block |
||
| 1992 | 1992 | |
| 1993 | 1993 | // If the module is active |
| 1994 | 1994 | foreach ($this->rights as $key => $value) { |
| 1995 | - $r_id = $this->rights[$key][self::KEY_ID]; // permission id in llx_rights_def (not unique because primary key is couple id-entity) |
|
| 1995 | + $r_id = $this->rights[$key][self::KEY_ID]; // permission id in llx_rights_def (not unique because primary key is couple id-entity) |
|
| 1996 | 1996 | $r_label = $this->rights[$key][self::KEY_LABEL]; |
| 1997 | - $r_type = $this->rights[$key][self::KEY_TYPE] ?? 'w'; // TODO deprecated |
|
| 1997 | + $r_type = $this->rights[$key][self::KEY_TYPE] ?? 'w'; // TODO deprecated |
|
| 1998 | 1998 | $r_default = $this->rights[$key][self::KEY_DEFAULT] ?? 0; |
| 1999 | 1999 | $r_perms = $this->rights[$key][self::KEY_FIRST_LEVEL] ?? ''; |
| 2000 | 2000 | $r_subperms = $this->rights[$key][self::KEY_SECOND_LEVEL] ?? ''; |
@@ -2018,7 +2018,7 @@ discard block |
||
| 2018 | 2018 | } |
| 2019 | 2019 | |
| 2020 | 2020 | // condition to show or hide a user right (default: 1) (eg isModEnabled('anothermodule') or ($conf->global->MAIN_FEATURES_LEVEL > 0) or etc..) |
| 2021 | - $r_enabled = $this->rights[$key][self::KEY_ENABLED] ?? '1'; |
|
| 2021 | + $r_enabled = $this->rights[$key][self::KEY_ENABLED] ?? '1'; |
|
| 2022 | 2022 | |
| 2023 | 2023 | // Search if perm already present |
| 2024 | 2024 | $sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."rights_def"; |
@@ -2035,7 +2035,7 @@ discard block |
||
| 2035 | 2035 | $sql .= ", libelle"; |
| 2036 | 2036 | $sql .= ", module"; |
| 2037 | 2037 | $sql .= ", module_origin"; |
| 2038 | - $sql .= ", type"; // TODO deprecated |
|
| 2038 | + $sql .= ", type"; // TODO deprecated |
|
| 2039 | 2039 | $sql .= ", bydefault"; |
| 2040 | 2040 | $sql .= ", perms"; |
| 2041 | 2041 | $sql .= ", subperms"; |
@@ -2046,7 +2046,7 @@ discard block |
||
| 2046 | 2046 | $sql .= ", '".$this->db->escape($r_label)."'"; |
| 2047 | 2047 | $sql .= ", '".$this->db->escape($r_module)."'"; |
| 2048 | 2048 | $sql .= ", '".$this->db->escape($r_module_origin)."'"; |
| 2049 | - $sql .= ", '".$this->db->escape($r_type)."'"; // TODO deprecated |
|
| 2049 | + $sql .= ", '".$this->db->escape($r_type)."'"; // TODO deprecated |
|
| 2050 | 2050 | $sql .= ", ".((int) $r_default); |
| 2051 | 2051 | $sql .= ", '".$this->db->escape($r_perms)."'"; |
| 2052 | 2052 | $sql .= ", '".$this->db->escape($r_subperms)."'"; |
@@ -2268,7 +2268,7 @@ discard block |
||
| 2268 | 2268 | |
| 2269 | 2269 | $sql = "DELETE FROM ".MAIN_DB_PREFIX."menu"; |
| 2270 | 2270 | $sql .= " WHERE module = '".$this->db->escape($module)."'"; |
| 2271 | - $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' |
|
| 2271 | + $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' |
|
| 2272 | 2272 | $sql .= " AND entity IN (0, ".$conf->entity.")"; |
| 2273 | 2273 | |
| 2274 | 2274 | dol_syslog(get_class($this)."::delete_menus", LOG_DEBUG); |
@@ -2652,36 +2652,36 @@ discard block |
||
| 2652 | 2652 | } |
| 2653 | 2653 | |
| 2654 | 2654 | if ($this->isCoreOrExternalModule() == 'external' || preg_match('/development|experimental|deprecated/i', $version)) { |
| 2655 | - $versionTitle = $langs->trans("Version").' '.$this->getVersion(1); |
|
| 2655 | + $versionTitle = $langs->trans("Version").' '.$this->getVersion(1); |
|
| 2656 | 2656 | if ($this->needUpdate) { |
| 2657 | 2657 | $versionTitle .= '<br>'.$langs->trans('ModuleUpdateAvailable').' : '.$this->lastVersion; |
| 2658 | 2658 | } |
| 2659 | 2659 | |
| 2660 | - $return .= '<span class="info-box-icon-version'.($versiontrans ? ' '.$versiontrans : '').' classfortooltip" title="'.dol_escape_js($versionTitle).'" >'; |
|
| 2661 | - $return .= $this->getVersion(1); |
|
| 2662 | - $return .= '</span>'; |
|
| 2660 | + $return .= '<span class="info-box-icon-version'.($versiontrans ? ' '.$versiontrans : '').' classfortooltip" title="'.dol_escape_js($versionTitle).'" >'; |
|
| 2661 | + $return .= $this->getVersion(1); |
|
| 2662 | + $return .= '</span>'; |
|
| 2663 | 2663 | } |
| 2664 | 2664 | |
| 2665 | - $return .= '</div> |
|
| 2665 | + $return .= '</div> |
|
| 2666 | 2666 | <div class="info-box-content info-box-text-module'.(!getDolGlobalString($const_name) ? '' : ' info-box-module-enabled'.($versiontrans ? ' info-box-content-warning' : '')).'"> |
| 2667 | 2667 | <span class="info-box-title">'.$this->getName().'</span> |
| 2668 | 2668 | <span class="info-box-desc twolinesmax opacitymedium" title="'.dol_escape_htmltag($this->getDesc()).'">'.nl2br($this->getDesc()).'</span>'; |
| 2669 | 2669 | |
| 2670 | - $return .= '<div class="valignmiddle inline-block info-box-more">'; |
|
| 2670 | + $return .= '<div class="valignmiddle inline-block info-box-more">'; |
|
| 2671 | 2671 | //if ($versiontrans) print img_warning($langs->trans("Version").' '.$this->getVersion(1)).' '; |
| 2672 | - $return .= '<a class="valignmiddle inline-block" href="javascript:document_preview(\''.DOL_URL_ROOT.'/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>'; |
|
| 2673 | - $return .= '</div><br>'; |
|
| 2674 | - |
|
| 2675 | - $return .= '<div class="valignmiddle inline-block info-box-actions">'; |
|
| 2676 | - $return .= '<div class="valignmiddle inline-block info-box-setup">'; |
|
| 2677 | - $return .= $codetoconfig; |
|
| 2678 | - $return .= '</div>'; |
|
| 2679 | - $return .= '<div class="valignmiddle inline-block marginleftonly marginrightonly">'; |
|
| 2680 | - $return .= $codeenabledisable; |
|
| 2681 | - $return .= '</div>'; |
|
| 2682 | - $return .= '</div>'; |
|
| 2683 | - |
|
| 2684 | - $return .= ' |
|
| 2672 | + $return .= '<a class="valignmiddle inline-block" href="javascript:document_preview(\''.DOL_URL_ROOT.'/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>'; |
|
| 2673 | + $return .= '</div><br>'; |
|
| 2674 | + |
|
| 2675 | + $return .= '<div class="valignmiddle inline-block info-box-actions">'; |
|
| 2676 | + $return .= '<div class="valignmiddle inline-block info-box-setup">'; |
|
| 2677 | + $return .= $codetoconfig; |
|
| 2678 | + $return .= '</div>'; |
|
| 2679 | + $return .= '<div class="valignmiddle inline-block marginleftonly marginrightonly">'; |
|
| 2680 | + $return .= $codeenabledisable; |
|
| 2681 | + $return .= '</div>'; |
|
| 2682 | + $return .= '</div>'; |
|
| 2683 | + |
|
| 2684 | + $return .= ' |
|
| 2685 | 2685 | </div><!-- /.info-box-content --> |
| 2686 | 2686 | </div><!-- /.info-box --> |
| 2687 | 2687 | </div>'; |
@@ -2701,7 +2701,7 @@ discard block |
||
| 2701 | 2701 | { |
| 2702 | 2702 | require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; |
| 2703 | 2703 | if (!empty($this->url_last_version)) { |
| 2704 | - $lastVersion = getURLContent($this->url_last_version, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only |
|
| 2704 | + $lastVersion = getURLContent($this->url_last_version, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only |
|
| 2705 | 2705 | if (isset($lastVersion['content']) && strlen($lastVersion['content']) < 30) { |
| 2706 | 2706 | // 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 _ . - |
| 2707 | 2707 | $this->lastVersion = preg_replace("/[^a-zA-Z0-9_\.\-]+/", "", $lastVersion['content']); |
@@ -2738,7 +2738,7 @@ discard block |
||
| 2738 | 2738 | if (empty($conf->cache['noncompliantmodules'])) { |
| 2739 | 2739 | require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; |
| 2740 | 2740 | |
| 2741 | - $result = getURLContent(self::URL_FOR_BLACKLISTED_MODULES, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only |
|
| 2741 | + $result = getURLContent(self::URL_FOR_BLACKLISTED_MODULES, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only |
|
| 2742 | 2742 | if (isset($result['content']) && $result['http_code'] == 200) { |
| 2743 | 2743 | $langs->load("errors"); |
| 2744 | 2744 | |
@@ -186,13 +186,13 @@ discard block |
||
| 186 | 186 | public function containsStrict($key, $value = null) |
| 187 | 187 | { |
| 188 | 188 | if (func_num_args() === 2) { |
| 189 | - return $this->contains(function ($item) use ($key, $value) { |
|
| 189 | + return $this->contains(function($item) use ($key, $value) { |
|
| 190 | 190 | return data_get($item, $key) === $value; |
| 191 | 191 | }); |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | if ($this->useAsCallable($key)) { |
| 195 | - return ! is_null($this->first($key)); |
|
| 195 | + return !is_null($this->first($key)); |
|
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | foreach ($this as $item) { |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | { |
| 227 | 227 | (new Collection(func_get_args())) |
| 228 | 228 | ->push($this->all()) |
| 229 | - ->each(function ($item) { |
|
| 229 | + ->each(function($item) { |
|
| 230 | 230 | VarDumper::dump($item); |
| 231 | 231 | }); |
| 232 | 232 | |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | */ |
| 259 | 259 | public function eachSpread(callable $callback) |
| 260 | 260 | { |
| 261 | - return $this->each(function ($chunk, $key) use ($callback) { |
|
| 261 | + return $this->each(function($chunk, $key) use ($callback) { |
|
| 262 | 262 | $chunk[] = $key; |
| 263 | 263 | |
| 264 | 264 | return $callback(...$chunk); |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | $callback = $this->valueRetriever($key); |
| 280 | 280 | |
| 281 | 281 | foreach ($this as $k => $v) { |
| 282 | - if (! $callback($v, $k)) { |
|
| 282 | + if (!$callback($v, $k)) { |
|
| 283 | 283 | return false; |
| 284 | 284 | } |
| 285 | 285 | } |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | */ |
| 311 | 311 | public function isNotEmpty() |
| 312 | 312 | { |
| 313 | - return ! $this->isEmpty(); |
|
| 313 | + return !$this->isEmpty(); |
|
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | /** |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | */ |
| 322 | 322 | public function mapSpread(callable $callback) |
| 323 | 323 | { |
| 324 | - return $this->map(function ($chunk, $key) use ($callback) { |
|
| 324 | + return $this->map(function($chunk, $key) use ($callback) { |
|
| 325 | 325 | $chunk[] = $key; |
| 326 | 326 | |
| 327 | 327 | return $callback(...$chunk); |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | */ |
| 363 | 363 | public function mapInto($class) |
| 364 | 364 | { |
| 365 | - return $this->map(function ($value, $key) use ($class) { |
|
| 365 | + return $this->map(function($value, $key) use ($class) { |
|
| 366 | 366 | return new $class($value, $key); |
| 367 | 367 | }); |
| 368 | 368 | } |
@@ -377,11 +377,11 @@ discard block |
||
| 377 | 377 | { |
| 378 | 378 | $callback = $this->valueRetriever($callback); |
| 379 | 379 | |
| 380 | - return $this->map(function ($value) use ($callback) { |
|
| 380 | + return $this->map(function($value) use ($callback) { |
|
| 381 | 381 | return $callback($value); |
| 382 | - })->filter(function ($value) { |
|
| 383 | - return ! is_null($value); |
|
| 384 | - })->reduce(function ($result, $value) { |
|
| 382 | + })->filter(function($value) { |
|
| 383 | + return !is_null($value); |
|
| 384 | + })->reduce(function($result, $value) { |
|
| 385 | 385 | return is_null($result) || $value < $result ? $value : $result; |
| 386 | 386 | }); |
| 387 | 387 | } |
@@ -396,9 +396,9 @@ discard block |
||
| 396 | 396 | { |
| 397 | 397 | $callback = $this->valueRetriever($callback); |
| 398 | 398 | |
| 399 | - return $this->filter(function ($value) { |
|
| 400 | - return ! is_null($value); |
|
| 401 | - })->reduce(function ($result, $item) use ($callback) { |
|
| 399 | + return $this->filter(function($value) { |
|
| 400 | + return !is_null($value); |
|
| 401 | + })->reduce(function($result, $item) use ($callback) { |
|
| 402 | 402 | $value = $callback($item); |
| 403 | 403 | |
| 404 | 404 | return is_null($result) || $value > $result ? $value : $result; |
@@ -459,7 +459,7 @@ discard block |
||
| 459 | 459 | ? $this->identity() |
| 460 | 460 | : $this->valueRetriever($callback); |
| 461 | 461 | |
| 462 | - return $this->reduce(function ($result, $item) use ($callback) { |
|
| 462 | + return $this->reduce(function($result, $item) use ($callback) { |
|
| 463 | 463 | return $result + $callback($item); |
| 464 | 464 | }, 0); |
| 465 | 465 | } |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | */ |
| 475 | 475 | public function when($value, callable $callback = null, callable $default = null) |
| 476 | 476 | { |
| 477 | - if (! $callback) { |
|
| 477 | + if (!$callback) { |
|
| 478 | 478 | return new HigherOrderWhenProxy($this, $value); |
| 479 | 479 | } |
| 480 | 480 | |
@@ -521,7 +521,7 @@ discard block |
||
| 521 | 521 | */ |
| 522 | 522 | public function unless($value, callable $callback, callable $default = null) |
| 523 | 523 | { |
| 524 | - return $this->when(! $value, $callback, $default); |
|
| 524 | + return $this->when(!$value, $callback, $default); |
|
| 525 | 525 | } |
| 526 | 526 | |
| 527 | 527 | /** |
@@ -607,7 +607,7 @@ discard block |
||
| 607 | 607 | { |
| 608 | 608 | $values = $this->getArrayableItems($values); |
| 609 | 609 | |
| 610 | - return $this->filter(function ($item) use ($key, $values, $strict) { |
|
| 610 | + return $this->filter(function($item) use ($key, $values, $strict) { |
|
| 611 | 611 | return in_array(data_get($item, $key), $values, $strict); |
| 612 | 612 | }); |
| 613 | 613 | } |
@@ -645,7 +645,7 @@ discard block |
||
| 645 | 645 | */ |
| 646 | 646 | public function whereNotBetween($key, $values) |
| 647 | 647 | { |
| 648 | - return $this->filter(function ($item) use ($key, $values) { |
|
| 648 | + return $this->filter(function($item) use ($key, $values) { |
|
| 649 | 649 | return data_get($item, $key) < reset($values) || data_get($item, $key) > end($values); |
| 650 | 650 | }); |
| 651 | 651 | } |
@@ -662,7 +662,7 @@ discard block |
||
| 662 | 662 | { |
| 663 | 663 | $values = $this->getArrayableItems($values); |
| 664 | 664 | |
| 665 | - return $this->reject(function ($item) use ($key, $values, $strict) { |
|
| 665 | + return $this->reject(function($item) use ($key, $values, $strict) { |
|
| 666 | 666 | return in_array(data_get($item, $key), $values, $strict); |
| 667 | 667 | }); |
| 668 | 668 | } |
@@ -687,7 +687,7 @@ discard block |
||
| 687 | 687 | */ |
| 688 | 688 | public function whereInstanceOf($type) |
| 689 | 689 | { |
| 690 | - return $this->filter(function ($value) use ($type) { |
|
| 690 | + return $this->filter(function($value) use ($type) { |
|
| 691 | 691 | if (is_array($type)) { |
| 692 | 692 | foreach ($type as $classType) { |
| 693 | 693 | if ($value instanceof $classType) { |
@@ -733,7 +733,7 @@ discard block |
||
| 733 | 733 | public function pipeThrough($pipes) |
| 734 | 734 | { |
| 735 | 735 | return static::make($pipes)->reduce( |
| 736 | - function ($carry, $pipe) { |
|
| 736 | + function($carry, $pipe) { |
|
| 737 | 737 | return $pipe($carry); |
| 738 | 738 | }, |
| 739 | 739 | $this |
@@ -803,7 +803,7 @@ discard block |
||
| 803 | 803 | foreach ($this as $key => $value) { |
| 804 | 804 | $result = call_user_func_array($callback, array_merge($result, [$value, $key])); |
| 805 | 805 | |
| 806 | - if (! is_array($result)) { |
|
| 806 | + if (!is_array($result)) { |
|
| 807 | 807 | throw new UnexpectedValueException(sprintf( |
| 808 | 808 | "%s::reduceMany expects reducer to return an array, but got a '%s' instead.", |
| 809 | 809 | class_basename(static::class), gettype($result) |
@@ -836,9 +836,9 @@ discard block |
||
| 836 | 836 | { |
| 837 | 837 | $useAsCallable = $this->useAsCallable($callback); |
| 838 | 838 | |
| 839 | - return $this->filter(function ($value, $key) use ($callback, $useAsCallable) { |
|
| 839 | + return $this->filter(function($value, $key) use ($callback, $useAsCallable) { |
|
| 840 | 840 | return $useAsCallable |
| 841 | - ? ! $callback($value, $key) |
|
| 841 | + ? !$callback($value, $key) |
|
| 842 | 842 | : $value != $callback; |
| 843 | 843 | }); |
| 844 | 844 | } |
@@ -871,7 +871,7 @@ discard block |
||
| 871 | 871 | */ |
| 872 | 872 | public function toArray() |
| 873 | 873 | { |
| 874 | - return $this->map(function ($value) { |
|
| 874 | + return $this->map(function($value) { |
|
| 875 | 875 | return $value instanceof Arrayable ? $value->toArray() : $value; |
| 876 | 876 | })->all(); |
| 877 | 877 | } |
@@ -884,7 +884,7 @@ discard block |
||
| 884 | 884 | #[\ReturnTypeWillChange] |
| 885 | 885 | public function jsonSerialize() |
| 886 | 886 | { |
| 887 | - return array_map(function ($value) { |
|
| 887 | + return array_map(function($value) { |
|
| 888 | 888 | if ($value instanceof JsonSerializable) { |
| 889 | 889 | return $value->jsonSerialize(); |
| 890 | 890 | } elseif ($value instanceof Jsonable) { |
@@ -965,7 +965,7 @@ discard block |
||
| 965 | 965 | */ |
| 966 | 966 | public function __get($key) |
| 967 | 967 | { |
| 968 | - if (! in_array($key, static::$proxies)) { |
|
| 968 | + if (!in_array($key, static::$proxies)) { |
|
| 969 | 969 | throw new Exception("Property [{$key}] does not exist on this collection instance."); |
| 970 | 970 | } |
| 971 | 971 | |
@@ -1021,10 +1021,10 @@ discard block |
||
| 1021 | 1021 | $operator = '='; |
| 1022 | 1022 | } |
| 1023 | 1023 | |
| 1024 | - return function ($item) use ($key, $operator, $value) { |
|
| 1024 | + return function($item) use ($key, $operator, $value) { |
|
| 1025 | 1025 | $retrieved = data_get($item, $key); |
| 1026 | 1026 | |
| 1027 | - $strings = array_filter([$retrieved, $value], function ($value) { |
|
| 1027 | + $strings = array_filter([$retrieved, $value], function($value) { |
|
| 1028 | 1028 | return is_string($value) || (is_object($value) && method_exists($value, '__toString')); |
| 1029 | 1029 | }); |
| 1030 | 1030 | |
@@ -1056,7 +1056,7 @@ discard block |
||
| 1056 | 1056 | */ |
| 1057 | 1057 | protected function useAsCallable($value) |
| 1058 | 1058 | { |
| 1059 | - return ! is_string($value) && is_callable($value); |
|
| 1059 | + return !is_string($value) && is_callable($value); |
|
| 1060 | 1060 | } |
| 1061 | 1061 | |
| 1062 | 1062 | /** |
@@ -1071,7 +1071,7 @@ discard block |
||
| 1071 | 1071 | return $value; |
| 1072 | 1072 | } |
| 1073 | 1073 | |
| 1074 | - return function ($item) use ($value) { |
|
| 1074 | + return function($item) use ($value) { |
|
| 1075 | 1075 | return data_get($item, $value); |
| 1076 | 1076 | }; |
| 1077 | 1077 | } |
@@ -1084,7 +1084,7 @@ discard block |
||
| 1084 | 1084 | */ |
| 1085 | 1085 | protected function equality($value) |
| 1086 | 1086 | { |
| 1087 | - return function ($item) use ($value) { |
|
| 1087 | + return function($item) use ($value) { |
|
| 1088 | 1088 | return $item === $value; |
| 1089 | 1089 | }; |
| 1090 | 1090 | } |
@@ -1097,8 +1097,8 @@ discard block |
||
| 1097 | 1097 | */ |
| 1098 | 1098 | protected function negate(Closure $callback) |
| 1099 | 1099 | { |
| 1100 | - return function (...$params) use ($callback) { |
|
| 1101 | - return ! $callback(...$params); |
|
| 1100 | + return function(...$params) use ($callback) { |
|
| 1101 | + return !$callback(...$params); |
|
| 1102 | 1102 | }; |
| 1103 | 1103 | } |
| 1104 | 1104 | |
@@ -1109,7 +1109,7 @@ discard block |
||
| 1109 | 1109 | */ |
| 1110 | 1110 | protected function identity() |
| 1111 | 1111 | { |
| 1112 | - return function ($value) { |
|
| 1112 | + return function($value) { |
|
| 1113 | 1113 | return $value; |
| 1114 | 1114 | }; |
| 1115 | 1115 | } |
@@ -49,8 +49,8 @@ discard block |
||
| 49 | 49 | require_once DOL_DOCUMENT_ROOT."/core/class/html.formcontract.class.php"; |
| 50 | 50 | require_once DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php"; |
| 51 | 51 | } |
| 52 | -if (getDolGlobalString('FICHEINTER_ADDON') && is_readable(DOL_DOCUMENT_ROOT."/core/modules/fichinter/mod_" . getDolGlobalString('FICHEINTER_ADDON').".php")) { |
|
| 53 | - require_once DOL_DOCUMENT_ROOT."/core/modules/fichinter/mod_" . getDolGlobalString('FICHEINTER_ADDON').'.php'; |
|
| 52 | +if (getDolGlobalString('FICHEINTER_ADDON') && is_readable(DOL_DOCUMENT_ROOT."/core/modules/fichinter/mod_".getDolGlobalString('FICHEINTER_ADDON').".php")) { |
|
| 53 | + require_once DOL_DOCUMENT_ROOT."/core/modules/fichinter/mod_".getDolGlobalString('FICHEINTER_ADDON').'.php'; |
|
| 54 | 54 | } |
| 55 | 55 | require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
| 56 | 56 | require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | $id = GETPOSTINT('id'); |
| 70 | 70 | $ref = GETPOST('ref', 'alpha'); |
| 71 | -$ref_client = GETPOST('ref_client', 'alpha'); |
|
| 71 | +$ref_client = GETPOST('ref_client', 'alpha'); |
|
| 72 | 72 | $socid = GETPOSTINT('socid'); |
| 73 | 73 | $contratid = GETPOSTINT('contratid'); |
| 74 | 74 | $action = GETPOST('action', 'alpha'); |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | $result = fichinter_create($db, $object, (!GETPOST('model', 'alpha')) ? $object->model_pdf : GETPOST('model', 'alpha'), $outputlangs); |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); |
|
| 233 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); |
|
| 234 | 234 | exit; |
| 235 | 235 | } else { |
| 236 | 236 | $mesg = $object->error; |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | $result = fichinter_create($db, $object, (!GETPOST('model', 'alpha')) ? $object->model_pdf : GETPOST('model', 'alpha'), $outputlangs); |
| 256 | 256 | } |
| 257 | 257 | |
| 258 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); |
|
| 258 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); |
|
| 259 | 259 | exit; |
| 260 | 260 | } else { |
| 261 | 261 | $mesg = $object->error; |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | $result = fichinter_create($db, $object, (!GETPOST('model', 'alpha')) ? $object->model_pdf : GETPOST('model', 'alpha'), $outputlangs); |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); |
|
| 283 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); |
|
| 284 | 284 | exit; |
| 285 | 285 | } else { |
| 286 | 286 | $mesg = $object->error; |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | |
| 377 | 377 | $classname = ucfirst($subelement); |
| 378 | 378 | $srcobject = new $classname($db); |
| 379 | - '@phan-var-force Commande|Propal|Contrat $srcobject'; // Can be other class, but CommonObject is too generic |
|
| 379 | + '@phan-var-force Commande|Propal|Contrat $srcobject'; // Can be other class, but CommonObject is too generic |
|
| 380 | 380 | /** @var Commande|Propal|Contrat $srcobject */ |
| 381 | 381 | |
| 382 | 382 | dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines"); |
@@ -1136,7 +1136,7 @@ discard block |
||
| 1136 | 1136 | } else { |
| 1137 | 1137 | print '<form name="fichinter" action="'.$_SERVER['PHP_SELF'].'" method="POST">'; |
| 1138 | 1138 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
| 1139 | - print '<input type="hidden" name="action" value="create">'; // We go back to create action |
|
| 1139 | + print '<input type="hidden" name="action" value="create">'; // We go back to create action |
|
| 1140 | 1140 | print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
| 1141 | 1141 | |
| 1142 | 1142 | print dol_get_fiche_head([]); |
@@ -1831,9 +1831,9 @@ discard block |
||
| 1831 | 1831 | // Sign |
| 1832 | 1832 | if ($object->statut > Fichinter::STATUS_DRAFT) { |
| 1833 | 1833 | if ($object->signed_status != Fichinter::$SIGNED_STATUSES['STATUS_SIGNED_ALL']) { |
| 1834 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=sign&token=' . newToken() . '">' . $langs->trans("InterventionSign") . '</a></div>'; |
|
| 1834 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=sign&token='.newToken().'">'.$langs->trans("InterventionSign").'</a></div>'; |
|
| 1835 | 1835 | } else { |
| 1836 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=unsign&token=' . newToken() . '">' . $langs->trans("InterventionUnsign") . '</a></div>'; |
|
| 1836 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=unsign&token='.newToken().'">'.$langs->trans("InterventionUnsign").'</a></div>'; |
|
| 1837 | 1837 | } |
| 1838 | 1838 | } |
| 1839 | 1839 | |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | $company_static->name = $x_coll[$my_coll_thirdpartyid]['company_name'][$id]; |
| 270 | 270 | $company_static->name_alias = $x_coll[$my_coll_thirdpartyid]['company_alias'][$id]; |
| 271 | 271 | $company_static->email = $x_coll[$my_coll_thirdpartyid]['company_email'][$id]; |
| 272 | - $company_static->tva_intra = isset($x_coll[$my_coll_thirdpartyid]['tva_intra'][$id]) ? $x_coll[$my_coll_thirdpartyid]['tva_intra'][$id] : '0'; // @phan-suppress-current-line PhanTypeInvalidDimOffset |
|
| 272 | + $company_static->tva_intra = isset($x_coll[$my_coll_thirdpartyid]['tva_intra'][$id]) ? $x_coll[$my_coll_thirdpartyid]['tva_intra'][$id] : '0'; // @phan-suppress-current-line PhanTypeInvalidDimOffset |
|
| 273 | 273 | $company_static->client = $x_coll[$my_coll_thirdpartyid]['company_client'][$id]; |
| 274 | 274 | $company_static->fournisseur = $x_coll[$my_coll_thirdpartyid]['company_fournisseur'][$id]; |
| 275 | 275 | $company_static->status = $x_coll[$my_coll_thirdpartyid]['company_status'][$id]; |
@@ -285,8 +285,8 @@ discard block |
||
| 285 | 285 | 'pid' => $x_coll[$my_coll_thirdpartyid]['pid'][$id], |
| 286 | 286 | 'pref' => isset($x_coll[$my_coll_thirdpartyid]['pref'][$id]) ? $x_coll[$my_coll_thirdpartyid]['pref'][$id] : '', |
| 287 | 287 | 'ptype' => $x_coll[$my_coll_thirdpartyid]['ptype'][$id], |
| 288 | - 'pstatus' => isset($x_paye[$my_coll_thirdpartyid]['pstatus'][$id]) ? $x_paye[$my_coll_thirdpartyid]['pstatus'][$id] : '', // @phan-suppress-current-line PhanTypeInvalidDimOffset |
|
| 289 | - 'pstatusbuy' => isset($x_paye[$my_coll_thirdpartyid]['pstatusbuy'][$id]) ? $x_paye[$my_coll_thirdpartyid]['pstatusbuy'][$id] : '', // @phan-suppress-current-line PhanTypeInvalidDimOffset |
|
| 288 | + 'pstatus' => isset($x_paye[$my_coll_thirdpartyid]['pstatus'][$id]) ? $x_paye[$my_coll_thirdpartyid]['pstatus'][$id] : '', // @phan-suppress-current-line PhanTypeInvalidDimOffset |
|
| 289 | + 'pstatusbuy' => isset($x_paye[$my_coll_thirdpartyid]['pstatusbuy'][$id]) ? $x_paye[$my_coll_thirdpartyid]['pstatusbuy'][$id] : '', // @phan-suppress-current-line PhanTypeInvalidDimOffset |
|
| 290 | 290 | |
| 291 | 291 | 'payment_id' => $x_coll[$my_coll_thirdpartyid]['payment_id'][$id], |
| 292 | 292 | 'payment_ref' => isset($x_coll[$my_coll_thirdpartyid]['payment_ref'][$id]) ? $x_coll[$my_coll_thirdpartyid]['payment_ref'][$id] : '', |
@@ -677,15 +677,15 @@ discard block |
||
| 677 | 677 | $multicurrency_alreadypayed = price2num($multicurrency_payment + $multicurrency_creditnotes + $multicurrency_deposits, 'MT'); |
| 678 | 678 | $multicurrency_remaintopay = price2num($invoice->multicurrency_total_ttc - $multicurrency_payment - $multicurrency_creditnotes - $multicurrency_deposits, 'MT'); |
| 679 | 679 | // Multicurrency full amount tooltip |
| 680 | - $tooltiponmulticurrencyfullamount = $langs->trans('AmountHT') . ": " . price($objp->multicurrency_total_ht, 0, $langs, 0, -1, -1, $objp->multicurrency_code) . "<br>"; |
|
| 681 | - $tooltiponmulticurrencyfullamount .= $langs->trans('AmountVAT') . ": " . price($objp->multicurrency_total_tva, 0, $langs, 0, -1, -1, $objp->multicurrency_code) . "<br>"; |
|
| 682 | - $tooltiponmulticurrencyfullamount .= $langs->trans('AmountTTC') . ": " . price($objp->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $objp->multicurrency_code) . "<br>"; |
|
| 680 | + $tooltiponmulticurrencyfullamount = $langs->trans('AmountHT').": ".price($objp->multicurrency_total_ht, 0, $langs, 0, -1, -1, $objp->multicurrency_code)."<br>"; |
|
| 681 | + $tooltiponmulticurrencyfullamount .= $langs->trans('AmountVAT').": ".price($objp->multicurrency_total_tva, 0, $langs, 0, -1, -1, $objp->multicurrency_code)."<br>"; |
|
| 682 | + $tooltiponmulticurrencyfullamount .= $langs->trans('AmountTTC').": ".price($objp->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $objp->multicurrency_code)."<br>"; |
|
| 683 | 683 | } |
| 684 | 684 | |
| 685 | 685 | // Full amount tooltip |
| 686 | - $tooltiponfullamount = $langs->trans('AmountHT') . ": " . price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . "<br>"; |
|
| 687 | - $tooltiponfullamount .= $langs->trans('AmountVAT') . ": " . price($objp->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . "<br>"; |
|
| 688 | - $tooltiponfullamount .= $langs->trans('AmountTTC') . ": " . price($objp->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . "<br>"; |
|
| 686 | + $tooltiponfullamount = $langs->trans('AmountHT').": ".price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency)."<br>"; |
|
| 687 | + $tooltiponfullamount .= $langs->trans('AmountVAT').": ".price($objp->total_tva, 0, $langs, 0, -1, -1, $conf->currency)."<br>"; |
|
| 688 | + $tooltiponfullamount .= $langs->trans('AmountTTC').": ".price($objp->total_ttc, 0, $langs, 0, -1, -1, $conf->currency)."<br>"; |
|
| 689 | 689 | |
| 690 | 690 | print '<tr class="oddeven'.(($invoice->id == $facid) ? ' highlight' : '').'">'; |
| 691 | 691 | |
@@ -722,7 +722,7 @@ discard block |
||
| 722 | 722 | if (isModEnabled('multicurrency')) { |
| 723 | 723 | print '<td class="right">'; |
| 724 | 724 | if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) { |
| 725 | - print '<span class="amount classfortooltip" title="'.$tooltiponmulticurrencyfullamount.'">' . price($sign * $objp->multicurrency_total_ttc); |
|
| 725 | + print '<span class="amount classfortooltip" title="'.$tooltiponmulticurrencyfullamount.'">'.price($sign * $objp->multicurrency_total_ttc); |
|
| 726 | 726 | } |
| 727 | 727 | print '</span></td>'; |
| 728 | 728 | |
@@ -209,8 +209,8 @@ |
||
| 209 | 209 | print '<div class="div-table-responsive">'; |
| 210 | 210 | print '<table class="liste noborder centpercent">'; |
| 211 | 211 | |
| 212 | -$x_coll_sum = 0; // Initialize value |
|
| 213 | -$x_paye_sum = 0; // Initialize value |
|
| 212 | +$x_coll_sum = 0; // Initialize value |
|
| 213 | +$x_paye_sum = 0; // Initialize value |
|
| 214 | 214 | |
| 215 | 215 | // IRPF that the customer has retained me |
| 216 | 216 | if ($calc == 0 || $calc == 2) { |