Ignore:
Timestamp:
08/09/12 12:25:44 (12 years ago)
Author:
acoutinho
Message:

Ticket #2966 - Correcoes de bugs e melhorias / suporte a historico em atividades

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/2.4.2-expresso1/prototype/modules/calendar/interceptors/DBMapping.php

    r6968 r6974  
    1212    static function encodeCreateSchedulable(&$uri, &$params, &$criteria, $original)  
    1313    { 
    14  
    15         if(isset($params['summary']) && $params['summary'] == '') 
    16             $params['summary'] = 'Evento sem título'; 
    1714 
    1815        if (!is_numeric($params['startTime'])) 
     
    566563    static function createParticipantHistoric(&$uri, &$params, &$criteria, $original){ 
    567564 
    568         if(!isset($criteria['event'])){ 
    569             $event = Controller::read(array('concept' => 'schedulable', 'id' => $original['properties']['schedulable'])); 
    570             $criteria['event'] = $event; 
    571         }else 
    572             $event = $criteria['event']; 
    573  
    574         if($event['type'] == '2'){ 
    575              Controller::create(array('concept' => 'calendarHistoric'),  
    576                 array('schedulable' => $original['properties']['schedulable'],  
    577                     'user' => Config::me('uidNumber'), 
    578                     'time' => time() . '000', 
    579                     'attribute' => 'participant', 
    580                     'beforeValue' => '', 
    581                     'afterValue' => $original['properties']['user'] 
    582                     ) 
    583                 ); 
    584         } 
     565        if(isset($original['properties']) && $original['properties']['isOrganizer'] != '1'){ 
     566            if(!isset($criteria['event'])){ 
     567                $event = Controller::read(array('concept' => 'schedulable', 'id' => $original['properties']['schedulable'])); 
     568                $criteria['event'] = $event; 
     569            }else 
     570                $event = $criteria['event']; 
     571 
     572            if($event['type'] == '2'){ 
     573                Controller::create(array('concept' => 'calendarHistoric'),  
     574                    array('schedulable' => $original['properties']['schedulable'],  
     575                        'user' => Config::me('uidNumber'), 
     576                        'time' => time() . '000', 
     577                        'attribute' => 'participant', 
     578                        'beforeValue' => '', 
     579                        'afterValue' => $original['properties']['user'] 
     580                        ) 
     581                    ); 
     582            } 
     583        } 
    585584    } 
    586585 
     
    840839            }  
    841840             
     841       } 
     842        
     843       if(isset($result['id']) && $result['type'] == '2'){ 
     844           $result['historic'] =  Controller::find( array( 'concept' => 'calendarHistoric' ), false, array( 'filter' => array( '=', 'schedulable', $result['id'] ) ) ); 
    842845       } 
    843846   }  
     
    10391042        if(isset($criteria['filter']) && $criteria['filter'] && isset($criteria['filter'][1][2])){ 
    10401043            $idSchedulable = $criteria['filter'][1][2]; 
    1041                         $idCalendar = $criteria['filter'][2][2]; 
     1044            $idCalendar = $criteria['filter'][2][2]; 
    10421045            $owner = $criteria['filter'][3][2]; 
    10431046 
     
    10761079 
    10771080            $uri['id'] = $idSchedulable; 
     1081             
     1082            if(isset($criteria['filter']) && isset($criteria['filter'][4]) && isset($criteria['filter'][4][2])){ 
     1083                Controller::deleteALL(array('concept' => 'taskToActivity'), null, array('filter' => array('=', 'activity', $idSchedulable))); 
     1084            } 
    10781085        } 
    10791086         
Note: See TracChangeset for help on using the changeset viewer.