fmsystem-commits
[Top][All Lists]
Advanced

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

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


From: sigurdne
Subject: [Fmsystem-commits] [15577] property: filter inactive components for controller
Date: Sun, 4 Sep 2016 16:24:35 +0000 (UTC)

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

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

Modified: trunk/property/inc/class.soentity.inc.php
===================================================================
--- trunk/property/inc/class.soentity.inc.php   2016-09-04 16:24:18 UTC (rev 
15576)
+++ trunk/property/inc/class.soentity.inc.php   2016-09-04 16:24:35 UTC (rev 
15577)
@@ -820,6 +820,37 @@
 
                        if ($check_for_control && !$control_registered)
                        {
+                               /*
+                                * Filter inactive
+                                */
+                               static $cache_attribute_status = array();
+
+                               
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']))
+                                               {
+                                                       $_querymethod[] = 
"CAST( json_representation->>'status' AS integer) < 90";
+                                                       $__querymethod = 
array(); // remove block
+//                                                     foreach 
($attibute['choice'] as $choice)
+//                                                     {
+//                                                             
if($choice['id'] < 90)
+//                                                             {
+//                                                                     
$_querymethod[] = "CAST( json_representation->>'status' AS integer) = " 
.(int)$choice['id'];
+//                                                                     
$__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]