Merge branch 'pu/inventory'
authorPhilipp Schüle <p.schuele@metaways.de>
Thu, 17 Jan 2013 11:02:56 +0000 (12:02 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 17 Jan 2013 11:02:56 +0000 (12:02 +0100)
Conflicts:
tine20/Inventory/Setup/Update/Release6.php
tine20/Inventory/Setup/setup.xml

1  2 
tine20/Inventory/Setup/Update/Release6.php
tine20/Inventory/Setup/Update/Release7.php
tine20/Inventory/Setup/setup.xml
tine20/Tinebase/Import/Abstract.php

@@@ -131,12 -131,23 +131,32 @@@ class Inventory_Setup_Update_Release6 e
      }
      
      /**
 -    
+      * Update import / export definitions
+      * Add note field
+      */
+     public function update_4()
+     {
+         Setup_Controller::getInstance()->createImportExportDefinitions(Tinebase_Application::getInstance()->getApplicationByName('Inventory'));
+         
+         $field = '<field>
+                     <name>adt_info</name>
+                     <type>text</type>
+                 </field>';
 -    
++        
+         $declaration = new Setup_Backend_Schema_Field_Xml($field);
+         $this->_backend->addCol('inventory_item', $declaration);
-     public function update_4()
++        
+         $this->setApplicationVersion('Inventory', '6.5');
+         $this->setTableVersion('inventory_item', '5');
+     }
+     
++    /**
 +     * update to 7.0
 +     * 
 +     * @return void
 +     */
++    public function update_5()
 +    {
 +        $this->setApplicationVersion('Inventory', '7.0');
 +    }
  }
index 59d7356,0000000..26f93f0
mode 100644,000000..100644
--- /dev/null
@@@ -1,69 -1,0 +1,87 @@@
 +<?php
 +/**
 + * Tine 2.0
 + *
 + * @package     Inventory
 + * @subpackage  Setup
 + * @license     http://www.gnu.org/licenses/agpl.html AGPL3
 + * @copyright   Copyright (c) 2012 Metaways Infosystems GmbH (http://www.metaways.de)
 + * @author      Philipp Schüle <p.schuele@metaways.de>
 + */
 +class Inventory_Setup_Update_Release7 extends Setup_Update_Abstract
 +{
 +    /**
 +     * update to 7.1
 +     * - add seq
 +     * 
 +     * @see 0000554: modlog: records can't be updated in less than 1 second intervals
 +     */
 +    public function update_0()
 +    {
 +        $declaration = Tinebase_Setup_Update_Release7::getRecordSeqDeclaration();
 +        try {
 +            $this->_backend->addCol('inventory_item', $declaration);
 +        } catch (Zend_Db_Statement_Exception $zdse) {
 +            // ignore
 +        }
 +        $this->setTableVersion('inventory_item', 3);
 +        
 +        Tinebase_Setup_Update_Release7::updateModlogSeq('Inventory_Model_InventoryItem', 'inventory_item');
 +        
 +        $this->setApplicationVersion('Inventory', '7.1');
 +    }
 +    
 +    /**
 +     * update to 7.2
 +     * 
 +     * - Delete depreciation and amortization column
 +     * - Add depreciate_status
 +     * - Rename add_time to invoice_date
 +     * - Rename item_added to added_date and item_removed to removed_date
 +     * - Update ExportDefinitions
 +     */
 +    public function update_1()
 +    {
 +        if ($this->getTableVersion('inventory_item') != 3) {
 +            $release6 = new Inventory_Setup_Update_Release6($this->_backend);
 +            $release6->update_1();
 +        }
 +        $this->setApplicationVersion('Inventory', '7.2');
 +    }
 +
 +    /**
 +     * update to 7.3
 +     * 
 +     * - Add CSV import feature and ensure that imports does not cause errors
 +     * - Update import / export definitions
 +     */
 +    public function update_2()
 +    {
 +        if ($this->getTableVersion('inventory_item') != 4) {
 +            $release6 = new Inventory_Setup_Update_Release6($this->_backend);
 +            $release6->update_2();
 +        }
 +        
 +        Setup_Controller::getInstance()->createImportExportDefinitions(Tinebase_Application::getInstance()->getApplicationByName('Inventory'));
 +        
 +        $this->setApplicationVersion('Inventory', '7.3');
 +    }
++
++    /**
++     * update to 7.4
++     * 
++     * - Add note field
++     * - Update import / export definitions
++     */
++    public function update_3()
++    {
++        if ($this->getTableVersion('inventory_item') != 5) {
++            $release6 = new Inventory_Setup_Update_Release6($this->_backend);
++            $release6->update_4();
++        }
++        
++        Setup_Controller::getInstance()->createImportExportDefinitions(Tinebase_Application::getInstance()->getApplicationByName('Inventory'));
++        
++        $this->setApplicationVersion('Inventory', '7.4');
++    }
 +}
@@@ -2,7 -2,7 +2,7 @@@
  <application>
      <name>Inventory</name>
      <!-- gettext('Inventory') -->   
-     <version>7.3</version>
 -    <version>6.5</version>
++    <version>7.4</version>
      <order>60</order>
      <status>enabled</status>
      <tables>
                      <type>datetime</type>
                  </field>
                  <field>
 +                    <name>seq</name>
 +                    <type>integer</type>
 +                    <notnull>true</notnull>
 +                    <default>0</default>
 +                </field>
++                <field>
+                     <name>adt_info</name>
+                     <type>text</type>
+                 </field>
                  <index>
                      <name>id</name>
                      <primary>true</primary>
Simple merge