fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [9602] controller: register control til component


From: Sigurd Nes
Subject: [Fmsystem-commits] [9602] controller: register control til component
Date: Sat, 16 Jun 2012 20:04:57 +0000

Revision: 9602
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9602
Author:   sigurdne
Date:     2012-06-16 20:04:57 +0000 (Sat, 16 Jun 2012)
Log Message:
-----------
controller: register control til component

Modified Paths:
--------------
    trunk/property/inc/class.boentity.inc.php
    trunk/property/inc/class.soentity.inc.php

Modified: trunk/property/inc/class.boentity.inc.php
===================================================================
--- trunk/property/inc/class.boentity.inc.php   2012-06-16 18:49:15 UTC (rev 
9601)
+++ trunk/property/inc/class.boentity.inc.php   2012-06-16 20:04:57 UTC (rev 
9602)
@@ -358,7 +358,8 @@
                                
'start_date'=>$this->bocommon->date_to_timestamp($data['start_date']),
                                
'end_date'=>$this->bocommon->date_to_timestamp($data['end_date']),
                                'dry_run'=>$data['dry_run'], 
'type'=>$data['type'], 'location_code' => $this->location_code,
-                               'criteria_id' => $this->criteria_id, 
'attrib_filter' => $attrib_filter, 'p_num' => $this->p_num));
+                               'criteria_id' => $this->criteria_id, 
'attrib_filter' => $attrib_filter, 'p_num' => $this->p_num,
+                               
'control_registered'=>isset($data['control_registered'])?$data['control_registered']:''));
 
                        $this->total_records = $this->so->total_records;
                        $this->uicols   = $this->so->uicols;

Modified: trunk/property/inc/class.soentity.inc.php
===================================================================
--- trunk/property/inc/class.soentity.inc.php   2012-06-16 18:49:15 UTC (rev 
9601)
+++ trunk/property/inc/class.soentity.inc.php   2012-06-16 20:04:57 UTC (rev 
9602)
@@ -241,6 +241,7 @@
                        $attrib_filter  = $data['attrib_filter'] ? 
$data['attrib_filter'] : array();
                        $p_num                  = isset($data['p_num']) ? 
$data['p_num'] : '';
                        $custom_condition= isset($data['custom_condition']) ? 
$data['custom_condition'] : '';
+                       $control_registered= isset($data['control_registered']) 
? $data['control_registered'] : '';
 
                        if(!$entity_id || !$cat_id)
                        {
@@ -689,6 +690,16 @@
                        }
 
                        $sql = "SELECT fm_bim_item.* __XML-ORDER__ FROM 
fm_bim_item {$this->join} fm_bim_type ON (fm_bim_item.type = fm_bim_type.id)";
+                       if($control_registered)
+                       {
+                               $sql .= "{$this->join} 
controller_control_component_list ON (fm_bim_item.id = 
controller_control_component_list.component_id  AND 
controller_control_component_list.location_id = fm_bim_type.location_id)";
+                               $sql_cnt_control_fields = ',control_id ';
+                       }
+                       else
+                       {
+                               $sql_cnt_control_fields = '';
+                       }
+
                        if(isset($category['location_level']) && 
$category['location_level'])
                        {
                                $sql .= "{$this->join} fm_location1 ON 
(fm_bim_item.loc1 = fm_location1.loc1)";
@@ -727,7 +738,7 @@
 //_debug_array($_sql);die();                   
 //                     if(!$cache_info)
                        {
-                               $sql_cnt = "SELECT DISTINCT fm_bim_item.id " . 
substr($_sql,strripos($_sql,'FROM'));
+                               $sql_cnt = "SELECT DISTINCT fm_bim_item.id 
{$sql_cnt_control_fields}" . substr($_sql,strripos($_sql,'FROM'));
                                $sql2 = "SELECT count(*) as cnt FROM 
({$sql_cnt}) as t";
 
                                $this->db->query($sql2,__LINE__,__FILE__);
@@ -745,6 +756,7 @@
 
                        $this->total_records    = $cache_info['total_records'];
 
+
                        if($dry_run)
                        {
                                return array();




reply via email to

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