fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [8646] Merge 8618:8645 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [8646] Merge 8618:8645 from trunk
Date: Sun, 22 Jan 2012 19:51:53 +0000

Revision: 8646
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8646
Author:   sigurdne
Date:     2012-01-22 19:51:52 +0000 (Sun, 22 Jan 2012)
Log Message:
-----------
Merge 8618:8645 from trunk

Modified Paths:
--------------
    branches/Version-1_0-branch/controller/inc/class.menu.inc.php
    branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php
    branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php
    branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
    branches/Version-1_0-branch/controller/inc/class.uicase.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.uicontrol.inc.php
    branches/Version-1_0-branch/controller/inc/class.uicontrol_group.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/setup/setup.inc.php
    branches/Version-1_0-branch/controller/setup/tables_update.inc.php
    
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_month.xsl
    
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_year.xsl
    
branches/Version-1_0-branch/controller/templates/base/case/create_case_message.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/edit_check_list.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/register_case.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/view_cases_for_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/check_list/view_control_items.xsl
    branches/Version-1_0-branch/controller/templates/base/css/base.css
    
branches/Version-1_0-branch/controller/templates/base/procedure/print_procedure.xsl
    
branches/Version-1_0-branch/controller/templates/base/procedure/view_procedures_for_control.xsl
    branches/Version-1_0-branch/phpgwapi/cron/asyncservices.php
    branches/Version-1_0-branch/phpgwapi/inc/class.asyncservice.inc.php
    branches/Version-1_0-branch/phpgwapi/inc/class.db_pdo.inc.php
    branches/Version-1_0-branch/phpgwapi/templates/portico/navbar.inc.php
    branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php
    branches/Version-1_0-branch/property/inc/class.soproject.inc.php
    branches/Version-1_0-branch/property/inc/class.soworkorder.inc.php
    branches/Version-1_0-branch/property/inc/class.uiinvoice.inc.php
    branches/Version-1_0-branch/property/inc/class.uiproject.inc.php
    branches/Version-1_0-branch/property/inc/class.uiworkorder.inc.php
    branches/Version-1_0-branch/property/js/yahoo/invoice.index.js
    branches/Version-1_0-branch/property/js/yahoo/invoice.paid.index.js
    branches/Version-1_0-branch/rental/inc/class.soadjustment.inc.php
    branches/Version-1_0-branch/rental/inc/class.soparty.inc.php
    
branches/Version-1_0-branch/rental/inc/class.soworkbench_notification.inc.php
    branches/Version-1_0-branch/rental/inc/class.uiparty.inc.php
    branches/Version-1_0-branch/rental/setup/setup.inc.php
    branches/Version-1_0-branch/rental/setup/tables_update.inc.php

Added Paths:
-----------
    branches/Version-1_0-branch/controller/inc/class.uicontrol_location.inc.php
    
branches/Version-1_0-branch/controller/templates/base/control_group/control_group_items.xsl
    
branches/Version-1_0-branch/controller/templates/base/control_group/control_group_tabs.xsl
    branches/Version-1_0-branch/controller/templates/base/control_location/
    
branches/Version-1_0-branch/controller/templates/base/tab_view_check_lists_garbage.xsl
    
branches/Version-1_0-branch/controller/templates/base/view_check_lists_for_location_garbage.xsl

Removed Paths:
-------------
    
branches/Version-1_0-branch/controller/templates/base/add_location_to_control.xsl
    
branches/Version-1_0-branch/controller/templates/base/control_check_lists.xsl
    
branches/Version-1_0-branch/controller/templates/base/control_group_items.xsl
    branches/Version-1_0-branch/controller/templates/base/control_group_tabs.xsl
    
branches/Version-1_0-branch/controller/templates/base/control_location_tabs.xsl
    branches/Version-1_0-branch/controller/templates/base/control_locations.xsl
    
branches/Version-1_0-branch/controller/templates/base/tab_view_check_lists.xsl
    
branches/Version-1_0-branch/controller/templates/base/view_check_lists_for_location.xsl
    
branches/Version-1_0-branch/controller/templates/base/view_locations_for_control.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,8503-8523,8525,8527-8531,8533,8535-8536,8538-8550,8552-8554,8556-8557,8559-8579,8581-8587,8589,8591-8592,8594-8595,8597-8601,8603-8610,8612-8613,8615,8617
   + 
/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,8525,8527-8531,8533,8535-8536,8538-8550,8552-8554,8556-8557,8559-8579,8581-8587,8589,8591-8592,8594-8595,8597-8601,8603-8610,8612-8613,8615,8617,8619-8645

Modified: branches/Version-1_0-branch/controller/inc/class.menu.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.menu.inc.php       
2012-01-22 19:08:35 UTC (rev 8645)
+++ branches/Version-1_0-branch/controller/inc/class.menu.inc.php       
2012-01-22 19:51:52 UTC (rev 8646)
@@ -61,7 +61,7 @@
                                                                                
        'location_for_check_list' => array
                                                                                
        (
                                                                                
                'text'  => lang('Location'),
-                                                                               
                'url'   => $GLOBALS['phpgw']->link('/index.php', 
array('menuaction'=> 'controller.uicheck_list_for_location.index') ),
+                                                                               
                'url'   => $GLOBALS['phpgw']->link('/index.php', 
array('menuaction'=> 'controller.uicontrol_location.index') ),
                                                                                
                'image' => array('property', 'location_1')
                                                                                
        ),
                                                                                
        'component_for_check_list' => array
@@ -75,7 +75,7 @@
                                        'location_for_check_list' => array
                                        (
                                                'text'  => 
lang('location_connections'),
-                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'controller.uicheck_list_for_location.index') ),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'controller.uicontrol_location.index') ),
                                                'image' => array('property', 
'location_1')
                                        ),
                                        'control_item' => array
@@ -105,7 +105,7 @@
                                        'calendar_overview' => array
                                        (
                                                'text'  => 
lang('Calendar_overview'),
-                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'controller.uicalendar.view_calendar_for_month', 'year' => '2011', 'month' => 
'10') ),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'controller.uicalendar.view_calendar_for_year') ),
                                                'image' => array('property', 
'location_1'),
                                        )
                                );

Modified: branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php       
2012-01-22 19:08:35 UTC (rev 8645)
+++ branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php       
2012-01-22 19:51:52 UTC (rev 8646)
@@ -73,7 +73,7 @@
                                
$check_list->set_deadline($this->unmarshal($this->db->f('deadline', true), 
'int'));
                                
$check_list->set_planned_date($this->unmarshal($this->db->f('planned_date', 
true), 'int'));
                                
$check_list->set_completed_date($this->unmarshal($this->db->f('completed_date', 
true), 'int'));
-                               
$check_list->set_location_code($this->unmarshal($this->db->f('location_code', 
true), 'int'));
+                               
$check_list->set_location_code($this->unmarshal($this->db->f('location_code', 
true), 'string'));
                                
$check_list->set_component_id($this->unmarshal($this->db->f('component_id', 
true), 'int'));
                                
$check_list->set_num_open_cases($this->unmarshal($this->db->f('num_open_cases', 
true), 'int')); 
                        }
@@ -130,7 +130,7 @@
                                
$check_list->set_deadline($this->unmarshal($this->db->f('deadline', true), 
'int'));
                                
$check_list->set_planned_date($this->unmarshal($this->db->f('planned_date', 
true), 'int'));
                                
$check_list->set_completed_date($this->unmarshal($this->db->f('completed_date', 
true), 'int')); 
-                               
$check_list->set_location_code($this->unmarshal($this->db->f('location_code', 
true), 'int'));   
+                               
$check_list->set_location_code($this->unmarshal($this->db->f('location_code', 
true), 'string'));        
                        }
                                                
                        if($this->db->f('ci_id', true) != ''){
@@ -195,7 +195,7 @@
                        
$control->set_control_area_name($this->unmarshal($this->db->f('control_area_name',
 true), 'string'));
                        
$control->set_equipment_type_id($this->unmarshal($this->db->f('equipment_type_id',
 true), 'int'));
                        
$control->set_equipment_id($this->unmarshal($this->db->f('equipment_id', true), 
'int'));
-                       
$control->set_location_code($this->unmarshal($this->db->f('location_code', 
true), 'int'));
+                       
$control->set_location_code($this->unmarshal($this->db->f('location_code', 
true), 'string'));
                        
$control->set_repeat_type($this->unmarshal($this->db->f('repeat_type', true), 
'int'));
                        
$control->set_repeat_interval($this->unmarshal($this->db->f('repeat_interval', 
true), 'int'));
                                
@@ -233,7 +233,7 @@
                                
$check_list->set_planned_date($this->unmarshal($this->db->f('planned_date', 
true), 'int'));
                                
$check_list->set_completed_date($this->unmarshal($this->db->f('completed_date', 
true), 'int')); 
                                
$check_list->set_component_id($this->unmarshal($this->db->f('component_id', 
true), 'int'));
-                               
$check_list->set_location_code($this->unmarshal($this->db->f('location_code', 
true), 'int'));
+                               
$check_list->set_location_code($this->unmarshal($this->db->f('location_code', 
true), 'string'));
                                
$check_list->set_num_open_cases($this->unmarshal($this->db->f('num_open_cases', 
true), 'int'));
                                
                                $check_items_array = array();
@@ -324,7 +324,7 @@
                $sql .= "AND cl.control_id = c.id ";
                $sql .= "AND cl.deadline >= $from_date_ts AND $to_date_ts > 
cl.deadline ";
                $sql .= "GROUP BY c.id";
-                       
+               
                $this->db->query($sql);
                
                if ($this->db->next_record() & $this->db->f('count', true) > 0) 
{
@@ -370,7 +370,7 @@
                                
$control->set_start_date($this->unmarshal($this->db->f('start_date', true), 
'int'));
                                
$control->set_end_date($this->unmarshal($this->db->f('end_date', true), 'int'));
                                
$control->set_control_area_id($this->unmarshal($this->db->f('control_area_id', 
true), 'int'));
-                               
$control->set_location_code($this->unmarshal($this->db->f('c_location_code', 
true), 'int'));
+                               
$control->set_location_code($this->unmarshal($this->db->f('c_location_code', 
true), 'string'));
                                
$control->set_repeat_type($this->unmarshal($this->db->f('repeat_type', true), 
'int'));
                                
$control->set_repeat_interval($this->unmarshal($this->db->f('repeat_interval', 
true), 'int'));
                                                                
@@ -384,7 +384,7 @@
                        
$check_list->set_planned_date($this->unmarshal($this->db->f('planned_date', 
true), 'int'));
                        
$check_list->set_completed_date($this->unmarshal($this->db->f('completed_date', 
true), 'int')); 
                        
$check_list->set_component_id($this->unmarshal($this->db->f('cl_component_id', 
true), 'int'));
-                       
$check_list->set_location_code($this->unmarshal($this->db->f('cl_location_code',
 true), 'int'));
+                       
$check_list->set_location_code($this->unmarshal($this->db->f('cl_location_code',
 true), 'string'));
                        
$check_list->set_num_open_cases($this->unmarshal($this->db->f('num_open_cases', 
true), 'int'));
                        
                        $check_lists_array[] = $check_list;
@@ -437,7 +437,7 @@
                        
$check_list->set_planned_date($this->unmarshal($this->db->f('planned_date', 
true), 'int'));
                        
$check_list->set_completed_date($this->unmarshal($this->db->f('completed_date', 
true), 'int')); 
                        
$check_list->set_component_id($this->unmarshal($this->db->f('cl_component_id', 
true), 'int'));
-                       
$check_list->set_location_code($this->unmarshal($this->db->f('cl_location_code',
 true), 'int'));
+                       
$check_list->set_location_code($this->unmarshal($this->db->f('cl_location_code',
 true), 'string'));
                        
$check_list->set_num_open_cases($this->unmarshal($this->db->f('num_open_cases', 
true), 'int'));
                        
                        $check_lists_array[] = $check_list;
@@ -540,7 +540,7 @@
                        
$control->set_control_area_name($this->unmarshal($this->db->f('control_area_name',
 true), 'string'));
                        
$control->set_equipment_type_id($this->unmarshal($this->db->f('equipment_type_id',
 true), 'int'));
                        
$control->set_equipment_id($this->unmarshal($this->db->f('equipment_id', true), 
'int'));
-                       
$control->set_location_code($this->unmarshal($this->db->f('location_code', 
true), 'int'));
+                       
$control->set_location_code($this->unmarshal($this->db->f('location_code', 
true), 'string'));
                        
$control->set_repeat_type($this->unmarshal($this->db->f('repeat_type', true), 
'int'));
                        
$control->set_repeat_interval($this->unmarshal($this->db->f('repeat_interval', 
true), 'int'));
                }
@@ -569,7 +569,7 @@
                        $this->marshal($check_list->get_deadline(), 'int'),
                        $this->marshal($check_list->get_planned_date(), 'int'),
                        $this->marshal($check_list->get_completed_date(), 
'int'),
-                       $this->marshal($check_list->get_location_code(), 'int'),
+                       $this->marshal($check_list->get_location_code(), 
'string'),
                        $this->marshal($check_list->get_component_id(), 'int'),
                        $this->marshal($check_list->get_num_open_cases(), 'int')
                );
@@ -590,7 +590,7 @@
                        'deadline = ' . 
$this->marshal($check_list->get_deadline(), 'int'),
                        'planned_date = ' . 
$this->marshal($check_list->get_planned_date(), 'int'),
                        'completed_date = ' . 
$this->marshal($check_list->get_completed_date(), 'int'),
-                       'location_code = ' . 
$this->marshal($check_list->get_location_code(), 'int'),
+                       'location_code = ' . 
$this->marshal($check_list->get_location_code(), 'string'),
                        'component_id = ' . 
$this->marshal($check_list->get_component_id(), 'int'),
                        'num_open_cases = ' . 
$this->marshal($check_list->get_num_open_cases(), 'int')
                );

Modified: branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php  
2012-01-22 19:08:35 UTC (rev 8645)
+++ branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php  
2012-01-22 19:51:52 UTC (rev 8646)
@@ -118,7 +118,7 @@
                        
                        $sql  = "SELECT distinct c.* FROM 
controller_control_location_list cll "; 
                        $sql .= "LEFT JOIN controller_control c on 
cll.control_id=c.id ";
-                       $sql .= "WHERE cll.location_code = $location_code ";
+                       $sql .= "WHERE cll.location_code = '$location_code' ";
                        
                        if( is_numeric($repeat_type) )
                                $sql .= "AND c.repeat_type = $repeat_type ";
@@ -141,7 +141,7 @@
                                
$control->set_control_area_id($this->unmarshal($this->db->f('control_area_id', 
true), 'int'));
                                
$control->set_component_type_id($this->unmarshal($this->db->f('component_type_id',
 true), 'int'));
                                
$control->set_component_id($this->unmarshal($this->db->f('component_id', true), 
'int'));
-                               
$control->set_location_code($this->unmarshal($this->db->f('location_code', 
true), 'int'));
+                               
$control->set_location_code($this->unmarshal($this->db->f('location_code', 
true), 'string'));
                                
$control->set_repeat_type($this->unmarshal($this->db->f('repeat_type', true), 
'int'));
                                
$control->set_repeat_interval($this->unmarshal($this->db->f('repeat_interval', 
true), 'int'));
                                
@@ -182,7 +182,7 @@
                                
$control->set_control_area_name($this->unmarshal($this->db->f('control_area_name',
 true), 'string'));
                                
$control->set_component_type_id($this->unmarshal($this->db->f('component_type_id',
 true), 'int'));
                                
$control->set_component_id($this->unmarshal($this->db->f('component_id', true), 
'int'));
-                               
$control->set_location_code($this->unmarshal($this->db->f('location_code', 
true), 'int'));
+                               
$control->set_location_code($this->unmarshal($this->db->f('location_code', 
true), 'string'));
                                
$control->set_repeat_type($this->unmarshal($this->db->f('repeat_type', true), 
'int'));
                                
$control->set_repeat_interval($this->unmarshal($this->db->f('repeat_interval', 
true), 'int'));
 
@@ -212,7 +212,7 @@
                        while($this->db->next_record()) {
                                $control_id = 
$this->unmarshal($this->db->f('id', true), 'int');
                                $title = $this->unmarshal($this->db->f('title', 
true), 'string');
-                               $location_code = 
$this->unmarshal($this->db->f('location_code', true), 'int');
+                               $location_code = 
$this->unmarshal($this->db->f('location_code', true), 'strign');
 
                                $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
 
@@ -355,7 +355,7 @@
        //                      
$control->set_control_group_id($this->unmarshal($this->db->f('control_group_id',
 true), 'int'));
                                
$control->set_component_type_id($this->unmarshal($this->db->f('component_type_id',
 true), 'int'));
                                
$control->set_component_id($this->unmarshal($this->db->f('component_id', true), 
'int'));
-                               
$control->set_location_code($this->unmarshal($this->db->f('location_code', 
true), 'int'));
+                               
$control->set_location_code($this->unmarshal($this->db->f('location_code', 
true), 'string'));
                                
$control->set_repeat_type($this->unmarshal($this->db->f('repeat_type', true), 
'int'));
                                
$control->set_repeat_interval($this->unmarshal($this->db->f('repeat_interval', 
true), 'int'));
                        }
@@ -397,7 +397,7 @@
                        
$control->set_control_area_name($this->unmarshal($this->db->f('control_area_name',
 true), 'string'));
                        
$control->set_component_type_id($this->unmarshal($this->db->f('component_type_id',
 true), 'int'));
                        
$control->set_component_id($this->unmarshal($this->db->f('component_id', true), 
'int'));
-                       
$control->set_location_code($this->unmarshal($this->db->f('location_code', 
true), 'int'));
+                       
$control->set_location_code($this->unmarshal($this->db->f('location_code', 
true), 'string'));
                        
$control->set_repeat_type($this->unmarshal($this->db->f('repeat_type', true), 
'int'));
                        
$control->set_repeat_interval($this->unmarshal($this->db->f('repeat_interval', 
true), 'int'));
 

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-22 19:08:35 UTC (rev 8645)
+++ branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php 
2012-01-22 19:51:52 UTC (rev 8646)
@@ -96,10 +96,6 @@
                        
                        $to_date_ts = strtotime("$to_month/01/$year");
                                                                                
                
-                       if(empty($location_code)){
-                               $location_code = "1101";        
-                       }
-                       
                        $this->calendar_builder = new 
calendar_builder($from_date_ts, $to_date_ts);
                        
                        $repeat_type = 0;
@@ -114,6 +110,10 @@
                
                        $location_finder = new location_finder();
                        $my_locations = $location_finder->get_responsibilities( 
$criteria );
+
+                       if(empty($location_code)){
+                               $location_code = 
$my_locations[0]["location_code"];     
+                       }
                        
                        $controls_for_location_array = 
$this->so_control->get_controls_by_location($location_code, $from_date_ts, 
$to_date_ts, $repeat_type);
                
@@ -121,7 +121,8 @@
                        
                        $controls_with_check_list = 
$this->populate_controls_with_check_lists($controls_for_location_array, 
$control_id_with_check_list_array);
                        
-                       $controls_calendar_array = 
$this->calendar_builder->build_calendar_array( $controls_with_check_list, 31, 
"view_days" );
+                       $controls_calendar_array = array();
+                       $controls_calendar_array = 
$this->calendar_builder->build_calendar_array( $controls_calendar_array, 
$controls_with_check_list, 31, "view_days" );
 
                        $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
                        
@@ -134,6 +135,7 @@
                        $data = array
                        (               
                                'my_locations'                    => 
$my_locations,
+                               'view_location_code'      => $location_code,
                                'location_array'                  => 
$location_array,
                                'heading_array'                   => 
$heading_array,
                                'controls_calendar_array' => 
$controls_calendar_array,
@@ -156,7 +158,8 @@
                                foreach($control_id_with_check_list_array as 
$control_id){
                                        if($control->get_id() == 
$control_id->get_id())
                                                
$control->set_check_lists_array($control_id->get_check_lists_array());          
                                
-                               }       
+                               }
+                                       
                                $controls_with_check_list[] = $control;
                        }
                        
@@ -168,16 +171,16 @@
                        $location_code = phpgw::get_var('location_code');
                        $year = phpgw::get_var('year');
                        
+                       if(empty($year)){
+                               $year = date("Y");      
+                       }
+                       
                        $year = intval($year);
                                                
                        $from_date_ts = strtotime("01/01/$year");
                        $to_year = $year + 1;
                        $to_date_ts = strtotime("01/01/$to_year");      
                                                
-                       if(empty($location_code)){
-                               $location_code = "1101";        
-                       }
-                       
                        $criteria = array
                        (
                                'user_id' => 
$GLOBALS['phpgw_info']['user']['account_id'],
@@ -188,59 +191,33 @@
                
                        $location_finder = new location_finder();
                        $my_locations = $location_finder->get_responsibilities( 
$criteria );
+                       
+                       if(empty($location_code)){
+                               $location_code = 
$my_locations[0]["location_code"];     
+                       }
+                       
                        $repeat_type = null;
                        
                        $controls_for_location_array = 
$this->so_control->get_controls_by_location($location_code, $from_date_ts, 
$to_date_ts, $repeat_type );
-
+                       
                        $this->calendar_builder = new 
calendar_builder($from_date_ts, $to_date_ts);
+               
+                       $controls_calendar_array = array();
 
+                       // Puts aggregate values for daily controls in a twelve 
month array 
                        foreach($controls_for_location_array as $control){
-                               
                                if($control->get_repeat_type() == 0){
-                                       
-                                       $twelve_month_array = array();
-                                                               
-                                       $trail_year = $year;
-                                       
-                                       
for($from_month=1;$from_month<=12;$from_month++){
-                               
-                                               $trail_from_date_ts = 
strtotime("$from_month/01/$trail_year");
-                                               
-                                               if(($from_month + 1) > 12)
-                                               {
-                                                       $to_month = 1;
-                                                       $cal_to_year = $year + 
1;
-                                               }
-                                               else
-                                               {
-                                                       $to_month = $from_month 
+ 1;
-                                               }
-                                               
-                                               $trail_to_date_ts = 
strtotime("$to_month/01/$trail_year");
-                                               
-                                               
$num_open_cases_for_control_array = array();
-                                               
$num_open_cases_for_control_array = 
$this->so_check_list->get_num_open_cases_for_control( $control->get_id(), 
$location_code, $trail_from_date_ts, $trail_to_date_ts ); 
-                               
-                                               $status = 
"control_agg_accomplished_with_errors";
-                                                       
-                                               
$twelve_month_array[$from_month-1]["status"] = $status;
-                                               
$twelve_month_array[$from_month-1]["info"] = 
$num_open_cases_for_control_array["count"];
-                                               
-                                       }
-                               
-                                       $days_controls_calendar_array[] = 
array("control" => $control->toArray(), "calendar_array" => 
$twelve_month_array);
+                                       $controls_calendar_array = 
$this->calendar_builder->build_agg_calendar_array($controls_calendar_array, 
$control, $location_code, $year);
                                }
-                                       
                        }
                        
-
                        $repeat_type = 2;
                        $control_check_list_array = 
$this->so->get_check_lists_for_location( $location_code, $from_date_ts, 
$to_date_ts, $repeat_type );
                        
-                       $month_controls_calendar_array = 
$this->calendar_builder->build_calendar_array( $control_check_list_array, 12, 
"view_months" );
-                                       
-                       $controls_calendar_array = 
array_merge($days_controls_calendar_array, $month_controls_calendar_array);
+                       $controls_calendar_array = 
$this->calendar_builder->build_calendar_array( $controls_calendar_array, 
$control_check_list_array, 12, "view_months" );
                        
+                       //print_r($controls_calendar_array);
+                                       
                        $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
                        
                        $heading_array = array("Jan", "Feb", "Mar", "Apr", 
"Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des");
@@ -248,6 +225,7 @@
                        $data = array
                        (
                                'my_locations'                    => 
$my_locations,
+                               'view_location_code'      => $location_code,
                                'location_array'                  => 
$location_array,
                                'heading_array'                   => 
$heading_array,
                                'controls_calendar_array' => 
$controls_calendar_array,
@@ -262,7 +240,8 @@
                        self::add_javascript('controller', 'controller', 
'ajax.js');
                }
                
-               
+               /* Kommentert ut av Torstein 21.01.2012 - Tror ikke vi bruker 
denne... Kanskje den bør slettes...
+                * 
                public function view_check_lists_for_location()
                {
                        $control_id = phpgw::get_var('control_id');
@@ -294,7 +273,10 @@
                        self::add_javascript('controller', 'controller', 
'ajax.js');
                        
self::render_template_xsl('view_check_lists_for_location', $data);
                }
-                               
+               */
+
+               /* Kommentert ut av Torstein 21.01.2012 - Tror ikke vi bruker 
denne... Kanskje den bør slettes...
+                * 
                public function view_check_lists_for_control()
                {
                        $control_id = phpgw::get_var('id');
@@ -313,7 +295,10 @@
                        
                        self::render_template_xsl('view_check_lists', $data);
                }
+               */
                
+               /* Kommentert ut av Torstein 21.01.2012 - Tror ikke vi bruker 
denne... Kanskje den bør slettes...
+                * 
                public function view_control_items_for_control()
                {
                        $control_id = phpgw::get_var('control_id');
@@ -339,6 +324,7 @@
                                                                
                        self::render_template_xsl('view_check_list', $data);
                }
+               */
                
                public function save_check_items(){
                        $check_item_ids = phpgw::get_var('check_item_ids');
@@ -359,6 +345,8 @@
                        $this->redirect(array('menuaction' => 
'controller.uicheck_list.view_check_list', 'check_list_id'=>$check_list_id));   
  
                }
                
+               /* Kommentert ut av Torstein 21.01.2012 - Tror ikke vi bruker 
denne... Kanskje den bør slettes...
+                * 
                public function save_check_list(){
                        $control_id = phpgw::get_var('control_id');
                        $control = $this->so_control->get_single($control_id);
@@ -401,7 +389,10 @@
                        
                        $this->redirect(array('menuaction' => 
'controller.uicheck_list.view_check_list_for_control', 
'control_id'=>$control_id));       
                }
+               */
                
+               /* Kommentert ut av Torstein 21.01.2012 - Tror ikke vi bruker 
denne... Kanskje den bør slettes...
+                * 
                public function make_check_list_for_control(){
                        $control_id = phpgw::get_var('control_id');
                        $control = $this->so_control->get_single($control_id);
@@ -444,7 +435,10 @@
                        
                        $this->redirect(array('menuaction' => 
'controller.uicheck_list.view_check_list_for_control', 
'control_id'=>$control_id));       
                }
+               */
                
+               /* Kommentert ut av Torstein 21.01.2012 - Tror ikke vi bruker 
denne... Kanskje den bør slettes...
+                * 
                public function query()
                {
                        $params = array(
@@ -485,6 +479,7 @@
                                $control = $this->so->get_single($control_id);
                        }
 */
+               /*
                        $result_objects = $this->so->get($start_index, 
$num_of_objects, $sort_field, $sort_ascending, $search_for, $search_type, 
$filters);
                        $object_count = $this->so->get_count($search_for, 
$search_type, $filters);
                        //var_dump($result_objects);
@@ -505,4 +500,7 @@
 
                        return $this->yui_results($results);
                }
+               */
+               
+               public function query(){}
        }
\ No newline at end of file

Modified: branches/Version-1_0-branch/controller/inc/class.uicase.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicase.inc.php     
2012-01-22 19:08:35 UTC (rev 8645)
+++ branches/Version-1_0-branch/controller/inc/class.uicase.inc.php     
2012-01-22 19:51:52 UTC (rev 8646)
@@ -148,8 +148,11 @@
                        
                        $categories     = 
$catsObj->formatted_xslt_list(array('select_name' => 
'values[cat_id]','selected' => $this->cat_id, 'use_acl' => 
$this->_category_acl));
 
+                       $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
+                       
                        $data = array
                        (
+                               'location_array'        => $location_array,
                                'categories'                    => $categories,
                                'check_list'                    => 
$check_list->toArray(),
                                'control'                               => 
$control->toArray(),

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-22 19:08:35 UTC (rev 8645)
+++ branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php       
2012-01-22 19:51:52 UTC (rev 8646)
@@ -51,9 +51,9 @@
                (
                        'index' =>      true,
                        'view_check_lists_for_control'          =>      true,
-                       'save_check_list'                                       
=>      true,
+               //      'save_check_list'                                       
=>      true,
                        'view_check_list'                                       
=>      true,
-                       'edit_check_list'                                       
=>      true,
+               //      'edit_check_list'                                       
=>      true,
                        'save_check_items'                                      
=>      true,
                        'save_check_item'                                       
=>      true,
                        'get_check_list_info'                           =>      
true,
@@ -177,7 +177,9 @@
 
                        self::render_template_xsl('datatable', $data);
                }
-
+               
+               /* Kommentert ut av Torstein 21.01.2012 - Tror ikke vi bruker 
denne... Kanskje den bør slettes...
+               * 
                public function view_check_list()
                {
                        $check_list_id = phpgw::get_var('check_list_id');
@@ -193,7 +195,8 @@
 
                        self::render_template_xsl('view_check_list', $data);
                }
-
+               */
+       
                // Returns check list info as JSON
                public function get_check_list_info()
                {
@@ -212,6 +215,8 @@
                        return json_encode( $check_items_with_cases );
                }
 
+               /* Kommentert ut av Torstein 21.01.2012 - Tror ikke vi bruker 
denne... Kanskje den bør slettes...
+               * 
                public function edit_check_list()
                {
                        $check_list_id = phpgw::get_var('check_list_id');
@@ -227,7 +232,7 @@
 
                        self::render_template_xsl('edit_check_list', $data);
                }
-               
+               */
                public function update_check_list(){
                        $check_list_id = phpgw::get_var('check_list_id');
                        $status = (int)phpgw::get_var('status');
@@ -253,7 +258,9 @@
                        else
                                return json_encode( array( "saveStatus" => 
"not_updated" ) );
                }
-
+               
+               /* Kommentert ut av Torstein 21.01.2012 - Tror ikke vi bruker 
denne... Kanskje den bør slettes...
+               * 
                public function control_calendar_status_overview()
                {
                        $control_id = phpgw::get_var('control_id');
@@ -272,7 +279,8 @@
 
                        
self::render_template_xsl('control_calendar_status_overview', $data);
                }
-
+               */
+               
                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);
@@ -368,7 +376,8 @@
                        $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());
+                                                               
                        // Fetches all control items for check list
                        $control_items_for_check_list = array();
                        
@@ -389,10 +398,14 @@
                                }
                        }
                        
+                       $location_array = execMethod( 
'property.bolocation.read_single', array('location_code' => 
$check_list->get_location_code()) );
+                       
                        $data = array
                        (
+                               'control'                                       
        => $control->toArray(),
+                               'check_list'                                    
=> $check_list->toArray(),
+                               'location_array'        => $location_array,
                                'control_items_for_check_list'  => 
$control_items_for_check_list,
-                               'check_list'                                    
=> $check_list->toArray()
                        );
                        
                        
self::render_template_xsl(array('check_list/check_list_tab_menu', 
'check_list/register_case'), $data);
@@ -449,7 +462,9 @@
                        
                        self::render_template_xsl( 
array('check_list/cases_tab_menu', 'check_list/view_measurements'), $data );
                }
-                               
+
+               /* Kommentert ut av Torstein 21.01.2012 - Tror ikke vi bruker 
denne... Kanskje den bør slettes...
+               * 
                public function view_check_lists_for_control()
                {
                        $control_id = phpgw::get_var('id');
@@ -468,7 +483,10 @@
 
                        self::render_template_xsl('view_check_lists', $data);
                }
-
+               */
+               
+               /* Kommentert ut av Torstein 21.01.2012 - Tror ikke vi bruker 
denne... Kanskje den bør slettes...
+               * 
                public function view_control_items_for_control()
                {
                        $control_id = phpgw::get_var('control_id');
@@ -494,7 +512,8 @@
 
                        self::render_template_xsl('view_check_list', $data);
                }
-
+               */
+               
                public function save_check_items(){
                        $check_item_ids = phpgw::get_var('check_item_ids');
                        $check_list_id = phpgw::get_var('check_list_id');
@@ -570,7 +589,9 @@
                        else
                                return json_encode( array( "saveStatus" => 
"not_saved" ) );
                }
-
+               
+               /* Kommentert ut av Torstein 21.01.2012 - Tror ikke vi bruker 
denne... Kanskje den bør slettes...
+                * 
                public function save_check_list(){
                        $control_id = phpgw::get_var('control_id');
                        $control = $this->so_control->get_single($control_id);
@@ -580,8 +601,7 @@
                        $repeat_type = $control->get_repeat_type();
                        $repeat_interval = $control->get_repeat_interval();
 
-                       $status = "FALSE";
-                       $comment = "Kommentar for sjekkliste";
+               
                        $deadline = $start_date;
 
                        // Saving check_list
@@ -613,7 +633,10 @@
 
                        $this->redirect(array('menuaction' => 
'controller.uicheck_list.view_check_list_for_control', 
'control_id'=>$control_id));
                }
-
+               */
+               
+               /* Kommentert ut av Torstein 21.01.2012 - Tror ikke vi bruker 
denne... Kanskje den bør slettes...
+                * 
                public function make_check_list_for_control(){
                        $control_id = phpgw::get_var('control_id');
                        $control = $this->so_control->get_single($control_id);
@@ -656,7 +679,8 @@
 
                        $this->redirect(array('menuaction' => 
'controller.uicheck_list.view_check_list_for_control', 
'control_id'=>$control_id));
                }
-
+               */
+               
                public function query()
                {
                        $params = array(

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-22 19:08:35 UTC (rev 8645)
+++ 
branches/Version-1_0-branch/controller/inc/class.uicheck_list_for_location.inc.php
  2012-01-22 19:51:52 UTC (rev 8646)
@@ -99,223 +99,6 @@
                        
self::set_active_menu('controller::control::location_for_check_list');
                }       
        
-               function index()
-               {
-                       if(phpgw::get_var('phpgw_return_as') == 'json') {
-                               return $this->query();
-                       }
-                       $building_types  = 
execMethod('property.soadmin_location.read',array());
-                       
-                       $type_id = 1;
-                       
-                       $category_types = 
$this->bocommon->select_category_list(array(
-                                                                               
                                                                
'format'=>'filter',
-                                                                               
                                                                'selected' => 
$this->cat_id,
-                                                                               
                                                                'type' 
=>'location',
-                                                                               
                                                                'type_id' 
=>$type_id,
-                                                                               
                                                                'order'=>'descr'
-                                                                               
                                                        ));
-                       
-                       $district_list  = 
$this->bocommon->select_district_list('filter',$this->district_id);
-                       $default_value = array ('id'=>'','name'=>lang('no 
district'));
-                       array_unshift($district_list,$default_value);
-                       
-                       $part_of_town_list =  
$this->bocommon->select_part_of_town('filter',$this->part_of_town_id,$this->district_id);
-                       $default_value = array ('id'=>'','name'=>lang('no part 
of town'));
-                       array_unshift($part_of_town_list,$default_value);
-                       
-                       $_role_criteria = array
-                                       (
-                                               'type'          => 
'responsibility_role',
-                                               'filter'        => 
array('location' => ".location.{$type_id}"),
-                                               'order'         => 'name'
-                                       );
-
-                       $responsibility_roles_list =   
execMethod('property.sogeneric.get_list',$_role_criteria);
-                       $default_value = array ('id'=>'','name'=>lang('no 
role'));
-                       array_unshift ($responsibility_roles,$default_value);
-                       
-                       $control_areas_array = 
$this->so_control_area->get_control_areas_as_array();
-                       $controls_array = 
$this->so_control->get_controls_by_control_area($control_areas_array[0]['id']);
-                       $control_id = $control_areas_array[0]['id'];
-                       
-                       if($control_id == null)
-                               $control_id = 0;
-                       
-                       $tabs = array( array(
-                                               'label' => 
lang('View_locations_for_control')
-                                       ), array(
-                                               'label' => 
lang('Add_locations_for_control'),
-                                               'link'  => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'controller.uicheck_list_for_location.add_location_to_control'))
-                                       ));
-                       
-                       $data = array(
-                               'tabs'                                  => 
$GLOBALS['phpgw']->common->create_tabs($tabs, 0),
-                               'view'                                  => 
"view_locations_for_control",
-                               'control_area_array'    => $control_areas_array,
-                               'control_array'                 => 
$control_array,
-                               'locations_table' => array(
-                                       'source' => 
self::link(array('menuaction' => 
'controller.uicontrol.get_locations_for_control', 'control_id' => $control_id 
,'phpgw_return_as' => 'json')),
-                                       'field' => array(
-                                               array(
-                                                       'key' => 'id',
-                                                       'label' => 
lang('ControlId'),
-                                                       'sortable'      => true,
-                                               ),
-                                               array(
-                                                       'key'   =>      'title',
-                                                       'label' =>      
lang('Property name'),
-                                                       'sortable'      =>      
false
-                                               ),
-                                               array(
-                                                       'key' => 
'location_code',
-                                                       'label' => 
lang('location_code'),
-                                                       'sortable'      => false
-                                               ),
-                                               array(
-                                                       'key' => 'loc1_name',
-                                                       'label' => 
lang('Location_name'),
-                                                       'sortable'      => false
-                                               ),
-                                               array(
-                                                       'key' => 'actions',
-                                                       'hidden' => true
-                                               ),
-                                               array(
-                                                       'key' => 'labels',
-                                                       'hidden' => true
-                                               ),
-                                               array(
-                                                       'key' => 'ajax',
-                                                       'hidden' => true
-                                               ),array(
-                                                       'key' => 'parameters',
-                                                       'hidden' => true
-                                               )                               
                
-                                       )
-                               )
-                       );
-                       
-                       phpgwapi_yui::load_widget('paginator');
-                       
-                       self::add_javascript('controller', 'yahoo', 
'control_tabs.js');
-                       self::add_javascript('controller', 'controller', 
'jquery.js');
-                       self::add_javascript('controller', 'controller', 
'ajax.js');
-
-                       
self::render_template_xsl(array('control_location_tabs', 'common', 
'view_locations_for_control'), $data);               
-               }
-               
-               function add_location_to_control()
-               {
-                       if(phpgw::get_var('phpgw_return_as') == 'json') {
-                               return $this->query();
-                       }
-                       $building_types  = 
execMethod('property.soadmin_location.read',array());
-                       
-                       $type_id = 1;
-                       
-                       $category_types = 
$this->bocommon->select_category_list(array(
-                                                                               
                                                                
'format'=>'filter',
-                                                                               
                                                                'selected' => 
$this->cat_id,
-                                                                               
                                                                'type' 
=>'location',
-                                                                               
                                                                'type_id' 
=>$type_id,
-                                                                               
                                                                'order'=>'descr'
-                                                                               
                                                        ));
-                       
-                       $district_list  = 
$this->bocommon->select_district_list('filter',$this->district_id);
-                       $default_value = array ('id'=>'','name'=>lang('no 
district'));
-                       array_unshift($district_list,$default_value);
-                       
-                       $part_of_town_list =  
$this->bocommon->select_part_of_town('filter',$this->part_of_town_id,$this->district_id);
-                       $default_value = array ('id'=>'','name'=>lang('no part 
of town'));
-                       array_unshift($part_of_town_list,$default_value);
-                       
-                       $_role_criteria = array
-                                       (
-                                               'type'          => 
'responsibility_role',
-                                               'filter'        => 
array('location' => ".location.{$type_id}"),
-                                               'order'         => 'name'
-                                       );
-
-                       $responsibility_roles_list = 
execMethod('property.sogeneric.get_list',$_role_criteria);
-                       $default_value = array ('id'=>'','name'=>lang('no 
role'));
-                       array_unshift ($responsibility_roles,$default_value);
-                       
-                       $control_areas_array = 
$this->so_control_area->get_control_areas_as_array();
-                       
-                       $tabs = array( array(
-                                               'label' => 
lang('View_locations_for_control'),
-                                               'link'  => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'controller.uicheck_list_for_location.index'))
-                       
-                                       ), array(
-                                               'label' => 
lang('Add_locations_for_control')
-                                       ));
-                                       
-                       $data = array(
-                               'tabs'                                          
=> $GLOBALS['phpgw']->common->create_tabs($tabs, 1),
-                               'view'                                          
=> "add_location_to_control",
-                               'control_filters'                       => 
array(
-                                       'control_area_array'            => 
$control_areas_array,
-                                       'control_array'                         
=> $control_array
-                               ),
-                               'filter_form'                           => 
array(
-                                       'building_types'                        
=> $building_types,
-                                       'category_types'                        
=> $category_types,
-                                       'district_list'                         
=> $district_list,
-                                       'part_of_town_list'             => 
$part_of_town_list
-                               ),
-                               'datatable' => array(
-                                       'source' => 
self::link(array('menuaction' => 'controller.uicheck_list_for_location.index', 
'phpgw_return_as' => 'json')),
-                                       'field' => array(
-                                               array(
-                                                       'key' => 
'location_code',
-                                                       'label' => 
lang('Property'),
-                                                       'sortable'      => true,
-                                                       'formatter' => 
'YAHOO.portico.formatLink'
-                                               ),
-                                               array(
-                                                       'key'   =>      
'loc1_name',
-                                                       'label' =>      
lang('Property name'),
-                                                       'sortable'      =>      
false
-                                               ),
-                                               array(
-                                                       'key' => 'adresse1',
-                                                       'label' => 
lang('Address'),
-                                                       'sortable'      => false
-                                               ),
-                                               array(
-                                                       'key' => 'postnummer',
-                                                       'label' => lang('Zip 
code'),
-                                                       'sortable'      => false
-                                               ),
-                                               array(
-                                                       'key' => 'actions',
-                                                       'hidden' => true
-                                               ),
-                                               array(
-                                                       'key' => 'labels',
-                                                       'hidden' => true
-                                               ),
-                                               array(
-                                                       'key' => 'ajax',
-                                                       'hidden' => true
-                                               ),array(
-                                                       'key' => 'parameters',
-                                                       'hidden' => true
-                                               )                               
                
-                                       )
-                               )
-                       );
-                       
-                       phpgwapi_yui::load_widget('paginator');
-                       
-                       self::add_javascript('controller', 'yahoo', 
'control_tabs.js');
-                       self::add_javascript('controller', 'controller', 
'jquery.js');
-                       self::add_javascript('controller', 'controller', 
'ajax.js');
-
-                       
self::render_template_xsl(array('control_location_tabs', 'common', 
'add_location_to_control'), $data);          
-               }
-               
                function add_check_list(){
                        $location_code = phpgw::get_var('location_code');
                        $control_id = phpgw::get_var('control_id');
@@ -371,6 +154,7 @@
                        $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());
                        
                        $date_format = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
                        $location_code = $check_list->get_location_code();
@@ -379,9 +163,10 @@
                                                
                        $data = array
                        (
-                               'check_list'                                    
=> $check_list->toArray(),
-                               'location_array'                                
=> $location_array,
-                               'date_format'                                   
=> $date_format
+                               'control'                       => 
$control->toArray(),
+                               'check_list'            => 
$check_list->toArray(),
+                               'location_array'        => $location_array,
+                               'date_format'           => $date_format
                        );
                        
                        self::add_javascript('controller', 'controller', 
'jquery.js');
@@ -398,7 +183,8 @@
                        $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());
+                               
                        $date_format = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
                        $location_code = $check_list->get_location_code();
        
@@ -406,9 +192,10 @@
                        
                        $data = array
                        (
-                               'check_list'                                    
=> $check_list->toArray(),
-                               'location_array'                                
=> $location_array,
-                               'date_format'                                   
=> $date_format
+                               'control'                       => 
$control->toArray(),
+                               'check_list'            => 
$check_list->toArray(),
+                               'location_array'        => $location_array,
+                               'date_format'           => $date_format
                        );
                        
                        self::add_javascript('controller', 'controller', 
'jquery.js');
@@ -531,49 +318,5 @@
                        
self::render_template_xsl(array('check_list/check_list_tab_menu','check_list/view_control_info'),
 $data);
                }
                
-               public function query(){
-                       $type_id = phpgw::get_var('type_id');
-                       $return_results = phpgw::get_var('results', 'int', 
'REQUEST', 0);
-                       
-                       $type_id = $type_id ? $type_id : 1;
-                       
-                       $location_list = array();
-
-                       $this->bo->sort = "ASC";
-                       $this->bo->start = phpgw::get_var('startIndex');
-                       
-                       $location_list = $this->bo->read(array('user_id' => 
$user_id, 'role_id' =>$role_id, 
'type_id'=>$type_id,'lookup_tenant'=>$lookup_tenant,
-                                                                               
                   'lookup'=>$lookup,'allrows'=>$this->allrows,'dry_run' 
=>$dry_run));
-
-                       $rows_total = $this->bo->read(array('type_id' => 
$type_id, 'allrows' => true));
-                       
-                       foreach($location_list as $location)
-                       {
-                               $results['results'][]= $location;       
-                       }
-                       
-                       $results['total_records'] = count($rows_total);
-                       $results['start'] = $this->start;
-                       $results['sort'] = 'location_code';
-                       $results['dir'] = "ASC";
-                                               
-                       array_walk($results['results'], array($this, 
'add_actions'), array($type));
-                                                       
-                       return $this->yui_results($results);
-               }
-                       
-               public function add_actions(&$value, $key, $params)
-               {
-                       unset($value['query_location']);
-                       
-                       $value['ajax'] = array();
-                       $value['actions'] = array();
-                       $value['labels'] = array();
-                       $value['parameters'] = array();
-                       
-                       $value['ajax'][] = true;
-                       $value['actions'][] = 
html_entity_decode(self::link(array('menuaction' => 
'controller.uicontrol.add_location_to_control', 'location_code' => 
$value['location_code'])));
-                       $value['labels'][] = lang('add_location');
-                       $value['parameters'][] = "control_id";
-               }
+               public function query(){}                       
        }

Modified: branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php  
2012-01-22 19:08:35 UTC (rev 8645)
+++ branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php  
2012-01-22 19:51:52 UTC (rev 8646)
@@ -243,8 +243,6 @@
                                $control = $this->so->get_single($control_id);
                        }
 
-                       $control_areas_array = 
$this->so_control_area->get_control_areas_as_array();
-
                        // Sigurd: START as categories
                        $cats   = CreateObject('phpgwapi.categories', -1, 
'controller', '.control');
                        $cats->supress_info     = true;
@@ -262,9 +260,9 @@
                        }
                        // END as categories
 
-                       // Fetches prosedures that are related to first control 
area in list
-                       $control_area_id = $control_areas_array[0]['id'];
-                       $procedures_array = 
$this->so_procedure->get_procedures_by_control_area_id($control_area_id);
+                       echo "Control area id: " . 
$control->get_control_area_id();
+                       
+                       $procedures_array = 
$this->so_procedure->get_procedures_by_control_area_id($control->get_control_area_id());
                        $role_array = $this->so->get_roles();
                        
                        $tabs = array( array(
@@ -282,8 +280,7 @@
                                'tabs'                                          
=> $GLOBALS['phpgw']->common->create_tabs($tabs, 0),
                                'view'                                          
=> "control_details",
                                'editable'                                      
=> true,
-                               'control'                                       
=> (isset($control)) ? $control->toArray(): null,
-                               'control_areas_array'           => 
$control_areas_array,
+                               'control'                                       
=> $control->toArray(),
                                'control_areas_array2'          => 
array('options' => $control_areas_array2),
                                'procedures_array'                      => 
$procedures_array,
                                'role_array'                            => 
$role_array
@@ -649,6 +646,8 @@
                        $this->redirect(array('menuaction' => 
'controller.uicontrol.view_check_lists_for_control', 'control_id'=>$control_id 
));
                }
                
+               /* Kommentert ut av Torstein 21.01.2012 - Tror ikke vi bruker 
denne... Kanskje den bør slettes...
+                * 
                public function view_check_lists_for_control()
                {
                        $control_id = phpgw::get_var('control_id');
@@ -690,7 +689,8 @@
                        self::render_template_xsl(array('control/control_tabs', 
'tab_view_check_lists'), $data);
                        self::add_javascript('controller', 'yahoo', 
'control_tabs.js');
                }
-                       
+               */      
+               
                // Returns control list info as JSON
                public function get_controls_by_control_area()
                {

Modified: 
branches/Version-1_0-branch/controller/inc/class.uicontrol_group.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicontrol_group.inc.php    
2012-01-22 19:08:35 UTC (rev 8645)
+++ branches/Version-1_0-branch/controller/inc/class.uicontrol_group.inc.php    
2012-01-22 19:51:52 UTC (rev 8646)
@@ -365,7 +365,7 @@
                                $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('controller') . '::' . lang('Control_group');
 
                                self::add_javascript('controller', 'yahoo', 
'control_tabs.js');
-                               
self::render_template_xsl(array('control_group_tabs','control_group','control_group_items'),
 $data);
+                               
self::render_template_xsl(array('control_group/control_group_tabs','control_group/control_group','control_group/control_group_items'),
 $data);
                        }
                        else if(isset($_POST['save_control_group_items']))
                        {
@@ -490,7 +490,7 @@
        //                      $GLOBALS['phpgw']->js->validate_file( 'yahoo', 
'controller.item', 'controller' );
 
                                self::add_javascript('controller', 'yahoo', 
'control_tabs.js');
-                               
self::render_template_xsl(array('control_group_tabs','control_group','control_group_items'),
 $data);
+                               
self::render_template_xsl(array('control_group/control_group_tabs','control_group/control_group','control_group/control_group_items'),
 $data);
                        }
                }
 
@@ -654,7 +654,7 @@
                                $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('controller') . '::' . lang('Control group');
 
                                self::add_javascript('controller', 'yahoo', 
'control_tabs.js');
-                               
self::render_template_xsl(array('control_group_tabs','control_group','control_group_items'),
 $data);
+                               
self::render_template_xsl(array('control_group/control_group_tabs','control_group/control_group','control_group/control_group_items'),
 $data);
                        }
                }
 

Copied: 
branches/Version-1_0-branch/controller/inc/class.uicontrol_location.inc.php 
(from rev 8645, trunk/controller/inc/class.uicontrol_location.inc.php)
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicontrol_location.inc.php 
                        (rev 0)
+++ branches/Version-1_0-branch/controller/inc/class.uicontrol_location.inc.php 
2012-01-22 19:51:52 UTC (rev 8646)
@@ -0,0 +1,364 @@
+<?php
+       /**
+       * phpGroupWare - controller: a part of a Facilities Management System.
+       *
+       * @author Erink Holm-Larsen <address@hidden>
+       * @author Torstein Vadla <address@hidden>
+       * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * This file is part of phpGroupWare.
+       *
+       * phpGroupWare is free software; you can redistribute it and/or modify
+       * it under the terms of the GNU General Public License as published by
+       * the Free Software Foundation; either version 2 of the License, or
+       * (at your option) any later version.
+       *
+       * phpGroupWare is distributed in the hope that it will be useful,
+       * but WITHOUT ANY WARRANTY; without even the implied warranty of
+       * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+       * GNU General Public License for more details.
+       *
+       * You should have received a copy of the GNU General Public License
+       * along with phpGroupWare; if not, write to the Free Software
+       * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 
 USA
+       *
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/
+       * @package property
+       * @subpackage controller
+       * @version $Id: class.uicheck_list_for_location.inc.php 8628 2012-01-21 
10:42:05Z vator $
+       */
+       
+       phpgw::import_class('phpgwapi.yui');
+       phpgw::import_class('controller.uicommon');
+       phpgw::import_class('controller.socontrol_area');
+       
+       include_class('controller', 'check_list', 'inc/model/');
+       include_class('controller', 'date_generator', 'inc/component/');
+       include_class('controller', 'status_checker', 'inc/helper/');
+       include_class('controller', 'date_helper', 'inc/helper/');
+               
+       class controller_uicontrol_location extends controller_uicommon
+       {
+               var $cat_id;
+               var $start;
+               var $query;
+               var $sort;
+               var $order;
+               var $filter;
+               var $currentapp;
+               var $type_id;
+               var $location_code;
+               
+               private $so_control_area;
+               private $so_control;
+               private $so_check_list;
+               private $so_control_item;
+               private $so_check_item;
+               private $so_procedure;
+       
+               var $public_functions = array(
+                                                                               
'index' => true,
+                                                                               
'view_locations_for_control'    => true,
+                                                                               
'add_location_to_control'               => true,
+                                                                               
'add_check_list'                                => true,
+                                                                               
'save_check_list'                               => true,
+                                                                               
'edit_check_list'                               => true,
+                                                                               
'create_case_message'                   => true,
+                                                                               
'view_control_info'                     => true,
+                                                                               
'view_cases_for_check_list'             => true
+                                                                       );
+
+               function __construct()
+               {
+                       parent::__construct();
+                       
+                       $this->bo                                       = 
CreateObject('property.bolocation',true);
+                       $this->bocommon                         = & 
$this->bo->bocommon;
+                       $this->so_control_area          = 
CreateObject('controller.socontrol_area');
+                       $this->so_control                       = 
CreateObject('controller.socontrol');
+                       $this->so_check_list            = 
CreateObject('controller.socheck_list');
+                       $this->so_control_item          = 
CreateObject('controller.socontrol_item');
+                       $this->so_check_item            = 
CreateObject('controller.socheck_item');
+                       $this->so_procedure                     = 
CreateObject('controller.soprocedure');
+                       
+                       $this->type_id                          = 
$this->bo->type_id;
+                       
+                       $this->start                            = 
$this->bo->start;
+                       $this->query                            = 
$this->bo->query;
+                       $this->sort                                     = 
$this->bo->sort;
+                       $this->order                            = 
$this->bo->order;
+                       $this->filter                           = 
$this->bo->filter;
+                       $this->cat_id                           = 
$this->bo->cat_id;
+                       $this->part_of_town_id          = 
$this->bo->part_of_town_id;
+                       $this->district_id                      = 
$this->bo->district_id;
+                       $this->status                           = 
$this->bo->status;
+                       $this->allrows                          = 
$this->bo->allrows;
+                       $this->lookup                           = 
$this->bo->lookup;
+                       $this->location_code            = 
$this->bo->location_code;
+                       
+                       
self::set_active_menu('controller::control::location_for_check_list');
+               }       
+       
+               function index()
+               {
+                       if(phpgw::get_var('phpgw_return_as') == 'json') {
+                               return $this->query();
+                       }
+                       $building_types  = 
execMethod('property.soadmin_location.read',array());
+                       
+                       $type_id = 1;
+                       
+                       $category_types = 
$this->bocommon->select_category_list(array(
+                                                                               
                                                                
'format'=>'filter',
+                                                                               
                                                                'selected' => 
$this->cat_id,
+                                                                               
                                                                'type' 
=>'location',
+                                                                               
                                                                'type_id' 
=>$type_id,
+                                                                               
                                                                'order'=>'descr'
+                                                                               
                                                        ));
+                       
+                       $district_list  = 
$this->bocommon->select_district_list('filter',$this->district_id);
+                       $default_value = array ('id'=>'','name'=>lang('no 
district'));
+                       array_unshift($district_list,$default_value);
+                       
+                       $part_of_town_list =  
$this->bocommon->select_part_of_town('filter',$this->part_of_town_id,$this->district_id);
+                       $default_value = array ('id'=>'','name'=>lang('no part 
of town'));
+                       array_unshift($part_of_town_list,$default_value);
+                       
+                       $_role_criteria = array
+                                       (
+                                               'type'          => 
'responsibility_role',
+                                               'filter'        => 
array('location' => ".location.{$type_id}"),
+                                               'order'         => 'name'
+                                       );
+
+                       $responsibility_roles_list =   
execMethod('property.sogeneric.get_list',$_role_criteria);
+                       $default_value = array ('id'=>'','name'=>lang('no 
role'));
+                       array_unshift ($responsibility_roles,$default_value);
+                       
+                       $control_areas_array = 
$this->so_control_area->get_control_areas_as_array();
+                       $controls_array = 
$this->so_control->get_controls_by_control_area($control_areas_array[0]['id']);
+                       $control_id = $control_areas_array[0]['id'];
+                       
+                       if($control_id == null)
+                               $control_id = 0;
+                       
+                       $tabs = array( array(
+                                               'label' => 
lang('View_locations_for_control')
+                                       ), array(
+                                               'label' => 
lang('Add_locations_for_control'),
+                                               'link'  => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'controller.uicontrol_location.add_location_to_control'))
+                                       ));
+                       
+                       $data = array(
+                               'tabs'                                  => 
$GLOBALS['phpgw']->common->create_tabs($tabs, 0),
+                               'view'                                  => 
"view_locations_for_control",
+                               'control_area_array'    => $control_areas_array,
+                               'control_array'                 => 
$control_array,
+                               'locations_table' => array(
+                                       'source' => 
self::link(array('menuaction' => 
'controller.uicontrol.get_locations_for_control', 'control_id' => $control_id 
,'phpgw_return_as' => 'json')),
+                                       'field' => array(
+                                               array(
+                                                       'key' => 'id',
+                                                       'label' => 
lang('ControlId'),
+                                                       'sortable'      => true,
+                                               ),
+                                               array(
+                                                       'key'   =>      'title',
+                                                       'label' =>      
lang('Property name'),
+                                                       'sortable'      =>      
false
+                                               ),
+                                               array(
+                                                       'key' => 
'location_code',
+                                                       'label' => 
lang('location_code'),
+                                                       'sortable'      => false
+                                               ),
+                                               array(
+                                                       'key' => 'loc1_name',
+                                                       'label' => 
lang('Location_name'),
+                                                       'sortable'      => false
+                                               ),
+                                               array(
+                                                       'key' => 'actions',
+                                                       'hidden' => true
+                                               ),
+                                               array(
+                                                       'key' => 'labels',
+                                                       'hidden' => true
+                                               ),
+                                               array(
+                                                       'key' => 'ajax',
+                                                       'hidden' => true
+                                               ),array(
+                                                       'key' => 'parameters',
+                                                       'hidden' => true
+                                               )                               
                
+                                       )
+                               )
+                       );
+                       
+                       phpgwapi_yui::load_widget('paginator');
+                       
+                       self::add_javascript('controller', 'yahoo', 
'control_tabs.js');
+                       self::add_javascript('controller', 'controller', 
'jquery.js');
+                       self::add_javascript('controller', 'controller', 
'ajax.js');
+
+                       
self::render_template_xsl(array('control_location/control_location_tabs', 
'control_location/view_locations_for_control', 'common' ), $data);            
+               }
+               
+               function add_location_to_control()
+               {
+                       if(phpgw::get_var('phpgw_return_as') == 'json') {
+                               return $this->query();
+                       }
+                       $building_types  = 
execMethod('property.soadmin_location.read',array());
+                       
+                       $type_id = 1;
+                       
+                       $category_types = 
$this->bocommon->select_category_list(array(
+                                                                               
                                                                
'format'=>'filter',
+                                                                               
                                                                'selected' => 
$this->cat_id,
+                                                                               
                                                                'type' 
=>'location',
+                                                                               
                                                                'type_id' 
=>$type_id,
+                                                                               
                                                                'order'=>'descr'
+                                                                               
                                                        ));
+                       
+                       $district_list  = 
$this->bocommon->select_district_list('filter',$this->district_id);
+                       $default_value = array ('id'=>'','name'=>lang('no 
district'));
+                       array_unshift($district_list,$default_value);
+                       
+                       $part_of_town_list =  
$this->bocommon->select_part_of_town('filter',$this->part_of_town_id,$this->district_id);
+                       $default_value = array ('id'=>'','name'=>lang('no part 
of town'));
+                       array_unshift($part_of_town_list,$default_value);
+                       
+                       $_role_criteria = array
+                                       (
+                                               'type'          => 
'responsibility_role',
+                                               'filter'        => 
array('location' => ".location.{$type_id}"),
+                                               'order'         => 'name'
+                                       );
+
+                       $responsibility_roles_list = 
execMethod('property.sogeneric.get_list',$_role_criteria);
+                       $default_value = array ('id'=>'','name'=>lang('no 
role'));
+                       array_unshift ($responsibility_roles,$default_value);
+                       
+                       $control_areas_array = 
$this->so_control_area->get_control_areas_as_array();
+                       
+                       $tabs = array( array(
+                                               'label' => 
lang('View_locations_for_control'),
+                                               'link'  => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'controller.uicontrol_location.index'))
+                       
+                                       ), array(
+                                               'label' => 
lang('Add_locations_for_control')
+                                       ));
+                                       
+                       $data = array(
+                               'tabs'                                          
=> $GLOBALS['phpgw']->common->create_tabs($tabs, 1),
+                               'view'                                          
=> "add_location_to_control",
+                               'control_filters'                       => 
array(
+                                       'control_area_array'            => 
$control_areas_array,
+                                       'control_array'                         
=> $control_array
+                               ),
+                               'filter_form'                           => 
array(
+                                       'building_types'                        
=> $building_types,
+                                       'category_types'                        
=> $category_types,
+                                       'district_list'                         
=> $district_list,
+                                       'part_of_town_list'             => 
$part_of_town_list
+                               ),
+                               'datatable' => array(
+                                       'source' => 
self::link(array('menuaction' => 'controller.uicontrol_location.index', 
'phpgw_return_as' => 'json')),
+                                       'field' => array(
+                                               array(
+                                                       'key' => 
'location_code',
+                                                       'label' => 
lang('Property'),
+                                                       'sortable'      => true,
+                                                       'formatter' => 
'YAHOO.portico.formatLink'
+                                               ),
+                                               array(
+                                                       'key'   =>      
'loc1_name',
+                                                       'label' =>      
lang('Property name'),
+                                                       'sortable'      =>      
false
+                                               ),
+                                               array(
+                                                       'key' => 'adresse1',
+                                                       'label' => 
lang('Address'),
+                                                       'sortable'      => false
+                                               ),
+                                               array(
+                                                       'key' => 'postnummer',
+                                                       'label' => lang('Zip 
code'),
+                                                       'sortable'      => false
+                                               ),
+                                               array(
+                                                       'key' => 'actions',
+                                                       'hidden' => true
+                                               ),
+                                               array(
+                                                       'key' => 'labels',
+                                                       'hidden' => true
+                                               ),
+                                               array(
+                                                       'key' => 'ajax',
+                                                       'hidden' => true
+                                               ),array(
+                                                       'key' => 'parameters',
+                                                       'hidden' => true
+                                               )                               
                
+                                       )
+                               )
+                       );
+                       
+                       phpgwapi_yui::load_widget('paginator');
+                       
+                       self::add_javascript('controller', 'yahoo', 
'control_tabs.js');
+                       self::add_javascript('controller', 'controller', 
'jquery.js');
+                       self::add_javascript('controller', 'controller', 
'ajax.js');
+
+                       
self::render_template_xsl(array('control_location/control_location_tabs', 
'control_location/add_location_to_control', 'common'), $data);                
+               }
+               
+               public function query(){
+                       $type_id = phpgw::get_var('type_id');
+                       $return_results = phpgw::get_var('results', 'int', 
'REQUEST', 0);
+                       
+                       $type_id = $type_id ? $type_id : 1;
+                       
+                       $location_list = array();
+
+                       $this->bo->sort = "ASC";
+                       $this->bo->start = phpgw::get_var('startIndex');
+                       
+                       $location_list = $this->bo->read(array('user_id' => 
$user_id, 'role_id' =>$role_id, 
'type_id'=>$type_id,'lookup_tenant'=>$lookup_tenant,
+                                                                               
                   'lookup'=>$lookup,'allrows'=>$this->allrows,'dry_run' 
=>$dry_run));
+
+                       $rows_total = $this->bo->read(array('type_id' => 
$type_id, 'allrows' => true));
+                       
+                       foreach($location_list as $location)
+                       {
+                               $results['results'][]= $location;       
+                       }
+                       
+                       $results['total_records'] = count($rows_total);
+                       $results['start'] = $this->start;
+                       $results['sort'] = 'location_code';
+                       $results['dir'] = "ASC";
+                                               
+                       array_walk($results['results'], array($this, 
'add_actions'), array($type));
+                                                       
+                       return $this->yui_results($results);
+               }
+                       
+               public function add_actions(&$value, $key, $params)
+               {
+                       unset($value['query_location']);
+                       
+                       $value['ajax'] = array();
+                       $value['actions'] = array();
+                       $value['labels'] = array();
+                       $value['parameters'] = array();
+                       
+                       $value['ajax'][] = true;
+                       $value['actions'][] = 
html_entity_decode(self::link(array('menuaction' => 
'controller.uicontrol.add_location_to_control', 'location_code' => 
$value['location_code'])));
+                       $value['labels'][] = lang('add_location');
+                       $value['parameters'][] = "control_id";
+               }
+       }

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-22 19:08:35 UTC (rev 8645)
+++ branches/Version-1_0-branch/controller/inc/class.uiprocedure.inc.php        
2012-01-22 19:51:52 UTC (rev 8646)
@@ -42,6 +42,7 @@
                private $_category_acl;
                private $so_control;
                private $so_control_group_list;
+               private $so_control_group;
 
                public $public_functions = array
                (
@@ -63,6 +64,7 @@
                        $this->so_control_area = 
CreateObject('controller.socontrol_area');
                        $this->so_control = 
CreateObject('controller.socontrol');
                        $this->so_control_group_list = 
CreateObject('controller.socontrol_group_list');
+                       $this->so_control_group = 
CreateObject('controller.socontrol_group');
                        
                        $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
"controller::procedure";
                        
@@ -484,9 +486,12 @@
 
                public function view_procedures_for_control(){
                        $control_id = phpgw::get_var('control_id');
+                       $location_code = phpgw::get_var('location_code');
                        
                        $control = $this->so_control->get_single($control_id);
                        
+                       $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
+                       
                        $control_procedure = 
$this->so->get_single_with_documents( $control->get_procedure_id(), 
"return_array" );
                        
                        $control_groups = 
$this->so_control_group_list->get_control_groups_by_control($control_id);
@@ -501,6 +506,8 @@
                        
                        $data = array
                        (
+                               'location'                                      
=> $location_array,
+                               'control'                                       
=> $control->toArray(),
                                'control_procedure'                     => 
$control_procedure,
                                'group_procedures_array'        => 
$group_procedures_array
                        );
@@ -510,14 +517,28 @@
                
                public function print_procedure(){
                        $procedure_id = phpgw::get_var('procedure_id');
+                       $location_code = phpgw::get_var('location_code');
+                       $control_id = phpgw::get_var('control_id');
+                       $control_group_id = phpgw::get_var('control_group_id');
                        
+                       $control = $this->so_control->get_single($control_id);
+                       
+                       $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
+                       
                        $procedure = $this->so->get_single($procedure_id);
                        
                        $data = array
                        (
+                               'location'      => $location_array,
+                               'control'       => $control->toArray(),
                                'procedure'     => $procedure->toArray()
                        );
                        
+                       if( !empty($control_group_id) ){
+                               $control_group = 
$this->so_control_group->get_single($control_group_id);
+                               $data['control_group'] = 
$control_group->toArray(); 
+                       }
+                       
                        
$GLOBALS['phpgw']->css->add_external_file('controller/templates/base/css/base.css');
                        
                        self::render_template_xsl('procedure/print_procedure', 
$data);

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-22 19:08:35 UTC (rev 8645)
+++ 
branches/Version-1_0-branch/controller/inc/component/class.calendar_builder.inc.php
 2012-01-22 19:51:52 UTC (rev 8646)
@@ -1,7 +1,8 @@
 <?php
-
+phpgw::import_class('controller.socheck_list');
 include_class('controller', 'date_generator', 'inc/component/');
 
+       
 class calendar_builder {
        
        private $period_start_date;
@@ -12,7 +13,7 @@
         $this->period_end_date = $period_end_date;
        }
        
-       public function build_calendar_array( $control_array, $num, 
$period_type ){
+       public function build_calendar_array( $controls_calendar_array, 
$control_array, $num, $period_type ){
                
                foreach($control_array as $control){
 
@@ -76,37 +77,65 @@
                return $controls_calendar_array;
        }
        
-       // Function receives array with control objects that each contain 
check_lists for a certain period
-       public function build_agg_calendar_array( $controls_array ){
-                                       
-               $calendar_array = array();
+       public function build_agg_calendar_array($controls_calendar_array, 
$control, $location_code, $year){
+                               
+               if( date("Y", $control->get_start_date()) == $year ){
+                       $from_month = date("n", $control->get_start_date());    
+               }else{
+                       $from_month = 1;
+               }
                
-               foreach($controls_array as $control_array){
+               if( date("Y", $control->get_end_date()) == $year ){
+                       $to_month = date("n", $control->get_end_date());
+               }else{
+                       $to_month = 12;
+               }
+               
+               $todays_date_ts = mktime(0,0,0,date("m"), date("d"), date("Y"));
+               
+               $twelve_month_array = array();
+               
+               for($i=1;$i<=12;$i++){
+                       $trail_date_ts = strtotime("$i/01/$year");
+
+                       if($trail_date_ts > $control->get_start_date() & 
$trail_date_ts < $todays_date_ts){
+                               $status = "controls_not_accomplished";
+                       }else if($trail_date_ts > $control->get_start_date() & 
$trail_date_ts > $todays_date_ts){
+                               $status = "controls_registered";
+                       }       
+
+                       $twelve_month_array[$i-1]["status"] = $status;
+               }
+               
+               print_r($twelve_month_array);
+                               
+               for($from_month;$from_month<=$to_month;$from_month++){
+       
+                       $trail_from_date_ts = strtotime("$from_month/01/$year");
                        
-                       $control_info = $control_array['control'];
-                       $check_list_array = $control_array['check_list'];
-                       
-                       $control_id = $control_info['id'];
-                        
-                       // Initialises twelve_months_array
-                       for($i=0;$i<12;$i++){
-                               $calendar_array[$i] = null;
+                       $trail_to_date_ts = strtotime("$to_month/01/$year");
+                       $so_check_list = 
CreateObject('controller.socheck_list');
+                               
+                       $num_open_cases_for_control_array = array();
+                       $num_open_cases_for_control_array = 
$so_check_list->get_num_open_cases_for_control( $control->get_id(), 
$location_code, $trail_from_date_ts, $trail_to_date_ts );       
+       
+                       if( !empty($num_open_cases_for_control_array) ){
+                               $status = "controls_accomplished_with_errors";
+                               
+                               $twelve_month_array[$from_month-1]["status"] = 
$status;
+                               $twelve_month_array[$from_month-1]["info"] = 
$num_open_cases_for_control_array["count"];
+                       }else{
+                               $status = 
"controls_accomplished_without_errors";
+                               
+                               $twelve_month_array[$from_month-1]["status"] = 
$status;
                        }
-                       
-                       $status = "control_agg_accomplished_with_errors";
-                       
-                       // Inserts check_list object on deadline month in 
twelve_months_array
-                       foreach($check_list_array as $check_list){
-                               $calendar_array[ date("m", 
$check_list['deadline']) - 1 ] ["status"] = $status;
-                               $calendar_array[ date("m", 
$check_list['deadline']) - 1 ] ["info"] = $check_list['count']; 
-                       }
-                       
-                       $control_calendar_array[] = array("control" => 
$control_info, "calendar_array" => $calendar_array);
                }
-
-               return $control_calendar_array;
+       
+               $controls_calendar_array[] = array("control" => 
$control->toArray(), "calendar_array" => $twelve_month_array);
+                
+               return $controls_calendar_array;
        }
-       
+               
        function init_calendar( $control, $calendar_array, $num, $period_type ){
                
                // Initialises twelve_months_array

Modified: branches/Version-1_0-branch/controller/js/controller/ajax.js
===================================================================
--- branches/Version-1_0-branch/controller/js/controller/ajax.js        
2012-01-22 19:08:35 UTC (rev 8645)
+++ branches/Version-1_0-branch/controller/js/controller/ajax.js        
2012-01-22 19:51:52 UTC (rev 8646)
@@ -369,6 +369,13 @@
                return false;
        });
        
+       $(".make_case_editable").live("click", function(e){
+               var thisForm = $(this);
+               var submitBnt = $(thisForm).find("input[type='submit']");
+               $(submitBnt).removeClass("not_active");
+       });
+       
+       
        $("#frm_update_check_list").live("click", function(e){
                var thisForm = $(this);
                var submitBnt = $(thisForm).find("input[type='submit']");
@@ -394,6 +401,7 @@
        });
 });
 
+
 //Updates order number for hidden field and number in front of row
 function update_order_nr(element, sign){
        

Modified: branches/Version-1_0-branch/controller/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/setup/setup.inc.php  2012-01-22 
19:08:35 UTC (rev 8645)
+++ branches/Version-1_0-branch/controller/setup/setup.inc.php  2012-01-22 
19:51:52 UTC (rev 8646)
@@ -1,6 +1,6 @@
 <?php
        $setup_info['controller']['name'] = 'controller';
-       $setup_info['controller']['version'] = '0.1.21';
+       $setup_info['controller']['version'] = '0.1.22';
        $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_update.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/setup/tables_update.inc.php  
2012-01-22 19:08:35 UTC (rev 8645)
+++ branches/Version-1_0-branch/controller/setup/tables_update.inc.php  
2012-01-22 19:51:52 UTC (rev 8646)
@@ -450,3 +450,16 @@
                        return 
$GLOBALS['setup_info']['controller']['currentver'];
                }               
        }
+       
+       $test[] = '0.1.21';
+       function controller_upgrade0_1_21()
+       {
+               
$GLOBALS['phpgw_setup']->oProc->AlterColumn('controller_check_item','comment',array(
+                       'type' => 'varchar', 
+                       'precision' => '255',
+                       'nullable' => true
+               ));
+               
+               $GLOBALS['setup_info']['controller']['currentver'] = '0.1.22';
+               return $GLOBALS['setup_info']['controller']['currentver'];
+       }

Deleted: 
branches/Version-1_0-branch/controller/templates/base/add_location_to_control.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/add_location_to_control.xsl
   2012-01-22 19:08:35 UTC (rev 8645)
+++ 
branches/Version-1_0-branch/controller/templates/base/add_location_to_control.xsl
   2012-01-22 19:51:52 UTC (rev 8646)
@@ -1,200 +0,0 @@
-<!-- $Id$ -->
-<func:function name="phpgw:conditional">
-       <xsl:param name="test"/>
-       <xsl:param name="true"/>
-       <xsl:param name="false"/>
-
-       <func:result>
-               <xsl:choose>
-                       <xsl:when test="$test">
-                               <xsl:value-of select="$true"/>
-                       </xsl:when>
-                       <xsl:otherwise>
-                               <xsl:value-of select="$false"/>
-                       </xsl:otherwise>
-               </xsl:choose>
-       </func:result>
-</func:function>
-
-<xsl:template name="add_location_to_control">
-       <!-- IMPORTANT!!! Loads YUI javascript -->
-       <xsl:call-template name="common"/>
-
-       <div class="yui-content">
-               <div id="control_details">
-                       <xsl:call-template name="yui_booking_i18n"/>
-                       <xsl:apply-templates select="control_filters" />
-                       <xsl:apply-templates select="filter_form" />
-                       <xsl:apply-templates select="paging"/>
-                       <xsl:apply-templates select="datatable"/>
-                       <xsl:apply-templates select="form/list_actions"/>
-               </div>
-       </div>
-</xsl:template>
-
-<xsl:template match="control_filters" name="control_filters">
-       <div style="margin: 10px;padding: 10px; width: 25%;">
-               
-               <!-- When control area is chosen, an ajax request is executed. 
The operation fetches controls from db and populates the control list.
-                        The ajax opearation is handled in ajax.js --> 
-                <select style="float:left;" id="control_area_list" 
name="control_area_list">
-                       <xsl:for-each select="control_area_array">
-                               <xsl:variable 
name="control_area_id"><xsl:value-of select="id"/></xsl:variable>
-                               <option value="{$control_area_id}">
-                                       <xsl:value-of select="title"/>
-                               </option>                       
-                       </xsl:for-each>
-               </select>
-                
-                <form id="loc_form" action="" method="GET">
-                       <select id="control_id" name="control_id">
-                               <xsl:choose>
-                                       <xsl:when 
test="control_array/child::node()">
-                                               <xsl:for-each 
select="control_array">
-                                                       <xsl:variable 
name="control_id"><xsl:value-of select="id"/></xsl:variable>
-                                                       <option 
value="{$control_id}">
-                                                               <xsl:value-of 
select="title"/>
-                                                       </option>               
                
-                                               </xsl:for-each>
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                               <option>
-                                                       Ingen kontroller
-                                               </option>
-                                       </xsl:otherwise>
-                               </xsl:choose>
-                       </select>
-               </form>
-       </div>
-</xsl:template>
-
-<xsl:template match="filter_form">
-       <form id="queryForm">
-               <xsl:attribute name="method">
-                       <xsl:value-of select="phpgw:conditional(not(method), 
'GET', method)"/>
-               </xsl:attribute>
-
-               <xsl:attribute name="action">
-                       <xsl:value-of select="phpgw:conditional(not(action), 
'', action)"/>
-               </xsl:attribute>
-               <xsl:call-template name="filter_list"/>
-       </form>
-       
-       <form id="update_table_dummy" method='POST' action='' >
-       </form>
-
-</xsl:template>
-
-<xsl:template name="filter_list" xmlns:php="http://php.net/xsl";>
-       <div>
-         <ul id="filters">
-               <li>
-                 <select id="type_id" name="type_id">
-                       <option value="">
-                               <xsl:value-of select="php:function('lang', 
'Choose_building_type')"/>
-                       </option>
-                       <xsl:for-each select="building_types">
-                               <xsl:variable 
name="building_type_id"><xsl:value-of select="id"/></xsl:variable>
-                               <option value="{$building_type_id}">
-                                       <xsl:value-of select="name"/>
-                               </option>
-                       </xsl:for-each>
-                 </select>
-               </li>
-               <li>
-                 <select id="cat_id" name="cat_id">
-                       <option value="">
-                               <xsl:value-of select="php:function('lang', 
'Choose_building_category')"/>
-                       </option>
-                       <xsl:for-each select="category_types">
-                               <xsl:variable 
name="category_type_id"><xsl:value-of select="id"/></xsl:variable>
-                               <option value="{$category_type_id}">
-                                       <xsl:value-of select="name"/>
-                               </option>
-                       </xsl:for-each>
-                 </select>
-               </li>
-               <li>
-                 <select id="district_id" name="district_id">
-                       <option value="">
-                                       <xsl:value-of 
select="php:function('lang', 'Choose_district')"/>
-                       </option>
-                       <xsl:for-each select="district_list">
-                               <xsl:variable name="district_id"><xsl:value-of 
select="id"/></xsl:variable>
-                               <option value="{$district_id}">
-                                       <xsl:value-of select="name"/>
-                               </option>
-                       </xsl:for-each>
-                 </select>
-               </li>
-               <li>
-                 <select id="part_of_town_id" name="part_of_town_id">
-                       <option value="">
-                                       <xsl:value-of 
select="php:function('lang', 'Choose_part_of_town')"/>
-                       </option>
-                       <xsl:for-each select="part_of_town_list">
-                               <xsl:variable 
name="part_of_town_id"><xsl:value-of select="id"/></xsl:variable>
-                               <option value="{$part_of_town_id}">
-                                       <xsl:value-of select="name"/>
-                               </option>
-                       </xsl:for-each>
-                 </select>
-               </li>           
-         </ul>
-         <ul id="search_list">
-                 <li>
-                       <input type="text" name="query" />
-                 </li>
-                 <li>
-                       <xsl:variable name="lang_search"><xsl:value-of 
select="php:function('lang', 'Search')" /></xsl:variable>
-                       <input type="submit" name="search" 
value="{$lang_search}" title = "{$lang_search}" />
-                 </li>                 
-         </ul>
-       
-       </div>
-</xsl:template>
-
-<xsl:template match="datatable">
-       <div id="data_paginator"/>
-       <div id="datatable-container"/>
-       <xsl:call-template name="datasource-definition" />
-</xsl:template>
-
-
-<xsl:template name="datasource-definition">
-       <script>
-               YAHOO.namespace('controller');
-        
-               YAHOO.controller.columnDefs = [
-                               <xsl:for-each select="//datatable/field">
-                                       {
-                                               key: "<xsl:value-of 
select="key"/>",
-                                               <xsl:if test="label">
-                                               label: "<xsl:value-of 
select="label"/>",
-                                               </xsl:if>
-                                               sortable: <xsl:value-of 
select="phpgw:conditional(not(sortable = 0), 'true', 'false')"/>,
-                                               <xsl:if test="hidden">
-                                               hidden: true,
-                                               </xsl:if>
-                                               <xsl:if test="formatter">
-                                               formatter: <xsl:value-of 
select="formatter"/>,
-                                               </xsl:if>
-                                               className: "<xsl:value-of 
select="className"/>"
-                                       }<xsl:value-of 
select="phpgw:conditional(not(position() = last()), ',', '')"/>
-                               </xsl:for-each>
-                       ];
-
-               var main_source = '<xsl:value-of select="source"/>';
-               var main_columnDefs = YAHOO.controller.columnDefs;
-               var main_form = 'queryForm';
-               var main_filters = ['type_id', 'cat_id', 'district_id', 
'part-of_town_list', 'responsibility_roles_list'];
-               var main_container = 'datatable-container';
-               var main_table_id = 'datatable';
-               var main_pag = 'data_paginator';
-               var related_table = new Array('locations_table');
-       
-               setDataSource(main_source, main_columnDefs, main_form, 
main_filters, main_container, main_pag, main_table_id, related_table ); 
-               
-       </script>
-        
-</xsl:template>

Modified: 
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_month.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_month.xsl
      2012-01-22 19:08:35 UTC (rev 8645)
+++ 
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_month.xsl
      2012-01-22 19:51:52 UTC (rev 8646)
@@ -2,6 +2,7 @@
 <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>
+<xsl:variable name="view_location_code"><xsl:value-of 
select="view_location_code"/></xsl:variable>
 
 <div id="main_content">
                
@@ -12,25 +13,30 @@
                
                <div style="float:right;width:300px;margin-top:40px;">
                        <form action="#">
-                               <input type="hidden" name="period_type" 
value="view_month" />
+                               <input type="hidden" name="period_type" 
value="view_year" />
                                <input type="hidden" name="year">
                              <xsl:attribute name="value">
                                <xsl:value-of select="year"/>
                              </xsl:attribute>
                                </input>
-                               <input type="hidden" name="month">
-                             <xsl:attribute name="value">
-                               <xsl:value-of select="month_nr"/>
-                             </xsl:attribute>
-                               </input>
-                               
+
                                <select id="choose_my_location">
                                        <xsl:for-each select="my_locations">
-                                               <option value="{location_code}" 
selected="selected">
-                                                       <xsl:value-of 
disable-output-escaping="yes" select="loc1_name"/>
-                                               </option>
+                                               <xsl:variable 
name="loc_code"><xsl:value-of select="location_code"/></xsl:variable>
+                                               <xsl:choose>
+                                                       <xsl:when 
test="location_code = $view_location_code">
+                                                               <option 
value="{$loc_code}" selected="selected">
+                                                                       
<xsl:value-of disable-output-escaping="yes" select="loc1_name"/>
+                                                               </option>
+                                                       </xsl:when>
+                                                       <xsl:otherwise>
+                                                               <option 
value="{$loc_code}">
+                                                                       
<xsl:value-of disable-output-escaping="yes" select="loc1_name"/>
+                                                               </option>
+                                                       </xsl:otherwise>
+                                               </xsl:choose>
                                        </xsl:for-each>
-                               </select>
+                               </select>                                       
                        </form>
                                        
                        <ul id="icon_color_map">

Modified: 
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_year.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_year.xsl
       2012-01-22 19:08:35 UTC (rev 8645)
+++ 
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_year.xsl
       2012-01-22 19:51:52 UTC (rev 8646)
@@ -2,7 +2,7 @@
 <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>
+<xsl:variable name="view_location_code"><xsl:value-of 
select="view_location_code"/></xsl:variable>
 
 <div id="main_content">
                
@@ -19,30 +19,35 @@
                                <xsl:value-of select="year"/>
                              </xsl:attribute>
                                </input>
-                               
+
                                <select id="choose_my_location">
                                        <xsl:for-each select="my_locations">
-                                               <option value="{location_code}" 
selected="selected">
-                                                       <xsl:value-of 
disable-output-escaping="yes" select="loc1_name"/>
-                                               </option>
+                                               <xsl:variable 
name="loc_code"><xsl:value-of select="location_code"/></xsl:variable>
+                                               <xsl:choose>
+                                                       <xsl:when 
test="location_code = $view_location_code">
+                                                               <option 
value="{$loc_code}" selected="selected">
+                                                                       
<xsl:value-of disable-output-escaping="yes" select="loc1_name"/>
+                                                               </option>
+                                                       </xsl:when>
+                                                       <xsl:otherwise>
+                                                               <option 
value="{$loc_code}">
+                                                                       
<xsl:value-of disable-output-escaping="yes" select="loc1_name"/>
+                                                               </option>
+                                                       </xsl:otherwise>
+                                               </xsl:choose>
                                        </xsl:for-each>
-                               </select>
+                               </select>                                       
                        </form>
                                        
                        <ul id="icon_color_map">
-                               <li><img height="15" 
src="controller/images/status_icon_yellow_ring.png" /><span>Kontroll satt 
opp</span></li>
-                               <li><img height="15" 
src="controller/images/status_icon_yellow.png" /><span>Kontroll har planlagt 
dato</span></li>
-                               <li><img height="15" 
src="controller/images/status_icon_dark_green.png" /><span>Kontroll gjennomført 
uten feil før frist</span></li>
-                               <li><img height="15" 
src="controller/images/status_icon_light_green.png" /><span>Kontroll 
gjennomført uten feil etter frist</span></li>
-                               <li><img height="15" 
src="controller/images/status_icon_red_empty.png" /><span>Kontroll gjennomført 
med rapporterte feil</span></li>
-                               <li><img height="15" 
src="controller/images/status_icon_red_cross.png" /><span>Kontroll ikke 
gjennomført</span></li>
+                               <li><img height="15" 
src="controller/images/status_icon_yellow_ring.png" /><span>Kontroller satt 
opp</span></li>
+                               <li><img height="15" 
src="controller/images/status_icon_dark_green.png" /><span>Kontroller 
gjennomført uten feil</span></li>
+                               <li><img height="15" 
src="controller/images/status_icon_red_empty.png" /><span>Kontroller 
gjennomført med rapporterte feil</span></li>
+                               <li><img height="15" 
src="controller/images/status_icon_red_cross.png" /><span>Kontroller ikke 
gjennomført</span></li>
                        </ul>
                </div>
                
                <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>
@@ -58,6 +63,8 @@
                                                                        
<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;location_code=</xsl:text>
+                                                                       
<xsl:value-of select="//location_code"/>
                                                                        
<xsl:text>&amp;month=</xsl:text>
                                                                        
<xsl:number/>
                                                                </xsl:attribute>
@@ -68,6 +75,9 @@
                                        </div>
                                </li>
                        
+                       <xsl:choose>
+                               <xsl:when 
test="controls_calendar_array/child::node()">
+                               
                                <xsl:for-each select="controls_calendar_array">
                                        <xsl:variable 
name="control_id"><xsl:value-of select="control/id"/></xsl:variable>
                                        <li>
@@ -99,7 +109,7 @@
                                                <div class="months">
                                                <xsl:for-each 
select="calendar_array">
                                                        <xsl:choose>
-                                                                       
<xsl:when test="status = 'control_registered'">
+                                                                       
<xsl:when test="status = 'control_registered' or status = 
'controls_registered'">
                                                                                
<div>
                                                                                
<a>
                                                                                
        <xsl:attribute name="href">
@@ -154,6 +164,11 @@
                                                                                
        </a>
                                                                                
</div>
                                                                        
</xsl:when>
+                                                                       
<xsl:when test="status = 'controls_accomplished_without_errors'">
+                                                                               
<div>
+                                                                               
        <img height="15" src="controller/images/status_icon_dark_green.png" />
+                                                                               
</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>
@@ -171,20 +186,10 @@
                                                                                
        </a>
                                                                                
</div>
                                                                        
</xsl:when>
-                                                                       
<xsl:when test="status = 'control_agg_accomplished_with_errors'">
+                                                                       
<xsl:when test="status = 'controls_accomplished_with_errors'">
                                                                                
<div style="position:relative;background: 
url(controller/images/status_icon_red_empty.png) no-repeat 50% 50%;">
-                                                                               
        <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</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>
-                                                                               
                <xsl:value-of select="info"/>
+                                                                               
        <a class="view_check_list">
+                                                                               
                <xsl:value-of select="info"/>
                                                                                
        </a>
                                                                                
</div>
                                                                        
@@ -194,7 +199,7 @@
                                                                                
        <img height="12" src="controller/images/status_icon_red_cross.png" />
                                                                                
</div>
                                                                        
</xsl:when>
-                                                                       
<xsl:when test="status = 'control_not_accomplished'">
+                                                                       
<xsl:when test="status = 'control_not_accomplished' or status = 
'controls_not_accomplished'">
                                                                                
<div>
                                                                                
        <img height="12" src="controller/images/status_icon_red_cross.png" />
                                                                                
</div>
@@ -209,7 +214,7 @@
                                </xsl:for-each> 
                        </xsl:when>
                        <xsl:otherwise>
-                               <div>Ingen sjekklister for bygg i angitt 
periode</div>
+                               <div class="cal_info_msg">Ingen sjekklister for 
bygg i angitt periode</div>
                        </xsl:otherwise>
                </xsl:choose>
        </ul>

Modified: 
branches/Version-1_0-branch/controller/templates/base/case/create_case_message.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/case/create_case_message.xsl
  2012-01-22 19:08:35 UTC (rev 8645)
+++ 
branches/Version-1_0-branch/controller/templates/base/case/create_case_message.xsl
  2012-01-22 19:51:52 UTC (rev 8646)
@@ -4,8 +4,9 @@
 
 <div id="main_content">
        
-               <h1>Registrer avviksmelding</h1>
-       
+               <h1>Utførelse av kontroll: <xsl:value-of 
select="control/title"/></h1>
+               <h2>Sjekkliste for: <xsl:value-of 
select="location_array/loc1_name"/></h2>
+               
                <xsl:call-template name="check_list_tab_menu" />
        
                <h3 class="box_header">Meldingen gjelder</h3>
@@ -13,7 +14,7 @@
                        <h3 class="first">Tittel på kontroll: <xsl:value-of 
select="control/title"/></h3>
                        <xsl:choose>
                                <xsl:when test="check_list/completed_date != 0">
-                                       <h3>Kontroll ble utført 
dato:<xsl:value-of select="php:function('date', $date_format, 
number(check_list/completed_date))"/></h3>
+                                       <h3>Kontroll ble utført: <xsl:value-of 
select="php:function('date', $date_format, 
number(check_list/completed_date))"/></h3>
                                </xsl:when>
                                <xsl:otherwise>
                                        <h3>Kontroll ble utført dato: Ikke 
registrert utført</h3>
@@ -100,7 +101,7 @@
                                </form>                 
                                </xsl:when>
                                <xsl:otherwise>
-                                       Ingen registrerte avvik
+                                       Ingen registrerte saker
                                </xsl:otherwise>
                        </xsl:choose>
                </fieldset>

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-22 19:08:35 UTC (rev 8645)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/edit_check_list.xsl
        2012-01-22 19:51:52 UTC (rev 8646)
@@ -24,9 +24,10 @@
                        
                });
        </script>
+       
+               <h1>Utførelse av kontroll: <xsl:value-of 
select="control/title"/></h1>
+               <h2>Sjekkliste for: <xsl:value-of 
select="location_array/loc1_name"/></h2>
                
-               <h1>Sjekkliste for <xsl:value-of 
select="location_array/loc1_name"/></h1>
-               
                <xsl:call-template name="check_list_tab_menu">
                        <xsl:with-param 
name="active_tab">view_details</xsl:with-param>
                </xsl:call-template>

Modified: 
branches/Version-1_0-branch/controller/templates/base/check_list/register_case.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/register_case.xsl
  2012-01-22 19:08:35 UTC (rev 8645)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/register_case.xsl
  2012-01-22 19:51:52 UTC (rev 8646)
@@ -3,8 +3,10 @@
 <xsl:template match="data" xmlns:php="http://php.net/xsl";>
 
 <div id="main_content">
-       <h1>Registrer avviksmelding</h1>
        
+       <h1>Utførelse av kontroll: <xsl:value-of select="control/title"/></h1>
+       <h2>Sjekkliste for: <xsl:value-of 
select="location_array/loc1_name"/></h2>
+       
        <xsl:call-template name="check_list_tab_menu" />
 
        <div id="view_cases">

Modified: 
branches/Version-1_0-branch/controller/templates/base/check_list/view_cases_for_check_list.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/view_cases_for_check_list.xsl
      2012-01-22 19:08:35 UTC (rev 8645)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/view_cases_for_check_list.xsl
      2012-01-22 19:51:52 UTC (rev 8646)
@@ -55,7 +55,8 @@
                }
        </script>
                
-               <h1>Sjekkliste for <xsl:value-of 
select="location_array/loc1_name"/></h1>
+               <h1>Utførelse av kontroll: <xsl:value-of 
select="control/title"/></h1>
+               <h2>Sjekkliste for: <xsl:value-of 
select="location_array/loc1_name"/></h2>
                
                <xsl:call-template name="check_list_tab_menu">
                        <xsl:with-param 
name="active_tab">view_cases</xsl:with-param>

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-22 19:08:35 UTC (rev 8645)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_info.xsl
      2012-01-22 19:51:52 UTC (rev 8646)
@@ -66,7 +66,8 @@
                                
        </script>
                
-       <h1>Sjekkliste for <xsl:value-of 
select="location_array/loc1_name"/></h1>
+       <h1>Utførelse av kontroll: <xsl:value-of select="control/title"/></h1>
+       <h2>Sjekkliste for: <xsl:value-of 
select="location_array/loc1_name"/></h2>
        
        <xsl:call-template name="check_list_tab_menu">
                <xsl:with-param 
name="active_tab">view_control_info</xsl:with-param>
@@ -96,6 +97,8 @@
                                
<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;location_code=</xsl:text>
+                               <xsl:value-of 
select="location_array/location_code"/>
                                
<xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
                        </xsl:attribute>
                        Prosedyrer

Modified: 
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_control_items.xsl
     2012-01-22 19:08:35 UTC (rev 8645)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_items.xsl
     2012-01-22 19:51:52 UTC (rev 8646)
@@ -2,16 +2,16 @@
 
 <xsl:template match="data">
 
-<ul class="groups">
+<ul>
        <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>
+               <li>
+                       <h3><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">
+                               <ul>
                                        <xsl:for-each select="control_items">
                                                <xsl:variable 
name="control_item_id"><xsl:value-of select="id"/></xsl:variable>
                                                <xsl:variable name="order_tag">
@@ -25,20 +25,10 @@
                                                        
</xsl:choose>:<xsl:value-of select="id"/>
                                                </xsl:variable>
                                                                                
                                
-                                               <li class="list_item">
-                                                       <span class="drag">
+                                               <li>
+                                                       <span>
                                                                <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>

Deleted: 
branches/Version-1_0-branch/controller/templates/base/control_check_lists.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/control_check_lists.xsl   
    2012-01-22 19:08:35 UTC (rev 8645)
+++ 
branches/Version-1_0-branch/controller/templates/base/control_check_lists.xsl   
    2012-01-22 19:51:52 UTC (rev 8646)
@@ -1,36 +0,0 @@
-<!-- $Id$ -->
-<xsl:template match="data" xmlns:php="http://php.net/xsl";>
-
-<xsl:call-template name="yui_booking_i18n"/>
-<div class="identifier-header">
-<h1><xsl:value-of select="php:function('lang', 'Check_lists')" /></h1>
-</div>
-
-<div class="yui-content">
-               <div id="view_check_lists">
-               
-               <ul 
class="th"><li>Tittel</li><li>Startdato</li><li>Planlagtdato</li><li>Utførtdato</li></ul>
-               <ul class="check_list">
-                       <xsl:for-each select="check_list_array">
-                               <li>
-                                       <ul class="row">
-                                               <li>
-                                                       <a>
-                                                               <xsl:attribute 
name="href">
-                                                                       
<xsl:text>index.php?menuaction=controller.uicheck_list.view_check_lists_for_control</xsl:text>
-                                                                       
<xsl:text>&amp;control_id=</xsl:text>
-                                                                       
<xsl:value-of select="id"/>
-                                                               </xsl:attribute>
-                                                               
<span><xsl:value-of select="title"/></span>
-                                                       </a>
-                                               </li>
-                                               <li><xsl:value-of 
select="start_date"/></li>
-                                               <li><xsl:value-of 
select="end_date"/></li>
-                                       </ul>
-                               </li>
-                       </xsl:for-each>
-               </ul>           
-                                               
-               </div>
-       </div>
-</xsl:template>

Copied: 
branches/Version-1_0-branch/controller/templates/base/control_group/control_group_items.xsl
 (from rev 8645, 
trunk/controller/templates/base/control_group/control_group_items.xsl)
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/control_group/control_group_items.xsl
                         (rev 0)
+++ 
branches/Version-1_0-branch/controller/templates/base/control_group/control_group_items.xsl
 2012-01-22 19:51:52 UTC (rev 8646)
@@ -0,0 +1,54 @@
+<!-- $Id$ -->
+<xsl:template name="control_group_items" xmlns:php="http://php.net/xsl";>
+
+<xsl:call-template name="yui_booking_i18n"/>
+<div class="identifier-header">
+<h1><img src="{img_go_home}" /> 
+       <xsl:value-of select="php:function('lang', 'Control_items')" />
+</h1>
+</div>
+
+<div class="yui-content">
+       <div>
+               <xsl:if test="selected_control_items">
+                       <h2>Valgte kontrollpunkt</h2>
+                       <form action="#" method="post"> 
+                               <ul class="control_items">
+                                       <xsl:for-each 
select="selected_control_items">
+                                               <xsl:variable 
name="control_item_id"><xsl:value-of select="id"/></xsl:variable>
+                                               <li><xsl:if 
test="//editable"><input type="checkbox"  name="item_remove_ids[]" 
value="{$control_item_id}"/></xsl:if><xsl:value-of select="title"/></li>
+                                       </xsl:for-each>
+                               </ul>
+                               <xsl:if test="//editable">
+                                       <div class="form-buttons">
+                                               <xsl:variable 
name="lang_remove"><xsl:value-of select="php:function('lang', 'remove')" 
/></xsl:variable>
+                                               <input type="submit" 
name="remove_control_group_items" value="{$lang_remove}" title = 
"{$lang_remove}" />
+                                       </div>
+                               </xsl:if>
+                       </form>
+               </xsl:if>
+          <!-- ===========================  CHOOSE CONTROL ITEMS  
=============================== -->
+          <xsl:choose>
+               <xsl:when test="editable">
+                       <h2>Velg kontrollpunkt</h2>
+                       <form action="#" method="post"> 
+                       
+                       <xsl:variable name="control_group_id"><xsl:value-of 
select="value_id"/></xsl:variable>
+                       <input type="hidden" name="control_group_id" 
value="{control_group_id}" />
+                       
+                       <ul class="control_items">
+                               <xsl:for-each select="control_items">
+                                       <xsl:variable 
name="control_item_id"><xsl:value-of select="id"/></xsl:variable>
+                                       <li><input type="checkbox"  
name="control_tag_ids[]" value="{$control_item_id}" /><xsl:value-of 
select="title"/></li>
+                               </xsl:for-each>
+                       </ul>           
+                       <div class="form-buttons">
+                               <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save')" /></xsl:variable>
+                               <input type="submit" 
name="save_control_group_items" value="{$lang_save}" title = "{$lang_save}" />
+                       </div>
+                       </form>
+               </xsl:when>
+          </xsl:choose>
+       </div>
+</div>
+</xsl:template>

Copied: 
branches/Version-1_0-branch/controller/templates/base/control_group/control_group_tabs.xsl
 (from rev 8645, 
trunk/controller/templates/base/control_group/control_group_tabs.xsl)
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/control_group/control_group_tabs.xsl
                          (rev 0)
+++ 
branches/Version-1_0-branch/controller/templates/base/control_group/control_group_tabs.xsl
  2012-01-22 19:51:52 UTC (rev 8646)
@@ -0,0 +1,20 @@
+<!-- $Id$ -->
+<!-- separate tabs and  inline tables-->
+
+<xsl:template match="data" xmlns:php="http://php.net/xsl";>
+       <div class="yui-navset yui-navset-top" id="control_group_tabview">
+               <xsl:value-of disable-output-escaping="yes" select="tabs" />
+               <div class="yui-content">
+                       <div id="control_group">
+                               <xsl:call-template name="control_group" />
+                       </div>
+                       <div id="control_items">
+                               <xsl:call-template name="control_group_items" />
+                       </div>
+               </div>
+       </div>
+       <!--  script type="text/javascript">
+               var resource_id = <xsl:value-of select="resource/id"/>;
+               var lang = <xsl:value-of select="php:function('js_lang', 
'Name', 'Category', 'Actions', 'Edit', 'Delete', 'Account', 'Role')"/>;
+       </script-->
+</xsl:template>

Deleted: 
branches/Version-1_0-branch/controller/templates/base/control_group_items.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/control_group_items.xsl   
    2012-01-22 19:08:35 UTC (rev 8645)
+++ 
branches/Version-1_0-branch/controller/templates/base/control_group_items.xsl   
    2012-01-22 19:51:52 UTC (rev 8646)
@@ -1,54 +0,0 @@
-<!-- $Id$ -->
-<xsl:template name="control_group_items" xmlns:php="http://php.net/xsl";>
-
-<xsl:call-template name="yui_booking_i18n"/>
-<div class="identifier-header">
-<h1><img src="{img_go_home}" /> 
-       <xsl:value-of select="php:function('lang', 'Control_items')" />
-</h1>
-</div>
-
-<div class="yui-content">
-       <div>
-               <xsl:if test="selected_control_items">
-                       <h2>Valgte kontrollpunkt</h2>
-                       <form action="#" method="post"> 
-                               <ul class="control_items">
-                                       <xsl:for-each 
select="selected_control_items">
-                                               <xsl:variable 
name="control_item_id"><xsl:value-of select="id"/></xsl:variable>
-                                               <li><xsl:if 
test="//editable"><input type="checkbox"  name="item_remove_ids[]" 
value="{$control_item_id}"/></xsl:if><xsl:value-of select="title"/></li>
-                                       </xsl:for-each>
-                               </ul>
-                               <xsl:if test="//editable">
-                                       <div class="form-buttons">
-                                               <xsl:variable 
name="lang_remove"><xsl:value-of select="php:function('lang', 'remove')" 
/></xsl:variable>
-                                               <input type="submit" 
name="remove_control_group_items" value="{$lang_remove}" title = 
"{$lang_remove}" />
-                                       </div>
-                               </xsl:if>
-                       </form>
-               </xsl:if>
-          <!-- ===========================  CHOOSE CONTROL ITEMS  
=============================== -->
-          <xsl:choose>
-               <xsl:when test="editable">
-                       <h2>Velg kontrollpunkt</h2>
-                       <form action="#" method="post"> 
-                       
-                       <xsl:variable name="control_group_id"><xsl:value-of 
select="value_id"/></xsl:variable>
-                       <input type="hidden" name="control_group_id" 
value="{control_group_id}" />
-                       
-                       <ul class="control_items">
-                               <xsl:for-each select="control_items">
-                                       <xsl:variable 
name="control_item_id"><xsl:value-of select="id"/></xsl:variable>
-                                       <li><input type="checkbox"  
name="control_tag_ids[]" value="{$control_item_id}" /><xsl:value-of 
select="title"/></li>
-                               </xsl:for-each>
-                       </ul>           
-                       <div class="form-buttons">
-                               <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save')" /></xsl:variable>
-                               <input type="submit" 
name="save_control_group_items" value="{$lang_save}" title = "{$lang_save}" />
-                       </div>
-                       </form>
-               </xsl:when>
-          </xsl:choose>
-       </div>
-</div>
-</xsl:template>

Deleted: 
branches/Version-1_0-branch/controller/templates/base/control_group_tabs.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/control_group_tabs.xsl    
    2012-01-22 19:08:35 UTC (rev 8645)
+++ 
branches/Version-1_0-branch/controller/templates/base/control_group_tabs.xsl    
    2012-01-22 19:51:52 UTC (rev 8646)
@@ -1,20 +0,0 @@
-<!-- $Id$ -->
-<!-- separate tabs and  inline tables-->
-
-<xsl:template match="data" xmlns:php="http://php.net/xsl";>
-       <div class="yui-navset yui-navset-top" id="control_group_tabview">
-               <xsl:value-of disable-output-escaping="yes" select="tabs" />
-               <div class="yui-content">
-                       <div id="control_group">
-                               <xsl:call-template name="control_group" />
-                       </div>
-                       <div id="control_items">
-                               <xsl:call-template name="control_group_items" />
-                       </div>
-               </div>
-       </div>
-       <!--  script type="text/javascript">
-               var resource_id = <xsl:value-of select="resource/id"/>;
-               var lang = <xsl:value-of select="php:function('js_lang', 
'Name', 'Category', 'Actions', 'Edit', 'Delete', 'Account', 'Role')"/>;
-       </script-->
-</xsl:template>

Deleted: 
branches/Version-1_0-branch/controller/templates/base/control_location_tabs.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/control_location_tabs.xsl 
    2012-01-22 19:08:35 UTC (rev 8645)
+++ 
branches/Version-1_0-branch/controller/templates/base/control_location_tabs.xsl 
    2012-01-22 19:51:52 UTC (rev 8646)
@@ -1,27 +0,0 @@
-<!-- $Id$ -->
-<!-- separate tabs and  inline tables-->
-
-<xsl:template match="data" xmlns:php="http://php.net/xsl";>
-<div class="yui-navset yui-navset-top" id="control_location_tabview">
-       <xsl:choose>
-               <xsl:when test="view = 'view_locations_for_control'">
-                       <div class="identifier-header">
-                               <h1><xsl:value-of select="php:function('lang', 
'Locations_for_control')"/></h1>
-                       </div>
-                       <!-- Prints tabs array -->
-                       <xsl:value-of disable-output-escaping="yes" 
select="tabs" />
-                        
-                       <xsl:call-template name="view_locations_for_control" />
-               </xsl:when>
-               <xsl:when test="view = 'add_location_to_control'">
-                       <div class="identifier-header">
-                               <h1><xsl:value-of select="php:function('lang', 
'Add_location_to_control')"/></h1>
-                       </div>
-                       <!-- Prints tabs array -->
-                       <xsl:value-of disable-output-escaping="yes" 
select="tabs" />
-                       <xsl:call-template name="add_location_to_control" />
-               </xsl:when>
-       </xsl:choose>
-</div>
-       
-</xsl:template>

Deleted: 
branches/Version-1_0-branch/controller/templates/base/control_locations.xsl
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/control_locations.xsl 
2012-01-22 19:08:35 UTC (rev 8645)
+++ branches/Version-1_0-branch/controller/templates/base/control_locations.xsl 
2012-01-22 19:51:52 UTC (rev 8646)
@@ -1,24 +0,0 @@
-<!-- $Id$ -->
-<xsl:template name="control_locations" xmlns:php="http://php.net/xsl";>
-
-<div class="yui-content">
-       <div>
-                 
-          <!-- ===========================  CHOOSE CONTROL LOCATIONS  
=============================== -->
-          <h2>Velg Byggkategori/Eiendom/Bygg</h2>
-          
-               <h4 class="expand_header"><div class="expand_all">Vis 
alle</div><div class="collapse_all">Skjul alle</div></h4>
-               <form id="frm_control_items" action="#" method="post">  
-               
-               <xsl:variable name="control_id"><xsl:value-of 
select="control_id"/></xsl:variable>
-               <input type="hidden" name="control_id" value="{control_id}" />  
        
-               <strong>Liste over byggkategorier/eiendommer/bygg el.</strong>
-               <div class="form-buttons">
-                       <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save')" /></xsl:variable>
-                       <input type="submit" name="save_control_locations" 
value="{$lang_save}" title = "{$lang_save}" />
-               </div>
-               </form>
-                                                               
-       </div>
-</div>
-</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-22 19:08:35 UTC (rev 8645)
+++ branches/Version-1_0-branch/controller/templates/base/css/base.css  
2012-01-22 19:51:52 UTC (rev 8646)
@@ -1259,4 +1259,11 @@
 }
 #cal_wrp{
        clear:both;
+}
+ul#groups {
+    margin-left: 10px;
+    margin-top: 5px;
+}
+ul#groups h4{
+    margin: 4px 0;
 }
\ No newline at end of file

Modified: 
branches/Version-1_0-branch/controller/templates/base/procedure/print_procedure.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/procedure/print_procedure.xsl
 2012-01-22 19:08:35 UTC (rev 8645)
+++ 
branches/Version-1_0-branch/controller/templates/base/procedure/print_procedure.xsl
 2012-01-22 19:51:52 UTC (rev 8646)
@@ -5,21 +5,23 @@
 <xsl:variable name="dateformat"><xsl:value-of select="dateformat" 
/></xsl:variable>
 
 <div id="control_info" style="margin:40px 0 0 40px;">
-
+       <h1 style="text-decoration: underline;text-transform: 
uppercase;"><xsl:value-of select="control/title"/></h1>
+       <h2 style="text-transform: uppercase;"><xsl:value-of 
select="location/loc1_name"/></h2>
+       <h3 style="text-transform: uppercase;"><xsl:value-of 
select="control_group/group_name"/></h3>
 </div>
 
 <div id="procedure" style="margin:40px 0 0 40px;">
                <div>
                        <label for="title"><xsl:value-of 
select="php:function('lang','Procedure title')" /></label>
-                       <xsl:value-of select="procedure/title" />
+                       <span style="display: inline-block;width: 
600px;"><xsl:value-of select="procedure/title" /></span>
                </div>
                <div>
                        <label for="revision_no"><xsl:value-of 
select="php:function('lang','Procedure revision')" /></label>
-                       <xsl:value-of select="procedure/revision_no" />
+                       <span style="display: inline-block;width: 
600px;"><xsl:value-of select="procedure/revision_no" /></span>
                </div>
                <div>
                        <label for="control_area"><xsl:value-of 
select="php:function('lang','Control area')" /></label>
-                       <xsl:value-of select="procedure/control_area_name" />
+                       <span style="display: inline-block;width: 
600px;"><xsl:value-of select="procedure/control_area_name" /></span>
                </div>
                <div>
                        <label for="start_date"><xsl:value-of 
select="php:function('lang','Procedure start date')" /></label>
@@ -43,15 +45,15 @@
                </div>
                <div>
                        <label for="purpose"><xsl:value-of 
select="php:function('lang','Procedure purpose')" /></label>
-                       <xsl:value-of select="procedure/purpose" 
disable-output-escaping="yes"/>
+                       <span style="display: inline-block;width: 
600px;"><xsl:value-of select="procedure/purpose" 
disable-output-escaping="yes"/></span>
                </div>
                <div>
                        <label for="responsibility"><xsl:value-of 
select="php:function('lang','Procedure responsibility')" /></label>
-                       <xsl:value-of select="procedure/responsibility" />
+                       <span style="display: inline-block;width: 
600px;"><xsl:value-of select="procedure/responsibility" /></span>
                </div>
                <div>
                        <label for="description"><xsl:value-of 
select="php:function('lang','Procedure description')" /></label>
-                       <xsl:value-of select="procedure/description" 
disable-output-escaping="yes"/>
+                       <span style="display: inline-block;width: 
600px;"><xsl:value-of select="procedure/description" 
disable-output-escaping="yes"/></span>
                </div>
                <div>
                        <label for="reference"><xsl:value-of 
select="php:function('lang','Procedure Reference')" /></label>
@@ -72,9 +74,10 @@
                margin:10px 0;
         }
        label{ 
-               font-weight: bold;
                display: inline-block;
-               width: 200px;
+       font-weight: bold;
+       vertical-align: top;
+       width: 200px;
        }
 
        .btn {
@@ -89,11 +92,12 @@
            text-decoration: none;
        }
        
-       ul{
-               list-style: none outside none;
+       ol{
+               margin: 0;
+       padding: 0 20px;
        }
        
-       li{
+       ul{
                list-style: none outside none;
        }
        

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-22 19:08:35 UTC (rev 8645)
+++ 
branches/Version-1_0-branch/controller/templates/base/procedure/view_procedures_for_control.xsl
     2012-01-22 19:51:52 UTC (rev 8646)
@@ -9,6 +9,10 @@
                                
<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;control_id=</xsl:text>
+                               <xsl:value-of select="control/id"/>
+                               <xsl:text>&amp;location_code=</xsl:text>
+                               <xsl:value-of select="location/location_code"/>
                                
<xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
                        </xsl:attribute>
                        Skriv ut
@@ -26,7 +30,7 @@
        
        <h3 style="margin:15px 0 3px 0;">Prosedyrer for grupper</h3>
        
-       <ul>
+       <ul id="groups">
                <xsl:for-each select="group_procedures_array">
                        <li>
                                <h4 style="margin:2px 0;"><xsl:value-of 
select="procedure/title"/></h4>
@@ -37,6 +41,12 @@
                                                        
<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;control_id=</xsl:text>
+                                                       <xsl:value-of 
select="//control/id"/>
+                                                       
<xsl:text>&amp;control_group_id=</xsl:text>
+                                                       <xsl:value-of 
select="control_group/id"/>
+                                                       
<xsl:text>&amp;location_code=</xsl:text>
+                                                       <xsl:value-of 
select="//location/location_code"/>
                                                        
<xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
                                                </xsl:attribute>
                                                Skriv ut

Deleted: 
branches/Version-1_0-branch/controller/templates/base/tab_view_check_lists.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/tab_view_check_lists.xsl  
    2012-01-22 19:08:35 UTC (rev 8645)
+++ 
branches/Version-1_0-branch/controller/templates/base/tab_view_check_lists.xsl  
    2012-01-22 19:51:52 UTC (rev 8646)
@@ -1,80 +0,0 @@
-<!-- $Id$ -->
-<xsl:template name="tab_view_check_lists" xmlns:php="http://php.net/xsl";>
-<xsl:variable name="date_format">d/m-Y</xsl:variable>
-
-<div class="yui-content tab_content">
-               
-         <!-- ===========================  SHOWS CONTROL ITEMS RECEIPT   
=============================== -->
-               <xsl:variable name="control_id"><xsl:value-of 
select="control_id"/></xsl:variable>      
-               <input type="hidden" id="control_id" name="control_id" 
value="{control_id}" />
-               
-               <fieldset class="tab_check_list_details">
-                       <label>Startdato</label>
-                       <xsl:if test="control_as_array/start_date != ''">
-                               <xsl:value-of select="php:function('date', 
$date_format, number(control_as_array/start_date))"/><br/>
-                       </xsl:if>
-                       <label>Sluttdato</label>
-                       <xsl:if test="control_as_array/end_date != ''">
-                               <xsl:value-of select="php:function('date', 
$date_format, number(control_as_array/end_date))"/><br/>
-                       </xsl:if>
-                       <label>Syklustype</label><xsl:value-of 
select="control_as_array/repeat_type"/><br/>
-                       <label>Syklusfrekvens</label><xsl:value-of 
select="control_as_array/repeat_interval"/><br/>
-               </fieldset>
-               
-               <ul class="check_list">
-                       <li class="heading">
-                               <div class="status">Status</div>
-                               <div>Skal utføres innen dato</div>
-                               <div>Planlagt utført dato</div>
-                               <div>Ble utført dato</div>
-                               <div>Kommentar</div>
-                       </li>
-                       <xsl:choose>
-                               <xsl:when test="check_list_array/child::node()">
-                                       <xsl:for-each select="check_list_array">
-                                               <li>
-                                                  <div 
class="order_nr"><xsl:number/>.</div>
-                                                  <div class="status">
-                                                        <xsl:variable 
name="status"><xsl:value-of select="status"/></xsl:variable>     
-                                                        <xsl:choose>
-                                                               <xsl:when 
test="status = 1">
-                                                                       <img 
height="15" src="controller/images/status_icon_light_green.png" /> 
-                                                               </xsl:when>
-                                                               <xsl:otherwise>
-                                                                       <img 
height="15" src="controller/images/status_icon_red.png" />
-                                                               </xsl:otherwise>
-                                                       </xsl:choose>
-                                                  </div>
-                                                  <div>
-                                                          <a>
-                                                                       
<xsl:attribute name="href">
-                                                                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_check_list</xsl:text>
-                                                                               
<xsl:text>&amp;check_list_id=</xsl:text>
-                                                                               
        <xsl:value-of select="id"/>
-                                                                       
</xsl:attribute>
-                                                                       <xsl:if 
test="deadline != ''">
-                                                                               
<xsl:value-of select="php:function('date', $date_format, number(deadline))"/>
-                                                                       
</xsl:if>
-                                                               </a>    
-                                                       </div>
-                                                  <div>
-                                                               <xsl:if 
test="planned_date != ''">
-                                                                       
<xsl:value-of select="php:function('date', $date_format, 
number(planned_date))"/>
-                                                               </xsl:if>       
        
-                                                  </div>
-                                                  <div>
-                                                               <xsl:if 
test="completed_date != ''">
-                                                                       
<xsl:value-of select="php:function('date', $date_format, 
number(completed_date))"/>
-                                                               </xsl:if>
-                                                  </div>
-                                                  <div><xsl:value-of 
select="comment"/></div>
-                                               </li>
-                                       </xsl:for-each>
-                               </xsl:when>
-                               <xsl:otherwise>
-                                       Ingen sjekklister for denne kontrollen
-                               </xsl:otherwise>
-                       </xsl:choose>
-               </ul>
-</div>
-</xsl:template>

Copied: 
branches/Version-1_0-branch/controller/templates/base/tab_view_check_lists_garbage.xsl
 (from rev 8645, 
trunk/controller/templates/base/tab_view_check_lists_garbage.xsl)
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/tab_view_check_lists_garbage.xsl
                              (rev 0)
+++ 
branches/Version-1_0-branch/controller/templates/base/tab_view_check_lists_garbage.xsl
      2012-01-22 19:51:52 UTC (rev 8646)
@@ -0,0 +1,80 @@
+<!-- $Id$ -->
+<xsl:template name="tab_view_check_lists" xmlns:php="http://php.net/xsl";>
+<xsl:variable name="date_format">d/m-Y</xsl:variable>
+
+<div class="yui-content tab_content">
+               
+         <!-- ===========================  SHOWS CONTROL ITEMS RECEIPT   
=============================== -->
+               <xsl:variable name="control_id"><xsl:value-of 
select="control_id"/></xsl:variable>      
+               <input type="hidden" id="control_id" name="control_id" 
value="{control_id}" />
+               
+               <fieldset class="tab_check_list_details">
+                       <label>Startdato</label>
+                       <xsl:if test="control_as_array/start_date != ''">
+                               <xsl:value-of select="php:function('date', 
$date_format, number(control_as_array/start_date))"/><br/>
+                       </xsl:if>
+                       <label>Sluttdato</label>
+                       <xsl:if test="control_as_array/end_date != ''">
+                               <xsl:value-of select="php:function('date', 
$date_format, number(control_as_array/end_date))"/><br/>
+                       </xsl:if>
+                       <label>Syklustype</label><xsl:value-of 
select="control_as_array/repeat_type"/><br/>
+                       <label>Syklusfrekvens</label><xsl:value-of 
select="control_as_array/repeat_interval"/><br/>
+               </fieldset>
+               
+               <ul class="check_list">
+                       <li class="heading">
+                               <div class="status">Status</div>
+                               <div>Skal utføres innen dato</div>
+                               <div>Planlagt utført dato</div>
+                               <div>Ble utført dato</div>
+                               <div>Kommentar</div>
+                       </li>
+                       <xsl:choose>
+                               <xsl:when test="check_list_array/child::node()">
+                                       <xsl:for-each select="check_list_array">
+                                               <li>
+                                                  <div 
class="order_nr"><xsl:number/>.</div>
+                                                  <div class="status">
+                                                        <xsl:variable 
name="status"><xsl:value-of select="status"/></xsl:variable>     
+                                                        <xsl:choose>
+                                                               <xsl:when 
test="status = 1">
+                                                                       <img 
height="15" src="controller/images/status_icon_light_green.png" /> 
+                                                               </xsl:when>
+                                                               <xsl:otherwise>
+                                                                       <img 
height="15" src="controller/images/status_icon_red.png" />
+                                                               </xsl:otherwise>
+                                                       </xsl:choose>
+                                                  </div>
+                                                  <div>
+                                                          <a>
+                                                                       
<xsl:attribute name="href">
+                                                                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_check_list</xsl:text>
+                                                                               
<xsl:text>&amp;check_list_id=</xsl:text>
+                                                                               
        <xsl:value-of select="id"/>
+                                                                       
</xsl:attribute>
+                                                                       <xsl:if 
test="deadline != ''">
+                                                                               
<xsl:value-of select="php:function('date', $date_format, number(deadline))"/>
+                                                                       
</xsl:if>
+                                                               </a>    
+                                                       </div>
+                                                  <div>
+                                                               <xsl:if 
test="planned_date != ''">
+                                                                       
<xsl:value-of select="php:function('date', $date_format, 
number(planned_date))"/>
+                                                               </xsl:if>       
        
+                                                  </div>
+                                                  <div>
+                                                               <xsl:if 
test="completed_date != ''">
+                                                                       
<xsl:value-of select="php:function('date', $date_format, 
number(completed_date))"/>
+                                                               </xsl:if>
+                                                  </div>
+                                                  <div><xsl:value-of 
select="comment"/></div>
+                                               </li>
+                                       </xsl:for-each>
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       Ingen sjekklister for denne kontrollen
+                               </xsl:otherwise>
+                       </xsl:choose>
+               </ul>
+</div>
+</xsl:template>

Deleted: 
branches/Version-1_0-branch/controller/templates/base/view_check_lists_for_location.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/view_check_lists_for_location.xsl
     2012-01-22 19:08:35 UTC (rev 8645)
+++ 
branches/Version-1_0-branch/controller/templates/base/view_check_lists_for_location.xsl
     2012-01-22 19:51:52 UTC (rev 8646)
@@ -1,90 +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>
-
-<div id="main_content">
-                       
-               <h1>Kalenderoversikt</h1>
-               <fieldset class="check_list_details">
-                       <div><xsl:value-of 
select="location_array/loc1_name"/></div>
-                       <div>Periode: <xsl:value-of 
select="php:function('date', 'd/m-Y', number(from_date))"/> - <xsl:value-of 
select="php:function('date', 'd/m-Y', number(to_date))"/></div>
-               </fieldset>
-               
-               <h2>Sjekklister</h2>
-               
-               <ul class="calendar">
-                       <li class="heading">
-                               <div>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>
-                               
<div>Jan</div><div>Feb</div><div>Mar</div><div>Apr</div><div>Mai</div><div>Jun</div>
-                               
<div>Jul</div><div>Aug</div><div>Sep</div><div>Okt</div><div>Nov</div><div>Des</div>
-                       </li>
-                       <xsl:choose>
-                               <xsl:when 
test="controls_calendar_array/child::node()">
-                                       <xsl:for-each 
select="controls_calendar_array">
-                                               <li>
-                                                       <div>
-                                                               <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', 'd/m-Y', number(control/start_date))"/>
-                                                       </div>
-                                                       <div class="date">
-                                                               <xsl:choose>
-                                                                       
<xsl:when test="control/end_date != 0">
-                                                                               
<xsl:value-of select="php:function('date', 'd/m-Y', 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>
-                                                       <xsl:for-each 
select="calendar_array">
-                                                               <div 
style="position:relative;">
-                                                               <div 
id="info_box" style="position:absolute;display:none;">
-                                                               </div>
-                                                               <xsl:choose>
-                                                                               
<xsl:when test="id">
-                                                                               
        <xsl:variable name="status"><xsl:value-of 
select="status"/></xsl:variable>
-                                                                               
        <xsl:choose>
-                                                                               
                <xsl:when test="status = 1">
-                                                                               
                        <img height="15" 
src="controller/images/status_icon_light_green.png" /> 
-                                                                               
                </xsl:when>
-                                                                               
                <xsl:otherwise>
-                                                                               
                 <a 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="id"/>
-                                                                               
                        </xsl:attribute>
-                                                                               
                        <img height="15" 
src="controller/images/status_icon_red.png" />
-                                                                               
                </a>
-                                                                               
                </xsl:otherwise>
-                                                                               
        </xsl:choose>   
-                                                                               
</xsl:when>
-                                                                               
<xsl:otherwise>
-                                                                               
        <img height="15" src="controller/images/status_icon_yellow.png" />
-                                                                               
</xsl:otherwise>
-                                                                       
</xsl:choose>
-                                                               </div>
-                                                       </xsl:for-each>
-                                               </li>
-                                       </xsl:for-each>
-                               </xsl:when>
-                               <xsl:otherwise>
-                                       Ingen sjekklister for denne kontrollen
-                               </xsl:otherwise>
-                       </xsl:choose>
-               </ul>
-</div>
-</xsl:template>

Copied: 
branches/Version-1_0-branch/controller/templates/base/view_check_lists_for_location_garbage.xsl
 (from rev 8645, 
trunk/controller/templates/base/view_check_lists_for_location_garbage.xsl)
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/view_check_lists_for_location_garbage.xsl
                             (rev 0)
+++ 
branches/Version-1_0-branch/controller/templates/base/view_check_lists_for_location_garbage.xsl
     2012-01-22 19:51:52 UTC (rev 8646)
@@ -0,0 +1,90 @@
+<!-- $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>
+
+<div id="main_content">
+                       
+               <h1>Kalenderoversikt</h1>
+               <fieldset class="check_list_details">
+                       <div><xsl:value-of 
select="location_array/loc1_name"/></div>
+                       <div>Periode: <xsl:value-of 
select="php:function('date', 'd/m-Y', number(from_date))"/> - <xsl:value-of 
select="php:function('date', 'd/m-Y', number(to_date))"/></div>
+               </fieldset>
+               
+               <h2>Sjekklister</h2>
+               
+               <ul class="calendar">
+                       <li class="heading">
+                               <div>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>
+                               
<div>Jan</div><div>Feb</div><div>Mar</div><div>Apr</div><div>Mai</div><div>Jun</div>
+                               
<div>Jul</div><div>Aug</div><div>Sep</div><div>Okt</div><div>Nov</div><div>Des</div>
+                       </li>
+                       <xsl:choose>
+                               <xsl:when 
test="controls_calendar_array/child::node()">
+                                       <xsl:for-each 
select="controls_calendar_array">
+                                               <li>
+                                                       <div>
+                                                               <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', 'd/m-Y', number(control/start_date))"/>
+                                                       </div>
+                                                       <div class="date">
+                                                               <xsl:choose>
+                                                                       
<xsl:when test="control/end_date != 0">
+                                                                               
<xsl:value-of select="php:function('date', 'd/m-Y', 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>
+                                                       <xsl:for-each 
select="calendar_array">
+                                                               <div 
style="position:relative;">
+                                                               <div 
id="info_box" style="position:absolute;display:none;">
+                                                               </div>
+                                                               <xsl:choose>
+                                                                               
<xsl:when test="id">
+                                                                               
        <xsl:variable name="status"><xsl:value-of 
select="status"/></xsl:variable>
+                                                                               
        <xsl:choose>
+                                                                               
                <xsl:when test="status = 1">
+                                                                               
                        <img height="15" 
src="controller/images/status_icon_light_green.png" /> 
+                                                                               
                </xsl:when>
+                                                                               
                <xsl:otherwise>
+                                                                               
                 <a 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="id"/>
+                                                                               
                        </xsl:attribute>
+                                                                               
                        <img height="15" 
src="controller/images/status_icon_red.png" />
+                                                                               
                </a>
+                                                                               
                </xsl:otherwise>
+                                                                               
        </xsl:choose>   
+                                                                               
</xsl:when>
+                                                                               
<xsl:otherwise>
+                                                                               
        <img height="15" src="controller/images/status_icon_yellow.png" />
+                                                                               
</xsl:otherwise>
+                                                                       
</xsl:choose>
+                                                               </div>
+                                                       </xsl:for-each>
+                                               </li>
+                                       </xsl:for-each>
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       Ingen sjekklister for denne kontrollen
+                               </xsl:otherwise>
+                       </xsl:choose>
+               </ul>
+</div>
+</xsl:template>

Deleted: 
branches/Version-1_0-branch/controller/templates/base/view_locations_for_control.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/view_locations_for_control.xsl
        2012-01-22 19:08:35 UTC (rev 8645)
+++ 
branches/Version-1_0-branch/controller/templates/base/view_locations_for_control.xsl
        2012-01-22 19:51:52 UTC (rev 8646)
@@ -1,125 +0,0 @@
-<!-- $Id$ -->
-<func:function name="phpgw:conditional">
-       <xsl:param name="test"/>
-       <xsl:param name="true"/>
-       <xsl:param name="false"/>
-
-       <func:result>
-               <xsl:choose>
-                       <xsl:when test="$test">
-                               <xsl:value-of select="$true"/>
-                       </xsl:when>
-                       <xsl:otherwise>
-                               <xsl:value-of select="$false"/>
-                       </xsl:otherwise>
-               </xsl:choose>
-       </func:result>
-</func:function>
-
-<xsl:template name="view_locations_for_control">
-       <!-- IMPORTANT!!! Loads YUI javascript -->
-       <xsl:call-template name="common"/>
-
-       <div class="yui-content">
-               <div id="control_details">
-                       <div style="margin: 10px;padding: 10px; width: 25%;">
-                               
-                               <!-- When control area is chosen, an ajax 
request is executed. 
-                                        The operation fetches controls from db 
and populates the control list.
-                                        The ajax operation is handled in 
ajax.js 
-                                --> 
-                                <select style="float:left;" 
id="control_area_list" name="control_area_list">
-                                       <xsl:for-each 
select="control_area_array">
-                                               <xsl:variable 
name="control_area_id"><xsl:value-of select="id"/></xsl:variable>
-                                               <option 
value="{$control_area_id}">
-                                                       <xsl:value-of 
select="title"/>
-                                               </option>                       
-                                       </xsl:for-each>
-                                </select>
-                                
-                                <form id="loc_form" action="" method="GET">
-                       
-                                       <select id="control_id" 
name="control_id">
-                                       <xsl:choose>
-                                               <xsl:when 
test="control_array/child::node()">
-                                                       <xsl:for-each 
select="control_array">
-                                                               <xsl:variable 
name="control_id"><xsl:value-of select="id"/></xsl:variable>
-                                                               <option 
value="{$control_id}">
-                                                                       
<xsl:value-of select="title"/>
-                                                               </option>       
                        
-                                                       </xsl:for-each>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <option>
-                                                               Ingen kontroller
-                                                       </option>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                               
-                                       </select>
-                               </form>
-                       </div>
-                       
-                       <div id="addedProperties">
-                               <ul id="locations_for_control" 
name="locations_for_control">
-                                       <xsl:for-each 
select="locations_for_control">
-                                               <li>
-                                                       <div><xsl:value-of 
select="id"/></div>
-                                                       <div><xsl:value-of 
select="title"/></div>
-                                                       <div><xsl:value-of 
select="location_code"/></div>
-                                               </li>                   
-                                       </xsl:for-each>
-                               </ul>
-                       </div>
-                       
-                       <iframe id="yui-history-iframe" 
src="phpgwapi/js/yahoo/history/assets/blank.html" 
style="position:absolute;top:0; left:0;width:1px; 
height:1px;visibility:hidden;"></iframe>
-                       <input id="yui-history-field" type="hidden"/>
-                       
-                       <xsl:apply-templates select="locations_table"/>
-                       <xsl:call-template name="yui_booking_i18n"/>
-               </div>
-       </div>
-</xsl:template>
-
-<xsl:template match="locations_table" xmlns:php="http://php.net/xsl";>
-       
-       <div id="loc_paginator"/>
-       <div style="margin:20px;" id="locations-container"/>
-       <xsl:call-template name="locations-definition" />
-</xsl:template>
-
-<xsl:template name="locations-definition">
-       <script>
-        
-               YAHOO.controller.columnDefs = [
-                               <xsl:for-each select="//locations_table/field">
-                                       {
-                                               key: "<xsl:value-of 
select="key"/>",
-                                               <xsl:if test="label">
-                                               label: "<xsl:value-of 
select="label"/>",
-                                               </xsl:if>
-                                               sortable: <xsl:value-of 
select="phpgw:conditional(not(sortable = 0), 'true', 'false')"/>,
-                                               <xsl:if test="hidden">
-                                               hidden: true,
-                                               </xsl:if>
-                                               <xsl:if test="formatter">
-                                               formatter: <xsl:value-of 
select="formatter"/>,
-                                               </xsl:if>
-                                               className: "<xsl:value-of 
select="className"/>"
-                                       }<xsl:value-of 
select="phpgw:conditional(not(position() = last()), ',', '')"/>
-                               </xsl:for-each>
-                       ];
-                       
-               var loc_source = '<xsl:value-of select="source"/>';
-               var loc_columnDefs = YAHOO.controller.columnDefs;
-               var loc_form = 'loc_form';
-               var loc_filters = ['control_id'];
-               var loc_container = 'locations-container';
-               var loc_table_id = 'locations_table';
-               var loc_data_table_pag = 'loc_paginator';
-       
-               setDataSource(loc_source, loc_columnDefs, loc_form, 
loc_filters, loc_container, loc_data_table_pag, loc_table_id, null, null, 
null); 
-               
-       </script>
-        
-</xsl:template>

Modified: branches/Version-1_0-branch/phpgwapi/cron/asyncservices.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/cron/asyncservices.php 2012-01-22 
19:08:35 UTC (rev 8645)
+++ branches/Version-1_0-branch/phpgwapi/cron/asyncservices.php 2012-01-22 
19:51:52 UTC (rev 8646)
@@ -56,7 +56,11 @@
        */
        include(PHPGW_API_INC.'/functions.inc.php');
        
+       $GLOBALS['phpgw_info']['user']['domain'] = $_GET['domain'];
+
+       echo 'Start cron: ' . date('Y/m/d H:i:s ') . "\n";
        $num = ExecMethod('phpgwapi.asyncservice.check_run','crontab');
+       echo 'End cron: ' . date('Y/m/d H:i:s ') . "\n";
        // if the following comment got removed, you will get an email from 
cron for every check performed
        //echo date('Y/m/d H:i:s ').$_GET['domain'].': '.($num ? "$num job(s) 
executed" : 'Nothing to execute')."\n";
 

Modified: branches/Version-1_0-branch/phpgwapi/inc/class.asyncservice.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.asyncservice.inc.php 
2012-01-22 19:08:35 UTC (rev 8645)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.asyncservice.inc.php 
2012-01-22 19:51:52 UTC (rev 8646)
@@ -34,6 +34,7 @@
                var $db;
                var $db_table = 'phpgw_async';
                var $debug = false;
+               protected $Exception_On_Error = false;
 
                /**
                * Constructor
@@ -43,6 +44,7 @@
                        $this->db =& $GLOBALS['phpgw']->db;
                        $this->cronline = PHPGW_SERVER_ROOT . 
'/phpgwapi/cron/asyncservices.php '.$GLOBALS['phpgw_info']['user']['domain'];
                        $this->only_fallback = substr(php_uname(), 0, 7) == 
"Windows";  // atm cron-jobs dont work on win
+                       $this->Exception_On_Error =     
$GLOBALS['phpgw']->db->Exception_On_Error; // continue on dberror
                }
 
                /**
@@ -383,6 +385,7 @@
                function check_run($run_by='')
                {
                        flush();
+                       $error = false;
 
                        if (!$this->last_check_run(True,False,$run_by))
                        {
@@ -420,29 +423,56 @@
                                        list($app) = 
explode('.',$job['method']);
                                        
$GLOBALS['phpgw']->translation->add_app($app);
 
+                                       
$GLOBALS['phpgw']->db->Exception_On_Error = true;
+
                                        if($job['next'] <= time())
                                        {
-                                               
ExecMethod($job['method'],$job['data']);
-                                       }
+                                               try
+                                               {
+                                                       echo 
"{$job['method']}\n";
+                                                       
ExecMethod($job['method'],$job['data']);
+                                               }
+                                               catch (Exception $e)
+                                               {
+                                                       if($e)
+                                                       {
+                                                               
$GLOBALS['phpgw']->log->error(array(
+                                                                       'text'  
=> 'asyncservice::check_run() : error when trying to execute %1. Error: %2',
+                                                                       'p1'    
=> $job['method'],
+                                                                       'p2'    
=> $e->getMessage(),
+                                                                       'line'  
=> __LINE__,
+                                                                       'file'  
=> __FILE__
+                                                               ));
 
-                                       if ($job['next'] = 
$this->next_run($job['times']))
-                                       {
-                                               $updated_jobs = 
$this->read($id);
-                                               if (isset($updated_jobs[$id]) 
&& isset($updated_jobs[$id]['data']))
-                                               { // update async data field, 
it could be changed during ExecMethod()
-                                                       $job['data'] = 
$updated_jobs[$id]['data'];
+                                                               // Do not throw 
further - it will stop the loop
+                                                               // in case of a 
manual run
+                                                               echo 
$e->getMessage() . "\n";
+                                                               continue;
+                                                       }
                                                }
-                                               // TK 20.11.06 write job to get 
'next' and alarm updated
-                                               $job['data']['time'] = 
$job['next'];
-                                               $this->write($job);
                                        }
-                                       else    // no further runs
-                                       {
-                                               if($job['next'] <= time())
+
+                                       
$GLOBALS['phpgw']->db->Exception_On_Error = $this->Exception_On_Error;
+
+                                               if ($job['next'] = 
$this->next_run($job['times']))
                                                {
-                                                       
$this->delete($job['id']);
+                                                       $updated_jobs = 
$this->read($id);
+                                                       if 
(isset($updated_jobs[$id]) && isset($updated_jobs[$id]['data']))
+                                                       { // update async data 
field, it could be changed during ExecMethod()
+                                                               $job['data'] = 
$updated_jobs[$id]['data'];
+                                                       }
+                                                       // TK 20.11.06 write 
job to get 'next' and alarm updated
+                                                       $job['data']['time'] = 
$job['next'];
+                                                       $this->write($job);
                                                }
-                                       }
+                                               else    // no further runs
+                                               {
+                                                       if($job['next'] <= 
time())
+                                                       {
+                                                               
$this->delete($job['id']);
+                                                       }
+                                               }
+
                                }
                        }
                        $this->last_check_run(True,True,$run_by);       // 
release semaphore

Modified: branches/Version-1_0-branch/phpgwapi/inc/class.db_pdo.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.db_pdo.inc.php       
2012-01-22 19:08:35 UTC (rev 8645)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.db_pdo.inc.php       
2012-01-22 19:51:52 UTC (rev 8646)
@@ -365,7 +365,7 @@
 
                        catch(PDOException $e)
                        {
-                               if ( $e && $this->Halt_On_Error == 'yes' )
+                               if ( $e && !$this->Exception_On_Error && 
$this->Halt_On_Error == 'yes' )
                                {
                                        $this->transaction_abort();
 
@@ -379,10 +379,15 @@
                                        }
                                        exit;
                                }
-                               else if($this->Exception_On_Error)
+                               else if($this->Exception_On_Error && 
$this->Halt_On_Error == 'yes')
                                {
+                                       $this->transaction_abort();
                                        throw $e;
                                }
+                               else if($this->Exception_On_Error && 
$this->Halt_On_Error != 'yes')
+                               {
+                                       throw $e;
+                               }
                        }
                        $this->delayPointer = true;
                        return true;
@@ -451,7 +456,7 @@
 
                        catch(PDOException $e)
                        {
-                               if ( $e && $this->Halt_On_Error == 'yes' )
+                               if ( $e && !$this->Exception_On_Error && 
$this->Halt_On_Error == 'yes' )
                                {
                                        $this->transaction_abort();
 
@@ -465,10 +470,15 @@
                                        }
                                        exit;
                                }
-                               else if($this->Exception_On_Error)
+                               else if($this->Exception_On_Error && 
$this->Halt_On_Error == 'yes')
                                {
+                                       $this->transaction_abort();
                                        throw $e;
                                }
+                               else if($this->Exception_On_Error && 
$this->Halt_On_Error != 'yes')
+                               {
+                                       throw $e;
+                               }
                        }
 
                        $this->delayPointer = true;

Modified: branches/Version-1_0-branch/phpgwapi/templates/portico/navbar.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/templates/portico/navbar.inc.php       
2012-01-22 19:08:35 UTC (rev 8645)
+++ branches/Version-1_0-branch/phpgwapi/templates/portico/navbar.inc.php       
2012-01-22 19:51:52 UTC (rev 8646)
@@ -195,7 +195,7 @@
                {
                        $icon = $GLOBALS['phpgw']->common->image('phpgwapi', 
'folder');
                        $icon_style = ' style="background-image: url(' . $icon 
. ')"';
-                       $images[$item['image'][0]][$item['image'][1]] = 
$icon_style;
+               //      $images[$item['image'][0]][$item['image'][1]] = 
$icon_style;
                }
                if ( $children )
                {

Modified: branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php    
2012-01-22 19:08:35 UTC (rev 8645)
+++ branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php    
2012-01-22 19:51:52 UTC (rev 8646)
@@ -185,13 +185,13 @@
                                $querymethod = " $where ( spvend_code = 
{$query} OR bilagsnr = {$query})";
                        }
 
-                       $sql = "SELECT bilagsnr, bilagsnr_ut, count(bilagsnr) 
as invoice_count, sum(belop) as belop,spvend_code,fakturadato FROM  $table 
$join_tables $filtermethod $querymethod GROUP BY periode, 
bilagsnr,bilagsnr_ut,spvend_code,fakturadato,oppsynsigndato,saksigndato,budsjettsigndato";
+                       $sql = "SELECT bilagsnr, bilagsnr_ut, count(bilagsnr) 
as invoice_count, sum(belop) as belop, sum(godkjentbelop) as 
godkjentbelop,spvend_code,fakturadato FROM  $table $join_tables $filtermethod 
$querymethod GROUP BY periode, 
bilagsnr,bilagsnr_ut,spvend_code,fakturadato,oppsynsigndato,saksigndato,budsjettsigndato";
                        $sql2 = "SELECT DISTINCT bilagsnr FROM  $table 
$join_tables $filtermethod $querymethod";
 
                        $this->db->query($sql2,__LINE__,__FILE__);
                        $this->total_records = $this->db->num_rows();
 
-                       $sql3 = "SELECT sum(belop) as sum_amount FROM  $table 
$join_tables $filtermethod $querymethod";
+                       $sql3 = "SELECT sum(godkjentbelop) as sum_amount FROM  
$table $join_tables $filtermethod $querymethod";
                        $this->db->query($sql3,__LINE__,__FILE__);
                        $this->db->next_record();
                        $this->sum_amount               = 
$this->db->f('sum_amount');
@@ -214,7 +214,8 @@
                                                'voucher_id'            => 
$this->db->f('bilagsnr'),
                                                'voucher_out_id'        => 
$this->db->f('bilagsnr_ut'),
                                                'invoice_count'         => 
$this->db->f('invoice_count'),
-                                               'amount'                        
=> $this->db->f('belop')
+                                               'amount'                        
=> $this->db->f('belop'),
+                                               'approved_amount'       => 
$this->db->f('godkjentbelop')
                                        );
                        }
 
@@ -305,6 +306,7 @@
                                        $invoice[$i]['currency']                
                = $this->db->f('currency');
                                        $invoice[$i]['order_id']                
                = $this->db->f('pmwrkord_code');
                                        $invoice[$i]['amount']                  
                = $invoice_temp['amount'];
+                                       $invoice[$i]['approved_amount']         
        = $invoice_temp['approved_amount'];
                                        $invoice[$i]['num_days']                
                = 
intval(($timestamp_payment_date-$timestamp_voucher_date)/(24*3600));
                                        $invoice[$i]['timestamp_voucher_date']  
= $timestamp_voucher_date;
 

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-22 19:08:35 UTC (rev 8645)
+++ branches/Version-1_0-branch/property/inc/class.soproject.inc.php    
2012-01-22 19:51:52 UTC (rev 8646)
@@ -283,22 +283,24 @@
                                $cols.= ",$entity_table.user_id";
 
 //                             $cols .= ',sum(fm_workorder.billable_hours) as 
billable_hours';
-                               $cols_return[] = 'billable_hours';
+//                             $cols_return[] = 'billable_hours';
 
-                               $joinmethod = " $this->join phpgw_accounts ON 
($entity_table.coordinator = phpgw_accounts.account_id))";
+                               $joinmethod = " {$this->join} phpgw_accounts ON 
($entity_table.coordinator = phpgw_accounts.account_id))";
                                $paranthesis ='(';
 
-                               $joinmethod .= " $this->join fm_project_status 
ON ($entity_table.status = fm_project_status.id))";
+                               $joinmethod .= " {$this->join} 
fm_project_status ON ($entity_table.status = fm_project_status.id))";
                                $paranthesis .='(';
-
 /*
-                               $joinmethod .= " $this->left_join fm_workorder 
ON ($entity_table.id = fm_workorder.project_id))";
+                               $joinmethod .= " {$this->left_join} 
fm_workorder ON ($entity_table.id = fm_workorder.project_id))";
                                $paranthesis .='(';
 */
                                //----- wo_hour_status
 
                                if($wo_hour_cat_id)
                                {
+                                       $joinmethod .= " {$this->join} 
fm_workorder ON ($entity_table.id = fm_workorder.project_id))";
+                                       $paranthesis .='(';
+
                                        $joinmethod .= " {$this->join} 
fm_wo_hours ON (fm_workorder.id = fm_wo_hours.workorder_id))";
                                        $paranthesis .='(';
 
@@ -338,17 +340,56 @@
                        }
 
 
+                       $order_field = '';
                        if ($order)
                        {
-                               $ordermethod = " order by $order $sort";
+                               $ordermethod = " ORDER BY $order $sort";
+                               switch($order)
+                               {
+                                       case 'project_id':
+                                               $ordermethod = " ORDER BY 
fm_project.id {$sort}";
+                                               break;
+                                       case 'actual_cost':
+                                               $order_field = 
',fm_workorder.act_mtrl_cost + fm_workorder.act_vendor_cost as actual_cost';
+                                               break;
+                                       case 'combined_cost':
+                                                       $order_field = 
',sum(fm_workorder.combined_cost) as combined_cost';
+                                               break;
+                                       case 'address':
+                                                       $order_field = ", 
fm_project.address";
+                                               break;
+                                       case 'status':
+                                                       $order_field = ", 
fm_project_status.descr as status";
+                                               break;
+                                       case 'entry_date':
+                                               $order_field = ", 
fm_project.entry_date";
+                                               break;
+                                       case 'start_date':
+                                               $order_field = ", 
fm_project.start_date";
+                                               break;
+                                       case 'end_date':
+                                               $order_field = ", 
fm_project.end_date";
+                                               break;
+                                       case 'ecodimb':
+                                               $order_field = ", 
fm_project.ecodimb";
+                                               break;
+                                       case 'location_code':
+                                               $order_field = ", 
fm_project.location_code";
+                                               break;
+
+
+                                       default:
+                                               $order_field = ", {$order}";
+                               }
                        }
                        else
                        {
-                               $ordermethod = ' order by fm_project.id DESC';
+                               $ordermethod = ' ORDER BY fm_project.id DESC';
                        }
 
-                       $where= 'WHERE';
 
+                       $where = 'WHERE';
+
                        $filtermethod = '';
 
                        $GLOBALS['phpgw']->config->read();
@@ -407,11 +448,12 @@
                                $where= 'AND';
                        }
 
+/*
                        $group_method = ' GROUP BY 
fm_project_status.descr,loc1_name,fm_project.location_code,fm_project.id,fm_project.entry_date,fm_project.start_date,fm_project.end_date,'
                                . 
'fm_project.name,fm_project.ecodimb,phpgw_accounts.account_lid,fm_project.user_id,fm_project.address,'
                                . 
'fm_project.budget,fm_project.reserve,planned_cost,project_group';
+*/
 
-
                        if (is_array($this->grants))
                        {
                                $grants = $this->grants;
@@ -502,29 +544,32 @@
 
                        $querymethod .= ')';
 
-                       $sql .= " $filtermethod $querymethod";
+//                     $sql .= " $filtermethod $querymethod";
+                       $sql_full = "{$sql} {$filtermethod} {$querymethod}";
+                       //echo substr($sql,strripos($sql,'from'));
 
-                       //echo substr($sql,strripos($sql,'from'));
                        
if($GLOBALS['phpgw_info']['server']['db_type']=='postgres')
-                       {
-                               $sql2 = 'SELECT count(*) as cnt FROM (SELECT 
DISTINCT fm_project.id ' . substr($sql,strripos($sql,'from'))  . ') as cnt';
-                               $this->db->query($sql2,__LINE__,__FILE__);
+                       {                               
+                               $sql_minimized = 'SELECT DISTINCT fm_project.id 
'  . substr($sql_full,strripos($sql_full,'FROM'));
+                               $sql_count = "SELECT count(id) as cnt FROM 
({$sql_minimized}) as t";
+
+                               $this->db->query($sql_count,__LINE__,__FILE__);
                                $this->db->next_record();
                                $this->total_records = $this->db->f('cnt');
                        }
                        else
                        {
-                               $sql2 = 'SELECT fm_project.id ' . 
substr($sql,strripos($sql,'from'))  . ' GROUP BY fm_project.id';
-                               $this->db->query($sql2,__LINE__,__FILE__);
+                               $sql_count = 'SELECT DISTINCT fm_project.id ' . 
substr($sql_full,strripos($sql_full,'FROM'));
+                               $this->db->query($sql_count,__LINE__,__FILE__);
                                $this->total_records = $this->db->num_rows();
                        }
-                       //_debug_array($sql2);
+
+                       $sql_end =   str_replace('SELECT DISTINCT 
fm_project.id',"SELECT DISTINCT fm_project.id {$order_field}", $sql_minimized) 
. " GROUP BY fm_project.id {$ordermethod}";
+//                     _debug_array($sql_end);die();
                        $project_list = array();
-                       $sql .= " $group_method";
-//_debug_array($sql . $ordermethod);
                        if(!$allrows)
                        {
-                               $this->db->limit_query($sql . 
$ordermethod,$start,__LINE__,__FILE__);
+                               
$this->db->limit_query($sql_end,$start,__LINE__,__FILE__);
                        }
                        else
                        {
@@ -536,51 +581,54 @@
                                {
                                        $_fetch_single = false;
                                }
-                               $this->db->query($sql . 
$ordermethod,__LINE__,__FILE__, false, $_fetch_single );
+                               $this->db->query($sql_end,__LINE__,__FILE__, 
false, $_fetch_single );
                                unset($_fetch_single);
                        }
 
                        $project_list = array();
-                       $j=0;
-                       $k=count($cols_return);
+
+
+
+                       $count_cols_return=count($cols_return);
+
                        while ($this->db->next_record())
                        {
-                               for ($i=0;$i<$k;$i++)
+                               $project_list[] = array('project_id' => 
$this->db->f('id'));
+                       }
+
+                       foreach($project_list as &$project)
+                       {
+                               $this->db->query("{$sql} WHERE fm_project.id = 
'{$project['project_id']}' {$group_method}");
+                               $this->db->next_record();
+
+                               for ($i=0;$i<$count_cols_return;$i++)
                                {
-                                       $project_list[$j][$cols_return[$i]] = 
stripslashes($this->db->f($cols_return[$i]));
-                                       $project_list[$j]['grants'] = 
(int)$this->grants[$this->db->f('user_id')];
+                                       $project[$cols_return[$i]] = 
$this->db->f($cols_return[$i]);
                                }
+                               $project['grants'] = 
(int)$this->grants[$this->db->f('user_id')];
+
                                $location_code= $this->db->f('location_code');
                                $location = explode('-',$location_code);
-                               $n=count($location);
-                               for ($m=0;$m<$n;$m++)
+                               $count_location =count($location);
+
+                               for ($m=0;$m<$count_location;$m++)
                                {
-                                       $project_list[$j]['loc' . ($m+1)] = 
$location[$m];
-                                       
$project_list[$j]['query_location']['loc' . ($m+1)]=implode("-", 
array_slice($location, 0, ($m+1)));
+                                       $project['loc' . ($m+1)] = 
$location[$m];
+                                       $project['query_location']['loc' . 
($m+1)]=implode("-", array_slice($location, 0, ($m+1)));
                                }
 
-                               $j++;
+                               $sql_workder  = 'SELECT 
sum(fm_workorder.combined_cost) as combined_cost,'
+                               . ' (sum(fm_workorder.act_mtrl_cost) + 
sum(fm_workorder.act_vendor_cost)) as actual_cost,'
+                               . ' sum(fm_workorder.billable_hours) as 
billable_hours'
+                               . " FROM fm_workorder WHERE project_id = 
'{$project['project_id']}'";
+                               $this->db->query($sql_workder);
+                               $this->db->next_record();
+                               $project['combined_cost']       = 
(int)$this->db->f('combined_cost');
+                               $project['actual_cost']         = 
(int)$this->db->f('actual_cost');
+                               $project['billable_hours']      = 
(int)$this->db->f('billable_hours');
+
                        }
 
-                       foreach($project_list as &$project)
-                       {
-                               $project['combined_cost']       = 0;
-                               $project['actual_cost']         = 0;
-                               $project['billable_hours']      = 0;
-
-                               if($project['project_id'])
-                               {
-                                       $sql  = 'SELECT 
sum(fm_workorder.combined_cost) as combined_cost,'
-                                       . ' (sum(fm_workorder.act_mtrl_cost) + 
sum(fm_workorder.act_vendor_cost)) as actual_cost,'
-                                       . ' sum(fm_workorder.billable_hours) as 
billable_hours'
-                                       . " FROM fm_workorder WHERE project_id 
= '{$project['project_id']}'";
-                                       $this->db->query($sql);
-                                       $this->db->next_record();
-                                       $project['combined_cost']       = 
(int)$this->db->f('combined_cost');
-                                       $project['actual_cost']         = 
(int)$this->db->f('actual_cost');
-                                       $project['billable_hours']      = 
(int)$this->db->f('billable_hours');
-                               }
-                       }
                        return $project_list;
                }
 

Modified: branches/Version-1_0-branch/property/inc/class.soworkorder.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soworkorder.inc.php  
2012-01-22 19:08:35 UTC (rev 8645)
+++ branches/Version-1_0-branch/property/inc/class.soworkorder.inc.php  
2012-01-22 19:51:52 UTC (rev 8646)
@@ -243,10 +243,10 @@
 */
                                $cols .= ",fm_project.user_id as project_owner";
 
-                               $joinmethod .= " $this->join  fm_workorder ON 
($entity_table.id = fm_workorder.project_id) $this->join  phpgw_accounts ON 
(fm_workorder.user_id = phpgw_accounts.account_id))";
+                               $joinmethod .= "{$this->join} fm_workorder ON 
({$entity_table}.id = fm_workorder.project_id) {$this->join} phpgw_accounts ON 
(fm_workorder.user_id = phpgw_accounts.account_id))";
                                $paranthesis .='(';
 
-                               $joinmethod .= " $this->join 
fm_workorder_status ON (fm_workorder.status = fm_workorder_status.id))";
+                               $joinmethod .= " {$this->join} 
fm_workorder_status ON (fm_workorder.status = fm_workorder_status.id))";
                                $paranthesis .='(';
 
                                $cols .= ',fm_vendor.org_name';
@@ -279,17 +279,17 @@
                                $uicols['classname'][]          = 'rightClasss';
                                $uicols['sortable'][]           = true;
 
-                               $joinmethod .= " $this->left_join  fm_vendor ON 
(fm_workorder.vendor_id = fm_vendor.id))";
+                               $joinmethod .= " {$this->left_join} fm_vendor 
ON (fm_workorder.vendor_id = fm_vendor.id))";
                                $paranthesis .='(';
 
                                //----- wo_hour_status
 
                                if($wo_hour_cat_id)
                                {
-                                       $joinmethod .= " $this->join 
fm_wo_hours ON (fm_workorder.id = fm_wo_hours.workorder_id))";
+                                       $joinmethod .= " {$this->join} 
fm_wo_hours ON (fm_workorder.id = fm_wo_hours.workorder_id))";
                                        $paranthesis .='(';
 
-                                       $joinmethod .= " $this->join 
fm_wo_hours_category ON (fm_wo_hours.category = fm_wo_hours_category.id))";
+                                       $joinmethod .= " {$this->join} 
fm_wo_hours_category ON (fm_wo_hours.category = fm_wo_hours_category.id))";
                                        $paranthesis .='(';
                                }
 
@@ -300,7 +300,7 @@
 
                                if($b_group)
                                {
-                                       $joinmethod .= " $this->join 
fm_b_account ON (fm_workorder.account_id =fm_b_account.id))";
+                                       $joinmethod .= " {$this->join} 
fm_b_account ON (fm_workorder.account_id =fm_b_account.id))";
                                        $paranthesis .='(';
                                }
 
@@ -369,24 +369,51 @@
                                $location_table = 'fm_workorder';
                        }
 
+                       $order_field = '';
                        if ($order)
                        {
-                               if($order == 'workorder_id')
+                               $ordermethod = " ORDER BY $order $sort";
+                               switch($order)
                                {
-       //                              $ordermethod = " ORDER BY 
fm_workorder.project_id {$sort},fm_workorder.id {$sort}";     
-                                       $ordermethod = " ORDER BY 
fm_workorder.id {$sort}";     
+                                       case 'workorder_id':
+       //                                      $ordermethod = " ORDER BY 
fm_workorder.project_id {$sort},fm_workorder.id {$sort}";     
+                                               $ordermethod = " ORDER BY 
fm_workorder.id {$sort}";
+                                               break;
+                                       case 'actual_cost':
+                                               $order_field = 
',fm_workorder.act_mtrl_cost + fm_workorder.act_vendor_cost as actual_cost';
+                                               break;
+                                       case 'address':
+                                               
if(isset($GLOBALS['phpgw']->config->config_data['location_at_workorder']) && 
$GLOBALS['phpgw']->config->config_data['location_at_workorder'])
+                                               {
+                                                       $order_field = ", 
fm_workorder.address";
+                                               }
+                                               else
+                                               {
+                                                       $order_field = ", 
fm_project.address";
+                                               }
+                                               break;
+                                       case 'entry_date':
+                                               $order_field = ", 
fm_workorder.entry_date";
+                                               break;
+                                       case 'start_date':
+                                               $order_field = ", 
fm_workorder.start_date";
+                                               break;
+                                       case 'end_date':
+                                               $order_field = ", 
fm_workorder.end_date";
+                                               break;
+                                       case 'ecodimb':
+                                               $order_field = ", 
fm_workorder.ecodimb";
+                                               break;
+                                       default:
+                                               $order_field = ", {$order}";
                                }
-                               else
-                               {
-                                       $ordermethod = " ORDER BY $order $sort";
-                               }
                        }
                        else
                        {
        //                      $ordermethod = ' ORDER BY 
fm_workorder.project_id DESC,fm_workorder.id DESC';
                                $ordermethod = ' ORDER BY fm_workorder.id DESC';
                        }
-
+//_debug_array($order_field);die;
                        $where= 'WHERE';
 
                        $filtermethod = '';
@@ -559,30 +586,32 @@
                        }
                        $querymethod .= ')';
 
-                       $sql .= " $filtermethod $querymethod";
+                       $sql_full = "{$sql} {$filtermethod} {$querymethod}";
 
-                       //_debug_array($sql);
                        
if($GLOBALS['phpgw_info']['server']['db_type']=='postgres')
-                       {
-                               $sql2 = 'SELECT count(fm_workorder.id) as cnt ' 
. substr($sql,strripos($sql,'from'));
-                               $this->db->query($sql2,__LINE__,__FILE__);
+                       {                               
+                               $sql_minimized = 'SELECT DISTINCT 
fm_workorder.id '  . substr($sql_full,strripos($sql_full,'FROM'));
+                               $sql_count = "SELECT count(id) as cnt FROM 
({$sql_minimized}) as t";
+
+                               $this->db->query($sql_count,__LINE__,__FILE__);
                                $this->db->next_record();
                                $this->total_records = $this->db->f('cnt');
                        }
                        else
                        {
-                               $sql2 = 'SELECT fm_workorder.id ' . 
substr($sql,strripos($sql,'from'));
-                               $this->db->query($sql2,__LINE__,__FILE__);
+                               $sql_count = 'SELECT DISTINCT fm_workorder.id ' 
. substr($sql_full,strripos($sql_full,'FROM'));
+                               $this->db->query($sql_count,__LINE__,__FILE__);
                                $this->total_records = $this->db->num_rows();
                        }
 
                        $workorder_list = array();
 
-                       $sql .= " $group_method";
+                       $sql_end =   str_replace('SELECT DISTINCT 
fm_workorder.id',"SELECT DISTINCT fm_workorder.id {$order_field}", 
$sql_minimized) . $ordermethod;
+//     _debug_array($sql_end);die();
 
                        if(!$allrows)
                        {
-                               $this->db->limit_query($sql . 
$ordermethod,$start,__LINE__,__FILE__);
+                               
$this->db->limit_query($sql_end,$start,__LINE__,__FILE__);
                        }
                        else
                        {
@@ -594,31 +623,37 @@
                                {
                                        $_fetch_single = false;
                                }
-                               $this->db->query($sql . 
$ordermethod,__LINE__,__FILE__, false, $_fetch_single );
+                               $this->db->query($sql_end,__LINE__,__FILE__, 
false, $_fetch_single );
                                unset($_fetch_single);
                        }
 
                        $count_cols_return=count($cols_return);
-                       $j=0;
 
                        while ($this->db->next_record())
                        {
+                               $workorder_list[] = array('workorder_id' => 
$this->db->f('id'));
+                       }
+
+                       foreach($workorder_list as &$workorder)
+                       {
+                               $this->db->query("{$sql} WHERE fm_workorder.id 
= '{$workorder['workorder_id']}'");
+                               $this->db->next_record();
+
                                for ($i=0;$i<$count_cols_return;$i++)
                                {
-                                       $workorder_list[$j][$cols_return[$i]] = 
$this->db->f($cols_return[$i]);
-                                       $workorder_list[$j]['grants'] = 
(int)$this->grants[$this->db->f('project_owner')];
+                                       $workorder[$cols_return[$i]] = 
$this->db->f($cols_return[$i]);
                                }
+                               $workorder['grants'] = 
(int)$this->grants[$this->db->f('project_owner')];
 
                                $location_code= $this->db->f('location_code');
                                $location = explode('-',$location_code);
                                $count_location =count($location);
+
                                for ($m=0;$m<$count_location;$m++)
                                {
-                                       $workorder_list[$j]['loc' . ($m+1)] = 
$location[$m];
-                                       
$workorder_list[$j]['query_location']['loc' . ($m+1)]=implode("-", 
array_slice($location, 0, ($m+1)));
+                                       $workorder['loc' . ($m+1)] = 
$location[$m];
+                                       $workorder['query_location']['loc' . 
($m+1)]=implode("-", array_slice($location, 0, ($m+1)));
                                }
-
-                               $j++;
                        }
 
                        return $workorder_list;
@@ -914,6 +949,12 @@
                                $workorder['workorder_num'] = $id;
                        }
 
+                       if 
(isset($GLOBALS['phpgw_info']['user']['preferences']['common']['currency']))
+                       {
+                               $workorder['contract_sum']              = 
str_ireplace($GLOBALS['phpgw_info']['user']['preferences']['common']['currency'],'',$workorder['contract_sum']);
+                       }
+                       $workorder['contract_sum']              = 
str_replace(array(' ',','),array('','.'),$workorder['contract_sum']);
+
                        $values= array
                                (
                                        $id,
@@ -1036,7 +1077,13 @@
                                $paid = 2;
                        }
 
+                       if 
(isset($GLOBALS['phpgw_info']['user']['preferences']['common']['currency']))
+                       {
+                               $workorder['contract_sum']              = 
str_ireplace($GLOBALS['phpgw_info']['user']['preferences']['common']['currency'],'',$workorder['contract_sum']);
+                       }
+                       $workorder['contract_sum']              = 
str_replace(array(' ',','),array('','.'),$workorder['contract_sum']);
 
+
                        $value_set = array
                                (
                                        'title'                 => 
$workorder['title'],

Modified: branches/Version-1_0-branch/property/inc/class.uiinvoice.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uiinvoice.inc.php    
2012-01-22 19:08:35 UTC (rev 8645)
+++ branches/Version-1_0-branch/property/inc/class.uiinvoice.inc.php    
2012-01-22 19:51:52 UTC (rev 8646)
@@ -826,7 +826,7 @@
                                                                                
'num_days',
                                                                                
'timestamp_voucher_date',
                                                                                
'num_days',
-                                                                               
'amount',
+                                                                               
'approved_amount',
                                                                                
'currency',
                                                                                
'vendor',
                                                                                
'invoice_count',
@@ -894,7 +894,7 @@
                                                                                
'dummy',
                                                                                
'dummy',
                                                                                
lang('Days'),
-                                                                               
lang('Sum'),
+                                                                               
lang('approved amount'),
                                                                                
lang('currency'),
                                                                                
lang('Vendor'),
                                                                                
'dummy',


@@ Diff output truncated at 153600 characters. @@



reply via email to

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