task #9747: Can show content of external calendar (ical) into agenda
This commit is contained in:
parent
0dff6f1e80
commit
b58e81d186
@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -79,6 +80,10 @@ class ActionComm extends CommonObject
|
||||
var $facid;
|
||||
var $supplierorderrowid;
|
||||
var $supplierinvoicerowid;
|
||||
|
||||
// Ical
|
||||
var $icalname;
|
||||
var $icalcolor;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -508,12 +508,13 @@ if ($conf->global->ENABLE_AGENDA_EXT==1 && $conf->global->AGENDA_EXT_NB>0)
|
||||
$namecal = $conf->global->$paramkey;
|
||||
$paramkey='AGENDA_EXT_COLOR'.$i;
|
||||
$colorcal = $conf->global->$paramkey;
|
||||
$event->id=$namecal;
|
||||
$event->id=$icalevent[UID];
|
||||
$event->icalname=$namecal;
|
||||
$event->icalcolor=$colorcal;
|
||||
$event->datep=$icalevent[DTSTART];
|
||||
$event->datef=$icalevent[DTEND];
|
||||
$event->type_code="ICALEVENT";
|
||||
$event->type_id = $colorcal;
|
||||
$event->libelle='<b>'.$icalevent[SUMMARY].'</b><br>'.dol_nl2br($icalevent[DESCRIPTION],1,false);
|
||||
$event->libelle='<b>'.$icalevent[SUMMARY].'</b><br>'.str_replace("\\n", "<br>", "$icalevent[DESCRIPTION]");;
|
||||
//$event->fulldayevent=$obj->fulldayevent;
|
||||
|
||||
$event->date_start_in_calendar=$event->datep;
|
||||
@ -801,7 +802,7 @@ 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;
|
||||
if ($event->type_code == 'ICALEVENT') $color=$event->type_id;
|
||||
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]);
|
||||
//print "x".$color;
|
||||
|
||||
@ -848,7 +849,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
if ($tmpyearend == $annee && $tmpmonthend == $mois && $tmpdayend == $jour)
|
||||
print dol_print_date($event->date_end_in_calendar,'%H:%M');
|
||||
}
|
||||
if ($event->type_code == 'ICALEVENT') print '<br>('.$event->id.')';
|
||||
if ($event->type_code == 'ICALEVENT') print '<br>('.$event->icalname.')';
|
||||
print '<br>'."\n";
|
||||
}
|
||||
else
|
||||
|
||||
@ -315,7 +315,7 @@ function agenda_prepare_head()
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // In dev version only for the moment
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/agenda_extsites.php";
|
||||
$head[$h][1] = $langs->trans("Import");
|
||||
$head[$h][1] = $langs->trans("ExtSites");
|
||||
$head[$h][2] = 'extsites';
|
||||
$h++;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user