Changeset 6038


Ignore:
Timestamp:
04/26/12 11:53:21 (12 years ago)
Author:
acoutinho
Message:

Ticket #2658 - Inconsistencias na Envio e recebimento de sugestao de novo horario

File:
1 edited

Legend:

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

    r6036 r6038  
    125125        $schedulableReference = $schedulable; 
    126126 
    127         $referenceSuggestion = array('startTime' => $params['startTime'], 
    128             'endTime' => $params['endTime'], 
     127        $referenceSuggestion = array('startTime' => strtotime($params['startTime'] . ' ' . $schedulable['timezone']) . '000', 
     128            'endTime' => strtotime($params['endTime'] . ' ' . $schedulable['timezone']) . '000', 
    129129            'allDay' => $params['allDay'] 
    130130        ); 
     131 
    131132        $schedulable = array_merge($schedulable, $referenceSuggestion); 
    132133 
     
    281282        else 
    282283            $ical = Config::regGet('ical://' . $schedulable['id'] . '/' . $method); 
    283          
     284 
    284285        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          
     286            $schedulable['startTime'] = self::parseTimeDate($schedulable['startTime'], $schedulable['timezone']); 
     287 
     288        if (!is_numeric($schedulable['endTime'])) { 
     289            $schedulable['endTime'] = self::parseTimeDate($schedulable['endTime'], $schedulable['timezone']); 
     290 
     291            if ($schedulable['allDay']) 
     292                $schedulable['endTime'] = $schedulable['endTime'] + 86400000; 
     293        } 
     294 
    294295        $timezone = new DateTimeZone('UTC'); 
    295296        $sTime = new DateTime('@' . (int) ($schedulable['startTime'] / 1000), $timezone); 
    296297        $eTime = new DateTime('@' . (int) ($schedulable['endTime'] / 1000), $timezone); 
    297          
     298 
    298299        if (isset($schedulable['timezone'])) { 
    299300            $sTime->setTimezone(new DateTimeZone($schedulable['timezone'])); 
     
    511512            $method = 'REQUEST'; 
    512513            $notificationType = 'Modificação de Calendario'; 
    513             $part = 'othersAttendees';     
     514            $part = 'othersAttendees'; 
    514515            self::mountStruture($uri['id'], $schedulable, false, $data, $subject, $ical, $part, $method, $notificationType); 
    515516 
     
    518519        } 
    519520    } 
    520      
    521    static private function parseTimeDate($time, $timezone){ 
    522         return strtotime( $time . ' ' .$timezone).'000';          
    523    }     
     521 
     522    static private function parseTimeDate($time, $timezone) { 
     523        return strtotime($time . ' ' . $timezone) . '000'; 
     524    } 
     525 
    524526} 
     527 
    525528?> 
Note: See TracChangeset for help on using the changeset viewer.