fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10876] Overwrited function edit_check_list in mobile


From: Torstein
Subject: [Fmsystem-commits] [10876] Overwrited function edit_check_list in mobilefrontend
Date: Sat, 16 Feb 2013 11:53:01 +0000

Revision: 10876
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10876
Author:   vator
Date:     2013-02-16 11:53:01 +0000 (Sat, 16 Feb 2013)
Log Message:
-----------
Overwrited function edit_check_list in mobilefrontend

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

Modified: trunk/controller/inc/class.uicase.inc.php
===================================================================
--- trunk/controller/inc/class.uicase.inc.php   2013-02-16 11:52:41 UTC (rev 
10875)
+++ trunk/controller/inc/class.uicase.inc.php   2013-02-16 11:53:01 UTC (rev 
10876)
@@ -513,8 +513,6 @@
                {
                        $check_list_id = phpgw::get_var('check_list_id');
                        
-                       $check_list = $this->so->get_single($check_list_id);
-
                        $open_check_items_and_cases = 
$this->so_check_item->get_check_items_with_cases($check_list_id, $type = null, 
'open_or_waiting', null, 'return_array');
 
                        foreach($open_check_items_and_cases as $key => 
$check_item)
@@ -525,30 +523,137 @@
                                $open_check_items_and_cases[$key] = $check_item;
                        }
 
+                       $check_list = 
$this->so_check_list->get_single($check_list_id);
+                       $control = 
$this->so_control->get_single($check_list->get_control_id());                   
     
+
+      $location_code = $check_list->get_location_code();
+      
+
+                       $component_id = $check_list->get_component_id();
+
+                       if($component_id > 0)
+                       {
+                               $location_id = $check_list->get_location_id();
+                               $component_id = $check_list->get_component_id();
+                               
+                               $component_arr = 
execMethod('property.soentity.read_single_eav', array('location_id' => 
$location_id, 'id' => $component_id));
+                               $short_desc = 
execMethod('property.soentity.get_short_description', array('location_id' => 
$location_id, 'id' => $component_id));
+               
+                               $component = new controller_component();
+                               $component->set_location_code( 
$component_arr['location_code'] );
+               $component->set_xml_short_desc( $short_desc );
+                               $component_array = $component->toArray();
+                               
+                               $type = 'component';
+                               $building_location_code = 
$this->location_finder->get_building_location_code($component_arr['location_code']);
+                       }
+                       else
+                       {
+                               
+                               $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
+                               $type = 'location';
+                       }
+      
+      
+      $level = $this->location_finder->get_location_level($location_code);
+                       $year = date("Y", $check_list->get_deadline());
+                       $month = date("n", $check_list->get_deadline());
+                                                       
+      $user_role = true;
+
+                       // Fetches buildings on property
+                       $buildings_on_property = 
$this->location_finder->get_buildings_on_property($user_role, $location_code, 
$level);
+      
+      // Check list top section info
+      
+      
                        $data = array
                        (
-                               'open_check_items_and_cases'    => 
$open_check_items_and_cases,
-                               'check_list'                                    
                                => $check_list
+        'control'                                                              
                                        => $control,
+                               'check_list'                                    
                                                        => $check_list,
+                               'buildings_on_property'             => 
$buildings_on_property,
+        'location_array'                                                       
                        => $location_array,
+                               'component_array'                               
                                                => $component_array,
+                               'type'                                          
                                                                        => 
$type,
+                               'location_level'                                
                                                => $level,
+                               'building_location_code'                        
                        => $building_location_code,
+                               'current_year'                                  
                                                => $year,
+                               'current_month_nr'                              
                                        => $month,
+                               'open_check_items_and_cases'        => 
$open_check_items_and_cases,
+        'cases_view'                        => 'open_cases',
                        );
-                       
-                       self::render_template_xsl( array('case/cases_tab_menu', 
'case/view_open_cases', 'check_list/fragments/case_row', 
'check_list/fragments/select_buildings_on_property'), $data );                 
+                             
+                       self::render_template_xsl( 
array('check_list/fragments/check_list_menu', 'case/cases_tab_menu', 
'case/view_open_cases', 'case/case_row', 
+                                       
'check_list/fragments/nav_control_plan', 
'check_list/fragments/check_list_top_section', 
+                                       
'check_list/fragments/select_buildings_on_property'), $data );                  
                }
                
                function view_closed_cases()
                {
                        $check_list_id = phpgw::get_var('check_list_id');
-                       
-                       $check_list = $this->so->get_single($check_list_id);
-                       
+                       $check_list = 
$this->so_check_list->get_single($check_list_id);
+        
                        $closed_check_items_and_cases = 
$this->so_check_item->get_check_items_with_cases($check_list_id, null, 
'closed', null, 'return_array');
 
+      // Check list top section info         
+                       $control = 
$this->so_control->get_single($check_list->get_control_id());                
+      $location_code = $check_list->get_location_code();
+      
+      $level = $this->location_finder->get_location_level($location_code);
+                       $year = date("Y", $check_list->get_deadline());
+                       $month = date("n", $check_list->get_deadline());
+                                                       
+      $user_role = true;
+
+                       // Fetches buildings on property
+                       $buildings_on_property = 
$this->location_finder->get_buildings_on_property($user_role, $location_code, 
$level);
+      
+      $component_id = $check_list->get_component_id();
+
+                       if($component_id > 0)
+                       {
+                               $location_id = $check_list->get_location_id();
+                               $component_id = $check_list->get_component_id();
+                               
+                               $component_arr = 
execMethod('property.soentity.read_single_eav', array('location_id' => 
$location_id, 'id' => $component_id));
+                               $short_desc = 
execMethod('property.soentity.get_short_description', array('location_id' => 
$location_id, 'id' => $component_id));
+               
+                               $component = new controller_component();
+                               $component->set_location_code( 
$component_arr['location_code'] );
+               $component->set_xml_short_desc( $short_desc );
+                               $component_array = $component->toArray();
+                               
+                               $type = 'component';
+                               $building_location_code = 
$this->location_finder->get_building_location_code($component_arr['location_code']);
+                       }
+                       else
+                       {
+                               $location_code = 
$check_list->get_location_code();
+                               $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
+                               $type = 'location';
+                       }
+      // Check list top section info
+      
                        $data = array
                        (
-                               'closed_check_items_and_cases'                  
        => $closed_check_items_and_cases,
-                               'check_list'                                    
                                                                => $check_list
+        'control'                                                              
                                        => $control,
+                               'check_list'                                    
                                                        => $check_list,
+                               'buildings_on_property'             => 
$buildings_on_property,
+        'location_array'                                                       
                        => $location_array,
+                               'component_array'                               
                                                => $component_array,
+                               'type'                                          
                                                                        => 
$type,
+                               'location_level'                                
                                                => $level,
+                               'building_location_code'                        
                        => $building_location_code,
+                               'current_year'                                  
                                                => $year,
+                               'current_month_nr'                              
                                        => $month,
+                               'closed_check_items_and_cases'      => 
$closed_check_items_and_cases,
+                               'check_list'                        => 
$check_list,
+        'cases_view'                        => 'closed_cases'
                        );
                        
-                       self::render_template_xsl( array('case/cases_tab_menu', 
'case/view_closed_cases', 'check_list/fragments/select_buildings_on_property'), 
$data );
+      self::render_template_xsl( array('check_list/fragments/check_list_menu', 
'case/cases_tab_menu', 'case/view_closed_cases', 'case/case_row', 
+                                       
'check_list/fragments/nav_control_plan', 
'check_list/fragments/check_list_top_section', 
+                                       
'check_list/fragments/select_buildings_on_property'), $data );                  
                }
                
                public function query(){}

Modified: trunk/controller/inc/class.uicheck_list.inc.php
===================================================================
--- trunk/controller/inc/class.uicheck_list.inc.php     2013-02-16 11:52:41 UTC 
(rev 10875)
+++ trunk/controller/inc/class.uicheck_list.inc.php     2013-02-16 11:53:01 UTC 
(rev 10876)
@@ -270,7 +270,7 @@
                                'component_array'                               
        => $component_array,
                                'control'                                       
                                => $control,
                                'check_list'                                    
                => $check_list,
-        'buildings_on_property' => $buildings_on_property,
+        'buildings_on_property'   => $buildings_on_property,
                                'type'                                          
                                => $type,
                                'current_year'                                  
        => $year,
                                'current_month_nr'                              
=> $month_nr,
@@ -283,7 +283,10 @@
       
                        self::add_javascript('controller', 'controller', 
'custom_ui.js');
                        self::add_javascript('controller', 'controller', 
'ajax.js');
-                       self::render_template_xsl( 
array('check_list/add_check_list', 'check_list/fragments/nav_control_plan', 
'check_list/fragments/check_list_top_section', 
'check_list/fragments/select_buildings_on_property'), $data );
+      
+      self::render_template_xsl(array('check_list/add_check_list', 
'check_list/fragments/nav_control_plan', 
+                                      
'check_list/fragments/check_list_top_section', 
'check_list/fragments/check_list_menu', 
+                                      
'check_list/fragments/select_buildings_on_property'), $data);
                }
 
                /**
@@ -292,7 +295,7 @@
                 * @param HTTP:: check list id
                 * @return data array
                */
-               function edit_check_list( $check_list = null){
+               function edit_check_list( $check_list = null ){
                        if($check_list == null)
                        {
                                $check_list_id = 
phpgw::get_var('check_list_id');
@@ -357,7 +360,9 @@
                        self::add_javascript('controller', 'controller', 
'custom_ui.js');
                        self::add_javascript('controller', 'controller', 
'ajax.js');
                        
-                       
self::render_template_xsl(array('check_list/fragments/check_list_menu', 
'check_list/fragments/nav_control_plan', 
'check_list/fragments/check_list_top_section', 'check_list/edit_check_list', 
'check_list/fragments/select_buildings_on_property'), $data);
+                       
self::render_template_xsl(array('check_list/fragments/check_list_menu', 
'check_list/fragments/nav_control_plan', 
+                                      
'check_list/fragments/check_list_top_section', 'check_list/edit_check_list', 
+                                      
'check_list/fragments/select_buildings_on_property'), $data);
                }
                
                /**
@@ -515,7 +520,9 @@
                        self::add_javascript('controller', 'controller', 
'ajax.js');
       self::add_javascript('controller', 'controller', 'case.js');
                        
-                       
self::render_template_xsl(array('check_list/fragments/check_list_menu', 
'check_list/fragments/nav_control_plan', 
'check_list/fragments/check_list_top_section', 
'check_list/view_cases_for_check_list', 
'check_list/fragments/select_buildings_on_property'), $data);
+                       
self::render_template_xsl(array('check_list/fragments/check_list_menu', 
'check_list/fragments/nav_control_plan', 
+                                      
'check_list/fragments/check_list_top_section', 
'check_list/view_cases_for_check_list', 
+                                      
'check_list/fragments/select_buildings_on_property'), $data);
                }
                
                function view_control_info()
@@ -537,7 +544,7 @@
                
                                $component = new controller_component();
                                $component->set_location_code( 
$component_arr['location_code'] );
-                       $component->set_xml_short_desc( $short_desc );
+               $component->set_xml_short_desc( $short_desc );
                                $component_array = $component->toArray();
                                
                                $type = 'component';
@@ -545,17 +552,15 @@
                        }
                        else
                        {
-        echo "ok 1";
                                $location_code = 
$check_list->get_location_code();
                                $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
                                $type = 'location';
                                $level = 
$this->location_finder->get_location_level($location_code);
-        echo "ok 2";
                        }
-                       echo "ok 4";
+                       
                        $year = date("Y", $check_list->get_deadline());
                        $month = date("n", $check_list->get_deadline());
-      echo "ok 5";
+      
       $level = $this->location_finder->get_location_level($location_code);
                        $user_role = true;
 
@@ -578,7 +583,9 @@
 
                        phpgwapi_jquery::load_widget('core');
                        
-                       
self::render_template_xsl(array('check_list/fragments/check_list_menu', 
'check_list/fragments/nav_control_plan', 'check_list/view_control_info', 
'check_list/fragments/select_buildings_on_property'), $data);
+                       
self::render_template_xsl(array('check_list/fragments/check_list_menu', 
'check_list/fragments/check_list_top_section',
+                                      'check_list/fragments/nav_control_plan', 
'check_list/view_control_info', 
+                                      
'check_list/fragments/select_buildings_on_property'), $data);
     }
                
                function view_control_details()
@@ -664,7 +671,8 @@
                                'location_level'                                
                                                => $level,
                                'building_location_code'                        
                        => $building_location_code,
                                'current_year'                                  
                                                => $year,
-                               'current_month_nr'                              
                                        => $month
+                               'current_month_nr'                              
                                        => $month,
+        'cases_view'                        => 'add_case',
                        );
                        
       
@@ -674,7 +682,9 @@
                        self::add_javascript('controller', 'controller', 
'ajax.js');
       self::add_javascript('controller', 'controller', 'case.js');
                        
-                       
self::render_template_xsl(array('check_list/fragments/check_list_menu', 
'check_list/fragments/nav_control_plan', 
'check_list/fragments/check_list_top_section', 'case/add_case', 
'check_list/fragments/select_buildings_on_property'), $data);
+                       
self::render_template_xsl(array('check_list/fragments/check_list_menu', 
'check_list/fragments/nav_control_plan', 
+                                      
'check_list/fragments/check_list_top_section', 'case/add_case', 
+                                      
'check_list/fragments/select_buildings_on_property'), $data);
                }
                
                function view_control_items()




reply via email to

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