Changeset 60 for trunk/calendar/inc/class.uiicalendar.inc.php
- Timestamp:
- 08/21/07 17:28:27 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/calendar/inc/class.uiicalendar.inc.php
r2 r60 76 76 } 77 77 78 function test()79 {80 $print_events = True;81 82 unset($GLOBALS['phpgw_info']['flags']['noheader']);83 unset($GLOBALS['phpgw_info']['flags']['nonavbar']);84 $GLOBALS['phpgw']->common->phpgw_header();85 86 echo "Start Time : ".$GLOBALS['phpgw']->common->show_date()."<br>\n";87 @set_time_limit(0);88 89 $icsfile=PHPGW_APP_INC.'/events.ics';90 $fp=fopen($icsfile,'rt');91 $contents = explode("\n",fread($fp, filesize($icsfile)));92 fclose($fp);93 94 $vcalendar = $this->bo->parse($contents);95 96 if($print_events)97 {98 $this->print_test($vcalendar['prodid'],'Product ID');99 $this->print_test($vcalendar['method'],'Method');100 $this->print_test($vcalendar['version'],'Version');101 102 for($i=0;$i<count($vcalendar['event']);$i++)103 {104 $event = $vcalendar['event'][$i];105 106 echo "<br>\nEVENT<br>\n";107 // echo 'TEST Debug : '._debug_array($event,False)."<br>\n";108 $this->print_test($event['uid'],'UID','X-');109 $this->print_test($event['valscale'],'Calscale','X-');110 $this->print_test($event['description'],'Description','X-');111 $this->print_test($event['summary'],'Summary','X-');112 $this->print_test($event['comment'],'Comment','X-');113 $this->print_test($event['location'],'Location','X-');114 $this->print_test($event['sequence'],'Sequence','X-');115 $this->print_test($event['priority'],'Priority','X-');116 $this->print_test($event['categories'],'Categories','X-');117 $this->print_test($event['dtstart'],'Date Start','X-');118 $this->print_test($event['dtstamp'],'Date Stamp','X-');119 $this->print_test($event['rrule'],'Recurrence','X-');120 121 echo "Class = ".$this->bo->switch_class($event['class'])."<br>\n";122 123 $this->print_test($event['organizer'],'Organizer','X-');124 $this->print_test($event['attendee'],'Attendee','X-');125 $this->print_test($event['x_type'],'X-Type','X-');126 $this->print_test($event['alarm'],'Alarm','X-');127 }128 }129 130 /*131 for($i=0;$i<count($vcalendar->todo);$i++)132 {133 echo "<br>\nTODO<br>\n";134 if($vcalendar['todo'][$i]['summary']['value'])135 {136 echo "Summary = ".$vcalendar['todo'][$i]['summary']['value']."<br>\n";137 }138 if($vcalendar['todo'][$i]['description']['value'])139 {140 echo "Description (Value) = ".$vcalendar['todo'][$i]['description']['value']."<br>\n";141 }142 if($vcalendar['todo'][$i]['description']['altrep'])143 {144 echo "Description (Alt Rep) = ".$vcalendar['todo'][$i]['description']['altrep']."<br>\n";145 }146 if($vcalendar['todo'][$i]['location']['value'])147 {148 echo "Location = ".$vcalendar['todo'][$i]['location']['value']."<br>\n";149 }150 echo "Sequence = ".$vcalendar['todo'][$i]['sequence']."<br>\n";151 echo "Date Start : ".$GLOBALS['phpgw']->common->show_date(mktime($vcalendar['todo'][$i]['dtstart']['hour'],$vcalendar['todo'][$i]['dtstart']['min'],$vcalendar['todo'][$i]['dtstart']['sec'],$vcalendar['todo'][$i]['dtstart']['month'],$vcalendar['todo'][$i]['dtstart']['mday'],$vcalendar['todo'][$i]['dtstart']['year']) - $this->datatime->tz_offset)."<br>\n";152 echo "Class = ".$vcalendar['todo'][$i]['class']['value']."<br>\n";153 }154 155 */156 include(PHPGW_APP_INC.'/../setup/setup.inc.php');157 158 $this->bo->set_var($vcalendar['prodid'],'value','-//phpGroupWare//phpGroupWare '.$setup_info['calendar']['version'].' MIMEDIR//'.strtoupper($GLOBALS['phpgw_info']['user']['preferences']['common']['lang']));159 $this->bo->set_var($vcalendar['version'],'value','2.0');160 $this->bo->set_var($vcalendar['method'],'value',strtoupper('publish'));161 echo "<br><br><br>\n";162 echo nl2br($this->bo->build_ical($vcalendar));163 echo "End Time : ".$GLOBALS['phpgw']->common->show_date()."<br>\n";164 }165 166 78 function import() 167 79 {
Note: See TracChangeset
for help on using the changeset viewer.