fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15575] property: filter inactive components for cont


From: sigurdne
Subject: [Fmsystem-commits] [15575] property: filter inactive components for controller
Date: Sun, 4 Sep 2016 15:28:10 +0000 (UTC)

Revision: 15575
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15575
Author:   sigurdne
Date:     2016-09-04 15:28:10 +0000 (Sun, 04 Sep 2016)
Log Message:
-----------
property: filter inactive components for controller

Modified Paths:
--------------
    branches/Version-1_0-branch/property/inc/class.soentity.inc.php

Modified: branches/Version-1_0-branch/property/inc/class.soentity.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soentity.inc.php     
2016-09-03 01:04:17 UTC (rev 15574)
+++ branches/Version-1_0-branch/property/inc/class.soentity.inc.php     
2016-09-04 15:28:10 UTC (rev 15575)
@@ -779,6 +779,34 @@
 
                        if($check_for_control && !$control_registered)
                        {
+
+                               /*
+                                * Filter inactive
+                                */
+                               
if(!isset($cache_attribute_status[$location_id]))
+                               {
+                                       $filters = array("column_name" => 
"status");
+                                       $cache_attribute_status[$location_id] = 
$GLOBALS['phpgw']->custom_fields->find2($location_id, 0, '', 'ASC', '', true, 
true,$filters);
+                               }
+
+                               
if(!empty($cache_attribute_status[$location_id]))
+                               {
+                                       foreach 
($cache_attribute_status[$location_id] as $attibute_id => $attibute)
+                                       {
+                                               if(!empty($attibute['choice']))
+                                               {
+                                                       foreach 
($attibute['choice'] as $choice)
+                                                       {
+                                                               
if($choice['id'] < 90)
+                                                               {
+                                                                       
$_querymethod[]= "xmlexists('//status[text() = ''{$choice['id']}'']' PASSING BY 
REF xml_representation)";
+                                                                       
$__querymethod = array(); // remove block
+                                                               }
+                                                       }
+                                               }
+                                       }
+                               }
+
                                $sql .= "{$this->left_join} {$join_control}";
 
                                $sql_custom_field .= ',count(control_id) AS 
has_control';




reply via email to

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