Ignore:
Timestamp:
12/17/12 14:22:24 (11 years ago)
Author:
cristiano
Message:

Ticket #3239 - Inconsistência na importação de eventos com repetição

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/prototype/services/iCal.php

    r7579 r7660  
    11<?php 
    22 
    3 require_once ROOTPATH . '/plugins/icalcreator/iCalUtilityFunctions.class.php'; 
     3//require_once ROOTPATH . '/plugins/icalcreator/iCalUtilityFunctions.class.php'; 
    44require_once ROOTPATH . '/plugins/icalcreator/iCalcreator.class.php'; 
    55require_once ROOTPATH . '/modules/calendar/constants.php'; 
     
    3131    protected function createIcal($data, $params = false ) 
    3232    { 
    33         $ical = new icalCreator(); 
     33        $ical = new vcalendar(); 
    3434                $ical->setProperty('method', isset($params['method']) ? $params['method'] : 'PUBLISH' ); 
    3535 
     
    136136                   $date = $r->next(); 
    137137 
    138                     $timezone = &$ical->newComponent('vtimezone'); 
     138                    $timezone = $ical->newComponent('vtimezone'); 
    139139                    $timezone->setProperty('tzid',$apTimezone ); 
    140140 
    141                     $standard  = &$timezone->newComponent( "standard" ); 
     141                    $standard  = $timezone->newComponent( "standard" ); 
    142142                    $standard->setProperty( "tzoffsetfrom", $timezoneDayligth['standardFrom'] ); 
    143143                    $standard->setProperty( "tzoffsetto", $timezoneDayligth['standardTo'] ); 
     
    154154                    $standard->setProperty('rrule', $rrule); 
    155155 
    156                     $daylight  = &$timezone->newComponent( "daylight" ); 
     156                    $daylight  = $timezone->newComponent( "daylight" ); 
    157157 
    158158                    $daylight->setProperty( "tzoffsetfrom", $timezoneDayligth['daylightFrom'] ); 
     
    261261    protected function createCompatibleIcal($data, $params = false ) 
    262262    { 
    263         $ical = new icalCreator(); 
     263        $ical = new vcalendar(); 
    264264                $ical->setProperty('method', isset($params['method']) ? $params['method'] : 'PUBLISH' ); 
    265265 
     
    527527    public function parse($data, $params = false) { 
    528528        Config::regSet('noAlarm', TRUE); //Evita o envio de notificação 
    529         $vcalendar = new icalCreator( ); 
     529        $vcalendar = new vcalendar( ); 
    530530        $vcalendar->parse(trim($data)); 
    531531        $vcalendar->sort(); 
     
    11681168 
    11691169    public function analize($data, $params = false) { 
    1170         $vcalendar = new icalCreator( ); 
     1170        $vcalendar = new vcalendar( ); 
    11711171        $vcalendar->parse(trim($data)); 
    11721172        $vcalendar->sort(); 
     
    16111611            $repeat = array(); 
    16121612            $repeat['schedulable'] = $eventID; 
    1613             foreach ($rrule as $i => $v) { 
     1613            $repeat['startTime'] = $schedulable['startTime']; 
     1614            foreach ($rrule as $i => $v) { 
    16141615                if (strtolower($i) == 'freq') 
    16151616                    $repeat['frequency'] = $v; 
    16161617                else if (strtolower($i) == 'until') 
    1617                     $repeat['endTime'] = $v; 
     1618            { 
     1619                $repeat['endTime'] = strtotime($v['year'].'-'.$v['month'].'-'.$v['day'].' '.$v['hour'].':'.$v['min'].':'.$v['sec'].' '.$v['tz']) .'000' ; 
     1620            } 
    16181621                else 
    16191622                    $repeat[strtolower($i)] = $v; 
     
    16221625            $interation['repeat://' . $repeatID] = $repeat; 
    16231626        } 
    1624  
    16251627 
    16261628        $schedulable['calendar'] = $params['calendar']; 
Note: See TracChangeset for help on using the changeset viewer.