forked from Wavyzz/dolibarr
Fix php8
This commit is contained in:
@@ -279,13 +279,13 @@ while ($i <= $MAXAGENDA) {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
// Calendar active by default
|
// Calendar active by default
|
||||||
print '<td class="nowrap right">';
|
print '<td class="nowrap right">';
|
||||||
if ($conf->use_javascript_ajax) {
|
if (!empty($conf->use_javascript_ajax)) {
|
||||||
print ajax_constantonoff('AGENDA_EXT_ACTIVEBYDEFAULT' . $key);
|
print ajax_constantonoff('AGENDA_EXT_ACTIVEBYDEFAULT' . $key);
|
||||||
} else {
|
} else {
|
||||||
if (empty($conf->global->{$default})) {
|
if (getDolGlobalString($default)) {
|
||||||
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=set_AGENDA_EXT_ACTIVEBYDEFAULT' . $key . '&token='.newToken().'">' . img_picto($langs->trans("Enabled"), 'on') . '</a>';
|
|
||||||
} else {
|
|
||||||
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=del_AGENDA_EXT_ACTIVEBYDEFAULT' . $key . '&token='.newToken().'">' . img_picto($langs->trans("Disabled"), 'off') . '</a>';
|
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=del_AGENDA_EXT_ACTIVEBYDEFAULT' . $key . '&token='.newToken().'">' . img_picto($langs->trans("Disabled"), 'off') . '</a>';
|
||||||
|
} else {
|
||||||
|
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=set_AGENDA_EXT_ACTIVEBYDEFAULT' . $key . '&token='.newToken().'">' . img_picto($langs->trans("Enabled"), 'on') . '</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@@ -274,7 +274,7 @@ if (empty($conf->global->AGENDA_DISABLE_EXT)) {
|
|||||||
$color = 'AGENDA_EXT_COLOR'.$i;
|
$color = 'AGENDA_EXT_COLOR'.$i;
|
||||||
$default = 'AGENDA_EXT_ACTIVEBYDEFAULT'.$i;
|
$default = 'AGENDA_EXT_ACTIVEBYDEFAULT'.$i;
|
||||||
$buggedfile = 'AGENDA_EXT_BUGGEDFILE'.$i;
|
$buggedfile = 'AGENDA_EXT_BUGGEDFILE'.$i;
|
||||||
if (!empty($conf->global->$source) && !empty($conf->global->$name)) {
|
if (getDolGlobalString($source) && getDolGlobalString($name)) {
|
||||||
// Note: $conf->global->buggedfile can be empty or 'uselocalandtznodaylight' or 'uselocalandtzdaylight'
|
// Note: $conf->global->buggedfile can be empty or 'uselocalandtznodaylight' or 'uselocalandtzdaylight'
|
||||||
$listofextcals[] = array(
|
$listofextcals[] = array(
|
||||||
'src' => getDolGlobalString($source),
|
'src' => getDolGlobalString($source),
|
||||||
@@ -299,14 +299,14 @@ if (empty($user->conf->AGENDA_DISABLE_EXT)) {
|
|||||||
$enabled = 'AGENDA_EXT_ENABLED_'.$user->id.'_'.$i;
|
$enabled = 'AGENDA_EXT_ENABLED_'.$user->id.'_'.$i;
|
||||||
$default = 'AGENDA_EXT_ACTIVEBYDEFAULT_'.$user->id.'_'.$i;
|
$default = 'AGENDA_EXT_ACTIVEBYDEFAULT_'.$user->id.'_'.$i;
|
||||||
$buggedfile = 'AGENDA_EXT_BUGGEDFILE_'.$user->id.'_'.$i;
|
$buggedfile = 'AGENDA_EXT_BUGGEDFILE_'.$user->id.'_'.$i;
|
||||||
if (!empty($user->conf->$source) && !empty($user->conf->$name)) {
|
if (getDolUserString($source) && getDolUserString($name)) {
|
||||||
// Note: $conf->global->buggedfile can be empty or 'uselocalandtznodaylight' or 'uselocalandtzdaylight'
|
// Note: $conf->global->buggedfile can be empty or 'uselocalandtznodaylight' or 'uselocalandtzdaylight'
|
||||||
$listofextcals[] = array(
|
$listofextcals[] = array(
|
||||||
'src' => $user->conf->$source,
|
'src' => getDolUserString($source),
|
||||||
'name' => dol_string_nohtmltag($user->conf->$name),
|
'name' => dol_string_nohtmltag(getDolUserString($name)),
|
||||||
'offsettz' => (int) (empty($user->conf->$offsettz) ? 0 : $user->conf->$offsettz),
|
'offsettz' => (int) (empty($user->conf->$offsettz) ? 0 : $user->conf->$offsettz),
|
||||||
'color' => dol_string_nohtmltag($user->conf->$color),
|
'color' => dol_string_nohtmltag(getDolUserString($color)),
|
||||||
'default' => dol_string_nohtmltag($user->conf->$default),
|
'default' => dol_string_nohtmltag(getDolUserString($default)),
|
||||||
'buggedfile' => dol_string_nohtmltag(isset($user->conf->buggedfile) ? $user->conf->buggedfile : '')
|
'buggedfile' => dol_string_nohtmltag(isset($user->conf->buggedfile) ? $user->conf->buggedfile : '')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1287,7 +1287,7 @@ if (count($listofextcals)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Transparency (see https://www.kanzaki.com/docs/ical/transp.html)
|
// Transparency (see https://www.kanzaki.com/docs/ical/transp.html)
|
||||||
if ($icalevent['TRANSP']) {
|
if (!empty($icalevent['TRANSP'])) {
|
||||||
if ($icalevent['TRANSP'] == "TRANSPARENT") {
|
if ($icalevent['TRANSP'] == "TRANSPARENT") {
|
||||||
$event->transparency = 0; // 0 = available / free
|
$event->transparency = 0; // 0 = available / free
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,8 +73,9 @@ if (!function_exists('utf8_decode')) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return dolibarr global constant string value
|
* Return dolibarr global constant string value
|
||||||
* @param string $key key to return value, return '' if not set
|
*
|
||||||
* @param string $default value to return
|
* @param string $key key to return value, return '' if not set
|
||||||
|
* @param string $default value to return
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getDolGlobalString($key, $default = '')
|
function getDolGlobalString($key, $default = '')
|
||||||
@@ -86,8 +87,9 @@ function getDolGlobalString($key, $default = '')
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return dolibarr global constant int value
|
* Return dolibarr global constant int value
|
||||||
* @param string $key key to return value, return 0 if not set
|
*
|
||||||
* @param int $default value to return
|
* @param string $key key to return value, return 0 if not set
|
||||||
|
* @param int $default value to return
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function getDolGlobalInt($key, $default = 0)
|
function getDolGlobalInt($key, $default = 0)
|
||||||
@@ -97,8 +99,37 @@ function getDolGlobalInt($key, $default = 0)
|
|||||||
return (int) (empty($conf->global->$key) ? $default : $conf->global->$key);
|
return (int) (empty($conf->global->$key) ? $default : $conf->global->$key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return dolibarr user constant string value
|
||||||
|
*
|
||||||
|
* @param string $key key to return value, return '' if not set
|
||||||
|
* @param string $default value to return
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function getDolUserString($key, $default = '')
|
||||||
|
{
|
||||||
|
global $user;
|
||||||
|
// return $conf->global->$key ?? $default;
|
||||||
|
return (string) (empty($user->conf->$key) ? $default : $user->conf->$key);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return dolibarr user constant int value
|
||||||
|
*
|
||||||
|
* @param string $key key to return value, return 0 if not set
|
||||||
|
* @param int $default value to return
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
function getDolUserInt($key, $default = 0)
|
||||||
|
{
|
||||||
|
global $user;
|
||||||
|
// return $conf->global->$key ?? $default;
|
||||||
|
return (int) (empty($user->conf->$key) ? $default : $user->conf->$key);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Is Dolibarr module enabled
|
* Is Dolibarr module enabled
|
||||||
|
*
|
||||||
* @param string $module module name to check
|
* @param string $module module name to check
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user