Merge branch 'pu/inventory'
authorPhilipp Schüle <p.schuele@metaways.de>
Mon, 14 Jan 2013 13:23:13 +0000 (14:23 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 14 Jan 2013 13:23:13 +0000 (14:23 +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/Frontend/Json/Abstract.php

@@@ -91,12 -91,43 +91,52 @@@ class Inventory_Setup_Update_Release6 e
      }
      
      /**
 -        
+      * Add CSV import feature and ensure that imports does not cause errors
+      */
+     public function update_2()
+     {
+         $field = '
+              <field>
+                 <name>description</name>
+                 <type>text</type>
+                 <notnull>false</notnull>
+              </field>';
+         
+         $declaration = new Setup_Backend_Schema_Field_Xml($field);
+         $this->_backend->alterCol('inventory_item', $declaration, 'description');
+         $field = '
+             <field>
+                 <name>name</name>
+                 <type>text</type>
+                 <length>250</length>
+                 <notnull>true</notnull>
+             </field>';
+         
+         $declaration = new Setup_Backend_Schema_Field_Xml($field);
+         $this->_backend->alterCol('inventory_item', $declaration, 'name');
+         
+         $this->setApplicationVersion('Inventory', '6.3');
+         $this->setTableVersion('inventory_item', '4');
-     public function update_2()
+     }
++    
+     /**
+      * Update import / export definitions
+      */
+     public function update_3()
+     {
+         Setup_Controller::getInstance()->createImportExportDefinitions(Tinebase_Application::getInstance()->getApplicationByName('Inventory'));
+     
+         $this->setApplicationVersion('Inventory', '6.4');
++    }
+     
++    /**
 +     * update to 7.0
 +     * 
 +     * @return void
 +     */
++    public function update_4()
 +    {
 +        $this->setApplicationVersion('Inventory', '7.0');
      }
  }
index 9cc5ad8,0000000..59d7356
mode 100644,000000..100644
--- /dev/null
@@@ -1,51 -1,0 +1,69 @@@
 +<?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');
++    }
 +}
@@@ -2,7 -2,7 +2,7 @@@
  <application>
      <name>Inventory</name>
      <!-- gettext('Inventory') -->   
-     <version>7.2</version>
 -    <version>6.4</version>
++    <version>7.3</version>
      <order>60</order>
      <status>enabled</status>
      <tables>