2
0
forked from Wavyzz/dolibarr

Clean code

This commit is contained in:
Laurent Destailleur
2023-10-15 15:32:35 +02:00
parent 2c5809e77b
commit 1f38e54e78
190 changed files with 696 additions and 680 deletions

View File

@@ -1849,7 +1849,7 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename =
// If adding log inside HTML page is required
if ((!empty($_REQUEST['logtohtml']) && !empty($conf->global->MAIN_ENABLE_LOG_TO_HTML))
|| (!empty($user->rights->debugbar->read) && is_object($debugbar))) {
|| ($user->hasRight('debugbar', 'read') && is_object($debugbar))) {
$conf->logbuffer[] = dol_print_date(time(), "%Y-%m-%d %H:%M:%S")." ".$logLevels[$level]." ".$message;
}
@@ -2277,7 +2277,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
$showimage = 1;
$entity = (empty($object->entity) ? $conf->entity : $object->entity);
$showbarcode = empty($conf->barcode->enabled) ? 0 : (empty($object->barcode) ? 0 : 1);
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->lire_advance)) {
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->hasRight('barcode', 'lire_advance')) {
$showbarcode = 0;
}
$modulepart = 'unknown';
@@ -4556,9 +4556,9 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
}
if (!empty($conf->global->MAIN_OVERWRITE_THEME_PATH)) {
$path = $conf->global->MAIN_OVERWRITE_THEME_PATH.'/theme/'.$theme; // If the theme does not have the same name as the module
$path = getDolGlobalString('MAIN_OVERWRITE_THEME_PATH') . '/theme/'.$theme; // If the theme does not have the same name as the module
} elseif (!empty($conf->global->MAIN_OVERWRITE_THEME_RES)) {
$path = $conf->global->MAIN_OVERWRITE_THEME_RES.'/theme/'.$conf->global->MAIN_OVERWRITE_THEME_RES; // To allow an external module to overwrite image resources whatever is activated theme
$path = getDolGlobalString('MAIN_OVERWRITE_THEME_RES') . '/theme/' . getDolGlobalString('MAIN_OVERWRITE_THEME_RES'); // To allow an external module to overwrite image resources whatever is activated theme
} elseif (!empty($conf->modules_parts['theme']) && array_key_exists($theme, $conf->modules_parts['theme'])) {
$path = $theme.'/theme/'.$theme; // If the theme have the same name as the module
}
@@ -9993,7 +9993,7 @@ function printCommonFooter($zone = 'private')
$reshook = $hookmanager->executeHooks('printCommonFooter', $parameters); // Note that $action and $object may have been modified by some hooks
if (empty($reshook)) {
if (!empty($conf->global->MAIN_HTML_FOOTER)) {
print $conf->global->MAIN_HTML_FOOTER."\n";
print getDolGlobalString('MAIN_HTML_FOOTER') . "\n";
}
print "\n";
@@ -10106,7 +10106,7 @@ function printCommonFooter($zone = 'private')
print "/* JS CODE TO ENABLE to add memory info */\n";
print 'window.console && console.log("';
if (!empty($conf->global->MEMCACHED_SERVER)) {
print 'MEMCACHED_SERVER='.$conf->global->MEMCACHED_SERVER.' - ';
print 'MEMCACHED_SERVER=' . getDolGlobalString('MEMCACHED_SERVER').' - ';
}
print 'MAIN_OPTIMIZE_SPEED='.(isset($conf->global->MAIN_OPTIMIZE_SPEED) ? $conf->global->MAIN_OPTIMIZE_SPEED : 'off');
if (!empty($micro_start_time)) { // Works only if MAIN_SHOW_TUNING_INFO is defined at $_SERVER level. Not in global variable.
@@ -10156,7 +10156,7 @@ function printCommonFooter($zone = 'private')
}
// Add DebugBar data
if (!empty($user->rights->debugbar->read) && is_object($debugbar)) {
if ($user->hasRight('debugbar', 'read') && is_object($debugbar)) {
$debugbar['time']->stopMeasure('pageaftermaster');
print '<!-- Output debugbar data -->'."\n";
$renderer = $debugbar->getRenderer();