Exemplo n.º 1
0
 /**
  * converts a tine20 event to an iTIP event
  * 
  * @param  Calendar_Model_Event $_event
  * @return Calendar_Model_Event 
  */
 protected function _toiTIP($_event)
 {
     if ($_event instanceof Tinebase_Record_RecordSet) {
         foreach ($_event as $idx => $event) {
             try {
                 $_event[$idx] = $this->_toiTIP($event);
             } catch (Tinebase_Exception_AccessDenied $ade) {
                 // if we don't have permissions for the exdates, this is likely a freebusy info only -> remove from set
                 $_event->removeRecord($event);
             } catch (Exception $e) {
                 $event->exdate = new Tinebase_Record_RecordSet('Calendar_Model_Event');
             }
         }
         return $_event;
     }
     // get exdates
     if ($_event->rrule) {
         $_event->exdate = $this->_eventController->getRecurExceptions($_event, TRUE);
     }
     // mark any exdates as deleted if the CU does not attend and is not organizer
     if ($_event->exdate instanceof Tinebase_Record_RecordSet && $_event->organizer != $this->_calendarUser->user_id) {
         foreach ($_event->exdate as $exdate) {
             $CUAttendee = Calendar_Model_Attender::getAttendee($exdate->attendee, $this->_calendarUser);
             if ($exdate->is_deleted == false && !$CUAttendee) {
                 $exdate->is_deleted = true;
             }
         }
     }
     return $_event;
 }