fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [11944] Controller: add org unit to short description


From: Sigurd Nes
Subject: [Fmsystem-commits] [11944] Controller: add org unit to short description
Date: Mon, 05 May 2014 12:17:40 +0000

Revision: 11944
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11944
Author:   sigurdne
Date:     2014-05-05 12:17:39 +0000 (Mon, 05 May 2014)
Log Message:
-----------
Controller: add org unit to short description

Modified Paths:
--------------
    trunk/controller/inc/class.uicase.inc.php

Modified: trunk/controller/inc/class.uicase.inc.php
===================================================================
--- trunk/controller/inc/class.uicase.inc.php   2014-05-05 11:48:10 UTC (rev 
11943)
+++ trunk/controller/inc/class.uicase.inc.php   2014-05-05 12:17:39 UTC (rev 
11944)
@@ -188,6 +188,9 @@
                        //Populating array with saved control items for each 
group
                        //Cache result
                        $components_at_location = array();
+                       $org_units_data = array();
+                       $sogeneric      = CreateObject('property.sogeneric');
+                       $sogeneric->get_location_info('org_unit');
                        
                        foreach ($saved_control_groups as $control_group)
                        {       
@@ -227,6 +230,8 @@
                                                if( 
!isset($components_at_location[$component_location_id][$location_code_search_components])
  || !$_components_at_location = 
$components_at_location[$component_location_id][$location_code_search_components])
                                                {
                                                        
$_components_at_location = execMethod('property.soentity.get_eav_list', 
$criterias_array);
+
+
                                                        
$components_at_location[$component_location_id][$location_code_search_components]
 = $_components_at_location;
                                                }
                                                
@@ -236,6 +241,20 @@
                                                {
                                                        
foreach($_components_at_location as &$_component_at_location)
                                                        {
+
+                                                               /**
+                                                               * Add org unit 
to short description
+                                                               */
+                                                               
if(isset($_component_at_location['org_unit_id']) && 
$_component_at_location['org_unit_id'])
+                                                               {
+                                                                       
if(!isset($org_units_data[$_component_at_location['org_unit_id']]))
+                                                                       {
+                                                                               
$org_unit = $sogeneric->read_single(array('id' => 
$_component_at_location['org_unit_id']));
+                                                                               
$org_units_data[$_component_at_location['org_unit_id']]['name'] = 
$org_unit['name'];
+                                                                       }
+                                                                       
$_component_at_location['short_description'] .= " 
[{$org_units_data[$_component_at_location['org_unit_id']]['name']}]";
+                                                               }
+
                                                                
if(isset($cases_at_component_group[$control_group->get_id()][$_component_at_location['location_id']][$_component_at_location['id']]))
                                                                {
                                                                        
$_component_at_location['short_description'] .= ' (' . 
$cases_at_component_group[$control_group->get_id()][$_component_at_location['location_id']][$_component_at_location['id']]
 . ')';




reply via email to

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