@@ -154,7 +154,7 @@ discard block  | 
                                                    ||
| 154 | 154 |  	if (dol_is_file($filetpl)) { | 
                                                        
| 155 | 155 |  		if ($backupold) { | 
                                                        
| 156 | 156 | $result = archiveOrBackupFile($filetpl);  | 
                                                        
| 157 | -			if (! $result) { | 
                                                        |
| 157 | +			if (!$result) { | 
                                                        |
| 158 | 158 | return false;  | 
                                                        
| 159 | 159 | }  | 
                                                        
| 160 | 160 |  		} else { | 
                                                        
@@ -344,48 +344,48 @@ discard block  | 
                                                    ||
| 344 | 344 |  		if ($objectpage->type_container == 'setup') { | 
                                                        
| 345 | 345 | $content = '<div id="websitetemplateconfigpage">'."\n";  | 
                                                        
| 346 | 346 | $content .= '<?php'."\n";  | 
                                                        
| 347 | - $content .= '/*' . "\n";  | 
                                                        |
| 348 | - $content .= ' * Actions' . "\n";  | 
                                                        |
| 349 | - $content .= ' */' . "\n";  | 
                                                        |
| 350 | - $content .= '$websitetemplateconf = GETPOSTINT(\'websitetemplateconf\');' . "\n";  | 
                                                        |
| 351 | - $content .= 'include DOL_DOCUMENT_ROOT.\'/core/actions_setmoduleoptions.inc.php\';' . "\n";  | 
                                                        |
| 352 | - $content .= '' . "\n";  | 
                                                        |
| 353 | - $content .= '/*' . "\n";  | 
                                                        |
| 354 | - $content .= ' * View' . "\n";  | 
                                                        |
| 355 | - $content .= ' */' . "\n";  | 
                                                        |
| 356 | - $content .= 'print load_fiche_titre($langs->trans(\'SetupAndProperties\'), \'\', \'title_setup\');' . "\n";  | 
                                                        |
| 357 | - $content .= '' . "\n";  | 
                                                        |
| 358 | -			$content .= 'if (!empty($message)) {' . "\n"; | 
                                                        |
| 359 | - $content .= ' print $message;' . "\n";  | 
                                                        |
| 360 | - $content .= '}' . "\n";  | 
                                                        |
| 361 | - $content .= '' . "\n";  | 
                                                        |
| 362 | -			$content .= 'if (!empty($formSetup->items)) {' . "\n"; | 
                                                        |
| 363 | - $content .= ' $html = \'\';' . "\n";  | 
                                                        |
| 364 | - $content .= '' . "\n";  | 
                                                        |
| 365 | - $content .= ' $html .= \'<form action="config.php" method="POST">\';' . "\n";  | 
                                                        |
| 366 | - $content .= ' // Generate hidden values from $formSetup->formHiddenInputs' . "\n";  | 
                                                        |
| 367 | -			$content .= '    if (!empty($formSetup->formHiddenInputs) && is_array($formSetup->formHiddenInputs)) {' . "\n"; | 
                                                        |
| 368 | -			$content .= '        foreach ($formSetup->formHiddenInputs as $hiddenKey => $hiddenValue) {' . "\n"; | 
                                                        |
| 369 | - $content .= ' $html .= \'<input type="hidden" name="\' . dol_escape_htmltag($hiddenKey) . \'" value="\' . dol_escape_htmltag($hiddenValue) . \'">\';' . "\n";  | 
                                                        |
| 370 | - $content .= ' }' . "\n";  | 
                                                        |
| 371 | - $content .= ' }' . "\n";  | 
                                                        |
| 372 | - $content .= '' . "\n";  | 
                                                        |
| 373 | - $content .= ' // Generate output table' . "\n";  | 
                                                        |
| 374 | - $content .= ' $html .= $formSetup->generateTableOutput(true);' . "\n";  | 
                                                        |
| 375 | - $content .= '' . "\n";  | 
                                                        |
| 376 | - $content .= ' // Submit button' . "\n";  | 
                                                        |
| 377 | - $content .= ' $html .= \'<input type="hidden" name="action" value="save">\';' . "\n";  | 
                                                        |
| 378 | - $content .= ' $html .= \'<input type="hidden" name="websitetemplateconf" value="1">\';' . "\n";  | 
                                                        |
| 379 | - $content .= ' $html .= \'<br>\';' . "\n";  | 
                                                        |
| 380 | - $content .= ' $html .= \'<div class="form-setup-button-container center">\';' . "\n";  | 
                                                        |
| 381 | -			$content .= '    $html .= \'<input class="button button-submit" type="submit" value="\' . $langs->trans("Save") . \'">\';' . "\n"; | 
                                                        |
| 382 | - $content .= ' $html .= \'</div>\';' . "\n";  | 
                                                        |
| 383 | - $content .= ' $html .= \'</form>\';' . "\n";  | 
                                                        |
| 384 | - $content .= '' . "\n";  | 
                                                        |
| 385 | - $content .= ' print $html;' . "\n";  | 
                                                        |
| 386 | - $content .= '}' . "\n";  | 
                                                        |
| 387 | - $content .= '?>' . "\n";  | 
                                                        |
| 388 | - $content .= '</div>' . "\n";  | 
                                                        |
| 347 | + $content .= '/*'."\n";  | 
                                                        |
| 348 | + $content .= ' * Actions'."\n";  | 
                                                        |
| 349 | + $content .= ' */'."\n";  | 
                                                        |
| 350 | + $content .= '$websitetemplateconf = GETPOSTINT(\'websitetemplateconf\');'."\n";  | 
                                                        |
| 351 | + $content .= 'include DOL_DOCUMENT_ROOT.\'/core/actions_setmoduleoptions.inc.php\';'."\n";  | 
                                                        |
| 352 | + $content .= ''."\n";  | 
                                                        |
| 353 | + $content .= '/*'."\n";  | 
                                                        |
| 354 | + $content .= ' * View'."\n";  | 
                                                        |
| 355 | + $content .= ' */'."\n";  | 
                                                        |
| 356 | + $content .= 'print load_fiche_titre($langs->trans(\'SetupAndProperties\'), \'\', \'title_setup\');'."\n";  | 
                                                        |
| 357 | + $content .= ''."\n";  | 
                                                        |
| 358 | +			$content .= 'if (!empty($message)) {'."\n"; | 
                                                        |
| 359 | + $content .= ' print $message;'."\n";  | 
                                                        |
| 360 | + $content .= '}'."\n";  | 
                                                        |
| 361 | + $content .= ''."\n";  | 
                                                        |
| 362 | +			$content .= 'if (!empty($formSetup->items)) {'."\n"; | 
                                                        |
| 363 | + $content .= ' $html = \'\';'."\n";  | 
                                                        |
| 364 | + $content .= ''."\n";  | 
                                                        |
| 365 | + $content .= ' $html .= \'<form action="config.php" method="POST">\';'."\n";  | 
                                                        |
| 366 | + $content .= ' // Generate hidden values from $formSetup->formHiddenInputs'."\n";  | 
                                                        |
| 367 | +			$content .= '    if (!empty($formSetup->formHiddenInputs) && is_array($formSetup->formHiddenInputs)) {'."\n"; | 
                                                        |
| 368 | +			$content .= '        foreach ($formSetup->formHiddenInputs as $hiddenKey => $hiddenValue) {'."\n"; | 
                                                        |
| 369 | + $content .= ' $html .= \'<input type="hidden" name="\' . dol_escape_htmltag($hiddenKey) . \'" value="\' . dol_escape_htmltag($hiddenValue) . \'">\';'."\n";  | 
                                                        |
| 370 | + $content .= ' }'."\n";  | 
                                                        |
| 371 | + $content .= ' }'."\n";  | 
                                                        |
| 372 | + $content .= ''."\n";  | 
                                                        |
| 373 | + $content .= ' // Generate output table'."\n";  | 
                                                        |
| 374 | + $content .= ' $html .= $formSetup->generateTableOutput(true);'."\n";  | 
                                                        |
| 375 | + $content .= ''."\n";  | 
                                                        |
| 376 | + $content .= ' // Submit button'."\n";  | 
                                                        |
| 377 | + $content .= ' $html .= \'<input type="hidden" name="action" value="save">\';'."\n";  | 
                                                        |
| 378 | + $content .= ' $html .= \'<input type="hidden" name="websitetemplateconf" value="1">\';'."\n";  | 
                                                        |
| 379 | + $content .= ' $html .= \'<br>\';'."\n";  | 
                                                        |
| 380 | + $content .= ' $html .= \'<div class="form-setup-button-container center">\';'."\n";  | 
                                                        |
| 381 | +			$content .= '    $html .= \'<input class="button button-submit" type="submit" value="\' . $langs->trans("Save") . \'">\';'."\n"; | 
                                                        |
| 382 | + $content .= ' $html .= \'</div>\';'."\n";  | 
                                                        |
| 383 | + $content .= ' $html .= \'</form>\';'."\n";  | 
                                                        |
| 384 | + $content .= ''."\n";  | 
                                                        |
| 385 | + $content .= ' print $html;'."\n";  | 
                                                        |
| 386 | + $content .= '}'."\n";  | 
                                                        |
| 387 | + $content .= '?>'."\n";  | 
                                                        |
| 388 | + $content .= '</div>'."\n";  | 
                                                        |
| 389 | 389 | $tplcontent .= $content."\n";  | 
                                                        
| 390 | 390 | }  | 
                                                        
| 391 | 391 | |
@@ -395,7 +395,7 @@ discard block  | 
                                                    ||
| 395 | 395 | |
| 396 | 396 | $tplcontent .= '<?php // BEGIN PHP'."\n";  | 
                                                        
| 397 | 397 |  		$tplcontent .= '} catch(Exception $e) { print $e->getMessage(); }'."\n"; | 
                                                        
| 398 | - $tplcontent .= '$tmp = ob_get_contents(); ob_end_clean();'."\n"; // replace with ob_get_clean ?  | 
                                                        |
| 398 | + $tplcontent .= '$tmp = ob_get_contents(); ob_end_clean();'."\n"; // replace with ob_get_clean ?  | 
                                                        |
| 399 | 399 | |
| 400 | 400 | $tplcontent .= "// Now fix the content for SEO or multilanguage\n";  | 
                                                        
| 401 | 401 | // Old method for custom SEO  | 
                                                        
@@ -526,7 +526,7 @@ discard block  | 
                                                    ||
| 526 | 526 | $indexcontent .= " require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php';\n";  | 
                                                        
| 527 | 527 | $indexcontent .= ' redirectToContainer($_GET[\'pageref\'], $_GET[\'pagealiasalt\'], $_GET[\'pageid\']);'."\n";  | 
                                                        
| 528 | 528 | $indexcontent .= "}\n";  | 
                                                        
| 529 | - $indexcontent .= "include_once '".$relpath."/".basename($filetpl)."'\n"; // use .. instead of .  | 
                                                        |
| 529 | + $indexcontent .= "include_once '".$relpath."/".basename($filetpl)."'\n"; // use .. instead of .  | 
                                                        |
| 530 | 530 | $indexcontent .= '// END PHP ?>'."\n";  | 
                                                        
| 531 | 531 | $result = file_put_contents($fileindexsub, $indexcontent);  | 
                                                        
| 532 | 532 |  						if ($result === false) { | 
                                                        
@@ -784,7 +784,7 @@ discard block  | 
                                                    ||
| 784 | 784 | dol_delete_file($dest.'.zip');  | 
                                                        
| 785 | 785 | |
| 786 | 786 | // Compress it  | 
                                                        
| 787 | - global $errormsg; // Used by dol_compress_dir  | 
                                                        |
| 787 | + global $errormsg; // Used by dol_compress_dir  | 
                                                        |
| 788 | 788 | $errormsg = '';  | 
                                                        
| 789 | 789 | $result = dol_compress_dir($src, $dest.'.zip', 'zip');  | 
                                                        
| 790 | 790 |  					if ($result < 0) { | 
                                                        
@@ -965,7 +965,7 @@ discard block  | 
                                                    ||
| 965 | 965 |  		//$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("require", "include", "require_once", "include_once")); | 
                                                        
| 966 | 966 |  		if (!getDolGlobalString('WEBSITE_PHP_ALLOW_EXEC')) {    // If option is not on, we disallow functions to execute commands | 
                                                        
| 967 | 967 |  			$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("exec", "passthru", "shell_exec", "system", "proc_open", "popen")); | 
                                                        
| 968 | -			$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("dol_eval", "executeCLI", "verifCond"));	// native dolibarr functions | 
                                                        |
| 968 | +			$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("dol_eval", "executeCLI", "verifCond")); // native dolibarr functions | 
                                                        |
| 969 | 969 |  			$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("eval", "create_function", "assert", "mb_ereg_replace")); // function with eval capabilities | 
                                                        
| 970 | 970 | }  | 
                                                        
| 971 | 971 |  		if (!getDolGlobalString('WEBSITE_PHP_ALLOW_WRITE')) {    // If option is not on, we disallow functions to write files | 
                                                        
@@ -974,7 +974,7 @@ discard block  | 
                                                    ||
| 974 | 974 | }  | 
                                                        
| 975 | 975 |  		//$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("require", "include")); | 
                                                        
| 976 | 976 | |
| 977 | -		$forbiddenphpmethods = array('invoke', 'invokeArgs');	// Method of ReflectionFunction to execute a function | 
                                                        |
| 977 | +		$forbiddenphpmethods = array('invoke', 'invokeArgs'); // Method of ReflectionFunction to execute a function | 
                                                        |
| 978 | 978 | |
| 979 | 979 |  		foreach ($forbiddenphpstrings as $forbiddenphpstring) { | 
                                                        
| 980 | 980 |  			if (preg_match('/'.preg_quote($forbiddenphpstring, '/').'/ims', $phpfullcodestring)) { | 
                                                        
@@ -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;  | 
                                                        
@@ -729,7 +729,7 @@ discard block  | 
                                                    ||
| 729 | 729 | $moduleNameInConf = 'supplier_proposal';  | 
                                                        
| 730 | 730 | }  | 
                                                        
| 731 | 731 | |
| 732 | - unset($conf->modules[$moduleNameInConf]); // Add this module in list of enabled modules so isModEnabled() will work (conf->module->enabled must no more be used)  | 
                                                        |
| 732 | + unset($conf->modules[$moduleNameInConf]); // Add this module in list of enabled modules so isModEnabled() will work (conf->module->enabled must no more be used)  | 
                                                        |
| 733 | 733 | |
| 734 | 734 | return 1;  | 
                                                        
| 735 | 735 |  		} else { | 
                                                        
@@ -825,7 +825,7 @@ discard block  | 
                                                    ||
| 825 | 825 | $pathoffile = $this->getDescLongReadmeFound();  | 
                                                        
| 826 | 826 | |
| 827 | 827 |  		if ($pathoffile) {     // Mostly for external modules | 
                                                        
| 828 | - $content = file_get_contents($pathoffile, false, null, 0, 1024 * 1024); // Max size loaded 1Mb  | 
                                                        |
| 828 | + $content = file_get_contents($pathoffile, false, null, 0, 1024 * 1024); // Max size loaded 1Mb  | 
                                                        |
| 829 | 829 | |
| 830 | 830 |  			if ((float) DOL_VERSION >= 6.0) {  // @phpstan-ignore-line | 
                                                        
| 831 | 831 | @include_once DOL_DOCUMENT_ROOT.'/core/lib/parsemd.lib.php';  | 
                                                        
@@ -1589,7 +1589,7 @@ discard block  | 
                                                    ||
| 1589 | 1589 | |
| 1590 | 1590 | $sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes_def";  | 
                                                        
| 1591 | 1591 | $sql .= " WHERE file = '".$this->db->escape($file)."'";  | 
                                                        
| 1592 | - $sql .= " AND entity = ".$conf->entity; // Do not use getEntity here, we want to delete only in current company  | 
                                                        |
| 1592 | + $sql .= " AND entity = ".$conf->entity; // Do not use getEntity here, we want to delete only in current company  | 
                                                        |
| 1593 | 1593 | |
| 1594 | 1594 | dol_syslog(get_class($this)."::delete_boxes", LOG_DEBUG);  | 
                                                        
| 1595 | 1595 | $resql = $this->db->query($sql);  | 
                                                        
@@ -1612,9 +1612,9 @@ discard block  | 
                                                    ||
| 1612 | 1612 | public function insert_cronjobs()  | 
                                                        
| 1613 | 1613 |  	{ | 
                                                        
| 1614 | 1614 | // phpcs:enable  | 
                                                        
| 1615 | - include_once DOL_DOCUMENT_ROOT . '/core/class/infobox.class.php';  | 
                                                        |
| 1616 | - include_once DOL_DOCUMENT_ROOT . '/cron/class/cronjob.class.php';  | 
                                                        |
| 1617 | - include_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';  | 
                                                        |
| 1615 | + include_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';  | 
                                                        |
| 1616 | + include_once DOL_DOCUMENT_ROOT.'/cron/class/cronjob.class.php';  | 
                                                        |
| 1617 | + include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';  | 
                                                        |
| 1618 | 1618 | |
| 1619 | 1619 | global $conf, $user;  | 
                                                        
| 1620 | 1620 | |
@@ -1625,7 +1625,7 @@ discard block  | 
                                                    ||
| 1625 | 1625 | $err = 0;  | 
                                                        
| 1626 | 1626 | |
| 1627 | 1627 |  		if (is_array($this->cronjobs)) { | 
                                                        
| 1628 | - dol_syslog(get_class($this) . "::insert_cronjobs", LOG_DEBUG);  | 
                                                        |
| 1628 | + dol_syslog(get_class($this)."::insert_cronjobs", LOG_DEBUG);  | 
                                                        |
| 1629 | 1629 | |
| 1630 | 1630 |  			foreach ($this->cronjobs as $key => $value) { | 
                                                        
| 1631 | 1631 | $now = dol_now();  | 
                                                        
@@ -1652,7 +1652,7 @@ discard block  | 
                                                    ||
| 1652 | 1652 | $test = isset($value['test']) ? $value['test'] : ''; // Line must be enabled or not (so visible or not)  | 
                                                        
| 1653 | 1653 | |
| 1654 | 1654 | // Search if cron entry already present  | 
                                                        
| 1655 | - $sql = "SELECT count(*) as nb FROM " . MAIN_DB_PREFIX . "cronjob";  | 
                                                        |
| 1655 | + $sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."cronjob";  | 
                                                        |
| 1656 | 1656 | //$sql .= " WHERE module_name = '" . $this->db->escape(empty($this->rights_class) ? strtolower($this->name) : $this->rights_class) . "'";  | 
                                                        
| 1657 | 1657 | $sql .= " WHERE label = '".$this->db->escape($label)."'";  | 
                                                        
| 1658 | 1658 | /* unique key is on label,entity so no need for this test  | 
                                                        
@@ -1672,7 +1672,7 @@ discard block  | 
                                                    ||
| 1672 | 1672 | $sql .= " AND params = '" . $this->db->escape($params) . "'";  | 
                                                        
| 1673 | 1673 | }  | 
                                                        
| 1674 | 1674 | */  | 
                                                        
| 1675 | - $sql .= " AND entity = " . ((int) $entity); // Must be exact entity  | 
                                                        |
| 1675 | + $sql .= " AND entity = ".((int) $entity); // Must be exact entity  | 
                                                        |
| 1676 | 1676 | |
| 1677 | 1677 | $result = $this->db->query($sql);  | 
                                                        
| 1678 | 1678 |  				if (!$result) { | 
                                                        
@@ -2003,9 +2003,9 @@ discard block  | 
                                                    ||
| 2003 | 2003 | |
| 2004 | 2004 | // If the module is active  | 
                                                        
| 2005 | 2005 |  				foreach ($this->rights as $key => $value) { | 
                                                        
| 2006 | - $r_id = $this->rights[$key][self::KEY_ID]; // permission id in llx_rights_def (not unique because primary key is couple id-entity)  | 
                                                        |
| 2006 | + $r_id = $this->rights[$key][self::KEY_ID]; // permission id in llx_rights_def (not unique because primary key is couple id-entity)  | 
                                                        |
| 2007 | 2007 | $r_label = $this->rights[$key][self::KEY_LABEL];  | 
                                                        
| 2008 | - $r_type = $this->rights[$key][self::KEY_TYPE] ?? 'w'; // TODO deprecated  | 
                                                        |
| 2008 | + $r_type = $this->rights[$key][self::KEY_TYPE] ?? 'w'; // TODO deprecated  | 
                                                        |
| 2009 | 2009 | $r_default = $this->rights[$key][self::KEY_DEFAULT] ?? 0;  | 
                                                        
| 2010 | 2010 | $r_perms = $this->rights[$key][self::KEY_FIRST_LEVEL] ?? '';  | 
                                                        
| 2011 | 2011 | $r_subperms = $this->rights[$key][self::KEY_SECOND_LEVEL] ?? '';  | 
                                                        
@@ -2029,7 +2029,7 @@ discard block  | 
                                                    ||
| 2029 | 2029 | }  | 
                                                        
| 2030 | 2030 | |
| 2031 | 2031 |  					// condition to show or hide a user right (default: 1) (eg isModEnabled('anothermodule') or ($conf->global->MAIN_FEATURES_LEVEL > 0) or etc..) | 
                                                        
| 2032 | - $r_enabled = $this->rights[$key][self::KEY_ENABLED] ?? '1';  | 
                                                        |
| 2032 | + $r_enabled = $this->rights[$key][self::KEY_ENABLED] ?? '1';  | 
                                                        |
| 2033 | 2033 | |
| 2034 | 2034 | // Search if perm already present  | 
                                                        
| 2035 | 2035 | $sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."rights_def";  | 
                                                        
@@ -2046,7 +2046,7 @@ discard block  | 
                                                    ||
| 2046 | 2046 | $sql .= ", libelle";  | 
                                                        
| 2047 | 2047 | $sql .= ", module";  | 
                                                        
| 2048 | 2048 | $sql .= ", module_origin";  | 
                                                        
| 2049 | - $sql .= ", type"; // TODO deprecated  | 
                                                        |
| 2049 | + $sql .= ", type"; // TODO deprecated  | 
                                                        |
| 2050 | 2050 | $sql .= ", bydefault";  | 
                                                        
| 2051 | 2051 | $sql .= ", perms";  | 
                                                        
| 2052 | 2052 | $sql .= ", subperms";  | 
                                                        
@@ -2057,7 +2057,7 @@ discard block  | 
                                                    ||
| 2057 | 2057 | $sql .= ", '".$this->db->escape($r_label)."'";  | 
                                                        
| 2058 | 2058 | $sql .= ", '".$this->db->escape($r_module)."'";  | 
                                                        
| 2059 | 2059 | $sql .= ", '".$this->db->escape($r_module_origin)."'";  | 
                                                        
| 2060 | - $sql .= ", '".$this->db->escape($r_type)."'"; // TODO deprecated  | 
                                                        |
| 2060 | + $sql .= ", '".$this->db->escape($r_type)."'"; // TODO deprecated  | 
                                                        |
| 2061 | 2061 | $sql .= ", ".((int) $r_default);  | 
                                                        
| 2062 | 2062 | $sql .= ", '".$this->db->escape($r_perms)."'";  | 
                                                        
| 2063 | 2063 | $sql .= ", '".$this->db->escape($r_subperms)."'";  | 
                                                        
@@ -2279,7 +2279,7 @@ discard block  | 
                                                    ||
| 2279 | 2279 | |
| 2280 | 2280 | $sql = "DELETE FROM ".MAIN_DB_PREFIX."menu";  | 
                                                        
| 2281 | 2281 | $sql .= " WHERE module = '".$this->db->escape($module)."'";  | 
                                                        
| 2282 | - $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'  | 
                                                        |
| 2282 | + $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'  | 
                                                        |
| 2283 | 2283 | $sql .= " AND entity IN (0, ".$conf->entity.")";  | 
                                                        
| 2284 | 2284 | |
| 2285 | 2285 | dol_syslog(get_class($this)."::delete_menus", LOG_DEBUG);  | 
                                                        
@@ -2463,7 +2463,7 @@ discard block  | 
                                                    ||
| 2463 | 2463 | dol_delete_file($dest.'.zip');  | 
                                                        
| 2464 | 2464 | |
| 2465 | 2465 | // Compress it  | 
                                                        
| 2466 | - global $errormsg; // Used by dol_compress_dir  | 
                                                        |
| 2466 | + global $errormsg; // Used by dol_compress_dir  | 
                                                        |
| 2467 | 2467 | $errormsg = '';  | 
                                                        
| 2468 | 2468 | $result = dol_compress_dir($src, $dest.'.zip', 'zip');  | 
                                                        
| 2469 | 2469 |  						if ($result < 0) { | 
                                                        
@@ -2663,36 +2663,36 @@ discard block  | 
                                                    ||
| 2663 | 2663 | }  | 
                                                        
| 2664 | 2664 | |
| 2665 | 2665 |  		if ($this->isCoreOrExternalModule() == 'external' || preg_match('/development|experimental|deprecated/i', $version)) { | 
                                                        
| 2666 | -			$versionTitle =  $langs->trans("Version").' '.$this->getVersion(1); | 
                                                        |
| 2666 | +			$versionTitle = $langs->trans("Version").' '.$this->getVersion(1); | 
                                                        |
| 2667 | 2667 |  			if ($this->needUpdate) { | 
                                                        
| 2668 | 2668 |  				$versionTitle .= '<br>'.$langs->trans('ModuleUpdateAvailable').' : '.$this->lastVersion; | 
                                                        
| 2669 | 2669 | }  | 
                                                        
| 2670 | 2670 | |
| 2671 | - $return .= '<span class="info-box-icon-version'.($versiontrans ? ' '.$versiontrans : '').' classfortooltip" title="'.dol_escape_js($versionTitle).'" >';  | 
                                                        |
| 2672 | - $return .= $this->getVersion(1);  | 
                                                        |
| 2673 | - $return .= '</span>';  | 
                                                        |
| 2671 | + $return .= '<span class="info-box-icon-version'.($versiontrans ? ' '.$versiontrans : '').' classfortooltip" title="'.dol_escape_js($versionTitle).'" >';  | 
                                                        |
| 2672 | + $return .= $this->getVersion(1);  | 
                                                        |
| 2673 | + $return .= '</span>';  | 
                                                        |
| 2674 | 2674 | }  | 
                                                        
| 2675 | 2675 | |
| 2676 | - $return .= '</div>  | 
                                                        |
| 2676 | + $return .= '</div>  | 
                                                        |
| 2677 | 2677 | <div class="info-box-content info-box-text-module'.(!getDolGlobalString($const_name) ? '' : ' info-box-module-enabled'.($versiontrans ? ' info-box-content-warning' : '')).'">  | 
                                                        
| 2678 | 2678 | <span class="info-box-title">'.$this->getName().'</span>  | 
                                                        
| 2679 | 2679 | <span class="info-box-desc twolinesmax opacitymedium" title="'.dol_escape_htmltag($this->getDesc()).'">'.nl2br($this->getDesc()).'</span>';  | 
                                                        
| 2680 | 2680 | |
| 2681 | - $return .= '<div class="valignmiddle inline-block info-box-more">';  | 
                                                        |
| 2681 | + $return .= '<div class="valignmiddle inline-block info-box-more">';  | 
                                                        |
| 2682 | 2682 |  		//if ($versiontrans) print img_warning($langs->trans("Version").' '.$this->getVersion(1)).' '; | 
                                                        
| 2683 | -		$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>'; | 
                                                        |
| 2684 | - $return .= '</div><br>';  | 
                                                        |
| 2685 | -  | 
                                                        |
| 2686 | - $return .= '<div class="valignmiddle inline-block info-box-actions">';  | 
                                                        |
| 2687 | - $return .= '<div class="valignmiddle inline-block info-box-setup">';  | 
                                                        |
| 2688 | - $return .= $codetoconfig;  | 
                                                        |
| 2689 | - $return .= '</div>';  | 
                                                        |
| 2690 | - $return .= '<div class="valignmiddle inline-block marginleftonly marginrightonly">';  | 
                                                        |
| 2691 | - $return .= $codeenabledisable;  | 
                                                        |
| 2692 | - $return .= '</div>';  | 
                                                        |
| 2693 | - $return .= '</div>';  | 
                                                        |
| 2694 | -  | 
                                                        |
| 2695 | - $return .= '  | 
                                                        |
| 2683 | +		$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>'; | 
                                                        |
| 2684 | + $return .= '</div><br>';  | 
                                                        |
| 2685 | +  | 
                                                        |
| 2686 | + $return .= '<div class="valignmiddle inline-block info-box-actions">';  | 
                                                        |
| 2687 | + $return .= '<div class="valignmiddle inline-block info-box-setup">';  | 
                                                        |
| 2688 | + $return .= $codetoconfig;  | 
                                                        |
| 2689 | + $return .= '</div>';  | 
                                                        |
| 2690 | + $return .= '<div class="valignmiddle inline-block marginleftonly marginrightonly">';  | 
                                                        |
| 2691 | + $return .= $codeenabledisable;  | 
                                                        |
| 2692 | + $return .= '</div>';  | 
                                                        |
| 2693 | + $return .= '</div>';  | 
                                                        |
| 2694 | +  | 
                                                        |
| 2695 | + $return .= '  | 
                                                        |
| 2696 | 2696 | </div><!-- /.info-box-content -->  | 
                                                        
| 2697 | 2697 | </div><!-- /.info-box -->  | 
                                                        
| 2698 | 2698 | </div>';  | 
                                                        
@@ -2712,7 +2712,7 @@ discard block  | 
                                                    ||
| 2712 | 2712 |  	{ | 
                                                        
| 2713 | 2713 | require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';  | 
                                                        
| 2714 | 2714 |  		if (!empty($this->url_last_version)) { | 
                                                        
| 2715 | -			$lastVersion = getURLContent($this->url_last_version, 'GET', '', 1, array(), array('http', 'https'), 0);	// Accept http or https links on external remote server only | 
                                                        |
| 2715 | +			$lastVersion = getURLContent($this->url_last_version, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only | 
                                                        |
| 2716 | 2716 |  			if (isset($lastVersion['content']) && strlen($lastVersion['content']) < 30) { | 
                                                        
| 2717 | 2717 | // 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 _ . -  | 
                                                        
| 2718 | 2718 |  				$this->lastVersion = preg_replace("/[^a-zA-Z0-9_\.\-]+/", "", $lastVersion['content']); | 
                                                        
@@ -2749,7 +2749,7 @@ discard block  | 
                                                    ||
| 2749 | 2749 |  		if (empty($conf->cache['noncompliantmodules'])) { | 
                                                        
| 2750 | 2750 | require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';  | 
                                                        
| 2751 | 2751 | |
| 2752 | -			$result = getURLContent(self::URL_FOR_BLACKLISTED_MODULES, 'GET', '', 1, array(), array('http', 'https'), 0);	// Accept http or https links on external remote server only | 
                                                        |
| 2752 | +			$result = getURLContent(self::URL_FOR_BLACKLISTED_MODULES, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only | 
                                                        |
| 2753 | 2753 |  			if (isset($result['content']) && $result['http_code'] == 200) { | 
                                                        
| 2754 | 2754 |  				$langs->load("errors"); | 
                                                        
| 2755 | 2755 | |
@@ -1,10 +1,10 @@ discard block  | 
                                                    ||
| 1 | 1 | <?php // BEGIN PHP  | 
                                                        
| 2 | -$websitekey=basename(__DIR__);  | 
                                                        |
| 3 | -if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { require_once __DIR__.'/master.inc.php'; } // Load env if not already loaded | 
                                                        |
| 2 | +$websitekey = basename(__DIR__);  | 
                                                        |
| 3 | +if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { require_once __DIR__.'/master.inc.php'; } // Load env if not already loaded | 
                                                        |
| 4 | 4 | require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php';  | 
                                                        
| 5 | 5 | require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php';  | 
                                                        
| 6 | 6 | ob_start();  | 
                                                        
| 7 | -if (! headers_sent()) {	/* because file is included inline when in edit mode and we don't want warning */ | 
                                                        |
| 7 | +if (!headers_sent()) {	/* because file is included inline when in edit mode and we don't want warning */ | 
                                                        |
| 8 | 8 |  header('Cache-Control: max-age=3600, public, must-revalidate'); | 
                                                        
| 9 | 9 |  header('Content-type: text/css'); | 
                                                        
| 10 | 10 | }  | 
                                                        
@@ -11382,8 +11382,8 @@ discard block  | 
                                                    ||
| 11382 | 11382 |  :root { | 
                                                        
| 11383 | 11383 | /*--main-color: #5d5b6a;  | 
                                                        
| 11384 | 11384 | --secondary-color: #FF7F50;*/  | 
                                                        
| 11385 | -    --main-color: <?php print getDolGlobalString('WS_' . strtoupper($website->ref) . '_MAIN_COLOR') ?: '#5d5b6a'; ?>; | 
                                                        |
| 11386 | -    --secondary-color: <?php print getDolGlobalString('WS_' . strtoupper($website->ref) . '_SECONDARY_COLOR') ?: '#FF7F50'; ?>; | 
                                                        |
| 11385 | +    --main-color: <?php print getDolGlobalString('WS_'.strtoupper($website->ref).'_MAIN_COLOR') ?: '#5d5b6a'; ?>; | 
                                                        |
| 11386 | +    --secondary-color: <?php print getDolGlobalString('WS_'.strtoupper($website->ref).'_SECONDARY_COLOR') ?: '#FF7F50'; ?>; | 
                                                        |
| 11387 | 11387 | --secondary-border-color: #999;  | 
                                                        
| 11388 | 11388 | /*--light-secondary-color: rgb(255, 249, 241);*/  | 
                                                        
| 11389 | 11389 | --light-secondary-color: color-mix(in srgb, var(--secondary-color) 20%, white);  | 
                                                        
@@ -1,6 +1,6 @@  | 
                                                    ||
| 1 | 1 | <?php // BEGIN PHP  | 
                                                        
| 2 | -$websitekey=basename(__DIR__);  | 
                                                        |
| 3 | -if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { require_once __DIR__.'/master.inc.php'; } // Load env if not already loaded | 
                                                        |
| 2 | +$websitekey = basename(__DIR__);  | 
                                                        |
| 3 | +if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { require_once __DIR__.'/master.inc.php'; } // Load env if not already loaded | 
                                                        |
| 4 | 4 | require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php';  | 
                                                        
| 5 | 5 | require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php';  | 
                                                        
| 6 | 6 | ob_start();  | 
                                                        
@@ -130,13 +130,13 @@  | 
                                                    ||
| 130 | 130 | |
| 131 | 131 | |
| 132 | 132 | // Cache or not  | 
                                                        
| 133 | -$cachestring = GETPOST("cache", 'aZ09');	// May be 1, or an int (delay in second of the cache if < 999999, or a timestamp), or a hash | 
                                                        |
| 133 | +$cachestring = GETPOST("cache", 'aZ09'); // May be 1, or an int (delay in second of the cache if < 999999, or a timestamp), or a hash | 
                                                        |
| 134 | 134 |  $cachedelay = GETPOSTINT('cachedelay') ? GETPOSTINT('cachedelay') : ((is_numeric($cachestring) && (int) $cachestring > 1 && (int) $cachestring < 999999) ? $cachestring : '3600'); | 
                                                        
| 135 | 135 |  if ($cachestring || image_format_supported($original_file) >= 0) { | 
                                                        
| 136 | 136 | // Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access.  | 
                                                        
| 137 | 137 |  	header('Cache-Control: max-age='.$cachedelay.', public, must-revalidate'); | 
                                                        
| 138 | 138 |  	header('Pragma: cache'); // This is to avoid having Pragma: no-cache | 
                                                        
| 139 | -	header('Expires: '.gmdate('D, d M Y H:i:s', time() + (int) $cachedelay).' GMT');	// This is to avoid to have Expires set by proxy or web server | 
                                                        |
| 139 | +	header('Expires: '.gmdate('D, d M Y H:i:s', time() + (int) $cachedelay).' GMT'); // This is to avoid to have Expires set by proxy or web server | 
                                                        |
| 140 | 140 | }  | 
                                                        
| 141 | 141 | |
| 142 | 142 | $refname = basename(dirname($original_file)."/");  | 
                                                        
@@ -1,6 +1,6 @@  | 
                                                    ||
| 1 | 1 | <?php // BEGIN PHP  | 
                                                        
| 2 | -$websitekey=basename(__DIR__);  | 
                                                        |
| 3 | -if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { require_once __DIR__.'/master.inc.php'; } // Load env if not already loaded | 
                                                        |
| 2 | +$websitekey = basename(__DIR__);  | 
                                                        |
| 3 | +if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { require_once __DIR__.'/master.inc.php'; } // Load env if not already loaded | 
                                                        |
| 4 | 4 | require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php';  | 
                                                        
| 5 | 5 | require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php';  | 
                                                        
| 6 | 6 | ob_start();  |