fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10031] controller: remove component_id and location_


From: Sigurd Nes
Subject: [Fmsystem-commits] [10031] controller: remove component_id and location_id from control
Date: Tue, 25 Sep 2012 08:49:30 +0000

Revision: 10031
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10031
Author:   sigurdne
Date:     2012-09-25 08:49:29 +0000 (Tue, 25 Sep 2012)
Log Message:
-----------
controller: remove component_id and location_id from control

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

Modified: trunk/controller/inc/class.socontrol.inc.php
===================================================================
--- trunk/controller/inc/class.socontrol.inc.php        2012-09-25 08:04:18 UTC 
(rev 10030)
+++ trunk/controller/inc/class.socontrol.inc.php        2012-09-25 08:49:29 UTC 
(rev 10031)
@@ -202,7 +202,7 @@
                 * @return array with controls as objects or arrays
                 */
                
-               public function 
get_controls_for_components_by_location($location_code, $from_date, $to_date, 
$repeat_type, $return_type = "return_object", $role_id = 0)
+               public function 
get_controls_for_components_by_location($location_code, $from_date, $to_date, 
$repeat_type, $role_id = 0)
                {                       
                        $controls_array = array();
                        
@@ -231,31 +231,25 @@
 
                        while($this->db->next_record())
                        {
-                               $control = new 
controller_control($this->unmarshal($this->db->f('id'), 'int'));
-                               
$control->set_title($this->unmarshal($this->db->f('title', true), 'string'));
-                               
$control->set_description($this->unmarshal($this->db->f('description', true), 
'string'));
-                               
$control->set_start_date($this->unmarshal($this->db->f('start_date'), 'int'));
-                               
$control->set_end_date($this->unmarshal($this->db->f('end_date'), 'int'));
-                               
$control->set_procedure_id($this->unmarshal($this->db->f('procedure_id'), 
'int'));
-                               
$control->set_requirement_id($this->unmarshal($this->db->f('requirement_id'), 
'int'));
-                               
$control->set_costresponsibility_id($this->unmarshal($this->db->f('costresponsibility_id'),
 'int'));
-                               
$control->set_responsibility_id($this->unmarshal($this->db->f('responsibility_id'),
 'int'));
-                               
$control->set_responsibility_name($this->unmarshal($this->db->f('responsibility_name',
 true), 'string'));
-                               
$control->set_control_area_id($this->unmarshal($this->db->f('control_area_id'), 
'int'));
-                               
$control->set_repeat_type($this->unmarshal($this->db->f('repeat_type'), 'int'));
-                               
$control->set_repeat_type_label($this->unmarshal($this->db->f('repeat_type'), 
'int'));
-                               
$control->set_repeat_interval($this->unmarshal($this->db->f('repeat_interval'), 
'int'));
-                               
$control->set_component_id($this->unmarshal($this->db->f('component_id'), 
'int'));
-                               
$control->set_location_id($this->unmarshal($this->db->f('location_id'), 'int'));
-
-                       if($return_type == "return_object")
-                               {
-                                       $controls_array[] = $control;
-                               }
-                               else
-                               {
-                                       $controls_array[] = $control->toArray();
-                               }
+       
+                               $controls_array[] = array
+                               (
+                                       'id'                                    
=> $this->db->f('id'),
+                                       'title'                                 
=> $this->db->f('title', true),
+                                       'description'                   => 
$this->db->f('description', true),
+                                       'start_date'                    => 
$this->db->f('start_date'),
+                                       'end_date'                              
=> $this->db->f('end_date'),
+                                       'procedure_id'                  => 
$this->db->f('procedure_id'),
+                                       'requirement_id'                => 
$this->db->f('requirement_id'),
+                                       'costresponsibility_id' => 
$this->db->f('costresponsibility_id'),
+                                       'responsibility_id'             => 
$this->db->f('responsibility_id'),
+                                       'responsibility_name'   => 
$this->db->f('responsibility_name', true),
+                                       'control_area_id'               => 
$this->db->f('control_area_id'),
+                                       'repeat_type'                   => 
$this->db->f('repeat_type'),
+                                       'repeat_interval'               => 
$this->db->f('repeat_interval'),
+                                       'component_id'                  => 
$this->db->f('component_id'),
+                                       'location_id'                   => 
$this->db->f('location_id')
+                               );
                        }
 
                        return $controls_array; 
@@ -356,8 +350,6 @@
                                
$control->set_repeat_type($this->unmarshal($this->db->f('repeat_type'), 'int'));
                                
$control->set_repeat_type_label($this->unmarshal($this->db->f('repeat_type'), 
'int'));
                                
$control->set_repeat_interval($this->unmarshal($this->db->f('repeat_interval'), 
'int'));
-                               
$control->set_component_id($this->unmarshal($this->db->f('component_id'), 
'int'));
-                               
$control->set_location_id($this->unmarshal($this->db->f('location_id'), 'int'));
                        
                                if($return_type == "return_object")
                                {

Modified: trunk/controller/inc/hook_home.inc.php
===================================================================
--- trunk/controller/inc/hook_home.inc.php      2012-09-25 08:04:18 UTC (rev 
10030)
+++ trunk/controller/inc/hook_home.inc.php      2012-09-25 08:49:29 UTC (rev 
10031)
@@ -381,7 +381,7 @@
 
                $controls = array();
                $controls_loc = 
$so_control->get_controls_by_location($location["location_code"], 
$from_date_ts, $to_date_ts, $repeat_type, "return_array", $location["role_id"] 
);
-               $controls_comp = 
$so_control->get_controls_for_components_by_location($location["location_code"],
 $from_date_ts, $to_date_ts, $repeat_type, "return_array", $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)
                {

Modified: trunk/controller/inc/model/class.control.inc.php
===================================================================
--- trunk/controller/inc/model/class.control.inc.php    2012-09-25 08:04:18 UTC 
(rev 10030)
+++ trunk/controller/inc/model/class.control.inc.php    2012-09-25 08:49:29 UTC 
(rev 10031)
@@ -57,8 +57,6 @@
                protected $responsibility_name;
                protected $control_area_id;
                protected $control_area_name;
-               protected $location_id;
-               protected $component_id;
 
                // Objects
                protected $check_lists_array = array();
@@ -235,27 +233,6 @@
                        $this->error_msg_array = $error_msg_array;
                }
 
-               public function set_component_id($component_id)
-               {
-                       $this->component_id = $component_id;
-               }
-               
-               public function get_component_id()
-               {
-                       return $this->component_id;
-               }
-
-
-               public function set_location_id($location_id)
-               {
-                       $this->location_id = $location_id;
-               }
-               
-               public function get_location_id()
-               {
-                       return $this->location_id;
-               }
-
                /**
                 * Get a static reference to the storage object associated with 
this model object
                 * 
@@ -315,9 +292,7 @@
                                'control_area_name' => 
$this->get_control_area_name(),
                                'repeat_type' => $this->get_repeat_type(),
                                'repeat_interval' => 
$this->get_repeat_interval(),
-                               'responsibility_name' => 
$this->get_responsibility_name(),
-                               'component_id'          =>  
$this->get_component_id(),
-                               'location_id'           =>  
$this->get_location_id()
+                               'responsibility_name' => 
$this->get_responsibility_name()
                        );
                }
                                




reply via email to

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