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

This commit is contained in:
Laurent Destailleur
2025-11-18 11:38:31 +01:00
70 changed files with 1055 additions and 622 deletions

View File

@@ -297,6 +297,17 @@ function getDolCurrency()
return (string) $conf->currency;
}
/**
* Return the default context page string
*
* @param string $s Page path
* @return string Value returned
*/
function getDolDefaultContextPage($s)
{
return str_replace('_', '', basename(dirname($s)).basename($s, '.php'));
}
/**
* Return Dolibarr user constant string value
*
@@ -3799,7 +3810,13 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
$offsettzstring = (empty($_SESSION['dol_tz_string']) ? 'UTC' : $_SESSION['dol_tz_string']); // Example 'Europe/Berlin' or 'Indian/Reunion'
if (class_exists('DateTimeZone')) {
$user_date_tz = new DateTimeZone($offsettzstring);
try {
$user_date_tz = new DateTimeZone($offsettzstring);
} catch (Exception $e) {
// Bad value for $offsettzstring
dol_syslog("DateInvalidTimeZoneException for timezone string '".$offsettzstring."'. Falling back to UTC.", LOG_ERR);
$user_date_tz = new DateTimeZone('UTC'); // Force valid timezone as UTC
}
$user_dt = new DateTime();
$user_dt->setTimezone($user_date_tz);
$user_dt->setTimestamp($tzoutput == 'tzuser' ? dol_now() : (int) $time);