From e813448bb9950d8a5d8648400ada9bc6957c9bed Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Wed, 8 Jun 2011 13:15:53 +0000 Subject: [PATCH] task #9747: Can show content of external calendar (ical) into agenda --- htdocs/admin/agenda_extsites.php | 14 -------------- htdocs/comm/action/index.php | 5 +++-- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 9c977346010..c98e6e6ab2f 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -74,12 +74,6 @@ if ($actionsave) if (! $res > 0) $error++; $i++; } - - // Save timezone - $timezone=trim(GETPOST("agenda_ext_timezone")); - if ($timezone=='-1') $timezone=''; - $res=dolibarr_set_const($db,'AGENDA_EXT_TIMEZONE',$timezone,'chaine',0); - if (! $res > 0) $error++; // Save nb of agenda $res=dolibarr_set_const($db,'AGENDA_EXT_NB',trim(GETPOST("AGENDA_EXT_NB")),'chaine',0); if (! $res > 0) $error++; @@ -131,14 +125,6 @@ print ''.$langs->trans("Parameter").""; print "".$langs->trans("Value").""; print ""; -// Timezone -print ""; -print "".$langs->trans("ClientTZ").""; -print ""; -print $formadmin->select_timezone($conf->global->AGENDA_EXT_TIMEZONE,'agenda_ext_timezone'); -print ""; -print ""; - // Nb of agenda $var=!$var; print ""; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 536b9e5f7ca..2b81cb6d8df 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -511,8 +511,9 @@ if ($conf->global->ENABLE_AGENDA_EXT==1 && $conf->global->AGENDA_EXT_NB>0) $event->id=$icalevent[UID]; $event->icalname=$namecal; $event->icalcolor=$colorcal; - $event->datep=$icalevent[DTSTART]; - $event->datef=$icalevent[DTEND]; + $usertime=($_SESSION['dol_tz']*60*60)+($_SESSION['dol_dst']*60*60); + $event->datep=$icalevent[DTSTART]+$usertime; + $event->datef=$icalevent[DTEND]+$usertime; $event->type_code="ICALEVENT"; $event->libelle=''.$icalevent[SUMMARY].'
'.str_replace("\\n", "
", "$icalevent[DESCRIPTION]"); //$event->fulldayevent=$obj->fulldayevent;