diff --git a/lib/ext/Syncroton/Model/Event.php b/lib/ext/Syncroton/Model/Event.php index 79686a9..679a2a1 100644 --- a/lib/ext/Syncroton/Model/Event.php +++ b/lib/ext/Syncroton/Model/Event.php @@ -1,127 +1,125 @@ */ /** * class to handle ActiveSync event * * @package Syncroton * @subpackage Model * @property string class * @property string collectionId * @property bool deletesAsMoves * @property bool getChanges * @property string syncKey * @property int windowSize */ - class Syncroton_Model_Event extends Syncroton_Model_AXMLEntry { - /** - * busy status constants - */ - const BUSY_STATUS_FREE = 0; - const BUSY_STATUS_TENATTIVE = 1; - const BUSY_STATUS_BUSY = 2; - - protected $_dateTimeFormat = "Ymd\THis\Z"; - + /** + * busy status constants + */ + const BUSY_STATUS_FREE = 0; + const BUSY_STATUS_TENATTIVE = 1; + const BUSY_STATUS_BUSY = 2; + + protected $_dateTimeFormat = "Ymd\THis\Z"; protected $_xmlBaseElement = 'ApplicationData'; - protected $_properties = array( - 'AirSyncBase' => array( - 'body' => array('type' => 'container', 'class' => 'Syncroton_Model_EmailBody') - ), + 'AirSyncBase' => array( + 'body' => array('type' => 'container', 'class' => 'Syncroton_Model_EmailBody') + ), 'Calendar' => array( - 'allDayEvent' => array('type' => 'number'), - 'appointmentReplyTime' => array('type' => 'datetime'), - 'attendees' => array('type' => 'container', 'childElement' => 'attendee', 'class' => 'Syncroton_Model_EventAttendee'), - 'busyStatus' => array('type' => 'number'), - 'categories' => array('type' => 'container', 'childElement' => 'category'), - 'disallowNewTimeProposal' => array('type' => 'number'), - 'dtStamp' => array('type' => 'datetime'), - 'endTime' => array('type' => 'datetime'), - 'exceptions' => array('type' => 'container', 'childElement' => 'exception', 'class' => 'Syncroton_Model_EventException'), - 'location' => array('type' => 'string'), - 'meetingStatus' => array('type' => 'number'), - 'onlineMeetingConfLink' => array('type' => 'string'), - 'onlineMeetingExternalLink' => array('type' => 'string'), - 'organizerEmail' => array('type' => 'string'), - 'organizerName' => array('type' => 'string'), - 'recurrence' => array('type' => 'container'), - 'reminder' => array('type' => 'number'), - 'responseRequested' => array('type' => 'number'), - 'responseType' => array('type' => 'number'), - 'sensitivity' => array('type' => 'number'), - 'startTime' => array('type' => 'datetime'), - 'subject' => array('type' => 'string'), - 'timezone' => array('type' => 'timezone'), - 'uID' => array('type' => 'string'), + 'allDayEvent' => array('type' => 'number'), + 'appointmentReplyTime' => array('type' => 'datetime'), + 'attendees' => array('type' => 'container', 'childElement' => 'attendee', 'class' => 'Syncroton_Model_EventAttendee'), + 'busyStatus' => array('type' => 'number'), + 'categories' => array('type' => 'container', 'childElement' => 'category'), + 'clientUid' => array('type' => 'string', 'supportedSince' => '16.0'), + 'disallowNewTimeProposal' => array('type' => 'number'), + 'dtStamp' => array('type' => 'datetime'), + 'endTime' => array('type' => 'datetime'), + 'exceptions' => array('type' => 'container', 'childElement' => 'exception', 'class' => 'Syncroton_Model_EventException'), + 'location' => array('type' => 'string'), + 'meetingStatus' => array('type' => 'number'), + 'onlineMeetingConfLink' => array('type' => 'string'), + 'onlineMeetingExternalLink' => array('type' => 'string'), + 'organizerEmail' => array('type' => 'string'), + 'organizerName' => array('type' => 'string'), + 'recurrence' => array('type' => 'container'), + 'reminder' => array('type' => 'number'), + 'responseRequested' => array('type' => 'number'), + 'responseType' => array('type' => 'number'), + 'sensitivity' => array('type' => 'number'), + 'startTime' => array('type' => 'datetime'), + 'subject' => array('type' => 'string'), + 'timezone' => array('type' => 'timezone'), + 'uID' => array('type' => 'string'), ) ); - + /** * (non-PHPdoc) * @see Syncroton_Model_IEntry::appendXML() * @todo handle Attendees element */ public function appendXML(DOMElement $domParrent, Syncroton_Model_IDevice $device) { parent::appendXML($domParrent, $device); $exceptionElements = $domParrent->getElementsByTagName('Exception'); $parentFields = array('AllDayEvent'/*, 'Attendees'*/, 'Body', 'BusyStatus'/*, 'Categories'*/, 'DtStamp', 'EndTime', 'Location', 'MeetingStatus', 'Reminder', 'ResponseType', 'Sensitivity', 'StartTime', 'Subject'); if ($exceptionElements->length > 0) { $mainEventElement = $exceptionElements->item(0)->parentNode->parentNode; foreach ($mainEventElement->childNodes as $childNode) { if (in_array($childNode->localName, $parentFields)) { foreach ($exceptionElements as $exception) { $elementsToLeftOut = $exception->getElementsByTagName($childNode->localName); foreach ($elementsToLeftOut as $elementToLeftOut) { if ($elementToLeftOut->nodeValue == $childNode->nodeValue) { $exception->removeChild($elementToLeftOut); } } } } } } } - + /** - * some elements of an exception can be left out, if they have the same value + * some elements of an exception can be left out, if they have the same value * like the main event - * + * * this function copies these elements to the exception for backends which need * this elements in the exceptions too. Tine 2.0 needs this for example. */ public function copyFieldsFromParent() { - if (isset($this->_elements['exceptions']) && is_array($this->_elements['exceptions'])) { - foreach ($this->_elements['exceptions'] as $exception) { - // no need to update deleted exceptions - if ($exception->deleted == 1) { - continue; - } - - $parentFields = array('allDayEvent', 'attendees', 'body', 'busyStatus', 'categories', 'dtStamp', 'endTime', 'location', 'meetingStatus', 'reminder', 'responseType', 'sensitivity', 'startTime', 'subject'); - - foreach ($parentFields as $field) { - if (!isset($exception->$field) && isset($this->_elements[$field])) { - $exception->$field = $this->_elements[$field]; - } - } - } - } + if (isset($this->_elements['exceptions']) && is_array($this->_elements['exceptions'])) { + foreach ($this->_elements['exceptions'] as $exception) { + // no need to update deleted exceptions + if ($exception->deleted == 1) { + continue; + } + + $parentFields = array('allDayEvent', 'attendees', 'body', 'busyStatus', 'categories', 'dtStamp', 'endTime', 'location', 'meetingStatus', 'reminder', 'responseType', 'sensitivity', 'startTime', 'subject'); + + foreach ($parentFields as $field) { + if (!isset($exception->$field) && isset($this->_elements[$field])) { + $exception->$field = $this->_elements[$field]; + } + } + } + } } -} \ No newline at end of file +} diff --git a/lib/ext/Syncroton/Model/MeetingResponse.php b/lib/ext/Syncroton/Model/MeetingResponse.php index 0a8d321..2dfc08f 100644 --- a/lib/ext/Syncroton/Model/MeetingResponse.php +++ b/lib/ext/Syncroton/Model/MeetingResponse.php @@ -1,47 +1,46 @@ */ /** * class to handle MeetingResponse request * * @package Syncroton * @subpackage Model * @property int userResponse * @property string collectionId * @property string calendarId * @property string requestId * @property string instanceId * @property string longId */ class Syncroton_Model_MeetingResponse extends Syncroton_Model_AXMLEntry { + /** + * attendee status + */ + const RESPONSE_ACCEPTED = 1; + const RESPONSE_TENTATIVE = 2; + const RESPONSE_DECLINED = 3; + protected $_xmlBaseElement = 'Request'; - - /** - * attendee status - */ - const RESPONSE_ACCEPTED = 1; - const RESPONSE_TENTATIVE = 2; - const RESPONSE_DECLINED = 3; - protected $_properties = array( 'MeetingResponse' => array( - 'userResponse' => array('type' => 'number'), - 'collectionId' => array('type' => 'string'), + 'userResponse' => array('type' => 'number'), + 'collectionId' => array('type' => 'string'), 'calendarId' => array('type' => 'string'), - 'requestId' => array('type' => 'string'), + 'requestId' => array('type' => 'string'), 'instanceId' => array('type' => 'datetime'), ), 'Search' => array( 'longId' => array('type' => 'string') ) ); -} \ No newline at end of file +} diff --git a/lib/ext/Syncroton/Model/Policy.php b/lib/ext/Syncroton/Model/Policy.php index 41ae331..5eb48ea 100644 --- a/lib/ext/Syncroton/Model/Policy.php +++ b/lib/ext/Syncroton/Model/Policy.php @@ -1,76 +1,75 @@ */ /** * class to handle ActiveSync Sync command * * @package Syncroton * @subpackage Model */ class Syncroton_Model_Policy extends Syncroton_Model_AXMLEntry implements Syncroton_Model_IPolicy { protected $_xmlBaseElement = 'EASProvisionDoc'; - protected $_properties = array( 'Internal' => array( 'id' => array('type' => 'string'), 'description' => array('type' => 'string'), 'name' => array('type' => 'string'), 'policyKey' => array('type' => 'string'), ), 'Provision' => array( + 'accountOnlyRemoteWipe' => array('type' => 'container', 'childName' => 'Status', 'supportedSince' => '16.1'), 'allowBluetooth' => array('type' => 'number'), 'allowSMIMEEncryptionAlgorithmNegotiation' => array('type' => 'number'), 'allowBrowser' => array('type' => 'number'), 'allowCamera' => array('type' => 'number'), 'allowConsumerEmail' => array('type' => 'number'), 'allowDesktopSync' => array('type' => 'number'), 'allowHTMLEmail' => array('type' => 'number'), 'allowInternetSharing' => array('type' => 'number'), 'allowIrDA' => array('type' => 'number'), 'allowPOPIMAPEmail' => array('type' => 'number'), 'allowRemoteDesktop' => array('type' => 'number'), 'allowSimpleDevicePassword' => array('type' => 'number'), 'allowSMIMEEncryptionAlgorithmNegotiation' => array('type' => 'number'), 'allowSMIMESoftCerts' => array('type' => 'number'), 'allowStorageCard' => array('type' => 'number'), 'allowTextMessaging' => array('type' => 'number'), 'allowUnsignedApplications' => array('type' => 'number'), 'allowUnsignedInstallationPackages' => array('type' => 'number'), 'allowWifi' => array('type' => 'number'), 'alphanumericDevicePasswordRequired' => array('type' => 'number'), 'approvedApplicationList' => array('type' => 'container', 'childName' => 'Hash'), 'attachmentsEnabled' => array('type' => 'number'), 'devicePasswordEnabled' => array('type' => 'number'), 'devicePasswordExpiration' => array('type' => 'number'), 'devicePasswordHistory' => array('type' => 'number'), 'maxAttachmentSize' => array('type' => 'number'), 'maxCalendarAgeFilter' => array('type' => 'number'), 'maxDevicePasswordFailedAttempts' => array('type' => 'number'), 'maxEmailAgeFilter' => array('type' => 'number'), 'maxEmailBodyTruncationSize' => array('type' => 'number'), 'maxEmailHTMLBodyTruncationSize' => array('type' => 'number'), 'maxInactivityTimeDeviceLock' => array('type' => 'number'), 'minDevicePasswordComplexCharacters' => array('type' => 'number'), 'minDevicePasswordLength' => array('type' => 'number'), 'passwordRecoveryEnabled' => array('type' => 'number'), 'requireDeviceEncryption' => array('type' => 'number'), 'requireEncryptedSMIMEMessages' => array('type' => 'number'), 'requireEncryptionSMIMEAlgorithm' => array('type' => 'number'), 'requireManualSyncWhenRoaming' => array('type' => 'number'), 'requireSignedSMIMEAlgorithm' => array('type' => 'number'), 'requireSignedSMIMEMessages' => array('type' => 'number'), 'requireStorageCardEncryption' => array('type' => 'number'), 'unapprovedInROMApplicationList' => array('type' => 'container', 'childName' => 'ApplicationName') ) ); } -