fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [9667]


From: Erik Holm-Larsen
Subject: [Fmsystem-commits] [9667]
Date: Tue, 26 Jun 2012 11:38:40 +0000

Revision: 9667
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9667
Author:   erikhl
Date:     2012-06-26 11:38:39 +0000 (Tue, 26 Jun 2012)
Log Message:
-----------


Modified Paths:
--------------
    trunk/controller/inc/class.socontrol.inc.php
    trunk/controller/inc/hook_home.inc.php

Modified: trunk/controller/inc/class.socontrol.inc.php
===================================================================
--- trunk/controller/inc/class.socontrol.inc.php        2012-06-26 11:06:06 UTC 
(rev 9666)
+++ trunk/controller/inc/class.socontrol.inc.php        2012-06-26 11:38:39 UTC 
(rev 9667)
@@ -110,7 +110,7 @@
                        }
                }
 
-               function get_controls_for_location($location_code, $role_id, 
$from_date, $to_date, $repeat_type)
+/*             function get_controls_for_location($location_code, $role_id, 
$from_date, $to_date, $repeat_type)
                {
                    $controls = array();
                    $controls_loc = 
$this->get_controls_by_location($location_code, $from_date, $to_date, 
$repeat_type, '', $role_id );
@@ -127,6 +127,7 @@
                    
                    return $controls;
                }
+*/
                
                public function get_controls_by_location($location_code, 
$from_date, $to_date, $repeat_type, $return_type = "return_object", $role_id = 
'')
                {
@@ -196,7 +197,7 @@
                        
                        $sql .= "AND (c.start_date <= $from_date AND c.end_date 
IS NULL ";
                        $sql .= "OR c.end_date > $from_date AND c.start_date < 
$to_date)";
-
+                       
                        $this->db->query($sql);
                        
                        while($this->db->next_record()) {
@@ -257,7 +258,7 @@
                        $sql .= "OR c.start_date > $from_date AND c.start_date 
< $to_date) ";
                        
                        $sql  .= "ORDER BY bim_item.id ";
-                        
+                        var_dump($sql);
                        $this->db->query($sql);
                        
                        $component_id = 0;

Modified: trunk/controller/inc/hook_home.inc.php
===================================================================
--- trunk/controller/inc/hook_home.inc.php      2012-06-26 11:06:06 UTC (rev 
9666)
+++ trunk/controller/inc/hook_home.inc.php      2012-06-26 11:38:39 UTC (rev 
9667)
@@ -69,7 +69,20 @@
        $controls_for_location_array = array();
        foreach($my_locations as $location)
        {
-         $controls_for_location_array[] = array($location["location_code"], 
$so_control->get_controls_for_location($location["location_code"], 
$location["role_id"], $from_date_ts, $to_date_ts, $repeat_type ));
+           $controls = array();
+           $controls_loc = 
$so_control->get_controls_by_location($location["location_code"], 
$from_date_ts, $to_date_ts, $repeat_type, '', $location["role_id"] );
+           $controls_comp = 
$so_control->get_controls_for_components_by_location($location["location_code"],
 $from_date_ts, $to_date_ts, $repeat_type, '', $location["role_id"] );
+           
+           foreach($controls_loc as $cl)
+           {
+               $controls[] = $cl;
+           }
+           foreach($controls_comp as $cc)
+           {
+               $controls[] = $cc;
+           }
+           
+        $controls_for_location_array[] = array($location["location_code"], 
$controls);
        }
        
 




reply via email to

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