fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [8742]


From: Torstein
Subject: [Fmsystem-commits] [8742]
Date: Tue, 31 Jan 2012 16:37:26 +0000

Revision: 8742
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8742
Author:   vator
Date:     2012-01-31 16:37:26 +0000 (Tue, 31 Jan 2012)
Log Message:
-----------


Modified Paths:
--------------
    trunk/controller/inc/class.socontrol.inc.php
    trunk/controller/inc/class.uicontrol.inc.php
    trunk/controller/inc/class.uicontrol_location.inc.php
    trunk/controller/setup/phpgw_no.lang

Modified: trunk/controller/inc/class.socontrol.inc.php
===================================================================
--- trunk/controller/inc/class.socontrol.inc.php        2012-01-31 15:04:59 UTC 
(rev 8741)
+++ trunk/controller/inc/class.socontrol.inc.php        2012-01-31 16:37:26 UTC 
(rev 8742)
@@ -228,7 +228,7 @@
                        }
                }
 
-               function add_location_to_control($control_id, $location_code)
+               function register_control_to_location($control_id, 
$location_code)
                {
                        $sql =  "INSERT INTO controller_control_location_list 
(control_id, location_code) values($control_id, $location_code)";
                        $this->db->query($sql);

Modified: trunk/controller/inc/class.uicontrol.inc.php
===================================================================
--- trunk/controller/inc/class.uicontrol.inc.php        2012-01-31 15:04:59 UTC 
(rev 8741)
+++ trunk/controller/inc/class.uicontrol.inc.php        2012-01-31 16:37:26 UTC 
(rev 8742)
@@ -73,7 +73,7 @@
                        'view_check_lists_for_control'          =>      true,
                        'get_controls_by_control_area'          =>      true,
                        'get_locations_for_control'                     =>      
true,
-                       'add_location_to_control'                       =>      
true
+                       'register_control_to_location'          =>      true
                );
 
                public function __construct()
@@ -594,9 +594,6 @@
                        return $tabs;
                } 
                
-               
-               
-               
                // Returns control list info as JSON
                public function get_controls_by_control_area()
                {
@@ -614,19 +611,27 @@
                public function get_locations_for_control()
                {
                        $control_id = phpgw::get_var('control_id');
-                       $locations_for_control_array = 
$this->so->get_locations_for_control($control_id);
                        
-                       foreach($locations_for_control_array as $location)
+                       if(is_numeric($control_id) & $control_id > 0)
                        {
-                               $results['results'][]= $location;       
+                               $locations_for_control_array = 
$this->so->get_locations_for_control($control_id);
+                       
+                               foreach($locations_for_control_array as 
$location)
+                               {
+                                       $results['results'][]= $location;       
+                               }
+                               
+                               $results['total_records'] = count( 
$locations_for_control_array );
+                               $results['start'] = 1;
+                               $results['sort'] = 'location_code';
+                                                       
+                               array_walk($results['results'], array($this, 
'add_actions'), array($type));
                        }
+                       else
+                       {
+                               $results['total_records'] = 0;
+                       }                               
                        
-                       $results['total_records'] = count( 
$locations_for_control_array );
-                       $results['start'] = 1;
-                       $results['sort'] = 'location_code';
-                                               
-                       array_walk($results['results'], array($this, 
'add_actions'), array($type));
-                                                       
                        return $this->yui_results($results);
                }
                
@@ -645,12 +650,12 @@
                        $value['parameters'][] = "control_id";
                }
                
-               public function add_location_to_control()
+               public function register_control_to_location()
                {
                        $control_id = phpgw::get_var('control_id');
                        $location_code = phpgw::get_var('location_code');
                        
-                       $this->so->add_location_to_control($control_id, 
$location_code);
+                       $this->so->register_control_to_location($control_id, 
$location_code);
                }
                
                public function query()

Modified: trunk/controller/inc/class.uicontrol_location.inc.php
===================================================================
--- trunk/controller/inc/class.uicontrol_location.inc.php       2012-01-31 
15:04:59 UTC (rev 8741)
+++ trunk/controller/inc/class.uicontrol_location.inc.php       2012-01-31 
16:37:26 UTC (rev 8742)
@@ -59,7 +59,7 @@
                var $public_functions = array(
                                                                                
'index' => true,
                                                                                
'view_locations_for_control'    => true,
-                                                                               
'add_location_to_control'               => true,
+                                                                               
'register_control_to_location'          => true,
                                                                        );
 
                function __construct()
@@ -120,7 +120,7 @@
                                                'label' => 
lang('View_locations_for_control')
                                        ), array(
                                                'label' => 
lang('Add_locations_for_control'),
-                                               'link'  => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'controller.uicontrol_location.add_location_to_control'))
+                                               'link'  => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'controller.uicontrol_location.register_to_control_to_location'))
                                        ));
                        
                        $data = array(
@@ -178,7 +178,7 @@
                        
self::render_template_xsl(array('control_location/control_location_tabs', 
'control_location/view_locations_for_control', 'common' ), $data);            
                }
                
-               function add_location_to_control()
+               function register_control_to_location()
                {
                        if(phpgw::get_var('phpgw_return_as') == 'json') {
                                return $this->query();
@@ -214,8 +214,6 @@
                        $default_value = array ('id'=>'','name'=>lang('no 
role'));
                        array_unshift ($responsibility_roles,$default_value);
                        
-                       $control_areas_array = 
$this->so_control_area->get_control_areas_as_array();
-                       
                        // Sigurd: START as categories
                        $cats   = CreateObject('phpgwapi.categories', -1, 
'controller', '.control');
                        $cats->supress_info     = true;
@@ -244,7 +242,7 @@
                                        
                        $data = array(
                                'tabs'                                          
=> $GLOBALS['phpgw']->common->create_tabs($tabs, 1),
-                               'view'                                          
=> "add_location_to_control",
+                               'view'                                          
=> "register_control_to_location",
                                'control_filters'                       => 
array(
                                        'control_areas_array2'  => 
$control_areas_array2,
                                        'control_array'                         
=> $control_array
@@ -304,7 +302,7 @@
                        self::add_javascript('controller', 'controller', 
'jquery.js');
                        self::add_javascript('controller', 'controller', 
'ajax.js');
 
-                       
self::render_template_xsl(array('control_location/control_location_tabs', 
'control_location/add_location_to_control', 'common'), $data);                
+                       
self::render_template_xsl(array('control_location/control_location_tabs', 
'control_location/register_control_to_location', 'common'), $data);           
                }
                
                public function query(){
@@ -348,7 +346,7 @@
                        $value['parameters'] = array();
                        
                        $value['ajax'][] = true;
-                       $value['actions'][] = 
html_entity_decode(self::link(array('menuaction' => 
'controller.uicontrol.add_location_to_control', 'location_code' => 
$value['location_code'])));
+                       $value['actions'][] = 
html_entity_decode(self::link(array('menuaction' => 
'controller.uicontrol.register_control_to_location', 'location_code' => 
$value['location_code'])));
                        $value['labels'][] = lang('add_location');
                        $value['parameters'][] = "control_id";
                }

Modified: trunk/controller/setup/phpgw_no.lang
===================================================================
--- trunk/controller/setup/phpgw_no.lang        2012-01-31 15:04:59 UTC (rev 
8741)
+++ trunk/controller/setup/phpgw_no.lang        2012-01-31 16:37:26 UTC (rev 
8742)
@@ -1,4 +1,4 @@
-add_check_list_to_location     controller      no      Registrer sjekkliste 
for bygg
+add_check_list_to_location     controller      no      Registrer kontroll for 
bygg
 location_connections   controller      no      Byggknytning
 control        controller      no      Kontroll
 controller     common  no      Kontroll




reply via email to

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