diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 6f24008c7ad3d..44f51e14b30f5 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1965,9 +1965,14 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $nextindextouse++; // Prepare to use next color } } - //print '|'.($color).'='.($idusertouse?$idusertouse:0).'='.$colorindex.'
'; - // Define color // @suppress-next-line PhanPluginPrintfIncompatibleArgumentType - $color = sprintf("%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]); + if (isset($theme_datacolor[$colorindex])) { + $color = sprintf("%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]); + } elseif (!empty(getDolGlobalString('THEME_ELDY_BACKBODY'))) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + $color = colorArrayToHex(explode(',', getDolGlobalString('THEME_ELDY_BACKBODY'))); + } else { + $color = "ffffff"; + } } $cssclass = $cssclass.' eventday_'.$ymd; @@ -2339,7 +2344,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa function dol_color_minus($color, $minus, $minusunit = 16) { $newcolor = $color; - if ($minusunit == 16) { + if ($minusunit == 16 && is_array($newcolor)) { $newcolor[0] = dechex(max(min(hexdec($newcolor[0]) - $minus, 15), 0)); $newcolor[2] = dechex(max(min(hexdec($newcolor[2]) - $minus, 15), 0)); $newcolor[4] = dechex(max(min(hexdec($newcolor[4]) - $minus, 15), 0));