/**
  * test Tinebase_WebDav_Container_Abstract::getCalendarVTimezone
  */
 public function testGetCalendarVTimezone()
 {
     $vTimezone = Tinebase_WebDav_Container_Abstract::getCalendarVTimezone('Calendar');
     $this->assertContains('PRODID:-//tine20.org//Tine 2.0 Calendar', $vTimezone);
     $vTimezone = Tinebase_WebDav_Container_Abstract::getCalendarVTimezone(Tinebase_Application::getInstance()->getApplicationByName('Calendar'));
     $this->assertContains('PRODID:-//tine20.org//Tine 2.0 Calendar', $vTimezone);
 }
 /**
  * Returns the list of properties
  *
  * @param array $requestedProperties
  * @return array
  */
 public function getProperties($requestedProperties)
 {
     $ctags = Tinebase_Container::getInstance()->getContentSequence($this->_container);
     $properties = array('{http://calendarserver.org/ns/}getctag' => $ctags, '{DAV:}sync-token' => Tinebase_WebDav_Plugin_SyncToken::SYNCTOKEN_PREFIX . $ctags, 'id' => $this->_container->getId(), 'uri' => $this->_useIdAsName == true ? $this->_container->getId() : $this->_container->name, '{DAV:}resource-id' => 'urn:uuid:' . $this->_container->getId(), '{DAV:}owner' => new Sabre\DAVACL\Property\Principal(Sabre\DAVACL\Property\Principal::HREF, 'principals/users/' . Tinebase_Core::getUser()->contact_id), '{DAV:}displayname' => $this->_container->name, '{http://apple.com/ns/ical/}calendar-color' => empty($this->_container->color) ? '#000000' : $this->_container->color, '{' . Sabre\CalDAV\Plugin::NS_CALDAV . '}supported-calendar-component-set' => new Sabre\CalDAV\Property\SupportedCalendarComponentSet(array('VEVENT')), '{' . Sabre\CalDAV\Plugin::NS_CALDAV . '}supported-calendar-data' => new Sabre\CalDAV\Property\SupportedCalendarData(), '{' . Sabre\CalDAV\Plugin::NS_CALDAV . '}calendar-description' => 'Calendar ' . $this->_container->name, '{' . Sabre\CalDAV\Plugin::NS_CALDAV . '}calendar-timezone' => Tinebase_WebDav_Container_Abstract::getCalendarVTimezone($this->_application));
     if (!empty(Tinebase_Core::getUser()->accountEmailAddress)) {
         $properties['{' . Sabre\CalDAV\Plugin::NS_CALDAV . '}calendar-user-address-set'] = new Sabre\DAV\Property\HrefList(array('mailto:' . Tinebase_Core::getUser()->accountEmailAddress), false);
     }
     if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) {
         Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ . print_r($properties, true));
     }
     $response = array();
     foreach ($requestedProperties as $prop) {
         if (isset($properties[$prop])) {
             $response[$prop] = $properties[$prop];
         }
     }
     if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) {
         Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ . print_r($response, true));
     }
     return $response;
 }
 /**
  * Returns the list of properties
  *
  * @param array $requestedProperties
  * @return array
  */
 public function getProperties($requestedProperties)
 {
     $properties = array('{http://calendarserver.org/ns/}getctag' => round(time() / 60), 'id' => 'schedule-inbox', 'uri' => 'schedule-inbox', '{DAV:}resource-id' => 'urn:uuid:schedule-inbox', '{DAV:}owner' => new \Sabre\DAVACL\Property\Principal(Sabre\DAVACL\Property\Principal::HREF, 'principals/users/' . $this->_user->contact_id), '{DAV:}displayname' => 'Schedule Inbox', '{http://apple.com/ns/ical/}calendar-color' => '#666666', '{' . \Sabre\CalDAV\Plugin::NS_CALDAV . '}supported-calendar-component-set' => new \Sabre\CalDAV\Property\SupportedCalendarComponentSet(array('VEVENT')), '{' . \Sabre\CalDAV\Plugin::NS_CALDAV . '}supported-calendar-data' => new \Sabre\CalDAV\Property\SupportedCalendarData(), '{' . \Sabre\CalDAV\Plugin::NS_CALDAV . '}calendar-description' => 'Calendar schedule inbox', '{' . \Sabre\CalDAV\Plugin::NS_CALDAV . '}calendar-timezone' => Tinebase_WebDav_Container_Abstract::getCalendarVTimezone('Calendar'));
     $defaultCalendarId = Tinebase_Core::getPreference('Calendar')->getValueForUser(Calendar_Preference::DEFAULTCALENDAR, $this->_user->getId());
     if (!empty($defaultCalendarId)) {
         $properties['{' . \Sabre\CalDAV\Plugin::NS_CALDAV . '}schedule-default-calendar-URL'] = new \Sabre\DAV\Property\Href('calendars/' . $this->_user->contact_id . '/' . $defaultCalendarId);
     }
     if (!empty(Tinebase_Core::getUser()->accountEmailAddress)) {
         $properties['{' . \Sabre\CalDAV\Plugin::NS_CALDAV . '}calendar-user-address-set'] = new \Sabre\DAV\Property\HrefList(array('mailto:' . Tinebase_Core::getUser()->accountEmailAddress), false);
     }
     $response = array();
     foreach ($requestedProperties as $prop) {
         if (isset($properties[$prop])) {
             $response[$prop] = $properties[$prop];
         }
     }
     return $response;
 }