fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [17013] property: more on location exceptions


From: sigurdne
Subject: [Fmsystem-commits] [17013] property: more on location exceptions
Date: Thu, 31 Aug 2017 04:52:17 -0400 (EDT)

Revision: 17013
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=17013
Author:   sigurdne
Date:     2017-08-31 04:52:17 -0400 (Thu, 31 Aug 2017)
Log Message:
-----------
property: more on location exceptions

Modified Paths:
--------------
    trunk/property/inc/class.bogeneric.inc.php
    trunk/property/inc/class.sogeneric.inc.php
    trunk/property/inc/class.sogeneric_.inc.php

Modified: trunk/property/inc/class.bogeneric.inc.php
===================================================================
--- trunk/property/inc/class.bogeneric.inc.php  2017-08-30 22:01:08 UTC (rev 
17012)
+++ trunk/property/inc/class.bogeneric.inc.php  2017-08-31 08:52:17 UTC (rev 
17013)
@@ -167,9 +167,9 @@
                                                {
                                                        $entry[$field['name']] 
= $GLOBALS['phpgw']->accounts->get($entry[$field['name']])->__toString();
                                                }
-                                               else if (isset($field['role']) 
&& $field['role'] == 'parent')
+                                               else if (isset($field['role']) 
&& $field['role'] == 'parent' && 
!empty($field['values_def']['method_input']['type']))
                                                {
-                                                       $path = 
$this->so->get_path(array('type' => $this->type, 'id' => 
$entry[$field['name']]));
+                                                       $path = 
$this->so->get_path(array('type' => 
$field['values_def']['method_input']['type'], 'id' => $entry[$field['name']]));
                                                        $entry[$field['name']] 
= implode(' > ', $path);
                                                }
                                                else if 
(isset($field['values_def']['get_single_value']) && 
$field['values_def']['get_single_value'])

Modified: trunk/property/inc/class.sogeneric.inc.php
===================================================================
--- trunk/property/inc/class.sogeneric.inc.php  2017-08-30 22:01:08 UTC (rev 
17012)
+++ trunk/property/inc/class.sogeneric.inc.php  2017-08-31 08:52:17 UTC (rev 
17013)
@@ -2614,6 +2614,7 @@
                                                                'nullable' => 
false,
                                                                'filter' => 
true,
                                                                'sortable' => 
true,
+                                                               'role' => 
'parent',
                                                                'values_def' => 
array
                                                                (
                                                                        
'valueset' => false,

Modified: trunk/property/inc/class.sogeneric_.inc.php
===================================================================
--- trunk/property/inc/class.sogeneric_.inc.php 2017-08-30 22:01:08 UTC (rev 
17012)
+++ trunk/property/inc/class.sogeneric_.inc.php 2017-08-31 08:52:17 UTC (rev 
17013)
@@ -102,6 +102,25 @@
                                        {
                                                $_filter_array[] = 
"{$field['name']} {$this->_like} '%,{$filter[$field['name']]},%'";
                                        }
+                                       else if 
(!empty($filter[$field['name']]) && 
(isset($field['values_def']['method_input']['role']) && 
$field['values_def']['method_input']['role'] == 'parent'))
+                                       {
+
+                                               $field_object = clone($this);
+                                               
$field_object->get_location_info($field['values_def']['method_input']['type'], 
0);
+                                               $this->table = 
$field_object->location_info['table'];
+                                               $children = 
$this->get_children2(array(), $filter[$field['name']], 0, true );
+                                                       
+                                               $_children = 
array($filter[$field['name']]);
+                                               if($children)
+                                               {
+                                                       foreach ($children as 
$_child)
+                                                       {
+                                                               $_children[] = 
$_child['id'];
+                                                       }
+                                               }
+                                               $_filter_array[] = 
"{$field['name']} IN (" . implode(',', $_children ) . ')';
+
+                                       }
                                        else if (isset($filter[$field['name']]) 
&& $filter[$field['name']])
                                        {
                                                $_filter_array[] = 
"{$field['name']} = '{$filter[$field['name']]}'";
@@ -1104,7 +1123,7 @@
                        {
                                return array();
                        }
-                       $this->table = $table;
+       //              $this->table = $table;
 
                        if (isset($this->location_info['mapping']) && 
$this->location_info['mapping'])
                        {




reply via email to

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