Merge branch '2016.11' into 2016.11-develop
authorPhilipp Schüle <p.schuele@metaways.de>
Fri, 30 Dec 2016 09:40:27 +0000 (10:40 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Fri, 30 Dec 2016 09:40:27 +0000 (10:40 +0100)
Change-Id: Ib975339876293d7b36bf51da0f538f65c930f507

1  2 
tine20/Tinebase/Setup/Update/Release10.php
tine20/Tinebase/Setup/Update/Release9.php
tine20/composer.lock

index 8f90548,0000000..9bfa557
mode 100644,000000..100644
--- /dev/null
@@@ -1,48 -1,0 +1,48 @@@
-         $release9->update_10();
 +<?php
 +/**
 + * Tine 2.0
 + *
 + * @package     Tinebase
 + * @subpackage  Setup
 + * @license     http://www.gnu.org/licenses/agpl.html AGPL3
 + * @copyright   Copyright (c) 2016 Metaways Infosystems GmbH (http://www.metaways.de)
 + * @author      Philipp Schüle <p.schuele@metaways.de>
 + */
 +class Tinebase_Setup_Update_Release10 extends Setup_Update_Abstract
 +{
 +    /**
 +     * update to 10.1
 +     *
 +     * @see 0012162: create new MailFiler application
 +     */
 +    public function update_0()
 +    {
 +        $release9 = new Tinebase_Setup_Update_Release9($this->_backend);
 +        $release9->update_9();
 +        $this->setApplicationVersion('Tinebase', '10.1');
 +    }
 +
 +    /**
 +     * update to 10.2
 +     *
 +     * @see 0012300: add container owner column
 +     */
 +    public function update_1()
 +    {
 +        $release9 = new Tinebase_Setup_Update_Release9($this->_backend);
-         $release9->update_11();
++        $release9->update_4();
 +        $this->setApplicationVersion('Tinebase', '10.2');
 +    }
 +
 +    /**
 +     * update to 10.3
 +     *
 +     * change length of groups.description column from varchar(255) to text
 +     */
 +    public function update_2()
 +    {
 +        $release9 = new Tinebase_Setup_Update_Release9($this->_backend);
++        $release9->update_5();
 +        $this->setApplicationVersion('Tinebase', '10.3');
 +    }
 +}
@@@ -227,180 -321,6 +321,90 @@@ class Tinebase_Setup_Update_Release9 ex
          }
  
          $this->setTableVersion('import', '2');
-         $this->setApplicationVersion('Tinebase', '9.8');
-     }
-     /**
-      * update to 9.11
-      *
-      * @see 0012300: add container owner column
-      */
-     public function update_8()
-     {
-         if ($this->getTableVersion('container') < 11) {
-             $declaration = new Setup_Backend_Schema_Field_Xml(
-                 '<field>
-                 <name>owner_id</name>
-                 <type>text</type>
-                 <length>40</length>
-                 <notnull>false</notnull>
-             </field>
-             ');
-             $this->_backend->addCol('container', $declaration);
-             $declaration = new Setup_Backend_Schema_Index_Xml('
-                 <index>
-                     <name>owner_id</name>
-                     <field>
-                         <name>owner_id</name>
-                     </field>
-                 </index>
-             ');
-             $this->_backend->addIndex('container', $declaration);
-             $this->setTableVersion('container', 11);
-         }
-         $this->_setContainerOwners();
-         $this->setApplicationVersion('Tinebase', '9.9');
-     }
-     /**
-      * write owner to all personal containers
-      */
-     protected function _setContainerOwners()
-     {
-         $filter = new Tinebase_Model_ContainerFilter(array(
-             array('field' => 'type', 'operator' => 'equals', 'value' => Tinebase_Model_Container::TYPE_PERSONAL),
-             array('field' => 'owner_id', 'operator' => 'isnull', 'value' => ''),
-         ));
-         $count = 0;
-         $paging = new Tinebase_Model_Pagination(array(
-             'start' => 0,
-             'limit' => 100,
-         ));
-         $containers = Tinebase_Container::getInstance()->search($filter, $paging);
-         while (count($containers) > 0) {
-             foreach ($containers as $container) {
-                 $ownerId = Tinebase_Container::getInstance()->getContainerOwner($container);
-                 if ($ownerId) {
-                     $container->owner_id = $ownerId;
-                     Tinebase_Container::getInstance()->update($container);
-                     $count++;
-                 }
-             }
-             $paging->start += $paging->limit;
-             $containers = Tinebase_Container::getInstance()->search($filter, $paging);
-         }
-         if (Tinebase_Core::isLogLevel(Zend_Log::INFO)) Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__
-             . ' Set owner for ' . $count . ' containers.');
-     }
-     /**
-      * update to 9.10
-      *
-      * change length of groups.description column from varchar(255) to text
-      */
-     public function update_9()
-     {
-         if ($this->getTableVersion('groups') < 6) {
-             $declaration = new Setup_Backend_Schema_Field_Xml(
-                 '<field>
-                     <name>description</name>
-                     <type>text</type>
-                     <notnull>false</notnull>
-                 </field>
-             ');
-             $this->_backend->alterCol('groups', $declaration);
-             $this->setTableVersion('groups', '6');
-         }
          $this->setApplicationVersion('Tinebase', '9.10');
      }
 +
 +    /**
 +     * update to 9.11
 +     *
 +     * @see xxx: add numberables
 +     */
 +    public function update_10()
 +    {
 +        $declaration = new Setup_Backend_Schema_Table_Xml('<table>
 +            <name>numberable</name>
 +            <version>1</version>
 +            <declaration>
 +                <field>
 +                    <name>id</name>
 +                    <type>integer</type>
 +                    <notnull>true</notnull>
 +                    <autoincrement>true</autoincrement>
 +                </field>
 +                <field>
 +                    <name>bucket</name>
 +                    <type>text</type>
 +                    <length>255</length>
 +                    <notnull>false</notnull>
 +                </field>
 +                <field>
 +                    <name>number</name>
 +                    <type>integer</type>
 +                    <notnull>true</notnull>
 +                </field>
 +                <index>
 +                    <name>id</name>
 +                    <primary>true</primary>
 +                    <field>
 +                        <name>id</name>
 +                    </field>
 +                </index>
 +                <index>
 +                    <name>bucket_number</name>
 +                    <unique>true</unique>
 +                    <field>
 +                        <name>bucket</name>
 +                    </field>
 +                    <field>
 +                        <name>number</name>
 +                    </field>
 +                </index>
 +            </declaration>
 +        </table>');
 +
 +        $this->createTable('numberable', $declaration);
 +        $this->setApplicationVersion('Tinebase', '9.11');
 +    }
 +
 +    /**
 +     * update to 9.12
 +     *
 +     * @see 0012162: create new MailFiler application
 +     */
 +    public function update_11()
 +    {
 +        if ($this->getTableVersion('tree_fileobjects') < 3) {
 +            $declaration = new Setup_Backend_Schema_Field_Xml('
 +                <field>
 +                    <name>description</name>
 +                    <type>text</type>
 +                    <notnull>false</notnull>
 +                </field>
 +            ');
 +            $this->_backend->alterCol('tree_fileobjects', $declaration);
 +            $this->setTableVersion('tree_fileobjects', '3');
 +        }
 +
 +        $this->setApplicationVersion('Tinebase', '9.12');
 +    }
 +
 +    /**
 +     * update to 10.0
 +     *
 +     * @return void
 +     */
 +    public function update_12()
 +    {
 +        $this->setApplicationVersion('Tinebase', '10.0');
 +    }
  }
Simple merge