fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [10140] added new column category_id


From: Erik Holm-Larsen
Subject: [Fmsystem-commits] [10140] added new column category_id
Date: Mon, 08 Oct 2012 10:10:58 +0000

Revision: 10140
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10140
Author:   erikhl
Date:     2012-10-08 10:10:58 +0000 (Mon, 08 Oct 2012)
Log Message:
-----------
added new column category_id

Modified Paths:
--------------
    trunk/logistic/inc/class.sobim_type_requirement.inc.php
    trunk/logistic/inc/class.uibim_type_requirement.inc.php
    trunk/logistic/inc/model/class.bim_item_type_requirement.inc.php
    trunk/logistic/setup/setup.inc.php
    trunk/logistic/setup/tables_current.inc.php
    trunk/logistic/setup/tables_update.inc.php

Modified: trunk/logistic/inc/class.sobim_type_requirement.inc.php
===================================================================
--- trunk/logistic/inc/class.sobim_type_requirement.inc.php     2012-10-08 
08:19:52 UTC (rev 10139)
+++ trunk/logistic/inc/class.sobim_type_requirement.inc.php     2012-10-08 
10:10:58 UTC (rev 10140)
@@ -47,11 +47,12 @@
                {
                        $user_id = $GLOBALS['phpgw_info']['user']['id'];
                        $now = time();
-                       $loc_id = $object->get_location_id();
+                       $entity_id = $object->get_entity_id();
+                       $category_id = $object->get_category_id();
                        $cust_attribute_id = $object->get_cust_attribute_id();
-                       $type_id = $project->get_project_type_id();
+                       $type_id = $object->get_project_type_id();
 
-                       $sql = "INSERT INTO lg_bim_item_type_requirement 
(location_id, cust_attribute_id, project_type_id, create_user, create_date) 
VALUES ('$loc_id','$cust_attribute_id',$type_id, $user_id, $now)";
+                       $sql = "INSERT INTO lg_bim_item_type_requirement 
(entity_id, category_id, cust_attribute_id, project_type_id, create_user, 
create_date) VALUES ($entity_id,$category_id,'$cust_attribute_id',$type_id, 
$user_id, $now)";
                        $result = $this->db->query($sql, __LINE__,__FILE__);
 
                        if($result)
@@ -144,8 +145,9 @@
                        {
                                $bim_item_type_requirement = new 
logistic_bim_item_type_requirement((int) $id);
 
-                               
$bim_item_type_requirement->set_location_id($this->unmarshal($this->db->f('location_id'),
 'int'));
-                               
$bim_item_type_requirement->set_cust_attribute_id($this->unmarshal($this->db->f('cust_attribute_id'),
 'int'));
+                               
$bim_item_type_requirement->set_entity_id($this->unmarshal($this->db->f('entity_id'),
 'int'));
+                               
$bim_item_type_requirement->set_category_id($this->unmarshal($this->db->f('category_id'),
 'int'));
+                               
$bim_item_type_requirement->set_cust_attribute_id($this->unmarshal($this->db->f('cust_attribute_id'),
 'string'));
                                
$bim_item_type_requirement->set_project_type_id($this->unmarshal($this->db->f('project_type_id'),
 'int'));
                        }
 

Modified: trunk/logistic/inc/class.uibim_type_requirement.inc.php
===================================================================
--- trunk/logistic/inc/class.uibim_type_requirement.inc.php     2012-10-08 
08:19:52 UTC (rev 10139)
+++ trunk/logistic/inc/class.uibim_type_requirement.inc.php     2012-10-08 
10:10:58 UTC (rev 10140)
@@ -234,7 +234,8 @@
 
                        if (isset($_POST['save']))
                        {
-                               
$req_type->set_location_id(phpgw::get_var('location_id'));
+                               
$req_type->set_entity_id(phpgw::get_var('entity_id'));
+                               
$req_type->set_category_id(phpgw::get_var('category_id'));
                                
$req_type->set_project_type_id(phpgw::get_var('project_type_id'));
                                $cust_attr_ids = phpgw::get_var('attributes');
                                $req_type->set_cust_attribute_id(implode(',', 
$cust_attr_ids));

Modified: trunk/logistic/inc/model/class.bim_item_type_requirement.inc.php
===================================================================
--- trunk/logistic/inc/model/class.bim_item_type_requirement.inc.php    
2012-10-08 08:19:52 UTC (rev 10139)
+++ trunk/logistic/inc/model/class.bim_item_type_requirement.inc.php    
2012-10-08 10:10:58 UTC (rev 10140)
@@ -33,10 +33,11 @@
        {
                public static $so;
 
-               protected static $id;
-               protected static $location_id;
-               protected static $project_type_id;
-               protected static $cust_attribute_id;
+               protected $id;
+               protected $entity_id;
+               protected $category_id;
+               protected $project_type_id;
+               protected $cust_attribute_id;
 
                /**
                 * Constructor.  Takes an optional ID.  If a contract is 
created from outside
@@ -59,16 +60,26 @@
                        return $this->id;
                }
 
-               public function set_location_id($location_id)
+               public function set_entity_id($entity_id)
                {
-                       $this->location_id = $location_id;
+                       $this->entity_id = $entity_id;
                }
 
-               public function get_location_id()
+               public function get_entity_id()
                {
-                       return $this->location_id;
+                       return $this->entity_id;
                }
 
+               public function set_category_id($category_id)
+               {
+                       $this->category_id = $category_id;
+               }
+
+               public function get_category_id()
+               {
+                       return $this->category_id;
+               }
+
                public function set_project_type_id($project_type_id)
                {
                        $this->project_type_id = $project_type_id;

Modified: trunk/logistic/setup/setup.inc.php
===================================================================
--- trunk/logistic/setup/setup.inc.php  2012-10-08 08:19:52 UTC (rev 10139)
+++ trunk/logistic/setup/setup.inc.php  2012-10-08 10:10:58 UTC (rev 10140)
@@ -1,6 +1,6 @@
 <?php
        $setup_info['logistic']['name'] = 'logistic';
-       $setup_info['logistic']['version'] = '0.0.5';
+       $setup_info['logistic']['version'] = '0.0.7';
        $setup_info['logistic']['app_order'] = 70;
        $setup_info['logistic']['enable'] = 1;
        $setup_info['logistic']['app_group']    = 'office';

Modified: trunk/logistic/setup/tables_current.inc.php
===================================================================
--- trunk/logistic/setup/tables_current.inc.php 2012-10-08 08:19:52 UTC (rev 
10139)
+++ trunk/logistic/setup/tables_current.inc.php 2012-10-08 10:10:58 UTC (rev 
10140)
@@ -101,7 +101,8 @@
                'lg_bim_item_type_requirement' => array(
                                'fd' => array(
                                                'id' => array('type' => 'auto', 
'precision' => 4, 'nullable' => false),
-                                               'location_id' => array('type' 
=> 'int', 'precision' => 4, 'nullable' => false),
+                                               'entity_id' => array('type' => 
'int', 'precision' => 4, 'nullable' => false),
+                                               'category_id' => array('type' 
=> 'int', 'precision' => 4, 'nullable' => false),
                                                'cust_attribute_id' => 
array('type' => 'varchar', 'precision' => 255, 'nullable' => false),
                                                'project_type_id' => 
array('type' => 'int', 'precision' => 4, 'nullable' => true),
                                                'create_user' => array('type' 
=> 'int', 'precision' => 4, 'nullable' => false),

Modified: trunk/logistic/setup/tables_update.inc.php
===================================================================
--- trunk/logistic/setup/tables_update.inc.php  2012-10-08 08:19:52 UTC (rev 
10139)
+++ trunk/logistic/setup/tables_update.inc.php  2012-10-08 10:10:58 UTC (rev 
10140)
@@ -75,4 +75,34 @@
 
                $GLOBALS['setup_info']['logistic']['currentver'] = '0.0.5';
                return $GLOBALS['setup_info']['logistic']['currentver'];
+       }
+
+       $test[] = '0.0.5';
+       function logistic_upgrade0_0_5()
+       {
+               
$GLOBALS['phpgw_setup']->oProc->DropColumn('lg_bim_item_type_requirement', 
array(), 'cust_attribute_id_id');
+
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('lg_bim_item_type_requirement','cust_attribute_id',array(
+                       'type' => 'varchar',
+                       'precision' => '255',
+                       'nullable' => True
+               ));
+
+               $GLOBALS['setup_info']['logistic']['currentver'] = '0.0.6';
+               return $GLOBALS['setup_info']['logistic']['currentver'];
+       }
+
+       $test[] = '0.0.6';
+       function logistic_upgrade0_0_6()
+       {
+               
$GLOBALS['phpgw_setup']->oProc->RenameColumn('lg_bim_item_type_requirement','location_id','entity_id');
+
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('lg_bim_item_type_requirement','category_id',array(
+                       'type' => 'varchar',
+                       'precision' => '255',
+                       'nullable' => True
+               ));
+
+               $GLOBALS['setup_info']['logistic']['currentver'] = '0.0.7';
+               return $GLOBALS['setup_info']['logistic']['currentver'];
        }
\ No newline at end of file




reply via email to

[Prev in Thread] Current Thread [Next in Thread]