From c61cba7b6b52abe18e11bd440dede2ee053d601b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 22 Jan 2012 13:10:59 +0100 Subject: [PATCH] Add a css different for each agenda --- htdocs/comm/action/index.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index d875269f4ef..7c7f79ad59a 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -969,15 +969,17 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa if ($i < $maxPrint || $maxPrint == 0) { $ponct=($event->date_start_in_calendar == $event->date_end_in_calendar); - // Show rect of event - $colorindex=0; - if ($event->author->id == $user->id || $event->usertodo->id == $user->id || $event->userdone->id == $user->id) $colorindex=1; - if ($event->type_code == 'BIRTHDAY') $colorindex=2; - if ($event->type_code == 'ICALEVENT') $color=$event->icalcolor; - else $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]); + + // Define $color and $cssclass of event + $color=-1; $cssclass=''; $colorindex=-1; + if ($event->author->id == $user->id || $event->usertodo->id == $user->id || $event->userdone->id == $user->id) { $colorindex=1; $cssclass='family_mytasks'; } + if ($event->type_code == 'ICALEVENT') { $color=$event->icalcolor; $cssclass=($event->icalname?'family_'.dol_string_nospecial($event->icalname):'family_other'); } + if ($event->type_code == 'BIRTHDAY') { $colorindex=2; $cssclass='family_birthday'; } + if ($color == -1) $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]); //print "x".$color; - print '
'; + // Show rect of event + print '
'; print ''; print '
'; if ($event->type_code == 'BIRTHDAY') // It's a birthday