Merge branch '2014.11' into 2014.11-develop
authorPhilipp Schüle <p.schuele@metaways.de>
Wed, 20 Jan 2016 14:33:37 +0000 (15:33 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Wed, 20 Jan 2016 14:33:37 +0000 (15:33 +0100)
Conflicts:
tine20/Calendar/Setup/Update/Release8.php
tine20/Tinebase/Relations.php

Change-Id: I918e6a1c3784ec44d48c042fd63fb50fe286e546

1  2 
tests/tine20/Calendar/Frontend/ActiveSyncTest.php
tests/tine20/Tinebase/AllTests.php
tine20/Calendar/Controller/Event.php
tine20/Calendar/Setup/Update/Release8.php
tine20/Calendar/Setup/setup.xml
tine20/Crm/Controller/Lead.php
tine20/Tinebase/Relations.php
tine20/Tinebase/User.php
tine20/Tinebase/User/Sql.php
tine20/composer.json

Simple merge
Simple merge
@@@ -450,49 -450,22 +450,68 @@@ class Calendar_Setup_Update_Release8 ex
          $this->setTableVersion('cal_events', 11);
          $this->setApplicationVersion('Calendar', '8.10');
      }
-     
      /**
 -     * force activesync calendar resync for iOS devices
 +     * 
       */
      public function update_10()
      {
-         
 +        $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->setApplicationVersion('Calendar', '8.11');
++
 +        $this->setTableVersion('cal_resources', '3');
++
 +        $this->setApplicationVersion('Calendar', '8.11');
 +    }
++
++    /**
++     * force activesync calendar resync for iOS devices
++     */
++    public function update_11()
++    {
+         $deviceBackend = new ActiveSync_Backend_Device();
+         $usersWithiPhones = $deviceBackend->search(new ActiveSync_Model_DeviceFilter(array(
+             'devicetype' => 'iphone'
+         )), NULL, 'owner_id');
+         $activeSyncController = ActiveSync_Controller::getInstance();
+         foreach($usersWithiPhones as $userId) {
+             $activeSyncController->resetSyncForUser($userId, 'Calendar');
+         }
++        $this->setApplicationVersion('Calendar', '8.12');
+     }
  }
@@@ -2,7 -2,7 +2,7 @@@
  <application>
      <name>Calendar</name>
      <!-- gettext('Calendar') -->   
--    <version>8.11</version>
++    <version>8.12</version>
      <order>15</order>
      <status>enabled</status>
      <tables>
Simple merge
@@@ -145,8 -138,12 +145,15 @@@ class Tinebase_Relation
                  )) {
                      if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__
                          . ' Related record diff: ' . print_r($current->related_record->diff($update->related_record)->toArray(), true));
-                     
-                     $this->_setAppRecord($update, $_doCreateUpdateCheck);
+                     if ( !$update->related_record->has('container_id') ||
+                         Tinebase_Container::getInstance()->hasGrant(Tinebase_Core::getUser()->getId(), $update->related_record->container_id,
+                             array(Tinebase_Model_Grants::GRANT_EDIT, Tinebase_Model_Grants::GRANT_ADMIN)) ) {
 -                        $this->_setAppRecord($update);
++                        $this->_setAppRecord($update, $_doCreateUpdateCheck);
++                    } else {
++                        if (Tinebase_Core::isLogLevel(Zend_Log::NOTICE)) Tinebase_Core::getLogger()->notice(__METHOD__ . '::' . __LINE__ .
++                            ' Permission denied to update related record');
+                     }
                  }
              }
              
Simple merge
Simple merge
Simple merge