task #9747: Can show content of external calendar (ical) into agenda

This commit is contained in:
Juanjo Menent 2011-06-08 13:15:53 +00:00
parent 7ae2b6e35b
commit e813448bb9
2 changed files with 3 additions and 16 deletions

View File

@ -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 '<td width="180">'.$langs->trans("Parameter")."</td>";
print "<td>".$langs->trans("Value")."</td>";
print "</tr>";
// Timezone
print "<tr ".$bc[$var].">";
print "<td>".$langs->trans("ClientTZ")."</td>";
print "<td>";
print $formadmin->select_timezone($conf->global->AGENDA_EXT_TIMEZONE,'agenda_ext_timezone');
print "</td>";
print "</tr>";
// Nb of agenda
$var=!$var;
print "<tr ".$bc[$var].">";

View File

@ -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='<b>'.$icalevent[SUMMARY].'</b><br>'.str_replace("\\n", "<br>", "$icalevent[DESCRIPTION]");
//$event->fulldayevent=$obj->fulldayevent;