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

1  2 
tine20/Calendar/Setup/Update/Release8.php

@@@ -452,70 -452,26 +452,72 @@@ class Calendar_Setup_Update_Release8 ex
      }
  
      /**
 -     * force activesync calendar resync for iOS devices
 +     * 
       */
      public function update_10()
      {
-         $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);
 +        $declaration = new Setup_Backend_Schema_Field_Xml('
 +            <field>
 +                <name>status</name>
 +                <type>text</type>
 +                <length>32</length>
 +                <default>NEEDS-ACTION</default>
 +                <notnull>true</notnull>
 +            </field>');
 +        $this->_backend->addCol('cal_resources', $declaration);
 +
 +        $declaration = new Setup_Backend_Schema_Index_Xml('
 +            <index>
 +                <name>status</name>
 +                <field>
 +                    <name>status</name>
 +                </field>
 +            </index>');
 +        $this->_backend->addIndex('cal_resources', $declaration);
 +
 +        $declaration = new Setup_Backend_Schema_Field_Xml('
 +            <field>
 +                <name>suppress_notification</name>
 +                <type>boolean</type>
 +                <default>false</default>
 +            </field>');
 +        $this->_backend->addCol('cal_resources', $declaration);
 +
 +        $declaration = new Setup_Backend_Schema_Index_Xml('
 +            <index>
 +                <name>suppress_notification</name>
 +                <field>
 +                    <name>suppress_notification</name>
 +                </field>
 +            </index>');
 +        $this->_backend->addIndex('cal_resources', $declaration);
 +
 +        $this->setTableVersion('cal_resources', '3');
 +
 +        $this->setApplicationVersion('Calendar', '8.11');
 +    }
 +
 +    /**
 +     * force activesync calendar resync for iOS devices
 +     */
 +    public function update_11()
 +    {
+         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);
+                 }
              }
          }
  
 -        $this->setApplicationVersion('Calendar', '8.11');
 +        $this->setApplicationVersion('Calendar', '8.12');
      }
  }