Merge branch '2014.11' into 2014.11-develop
authorPhilipp Schüle <p.schuele@metaways.de>
Thu, 22 Oct 2015 09:42:23 +0000 (11:42 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 22 Oct 2015 09:42:23 +0000 (11:42 +0200)
Conflicts:
tine20/Tinebase/Setup/Update/Release8.php
tine20/Tinebase/Setup/setup.xml

Change-Id: Ifd975cf8639acc56480cba89372c9079302dbabb

1  2 
tine20/Tinebase/Setup/Update/Release8.php
tine20/Tinebase/Setup/setup.xml

@@@ -499,45 -499,28 +499,69 @@@ class Tinebase_Setup_Update_Release8 ex
          $this->setTableVersion('groups', '5');
          $this->setApplicationVersion('Tinebase', '8.10');
      }
-     
      /**
 -     * update 10 -> adds index to relations
 +     * update 10 -> adds "use personal tags" role right to all installed apps
 +     * 
 +     * @see 0010732: add "use personal tags" right to all applications
       */
      public function update_10()
      {
 -        $this->setApplicationVersion('Tinebase', '8.11');
 +        try {
 +            $userRole = Tinebase_Acl_Roles::getInstance()->getRoleByName('user role');
 +            
 +            $enabledApplications = Tinebase_Application::getInstance()->getApplicationsByState(Tinebase_Application::ENABLED);
 +            foreach ($enabledApplications as $application) {
 +                $allRights = Tinebase_Application::getInstance()->getAllRights($application->getId());
 +                if (in_array(Tinebase_Acl_Rights::USE_PERSONAL_TAGS, $allRights)) {
 +                    Tinebase_Acl_Roles::getInstance()->addSingleRight($userRole->getId(), $application->getId(), Tinebase_Acl_Rights::USE_PERSONAL_TAGS);
 +                }
 +            }
 +            
 +        } catch (Tinebase_Exception_NotFound $tenf) {
 +            // do nothing
 +        }
 +        
 +        $this->setApplicationVersion('Tinebase', '8.11');
 +    }
 +
 +    /**
 +     * update 11
 +     *
 +     * @see 0011178: allow to lock preferences for individual users
 +     */
 +    public function update_11()
 +    {
 +        $declaration = new Setup_Backend_Schema_Field_Xml('<field>
 +                    <name>locked</name>
 +                    <type>boolean</type>
 +                </field>');
 +        $this->_backend->addCol('preferences', $declaration);
 +        $this->setTableVersion('preferences', '8');
 +        $this->setApplicationVersion('Tinebase', '8.12');
 +    }
++
++    /**
++     * update 10 -> adds index to relations
++     */
++    public function update_12()
++    {
+         $tableVersion = $this->getTableVersion('relations');
+         if ($tableVersion < 8) {
+             $declaration = new Setup_Backend_Schema_Index_Xml('
+                     <index>
+                         <name>own_id</name>
+                         <field>
+                             <name>own_id</name>
+                         </field>
+                     </index>
+                 ');
+             $this->_backend->addIndex('relations', $declaration);
+             $this->setTableVersion('relations', '8');
+         }
++        $this->setApplicationVersion('Tinebase', '8.13');
+     }
  }
@@@ -1,7 -1,7 +1,7 @@@
  <?xml version="1.0" encoding="utf-8"?>
  <application>
      <name>Tinebase</name>
-     <version>8.12</version>
 -    <version>8.11</version>
++    <version>8.13</version>
      <tables>
          <table>
              <name>applications</name>