fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [7196] property: tuning


From: Sigurd Nes
Subject: [Fmsystem-commits] [7196] property: tuning
Date: Thu, 07 Apr 2011 12:13:41 +0000

Revision: 7196
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7196
Author:   sigurdne
Date:     2011-04-07 12:13:40 +0000 (Thu, 07 Apr 2011)
Log Message:
-----------
property: tuning

Modified Paths:
--------------
    trunk/property/inc/class.botts.inc.php
    trunk/property/inc/class.soproject.inc.php
    trunk/property/inc/class.sotts.inc.php
    trunk/property/inc/class.soworkorder.inc.php
    trunk/property/inc/class.uitts.inc.php

Modified: trunk/property/inc/class.botts.inc.php
===================================================================
--- trunk/property/inc/class.botts.inc.php      2011-04-07 11:50:12 UTC (rev 
7195)
+++ trunk/property/inc/class.botts.inc.php      2011-04-07 12:13:40 UTC (rev 
7196)
@@ -161,8 +161,14 @@
                        }
                        $filter = array('list' => ''); // translates to "list 
IS NULL"
                        $columns = array();
+
                        $columns[] = array
                                (
+                                       'id' => 'vendor',
+                                       'name'=> lang('vendor')
+                               );
+                       $columns[] = array
+                               (
                                        'id' => 'billable_hours',
                                        'name'=> lang('billable hours')
                                );

Modified: trunk/property/inc/class.soproject.inc.php
===================================================================
--- trunk/property/inc/class.soproject.inc.php  2011-04-07 11:50:12 UTC (rev 
7195)
+++ trunk/property/inc/class.soproject.inc.php  2011-04-07 12:13:40 UTC (rev 
7196)
@@ -505,7 +505,7 @@
                        //echo substr($sql,strripos($sql,'from'));
                        
if($GLOBALS['phpgw_info']['server']['db_type']=='postgres')
                        {
-                               $sql2 = 'SELECT count(*) as cnt FROM (SELECT 
fm_project.id ' . substr($sql,strripos($sql,'from'))  . ' GROUP BY 
fm_project.id) as cnt';
+                               $sql2 = 'SELECT count(*) as cnt FROM (SELECT 
DISTINCT fm_project.id ' . substr($sql,strripos($sql,'from'))  . ') as cnt';
                                $this->db->query($sql2,__LINE__,__FILE__);
                                $this->db->next_record();
                                $this->total_records = $this->db->f('cnt');

Modified: trunk/property/inc/class.sotts.inc.php
===================================================================
--- trunk/property/inc/class.sotts.inc.php      2011-04-07 11:50:12 UTC (rev 
7195)
+++ trunk/property/inc/class.sotts.inc.php      2011-04-07 12:13:40 UTC (rev 
7196)
@@ -432,7 +432,22 @@
                                }
                        }
 
-                       $sql = "SELECT DISTINCT fm_tts_tickets.* 
,fm_location1.loc1_name, fm_tts_views.id as view 
{$result_order_field},fm_district.descr as district  FROM fm_tts_tickets"
+                       $return_fields = 
"fm_tts_tickets.id,fm_tts_tickets.assignedto,fm_tts_tickets.status,fm_tts_tickets.user_id,"
+                       . 
"fm_tts_tickets.subject,fm_tts_tickets.address,fm_tts_tickets.location_code,fm_tts_tickets.priority,fm_tts_tickets.cat_id,fm_tts_tickets.group_id,"
+                       . 
"fm_tts_tickets.entry_date,fm_tts_tickets.finnish_date,fm_tts_tickets.finnish_date2,fm_tts_tickets.order_id,fm_tts_tickets.vendor_id,fm_tts_tickets.actual_cost,"
+                       . 
"fm_tts_tickets.budget,fm_tts_tickets.billable_hours,fm_district.descr as 
district,fm_tts_views.id as view,fm_location1.loc1_name {$result_order_field}";
+                       
+                       //fm_tts_tickets.* ,fm_location1.loc1_name, 
fm_tts_views.id as view {$result_order_field},fm_district.descr as district
+                       $sql = "SELECT DISTINCT {$return_fields}  FROM 
fm_tts_tickets"
+                               . " {$this->join} fm_location1 ON 
fm_tts_tickets.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"
+                               . " {$this->join} fm_district ON fm_district.id 
= fm_part_of_town.district_id"
+                               . " {$order_join}"
+                               . " LEFT OUTER JOIN fm_tts_views ON 
(fm_tts_tickets.id = fm_tts_views.id AND 
fm_tts_views.account_id='{$this->account}')"
+                               . " {$filtermethod} {$querymethod}";
+
+
+                       $sql_cnt = "SELECT DISTINCT fm_tts_tickets.budget 
,fm_tts_tickets.actual_cost, fm_tts_tickets.id FROM fm_tts_tickets"
                                . " $this->join fm_location1 ON 
fm_tts_tickets.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"
                                . " $this->join fm_district ON fm_district.id = 
fm_part_of_town.district_id"
@@ -442,7 +457,7 @@
 
 //_debug_array($sql);
 
-                       $sql2 = "SELECT count(*) as cnt, sum(budget) as 
sum_budget, sum(actual_cost) as sum_actual_cost FROM ({$sql}) as t";
+                       $sql2 = "SELECT count(*) as cnt, sum(budget) as 
sum_budget, sum(actual_cost) as sum_actual_cost FROM ({$sql_cnt}) as t";
                        $this->db->query($sql2,__LINE__,__FILE__);
                        $this->db->next_record();
                        $this->total_records    = $this->db->f('cnt');

Modified: trunk/property/inc/class.soworkorder.inc.php
===================================================================
--- trunk/property/inc/class.soworkorder.inc.php        2011-04-07 11:50:12 UTC 
(rev 7195)
+++ trunk/property/inc/class.soworkorder.inc.php        2011-04-07 12:13:40 UTC 
(rev 7196)
@@ -561,7 +561,7 @@
                        //_debug_array($sql);
                        
if($GLOBALS['phpgw_info']['server']['db_type']=='postgres')
                        {
-                               $sql2 = 'SELECT count(*) as cnt FROM (SELECT 
fm_workorder.id ' . substr($sql,strripos($sql,'from'))  . ') as cnt';
+                               $sql2 = 'SELECT count(fm_workorder.id) as cnt ' 
. substr($sql,strripos($sql,'from'));
                                $this->db->query($sql2,__LINE__,__FILE__);
                                $this->db->next_record();
                                $this->total_records = $this->db->f('cnt');

Modified: trunk/property/inc/class.uitts.inc.php
===================================================================
--- trunk/property/inc/class.uitts.inc.php      2011-04-07 11:50:12 UTC (rev 
7195)
+++ trunk/property/inc/class.uitts.inc.php      2011-04-07 12:13:40 UTC (rev 
7196)
@@ -906,8 +906,8 @@
                        {
                                $uicols['name'][] = 'order_id';
                                $uicols['descr'][]      = lang('order id');
-                               $uicols['name'][] = 'vendor';
-                               $uicols['descr'][]      = lang('vendor');
+//                             $uicols['name'][] = 'vendor';
+//                             $uicols['descr'][]      = lang('vendor');
                        }
 
                        if( $this->acl->check('.ticket.order', PHPGW_ACL_ADD, 
'property') )
@@ -947,7 +947,7 @@
                        {
        //                      $uicols['input_type'][] = 'text';
                                $uicols['name'][]               = $col;
-       //                      $uicols['descr'][]              = 
lang(str_replace('_', ' ', $col));
+                               $uicols['descr'][]              = 
lang(str_replace('_', ' ', $col));
        //                      $uicols['statustext'][] = $col;
                        }
 




reply via email to

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