fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [13654] backport from dev-syncromind


From: Sigurd Nes
Subject: [Fmsystem-commits] [13654] backport from dev-syncromind
Date: Tue, 14 Jul 2015 10:56:42 +0000

Revision: 13654
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=13654
Author:   sigurdne
Date:     2015-07-14 10:56:41 +0000 (Tue, 14 Jul 2015)
Log Message:
-----------
backport from dev-syncromind

Modified Paths:
--------------
    trunk/property/inc/class.soadmin_location.inc.php
    trunk/property/inc/class.solocation.inc.php
    trunk/property/setup/default_records.inc.php
    trunk/property/setup/setup.inc.php
    trunk/property/setup/tables_current.inc.php
    trunk/property/setup/tables_update.inc.php

Property Changed:
----------------
    trunk/


Property changes on: trunk
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/stavangerkommune:12743-12875,12986
   + /branches/dev-syncromind:13653
/branches/stavangerkommune:12743-12875,12986

Modified: trunk/property/inc/class.soadmin_location.inc.php
===================================================================
--- trunk/property/inc/class.soadmin_location.inc.php   2015-07-14 10:33:05 UTC 
(rev 13653)
+++ trunk/property/inc/class.soadmin_location.inc.php   2015-07-14 10:56:41 UTC 
(rev 13654)
@@ -208,19 +208,19 @@
                        $default_attrib['type'][]='V';
                        $default_attrib['precision'][] =4*$standard['id'];
                        $default_attrib['nullable'][] ='false';
-                       $default_attrib['input_text'][] ='dummy';
-                       $default_attrib['statustext'][] ='dummy';
+                       $default_attrib['input_text'][] ='location_code';
+                       $default_attrib['statustext'][] ='location_code';
                        $default_attrib['attrib_sort'][] ='';
                        $default_attrib['custom'][] ='';
 
                        $j++;
                        $default_attrib['id'][]= $j;
-                       $default_attrib['column_name'][]= 'loc' . 
$standard['id'] . '_name';
+                       $default_attrib['column_name'][]= 
"loc{$standard['id']}_name";
                        $default_attrib['type'][]='V';
                        $default_attrib['precision'][] =50;
                        $default_attrib['nullable'][] ='true';
-                       $default_attrib['input_text'][] ='dummy';
-                       $default_attrib['statustext'][] ='dummy';
+                       $default_attrib['input_text'][] 
="loc{$standard['id']}_name";
+                       $default_attrib['statustext'][] 
="loc{$standard['id']}_name";
                        $default_attrib['attrib_sort'][] ='';
                        $default_attrib['custom'][] ='';
 
@@ -230,8 +230,8 @@
                        $default_attrib['type'][]='I';
                        $default_attrib['precision'][] =4;
                        $default_attrib['nullable'][] ='true';
-                       $default_attrib['input_text'][] ='dummy';
-                       $default_attrib['statustext'][] ='dummy';
+                       $default_attrib['input_text'][] ='entry_date';
+                       $default_attrib['statustext'][] ='entry_date';
                        $default_attrib['attrib_sort'][] ='';
                        $default_attrib['custom'][] ='';
 
@@ -241,8 +241,8 @@
                        $default_attrib['type'][]='I';
                        $default_attrib['precision'][] =4;
                        $default_attrib['nullable'][] ='false';
-                       $default_attrib['input_text'][] ='dummy';
-                       $default_attrib['statustext'][] ='dummy';
+                       $default_attrib['input_text'][] ='category';
+                       $default_attrib['statustext'][] ='category';
                        $default_attrib['attrib_sort'][] ='';
                        $default_attrib['custom'][] ='';
 
@@ -252,8 +252,8 @@
                        $default_attrib['type'][]='I';
                        $default_attrib['precision'][] =4;
                        $default_attrib['nullable'][] ='false';
-                       $default_attrib['input_text'][] ='dummy';
-                       $default_attrib['statustext'][] ='dummy';
+                       $default_attrib['input_text'][] ='user_id';
+                       $default_attrib['statustext'][] ='user_id';
                        $default_attrib['attrib_sort'][] ='';
                        $default_attrib['custom'][] ='';
 
@@ -286,8 +286,8 @@
                        $default_attrib['type'][]='I';
                        $default_attrib['precision'][] =4;
                        $default_attrib['nullable'][] ='true';
-                       $default_attrib['input_text'][] ='dummy';
-                       $default_attrib['statustext'][] ='dummy';
+                       $default_attrib['input_text'][] ='change_type';
+                       $default_attrib['statustext'][] ='change_type';
                        $default_attrib['attrib_sort'][] ='';
                        $default_attrib['custom'][] ='';
 
@@ -342,12 +342,12 @@
                                $pk[$i-1]= 'loc' . $i;
 
                                $default_attrib['id'][]                         
= $i+$j;
-                               $default_attrib['column_name'][]        = 'loc' 
. $i;
+                               $default_attrib['column_name'][]        = 
"loc{$i}";
                                $default_attrib['type'][]                       
= 'V';
                                $default_attrib['precision'][]          = 4;
                                $default_attrib['nullable'][]           = 
'false';
-                               $default_attrib['input_text'][]         = 
'dummy';
-                               $default_attrib['statustext'][]         = 
'dummy';
+                               $default_attrib['input_text'][]         = 
"loc{$i}";
+                               $default_attrib['statustext'][]         = 
"loc{$i}";
                                $default_attrib['attrib_sort'][]        = '';
                                $default_attrib['custom'][]                     
= '';
                        }
@@ -374,6 +374,8 @@
                        $fd['area_gross'] = array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00');
                        $fd['area_net'] = array('type' => 'decimal','precision' 
=> '20','scale' => '2','nullable' => True,'default' => '0.00');
                        $fd['area_usable'] = array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00');
+                       $fd['modified_by'] = array('type' => 'int','precision' 
=> 4,'nullable' => true);
+                       $fd['modified_on'] = array('type' => 
'timestamp','nullable' => True,'default' => 'current_timestamp');
 
                        $ix = array('location_code');
                        $uc = array();

Modified: trunk/property/inc/class.solocation.inc.php
===================================================================
--- trunk/property/inc/class.solocation.inc.php 2015-07-14 10:33:05 UTC (rev 
13653)
+++ trunk/property/inc/class.solocation.inc.php 2015-07-14 10:56:41 UTC (rev 
13654)
@@ -1310,11 +1310,20 @@
                                }
                        }
 
-                       $cols   =implode(",", $cols) . ",entry_date,user_id";
-                       $vals   ="'" . implode("','", $vals) . "'," . "'" . 
time() . "','" . $this->account . "'";
+                       $cols[] = 'user_id';
+                       $cols[] = 'entry_date';
+                       $cols[] = 'modified_by';
+                       $cols[] = 'modified_on';
+                       $vals[] = $this->account;
+                       $vals[] = time();
+                       $vals[] = $this->account;
+                       $vals[] = date($this->db->datetime_format(),time());
 
+                       $cols   = implode(",", $cols);
+                       $vals   = "'" . implode("','", $vals)  . "'";
+
                        $this->db->transaction_begin();
-                       $sql    = "INSERT INTO fm_location$type_id ($cols) 
VALUES ($vals)";
+                       $sql    = "INSERT INTO fm_location{$type_id} ($cols) 
VALUES ($vals)";
 
                        //echo $sql;
                        $this->db->query($sql,__LINE__,__FILE__);
@@ -1368,11 +1377,12 @@
                                }
                        }
 
-                       $value_set['entry_date'] = time();
+                       $value_set['modified_by'] = $this->account;
+                       $value_set['modified_on'] = 
date($this->db->datetime_format(),time());
 
                        $value_set      = 
$this->db->validate_update($value_set);
 
-                       $sql = "SELECT * from fm_location$type_id where 
location_code ='" . $location['location_code'] . "'";
+                       $sql = "SELECT * FROM fm_location{$type_id} WHERE 
location_code ='{$location['location_code']}'";
                        $this->db->query($sql,__LINE__,__FILE__);
                        $this->db->next_record();
 
@@ -1410,10 +1420,10 @@
                        $vals = $this->db->validate_insert($vals);
 
                        $this->db->transaction_begin();
-                       $sql = "INSERT INTO fm_location" . $type_id ."_history 
($cols) VALUES ($vals)";
+                       $sql = "INSERT INTO fm_location{$type_id}_history 
($cols) VALUES ($vals)";
                        $this->db->query($sql,__LINE__,__FILE__);
 
-                       $sql = "UPDATE fm_location$type_id SET $value_set WHERE 
location_code='" . $location['location_code'] . "'";
+                       $sql = "UPDATE fm_location{$type_id} SET {$value_set} 
WHERE location_code='{$location['location_code']}'";
                        $this->db->query($sql,__LINE__,__FILE__);
 
                        $this->update_location_name($location['location_code']);
@@ -1808,15 +1818,15 @@
                                return;
                        }
 
-                       $table = 'fm_location' . $type_id . '_history';
+                       $table = "fm_location{$type_id}_history";
 
-                       $table_category = 'fm_location' . $type_id . 
'_category';
+                       $table_category = "fm_location{$type_id}_category";
                        $location_id = 
$GLOBALS['phpgw']->locations->get_id('property', ".location.{$type_id}");
                        $choice_table = 'phpgw_cust_choice';
                        $attribute_table = 'phpgw_cust_attribute';
-                       $attribute_filter = " location_id = {$location_id}";
+                       $attribute_filter = "location_id = {$location_id}";
 
-                       $sql = "SELECT column_name,datatype,input_text,id as 
attrib_id FROM $attribute_table WHERE $attribute_filter";
+                       $sql = "SELECT column_name,datatype,input_text,id AS 
attrib_id FROM {$attribute_table} WHERE {$attribute_filter}";
 
                        $this->db->query($sql,__LINE__,__FILE__);
                        while ($this->db->next_record())
@@ -1839,14 +1849,16 @@
 
 
                        $attrib[] = array
-                               (
-                                       'column_name'   => 'exp_date',
-                                       'input_text'    => 'exp date',
-                                       'datatype'              => 'D',
-                                       'attrib_id'             => 0
-                               );
+                       (
+                               'column_name'   => 'exp_date',
+                               'input_text'    => 'exp date',
+                               'datatype'              => 'D',
+                               'attrib_id'             => 0
+                       );
 
-                       $sql = "SELECT $table.*, $table_category.descr as 
category FROM $table $this->left_join $table_category ON $table.category 
=$table_category.id WHERE location_code='$location_code' ORDER BY exp_date 
DESC";
+                       $sql = "SELECT {$table}.*, {$table_category}.descr as 
category"
+                       . " FROM {$table} {$this->left_join} {$table_category} 
ON {$table}.category = {$table_category}.id"
+                       . " WHERE location_code='{$location_code}' ORDER BY 
exp_date DESC";
                        $this->db->query($sql,__LINE__,__FILE__);
 
                        $j=0;

Modified: trunk/property/setup/default_records.inc.php
===================================================================
--- trunk/property/setup/default_records.inc.php        2015-07-14 10:33:05 UTC 
(rev 13653)
+++ trunk/property/setup/default_records.inc.php        2015-07-14 10:56:41 UTC 
(rev 13654)
@@ -585,11 +585,27 @@
        $default_attrib['input_text'][] ='user_id';
        $default_attrib['statustext'][] ='user_id';
 
+       $default_attrib['id'][]= 6;
+       $default_attrib['column_name'][]= 'modified_by';
+       $default_attrib['type'][]='user';
+       $default_attrib['precision'][] =4;
+       $default_attrib['nullable'][] ='true';
+       $default_attrib['input_text'][] ='modified_by';
+       $default_attrib['statustext'][] ='modified_by';
+
+       $default_attrib['id'][]= 7;
+       $default_attrib['column_name'][]= 'modified_on';
+       $default_attrib['type'][]='DT';
+       $default_attrib['precision'][] =8;
+       $default_attrib['nullable'][] ='true';
+       $default_attrib['input_text'][] ='modified_on';
+       $default_attrib['statustext'][] ='modified_on';
+
        for ($i=1; $i<$location_type+1; $i++)
        {
                $pk[$i-1]= 'loc' . $i;
 
-               $default_attrib['id'][]= $i+5;
+               $default_attrib['id'][]= $i+7;
                $default_attrib['column_name'][]= 'loc' . $i;
                $default_attrib['type'][]='V';
                $default_attrib['precision'][] =4;
@@ -648,60 +664,60 @@
 # Dumping data for table fm_location_attrib
 #
 $location_id = $GLOBALS['phpgw']->locations->get_id('property', '.location.1');
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 8, 'status', 'Status', 'Status', 'LB', NULL, 1, NULL, NULL, 
NULL, NULL, 'True', 1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 9, 'remark', 'Remark', 'Remark', 'T', NULL, 2, NULL, NULL, NULL, 
NULL, 'True', 1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 10, 'mva', 'mva', 'Status', 'I', NULL, 3, NULL, 4, NULL, NULL, 
'True', 1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 11, 'kostra_id', 'kostra_id', 'kostra_id', 'I', NULL, 4, NULL, 
4, NULL, NULL, 'True', 1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 12, 'part_of_town_id', 'part_of_town_id', 'part_of_town_id', 
'I', NULL, NULL, NULL, 4, NULL, NULL, 'True', NULL)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 13, 'owner_id', 'owner_id', 'owner_id', 'I', NULL, NULL, NULL, 
4, NULL, NULL, 'True', NULL)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 14, 'change_type', 'change_type', 'change_type', 'I', NULL, 
NULL, NULL, 4, NULL, NULL, 'True', NULL)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 15, 'rental_area', 'Rental area', 'Rental area', 'N', NULL, 5, 
20, 2, NULL, 'True', 1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 16, 'area_gross', 'Gross area', 'Sum of the areas included 
within the outside face of the exterior walls of a building.', 'N', NULL, 5, 
20, 2, NULL, 'True', 1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 17, 'area_net', 'Net area', 'The wall-to-wall floor area of a 
room.', 'N', NULL, 5, 20, 2, NULL, 'True', 1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 18, 'area_usable', 'Usable area', 'generally measured from paint 
to paint inside the permanent walls and to the middle of partitions separating 
rooms', 'N', NULL, 5, 20, 2, NULL, 'True', 1)");
-
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice 
(location_id, attrib_id, id, value) VALUES ($location_id, 8, 1, 'OK')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice 
(location_id, attrib_id, id, value) VALUES ($location_id, 8, 2, 'Not OK')");
-
-
-$location_id = $GLOBALS['phpgw']->locations->get_id('property', '.location.2');
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 9, 'status', 'Status', 'Status', 'LB', NULL, 1, NULL, NULL, 
NULL, NULL, 'True', 1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 10, 'remark', 'Remark', 'Remark', 'T', NULL, 2, NULL, NULL, 
NULL, NULL, 'True', 1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 11, 'change_type', 'change_type', 'change_type', 'I', NULL, 
NULL, NULL, 4, NULL, NULL, 'True', NULL)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 12, 'rental_area', 'Rental area', 'Rental area', 'N', NULL, 3, 
20, 2, NULL, 'True', 1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 13, 'area_gross', 'Gross area', 'Sum of the areas included 
within the outside face of the exterior walls of a building.', 'N', NULL, 5, 
20, 2, NULL, 'True', 1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 14, 'area_net', 'Net area', 'The wall-to-wall floor area of a 
room.', 'N', NULL, 5, 20, 2, NULL, 'True', 1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 15, 'area_usable', 'Usable area', 'generally measured from paint 
to paint inside the permanent walls and to the middle of partitions separating 
rooms', 'N', NULL, 5, 20, 2, NULL, 'True', 1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice 
(location_id, attrib_id, id, value) VALUES ($location_id, 9, 1, 'OK')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice 
(location_id, attrib_id, id, value) VALUES ($location_id, 9, 2, 'Not OK')");
-
-$location_id = $GLOBALS['phpgw']->locations->get_id('property', '.location.3');
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 10, 'status', 'Status', 'Status', 'LB', NULL, 1, NULL, NULL, 
NULL, NULL, 'True', 1)");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 11, 'remark', 'Remark', 'Remark', 'T', NULL, 2, NULL, NULL, 
NULL, NULL, 'True', 1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 12, 'change_type', 'change_type', 'change_type', 'I', NULL, 
NULL, NULL, 4, NULL, NULL, 'True', NULL)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 13, 'rental_area', 'Rental area', 'Rental area', 'N', NULL, 3, 
20, 2, NULL, 'True', 1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 14, 'area_gross', 'Gross area', 'Sum of the areas included 
within the outside face of the exterior walls of a building.', 'N', NULL, 5, 
20, 2, NULL, 'True', 1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 15, 'area_net', 'Net area', 'The wall-to-wall floor area of a 
room.', 'N', NULL, 5, 20, 2, NULL, 'True', 1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 16, 'area_usable', 'Usable area', 'generally measured from paint 
to paint inside the permanent walls and to the middle of partitions separating 
rooms', 'N', NULL, 5, 20, 2, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 12, 'mva', 'mva', 'Status', 'I', NULL, 3, NULL, 4, NULL, NULL, 
'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 13, 'kostra_id', 'kostra_id', 'kostra_id', 'I', NULL, 4, NULL, 
4, NULL, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 14, 'part_of_town_id', 'part_of_town_id', 'part_of_town_id', 
'I', NULL, NULL, NULL, 4, NULL, NULL, 'True', NULL)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 15, 'owner_id', 'owner_id', 'owner_id', 'I', NULL, NULL, NULL, 
4, NULL, NULL, 'True', NULL)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 16, 'change_type', 'change_type', 'change_type', 'I', NULL, 
NULL, NULL, 4, NULL, NULL, 'True', NULL)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 17, 'rental_area', 'Rental area', 'Rental area', 'N', NULL, 5, 
20, 2, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 18, 'area_gross', 'Gross area', 'Sum of the areas included 
within the outside face of the exterior walls of a building.', 'N', NULL, 5, 
20, 2, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 19, 'area_net', 'Net area', 'The wall-to-wall floor area of a 
room.', 'N', NULL, 5, 20, 2, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 20, 'area_usable', 'Usable area', 'generally measured from paint 
to paint inside the permanent walls and to the middle of partitions separating 
rooms', 'N', NULL, 5, 20, 2, NULL, 'True', 1)");
+
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice 
(location_id, attrib_id, id, value) VALUES ($location_id, 10, 1, 'OK')");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice 
(location_id, attrib_id, id, value) VALUES ($location_id, 10, 2, 'Not OK')");
 
 
-$location_id = $GLOBALS['phpgw']->locations->get_id('property', '.location.4');
+$location_id = $GLOBALS['phpgw']->locations->get_id('property', '.location.2');
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 11, 'status', 'Status', 'Status', 'LB', NULL, 1, NULL, NULL, 
NULL, NULL, 'True', 1)");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 12, 'remark', 'Remark', 'Remark', 'T', NULL, 2, NULL, NULL, 
NULL, NULL, 'True', 1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 13, 'street_id', 'street_id', 'street_id', 'I', NULL, NULL, 
NULL, 4, NULL, NULL, 'True', NULL)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 14, 'street_number', 'street_number', 'street_number', 'I', 
NULL, NULL, NULL, 4, NULL, NULL, 'True', NULL)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 15, 'tenant_id', 'tenant_id', 'tenant_id', 'I', NULL, NULL, 
NULL, 4, NULL, NULL, 'True', NULL)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 16, 'change_type', 'change_type', 'change_type', 'I', NULL, 
NULL, NULL, 4, NULL, NULL, 'True', NULL)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 17, 'rental_area', 'Rental area', 'Rental area', 'N', NULL, 4, 
20, 2, NULL, 'True', 1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 18, 'area_gross', 'Gross area', 'Sum of the areas included 
within the outside face of the exterior walls of a building.', 'N', NULL, 5, 
20, 2, NULL, 'True', 1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 19, 'area_net', 'Net area', 'The wall-to-wall floor area of a 
room.', 'N', NULL, 5, 20, 2, NULL, 'True', 1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 20, 'area_usable', 'Usable area', 'generally measured from paint 
to paint inside the permanent walls and to the middle of partitions separating 
rooms', 'N', NULL, 5, 20, 2, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 13, 'change_type', 'change_type', 'change_type', 'I', NULL, 
NULL, NULL, 4, NULL, NULL, 'True', NULL)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 14, 'rental_area', 'Rental area', 'Rental area', 'N', NULL, 3, 
20, 2, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 15, 'area_gross', 'Gross area', 'Sum of the areas included 
within the outside face of the exterior walls of a building.', 'N', NULL, 5, 
20, 2, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 16, 'area_net', 'Net area', 'The wall-to-wall floor area of a 
room.', 'N', NULL, 5, 20, 2, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 17, 'area_usable', 'Usable area', 'generally measured from paint 
to paint inside the permanent walls and to the middle of partitions separating 
rooms', 'N', NULL, 5, 20, 2, NULL, 'True', 1)");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice 
(location_id, attrib_id, id, value) VALUES ($location_id, 11, 1, 'OK')");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice 
(location_id, attrib_id, id, value) VALUES ($location_id, 11, 2, 'Not OK')");
 
+$location_id = $GLOBALS['phpgw']->locations->get_id('property', '.location.3');
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 12, 'status', 'Status', 'Status', 'LB', NULL, 1, NULL, NULL, 
NULL, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 13, 'remark', 'Remark', 'Remark', 'T', NULL, 2, NULL, NULL, 
NULL, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 14, 'change_type', 'change_type', 'change_type', 'I', NULL, 
NULL, NULL, 4, NULL, NULL, 'True', NULL)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 15, 'rental_area', 'Rental area', 'Rental area', 'N', NULL, 3, 
20, 2, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 16, 'area_gross', 'Gross area', 'Sum of the areas included 
within the outside face of the exterior walls of a building.', 'N', NULL, 5, 
20, 2, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 17, 'area_net', 'Net area', 'The wall-to-wall floor area of a 
room.', 'N', NULL, 5, 20, 2, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 18, 'area_usable', 'Usable area', 'generally measured from paint 
to paint inside the permanent walls and to the middle of partitions separating 
rooms', 'N', NULL, 5, 20, 2, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice 
(location_id, attrib_id, id, value) VALUES ($location_id, 12, 1, 'OK')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice 
(location_id, attrib_id, id, value) VALUES ($location_id, 12, 2, 'Not OK')");
 
+
+$location_id = $GLOBALS['phpgw']->locations->get_id('property', '.location.4');
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 13, 'status', 'Status', 'Status', 'LB', NULL, 1, NULL, NULL, 
NULL, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 14, 'remark', 'Remark', 'Remark', 'T', NULL, 2, NULL, NULL, 
NULL, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 15, 'street_id', 'street_id', 'street_id', 'I', NULL, NULL, 
NULL, 4, NULL, NULL, 'True', NULL)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 16, 'street_number', 'street_number', 'street_number', 'I', 
NULL, NULL, NULL, 4, NULL, NULL, 'True', NULL)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 17, 'tenant_id', 'tenant_id', 'tenant_id', 'I', NULL, NULL, 
NULL, 4, NULL, NULL, 'True', NULL)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 18, 'change_type', 'change_type', 'change_type', 'I', NULL, 
NULL, NULL, 4, NULL, NULL, 'True', NULL)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 19, 'rental_area', 'Rental area', 'Rental area', 'N', NULL, 4, 
20, 2, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 20, 'area_gross', 'Gross area', 'Sum of the areas included 
within the outside face of the exterior walls of a building.', 'N', NULL, 5, 
20, 2, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 21, 'area_net', 'Net area', 'The wall-to-wall floor area of a 
room.', 'N', NULL, 5, 20, 2, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(location_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
($location_id, 22, 'area_usable', 'Usable area', 'generally measured from paint 
to paint inside the permanent walls and to the middle of partitions separating 
rooms', 'N', NULL, 5, 20, 2, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice 
(location_id, attrib_id, id, value) VALUES ($location_id, 13, 1, 'OK')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice 
(location_id, attrib_id, id, value) VALUES ($location_id, 13, 2, 'Not OK')");
+
+
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_action_pending_category 
(num, name, descr) VALUES ('approval', 'Approval', 'Please approve the item 
requested')");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_action_pending_category 
(num, name, descr) VALUES ('remind', 'Remind', 'This is a reminder of task 
assigned')");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_action_pending_category 
(num, name, descr) VALUES ('accept_delivery', 'Accept delivery', 'Please accept 
delivery on this item')");

Modified: trunk/property/setup/setup.inc.php
===================================================================
--- trunk/property/setup/setup.inc.php  2015-07-14 10:33:05 UTC (rev 13653)
+++ trunk/property/setup/setup.inc.php  2015-07-14 10:56:41 UTC (rev 13654)
@@ -12,7 +12,7 @@
        */
 
        $setup_info['property']['name']                 = 'property';
-       $setup_info['property']['version']              = '0.9.17.690';
+       $setup_info['property']['version']              = '0.9.17.691';
        $setup_info['property']['app_order']    = 8;
        $setup_info['property']['enable']               = 1;
        $setup_info['property']['app_group']    = 'office';

Modified: trunk/property/setup/tables_current.inc.php
===================================================================
--- trunk/property/setup/tables_current.inc.php 2015-07-14 10:33:05 UTC (rev 
13653)
+++ trunk/property/setup/tables_current.inc.php 2015-07-14 10:56:41 UTC (rev 
13654)
@@ -198,7 +198,9 @@
                                'rental_area' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
                                'area_gross' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
                                'area_net' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
-                               'area_usable' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00')
+                               'area_usable' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
+                               'modified_by' => array('type' => 
'int','precision' => 4,'nullable' => true),
+                               'modified_on' => array('type' => 
'timestamp','nullable' => True,'default' => 'current_timestamp')
                        ),
                        'pk' => array('loc1'),
                        'fk' => array('fm_location1_category' => 
array('category' => 'id')),
@@ -224,7 +226,9 @@
                                'area_gross' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
                                'area_net' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
                                'area_usable' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
-                               'exp_date' => array('type' => 
'timestamp','nullable' => True,'default' => 'current_timestamp')
+                               'exp_date' => array('type' => 
'timestamp','nullable' => True,'default' => 'current_timestamp'),
+                               'modified_by' => array('type' => 
'int','precision' => 4,'nullable' => true),
+                               'modified_on' => array('type' => 
'timestamp','nullable' => True,'default' => 'current_timestamp')
                        ),
                        'pk' => array(),
                        'fk' => array(),
@@ -256,7 +260,9 @@
                                'rental_area' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
                                'area_gross' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
                                'area_net' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
-                               'area_usable' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00')
+                               'area_usable' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
+                               'modified_by' => array('type' => 
'int','precision' => 4,'nullable' => true),
+                               'modified_on' => array('type' => 
'timestamp','nullable' => True,'default' => 'current_timestamp')
                        ),
                        'pk' => array('loc1','loc2'),
                        'fk' => array(
@@ -282,7 +288,9 @@
                                'area_gross' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
                                'area_net' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
                                'area_usable' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
-                               'exp_date' => array('type' => 
'timestamp','nullable' => True,'default' => 'current_timestamp')
+                               'exp_date' => array('type' => 
'timestamp','nullable' => True,'default' => 'current_timestamp'),
+                               'modified_by' => array('type' => 
'int','precision' => 4,'nullable' => true),
+                               'modified_on' => array('type' => 
'timestamp','nullable' => True,'default' => 'current_timestamp')
                        ),
                        'pk' => array(),
                        'fk' => array(),
@@ -315,7 +323,9 @@
                                'rental_area' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
                                'area_gross' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
                                'area_net' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
-                               'area_usable' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00')
+                               'area_usable' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
+                               'modified_by' => array('type' => 
'int','precision' => 4,'nullable' => true),
+                               'modified_on' => array('type' => 
'timestamp','nullable' => True,'default' => 'current_timestamp')
                        ),
                        'pk' => array('loc1','loc2','loc3'),
                        'fk' => array(
@@ -342,7 +352,9 @@
                                'area_gross' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
                                'area_net' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
                                'area_usable' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
-                               'exp_date' => array('type' => 
'timestamp','nullable' => True,'default' => 'current_timestamp')
+                               'exp_date' => array('type' => 
'timestamp','nullable' => True,'default' => 'current_timestamp'),
+                               'modified_by' => array('type' => 
'int','precision' => 4,'nullable' => true),
+                               'modified_on' => array('type' => 
'timestamp','nullable' => True,'default' => 'current_timestamp')
                        ),
                        'pk' => array(),
                        'fk' => array(),
@@ -380,7 +392,9 @@
                                'rental_area' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
                                'area_gross' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
                                'area_net' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
-                               'area_usable' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00')
+                               'area_usable' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
+                               'modified_by' => array('type' => 
'int','precision' => 4,'nullable' => true),
+                               'modified_on' => array('type' => 
'timestamp','nullable' => True,'default' => 'current_timestamp')
                        ),
                        'pk' => array('loc1','loc2','loc3','loc4'),
                        'fk' => array(
@@ -411,7 +425,9 @@
                                'area_gross' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
                                'area_net' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
                                'area_usable' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
-                               'exp_date' => array('type' => 
'timestamp','nullable' => True,'default' => 'current_timestamp')
+                               'exp_date' => array('type' => 
'timestamp','nullable' => True,'default' => 'current_timestamp'),
+                               'modified_by' => array('type' => 
'int','precision' => 4,'nullable' => true),
+                               'modified_on' => array('type' => 
'timestamp','nullable' => True,'default' => 'current_timestamp')
                        ),
                        'pk' => array(),
                        'fk' => array(),

Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php  2015-07-14 10:33:05 UTC (rev 
13653)
+++ trunk/property/setup/tables_update.inc.php  2015-07-14 10:56:41 UTC (rev 
13654)
@@ -8436,3 +8436,99 @@
                        return $GLOBALS['setup_info']['property']['currentver'];
                }
        }
+
+       /**
+       * Update property version from 0.9.17.690 to 0.9.17.691
+       * Add modifyinfo to location-register.
+       */
+       $test[] = '0.9.17.690';
+       function property_upgrade0_9_17_690()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               $attributes= array(
+                       array(
+                               'column_name'   => 'modified_by',
+                               'type'                  => 'user',
+                               'precision'             => 4,
+                               'nullable'              => 'true',
+                               'input_text'    => 'modified_by',
+                               'statustext'    => 'modified_by'
+                       ),
+                       array(
+                               'column_name'   => 'modified_on',
+                               'type'                  => 'DT',
+                               'precision'             => 8,
+                               'nullable'              => 'true',
+                               'input_text'    => 'modified_on',
+                               'statustext'    => 'modified_on'
+
+                       )
+               );
+
+               $GLOBALS['phpgw_setup']->oProc->query('SELECT count(*) as cnt 
FROM fm_location_type');
+               $GLOBALS['phpgw_setup']->oProc->next_record();
+               $levels = $GLOBALS['phpgw_setup']->oProc->f('cnt');
+
+               for ($i=1; $i<($levels +1); $i++)
+               {
+
+                       
$GLOBALS['phpgw_setup']->oProc->AddColumn("fm_location{$i}",'modified_by',array(
+                               'type' => 'int',
+                               'precision' => 4,
+                               'nullable' => True
+                               )
+                       );
+                       
$GLOBALS['phpgw_setup']->oProc->AddColumn("fm_location{$i}",'modified_on',array(
+                               'type' => 'timestamp',
+                               'nullable' => True,
+                               'default' => 'current_timestamp'
+                               )
+                       );
+                       
$GLOBALS['phpgw_setup']->oProc->AddColumn("fm_location{$i}_history",'modified_by',array(
+                               'type' => 'int',
+                               'precision' => 4,
+                               'nullable' => True
+                               )
+                       );
+                       
$GLOBALS['phpgw_setup']->oProc->AddColumn("fm_location{$i}_history",'modified_on',array(
+                               'type' => 'timestamp',
+                               'nullable' => True,
+                               'default' => 'current_timestamp'
+                               )
+                       );
+
+                       $GLOBALS['phpgw_setup']->oProc->query("UPDATE 
fm_location{$i} SET modified_on = NULL");
+                       $GLOBALS['phpgw_setup']->oProc->query("UPDATE 
fm_location{$i}_history SET modified_on = NULL");
+
+                       $location_id = 
$GLOBALS['phpgw']->locations->get_id('property', ".location.{$i}");
+                       $GLOBALS['phpgw_setup']->oProc->query("SELECT max(id) 
as id FROM phpgw_cust_attribute WHERE location_id = {$location_id}");
+                       $GLOBALS['phpgw_setup']->oProc->next_record();
+                       $id = $GLOBALS['phpgw_setup']->oProc->f('id');
+
+                       foreach ( $attributes as $attrib)
+                       {
+                               $id ++;
+
+                               $GLOBALS['phpgw_setup']->oProc->query("INSERT 
INTO phpgw_cust_attribute (location_id, 
id,column_name,datatype,precision_,input_text,statustext,nullable,custom)"
+                                       . " VALUES ("
+                                       . $location_id. ','
+                                       . $id . ",'"
+                                       . $attrib['column_name'] . "','"
+                                       . $attrib['type'] . "',"
+                                       . $attrib['precision'] . ",'"
+                                       . $attrib['input_text'] . "','"
+                                       . $attrib['statustext'] . "','"
+                                       . $attrib['nullable'] . "',NULL)");
+
+                       }
+               }
+
+               $GLOBALS['phpgw_setup']->oProc->query("UPDATE 
phpgw_cust_attribute SET input_text = column_name WHERE input_text = 'dummy'");
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.691';
+                       return $GLOBALS['setup_info']['property']['currentver'];
+               }
+       }
\ No newline at end of file




reply via email to

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