- Timestamp:
- 03/28/12 18:01:34 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/calendar/inc/class.bocalendar.inc.php
r5399 r5845 2939 2939 $importAccount['mail'] = $GLOBALS['phpgw_info']['user']['email']; 2940 2940 2941 2941 if(!is_array($event_arrays)) 2942 2942 return null; 2943 2943 … … 2949 2949 2950 2950 //$offset = ((int)substr(date('O',$GLOBALS['phpgw']->datetime->users_localtime), 0, 3)); 2951 $offset = (($GLOBALS['phpgw']->datetime->tz_offset)/60)/60; 2952 2951 2952 //Recupera o offset do cliente com base na diferenca entre o horario do cliente (timezone da preferencia) 2953 //e o unixtime 2954 //$offset = ((($GLOBALS['phpgw']->datetime->users_localtime) - ($GLOBALS['phpgw']->datetime->gmtnow))/60)/60; 2955 2956 $timezone = date('e'); 2957 2953 2958 foreach ($event_arrays as $event_array) 2954 2959 { … … 2956 2961 $sm = $event_array['start']['month']; 2957 2962 $sd = $event_array['start']['mday']; 2958 $sh = $event_array['start']['hour'] -= $offset;2963 $sh = $event_array['start']['hour']; 2959 2964 $sn = $event_array['start']['min']; 2960 $dtstart = sprintf("%04d%02d%02dT%02d%02d00 Z", $sy, $sm, $sd, $sh, $sn);2965 $dtstart = sprintf("%04d%02d%02dT%02d%02d00", $sy, $sm, $sd, $sh, $sn); 2961 2966 2962 2967 $ey = $event_array['end']['year']; 2963 2968 $em = $event_array['end']['month']; 2964 2969 $ed = $event_array['end']['mday']; 2965 $eh = $event_array['end']['hour'] -= $offset;2970 $eh = $event_array['end']['hour']; 2966 2971 $en = $event_array['end']['min']; 2967 $dtend = sprintf("%04d%02d%02dT%02d%02d00 Z", $ey, $em, $ed, $eh, $en);2972 $dtend = sprintf("%04d%02d%02dT%02d%02d00", $ey, $em, $ed, $eh, $en); 2968 2973 2969 2974 // Necessário espaços após quebra-de-linha, na descrição, caso contrário … … 2972 2977 $tmpattach.="BEGIN:VEVENT\r\n"; 2973 2978 2974 2975 2979 if(isset($event_array['organizer']) && $event_array['owner'] != -2) 2980 { 2976 2981 $ldap = $this->getLdap(); 2977 2982 $justthese = array("mail","cn"); … … 2979 2984 $search = ldap_search($ldap, $GLOBALS['phpgw_info']['server']['ldap_context'], $filter, $justthese); 2980 2985 $entry = ldap_get_entries($ldap, $search); 2981 2982 2983 2984 2985 2986 $organizer = 'ORGANIZER;CN='.$entry[0]['cn'][0].':mailto:'.$entry[0]['mail'][0]."\r\n"; 2987 } 2988 else{ 2989 $email = explode('<', $event_array['organizer']); 2990 $email2 = explode('>', $email[1]); 2986 2991 $organizer = 'ORGANIZER;CN='.rtrim($email[0]).':mailto:'.$email2[0]."\r\n"; 2987 2992 } … … 2989 2994 if(!$externo) 2990 2995 { 2991 2992 "DTSTART :".$dtstart."\r\n"2993 ."DTEND :".$dtend."\r\n"2996 $tmpattach.= 2997 "DTSTART;TZID=".$timezone.":".$dtstart."\r\n" 2998 ."DTEND;TZID=".$timezone.":".$dtend."\r\n" 2994 2999 ."LAST-MODIFIED:".gmdate("Ymd\THis\Z")."\r\n" //Hora no formato UTC 2995 3000 .$organizer 2996 3001 ."UID:".$event_array['uid']."\r\n" 2997 2998 3002 .$this->mb_wordwrap($this->getvCalendarParticipants($event_array['participants'],$event_array['id']),74,"\r\n ") 3003 .$this->mb_wordwrap($this->getvCalendarExternalParticipants($event_array['id']),74,"\r\n ") 2999 3004 ."DESCRIPTION:".$description."\r\n" 3000 3005 ."SUMMARY:".$event_array['title']."\r\n" … … 3004 3009 else 3005 3010 { 3006 3007 "DTSTART :".$dtstart."\r\n"3008 ."DTEND :".$dtend."\r\n"3011 $tmpattach.= 3012 "DTSTART;TZID=".$timezone.":".$dtstart."\r\n" 3013 ."DTEND;TZID=".$timezone.":".$dtend."\r\n" 3009 3014 ."DTSTAMP:".gmdate("Ymd\THis\Z")."\r\n" //Hora no formato UTC 3010 3015 .$organizer … … 3042 3047 3043 3048 } 3044 $tmpattach.="END:VCALENDAR\r\n\r\n\r\n"; 3049 $tmpattach.="END:VCALENDAR\r\n\r\n\r\n"; 3045 3050 return $tmpattach; 3046 3051 }
Note: See TracChangeset
for help on using the changeset viewer.