Merge branch 'develop' of github.com:Dolibarr/dolibarr into develop

This commit is contained in:
Laurent Destailleur
2024-08-20 04:19:17 +02:00
1498 changed files with 23551 additions and 12816 deletions

View File

@@ -205,7 +205,7 @@ function getMultidirVersion($object, $module = '', $forobject = 0)
/**
* Return dolibarr global constant string value
* Return a Dolibarr global constant string value
*
* @param string $key Key to return value, return $default if not set
* @param string|int|float $default Value to return if not defined
@@ -222,9 +222,9 @@ function getDolGlobalString($key, $default = '')
* Return a Dolibarr global constant int value.
* The constants $conf->global->xxx are loaded by the script master.inc.php included at begin of any PHP page.
*
* @param string $key key to return value, return 0 if not set
* @param int $default value to return
* @return int
* @param string $key Key to return value, return $default if not set
* @param int $default Value to return if not defined
* @return int Value returned
* @see getDolUserInt()
*/
function getDolGlobalInt($key, $default = 0)
@@ -233,6 +233,20 @@ function getDolGlobalInt($key, $default = 0)
return (int) (isset($conf->global->$key) ? $conf->global->$key : $default);
}
/**
* Return a Dolibarr global constant boolean value.
* The constants $conf->global->xxx are loaded by the script master.inc.php included at begin of any PHP page.
*
* @param string $key Key to return value, return $default if not set
* @param bool $default Value to return if not defined
* @return bool Value returned
*/
function getDolGlobalBool($key, $default = false)
{
global $conf;
return (bool) ($conf->global->$key ?? $default);
}
/**
* Return Dolibarr user constant string value
*
@@ -2206,9 +2220,8 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename =
}
if (!empty($message)) {
// Test log level
// @phan-suppress-next-line PhanPluginDuplicateArrayKey
$logLevels = array(LOG_EMERG => 'EMERG', LOG_ALERT => 'ALERT', LOG_CRIT => 'CRITICAL', LOG_ERR => 'ERR', LOG_WARNING => 'WARN', LOG_NOTICE => 'NOTICE', LOG_INFO => 'INFO', LOG_DEBUG => 'DEBUG');
// Test log level @phan-ignore-next-line PhanPluginDuplicateArrayKey
$logLevels = array(LOG_EMERG => 'EMERG', LOG_ALERT => 'ALERT', LOG_CRIT => 'CRITICAL', LOG_ERR => 'ERR', LOG_WARNING => 'WARN', LOG_NOTICE => 'NOTICE',LOG_INFO => 'INFO', LOG_DEBUG => 'DEBUG');
if (!array_key_exists($level, $logLevels)) {
throw new Exception('Incorrect log level');
}
@@ -3417,7 +3430,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
$smin = (!empty($reg[5]) ? $reg[5] : '');
$ssec = (!empty($reg[6]) ? $reg[6] : '');
$time = dol_mktime($shour, $smin, $ssec, $smonth, $sday, $syear, true);
$time = dol_mktime((int) $shour, (int) $smin, (int) $ssec, (int) $smonth, (int) $sday, (int) $syear, true);
if ($to_gmt) {
$tzo = new DateTimeZone('UTC'); // when to_gmt is true, base for offsettz and offsetdst (so timetouse) is UTC
@@ -4530,8 +4543,8 @@ function dol_user_country()
* Format address string
*
* @param string $address Address string, already formatted with dol_format_address()
* @param int $htmlid Html ID (for example 'gmap')
* @param int $element 'thirdparty'|'contact'|'member'|'user'|'other'
* @param string $htmlid Html ID (for example 'gmap')
* @param string $element 'thirdparty'|'contact'|'member'|'user'|'other'
* @param int $id Id of object
* @param int $noprint No output. Result is the function return
* @param string $charfornl Char to use instead of nl2br. '' means we use a standad nl2br.