fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [9836] proprty: rename fields


From: Sigurd Nes
Subject: [Fmsystem-commits] [9836] proprty: rename fields
Date: Wed, 08 Aug 2012 07:20:17 +0000

Revision: 9836
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9836
Author:   sigurdne
Date:     2012-08-08 07:20:16 +0000 (Wed, 08 Aug 2012)
Log Message:
-----------
proprty: rename fields

Modified Paths:
--------------
    trunk/property/inc/class.soXport.inc.php
    trunk/property/inc/class.soproject.inc.php
    trunk/property/inc/custom/default/hent_maaler_nr_til_besikt_rapport.php
    trunk/property/inc/export/default/El_anlegg_LRS
    trunk/property/inc/import/default/Import_fra_BKK_csv
    trunk/property/inc/import/default/efaktura_dnb_xml
    trunk/property/setup/default_records.inc.php
    trunk/property/setup/tables_current.inc.php

Modified: trunk/property/inc/class.soXport.inc.php
===================================================================
--- trunk/property/inc/class.soXport.inc.php    2012-08-07 13:18:54 UTC (rev 
9835)
+++ trunk/property/inc/class.soXport.inc.php    2012-08-08 07:20:16 UTC (rev 
9836)
@@ -126,7 +126,7 @@
 
                function anleggsnr_to_objekt($anleggsnr,$meter_table)
                {
-                       $this->db->query("SELECT 
$meter_table.ext_meter_id,$meter_table.loc1,$meter_table.loc2,$meter_table.loc3,fm_part_of_town.district_id
 "
+                       $this->db->query("SELECT 
$meter_table.maaler_nr,$meter_table.loc1,$meter_table.loc2,$meter_table.loc3,fm_part_of_town.district_id
 "
                                . " FROM $meter_table $this->join fm_location1 
ON $meter_table.loc1 = fm_location1.loc1 $this->join "
                                . " fm_part_of_town ON 
fm_location1.part_of_town_id = fm_part_of_town.part_of_town_id WHERE 
$meter_table.ext_system_id='$anleggsnr'");
 
@@ -141,7 +141,7 @@
 
                        $maalerinfo['loc1']=$loc1;
                        $maalerinfo['dima']=$dima;
-                       $maalerinfo['maalernr']=$this->db->f('ext_meter_id');
+                       $maalerinfo['maalernr']=$this->db->f('maaler_nr');
                        $maalerinfo['district']=$this->db->f('district_id');
                        return $maalerinfo;
 

Modified: trunk/property/inc/class.soproject.inc.php
===================================================================
--- trunk/property/inc/class.soproject.inc.php  2012-08-07 13:18:54 UTC (rev 
9835)
+++ trunk/property/inc/class.soproject.inc.php  2012-08-08 07:20:16 UTC (rev 
9836)
@@ -856,7 +856,7 @@
                                return false;
                        }
 
-                       $this->db->query("SELECT ext_meter_id as power_meter 
FROM $meter_table where location_code='$location_code' and 
category='1'",__LINE__,__FILE__);
+                       $this->db->query("SELECT maaler_nr as power_meter FROM 
$meter_table where location_code='$location_code' and 
category='1'",__LINE__,__FILE__);
 
                        $this->db->next_record();
 
@@ -1121,14 +1121,14 @@
 
                        if ( $this->db->f('cnt'))
                        {
-                               $this->db->query("update $meter_table set 
ext_meter_id='$power_meter',address='$address' where 
location_code='$location_code' and category='1'",__LINE__,__FILE__);
+                               $this->db->query("update $meter_table set 
maaler_nr='$power_meter',address='$address' where 
location_code='$location_code' and category='1'",__LINE__,__FILE__);
                        }
                        else
                        {
                                $id = $this->bocommon->next_id($meter_table);
 
                                $meter_id       = 
$this->generate_meter_id($meter_table);
-                               $this->db->query("insert into $meter_table 
(id,num,ext_meter_id,category,location_code,entry_date,user_id,address $cols) "
+                               $this->db->query("insert into $meter_table 
(id,num,maaler_nr,category,location_code,entry_date,user_id,address $cols) "
                                        . "VALUES ('"
                                        . $id. "','"
                                        . $meter_id. "','"

Modified: 
trunk/property/inc/custom/default/hent_maaler_nr_til_besikt_rapport.php
===================================================================
--- trunk/property/inc/custom/default/hent_maaler_nr_til_besikt_rapport.php     
2012-08-07 13:18:54 UTC (rev 9835)
+++ trunk/property/inc/custom/default/hent_maaler_nr_til_besikt_rapport.php     
2012-08-08 07:20:16 UTC (rev 9836)
@@ -11,7 +11,7 @@
 
                //'property'    = $GLOBALS['phpgw_info']['flags']['currentapp'];
 
-               $sql = "SELECT ext_meter_id as maaler_nr FROM fm_entity_1_11 
WHERE location_code='" . $values['location_code'] . "'";
+               $sql = "SELECT maaler_nr as maaler_nr FROM fm_entity_1_11 WHERE 
location_code='" . $values['location_code'] . "'";
                $this->db->query($sql,__LINE__,__FILE__);
                $this->db->next_record();
                $maaler_nr = $this->db->f('maaler_nr');
@@ -66,7 +66,7 @@
                                                {
                                                        $new_value = 
$entry['value'];
 
-                                                       
$this->db->query("SELECT maaler_stand, id FROM fm_entity_1_11 WHERE 
ext_meter_id = '$maaler_nr' AND location_code ='" . $values['location_code']. 
"'",__LINE__,__FILE__);
+                                                       
$this->db->query("SELECT maaler_stand, id FROM fm_entity_1_11 WHERE maaler_nr = 
'$maaler_nr' AND location_code ='" . $values['location_code']. 
"'",__LINE__,__FILE__);
                                                        
$this->db->next_record();
                                                        $old_value = 
$this->db->f('maaler_stand');
                                                        $id = 
$this->db->f('id');
@@ -77,7 +77,7 @@
                                                                {
                                                                        
$historylog     = CreateObject('property.historylog','entity_1_11');
                                                                        
$historylog->add('SO',$id,$new_value,false, $attrib_id,$besiktet_dato);
-                                                                       
$this->db->query("UPDATE fm_entity_1_11 SET maaler_stand = '{$new_value}' WHERE 
ext_meter_id = '{$maaler_nr}' AND location_code 
='{$values['location_code']}'",__LINE__,__FILE__);
+                                                                       
$this->db->query("UPDATE fm_entity_1_11 SET maaler_stand = '{$new_value}' WHERE 
maaler_nr = '{$maaler_nr}' AND location_code 
='{$values['location_code']}'",__LINE__,__FILE__);
                                                                }
                                                        }
                                                }

Modified: trunk/property/inc/export/default/El_anlegg_LRS
===================================================================
--- trunk/property/inc/export/default/El_anlegg_LRS     2012-08-07 13:18:54 UTC 
(rev 9835)
+++ trunk/property/inc/export/default/El_anlegg_LRS     2012-08-08 07:20:16 UTC 
(rev 9836)
@@ -66,25 +66,27 @@
                        $doc = new DOMDocument('1.0', 'utf-8');
                        $domElement = $doc->createElement('AttributeList');
 
+
                        while ($this->db->next_record())
                        {
                                        $Attribute = array
                                        (
                                                'ID'                    => 'TJ',
                                                'Name'                  => 
'MALEPID',
-                                               'Value'                 => 
substr($this->db->f('ext_system_id2'),-8),
+                                               'Value'                 => 
substr($this->db->f('maalepunkt_id'),-8),
                                        //      'id'                    => 
$this->db->f('id'),
                                                'Description'   => 
$this->db->f('address'),
                                                'PeriodFrom'    => $PeriodFrom,
                                                'PeriodTo'              => 
$PeriodTo,
                                                'Status'                => 'N',
+                                               'Percentage'    => '100',
                                                'RelationList'  => array
                                                (
                                                        'RelationValue' => array
                                                        (
                                                                array
                                                                (
-                                                                       'ID'    
=> '',
+                                                                       'ID'    
=> 'A3',
                                                                        'Name'  
=> 'FIRMA',
                                                                        'Value' 
=> 'BB',
                                                                        
'Description'   => '',
@@ -95,7 +97,7 @@
                                                                ),
                                                                array
                                                                (
-                                                                       'ID'    
=> '',
+                                                                       'ID'    
=> 'A0',
                                                                        'Name'  
=> 'Art',
                                                                        'Value' 
=> '12304121',
                                                                        
'Description'   => '',
@@ -106,7 +108,7 @@
                                                                ),
                                                                array
                                                                (
-                                                                       'ID'    
=> '',
+                                                                       'ID'    
=> 'C1',
                                                                        'Name'  
=> 'Ansvar',
                                                                        'Value' 
=> '45',
                                                                        
'Description'   => '',
@@ -117,7 +119,7 @@
                                                                ),
                                                                array
                                                                (
-                                                                       'ID'    
=> '',
+                                                                       'ID'    
=> 'F0',
                                                                        'Name'  
=> 'Objekt',
                                                                        'Value' 
=> $this->db->f('loc1'),
                                                                        
'Description'   => '',
@@ -128,7 +130,7 @@
                                                                ),
                                                                array
                                                                (
-                                                                       'ID'    
=> '',
+                                                                       'ID'    
=> 'B0',
                                                                        'Name'  
=> 'Prosjekt',
                                                                        'Value' 
=> '',
                                                                        
'Description'   => '',
@@ -139,7 +141,7 @@
                                                                ),
                                                                array
                                                                (
-                                                                       'ID'    
=> '',
+                                                                       'ID'    
=> 'B1',
                                                                        'Name'  
=> 'Fagkode',
                                                                        'Value' 
=> '999',
                                                                        
'Description'   => '',

Modified: trunk/property/inc/import/default/Import_fra_BKK_csv
===================================================================
--- trunk/property/inc/import/default/Import_fra_BKK_csv        2012-08-07 
13:18:54 UTC (rev 9835)
+++ trunk/property/inc/import/default/Import_fra_BKK_csv        2012-08-08 
07:20:16 UTC (rev 9836)
@@ -296,9 +296,9 @@
 
                function anleggsnr_to_objekt($anleggsnr,$meter_table)
                {
-                       $sql = "SELECT 
{$meter_table}.ext_meter_id,{$meter_table}.loc1,{$meter_table}.loc2,{$meter_table}.loc3,fm_part_of_town.district_id
 "
+                       $sql = "SELECT 
{$meter_table}.maaler_nr,{$meter_table}.loc1,{$meter_table}.loc2,{$meter_table}.loc3,fm_part_of_town.district_id
 "
                        . " FROM {$meter_table} {$this->join} fm_location1 ON 
{$meter_table}.loc1 = fm_location1.loc1 $this->join "
-                         . " fm_part_of_town ON fm_location1.part_of_town_id = 
fm_part_of_town.part_of_town_id WHERE {$meter_table}.ext_system_id2 
{$this->like} '%{$anleggsnr}'";
+                         . " fm_part_of_town ON fm_location1.part_of_town_id = 
fm_part_of_town.part_of_town_id WHERE {$meter_table}.maalepunkt_id 
{$this->like} '%{$anleggsnr}'";
 //     _debug_array($sql);
                        $this->db->query($sql);
 
@@ -309,7 +309,7 @@
 
                        $maalerinfo['loc1']=$loc1;
                        $maalerinfo['dima']=$loc1.$loc2;//.$loc3;
-                       $maalerinfo['maalernr']=$this->db->f('ext_meter_id');
+                       $maalerinfo['maalernr']=$this->db->f('maaler_nr');
                        $maalerinfo['district']=$this->db->f('district_id');
                        return $maalerinfo;
                }

Modified: trunk/property/inc/import/default/efaktura_dnb_xml
===================================================================
--- trunk/property/inc/import/default/efaktura_dnb_xml  2012-08-07 13:18:54 UTC 
(rev 9835)
+++ trunk/property/inc/import/default/efaktura_dnb_xml  2012-08-08 07:20:16 UTC 
(rev 9836)
@@ -288,9 +288,9 @@
 
                function anleggsnr_to_objekt($anleggsnr,$meter_table)
                {
-                       $sql = "SELECT 
{$meter_table}.ext_meter_id,{$meter_table}.loc1,{$meter_table}.loc2,{$meter_table}.loc3,fm_part_of_town.district_id
 "
+                       $sql = "SELECT 
{$meter_table}.maaler_nr,{$meter_table}.loc1,{$meter_table}.loc2,{$meter_table}.loc3,fm_part_of_town.district_id
 "
                        . " FROM {$meter_table} {$this->join} fm_location1 ON 
{$meter_table}.loc1 = fm_location1.loc1 $this->join "
-                         . " fm_part_of_town ON fm_location1.part_of_town_id = 
fm_part_of_town.part_of_town_id WHERE {$meter_table}.ext_system_id2 
{$this->like} '%{$anleggsnr}'";
+                         . " fm_part_of_town ON fm_location1.part_of_town_id = 
fm_part_of_town.part_of_town_id WHERE {$meter_table}.maalepunkt_id 
{$this->like} '%{$anleggsnr}'";
 //     _debug_array($sql);
                        $this->db->query($sql);
 
@@ -300,7 +300,7 @@
 
                        $maalerinfo['loc1']=$loc1;
                        $maalerinfo['dima']=$loc1.$loc2;
-                       $maalerinfo['maalernr']=$this->db->f('ext_meter_id');
+                       $maalerinfo['maalernr']=$this->db->f('maaler_nr');
                        $maalerinfo['district']=$this->db->f('district_id');
                        return $maalerinfo;
                }

Modified: trunk/property/setup/default_records.inc.php
===================================================================
--- trunk/property/setup/default_records.inc.php        2012-08-07 13:18:54 UTC 
(rev 9835)
+++ trunk/property/setup/default_records.inc.php        2012-08-08 07:20:16 UTC 
(rev 9836)
@@ -419,7 +419,7 @@
 $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) VALUES 
($location_id, 1, 'status', 'Status', 'Status', 'LB', NULL, 1, NULL, NULL, 
NULL, NULL, 'True')");
 $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) VALUES 
($location_id, 2, 'category', 'Category', 'Category statustext', 'LB', NULL, 2, 
NULL, NULL, NULL, NULL, 'True')");
 $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) VALUES 
($location_id, 3, 'ext_system_id', 'Ext system id', 'External system id', 'V', 
NULL, 3, NULL, 12, NULL, NULL, 'False')");
-$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) VALUES 
($location_id, 4, 'ext_meter_id', 'Ext meter id', 'External meter id', 'V', 
NULL, 4, NULL, 12, NULL, NULL, 'False')");
+$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) VALUES 
($location_id, 4, 'maaler_nr', 'Ext meter id', 'External meter id', 'V', NULL, 
4, NULL, 12, NULL, NULL, 'False')");
 $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) VALUES 
($location_id, 5, 'remark', 'Remark', 'Remark status text', 'T', NULL, 5, NULL, 
NULL, NULL, NULL, 'True')");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice 
(location_id, attrib_id, id, value) VALUES ($location_id, 1, 1, 'status 1')");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice 
(location_id, attrib_id, id, value) VALUES ($location_id, 1, 2, 'status 2')");

Modified: trunk/property/setup/tables_current.inc.php
===================================================================
--- trunk/property/setup/tables_current.inc.php 2012-08-07 13:18:54 UTC (rev 
9835)
+++ trunk/property/setup/tables_current.inc.php 2012-08-08 07:20:16 UTC (rev 
9836)
@@ -1781,7 +1781,7 @@
                                'status' => array('type' => 'int','precision' 
=> '4','nullable' => True),
                                'category' => array('type' => 'int','precision' 
=> '4','nullable' => False),
                                'ext_system_id' => array('type' => 
'varchar','precision' => '20','nullable' => False),
-                               'ext_meter_id' => array('type' => 
'varchar','precision' => '20','nullable' => False),
+                               'maaler_nr' => array('type' => 
'varchar','precision' => '20','nullable' => False),
                                'remark' => array('type' => 
'varchar','precision' => '255','nullable' => True)
                        ),
                        'pk' => array('id'),




reply via email to

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