Ignore:
Timestamp:
05/29/12 17:05:46 (12 years ago)
Author:
acoutinho
Message:

Ticket #2812 - Inconsistências na importação de evento para diferentes agendas

File:
1 edited

Legend:

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

    r6331 r6344  
    235235                    switch ($method) { 
    236236                        case 'PUBLISH': 
    237                             if (!$schedulable = self::_getSchedulable($uid)) 
     237                            //Caso o evento não exista o mesmo cria um novo evento, se já existir o mesmo referencia o evento com agenda 
     238                            if (!$schedulable = self::_getSchedulable($uid)) 
    238239                                $interation = self::_makeVEVENT($schedulable, $component, $params); 
     240                            else{ 
     241                                $links = Controller::read(array('concept' => 'calendarToSchedulable'), array('id'), array('filter' => 
     242                                array('AND', 
     243                                    array('=', 'calendar', $params['calendar']), 
     244                                    array('=', 'schedulable', $schedulable['id']) 
     245                                ))); 
     246 
     247                                if(!$links &&  !isset($links[0])) 
     248                                    Controller::create(array('concept' => 'calendarToSchedulable'), array('calendar' => $params['calendar'], 'schedulable' => $schedulable['id'])); 
     249 
     250                                } 
    239251                            break; 
    240252 
     
    791803 
    792804    static private function _makeVEVENT($schedulable, $component, $params) { 
    793  
    794805        $interation = array(); 
    795806        $eventID = isset($schedulable['id']) ? $schedulable['id'] : mt_rand() . '(Formatter)'; 
Note: See TracChangeset for help on using the changeset viewer.