fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [7882] rental: wrapper for get_result_units for use w


From: Sigurd Nes
Subject: [Fmsystem-commits] [7882] rental: wrapper for get_result_units for use with custom function-call for custom fields
Date: Fri, 14 Oct 2011 09:21:17 +0000

Revision: 7882
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7882
Author:   sigurdne
Date:     2011-10-14 09:21:16 +0000 (Fri, 14 Oct 2011)
Log Message:
-----------
rental:  wrapper for get_result_units for use with custom function-call for 
custom fields

Modified Paths:
--------------
    trunk/rental/inc/class.bofellesdata.inc.php

Modified: trunk/rental/inc/class.bofellesdata.inc.php
===================================================================
--- trunk/rental/inc/class.bofellesdata.inc.php 2011-10-14 09:18:34 UTC (rev 
7881)
+++ trunk/rental/inc/class.bofellesdata.inc.php 2011-10-14 09:21:16 UTC (rev 
7882)
@@ -21,12 +21,11 @@
                
                public function get_db()
                {
-
                        $config = CreateObject('phpgwapi.config','rental');
                        $config->read();
 
-//                     $db = createObject('phpgwapi.db', null, null, true);
-                       $db = createObject('property.db_oci8');
+                       $db = createObject('phpgwapi.db', null, null, true);
+//                     $db = createObject('property.db_oci8'); // this one was 
intended for premilay testing
 
                        $db->debug = 
!!$config->config_data['external_db_debug'];
                        $db->Host = $config->config_data['external_db_host'];
@@ -167,6 +166,26 @@
                                                
                        return $result_units;
                }
+
+               /**
+                * Get id/name for result unit
+                * 
+                * @return array values prepared for standardized select/filter
+                */
+               public function get_result_units_wrapper()
+               {
+                       $result_units = $this->get_result_units();
+                       $values = array();
+                       foreach($result_units as $result_unit)
+                       {
+                               $values[] = array
+                               (
+                                       'id'    => $result_unit['ORG_UNIT_ID'],
+                                       'name'  => "{$result_unit['UNIT_ID']} - 
{$result_unit['ORG_UNIT_NAME']}"
+                               );
+                       }
+                       return $values;
+               }
                
                public function get_result_unit_with_leader($org_unit_id)
                {




reply via email to

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