Changeset 2654 for branches/2.0
- Timestamp:
- 04/28/10 16:57:18 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0/calendar/inc/class.boicalendar.inc.php
r678 r2654 1275 1275 if($this->line < count($ical_text)) 1276 1276 { 1277 $str = str_replace("\r\n",'',$ical_text[$this->line]); 1277 $str = str_replace(array("\r\n","\r","\n"), '', $ical_text[$this->line]); 1278 1278 1279 $this->line = $this->line + 1; 1279 1280 while(ereg("^[[:space:]]",$ical_text[$this->line])) … … 1282 1283 $this->line = $this->line + 1; 1283 1284 } 1285 // Corrige a codificacao dos caracteres 1286 $str = utf8_decode ( trim ($str) ); 1284 1287 $this->debug("LINE : ".$str); 1285 1288 return $str; … … 1405 1408 function parse_parameters(&$event,$majortype,$value) 1406 1409 { 1410 $this->debug ('value: '.$value); 1407 1411 if(!ereg('[\=\;]',$value)) 1408 1412 { … … 1451 1455 } 1452 1456 } 1457 1458 $this->debug('parse_parameters array return_value: '._debug_array($return_value,False)); 1453 1459 1454 1460 for($i=0;$i<count($return_value);$i++) … … 1528 1534 if($this->property[$majortype][$mode]['multiples']) 1529 1535 { 1530 $this->debug( _debug_array($var,False));1536 $this->debug('parse_value var array: '._debug_array($var,False)); 1531 1537 $event[$majortype][] = $var; 1532 1538 } … … 1540 1546 $t_var = $var[$majortype]; 1541 1547 unset($var[$majortype]); 1542 reset($t_var); 1543 while(list($key,$val) = each($t_var)) 1544 { 1545 $var[$key] = $val; 1546 } 1547 $this->debug($majortype.' : '._debug_array($var,False)); 1548 if ( $t_var ) 1549 { 1550 reset($t_var); 1551 while(list($key,$val) = each($t_var)) 1552 { 1553 $var[$key] = $val; 1554 } 1555 $this->debug($majortype.' : '._debug_array($var,False)); 1556 } 1548 1557 } 1549 1558 $this->set_var($event,$majortype,$var); … … 2260 2269 function switch_partstat($var) 2261 2270 { 2262 // $this->debug_str = True;2263 2271 $this->debug('PARTSTAT = '.$var); 2264 // $this->debug_str = False;2265 2272 if(is_string($var)) 2266 2273 { … … 2567 2574 2568 2575 ereg($property_regexp,$text,$temp); 2576 $this->debug ('Majortype dump: '._debug_array($temp, false) ); 2569 2577 $majortype = str_replace('-','_',strtolower($temp[1])); 2570 2578 $value = chop($temp[2]); … … 2767 2775 elseif($state == 'optional' || $state == 'required') 2768 2776 { 2769 $this->debug('Mode : '.$mode.' Majortype : '.$majortype );2777 $this->debug('Mode : '.$mode.' Majortype : '.$majortype . ' Type : '.$type); 2770 2778 if($do_to_text) 2771 2779 { … … 3016 3024 break; 3017 3025 } 3026 $this->debug ('ical parse result: ' . _debug_array ($ical, false)); 3018 3027 $c_events = count($ical['event']); 3019 3028 for($i=0;$i<$c_events;$i++) … … 3056 3065 $so_event->set_ex_participants($ical['event'][$i]['ex_participants']['value']); 3057 3066 } 3067 // Compatibilidade com agendamentos vindos do outlook/exchange 3068 if ( isset ($ical['event'][$i]['attendee']) ) 3069 { 3070 $c_attendees = count($ical['event'][$i]['attendee']); 3071 $all_attendees = ''; 3072 for ( $a=0; $a < $c_attendees; $a++ ) 3073 { 3074 $cname = '"'. $ical['event'][$i]['attendee'][$a]['cn'] .'"'; 3075 $email = $ical['event'][$i]['attendee'][$a]['mailto']['user']; 3076 if ( $email ) 3077 $email = '<'. $email .'@'. $ical['event'][$i]['attendee'][$a]['mailto']['host'] .'>'; 3078 else 3079 $email = ''; 3080 3081 $all_attendees .= $cname . $email .', '; 3082 } 3083 $this->debug ('All attendees: ' . $all_attendees); 3084 $so_event->set_ex_participants($all_attendees); 3085 } 3086 3058 3087 if($ical['event'][$i]['location']['value']) 3059 3088 { … … 3296 3325 else 3297 3326 { 3298 //owner 3327 $so_event->add_attribute('participants','A',(int)$GLOBALS['phpgw_info']['user']['account_id']); 3299 3328 } 3300 3329 … … 3585 3614 if($this->debug_str) 3586 3615 { 3587 echo $str."<br>\n"; 3616 //echo $str."<br>\n"; 3617 $log = fopen('/tmp/calendar.log', 'a') or die("nao foi possivel abrir o arquivo /tmp/calendar.log"); 3618 fwrite($log, $str . "\n"); 3619 fclose($log); 3588 3620 } 3589 3621 }
Note: See TracChangeset
for help on using the changeset viewer.