コード例 #1
0
ファイル: index.php プロジェクト: remyyounes/dolibarr
	}
}

if (sizeof($listofextcals))
{
    require_once(DOL_DOCUMENT_ROOT."/comm/action/class/ical.class.php");
    foreach($listofextcals as $extcal)
    {
        $url=$extcal['src'];
        $namecal = $extcal['name'];
        $colorcal = $extcal['color'];
        //print "url=".$url." namecal=".$namecal." colorcal=".$colorcal;
        $ical=new ical();
        $ical->parse($url);
        $icalevents=array();
        if (is_array($ical->get_event_list())) $icalevents=array_merge($icalevents,$ical->get_event_list());
        if (is_array($ical->get_freebusy_list())) $icalevents=array_merge($icalevents,$ical->get_freebusy_list());

        if(count($icalevents)>0)
        {
            foreach($icalevents as $icalevent)
            {
                // Create a new object action
                $event=new ActionComm($db);
                $addevent = false;
                if($icalevent['DTSTART;VALUE=DATE']) //fullday event
                {
                    // For full day events, date are also GMT but they wont but converted using tz during output
                    $datestart=dol_stringtotime($icalevent['DTSTART;VALUE=DATE'],1);
                    $dateend=dol_stringtotime($icalevent['DTEND;VALUE=DATE'],1)-1;  // We remove one second to get last second of day
                    //print 'x'.$datestart.'-'.$dateend;exit;
コード例 #2
0
ファイル: cal.php プロジェクト: BackupTheBerlios/wikiplug
  Usage : {{cal src="http://mon.domai.ne/path/fichier.ics"}}

  **************************************************************************/
//on appele le fichier sans passer par wikini (pour l'appel ajax)
if (!defined("WIKINI_VERSION")) {
    $params['url'] = urldecode($_GET["url"]);
    $params['color'] = urldecode($_GET["color"]);
    $params['class'] = urldecode($_GET["class"]);
    $params['link'] = urldecode($_GET["link"]);
    include_once '../libs/ical.php';
    include_once '../libs/functions.ical.php';
} else {
    $params['url'] = $this->GetParameter("url");
    $params['color'] = $this->GetParameter("color");
    $params['class'] = $this->GetParameter("class");
    $params['link'] = $this->GetParameter("link");
    include_once 'tools/wikical/libs/ical.php';
    include_once 'tools/wikical/libs/functions.ical.php';
}
$cal = new ical();
$cal->parse($params['url']);
$data = $cal->get_event_list();
if (isset($_GET['timestamp'])) {
    $daytime = $_GET['timestamp'];
} else {
    $daytime = time();
}
$data = filterEvents(getMonthStartTS($daytime), getMonthEndTS($daytime), $data);
$data = makeMonth($daytime, $data);
printMonthCal($daytime, $data, $params);