fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [8524] Merge 8502:8523 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [8524] Merge 8502:8523 from trunk
Date: Sun, 08 Jan 2012 13:23:14 +0000

Revision: 8524
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8524
Author:   sigurdne
Date:     2012-01-08 13:23:14 +0000 (Sun, 08 Jan 2012)
Log Message:
-----------
Merge 8502:8523 from trunk

Modified Paths:
--------------
    branches/Version-1_0-branch/controller/images/status_icon_red_cross.png
    branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
    branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php
    
branches/Version-1_0-branch/controller/inc/class.uicheck_list_for_location.inc.php
    branches/Version-1_0-branch/controller/inc/class.uiprocedure.inc.php
    
branches/Version-1_0-branch/controller/inc/component/class.calendar_builder.inc.php
    branches/Version-1_0-branch/controller/js/controller/ajax.js
    branches/Version-1_0-branch/controller/js/controller/custom_drag_drop.js
    branches/Version-1_0-branch/controller/js/controller/custom_ui.js
    branches/Version-1_0-branch/controller/setup/setup.inc.php
    branches/Version-1_0-branch/controller/setup/tables_current.inc.php
    branches/Version-1_0-branch/controller/setup/tables_update.inc.php
    
branches/Version-1_0-branch/controller/templates/base/check_list/edit_check_list.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_info.xsl
    branches/Version-1_0-branch/controller/templates/base/css/base.css
    
branches/Version-1_0-branch/controller/templates/base/procedure/procedure_item.xsl
    
branches/Version-1_0-branch/controller/templates/base/procedure/view_procedures_for_control.xsl
    branches/Version-1_0-branch/phpgwapi/inc/class.xslttemplates.inc.php
    branches/Version-1_0-branch/property/inc/class.bocommon.inc.php
    branches/Version-1_0-branch/property/inc/class.boproject.inc.php
    branches/Version-1_0-branch/property/inc/class.custom_fields.inc.php
    branches/Version-1_0-branch/property/inc/class.solocation.inc.php
    branches/Version-1_0-branch/property/inc/class.soproject.inc.php
    branches/Version-1_0-branch/property/inc/class.uiproject.inc.php
    branches/Version-1_0-branch/property/inc/class.uiwo_hour.inc.php
    branches/Version-1_0-branch/property/setup/default_records.inc.php
    branches/Version-1_0-branch/property/setup/setup.inc.php
    branches/Version-1_0-branch/property/setup/tables_update.inc.php
    branches/Version-1_0-branch/property/templates/base/project.xsl

Added Paths:
-----------
    branches/Version-1_0-branch/controller/images/status_icon_red_cross.psd
    branches/Version-1_0-branch/controller/templates/base/calendar/
    
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list_for_location.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/print_check_list.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/register_errors.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/view_closed_errors.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_details.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_items.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/view_errors_for_check_list.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/view_measurements.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/view_open_errors.xsl
    
branches/Version-1_0-branch/controller/templates/base/procedure/print_procedure.xsl

Removed Paths:
-------------
    
branches/Version-1_0-branch/controller/templates/base/add_check_list_for_location.xsl
    
branches/Version-1_0-branch/controller/templates/base/control/view_control_details.xsl
    
branches/Version-1_0-branch/controller/templates/base/control_item/view_control_items.xsl
    
branches/Version-1_0-branch/controller/templates/base/view_calendar_month.xsl
    branches/Version-1_0-branch/controller/templates/base/view_calendar_year.xsl

Property Changed:
----------------
    branches/Version-1_0-branch/


Property changes on: branches/Version-1_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538,7540-7542,7544-7549,7551-7552,7554-7561,7563,7565,7567-7573,7575-7578,7580-7584,7586-7591,7593-7624,7627-7636,7638-7656,7658-7718,7720-7732,7734,7736,7738-7750,7754-7759,7761-7767,7769-7780,7782,7784-7809,7811-7812,7814-7835,7837-7847,7849-7887,7889-7895,7897,7899,7901,7903-7905,7907-7921,7923-7925,7927-7933,7935,7937-7952,7954-7968,7970-7974,7976,7978-7979,7981-7982,7984-7988,7990-7992,7994-8041,8043-8066,8068-8087,8089,8091-8108,8110-8124,8126-8129,8131,8133-8150,8152-8154,8156-8162,8164-8167,8169-8170,8172-8179,8181,8183-8196,8198-8207,8209-8211,8213-8214,8216-8217,8219-8220,8222,8224-8225,8227-8247,8249,8251,8253-8282,8284-8352,8354-8368,8370-8396,8398-8430,8432,8434-8440,8442-8445,8447-8453,8455-8456,8458,8460,8462-8464,8466-8473,8475-8479,8481,8483-8501
   + 
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538,7540-7542,7544-7549,7551-7552,7554-7561,7563,7565,7567-7573,7575-7578,7580-7584,7586-7591,7593-7624,7627-7636,7638-7656,7658-7718,7720-7732,7734,7736,7738-7750,7754-7759,7761-7767,7769-7780,7782,7784-7809,7811-7812,7814-7835,7837-7847,7849-7887,7889-7895,7897,7899,7901,7903-7905,7907-7921,7923-7925,7927-7933,7935,7937-7952,7954-7968,7970-7974,7976,7978-7979,7981-7982,7984-7988,7990-7992,7994-8041,8043-8066,8068-8087,8089,8091-8108,8110-8124,8126-8129,8131,8133-8150,8152-8154,8156-8162,8164-8167,8169-8170,8172-8179,8181,8183-8196,8198-8207,8209-8211,8213-8214,8216-8217,8219-8220,8222,8224-8225,8227-8247,8249,8251,8253-8282,8284-8352,8354-8368,8370-8396,8398-8430,8432,8434-8440,8442-8445,8447-8453,8455-8456,8458,8460,8462-8464,8466-8473,8475-8479,8481,8483-8501,8503-8523

Modified: 
branches/Version-1_0-branch/controller/images/status_icon_red_cross.png
===================================================================
(Binary files differ)

Copied: branches/Version-1_0-branch/controller/images/status_icon_red_cross.psd 
(from rev 8522, trunk/controller/images/status_icon_red_cross.psd)
===================================================================
(Binary files differ)

Modified: branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php 
2012-01-08 13:21:05 UTC (rev 8523)
+++ branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php 
2012-01-08 13:23:14 UTC (rev 8524)
@@ -122,7 +122,7 @@
                        self::add_javascript('controller', 'controller', 
'jquery.js');
                        self::add_javascript('controller', 'controller', 
'ajax.js');
                        
-                       self::render_template_xsl('view_calendar_month', $data);
+                       
self::render_template_xsl('calendar/view_calendar_month', $data);
                }
                
                public function view_calendar_for_year()
@@ -164,7 +164,7 @@
                                'year'                                    => 
$year
                        );
                        
-                       self::render_template_xsl('view_calendar_year', $data);
+                       
self::render_template_xsl('calendar/view_calendar_year', $data);
                        
                        self::add_javascript('controller', 'controller', 
'jquery.js');
                        self::add_javascript('controller', 'controller', 
'ajax.js');

Modified: branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php       
2012-01-08 13:21:05 UTC (rev 8523)
+++ branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php       
2012-01-08 13:23:14 UTC (rev 8524)
@@ -43,6 +43,7 @@
                private $so_control_item;
                private $so_check_list;
                private $so_check_item;
+               private $so_procedure;
 
                public $public_functions = array
                (
@@ -58,7 +59,13 @@
                        'add_check_item_to_list'                        =>      
true,
                        'update_check_list'                                     
=>      true,
                        'view_control_items'                            =>      
true,
-                       'view_control_details'                          =>      
true
+                       'view_control_details'                          =>      
true,
+                       'print_check_list'                                      
=>      true,
+                       'register_errors'                                       
=>      true,
+                       'view_open_errors'                                      
=>      true,
+                       'view_closed_errors'                            =>      
true,
+                       'view_measurements'                                     
=>      true
+               
                );
 
                public function __construct()
@@ -72,6 +79,7 @@
                        $this->so_control_item = 
CreateObject('controller.socontrol_item');
                        $this->so_check_list = 
CreateObject('controller.socheck_list');
                        $this->so_check_item = 
CreateObject('controller.socheck_item');
+                       $this->so_procedure = 
CreateObject('controller.soprocedure');
 
                        $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
"controller::check_list";
                }
@@ -264,18 +272,81 @@
                }
 
                public function view_control_items(){
+                       $check_list_id = phpgw::get_var('check_list_id');
+                       $check_list = 
$this->so_check_list->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->get_control_items_by_control_id_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->toArray()
+                       );
+                       
+                       
self::render_template_xsl('check_list/view_control_items', 
array('view_control_items' => $data));
+               }
+               
+               public function view_control_details(){
                        $control_id = phpgw::get_var('control_id');
                        
                        $control = $this->so_control->get_single($control_id);
                        
-                       $control_groups = 
$this->so_control_group_list->get_control_groups_by_control($control_id);
+                       // Sigurd: START as categories
+                       $cats   = CreateObject('phpgwapi.categories', -1, 
'controller', '.control');
+                       $cats->supress_info     = true;
+
+                       $control_areas = 
$cats->formatted_xslt_list(array('format'=>'filter','selected' => 
$control_area_id,'globals' => true,'use_acl' => $this->_category_acl));
+                       array_unshift($control_areas['cat_list'],array 
('cat_id'=>'','name'=> lang('select value')));
+                       $control_areas_array2 = array();
+                       foreach($control_areas['cat_list'] as $cat_list)
+                       {
+                               $control_areas_array2[] = array
+                               (
+                                       'id'    => $cat_list['cat_id'],
+                                       'name'  => $cat_list['name'],
+                               );              
+                       }
+                       // END as categories
+                       $control_area_id = $control_areas_array2[1]['id'];
+                       $procedures_array = 
$this->so_procedure->get_procedures_by_control_area_id($control_area_id);
+                       $role_array = $this->so_control->get_roles();
                        
+                       $data = array
+                       (
+                               'control'       => $control->toArray(),
+                               'procedures_array'                      => 
$procedures_array,
+                               'role_array'                            => 
$role_array
+                       );
+                       
+                       
self::render_template_xsl('check_list/view_control_details', 
array('view_control_details' => $data));
+               }
+               
+               public function print_check_list(){
+                       $check_list_id = phpgw::get_var('check_list_id');
+                       $check_list = 
$this->so_check_list->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->get_control_items_by_control_id_and_group($control_id, 
$control_group->get_id());
+                               $saved_control_items = 
$this->so_control_item->get_control_items_by_control_id_and_group($control->get_id(),
 $control_group->get_id());
                                
                                $control_item = 
$this->so_control_item->get_single($control_item_id);
                                
@@ -284,67 +355,116 @@
                        
                        $data = array
                        (
-                               'saved_groups_with_items_array' => 
$saved_groups_with_items_array
+                               'saved_groups_with_items_array' => 
$saved_groups_with_items_array,
+                               'check_list'                                    
=> $check_list->toArray()
                        );
                        
-                       $xslttemplate = CreateObject('phpgwapi.xslttemplates');
+                       
self::render_template_xsl('check_list/print_check_list', 
array('view_control_items' => $data));
+               }
+               
+               function register_errors(){
+                       $check_list_id = phpgw::get_var('check_list_id');
                        
-            $xslttemplate->add_file(array(PHPGW_SERVER_ROOT . 
'/controller/templates/base/control_item/view_control_items'));
-           
-            $xslttemplate->set_var('phpgw',array('view_control_items' => 
$data));
-            
-            $xslttemplate->xsl_parse();
-               $xslttemplate->xml_parse();
-       
-               $xml = new DOMDocument;
-               $xml->loadXML($xslttemplate->xmldata);
+                       $check_list = 
$this->so_check_list->get_single($check_list_id);
+                       
+                       // Fetches with check items
+                       $open_check_items = 
$this->so_check_item->get_check_items($check_list_id, 'open', 
'control_item_type_1');
 
-               $xsl = new DOMDocument;
-               $xsl->loadXML($xslttemplate->xsldata);
+                       // Fetches check list with check items
+                       $handled_check_items = 
$this->so_check_item->get_check_items($check_list_id, 'handled', 
'control_item_type_1');
+                                               
+                       $location_code = $check_list->get_location_code();
+                               
+                       // Fetches all control items for check list
+                       $control_items_for_check_list = 
$this->so_control_item->get_control_items_by_control_id($check_list->get_control_id());
+                       
+                       // Fetches check items that registeres measurement
+                       $measurement_check_items = 
$this->so_check_item->get_check_items($check_list_id, null, 
'control_item_type_2');
+                                               
+                       // Puts ids for control items that is registered as 
open check item in an array   
+                       $control_item_ids = array();
+                       foreach($open_check_items as $check_item){
+                               $control_item_ids[] = 
$check_item["control_item_id"];
+                       }
+                       
+                       // Puts ids for control items that is registered as 
handled check item in an array   
+                       foreach($handled_check_items as $check_item){
+                               $control_item_ids[] = 
$check_item["control_item_id"];
+                       }
+                       
+                       // Puts ids for control items that is registered check 
item measurements in an array   
+                       foreach($measurement_check_items as $check_item){
+                               $control_item_ids[] = 
$check_item["control_item_id"];
+                       }
+                       
+                       // Puts control items not registered as check item in 
an array
+                       $control_items_not_registered = array();
+                       foreach($control_items_for_check_list as $control_item){
+                               if( !in_array($control_item->get_id(), 
$control_item_ids) ){
+                                       $control_items_not_registered[] = 
$control_item->toArray();
+                               }
+                       }
 
-               // Configure the transformer
-               $proc = new XSLTProcessor;
-               $proc->importStyleSheet($xsl); // attach the xsl rules
-       
-               $html = $proc->transformToXML($xml);
+                       $data = array
+                       (
+                               'control_items_not_registered'  => 
$control_items_not_registered,
+                               'check_list'    => $check_list->toArray()
+                       );
+                       
+                       self::render_template_xsl('check_list/register_errors', 
array('register_errors' => $data));
+               }
+               
+               function view_open_errors(){
+                       $check_list_id = phpgw::get_var('check_list_id');
+                       
+                       $check_list = 
$this->so_check_list->get_single($check_list_id);
+                       
+                       // Fetches with check items
+                       $open_check_items = 
$this->so_check_item->get_check_items($check_list_id, 'open', 
'control_item_type_1');
 
-               echo $html;
+                       $data = array
+                       (
+                               'open_check_items'      => $open_check_items,
+                               'check_list'            => 
$check_list->toArray()
+                       );
+                       
+                       
self::render_template_xsl('check_list/view_open_errors', 
array('view_open_errors' => $data));
                }
                
-               public function view_control_details(){
-                       $control_id = phpgw::get_var('control_id');
+               function view_closed_errors(){
+                       $check_list_id = phpgw::get_var('check_list_id');
                        
-                       $control = $this->so_control->get_single($control_id);
+                       $check_list = 
$this->so_check_list->get_single($check_list_id);
                        
+                       // Fetches check list with check items
+                       $handled_check_items = 
$this->so_check_item->get_check_items($check_list_id, 'handled', 
'control_item_type_1');
+                                                       
                        $data = array
                        (
-                               'control'       => $control->toArray()
+                               'handled_check_items'   => $handled_check_items,
+                               'check_list'    => $check_list->toArray()
                        );
                        
-                       $xslttemplate = CreateObject('phpgwapi.xslttemplates');
+                       
self::render_template_xsl('check_list/view_closed_errors', 
array('view_closed_errors' => $data));
+               }
+               
+               function view_measurements(){
+                       $check_list_id = phpgw::get_var('check_list_id');
                        
-            $xslttemplate->add_file(array(PHPGW_SERVER_ROOT . 
'/controller/templates/base/control/view_control_details'));
-           
-            $xslttemplate->set_var('phpgw',array('view_control_details' => 
$data));
-            
-            $xslttemplate->xsl_parse();
-               $xslttemplate->xml_parse();
-       
-               $xml = new DOMDocument;
-               $xml->loadXML($xslttemplate->xmldata);
-
-               $xsl = new DOMDocument;
-               $xsl->loadXML($xslttemplate->xsldata);
-
-               // Configure the transformer
-               $proc = new XSLTProcessor;
-               $proc->importStyleSheet($xsl); // attach the xsl rules
-       
-               $html = $proc->transformToXML($xml);
-
-               echo $html;
+                       $check_list = 
$this->so_check_list->get_single($check_list_id);
+                                               
+                       // Fetches check items that registeres measurement
+                       $measurement_check_items = 
$this->so_check_item->get_check_items($check_list_id, null, 
'control_item_type_2');
+                                               
+                       $data = array
+                       (
+                               'measurement_check_items'               => 
$measurement_check_items,
+                               'check_list'    => $check_list->toArray()
+                       );
+                       
+                       
self::render_template_xsl('check_list/view_measurements', 
array('view_measurements' => $data));
                }
-
+                               
                public function view_check_lists_for_control()
                {
                        $control_id = phpgw::get_var('id');

Modified: 
branches/Version-1_0-branch/controller/inc/class.uicheck_list_for_location.inc.php
===================================================================
--- 
branches/Version-1_0-branch/controller/inc/class.uicheck_list_for_location.inc.php
  2012-01-08 13:21:05 UTC (rev 8523)
+++ 
branches/Version-1_0-branch/controller/inc/class.uicheck_list_for_location.inc.php
  2012-01-08 13:23:14 UTC (rev 8524)
@@ -62,7 +62,8 @@
                                                                                
'save_check_list_for_location'  => true,
                                                                                
'edit_check_list_for_location'  => true,
                                                                                
'create_error_report_message'   => true,
-                                                                               
'view_control_info'                     => true
+                                                                               
'view_control_info'                     => true,
+                                                                               
'view_errors_for_check_list'    => true
                                                                        );
 
                function __construct()
@@ -369,55 +370,41 @@
                        
                        $check_list = 
$this->so_check_list->get_single($check_list_id);
                        
-                       // Fetches with check items
-                       $open_check_items = 
$this->so_check_item->get_check_items($check_list_id, 'open', 
'control_item_type_1');
-
-                       // Fetches check list with check items
-                       $handled_check_items = 
$this->so_check_item->get_check_items($check_list_id, 'handled', 
'control_item_type_1');
-                                               
+                       $date_format = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
                        $location_code = $check_list->get_location_code();
-                               
-                       // Fetches all control items for check list
-                       $control_items_for_check_list = 
$this->so_control_item->get_control_items_by_control_id($check_list->get_control_id());
+       
+                       $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
                        
-                       // Fetches check items that registeres measurement
-                       $measurement_check_items = 
$this->so_check_item->get_check_items($check_list_id, null, 
'control_item_type_2');
-                                               
-                       // Puts ids for control items that is registered as 
open check item in an array   
-                       $control_item_ids = array();
-                       foreach($open_check_items as $check_item){
-                               $control_item_ids[] = 
$check_item["control_item_id"];
-                       }
+                       $data = array
+                       (
+                               'check_list'                                    
=> $check_list->toArray(),
+                               'location_array'                                
=> $location_array,
+                               'date_format'                                   
=> $date_format
+                       );
                        
-                       // Puts ids for control items that is registered as 
handled check item in an array   
-                       foreach($handled_check_items as $check_item){
-                               $control_item_ids[] = 
$check_item["control_item_id"];
-                       }
+                       self::add_javascript('controller', 'controller', 
'jquery.js');
+                       self::add_javascript('controller', 'controller', 
'jquery-ui.custom.min.js');
+                       self::add_javascript('controller', 'controller', 
'custom_ui.js');
+                       self::add_javascript('controller', 'controller', 
'ajax.js');
                        
-                       // Puts ids for control items that is registered check 
item measurements in an array   
-                       foreach($measurement_check_items as $check_item){
-                               $control_item_ids[] = 
$check_item["control_item_id"];
-                       }
+                       
$GLOBALS['phpgw']->css->add_external_file('controller/templates/base/css/jquery-ui.custom.css');
                        
-                       // Puts control items not registered as check item in 
an array
-                       $control_items_not_registered = array();
-                       foreach($control_items_for_check_list as $control_item){
-                               if( !in_array($control_item->get_id(), 
$control_item_ids) ){
-                                       $control_items_not_registered[] = 
$control_item->toArray();
-                               }
-                       }
-
+                       self::render_template_xsl('check_list/edit_check_list', 
$data);
+               }
+               
+               function view_errors_for_check_list(){
+                       $check_list_id = phpgw::get_var('check_list_id');
+                       
+                       $check_list = 
$this->so_check_list->get_single($check_list_id);
+                       
                        $date_format = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+                       $location_code = $check_list->get_location_code();
        
                        $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
                        
                        $data = array
                        (
                                'check_list'                                    
=> $check_list->toArray(),
-                               'open_check_items'                              
=> $open_check_items,
-                               'handled_check_items'                   => 
$handled_check_items,
-                               'measurement_check_items'               => 
$measurement_check_items,
-                               'control_items_not_registered'  => 
$control_items_not_registered,
                                'location_array'                                
=> $location_array,
                                'date_format'                                   
=> $date_format
                        );
@@ -429,7 +416,7 @@
                        
                        
$GLOBALS['phpgw']->css->add_external_file('controller/templates/base/css/jquery-ui.custom.css');
                        
-                       self::render_template_xsl('edit_check_list', $data);
+                       
self::render_template_xsl('check_list/view_errors_for_check_list', $data);
                }
                
                function save_check_list_for_location(){

Modified: branches/Version-1_0-branch/controller/inc/class.uiprocedure.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uiprocedure.inc.php        
2012-01-08 13:21:05 UTC (rev 8523)
+++ branches/Version-1_0-branch/controller/inc/class.uiprocedure.inc.php        
2012-01-08 13:23:14 UTC (rev 8524)
@@ -39,6 +39,7 @@
        {
                private $so;
                private $so_control_area;
+               private $_category_acl;
                private $so_control;
                private $so_control_group_list;
 
@@ -50,7 +51,8 @@
                        'view'                                                  
=>      true,
                        'add'                                                   
=>      true,
                        'get_procedures'                                =>      
true,
-                       'view_procedures_for_control'   =>      true
+                       'view_procedures_for_control'   =>      true,
+                       'print_procedure'       =>      true
                );
 
                public function __construct()
@@ -63,6 +65,10 @@
                        $this->so_control_group_list = 
CreateObject('controller.socontrol_group_list');
                        
                        $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
"controller::procedure";
+                       
+                       $config = CreateObject('phpgwapi.config','controller');
+                       $config->read();
+                       $this->_category_acl = 
isset($config->config_data['acl_at_control_area']) && 
$config->config_data['acl_at_control_area'] == 1 ? true : false;
                        //$this->bo = CreateObject('property.boevent',true);
                }
 
@@ -75,7 +81,24 @@
                        self::add_javascript('controller', 'yahoo', 
'datatable.js');
                        phpgwapi_yui::load_widget('datatable');
                        phpgwapi_yui::load_widget('paginator');
+                       
+                       // Sigurd: START as categories
+                       $cats   = CreateObject('phpgwapi.categories', -1, 
'controller', '.control');
+                       $cats->supress_info     = true;
 
+                       $control_areas = 
$cats->formatted_xslt_list(array('format'=>'filter','selected' => '','globals' 
=> true,'use_acl' => $this->_category_acl));
+                       array_unshift($control_areas['cat_list'],array 
('cat_id'=>'','name'=> lang('select value')));
+                       $control_areas_array2 = array();
+                       foreach($control_areas['cat_list'] as $cat_list)
+                       {
+                               $control_areas_array2[] = array
+                               (
+                                       'id'    => $cat_list['cat_id'],
+                                       'name'  => $cat_list['name'],
+                               );              
+                       }
+                       // END as categories
+
                        $data = array(
                                'form' => array(
                                        'toolbar' => array(
@@ -83,7 +106,7 @@
                                                        array('type' => 
'filter',
                                                                'name' => 
'control_areas',
                                                                'text' => 
lang('Control_area').':',
-                                                               'list' => 
$this->so_control_area->get_control_area_select_array(),
+                                                               'list' => 
$control_areas_array2,
                                                        ),
                                                        array('type' => 'text', 
                                                                'text' => 
lang('search'),
@@ -274,7 +297,24 @@
                                        $msgbox_data = 
$GLOBALS['phpgw']->common->msgbox_data($this->flash_msgs);
                                        $msgbox_data = 
$GLOBALS['phpgw']->common->msgbox($msgbox_data);
                                }
-                               $control_area_array = 
$this->so_control_area->get_control_area_array();
+                               
+                               // Sigurd: START as categories
+                               $cats   = CreateObject('phpgwapi.categories', 
-1, 'controller', '.control');
+                               $cats->supress_info     = true;
+       
+                               $control_areas = 
$cats->formatted_xslt_list(array('format'=>'filter','selected' => 
$procedure->get_control_area_id(),'globals' => true,'use_acl' => 
$this->_category_acl));
+                               array_unshift($control_areas['cat_list'],array 
('cat_id'=>'','name'=> lang('select value')));
+                               $control_areas_array2 = array();
+                               foreach($control_areas['cat_list'] as $cat_list)
+                               {
+                                       $control_areas_array2[] = array
+                                       (
+                                               'id'    => $cat_list['cat_id'],
+                                               'name'  => $cat_list['name'],
+                                       );              
+                               }
+                               // END as categories
+/*                             $control_area_array = 
$this->so_control_area->get_control_area_array();
                                foreach ($control_area_array as $control_area)
                                {
                                        if($procedure->get_control_area_id() && 
$control_area->get_id() == $procedure->get_control_area_id())
@@ -295,6 +335,7 @@
                                                );
                                        }
                                }
+*/
                                $procedure_array = $procedure->toArray();
                                //_debug_array($procedure_array);
                                
@@ -316,7 +357,8 @@
                                        'img_go_home'                   => 
'rental/templates/base/images/32x32/actions/go-home.png',
                                        'editable'                              
=> true,
                                        'procedure'                             
=> $procedure_array,
-                                       'control_area'                          
=> array('options' => $control_area_options),
+                                       //'control_area'                        
        => array('options' => $control_area_options),
+                                       'control_area'          => 
array('options' => $control_areas_array2),
                                );
 
 
@@ -441,50 +483,42 @@
                }
 
                public function view_procedures_for_control(){
-                               $control_id = phpgw::get_var('control_id');
-                               
-                               $control = 
$this->so_control->get_single($control_id);
-                               
-                               $control_procedure = $this->so->get_single( 
$control->get_procedure_id() );
-                               
-                               $control_groups = 
$this->so_control_group_list->get_control_groups_by_control($control_id);
+                       $control_id = phpgw::get_var('control_id');
                        
-                               $group_procedures_array = array();
-                               
-                               foreach ($control_groups as $control_group)
-                               {       
-                                       $group_procedure = 
$this->so->get_single( $control_group->get_procedure_id() );
-                                       $group_procedures_array[] = 
array("control_group" => $control_group->toArray(), "procedure" => 
$group_procedure->toArray());
-                               }
-                               
-                               $data = array
-                               (
-                                       'control_procedure'                     
=> $control_procedure->toArray(),
-                                       'group_procedures_array'        => 
$group_procedures_array
-                               );
-                               
-                               $xslttemplate = 
CreateObject('phpgwapi.xslttemplates');
-                               
-                   $xslttemplate->add_file(array(PHPGW_SERVER_ROOT . 
'/controller/templates/base/procedure/view_procedures_for_control'));
-                  
-                   
$xslttemplate->set_var('phpgw',array('view_procedures_for_control' => $data));
-                   
-                   $xslttemplate->xsl_parse();
-                       $xslttemplate->xml_parse();
+                       $control = $this->so_control->get_single($control_id);
+                       
+                       $control_procedure = $this->so->get_single( 
$control->get_procedure_id() );
+                       
+                       $control_groups = 
$this->so_control_group_list->get_control_groups_by_control($control_id);
                
-                       $xml = new DOMDocument;
-                       $xml->loadXML($xslttemplate->xmldata);
-       
-                       $xsl = new DOMDocument;
-                       $xsl->loadXML($xslttemplate->xsldata);
-       
-                       // Configure the transformer
-                       $proc = new XSLTProcessor;
-                       $proc->importStyleSheet($xsl); // attach the xsl rules
+                       $group_procedures_array = array();
+                       
+                       foreach ($control_groups as $control_group)
+                       {       
+                               $group_procedure = $this->so->get_single( 
$control_group->get_procedure_id() );
+                               $group_procedures_array[] = 
array("control_group" => $control_group->toArray(), "procedure" => 
$group_procedure->toArray());
+                       }
+                       
+                       $data = array
+                       (
+                               'control_procedure'                     => 
$control_procedure->toArray(),
+                               'group_procedures_array'        => 
$group_procedures_array
+                       );
+                       
+                       
self::render_template_xsl('procedure/view_procedures_for_control', 
array('view_procedures_for_control' => $data));
+               }
                
-                       $html = $proc->transformToXML($xml);
-       
-                       echo $html;
+               public function print_procedure(){
+                       $procedure_id = phpgw::get_var('procedure_id');
+                       
+                       $procedure = $this->so->get_single($procedure_id);
+                       
+                       $data = array
+                       (
+                               'procedure'                     => 
$procedure->toArray()
+                       );
+                       
+                       self::render_template_xsl('procedure/print_procedure', 
array('print_procedure' => $data));
                }
                
                public function query()

Modified: 
branches/Version-1_0-branch/controller/inc/component/class.calendar_builder.inc.php
===================================================================
--- 
branches/Version-1_0-branch/controller/inc/component/class.calendar_builder.inc.php
 2012-01-08 13:21:05 UTC (rev 8523)
+++ 
branches/Version-1_0-branch/controller/inc/component/class.calendar_builder.inc.php
 2012-01-08 13:23:14 UTC (rev 8524)
@@ -27,8 +27,14 @@
                        // Inserts dates on behalf of repeat type and repeat 
interval
                        foreach($dates_array as $date){
                                
-                               $status = "control_registered";
+                               $todays_date = mktime(0,0,0,date("m"), 
date("d"), date("Y"));
                                
+                               if($date < $todays_date){
+                                       $status = "control_not_accomplished";
+                               }else{
+                                       $status = "control_registered";
+                               }
+                               
                                if( $period_type == "view_months" )
                                {
                                        $calendar_array[ date("n", $date) 
]["status"]  = $status;

Modified: branches/Version-1_0-branch/controller/js/controller/ajax.js
===================================================================
--- branches/Version-1_0-branch/controller/js/controller/ajax.js        
2012-01-08 13:21:05 UTC (rev 8523)
+++ branches/Version-1_0-branch/controller/js/controller/ajax.js        
2012-01-08 13:23:14 UTC (rev 8524)
@@ -191,8 +191,7 @@
                $(infoBox).hide();
        });
        
-       // file: edit_check_list.xsl
-       $(".frm_save_check_item").submit(function(e){
+       $("#frm_save_check_item").live("submit", function(e){
                e.preventDefault();
                var thisForm = $(this);
                var liWrp = $(this).parent();
@@ -232,8 +231,7 @@
                        });
        });
        
-       // file: edit_check_list.xsl
-       $(".frm_save_control_item").submit(function(e){
+       $(".frm_save_control_item").live("click", function(e){
                e.preventDefault();
                var thisForm = $(this);
                var liWrp = $(this).parent();
@@ -257,8 +255,7 @@
                        });
        });
        
-       // file: edit_check_list.xsl
-       $("#frm_update_check_list").submit(function(e){
+       $("#frm_update_check_list").live("click", function(e){
                e.preventDefault();
 
                var thisForm = $(this);
@@ -287,18 +284,21 @@
                });
        });
        
-       // file: edit_check_list.xsl
-       $("#frm_update_check_list").click(function(e){
+       $("#frm_update_check_list").live("click", function(e){
                var thisForm = $(this);
                var submitBnt = $(thisForm).find("input[type='submit']");
                $(submitBnt).removeClass("not_active");
        });
        
-
-       // file: add_check_list_for_location.xsl
-       $("#frm_add_check_list").click(function(e){
+       $("#frm_add_check_list").live("click", function(e){
                var thisForm = $(this);
                var submitBnt = $(thisForm).find("input[type='submit']");
                $(submitBnt).removeClass("not_active");
        });
+       
+       $("#frm_save_check_item").live("click", function(e){
+               var thisForm = $(this);
+               var submitBnt = $(thisForm).find("input[type='submit']");
+               $(submitBnt).removeClass("not_active");
+       });
 });
\ No newline at end of file

Modified: 
branches/Version-1_0-branch/controller/js/controller/custom_drag_drop.js
===================================================================
--- branches/Version-1_0-branch/controller/js/controller/custom_drag_drop.js    
2012-01-08 13:21:05 UTC (rev 8523)
+++ branches/Version-1_0-branch/controller/js/controller/custom_drag_drop.js    
2012-01-08 13:23:14 UTC (rev 8524)
@@ -49,7 +49,7 @@
        });
        
        // Delete a control item list
-       $(".delete").click(function(){
+       $(".delete").live("click", function(){
                var clickElem = $(this);
                var clickRow = $(this).parent();
                

Modified: branches/Version-1_0-branch/controller/js/controller/custom_ui.js
===================================================================
--- branches/Version-1_0-branch/controller/js/controller/custom_ui.js   
2012-01-08 13:21:05 UTC (rev 8523)
+++ branches/Version-1_0-branch/controller/js/controller/custom_ui.js   
2012-01-08 13:23:14 UTC (rev 8524)
@@ -6,7 +6,7 @@
 
        /* 
=============================================================================== 
*/
        
-       $(".expand_list h4").click(function(){
+       $(".expand_list h4").live("click", function(){
                if( $(this).parent().parent().hasClass('active')){
                        $(this).parent().find("ul").slideUp("slow");
                        $(this).find("img").attr("src", 
"controller/images/arrow_right.png");
@@ -18,7 +18,7 @@
                }
        });
        
-       $(".expand_all").click(function(){
+       $(".expand_all").live("click", function(){
                $(this).addClass("focus");
                $(".collapse_all").removeClass("focus");
                        
@@ -27,7 +27,7 @@
                $("ul.expand_list").find("li h4 img").attr("src", 
"controller/images/arrow_down.png");
        });
        
-       $(".collapse_all").click(function(){
+       $(".collapse_all").live("click", function(){
                $(this).addClass("focus");
                $(".expand_all").removeClass("focus");
                
@@ -38,7 +38,7 @@
        
        /* 
=============================================================================== 
*/
        
-       $("ul.check_items.expand_list h4").click(function(){
+       $("ul.check_items.expand_list h4").live("click", function(){
                if( $(this).parent().hasClass('expanded')){
                        $(this).parent().find(".check_item").slideUp("slow");
                        $(this).find("img").attr("src", 
"controller/images/arrow_right.png");
@@ -50,7 +50,7 @@
                }
        });
        
-       $(".expand_all").click(function(){
+       $(".expand_all").live("click", function(){
                $(this).addClass("focus");
                $(".collapse_all").removeClass("focus");
                        
@@ -59,7 +59,7 @@
                $("ul.expand_list").find("li h4 img").attr("src", 
"controller/images/arrow_down.png");
        });
        
-       $(".collapse_all").click(function(){
+       $(".collapse_all").live("click", function(){
                $(this).addClass("focus");
                $(".expand_all").removeClass("focus");
                

Modified: branches/Version-1_0-branch/controller/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/setup/setup.inc.php  2012-01-08 
13:21:05 UTC (rev 8523)
+++ branches/Version-1_0-branch/controller/setup/setup.inc.php  2012-01-08 
13:23:14 UTC (rev 8524)
@@ -1,6 +1,6 @@
 <?php
        $setup_info['controller']['name'] = 'controller';
-       $setup_info['controller']['version'] = '0.1.15';
+       $setup_info['controller']['version'] = '0.1.17';
        $setup_info['controller']['app_order'] = 100;
        $setup_info['controller']['enable'] = 1;
        $setup_info['controller']['app_group']  = 'office';

Modified: branches/Version-1_0-branch/controller/setup/tables_current.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/setup/tables_current.inc.php 
2012-01-08 13:21:05 UTC (rev 8523)
+++ branches/Version-1_0-branch/controller/setup/tables_current.inc.php 
2012-01-08 13:23:14 UTC (rev 8524)
@@ -58,9 +58,7 @@
                                'control_item_id' => array('type' => 'int', 
'precision' => 4, 'nullable' => True),
                                'status' => array('type' => 'bool','nullable' 
=> true,'default' => 'false'),
                                'comment' => array('type' => 
'varchar','precision' => '255','nullable' => False),
-                               'check_list_id' => array('type' => 'int', 
'precision' => 4, 'nullable' => True),
-                               'message_ticket_id' => array('type' => 'int', 
'precision' => 4, 'nullable' => True),
-                               'measurement' => array('type' => 'int', 
'precision' => 8, 'nullable' => True)
+                               'check_list_id' => array('type' => 'int', 
'precision' => 4, 'nullable' => True)
                        ),
                        'pk' => array('id'),
                        'fk' => array(),
@@ -189,4 +187,16 @@
                        'ix' => array(),
                        'uc' => array()
                ),
+               'controller_check_item_case', array(
+                               'fd' => array(
+                                       'id'                    => array('type' 
=> 'auto', 'nullable' => false),
+                                       'check_item_id'         => array('type' 
=> 'int', 'precision' => '4', 'nullable' => false),
+                                       'message_ticket_id' => array('type' => 
'int', 'precision' => '12', 'nullable' => true),
+                                       'measurement'           => array('type' 
=> 'int', 'precision' => '12', 'nullable' => true)
+                               ),
+                               'pk' => array('id'),
+                               'fk' => array(),
+                               'ix' => array(),
+                               'uc' => array()
+               )
        );

Modified: branches/Version-1_0-branch/controller/setup/tables_update.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/setup/tables_update.inc.php  
2012-01-08 13:21:05 UTC (rev 8523)
+++ branches/Version-1_0-branch/controller/setup/tables_update.inc.php  
2012-01-08 13:23:14 UTC (rev 8524)
@@ -317,4 +317,47 @@
                $GLOBALS['setup_info']['controller']['currentver'] = '0.1.15';
                return $GLOBALS['setup_info']['controller']['currentver'];
        }
-       
\ No newline at end of file
+       
+       $test[] = '0.1.15';
+       function controller_upgrade0_1_15()
+       {
+               
$GLOBALS['phpgw_setup']->oProc->DropColumn('controller_check_item', array(), 
'message_ticket_id');
+               
$GLOBALS['phpgw_setup']->oProc->DropColumn('controller_check_item', array(), 
'measurement');
+               
+               $GLOBALS['phpgw_setup']->oProc->CreateTable(
+                       'controller_check_item_case', array(
+                               'fd' => array(
+                                       'id'                    => array('type' 
=> 'auto', 'nullable' => false),
+                                       'check_item_id'         => array('type' 
=> 'int', 'precision' => '4', 'nullable' => false),
+                                       'message_ticket_id' => array('type' => 
'int', 'precision' => '4', 'nullable' => true),
+                                       'measurement'           => array('type' 
=> 'int', 'precision' => '4', 'nullable' => true)
+                               ),
+                               'pk' => array('id'),
+                               'fk' => array(),
+                               'ix' => array(),
+                               'uc' => array()
+                       )
+               );
+               
+               $GLOBALS['setup_info']['controller']['currentver'] = '0.1.16';
+               return $GLOBALS['setup_info']['controller']['currentver'];
+       }
+       
+       $test[] = '0.1.16';
+       function controller_upgrade0_1_16()
+       {
+               
$GLOBALS['phpgw_setup']->oProc->AlterColumn('controller_check_item_case','message_ticket_id',array(
+                       'type' => 'int', 
+                       'precision' => '8',
+                       'nullable' => true
+               ));
+               
+               
$GLOBALS['phpgw_setup']->oProc->AlterColumn('controller_check_item_case','measurement',array(
+                       'type' => 'varchar', 
+                       'precision' => '50',
+                       'nullable' => true
+               ));
+               
+               $GLOBALS['setup_info']['controller']['currentver'] = '0.1.17';
+               return $GLOBALS['setup_info']['controller']['currentver'];
+       }
\ No newline at end of file

Deleted: 
branches/Version-1_0-branch/controller/templates/base/add_check_list_for_location.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/add_check_list_for_location.xsl
       2012-01-08 13:21:05 UTC (rev 8523)
+++ 
branches/Version-1_0-branch/controller/templates/base/add_check_list_for_location.xsl
       2012-01-08 13:23:14 UTC (rev 8524)
@@ -1,91 +0,0 @@
-<!-- $Id$ -->
-<xsl:template match="data" xmlns:php="http://php.net/xsl";>
-<xsl:variable name="date_format">d/m-Y</xsl:variable>
-
-
-<script>
-       $(function() {
-               $( "#planned_date" ).datepicker({ 
-                       monthNames: 
['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],
-                       dayNamesMin: ['Sø', 'Ma', 'Ti', 'On', 'To', 'Fr', 'Lø'],
-                       dateFormat: 'dd/mm-yy' 
-               });
-               $( "#completed_date" ).datepicker({ 
-                       monthNames: 
['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],
-                       dayNamesMin: ['Sø', 'Ma', 'Ti', 'On', 'To', 'Fr', 'Lø'],
-                       dateFormat: 'dd/mm-yy' 
-               });
-       });
-</script>
-               
-
-<div id="main_content">
-       
-       <h1>Registrere sjekkliste for <xsl:value-of 
select="location_array/loc1_name"/></h1>
-       
-       <div class="tab_menu"><a class="active">Sjekklistedetaljer</a></div>
-       <fieldset class="check_list_details">
-               <form id="frm_add_check_list" 
action="index.php?menuaction=controller.uicheck_list_for_location.save_check_list_for_location"
 method="post">
-                                       
-                       <div id="calendar_dates">
-                               <xsl:for-each select="calendar_array">
-                                       <xsl:variable 
name="cal_date"><xsl:value-of select="."/></xsl:variable>
-                                               
-                                       <span><xsl:value-of 
select="php:function('date', $date_format, number( $cal_date ) )"/></span>
-                               </xsl:for-each>
-                       </div>
-               
-                       <xsl:variable name="location_code"><xsl:value-of 
select="location_array/location_code"/></xsl:variable>
-                       <xsl:variable name="control_id"><xsl:value-of 
select="control_array/id"/></xsl:variable>
-               
-                       <input type="hidden" name="control_id" 
value="{$control_id}" />
-                       <input type="hidden" name="location_code" 
value="{$location_code}" />
-
-                       <fieldset class="add_check_list">
-                               <div>
-                                       <label>Status</label>
-                                       <select name="status">
-                                               <option value="0" 
SELECTED="SELECTED">Ikke utført</option>
-                                               <option value="1" 
>Utført</option>
-                                       </select>
-                               </div>
-                               <div>
-                                       <label>Fristdato</label>
-                                       <input>
-                                     <xsl:attribute 
name="id">deadline_date</xsl:attribute>
-                                     <xsl:attribute 
name="name">deadline_date</xsl:attribute>
-                                     <xsl:attribute 
name="type">text</xsl:attribute>
-                                     <xsl:attribute name="value"><xsl:value-of 
select="php:function('date', $date_format, number(deadline))"/></xsl:attribute>
-                                   </input>
-                           </div>
-                               <div>
-                                       <label>Planlagt dato</label>
-                                       <input>
-                                     <xsl:attribute 
name="id">planned_date</xsl:attribute>
-                                     <xsl:attribute 
name="name">planned_date</xsl:attribute>
-                                     <xsl:attribute 
name="type">text</xsl:attribute>
-                                     <xsl:attribute 
name="value"></xsl:attribute>
-                                   </input>
-                           </div>
-                           <div>
-                                       <label>Utført dato</label>
-                                       <input>
-                                     <xsl:attribute 
name="id">completed_date</xsl:attribute>
-                                     <xsl:attribute 
name="name">completed_date</xsl:attribute>
-                                     <xsl:attribute 
name="type">text</xsl:attribute>
-                                         <xsl:if 
test="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>
-                               <div><label>Utstyr</label><input 
name="equipment_id" /></div>
-                       </fieldset>
-                       <div class="form-buttons">
-                               <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save_check_list')" /></xsl:variable>
-                               <input style="width: 170px;" class="btn 
not_active" type="submit" name="save_control" value="Lagre detaljer" />
-                       </div>
-               </form>
-       </fieldset>
-       
-        </div>
-</xsl:template>

Copied: 
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list_for_location.xsl
 (from rev 8522, 
trunk/controller/templates/base/check_list/add_check_list_for_location.xsl)
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list_for_location.xsl
                            (rev 0)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list_for_location.xsl
    2012-01-08 13:23:14 UTC (rev 8524)
@@ -0,0 +1,91 @@
+<!-- $Id$ -->
+<xsl:template match="data" xmlns:php="http://php.net/xsl";>
+<xsl:variable name="date_format">d/m-Y</xsl:variable>
+
+
+<script>
+       $(function() {
+               $( "#planned_date" ).datepicker({ 
+                       monthNames: 
['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],
+                       dayNamesMin: ['Sø', 'Ma', 'Ti', 'On', 'To', 'Fr', 'Lø'],
+                       dateFormat: 'dd/mm-yy' 
+               });
+               $( "#completed_date" ).datepicker({ 
+                       monthNames: 
['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],
+                       dayNamesMin: ['Sø', 'Ma', 'Ti', 'On', 'To', 'Fr', 'Lø'],
+                       dateFormat: 'dd/mm-yy' 
+               });
+       });
+</script>
+               
+
+<div id="main_content">
+       
+       <h1>Registrere sjekkliste for <xsl:value-of 
select="location_array/loc1_name"/></h1>
+       
+       <div class="tab_menu"><a class="active">Sjekklistedetaljer</a></div>
+       <fieldset class="check_list_details">
+               <form id="frm_add_check_list" 
action="index.php?menuaction=controller.uicheck_list_for_location.save_check_list_for_location"
 method="post">
+                                       
+                       <div id="calendar_dates">
+                               <xsl:for-each select="calendar_array">
+                                       <xsl:variable 
name="cal_date"><xsl:value-of select="."/></xsl:variable>
+                                               
+                                       <span><xsl:value-of 
select="php:function('date', $date_format, number( $cal_date ) )"/></span>
+                               </xsl:for-each>
+                       </div>
+               
+                       <xsl:variable name="location_code"><xsl:value-of 
select="location_array/location_code"/></xsl:variable>
+                       <xsl:variable name="control_id"><xsl:value-of 
select="control_array/id"/></xsl:variable>
+               
+                       <input type="hidden" name="control_id" 
value="{$control_id}" />
+                       <input type="hidden" name="location_code" 
value="{$location_code}" />
+
+                       <fieldset class="add_check_list">
+                               <div>
+                                       <label>Status</label>
+                                       <select name="status">
+                                               <option value="0" 
SELECTED="SELECTED">Ikke utført</option>
+                                               <option value="1" 
>Utført</option>
+                                       </select>
+                               </div>
+                               <div>
+                                       <label>Fristdato</label>
+                                       <input>
+                                     <xsl:attribute 
name="id">deadline_date</xsl:attribute>
+                                     <xsl:attribute 
name="name">deadline_date</xsl:attribute>
+                                     <xsl:attribute 
name="type">text</xsl:attribute>
+                                     <xsl:attribute name="value"><xsl:value-of 
select="php:function('date', $date_format, number(deadline))"/></xsl:attribute>
+                                   </input>
+                           </div>
+                               <div>
+                                       <label>Planlagt dato</label>
+                                       <input>
+                                     <xsl:attribute 
name="id">planned_date</xsl:attribute>
+                                     <xsl:attribute 
name="name">planned_date</xsl:attribute>
+                                     <xsl:attribute 
name="type">text</xsl:attribute>
+                                     <xsl:attribute 
name="value"></xsl:attribute>
+                                   </input>
+                           </div>
+                           <div>
+                                       <label>Utført dato</label>
+                                       <input>
+                                     <xsl:attribute 
name="id">completed_date</xsl:attribute>
+                                     <xsl:attribute 
name="name">completed_date</xsl:attribute>
+                                     <xsl:attribute 
name="type">text</xsl:attribute>
+                                         <xsl:if 
test="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>
+                               <div><label>Utstyr</label><input 
name="equipment_id" /></div>
+                       </fieldset>
+                       <div class="form-buttons">
+                               <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save_check_list')" /></xsl:variable>
+                               <input style="width: 170px;" class="btn 
not_active" type="submit" name="save_control" value="Lagre detaljer" />
+                       </div>
+               </form>
+       </fieldset>
+       
+        </div>
+</xsl:template>

Modified: 
branches/Version-1_0-branch/controller/templates/base/check_list/edit_check_list.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/edit_check_list.xsl
        2012-01-08 13:21:05 UTC (rev 8523)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/edit_check_list.xsl
        2012-01-08 13:23:14 UTC (rev 8524)
@@ -22,77 +22,54 @@
                                dateFormat: 'dd/mm-yy' 
                        });
                        
-                       $(".tab_menu a").click(function(){
-                               var thisTabA = $(this);
-                               var thisTabMenu = $(this).parent(".tab_menu");
-                                                               
-                               var showId = $(thisTabA).attr("href");
-                               var hideId = 
$(thisTabMenu).find("a.active").attr("href");
-                                                       
-                               $(thisTabMenu).find("a").removeClass("active");
-                               $(thisTabA).addClass('active');
-                                                                               
                
-                               $(hideId).hide();
-                               $(hideId).removeClass("active")
-                               $(showId).fadeIn('10', function(){
-                                       $(showId).addClass('active');
-                                       
-                               });
-                       
-                               return false;
-                       });
-                                               
-                       $("#reg_errors").click(function(){
-                               var thisA = $(this);
-                               var showId = $(thisA).attr("href");
-                               var hideId = "#view_errors";
-                                                                       
-                               $(hideId).hide();
-                               $(showId).fadeIn('10');
-                               $(thisA).hide();
-                               $("a#view_errors_measurements").css("display", 
"block");
-                       
-                               return false;
-                       });
-                       
-                       $("#view_errors_measurements").click(function(){
-                               var thisA = $(this);
-                               var showId = $(thisA).attr("href");
-                               var hideId = "#register_errors";
-                                                                       
-                               $(hideId).hide();
-                               $(showId).fadeIn('10');
-                               $(thisA).hide();
-                               $("a#reg_errors").css("display", "block");
-                       
-                               return false;
-                       });
-                       
                });
        </script>
                
                <h1>Sjekkliste for <xsl:value-of 
select="location_array/loc1_name"/></h1>
                
                <div id="edit_check_list_menu" class="hor_menu">
-                       <a class="active" id="view_check_list" 
href="#view_check_list">Vis info om sjekkliste</a>
-                       <a id="view_control_details">
+                       <a class="active">
                                <xsl:attribute name="href">
+                                       
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.edit_check_list_for_location</xsl:text>
+                                       <xsl:text>&amp;check_list_id=</xsl:text>
+                                       <xsl:value-of select="check_list/id"/>
+                               </xsl:attribute>
+                               Vis detaljer for sjekkliste
+                       </a>
+                       <a>
+                               <xsl:attribute name="href">
+                                       
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.view_errors_for_check_list</xsl:text>
+                                       <xsl:text>&amp;check_list_id=</xsl:text>
+                                       <xsl:value-of select="check_list/id"/>
+                               </xsl:attribute>
+                               Vis avvik/saker for sjekkliste
+                       </a>                    
+                       <a>
+                               <xsl:attribute name="href">
                                        
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.view_control_info</xsl:text>
                                        <xsl:text>&amp;check_list_id=</xsl:text>
                                        <xsl:value-of select="check_list/id"/>
                                </xsl:attribute>
                                Vis info om kontroll
                        </a>
+                       
+                       <a style="background:#DD624B;border-bottom: 1px solid 
#CB563F;border-top: 1px solid #EE836F;box-shadow: 0 1px 0 #A9422E, 0 -1px 0 
#A9422E;color: #FFFFFF;height: 18px;margin-left: 40px;margin-top: 1px;">
+                               <xsl:attribute name="href">
+                                       
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.register_error</xsl:text>
+                                       <xsl:text>&amp;check_list_id=</xsl:text>
+                                       <xsl:value-of select="check_list/id"/>
+                               </xsl:attribute>
+                               Registrer avvik/sak
+                       </a>
                </div>
                
-               
                <div class="tab_menu"><a 
class="active">Sjekklistedetaljer</a></div>
                
                <fieldset class="check_list_details">
                        <form id="frm_update_check_list" 
action="index.php?menuaction=controller.uicheck_list.update_check_list" 
method="post">
                                
                        <xsl:variable name="check_list_id"><xsl:value-of 
select="check_list/id"/></xsl:variable>
-                       <input type="hidden" name="check_list_id" 
value="{$check_list_id}" />
+                       <input id="check_list_id" type="hidden" 
name="check_list_id" value="{$check_list_id}" />
                                
                        <div>
                                <label>ID</label>
@@ -163,280 +140,6 @@
                                <input style="width: 170px;" class="btn 
not_active" type="submit" name="save_control" value="Lagre detaljer" />
                        </div>
                        </form>
-               </fieldset>
-               
-               <div id="error_message_menu">
-                       <a class="btn">
-                               <xsl:attribute name="id">
-                                       <xsl:text>reg_errors</xsl:text>
-                               </xsl:attribute>                                
        
-                               <xsl:attribute name="href">
-                                       <xsl:text>#register_errors</xsl:text>
-                               </xsl:attribute>
-                               Registrer sak/måling
-                       </a>
-                       <a class="btn">
-                               <xsl:attribute name="id">
-                                       
<xsl:text>view_errors_measurements</xsl:text>
-                               </xsl:attribute>                                
        
-                               <xsl:attribute name="href">
-                                       <xsl:text>#view_errors</xsl:text>
-                               </xsl:attribute>
-                               Vis avvik/måling
-                       </a>
-                       <a class="btn">
-                               <xsl:attribute name="href">
-                                       
<xsl:text>index.php?menuaction=controller.uierror_report_message.create_error_report_message</xsl:text>
-                                       <xsl:text>&amp;check_list_id=</xsl:text>
-                                       <xsl:value-of select="check_list/id"/>
-                               </xsl:attribute>
-                               Registrer avviksmelding
-                       </a>
-               </div>
-               
-               <div id="register_errors">
-                       <div class="tab_menu"><a class="active">Registrer 
sak/måling</a></div>
-                                       
-                       <div class="tab_item active">
-                       
-                       <xsl:choose>
-                               <xsl:when 
test="control_items_not_registered/child::node()">
-                               
-                                       <ul id="control_items_list" 
class="check_items expand_list">
-                                               <xsl:for-each 
select="control_items_not_registered">
-                                                       <li>
-                                                       <h4><img 
src="controller/images/arrow_right.png" width="14"/><span><xsl:value-of 
select="title"/></span></h4>                                           
-                                                               <form 
class="frm_save_control_item" 
action="index.php?menuaction=controller.uicheck_list.add_check_item_to_list" 
method="post">
-                                                                       
<xsl:variable name="control_item_id"><xsl:value-of select="id"/></xsl:variable>
-                                                                       <input 
type="hidden" name="control_item_id" value="{$control_item_id}" /> 
-                                                                       <input 
name="check_list_id" type="hidden">
-                                                                     
<xsl:attribute name="value">
-                                                                       
<xsl:value-of select="//check_list/id"/>
-                                                                     
</xsl:attribute>
-                                                                   </input>
-                                                                   <input 
name="status" type="hidden" value="0" />
-                                                                     
-                                                               <xsl:choose>
-                                                                       
<xsl:when test="type = 'control_item_type_1'">
-                                                                               
<input name="type" type="hidden" value="control_item_type_1" />
-                                                                           
-                                                                               
<div class="check_item">
-                                                                              
<div>
-                                                                               
         <label class="comment">Kommentar</label>
-                                                                               
         <textarea name="comment">
-                                                                               
                        <xsl:value-of select="comment"/>
-                                                                               
                 </textarea>
-                                                                               
   </div>
-                                                                              
<div class="form-buttons">
-                                                                               
                <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'register_error')" /></xsl:variable>
-                                                                               
                <input type="submit" name="save_control" value="{$lang_save}" 
class="not_active" title="{$lang_save}" />
-                                                                               
        </div>
-                                                                               
</div>
-                                                                       
</xsl:when>
-                                                                       
<xsl:when test="type = 'control_item_type_2'">
-                                                                               
<input name="type" type="hidden" value="control_item_type_2" />
-                                                                               
<div class="check_item">
-                                                                               
 <div>
-                                                                               
 <label class="comment">Registrer målingsverdi</label>
-                                                                               
   <input>
-                                                                               
              <xsl:attribute name="name">measurement</xsl:attribute>
-                                                                               
              <xsl:attribute name="type">text</xsl:attribute>
-                                                                               
              <xsl:attribute name="value">
-                                                                               
                <xsl:value-of select="measurement"/>
-                                                                               
              </xsl:attribute>
-                                                                               
            </input>
-                                                                              
</div>
-                                                                              
<div>
-                                                                               
         <label class="comment">Kommentar</label>
-                                                                               
         <textarea name="comment">
-                                                                               
                        <xsl:value-of select="comment"/>
-                                                                               
                 </textarea>
-                                                                               
   </div>
-                                                                              
<div class="form-buttons">
-                                                                               
                <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'register_error')" /></xsl:variable>
-                                                                               
                <input type="submit" name="save_control" value="Registrer 
avvik" class="not_active" title="{$lang_save}" />
-                                                                               
        </div>
-                                                                               
</div>
-                                                                       
</xsl:when>
-                                                               </xsl:choose>   
                                                                                
                        
-                                                                       
-                                                               </form>
-                                                   </li>
-                                               </xsl:for-each>
-                                       </ul>                   
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                               Alle sjekkpunkter for kontroll 
er registert som åpent/håndtert avvik eller måling 
-                                       </xsl:otherwise>
-                       </xsl:choose>
-               </div>
-               </div>
-               
-               <div id="view_errors">
-               
-               <div class="tab_menu">
-                       <a class="active" href="#view_open_errors">Vis åpne 
saker</a>
-                       <a href="#view_handled_errors">Vis lukkede saker</a>
-                       <a href="#view_measurements">Vis målinger</a>
-               </div>  
-               
-               <div id="view_open_errors" class="tab_item active">
-                       <xsl:choose>
-                               <xsl:when test="open_check_items/child::node()">
-                                       
-                               <div class="expand_menu"><div 
class="expand_all">Vis alle</div><div class="collapse_all focus">Skjul 
alle</div></div>
-                       
-                                       <ul id="check_list_not_fixed_list" 
class="check_items expand_list">
-                                               <xsl:for-each 
select="open_check_items">
-                                                               <li>
-                                                               <xsl:if 
test="status = 0">
-                                                                       
<h4><img src="controller/images/arrow_right.png" 
width="14"/><span><xsl:value-of select="control_item/title"/></span></h4>       
                                       
-                                                                       <form 
class="frm_save_check_item" 
action="index.php?menuaction=controller.uicheck_list.save_check_item" 
method="post">
-                                                                               
<xsl:variable name="check_item_id"><xsl:value-of select="id"/></xsl:variable>
-                                                                               
<input type="hidden" name="check_item_id" value="{$check_item_id}" /> 
-                                                                               
<div class="check_item">
-                                                                               
  <div>
-                                                                               
       <label>Status</label>
-                                                                               
       <select name="status">
-                                                                               
                <xsl:choose>
-                                                                               
                        <xsl:when test="status = 0">
-                                                                               
                                <option value="0" SELECTED="SELECTED">Avvik er 
åpent</option>
-                                                                               
                                <option value="1">Avvik er håndtert</option>
-                                                                               
                        </xsl:when>
-                                                                               
                        <xsl:when test="status = 1">
-                                                                               
                                <option value="0">Avvik er åpent</option>
-                                                                               
                                <option value="1" SELECTED="SELECTED">Avvik er 
håndtert</option>
-                                                                               
                        </xsl:when>
-                                                                               
                </xsl:choose>
-                                                                               
           </select>
-                                                                              
</div>
-                                                                              
<div>
-                                                                               
 <label class="comment">Kommentar</label>
-                                                                               
 <textarea name="comment">
-                                                                               
                <xsl:value-of select="comment"/>
-                                                                               
         </textarea>
-                                                                              
</div>
-                                                                              
<div class="form-buttons">
-                                                                               
                <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save_check_item')" /></xsl:variable>
-                                                                               
                <input style="width: 200px;" type="submit" name="save_control" 
value="Oppdater registrert avvik" class="not_active" title="{$lang_save}" />
-                                                                               
        </div>
-                                                                               
</div>
-                                                                       </form>
-                                                               </xsl:if>
-                                                   </li>
-                                               </xsl:for-each>
-                                       </ul>                   
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                               Ingen registrerte åpne avvik
-                                       </xsl:otherwise>
-                       </xsl:choose>
-               </div>
-               
-               <div id="view_handled_errors" class="tab_item"> 
-                       <xsl:choose>
-                               <xsl:when 
test="handled_check_items/child::node()">
-                                       
-                               <div class="expand_menu"><div 
class="expand_all">Vis alle</div><div class="collapse_all focus">Skjul 
alle</div></div>
-                                       
-                                       <ul id="check_list_fixed_list" 
class="check_items expand_list">
-                                               <xsl:for-each 
select="handled_check_items">
-                                                               <xsl:if 
test="status = 1">
-                                                               <li>
-                                                               <h4><img 
src="controller/images/arrow_right.png" width="14"/><span><xsl:value-of 
select="control_item/title"/></span></h4>                                       
       
-                                                                       <form 
class="frm_save_check_item" 
action="index.php?menuaction=controller.uicheck_list.save_check_item" 
method="post">
-                                                                               
<xsl:variable name="check_item_id"><xsl:value-of select="id"/></xsl:variable>
-                                                                               
<input type="hidden" name="check_item_id" value="{$check_item_id}" /> 
-                                                                               
<div class="check_item">
-                                                                               
  <div>
-                                                                               
       <label>Status</label>
-                                                                               
       <select name="status">
-                                                                               
                <xsl:choose>
-                                                                               
                        <xsl:when test="status = 0">
-                                                                               
                                <option value="0" SELECTED="SELECTED">Avvik er 
åpent</option>
-                                                                               
                                <option value="1">Avvik er håndtert</option>
-                                                                               
                        </xsl:when>
-                                                                               
                        <xsl:when test="status = 1">
-                                                                               
                                <option value="0">Avvik er åpent</option>
-                                                                               
                                <option value="1" SELECTED="SELECTED">Avvik er 
lukket</option>
-                                                                               
                        </xsl:when>
-                                                                               
                </xsl:choose>
-                                                                               
           </select>
-                                                                              
</div>
-                                                                              
<div>
-                                                                               
 <label class="comment">Kommentar</label>
-                                                                               
 <textarea name="comment">
-                                                                               
                <xsl:value-of select="comment"/>
-                                                                               
         </textarea>
-                                                                              
</div>
-                                                                              
<div class="form-buttons">
-                                                                               
                <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save_check_item')" /></xsl:variable>
-                                                                               
                <input type="submit" name="save_control" value="Oppdater 
håndtert avvik" class="not_active" title="{$lang_save}" />
-                                                                               
        </div>
-                                                                               
</div>
-                                                                       </form>
-                                                           </li>
-                                                       </xsl:if>
-                                               </xsl:for-each>
-                                       </ul>                   
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                               Ingen registrerte håndterte 
avvik
-                                       </xsl:otherwise>
-                       </xsl:choose>
-               </div>
-               
-               <div id="view_measurements" class="tab_item">
-                       <xsl:choose>
-                               <xsl:when 
test="measurement_check_items/child::node()">
-                                       
-                               <div class="expand_menu"><div 
class="expand_all">Vis alle</div><div class="collapse_all focus">Skjul 
alle</div></div>
-                       
-                                       <ul id="check_list_not_fixed_list" 
class="check_items expand_list">
-                                               <xsl:for-each 
select="measurement_check_items">
-                                                               <li>
-                                                               <xsl:if 
test="status = 0">
-                                                                       
<h4><img src="controller/images/arrow_right.png" 
width="14"/><span><xsl:value-of select="control_item/title"/></span></h4>       
                                       
-                                                                       <form 
class="frm_save_check_item" 
action="index.php?menuaction=controller.uicheck_list.save_check_item" 
method="post">
-                                                                               
<xsl:variable name="check_item_id"><xsl:value-of select="id"/></xsl:variable>
-                                                                               
<input type="hidden" name="check_item_id" value="{$check_item_id}" />
-                                                                               
<input type="hidden" name="type" value="measurement" />
-                                                                               
 
-                                                                               
<div class="check_item">
-                                                                               
  <div>
-                                                                               
       <label>Målingsverdi</label>
-                                                                               
       <input>
-                                                                               
              <xsl:attribute name="name">measurement</xsl:attribute>
-                                                                               
              <xsl:attribute name="type">text</xsl:attribute>
-                                                                               
              <xsl:attribute name="value">
-                                                                               
                <xsl:value-of select="measurement"/>
-                                                                               
              </xsl:attribute>
-                                                                               
            </input>
-                                                                              
</div>
-                                                                              
-                                                                              
<div>
-                                                                               
 <label class="comment">Kommentar</label>
-                                                                               
 <textarea name="comment">
-                                                                               
                <xsl:value-of select="comment"/>
-                                                                               
         </textarea>
-                                                                              
</div>
-                                                                              
<div class="form-buttons">
-                                                                               
                <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save_check_item')" /></xsl:variable>
-                                                                               
                <input type="submit" name="save_control" value="Oppdatert 
registert måling" class="not_active" title="{$lang_save}" />
-                                                                               
        </div>
-                                                                               
</div>
-                                                                       </form>
-                                                               </xsl:if>
-                                                   </li>
-                                               </xsl:for-each>
-                                       </ul>                   
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                               Ingen registrerte målinger
-                                       </xsl:otherwise>
-                       </xsl:choose>
-               </div>
-               
-       </div>
+               </fieldset>             
 </div>
 </xsl:template>

Copied: 
branches/Version-1_0-branch/controller/templates/base/check_list/print_check_list.xsl
 (from rev 8522, 
trunk/controller/templates/base/check_list/print_check_list.xsl)
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/print_check_list.xsl
                               (rev 0)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/print_check_list.xsl
       2012-01-08 13:23:14 UTC (rev 8524)
@@ -0,0 +1,74 @@
+<!-- $Id: choose_control_items.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
+
+<xsl:template match="view_control_items">
+
+<ul class="groups">
+       <xsl:for-each select="saved_groups_with_items_array">
+               <li class="drag_group list_item">
+                       <h3><span class="group_order_nr"><xsl:number/></span>. 
<xsl:value-of select="control_group/group_name"/></h3>
+       
+                       <form 
action="index.php?menuaction=controller.uicontrol_item.save_item_order" 
class="frm_save_order">
+                               <xsl:variable 
name="control_group_id"><xsl:value-of select="control_group/id"/></xsl:variable>
+                               <input type="hidden" name="control_group_id" 
value="{$control_group_id}" />
+               
+                               <ul id="list">
+                                       <xsl:for-each select="control_items">
+                                               <xsl:variable 
name="control_item_id"><xsl:value-of select="id"/></xsl:variable>
+                                               <xsl:variable name="order_tag">
+                                                       <xsl:choose>
+                                                               <xsl:when 
test="order_nr > 0">
+                                                                       
<xsl:value-of select="order_nr"/>
+                                                               </xsl:when>
+                                                               <xsl:otherwise>
+                                                                       
<xsl:number/>
+                                                               </xsl:otherwise>
+                                                       
</xsl:choose>:<xsl:value-of select="id"/>
+                                               </xsl:variable>
+                                                                               
                                
+                                               <li class="list_item">
+                                                       <span 
class="order_nr"><xsl:number/></span>. <xsl:value-of select="title"/><input 
type="hidden" name="order_nr[]" value="{$order_tag}" />
+                                               </li>
+                                       </xsl:for-each>
+                               </ul>
+                       </form>
+               </li>
+       </xsl:for-each>
+</ul>
+
+<style>
+.btn{
+       background: none repeat scroll 0 0 #2647A0;
+    color: #FFFFFF;
+    display: inline-block;
+    margin-right: 5px;
+    padding: 5px 10px;
+    text-decoration: none;
+    border: 1px solid #173073;
+    cursor: pointer;
+}
+
+ul{
+       list-style: none outside none;
+}
+
+li{
+       list-style: none outside none;
+}
+
+ul.groups li {
+    padding: 3px 0;
+}
+
+ul.groups li.odd{
+    background: none repeat scroll 0 0 #DBE7F5;
+}
+
+ul.groups h3 {
+    font-size: 18px;
+    margin: 0 0 5px;
+}
+
+</style>
+<a style="margin:20px 0 0 40px;" href="#print" class="btn" 
onClick="window.print()">Skriv ut</a>
+
+</xsl:template>

Copied: 
branches/Version-1_0-branch/controller/templates/base/check_list/register_errors.xsl
 (from rev 8522, trunk/controller/templates/base/check_list/register_errors.xsl)
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/register_errors.xsl
                                (rev 0)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/register_errors.xsl
        2012-01-08 13:23:14 UTC (rev 8524)
@@ -0,0 +1,101 @@
+<!-- $Id: choose_control_items.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
+
+<xsl:template match="register_errors" xmlns:php="http://php.net/xsl";>
+
+<div id="error_message_menu">
+       <a class="btn" id="view_open_errors">                                   
+               <xsl:attribute name="href">
+                       
<xsl:text>index.php?menuaction=controller.uicheck_list.view_open_errors</xsl:text>
+                       <xsl:text>&amp;check_list_id=</xsl:text>
+                       <xsl:value-of select="check_list/id"/>
+               </xsl:attribute>
+               Vis avvik/måling
+       </a>
+       <a class="btn">
+               <xsl:attribute name="href">
+                       
<xsl:text>index.php?menuaction=controller.uierror_report_message.create_error_report_message</xsl:text>
+                       <xsl:text>&amp;check_list_id=</xsl:text>
+                       <xsl:value-of select="check_list/id"/>
+               </xsl:attribute>
+               Registrer avviksmelding
+       </a>
+</div>
+
+<div id="register_errors_content">
+                       <div class="tab_menu"><a class="active">Registrer 
sak/måling</a></div>
+                                       
+                       <div class="tab_item active">
+                       
+                       <xsl:choose>
+                               <xsl:when 
test="control_items_not_registered/child::node()">
+                               
+                                       <ul id="control_items_list" 
class="check_items expand_list">
+                                               <xsl:for-each 
select="control_items_not_registered">
+                                                       <li>
+                                                       <h4><img 
src="controller/images/arrow_right.png" width="14"/><span><xsl:value-of 
select="title"/></span></h4>                                           
+                                                               <form 
class="frm_save_control_item" 
action="index.php?menuaction=controller.uicheck_list.add_check_item_to_list" 
method="post">
+                                                                       
<xsl:variable name="control_item_id"><xsl:value-of select="id"/></xsl:variable>
+                                                                       <input 
type="hidden" name="control_item_id" value="{$control_item_id}" /> 
+                                                                       <input 
name="check_list_id" type="hidden">
+                                                                     
<xsl:attribute name="value">
+                                                                       
<xsl:value-of select="//check_list/id"/>
+                                                                     
</xsl:attribute>
+                                                                   </input>
+                                                                   <input 
name="status" type="hidden" value="0" />
+                                                                     
+                                                               <xsl:choose>
+                                                                       
<xsl:when test="type = 'control_item_type_1'">
+                                                                               
<input name="type" type="hidden" value="control_item_type_1" />
+                                                                           
+                                                                               
<div class="check_item">
+                                                                              
<div>
+                                                                               
         <label class="comment">Kommentar</label>
+                                                                               
         <textarea name="comment">
+                                                                               
                        <xsl:value-of select="comment"/>
+                                                                               
                 </textarea>
+                                                                               
   </div>
+                                                                              
<div class="form-buttons">
+                                                                               
                <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'register_error')" /></xsl:variable>
+                                                                               
                <input type="submit" name="save_control" value="{$lang_save}" 
class="not_active" title="{$lang_save}" />
+                                                                               
        </div>
+                                                                               
</div>
+                                                                       
</xsl:when>
+                                                                       
<xsl:when test="type = 'control_item_type_2'">
+                                                                               
<input name="type" type="hidden" value="control_item_type_2" />
+                                                                               
<div class="check_item">
+                                                                               
 <div>
+                                                                               
 <label class="comment">Registrer målingsverdi</label>
+                                                                               
   <input>
+                                                                               
              <xsl:attribute name="name">measurement</xsl:attribute>
+                                                                               
              <xsl:attribute name="type">text</xsl:attribute>
+                                                                               
              <xsl:attribute name="value">
+                                                                               
                <xsl:value-of select="measurement"/>
+                                                                               
              </xsl:attribute>
+                                                                               
            </input>
+                                                                              
</div>
+                                                                              
<div>
+                                                                               
         <label class="comment">Kommentar</label>
+                                                                               
         <textarea name="comment">
+                                                                               
                        <xsl:value-of select="comment"/>
+                                                                               
                 </textarea>
+                                                                               
   </div>
+                                                                              
<div class="form-buttons">
+                                                                               
                <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'register_error')" /></xsl:variable>
+                                                                               
                <input type="submit" name="save_control" value="Registrer 
avvik" class="not_active" title="{$lang_save}" />
+                                                                               
        </div>
+                                                                               
</div>
+                                                                       
</xsl:when>
+                                                               </xsl:choose>   
                                                                                
                        
+                                                                       
+                                                               </form>
+                                                   </li>
+                                               </xsl:for-each>
+                                       </ul>                   
+                                       </xsl:when>
+                                       <xsl:otherwise>
+                                               Alle sjekkpunkter for kontroll 
er registert som åpent/håndtert avvik eller måling 
+                                       </xsl:otherwise>
+                       </xsl:choose>
+               </div>
+               </div>
+</xsl:template>

Copied: 
branches/Version-1_0-branch/controller/templates/base/check_list/view_closed_errors.xsl
 (from rev 8522, 
trunk/controller/templates/base/check_list/view_closed_errors.xsl)
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/view_closed_errors.xsl
                             (rev 0)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/view_closed_errors.xsl
     2012-01-08 13:23:14 UTC (rev 8524)
@@ -0,0 +1,110 @@
+<!-- $Id: choose_control_items.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
+
+<xsl:template match="view_closed_errors">
+
+<div id="error_message_menu">
+       <a class="btn" id="register_errors">                                    
+               <xsl:attribute name="href">
+                       
<xsl:text>index.php?menuaction=controller.uicheck_list.register_errors</xsl:text>
+                       <xsl:text>&amp;check_list_id=</xsl:text>
+                       <xsl:value-of select="check_list/id"/>
+                       <xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
+               </xsl:attribute>
+               Registrer sak/måling
+       </a>
+       <a class="btn">
+               <xsl:attribute name="href">
+                       
<xsl:text>index.php?menuaction=controller.uierror_report_message.create_error_report_message</xsl:text>
+                       <xsl:text>&amp;check_list_id=</xsl:text>
+                       <xsl:value-of select="check_list/id"/>
+               </xsl:attribute>
+               Registrer avviksmelding
+       </a>
+</div>
+       
+<div id="view_errors">
+       
+       <div class="tab_menu">
+               <a id="view_open_errors">                                       
+                       <xsl:attribute name="href">
+                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_open_errors</xsl:text>
+                               <xsl:text>&amp;check_list_id=</xsl:text>
+                               <xsl:value-of select="check_list/id"/>
+                               
<xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
+                       </xsl:attribute>
+                       Vis åpne saker
+               </a>
+               <a class="active" id="view_closed_errors">                      
                
+                       <xsl:attribute name="href">
+                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_closed_errors</xsl:text>
+                               <xsl:text>&amp;check_list_id=</xsl:text>
+                               <xsl:value-of select="check_list/id"/>
+                               
<xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
+                       </xsl:attribute>
+                       Vis lukkede saker
+               </a>
+               <a id="view_measurements">                                      
+                       <xsl:attribute name="href">
+                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_measurements</xsl:text>
+                               <xsl:text>&amp;check_list_id=</xsl:text>
+                               <xsl:value-of select="check_list/id"/>
+                               
<xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
+                       </xsl:attribute>
+                       Vis målinger
+               </a>
+       </div>  
+       
+       <div class="tab_item"> 
+               <xsl:choose>
+                       <xsl:when test="handled_check_items/child::node()">
+                               
+                       <div class="expand_menu"><div class="expand_all">Vis 
alle</div><div class="collapse_all focus">Skjul alle</div></div>
+                               
+                               <ul id="check_list_fixed_list" 
class="check_items expand_list">
+                                       <xsl:for-each 
select="handled_check_items">
+                                                       <xsl:if test="status = 
1">
+                                                       <li>
+                                                       <h4><img 
src="controller/images/arrow_right.png" width="14"/><span><xsl:value-of 
select="control_item/title"/></span></h4>                                       
       
+                                                               <form 
id="frm_save_check_item" 
action="index.php?menuaction=controller.uicheck_list.save_check_item" 
method="post">
+                                                                       
<xsl:variable name="check_item_id"><xsl:value-of select="id"/></xsl:variable>
+                                                                       <input 
type="hidden" name="check_item_id" value="{$check_item_id}" /> 
+                                                                       <div 
class="check_item">
+                                                                         <div>
+                                                                              
<label>Status</label>
+                                                                              
<select name="status">
+                                                                               
        <xsl:choose>
+                                                                               
                <xsl:when test="status = 0">
+                                                                               
                        <option value="0" SELECTED="SELECTED">Avvik er 
åpent</option>
+                                                                               
                        <option value="1">Avvik er håndtert</option>
+                                                                               
                </xsl:when>
+                                                                               
                <xsl:when test="status = 1">
+                                                                               
                        <option value="0">Avvik er åpent</option>
+                                                                               
                        <option value="1" SELECTED="SELECTED">Avvik er 
lukket</option>
+                                                                               
                </xsl:when>
+                                                                               
        </xsl:choose>
+                                                                               
   </select>
+                                                                      </div>
+                                                                      <div>
+                                                                        <label 
class="comment">Kommentar</label>
+                                                                        
<textarea name="comment">
+                                                                               
        <xsl:value-of select="comment"/>
+                                                                               
 </textarea>
+                                                                      </div>
+                                                                      <div 
class="form-buttons">
+                                                                               
        <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save_check_item')" /></xsl:variable>
+                                                                               
        <input type="submit" name="save_control" value="Oppdater håndtert 
avvik" class="not_active" title="{$lang_save}" />
+                                                                               
</div>
+                                                                       </div>
+                                                               </form>
+                                                   </li>
+                                               </xsl:if>
+                                       </xsl:for-each>
+                               </ul>                   
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       Ingen registrerte håndterte avvik
+                               </xsl:otherwise>
+               </xsl:choose>
+       </div>
+</div>
+</xsl:template>
\ No newline at end of file

Copied: 
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_details.xsl
 (from rev 8522, 
trunk/controller/templates/base/check_list/view_control_details.xsl)
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_details.xsl
                           (rev 0)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_details.xsl
   2012-01-08 13:23:14 UTC (rev 8524)
@@ -0,0 +1,129 @@
+<!-- $Id: choose_control_items.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
+<xsl:variable name="date_format">d/m-Y</xsl:variable>
+
+<xsl:template match="view_control_details" xmlns:php="http://php.net/xsl";>
+       
+
+       <fieldset>
+               <dl class="proplist-col">
+               <dt>
+                       <label>Kontrollområde</label>
+               </dt>
+               <dd>
+               <xsl:choose>
+                       <xsl:when test="editable">
+                               <select id="control_area_id" 
name="control_area_id">
+                                       <xsl:apply-templates 
select="control_areas_array2/options"/>
+                               </select>
+                       </xsl:when>
+                       <xsl:otherwise>
+                               <xsl:value-of 
select="control/control_area_name" />
+                       </xsl:otherwise>
+               </xsl:choose>
+               </dd>
+               <dt>
+                       <label>Prosedyre</label>
+               </dt>
+               <dd>
+                       <xsl:value-of select="control/procedure_name" />        
+               </dd>
+               <dt>
+                       <label for="title">Tittel</label>
+               </dt>
+               <dd>
+                       <xsl:choose>
+                               <xsl:when test="editable">
+                                       <input type="text" name="title" 
id="title" value="{control/title}" size="80"/>
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       <xsl:value-of select="control/title" />
+                               </xsl:otherwise>
+                       </xsl:choose>
+               </dd>
+               <dt>
+                       <label for="start_date">Startdato</label>
+               </dt>
+               <dd>
+                       <xsl:choose>
+                     <xsl:when test="not(control/start_date = '0') or 
not(control/start_date = '')">
+                       <xsl:value-of select="php:function('date', 
$date_format, number(control/start_date))"/>
+                     </xsl:when>
+                     <xsl:otherwise>
+                       Dato ikke angitt
+                     </xsl:otherwise>
+             </xsl:choose>
+               </dd>
+               <dt>
+                       <label for="end_date">Sluttdato</label>
+               </dt>
+               <dd>
+             <xsl:choose>
+                     <xsl:when test="not(control/end_date = '0') or 
not(control/end_date = '')">
+                       Dato ikke angitt
+                     </xsl:when>
+                     <xsl:otherwise>
+                       <xsl:value-of select="php:function('date', 
$date_format, number(control/end_date))"/>
+                     </xsl:otherwise>
+             </xsl:choose>
+               </dd>
+               <dt>
+                       <label>Frekvenstype</label>
+               </dt>
+               <dd>
+                       <select id="repeat_type" name="repeat_type">
+                               <option value="0">Ikke angitt</option>
+                               <option value="1">Dag</option>
+                               <option value="2">Uke</option>
+                               <option value="3">Måned</option>
+                               <option value="5">År</option>
+                       </select>
+               </dd>
+               <dt>
+                       <label>Frekvens</label>
+               </dt>
+               <dd>
+               <xsl:choose>
+                       <xsl:when test="editable">
+                               <input size="2" type="text" 
name="repeat_interval" value="{control/repeat_interval}" />
+                       </xsl:when>
+                       <xsl:otherwise>
+                               <xsl:value-of select="control/repeat_interval" 
/>
+                       </xsl:otherwise>
+               </xsl:choose>
+               </dd>
+               <dt>
+                       <label>Rolle</label>
+               </dt>
+               <dd>
+               <xsl:choose>
+                       <xsl:when test="editable">
+                               <select id="responsibility_id" 
name="responsibility_id">
+                                       <xsl:for-each select="role_array">
+                                               <option value="{id}">
+                                                       <xsl:value-of 
disable-output-escaping="yes" select="name"/>
+                                               </option>
+                                       </xsl:for-each>
+                               </select>
+                       </xsl:when>
+                       <xsl:otherwise>
+                               <xsl:value-of select="control/role_name" />
+                       </xsl:otherwise>
+               </xsl:choose>
+               </dd>
+               <dt>
+                       <label for="description">Beskrivelse</label>
+               </dt>
+               <dd>
+               <xsl:choose>
+                       <xsl:when test="editable">
+                               <textarea cols="70" rows="5" name="description" 
id="description"><xsl:value-of select="control/description" /></textarea>
+                       </xsl:when>
+                       <xsl:otherwise>
+                               <xsl:value-of select="control/description" 
disable-output-escaping="yes"/>
+                       </xsl:otherwise>
+               </xsl:choose>
+               </dd>
+       </dl>
+       </fieldset>
+       
+</xsl:template>

Modified: 
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_info.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_info.xsl
      2012-01-08 13:21:05 UTC (rev 8523)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_info.xsl
      2012-01-08 13:23:14 UTC (rev 8524)
@@ -5,74 +5,104 @@
 <div id="main_content">
                
        <script>
+               $(document).ready(function() {
+                       var requestUrl = 
$("#view_control_details").attr("href");
+                       load_tab(requestUrl);
+               });
+       
                $(function() {
                        
-                       $("#view_control_details").click(function(){
-                               var requestUrl = $(this).attr("href");
+                       $(".tab_menu a").click(function(){
+                               var thisTabA = $(this);
+                               var thisTabMenu = $(this).parent(".tab_menu");
+                                                               
+                               var showId = $(thisTabA).attr("href");
+                               var hideId = 
$(thisTabMenu).find("a.active").attr("href");
                                                        
-                               $.ajax({
-                                 type: 'POST',
-                                 url: requestUrl,
-                                 success: function(data) {
-                                       $("#tab_content").html(data);
-                                 }
+                               $(thisTabMenu).find("a").removeClass("active");
+                               $(thisTabA).addClass('active');
+                                                                               
                
+                               $(hideId).hide();
+                               $(hideId).removeClass("active")
+                               $(showId).fadeIn('10', function(){
+                                       $(showId).addClass('active');
+                                       
                                });
                        
                                return false;
                        });
                        
+                       $("#view_control_details").click(function(){
+                               var requestUrl = $(this).attr("href");
+                               load_tab(requestUrl);
+                       
+                               return false;
+                       });
+                       
                        $("#view_control_items").click(function(){
                                var requestUrl = $(this).attr("href");
-                                                       
-                               $.ajax({
-                                 type: 'POST',
-                                 url: requestUrl,
-                                 success: function(data) {
-                                       $("#tab_content").html(data);
-                                 }
-                               });
+                               load_tab(requestUrl);
                        
                                return false;
                        });
                        
                        $("#view_procedures").click(function(){
                                var requestUrl = $(this).attr("href");
-                                                       
-                               $.ajax({
+                               load_tab(requestUrl);
+                       
+                               return false;
+                       });
+               });
+               
+               function load_tab(requestUrl){
+                       $.ajax({
                                  type: 'POST',
                                  url: requestUrl,
                                  success: function(data) {
                                        $("#tab_content").html(data);
                                  }
-                               });
-                       
-                               return false;
                        });
-                       
-               });
+               }
+                               
        </script>
                
        <h1>Sjekkliste for <xsl:value-of 
select="location_array/loc1_name"/></h1>
        
        <div id="edit_check_list_menu" class="hor_menu">
-               <a id="view_check_list">
-                       <xsl:attribute name="href">
-                               
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.edit_check_list_for_location</xsl:text>
-                               <xsl:text>&amp;check_list_id=</xsl:text>
-                               <xsl:value-of select="check_list/id"/>
-                       </xsl:attribute>
-                       Vis info om sjekkliste
-               </a>
-               
-               <a id="view_control_details" class="active">
-                       <xsl:attribute name="href">
-                               
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.view_control_info</xsl:text>
-                               <xsl:text>&amp;check_list_id=</xsl:text>
-                               <xsl:value-of select="check_list/id"/>
-                       </xsl:attribute>
-                       Vis info om kontroll
-               </a>
-       </div>
+                       <a>
+                               <xsl:attribute name="href">
+                                       
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.edit_check_list_for_location</xsl:text>
+                                       <xsl:text>&amp;check_list_id=</xsl:text>
+                                       <xsl:value-of select="check_list/id"/>
+                               </xsl:attribute>
+                               Vis detaljer for sjekkliste
+                       </a>
+                       <a>
+                               <xsl:attribute name="href">
+                                       
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.view_errors_for_check_list</xsl:text>
+                                       <xsl:text>&amp;check_list_id=</xsl:text>
+                                       <xsl:value-of select="check_list/id"/>
+                               </xsl:attribute>
+                               Vis avvik/saker for sjekkliste
+                       </a>                    
+                       <a class="active">
+                               <xsl:attribute name="href">
+                                       
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.view_control_info</xsl:text>
+                                       <xsl:text>&amp;check_list_id=</xsl:text>
+                                       <xsl:value-of select="check_list/id"/>
+                               </xsl:attribute>
+                               Vis info om kontroll
+                       </a>
+                       
+                       <a style="background:#DD624B;border-bottom: 1px solid 
#CB563F;border-top: 1px solid #EE836F;box-shadow: 0 1px 0 #A9422E, 0 -1px 0 
#A9422E;color: #FFFFFF;height: 18px;margin-left: 40px;margin-top: 1px;">
+                               <xsl:attribute name="href">
+                                       
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.register_error</xsl:text>
+                                       <xsl:text>&amp;check_list_id=</xsl:text>
+                                       <xsl:value-of select="check_list/id"/>
+                               </xsl:attribute>
+                               Registrer avvik/sak
+                       </a>
+               </div>
                                
        <div class="tab_menu">
                <a id="view_control_details" class="active">
@@ -80,14 +110,16 @@
                                
<xsl:text>index.php?menuaction=controller.uicheck_list.view_control_details</xsl:text>
                                <xsl:text>&amp;control_id=</xsl:text>
                                <xsl:value-of select="control/id"/>
+                               
<xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
                        </xsl:attribute>
                        Kontrolldetaljer
                </a>
                <a id="view_control_items">
                        <xsl:attribute name="href">
                                
<xsl:text>index.php?menuaction=controller.uicheck_list.view_control_items</xsl:text>
-                               <xsl:text>&amp;control_id=</xsl:text>
-                               <xsl:value-of select="control/id"/>
+                               <xsl:text>&amp;check_list_id=</xsl:text>
+                               <xsl:value-of select="check_list/id"/>
+                               
<xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
                        </xsl:attribute>
                        Kontrollpunkter
                </a>
@@ -96,173 +128,13 @@
                                
<xsl:text>index.php?menuaction=controller.uiprocedure.view_procedures_for_control</xsl:text>
                                <xsl:text>&amp;control_id=</xsl:text>
                                <xsl:value-of select="control/id"/>
+                               
<xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
                        </xsl:attribute>
                        Prosedyrer
                </a>
        </div>
                
-       <div id="tab_content" class="content_wrp">
+       <div id="tab_content" class="content_wrp"></div>
        
-       <fieldset>
-               <dl class="proplist-col">
-                               <dt>
-                                       <label>Kontrollområde</label>
-                               </dt>
-                               <dd>
-                               <xsl:choose>
-                                       <xsl:when test="editable">
-                                               <select id="control_area_id" 
name="control_area_id">
-                                                       <xsl:for-each 
select="control_areas_array">
-                                                               <xsl:choose>
-                                                                       
<xsl:when test="id != $control_area_id">
-                                                                               
<option value="{id}">
-                                                                               
        <xsl:value-of disable-output-escaping="yes" select="title"/>
-                                                                               
</option>
-                                                                       
</xsl:when>
-                                                                       
<xsl:otherwise>
-                                                                               
<option value="{id}" selected="selected">
-                                                                               
        <xsl:value-of disable-output-escaping="yes" select="title"/>
-                                                                               
</option>
-                                                                       
</xsl:otherwise>
-                                                               </xsl:choose>   
                                                        
-                                                       </xsl:for-each>
-                                               </select>
-                                               <select id="control_area_id" 
name="control_area_id">
-                                                       <xsl:apply-templates 
select="control_areas_array2/options"/>
-                                               </select>
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                               <xsl:value-of 
select="control/control_area_name" />
-                                       </xsl:otherwise>
-                               </xsl:choose>
-                               </dd>
-                               <dt>
-                                       <label>Prosedyre</label>
-                               </dt>
-                               <dd>
-                               <xsl:choose>
-                                       <xsl:when test="editable">
-                                               <select id="procedure_id" 
name="procedure_id">
-                                                       <xsl:for-each 
select="procedures_array">
-                                                               <xsl:choose>
-                                                                       
<xsl:when test="id != $control_procedure_id">
-                                                                               
<option value="{id}">
-                                                                               
        <xsl:value-of disable-output-escaping="yes" select="title"/>
-                                                                               
</option>
-                                                                       
</xsl:when>
-                                                                       
<xsl:otherwise>
-                                                                               
<option value="{id}" selected="selected">
-                                                                               
        <xsl:value-of disable-output-escaping="yes" select="title"/>
-                                                                               
</option>
-                                                                       
</xsl:otherwise>
-                                                               </xsl:choose>   
                                                        
-                                                       </xsl:for-each>
-                                               </select>
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                               <xsl:value-of 
select="control/procedure_name" />
-                                       </xsl:otherwise>
-                               </xsl:choose>
-                               </dd>
-                               <dt>
-                                       <label for="title">Tittel</label>
-                               </dt>
-                               <dd>
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <input type="text" 
name="title" id="title" value="{control/title}" size="80"/>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:value-of 
select="control/title" />
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                               </dd>
-                               <dt>
-                                       <label 
for="start_date">Startdato</label>
-                               </dt>
-                               <dd>
-                                       <input>
-                                     <xsl:attribute 
name="id">start_date</xsl:attribute>
-                                     <xsl:attribute 
name="name">start_date</xsl:attribute>
-                                     <xsl:attribute 
name="type">text</xsl:attribute>
-                                     <xsl:if test="control/start_date != ''">
-                                       <xsl:attribute 
name="value"><xsl:value-of select="php:function('date', $date_format, 
number(control/start_date))"/></xsl:attribute>
-                                     </xsl:if>
-                                   </input>
-                               </dd>
-                               <dt>
-                                       <label for="end_date">Sluttdato</label>
-                               </dt>
-                               <dd>
-                                       <input>
-                                     <xsl:attribute 
name="id">end_date</xsl:attribute>
-                                     <xsl:attribute 
name="name">end_date</xsl:attribute>
-                                     <xsl:attribute 
name="type">text</xsl:attribute>
-                                     <xsl:if test="control/end_date != 0">
-                                       <xsl:attribute 
name="value"><xsl:value-of select="php:function('date', $date_format, 
number(control/end_date))"/></xsl:attribute>
-                                     </xsl:if>
-                                   </input>
-                               </dd>
-                               <dt>
-                                       <label>Frekvenstype</label>
-                               </dt>
-                               <dd>
-                                       <select id="repeat_type" 
name="repeat_type">
-                                               <option value="0">Ikke 
angitt</option>
-                                               <option value="1">Dag</option>
-                                               <option value="2">Uke</option>
-                                               <option value="3">Måned</option>
-                                               <option value="5">År</option>
-                                       </select>
-                               </dd>
-                               <dt>
-                                       <label>Frekvens</label>
-                               </dt>
-                               <dd>
-                               <xsl:choose>
-                                       <xsl:when test="editable">
-                                               <input size="2" type="text" 
name="repeat_interval" value="{control/repeat_interval}" />
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                               <xsl:value-of 
select="control/repeat_interval" />
-                                       </xsl:otherwise>
-                               </xsl:choose>
-                               </dd>
-                               <dt>
-                                       <label>Rolle</label>
-                               </dt>
-                               <dd>
-                               <xsl:choose>
-                                       <xsl:when test="editable">
-                                               <select id="responsibility_id" 
name="responsibility_id">
-                                                       <xsl:for-each 
select="role_array">
-                                                               <option 
value="{id}">
-                                                                       
<xsl:value-of disable-output-escaping="yes" select="name"/>
-                                                               </option>
-                                                       </xsl:for-each>
-                                               </select>
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                               <xsl:value-of 
select="control/role_name" />
-                                       </xsl:otherwise>
-                               </xsl:choose>
-                               </dd>
-                               <dt>
-                                       <label 
for="description">Beskrivelse</label>
-                               </dt>
-                               <dd>
-                               <xsl:choose>
-                                       <xsl:when test="editable">
-                                               <textarea cols="70" rows="5" 
name="description" id="description"><xsl:value-of select="control/description" 
/></textarea>
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                               <xsl:value-of 
select="control/description" disable-output-escaping="yes"/>
-                                       </xsl:otherwise>
-                               </xsl:choose>
-                               </dd>
-                       </dl>
-       </fieldset>
-
-       </div>
 </div>
 </xsl:template>

Copied: 
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_items.xsl
 (from rev 8522, 
trunk/controller/templates/base/check_list/view_control_items.xsl)
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_items.xsl
                             (rev 0)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_items.xsl
     2012-01-08 13:23:14 UTC (rev 8524)
@@ -0,0 +1,58 @@
+<!-- $Id: choose_control_items.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
+
+<xsl:template match="view_control_items">
+
+<ul class="groups">
+       <xsl:for-each select="saved_groups_with_items_array">
+               <li class="drag_group list_item">
+                       <h3><span class="group_order_nr"><xsl:number/></span>. 
<xsl:value-of select="control_group/group_name"/></h3>
+       
+                       <form 
action="index.php?menuaction=controller.uicontrol_item.save_item_order" 
class="frm_save_order">
+                               <xsl:variable 
name="control_group_id"><xsl:value-of select="control_group/id"/></xsl:variable>
+                               <input type="hidden" name="control_group_id" 
value="{$control_group_id}" />
+               
+                               <ul id="list">
+                                       <xsl:for-each select="control_items">
+                                               <xsl:variable 
name="control_item_id"><xsl:value-of select="id"/></xsl:variable>
+                                               <xsl:variable name="order_tag">
+                                                       <xsl:choose>
+                                                               <xsl:when 
test="order_nr > 0">
+                                                                       
<xsl:value-of select="order_nr"/>
+                                                               </xsl:when>
+                                                               <xsl:otherwise>
+                                                                       
<xsl:number/>
+                                                               </xsl:otherwise>
+                                                       
</xsl:choose>:<xsl:value-of select="id"/>
+                                               </xsl:variable>
+                                                                               
                                
+                                               <li class="list_item">
+                                                       <span class="drag">
+                                                               <span 
class="order_nr"><xsl:number/></span>. <xsl:value-of select="title"/><input 
type="hidden" name="order_nr[]" value="{$order_tag}" />
+                                                       </span>
+                                                       <a class="delete">
+                                                               <xsl:attribute 
name="href">
+                                                                       
<xsl:text>index.php?menuaction=controller.uicontrol_item.delete_item_list</xsl:text>
+                                                                       
<xsl:text>&amp;control_id=</xsl:text>
+                                                                       
<xsl:value-of select="//control_id"/>
+                                                                       
<xsl:text>&amp;control_item_id=</xsl:text>
+                                                                       
<xsl:value-of select="id"/>
+                                                               </xsl:attribute>
+                                                               <span>x</span>
+                                                       </a>
+                                               </li>
+                                       </xsl:for-each>
+                               </ul>
+                       </form>
+               </li>
+       </xsl:for-each>
+</ul>
+<a style="margin-top:20px;" id="print_control_items" class="btn" 
target="_blank">
+       <xsl:attribute name="href">
+               
<xsl:text>index.php?menuaction=controller.uicheck_list.print_check_list</xsl:text>
+               <xsl:text>&amp;check_list_id=</xsl:text>
+               <xsl:value-of select="check_list/id"/>
+       </xsl:attribute>
+       Skriv ut
+</a>
+
+</xsl:template>

Copied: 
branches/Version-1_0-branch/controller/templates/base/check_list/view_errors_for_check_list.xsl
 (from rev 8522, 
trunk/controller/templates/base/check_list/view_errors_for_check_list.xsl)
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/view_errors_for_check_list.xsl
                             (rev 0)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/view_errors_for_check_list.xsl
     2012-01-08 13:23:14 UTC (rev 8524)
@@ -0,0 +1,106 @@
+<!-- $Id: edit_check_list.xsl 8513 2012-01-07 10:38:09Z vator $ -->
+<xsl:template match="data" name="view_check_list" 
xmlns:php="http://php.net/xsl";>
+<xsl:variable name="date_format">d/m-Y</xsl:variable>
+
+<div id="main_content">
+               
+       <script>
+       
+               $(document).ready(function() {
+                               var requestUrl = 
$("#view_open_errors").attr("href");
+                               load_tab(requestUrl);
+                       });
+                       
+               $(function() {
+                                       
+                       $("#register_errors").live("click", function(){
+                               var requestUrl = $(this).attr("href");
+                               load_tab(requestUrl);
+                       
+                               return false;
+                       });
+                                               
+                       $("#view_open_errors").live("click", function(){
+                               var requestUrl = $(this).attr("href");
+                               load_tab(requestUrl);
+                       
+                               return false;
+                       });
+                       
+                       $("#view_closed_errors").live("click", function(){
+                               var requestUrl = $(this).attr("href");
+                               load_tab(requestUrl);
+                       
+                               return false;
+                       });
+                       
+                       $("#view_measurements").live("click", function(){
+                               var requestUrl = $(this).attr("href");
+                               load_tab(requestUrl);
+                       
+                               return false;
+                       });
+               });
+
+               function load_tab(requestUrl){
+                       $.ajax({
+                                 type: 'POST',
+                                 url: requestUrl,
+                                 success: function(data) {
+                                       $("#load_view_content").html(data);
+                                 }
+                       });
+               }
+       </script>
+               
+               <h1>Sjekkliste for <xsl:value-of 
select="location_array/loc1_name"/></h1>
+               
+               <div id="edit_check_list_menu" class="hor_menu">
+                       <a>
+                               <xsl:attribute name="href">
+                                       
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.edit_check_list_for_location</xsl:text>
+                                       <xsl:text>&amp;check_list_id=</xsl:text>
+                                       <xsl:value-of select="check_list/id"/>
+                               </xsl:attribute>
+                               Vis detaljer for sjekkliste
+                       </a>
+                       <a class="active">
+                               <xsl:attribute name="href">
+                                       
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.view_errors_for_check_list</xsl:text>
+                                       <xsl:text>&amp;check_list_id=</xsl:text>
+                                       <xsl:value-of select="check_list/id"/>
+                               </xsl:attribute>
+                               Vis avvik/saker for sjekkliste
+                       </a>                    
+                       <a>
+                               <xsl:attribute name="href">
+                                       
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.view_control_info</xsl:text>
+                                       <xsl:text>&amp;check_list_id=</xsl:text>
+                                       <xsl:value-of select="check_list/id"/>
+                               </xsl:attribute>
+                               Vis info om kontroll
+                       </a>
+                       
+                       <a style="background:#DD624B;border-bottom: 1px solid 
#CB563F;border-top: 1px solid #EE836F;box-shadow: 0 1px 0 #A9422E, 0 -1px 0 
#A9422E;color: #FFFFFF;height: 18px;margin-left: 40px;margin-top: 1px;">
+                               <xsl:attribute name="href">
+                                       
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.register_error</xsl:text>
+                                       <xsl:text>&amp;check_list_id=</xsl:text>
+                                       <xsl:value-of select="check_list/id"/>
+                               </xsl:attribute>
+                               Registrer avvik/sak
+                       </a>
+               </div>
+               
+               
+               <a style="display:none;" id="view_open_errors">
+                       <xsl:attribute name="href">
+                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_open_errors</xsl:text>
+                               <xsl:text>&amp;check_list_id=</xsl:text>
+                               <xsl:value-of select="check_list/id"/>
+                               
<xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
+                       </xsl:attribute>
+               </a>
+       
+               <div id="load_view_content"></div>      
+</div>
+</xsl:template>

Copied: 
branches/Version-1_0-branch/controller/templates/base/check_list/view_measurements.xsl
 (from rev 8522, 
trunk/controller/templates/base/check_list/view_measurements.xsl)
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/view_measurements.xsl
                              (rev 0)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/view_measurements.xsl
      2012-01-08 13:23:14 UTC (rev 8524)
@@ -0,0 +1,106 @@
+<!-- $Id: choose_control_items.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
+
+<xsl:template match="view_measurements">
+
+<div id="error_message_menu">
+       <a class="btn" id="register_errors">                                    
+               <xsl:attribute name="href">
+                       
<xsl:text>index.php?menuaction=controller.uicheck_list.register_errors</xsl:text>
+                       <xsl:text>&amp;check_list_id=</xsl:text>
+                       <xsl:value-of select="check_list/id"/>
+               </xsl:attribute>
+               Registrer sak/måling
+       </a>
+       <a class="btn">
+               <xsl:attribute name="href">
+                       
<xsl:text>index.php?menuaction=controller.uierror_report_message.create_error_report_message</xsl:text>
+                       <xsl:text>&amp;check_list_id=</xsl:text>
+                       <xsl:value-of select="check_list/id"/>
+               </xsl:attribute>
+               Registrer avviksmelding
+       </a>
+</div>
+       
+<div id="view_errors">
+       
+       <div class="tab_menu">
+               <a id="view_open_errors">                                       
+                       <xsl:attribute name="href">
+                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_open_errors</xsl:text>
+                               <xsl:text>&amp;check_list_id=</xsl:text>
+                               <xsl:value-of select="check_list/id"/>
+                               
<xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
+                       </xsl:attribute>
+                       Vis åpne saker
+               </a>
+               <a id="view_closed_errors">                                     
+                       <xsl:attribute name="href">
+                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_closed_errors</xsl:text>
+                               <xsl:text>&amp;check_list_id=</xsl:text>
+                               <xsl:value-of select="check_list/id"/>
+                       </xsl:attribute>
+                       Vis lukkede saker
+               </a>
+               <a class="active" id="view_measurements">                       
                
+                       <xsl:attribute name="href">
+                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_measurements</xsl:text>
+                               <xsl:text>&amp;check_list_id=</xsl:text>
+                               <xsl:value-of select="check_list/id"/>
+                               
<xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
+                       </xsl:attribute>
+                       Vis målinger
+               </a>
+       </div>  
+       
+       <div class="tab_item">
+               <xsl:choose>
+                       <xsl:when test="measurement_check_items/child::node()">
+                               
+                       <div class="expand_menu"><div class="expand_all">Vis 
alle</div><div class="collapse_all focus">Skjul alle</div></div>
+               
+                               <ul id="check_list_not_fixed_list" 
class="check_items expand_list">
+                                       <xsl:for-each 
select="measurement_check_items">
+                                                       <li>
+                                                       <xsl:if test="status = 
0">
+                                                               <h4><img 
src="controller/images/arrow_right.png" width="14"/><span><xsl:value-of 
select="control_item/title"/></span></h4>                                       
       
+                                                               <form 
class="frm_save_check_item" 
action="index.php?menuaction=controller.uicheck_list.save_check_item" 
method="post">
+                                                                       
<xsl:variable name="check_item_id"><xsl:value-of select="id"/></xsl:variable>
+                                                                       <input 
type="hidden" name="check_item_id" value="{$check_item_id}" />
+                                                                       <input 
type="hidden" name="type" value="measurement" />
+                                                                        
+                                                                       <div 
class="check_item">
+                                                                         <div>
+                                                                              
<label>Målingsverdi</label>
+                                                                              
<input>
+                                                                               
      <xsl:attribute name="name">measurement</xsl:attribute>
+                                                                               
      <xsl:attribute name="type">text</xsl:attribute>
+                                                                               
      <xsl:attribute name="value">
+                                                                               
        <xsl:value-of select="measurement"/>
+                                                                               
      </xsl:attribute>
+                                                                               
    </input>
+                                                                      </div>
+                                                                      
+                                                                      <div>
+                                                                        <label 
class="comment">Kommentar</label>
+                                                                        
<textarea name="comment">
+                                                                               
        <xsl:value-of select="comment"/>
+                                                                               
 </textarea>
+                                                                      </div>
+                                                                      <div 
class="form-buttons">
+                                                                               
        <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save_check_item')" /></xsl:variable>
+                                                                               
        <input type="submit" name="save_control" value="Oppdatert registert 
måling" class="not_active" title="{$lang_save}" />
+                                                                               
</div>
+                                                                       </div>
+                                                               </form>
+                                                       </xsl:if>
+                                           </li>
+                                       </xsl:for-each>
+                               </ul>                   
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       Ingen registrerte målinger
+                               </xsl:otherwise>
+               </xsl:choose>
+       </div>
+</div>
+</xsl:template>

Copied: 
branches/Version-1_0-branch/controller/templates/base/check_list/view_open_errors.xsl
 (from rev 8522, 
trunk/controller/templates/base/check_list/view_open_errors.xsl)
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/view_open_errors.xsl
                               (rev 0)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/view_open_errors.xsl
       2012-01-08 13:23:14 UTC (rev 8524)
@@ -0,0 +1,108 @@
+<!-- $Id: choose_control_items.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
+
+<xsl:template match="view_open_errors" xmlns:php="http://php.net/xsl";>
+
+<div id="error_message_menu">
+       <a class="btn" id="register_errors">                                    
+               <xsl:attribute name="href">
+                       
<xsl:text>index.php?menuaction=controller.uicheck_list.register_errors</xsl:text>
+                       <xsl:text>&amp;check_list_id=</xsl:text>
+                       <xsl:value-of select="check_list/id"/>
+               </xsl:attribute>
+               Registrer sak/måling
+       </a>
+       <a class="btn">
+               <xsl:attribute name="href">
+                       
<xsl:text>index.php?menuaction=controller.uierror_report_message.create_error_report_message</xsl:text>
+                       <xsl:text>&amp;check_list_id=</xsl:text>
+                       <xsl:value-of select="check_list/id"/>
+               </xsl:attribute>
+               Registrer avviksmelding
+       </a>
+</div>
+       
+<div id="view_errors">
+       
+       <div class="tab_menu">
+               <a class="active" id="view_open_errors">                        
                
+                       <xsl:attribute name="href">
+                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_open_errors</xsl:text>
+                               <xsl:text>&amp;check_list_id=</xsl:text>
+                               <xsl:value-of select="check_list/id"/>
+                               
<xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
+                       </xsl:attribute>
+                       Vis åpne saker
+               </a>
+               <a id="view_closed_errors">                                     
+                       <xsl:attribute name="href">
+                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_closed_errors</xsl:text>
+                               <xsl:text>&amp;check_list_id=</xsl:text>
+                               <xsl:value-of select="check_list/id"/>
+                       </xsl:attribute>
+                       Vis lukkede saker
+               </a>
+               <a id="view_measurements">                                      
+                       <xsl:attribute name="href">
+                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_measurements</xsl:text>
+                               <xsl:text>&amp;check_list_id=</xsl:text>
+                               <xsl:value-of select="check_list/id"/>
+                               
<xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
+                       </xsl:attribute>
+                       Vis målinger
+               </a>
+       </div>  
+       
+       <div class="tab_item active">
+               <xsl:choose>
+                       <xsl:when test="open_check_items/child::node()">
+                               
+                       <div class="expand_menu"><div class="expand_all">Vis 
alle</div><div class="collapse_all focus">Skjul alle</div></div>
+               
+                               <ul id="check_list_not_fixed_list" 
class="check_items expand_list">
+                                       <xsl:for-each select="open_check_items">
+                                                       <li>
+                                                       <xsl:if test="status = 
0">
+                                                               <h4><img 
src="controller/images/arrow_right.png" width="14"/><span><xsl:value-of 
select="control_item/title"/></span></h4>                                       
       
+                                                               <form 
id="frm_save_check_item" 
action="index.php?menuaction=controller.uicheck_list.save_check_item" 
method="post">
+                                                                       
<xsl:variable name="check_item_id"><xsl:value-of select="id"/></xsl:variable>
+                                                                       <input 
type="hidden" name="check_item_id" value="{$check_item_id}" /> 
+                                                                       <div 
class="check_item">
+                                                                         <div>
+                                                                              
<label>Status</label>
+                                                                              
<select name="status">
+                                                                               
        <xsl:choose>
+                                                                               
                <xsl:when test="status = 0">
+                                                                               
                        <option value="0" SELECTED="SELECTED">Avvik er 
åpent</option>
+                                                                               
                        <option value="1">Avvik er håndtert</option>
+                                                                               
                </xsl:when>
+                                                                               
                <xsl:when test="status = 1">
+                                                                               
                        <option value="0">Avvik er åpent</option>
+                                                                               
                        <option value="1" SELECTED="SELECTED">Avvik er 
håndtert</option>
+                                                                               
                </xsl:when>
+                                                                               
        </xsl:choose>
+                                                                               
   </select>
+                                                                      </div>
+                                                                      <div>
+                                                                        <label 
class="comment">Kommentar</label>
+                                                                        
<textarea name="comment">
+                                                                               
        <xsl:value-of select="comment"/>
+                                                                               
 </textarea>
+                                                                      </div>
+                                                                      <div 
class="form-buttons">
+                                                                               
        <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save_check_item')" /></xsl:variable>
+                                                                               
        <input style="width: 200px;" type="submit" name="save_control" 
value="Oppdater registrert avvik" class="not_active" title="{$lang_save}" />
+                                                                               
</div>
+                                                                       </div>
+                                                               </form>
+                                                       </xsl:if>
+                                           </li>
+                                       </xsl:for-each>
+                               </ul>                   
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       Ingen registrerte åpne avvik
+                               </xsl:otherwise>
+               </xsl:choose>
+       </div>
+</div>
+</xsl:template>

Deleted: 
branches/Version-1_0-branch/controller/templates/base/control/view_control_details.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/control/view_control_details.xsl
      2012-01-08 13:21:05 UTC (rev 8523)
+++ 
branches/Version-1_0-branch/controller/templates/base/control/view_control_details.xsl
      2012-01-08 13:23:14 UTC (rev 8524)
@@ -1,146 +0,0 @@
-<!-- $Id: choose_control_items.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
-
-<xsl:template match="view_control_details">
-
-       <dl class="proplist-col">
-               <dt>
-                       <label>Kontrollområde</label>
-               </dt>
-               <dd>
-               <xsl:choose>
-                       <xsl:when test="editable">
-                               <select id="control_area_id" 
name="control_area_id">
-                                       <xsl:apply-templates 
select="control_areas_array2/options"/>
-                               </select>
-                       </xsl:when>
-                       <xsl:otherwise>
-                               <xsl:value-of 
select="control/control_area_name" />
-                       </xsl:otherwise>
-               </xsl:choose>
-               </dd>
-               <dt>
-                       <label>Prosedyre</label>
-               </dt>
-               <dd>
-               <xsl:choose>
-                       <xsl:when test="editable">
-                               <select id="procedure_id" name="procedure_id">
-                                       <xsl:for-each select="procedures_array">
-                                               <xsl:choose>
-                                                       <xsl:when test="id != 
$control_procedure_id">
-                                                               <option 
value="{id}">
-                                                                       
<xsl:value-of disable-output-escaping="yes" select="title"/>
-                                                               </option>
-                                                       </xsl:when>
-                                                       <xsl:otherwise>
-                                                               <option 
value="{id}" selected="selected">
-                                                                       
<xsl:value-of disable-output-escaping="yes" select="title"/>
-                                                               </option>
-                                                       </xsl:otherwise>
-                                               </xsl:choose>                   
                                        
-                                       </xsl:for-each>
-                               </select>
-                       </xsl:when>
-                       <xsl:otherwise>
-                               <xsl:value-of select="control/procedure_name" />
-                       </xsl:otherwise>
-               </xsl:choose>
-               </dd>
-               <dt>
-                       <label for="title">Tittel</label>
-               </dt>
-               <dd>
-                       <xsl:choose>
-                               <xsl:when test="editable">
-                                       <input type="text" name="title" 
id="title" value="{control/title}" size="80"/>
-                               </xsl:when>
-                               <xsl:otherwise>
-                                       <xsl:value-of select="control/title" />
-                               </xsl:otherwise>
-                       </xsl:choose>
-               </dd>
-               <dt>
-                       <label for="start_date">Startdato</label>
-               </dt>
-               <dd>
-                       <input>
-                     <xsl:attribute name="id">start_date</xsl:attribute>
-                     <xsl:attribute name="name">start_date</xsl:attribute>
-                     <xsl:attribute name="type">text</xsl:attribute>
-                     <xsl:if test="control/start_date != ''">
-                       <xsl:attribute name="value"><xsl:value-of 
select="php:function('date', $date_format, 
number(control/start_date))"/></xsl:attribute>
-                     </xsl:if>
-                   </input>
-               </dd>
-               <dt>
-                       <label for="end_date">Sluttdato</label>
-               </dt>
-               <dd>
-                       <input>
-                     <xsl:attribute name="id">end_date</xsl:attribute>
-                     <xsl:attribute name="name">end_date</xsl:attribute>
-                     <xsl:attribute name="type">text</xsl:attribute>
-                     <xsl:if test="control/end_date != 0">
-                       <xsl:attribute name="value"><xsl:value-of 
select="php:function('date', $date_format, 
number(control/end_date))"/></xsl:attribute>
-                     </xsl:if>
-                   </input>
-               </dd>
-               <dt>
-                       <label>Frekvenstype</label>
-               </dt>
-               <dd>
-                       <select id="repeat_type" name="repeat_type">
-                               <option value="0">Ikke angitt</option>
-                               <option value="1">Dag</option>
-                               <option value="2">Uke</option>
-                               <option value="3">Måned</option>
-                               <option value="5">År</option>
-                       </select>
-               </dd>
-               <dt>
-                       <label>Frekvens</label>
-               </dt>
-               <dd>
-               <xsl:choose>
-                       <xsl:when test="editable">
-                               <input size="2" type="text" 
name="repeat_interval" value="{control/repeat_interval}" />
-                       </xsl:when>
-                       <xsl:otherwise>
-                               <xsl:value-of select="control/repeat_interval" 
/>
-                       </xsl:otherwise>
-               </xsl:choose>
-               </dd>
-               <dt>
-                       <label>Rolle</label>
-               </dt>
-               <dd>
-               <xsl:choose>
-                       <xsl:when test="editable">
-                               <select id="responsibility_id" 
name="responsibility_id">
-                                       <xsl:for-each select="role_array">
-                                               <option value="{id}">
-                                                       <xsl:value-of 
disable-output-escaping="yes" select="name"/>
-                                               </option>
-                                       </xsl:for-each>
-                               </select>
-                       </xsl:when>
-                       <xsl:otherwise>
-                               <xsl:value-of select="control/role_name" />
-                       </xsl:otherwise>
-               </xsl:choose>
-               </dd>
-               <dt>
-                       <label for="description">Beskrivelse</label>
-               </dt>
-               <dd>
-               <xsl:choose>
-                       <xsl:when test="editable">
-                               <textarea cols="70" rows="5" name="description" 
id="description"><xsl:value-of select="control/description" /></textarea>
-                       </xsl:when>
-                       <xsl:otherwise>
-                               <xsl:value-of select="control/description" 
disable-output-escaping="yes"/>
-                       </xsl:otherwise>
-               </xsl:choose>
-               </dd>
-       </dl>
-</xsl:template>

Deleted: 
branches/Version-1_0-branch/controller/templates/base/control_item/view_control_items.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/control_item/view_control_items.xsl
   2012-01-08 13:21:05 UTC (rev 8523)
+++ 
branches/Version-1_0-branch/controller/templates/base/control_item/view_control_items.xsl
   2012-01-08 13:23:14 UTC (rev 8524)
@@ -1,57 +0,0 @@
-<!-- $Id: choose_control_items.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
-
-<xsl:template match="view_control_items">
-
-<ul class="groups">
-       <xsl:for-each select="saved_groups_with_items_array">
-               <li class="drag_group list_item">
-                       <h3><span class="group_order_nr"><xsl:number/></span>. 
<xsl:value-of select="control_group/group_name"/></h3>
-       
-                       <form 
action="index.php?menuaction=controller.uicontrol_item.save_item_order" 
class="frm_save_order">
-                               <xsl:variable 
name="control_group_id"><xsl:value-of select="control_group/id"/></xsl:variable>
-                               <input type="hidden" name="control_group_id" 
value="{$control_group_id}" />
-               
-                               <ul id="list">
-                                       <xsl:for-each select="control_items">
-                                               <xsl:variable 
name="control_item_id"><xsl:value-of select="id"/></xsl:variable>
-                                               <xsl:variable name="order_tag">
-                                                       <xsl:choose>
-                                                               <xsl:when 
test="order_nr > 0">
-                                                                       
<xsl:value-of select="order_nr"/>
-                                                               </xsl:when>
-                                                               <xsl:otherwise>
-                                                                       
<xsl:number/>
-                                                               </xsl:otherwise>
-                                                       
</xsl:choose>:<xsl:value-of select="id"/>
-                                               </xsl:variable>
-                                                                               
                                
-                                               <li class="list_item">
-                                                       <span class="drag">
-                                                               <span 
class="order_nr"><xsl:number/></span>. <xsl:value-of select="title"/><input 
type="hidden" name="order_nr[]" value="{$order_tag}" />
-                                                       </span>
-                                                       <a class="delete">
-                                                               <xsl:attribute 
name="href">
-                                                                       
<xsl:text>index.php?menuaction=controller.uicontrol_item.delete_item_list</xsl:text>
-                                                                       
<xsl:text>&amp;control_id=</xsl:text>
-                                                                       
<xsl:value-of select="//control_id"/>
-                                                                       
<xsl:text>&amp;control_item_id=</xsl:text>
-                                                                       
<xsl:value-of select="id"/>
-                                                               </xsl:attribute>
-                                                               <span>x</span>
-                                                       </a>
-                                               </li>
-                                       </xsl:for-each>
-                               </ul>
-                               <div>
-                                       <xsl:variable 
name="lang_save"><xsl:value-of select="php:function('lang', 'save_order')" 
/></xsl:variable>
-                                       <input type="submit" id="save_order" 
name="save_order" value="{$lang_save}" title = "{$lang_save}" style="opacity: 
0.5;" disabled="disabled"/>
-                               </div>
-                       </form>
-               </li>
-       </xsl:for-each>
-</ul>
-
-
-
-
-</xsl:template>

Modified: branches/Version-1_0-branch/controller/templates/base/css/base.css
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/css/base.css  
2012-01-08 13:21:05 UTC (rev 8523)
+++ branches/Version-1_0-branch/controller/templates/base/css/base.css  
2012-01-08 13:23:14 UTC (rev 8524)
@@ -1060,7 +1060,6 @@
 .tab_item {
     background: none repeat scroll 0 0 #EDF5FF;
     border: 1px solid #A3A3A3;
-    display: none;
     margin: 0 318px 0 0;
     padding: 15px;
     width: 628px;
@@ -1086,12 +1085,12 @@
        margin:10px 0;
 }
 ul#icon_color_map {
-    background: none repeat scroll 0 0 #EDF5FF;
     border: 1px solid #DDDDDD;
     float: right;
     margin-left: 500px;
     margin-right: 10px;
     padding: 5px;
+    margin-top: 55px;
 }
 ul#icon_color_map li {
     font-size: 12px;
@@ -1164,20 +1163,17 @@
        float:left;
     margin: 20px 0 0 10px;   
 }
-#register_errors {
-       display:none;
+#register_errors_content {
     float: right;
     margin-top: 20px;   
 }
-
-a#view_errors_measurements{
-       display:none;
+#edit_check_list_menu a {
+    float: left;
+    height: 20px;
+    padding-top: 10px;
+    text-align: center;
+    width: 185px;
 }
-#edit_check_list_menu a{
-               float:left;
-               width: 150px;
-               text-align:center;
-}
 #edit_check_list_menu{
                height:30px;
                margin:0 0 20px 0;

Copied: 
branches/Version-1_0-branch/controller/templates/base/procedure/print_procedure.xsl
 (from rev 8522, trunk/controller/templates/base/procedure/print_procedure.xsl)
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/procedure/print_procedure.xsl
                         (rev 0)
+++ 
branches/Version-1_0-branch/controller/templates/base/procedure/print_procedure.xsl
 2012-01-08 13:23:14 UTC (rev 8524)
@@ -0,0 +1,191 @@
+<!-- $Id: procedure_item.xsl 8503 2012-01-06 08:13:27Z erikhl $ -->
+<!-- item  -->
+
+<xsl:template match="print_procedure" xmlns:php="http://php.net/xsl";>
+<xsl:variable name="dateformat"><xsl:value-of select="dateformat" 
/></xsl:variable>
+
+<div style="margin:40px 0 0 40px;">
+               <dl class="proplist-col">
+                       <dt>
+                               <label for="title"><xsl:value-of 
select="php:function('lang','Procedure title')" /></label>
+                       </dt>
+                       <dd>
+                       <xsl:choose>
+                               <xsl:when test="editable">
+                                       <input type="text" name="title" 
id="title" value="{procedure/title}" size="100"/>
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       <xsl:value-of select="procedure/title" 
/>
+                               </xsl:otherwise>
+                       </xsl:choose>
+                       </dd>
+                       <dt>
+                               <label for="revision_no"><xsl:value-of 
select="php:function('lang','Procedure revision')" /></label>
+                       </dt>
+                       <dd>
+                               <xsl:value-of select="procedure/revision_no" />
+                       </dd>
+                       <dt>
+                               <label for="control_area"><xsl:value-of 
select="php:function('lang','Control area')" /></label>
+                       </dt>
+                       <dd>
+                       <xsl:choose>
+                               <xsl:when test="editable">
+                                       <select id="control_area" 
name="control_area">
+                                               <xsl:apply-templates 
select="control_area/options"/>
+                                       </select>
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       <xsl:value-of 
select="procedure/control_area_name" />
+                               </xsl:otherwise>
+                       </xsl:choose>
+                       </dd>
+                       <dt>
+                               <label for="start_date"><xsl:value-of 
select="php:function('lang','Procedure start date')" /></label>
+                       </dt>
+                       <dd>
+                       <xsl:choose>
+                               <xsl:when test="editable">
+                                       <xsl:value-of 
disable-output-escaping="yes" select="start_date"/>
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       <xsl:variable 
name="startdate"><xsl:value-of select="procedure/start_date" /></xsl:variable>
+                                       <xsl:value-of 
select="php:function('date', $dateformat, $startdate)" />
+                               </xsl:otherwise>
+                       </xsl:choose>
+                       </dd>
+                       <dt>
+                               <label for="revision_date"><xsl:value-of 
select="php:function('lang','Procedure revision date')" /></label>
+                       </dt>
+                       <dd>
+                       <xsl:choose>
+                               <xsl:when test="editable">
+                                       <xsl:value-of 
disable-output-escaping="yes" select="revision_date"/>
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       <xsl:if test="procedure/revision_date 
!= 0">
+                                               <xsl:variable 
name="revisiondate"><xsl:value-of select="procedure/revision_date" 
/></xsl:variable>
+                                               <xsl:value-of 
select="php:function('date', $dateformat, $revisiondate)" />
+                                       </xsl:if>
+                               </xsl:otherwise>
+                       </xsl:choose>
+                       </dd>
+                       <xsl:if test="procedure/end_date != 0">
+                       <dt>
+                               <label for="end_date"><xsl:value-of 
select="php:function('lang','Procedure end date')" /></label>
+                       </dt>
+                       <dd>
+                       <xsl:choose>
+                               <xsl:when test="editable">
+                                       <xsl:value-of 
disable-output-escaping="yes" select="end_date"/>
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       <xsl:variable 
name="enddate"><xsl:value-of select="procedure/end_date" /></xsl:variable>
+                                       <xsl:value-of 
select="php:function('date', $dateformat, $enddate)" />
+                               </xsl:otherwise>
+                       </xsl:choose>
+                       </dd>
+                       </xsl:if>
+                       <dt>
+                               <label for="purpose"><xsl:value-of 
select="php:function('lang','Procedure purpose')" /></label>
+                       </dt>
+                       <dd>
+                       <xsl:choose>
+                               <xsl:when test="editable">
+                                       <textarea id="purpose" name="purpose" 
rows="5" cols="60"><xsl:value-of select="procedure/purpose" 
disable-output-escaping="yes"/></textarea>
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       <xsl:value-of 
select="procedure/purpose" disable-output-escaping="yes"/>
+                               </xsl:otherwise>
+                       </xsl:choose>
+                       </dd>
+                       <dt>
+                               <label for="responsibility"><xsl:value-of 
select="php:function('lang','Procedure responsibility')" /></label>
+                       </dt>
+                       <dd>
+                       <xsl:choose>
+                               <xsl:when test="editable">
+                                       <textarea id="responsibility" 
name="responsibility" rows="5" cols="60"><xsl:value-of 
select="procedure/responsibility" /></textarea>
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       <xsl:value-of 
select="procedure/responsibility" />
+                               </xsl:otherwise>
+                       </xsl:choose>
+                       </dd>
+                       <dt>
+                               <label for="description"><xsl:value-of 
select="php:function('lang','Procedure description')" /></label>
+                       </dt>
+                       <dd>
+                       <xsl:choose>
+                               <xsl:when test="editable">
+                                       <textarea id="description" 
name="description" rows="5" cols="60"><xsl:value-of 
select="procedure/description" disable-output-escaping="yes"/></textarea>
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       <xsl:value-of 
select="procedure/description" disable-output-escaping="yes"/>
+                               </xsl:otherwise>
+                       </xsl:choose>
+                       </dd>
+                       <dt>
+                               <label for="reference"><xsl:value-of 
select="php:function('lang','Procedure Reference')" /></label>
+                       </dt>
+                       <dd>
+                       <xsl:choose>
+                               <xsl:when test="editable">
+                                       <input type="text" name="reference" 
id="reference" value="{procedure/reference}"  />
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       <xsl:value-of 
select="procedure/reference" />
+                               </xsl:otherwise>
+                       </xsl:choose>
+                       </dd>   
+                       <dt>
+                       <label for="attachment"><xsl:value-of 
select="php:function('lang','Procedure Attachment')" /></label>
+                       </dt>
+                       <dd>
+                       <xsl:choose>
+                               <xsl:when test="editable">
+                                       <input type="text" name="attachment" 
id="attachment" value="{procedure/attachment}"  />
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       <xsl:value-of 
select="procedure/attachment" />
+                               </xsl:otherwise>
+                       </xsl:choose>
+                       </dd>                   
+               </dl>           
+</div>
+<style>
+               .btn{
+                       background: none repeat scroll 0 0 #2647A0;
+                   color: #FFFFFF;
+                   display: inline-block;
+                   margin-right: 5px;
+                   padding: 5px 10px;
+                   text-decoration: none;
+                   border: 1px solid #173073;
+                   cursor: pointer;
+               }
+               
+               ul{
+                       list-style: none outside none;
+               }
+               
+               li{
+                       list-style: none outside none;
+               }
+               
+               ul.groups li {
+                   padding: 3px 0;
+               }
+               
+               ul.groups li.odd{
+                   background: none repeat scroll 0 0 #DBE7F5;
+               }
+               
+               ul.groups h3 {
+                   font-size: 18px;
+                   margin: 0 0 5px;
+               }
+               
+               </style>
+               <a style="margin:20px 0 0 40px;" href="#print" class="btn" 
onClick="window.print()">Skriv ut</a>
+</xsl:template>
\ No newline at end of file

Modified: 
branches/Version-1_0-branch/controller/templates/base/procedure/procedure_item.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/procedure/procedure_item.xsl
  2012-01-08 13:21:05 UTC (rev 8523)
+++ 
branches/Version-1_0-branch/controller/templates/base/procedure/procedure_item.xsl
  2012-01-08 13:23:14 UTC (rev 8524)
@@ -38,7 +38,6 @@
                                        <xsl:choose>
                                                <xsl:when test="editable">
                                                        <select 
id="control_area" name="control_area">
-                                                               <option 
value="0">Ingen valgt</option>
                                                                
<xsl:apply-templates select="control_area/options"/>
                                                        </select>
                                                </xsl:when>

Modified: 
branches/Version-1_0-branch/controller/templates/base/procedure/view_procedures_for_control.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/procedure/view_procedures_for_control.xsl
     2012-01-08 13:21:05 UTC (rev 8523)
+++ 
branches/Version-1_0-branch/controller/templates/base/procedure/view_procedures_for_control.xsl
     2012-01-08 13:23:14 UTC (rev 8524)
@@ -4,6 +4,15 @@
        <h3 style="margin:5px 0;">Prosedyre for kontroll</h3>
        
        <span>Tittel: </span><xsl:value-of select="control_procedure/title"/>
+       <a style="display:block;margin-top:5px;" id="print_control_items" 
target="_blank">
+               <xsl:attribute name="href">
+                       
<xsl:text>index.php?menuaction=controller.uiprocedure.print_procedure</xsl:text>
+                       <xsl:text>&amp;procedure_id=</xsl:text>
+                       <xsl:value-of select="control_procedure/id"/>
+                       <xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
+               </xsl:attribute>
+               Skriv ut
+       </a>
        
        <h3 style="margin:15px 0 3px 0;">Prosedyrer for grupper</h3>
        
@@ -13,7 +22,15 @@
                                <h4 style="margin:2px 0;"><xsl:value-of 
select="procedure/title"/></h4>
                                <div style="margin-left:10px;">
                                        <span>Gruppe: </span><xsl:value-of 
select="control_group/group_name"/>
-                                       <span style="margin-left:10px;">Skriv 
ut</span>
+                                       <a 
style="display:block;margin-top:5px;" id="print_control_items" target="_blank">
+                                               <xsl:attribute name="href">
+                                                       
<xsl:text>index.php?menuaction=controller.uiprocedure.print_procedure</xsl:text>
+                                                       
<xsl:text>&amp;procedure_id=</xsl:text>
+                                                       <xsl:value-of 
select="procedure/id"/>
+                                                       
<xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
+                                               </xsl:attribute>
+                                               Skriv ut
+                                       </a>
                                </div>  
                        </li>
                </xsl:for-each>

Deleted: 
branches/Version-1_0-branch/controller/templates/base/view_calendar_month.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/view_calendar_month.xsl   
    2012-01-08 13:21:05 UTC (rev 8523)
+++ 
branches/Version-1_0-branch/controller/templates/base/view_calendar_month.xsl   
    2012-01-08 13:23:14 UTC (rev 8524)
@@ -1,216 +0,0 @@
-<!-- $Id$ -->
-<xsl:template match="data" name="view_check_lists" 
xmlns:php="http://php.net/xsl";>
-<xsl:variable name="date_format">d/m-Y</xsl:variable>
-<xsl:variable name="location_code"><xsl:value-of 
select="location_array/location_code"/></xsl:variable>
-
-<div id="main_content">
-               
-               <h1>Kalenderoversikt for <xsl:value-of select="period"/></h1>
-               
-               <div style="float:left;">                       
-                       <fieldset class="location_details">
-                               <h3 
style="margin:0;font-size:19px;"><xsl:value-of 
select="location_array/loc1_name"/></h3>
-                       </fieldset>
-               </div>
-               
-               <ul id="icon_color_map">
-                       <li><img height="13" 
src="controller/images/status_icon_yellow_ring.png" /><span>Kontroll satt 
opp</span></li>
-                       <li><img height="13" 
src="controller/images/status_icon_yellow.png" /><span>Kontroll har planlagt 
dato</span></li>
-                       <li><img height="13" 
src="controller/images/status_icon_dark_green.png" /><span>Kontroll gjennomført 
uten feil før frist</span></li>
-                       <li><img height="13" 
src="controller/images/status_icon_light_green.png" /><span>Kontroll 
gjennomført uten feil etter frist</span></li>
-                       <li><img height="13" 
src="controller/images/status_icon_red_empty.png" /><span>Kontroll gjennomført 
med rapporterte feil</span></li>
-                       <li><img height="11" 
src="controller/images/status_icon_red_cross.png" /><span>Kontroll ikke 
gjennomført</span></li>
-               </ul>
-                               
-               <div style="float: left;margin-bottom: 10px;margin-left: 
735px;margin-top: 30px;"><a class="move_cal_right" href="#"><img 
src="controller/images/arrow_left.png" width="16"/></a></div>
-               <div style="float:left;margin-top: 30px;margin-left: 374px;"><a 
class="move_cal_left" href="#"><img src="controller/images/arrow_right.png" 
width="16"/></a></div>
-               
-               <script>
-                       $(document).ready(function() {
-                               $(".move_cal_left").click(function(){
-                                       var leftStrVal = 
$("#days_view").css("left");
-                                       var leftNumVal = 
leftStrVal.substring(0, leftStrVal.indexOf('px'));
-                                       
-                                       if(leftNumVal == -417){
-                                               $("#days_view").animate({
-                                   left: '-=93' 
-                                   }, 800);
-                                       }else if(leftNumVal > -417){
-                                               $("#days_view").animate({
-                                   left: '-=417' 
-                                   }, 800);
-                                       }
-                               });
-                               
-                               $(".move_cal_right").click(function(){
-                                       var leftStrVal = 
$("#days_view").css("left");
-                                       var leftNumVal = 
leftStrVal.substring(0, leftStrVal.indexOf('px'));
-                                       
-                                       if( leftNumVal != 0 ){
-                                               if(leftNumVal == -93){
-                                                       
$("#days_view").animate({
-                                           left: '+=93' 
-                                           }, 800);
-                                               }else if( leftNumVal >= -510 ){
-                                                       
$("#days_view").animate({
-                                           left: '+=417' 
-                                           }, 800);
-                                               }
-                                       }
-                               });
-                       });
-               </script>
-               
-               <xsl:choose>
-                       <xsl:when test="controls_calendar_array/child::node()">
-                       <ul style="clear:left;" class="calendar info month">
-                               <li class="heading">
-                                       <div class="id">ID</div>
-                                       <div class="title">Tittel</div>
-                                       <div class="date">Startdato</div>
-                                       <div class="date">Sluttdato</div>
-                                       <div 
class="frequency">Frekvenstype</div>
-                                       <div 
class="frequency">Frekvensintervall</div>
-                               </li>
-                       
-                               <xsl:for-each select="controls_calendar_array">
-                                       <li>
-                                       <div class="id">
-                                               <xsl:value-of 
select="control/id"/>
-                                               </div>
-                                               <div class="title">
-                                               <xsl:value-of 
select="control/title"/>
-                                               </div>
-                                               <div class="date">
-                                               <xsl:value-of 
select="php:function('date', $date_format, number(control/start_date))"/>
-                                               </div>
-                                               <div class="date">
-                                                       <xsl:choose>
-                                                               <xsl:when 
test="control/end_date != 0">
-                                                               <xsl:value-of 
select="php:function('date', $date_format, number(control/end_date))"/>
-                                                       </xsl:when>
-                                                       <xsl:otherwise>
-                                                               Løpende
-                                                       </xsl:otherwise>
-                                               </xsl:choose>
-                                               </div>
-                                               <div class="frequency">
-                                               <xsl:value-of 
select="control/repeat_type"/>
-                                               </div>
-                                               <div class="frequency">
-                                               <xsl:value-of 
select="control/repeat_interval"/>
-                                               </div>                          
                        
-                                       </li>
-                               </xsl:for-each>
-                       </ul>
-                       
-                       <div id="days_wrp">
-                               <ul id="days_view" class="calendar days">
-                                       <li class="heading">
-                                               <xsl:for-each 
select="heading_array">
-                                                       <div><xsl:value-of 
select="."/></div>
-                                               </xsl:for-each>
-                                       </li>                           
-                                                       
-                                       <xsl:for-each 
select="controls_calendar_array">
-                                       <li>
-                                               <xsl:for-each 
select="calendar_array">
-                                                       <xsl:choose>
-                                                                       
<xsl:when test="status = 'control_registered'">
-                                                                               
<div>
-                                                                               
<a>
-                                                                               
        <xsl:attribute name="href">
-                                                                               
                
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.add_check_list_for_location</xsl:text>
-                                                                               
                <xsl:text>&amp;date=</xsl:text>
-                                                                               
                <xsl:value-of select="info/date"/>
-                                                                               
                <xsl:text>&amp;control_id=</xsl:text>
-                                                                               
                <xsl:value-of select="info/control_id"/>
-                                                                               
                <xsl:text>&amp;location_code=</xsl:text>
-                                                                               
                <xsl:value-of select="$location_code"/>
-                                                                               
        </xsl:attribute>
-                                                                               
        <img height="15" src="controller/images/status_icon_yellow_ring.png" />
-                                                                               
</a>
-                                                                               
</div>
-                                                                       
</xsl:when>
-                                                                       
<xsl:when test="status = 'control_planned'">
-                                                                               
<div>
-                                                                               
<a>
-                                                                               
        <xsl:attribute name="href">
-                                                                               
                
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.edit_check_list_for_location</xsl:text>
-                                                                               
                <xsl:text>&amp;check_list_id=</xsl:text>
-                                                                               
                <xsl:value-of select="info/check_list_id"/>
-                                                                               
        </xsl:attribute>
-                                                                               
        <img height="15" src="controller/images/status_icon_yellow.png" />
-                                                                               
</a>
-                                                                               
</div>
-                                                                       
</xsl:when>
-                                                                       
<xsl:when test="status = 'control_accomplished_in_time_without_errors'">
-                                                                               
<div>
-                                                                               
        <a>
-                                                                               
        <xsl:attribute name="href">
-                                                                               
                
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.edit_check_list_for_location</xsl:text>
-                                                                               
                <xsl:text>&amp;check_list_id=</xsl:text>
-                                                                               
                <xsl:value-of select="info/check_list_id"/>
-                                                                               
        </xsl:attribute>
-                                                                               
                <span style="display:none"><xsl:value-of 
select="info/id"/></span>
-                                                                               
                <img height="15" 
src="controller/images/status_icon_dark_green.png" />
-                                                                               
        </a>
-                                                                               
</div>
-                                                                       
</xsl:when>
-                                                                       
<xsl:when test="status = 'control_accomplished_over_time_without_errors'">
-                                                                               
<div style="position:relative;">
-                                                                               
<div id="info_box" style="position:absolute;display:none;"></div>
-                                                                               
        <a>
-                                                                               
        <xsl:attribute name="href">
-                                                                               
                
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.edit_check_list_for_location</xsl:text>
-                                                                               
                <xsl:text>&amp;check_list_id=</xsl:text>
-                                                                               
                <xsl:value-of select="info/check_list_id"/>
-                                                                               
        </xsl:attribute>
-                                                                               
                <span style="display:none"><xsl:value-of 
select="info/id"/></span>
-                                                                               
                <img height="15" 
src="controller/images/status_icon_light_green.png" />
-                                                                               
        </a>
-                                                                               
</div>
-                                                                       
</xsl:when>
-                                                                       
<xsl:when test="status = 'control_accomplished_with_errors'">
-                                                                               
<div style="position:relative;">
-                                                                               
<div id="info_box" style="position:absolute;display:none;"></div>
-                                                                               
        <a class="view_check_list">
-                                                                               
                <xsl:attribute name="href">
-                                                                               
                        
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.edit_check_list_for_location</xsl:text>
-                                                                               
                        <xsl:text>&amp;check_list_id=</xsl:text>
-                                                                               
                        <xsl:value-of select="info/check_list_id"/>
-                                                                               
                </xsl:attribute>
-                                                                               
                <span style="display:none">
-                                                                               
                        <xsl:text>&amp;check_list_id=</xsl:text><xsl:value-of 
select="info/check_list_id"/>
-                                                                               
                        <xsl:text>&amp;phpgw_return_as=json</xsl:text>
-                                                                               
                </span>
-                                                                               
                <img height="15" 
src="controller/images/status_icon_red_empty.png" />
-                                                                               
        </a>
-                                                                               
</div>
-                                                                       
</xsl:when>
-                                                                       
<xsl:when test="status = 'control_canceled'">
-                                                                               
<div>
-                                                                               
        <img height="12" src="controller/images/status_icon_red_cross.png" />
-                                                                               
</div>
-                                                                       
</xsl:when>
-                                                                       
<xsl:when test="status = 'control_not_accomplished'">
-                                                                               
<div>
-                                                                               
        <img height="12" src="controller/images/status_icon_red_cross.png" />
-                                                                               
</div>
-                                                                       
</xsl:when>
-                                                                       
<xsl:otherwise>
-                                                                       
<div></div>
-                                                                       
</xsl:otherwise>
-                                                               </xsl:choose>
-                                                       </xsl:for-each>
-                                               </li>
-                                       </xsl:for-each>
-                               </ul>
-                       </div>
-               </xsl:when>
-               <xsl:otherwise>
-                       <div>Ingen sjekklister for bygg i angitt periode</div>
-               </xsl:otherwise>
-       </xsl:choose>
-</div>
-</xsl:template>

Deleted: 
branches/Version-1_0-branch/controller/templates/base/view_calendar_year.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/view_calendar_year.xsl    
    2012-01-08 13:21:05 UTC (rev 8523)
+++ 
branches/Version-1_0-branch/controller/templates/base/view_calendar_year.xsl    
    2012-01-08 13:23:14 UTC (rev 8524)
@@ -1,197 +0,0 @@
-<!-- $Id$ -->
-<xsl:template match="data" name="view_check_lists" 
xmlns:php="http://php.net/xsl";>
-<xsl:variable name="date_format">d/m-Y</xsl:variable>
-<xsl:variable name="year"><xsl:value-of select="year"/></xsl:variable>
-<xsl:variable name="location_code"><xsl:value-of 
select="location_array/location_code"/></xsl:variable>
-
-<div id="main_content">
-               
-               <h1>Kalenderoversikt for <xsl:value-of select="period"/></h1>
-               
-               <div style="float:left;">                       
-                       <fieldset class="location_details">
-                               <h3 
style="margin:0;font-size:19px;"><xsl:value-of 
select="location_array/loc1_name"/></h3>
-                       </fieldset>
-               </div>
-               
-       <ul id="icon_color_map">
-                       <li><img height="13" 
src="controller/images/status_icon_yellow_ring.png" /><span>Kontroll satt 
opp</span></li>
-                       <li><img height="13" 
src="controller/images/status_icon_yellow.png" /><span>Kontroll har planlagt 
dato</span></li>
-                       <li><img height="13" 
src="controller/images/status_icon_dark_green.png" /><span>Kontroll gjennomført 
uten feil før frist</span></li>
-                       <li><img height="13" 
src="controller/images/status_icon_light_green.png" /><span>Kontroll 
gjennomført uten feil etter frist</span></li>
-                       <li><img height="13" 
src="controller/images/status_icon_red_empty.png" /><span>Kontroll gjennomført 
med rapporterte feil</span></li>
-                       <li><img height="11" 
src="controller/images/status_icon_red_cross.png" /><span>Kontroll ikke 
gjennomført</span></li>
-               </ul>
-               
-               <ul class="calendar">
-                       <xsl:choose>
-                               <xsl:when 
test="controls_calendar_array/child::node()">
-
-                               <li class="heading">
-                                       <div class="id">ID</div>
-                                       <div class="title">Tittel</div>
-                                       <div class="date">Start dato</div>
-                                       <div class="date">Slutt dato</div>
-                                       <div 
class="frequency">Frekvenstype</div>
-                                       <div 
class="frequency">Frekvensintervall</div>
-                                       <div class="months">
-                                       <xsl:for-each select="heading_array">
-                                               <div>
-                                                       <a>
-                                                               <xsl:attribute 
name="href">
-                                                                       
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
-                                                                       
<xsl:text>&amp;year=</xsl:text>
-                                                                       
<xsl:value-of select="$year"/>
-                                                                       
<xsl:text>&amp;month=</xsl:text>
-                                                                       
<xsl:number/>
-                                                               </xsl:attribute>
-                                                               <xsl:value-of 
select="."/>
-                                                       </a>                    
        
-                                               </div>
-                                       </xsl:for-each>
-                                       </div>
-                               </li>
-                       
-                               <xsl:for-each select="controls_calendar_array">
-                                       <xsl:variable 
name="control_id"><xsl:value-of select="control/id"/></xsl:variable>
-                                       <li>
-                                       <div class="id">
-                                               <xsl:value-of 
select="control/id"/>
-                                               </div>
-                                               <div class="title">
-                                               <xsl:value-of 
select="control/title"/>
-                                               </div>
-                                               <div class="date">
-                                               <xsl:value-of 
select="php:function('date', $date_format, number(control/start_date))"/>
-                                               </div>
-                                               <div class="date">
-                                                       <xsl:choose>
-                                                               <xsl:when 
test="control/end_date != 0">
-                                                               <xsl:value-of 
select="php:function('date', $date_format, number(control/end_date))"/>
-                                                       </xsl:when>
-                                                       <xsl:otherwise>
-                                                               Løpende
-                                                       </xsl:otherwise>
-                                               </xsl:choose>
-                                               </div>
-                                               <div class="frequency">
-                                               <xsl:value-of 
select="control/repeat_type"/>
-                                               </div>
-                                               <div class="frequency">
-                                               <xsl:value-of 
select="control/repeat_interval"/>
-                                               </div>                          
                        
-                                               <div class="months">
-                                               <xsl:for-each 
select="calendar_array">
-                                               <xsl:choose>
-                                                                       
<xsl:when test="status = 'control_registered'">
-                                                                               
<div>
-                                                                               
<a>
-                                                                               
        <xsl:attribute name="href">
-                                                                               
                
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.add_check_list_for_location</xsl:text>
-                                                                               
                <xsl:text>&amp;date=</xsl:text>
-                                                                               
                <xsl:value-of select="info/date"/>
-                                                                               
                <xsl:text>&amp;control_id=</xsl:text>
-                                                                               
                <xsl:value-of select="info/control_id"/>
-                                                                               
                <xsl:text>&amp;location_code=</xsl:text>
-                                                                               
                <xsl:value-of select="$location_code"/>
-                                                                               
        </xsl:attribute>
-                                                                               
        <img height="15" src="controller/images/status_icon_yellow_ring.png" />
-                                                                               
</a>
-                                                                               
</div>
-                                                                       
</xsl:when>
-                                                                       
<xsl:when test="status = 'control_planned'">
-                                                                               
<div>
-                                                                               
<a>
-                                                                               
        <xsl:attribute name="href">
-                                                                               
                
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.edit_check_list_for_location</xsl:text>
-                                                                               
                <xsl:text>&amp;check_list_id=</xsl:text>
-                                                                               
                <xsl:value-of select="info/check_list_id"/>
-                                                                               
        </xsl:attribute>
-                                                                               
        <img height="15" src="controller/images/status_icon_yellow.png" />
-                                                                               
</a>
-                                                                               
</div>
-                                                                       
</xsl:when>
-                                                                       
<xsl:when test="status = 'control_accomplished_in_time_without_errors'">
-                                                                               
<div>
-                                                                               
        <a>
-                                                                               
        <xsl:attribute name="href">
-                                                                               
                
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.edit_check_list_for_location</xsl:text>
-                                                                               
                <xsl:text>&amp;check_list_id=</xsl:text>
-                                                                               
                <xsl:value-of select="info/check_list_id"/>
-                                                                               
        </xsl:attribute>
-                                                                               
                <span style="display:none"><xsl:value-of 
select="info/id"/></span>
-                                                                               
                <img height="15" 
src="controller/images/status_icon_dark_green.png" />
-                                                                               
        </a>
-                                                                               
</div>
-                                                                       
</xsl:when>
-                                                                       
<xsl:when test="status = 'control_accomplished_over_time_without_errors'">
-                                                                               
<div style="position:relative;">
-                                                                               
<div id="info_box" style="position:absolute;display:none;"></div>
-                                                                               
        <a>
-                                                                               
        <xsl:attribute name="href">
-                                                                               
                
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.edit_check_list_for_location</xsl:text>
-                                                                               
                <xsl:text>&amp;check_list_id=</xsl:text>
-                                                                               
                <xsl:value-of select="info/check_list_id"/>
-                                                                               
        </xsl:attribute>
-                                                                               
                <span style="display:none"><xsl:value-of 
select="info/id"/></span>
-                                                                               
                <img height="15" 
src="controller/images/status_icon_light_green.png" />
-                                                                               
        </a>
-                                                                               
</div>
-                                                                       
</xsl:when>
-                                                                       
<xsl:when test="status = 'control_accomplished_with_errors'">
-                                                                               
<div style="position:relative;">
-                                                                               
<div id="info_box" style="position:absolute;display:none;"></div>
-                                                                               
        <a class="view_check_list">
-                                                                               
                <xsl:attribute name="href">
-                                                                               
                        
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.edit_check_list_for_location</xsl:text>
-                                                                               
                        <xsl:text>&amp;check_list_id=</xsl:text>
-                                                                               
                        <xsl:value-of select="info/check_list_id"/>
-                                                                               
                </xsl:attribute>
-                                                                               
                <span style="display:none">
-                                                                               
                        <xsl:text>&amp;check_list_id=</xsl:text><xsl:value-of 
select="info/check_list_id"/>
-                                                                               
                        <xsl:text>&amp;phpgw_return_as=json</xsl:text>
-                                                                               
                </span>
-                                                                               
                <img height="15" src="controller/images/status_icon_red.png" />
-                                                                               
        </a>
-                                                                               
</div>
-                                                                       
</xsl:when>
-                                                                       
<xsl:when test="status = 'control_agg_accomplished_with_errors'">
-                                                                               
<div style="background: url(controller/images/status_icon_red_empty.png) 
no-repeat 50% 50%;">
-                                                                               
<a style="color:#fff;font-weight:bold;text-decoration: none;font-size:10px;" 
class="view_check_list">
-                                                                               
                <xsl:attribute name="href">
-                                                                               
                        
<xsl:text>index.php?menuaction=controller.uicheck_list.get_check_list_info</xsl:text>
-                                                                               
                        <xsl:text>&amp;phpgw_return_as=json</xsl:text>
-                                                                               
                        <xsl:text>&amp;check_list_id=</xsl:text>
-                                                                               
                        <xsl:value-of select="info/id"/>
-                                                                               
                </xsl:attribute>
-                                                                               
                <span><xsl:value-of select="info"/></span>
-                                                                               
        </a>
-                                                                               
</div>
-                                                                       
</xsl:when>
-                                                                       
<xsl:when test="status = 'control_canceled'">
-                                                                               
<div>
-                                                                               
        <img height="12" src="controller/images/status_icon_red_cross.png" />
-                                                                               
</div>
-                                                                       
</xsl:when>
-                                                                       
<xsl:when test="status = 'control_not_accomplished'">
-                                                                               
<div>
-                                                                               
        <img height="12" src="controller/images/status_icon_red_cross.png" />
-                                                                               
</div>
-                                                                       
</xsl:when>
-                                                                       
<xsl:otherwise>
-                                                                       
<div></div>
-                                                                       
</xsl:otherwise>
-                                                               </xsl:choose>
-                                                               
-                                               </xsl:for-each>
-                                               </div>
-                                       </li>   
-                               </xsl:for-each> 
-                       </xsl:when>
-                       <xsl:otherwise>
-                               <div>Ingen sjekklister for bygg i angitt 
periode</div>
-                       </xsl:otherwise>
-               </xsl:choose>
-       </ul>
-</div>
-</xsl:template>

Modified: branches/Version-1_0-branch/phpgwapi/inc/class.xslttemplates.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.xslttemplates.inc.php        
2012-01-08 13:21:05 UTC (rev 8523)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.xslttemplates.inc.php        
2012-01-08 13:23:14 UTC (rev 8524)
@@ -365,7 +365,9 @@
                {
                        $output_header = 
!(isset($GLOBALS['phpgw_info']['flags']['noframework']) && 
$GLOBALS['phpgw_info']['flags']['noframework']);
                        
-                       if ( $this->output != 'wml' )
+                       $stripped_htm   = phpgw::get_var('phpgw_return_as') == 
'stripped_html';
+                       
+                       if ( $this->output != 'wml' && !$stripped_htm)
                        {
                                
$GLOBALS['phpgw']->common->phpgw_header($output_header);
                        }

Modified: branches/Version-1_0-branch/property/inc/class.bocommon.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.bocommon.inc.php     
2012-01-08 13:21:05 UTC (rev 8523)
+++ branches/Version-1_0-branch/property/inc/class.bocommon.inc.php     
2012-01-08 13:23:14 UTC (rev 8524)
@@ -1176,11 +1176,17 @@
                                $type_id        = 0;//count($location_types);
                                $no_address     = true;
                        }
+
+                       $GLOBALS['phpgw']->config->read();
+                       $list_location_level = 
isset($GLOBALS['phpgw']->config->config_data['list_location_level'])     && 
$GLOBALS['phpgw']->config->config_data['list_location_level'] ? 
$GLOBALS['phpgw']->config->config_data['list_location_level'] : array();
+
+
                        $this->type_id  = $type_id;
                        $_level = 1;
                        for ($i=0; $i<$type_id; $i++)
                        {
-                               if($_level > 1)
+               //              if($_level > 1) // very expensive 
+                               if($_level == 2 && in_array(2, 
$list_location_level))
                                {
                                        $joinmethod .= " {$this->join} 
fm_location{$_level}";
                                        $paranthesis .='(';
@@ -1216,9 +1222,6 @@
                                $cols_return[] = 'loc' . 
$location_types[$i]['id'];
                        }
 
-                       $GLOBALS['phpgw']->config->read();
-                       $list_location_level = 
isset($GLOBALS['phpgw']->config->config_data['list_location_level'])     && 
$GLOBALS['phpgw']->config->config_data['list_location_level'] ? 
$GLOBALS['phpgw']->config->config_data['list_location_level'] : array();
-
                        for ($i=1;$i<($type_id+1);$i++)
                        {
                                $cols_return[]                          = 
"loc{$i}_name";

Modified: branches/Version-1_0-branch/property/inc/class.boproject.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.boproject.inc.php    
2012-01-08 13:21:05 UTC (rev 8523)
+++ branches/Version-1_0-branch/property/inc/class.boproject.inc.php    
2012-01-08 13:23:14 UTC (rev 8524)
@@ -806,8 +806,8 @@
                        $this->so->delete($project_id);
                }
 
-               function bulk_update_status($start_date, $end_date, 
$status_filter, $status_new, $execute, $type, $user_id,$ids)
+               function bulk_update_status($start_date, $end_date, 
$status_filter, $status_new, $execute, $type, 
$user_id,$ids,$paid,$closed_orders)
                {
-                       return $this->so->bulk_update_status($start_date, 
$end_date, $status_filter, $status_new, $execute, $type, $user_id,$ids);
+                       return $this->so->bulk_update_status($start_date, 
$end_date, $status_filter, $status_new, $execute, $type, 
$user_id,$ids,$paid,$closed_orders);
                }
        }

Modified: branches/Version-1_0-branch/property/inc/class.custom_fields.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.custom_fields.inc.php        
2012-01-08 13:21:05 UTC (rev 8523)
+++ branches/Version-1_0-branch/property/inc/class.custom_fields.inc.php        
2012-01-08 13:23:14 UTC (rev 8524)
@@ -447,73 +447,71 @@
                                                $location = 
explode('-',$data['value']);
                                        }
 
-                                       if(($data['datatype']=='R' || 
$data['datatype']=='LB') && $data['value'] && $data['attrib_id'])
+                                       $ret[$j][$field] = '';
+                                       if($data['value'])
                                        {
-                                               $sql="SELECT value FROM 
$choice_table WHERE $attribute_filter AND attrib_id=" .$data['attrib_id']. "  
AND id=" . $data['value'];
-                                               $this->_db->query($sql);
-                                               $this->_db->next_record();
-                                               $ret[$j][$field] =  
$this->_db->f('value');
-                                       }
-                                       else if($data['datatype']=='AB' && 
$data['value'])
-                                       {
-                                               $contact_data   = 
$contacts->read_single_entry($data['value'],array('fn'));
-                                               $ret[$j][$field] =  
$contact_data[0]['fn'];
-                                       }
-                                       else if($data['datatype']=='ABO' && 
$data['value'])
-                                       {
-                                               $contact_data   = 
$contacts->get_principal_organizations_data($data['value']);
-                                               $ret[$j][$field] = 
$contact_data[0]['org_name'];
-                                       }
-                                       else if($data['datatype']=='VENDOR' && 
$data['value'])
-                                       {
-                                               $sql="SELECT org_name FROM 
fm_vendor where id={$data['value']}";
-                                               $this->_db->query($sql);
-                                               $this->_db->next_record();
-                                               $ret[$j][$field] =  
$this->_db->f('org_name',true);
-                                       }
-                                       else if($data['datatype']=='CH' && 
$data['value'])
-                                       {
-                                       //      $ch= 
unserialize($data['value']);
-                                               $ch = explode(',', 
trim($data['value'], ','));
-                                               if (isset($ch) AND 
is_array($ch))
+                                               switch($data['datatype'])
                                                {
-                                                       for 
($k=0;$k<count($ch);$k++)
-                                                       {
-                                                               $sql="SELECT 
value FROM $choice_table WHERE $attribute_filter AND attrib_id= 
{$data['attrib_id']} AND id=" . $ch[$k];
+                                                       case 'R':
+                                                       case 'LB':
+                                                               
if($data['attrib_id'])
+                                                               {
+                                                                       
$sql="SELECT value FROM $choice_table WHERE $attribute_filter AND attrib_id=" 
.(int)$data['attrib_id']. "  AND id=" . (int)$data['value'];
+                                                                       
$this->_db->query($sql);
+                                                                       
$this->_db->next_record();
+                                                                       
$ret[$j][$field] =  $this->_db->f('value');
+                                                               }
+                                                               break;
+                                                       case 'AB':
+                                                               $contact_data   
= $contacts->read_single_entry($data['value'],array('fn'));
+                                                               
$ret[$j][$field] =  $contact_data[0]['fn'];
+                                                               break;
+                                                       case 'ABO':
+                                                               $contact_data   
= $contacts->get_principal_organizations_data($data['value']);
+                                                               
$ret[$j][$field] = $contact_data[0]['org_name'];
+                                                               break;
+                                                       case 'VENDOR':
+                                                               $sql="SELECT 
org_name FROM fm_vendor where id=" . (int)$data['value'];
                                                                
$this->_db->query($sql);
-                                                               while 
($this->_db->next_record())
+                                                               
$this->_db->next_record();
+                                                               
$ret[$j][$field] =  $this->_db->f('org_name',true);
+                                                               break;
+                                                       case 'CH':
+                                                               $ch = 
explode(',', trim($data['value'], ','));
+                                                               if (isset($ch) 
AND is_array($ch))
                                                                {
-                                                                       
$ch_value[]=$this->_db->f('value');
+                                                                       for 
($k=0;$k<count($ch);$k++)
+                                                                       {
+                                                                               
$sql="SELECT value FROM $choice_table WHERE $attribute_filter AND attrib_id= " 
. (int)$data['attrib_id'] . ' AND id = ' . (int)$ch[$k];
+                                                                               
$this->_db->query($sql);
+                                                                               
while ($this->_db->next_record())
+                                                                               
{
+                                                                               
        $ch_value[]=$this->_db->f('value');
+                                                                               
}
+                                                                       }
+                                                                       
$ret[$j][$field] =  @implode(",", $ch_value);
+                                                                       
unset($ch_value);
                                                                }
-                                                       }
-                                                       $ret[$j][$field] =  
@implode(",", $ch_value);
-                                                       unset($ch_value);
+                                                               break;
+                                                       case 'D':
+                                                               
$ret[$j][$field] =  
date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],strtotime($data['value']));
+                                                               break;
+                                                       case 'timestamp':
+                                                               
$ret[$j][$field] =  
date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],$data['value']);
+                                                               break;
+                                                       case 'link':
+                                                               
$ret[$j][$field] =  phpgw::safe_redirect($data['value']);
+                                                               break;
+                                                       case 'user':
+                                                               
$ret[$j][$field] =   
$GLOBALS['phpgw']->accounts->get($data['value'])->__toString();
+                                                               break;
+                                                       case 'pwd':
+                                                               
$ret[$j][$field] =   lang('yes');
+                                                               break;
+                                                       default:
+                                                               
$ret[$j][$field] =  stripslashes($data['value']);
                                                }
                                        }
-                                       else if($data['datatype']=='D' && 
$data['value'])
-                                       {
-                                               $ret[$j][$field] =  
date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],strtotime($data['value']));
-                                       }
-                                       else if($data['datatype']=='timestamp' 
&& $data['value'])
-                                       {
-                                               $ret[$j][$field] =  
date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],$data['value']);
-                                       }
-                                       else if($data['datatype']=='link' && 
$data['value'])
-                                       {
-                                               $ret[$j][$field] =  
phpgw::safe_redirect($data['value']);
-                                       }
-                                       else if($data['datatype']=='user' && 
$data['value'])
-                                       {
-                                               $ret[$j][$field] =   
$GLOBALS['phpgw']->accounts->get($data['value'])->__toString();
-                                       }
-                                       else if($data['datatype']=='pwd' && 
$data['value'])
-                                       {
-                                               $ret[$j][$field] =   
lang('yes');
-                                       }
-                                       else
-                                       {
-                                               $ret[$j][$field] =  
stripslashes($data['value']);
-                                       }
 
                                        if($location)
                                        {

Modified: branches/Version-1_0-branch/property/inc/class.solocation.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.solocation.inc.php   
2012-01-08 13:21:05 UTC (rev 8523)
+++ branches/Version-1_0-branch/property/inc/class.solocation.inc.php   
2012-01-08 13:23:14 UTC (rev 8524)
@@ -1769,4 +1769,29 @@
                        $this->db->next_record();
                        return $this->db->f('id');
                }
+
+               function get_children($location_code)
+               {
+                       $level = count(explode('-', $location_code));
+                       $child_level = $level + 1;
+                       $location_types = 
$this->soadmin_location->select_location_type();
+
+                       $values = array();
+                       
+                       if( $level >= count($location_types))
+                       {
+                               return $values;
+                       }
+                       
+                       $this->db->query("SELECT loc{$child_level} AS id, 
loc{$child_level}_name AS name FROM fm_location{$child_level} WHERE 
location_code {$this->like} '{$location_code}%'",__LINE__,__FILE__);
+                       while ($this->db->next_record())
+                       {
+                               $values[] = array
+                               (
+                                       'id'    =>  $this->db->f('id'),
+                                       'name'  =>  $this->db->f('name')
+                               );
+                       }
+                       return $values;
+               }
        }

Modified: branches/Version-1_0-branch/property/inc/class.soproject.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soproject.inc.php    
2012-01-08 13:21:05 UTC (rev 8523)
+++ branches/Version-1_0-branch/property/inc/class.soproject.inc.php    
2012-01-08 13:23:14 UTC (rev 8524)
@@ -1285,7 +1285,7 @@
                }
 
 
-               function bulk_update_status($start_date, $end_date, 
$status_filter, $status_new, $execute, $type, $user_id = 0,$ids)
+               function bulk_update_status($start_date, $end_date, 
$status_filter, $status_new, $execute, $type, $user_id = 0,$ids,$paid = false, 
$closed_orders = false)
                {
                        $start_date = $start_date ? 
phpgwapi_datetime::date_to_timestamp($start_date) : time();
                        $end_date = $end_date ? 
phpgwapi_datetime::date_to_timestamp($end_date) : time();
@@ -1306,20 +1306,29 @@
                        switch($type)
                        {
                                case 'project':
+                                       if($closed_orders)
+                                       {
+                                               $filter .=  " AND 
fm_open_workorder_view.project_id IS NULL";
+                                       }
+
                                        $table = 'fm_project';
                                        $status_table = 'fm_project_status';
                                        $title_field = 'fm_project.name as 
title';
                                        $this->_update_status_project($execute, 
$status_new, $ids);
                                        $sql = "SELECT DISTINCT {$table}.id, 
$status_table.descr as status ,{$title_field},{$table}.start_date, 
count(project_id) as num_open FROM {$table}"
                                        . " {$this->join} {$status_table} ON  
{$table}.status = {$status_table}.id "
-                                       . " {$this->left_join} fm_workorder ON 
{$table}.id = fm_workorder.project_id "
-                                       . " {$this->join} fm_workorder_status 
ON  fm_workorder.status = fm_workorder_status.id "
-                                       . " WHERE ({$table}.start_date > 
{$start_date} AND {$table}.start_date < {$end_date} {$filter}) AND 
fm_workorder_status.delivered IS NULL AND fm_workorder_status.closed IS NULL"
+                                       . " {$this->left_join} 
fm_open_workorder_view ON {$table}.id = fm_open_workorder_view.project_id "
+                                       . " WHERE ({$table}.start_date > 
{$start_date} AND {$table}.start_date < {$end_date} {$filter})"
                                        . " GROUP BY {$table}.id, 
$status_table.descr ,{$table}.name, {$table}.start_date"
                                        . " ORDER BY {$table}.id DESC";
 
                                        break;
                                case 'workorder':
+                                       if($paid)
+                                       {
+                                               $filter .= " AND (act_mtrl_cost 
> 0 OR act_vendor_cost > 0)";
+                                       }
+                                       
                                        $table = 'fm_workorder';
                                        $status_table = 'fm_workorder_status';
                                        $title_field = 'fm_workorder.title';

Modified: branches/Version-1_0-branch/property/inc/class.uiproject.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uiproject.inc.php    
2012-01-08 13:21:05 UTC (rev 8523)
+++ branches/Version-1_0-branch/property/inc/class.uiproject.inc.php    
2012-01-08 13:23:14 UTC (rev 8524)
@@ -1976,6 +1976,9 @@
                        $type                   = phpgw::get_var('type');
                        $user_id                = phpgw::get_var('user_id', 
'int');
                        $id_to_update   = phpgw::get_var('id_to_update');
+                       $paid                   = phpgw::get_var('paid', 
'bool', 'POST');
+                       $closed_orders  = phpgw::get_var('closed_orders', 
'bool', 'POST');
+
                        
                        if($id_to_update)
                        {
@@ -1998,7 +2001,7 @@
 
                        if(($execute || $get_list) && $type)
                        {
-                               $list = 
$this->bo->bulk_update_status($start_date, $end_date, $status_filter, 
$status_new, $execute, $type, $user_id,$ids);
+                               $list = 
$this->bo->bulk_update_status($start_date, $end_date, $status_filter, 
$status_new, $execute, $type, $user_id,$ids,$paid,$closed_orders);
                        }
 
                        $total_records  = count($list);
@@ -2070,13 +2073,13 @@
                                ),
                                array
                                (
-                                       'id' => 'project',
-                                       'name'  => lang('project')
+                                       'id' => 'workorder',
+                                       'name'  => lang('workorder')
                                ),
                                array
                                (
-                                       'id' => 'workorder',
-                                       'name'  => lang('workorder')
+                                       'id' => 'project',
+                                       'name'  => lang('project')
                                )
                        );
 
@@ -2099,7 +2102,11 @@
                                'user_list'                             => 
array('options' => $user_list),
                                'start_date'                    => $start_date,
                                'end_date'                              => 
$end_date,
-                               'total_records'                 => 
$total_records
+                               'total_records'                 => 
$total_records,
+                               'paid'                                  => 
$paid,
+                               'closed_orders'                 => 
$closed_orders,
+                               'check_paid'                    => $type == 
'workorder' ? 1 : 0,
+                               'check_closed_orders'   => $type == 'project' ? 
1 : 0
                        );
 
 

Modified: branches/Version-1_0-branch/property/inc/class.uiwo_hour.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uiwo_hour.inc.php    
2012-01-08 13:21:05 UTC (rev 8523)
+++ branches/Version-1_0-branch/property/inc/class.uiwo_hour.inc.php    
2012-01-08 13:23:14 UTC (rev 8524)
@@ -1460,6 +1460,7 @@
 
                                // Configure the transformer
                                $proc = new XSLTProcessor;
+                               $proc->registerPHPFunctions(); // enable php 
functions
                                $proc->importStyleSheet($xsl); // attach the 
xsl rules
 
                                $header =  <<<HTML

Modified: branches/Version-1_0-branch/property/setup/default_records.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/default_records.inc.php  
2012-01-08 13:21:05 UTC (rev 8523)
+++ branches/Version-1_0-branch/property/setup/default_records.inc.php  
2012-01-08 13:23:14 UTC (rev 8524)
@@ -876,3 +876,8 @@
                        )
                );
 
+               $sql = 'CREATE OR REPLACE VIEW fm_open_workorder_view AS' 
+                       . ' SELECT fm_workorder.id, fm_workorder.project_id, 
fm_workorder_status.descr FROM fm_workorder'
+                       . ' JOIN fm_workorder_status ON fm_workorder.status = 
fm_workorder_status.id WHERE fm_workorder_status.delivered IS NULL AND 
fm_workorder_status.closed IS NULL';
+
+               $GLOBALS['phpgw_setup']->oProc->query($sql,__LINE__,__FILE__);

Modified: branches/Version-1_0-branch/property/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/setup.inc.php    2012-01-08 
13:21:05 UTC (rev 8523)
+++ branches/Version-1_0-branch/property/setup/setup.inc.php    2012-01-08 
13:23:14 UTC (rev 8524)
@@ -12,7 +12,7 @@
        */
 
        $setup_info['property']['name']                 = 'property';
-       $setup_info['property']['version']              = '0.9.17.630';
+       $setup_info['property']['version']              = '0.9.17.631';

@@ Diff output truncated at 153600 characters. @@



reply via email to

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