The last of the (currently implemented) constants.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 9 Apr 2010 22:39:06 +0000 (18:39 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 9 Apr 2010 22:39:06 +0000 (18:39 -0400)
..also comment out the defines for constants used in commands that are not yet implemented.

framework/ActiveSync/lib/Horde/ActiveSync.php
framework/ActiveSync/lib/Horde/ActiveSync/Connector/Importer.php
framework/ActiveSync/lib/Horde/ActiveSync/Driver/Horde.php
framework/ActiveSync/lib/Horde/ActiveSync/Message/Folder.php
framework/ActiveSync/lib/Horde/ActiveSync/Request/FolderSync.php
framework/ActiveSync/lib/Horde/ActiveSync/Request/GetItemEstimate.php
framework/ActiveSync/lib/Horde/ActiveSync/Request/Ping.php
framework/ActiveSync/lib/Horde/ActiveSync/Request/Provision.php
framework/ActiveSync/lib/Horde/ActiveSync/State/File.php
framework/ActiveSync/lib/Horde/ActiveSync/State/History.php

index 959bab1..06a682a 100644 (file)
@@ -112,40 +112,6 @@ define("SYNC_MOVE_RESPONSE","Move:Response");
 define("SYNC_MOVE_STATUS","Move:Status");
 define("SYNC_MOVE_DSTMSGID","Move:DstMsgId");
 
-// GetItemEstimate
-define("SYNC_GETITEMESTIMATE_GETITEMESTIMATE","GetItemEstimate:GetItemEstimate");
-define("SYNC_GETITEMESTIMATE_VERSION","GetItemEstimate:Version");
-define("SYNC_GETITEMESTIMATE_FOLDERS","GetItemEstimate:Folders");
-define("SYNC_GETITEMESTIMATE_FOLDER","GetItemEstimate:Folder");
-define("SYNC_GETITEMESTIMATE_FOLDERTYPE","GetItemEstimate:FolderType");
-define("SYNC_GETITEMESTIMATE_FOLDERID","GetItemEstimate:FolderId");
-define("SYNC_GETITEMESTIMATE_DATETIME","GetItemEstimate:DateTime");
-define("SYNC_GETITEMESTIMATE_ESTIMATE","GetItemEstimate:Estimate");
-define("SYNC_GETITEMESTIMATE_RESPONSE","GetItemEstimate:Response");
-define("SYNC_GETITEMESTIMATE_STATUS","GetItemEstimate:Status");
-
-// FolderHierarchy
-define("SYNC_FOLDERHIERARCHY_FOLDERS","FolderHierarchy:Folders");
-define("SYNC_FOLDERHIERARCHY_FOLDER","FolderHierarchy:Folder");
-define("SYNC_FOLDERHIERARCHY_DISPLAYNAME","FolderHierarchy:DisplayName");
-define("SYNC_FOLDERHIERARCHY_SERVERENTRYID","FolderHierarchy:ServerEntryId");
-define("SYNC_FOLDERHIERARCHY_PARENTID","FolderHierarchy:ParentId");
-define("SYNC_FOLDERHIERARCHY_TYPE","FolderHierarchy:Type");
-define("SYNC_FOLDERHIERARCHY_RESPONSE","FolderHierarchy:Response");
-define("SYNC_FOLDERHIERARCHY_STATUS","FolderHierarchy:Status");
-define("SYNC_FOLDERHIERARCHY_CONTENTCLASS","FolderHierarchy:ContentClass");
-define("SYNC_FOLDERHIERARCHY_CHANGES","FolderHierarchy:Changes");
-define("SYNC_FOLDERHIERARCHY_ADD","FolderHierarchy:Add");
-define("SYNC_FOLDERHIERARCHY_REMOVE","FolderHierarchy:Remove");
-define("SYNC_FOLDERHIERARCHY_UPDATE","FolderHierarchy:Update");
-define("SYNC_FOLDERHIERARCHY_SYNCKEY","FolderHierarchy:SyncKey");
-define("SYNC_FOLDERHIERARCHY_FOLDERCREATE","FolderHierarchy:FolderCreate");
-define("SYNC_FOLDERHIERARCHY_FOLDERDELETE","FolderHierarchy:FolderDelete");
-define("SYNC_FOLDERHIERARCHY_FOLDERUPDATE","FolderHierarchy:FolderUpdate");
-define("SYNC_FOLDERHIERARCHY_FOLDERSYNC","FolderHierarchy:FolderSync");
-define("SYNC_FOLDERHIERARCHY_COUNT","FolderHierarchy:Count");
-define("SYNC_FOLDERHIERARCHY_VERSION","FolderHierarchy:Version");
-
 // MeetingResponse
 define("SYNC_MEETINGRESPONSE_CALENDARID","MeetingResponse:CalendarId");
 define("SYNC_MEETINGRESPONSE_FOLDERID","MeetingResponse:FolderId");
@@ -215,26 +181,6 @@ define("SYNC_VALIDATECERT_CERTIFICATECHAIN","ValidateCert:CertificateChain");
 define("SYNC_VALIDATECERT_CHECKCRL","ValidateCert:CheckCRL");
 define("SYNC_VALIDATECERT_STATUS","ValidateCert:Status");
 
-// Ping
-define("SYNC_PING_PING","Ping:Ping");
-define("SYNC_PING_STATUS","Ping:Status");
-define("SYNC_PING_LIFETIME", "Ping:LifeTime");
-define("SYNC_PING_FOLDERS", "Ping:Folders");
-define("SYNC_PING_FOLDER", "Ping:Folder");
-define("SYNC_PING_SERVERENTRYID", "Ping:ServerEntryId");
-define("SYNC_PING_FOLDERTYPE", "Ping:FolderType");
-
-//Provision
-define("SYNC_PROVISION_PROVISION", "Provision:Provision");
-define("SYNC_PROVISION_POLICIES", "Provision:Policies");
-define("SYNC_PROVISION_POLICY", "Provision:Policy");
-define("SYNC_PROVISION_POLICYTYPE", "Provision:PolicyType");
-define("SYNC_PROVISION_POLICYKEY", "Provision:PolicyKey");
-define("SYNC_PROVISION_DATA", "Provision:Data");
-define("SYNC_PROVISION_STATUS", "Provision:Status");
-define("SYNC_PROVISION_REMOTEWIPE", "Provision:RemoteWipe");
-define("SYNC_PROVISION_EASPROVISIONDOC", "Provision:EASProvisionDoc");
-
 //Search
 define("SYNC_SEARCH_SEARCH", "Search:Search");
 define("SYNC_SEARCH_STORE", "Search:Store");
@@ -273,28 +219,6 @@ define("SYNC_GAL_HOMEPHONE", "GAL:HomePhone");
 define("SYNC_GAL_MOBILEPHONE", "GAL:MobilePhone");
 define("SYNC_GAL_EMAILADDRESS", "GAL:EmailAddress");
 
-// Other constants
-define("SYNC_FOLDER_TYPE_OTHER", 1);
-define("SYNC_FOLDER_TYPE_INBOX", 2);
-define("SYNC_FOLDER_TYPE_DRAFTS", 3);
-define("SYNC_FOLDER_TYPE_WASTEBASKET", 4);
-define("SYNC_FOLDER_TYPE_SENTMAIL", 5);
-define("SYNC_FOLDER_TYPE_OUTBOX", 6);
-define("SYNC_FOLDER_TYPE_TASK", 7);
-define("SYNC_FOLDER_TYPE_APPOINTMENT", 8);
-define("SYNC_FOLDER_TYPE_CONTACT", 9);
-define("SYNC_FOLDER_TYPE_NOTE", 10);
-define("SYNC_FOLDER_TYPE_JOURNAL", 11);
-define("SYNC_FOLDER_TYPE_USER_MAIL", 12);
-define("SYNC_FOLDER_TYPE_USER_APPOINTMENT", 13);
-define("SYNC_FOLDER_TYPE_USER_CONTACT", 14);
-define("SYNC_FOLDER_TYPE_USER_TASK", 15);
-define("SYNC_FOLDER_TYPE_USER_JOURNAL", 16);
-define("SYNC_FOLDER_TYPE_USER_NOTE", 17);
-define("SYNC_FOLDER_TYPE_UNKNOWN", 18);
-define("SYNC_FOLDER_TYPE_RECIPIENT_CACHE", 19);
-define("SYNC_FOLDER_TYPE_DUMMY", "__dummy.Folder.Id__");
-
 /**
  * Main ActiveSync class. Entry point for performing all ActiveSync operations
  *
@@ -313,7 +237,29 @@ class Horde_ActiveSync
     const TRUNCATION_SEVEN = 7;
     const TRUNCATION_ALL = 9;
 
-    /* Request related constants */
+    /* Request related constants that are used in multiple places */
+    /* FOLDERHIERARCHY */ 
+    const FOLDERHIERARCHY_FOLDERS = 'FolderHierarchy:Folders';
+    const FOLDERHIERARCHY_FOLDER = 'FolderHierarchy:Folder';
+    const FOLDERHIERARCHY_DISPLAYNAME = 'FolderHierarchy:DisplayName';
+    const FOLDERHIERARCHY_SERVERENTRYID = 'FolderHierarchy:ServerEntryId';
+    const FOLDERHIERARCHY_PARENTID = 'FolderHierarchy:ParentId';
+    const FOLDERHIERARCHY_TYPE = 'FolderHierarchy:Type';
+    const FOLDERHIERARCHY_RESPONSE = 'FolderHierarchy:Response';
+    const FOLDERHIERARCHY_STATUS = 'FolderHierarchy:Status';
+    const FOLDERHIERARCHY_CONTENTCLASS = 'FolderHierarchy:ContentClass';
+    const FOLDERHIERARCHY_CHANGES = 'FolderHierarchy:Changes';
+    const FOLDERHIERARCHY_ADD = 'FolderHierarchy:Add';
+    const FOLDERHIERARCHY_REMOVE = 'FolderHierarchy:Remove';
+    const FOLDERHIERARCHY_UPDATE = 'FolderHierarchy:Update';
+    const FOLDERHIERARCHY_SYNCKEY = 'FolderHierarchy:SyncKey';
+    const FOLDERHIERARCHY_FOLDERCREATE = 'FolderHierarchy:FolderCreate';
+    const FOLDERHIERARCHY_FOLDERDELETE = 'FolderHierarchy:FolderDelete';
+    const FOLDERHIERARCHY_FOLDERUPDATE = 'FolderHierarchy:FolderUpdate';
+    const FOLDERHIERARCHY_FOLDERSYNC = 'FolderHierarchy:FolderSync';
+    const FOLDERHIERARCHY_COUNT = 'FolderHierarchy:Count';
+    const FOLDERHIERARCHY_VERSION = 'FolderHierarchy:Version';
+    
     /* SYNC */
     const SYNC_SYNCHRONIZE = 'Synchronize';
     const SYNC_REPLIES = 'Replies';
@@ -347,9 +293,43 @@ class Horde_ActiveSync
     const SYNC_MIMESUPPORT = 'MIMESupport';
     const SYNC_MIMETRUNCATION = 'MIMETruncation';
 
+    /* PROVISION */
+    const PROVISION_PROVISION =  'Provision:Provision';
+    const PROVISION_POLICIES =  'Provision:Policies';
+    const PROVISION_POLICY =  'Provision:Policy';
+    const PROVISION_POLICYTYPE =  'Provision:PolicyType';
+    const PROVISION_POLICYKEY =  'Provision:PolicyKey';
+    const PROVISION_DATA =  'Provision:Data';
+    const PROVISION_STATUS =  'Provision:Status';
+    const PROVISION_REMOTEWIPE =  'Provision:RemoteWipe';
+    const PROVISION_EASPROVISIONDOC =  'Provision:EASProvisionDoc';
+
     /* Flags */
     const FLAG_NEWMESSAGE = 'NewMessage';
 
+    /* Folder types */
+    // Other constants
+    const FOLDER_TYPE_OTHER =  1;
+    const FOLDER_TYPE_INBOX =  2;
+    const FOLDER_TYPE_DRAFTS =  3;
+    const FOLDER_TYPE_WASTEBASKET =  4;
+    const FOLDER_TYPE_SENTMAIL =  5;
+    const FOLDER_TYPE_OUTBOX =  6;
+    const FOLDER_TYPE_TASK =  7;
+    const FOLDER_TYPE_APPOINTMENT =  8;
+    const FOLDER_TYPE_CONTACT =  9;
+    const FOLDER_TYPE_NOTE =  10;
+    const FOLDER_TYPE_JOURNAL =  11;
+    const FOLDER_TYPE_USER_MAIL =  12;
+    const FOLDER_TYPE_USER_APPOINTMENT =  13;
+    const FOLDER_TYPE_USER_CONTACT =  14;
+    const FOLDER_TYPE_USER_TASK =  15;
+    const FOLDER_TYPE_USER_JOURNAL =  16;
+    const FOLDER_TYPE_USER_NOTE =  17;
+    const FOLDER_TYPE_UNKNOWN =  18;
+    const FOLDER_TYPE_RECIPIENT_CACHE =  19;
+    const FOLDER_TYPE_DUMMY =  '__dummy.Folder.Id__';
     /**
      * Logger
      *
@@ -538,10 +518,10 @@ class Horde_ActiveSync
         $this->_stateMachine->setFolderData($devid, $folders);
 
         $this->_encoder->StartWBXML();
-        $this->_encoder->startTag(SYNC_FOLDERHIERARCHY_FOLDERS);
+        $this->_encoder->startTag(self::FOLDERHIERARCHY_FOLDERS);
 
         foreach ($folders as $folder) {
-            $this->_encoder->startTag(SYNC_FOLDERHIERARCHY_FOLDER);
+            $this->_encoder->startTag(self::FOLDERHIERARCHY_FOLDER);
             $folder->encodeStream($this->_encoder);
             $this->_encoder->endTag();
         }
@@ -648,11 +628,11 @@ class Horde_ActiveSync
 
         $create = $update = $delete = false;
 
-        if ($el[Horde_ActiveSync_Wbxml::EN_TAG] == SYNC_FOLDERHIERARCHY_FOLDERCREATE) {
+        if ($el[Horde_ActiveSync_Wbxml::EN_TAG] == self::FOLDERHIERARCHY_FOLDERCREATE) {
             $create = true;
-        } elseif ($el[Horde_ActiveSync_Wbxml::EN_TAG] == SYNC_FOLDERHIERARCHY_FOLDERUPDATE) {
+        } elseif ($el[Horde_ActiveSync_Wbxml::EN_TAG] == self::FOLDERHIERARCHY_FOLDERUPDATE) {
             $update = true;
-        } elseif ($el[Horde_ActiveSync_Wbxml::EN_TAG] == SYNC_FOLDERHIERARCHY_FOLDERDELETE) {
+        } elseif ($el[Horde_ActiveSync_Wbxml::EN_TAG] == self::FOLDERHIERARCHY_FOLDERDELETE) {
             $delete = true;
         }
 
@@ -661,7 +641,7 @@ class Horde_ActiveSync
         }
 
         // SyncKey
-        if (!$this->_decoder->getElementStartTag(SYNC_FOLDERHIERARCHY_SYNCKEY)) {
+        if (!$this->_decoder->getElementStartTag(self::FOLDERHIERARCHY_SYNCKEY)) {
             return false;
         }
         $synckey = $this->_decoder->getElementContent();
@@ -671,7 +651,7 @@ class Horde_ActiveSync
 
         // ServerID
         $serverid = false;
-        if ($this->_decoder->getElementStartTag(SYNC_FOLDERHIERARCHY_SERVERENTRYID)) {
+        if ($this->_decoder->getElementStartTag(self::FOLDERHIERARCHY_SERVERENTRYID)) {
             $serverid = $this->_decoder->getElementContent();
             if (!$this->_decoder->getElementEndTag()) {
                 return false;
@@ -682,7 +662,7 @@ class Horde_ActiveSync
         if (!$delete) {
             // Parent
             $parentid = false;
-            if ($this->_decoder->getElementStartTag(SYNC_FOLDERHIERARCHY_PARENTID)) {
+            if ($this->_decoder->getElementStartTag(self::FOLDERHIERARCHY_PARENTID)) {
                 $parentid = $this->_decoder->getElementContent();
                 if (!$this->_decoder->getElementEndTag()) {
                     return false;
@@ -690,7 +670,7 @@ class Horde_ActiveSync
             }
 
             // Displayname
-            if (!$this->_decoder->getElementStartTag(SYNC_FOLDERHIERARCHY_DISPLAYNAME)) {
+            if (!$this->_decoder->getElementStartTag(self::FOLDERHIERARCHY_DISPLAYNAME)) {
                 return false;
             }
             $displayname = $this->_decoder->getElementContent();
@@ -700,7 +680,7 @@ class Horde_ActiveSync
 
             // Type
             $type = false;
-            if ($this->_decoder->getElementStartTag(SYNC_FOLDERHIERARCHY_TYPE)) {
+            if ($this->_decoder->getElementStartTag(self::FOLDERHIERARCHY_TYPE)) {
                 $type = $this->_decoder->getElementContent();
                 if (!$this->_decoder->getElementEndTag()) {
                     return false;
@@ -738,18 +718,18 @@ class Horde_ActiveSync
             // add folder id to the seen folders
             $seenfolders[] = $serverid;
 
-            $this->_encoder->startTag(SYNC_FOLDERHIERARCHY_FOLDERCREATE);
+            $this->_encoder->startTag(self::FOLDERHIERARCHY_FOLDERCREATE);
 
 
-            $this->_encoder->startTag(SYNC_FOLDERHIERARCHY_STATUS);
+            $this->_encoder->startTag(self::FOLDERHIERARCHY_STATUS);
             $this->_encoder->content(1);
             $this->_encoder->endTag();
 
-            $this->_encoder->startTag(SYNC_FOLDERHIERARCHY_SYNCKEY);
+            $this->_encoder->startTag(self::FOLDERHIERARCHY_SYNCKEY);
             $this->_encoder->content($newsynckey);
             $this->_encoder->endTag();
 
-            $this->_encoder->startTag(SYNC_FOLDERHIERARCHY_SERVERENTRYID);
+            $this->_encoder->startTag(self::FOLDERHIERARCHY_SERVERENTRYID);
             $this->_encoder->content($serverid);
             $this->_encoder->endTag();
 
@@ -758,25 +738,25 @@ class Horde_ActiveSync
             $this->_encoder->endTag();
         } elseif ($update) {
 
-            $this->_encoder->startTag(SYNC_FOLDERHIERARCHY_FOLDERUPDATE);
+            $this->_encoder->startTag(self::FOLDERHIERARCHY_FOLDERUPDATE);
 
-            $this->_encoder->startTag(SYNC_FOLDERHIERARCHY_STATUS);
+            $this->_encoder->startTag(self::FOLDERHIERARCHY_STATUS);
             $this->_encoder->content(1);
             $this->_encoder->endTag();
 
-            $this->_encoder->startTag(SYNC_FOLDERHIERARCHY_SYNCKEY);
+            $this->_encoder->startTag(self::FOLDERHIERARCHY_SYNCKEY);
             $this->_encoder->content($newsynckey);
             $this->_encoder->endTag();
 
             $this->_encoder->endTag();
         } elseif ($delete) {
-            $this->_encoder->startTag(SYNC_FOLDERHIERARCHY_FOLDERDELETE);
+            $this->_encoder->startTag(self::FOLDERHIERARCHY_FOLDERDELETE);
 
-            $this->_encoder->startTag(SYNC_FOLDERHIERARCHY_STATUS);
+            $this->_encoder->startTag(self::FOLDERHIERARCHY_STATUS);
             $this->_encoder->content($deletedstat);
             $this->_encoder->endTag();
 
-            $this->_encoder->startTag(SYNC_FOLDERHIERARCHY_SYNCKEY);
+            $this->_encoder->startTag(self::FOLDERHIERARCHY_SYNCKEY);
             $this->_encoder->content($newsynckey);
             $this->_encoder->endTag();
 
index f3c9a23..df92ce3 100644 (file)
@@ -97,7 +97,7 @@ class Horde_ActiveSync_Connector_Importer
     public function ImportMessageChange($id, $message)
     {
         /* do nothing if it is in a dummy folder */
-        if ($this->_folderId == SYNC_FOLDER_TYPE_DUMMY) {
+        if ($this->_folderId == Horde_ActiveSync::FOLDER_TYPE_DUMMY) {
             return false;
         }
 
@@ -143,7 +143,7 @@ class Horde_ActiveSync_Connector_Importer
     public function ImportMessageDeletion($id)
     {
         /* Do nothing if it is in a dummy folder */
-        if ($this->_folderId == SYNC_FOLDER_TYPE_DUMMY) {
+        if ($this->_folderId == Horde_ActiveSync::FOLDER_TYPE_DUMMY) {
             return true;
         }
 
@@ -177,7 +177,7 @@ class Horde_ActiveSync_Connector_Importer
     public function ImportMessageReadFlag($id, $flags)
     {
         /* Do nothing if it is a dummy folder */
-        if ($this->_folderId == SYNC_FOLDER_TYPE_DUMMY) {
+        if ($this->_folderId == Horde_ActiveSync::FOLDER_TYPE_DUMMY) {
             return true;
         }
 
@@ -221,7 +221,7 @@ class Horde_ActiveSync_Connector_Importer
     public function ImportFolderChange($id, $parent, $displayname, $type)
     {
         /* do nothing if it is a dummy folder */
-        if ($parent == SYNC_FOLDER_TYPE_DUMMY) {
+        if ($parent == Horde_ActiveSync::FOLDER_TYPE_DUMMY) {
             return false;
         }
 
@@ -254,7 +254,7 @@ class Horde_ActiveSync_Connector_Importer
     public function ImportFolderDeletion($id, $parent)
     {
         /* Do nothing if it is a dummy folder */
-        if ($parent == SYNC_FOLDER_TYPE_DUMMY) {
+        if ($parent == Horde_ActiveSync::FOLDER_TYPE_DUMMY) {
             return false;
         }
 
index 9294d05..963de77 100644 (file)
@@ -168,13 +168,13 @@ class Horde_ActiveSync_Driver_Horde extends Horde_ActiveSync_Driver_Base
 
         switch ($id) {
         case self::APPOINTMENTS_FOLDER:
-            $folder->type = SYNC_FOLDER_TYPE_APPOINTMENT;
+            $folder->type = Horde_ActiveSync::FOLDER_TYPE_APPOINTMENT;
             break;
         case self::CONTACTS_FOLDER:
-            $folder->type = SYNC_FOLDER_TYPE_CONTACT;
+            $folder->type = Horde_ActiveSync::FOLDER_TYPE_CONTACT;
             break;
         case self::TASKS_FOLDER:
-            $folder->type = SYNC_FOLDER_TYPE_TASK;
+            $folder->type = Horde_ActiveSync::FOLDER_TYPE_TASK;
             break;
         default:
             return false;
index d592994..8463d3c 100644 (file)
@@ -18,10 +18,10 @@ class Horde_ActiveSync_Message_Folder extends Horde_ActiveSync_Message_Base
     public function __construct($params = array())
     {
         $mapping = array (
-            SYNC_FOLDERHIERARCHY_SERVERENTRYID => array (Horde_ActiveSync_Message_Base::KEY_ATTRIBUTE => 'serverid'),
-            SYNC_FOLDERHIERARCHY_PARENTID => array (Horde_ActiveSync_Message_Base::KEY_ATTRIBUTE => 'parentid'),
-            SYNC_FOLDERHIERARCHY_DISPLAYNAME => array (Horde_ActiveSync_Message_Base::KEY_ATTRIBUTE => 'displayname'),
-            SYNC_FOLDERHIERARCHY_TYPE => array (Horde_ActiveSync_Message_Base::KEY_ATTRIBUTE => 'type')
+            Horde_ActiveSync::FOLDERHIERARCHY_SERVERENTRYID => array (Horde_ActiveSync_Message_Base::KEY_ATTRIBUTE => 'serverid'),
+            Horde_ActiveSync::FOLDERHIERARCHY_PARENTID => array (Horde_ActiveSync_Message_Base::KEY_ATTRIBUTE => 'parentid'),
+            Horde_ActiveSync::FOLDERHIERARCHY_DISPLAYNAME => array (Horde_ActiveSync_Message_Base::KEY_ATTRIBUTE => 'displayname'),
+            Horde_ActiveSync::FOLDERHIERARCHY_TYPE => array (Horde_ActiveSync_Message_Base::KEY_ATTRIBUTE => 'type')
         );
 
         parent::__construct($mapping, $params);
index be91f7a..85ba7d0 100644 (file)
@@ -46,7 +46,7 @@ class Horde_ActiveSync_Request_FolderSync extends Horde_ActiveSync_Request_Base
         $map = array();
 
         /* Start parsing input */
-        if (!$this->_decoder->getElementStartTag(SYNC_FOLDERHIERARCHY_FOLDERSYNC)) {
+        if (!$this->_decoder->getElementStartTag(Horde_ActiveSync::FOLDERHIERARCHY_FOLDERSYNC)) {
             $this->_logger->err('[Horde_ActiveSync::handleFolderSync] No input to parse');
             $this->_statusCode = self::STATUS_PROTOERR;
             $this->_handleError();
@@ -54,7 +54,7 @@ class Horde_ActiveSync_Request_FolderSync extends Horde_ActiveSync_Request_Base
         }
 
         /* Get the current synckey from PIM */
-        if (!$this->_decoder->getElementStartTag(SYNC_FOLDERHIERARCHY_SYNCKEY)) {
+        if (!$this->_decoder->getElementStartTag(Horde_ActiveSync::FOLDERHIERARCHY_SYNCKEY)) {
             $this->_logger->err('[Horde_ActiveSync::handleFolderSync] No input to parse');
             $this->_statusCode = self::STATUS_PROTOERR;
             $this->_handleError();
@@ -86,9 +86,9 @@ class Horde_ActiveSync_Request_FolderSync extends Horde_ActiveSync_Request_Base
         $this->_logger->debug('[Horde_ActiveSync::handleFolderSync] newSyncKey: ' . $newsynckey);
 
         /* Deal with folder hierarchy changes */
-        if ($this->_decoder->getElementStartTag(SYNC_FOLDERHIERARCHY_CHANGES)) {
+        if ($this->_decoder->getElementStartTag(Horde_ActiveSync::FOLDERHIERARCHY_CHANGES)) {
             // Ignore <Count> if present
-            if ($this->_decoder->getElementStartTag(SYNC_FOLDERHIERARCHY_COUNT)) {
+            if ($this->_decoder->getElementStartTag(Horde_ActiveSync::FOLDERHIERARCHY_COUNT)) {
                 $this->_decoder->getElementContent();
                 if (!$this->_decoder->getElementEndTag()) {
                     $this->_statusCode = self::STATUS_PROTOERR;
@@ -160,28 +160,28 @@ class Horde_ActiveSync_Request_FolderSync extends Horde_ActiveSync_Request_Base
         // Output our WBXML reply now
         $this->_encoder->StartWBXML();
 
-        $this->_encoder->startTag(SYNC_FOLDERHIERARCHY_FOLDERSYNC);
+        $this->_encoder->startTag(Horde_ActiveSync::FOLDERHIERARCHY_FOLDERSYNC);
 
-        $this->_encoder->startTag(SYNC_FOLDERHIERARCHY_STATUS);
+        $this->_encoder->startTag(Horde_ActiveSync::FOLDERHIERARCHY_STATUS);
         $this->_encoder->content($this->_statusCode);
         $this->_encoder->endTag();
 
-        $this->_encoder->startTag(SYNC_FOLDERHIERARCHY_SYNCKEY);
+        $this->_encoder->startTag(Horde_ActiveSync::FOLDERHIERARCHY_SYNCKEY);
         $this->_encoder->content($newsynckey);
         $this->_encoder->endTag();
 
-        $this->_encoder->startTag(SYNC_FOLDERHIERARCHY_CHANGES);
+        $this->_encoder->startTag(Horde_ActiveSync::FOLDERHIERARCHY_CHANGES);
 
-        $this->_encoder->startTag(SYNC_FOLDERHIERARCHY_COUNT);
+        $this->_encoder->startTag(Horde_ActiveSync::FOLDERHIERARCHY_COUNT);
         $this->_encoder->content($connector->count);
         $this->_encoder->endTag();
 
         if (count($connector->changed) > 0) {
             foreach ($connector->changed as $folder) {
                 if (isset($folder->serverid) && in_array($folder->serverid, $seenfolders)) {
-                    $this->_encoder->startTag(SYNC_FOLDERHIERARCHY_UPDATE);
+                    $this->_encoder->startTag(Horde_ActiveSync::FOLDERHIERARCHY_UPDATE);
                 } else {
-                    $this->_encoder->startTag(SYNC_FOLDERHIERARCHY_ADD);
+                    $this->_encoder->startTag(Horde_ActiveSync::FOLDERHIERARCHY_ADD);
                 }
                 $folder->encodeStream($this->_encoder);
                 $this->_encoder->endTag();
@@ -190,8 +190,8 @@ class Horde_ActiveSync_Request_FolderSync extends Horde_ActiveSync_Request_Base
 
         if (count($connector->deleted) > 0) {
             foreach ($connector->deleted as $folder) {
-                $this->_encoder->startTag(SYNC_FOLDERHIERARCHY_REMOVE);
-                $this->_encoder->startTag(SYNC_FOLDERHIERARCHY_SERVERENTRYID);
+                $this->_encoder->startTag(Horde_ActiveSync::FOLDERHIERARCHY_REMOVE);
+                $this->_encoder->startTag(Horde_ActiveSync::FOLDERHIERARCHY_SERVERENTRYID);
                 $this->_encoder->content($folder);
                 $this->_encoder->endTag();
                 $this->_encoder->endTag();
@@ -215,8 +215,8 @@ class Horde_ActiveSync_Request_FolderSync extends Horde_ActiveSync_Request_Base
     private function _handleError()
     {
         $this->_encoder->StartWBXML();
-        $this->_encoder->startTag(SYNC_FOLDERHIERARCHY_FOLDERSYNC);
-        $this->_encoder->startTag(SYNC_FOLDERHIERARCHY_STATUS);
+        $this->_encoder->startTag(Horde_ActiveSync::FOLDERHIERARCHY_FOLDERSYNC);
+        $this->_encoder->startTag(Horde_ActiveSync::FOLDERHIERARCHY_STATUS);
         $this->_encoder->content($this->_statusCode);
         $this->_encoder->endTag();
         $this->_encoder->endTag();
index c407bbf..c6ba3e7 100644 (file)
@@ -20,6 +20,18 @@ class Horde_ActiveSync_Request_GetItemEstimate extends Horde_ActiveSync_Request_
     const STATUS_NOTPRIMED = 3;
     const STATUS_KEYMISM = 4;
 
+    /* Request tag constants */
+    const GETITEMESTIMATE = 'GetItemEstimate:GetItemEstimate';
+    const VERSION = 'GetItemEstimate:Version';
+    const FOLDERS = 'GetItemEstimate:Folders';
+    const FOLDER = 'GetItemEstimate:Folder';
+    const FOLDERTYPE = 'GetItemEstimate:FolderType';
+    const FOLDERID = 'GetItemEstimate:FolderId';
+    const DATETIME = 'GetItemEstimate:DateTime';
+    const ESTIMATE = 'GetItemEstimate:Estimate';
+    const RESPONSE = 'GetItemEstimate:Response';
+    const STATUS = 'GetItemEstimate:Status';
+
     /**
      * Handle the request
      *
@@ -39,21 +51,21 @@ class Horde_ActiveSync_Request_GetItemEstimate extends Horde_ActiveSync_Request_
         $status = array();
         $collections = array();
 
-        if (!$this->_decoder->getElementStartTag(SYNC_GETITEMESTIMATE_GETITEMESTIMATE) ||
-            !$this->_decoder->getElementStartTag(SYNC_GETITEMESTIMATE_FOLDERS)) {
+        if (!$this->_decoder->getElementStartTag(self::GETITEMESTIMATE) ||
+            !$this->_decoder->getElementStartTag(self::FOLDERS)) {
 
             // Not sure why the protocol doesn't have a status for this...
             return false;
         }
 
         /* Obtain all the collections we are getting estimates for */
-        while ($this->_decoder->getElementStartTag(SYNC_GETITEMESTIMATE_FOLDER)) {
+        while ($this->_decoder->getElementStartTag(self::FOLDER)) {
 
             /* Status - Assume success */
             $cStatus = self::STATUS_SUCCESS;
 
             /* Collection Class */
-            if (!$this->_decoder->getElementStartTag(SYNC_GETITEMESTIMATE_FOLDERTYPE)) {
+            if (!$this->_decoder->getElementStartTag(self::FOLDERTYPE)) {
                 return false;
             }
             $class = $this->_decoder->getElementContent();
@@ -62,7 +74,7 @@ class Horde_ActiveSync_Request_GetItemEstimate extends Horde_ActiveSync_Request_
             }
 
             /* Collection Id */
-            if ($this->_decoder->getElementStartTag(SYNC_GETITEMESTIMATE_FOLDERID)) {
+            if ($this->_decoder->getElementStartTag(self::FOLDERID)) {
                 $collectionid = $this->_decoder->getElementContent();
                 if (!$this->_decoder->getElementEndTag()) {
                     return false;
@@ -115,20 +127,20 @@ class Horde_ActiveSync_Request_GetItemEstimate extends Horde_ActiveSync_Request_
         $this->_encoder->startWBXML();
 
         /* Start getting the actual esitmates and outputting the results */
-        $this->_encoder->startTag(SYNC_GETITEMESTIMATE_GETITEMESTIMATE);
+        $this->_encoder->startTag(self::GETITEMESTIMATE);
         foreach ($collections as $collection) {
-            $this->_encoder->startTag(SYNC_GETITEMESTIMATE_RESPONSE);
-            $this->_encoder->startTag(SYNC_GETITEMESTIMATE_STATUS);
+            $this->_encoder->startTag(self::RESPONSE);
+            $this->_encoder->startTag(self::STATUS);
             $this->_encoder->content($status[$collection['id']]);
             $this->_encoder->endTag();
-            $this->_encoder->startTag(SYNC_GETITEMESTIMATE_FOLDER);
-            $this->_encoder->startTag(SYNC_GETITEMESTIMATE_FOLDERTYPE);
+            $this->_encoder->startTag(self::FOLDER);
+            $this->_encoder->startTag(self::FOLDERTYPE);
             $this->_encoder->content($collection['class']);
             $this->_encoder->endTag();
-            $this->_encoder->startTag(SYNC_GETITEMESTIMATE_FOLDERID);
+            $this->_encoder->startTag(self::FOLDERID);
             $this->_encoder->content($collection['id']);
             $this->_encoder->endTag();
-            $this->_encoder->startTag(SYNC_GETITEMESTIMATE_ESTIMATE);
+            $this->_encoder->startTag(self::ESTIMATE);
 
             $importer = new Horde_ActiveSync_Connector_NullImporter();
             $state = $this->_driver->getStateObject($collection);
index 1a1d045..2ec96b9 100644 (file)
@@ -28,6 +28,15 @@ class Horde_ActiveSync_Request_Ping extends Horde_ActiveSync_Request_Base
     const STATUS_FOLDERSYNCREQD = 7;
     const STATUS_SERVERERROR = 8;
 
+    // Ping
+    const PING = 'Ping:Ping';
+    const STATUS = 'Ping:Status';
+    const LIFETIME =  'Ping:LifeTime';
+    const FOLDERS =  'Ping:Folders';
+    const FOLDER =  'Ping:Folder';
+    const SERVERENTRYID =  'Ping:ServerEntryId';
+    const FOLDERTYPE =  'Ping:FolderType';
+
     /**
      * Handle a PING command from the PIM. Ping is sent periodically by the PIM
      * to tell the server what folders we are interested in monitoring for
@@ -60,22 +69,22 @@ class Horde_ActiveSync_Request_Ping extends Horde_ActiveSync_Request_Base
         $lifetime = $state->getPingLifetime();
 
         /* Build the $collections array if we receive request from PIM */
-        if ($this->_decoder->getElementStartTag(SYNC_PING_PING)) {
-            if ($this->_decoder->getElementStartTag(SYNC_PING_LIFETIME)) {
+        if ($this->_decoder->getElementStartTag(self::PING)) {
+            if ($this->_decoder->getElementStartTag(self::LIFETIME)) {
                 $lifetime = $this->_decoder->getElementContent();
                 $state->setPingLifetime($lifetime);
                 $this->_decoder->getElementEndTag();
             }
 
-            if ($this->_decoder->getElementStartTag(SYNC_PING_FOLDERS)) {
+            if ($this->_decoder->getElementStartTag(self::FOLDERS)) {
                 $collections = array();
-                while ($this->_decoder->getElementStartTag(SYNC_PING_FOLDER)) {
+                while ($this->_decoder->getElementStartTag(self::FOLDER)) {
                     $collection = array();
-                    if ($this->_decoder->getElementStartTag(SYNC_PING_SERVERENTRYID)) {
+                    if ($this->_decoder->getElementStartTag(self::SERVERENTRYID)) {
                         $collection['id'] = $this->_decoder->getElementContent();
                         $this->_decoder->getElementEndTag();
                     }
-                    if ($this->_decoder->getElementStartTag(SYNC_PING_FOLDERTYPE)) {
+                    if ($this->_decoder->getElementStartTag(self::FOLDERTYPE)) {
                         $collection['class'] = $this->_decoder->getElementContent();
                         $this->_decoder->getElementEndTag();
                     }
@@ -108,7 +117,7 @@ class Horde_ActiveSync_Request_Ping extends Horde_ActiveSync_Request_Base
                 //check the remote wipe status
                 if ($this->_provisioning === true) {
                     $rwstatus = $state->getDeviceRWStatus($this->_devId);
-                    if ($rwstatus == SYNC_PROVISION_RWSTATUS_PENDING || $rwstatus == SYNC_PROVISION_RWSTATUS_WIPED) {
+                    if ($rwstatus == Horde_ActiveSync::PROVISION_RWSTATUS_PENDING || $rwstatus == Horde_ActiveSync::PROVISION_RWSTATUS_WIPED) {
                         $this->_statusCode = self::STATUS_FOLDERSYNCREQD;
                         break;
                     }
@@ -159,16 +168,16 @@ class Horde_ActiveSync_Request_Ping extends Horde_ActiveSync_Request_Base
         $this->_logger->info('[' . $this->_devId . '] Sending response for PING.');
         $this->_encoder->StartWBXML();
 
-        $this->_encoder->startTag(SYNC_PING_PING);
+        $this->_encoder->startTag(self::PING);
 
-        $this->_encoder->startTag(SYNC_PING_STATUS);
+        $this->_encoder->startTag(self::STATUS);
         $this->_encoder->content($this->_statusCode);
         $this->_encoder->endTag();
 
-        $this->_encoder->startTag(SYNC_PING_FOLDERS);
+        $this->_encoder->startTag(self::FOLDERS);
         foreach ($collections as $collection) {
             if (isset($changes[$collection['id']])) {
-                $this->_encoder->startTag(SYNC_PING_FOLDER);
+                $this->_encoder->startTag(self::FOLDER);
                 $this->_encoder->content($collection['id']);
                 $this->_encoder->endTag();
             }
index 45c6be1..b7ecfdb 100644 (file)
@@ -69,13 +69,13 @@ class Horde_ActiveSync_Request_Provision extends Horde_ActiveSync_Request_Base
 
         /* Start by assuming we are in stage 2 */
         $phase2 = true;
-        if (!$this->_decoder->getElementStartTag(SYNC_PROVISION_PROVISION)) {
+        if (!$this->_decoder->getElementStartTag(Horde_ActiveSync::PROVISION_PROVISION)) {
             return $this->_globalError(self::STATUS_PROTERROR);
         }
 
         /* Handle android remote wipe */
-        if ($this->_decoder->getElementStartTag(SYNC_PROVISION_REMOTEWIPE)) {
-            if (!$this->_decoder->getElementStartTag(SYNC_PROVISION_STATUS)) {
+        if ($this->_decoder->getElementStartTag(Horde_ActiveSync::PROVISION_REMOTEWIPE)) {
+            if (!$this->_decoder->getElementStartTag(Horde_ActiveSync::PROVISION_STATUS)) {
                 return $this->_globalError(self::STATUS_PROTERROR);
             }
             // TODO: Look at $status here...
@@ -87,9 +87,9 @@ class Horde_ActiveSync_Request_Provision extends Horde_ActiveSync_Request_Base
             /* Need to send *something* in the policytype field even if wiping */
             $policytype = self::POLICYTYPE_XML;
         } else {
-            if (!$this->_decoder->getElementStartTag(SYNC_PROVISION_POLICIES) ||
-                !$this->_decoder->getElementStartTag(SYNC_PROVISION_POLICY) ||
-                !$this->_decoder->getElementStartTag(SYNC_PROVISION_POLICYTYPE)) {
+            if (!$this->_decoder->getElementStartTag(Horde_ActiveSync::PROVISION_POLICIES) ||
+                !$this->_decoder->getElementStartTag(Horde_ActiveSync::PROVISION_POLICY) ||
+                !$this->_decoder->getElementStartTag(Horde_ActiveSync::PROVISION_POLICYTYPE)) {
 
                 return $this->_globalError(self::STATUS_PROTERROR);
             }
@@ -108,11 +108,11 @@ class Horde_ActiveSync_Request_Provision extends Horde_ActiveSync_Request_Base
             }
 
             /* POLICYKEY is only sent by client in phase 3 */
-            if ($this->_decoder->getElementStartTag(SYNC_PROVISION_POLICYKEY)) {
+            if ($this->_decoder->getElementStartTag(Horde_ActiveSync::PROVISION_POLICYKEY)) {
                 $policykey = $this->_decoder->getElementContent();
                 $this->_logger->debug('PHASE 3 policykey sent from PIM: ' . $policykey);
                 if (!$this->_decoder->getElementEndTag() ||
-                    !$this->_decoder->getElementStartTag(SYNC_PROVISION_STATUS)) {
+                    !$this->_decoder->getElementStartTag(Horde_ActiveSync::PROVISION_STATUS)) {
 
                     return $this->_globalError(self::STATUS_PROTERROR);
                 }
@@ -133,8 +133,8 @@ class Horde_ActiveSync_Request_Provision extends Horde_ActiveSync_Request_Base
             }
 
             /* Handle remote wipe for other devices */
-            if ($this->_decoder->getElementStartTag(SYNC_PROVISION_REMOTEWIPE)) {
-                if (!$this->_decoder->getElementStartTag(SYNC_PROVISION_STATUS)) {
+            if ($this->_decoder->getElementStartTag(Horde_ActiveSync::PROVISION_REMOTEWIPE)) {
+                if (!$this->_decoder->getElementStartTag(Horde_ActiveSync::PROVISION_STATUS)) {
                     return $this->_globalError(self::STATUS_PROTERROR);
                 }
                 // @TODO: look at status here??
@@ -172,26 +172,26 @@ class Horde_ActiveSync_Request_Provision extends Horde_ActiveSync_Request_Base
             $state->setPolicyKey($this->_devId, $policykey);
         }
 
-        $this->_encoder->startTag(SYNC_PROVISION_PROVISION);
-        $this->_encoder->startTag(SYNC_PROVISION_STATUS);
+        $this->_encoder->startTag(Horde_ActiveSync::PROVISION_PROVISION);
+        $this->_encoder->startTag(Horde_ActiveSync::PROVISION_STATUS);
         $this->_encoder->content($status);
         $this->_encoder->endTag();
 
-        $this->_encoder->startTag(SYNC_PROVISION_POLICIES);
-        $this->_encoder->startTag(SYNC_PROVISION_POLICY);
-        $this->_encoder->startTag(SYNC_PROVISION_POLICYTYPE);
+        $this->_encoder->startTag(Horde_ActiveSync::PROVISION_POLICIES);
+        $this->_encoder->startTag(Horde_ActiveSync::PROVISION_POLICY);
+        $this->_encoder->startTag(Horde_ActiveSync::PROVISION_POLICYTYPE);
         $this->_encoder->content($policytype);
         $this->_encoder->endTag();
-        $this->_encoder->startTag(SYNC_PROVISION_STATUS);
+        $this->_encoder->startTag(Horde_ActiveSync::PROVISION_STATUS);
         $this->_encoder->content($policyStatus);
         $this->_encoder->endTag();
-        $this->_encoder->startTag(SYNC_PROVISION_POLICYKEY);
+        $this->_encoder->startTag(Horde_ActiveSync::PROVISION_POLICYKEY);
         $this->_encoder->content($policykey);
         $this->_encoder->endTag();
 
         /* Send security policies - configure this/move to it's own method...*/
         if ($phase2 && $status == self::STATUS_SUCCESS && $policyStatus == self::STATUS_SUCCESS) {
-            $this->_encoder->startTag(SYNC_PROVISION_DATA);
+            $this->_encoder->startTag(Horde_ActiveSync::PROVISION_DATA);
             if ($policytype == self::POLICYTYPE_XML) {
                 $this->_encoder->content($this->_driver->getCurrentPolicy(self::POLICYTYPE_XML));
             } else {
@@ -205,7 +205,7 @@ class Horde_ActiveSync_Request_Provision extends Horde_ActiveSync_Request_Base
 
         //wipe data if status is pending or wiped
         if ($rwstatus == self::RWSTATUS_PENDING || $rwstatus == self::RWSTATUS_WIPED) {
-            $this->_encoder->startTag(SYNC_PROVISION_REMOTEWIPE, false, true);
+            $this->_encoder->startTag(Horde_ActiveSync::PROVISION_REMOTEWIPE, false, true);
             $state->setDeviceRWStatus($this->_devId, self::RWSTATUS_WIPED);
         }
 
@@ -217,8 +217,8 @@ class Horde_ActiveSync_Request_Provision extends Horde_ActiveSync_Request_Base
     private function _globalError($status)
     {
         $this->_encoder->StartWBXML();
-        $this->_encoder->startTag(SYNC_PROVISION_PROVISION);
-        $this->_encoder->startTag(SYNC_PROVISION_STATUS);
+        $this->_encoder->startTag(Horde_ActiveSync::PROVISION_PROVISION);
+        $this->_encoder->startTag(Horde_ActiveSync::PROVISION_STATUS);
         $this->_encoder->content($status);
         $this->_encoder->endTag();
         $this->_encoder->endTag();
index 90869ff..e93300b 100644 (file)
@@ -250,7 +250,7 @@ class Horde_ActiveSync_State_File extends Horde_ActiveSync_State_Base
         $unique_folders = array ();
         foreach ($folders as $folder) {
             // don't save folder-ids for emails
-            if ($folder->type == SYNC_FOLDER_TYPE_INBOX) {
+            if ($folder->type == Horde_ActiveSync::FOLDER_TYPE_INBOX) {
                 continue;
             }
 
@@ -262,11 +262,11 @@ class Horde_ActiveSync_State_File extends Horde_ActiveSync_State_Base
 
         // Treo does initial sync for calendar and contacts too, so we need to fake
         // these folders if they are not supported by the backend
-        if (!array_key_exists(SYNC_FOLDER_TYPE_APPOINTMENT, $unique_folders)) {
-            $unique_folders[SYNC_FOLDER_TYPE_APPOINTMENT] = SYNC_FOLDER_TYPE_DUMMY;
+        if (!array_key_exists(Horde_ActiveSync::FOLDER_TYPE_APPOINTMENT, $unique_folders)) {
+            $unique_folders[Horde_ActiveSync::FOLDER_TYPE_APPOINTMENT] = Horde_ActiveSync::FOLDER_TYPE_DUMMY;
         }
-        if (!array_key_exists(SYNC_FOLDER_TYPE_CONTACT, $unique_folders)) {
-            $unique_folders[SYNC_FOLDER_TYPE_CONTACT] = SYNC_FOLDER_TYPE_DUMMY;
+        if (!array_key_exists(Horde_ActiveSync::FOLDER_TYPE_CONTACT, $unique_folders)) {
+            $unique_folders[Horde_ActiveSync::FOLDER_TYPE_CONTACT] = Horde_ActiveSync::FOLDER_TYPE_DUMMY;
 
         }
         if (!file_put_contents($this->_stateDir . '/' . $this->_backend->getUser() . '/compat-' . $devId, serialize($unique_folders))) {
@@ -290,10 +290,10 @@ class Horde_ActiveSync_State_File extends Horde_ActiveSync_State_Base
         if (file_exists($filename)) {
             $arr = unserialize(file_get_contents($filename));
             if ($class == "Calendar") {
-                return $arr[SYNC_FOLDER_TYPE_APPOINTMENT];
+                return $arr[Horde_ActiveSync::FOLDER_TYPE_APPOINTMENT];
             }
             if ($class == "Contacts") {
-                return $arr[SYNC_FOLDER_TYPE_CONTACT];
+                return $arr[Horde_ActiveSync::FOLDER_TYPE_CONTACT];
             }
         }
 
@@ -581,7 +581,7 @@ class Horde_ActiveSync_State_File extends Horde_ActiveSync_State_Base
             $this->_logger->debug('[' . $this->_devId . ']' . count($syncState) . ' messages in state.');
 
             /* do nothing if it is a dummy folder */
-            if ($folderId != SYNC_FOLDER_TYPE_DUMMY) {
+            if ($folderId != Horde_ActiveSync::FOLDER_TYPE_DUMMY) {
                 // on ping: check if backend supports alternative PING mechanism & use it
                 if ($this->_collection['class'] === false && $flags == BACKEND_DISCARD_DATA && $this->_backend->AlterPing()) {
                     //@TODO - look at the passing of syncstate here - should probably pass self??
index a6c98b9..f115743 100644 (file)
@@ -202,7 +202,7 @@ class Horde_ActiveSync_State_History extends Horde_ActiveSync_State_Base
         $unique_folders = array ();
         foreach ($folders as $folder) {
             // don't save folder-ids for emails
-            if ($folder->type == SYNC_FOLDER_TYPE_INBOX) {
+            if ($folder->type == Horde_ActiveSync::FOLDER_TYPE_INBOX) {
                 continue;
             }
 
@@ -214,11 +214,11 @@ class Horde_ActiveSync_State_History extends Horde_ActiveSync_State_Base
 
         // Treo does initial sync for calendar and contacts too, so we need to fake
         // these folders if they are not supported by the backend
-        if (!array_key_exists(SYNC_FOLDER_TYPE_APPOINTMENT, $unique_folders)) {
-            $unique_folders[SYNC_FOLDER_TYPE_APPOINTMENT] = SYNC_FOLDER_TYPE_DUMMY;
+        if (!array_key_exists(Horde_ActiveSync::FOLDER_TYPE_APPOINTMENT, $unique_folders)) {
+            $unique_folders[Horde_ActiveSync::FOLDER_TYPE_APPOINTMENT] = Horde_ActiveSync::FOLDER_TYPE_DUMMY;
         }
-        if (!array_key_exists(SYNC_FOLDER_TYPE_CONTACT, $unique_folders)) {
-            $unique_folders[SYNC_FOLDER_TYPE_CONTACT] = SYNC_FOLDER_TYPE_DUMMY;
+        if (!array_key_exists(Horde_ActiveSync::FOLDER_TYPE_CONTACT, $unique_folders)) {
+            $unique_folders[Horde_ActiveSync::FOLDER_TYPE_CONTACT] = Horde_ActiveSync::FOLDER_TYPE_DUMMY;
         }
         /* Storage to SQL? */
 //
@@ -242,10 +242,10 @@ class Horde_ActiveSync_State_History extends Horde_ActiveSync_State_Base
 //        if (file_exists($filename)) {
 //            $arr = unserialize(file_get_contents($filename));
 //            if ($class == "Calendar") {
-//                return $arr[SYNC_FOLDER_TYPE_APPOINTMENT];
+//                return $arr[Horde_ActiveSync::FOLDER_TYPE_APPOINTMENT];
 //            }
 //            if ($class == "Contacts") {
-//                return $arr[SYNC_FOLDER_TYPE_CONTACT];
+//                return $arr[Horde_ActiveSync::FOLDER_TYPE_CONTACT];
 //            }
 //        }
 //
@@ -425,7 +425,7 @@ class Horde_ActiveSync_State_History extends Horde_ActiveSync_State_Base
             $this->_logger->debug('Initializing message diff engine');
 
             //do nothing if it is a dummy folder
-            if ($folderId != SYNC_FOLDER_TYPE_DUMMY) {
+            if ($folderId != Horde_ActiveSync::FOLDER_TYPE_DUMMY) {
                 /* First, need to see if we have exising changes left over
                  * from a previous sync that resulted in a MORE_AVAILABLE */
                 if (!$empty($this->_changes)) {