Changeset 6034


Ignore:
Timestamp:
04/26/12 10:32:38 (12 years ago)
Author:
cristiano
Message:

Ticket #2640 - Erro calculo de data ao editar um evento

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/prototype/modules/calendar/interceptors/Notifications.php

    r6027 r6034  
    281281        else 
    282282            $ical = Config::regGet('ical://' . $schedulable['id'] . '/' . $method); 
    283  
     283         
     284        if (!is_numeric($schedulable['endTime'])) 
     285            $schedulable['startTime'] = self::parseTimeDate( $schedulable['startTime'], $schedulable['timezone'] ); 
     286         
     287        if (!is_numeric($schedulable['endTime'])){ 
     288            $schedulable['endTime'] =    self::parseTimeDate( $schedulable['endTime'], $schedulable['timezone'] );  
     289 
     290            if($schedulable['allDay']) 
     291                $schedulable['endTime'] =  $schedulable['endTime']  + 86400000; 
     292        } 
     293         
    284294        $timezone = new DateTimeZone('UTC'); 
    285295        $sTime = new DateTime('@' . (int) ($schedulable['startTime'] / 1000), $timezone); 
    286296        $eTime = new DateTime('@' . (int) ($schedulable['endTime'] / 1000), $timezone); 
    287  
     297         
    288298        if (isset($schedulable['timezone'])) { 
    289299            $sTime->setTimezone(new DateTimeZone($schedulable['timezone'])); 
     
    501511            $method = 'REQUEST'; 
    502512            $notificationType = 'Modificação de Calendario'; 
    503             $part = 'othersAttendees'; 
     513            $part = 'othersAttendees';     
    504514            self::mountStruture($uri['id'], $schedulable, false, $data, $subject, $ical, $part, $method, $notificationType); 
    505515 
     
    508518        } 
    509519    } 
    510  
    511 } 
     520     
     521   static private function parseTimeDate($time, $timezone){ 
     522        return strtotime( $time . ' ' .$timezone).'000';          
     523   }     
    512524 
    513525?> 
Note: See TracChangeset for help on using the changeset viewer.