phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property/inc class.soadmin_location.inc.php, 1.4 clas


From: sigurdne
Subject: [Phpgroupware-cvs] property/inc class.soadmin_location.inc.php, 1.4 class.soXport.inc.php, 1.12 hook_admin.inc.php, 1.11 class.menu.inc.php, 1.8 class.soproject.inc.php, 1.9
Date: Thu, 24 Feb 2005 15:10:21 -0000

Update of property/inc

Modified Files:
     Branch: MAIN
            class.soadmin_location.inc.php lines: +3 -2
            class.soXport.inc.php lines: +5 -5
            hook_admin.inc.php lines: +2 -2
            class.menu.inc.php lines: +3 -2
            class.soproject.inc.php lines: +23 -13

Log Message:
no message

====================================================
Index: property/inc/class.soadmin_location.inc.php
diff -u property/inc/class.soadmin_location.inc.php:1.3 
property/inc/class.soadmin_location.inc.php:1.4
--- property/inc/class.soadmin_location.inc.php:1.3     Thu Jan 13 16:52:48 2005
+++ property/inc/class.soadmin_location.inc.php Sat Jan 29 13:23:26 2005
@@ -239,7 +239,8 @@
                        $fd['remark'] = array('type' => 'text', 'nullable' => 
True);
                        $fd['status'] = array('type' => 'int', 'precision' => 
4, 'nullable' => True);

-                       
$add_columns_in_tables=array('fm_meter','fm_project','fm_tts_tickets','fm_request','fm_document','fm_investment');
+//                     
$add_columns_in_tables=array('fm_meter','fm_project','fm_tts_tickets','fm_request','fm_document','fm_investment');
+                       
$add_columns_in_tables=array('fm_project','fm_tts_tickets','fm_request','fm_document','fm_investment');

                        if($this->oProc->CreateTable('fm_location'. 
$standard['id'],array('fd' => $fd,'pk' => $pk,'fk' => $fk,'ix' => 
array('location_code'),'uc' => array())))
                        {

====================================================
Index: property/inc/class.soXport.inc.php
diff -u property/inc/class.soXport.inc.php:1.11 
property/inc/class.soXport.inc.php:1.12
--- property/inc/class.soXport.inc.php:1.11     Thu Jan 13 16:52:48 2005
+++ property/inc/class.soXport.inc.php  Sat Jan 29 13:23:25 2005
@@ -114,11 +114,11 @@
                        return $this->db->f('kostra_id');
                }

-               function anleggsnr_to_objekt($anleggsnr)
+               function anleggsnr_to_objekt($anleggsnr,$meter_table)
                {
-                       $this->db->query("select 
fm_meter.name,fm_meter.loc1,fm_meter.loc2,fm_meter.loc3,fm_part_of_town.district_id
 "
-                       . " from fm_meter $this->join fm_location1 ON 
fm_meter.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 fm_meter.num='$anleggsnr'");
+                       $this->db->query("select 
$meter_table.name,$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.num='$anleggsnr'");

                        $this->db->next_record();


====================================================
Index: property/inc/hook_admin.inc.php
diff -u property/inc/hook_admin.inc.php:1.10 
property/inc/hook_admin.inc.php:1.11
--- property/inc/hook_admin.inc.php:1.10        Thu Jan 13 16:52:48 2005
+++ property/inc/hook_admin.inc.php     Sat Jan 29 13:23:25 2005
@@ -45,7 +45,7 @@
                                'Vendor Attributes'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uiactor.list_attribute&role=vendor'),
                                'Drawing Categories'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uicategory.index&type=drawing'),
                                'Document Categories'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uicategory.index&type=document'),
-                               'Meter Categories'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uicategory.index&type=meter'),
+//                             'Meter Categories'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uicategory.index&type=meter'),
                                'Building Part'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uistandard_2.index&type=building_part'),
                                'Tender chapter'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uicategory.index&type=tender_chapter'),
                                'ID Controle'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uiadmin.edit_id'),

====================================================
Index: property/inc/class.menu.inc.php
diff -u property/inc/class.menu.inc.php:1.7 property/inc/class.menu.inc.php:1.8
--- property/inc/class.menu.inc.php:1.7 Thu Jan 13 16:52:48 2005
+++ property/inc/class.menu.inc.php     Sat Jan 29 13:23:25 2005
@@ -59,6 +59,7 @@
                                $menu['module'][$i]['name']             = 
lang('Property');
                                $menu['module'][$i]['statustext']       = 
lang('Property');
                                $i++;
+/*
                                if($sub=='meter')
                                {
                                        $menu['module'][$i]['this']=True;
@@ -66,8 +67,8 @@
                                $menu['module'][$i]['link']             = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uimeter.index');
                                $menu['module'][$i]['name']             = 
lang('Meter');
                                $menu['module'][$i]['statustext']       = 
lang('Meter');
-
                                $i++;
+*/
                                if($sub=='ticket')
                                {
                                        $menu['module'][$i]['this']=True;

====================================================
Index: property/inc/class.soproject.inc.php
diff -u property/inc/class.soproject.inc.php:1.8 
property/inc/class.soproject.inc.php:1.9
--- property/inc/class.soproject.inc.php:1.8    Thu Jan 13 16:52:48 2005
+++ property/inc/class.soproject.inc.php        Sat Jan 29 13:23:25 2005
@@ -313,6 +313,9 @@

                function read_single($project_id)
                {
+                       $config = CreateObject('phpgwapi.config','property');
+                       $config->read_repository();
+                       $meter_table = $config->config_data['meter_table'];

                        $sql = "SELECT * from fm_project where 
id='$project_id'";

@@ -347,7 +350,10 @@
                                $project['contact_phone']               = 
$this->db->f('contact_phone');


-                               $project['power_meter'] = 
$this->get_power_meter($this->db->f('location_code'));
+                               if($meter_table)
+                               {
+                                       $project['power_meter'] = 
$this->get_power_meter($this->db->f('location_code'),$meter_table);
+                               }
                        }

                        $sql = "SELECT * FROM fm_project_origin WHERE 
project_id='$project_id' and origin ='request'";
@@ -385,9 +391,9 @@
                        return $this->db->f('origin_id');
                }

-               function get_power_meter($location_code = '')
+               function get_power_meter($location_code = '',$meter_table)
                {
-                       $this->db2->query("SELECT name as power_meter FROM 
fm_meter where location_code='$location_code' and 
category='1'",__LINE__,__FILE__);
+                       $this->db2->query("SELECT name as power_meter FROM 
$meter_table where location_code='$location_code' and 
category='1'",__LINE__,__FILE__);

                        $this->db2->next_record();

@@ -516,9 +522,13 @@
                                $this->db->query("update fm_tenant set 
contact_phone='". $project['extra']['contact_phone']. "' where id='". 
$project['extra']['tenant_id']. "'",__LINE__,__FILE__);
                        }

-                       if ($project['power_meter'] )
+                       $config = CreateObject('phpgwapi.config','property');
+                       $config->read_repository();
+                       $meter_table = $config->config_data['meter_table'];
+
+                       if ($project['power_meter'] && $meter_table)
                        {
-                               
$this->update_power_meter($project['power_meter'],$project['location_code'],$address);
+                               
$this->update_power_meter($project['power_meter'],$project['location_code'],$address,$meter_table);
                        }

                        if (count($project['branch']) != 0)
@@ -556,7 +566,7 @@
                        return $receipt;
                }

-               function 
update_power_meter($power_meter,$location_code,$address)
+               function 
update_power_meter($power_meter,$location_code,$address,$meter_table)
                {

                        $location=explode('-',$location_code);
@@ -582,18 +592,18 @@
                        }


-                       $this->db->query("SELECT count(*) FROM fm_meter where 
location_code='$location_code' and category=1",__LINE__,__FILE__);
+                       $this->db->query("SELECT count(*) FROM $meter_table 
where location_code='$location_code' and category=1",__LINE__,__FILE__);

                        $this->db->next_record();

                        if ( $this->db->f(0))
                        {
-                               $this->db->query("update fm_meter set 
name='$power_meter',address='$address' where location_code='$location_code' and 
category='1'",__LINE__,__FILE__);
+                               $this->db->query("update $meter_table set 
name='$power_meter',address='$address' where location_code='$location_code' and 
category='1'",__LINE__,__FILE__);
                        }
                        else
                        {
-                               $meter_id       = $this->generate_meter_id();
-                               $this->db->query("insert into fm_meter 
(num,name,category,location_code,entry_date,user_id,address $cols) "
+                               $meter_id       = 
$this->generate_meter_id($meter_table);
+                               $this->db->query("insert into $meter_table 
(num,name,category,location_code,entry_date,user_id,address $cols) "
                                        . "VALUES ('"
                                        . $meter_id. "','"
                                        . $power_meter. "',"
@@ -603,11 +613,11 @@
                        }
                }

-               function generate_meter_id()
+               function generate_meter_id($meter_table)
                {
                        $prefix = 'meter';
                        $pos    = strlen($prefix);
-                       $this->db->query("select max(num) from fm_meter where 
num $this->like ('$prefix%')");
+                       $this->db->query("select max(num) from $meter_table 
where num $this->like ('$prefix%')");
                        $this->db->next_record();

                        $max = 
$this->bocommon->add_leading_zero(substr($this->db->f(0),$pos));






reply via email to

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