fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10911] Deleted function view_cases_for_check_list


From: Torstein
Subject: [Fmsystem-commits] [10911] Deleted function view_cases_for_check_list
Date: Mon, 18 Feb 2013 12:20:45 +0000

Revision: 10911
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10911
Author:   vator
Date:     2013-02-18 12:20:45 +0000 (Mon, 18 Feb 2013)
Log Message:
-----------
Deleted function view_cases_for_check_list

Modified Paths:
--------------
    trunk/controller/inc/class.hook_helper.inc.php
    trunk/controller/inc/class.uicase.inc.php
    trunk/controller/inc/class.uicheck_list.inc.php
    trunk/controller/setup/phpgw_no.lang
    trunk/controller/templates/base/check_list/add_check_list.xsl
    trunk/controller/templates/base/check_list/edit_check_list.xsl
    trunk/controller/templates/base/check_list/fragments/check_list_menu.xsl
    
trunk/controller/templates/base/check_list/fragments/check_list_top_section.xsl
    trunk/controller/templates/base/css/base.css

Added Paths:
-----------
    trunk/controller/templates/base/check_list/fragments/add_check_list_menu.xsl

Modified: trunk/controller/inc/class.hook_helper.inc.php
===================================================================
--- trunk/controller/inc/class.hook_helper.inc.php      2013-02-18 07:54:07 UTC 
(rev 10910)
+++ trunk/controller/inc/class.hook_helper.inc.php      2013-02-18 12:20:45 UTC 
(rev 10911)
@@ -88,7 +88,7 @@
                        $styling .= " .home_portal .title { 
width:300px;margin:0 20px 0 0;}";
                        $styling .= " .home_portal .control-area { 
width:200px;}";
                        $styling .= " .home_portal .control { width:300px;}";
-                       $styling .= " .home_portal .date { margin-left: 
20px;width:130px;}";
+                       $styling .= " .home_portal .date { margin-left: 
20px;width:130px;float:left;}";
                        $styling .= " .home_portal li { overflow: 
hidden;margin: 10px;}";
                        $styling .= " .home_portal li div { display: 
block;float:left;cursor: pointer;vertical-align: middle;}";
 
@@ -621,7 +621,7 @@
                                                                $link = "";
                                                                $link = 
$GLOBALS['phpgw']->link("{$url_correction}/index.php", array('menuaction' => 
'controller.uicheck_list.add_check_list', 'type' => "location", 'control_id' => 
$my_control['id'], 'location_code' => $location_code, 'deadline_ts' => 
$deadline_ts));
 
-                                                               
$my_assigned_controls_HTML .= "<a href='$link'><div 
class='date'>{$date_str}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$location_name}</div><div 
class='control-area'>{$control_area_name}</div></a>";
+                                                               
$my_assigned_controls_HTML .= "<li><a href='$link'><div 
class='date'>{$date_str}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$location_name}</div><div 
class='control-area'>{$control_area_name}</div></a></li>";
                                                        }
                                                }
                                                else if($check_list_type == 
"component")
@@ -651,7 +651,7 @@
                                                                $link = "";
                                                                $link = 
$GLOBALS['phpgw']->link("{$url_correction}/index.php", array('menuaction' => 
'controller.uicheck_list.add_check_list', 'type' => "component", 'control_id' 
=> $my_control['id'], 'location_id' => $location_id, 'component_id' => 
$component_id, 'deadline_ts' => $deadline_ts));
 
-                                                               
$my_assigned_controls_HTML .= "<a href='$link'><div 
class='date'>{$date_str}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$short_desc_arr}</div><div 
class='control-area'>{$control_area_name}</div></a>";
+                                                               
$my_assigned_controls_HTML .= "<li><a href='$link'><div 
class='date'>{$date_str}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$short_desc_arr}</div><div 
class='control-area'>{$control_area_name}</div></a></li>";
                                                        }
                                                }
                                        }
@@ -678,7 +678,7 @@
                                                        $link = "";
                                                        $link = 
$GLOBALS['phpgw']->link("{$url_correction}/index.php", array('menuaction' => 
'controller.uicheck_list.edit_check_list', 'check_list_id' => $check_list_id));
 
-                                                       
$my_assigned_controls_HTML .= "<a href='$link'><div 
class='date'>{$date_str}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$location_name}</div><div 
class='control-area'>{$control_area_name}</div></a>";
+                                                       
$my_assigned_controls_HTML .= "<li><a href='$link'><div 
class='date'>{$date_str}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$location_name}</div><div 
class='control-area'>{$control_area_name}</div></a></li>";
                                                }
                                        }
                                }

Modified: trunk/controller/inc/class.uicase.inc.php
===================================================================
--- trunk/controller/inc/class.uicase.inc.php   2013-02-18 07:54:07 UTC (rev 
10910)
+++ trunk/controller/inc/class.uicase.inc.php   2013-02-18 12:20:45 UTC (rev 
10911)
@@ -523,7 +523,7 @@
                        self::add_javascript('controller', 'controller', 
'custom_ui.js');
                        self::add_javascript('controller', 'controller', 
'ajax.js');
                        
-                       
self::render_template_xsl(array('check_list/check_list_menu', 
'case/view_case_message'), $data);
+                       
self::render_template_xsl(array('check_list/fragments/check_list_menu', 
'case/view_case_message'), $data);
                }
                
                public function updateStatusForCases($location_id, 
$location_item_id, $updateStatus = 0){

Modified: trunk/controller/inc/class.uicheck_list.inc.php
===================================================================
--- trunk/controller/inc/class.uicheck_list.inc.php     2013-02-18 07:54:07 UTC 
(rev 10910)
+++ trunk/controller/inc/class.uicheck_list.inc.php     2013-02-18 12:20:45 UTC 
(rev 10911)
@@ -1,650 +1,645 @@
 <?php
-       /**
-       * phpGroupWare - controller: a part of a Facilities Management System.
-       *
-       * @author Erik Holm-Larsen <address@hidden>
-       * @author Torstein Vadla <address@hidden>
-       * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc. 
http://www.fsf.org/
-       * This file is part of phpGroupWare.
-       *
-       * phpGroupWare is free software; you can redistribute it and/or modify
-       * it under the terms of the GNU General Public License as published by
-       * the Free Software Foundation; either version 2 of the License, or
-       * (at your option) any later version.
-       *
-       * phpGroupWare is distributed in the hope that it will be useful,
-       * but WITHOUT ANY WARRANTY; without even the implied warranty of
-       * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-       * GNU General Public License for more details.
-       *
-       * You should have received a copy of the GNU General Public License
-       * along with phpGroupWare; if not, write to the Free Software
-       * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 
 USA
-       *
-       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
-       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/
-       * @package property
-       * @subpackage controller
-       * @version $Id$
-       */
-       
-       /**
-       * Import the jQuery class
-       */
-       phpgw::import_class('phpgwapi.jquery');
 
-       /**
-       * Import the yui class
-       */
-       phpgw::import_class('phpgwapi.yui');
-       phpgw::import_class('phpgwapi.uicommon');
-       phpgw::import_class('controller.socheck_list');
-       phpgw::import_class('phpgwapi.datetime');
-       
-       include_class('controller', 'check_list', 'inc/model/');
-       include_class('controller', 'check_item', 'inc/model/');
-       include_class('controller', 'date_generator', 'inc/component/');
-       include_class('controller', 'check_list_status_updater', 'inc/helper/');
-  include_class('controller', 'date_converter', 'inc/helper/');
-  include_class('controller', 'location_finder', 'inc/helper/');
-               
-       class controller_uicheck_list extends phpgwapi_uicommon
-       {
-               protected $so;
-               protected $so_control;
-               protected $so_control_item;
-               protected $so_check_item;
-               protected $so_procedure;
-               protected $so_control_group_list;
-               protected $so_control_group;
-               protected $so_control_item_list;
-    protected $location_finder;
-       
-               var $public_functions = array(
-                                                                               
'index'                                                                         
        => true,
-                                                                               
'add_check_list'                                                => true,
-                                                                               
'save_check_list'                                       => true,
-                                                                               
'edit_check_list'                                       => true,
-                                                                               
'print_check_list'                                      => true,
-                    'view_control_info'                                => true,
-                                                                               
'view_control_details'                  => true,
-                                                                               
'view_control_items'                            => true,
-                                                                               
'get_check_list_info'                           => true, 
-                                                                               
'get_cases_for_check_list'      => true,
-                    'update_status'             => true
-                                                                       );
+    /**
+     * phpGroupWare - controller: a part of a Facilities Management System.
+     *
+     * @author Erik Holm-Larsen <address@hidden>
+     * @author Torstein Vadla <address@hidden>
+     * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc. 
http://www.fsf.org/
+     * This file is part of phpGroupWare.
+     *
+     * phpGroupWare is free software; you can redistribute it and/or modify
+     * it under the terms of the GNU General Public License as published by
+     * the Free Software Foundation; either version 2 of the License, or
+     * (at your option) any later version.
+     *
+     * phpGroupWare is distributed in the hope that it will be useful,
+     * but WITHOUT ANY WARRANTY; without even the implied warranty of
+     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+     * GNU General Public License for more details.
+     *
+     * You should have received a copy of the GNU General Public License
+     * along with phpGroupWare; if not, write to the Free Software
+     * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  
USA
+     *
+     * @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+     * @internal Development of this application was funded by 
http://www.bergen.kommune.no/
+     * @package property
+     * @subpackage controller
+     * @version $Id$
+     */
+    /**
+     * Import the jQuery class
+     */
+    phpgw::import_class('phpgwapi.jquery');
 
-               function __construct()
-               {
-                       parent::__construct();
+    /**
+     * Import the yui class
+     */
+    phpgw::import_class('phpgwapi.yui');
+    phpgw::import_class('phpgwapi.uicommon');
+    phpgw::import_class('controller.socheck_list');
+    phpgw::import_class('phpgwapi.datetime');
 
-                       $this->so_control                                       
        = CreateObject('controller.socontrol');
-                       $this->so                                               
                                        = 
CreateObject('controller.socheck_list');
-                       $this->so_control_item                          = 
CreateObject('controller.socontrol_item');
-                       $this->so_check_item                                    
= CreateObject('controller.socheck_item');
-                       $this->so_procedure                                     
        = CreateObject('controller.soprocedure');
-                       $this->so_control_group_list    = 
CreateObject('controller.socontrol_group_list');
-                       $this->so_control_group                         = 
CreateObject('controller.socontrol_group');
-                       $this->so_control_item_list     = 
CreateObject('controller.socontrol_item_list');
-      
-      $this->location_finder        = new location_finder();
+    include_class('controller', 'check_list', 'inc/model/');
+    include_class('controller', 'check_item', 'inc/model/');
+    include_class('controller', 'date_generator', 'inc/component/');
+    include_class('controller', 'check_list_status_updater', 'inc/helper/');
+    include_class('controller', 'date_converter', 'inc/helper/');
+    include_class('controller', 'location_finder', 'inc/helper/');
 
-                       
self::set_active_menu('controller::control::check_list');
-               }       
-               
-               /**
-                * Public function for displaying checklists  
-                * 
-                * @param HTTP:: phpgw_return_as
-                * @return data array
-               */
-               public function index()
-               {
-                       if(phpgw::get_var('phpgw_return_as') == 'json') {
-                               return $this->query();
-                       }
-                       self::add_javascript('phpgwapi', 'yahoo', 
'datatable.js');
-                       phpgwapi_yui::load_widget('datatable');
-                       phpgwapi_yui::load_widget('paginator');
+    class controller_uicheck_list extends phpgwapi_uicommon
+    {
+        protected $so;
+        protected $so_control;
+        protected $so_control_item;
+        protected $so_check_item;
+        protected $so_procedure;
+        protected $so_control_group_list;
+        protected $so_control_group;
+        protected $so_control_item_list;
+        protected $location_finder;
+        var $public_functions = array(
+            'index' => true,
+            'add_check_list' => true,
+            'save_check_list' => true,
+            'edit_check_list' => true,
+            'print_check_list' => true,
+            'view_control_info' => true,
+            'view_control_details' => true,
+            'view_control_items' => true,
+            'get_check_list_info' => true,
+            'get_cases_for_check_list' => true,
+            'update_status' => true
+        );
 
-                       $data = array(
-                               'datatable_name'        => 'Sjekkliste (Ikke i 
bruk)',
-                               'form' => array(
-                                       'toolbar' => array(
-                                               'item' => array(
-                                                       array('type' => 
'filter', 
-                                                               'name' => 
'status',
-                                                               'text' => 
lang('Status'),
-                                                               'list' => array(
-                                                                       array(
-                                                                               
'id' => 'none',
-                                                                               
'name' => lang('Not selected')
-                                                                       ), 
-                                                                       array(
-                                                                               
'id' => 'NEW',
-                                                                               
'name' => lang('NEW')
-                                                                       ), 
-                                                                       array(
-                                                                               
'id' => 'PENDING',
-                                                                               
'name' =>  lang('PENDING')
-                                                                       ), 
-                                                                       array(
-                                                                               
'id' => 'REJECTED',
-                                                                               
'name' => lang('REJECTED')
-                                                                       ), 
-                                                                       array(
-                                                                               
'id' => 'ACCEPTED',
-                                                                               
'name' => lang('ACCEPTED')
-                                                                       )
-                                                               )
-                                                       ),
-                                                       array('type' => 'text', 
-                                                               'text' => 
lang('searchfield'),
-                                                               'name' => 
'query'
-                                                       ),
-                                                       array(
-                                                               'type' => 
'submit',
-                                                               'name' => 
'search',
-                                                               'value' => 
lang('Search')
-                                                       ),
-                                               ),
-                                       ),
-                               ),
-                               'datatable' => array(
-                                       'source' => 
self::link(array('menuaction' => 'controller.uicheck_list.index', 
'phpgw_return_as' => 'json')),
-                                       'field' => array(
-                                               array(
-                                                       'key' => 'id',
-                                                       'label' => lang('ID'),
-                                                       'sortable'      => true,
-                                                       'formatter' => 
'YAHOO.portico.formatLink'
-                                               ),
-                                               array(
-                                                       'key'   =>      'title',
-                                                       'label' =>      
lang('Control title'),
-                                                       'sortable'      =>      
false
-                                               ),
-                                               array(
-                                                       'key' => 'start_date',
-                                                       'label' => 
lang('start_date'),
-                                                       'sortable'      => false
-                                               ),
-                                               array(
-                                                       'key' => 'planned_date',
-                                                       'label' => 
lang('planned_date'),
-                                                       'sortable'      => false
-                                               ),
-                                               array(
-                                                       'key' => 'end_date',
-                                                       'label' => 
lang('end_date'),
-                                                       'sortable'      => false
-                                               ),
-                                               array(
-                                                       'key' => 'link',
-                                                       'hidden' => true
-                                               )
-                                       )
-                               ),
-                       );
+        function __construct()
+        {
+            parent::__construct();
 
-                       self::render_template_xsl('datatable_common', $data);
-               }
-               
-               /**
-                * Public function for displaying the add check list form
-                * 
-                * @param HTTP:: location code, control id, date
-                * @return data array
-               */                      
-               function add_check_list($check_list = null){
-                       if($check_list == null)
-                       {
-                               $type = phpgw::get_var('type');
-                               $control_id = phpgw::get_var('control_id');
-                               $deadline_ts = phpgw::get_var('deadline_ts');
-                               
-                               $check_list = new controller_check_list();
-                               $check_list->set_control_id($control_id);
-                               $check_list->set_deadline($deadline_ts);
-                       }
-                       else
-                       {
-                               if( $check_list->get_component_id() > 0)
-                               {
-                                       $type = "component";
-                               }
-                               else
-                               {
-                                       $type = "location";
-                               }
-                       }
-                       
-                       if(!$location_code = $check_list->get_location_code())
-                       {
-                               $location_code = 
phpgw::get_var('location_code');
-                               $check_list->set_location_code($location_code); 
-                               $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$check_list->get_location_code()));
-                               $level = 
$this->location_finder->get_location_level($location_code);
-                       }
+            $this->so_control = CreateObject('controller.socontrol');
+            $this->so = CreateObject('controller.socheck_list');
+            $this->so_control_item = CreateObject('controller.socontrol_item');
+            $this->so_check_item = CreateObject('controller.socheck_item');
+            $this->so_procedure = CreateObject('controller.soprocedure');
+            $this->so_control_group_list = 
CreateObject('controller.socontrol_group_list');
+            $this->so_control_group = 
CreateObject('controller.socontrol_group');
+            $this->so_control_item_list = 
CreateObject('controller.socontrol_item_list');
 
-                       if($type == "component")
-                       {
-                               if($check_list != null)
-                               {
-                                       $location_id = 
phpgw::get_var('location_id');
-                                       
$check_list->set_location_id($location_id);
-                                       $component_id = 
phpgw::get_var('component_id');
-                                       
$check_list->set_component_id($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();
-                               $building_location_code = 
$this->location_finder->get_building_location_code($component_arr['location_code']);
-                               $type = "component";
-                       }
-                       else
-                       {
-                               $type = "location";
-                       }
-                         
-                       $control = $this->so_control->get_single( 
$check_list->get_control_id() );
-                       
-                       $year = date("Y", $deadline_ts);
-                       $month_nr = date("n", $deadline_ts);
-                       
-      $level = $this->location_finder->get_location_level($location_code);
-                       $user_role = true;
+            $this->location_finder = new location_finder();
 
-                       // Fetches buildings on property
-                       $buildings_on_property = 
$this->location_finder->get_buildings_on_property($user_role, $location_code, 
$level);
-                             
-                       $data = array
-                       (
-                               'location_array'                                
        => $location_array,
-                               'component_array'                               
        => $component_array,
-                               'control'                                       
                                => $control,
-                               'check_list'                                    
                => $check_list,
-        'buildings_on_property'   => $buildings_on_property,
-                               'type'                                          
                                => $type,
-                               'current_year'                                  
        => $year,
-                               'current_month_nr'                              
=> $month_nr,
-                               'building_location_code'        => 
$building_location_code,
-                               'location_level'                                
        => $level
-                       );
-                       
-                       $GLOBALS['phpgw']->jqcal->add_listener('planned_date');
-                       
$GLOBALS['phpgw']->jqcal->add_listener('completed_date');
-      
-                       self::add_javascript('controller', 'controller', 
'custom_ui.js');
-                       self::add_javascript('controller', 'controller', 
'ajax.js');
-      self::add_javascript('controller', 'controller', 'check_list.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/check_list_menu', 
-                                      
'check_list/fragments/select_buildings_on_property'), $data);
-               }
+            self::set_active_menu('controller::control::check_list');
+        }
 
-               /**
-                * Public function for displaying the edit check list form  
-                * 
-                * @param HTTP:: check list id
-                * @return data array
-               */
-               function edit_check_list( $check_list = null ){
-                       if($check_list == null)
-                       {
-                               $check_list_id = 
phpgw::get_var('check_list_id');
-                               $check_list = 
$this->so->get_single($check_list_id);
-                       }
-                       
-                       $control = 
$this->so_control->get_single($check_list->get_control_id());
-                       
-                       $component_id = $check_list->get_component_id();
+        /**
+         * Public function for displaying checklists  
+         * 
+         * @param HTTP:: phpgw_return_as
+         * @return data array
+         */
+        public function index()
+        {
+            if(phpgw::get_var('phpgw_return_as') == 'json')
+            {
+                return $this->query();
+            }
+            self::add_javascript('phpgwapi', 'yahoo', 'datatable.js');
+            phpgwapi_yui::load_widget('datatable');
+            phpgwapi_yui::load_widget('paginator');
 
-                       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';
-                               $level = 
$this->location_finder->get_location_level($location_code);
-                       }
-                       
-                       $year = date("Y", $check_list->get_deadline());
-                       $month = date("n", $check_list->get_deadline());
-                       
-      $level = $this->location_finder->get_location_level($location_code);
-                       $user_role = true;
+            $data = array(
+                'datatable_name' => 'Sjekkliste (Ikke i bruk)',
+                'form' => array(
+                    'toolbar' => array(
+                        'item' => array(
+                            array('type' => 'filter',
+                                'name' => 'status',
+                                'text' => lang('Status'),
+                                'list' => array(
+                                    array(
+                                        'id' => 'none',
+                                        'name' => lang('Not selected')
+                                    ),
+                                    array(
+                                        'id' => 'NEW',
+                                        'name' => lang('NEW')
+                                    ),
+                                    array(
+                                        'id' => 'PENDING',
+                                        'name' => lang('PENDING')
+                                    ),
+                                    array(
+                                        'id' => 'REJECTED',
+                                        'name' => lang('REJECTED')
+                                    ),
+                                    array(
+                                        'id' => 'ACCEPTED',
+                                        'name' => lang('ACCEPTED')
+                                    )
+                                )
+                            ),
+                            array('type' => 'text',
+                                'text' => lang('searchfield'),
+                                'name' => 'query'
+                            ),
+                            array(
+                                'type' => 'submit',
+                                'name' => 'search',
+                                'value' => lang('Search')
+                            ),
+                        ),
+                    ),
+                ),
+                'datatable' => array(
+                    'source' => self::link(array('menuaction' => 
'controller.uicheck_list.index', 'phpgw_return_as' => 'json')),
+                    'field' => array(
+                        array(
+                            'key' => 'id',
+                            'label' => lang('ID'),
+                            'sortable' => true,
+                            'formatter' => 'YAHOO.portico.formatLink'
+                        ),
+                        array(
+                            'key' => 'title',
+                            'label' => lang('Control title'),
+                            'sortable' => false
+                        ),
+                        array(
+                            'key' => 'start_date',
+                            'label' => lang('start_date'),
+                            'sortable' => false
+                        ),
+                        array(
+                            'key' => 'planned_date',
+                            'label' => lang('planned_date'),
+                            'sortable' => false
+                        ),
+                        array(
+                            'key' => 'end_date',
+                            'label' => lang('end_date'),
+                            'sortable' => false
+                        ),
+                        array(
+                            'key' => 'link',
+                            'hidden' => true
+                        )
+                    )
+                ),
+            );
 
-                       // Fetches buildings on property
-                       $buildings_on_property = 
$this->location_finder->get_buildings_on_property($user_role, $location_code, 
$level);
-      
-                       $data = array
-                       (
-                               'control'                                       
                        => $control,
-                               'check_list'                                    
                => $check_list,
-        '$buildings_on_property'       => $buildings_on_property,
-                               'location_array'                                
        => $location_array,
-                               'component_array'                               
        => $component_array,
-                               'type'                                          
                                => $type,
-                               'current_year'                                  
        => $year,
-                               'current_month_nr'                              
=> $month,
-                               'building_location_code'        => 
$building_location_code,
-                               'location_level'                                
        => $level
-                       );
-                       
-                       $GLOBALS['phpgw']->jqcal->add_listener('planned_date');
-                       
$GLOBALS['phpgw']->jqcal->add_listener('completed_date');
-                       $GLOBALS['phpgw']->jqcal->add_listener('deadline_date');
+            self::render_template_xsl('datatable_common', $data);
+        }
 
-                       self::add_javascript('controller', 'controller', 
'custom_ui.js');
-                       self::add_javascript('controller', 'controller', 
'ajax.js');
-      self::add_javascript('controller', 'controller', 'check_list.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);
-               }
-               
-               /**
-                * Public function for saving a check list
-                * 
-                * @param HTTP:: location code, control id, status etc.. (check 
list details) 
-                * @return data array
-               */
-               function save_check_list()
-               {
-                       $check_list_id = phpgw::get_var('check_list_id');
-                       $control_id = phpgw::get_var('control_id');
-                       $status = (int)phpgw::get_var('status');
-                       $type = phpgw::get_var('type');
-                       $deadline_date = phpgw::get_var('deadline_date', 
'string');
-                       $planned_date = phpgw::get_var('planned_date', 
'string');
-                       $completed_date = phpgw::get_var('completed_date', 
'string');
-                       $comment = phpgw::get_var('comment', 'string');
-                       
-                       $deadline_date_ts = date_converter::date_to_timestamp( 
$deadline_date );
-                            
-                       if($planned_date != '')
-                       {
-                               $planned_date_ts = 
date_converter::date_to_timestamp( $planned_date );
-                       }
-                       else
-                       {
-                               $planned_date_ts = 0;
-                       } 
-                       
-                       if($completed_date != '')
-                       {
-                               $completed_date_ts = 
phpgwapi_datetime::date_to_timestamp( $completed_date );
-                               $status = controller_check_list::STATUS_DONE;
-                       }
-                       else
-                       {
-                               $completed_date_ts = 0;
-                       }               
+        /**
+         * Public function for displaying the add check list form
+         * 
+         * @param HTTP:: location code, control id, date
+         * @return data array
+         */
+        function add_check_list($check_list = null)
+        {
+            if($check_list == null)
+            {
+                $type = phpgw::get_var('type');
+                $control_id = phpgw::get_var('control_id');
+                $deadline_ts = phpgw::get_var('deadline_ts');
 
-                       if($check_list_id > 0)
-                       {
-                               $check_list = 
$this->so->get_single($check_list_id);
-                       }
-                       else
-                       {
-                               $check_list = new controller_check_list();      
-                               $check_list->set_control_id($control_id);
-                               $location_code = 
phpgw::get_var('location_code');
-                               $check_list->set_location_code( $location_code 
);
-                               
-                               if($type == "component")
-                               {
-                                       $location_id = 
phpgw::get_var('location_id');
-                                       $component_id = 
phpgw::get_var('component_id');
-                                       $check_list->set_location_id( 
$location_id );
-                                       $check_list->set_component_id( 
$component_id );
-                               }
-                       }
-                                               
-                       $check_list->set_status($status);
-                       $check_list->set_comment($comment);
-                       $check_list->set_deadline( $deadline_date_ts );
-                       $check_list->set_planned_date($planned_date_ts);
-                       $check_list->set_completed_date($completed_date_ts);
+                $check_list = new controller_check_list();
+                $check_list->set_control_id($control_id);
+                $check_list->set_deadline($deadline_ts);
+            } else
+            {
+                if($check_list->get_component_id() > 0)
+                {
+                    $type = "component";
+                } else
+                {
+                    $type = "location";
+                }
+            }
 
-                       if( $check_list->validate() )
-                       {
-                               $check_list_id  = $this->so->store($check_list);
-                               
-        $cl_status_updater = new check_list_status_updater();
-        $cl_status_updater->update_check_list_status( $check_list_id );
-      
-                               if( $check_list_id > 0 )
-                               {
-                                       $this->redirect(array('menuaction' => 
'controller.uicheck_list.edit_check_list', 'check_list_id' => $check_list_id)); 
  
-                               }
-                               else{
-                                       $this->edit_check_list($check_list);    
-                               }
-                       }
-                       else
-                       {
-                               if($check_list->get_id() > 0)
-                               {
-                                       $this->edit_check_list($check_list);    
-                               }
-                               else
-                               {
-                                       $this->add_check_list($check_list);
-                               }
-                       }
-               }
-               
-               function view_control_info()
-               {
-                       $check_list_id = phpgw::get_var('check_list_id');
+            if(!$location_code = $check_list->get_location_code())
+            {
+                $location_code = phpgw::get_var('location_code');
+                $check_list->set_location_code($location_code);
+                $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$check_list->get_location_code()));
+                $level = 
$this->location_finder->get_location_level($location_code);
+            }
 
-                       $check_list = $this->so->get_single($check_list_id);
-                       $control = 
$this->so_control->get_single($check_list->get_control_id());
+            if($type == "component")
+            {
+                if($check_list != null)
+                {
+                    $location_id = phpgw::get_var('location_id');
+                    $check_list->set_location_id($location_id);
+                    $component_id = phpgw::get_var('component_id');
+                    $check_list->set_component_id($component_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));
 
-                       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';
-                               $level = 
$this->location_finder->get_location_level($location_code);
-                       }
-                       
-                       $year = date("Y", $check_list->get_deadline());
-                       $month = date("n", $check_list->get_deadline());
-      
-      $level = $this->location_finder->get_location_level($location_code);
-                       $user_role = true;
+                $component = new controller_component();
+                $component->set_location_code($component_arr['location_code']);
+                $component->set_xml_short_desc($short_desc);
 
-                       // Fetches buildings on property
-                       $buildings_on_property = 
$this->location_finder->get_buildings_on_property($user_role, $location_code, 
$level);
-                       
-                       $data = array
-                       (
-                               'control'                                       
                        => $control,
-                               'check_list'                                    
                => $check_list,
-        'buildings_on_property'   => $buildings_on_property,
-                               'location_array'                                
        => $location_array,
-                               'component_array'                               
        => $component_array,
-                               'type'                                          
                                => $type,
-                               'current_year'                                  
        => $year,
-                               'current_month_nr'                              
=> $month,
-                               'building_location_code'        => 
$building_location_code,
-                               'location_level'                                
        => $level
-                       );
+                $component_array = $component->toArray();
+                $building_location_code = 
$this->location_finder->get_building_location_code($component_arr['location_code']);
+                $type = "component";
+            } else
+            {
+                $type = "location";
+            }
 
-                       phpgwapi_jquery::load_widget('core');
-                       
-                       
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()
-               {
-                       $control_id = phpgw::get_var('control_id');
-                       
-                       $control = $this->so_control->get_single($control_id);
-                       
-                       $data = array
-                       (
-                               'control'       => $control,
-                       );
-                       
-                       
self::render_template_xsl('check_list/view_control_details', $data);
-               }
-                                               
-               function view_control_items()
-               {
-                       $check_list_id = phpgw::get_var('check_list_id');
-                       $check_list = $this->so->get_single($check_list_id);
-                                               
-                       $control = 
$this->so_control->get_single($check_list->get_control_id());
-                       $control_groups = 
$this->so_control_group_list->get_control_groups_by_control($control->get_id());
-                       
-                       $saved_groups_with_items_array = array();
-                       
-                       //Populating array with saved control items for each 
group
-                       foreach ($control_groups as $control_group)
-                       {       
-                               $saved_control_items = 
$this->so_control_item_list->get_control_items_by_control_and_group($control->get_id(),
 $control_group->get_id());
-                               
-                               $control_item = 
$this->so_control_item->get_single($control_item_id);
-                               
-                               $saved_groups_with_items_array[] = 
array("control_group" => $control_group->toArray(), "control_items" => 
$saved_control_items);
-                       }
-                       
-                       $data = array
-                       (
-                               'saved_groups_with_items_array' => 
$saved_groups_with_items_array,
-                               'check_list'                                    
=> $check_list
-                       );
-                       
-                       
self::render_template_xsl('check_list/view_control_items', $data);
-               }
-    
-       public function print_check_list()
-               {
-                       $check_list_id = phpgw::get_var('check_list_id');
-                       $check_list = $this->so->get_single($check_list_id);
-                       
-                       $control = 
$this->so_control->get_single($check_list->get_control_id());
-                       $control_groups = 
$this->so_control_group_list->get_control_groups_by_control($control->get_id());
-                       
-                       $saved_groups_with_items_array = array();
-                       
-                       //Populating array with saved control items for each 
group
-                       foreach ($control_groups as $control_group)
-                       {       
-                               $saved_control_items = 
$this->so_control_item_list->get_control_items_by_control_and_group($control->get_id(),
 $control_group->get_id());
-                               
-                               $control_item = 
$this->so_control_item->get_single($control_item_id);
-                               
-                               $saved_groups_with_items_array[] = 
array("control_group" => $control_group->toArray(), "control_items" => 
$saved_control_items);
-                       }
-                       
-                       $data = array
-                       (
-                               'saved_groups_with_items_array' => 
$saved_groups_with_items_array,
-                               'check_list'                                    
                                        => $check_list
-                       );
-                       
-                       
self::render_template_xsl('check_list/print_check_list', $data);
-               }
-       
-               // Returns check list info as JSON
-               public function get_check_list_info()
-               {
-                       $check_list_id = phpgw::get_var('check_list_id');
-                       $check_list = 
$this->so_check_list->get_single_with_check_items($check_list_id, "open");
-                       
-                       return json_encode( $check_list );
-               }
-               
-               // Returns open cases for a check list as JSON 
-               public function get_cases_for_check_list()
-               {
-                       $check_list_id = phpgw::get_var('check_list_id');
+            $control = 
$this->so_control->get_single($check_list->get_control_id());
 
-                       $check_items_with_cases = 
$this->so_check_item->get_check_items_with_cases($check_list_id, null, "open", 
null);
-                       
-                       return json_encode( $check_items_with_cases );
-               }
-    
-    /**
-                * Public function for updateing status for a check list
-                * 
-                * @return json encoded array with status saved or not saved
-               */
-               public function update_status()
-               {
-                       $check_list_id = phpgw::get_var('check_list_id');
-      $check_list_status = phpgw::get_var('status');
+            $year = date("Y", $deadline_ts);
+            $month_nr = date("n", $deadline_ts);
 
-                       $check_list = $this->so->get_single($check_list_id);
-                       
-      $check_list->set_status( $check_list_status );
-      
-      if($check_list->validate())
-      {
-        $save_status = $this->so->store($check_list);
-      
-        if($save_status > 0)
+            $level = 
$this->location_finder->get_location_level($location_code);
+            $user_role = true;
+
+            // Fetches buildings on property
+            $buildings_on_property = 
$this->location_finder->get_buildings_on_property($user_role, $location_code, 
$level);
+
+            $data = array
+                (
+                'location_array' => $location_array,
+                'component_array' => $component_array,
+                'control' => $control,
+                'check_list' => $check_list,
+                'buildings_on_property' => $buildings_on_property,
+                'type' => $type,
+                'current_year' => $year,
+                'current_month_nr' => $month_nr,
+                'building_location_code' => $building_location_code,
+                'location_level' => $level,
+                'check_list_type' => 'add_check_list'
+            );
+
+            $GLOBALS['phpgw']->jqcal->add_listener('planned_date');
+            $GLOBALS['phpgw']->jqcal->add_listener('completed_date');
+
+            self::add_javascript('controller', 'controller', 'custom_ui.js');
+            self::add_javascript('controller', 'controller', 'ajax.js');
+            self::add_javascript('controller', 'controller', 'check_list.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/add_check_list_menu',
+                'check_list/fragments/select_buildings_on_property'), $data);
+        }
+
+        /**
+         * Public function for displaying the edit check list form  
+         * 
+         * @param HTTP:: check list id
+         * @return data array
+         */
+        function edit_check_list($check_list = null)
         {
-          return json_encode( array( "status" => "saved") );
+            if($check_list == null)
+            {
+                $check_list_id = phpgw::get_var('check_list_id');
+                $check_list = $this->so->get_single($check_list_id);
+            }
+
+            $control = 
$this->so_control->get_single($check_list->get_control_id());
+
+            $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';
+                $level = 
$this->location_finder->get_location_level($location_code);
+            }
+
+            $year = date("Y", $check_list->get_deadline());
+            $month = date("n", $check_list->get_deadline());
+
+            $level = 
$this->location_finder->get_location_level($location_code);
+            $user_role = true;
+
+            // Fetches buildings on property
+            $buildings_on_property = 
$this->location_finder->get_buildings_on_property($user_role, $location_code, 
$level);
+
+            $data = array
+                (
+                'control' => $control,
+                'check_list' => $check_list,
+                '$buildings_on_property' => $buildings_on_property,
+                'location_array' => $location_array,
+                'component_array' => $component_array,
+                'type' => $type,
+                'current_year' => $year,
+                'current_month_nr' => $month,
+                'building_location_code' => $building_location_code,
+                'location_level' => $level
+            );
+
+            $GLOBALS['phpgw']->jqcal->add_listener('planned_date');
+            $GLOBALS['phpgw']->jqcal->add_listener('completed_date');
+            $GLOBALS['phpgw']->jqcal->add_listener('deadline_date');
+
+            self::add_javascript('controller', 'controller', 'custom_ui.js');
+            self::add_javascript('controller', 'controller', 'ajax.js');
+            self::add_javascript('controller', 'controller', 'check_list.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);
         }
-        else
+
+        /**
+         * Public function for saving a check list
+         * 
+         * @param HTTP:: location code, control id, status etc.. (check list 
details) 
+         * @return data array
+         */
+        function save_check_list()
         {
-          return json_encode( array( "status" => "not_saved") );
+            $check_list_id = phpgw::get_var('check_list_id');
+            $control_id = phpgw::get_var('control_id');
+            $status = (int) phpgw::get_var('status');
+            $type = phpgw::get_var('type');
+            $deadline_date = phpgw::get_var('deadline_date', 'string');
+            $planned_date = phpgw::get_var('planned_date', 'string');
+            $completed_date = phpgw::get_var('completed_date', 'string');
+            $comment = phpgw::get_var('comment', 'string');
+
+            $deadline_date_ts = 
date_converter::date_to_timestamp($deadline_date);
+
+            if($planned_date != '')
+            {
+                $planned_date_ts = 
date_converter::date_to_timestamp($planned_date);
+            } else
+            {
+                $planned_date_ts = 0;
+            }
+
+            if($completed_date != '')
+            {
+                $completed_date_ts = 
phpgwapi_datetime::date_to_timestamp($completed_date);
+                $status = controller_check_list::STATUS_DONE;
+            } else
+            {
+                $completed_date_ts = 0;
+            }
+
+            if($check_list_id > 0)
+            {
+                $check_list = $this->so->get_single($check_list_id);
+            } else
+            {
+                $check_list = new controller_check_list();
+                $check_list->set_control_id($control_id);
+                $location_code = phpgw::get_var('location_code');
+                $check_list->set_location_code($location_code);
+
+                if($type == "component")
+                {
+                    $location_id = phpgw::get_var('location_id');
+                    $component_id = phpgw::get_var('component_id');
+                    $check_list->set_location_id($location_id);
+                    $check_list->set_component_id($component_id);
+                }
+            }
+
+            $check_list->set_status($status);
+            $check_list->set_comment($comment);
+            $check_list->set_deadline($deadline_date_ts);
+            $check_list->set_planned_date($planned_date_ts);
+            $check_list->set_completed_date($completed_date_ts);
+
+            if($check_list->validate())
+            {
+                $check_list_id = $this->so->store($check_list);
+
+                $cl_status_updater = new check_list_status_updater();
+                $cl_status_updater->update_check_list_status($check_list_id);
+
+                if($check_list_id > 0)
+                {
+                    $this->redirect(array('menuaction' => 
'controller.uicheck_list.edit_check_list', 'check_list_id' => $check_list_id));
+                } else
+                {
+                    $this->edit_check_list($check_list);
+                }
+            } else
+            {
+                if($check_list->get_id() > 0)
+                {
+                    $this->edit_check_list($check_list);
+                } else
+                {
+                    $this->add_check_list($check_list);
+                }
+            }
         }
-      }
-      else
-      {
-          return json_encode( array( "status" => "not_saved") );
-      }
-               }
-               
-               public function query(){}
-       }
\ No newline at end of file
+
+        function view_control_info()
+        {
+            $check_list_id = phpgw::get_var('check_list_id');
+
+            $check_list = $this->so->get_single($check_list_id);
+            $control = 
$this->so_control->get_single($check_list->get_control_id());
+
+            $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';
+                $level = 
$this->location_finder->get_location_level($location_code);
+            }
+
+            $year = date("Y", $check_list->get_deadline());
+            $month = date("n", $check_list->get_deadline());
+
+            $level = 
$this->location_finder->get_location_level($location_code);
+            $user_role = true;
+
+            // Fetches buildings on property
+            $buildings_on_property = 
$this->location_finder->get_buildings_on_property($user_role, $location_code, 
$level);
+
+            $data = array
+                (
+                'control' => $control,
+                'check_list' => $check_list,
+                'buildings_on_property' => $buildings_on_property,
+                'location_array' => $location_array,
+                'component_array' => $component_array,
+                'type' => $type,
+                'current_year' => $year,
+                'current_month_nr' => $month,
+                'building_location_code' => $building_location_code,
+                'location_level' => $level
+            );
+
+            phpgwapi_jquery::load_widget('core');
+
+            
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()
+        {
+            $control_id = phpgw::get_var('control_id');
+
+            $control = $this->so_control->get_single($control_id);
+
+            $data = array
+                (
+                'control' => $control,
+            );
+
+            self::render_template_xsl('check_list/view_control_details', 
$data);
+        }
+
+        function view_control_items()
+        {
+            $check_list_id = phpgw::get_var('check_list_id');
+            $check_list = $this->so->get_single($check_list_id);
+
+            $control = 
$this->so_control->get_single($check_list->get_control_id());
+            $control_groups = 
$this->so_control_group_list->get_control_groups_by_control($control->get_id());
+
+            $saved_groups_with_items_array = array();
+
+            //Populating array with saved control items for each group
+            foreach($control_groups as $control_group)
+            {
+                $saved_control_items = 
$this->so_control_item_list->get_control_items_by_control_and_group($control->get_id(),
 $control_group->get_id());
+
+                $control_item = 
$this->so_control_item->get_single($control_item_id);
+
+                $saved_groups_with_items_array[] = array("control_group" => 
$control_group->toArray(), "control_items" => $saved_control_items);
+            }
+
+            $data = array
+                (
+                'saved_groups_with_items_array' => 
$saved_groups_with_items_array,
+                'check_list' => $check_list
+            );
+
+            self::render_template_xsl('check_list/view_control_items', $data);
+        }
+
+        public function print_check_list()
+        {
+            $check_list_id = phpgw::get_var('check_list_id');
+            $check_list = $this->so->get_single($check_list_id);
+
+            $control = 
$this->so_control->get_single($check_list->get_control_id());
+            $control_groups = 
$this->so_control_group_list->get_control_groups_by_control($control->get_id());
+
+            $saved_groups_with_items_array = array();
+
+            //Populating array with saved control items for each group
+            foreach($control_groups as $control_group)
+            {
+                $saved_control_items = 
$this->so_control_item_list->get_control_items_by_control_and_group($control->get_id(),
 $control_group->get_id());
+
+                $control_item = 
$this->so_control_item->get_single($control_item_id);
+
+                $saved_groups_with_items_array[] = array("control_group" => 
$control_group->toArray(), "control_items" => $saved_control_items);
+            }
+
+            $data = array
+                (
+                'saved_groups_with_items_array' => 
$saved_groups_with_items_array,
+                'check_list' => $check_list
+            );
+
+            self::render_template_xsl('check_list/print_check_list', $data);
+        }
+
+        // Returns check list info as JSON
+        public function get_check_list_info()
+        {
+            $check_list_id = phpgw::get_var('check_list_id');
+            $check_list = 
$this->so_check_list->get_single_with_check_items($check_list_id, "open");
+
+            return json_encode($check_list);
+        }
+
+        // Returns open cases for a check list as JSON 
+        public function get_cases_for_check_list()
+        {
+            $check_list_id = phpgw::get_var('check_list_id');
+
+            $check_items_with_cases = 
$this->so_check_item->get_check_items_with_cases($check_list_id, null, "open", 
null);
+
+            return json_encode($check_items_with_cases);
+        }
+
+        /**
+         * Public function for updateing status for a check list
+         * 
+         * @return json encoded array with status saved or not saved
+         */
+        public function update_status()
+        {
+            $check_list_id = phpgw::get_var('check_list_id');
+            $check_list_status = phpgw::get_var('status');
+
+            $check_list = $this->so->get_single($check_list_id);
+
+            $check_list->set_status($check_list_status);
+
+            if($check_list->validate())
+            {
+                $save_status = $this->so->store($check_list);
+
+                if($save_status > 0)
+                {
+                    return json_encode(array("status" => "saved"));
+                } else
+                {
+                    return json_encode(array("status" => "not_saved"));
+                }
+            } else
+            {
+                return json_encode(array("status" => "not_saved"));
+            }
+        }
+
+        public function query()
+        {
+            
+        }
+
+    }
\ No newline at end of file

Modified: trunk/controller/setup/phpgw_no.lang
===================================================================
--- trunk/controller/setup/phpgw_no.lang        2013-02-18 07:54:07 UTC (rev 
10910)
+++ trunk/controller/setup/phpgw_no.lang        2013-02-18 12:20:45 UTC (rev 
10911)
@@ -362,6 +362,6 @@
 error_msg_no_controls_for_component    controller      no      Ingen 
kontroller for komponent i denne perioden
 role at location       controller      no      Tildeling av rolle
 Register new message   controller      no      Registrer ny melding
-Show message  controller       no      Vis melding
+Show message  controller  no  Vis melding
 Status not done controller  no  Status: Ikke utført
 Status done controller  no  Status: Utført
\ No newline at end of file

Modified: trunk/controller/templates/base/check_list/add_check_list.xsl
===================================================================
--- trunk/controller/templates/base/check_list/add_check_list.xsl       
2013-02-18 07:54:07 UTC (rev 10910)
+++ trunk/controller/templates/base/check_list/add_check_list.xsl       
2013-02-18 12:20:45 UTC (rev 10911)
@@ -1,127 +1,158 @@
 <!-- $Id$ -->
 <xsl:template match="data" xmlns:php="http://php.net/xsl";>
-<xsl:variable name="date_format"><xsl:value-of 
select="php:function('get_phpgw_info', 'user|preferences|common|dateformat')" 
/></xsl:variable>
+    <xsl:variable name="date_format">
+        <xsl:value-of select="php:function('get_phpgw_info', 
'user|preferences|common|dateformat')" />
+    </xsl:variable>
 
-<!-- ==================  ADD CHECKLIST  ========================= -->
-<div id="main_content" class="medium">
-  
-       <xsl:call-template name="check_list_top_section" />
+    <!-- ==================  ADD CHECKLIST  ========================= -->
+    <div id="main_content" class="medium">
+        
+        <!-- ==================  CHECK LIST TOP SECTION  ===================== 
-->
+        <xsl:call-template name="check_list_top_section" />
        
-       <!-- ==================  CHECKLIST DETAILS  ===================== -->
-       <div id="check_list_details">
-               <h3 class="box_header">Sjekklistedetaljer</h3>
+        <!-- ==================  CHECKLIST DETAILS  ===================== -->
+        <div id="check_list_details">
+            <h3 class="box_header">Sjekklistedetaljer</h3>
                
-               <xsl:variable name="action_url">
-                       <xsl:value-of select="php:function('get_phpgw_link', 
'/index.php', 'menuaction:controller.uicheck_list.save_check_list')" />
-               </xsl:variable>
+            <xsl:variable name="action_url">
+                <xsl:value-of select="php:function('get_phpgw_link', 
'/index.php', 'menuaction:controller.uicheck_list.save_check_list')" />
+            </xsl:variable>
                
-               <form id="frm_add_check_list" action="{$action_url}" 
method="post">
-                       <xsl:variable name="control_id"><xsl:value-of 
select="control/id"/></xsl:variable>
-                       <input type="hidden" name="control_id" 
value="{$control_id}" />
-                       <xsl:variable name="type"><xsl:value-of 
select="type"/></xsl:variable>
-                       <input type="hidden" name="type" value="{$type}" />
+            <form id="frm_add_check_list" action="{$action_url}" method="post">
+                <xsl:variable name="control_id">
+                    <xsl:value-of select="control/id"/>
+                </xsl:variable>
+                <input type="hidden" name="control_id" value="{$control_id}" />
+                <xsl:variable name="type">
+                    <xsl:value-of select="type"/>
+                </xsl:variable>
+                <input type="hidden" name="type" value="{$type}" />
 
-                       <xsl:variable name="location_code"><xsl:value-of 
select="location_array/location_code"/></xsl:variable>         
+                <xsl:variable name="location_code">
+                    <xsl:value-of select="location_array/location_code"/>
+                </xsl:variable>                
 
-                       <xsl:choose>
-                               <xsl:when test="type = 'component'">
-                                       <xsl:variable 
name="location_id"><xsl:value-of 
select="check_list/location_id"/></xsl:variable>
-                                       <input type="hidden" name="location_id" 
value="{$location_id}" />
-                                       <xsl:variable 
name="component_id"><xsl:value-of 
select="check_list/component_id"/></xsl:variable>
-                                       <input type="hidden" 
name="component_id" value="{$component_id}" />
-                                       <input type="hidden" 
name="location_code" value="{$location_code}" />
-                               </xsl:when>
-                               <xsl:otherwise>
-                                       <input type="hidden" 
name="location_code" value="{$location_code}" />
-                               </xsl:otherwise>
-                       </xsl:choose>
+                <xsl:choose>
+                    <xsl:when test="type = 'component'">
+                        <xsl:variable name="location_id">
+                            <xsl:value-of select="check_list/location_id"/>
+                        </xsl:variable>
+                        <input type="hidden" name="location_id" 
value="{$location_id}" />
+                        <xsl:variable name="component_id">
+                            <xsl:value-of select="check_list/component_id"/>
+                        </xsl:variable>
+                        <input type="hidden" name="component_id" 
value="{$component_id}" />
+                        <input type="hidden" name="location_code" 
value="{$location_code}" />
+                    </xsl:when>
+                    <xsl:otherwise>
+                        <input type="hidden" name="location_code" 
value="{$location_code}" />
+                    </xsl:otherwise>
+                </xsl:choose>
                        
-                       <fieldset>
-                               <!-- STATUS -->
-                               <div class="row">
-                               <xsl:if test="check_list/error_msg_array/status 
!= ''">
-                                         <xsl:variable 
name="error_msg"><xsl:value-of select="check_list/error_msg_array/status" 
/></xsl:variable>
-                                               <div 
class='input_error_msg'><xsl:value-of select="php:function('lang', $error_msg)" 
/></div>
-                                       </xsl:if>
-                                       <label>Status</label>
-                                       <xsl:variable 
name="status"><xsl:value-of select="check_list/status"/></xsl:variable>
-                                       <select id="status" name="status">
-                                               <xsl:choose>
-                                                       <xsl:when 
test="check_list/status = 0">
-                                                               <option 
value="1">Utført</option>
-                                                               <option 
value="0" SELECTED="SELECTED">Ikke utført</option>
-                <option value="3">Kansellert</option>
-                                                       </xsl:when>
-                                                       <xsl:when 
test="check_list/status = 1">
-                                                               <option 
value="1" SELECTED="SELECTED">Utført</option>
-                                                               <option 
value="0">Ikke utført</option>
-                <option value="3">Kansellert</option>
-                                                       </xsl:when>
-              <xsl:when test="check_list/status = 3">
-                                                               <option 
value="3" SELECTED="SELECTED">Kansellert</option>
-                                                               <option 
value="0">Ikke utført</option>
-                <option value="1">Utført</option>
-                                                       </xsl:when>
-                                                       <xsl:otherwise>
-                                                               <option 
value="0" SELECTED="SELECTED">Ikke utført</option>
-                                                               <option 
value="1">Utført</option>
-                <option value="3">Kansellert</option>
-                                                       </xsl:otherwise>
-                                               </xsl:choose>
-                                       </select>
-                               </div>
-                               <!-- DEADLINE -->
-                               <div class="row">
-                                       <xsl:if 
test="check_list/error_msg_array/deadline != ''">
-                                               <xsl:variable 
name="error_msg"><xsl:value-of select="check_list/error_msg_array/deadline" 
/></xsl:variable>
-                                               <div 
class='input_error_msg'><xsl:value-of select="php:function('lang', $error_msg)" 
/></div>
-                                       </xsl:if>
-                                       <label>Fristdato</label>
-                                       <input type="text" id="deadline_date" 
name="deadline_date" class="date">
-                                     <xsl:attribute name="value"><xsl:value-of 
select="php:function('date', $date_format, 
number(check_list/deadline))"/></xsl:attribute>
-                                 </input>
-                               </div>
-                               <!-- PLANNED DATE -->
-                               <div class="row">
-                                       <label>Planlagt dato</label>
-                                       <input type="text" id="planned_date" 
name="planned_date" class="date">
-                                       <xsl:if test="check_list/planned_date 
!= 0 and check_list/planned_date != ''">
-                                       <xsl:attribute name="value">
-                                               <xsl:value-of 
select="php:function('date', $date_format, number(check_list/planned_date))"/>
-                                       </xsl:attribute>
-                               </xsl:if>
-                           </input>
-                         </div>
-                         <!-- COMPLETED DATE -->
-                   <div class="row">
-                                 <xsl:if 
test="check_list/error_msg_array/completed_date != ''">
-                                         <xsl:variable 
name="error_msg"><xsl:value-of 
select="check_list/error_msg_array/completed_date" /></xsl:variable>
-                                               <div 
class='input_error_msg'><xsl:value-of select="php:function('lang', $error_msg)" 
/></div>
-                                 </xsl:if>
-                                 <label>Utført dato</label>
-                                 <input type="text" id="completed_date" 
name="completed_date" class="date">
-                                       <xsl:if test="check_list/completed_date 
!= 0 and check_list/completed_date != ''">
-                                       <xsl:attribute name="value">
-                                               <xsl:value-of 
select="php:function('date', $date_format, number(check_list/completed_date))"/>
-                                       </xsl:attribute>
-                               </xsl:if>
-                           </input>
-                   </div>
-                       </fieldset>
-                        <!-- COMMENT -->
-                       <div class="comment">
-                               <label>Kommentar</label>
-                               <textarea>
-                                 <xsl:attribute 
name="name">comment</xsl:attribute>
-                                 <xsl:value-of select="check_list/comment"/>
-                               </textarea>
-                       </div>
+                <fieldset>
+                    <!-- STATUS -->
+                    <div class="row">
+                        <xsl:if test="check_list/error_msg_array/status != ''">
+                            <xsl:variable name="error_msg">
+                                <xsl:value-of 
select="check_list/error_msg_array/status" />
+                            </xsl:variable>
+                            <div class='input_error_msg'>
+                                <xsl:value-of select="php:function('lang', 
$error_msg)" />
+                            </div>
+                        </xsl:if>
+                        <label>Status</label>
+                        <xsl:variable name="status">
+                            <xsl:value-of select="check_list/status"/>
+                        </xsl:variable>
+                        <select id="status" name="status">
+                            <xsl:choose>
+                                <xsl:when test="check_list/status = 0">
+                                    <option value="1">Utført</option>
+                                    <option value="0" SELECTED="SELECTED">Ikke 
utført</option>
+                                    <option value="3">Kansellert</option>
+                                </xsl:when>
+                                <xsl:when test="check_list/status = 1">
+                                    <option value="1" 
SELECTED="SELECTED">Utført</option>
+                                    <option value="0">Ikke utført</option>
+                                    <option value="3">Kansellert</option>
+                                </xsl:when>
+                                <xsl:when test="check_list/status = 3">
+                                    <option value="3" 
SELECTED="SELECTED">Kansellert</option>
+                                    <option value="0">Ikke utført</option>
+                                    <option value="1">Utført</option>
+                                </xsl:when>
+                                <xsl:otherwise>
+                                    <option value="0" SELECTED="SELECTED">Ikke 
utført</option>
+                                    <option value="1">Utført</option>
+                                    <option value="3">Kansellert</option>
+                                </xsl:otherwise>
+                            </xsl:choose>
+                        </select>
+                    </div>
+                    <!-- DEADLINE -->
+                    <div class="row">
+                        <xsl:if test="check_list/error_msg_array/deadline != 
''">
+                            <xsl:variable name="error_msg">
+                                <xsl:value-of 
select="check_list/error_msg_array/deadline" />
+                            </xsl:variable>
+                            <div class='input_error_msg'>
+                                <xsl:value-of select="php:function('lang', 
$error_msg)" />
+                            </div>
+                        </xsl:if>
+                        <label>Fristdato</label>
+                        <input type="text" id="deadline_date" 
name="deadline_date" class="date">
+                            <xsl:attribute name="value">
+                                <xsl:value-of select="php:function('date', 
$date_format, number(check_list/deadline))"/>
+                            </xsl:attribute>
+                        </input>
+                    </div>
+                    <!-- PLANNED DATE -->
+                    <div class="row">
+                        <label>Planlagt dato</label>
+                        <input type="text" id="planned_date" 
name="planned_date" class="date">
+                            <xsl:if test="check_list/planned_date != 0 and 
check_list/planned_date != ''">
+                                <xsl:attribute name="value">
+                                    <xsl:value-of select="php:function('date', 
$date_format, number(check_list/planned_date))"/>
+                                </xsl:attribute>
+                            </xsl:if>
+                        </input>
+                    </div>
+                    <!-- COMPLETED DATE -->
+                    <div class="row">
+                        <xsl:if 
test="check_list/error_msg_array/completed_date != ''">
+                            <xsl:variable name="error_msg">
+                                <xsl:value-of 
select="check_list/error_msg_array/completed_date" />
+                            </xsl:variable>
+                            <div class='input_error_msg'>
+                                <xsl:value-of select="php:function('lang', 
$error_msg)" />
+                            </div>
+                        </xsl:if>
+                        <label>Utført dato</label>
+                        <input type="text" id="completed_date" 
name="completed_date" class="date">
+                            <xsl:if test="check_list/completed_date != 0 and 
check_list/completed_date != ''">
+                                <xsl:attribute name="value">
+                                    <xsl:value-of select="php:function('date', 
$date_format, number(check_list/completed_date))"/>
+                                </xsl:attribute>
+                            </xsl:if>
+                        </input>
+                    </div>
+                </fieldset>
+                <!-- COMMENT -->
+                <div class="comment">
+                    <label>Kommentar</label>
+                    <textarea>
+                        <xsl:attribute name="name">comment</xsl:attribute>
+                        <xsl:value-of select="check_list/comment"/>
+                    </textarea>
+                </div>
                        
-                       <div class="form-buttons">
-                               <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save_check_list')" /></xsl:variable>
-                               <input class="btn" type="submit" value="Lagre 
detaljer" />
-                       </div>
-               </form> 
-        </div>
-</div>
+                <div class="form-buttons">
+                    <xsl:variable name="lang_save">
+                        <xsl:value-of select="php:function('lang', 
'save_check_list')" />
+                    </xsl:variable>
+                    <input class="btn" type="submit" value="Lagre detaljer" />
+                </div>
+            </form>    
+        </div>
+    </div>
 </xsl:template>

Modified: trunk/controller/templates/base/check_list/edit_check_list.xsl
===================================================================
--- trunk/controller/templates/base/check_list/edit_check_list.xsl      
2013-02-18 07:54:07 UTC (rev 10910)
+++ trunk/controller/templates/base/check_list/edit_check_list.xsl      
2013-02-18 12:20:45 UTC (rev 10911)
@@ -24,22 +24,22 @@
                                                        <xsl:when 
test="check_list/status = 0">
                                                                <option 
value="1">Utført</option>
                                                                <option 
value="0" SELECTED="SELECTED">Ikke utført</option>
-                <option value="3">Kansellert</option>
+                                <option value="3">Kansellert</option>
                                                        </xsl:when>
                                                        <xsl:when 
test="check_list/status = 1">
                                                                <option 
value="1" SELECTED="SELECTED">Utført</option>
                                                                <option 
value="0">Ikke utført</option>
-                <option value="3">Kansellert</option>
+                                <option value="3">Kansellert</option>
                                                        </xsl:when>
-              <xsl:when test="check_list/status = 3">
+                            <xsl:when test="check_list/status = 3">
                                                                <option 
value="3" SELECTED="SELECTED">Kansellert</option>
                                                                <option 
value="0">Ikke utført</option>
-                <option value="1">Utført</option>
+                                <option value="1">Utført</option>
                                                        </xsl:when>
                                                        <xsl:otherwise>
                                                                <option 
value="0" SELECTED="SELECTED">Ikke utført</option>
                                                                <option 
value="1">Utført</option>
-                <option value="3">Kansellert</option>
+                                <option value="3">Kansellert</option>
                                                        </xsl:otherwise>
                                                </xsl:choose>
                                        </select>

Copied: 
trunk/controller/templates/base/check_list/fragments/add_check_list_menu.xsl 
(from rev 10907, 
trunk/controller/templates/base/check_list/fragments/check_list_menu.xsl)
===================================================================
--- 
trunk/controller/templates/base/check_list/fragments/add_check_list_menu.xsl    
                            (rev 0)
+++ 
trunk/controller/templates/base/check_list/fragments/add_check_list_menu.xsl    
    2013-02-18 12:20:45 UTC (rev 10911)
@@ -0,0 +1,32 @@
+<xsl:template name="add_check_list_menu" xmlns:php="http://php.net/xsl";>
+    <xsl:variable name="session_url">&amp;
+        <xsl:value-of select="php:function('get_phpgw_session_url')" />
+    </xsl:variable>
+
+    <div id="check_list_menu">
+        <div class="left_btns">
+            <span class="first active">
+                Vis detaljer for sjekkliste
+            </span>
+            <!-- ==================  LOADS CASES FOR CHECKLIST  
===================== -->
+            <span>
+                Vis saker
+            </span>
+            <!-- ==================  LOADS INFO ABOUT CONTROL  
===================== -->
+            <span class="last">
+                Vis info om kontroll
+            </span>
+        </div>
+               
+        <div class="right_btns">
+            <!-- ==================  REGISTER NEW CASE  ===================== 
-->
+            <span class="btn focus first">
+                Registrer sak
+            </span>
+            <!-- ==================  REGISTER NEW MESSAGE  
===================== -->
+            <span class="btn focus">
+                Registrer melding
+            </span>
+        </div>
+    </div>
+</xsl:template>

Modified: 
trunk/controller/templates/base/check_list/fragments/check_list_menu.xsl
===================================================================
--- trunk/controller/templates/base/check_list/fragments/check_list_menu.xsl    
2013-02-18 07:54:07 UTC (rev 10910)
+++ trunk/controller/templates/base/check_list/fragments/check_list_menu.xsl    
2013-02-18 12:20:45 UTC (rev 10911)
@@ -1,83 +1,81 @@
 <xsl:template name="check_list_menu" xmlns:php="http://php.net/xsl";>
-<xsl:param name="active_tab" />
-<xsl:variable name="session_url">&amp;<xsl:value-of 
select="php:function('get_phpgw_session_url')" /></xsl:variable>
+    <xsl:param name="active_tab" />
+    <xsl:variable name="session_url">&amp;<xsl:value-of 
select="php:function('get_phpgw_session_url')" /></xsl:variable>
 
-<div id="check_list_menu">
-               <!-- ==================  LOADS VIEW CHECKLIST DETAILS   
===================== -->
-               <div class="left_btns">
-                       <a class="first">
-        <xsl:choose>
-          <xsl:when test="$active_tab = 'view_details'">
-            <xsl:attribute name="class">first active</xsl:attribute>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:attribute name="class">first</xsl:attribute>
-          </xsl:otherwise>
-        </xsl:choose>
-                               
-                               <xsl:attribute name="href">
-                                       
<xsl:text>index.php?menuaction=controller.uicheck_list.edit_check_list</xsl:text>
-                                       <xsl:text>&amp;check_list_id=</xsl:text>
-                                       <xsl:value-of select="check_list/id"/>
-                                       <xsl:value-of select="$session_url"/>
-                               </xsl:attribute>
-                               Vis detaljer for sjekkliste
-                       </a>
-                       <!-- ==================  LOADS CASES FOR CHECKLIST  
===================== -->
-                       <a>
-                               <xsl:if test="$active_tab = 'view_cases'">
-                                       <xsl:attribute 
name="class">active</xsl:attribute>
-                               </xsl:if>
-                               <xsl:attribute name="href">
-                                       
<xsl:text>index.php?menuaction=controller.uicase.view_open_cases</xsl:text>
-                                       <xsl:text>&amp;check_list_id=</xsl:text>
-                                       <xsl:value-of select="check_list/id"/>
-                                       <xsl:value-of select="$session_url"/>
-                               </xsl:attribute>
-                               Vis saker
-                       </a>
-                       <!-- ==================  LOADS INFO ABOUT CONTROL  
===================== -->
-                       <a>
-        <xsl:choose>
-          <xsl:when test="$active_tab = 'view_control_info'">
-            <xsl:attribute name="class">last active</xsl:attribute>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:attribute name="class">last</xsl:attribute>
-          </xsl:otherwise>
-        </xsl:choose>
-                               <xsl:attribute name="href">
-                                       
<xsl:text>index.php?menuaction=controller.uicheck_list.view_control_info</xsl:text>
-                                       <xsl:text>&amp;check_list_id=</xsl:text>
-                                       <xsl:value-of select="check_list/id"/>
-                                       <xsl:value-of select="$session_url"/>
-                               </xsl:attribute>
-                               Vis info om kontroll
-                       </a>
-               </div>
+    <div id="check_list_menu">
+        <div class="left_btns">
+            <a class="first">
+                <xsl:choose>
+                    <xsl:when test="$active_tab = 'view_details'">
+                        <xsl:attribute name="class">first 
active</xsl:attribute>
+                    </xsl:when>
+                    <xsl:otherwise>
+                        <xsl:attribute name="class">first</xsl:attribute>
+                    </xsl:otherwise>
+                </xsl:choose>
+                
+                <xsl:attribute name="href">
+                    
<xsl:text>index.php?menuaction=controller.uicheck_list.edit_check_list</xsl:text>
+                    <xsl:text>&amp;check_list_id=</xsl:text>
+                    <xsl:value-of select="check_list/id"/>
+                    <xsl:value-of select="$session_url"/>
+                </xsl:attribute>
+                Vis detaljer for sjekkliste
+            </a>
+            <!-- ==================  LOADS CASES FOR CHECKLIST  
===================== -->
+            <a>
+                <xsl:if test="$active_tab = 'view_cases'">
+                    <xsl:attribute name="class">active</xsl:attribute>
+                </xsl:if>
+                <xsl:attribute name="href">
+                    
<xsl:text>index.php?menuaction=controller.uicase.view_open_cases</xsl:text>
+                    <xsl:text>&amp;check_list_id=</xsl:text>
+                    <xsl:value-of select="check_list/id"/>
+                    <xsl:value-of select="$session_url"/>
+                </xsl:attribute>
+                Vis saker
+            </a>
+            <!-- ==================  LOADS INFO ABOUT CONTROL  
===================== -->
+            <a>
+                <xsl:choose>
+                    <xsl:when test="$active_tab = 'view_control_info'">
+                        <xsl:attribute name="class">last active</xsl:attribute>
+                    </xsl:when>
+                    <xsl:otherwise>
+                        <xsl:attribute name="class">last</xsl:attribute>
+                    </xsl:otherwise>
+                </xsl:choose>
+                <xsl:attribute name="href">
+                    
<xsl:text>index.php?menuaction=controller.uicheck_list.view_control_info</xsl:text>
+                    <xsl:text>&amp;check_list_id=</xsl:text>
+                    <xsl:value-of select="check_list/id"/>
+                    <xsl:value-of select="$session_url"/>
+                </xsl:attribute>
+                Vis info om kontroll
+            </a>
+        </div>
                
-               <div class="right_btns">
-                       <!-- ==================  REGISTER NEW CASE  
===================== -->
-                       <a class="btn focus first">
-                               <xsl:attribute name="href">
-                                       
<xsl:text>index.php?menuaction=controller.uicase.add_case</xsl:text>
-                                       <xsl:text>&amp;check_list_id=</xsl:text>
-                                       <xsl:value-of select="check_list/id"/>
-                                       <xsl:value-of select="$session_url"/>
-                               </xsl:attribute>
-                               Registrer sak
-                       </a>
-                       <!-- ==================  REGISTER NEW MESSAGE  
===================== -->
-                       <a class="btn focus">
-                               <xsl:attribute name="href">
-                                       
<xsl:text>index.php?menuaction=controller.uicase.create_case_message</xsl:text>
-                                       <xsl:text>&amp;check_list_id=</xsl:text>
-                                       <xsl:value-of select="check_list/id"/>
-                                       <xsl:value-of select="$session_url"/>
-                               </xsl:attribute>
-                               Registrer melding
-                       </a>
-               </div>
-       </div>
-               
+        <div class="right_btns">
+            <!-- ==================  REGISTER NEW CASE  ===================== 
-->
+            <a class="btn focus first">
+                <xsl:attribute name="href">
+                    
<xsl:text>index.php?menuaction=controller.uicase.add_case</xsl:text>
+                    <xsl:text>&amp;check_list_id=</xsl:text>
+                    <xsl:value-of select="check_list/id"/>
+                    <xsl:value-of select="$session_url"/>
+                </xsl:attribute>
+                Registrer sak
+            </a>
+            <!-- ==================  REGISTER NEW MESSAGE  
===================== -->
+            <a class="btn focus">
+                <xsl:attribute name="href">
+                    
<xsl:text>index.php?menuaction=controller.uicase.create_case_message</xsl:text>
+                    <xsl:text>&amp;check_list_id=</xsl:text>
+                    <xsl:value-of select="check_list/id"/>
+                    <xsl:value-of select="$session_url"/>
+                </xsl:attribute>
+                Registrer melding
+            </a>
+        </div>
+    </div>
 </xsl:template>

Modified: 
trunk/controller/templates/base/check_list/fragments/check_list_top_section.xsl
===================================================================
--- 
trunk/controller/templates/base/check_list/fragments/check_list_top_section.xsl 
    2013-02-18 07:54:07 UTC (rev 10910)
+++ 
trunk/controller/templates/base/check_list/fragments/check_list_top_section.xsl 
    2013-02-18 12:20:45 UTC (rev 10911)
@@ -16,7 +16,7 @@
                                                        <h2>Eiendom: 
<xsl:value-of select="location_array/loc1_name"/></h2>
                                                </xsl:when>
                                                <xsl:otherwise>
-                                                               <h2>Bygg: 
<xsl:value-of select="location_array/loc2_name"/></h2>
+                                                       <h2>Bygg: <xsl:value-of 
select="location_array/loc2_name"/></h2>
                                                </xsl:otherwise>
                                        </xsl:choose>
                                </xsl:otherwise>
@@ -24,13 +24,20 @@
                </div>
                
                <div class="box-2 select-box">
-      <xsl:call-template name="nav_control_plan" />
+            <xsl:call-template name="nav_control_plan" />
                </div>
                
                <!-- ==================  CHECKLIST TAB MENU  
===================== -->
-               <xsl:call-template name="check_list_menu">
-                       <xsl:with-param 
name="active_tab">view_details</xsl:with-param>
-               </xsl:call-template>
+        <xsl:choose>
+        <xsl:when test="count(check_list_type) = 0 or check_list_type != 
'add_check_list'">
+            <xsl:call-template name="check_list_menu">
+                <xsl:with-param name="active_tab">view_details</xsl:with-param>
+            </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+            <xsl:call-template name="add_check_list_menu" />
+        </xsl:otherwise>
+        </xsl:choose>
        </div>
                
 </xsl:template>

Modified: trunk/controller/templates/base/css/base.css
===================================================================
--- trunk/controller/templates/base/css/base.css        2013-02-18 07:54:07 UTC 
(rev 10910)
+++ trunk/controller/templates/base/css/base.css        2013-02-18 12:20:45 UTC 
(rev 10911)
@@ -1639,7 +1639,7 @@
   overflow: hidden;
 }
 
-#check_list_menu a {
+#check_list_menu a, #check_list_menu span {
   background: none repeat scroll 0 0 #F4EDE3;
   border: 1px solid #E7E1DA;
   color: #444444;
@@ -1652,17 +1652,21 @@
   width: 185px;
 }
 
-#check_list_menu a.first {
+#check_list_menu span {
+  cursor: default;
+}
+
+#check_list_menu a.first, #check_list_menu span.first {
   border-radius: 4px 0 0 4px;
   border-right: 0 none;
 }
 
-#check_list_menu a.last {
+#check_list_menu a.last, #check_list_menu span.last {
   border-radius: 0 4px 4px 0;
   border-left: 0;
 }
 
-#check_list_menu a.active {
+#check_list_menu a.active, #check_list_menu span.active {
   background: none repeat scroll 0 0 #E7E1DA;
   border: 1px solid #E7E1DA;
 }
@@ -1675,7 +1679,7 @@
   float: right;
 }
 
-#check_list_menu .right_btns a {
+#check_list_menu .right_btns a, #check_list_menu .right_btns span {
   background: none repeat scroll 0 0 #F57056;
   border-color: #EE836F -moz-use-text-color #CB563F;
   border-radius: 4px;




reply via email to

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