From d4edb471a8449e8579f14a9c5a669b9cef47e328 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 24 Dec 2024 11:57:59 +0100 Subject: [PATCH 1/3] fix: warning in monthly agenda when user have no color and AGENDA_NO_TRANSPARENT_ON_NOT_BUSY=1 --- htdocs/comm/action/index.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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)); From c4255f6a8c7c24203212491bf3fbf9608a6a8697 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 24 Dec 2024 12:58:46 +0100 Subject: [PATCH 2/3] fix: warning in monthly agenda when user have no color and AGENDA_NO_TRANSPARENT_ON_NOT_BUSY=1 --- htdocs/comm/action/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 44f51e14b30f5..eb47132692ba3 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1967,7 +1967,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa } 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'))) { + } elseif (getDolGlobalString('THEME_ELDY_BACKBODY')) { require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $color = colorArrayToHex(explode(',', getDolGlobalString('THEME_ELDY_BACKBODY'))); } else { From 3571e645468a8d8410024756801f9aab6f68d70b Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 24 Dec 2024 16:02:43 +0100 Subject: [PATCH 3/3] fix: warning undefined var --- htdocs/comm/action/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 30c71c6e01a8b..7f7da4ee7c7e3 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -123,6 +123,7 @@ // Load object if ($id > 0 && $action != 'add') { $ret = $object->fetch($id); + $ret1 = 0; if ($ret > 0) { $ret = $object->fetch_optionals(); $ret1 = $object->fetch_userassigned();