Ignore:
Timestamp:
02/14/12 16:52:04 (12 years ago)
Author:
acoutinho
Message:

Ticket #2434 - Implementacao anexos, acls e delegacao de participantes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/prototype/modules/calendar/export.php

    r5399 r5514  
    3131       $eventsIds[] = $eventLink['schedulable']; 
    3232 
    33     $events = Controller::find(array('concept' => 'schedulable') , false , array('filter' => array('IN','id',$eventsIds) , 'deepness' => '2' )); 
     33    $events = Controller::find(array('concept' => 'schedulable') , false , array('filter' => array('IN','id',$eventsIds) , 'deepness' => '2' ));         
    3434    $ics = Controller::format( array( 'service' => 'iCal' ) , $events , array('defaultTZI' => $calendar['timezone']) ); 
    3535 
     
    4545{     
    4646    $event = Controller::read(array('concept' => 'schedulable' , 'id' => $params['event'])); 
     47        $attachmentRelation = Controller::find( array( 'concept' => 'schedulableToAttachment' ) , false ,array( 'filter' => array('=', 'schedulable'  ,  $event['id']) ));  
     48        if(is_array($attachmentRelation)){ 
     49                $attachments = array(); 
     50                foreach($attachmentRelation as $key => $value) 
     51                        if(isset($value['attachment']) || !!$value['attachment']) 
     52                                $attachments[$key]  = $value['attachment']; 
     53                //Pega os anexos sem source 
     54                $event['attachments'] = Controller::find( array( 'concept' => 'attachment' ) , false ,array( 'filter' => array('IN', 'id' , $attachments) ));  
     55        } 
     56                 
    4757    $ics = Controller::format( array( 'service' => 'iCal' ) , array($event) , array('defaultTZI' => $event['timezone']) ); 
    4858     
Note: See TracChangeset for help on using the changeset viewer.