Merge branch '2014.11' into 2014.11-develop
authorPhilipp Schüle <p.schuele@metaways.de>
Mon, 25 Jan 2016 08:08:25 +0000 (09:08 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 25 Jan 2016 08:08:25 +0000 (09:08 +0100)
Conflicts:
tine20/Calendar/Setup/Update/Release8.php

Change-Id: I6deeb82f286072311b6bf0fd24d3d66dcffd09c4

tine20/Calendar/Setup/Update/Release8.php

index 57955ec..ff0e3b0 100644 (file)
@@ -502,17 +502,19 @@ class Calendar_Setup_Update_Release8 extends Setup_Update_Abstract
      */
     public function update_11()
     {
-        $deviceBackend = new ActiveSync_Backend_Device();
-        $usersWithiPhones = $deviceBackend->search(new ActiveSync_Model_DeviceFilter(array(
-            'devicetype' => 'iphone'
-        )))->owner_id;
-
-        $activeSyncController = ActiveSync_Controller::getInstance();
-        foreach($usersWithiPhones as $userId) {
-            try {
-                $activeSyncController->resetSyncForUser($userId, 'Calendar');
-            } catch (Exception $e) {
-                Tinebase_Exception::log($e, /* suppress trace */ false);
+        if (Tinebase_Application::getInstance()->isInstalled('ActiveSync')) {
+            $deviceBackend = new ActiveSync_Backend_Device();
+            $usersWithiPhones = $deviceBackend->search(new ActiveSync_Model_DeviceFilter(array(
+                'devicetype' => 'iphone'
+            )))->owner_id;
+
+            $activeSyncController = ActiveSync_Controller::getInstance();
+            foreach ($usersWithiPhones as $userId) {
+                try {
+                    $activeSyncController->resetSyncForUser($userId, 'Calendar');
+                } catch (Exception $e) {
+                    Tinebase_Exception::log($e, /* suppress trace */ false);
+                }
             }
         }