/**
  * return vcard and convert Calendar_Model_Event to vcard if needed
  * 
  * @return string
  */
 protected function _getVEvent()
 {
     if ($this->_vevent == null) {
         $this->_vevent = $this->_getConverter()->fromTine20Model($this->getRecord());
         foreach ($this->_vevent->children() as $component) {
             if ($component->name == 'VEVENT') {
                 // NOTE: we store the requested container here to have an origin when the event is moved
                 $component->add('X-TINE20-CONTAINER', $this->_container->getId());
                 if (isset($component->{'VALARM'}) && !$this->_container->isPersonalOf(Tinebase_Core::getUser())) {
                     // prevent duplicate alarms
                     $component->add('X-MOZ-LASTACK', Tinebase_DateTime::now()->addYear(100)->setTimezone('UTC'), array('VALUE' => 'DATE-TIME'));
                 }
             }
         }
     }
     return $this->_vevent->serialize();
 }
Example #2
0
 /**
  * return vcard and convert Calendar_Model_Event to vcard if needed
  * 
  * @return string
  */
 protected function _getVEvent()
 {
     if ($this->_vevent == null) {
         $this->_vevent = $this->_converter->fromTine20Model($this->getRecord());
         foreach ($this->_vevent->children() as $component) {
             if ($component->name == 'VEVENT') {
                 // NOTE: we store the requested container here to have an origin when the event is moved
                 $component->{'X-TINE20-CONTAINER'} = $this->_container->getId();
                 if (isset($component->{'VALARM'}) && !$this->_container->isPersonalOf(Tinebase_Core::getUser())) {
                     // prevent duplicate alarms
                     $component->{'X-MOZ-LASTACK'} = new Sabre_VObject_Element_DateTime('X-MOZ-LASTACK');
                     $component->{'X-MOZ-LASTACK'}->setDateTime(Tinebase_DateTime::now()->addYear(100), Sabre_VObject_Element_DateTime::UTC);
                 }
             }
         }
     }
     return $this->_vevent->serialize();
 }