fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [11910] property: more on org_unit


From: Sigurd Nes
Subject: [Fmsystem-commits] [11910] property: more on org_unit
Date: Mon, 14 Apr 2014 09:00:20 +0000

Revision: 11910
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11910
Author:   sigurdne
Date:     2014-04-14 09:00:18 +0000 (Mon, 14 Apr 2014)
Log Message:
-----------
property: more on org_unit

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

Modified: trunk/frontend/inc/class.uientity.inc.php
===================================================================
--- trunk/frontend/inc/class.uientity.inc.php   2014-04-13 16:49:53 UTC (rev 
11909)
+++ trunk/frontend/inc/class.uientity.inc.php   2014-04-14 09:00:18 UTC (rev 
11910)
@@ -114,13 +114,30 @@
                                        foreach($_subs as $entry)
                                        {
                                                $_org_units[$entry['id']] = 
true;
+                                               if(isset($entry['children']) && 
$entry['children'])
+                                               {
+                                                       
$this->_get_children($entry['children'], $_org_units);                  
+                                               }
                                        }
                                }
                        }
                        $org_units = array_keys($_org_units);
-
                        $this->bo->org_units = $org_units;
+               }
 
+               /**
+               * Get the sublevels of the org tree into one arry
+               */
+               private function _get_children($data = array(), &$_org_units)
+               {
+                       foreach ($data as $entry)
+                       {
+                               $_org_units[$entry['id']] = true;
+                               if(isset($entry['children']) && 
$entry['children'])
+                               {
+                                       
$this->_get_children($entry['children'], $_org_units);                  
+                               }
+                       }
                }
 
 

Modified: trunk/property/inc/class.boentity.inc.php
===================================================================
--- trunk/property/inc/class.boentity.inc.php   2014-04-13 16:49:53 UTC (rev 
11909)
+++ trunk/property/inc/class.boentity.inc.php   2014-04-14 09:00:18 UTC (rev 
11910)
@@ -347,6 +347,21 @@
                        return 
$this->bocommon->select_list($selected,$criteria);
                }
 
+               /**
+               * Get the sublevels of the org tree into one arry
+               */
+               private function _get_children($data = array() )
+               {
+                       foreach ($data as $entry)
+                       {
+                               $this->org_units[]= $entry['id'];               
        
+                               if(isset($entry['children']) && 
$entry['children'])
+                               {
+                                       
$this->_get_children($entry['children']);                       
+                               }
+                       }
+               }
+
                function read($data= array())
                {
                        if($this->org_unit_id && !$this->org_units)
@@ -357,8 +372,13 @@
                                foreach($_subs as $entry)
                                {
                                        $this->org_units[]= $entry['id'];
+                                       if(isset($entry['children']) && 
$entry['children'])
+                                       {
+                                               
$this->_get_children($entry['children']);                       
+                                       }
                                }
                        }
+
                        static $location_data = array();
                        static $org_units_data = array();
 




reply via email to

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