Changeset 60 for trunk/calendar


Ignore:
Timestamp:
08/21/07 17:28:27 (17 years ago)
Author:
niltonneto
Message:

* empty log message *

Location:
trunk/calendar/inc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/calendar/inc/class.boicalendar.inc.php

    r15 r60  
    28302830                } 
    28312831 
    2832                 function build_ical($ical) 
    2833                 { 
    2834                         $var = Array( 
    2835                                 'timezone', 
    2836                                 'event', 
    2837                                 'todo', 
    2838                                 'journal', 
    2839                                 'freebusy' 
    2840                         ); 
    2841  
    2842                         $str = 'BEGIN:VCALENDAR'."\r\n"; 
    2843                         $str .= $this->fold('PRODID'.$this->build_text($ical['prodid'],'prodid')); 
    2844                         $str .= $this->fold('VERSION'.$this->build_text($ical['version'],'version')); 
    2845                         $str .= $this->fold('METHOD'.$this->build_text($ical['method'],'method')); 
    2846                         foreach($var as $vtype) 
    2847                         { 
    2848                                 if($ical[$vtype]) 
    2849                                 { 
    2850                                         for($i=0;$i<count($ical[$vtype]);$i++) 
    2851                                         { 
    2852                                                 $str .= 'BEGIN:V'.strtoupper($vtype)."\r\n"; 
    2853                                                 $str .= $this->build_card_internals('v'.$vtype,$ical[$vtype][$i]); 
    2854                                                 $str .= 'END:V'.strtoupper($vtype)."\r\n"; 
    2855                                         } 
    2856                                 } 
    2857                         } 
    2858                         $str .= 'END:VCALENDAR'."\r\n"; 
    2859  
    2860                         return $str; 
    2861                 } 
    28622832 
    28632833                function switch_to_phpgw_status($partstat) 
  • trunk/calendar/inc/class.uiicalendar.inc.php

    r2 r60  
    7676                } 
    7777 
    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  
    16678                function import() 
    16779                { 
Note: See TracChangeset for help on using the changeset viewer.