From 9e0e6e13df1859c3da4c1bcbd01058fd8a46dbd8 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Wed, 1 Jun 2011 08:18:52 +0000 Subject: [PATCH] task #9747: Can show content of external calendar (ical) into agenda --- htdocs/comm/action/index.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 15d16dbff41..835e3501b87 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -506,10 +506,13 @@ if ($conf->global->ENABLE_AGENDA_EXT==1 && $conf->global->AGENDA_EXT_NB>0) $event=new ActionComm($db); $paramkey='AGENDA_EXT_NAME'.$i; $namecal = $conf->global->$paramkey; + $paramkey='AGENDA_EXT_COLOR'.$i; + $colorcal = $conf->global->$paramkey; $event->id=$namecal; $event->datep=$icalevent[DTSTART]; $event->datef=$icalevent[DTEND]; $event->type_code="ICALEVENT"; + $event->type_id = $colorcal; $event->libelle=''.$icalevent[SUMMARY].'
'.dol_nl2br($icalevent[DESCRIPTION],1,false); //$event->fulldayevent=$obj->fulldayevent; @@ -798,8 +801,10 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $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; - $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]); + if ($event->type_code == 'ICALEVENT') $color=$event->type_id; + else $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]); //print "x".$color; + print ''; print '
'; if ($event->type_code != 'BIRTHDAY')