fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [8431] Merge 8397:8430 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [8431] Merge 8397:8430 from trunk
Date: Fri, 23 Dec 2011 14:22:25 +0000

Revision: 8431
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8431
Author:   sigurdne
Date:     2011-12-23 14:22:25 +0000 (Fri, 23 Dec 2011)
Log Message:
-----------
Merge 8397:8430 from trunk

Modified Paths:
--------------
    branches/Version-1_0-branch/admin/inc/class.soconfig.inc.php
    branches/Version-1_0-branch/controller/images/status_icon_dark_blue.png
    branches/Version-1_0-branch/controller/images/status_icon_dark_blue.psd
    branches/Version-1_0-branch/controller/images/status_icon_light_blue.png
    branches/Version-1_0-branch/controller/images/status_icon_light_blue.psd
    branches/Version-1_0-branch/controller/images/status_icon_light_green.psd
    branches/Version-1_0-branch/controller/images/status_icon_yellow.png
    branches/Version-1_0-branch/controller/images/status_icon_yellow.psd
    branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php
    branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php
    branches/Version-1_0-branch/controller/inc/class.socontrol_item_list.inc.php
    branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
    
branches/Version-1_0-branch/controller/inc/class.uicheck_list_for_location.inc.php
    branches/Version-1_0-branch/controller/inc/class.uidocument.inc.php
    
branches/Version-1_0-branch/controller/inc/component/class.calendar_builder.inc.php
    
branches/Version-1_0-branch/controller/inc/helper/class.check_list_status_info.inc.php
    branches/Version-1_0-branch/controller/js/controller/custom_ui.js
    branches/Version-1_0-branch/controller/setup/phpgw_no.lang
    
branches/Version-1_0-branch/controller/templates/base/add_check_list_for_location.xsl
    branches/Version-1_0-branch/controller/templates/base/css/base.css
    branches/Version-1_0-branch/controller/templates/base/edit_check_list.xsl
    
branches/Version-1_0-branch/controller/templates/base/procedure_documents.xsl
    
branches/Version-1_0-branch/controller/templates/base/view_calendar_month.xsl
    branches/Version-1_0-branch/controller/templates/base/view_calendar_year.xsl
    branches/Version-1_0-branch/frontend/inc/class.uihelpdesk.inc.php
    branches/Version-1_0-branch/phpgwapi/inc/class.setup.inc.php
    branches/Version-1_0-branch/property/inc/class.boproject.inc.php
    branches/Version-1_0-branch/property/inc/class.botts.inc.php
    branches/Version-1_0-branch/property/inc/class.menu.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/inc/cron/default/Import_fra_basware_X205.php
    branches/Version-1_0-branch/property/inc/export/default/Agresso
    branches/Version-1_0-branch/property/inc/export/default/Basware_X114
    branches/Version-1_0-branch/property/js/yahoo/admin_entity.edit_category.js
    branches/Version-1_0-branch/property/js/yahoo/project.edit.js
    branches/Version-1_0-branch/property/js/yahoo/workorder.edit.js
    branches/Version-1_0-branch/property/setup/default_records.inc.php
    branches/Version-1_0-branch/property/setup/phpgw_no.lang
    branches/Version-1_0-branch/property/setup/setup.inc.php
    branches/Version-1_0-branch/property/setup/tables_update.inc.php
    branches/Version-1_0-branch/property/templates/base/config.tpl
    branches/Version-1_0-branch/property/templates/base/project.xsl

Added Paths:
-----------
    branches/Version-1_0-branch/controller/images/status_icon_yellow_ring.png
    
branches/Version-1_0-branch/controller/inc/class.uierror_report_message.inc.php
    
branches/Version-1_0-branch/controller/templates/base/create_error_report_message.xsl
    branches/Version-1_0-branch/property/js/yahoo/project.bulk_update_status.js

Removed Paths:
-------------
    
branches/Version-1_0-branch/controller/templates/base/css/jquery-ui.custom_bac.css

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
   + 
/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

Modified: branches/Version-1_0-branch/admin/inc/class.soconfig.inc.php
===================================================================
--- branches/Version-1_0-branch/admin/inc/class.soconfig.inc.php        
2011-12-23 14:09:08 UTC (rev 8430)
+++ branches/Version-1_0-branch/admin/inc/class.soconfig.inc.php        
2011-12-23 14:22:25 UTC (rev 8431)
@@ -22,6 +22,7 @@
                public $config_data = array();
                protected $db;
                protected $location_id = 0;
+               protected $global_lock = false;
 
                public function __construct($location_id = 0)
                {
@@ -142,10 +143,29 @@
 
                function add_section(array $values)
                {
-                       $this->db->transaction_begin();
+                       if ( $this->db->get_transaction() )
+                       {
+                               $this->global_lock = true;
+                       }
+                       else
+                       {
+                               $this->db->transaction_begin();
+                       }
 
+
                        $values['name'] = 
$this->db->db_addslashes($values['name']);
                        $values['descr'] = 
$this->db->db_addslashes($values['descr']);
+
+                       $sql = "SELECT id FROM phpgw_config2_section WHERE 
location_id = {$this->location_id} AND descr = '{$values['descr']}'";
+
+                       $this->db->query($sql,__LINE__,__FILE__);
+                       if ($this->db->next_record())
+                       {
+                               $receipt['section_id']=  $this->db->f('id');
+                               $receipt['message'][]=array('msg'=>lang('config 
section has not been saved'));
+                               return $receipt;
+                       }
+
                        $values['section_id'] = 
$this->db->next_id('phpgw_config2_section');
 
                        $insert_values = array
@@ -163,15 +183,26 @@
                        $receipt['message'][]=array('msg'=>lang('config section 
has been saved'));
                        $receipt['section_id']= $values['section_id'];
 
-                       $this->db->transaction_commit();
+                       if ( !$this->global_lock )
+                       {
+                               $this->db->transaction_commit();
+                       }
 
                        return $receipt;
                }
 
                function edit_section(array $values)
                {
-                       $this->db->transaction_begin();
+                       if ( $this->db->get_transaction() )
+                       {
+                               $this->global_lock = true;
+                       }
+                       else
+                       {
+                               $this->db->transaction_begin();
+                       }
 
+
                        $value_set['name']              = 
$this->db->db_addslashes($values['name']);
                        $value_set['descr']             = 
$this->db->db_addslashes($values['descr']);
 
@@ -179,7 +210,10 @@
 
                        $this->db->query("UPDATE phpgw_config2_section set 
$value_set WHERE id=" . $values['section_id'],__LINE__,__FILE__);
 
-                       $this->db->transaction_commit();
+                       if ( !$this->global_lock )
+                       {
+                               $this->db->transaction_commit();
+                       }
 
                        $receipt['message'][]=array('msg'=>lang('config section 
has been edited'));
 
@@ -190,12 +224,25 @@
                function delete_section(int $id)
                {
                        $id = (int)$id;
-                       $this->db->transaction_begin();
+
+                       if ( $this->db->get_transaction() )
+                       {
+                               $this->global_lock = true;
+                       }
+                       else
+                       {
+                               $this->db->transaction_begin();
+                       }
+
                        $this->db->query("DELETE FROM phpgw_config2_value WHERE 
section_id = {$id}",__LINE__,__FILE__);
                        $this->db->query("DELETE FROM phpgw_config2_choice 
WHERE section_id = {$id}",__LINE__,__FILE__);
                        $this->db->query("DELETE FROM phpgw_config2_attrib 
WHERE section_id = {$id}",__LINE__,__FILE__);
                        $this->db->query("DELETE FROM phpgw_config2_section 
WHERE id = {$id}",__LINE__,__FILE__);
-                       $this->db->transaction_commit();
+
+                       if ( !$this->global_lock )
+                       {
+                               $this->db->transaction_commit();
+                       }
                }
 
                function read_attrib(array $data)
@@ -321,10 +368,29 @@
 
                function add_attrib(array $values)
                {
-                       $this->db->transaction_begin();
+                       if ( $this->db->get_transaction() )
+                       {
+                               $this->global_lock = true;
+                       }
+                       else
+                       {
+                               $this->db->transaction_begin();
+                       }
 
                        $values['name'] = 
$this->db->db_addslashes($values['name']);
                        $values['descr'] = 
$this->db->db_addslashes($values['descr']);
+
+                       $sql = "SELECT id FROM phpgw_config2_attrib WHERE 
section_id = '{$values['section_id']}' AND name = '{$values['name']}'";
+
+                       $this->db->query($sql,__LINE__,__FILE__);
+
+                       if ($this->db->next_record())
+                       {
+                               $receipt['attrib_id']   = $this->db->f('id');
+                               $receipt['error'][]=array('msg'=>lang('config 
attrib has been saved'));
+                               return $receipt;
+                       }
+
                        $values['attrib_id'] = 
$this->db->next_id('phpgw_config2_attrib',array('section_id'=>$values['section_id']));
 
                        $insert_values = array
@@ -340,18 +406,45 @@
                        $this->db->query("INSERT INTO phpgw_config2_attrib 
(section_id,id,input_type,name,descr) "
                                . "VALUES ($insert_values)",__LINE__,__FILE__);
 
+
+                       $choice_map = array();
+                       if(isset($values['choice']) && $values['choice'])
+                       {
+                               foreach ($values['choice'] as $choice)
+                               {
+                                       $values['new_choice'] = $choice;
+                                       $this->edit_attrib($values);            
                
+                               }
+                       }
+
+                       if(isset($values['value']) && $values['value'])
+                       {
+                               $this->add_value($values);
+                       }
+
                        $receipt['message'][]=array('msg'=>lang('config attrib 
has been saved'));
                        $receipt['attrib_id']= $values['attrib_id'];
 
-                       $this->db->transaction_commit();
+                       if ( !$this->global_lock )
+                       {
+                               $this->db->transaction_commit();
+                       }
 
                        return $receipt;
                }
 
                function edit_attrib(array $values)
                {
-                       $this->db->transaction_begin();
+                       if ( $this->db->get_transaction() )
+                       {
+                               $this->global_lock = true;
+                       }
+                       else
+                       {
+                               $this->db->transaction_begin();
+                       }
 
+
                        $value_set['name']      = 
$this->db->db_addslashes($values['name']);
                        $value_set['descr']     = 
$this->db->db_addslashes($values['descr']);
                        $value_set['input_type']        = $values['input_type'];
@@ -387,11 +480,15 @@
                                }
                        }
 
-                       $this->db->transaction_commit();
+                       if ( !$this->global_lock )
+                       {
+                               $this->db->transaction_commit();
+                       }
 
                        $receipt['message'][]=array('msg'=>lang('config attrib 
has been edited'));
 
                        $receipt['attrib_id']= $values['attrib_id'];
+                       $receipt['choice_id'] = $choice_id;
                        return $receipt;
                }
 
@@ -400,11 +497,22 @@
                        $section_id     = (int) $section_id;
                        $id                     = (int) $id;
 
-                       $this->db->transaction_begin();
+                       if ( $this->db->get_transaction() )
+                       {
+                               $this->global_lock = true;
+                       }
+                       else
+                       {
+                               $this->db->transaction_begin();
+                       }
+
                        $this->db->query("DELETE FROM phpgw_config2_value WHERE 
section_id ={$section_id} AND attrib_id={$id}",__LINE__,__FILE__);
                        $this->db->query("DELETE FROM phpgw_config2_choice 
WHERE section_id ={$section_id} AND attrib_id={$id}",__LINE__,__FILE__);
                        $this->db->query("DELETE FROM phpgw_config2_attrib 
WHERE section_id ={$section_id} AND id={$id}",__LINE__,__FILE__);
-                       $this->db->transaction_commit();
+                       if ( !$this->global_lock )
+                       {
+                               $this->db->transaction_commit();
+                       }
                }
 
                function read_value(array $data)
@@ -490,8 +598,16 @@
                                $values['value'] = 
phpgwapi_datetime::date_to_timestamp($values['value']);
                        }
 
-                       $this->db->transaction_begin();
+                       if ( $this->db->get_transaction() )
+                       {
+                               $this->global_lock = true;
+                       }
+                       else
+                       {
+                               $this->db->transaction_begin();
+                       }
 
+
                        $values['value'] = 
$this->db->db_addslashes($values['value']);
                        $id = 
$this->db->next_id('phpgw_config2_value',array('section_id'=>$values['section_id'],'attrib_id'=>$values['attrib_id']));
 
@@ -510,7 +626,10 @@
                        $receipt['message'][]=array('msg'=>lang('config value 
has been saved'));
                        $receipt['id']= $id;
 
-                       $this->db->transaction_commit();
+                       if ( !$this->global_lock )
+                       {
+                               $this->db->transaction_commit();
+                       }
 
                        return $receipt;
                }
@@ -528,11 +647,23 @@
                        }
                        else
                        {
-                               $this->db->transaction_begin();
+                               if ( $this->db->get_transaction() )
+                               {
+                                       $this->global_lock = true;
+                               }
+                               else
+                               {
+                                       $this->db->transaction_begin();
+                               }
+
                                $value_set['value']     = 
$this->db->db_addslashes($values['value']);
                                $value_set      = 
$this->db->validate_update($value_set);
                                $this->db->query("UPDATE phpgw_config2_value 
SET {$value_set} WHERE section_id =" . (int)$values['section_id'] . ' AND 
attrib_id=' . (int)$values['attrib_id'] . ' AND id=' . 
(int)$values['id'],__LINE__,__FILE__);
-                               $this->db->transaction_commit();
+
+                               if ( !$this->global_lock )
+                               {
+                                       $this->db->transaction_commit();
+                               }
                        }
 
                        $receipt['message'][]=array('msg'=>lang('config value 
has been edited'));
@@ -547,9 +678,20 @@
                        $attrib_id      = (int) $attrib_id;
                        $id                     = (int) $id;
 
-                       $this->db->transaction_begin();
+                       if ( $this->db->get_transaction() )
+                       {
+                               $this->global_lock = true;
+                       }
+                       else
+                       {
+                               $this->db->transaction_begin();
+                       }
+
                        $this->db->query("DELETE FROM phpgw_config2_value WHERE 
section_id ={$section_id} AND attrib_id={$attrib_id} AND 
id={$id}",__LINE__,__FILE__);
-                       $this->db->transaction_commit();
+                       if ( !$this->global_lock )
+                       {
+                               $this->db->transaction_commit();
+                       }
                }
 
                function select_choice_list($section_id,$attrib_id)

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

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

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

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

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

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

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

Copied: 
branches/Version-1_0-branch/controller/images/status_icon_yellow_ring.png (from 
rev 8430, trunk/controller/images/status_icon_yellow_ring.png)
===================================================================
(Binary files differ)

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       
2011-12-23 14:09:08 UTC (rev 8430)
+++ branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php       
2011-12-23 14:22:25 UTC (rev 8431)
@@ -86,7 +86,7 @@
        }
                
        public function get_single_with_check_items($check_list_id, $status){
-               $sql  = "SELECT cl.id as cl_id, cl.status as cl_status, 
cl.control_id, cl.comment as cl_comment, deadline, planned_date, 
completed_date, ";
+               $sql  = "SELECT cl.id as cl_id, cl.status as cl_status, 
cl.control_id, cl.comment as cl_comment, deadline, planned_date, 
completed_date, location_code, ";
                $sql .= "ci.id as ci_id, ci.status as ci_status, 
control_item_id, ci.comment as ci_comment, check_list_id, "; 
                $sql .= "coi.title as coi_id, coi.title as coi_title, 
coi.required as coi_required, coi.required as coi_required, ";
                $sql .= "coi.what_to_do as coi_what_to_do, coi.how_to_do as 
coi_how_to_do, coi.control_group_id as coi_control_group_id "; 
@@ -113,6 +113,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'));   
                        }
                                                
                        if($this->db->f('ci_id', true) != ''){

Modified: 
branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php     
2011-12-23 14:09:08 UTC (rev 8430)
+++ branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php     
2011-12-23 14:22:25 UTC (rev 8431)
@@ -312,8 +312,8 @@
                {
                        $results = array();
 
-                       $sql = "SELECT ci.* FROM controller_control_item ci, 
controller_control_item_list cl, controller_control c ";
-                       $sql .= "WHERE c.id=$control_id AND c.id=cl.control_id 
AND cl.control_item_id=ci.id";
+                       $sql  = "SELECT ci.* FROM controller_control_item ci, 
controller_control_item_list cl ";
+                       $sql .= "WHERE cl.control_id=$control_id AND 
cl.control_item_id=ci.id";
                        $this->db->query($sql);
 
                        while ($this->db->next_record()) {
@@ -326,7 +326,6 @@
 
                                $results[] = $control_item;
                        }
-
                        return $results;
                }
 

Modified: 
branches/Version-1_0-branch/controller/inc/class.socontrol_item_list.inc.php
===================================================================
--- 
branches/Version-1_0-branch/controller/inc/class.socontrol_item_list.inc.php    
    2011-12-23 14:09:08 UTC (rev 8430)
+++ 
branches/Version-1_0-branch/controller/inc/class.socontrol_item_list.inc.php    
    2011-12-23 14:22:25 UTC (rev 8431)
@@ -82,20 +82,6 @@
                        }
                }
 
-               /**
-                * Update the database values for an existing activity object.
-                *
-                * @param $activity the activity to be updated
-                * @return boolean true if successful, false otherwise
-                */
-
-       /**
-                * Update the database values for an existing activity object.
-                *
-                * @param $activity the activity to be updated
-                * @return boolean true if successful, false otherwise
-                */
-
                function update($control_item_list)
                {
                        $id = intval($control_item_list->get_id());
@@ -161,21 +147,8 @@
                        return isset($result);
                }
 
-               /**
-                * Get a list of procedure objects matching the specific filters
-                * 
-                * @param $start search result offset
-                * @param $results number of results to return
-                * @param $sort field to sort by
-                * @param $query LIKE-based query string
-                * @param $filters array of custom filters
-                * @return list of rental_composite objects
-                */
-               function get_control_item_array($start = 0, $results = 1000, 
$sort = null, $dir = '', $query = null, $search_option = null, $filters = 
array())
-               {
+               function get_control_item_array($start = 0, $results = 1000, 
$sort = null, $dir = '', $query = null, $search_option = null, $filters = 
array()){}
 
-               }
-
                function get_id_field_name($extended_info = false)
                {
                }

Modified: branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php 
2011-12-23 14:09:08 UTC (rev 8430)
+++ branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php 
2011-12-23 14:22:25 UTC (rev 8431)
@@ -96,12 +96,13 @@
                                
                        $repeat_type = 0;
                        $check_list_array = 
$this->so->get_check_lists_for_location( $location_code, $from_date, $to_date, 
$repeat_type);
+                       
                        $controls_calendar_array = 
$this->calendar_builder->build_calendar_array( $check_list_array, null, 31, 
"view_days" );
-                                                       
-                       print_r( $controls_calendar_array );
                        
                        $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
                        
+                       $month_array = array("Januar", "Februar", "Mars", 
"April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", 
"Desember");
+                       
                        for($i=1;$i<=31;$i++){
                                $heading_array[$i] = "$i";      
                        }
@@ -112,7 +113,7 @@
                                'heading_array'                   => 
$heading_array,
                                'controls_calendar_array' => 
$controls_calendar_array,
                                'date_format'                     => 
$date_format,
-                               'period'                                  => 
$month,
+                               'period'                                  => 
$month_array[ $month - 1],
                                'year'                                    => 
$year
                        );
                        
@@ -146,11 +147,11 @@
                        $repeat_type = 2;
                        $control_check_list_array = 
$this->so->get_check_lists_for_location( $location_code, $from_date, $to_date, 
$repeat_type );
                        $controls_calendar_array = 
$this->calendar_builder->build_calendar_array( $control_check_list_array, 
$controls_calendar_array, 12, "view_months" );
-                       
+                                       
                        $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");
-                                                       
+                       
                        $data = array
                        (
                                'location_array'                  => 
$location_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
  2011-12-23 14:09:08 UTC (rev 8430)
+++ 
branches/Version-1_0-branch/controller/inc/class.uicheck_list_for_location.inc.php
  2011-12-23 14:22:25 UTC (rev 8431)
@@ -58,7 +58,8 @@
                                                                                
'add_location_to_control' => true,
                                                                                
'add_check_list_for_location' => true,
                                                                                
'save_check_list_for_location' => true,
-                                                                               
'edit_check_list_for_location' => true
+                                                                               
'edit_check_list_for_location' => true,
+                                                                               
'create_error_report_message' => true
                                                                        );
 
                function __construct()
@@ -312,7 +313,6 @@
                        $control_id = phpgw::get_var('control_id');
                        $date = phpgw::get_var('date');
                        
-                       $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
                        $control = $this->so_control->get_single($control_id);
                        
                        if($date == null || $date == ''){
@@ -338,7 +338,9 @@
                        {
                                $calendar_array[] = $date;
                        }                       
-                                               
+
+                       $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
+                       
                        $data = array
                        (
                                'location_array'        => $location_array,
@@ -359,8 +361,10 @@
                
                function edit_check_list_for_location(){
                        $check_list_id = phpgw::get_var('check_list_id');
-                       
+                                               
                        $check_list_with_check_items = 
$this->so_check_list->get_single_with_check_items($check_list_id);
+                                               
+                       $location_code = 
$check_list_with_check_items["location_code"];  
                                
                        $control_item_list_all = 
$this->so_control_item->get_control_items_by_control_id($check_list_with_check_items["control_id"]);
                        
@@ -380,10 +384,11 @@
                        
                        $date_format = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
        
-                       print_r($control_item_list_stripped);
+                       $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
                        
                        $data = array
                        (
+                               'location_array'        => $location_array,
                                'check_list'                    => 
$check_list_with_check_items,
                                'control_items_list'    => 
$control_item_list_stripped,
                                'date_format'                   => $date_format
@@ -405,34 +410,70 @@
                        $status = phpgw::get_var('status');
                                        
                        $planned_date = phpgw::get_var('planned_date', 
'string');
-                       $completed_date = strtotime( 
phpgw::get_var('completed_date', 'string') );
-                       $deadline_date = strtotime( 
phpgw::get_var('deadline_date', 'string') );
+                       $completed_date = phpgw::get_var('completed_date', 
'string');
+                       $deadline_date = phpgw::get_var('deadline_date', 
'string');
                                                
-                       $pos_day = strpos($planned_date, "/"); 
-                       $day =  substr($planned_date, 0, $pos_day);
+                       $planned_date_ts = $this->get_timestamp_from_date( 
$planned_date ); 
+                       $deadline_date_ts = $this->get_timestamp_from_date( 
$deadline_date );
                        
-                       $pos_month = strpos($planned_date, "-");
-                       $len_month = $pos_month - $pos_day -1;
-                       $month = substr($planned_date, $pos_day+1, $len_month);
-                       
-                       $year = substr($planned_date, $pos_month + 
$len_month-1, strlen($planned_date)-1);
-                       
-                       $planned_date = mktime(0, 0, 0, $month, $day, $year);
-                                               
                        $check_list = new controller_check_list();
                        $check_list->set_location_code($location_code);
                        $check_list->set_control_id($control_id);
                        $check_list->set_status($status);
-                       $check_list->set_deadline( $deadline_date );
-                       $check_list->set_planned_date($planned_date);
+                       $check_list->set_deadline( $deadline_date_ts );
+                       $check_list->set_planned_date($planned_date_ts);
                        $check_list->set_completed_date($completed_date);
-                                       
                        
-                       $check_list_id = 
$this->so_check_list->add($check_list);        
-
+                       $check_list_id = $this->so_check_list->add($check_list);
+                       
                        $this->redirect(array('menuaction' => 
'controller.uicheck_list_for_location.edit_check_list_for_location', 
'check_list_id'=>$check_list_id));
                }
                
+               function create_error_report_message(){
+                       $check_list_id = phpgw::get_var('check_list_id');
+                                               
+                       $check_list_with_check_items = 
$this->so_check_list->get_single_with_check_items($check_list_id);
+                                               
+                       $control_id = 
$check_list_with_check_items["control_id"];
+                       $control = $this->so_control->get_single( $control_id );
+                       
+                       $location_code = 
$check_list_with_check_items["location_code"];  
+                                
+                       $date_format = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+       
+                       $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
+                       
+                       $data = array
+                       (
+                               'location_array'                => 
$location_array,
+                               'control_array'                 => 
$control->toArray(),
+                               'check_list'                    => 
$check_list_with_check_items,
+                               'date_format'                   => $date_format
+                       );
+                       
+                       self::add_javascript('controller', 'controller', 
'jquery.js');
+                       self::add_javascript('controller', 'controller', 
'jquery-ui.custom.min.js');
+                       self::add_javascript('controller', 'controller', 
'custom_ui.js');
+                       self::add_javascript('controller', 'controller', 
'ajax.js');
+                       
+                       
$GLOBALS['phpgw']->css->add_external_file('controller/templates/base/css/jquery-ui.custom.css');
+                       
+                       
self::render_template_xsl('create_error_report_message', $data);
+               }
+               
+               function get_timestamp_from_date( $date_string ){
+                       $pos_day = strpos($date_string, "/"); 
+                       $day =  substr($date_string, 0, $pos_day);
+                       
+                       $pos_month = strpos($date_string, "-");
+                       $len_month = $pos_month - $pos_day -1;
+                       $month = substr($date_string, $pos_day+1, $len_month);
+                       
+                       $year = substr($date_string, $pos_month + $len_month-1, 
strlen($date_string)-1);
+                       
+                       return mktime(0, 0, 0, $month, $day, $year);
+               }
+               
                public function query(){
                        $type_id = phpgw::get_var('type_id');
                        $return_results = phpgw::get_var('results', 'int', 
'REQUEST', 0);

Modified: branches/Version-1_0-branch/controller/inc/class.uidocument.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uidocument.inc.php 
2011-12-23 14:09:08 UTC (rev 8430)
+++ branches/Version-1_0-branch/controller/inc/class.uidocument.inc.php 
2011-12-23 14:22:25 UTC (rev 8431)
@@ -183,7 +183,11 @@
                                
$document->set_title(phpgw::get_var('document_title'));
                                
$document->set_name($_FILES["file_path"]["name"]);
                                
$document->set_type_id(phpgw::get_var('document_type'));
+                               $desc = 
phpgw::get_var('document_description','html');
+                               var_dump($desc);
+                               $document->set_description($desc);
                                $document->set_procedure_id($procedure_id);
+                               //var_dump($document);
                                
                                //Retrieve the document properties
                                $document_properties = 
$this->get_type_and_id($document);
@@ -230,26 +234,26 @@
                {
                        $document_id = intval(phpgw::get_var('id'));
                        $document = $this->so->get_single($document_id);
-                       if($document->has_permission(PHPGW_ACL_READ))
-                       {
+//                     if($document->has_permission(PHPGW_ACL_READ))
+//                     {
                                $document_properties = 
$this->get_type_and_id($document);
                                
                                header("Content-Disposition: attachment; 
filename={$document->get_name()}");
                                header("Content-Type: $file_type");
                                header("Cache-Control: must-revalidate, 
post-check=0, pre-check=0");
                                
-                               echo 
rental_sodocument::get_instance()->read_document_from_vfs
+                               echo $this->so->read_document_from_vfs
                                (
                                        $document_properties['document_type'],  
                                        $document_properties['id'],
                                        $document->get_name()
                                );
-                       }
+/*                     }
                        else
                        {
                                $this->redirect($document, 
$document_properties, lang('no_access'), '');
                        }
-                       exit;
+                       exit;*/
                }
                
                /**
@@ -391,6 +395,7 @@
                                //$document_array[] = array('document' => 
$document->toArray());
                                $table_header[] = array('header' => 
lang('Document title'));
                                $table_header[] = array('header' => 
lang('Document name'));
+                               $table_header[] = array('header' => 
lang('Document description'));
                                
                                foreach($documents as $document)
                                {
@@ -421,6 +426,8 @@
                                        'values'                                
=> $table_values,
                                        'table_header'                  => 
$table_header,
                                );
+                               
+                               
$this->use_yui_editor(array('document_description'));
 
                                $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('controller') . '::' . lang('Procedure');
 

Copied: 
branches/Version-1_0-branch/controller/inc/class.uierror_report_message.inc.php 
(from rev 8430, trunk/controller/inc/class.uierror_report_message.inc.php)
===================================================================
--- 
branches/Version-1_0-branch/controller/inc/class.uierror_report_message.inc.php 
                            (rev 0)
+++ 
branches/Version-1_0-branch/controller/inc/class.uierror_report_message.inc.php 
    2011-12-23 14:22:25 UTC (rev 8431)
@@ -0,0 +1,159 @@
+<?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 8419 2011-12-23 
09:54:15Z 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/');
+               
+       class controller_uierror_report_message extends controller_uicommon
+       {
+               private $so_control_area;
+               private $so_control;
+               private $so_check_list;
+               private $so_control_item;
+               private $so_check_item;
+       
+               var $public_functions = array(
+                                                                               
'create_error_report_message' => true,
+                                                                               
'save_error_report_message' => 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->type_id                          = 
$this->bo->type_id;
+                       
+                       
self::set_active_menu('controller::control::location_for_check_list');
+               }       
+               
+               function create_error_report_message(){
+                       $check_list_id = phpgw::get_var('check_list_id');
+                                               
+                       $check_list_with_check_items = 
$this->so_check_list->get_single_with_check_items($check_list_id);
+                                               
+                       $control_id = 
$check_list_with_check_items["control_id"];
+                       $control = $this->so_control->get_single( $control_id );
+                       
+                       $location_code = 
$check_list_with_check_items["location_code"];  
+                                
+                       $date_format = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+       
+                       $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
+                       
+                       $data = array
+                       (
+                               'location_array'                => 
$location_array,
+                               'control_array'                 => 
$control->toArray(),
+                               'check_list'                    => 
$check_list_with_check_items,
+                               'date_format'                   => $date_format
+                       );
+                       
+                       self::add_javascript('controller', 'controller', 
'jquery.js');
+                       self::add_javascript('controller', 'controller', 
'jquery-ui.custom.min.js');
+                       self::add_javascript('controller', 'controller', 
'custom_ui.js');
+                       self::add_javascript('controller', 'controller', 
'ajax.js');
+                       
+                       
$GLOBALS['phpgw']->css->add_external_file('controller/templates/base/css/jquery-ui.custom.css');
+                       
+                       
self::render_template_xsl('create_error_report_message', $data);
+               }
+               
+               function save_error_report_message(){
+                       $check_list_id = phpgw::get_var('check_list_id');
+                       $check_item_ids = phpgw::get_var('check_item_ids');
+                       $location_code = phpgw::get_var('location_code');
+                       $message_title = phpgw::get_var('message_title');
+                       
+                       $check_list_with_check_items = 
$this->so_check_list->get_single_with_check_items($check_list_id);
+                                               
+                       $control_id = 
$check_list_with_check_items["control_id"];
+                       $control = $this->so_control->get_single( $control_id );
+                       
+                       $location_code = 
$check_list_with_check_items["location_code"];  
+                                
+                       $date_format = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+       
+                       $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
+                       
+                       foreach($check_item_ids as $check_item_id){
+                               $check_item = 
$this->so_check_item->get_single($check_item_id);
+                               
+                               $details .= $check_item->get_comment(); 
+                       }
+                       
+                       $ticket = array
+                       (
+                               'origin'                => $location_id,
+                               'origin_id'             => $location_item_id,
+                               'location_code' => $location_code,
+                               'cat_id'                => $cat_id,
+                               'priority'              => $priority, //valgfri 
(1-3)
+                               'title'                 => $message_title,
+                               'details'               => $details,
+                               'file_input_name'       => 'file' // default, 
men valgfri
+                       );
+                       
+                       $botts = CreateObject('property.botts',true);
+                       $ticket_id = $botts->add_ticket($ticket);
+
+                       
+                       
+                       $data = array
+                       (
+                               'location_array'                => 
$location_array,
+                               'control_array'                 => 
$control->toArray(),
+                               'check_list'                    => 
$check_list_with_check_items,
+                               'date_format'                   => $date_format
+                       );
+                       
+                       self::add_javascript('controller', 'controller', 
'jquery.js');
+                       self::add_javascript('controller', 'controller', 
'jquery-ui.custom.min.js');
+                       self::add_javascript('controller', 'controller', 
'custom_ui.js');
+                       self::add_javascript('controller', 'controller', 
'ajax.js');
+                       
+                       
$GLOBALS['phpgw']->css->add_external_file('controller/templates/base/css/jquery-ui.custom.css');
+                       
+                       
self::render_template_xsl('create_error_report_message', $data);
+               }
+               
+               public function query(){}
+       }

Modified: 
branches/Version-1_0-branch/controller/inc/component/class.calendar_builder.inc.php
===================================================================
--- 
branches/Version-1_0-branch/controller/inc/component/class.calendar_builder.inc.php
 2011-12-23 14:09:08 UTC (rev 8430)
+++ 
branches/Version-1_0-branch/controller/inc/component/class.calendar_builder.inc.php
 2011-12-23 14:22:25 UTC (rev 8431)
@@ -45,13 +45,14 @@
                        foreach($control->get_check_lists_array() as 
$check_list){
                                
                                $check_list_status_info = new 
check_list_status_info();
-                               $check_list_status_info->set_id( 
$check_list->get_id() );
+                               $check_list_status_info->set_check_list_id( 
$check_list->get_id() );
                
                                $todays_date = mktime(0,0,0,date("m"), 
date("d"), date("Y"));
                                
                                if( $check_list->get_status() == 0 & 
$check_list->get_planned_date() > 0 )
                                {
                                        $status = "control_planned";
+                                       
$check_list_status_info->set_info_text("Planlagt utført: " . 
$check_list->get_planned_date());
                                }
                                else if( $check_list->get_status() == 0 & 
$check_list->get_deadline() > $todays_date )
                                {
@@ -73,7 +74,7 @@
                                        $status = "control_canceled";
                                }
                                
-                               $check_list_status_info->set_deadline( 
date("d/m-Y", $check_list->get_deadline()) );
+                               $check_list_status_info->set_deadline_date( 
date("d/m-Y", $check_list->get_deadline()) );
                                
                                if($period_type == "view_months")
                                {
@@ -110,11 +111,12 @@
                                $calendar_array[$i] = null;
                        }
                        
+                       $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"] = 2;
+                               $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);

Modified: 
branches/Version-1_0-branch/controller/inc/helper/class.check_list_status_info.inc.php
===================================================================
--- 
branches/Version-1_0-branch/controller/inc/helper/class.check_list_status_info.inc.php
      2011-12-23 14:09:08 UTC (rev 8430)
+++ 
branches/Version-1_0-branch/controller/inc/helper/class.check_list_status_info.inc.php
      2011-12-23 14:22:25 UTC (rev 8431)
@@ -30,19 +30,20 @@
 
        class check_list_status_info
        {               
-               private $id;
+               private $check_list_id;
                private $status;
                private $status_text;
-               private $deadline;
+               private $deadline_date;
+               private $info_text;
 
                public function __construct(){}
                
-               public function set_id($id)
+               public function set_check_list_id($check_list_id)
                {
-                       $this->id = $id;
+                       $this->check_list_id = $check_list_id;
                }
                
-               public function get_id() { return $this->id; }
+               public function get_check_list_id() { return 
$this->check_list_id; }
                
                public function set_status($status)
                {
@@ -58,21 +59,29 @@
                
                public function get_status_text() { return $this->status_text; }
                
-               public function set_deadline($deadline)
+               public function set_deadline_date($deadline_date)
                {
-                       $this->deadline = $deadline;
+                       $this->deadline_date = $deadline_date;
                }
                
-               public function get_deadline() { return $this->deadline; }
+               public function get_deadline_date() { return 
$this->deadline_date; }
                
+               public function set_info_text($info_text)
+               {
+                       $this->info_text = $info_text;
+               }
                
+               public function get_info_text() { return $this->info_text; }
+               
+               
                public function serialize()
                {
                        return array(
-                               'id' => $this->get_id(),
+                               'check_list_id' => $this->get_check_list_id(),
                                'status' => $this->get_status(),
                                'status_text' => $this->get_status_text(),
-                               'deadline' => $this->get_deadline()             
        
+                               'deadline_date' => $this->get_deadline_date(),
+                               'info_text' => $this->get_info_text()
                        );
                }
        }

Modified: branches/Version-1_0-branch/controller/js/controller/custom_ui.js
===================================================================
--- branches/Version-1_0-branch/controller/js/controller/custom_ui.js   
2011-12-23 14:09:08 UTC (rev 8430)
+++ branches/Version-1_0-branch/controller/js/controller/custom_ui.js   
2011-12-23 14:22:25 UTC (rev 8431)
@@ -125,4 +125,11 @@
                
                $(submitBnt).removeClass("not_active");
        });
+       
+       $(".frm_save_control_item").click(function(e){
+               var thisForm = $(this);
+               var submitBnt = $(thisForm).find("input[type='submit']");
+               
+               $(submitBnt).removeClass("not_active");
+       });
 });
\ No newline at end of file

Modified: branches/Version-1_0-branch/controller/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/controller/setup/phpgw_no.lang  2011-12-23 
14:09:08 UTC (rev 8430)
+++ branches/Version-1_0-branch/controller/setup/phpgw_no.lang  2011-12-23 
14:22:25 UTC (rev 8431)
@@ -56,6 +56,7 @@
 location_code  controller      no      Enhetsnummer
 included_units controller      no      Kontrollens enheter
 floor  controller      no      Etasje
+register_error controller      no      Registrer avvik
 section        controller      no      Seksjon
 room   controller      no      Rom
 save   controller      no      Lagre
@@ -306,5 +307,6 @@
 GUID   controller      no      GUID
 View_procedure controller      Prosedyre
 View_documents_for_procedure   controller      no      Tilknyttede dokumenter
-Document title controller      no      Dokumentets tittel:
-Document name  controller      no      Filnavn:
\ No newline at end of file
+Document title controller      no      Dokumentets tittel
+Document name  controller      no      Filnavn
+Document description   controller      no      Beskrivelse
\ No newline at end of file

Modified: 
branches/Version-1_0-branch/controller/templates/base/add_check_list_for_location.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/add_check_list_for_location.xsl
       2011-12-23 14:09:08 UTC (rev 8430)
+++ 
branches/Version-1_0-branch/controller/templates/base/add_check_list_for_location.xsl
       2011-12-23 14:22:25 UTC (rev 8431)
@@ -15,11 +15,6 @@
                        dayNamesMin: ['Sø', 'Ma', 'Ti', 'On', 'To', 'Fr', 'Lø'],
                        dateFormat: 'dd/mm-yy' 
                });
-               $( "#deadline_date" ).datepicker({ 
-                       monthNames: 
['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],
-                       dayNamesMin: ['Sø', 'Ma', 'Ti', 'On', 'To', 'Fr', 'Lø'],
-                       dateFormat: 'dd/mm-yy' 
-               });             
        });
 </script>
                
@@ -27,69 +22,69 @@
 <div id="main_content">
        
        <h1>Registrere sjekkliste for <xsl:value-of 
select="location_array/loc1_name"/></h1>
-
-       <h2>Tittel <xsl:value-of select="control_array/title"/></h2>
        
-       <form id="frm_add_check_list" 
action="index.php?menuaction=controller.uicheck_list_for_location.save_check_list_for_location"
 method="post">
-                               
-               <div id="calendar_dates">
-                       <xsl:for-each select="calendar_array">
-                               <xsl:variable name="cal_date"><xsl:value-of 
select="."/></xsl:variable>
+       <fieldset class="check_list_details">
+               <form id="frm_add_check_list" 
action="index.php?menuaction=controller.uicheck_list_for_location.save_check_list_for_location"
 method="post">
                                        
-                               <span><xsl:value-of 
select="php:function('date', $date_format, number( $cal_date ) )"/></span>
-                       </xsl:for-each>
-               </div>
+                       <div id="calendar_dates">
+                               <xsl:for-each select="calendar_array">
+                                       <xsl:variable 
name="cal_date"><xsl:value-of select="."/></xsl:variable>
+                                               
+                                       <span><xsl:value-of 
select="php:function('date', $date_format, number( $cal_date ) )"/></span>
+                               </xsl:for-each>
+                       </div>
+               
+                       <xsl:variable name="location_code"><xsl:value-of 
select="location_array/location_code"/></xsl:variable>
+                       <xsl:variable name="control_id"><xsl:value-of 
select="control_array/id"/></xsl:variable>
+               
+                       <input type="hidden" name="control_id" 
value="{$control_id}" />
+                       <input type="hidden" name="location_code" 
value="{$location_code}" />
 
-       
-               <xsl:variable name="location_code"><xsl:value-of 
select="location_array/location_code"/></xsl:variable>
-               <xsl:variable name="control_id"><xsl:value-of 
select="control_array/id"/></xsl:variable>
-       
-               <input type="hidden" name="control_id" value="{$control_id}" />
-               <input type="hidden" name="location_code" 
value="{$location_code}" />
-       
-               <fieldset class="add_check_list">
+                       <fieldset class="add_check_list">
+                               <div>
+                                       <label>Status</label>
+                                       <select name="status">
+                                               <option value="0" 
SELECTED="SELECTED">Ikke utført</option>
+                                               <option value="1" 
>Utført</option>
+                                       </select>
+                               </div>
+                               <div>
+                                       <label>Fristdato</label>
+                                       <input>
+                                     <xsl:attribute 
name="id">deadline_date</xsl:attribute>
+                                     <xsl:attribute 
name="name">deadline_date</xsl:attribute>
+                                     <xsl:attribute 
name="type">text</xsl:attribute>
+                                     <xsl:attribute name="value"><xsl:value-of 
select="php:function('date', $date_format, number(deadline))"/></xsl:attribute>
+                                   </input>
+                           </div>
+                               <div>
+                                       <label>Planlagt dato</label>
+                                       <input>
+                                     <xsl:attribute 
name="id">planned_date</xsl:attribute>
+                                     <xsl:attribute 
name="name">planned_date</xsl:attribute>
+                                     <xsl:attribute 
name="type">text</xsl:attribute>
+                                     <xsl:attribute 
name="value"></xsl:attribute>
+                                   </input>
+                           </div>
+                           <div>
+                                       <label>Utført dato</label>
+                                       <input>
+                                     <xsl:attribute 
name="id">completed_date</xsl:attribute>
+                                     <xsl:attribute 
name="name">completed_date</xsl:attribute>
+                                     <xsl:attribute 
name="type">text</xsl:attribute>
+                                         <xsl:if 
test="check_list/completed_date != ''">
+                                       <xsl:attribute 
name="value"><xsl:value-of select="php:function('date', $date_format, 
number(check_list/completed_date))"/></xsl:attribute>
+                                     </xsl:if>
+                                   </input>
+                           </div>
+                               <div><label>Utstyr</label><input 
name="equipment_id" /></div>
+                       </fieldset>
                        <div>
-                               <label>Status</label>
-                               <select name="status">
-                                       <option value="0">Utført</option>
-                                       <option value="0">Ikke utført</option>
-                               </select>
+                               <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save')" /></xsl:variable>
+                               <input type="submit" name="save" 
value="{$lang_save}" title = "{$lang_save}" />
                        </div>
-                       <div>
-                               <label>Fristdato</label>
-                               <input>
-                             <xsl:attribute 
name="id">deadline_date</xsl:attribute>
-                             <xsl:attribute 
name="name">deadline_date</xsl:attribute>
-                             <xsl:attribute name="type">text</xsl:attribute>
-                             <xsl:attribute name="value"><xsl:value-of 
select="php:function('date', $date_format, number(deadline))"/></xsl:attribute>
-                           </input>
-                   </div>
-                       <div>
-                               <label>Planlagt dato</label>
-                               <input>
-                             <xsl:attribute 
name="id">planned_date</xsl:attribute>
-                             <xsl:attribute 
name="name">planned_date</xsl:attribute>
-                             <xsl:attribute name="type">text</xsl:attribute>
-                           </input>
-                   </div>
-                   <div>
-                               <label>Utført dato</label>
-                               <input>
-                             <xsl:attribute 
name="id">completed_date</xsl:attribute>
-                             <xsl:attribute 
name="name">completed_date</xsl:attribute>
-                             <xsl:attribute name="type">text</xsl:attribute>
-                                 <xsl:if test="check_list/completed_date != 
''">
-                               <xsl:attribute name="value"><xsl:value-of 
select="php:function('date', $date_format, 
number(check_list/completed_date))"/></xsl:attribute>
-                             </xsl:if>
-                           </input>
-                   </div>
-                       <div><label>Utstyr</label><input name="equipment_id" 
/></div>
-               </fieldset>
-               <div>
-                       <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save')" /></xsl:variable>
-                       <input type="submit" name="save" value="{$lang_save}" 
title = "{$lang_save}" />
-               </div>
-       </form>
+               </form>
+       </fieldset>
        
         </div>
 </xsl:template>

Copied: 
branches/Version-1_0-branch/controller/templates/base/create_error_report_message.xsl
 (from rev 8430, 
trunk/controller/templates/base/create_error_report_message.xsl)
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/create_error_report_message.xsl
                               (rev 0)
+++ 
branches/Version-1_0-branch/controller/templates/base/create_error_report_message.xsl
       2011-12-23 14:22:25 UTC (rev 8431)
@@ -0,0 +1,61 @@
+<!-- $Id: edit_check_list.xsl 8374 2011-12-20 07:45:04Z vator $ -->
+<xsl:template match="data" name="view_check_list" 
xmlns:php="http://php.net/xsl";>
+<xsl:variable name="date_format">d/m-Y</xsl:variable>
+
+<div id="main_content">
+       
+               <h1>Send avviksmelding pĂĄ bygg: <xsl:value-of 
select="location_array/loc1_name"/></h1>
+               
+               <h2>Kontroll <xsl:value-of select="control_array/title"/></h2>
+               <h2>Utført dato <xsl:value-of select="php:function('date', 
$date_format, number(check_list/completed_date))"/></h2>
+                               
+               <div id="error_report_message_details">
+                       <h2 class="check_item_details">Velg sjekkpunkter som 
skal være med i avviksmelding</h2>
+
+                       <xsl:choose>
+                               <xsl:when 
test="check_list/check_item_array/child::node()">
+                                       
+                               <form class="frm_save_error_report_message" 
action="index.php?menuaction=controller.uierror_report_message.save_error_report_message"
 method="post">
+                                       <input>
+                                     <xsl:attribute 
name="name">check_list_id</xsl:attribute>
+                                     <xsl:attribute 
name="type">hidden</xsl:attribute>
+                                     <xsl:attribute name="value">
+                                       <xsl:value-of select="check_list/id"/>
+                                     </xsl:attribute>
+                                   </input>
+                                   <input>
+                                     <xsl:attribute 
name="name">location_code</xsl:attribute>
+                                     <xsl:attribute 
name="type">hidden</xsl:attribute>
+                                     <xsl:attribute name="value">
+                                       <xsl:value-of 
select="location_array/location_code"/>
+                                     </xsl:attribute>
+                                   </input>
+                                   
+                                       <label>Tittel pĂĄ melding</label>
+                                       <input name="title" type="text" />
+                                                               
+                                       <ul class="check_items expand_list">
+                                               <xsl:for-each 
select="check_list/check_item_array">
+                                                       <li>
+                                                               <xsl:variable 
name="check_item_id"><xsl:value-of select="id" /></xsl:variable>
+                                                               <h4><input 
type="checkbox" name="check_item_ids[]" value="{$check_item_id}" 
/><span><xsl:value-of select="control_item/title"/></span></h4>                 
                            
+                                                       </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" value="{$lang_save}" title="{$lang_save}" />
+                                         </div>
+                               </form>                 
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       Ingen sjekkpunkter
+                               </xsl:otherwise>
+                       </xsl:choose>
+               </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  
2011-12-23 14:09:08 UTC (rev 8430)
+++ branches/Version-1_0-branch/controller/templates/base/css/base.css  
2011-12-23 14:22:25 UTC (rev 8431)
@@ -668,6 +668,7 @@
 
 #main_content {
        padding:20px;   
+       width: 1150px;
 }
 
 #main_content.groups{
@@ -689,12 +690,11 @@
     text-align: center;
     width: 190px;
 }
-#main_content fieldset.check_list_details{
-       background: none repeat scroll 0 0 #EDF5FF;
-    border: 1px solid #243356;
+#main_content fieldset.check_list_details {
+    background: none repeat scroll 0 0 #EDF5FF;
+    border: 1px solid #CCCCCC;
     padding: 15px;
 }
-
 #main_content fieldset.check_item_details{
        background: none repeat scroll 0 0 #EDF5FF;
     border: 1px solid #243356;
@@ -813,12 +813,13 @@
     font-weight: bold;
     font-size:16px;
 }
-ul.calendar{
+ul.calendar {
     float: left;
+    margin-top: 30px;
 }
 ul.calendar li div {
     float: left;
-    width: 30px;
+    width: 24px;
     padding: 3px;
     text-align: center;
 }
@@ -831,7 +832,7 @@
 #days_wrp {
     float: left;
     position: relative;
-    width: 500px;
+    width: 420px;
     overflow-x: hidden;
     height: 800px;
     margin-left: 40px;
@@ -839,6 +840,7 @@
 ul.calendar.days {
        position: absolute;
     width: 1120px;
+    margin-top:0;
 }
 ul.calendar li div.date, ul.calendar.info div.date {
     width: 80px;
@@ -858,7 +860,9 @@
 ul.calendar div.frequency, ul.calendar.info div.frequency {
        width: 120px;   
 }
-
+ul.calendar.month {
+       margin-top:0;
+}
 #info_box {
     background: none repeat scroll 0 0 #EDF5FF;
     border: 1px solid #243356;
@@ -1014,10 +1018,13 @@
 }
 .tab_menu div.active{
        background: url('../../../images/bg_tab_menu_active.png') no-repeat;
+}
+.tab_menu div.active a{
        color: #FFF;
 }
 .tab_menu {
-    margin: 15px 0 20px;
+    height: 29px;
+    margin: 15px 0 0;
     overflow: hidden;
 }
 .tab_menu div {
@@ -1033,12 +1040,75 @@
     width: 93px;
     word-wrap: normal;
 }
-.tab_menu div.text {
-   background: none repeat scroll 0 0 transparent;
+.tab_menu div.ext {
+    padding-top: 0px;
+}
+.tab_menu div a{
+    text-decoration:none;
+    color:#333;
+}
+.tab_menu div.ext a{
+       display:block;
     font-size: 11px;
     line-height: 12px;
     margin: 0;
     padding: 3px 0 0 9px;
     text-align: center;
     width: 75px;
+    text-decoration:none;
+}
+.tab_item {
+       display:none;
+       background: none repeat scroll 0 0 #EDF5FF;
+    border: 1px solid #ddd;
+    margin: 0;
+    padding: 15px;
+    width: 800px;      
+}
+.tab_item h2{
+       margin:0 0 10px;
+       font-size: 17px;        
+}
+.tab_item.active {
+       display:block;  
+}
+fieldset.check_list_details{
+       width: 800px;   
+}
+#main_content fieldset.location_details{
+       background: none repeat scroll 0 0 #EDF5FF;
+    border: 1px solid #CCCCCC;
+    padding: 15px;
+    float:left;        
+    border: 1px solid #ddd;
+}
+fieldset.location_details div{
+       margin:10px 0;
+}
+ul#icon_color_map {
+    background: none repeat scroll 0 0 #EDF5FF;
+    border: 1px solid #DDDDDD;
+    float: right;
+    margin-left: 500px;
+    margin-right: 10px;
+    padding: 5px;
+}
+ul#icon_color_map li {
+    font-size: 12px;
+    padding: 3px 10px;
+}
+ul#icon_color_map span{
+       margin-left: 10px;
+}
+#create_message_dialog{
+       display:none;
+       position:absolute;
+       width: 600px;
+    z-index: 2;
+    background:#aaa;   
+}
+#curtain{
+       display:none;
+       position:absolute;
+    z-index: 1;
 }
\ No newline at end of file

Deleted: 
branches/Version-1_0-branch/controller/templates/base/css/jquery-ui.custom_bac.css
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/css/jquery-ui.custom_bac.css
  2011-12-23 14:09:08 UTC (rev 8430)
+++ 
branches/Version-1_0-branch/controller/templates/base/css/jquery-ui.custom_bac.css
  2011-12-23 14:22:25 UTC (rev 8431)
@@ -1,357 +0,0 @@
-/*
- * jQuery UI CSS Framework 1.8.16
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Theming/API
- */
-
-/* Layout helpers
-----------------------------------*/
-.ui-helper-hidden { display: none; }
-.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 
1px 1px 1px); clip: rect(1px,1px,1px,1px); }
-.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 
1.3; text-decoration: none; font-size: 100%; list-style: none; }
-.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: 
both; visibility: hidden; }
-.ui-helper-clearfix { display: inline-block; }
-/* required comment for clearfix to work in Opera \*/
-* html .ui-helper-clearfix { height:1%; }
-.ui-helper-clearfix { display:block; }
-/* end clearfix */
-.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: 
absolute; opacity: 0; filter:Alpha(Opacity=0); }
-
-
-/* Interaction Cues
-----------------------------------*/
-.ui-state-disabled { cursor: default !important; }
-
-
-/* Icons
-----------------------------------*/
-
-/* states and images */
-.ui-icon { display: block; text-indent: -99999px; overflow: hidden; 
background-repeat: no-repeat; }
-
-
-/* Misc visuals
-----------------------------------*/
-
-/* Overlays */
-.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 
100%; }
-
-
-/*
- * jQuery UI CSS Framework 1.8.16
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Theming/API
- *
- * To view and modify this theme, visit 
http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Tahoma,%20Verdana,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px
- */
-
-
-/* Component containers
-----------------------------------*/
-.ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; 
font-size: 1.1em; }
-.ui-widget .ui-widget { font-size: 1em; }
-.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { 
font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; }
-.ui-widget-content { border: 1px solid #dddddd; background: #eeeeee 
url(images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x; color: 
#333333; }
-.ui-widget-content a { color: #333333; }
-.ui-widget-header { border: 1px solid #e78f08; background: #f6a828 
url(images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x; color: 
#ffffff; font-weight: bold; }
-.ui-widget-header a { color: #ffffff; }
-
-/* Interaction states
-----------------------------------*/
-.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header 
.ui-state-default { border: 1px solid #cccccc; background: #f6f6f6 
url(images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x; font-weight: 
bold; color: #1c94c4; }
-.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { 
color: #1c94c4; text-decoration: none; }
-.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header 
.ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, 
.ui-widget-header .ui-state-focus { border: 1px solid #fbcb09; background: 
#fdf5ce url(images/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x; 
font-weight: bold; color: #c77405; }
-.ui-state-hover a, .ui-state-hover a:hover { color: #c77405; text-decoration: 
none; }
-.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header 
.ui-state-active { border: 1px solid #fbd850; background: #ffffff 
url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: 
bold; color: #eb8f00; }
-.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { 
color: #eb8f00; text-decoration: none; }
-.ui-widget :active { outline: none; }
-
-/* Interaction Cues
-----------------------------------*/
-.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header 
.ui-state-highlight  {border: 1px solid #fed22f; background: #ffe45c 
url(images/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x; color: 
#363636; }
-.ui-state-highlight a, .ui-widget-content .ui-state-highlight 
a,.ui-widget-header .ui-state-highlight a { color: #363636; }
-.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header 
.ui-state-error {border: 1px solid #cd0a0a; background: #b81900 
url(images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat; color: 
#ffffff; }
-.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header 
.ui-state-error a { color: #ffffff; }
-.ui-state-error-text, .ui-widget-content .ui-state-error-text, 
.ui-widget-header .ui-state-error-text { color: #ffffff; }
-.ui-priority-primary, .ui-widget-content .ui-priority-primary, 
.ui-widget-header .ui-priority-primary { font-weight: bold; }
-.ui-priority-secondary, .ui-widget-content .ui-priority-secondary,  
.ui-widget-header .ui-priority-secondary { opacity: .7; 
filter:Alpha(Opacity=70); font-weight: normal; }
-.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header 
.ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: 
none; }
-
-/* Icons
-----------------------------------*/
-
-/* states and images */
-.ui-icon { width: 16px; height: 16px; background-image: 
url(images/ui-icons_222222_256x240.png); }
-.ui-widget-content .ui-icon {background-image: 
url(images/ui-icons_222222_256x240.png); }
-.ui-widget-header .ui-icon {background-image: 
url(images/ui-icons_ffffff_256x240.png); }
-.ui-state-default .ui-icon { background-image: 
url(images/ui-icons_ef8c08_256x240.png); }
-.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: 
url(images/ui-icons_ef8c08_256x240.png); }
-.ui-state-active .ui-icon {background-image: 
url(images/ui-icons_ef8c08_256x240.png); }
-.ui-state-highlight .ui-icon {background-image: 
url(images/ui-icons_228ef1_256x240.png); }
-.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: 
url(images/ui-icons_ffd27a_256x240.png); }
-
-/* positioning */
-.ui-icon-carat-1-n { background-position: 0 0; }
-.ui-icon-carat-1-ne { background-position: -16px 0; }
-.ui-icon-carat-1-e { background-position: -32px 0; }
-.ui-icon-carat-1-se { background-position: -48px 0; }
-.ui-icon-carat-1-s { background-position: -64px 0; }
-.ui-icon-carat-1-sw { background-position: -80px 0; }
-.ui-icon-carat-1-w { background-position: -96px 0; }
-.ui-icon-carat-1-nw { background-position: -112px 0; }
-.ui-icon-carat-2-n-s { background-position: -128px 0; }
-.ui-icon-carat-2-e-w { background-position: -144px 0; }
-.ui-icon-triangle-1-n { background-position: 0 -16px; }
-.ui-icon-triangle-1-ne { background-position: -16px -16px; }
-.ui-icon-triangle-1-e { background-position: -32px -16px; }
-.ui-icon-triangle-1-se { background-position: -48px -16px; }
-.ui-icon-triangle-1-s { background-position: -64px -16px; }
-.ui-icon-triangle-1-sw { background-position: -80px -16px; }
-.ui-icon-triangle-1-w { background-position: -96px -16px; }
-.ui-icon-triangle-1-nw { background-position: -112px -16px; }
-.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
-.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
-.ui-icon-arrow-1-n { background-position: 0 -32px; }
-.ui-icon-arrow-1-ne { background-position: -16px -32px; }
-.ui-icon-arrow-1-e { background-position: -32px -32px; }
-.ui-icon-arrow-1-se { background-position: -48px -32px; }
-.ui-icon-arrow-1-s { background-position: -64px -32px; }
-.ui-icon-arrow-1-sw { background-position: -80px -32px; }
-.ui-icon-arrow-1-w { background-position: -96px -32px; }
-.ui-icon-arrow-1-nw { background-position: -112px -32px; }
-.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
-.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
-.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
-.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
-.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
-.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
-.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
-.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
-.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
-.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
-.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
-.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
-.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
-.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
-.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
-.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
-.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
-.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
-.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
-.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
-.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
-.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
-.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
-.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
-.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
-.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
-.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
-.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
-.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
-.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
-.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
-.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
-.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
-.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
-.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
-.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
-.ui-icon-arrow-4 { background-position: 0 -80px; }
-.ui-icon-arrow-4-diag { background-position: -16px -80px; }
-.ui-icon-extlink { background-position: -32px -80px; }
-.ui-icon-newwin { background-position: -48px -80px; }
-.ui-icon-refresh { background-position: -64px -80px; }
-.ui-icon-shuffle { background-position: -80px -80px; }
-.ui-icon-transfer-e-w { background-position: -96px -80px; }
-.ui-icon-transferthick-e-w { background-position: -112px -80px; }
-.ui-icon-folder-collapsed { background-position: 0 -96px; }
-.ui-icon-folder-open { background-position: -16px -96px; }
-.ui-icon-document { background-position: -32px -96px; }
-.ui-icon-document-b { background-position: -48px -96px; }
-.ui-icon-note { background-position: -64px -96px; }
-.ui-icon-mail-closed { background-position: -80px -96px; }
-.ui-icon-mail-open { background-position: -96px -96px; }
-.ui-icon-suitcase { background-position: -112px -96px; }
-.ui-icon-comment { background-position: -128px -96px; }
-.ui-icon-person { background-position: -144px -96px; }
-.ui-icon-print { background-position: -160px -96px; }
-.ui-icon-trash { background-position: -176px -96px; }
-.ui-icon-locked { background-position: -192px -96px; }
-.ui-icon-unlocked { background-position: -208px -96px; }
-.ui-icon-bookmark { background-position: -224px -96px; }
-.ui-icon-tag { background-position: -240px -96px; }
-.ui-icon-home { background-position: 0 -112px; }
-.ui-icon-flag { background-position: -16px -112px; }
-.ui-icon-calendar { background-position: -32px -112px; }
-.ui-icon-cart { background-position: -48px -112px; }
-.ui-icon-pencil { background-position: -64px -112px; }
-.ui-icon-clock { background-position: -80px -112px; }
-.ui-icon-disk { background-position: -96px -112px; }
-.ui-icon-calculator { background-position: -112px -112px; }
-.ui-icon-zoomin { background-position: -128px -112px; }
-.ui-icon-zoomout { background-position: -144px -112px; }
-.ui-icon-search { background-position: -160px -112px; }
-.ui-icon-wrench { background-position: -176px -112px; }
-.ui-icon-gear { background-position: -192px -112px; }
-.ui-icon-heart { background-position: -208px -112px; }
-.ui-icon-star { background-position: -224px -112px; }
-.ui-icon-link { background-position: -240px -112px; }
-.ui-icon-cancel { background-position: 0 -128px; }
-.ui-icon-plus { background-position: -16px -128px; }
-.ui-icon-plusthick { background-position: -32px -128px; }
-.ui-icon-minus { background-position: -48px -128px; }
-.ui-icon-minusthick { background-position: -64px -128px; }
-.ui-icon-close { background-position: -80px -128px; }
-.ui-icon-closethick { background-position: -96px -128px; }
-.ui-icon-key { background-position: -112px -128px; }
-.ui-icon-lightbulb { background-position: -128px -128px; }
-.ui-icon-scissors { background-position: -144px -128px; }
-.ui-icon-clipboard { background-position: -160px -128px; }
-.ui-icon-copy { background-position: -176px -128px; }
-.ui-icon-contact { background-position: -192px -128px; }
-.ui-icon-image { background-position: -208px -128px; }
-.ui-icon-video { background-position: -224px -128px; }
-.ui-icon-script { background-position: -240px -128px; }
-.ui-icon-alert { background-position: 0 -144px; }
-.ui-icon-info { background-position: -16px -144px; }
-.ui-icon-notice { background-position: -32px -144px; }
-.ui-icon-help { background-position: -48px -144px; }
-.ui-icon-check { background-position: -64px -144px; }
-.ui-icon-bullet { background-position: -80px -144px; }
-.ui-icon-radio-off { background-position: -96px -144px; }
-.ui-icon-radio-on { background-position: -112px -144px; }
-.ui-icon-pin-w { background-position: -128px -144px; }
-.ui-icon-pin-s { background-position: -144px -144px; }
-.ui-icon-play { background-position: 0 -160px; }
-.ui-icon-pause { background-position: -16px -160px; }
-.ui-icon-seek-next { background-position: -32px -160px; }
-.ui-icon-seek-prev { background-position: -48px -160px; }
-.ui-icon-seek-end { background-position: -64px -160px; }
-.ui-icon-seek-start { background-position: -80px -160px; }
-/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
-.ui-icon-seek-first { background-position: -80px -160px; }
-.ui-icon-stop { background-position: -96px -160px; }
-.ui-icon-eject { background-position: -112px -160px; }
-.ui-icon-volume-off { background-position: -128px -160px; }
-.ui-icon-volume-on { background-position: -144px -160px; }
-.ui-icon-power { background-position: 0 -176px; }
-.ui-icon-signal-diag { background-position: -16px -176px; }
-.ui-icon-signal { background-position: -32px -176px; }
-.ui-icon-battery-0 { background-position: -48px -176px; }
-.ui-icon-battery-1 { background-position: -64px -176px; }
-.ui-icon-battery-2 { background-position: -80px -176px; }
-.ui-icon-battery-3 { background-position: -96px -176px; }
-.ui-icon-circle-plus { background-position: 0 -192px; }
-.ui-icon-circle-minus { background-position: -16px -192px; }
-.ui-icon-circle-close { background-position: -32px -192px; }
-.ui-icon-circle-triangle-e { background-position: -48px -192px; }
-.ui-icon-circle-triangle-s { background-position: -64px -192px; }
-.ui-icon-circle-triangle-w { background-position: -80px -192px; }
-.ui-icon-circle-triangle-n { background-position: -96px -192px; }
-.ui-icon-circle-arrow-e { background-position: -112px -192px; }
-.ui-icon-circle-arrow-s { background-position: -128px -192px; }
-.ui-icon-circle-arrow-w { background-position: -144px -192px; }
-.ui-icon-circle-arrow-n { background-position: -160px -192px; }
-.ui-icon-circle-zoomin { background-position: -176px -192px; }
-.ui-icon-circle-zoomout { background-position: -192px -192px; }
-.ui-icon-circle-check { background-position: -208px -192px; }
-.ui-icon-circlesmall-plus { background-position: 0 -208px; }
-.ui-icon-circlesmall-minus { background-position: -16px -208px; }
-.ui-icon-circlesmall-close { background-position: -32px -208px; }
-.ui-icon-squaresmall-plus { background-position: -48px -208px; }
-.ui-icon-squaresmall-minus { background-position: -64px -208px; }
-.ui-icon-squaresmall-close { background-position: -80px -208px; }
-.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
-.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
-.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
-.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
-.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
-.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
-
-
-/* Misc visuals
-----------------------------------*/
-
-/* Corner radius */
-.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { 
-moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; 
-khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; }
-.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { 
-moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; 
-khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; }
-.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { 
-moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; 
-khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
-.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { 
-moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; 
-khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
-
-/* Overlays */
-.ui-widget-overlay { background: #666666 
url(images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat; opacity: 
.50;filter:Alpha(Opacity=50); }
-.ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 
url(images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; opacity: 
.20;filter:Alpha(Opacity=20); -moz-border-radius: 5px; -khtml-border-radius: 
5px; -webkit-border-radius: 5px; border-radius: 5px; }/*
- * jQuery UI Datepicker 1.8.16
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Datepicker#theming
- */
-.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
-.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
-.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { 
position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
-.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker 
.ui-datepicker-next-hover { top: 1px; }
-.ui-datepicker .ui-datepicker-prev { left:2px; }
-.ui-datepicker .ui-datepicker-next { right:2px; }
-.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
-.ui-datepicker .ui-datepicker-next-hover { right:1px; }
-.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next 
span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 
50%; margin-top: -8px;  }
-.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; 
text-align: center; }
-.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
-.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
-.ui-datepicker select.ui-datepicker-month, 
-.ui-datepicker select.ui-datepicker-year { width: 49%;}
-.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; 
margin:0 0 .4em; }
-.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; 
border: 0;  }
-.ui-datepicker td { border: 0; padding: 1px; }
-.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; 
text-align: right; text-decoration: none; }
-.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: 
.7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
-.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em 
.2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; 
overflow:visible; }
-.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { 
float:left; }
-
-/* with multiple calendars */
-.ui-datepicker.ui-datepicker-multi { width:auto; }
-.ui-datepicker-multi .ui-datepicker-group { float:left; }
-.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto 
.4em; }
-.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
-.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
-.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
-.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { 
border-left-width:0; }
-.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { 
border-left-width:0; }
-.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
-.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
-
-/* RTL support */
-.ui-datepicker-rtl { direction: rtl; }
-.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
-.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
-.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
-.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
-.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
-.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
-.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { 
float:right; }
-.ui-datepicker-rtl .ui-datepicker-group { float:right; }
-.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { 
border-right-width:0; border-left-width:1px; }
-.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { 
border-right-width:0; border-left-width:1px; }
-
-/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
-.ui-datepicker-cover {
-    display: none; /*sorry for IE5*/
-    display/**/: block; /*sorry for IE5*/
-    position: absolute; /*must have*/
-    z-index: -1; /*must have*/
-    filter: mask(); /*must have*/
-    top: -4px; /*must have*/
-    left: -4px; /*must have*/
-    width: 200px; /*must have*/
-    height: 200px; /*must have*/
-}
\ No newline at end of file

Modified: 
branches/Version-1_0-branch/controller/templates/base/edit_check_list.xsl
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/edit_check_list.xsl   
2011-12-23 14:09:08 UTC (rev 8430)
+++ branches/Version-1_0-branch/controller/templates/base/edit_check_list.xsl   
2011-12-23 14:22:25 UTC (rev 8431)
@@ -9,22 +9,46 @@
                        $( "#planned_date" ).datepicker({ 
                                monthNames: 
['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],
                                dayNamesMin: ['Sø', 'Ma', 'Ti', 'On', 'To', 
'Fr', 'Lø'],
-                               dateFormat: 'd/m-yy' 
+                               dateFormat: 'dd/mm-yy' 
                        });
                        $( "#completed_date" ).datepicker({ 
                                monthNames: 
['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],
                                dayNamesMin: ['Sø', 'Ma', 'Ti', 'On', 'To', 
'Fr', 'Lø'],
-                               dateFormat: 'd/m-yy' 
+                               dateFormat: 'dd/mm-yy' 
                        });
-                       $( "#deadline" ).datepicker({ 
+                       $( "#deadline_date" ).datepicker({ 
                                monthNames: 
['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],
                                dayNamesMin: ['Sø', 'Ma', 'Ti', 'On', 'To', 
'Fr', 'Lø'],
-                               dateFormat: 'd/m-yy' 
-                       });             
+                               dateFormat: 'dd/mm-yy' 
+                       });
+                       
+                       $(".tab_menu a").click(function(){
+                       
+                               var thisA = $(this);
+                               var wrpDiv = $(this).parent();
+                               var showId = $(thisA).attr("href");
+                               
+                               var activeA = $(".tab_menu").find("div.active");
+                               var hideId = $(activeA).find("a").attr("href");
+                               
+                                                               
+                               
$(".tab_menu").find("div.active").removeClass("active");
+                               
+                               $(wrpDiv).addClass("active");
+                               
+                               $(hideId).fadeOut('1000', function(){
+                                       $(showId).fadeIn('1000');
+                               });                     
+                                                       
+                                                       
+                       
+                               return false;
+                       });
+                                               
                });
        </script>
                
-               <h1>Sjekkliste</h1>
+               <h1>Endre sjekkliste for <xsl:value-of 
select="location_array/loc1_name"/></h1>
                
                <fieldset class="check_list_details">
                
@@ -40,10 +64,19 @@
                    </div>
                        <div>
                                <label>Status</label>
-                               <input>
-                                <xsl:attribute 
name="name">check_list_status</xsl:attribute>
-                                 <xsl:attribute name="value"><xsl:value-of 
select="check_list/status"/></xsl:attribute>
-                               </input>
+                                       <xsl:variable 
name="status"><xsl:value-of select="check_list/status"/></xsl:variable>
+                                       <select name="status">
+                                               <xsl:choose>
+                                                       <xsl:when 
test="check_list/status = 0">
+                                                               <option 
value="0" SELECTED="SELECTED">Ikke utført</option>
+                                                               <option 
value="1" >Utført</option>
+                                                       </xsl:when>
+                                                       <xsl:when 
test="check_list/status = 1">
+                                                               <option 
value="0">Ikke utført</option>
+                                                               <option 
value="1" SELECTED="SELECTED">Utført</option>
+                                                       </xsl:when>
+                                               </xsl:choose>
+                                       </select>
                        </div>
                        <div>
                                <label>Skal utføres innen</label>
@@ -85,207 +118,217 @@
                                  <xsl:value-of select="check_list/comment"/>
                                </textarea>
                        </div>
-                       
                </fieldset>
-                               
-               <h2 class="check_item_details">Ă…pne sjekkpunkter</h2>
-       
-               <xsl:choose>
-                       <xsl:when 
test="check_list/check_item_array/child::node()">
-                               
-                       <div class="expand_menu"><div class="expand_all">Vis 
alle</div><div class="collapse_all focus">Skjul alle</div></div>
                
-                               <ul class="check_items expand_list">
-                                       <xsl:for-each 
select="check_list/check_item_array">
-                                                       <li>
-                                                       <xsl:if test="status = 
0">
-                                                               <h4><img 
src="controller/images/arrow_right.png" width="14"/><xsl:number />. 
<span><xsl:value-of select="control_item/title"/></span></h4>                   
                           
-                                                               <form 
class="frm_save_check_item" 
action="index.php?menuaction=controller.uicheck_list.save_check_item" 
method="post">
-                                                                       
<xsl:variable name="check_item_id"><xsl:value-of select="id"/></xsl:variable>
-                                                                       <input 
type="hidden" name="check_item_id" value="{$check_item_id}" /> 
-                                                                       <div 
class="check_item">
-                                                                         <div>
-                                                                              
<label>Status</label>
-                                                                              
<select name="status">
-                                                                               
        <xsl:choose>
-                                                                               
                <xsl:when test="status = 0">
-                                                                               
                        <option value="0" SELECTED="SELECTED">Feil pĂĄ 
sjekkpunkt</option>
-                                                                               
                        <option value="1">Feil fikset</option>
-                                                                               
                </xsl:when>
-                                                                               
                <xsl:when test="status = 1">
-                                                                               
                        <option value="0">Feil pĂĄ sjekkpunkt</option>
-                                                                               
                        <option value="1" SELECTED="SELECTED">Feil 
fikset</option>
-                                                                               
                </xsl:when>
-                                                                               
        </xsl:choose>
-                                                                               
   </select>
-                                                                      </div>
-                                                                      <div>
-                                                                        <label 
class="comment">Kommentar</label>
-                                                                        
<textarea name="comment">
-                                                                               
        <xsl:value-of select="comment"/>
-                                                                               
 </textarea>
-                                                                      </div>
-                                                                      <div>
-                                                                        
<label>Hva skal gjøres</label>
-                                                                        
<textarea><xsl:value-of select="control_item/what_to_do"/></textarea>
-                                                                      </div>
-                                                                      <div>
-                                                                        
<label>Utførelsesbeskrivelse</label>
-                                                                        
<textarea><xsl:value-of select="control_item/what_to_do"/></textarea>
-                                                                      </div>
-                                                                      <div 
class="form-buttons">
-                                                                               
        <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save_check_item')" /></xsl:variable>
-                                                                               
        <input type="submit" name="save_control" value="{$lang_save}" 
class="not_active" title="{$lang_save}" />
-                                                                               
</div>
-                                                                       </div>
-                                                               </form>
-                                                       </xsl:if>
-                                           </li>
-                                       </xsl:for-each>
-                               </ul>                   
-                               </xsl:when>
-                               <xsl:otherwise>
-                                       Ingen sjekkpunkter
-                               </xsl:otherwise>
-               </xsl:choose>
+               <a>
+                       <xsl:attribute name="href">
+                               
<xsl:text>index.php?menuaction=controller.uierror_report_message.create_error_report_message</xsl:text>
+                               <xsl:text>&amp;check_list_id=</xsl:text>
+                               <xsl:value-of select="check_list/id"/>
+                       </xsl:attribute>
+                       Send avviksmelding
+               </a>
                
-               <h2 class="check_item_details">Sjekkpunkter som er fikset</h2>
-       
-               <xsl:choose>
-                       <xsl:when 
test="check_list/check_item_array/child::node()">
+               <div class="tab_menu">
+                       <div class="active ext"><a 
href="#control_items_list">Registrer avvik</a></div>
+                       <div><a href="#check_list_not_fixed_list">Vis ĂĄpne 
avvik</a></div>
+                       <div><a href="#check_list_fixed_list">Vis hĂĄndterte 
avvik</a></div>
+               </div>
+               
+               <div id="control_items_list" class="tab_item active">
+                       <h2 class="check_item_details">Velg sjekkpunkter som 
skal registreres som avvik</h2>
+
+                       <xsl:choose>
+                               <xsl:when 
test="control_items_list/child::node()">
                                
-                       <div class="expand_menu"><div class="expand_all">Vis 
alle</div><div class="collapse_all focus">Skjul alle</div></div>
-                               
-                               <ul class="check_items expand_list">
-                                       <xsl:for-each 
select="check_list/check_item_array">
-                                                       <xsl:if test="status = 
1">
+                                       <ul id="control_items_list" 
class="check_items expand_list">
+                                               <xsl:for-each 
select="control_items_list">
                                                        <li>
-                                                       <h4><img 
src="controller/images/arrow_right.png" width="14"/><xsl:number/>. 
<span><xsl:value-of select="control_item/title"/></span></h4>                   
                            
-                                                               <form 
class="frm_save_check_item" 
action="index.php?menuaction=controller.uicheck_list.save_check_item" 
method="post">
-                                                                       
<xsl:variable name="check_item_id"><xsl:value-of select="id"/></xsl:variable>
-                                                                       <input 
type="hidden" name="check_item_id" value="{$check_item_id}" /> 
+                                                       <h4><img 
src="controller/images/arrow_right.png" width="14"/><xsl:number/>. 
<span><xsl:value-of select="title"/></span></h4>                                
            
+                                                               <form 
class="frm_save_control_item" 
action="index.php?menuaction=controller.uicheck_list.add_check_item_to_list" 
method="post">
+                                                                       
<xsl:variable name="control_item_id"><xsl:value-of select="id"/></xsl:variable>
+                                                                       <input 
type="hidden" name="control_item_id" value="{$control_item_id}" /> 
+                                                                       <input>
+                                                                     
<xsl:attribute name="name">check_list_id</xsl:attribute>
+                                                                     
<xsl:attribute name="type">hidden</xsl:attribute>
+                                                                     
<xsl:attribute name="value">
+                                                                       
<xsl:value-of select="//check_list/id"/>
+                                                                     
</xsl:attribute>
+                                                                   </input>
+                                                                   <input>
+                                                                     
<xsl:attribute name="name">status</xsl:attribute>
+                                                                     
<xsl:attribute name="type">hidden</xsl:attribute>
+                                                                     
<xsl:attribute name="value">
+                                                                       
<xsl:value-of select="0"/>
+                                                                     
</xsl:attribute>
+                                                                   </input>
+                                                                               
                                                        
                                                                        <div 
class="check_item">
-                                                                         <div>
-                                                                              
<label>Status</label>
-                                                                              
<select name="status">
-                                                                               
        <xsl:choose>
-                                                                               
                <xsl:when test="status = 0">
-                                                                               
                        <option value="0" SELECTED="SELECTED">Feil pĂĄ 
sjekkpunkt</option>
-                                                                               
                        <option value="1">Feil fikset</option>
-                                                                               
                </xsl:when>
-                                                                               
                <xsl:when test="status = 1">
-                                                                               
                        <option value="0">Feil pĂĄ sjekkpunkt</option>
-                                                                               
                        <option value="1" SELECTED="SELECTED">Feil 
fikset</option>
-                                                                               
                </xsl:when>
-                                                                               
        </xsl:choose>
-                                                                               
   </select>
+                                                                        <div>
+                                                                        <label 
class="comment">PĂĄkrevd</label>
+                                                                          
<input>
+                                                                               
      <xsl:attribute name="name">required</xsl:attribute>
+                                                                               
      <xsl:attribute name="type">checkbox</xsl:attribute>
+                                                                               
      <xsl:attribute name="value">
+                                                                               
        <xsl:value-of select="required"/>
+                                                                               
      </xsl:attribute>
+                                                                               
    </input>
                                                                       </div>
+                                                                       <div>
+                                                                               
 <label class="comment">Kommentar</label>
+                                                                               
 <textarea name="comment">
+                                                                               
                <xsl:value-of select="comment"/>
+                                                                               
         </textarea>
+                                                                              
</div>
                                                                       <div>
-                                                                        <label 
class="comment">Kommentar</label>
-                                                                        
<textarea name="comment">
-                                                                               
        <xsl:value-of select="comment"/>
-                                                                               
 </textarea>
-                                                                      </div>
-                                                                      <div>
-                                                                        
<label>Hva skal gjøres</label>
+                                                                        <label 
style="vertical-align:top">Hva skal gjøres</label>
                                                                         
<textarea><xsl:value-of select="control_item/what_to_do"/></textarea>
                                                                       </div>
                                                                       <div>
-                                                                        
<label>Utførelsesbeskrivelse</label>
+                                                                        <label 
style="vertical-align:top">Utførelsesbeskrivelse</label>
                                                                         
<textarea><xsl:value-of select="control_item/what_to_do"/></textarea>
                                                                       </div>
                                                                       <div 
class="form-buttons">
-                                                                               
        <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save_check_item')" /></xsl:variable>
+                                                                               
        <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'register_error')" /></xsl:variable>
                                                                                
        <input type="submit" name="save_control" value="{$lang_save}" 
class="not_active" title="{$lang_save}" />
                                                                                
</div>
                                                                        </div>
                                                                </form>
                                                    </li>
-                                               </xsl:if>
-                                       </xsl:for-each>
-                               </ul>                   
-                               </xsl:when>
-                               <xsl:otherwise>
-                                       Ingen sjekkpunkter
-                               </xsl:otherwise>
-               </xsl:choose>
+                                               </xsl:for-each>
+                                       </ul>                   
+                                       </xsl:when>
+                                       <xsl:otherwise>
+                                               Ingen sjekkpunkter
+                                       </xsl:otherwise>
+                       </xsl:choose>
+               </div>
                
-               <h2 class="check_item_details">Kontrollpunkter</h2>
-       
-               <xsl:choose>
-                       <xsl:when test="control_items_list/child::node()">
                
-                               <ul class="check_items expand_list">
-                                       <xsl:for-each 
select="control_items_list">
-                                               <li>
-                                               <h4><img 
src="controller/images/arrow_right.png" width="14"/><xsl:number/>. 
<span><xsl:value-of select="title"/></span></h4>                                
            
-                                                       <form 
class="frm_save_control_item" 
action="index.php?menuaction=controller.uicheck_list.add_check_item_to_list" 
method="post">
-                                                               <xsl:variable 
name="control_item_id"><xsl:value-of select="id"/></xsl:variable>
-                                                               <input 
type="hidden" name="control_item_id" value="{$control_item_id}" /> 
-                                                               <input>
-                                                             <xsl:attribute 
name="name">check_list_id</xsl:attribute>
-                                                             <xsl:attribute 
name="type">hidden</xsl:attribute>
-                                                             <xsl:attribute 
name="value">
-                                                               <xsl:value-of 
select="//check_list/id"/>
-                                                             </xsl:attribute>
-                                                           </input>
-                                                           <input>
-                                                             <xsl:attribute 
name="name">status</xsl:attribute>
-                                                             <xsl:attribute 
name="type">hidden</xsl:attribute>
-                                                             <xsl:attribute 
name="value">
-                                                               <xsl:value-of 
select="0"/>
-                                                             </xsl:attribute>
-                                                           </input>
-                                                                               
                                                
-                                                               <div 
class="check_item">
-                                                                 <div>
-                                                                      
<label>Tittel</label>
-                                                                      <input>
-                                                                             
<xsl:attribute name="name">control_item_title</xsl:attribute>
-                                                                             
<xsl:attribute name="type">text</xsl:attribute>
-                                                                             
<xsl:attribute name="value">
-                                                                               
<xsl:value-of select="title"/>
-                                                                             
</xsl:attribute>
-                                                                           
</input>
-                                                              </div>
-                                                               <div>
-                                                                        <label 
class="comment">Kommentar</label>
-                                                                        
<textarea name="comment">
-                                                                               
        <xsl:value-of select="comment"/>
-                                                                               
 </textarea>
-                                                                      </div>
-                                                              <div>
-                                                                <label 
class="comment">PĂĄkrevd</label>
-                                                                  <input>
-                                                                             
<xsl:attribute name="name">required</xsl:attribute>
-                                                                             
<xsl:attribute name="type">text</xsl:attribute>
-                                                                             
<xsl:attribute name="value">
-                                                                               
<xsl:value-of select="required"/>
-                                                                             
</xsl:attribute>
-                                                                           
</input>
-                                                              </div>
-                                                              <div>
-                                                                <label>Hva 
skal gjøres</label>
-                                                                
<textarea><xsl:value-of select="control_item/what_to_do"/></textarea>
-                                                              </div>
-                                                              <div>
-                                                                
<label>Utførelsesbeskrivelse</label>
-                                                                
<textarea><xsl:value-of select="control_item/what_to_do"/></textarea>
-                                                              </div>
-                                                              <div 
class="form-buttons">
-                                                                               
<xsl:variable name="lang_save"><xsl:value-of select="php:function('lang', 
'save_check_item')" /></xsl:variable>
-                                                                               
<input type="submit" name="save_control" value="{$lang_save}" 
class="not_active" title="{$lang_save}" />
-                                                                       </div>
-                                                               </div>
-                                                       </form>
-                                           </li>
-                                       </xsl:for-each>
-                               </ul>                   
-                               </xsl:when>
-                               <xsl:otherwise>
-                                       Ingen kontrollpunkter
-                               </xsl:otherwise>
-               </xsl:choose>
+               <div id="check_list_not_fixed_list" class="tab_item">
+                       <h2 class="check_item_details">Ă…pne avvik</h2>
+               
+                       <xsl:choose>
+                               <xsl:when 
test="check_list/check_item_array/child::node()">
+                                       
+                               <div class="expand_menu"><div 
class="expand_all">Vis alle</div><div class="collapse_all focus">Skjul 
alle</div></div>
                        
+                                       <ul id="check_list_not_fixed_list" 
class="check_items expand_list">
+                                               <xsl:for-each 
select="check_list/check_item_array">
+                                                               <li>
+                                                               <xsl:if 
test="status = 0">
+                                                                       
<h4><img src="controller/images/arrow_right.png" width="14"/><xsl:number />. 
<span><xsl:value-of select="control_item/title"/></span></h4>                   
                           
+                                                                       <form 
class="frm_save_check_item" 
action="index.php?menuaction=controller.uicheck_list.save_check_item" 
method="post">
+                                                                               
<xsl:variable name="check_item_id"><xsl:value-of select="id"/></xsl:variable>
+                                                                               
<input type="hidden" name="check_item_id" value="{$check_item_id}" /> 
+                                                                               
<div class="check_item">
+                                                                               
  <div>
+                                                                               
       <label>Status</label>
+                                                                               
       <select name="status">
+                                                                               
                <xsl:choose>
+                                                                               
                        <xsl:when test="status = 0">
+                                                                               
                                <option value="0" SELECTED="SELECTED">Feil pĂĄ 
sjekkpunkt</option>
+                                                                               
                                <option value="1">Feil fikset</option>
+                                                                               
                        </xsl:when>
+                                                                               
                        <xsl:when test="status = 1">
+                                                                               
                                <option value="0">Feil pĂĄ sjekkpunkt</option>
+                                                                               
                                <option value="1" SELECTED="SELECTED">Feil 
fikset</option>
+                                                                               
                        </xsl:when>
+                                                                               
                </xsl:choose>
+                                                                               
           </select>
+                                                                              
</div>
+                                                                              
<div>
+                                                                               
 <label class="comment">Kommentar</label>
+                                                                               
 <textarea name="comment">
+                                                                               
                <xsl:value-of select="comment"/>
+                                                                               
         </textarea>
+                                                                              
</div>
+                                                                              
<div>
+                                                                               
 <label>Hva skal gjøres</label>
+                                                                               
 <textarea><xsl:value-of select="control_item/what_to_do"/></textarea>
+                                                                              
</div>
+                                                                              
<div>
+                                                                               
 <label>Utførelsesbeskrivelse</label>
+                                                                               
 <textarea><xsl:value-of select="control_item/what_to_do"/></textarea>
+                                                                              
</div>
+                                                                              
<div class="form-buttons">
+                                                                               
                <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save_check_item')" /></xsl:variable>
+                                                                               
                <input type="submit" name="save_control" value="{$lang_save}" 
class="not_active" title="{$lang_save}" />
+                                                                               
        </div>
+                                                                               
</div>
+                                                                       </form>
+                                                               </xsl:if>
+                                                   </li>
+                                               </xsl:for-each>
+                                       </ul>                   
+                                       </xsl:when>
+                                       <xsl:otherwise>
+                                               Ingen sjekkpunkter
+                                       </xsl:otherwise>
+                       </xsl:choose>
+               </div>
+               
+               <div id="check_list_fixed_list" class="tab_item"> 
+                       <h2 class="check_item_details">Avvik som er 
hĂĄndterte</h2>
+               
+                       <xsl:choose>
+                               <xsl:when 
test="check_list/check_item_array/child::node()">
+                                       
+                               <div class="expand_menu"><div 
class="expand_all">Vis alle</div><div class="collapse_all focus">Skjul 
alle</div></div>
+                                       
+                                       <ul id="check_list_fixed_list" 
class="check_items expand_list">
+                                               <xsl:for-each 
select="check_list/check_item_array">
+                                                               <xsl:if 
test="status = 1">
+                                                               <li>
+                                                               <h4><img 
src="controller/images/arrow_right.png" width="14"/><xsl:number/>. 
<span><xsl:value-of select="control_item/title"/></span></h4>                   
                            
+                                                                       <form 
class="frm_save_check_item" 
action="index.php?menuaction=controller.uicheck_list.save_check_item" 
method="post">
+                                                                               
<xsl:variable name="check_item_id"><xsl:value-of select="id"/></xsl:variable>
+                                                                               
<input type="hidden" name="check_item_id" value="{$check_item_id}" /> 
+                                                                               
<div class="check_item">
+                                                                               
  <div>
+                                                                               
       <label>Status</label>
+                                                                               
       <select name="status">
+                                                                               
                <xsl:choose>
+                                                                               
                        <xsl:when test="status = 0">
+                                                                               
                                <option value="0" SELECTED="SELECTED">Feil pĂĄ 
sjekkpunkt</option>
+                                                                               
                                <option value="1">Feil fikset</option>
+                                                                               
                        </xsl:when>
+                                                                               
                        <xsl:when test="status = 1">
+                                                                               
                                <option value="0">Feil pĂĄ sjekkpunkt</option>
+                                                                               
                                <option value="1" SELECTED="SELECTED">Feil 
fikset</option>
+                                                                               
                        </xsl:when>
+                                                                               
                </xsl:choose>
+                                                                               
           </select>
+                                                                              
</div>
+                                                                              
<div>
+                                                                               
 <label class="comment">Kommentar</label>
+                                                                               
 <textarea name="comment">
+                                                                               
                <xsl:value-of select="comment"/>
+                                                                               
         </textarea>
+                                                                              
</div>
+                                                                              
<div>
+                                                                               
 <label>Hva skal gjøres</label>
+                                                                               
 <textarea><xsl:value-of select="control_item/what_to_do"/></textarea>
+                                                                              
</div>
+                                                                              
<div>
+                                                                               
 <label>Utførelsesbeskrivelse</label>
+                                                                               
 <textarea><xsl:value-of select="control_item/what_to_do"/></textarea>
+                                                                              
</div>
+                                                                              
<div class="form-buttons">
+                                                                               
                <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save_check_item')" /></xsl:variable>
+                                                                               
                <input type="submit" name="save_control" value="{$lang_save}" 
class="not_active" title="{$lang_save}" />
+                                                                               
        </div>
+                                                                               
</div>
+                                                                       </form>
+                                                           </li>
+                                                       </xsl:if>
+                                               </xsl:for-each>
+                                       </ul>                   
+                                       </xsl:when>
+                                       <xsl:otherwise>
+                                               Ingen sjekkpunkter
+                                       </xsl:otherwise>
+                       </xsl:choose>
+               </div>  
 </div>
 </xsl:template>

Modified: 
branches/Version-1_0-branch/controller/templates/base/procedure_documents.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/procedure_documents.xsl   
    2011-12-23 14:09:08 UTC (rev 8430)
+++ 
branches/Version-1_0-branch/controller/templates/base/procedure_documents.xsl   
    2011-12-23 14:22:25 UTC (rev 8431)
@@ -15,7 +15,9 @@
                                        <h3><xsl:value-of 
select="php:function('lang','upload')" /></h3>
                                        <input type="file" id="file_path" 
name="file_path" />
                                        <xsl:value-of 
select="php:function('lang','title')" />:
-                                       <input type="text" id="document_title" 
name="document_title" />
+                                       <input type="text" id="document_title" 
name="document_title" /><br/>
+                                       <xsl:value-of 
select="php:function('lang','description')" />:
+                                       <textarea id="document_description" 
name="document_description" rows="5" cols="60"></textarea>
                                        <input type="submit" id="upload_button" 
value="{$lang_upload}" />
                                </fieldset>
                        </form>
@@ -50,6 +52,9 @@
                                <td align="left" style="padding-right: 10px;">
                                        <xsl:value-of select="name"/>
                                </td>
+                               <td align="left" style="padding-right: 10px;">
+                                       <xsl:value-of select="description" 
disable-output-escaping="yes"/>
+                               </td>
                        </xsl:for-each>
                </tr>
        </xsl:for-each>

Modified: 
branches/Version-1_0-branch/controller/templates/base/view_calendar_month.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/view_calendar_month.xsl   
    2011-12-23 14:09:08 UTC (rev 8430)
+++ 
branches/Version-1_0-branch/controller/templates/base/view_calendar_month.xsl   
    2011-12-23 14:22:25 UTC (rev 8431)
@@ -4,52 +4,58 @@
 <xsl:variable name="location_code"><xsl:value-of 
select="location_array/location_code"/></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="period"/></div>
-               </fieldset>
+               
+               <h1>Kalenderoversikt for <xsl:value-of select="period"/></h1>
+               
+               <div style="float:left;">                       
+                       <fieldset class="location_details">
+                               <h3 
style="margin:0;font-size:19px;"><xsl:value-of 
select="location_array/loc1_name"/></h3>
+                       </fieldset>
+               </div>
+               
+               <ul id="icon_color_map">
+                       <li><img height="13" 
src="controller/images/status_icon_yellow_ring.png" /><span>Kontroll satt 
opp</span></li>
+                       <li><img height="13" 
src="controller/images/status_icon_yellow.png" /><span>Kontroll har planlagt 
dato</span></li>
+                       <li><img height="13" 
src="controller/images/status_icon_dark_green.png" /><span>Kontroll gjennomført 
uten feil før frist</span></li>
+                       <li><img height="13" 
src="controller/images/status_icon_light_green.png" /><span>Kontroll 
gjennomført uten feil etter frist</span></li>
+                       <li><img height="13" 
src="controller/images/status_icon_red_empty.png" /><span>Kontroll gjennomført 
med rapporterte feil</span></li>
+                       <li><img height="11" 
src="controller/images/status_icon_red_cross.png" /><span>Kontroll ikke 
gjennomført</span></li>
+               </ul>
                                
-               <h2 style="float:left;">Sjekklister</h2>
-               <div style="float:left;margin-top: 30px;margin-left: 636px;"><a 
class="move_cal_right" href="#"><img src="controller/images/arrow_left.png" 
width="16"/></a></div>
-               <div style="float:left;margin-top: 30px;margin-left: 454px;"><a 
class="move_cal_left" href="#"><img src="controller/images/arrow_right.png" 
width="16"/></a></div>
+               <div style="float: left;margin-bottom: 10px;margin-left: 
735px;margin-top: 30px;"><a class="move_cal_right" href="#"><img 
src="controller/images/arrow_left.png" width="16"/></a></div>
+               <div style="float:left;margin-top: 30px;margin-left: 374px;"><a 
class="move_cal_left" href="#"><img src="controller/images/arrow_right.png" 
width="16"/></a></div>
                
                <script>
                        $(document).ready(function() {
-                                               
-                               $(".move_cal_left").click(function(){
+                               $(".move_cal_left").click(function(){
                                        var leftStrVal = 
$("#days_view").css("left");
                                        var leftNumVal = 
leftStrVal.substring(0, leftStrVal.indexOf('px'));
                                        
-                                       if(leftNumVal == -502){
+                                       if(leftNumVal == -417){
                                                $("#days_view").animate({
-                                   left: '-=110' 
+                                   left: '-=93' 
                                    }, 800);
-                                       }else if(leftNumVal > -502){
+                                       }else if(leftNumVal > -417){
                                                $("#days_view").animate({
-                                   left: '-=502' 
+                                   left: '-=417' 
                                    }, 800);
                                        }
                                });
                                
                                $(".move_cal_right").click(function(){
-               
                                        var leftStrVal = 
$("#days_view").css("left");
                                        var leftNumVal = 
leftStrVal.substring(0, leftStrVal.indexOf('px'));
                                        
-                                       if(leftNumVal == -110){
-                                               $("#days_view").animate({
-                                   left: '+=110' 
-                                   }, 800);
-                                       }else if(-502 == leftNumVal){
-                                               $("#days_view").animate({
-                                   left: '+=502' 
-                                   }, 800);
-                                       }else if(-502 > leftNumVal){
-                                               $("#days_view").animate({
-                                   left: '+=502' 
-                                   }, 800);
+                                       if( leftNumVal != 0 ){
+                                               if(leftNumVal == -93){
+                                                       
$("#days_view").animate({
+                                           left: '+=93' 
+                                           }, 800);
+                                               }else if( leftNumVal >= -510 ){
+                                                       
$("#days_view").animate({
+                                           left: '+=417' 
+                                           }, 800);
+                                               }
                                        }
                                });
                        });
@@ -57,7 +63,7 @@
                
                <xsl:choose>
                        <xsl:when test="controls_calendar_array/child::node()">
-                       <ul style="clear:left;" class="calendar info">
+                       <ul style="clear:left;" class="calendar info month">
                                <li class="heading">
                                        <div class="id">ID</div>
                                        <div class="title">Tittel</div>
@@ -122,7 +128,7 @@
                                                                                
                <xsl:text>&amp;location_code=</xsl:text>
                                                                                
                <xsl:value-of select="$location_code"/>
                                                                                
        </xsl:attribute>
-                                                                               
        <img height="15" src="controller/images/status_icon_yellow.png" />
+                                                                               
        <img height="15" src="controller/images/status_icon_yellow_ring.png" />
                                                                                
</a>
                                                                                
</div>
                                                                        
</xsl:when>
@@ -130,27 +136,22 @@
                                                                                
<div>
                                                                                
<a>
                                                                                
        <xsl:attribute name="href">
-                                                                               
                
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.add_check_list_for_location</xsl:text>
-                                                                               
                <xsl:text>&amp;date=</xsl:text>
-                                                                               
                <xsl:value-of select="info/date"/>
-                                                                               
                <xsl:text>&amp;control_id=</xsl:text>
-                                                                               
                <xsl:value-of select="info/control_id"/>
-                                                                               
                <xsl:text>&amp;location_code=</xsl:text>
-                                                                               
                <xsl:value-of select="$location_code"/>
+                                                                               
                
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.edit_check_list_for_location</xsl:text>
+                                                                               
                <xsl:text>&amp;check_list_id=</xsl:text>
+                                                                               
                <xsl:value-of select="info/check_list_id"/>
                                                                                
        </xsl:attribute>
-                                                                               
        <img height="15" src="controller/images/status_icon_light_green.png" />
+                                                                               
        <img height="15" src="controller/images/status_icon_yellow.png" />
                                                                                
</a>
                                                                                
</div>
                                                                        
</xsl:when>
                                                                        
<xsl:when test="status = 'control_accomplished_in_time_without_errors'">
                                                                                
<div>
-                                                                               
        <a class="view_check_list">
-                                                                               
                <xsl:attribute name="href">
-                                                                               
                        
<xsl:text>index.php?menuaction=controller.uicheck_list.get_check_list_info</xsl:text>
-                                                                               
                        <xsl:text>&amp;phpgw_return_as=json</xsl:text>
-                                                                               
                        <xsl:text>&amp;check_list_id=</xsl:text>
-                                                                               
                        <xsl:value-of select="info/id"/>
-                                                                               
                </xsl:attribute>
+                                                                               
        <a>
+                                                                               
        <xsl:attribute name="href">
+                                                                               
                
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.edit_check_list_for_location</xsl:text>
+                                                                               
                <xsl:text>&amp;check_list_id=</xsl:text>
+                                                                               
                <xsl:value-of select="info/check_list_id"/>
+                                                                               
        </xsl:attribute>
                                                                                
                <span style="display:none"><xsl:value-of 
select="info/id"/></span>
                                                                                
                <img height="15" 
src="controller/images/status_icon_dark_green.png" />
                                                                                
        </a>
@@ -159,13 +160,12 @@
                                                                        
<xsl:when test="status = 'control_accomplished_over_time_without_errors'">
                                                                                
<div style="position:relative;">
                                                                                
<div id="info_box" style="position:absolute;display:none;"></div>
-                                                                               
        <a class="view_check_list">
-                                                                               
                <xsl:attribute name="href">
-                                                                               
                        
<xsl:text>index.php?menuaction=controller.uicheck_list.get_check_list_info</xsl:text>
-                                                                               
                        <xsl:text>&amp;phpgw_return_as=json</xsl:text>
-                                                                               
                        <xsl:text>&amp;check_list_id=</xsl:text>
-                                                                               
                        <xsl:value-of select="info/id"/>
-                                                                               
                </xsl:attribute>
+                                                                               
        <a>
+                                                                               
        <xsl:attribute name="href">
+                                                                               
                
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.edit_check_list_for_location</xsl:text>
+                                                                               
                <xsl:text>&amp;check_list_id=</xsl:text>
+                                                                               
                <xsl:value-of select="info/check_list_id"/>
+                                                                               
        </xsl:attribute>
                                                                                
                <span style="display:none"><xsl:value-of 
select="info/id"/></span>
                                                                                
                <img height="15" 
src="controller/images/status_icon_light_green.png" />
                                                                                
        </a>
@@ -176,13 +176,15 @@
                                                                                
<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.get_check_list_info</xsl:text>
-                                                                               
                        <xsl:text>&amp;phpgw_return_as=json</xsl:text>
+                                                                               
                        
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.edit_check_list_for_location</xsl:text>
                                                                                
                        <xsl:text>&amp;check_list_id=</xsl:text>
-                                                                               
                        <xsl:value-of select="info/id"/>
+                                                                               
                        <xsl:value-of select="info/check_list_id"/>
                                                                                
                </xsl:attribute>
-                                                                               
                <span style="display:none"><xsl:value-of 
select="info/id"/></span>
-                                                                               
                <img height="15" src="controller/images/status_icon_red.png" />
+                                                                               
                <span style="display:none">
+                                                                               
                        <xsl:text>&amp;check_list_id=</xsl:text><xsl:value-of 
select="info/check_list_id"/>
+                                                                               
                        <xsl:text>&amp;phpgw_return_as=json</xsl:text>
+                                                                               
                </span>
+                                                                               
                <img height="15" 
src="controller/images/status_icon_red_empty.png" />
                                                                                
        </a>
                                                                                
</div>
                                                                        
</xsl:when>

Modified: 
branches/Version-1_0-branch/controller/templates/base/view_calendar_year.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/view_calendar_year.xsl    
    2011-12-23 14:09:08 UTC (rev 8430)
+++ 
branches/Version-1_0-branch/controller/templates/base/view_calendar_year.xsl    
    2011-12-23 14:22:25 UTC (rev 8431)
@@ -5,15 +5,25 @@
 <xsl:variable name="location_code"><xsl:value-of 
select="location_array/location_code"/></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="period"/></div>
-               </fieldset>
-                               
-               <h2>Sjekklister</h2>
                
+               <h1>Kalenderoversikt for <xsl:value-of select="period"/></h1>
+               
+               <div style="float:left;">                       
+                       <fieldset class="location_details">
+                               <h3 
style="margin:0;font-size:19px;"><xsl:value-of 
select="location_array/loc1_name"/></h3>
+                       </fieldset>
+               </div>
+               
+               <ul id="icon_color_map">
+                       <li><img height="15" 
src="controller/images/status_icon_yellow.png" /><span>Kontroll satt 
opp</span></li>
+                       <li><img height="15" 
src="controller/images/status_icon_light_green.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</span></li>
+                       <li><img height="15" 
src="controller/images/status_icon_light_blue.png" /><span>Kontroll gjennomført 
uten feil før frist</span></li>
+                       <li><img height="15" 
src="controller/images/status_icon_dark_blue.png" /><span>Kontroll gjennomført 
uten feil etter frist</span></li>
+                       <li><img height="15" 
src="controller/images/status_icon_red.png" /><span>Kontroll gjennomført med 
rapporterte feil</span></li>
+                       <li><img height="12" 
src="controller/images/status_icon_red_cross.png" /><span>Kontroll ikke 
gjennomført</span></li>
+               </ul>
+               
                <ul class="calendar">
                        <xsl:choose>
                                <xsl:when 
test="controls_calendar_array/child::node()">
@@ -30,7 +40,7 @@
                                                <div>
                                                        <a>
                                                                <xsl:attribute 
name="href">
-                                                                       
<xsl:text>index.php?menuaction=controller.uilocation_check_list.view_calendar_for_month</xsl:text>
+                                                                       
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
                                                                        
<xsl:text>&amp;year=</xsl:text>
                                                                        
<xsl:value-of select="$year"/>
                                                                        
<xsl:text>&amp;month=</xsl:text>
@@ -73,55 +83,107 @@
                                                </div>                          
                        
                                                <div class="months">
                                                <xsl:for-each 
select="calendar_array">
-                                               <xsl:choose>
-                                                               <xsl:when 
test="status = 0">
-                                                                       <div>
-                                                                       <a>
-                                                                               
<xsl:attribute name="href">
-                                                                               
        
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.add_check_list_for_location</xsl:text>
-                                                                               
        <xsl:text>&amp;date=</xsl:text>
-                                                                               
        <xsl:value-of select="info/date"/>
-                                                                               
        <xsl:text>&amp;control_id=</xsl:text>
-                                                                               
        <xsl:value-of select="$control_id"/>
-                                                                               
        <xsl:text>&amp;location_code=</xsl:text>
-                                                                               
        <xsl:value-of select="$location_code"/>
-                                                                               
</xsl:attribute>
-                                                                               
<img height="15" src="controller/images/status_icon_yellow.png" />
-                                                                       </a>
-                                                                       </div>
-                                                               </xsl:when>
-                                                               <xsl:when 
test="status = 1">
-                                                                       <div 
style="position:relative;">
-                                                                       <div 
id="info_box" style="position:absolute;display:none;"></div>
-                                                                               
<a class="view_check_list">
-                                                                               
        <xsl:attribute name="href">
-                                                                               
                
<xsl:text>index.php?menuaction=controller.uicheck_list.get_check_list_info</xsl:text>
-                                                                               
                <xsl:text>&amp;phpgw_return_as=json</xsl:text>
+                                               <xsl:choose>
+                                                                       
<xsl:when test="status = 'control_registered'">
+                                                                               
<div>
+                                                                               
<a>
+                                                                               
        <xsl:attribute name="href">
+                                                                               
                
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.add_check_list_for_location</xsl:text>
+                                                                               
                <xsl:text>&amp;date=</xsl:text>
+                                                                               
                <xsl:value-of select="info/date"/>
+                                                                               
                <xsl:text>&amp;control_id=</xsl:text>
+                                                                               
                <xsl:value-of select="info/control_id"/>
+                                                                               
                <xsl:text>&amp;location_code=</xsl:text>
+                                                                               
                <xsl:value-of select="$location_code"/>
+                                                                               
        </xsl:attribute>
+                                                                               
        <img height="15" src="controller/images/status_icon_yellow.png" />
+                                                                               
</a>
+                                                                               
</div>
+                                                                       
</xsl:when>
+                                                                       
<xsl:when test="status = 'control_planned'">
+                                                                               
<div>
+                                                                               
<a>
+                                                                               
        <xsl:attribute name="href">
+                                                                               
                
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.edit_check_list_for_location</xsl:text>
                                                                                
                <xsl:text>&amp;check_list_id=</xsl:text>
-                                                                               
                <xsl:value-of select="info/id"/>
+                                                                               
                <xsl:value-of select="info/check_list_id"/>
                                                                                
        </xsl:attribute>
-                                                                               
        <span style="display:none"><xsl:value-of select="info/id"/></span>
-                                                                               
        <img height="15" src="controller/images/status_icon_red.png" />
+                                                                               
        <img height="15" src="controller/images/status_icon_light_green.png" />
                                                                                
</a>
-                                                                       </div>
-                                                               </xsl:when>
-                                                               <xsl:when 
test="status = 2">
-                                                                       <div 
style="background: url(controller/images/status_icon_red_empty.png) no-repeat 
50% 50%;">
-                                                                       <a 
style="color:#fff;font-weight:bold;text-decoration: none;font-size:10px;" 
class="view_check_list">
-                                                                               
        <xsl:attribute name="href">
-                                                                               
                
<xsl:text>index.php?menuaction=controller.uicheck_list.get_check_list_info</xsl:text>
-                                                                               
                <xsl:text>&amp;phpgw_return_as=json</xsl:text>
+                                                                               
</div>
+                                                                       
</xsl:when>
+                                                                       
<xsl:when test="status = 'control_accomplished_in_time_without_errors'">
+                                                                               
<div>
+                                                                               
        <a>
+                                                                               
        <xsl:attribute name="href">
+                                                                               
                
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.edit_check_list_for_location</xsl:text>
                                                                                
                <xsl:text>&amp;check_list_id=</xsl:text>
-                                                                               
                <xsl:value-of select="info/id"/>
+                                                                               
                <xsl:value-of select="info/check_list_id"/>
                                                                                
        </xsl:attribute>
-                                                                               
        <span><xsl:value-of select="info"/></span>
-                                                                               
</a>
-                                                                       </div>
-                                                               </xsl:when>
-                                                               <xsl:otherwise>
-                                                               <div></div>
-                                                               </xsl:otherwise>
-                                                       </xsl:choose>
+                                                                               
                <span style="display:none"><xsl:value-of 
select="info/id"/></span>
+                                                                               
                <img height="15" 
src="controller/images/status_icon_dark_green.png" />
+                                                                               
        </a>
+                                                                               
</div>
+                                                                       
</xsl:when>
+                                                                       
<xsl:when test="status = 'control_accomplished_over_time_without_errors'">
+                                                                               
<div style="position:relative;">
+                                                                               
<div id="info_box" style="position:absolute;display:none;"></div>
+                                                                               
        <a>
+                                                                               
        <xsl:attribute name="href">
+                                                                               
                
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.edit_check_list_for_location</xsl:text>
+                                                                               
                <xsl:text>&amp;check_list_id=</xsl:text>
+                                                                               
                <xsl:value-of select="info/check_list_id"/>
+                                                                               
        </xsl:attribute>
+                                                                               
                <span style="display:none"><xsl:value-of 
select="info/id"/></span>
+                                                                               
                <img height="15" 
src="controller/images/status_icon_light_green.png" />
+                                                                               
        </a>
+                                                                               
</div>
+                                                                       
</xsl:when>
+                                                                       
<xsl:when test="status = 'control_accomplished_with_errors'">
+                                                                               
<div style="position:relative;">
+                                                                               
<div id="info_box" style="position:absolute;display:none;"></div>
+                                                                               
        <a class="view_check_list">
+                                                                               
                <xsl:attribute name="href">
+                                                                               
                        
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.edit_check_list_for_location</xsl:text>
+                                                                               
                        <xsl:text>&amp;check_list_id=</xsl:text>
+                                                                               
                        <xsl:value-of select="info/check_list_id"/>
+                                                                               
                </xsl:attribute>
+                                                                               
                <span style="display:none">
+                                                                               
                        <xsl:text>&amp;check_list_id=</xsl:text><xsl:value-of 
select="info/check_list_id"/>
+                                                                               
                        <xsl:text>&amp;phpgw_return_as=json</xsl:text>
+                                                                               
                </span>
+                                                                               
                <img height="15" src="controller/images/status_icon_red.png" />
+                                                                               
        </a>
+                                                                               
</div>
+                                                                       
</xsl:when>
+                                                                       
<xsl:when test="status = 'control_agg_accomplished_with_errors'">
+                                                                               
<div style="background: url(controller/images/status_icon_red_empty.png) 
no-repeat 50% 50%;">
+                                                                               
<a style="color:#fff;font-weight:bold;text-decoration: none;font-size:10px;" 
class="view_check_list">
+                                                                               
                <xsl:attribute name="href">
+                                                                               
                        
<xsl:text>index.php?menuaction=controller.uicheck_list.get_check_list_info</xsl:text>
+                                                                               
                        <xsl:text>&amp;phpgw_return_as=json</xsl:text>
+                                                                               
                        <xsl:text>&amp;check_list_id=</xsl:text>
+                                                                               
                        <xsl:value-of select="info/id"/>
+                                                                               
                </xsl:attribute>
+                                                                               
                <span><xsl:value-of select="info"/></span>
+                                                                               
        </a>
+                                                                               
</div>
+                                                                       
</xsl:when>
+                                                                       
<xsl:when test="status = 'control_canceled'">
+                                                                               
<div>
+                                                                               
        <img height="12" src="controller/images/status_icon_red_cross.png" />
+                                                                               
</div>
+                                                                       
</xsl:when>
+                                                                       
<xsl:when test="status = 'control_not_accomplished'">
+                                                                               
<div>
+                                                                               
        <img height="12" src="controller/images/status_icon_red_cross.png" />
+                                                                               
</div>
+                                                                       
</xsl:when>
+                                                                       
<xsl:otherwise>
+                                                                       
<div></div>
+                                                                       
</xsl:otherwise>
+                                                               </xsl:choose>
+                                                               
                                                </xsl:for-each>
                                                </div>
                                        </li>   

Modified: branches/Version-1_0-branch/frontend/inc/class.uihelpdesk.inc.php
===================================================================
--- branches/Version-1_0-branch/frontend/inc/class.uihelpdesk.inc.php   
2011-12-23 14:09:08 UTC (rev 8430)
+++ branches/Version-1_0-branch/frontend/inc/class.uihelpdesk.inc.php   
2011-12-23 14:22:25 UTC (rev 8431)
@@ -600,10 +600,10 @@
 
                                                // Files
                                                $values['file_name'] = 
@str_replace(' ','_',$_FILES['file']['name']);
-                                               if($values['file_name'] && 
$msglog['id'])
+                                               if($values['file_name'] && 
$result['id'])
                                                {
                                                        $bofiles = 
CreateObject('property.bofiles');
-                                                       $to_file = 
$bofiles->fakebase . '/fmticket/' . $msglog['id'] . '/' . $values['file_name'];
+                                                       $to_file = 
$bofiles->fakebase . '/fmticket/' . $result['id'] . '/' . $values['file_name'];
 
                                                        
if($bofiles->vfs->file_exists(array(
                                                                'string' => 
$to_file,

Modified: branches/Version-1_0-branch/phpgwapi/inc/class.setup.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.setup.inc.php        
2011-12-23 14:09:08 UTC (rev 8430)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.setup.inc.php        
2011-12-23 14:22:25 UTC (rev 8431)
@@ -553,10 +553,21 @@
                                $this->db->query('DELETE FROM phpgw_cust_choice 
WHERE location_id IN ('. implode (',',$locations) . ')');
                                $this->db->query('DELETE FROM 
phpgw_cust_attribute WHERE location_id IN ('. implode (',',$locations). ')');
                                $this->db->query('DELETE FROM phpgw_acl  WHERE 
location_id IN ('. implode (',',$locations) . ')');
+
+                               $this->db->query('SELECT id FROM 
phpgw_config2_section WHERE location_id IN ('. implode (',',$locations) . ')');
+                               $sections = array();
+                               while ($this->db->next_record())
+                               {
+                                       $sections[] = $this->db->f('id');
+                               }
+                               $this->db->query('DELETE FROM 
phpgw_config2_value WHERE section_id IN ('. implode (',',$sections) . ')');
+                               $this->db->query('DELETE FROM 
phpgw_config2_choice WHERE section_id IN ('. implode (',',$sections) . ')');
+                               $this->db->query('DELETE FROM 
phpgw_config2_attrib WHERE section_id IN ('. implode (',',$sections) . ')');
+                               $this->db->query('DELETE FROM 
phpgw_config2_section WHERE location_id IN ('. implode (',',$locations) . ')');
                        }
 
                        $this->db->query("DELETE FROM phpgw_locations WHERE 
app_id = {$app_id}");
-
+                       $this->db->query("DELETE FROM phpgw_config WHERE 
config_app='{$appname}'",__LINE__,__FILE__);
                        //echo 'DELETING application: ' . $appname;
                        $this->db->query("DELETE FROM phpgw_applications WHERE 
app_name='{$appname}'",__LINE__,__FILE__);
                        $this->clear_session_cache();

Modified: branches/Version-1_0-branch/property/inc/class.boproject.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.boproject.inc.php    
2011-12-23 14:09:08 UTC (rev 8430)
+++ branches/Version-1_0-branch/property/inc/class.boproject.inc.php    
2011-12-23 14:22:25 UTC (rev 8431)
@@ -806,4 +806,8 @@
                        $this->so->delete($project_id);
                }
 
+               function bulk_update_status($start_date, $end_date, 
$status_filter, $status_new, $execute, $type, $user_id,$ids)
+               {
+                       return $this->so->bulk_update_status($start_date, 
$end_date, $status_filter, $status_new, $execute, $type, $user_id,$ids);
+               }
        }

Modified: branches/Version-1_0-branch/property/inc/class.botts.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.botts.inc.php        
2011-12-23 14:09:08 UTC (rev 8430)
+++ branches/Version-1_0-branch/property/inc/class.botts.inc.php        
2011-12-23 14:22:25 UTC (rev 8431)
@@ -677,6 +677,104 @@
                        return $record_history;
                }
 
+               /**
+                * Simplified method for adding tickets from external apps
+                *      $data = array
+                *      (
+                *              'origin'                        => $location_id,
+                *              'origin_id'                     => 
$location_item_id,
+                *              'location_code'         => $location_code,
+                *              'cat_id'                        => $cat_id,
+                *              'priority'                      => $priority, 
//optional (1-3)
+                *              'title'                         => $title,
+                *              'details'                       => $details,
+                *              'file_input_name'       => 'file' // default, 
optional
+                *      );
+                * 
+                */
+               function add_ticket($data)
+               {
+                       $boloc  = CreateObject('property.bolocation');
+                       $location_details = 
$boloc->read_single($data['location_code'], array('noattrib' => true));
+
+                       $location = array();
+                       $_location_arr = explode('-', $data['location_code']);
+                       $i = 1;
+                       foreach($_location_arr as $_loc)
+                       {
+                               $location["loc{$i}"] = $_loc;
+                               $i++;
+                       }
+
+                       $assignedto = 
execMethod('property.boresponsible.get_responsible', array('location' => 
$location, 'cat_id' => $data['cat_id']));
+
+                       if(!$assignedto)
+                       {
+                               $default_group = 
(int)$this->config->config_data['tts_default_group'];
+                       }
+                       else
+                       {
+                               $default_group = 0;
+                       }
+
+                       $default_priority = 
isset($this->config->config_data['prioritylevels']) && 
$this->config->config_data['prioritylevels'] ? 
$this->config->config_data['prioritylevels'] : 3;
+
+                       $ticket = array
+                       (
+                               'origin'    => isset($data['origin']) ? 
$data['origin'] : null,
+                               'origin_id' => isset($data['origin_id']) ? 
$data['origin_id'] : null,
+                               'cat_id'    => $data['cat_id'],
+                               'group_id'  => isset($data['group_id']) && 
$data['group_id'] ? $data['group_id']: $default_group,
+                               'assignedto'=> $assignedto,
+                               'priority'  => isset($data['priority']) && 
$data['priority'] ? $data['priority'] : $default_priority,
+                               'status'    => 'O', // O = Open
+                               'subject'   => $data['title'],
+                               'details'   => $data['details'],
+                               'apply'     => true,
+                               'contact_id'=> 0,
+                               'location'  => $location,
+                               'location_code' => $data['location_code'],
+                               'street_name'   => 
$location_details['street_name'],
+                               'street_number' => 
$location_details['street_number'],
+                               'location_name' => 
$location_details['loc1_name'],
+                       );
+
+                       $result = $this->add($ticket);
+
+                       // Files
+                       $file_input_name = isset($data['file_input_name']) && 
$data['file_input_name'] ? $data['file_input_name'] : 'file';
+                       
+                       $file_name = @str_replace(' 
','_',$_FILES[$file_input_name]['name']);
+                       if($file_name && $result['id'])
+                       {
+                               $bofiles = CreateObject('property.bofiles');
+                               $to_file = 
"{$bofiles->fakebase}/fmticket/{$result['id']}/{$file_name}";
+
+                               if($bofiles->vfs->file_exists(array(
+                                       'string' => $to_file,
+                                       'relatives' => array(RELATIVE_NONE)
+                               )))
+                               {
+                                       $msglog['error'][] = 
array('msg'=>lang('This file already exists !'));
+                               }
+                               else
+                               {
+                                       
$bofiles->create_document_dir("fmticket/{$result['id']}");
+                                       $bofiles->vfs->override_acl = 1;
+
+                                       if(!$bofiles->vfs->cp(array (
+                                       'from'  => 
$_FILES[$file_input_name]['tmp_name'],
+                                       'to'    => $to_file,
+                                       'relatives'     => array 
(RELATIVE_NONE|VFS_REAL, RELATIVE_ALL))))
+                                       {
+                                               $msglog['error'][] = 
array('msg' => lang('Failed to upload file!'));
+                                       }
+                                       $bofiles->vfs->override_acl = 0;
+                               }
+                       }
+                       return (int)$result['id'];      
+               }
+
                function add($ticket)
                {
                        if((!isset($ticket['location_code']) || ! 
$ticket['location_code']) && isset($ticket['location']) && 
is_array($ticket['location']))

Modified: branches/Version-1_0-branch/property/inc/class.menu.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.menu.inc.php 2011-12-23 
14:09:08 UTC (rev 8430)
+++ branches/Version-1_0-branch/property/inc/class.menu.inc.php 2011-12-23 
14:22:25 UTC (rev 8431)
@@ -735,6 +735,11 @@
                                                                'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitemplate.index')),
                                                                'text'  => 
lang('template'),
                                                                'image'         
=> array('property', 'project_template')
+                                                       ),
+                                                       
'project_bulk_update_status'    => array
+                                                       (
+                                                               'text'  => 
lang('project bulk update status'),
+                                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiproject.bulk_update_status') )
                                                        )
                                                )
                                        );

Modified: branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php    
2011-12-23 14:09:08 UTC (rev 8430)
+++ branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php    
2011-12-23 14:22:25 UTC (rev 8431)
@@ -185,7 +185,7 @@
                                $querymethod = " $where ( spvend_code = 
{$query} OR bilagsnr = {$query})";
                        }
 
-                       $sql = "SELECT bilagsnr, count(bilagsnr) as 
invoice_count, sum(belop) as belop,spvend_code,fakturadato FROM  $table 
$join_tables $filtermethod $querymethod GROUP BY periode, 
bilagsnr,spvend_code,fakturadato,oppsynsigndato,saksigndato,budsjettsigndato";
+                       $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";
                        $sql2 = "SELECT DISTINCT bilagsnr FROM  $table 
$join_tables $filtermethod $querymethod";
 
                        $this->db->query($sql2,__LINE__,__FILE__);
@@ -212,8 +212,9 @@
                                $temp[] = array
                                        (
                                                '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')
                                        );
                        }
 
@@ -280,6 +281,7 @@
                                        $invoice[$i]['counter']                 
                = $i;
                                        $invoice[$i]['current_user']            
        = $GLOBALS['phpgw_info']['user']['account_lid'];
                                        $invoice[$i]['voucher_id']              
                = $voucher_id;
+                                       $invoice[$i]['voucher_out_id']          
        = $invoice_temp['voucher_out_id'];
                                        $invoice[$i]['invoice_count']           
        = $invoice_temp['invoice_count'];
                                        $invoice[$i]['vendor_id']               
                = $this->db->f('spvend_code');
                                        $invoice[$i]['vendor']                  
                = $this->db->f('org_name');
@@ -406,6 +408,7 @@
                                                'status'                        
        => $this->db->f('status'),
                                                'closed'                        
        => $this->db->f('status') == $closed,
                                                'voucher_id'                    
=> $this->db->f('bilagsnr'),
+                                               'voucher_out_id'                
=> $this->db->f('bilagsnr_ut'),
                                                'id'                            
        => $this->db->f('id'),
                                                'invoice_id'                    
=> $this->db->f('fakturanr'),
                                                'budget_account'                
=> $this->db->f('spbudact_code'),

Modified: branches/Version-1_0-branch/property/inc/class.soproject.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soproject.inc.php    
2011-12-23 14:09:08 UTC (rev 8430)
+++ branches/Version-1_0-branch/property/inc/class.soproject.inc.php    
2011-12-23 14:22:25 UTC (rev 8431)
@@ -1266,21 +1266,204 @@
                                $this->db->query("UPDATE fm_request set 
project_id = NULL where id='{$request_id}'",__LINE__,__FILE__);
                        }
 
-                       $this->db->query("DELETE FROM fm_project WHERE id='" . 
$project_id . "'",__LINE__,__FILE__);
+                       $this->db->query("DELETE FROM fm_project WHERE 
id='{$project_id}'",__LINE__,__FILE__);
                        $this->db->query("DELETE FROM fm_project_history  WHERE 
 history_record_id='" . $project_id   . "'",__LINE__,__FILE__);
                        $this->db->query("DELETE FROM fm_projectbranch  WHERE  
project_id='" . $project_id   . "'",__LINE__,__FILE__);
 //                     $this->db->query("DELETE FROM fm_origin WHERE 
destination ='project' AND destination_id ='" . $project_id . 
"'",__LINE__,__FILE__);
                        $this->interlink->delete_at_origin('property', 
'.project.request', '.project', $project_id, $this->db);
                        $this->interlink->delete_at_target('property', 
'.project', $project_id, $this->db);
 
-                       $this->db->query("DELETE FROM fm_workorder WHERE 
project_id='" . $project_id . "'",__LINE__,__FILE__);
+                       $this->db->query("DELETE FROM fm_workorder WHERE 
project_id='{$project_id}'",__LINE__,__FILE__);
 
                        for ($i=0;$i<count($workorder_id);$i++)
                        {
-                               $this->db->query("DELETE FROM fm_wo_hours WHERE 
workorder_id='" . $workorder_id[$i] . "'",__LINE__,__FILE__);
-                               $this->db->query("DELETE FROM 
fm_workorder_history  WHERE  history_record_id='" . $workorder_id[$i]   . 
"'",__LINE__,__FILE__);
+                               $this->db->query("DELETE FROM fm_wo_hours WHERE 
workorder_id='{$workorder_id[$i]}'",__LINE__,__FILE__);
+                               $this->db->query("DELETE FROM 
fm_workorder_history  WHERE  
history_record_id='{$workorder_id[$i]}'",__LINE__,__FILE__);
                        }
 
                        $this->db->transaction_commit();
                }
+
+
+               function bulk_update_status($start_date, $end_date, 
$status_filter, $status_new, $execute, $type, $user_id = 0,$ids)
+               {
+                       $start_date = $start_date ? 
phpgwapi_datetime::date_to_timestamp($start_date) : time();
+                       $end_date = $end_date ? 
phpgwapi_datetime::date_to_timestamp($end_date) : time();
+
+                       $filter = '';
+                       if($user_id)
+                       {
+                               $user_id = (int) $user_id;
+                               $filter = "AND fm_{$type}.user_id = $user_id";
+                       }
+
+                       if($status_filter)
+                       {
+                               $user_id = (int) $user_id;
+                               $filter .= "AND fm_{$type}.status = 
'{$status_filter}'";
+                       }
+
+                       switch($type)
+                       {
+                               case 'project':
+                                       $table = 'fm_project';
+                                       $status_table = 'fm_project_status';
+                                       $title_field = 'fm_project.name as 
title';
+                                       $this->_update_status_project($execute, 
$status_new, $ids);
+                                       $sql = "SELECT DISTINCT {$table}.id, 
$status_table.descr as status ,{$title_field},{$table}.start_date, 
count(project_id) as num_open FROM {$table}"
+                                       . " {$this->join} {$status_table} ON  
{$table}.status = {$status_table}.id "
+                                       . " {$this->left_join} fm_workorder ON 
{$table}.id = fm_workorder.project_id "
+                                       . " {$this->join} fm_workorder_status 
ON  fm_workorder.status = fm_workorder_status.id "
+                                       . " WHERE ({$table}.start_date > 
{$start_date} AND {$table}.start_date < {$end_date} {$filter}) AND 
fm_workorder_status.delivered IS NULL AND fm_workorder_status.closed IS NULL"
+                                       . " GROUP BY {$table}.id, 
$status_table.descr ,{$table}.name, {$table}.start_date"
+                                       . " ORDER BY {$table}.id DESC";
+
+                                       break;
+                               case 'workorder':
+                                       $table = 'fm_workorder';
+                                       $status_table = 'fm_workorder_status';
+                                       $title_field = 'fm_workorder.title';
+                                       $actual_cost = ',(act_mtrl_cost + 
act_vendor_cost) as actual_cost';
+                                       
$this->_update_status_workorder($execute, $status_new, $ids);
+                                       $sql = "SELECT {$table}.id, 
$status_table.descr as status ,{$title_field},start_date {$actual_cost} FROM 
{$table}"
+                                       . " {$this->join} {$status_table} ON  
{$table}.status = {$status_table}.id  WHERE (start_date > {$start_date} AND 
start_date < {$end_date} {$filter}) OR start_date is NULL"
+                                       . " ORDER BY {$table}.id DESC";
+                                       break;
+                               default:
+                                       return array();
+                       }
+
+                       $this->db->query($sql,__LINE__,__FILE__);
+                       $values = array();
+                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+
+                       while ($this->db->next_record())
+                       {
+                               $values[] = array
+                               (
+                                       'id'                    => 
$this->db->f('id'),
+                                       'title'                 => 
$this->db->f('title',true),
+                                       'status'                => 
$this->db->f('status',true),
+                                       'actual_cost'   => 
$this->db->f('actual_cost'),
+                                       'start_date'    => 
$GLOBALS['phpgw']->common->show_date($this->db->f('start_date'),$dateformat),
+                                       'num_open'              => 
(int)$this->db->f('num_open'),
+                               );
+                       }
+
+                       return $values;
+
+
+               }
+
+               protected function _update_status_project($execute, 
$status_new, $ids)
+               {
+                       if(!$execute || !$status_new)
+                       {
+                               return;
+                       }
+                       $historylog     = 
CreateObject('property.historylog','project');
+
+
+                       $this->db->transaction_begin();
+                       foreach ($ids as $id)
+                       {
+                               $this->db->query("SELECT status, vendor_id FROM 
fm_project WHERE id = '{$id}'",__LINE__,__FILE__);
+                               $this->db->next_record();
+                               $old_status     = $this->db->f('status');
+
+                               if ($old_status != $status_new)
+                               {
+                                       $this->db->query("UPDATE fm_project SET 
status = '{$status_new}' WHERE id = '{$id}'",__LINE__,__FILE__);
+                                       $historylog->add('S', $id, $status_new, 
$old_status);
+                               }
+
+                               $action_params_approved = array
+                                       (
+                                               'appname'                       
=> 'property',
+                                               'location'                      
=> '.project',
+                                               'id'                            
=> $id,
+                                               'responsible'           => 
$this->account,
+                                               'responsible_type'  => 'user',
+                                               'action'                        
=> 'approval',
+                                               'remark'                        
=> '',
+                                               'deadline'                      
=> ''
+                                       );
+       
+                               $this->db->query("SELECT * FROM 
fm_project_status WHERE id = '{$status_new}'");
+                               $this->db->next_record();
+                               if ($this->db->f('approved') || 
$this->db->f('closed'))
+                               {
+                                       
execMethod('property.sopending_action.close_pending_action', 
$action_params_approved);
+                               }
+                       }
+
+                       $this->db->transaction_commit();
+
+               }
+
+               protected function _update_status_workorder($execute, 
$status_new, $ids)
+               {
+                       if(!$execute || !$status_new)
+                       {
+                               return;
+                       }
+                       $historylog     = 
CreateObject('property.historylog','workorder');
+
+                       $this->db->transaction_begin();
+                       foreach ($ids as $id)
+                       {
+                               $this->db->query("SELECT status, vendor_id FROM 
fm_workorder WHERE id = '{$id}'",__LINE__,__FILE__);
+                               $this->db->next_record();
+                               $old_status     = $this->db->f('status');
+                               $vendor_id      = $this->db->f('vendor_id');
+
+                               if ($old_status != $status_new)
+                               {
+                                       $this->db->query("UPDATE fm_workorder 
SET status = '{$status_new}' WHERE id = '{$id}'",__LINE__,__FILE__);
+                                       $historylog->add('S', $id, $status_new, 
$old_status);
+                               }
+
+                               $action_params_approved = array
+                                       (
+                                               'appname'                       
=> 'property',
+                                               'location'                      
=> '.project.workorder',
+                                               'id'                            
=> $id,
+                                               'responsible'           => 
$this->account,
+                                               'responsible_type'  => 'user',
+                                               'action'                        
=> 'approval',
+                                               'remark'                        
=> '',
+                                               'deadline'                      
=> ''
+                                       );
+
+                               $action_params_progress = array
+                                       (
+                                               'appname'                       
=> 'property',
+                                               'location'                      
=> '.project.workorder',
+                                               'id'                            
=> $id,
+                                               'responsible'           => 
$vendor_id,
+                                               'responsible_type'  => 'vendor',
+                                               'action'                        
=> 'remind',
+                                               'remark'                        
=> '',
+                                               'deadline'                      
=> ''
+                                       );
+
+                               $this->db->query("SELECT * FROM 
fm_workorder_status WHERE id = '{$status_new}'");
+                               $this->db->next_record();
+                               if ($this->db->f('approved') )
+                               {
+                                       
execMethod('property.sopending_action.close_pending_action', 
$action_params_approved);
+                               }
+                               if ($this->db->f('in_progress') )
+                               {
+                                       
execMethod('property.sopending_action.close_pending_action', 
$action_params_progress);
+                               }
+                               if ($this->db->f('delivered') || 
$this->db->f('closed'))
+                               {
+                                       
execMethod('property.sopending_action.close_pending_action', 
$action_params_approved);
+                                       
execMethod('property.sopending_action.close_pending_action', 
$action_params_progress);
+                               }
+                       }
+
+                       $this->db->transaction_commit();
+               }
        }

Modified: branches/Version-1_0-branch/property/inc/class.soworkorder.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soworkorder.inc.php  
2011-12-23 14:09:08 UTC (rev 8430)
+++ branches/Version-1_0-branch/property/inc/class.soworkorder.inc.php  
2011-12-23 14:22:25 UTC (rev 8431)
@@ -1161,7 +1161,7 @@
                                        unset($action_params);
 
                                }
-                               if ($this->db->f('delivered') )
+                               if ($this->db->f('delivered') || 
$this->db->f('closed'))
                                {
                                        //close
                                }

Modified: branches/Version-1_0-branch/property/inc/class.uiinvoice.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uiinvoice.inc.php    
2011-12-23 14:09:08 UTC (rev 8430)
+++ branches/Version-1_0-branch/property/inc/class.uiinvoice.inc.php    
2011-12-23 14:22:25 UTC (rev 8431)
@@ -1324,7 +1324,15 @@
                                                //-- links a otros modulos
                                                if($column['format']== "link")
                                                {
-                                                       
$json_row[$column['name']] = "<a target='".$column['target']."' 
href='".$column['link']."' >".$column['value']."</a>";
+                                                       if($column['name'] == 
'voucher_id_lnk')
+                                                       {
+                                                               $_value = 
isset($content[$k]['voucher_out_id']) && $content[$k]['voucher_out_id'] ? 
$content[$k]['voucher_out_id'] : $column['value'];
+                                                               
$json_row[$column['name']] = "<a target='".$column['target']."' 
href='".$column['link']."' >".$_value."</a>";
+                                                       }
+                                                       else
+                                                       {
+                                                               
$json_row[$column['name']] = "<a target='".$column['target']."' 
href='".$column['link']."' >".$column['value']."</a>";                          
                        
+                                                       }
                                                }
                                                else if($column['format']== 
"input")
                                                {
@@ -1634,7 +1642,7 @@
                                array(
                                        'col_name'=>'Remark',                   
'label'=>lang('Remark'),                'className'=>'centerClasss', 
'sortable'=>false, 'sort_field'=>'',                               
'visible'=>true),
                                array(
-                                       'col_name'=>'external_ref'              
,'label'=>lang('external_ref'), 'className'=>'centerClasss', 'sortable'=>false, 
'sort_field'=>'',                       'visible'=>true),
+                                       'col_name'=>'external_ref'              
,'label'=>lang('external ref'), 'className'=>'centerClasss', 'sortable'=>false, 
'sort_field'=>'',                       'visible'=>true),
                                array(
                                        'col_name'=>'counter',          
'visible'=>false),
                                array(
@@ -1642,9 +1650,10 @@
                                );
 
 
-                       $config         = 
CreateObject('phpgwapi.config','property');
-                       $config->read();
-                       $baseurl_invoice = 
isset($config->config_data['baseurl_invoice']) && 
$config->config_data['baseurl_invoice'] ? 
$config->config_data['baseurl_invoice'] : '';
+       //              $config         = 
CreateObject('phpgwapi.config','property');
+       //              $config->read();
+                       $custom_config  = 
CreateObject('admin.soconfig',$GLOBALS['phpgw']->locations->get_id('property', 
'.invoice'));
+                       $baseurl_invoice = 
isset($custom_config->config_data['common']['baseurl_invoice']) && 
$custom_config->config_data['common']['baseurl_invoice'] ? 
$custom_config->config_data['common']['baseurl_invoice'] : '';
                        $lang_picture = lang('picture');
 
                        $j=0;
@@ -1907,7 +1916,7 @@
                                }
                                if($i==1)
                                {
-                                       $current_Consult[] = 
array(lang('Voucher Id'),$content[0]['voucher_id']);
+                                       $current_Consult[] = 
array(lang('Voucher Id'),$content[0]['voucher_out_id'] ? 
$content[0]['voucher_out_id'] : $content[0]['voucher_id']);
                                }
                        }
 

Modified: branches/Version-1_0-branch/property/inc/class.uiproject.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uiproject.inc.php    
2011-12-23 14:09:08 UTC (rev 8430)
+++ branches/Version-1_0-branch/property/inc/class.uiproject.inc.php    
2011-12-23 14:22:25 UTC (rev 8431)
@@ -51,14 +51,14 @@
 
                var $public_functions = array
                        (
-                               'download'              => true,
-                               'index'                 => true,
-                               'view'                  => true,
-                               'edit'                  => true,
-                               'delete'                => true,
-                               'date_search'   => true,
-                               'columns'               => true,
-                               'update_data'   => true,
+                               'download'                              => true,
+                               'index'                                 => true,
+                               'view'                                  => true,
+                               'edit'                                  => true,
+                               'delete'                                => true,
+                               'date_search'                   => true,
+                               'columns'                               => true,
+                               'bulk_update_status'    => true
                        );
 
                function property_uiproject()
@@ -1646,6 +1646,7 @@
                                $content_invoice[] = array
                                (
                                        'voucher_id'                    => 
$entry['transfer_time'] ? -1*$entry['voucher_id'] : $entry['voucher_id'],
+                                       'voucher_out_id'                => 
$entry['voucher_out_id'],
                                        'workorder_id'                  => 
$entry['workorder_id'],
                                        'status'                                
=> $entry['status'],
                                        'invoice_id'                    => 
$entry['invoice_id'],                                        
@@ -1680,6 +1681,7 @@
                                        'name'          => "2",
                                        'values'        =>      
json_encode(array(      array('key' => 
'workorder_id','label'=>lang('Workorder'),'sortable'=>true,'resizeable'=>true),
                                                                                
                                array('key' => 
'voucher_id','label'=>lang('bilagsnr'),'sortable'=>false,'resizeable'=>true,'formatter'=>'YAHOO.widget.DataTable.formatLink_voucher'),
+                                                                               
                                array('key' => 'voucher_out_id','hidden'=>true),
                                                                                
                                array('key' => 
'invoice_id','label'=>lang('invoice 
number'),'sortable'=>false,'resizeable'=>true),
                                                                                
                                array('key' => 
'vendor','label'=>lang('vendor'),'sortable'=>false,'resizeable'=>true),
                                                                                
                                array('key' => 
'amount','label'=>lang('amount'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterRight'),
@@ -1890,8 +1892,8 @@
                        phpgwapi_yui::load_widget('paginator');
                        phpgwapi_yui::load_widget('animation');
 
-                       $template_vars = array();
-                       $template_vars['datatable'] = $datatable;
+//                     $template_vars = array();
+//                     $template_vars['datatable'] = $datatable;
 
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
 
@@ -1948,9 +1950,183 @@
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-                       //      $GLOBALS['phpgw']->xslttpl->pp();
                }
 
+
+               function bulk_update_status()
+               {
+                       if(!$this->acl->check('.project', PHPGW_ACL_PRIVATE, 
'property'))//manage
+                       {
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>PHPGW_ACL_PRIVATE, 
'acl_location'=>$this->acl_location));
+                       }
+
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::project_bulk_update_status';
+
+                       $start_date     = phpgw::get_var('start_date');
+                       $end_date               = phpgw::get_var('end_date');
+                       $get_list               = phpgw::get_var('get_list', 
'bool', 'POST');
+                       $execute                = phpgw::get_var('execute', 
'bool', 'POST');
+                       $status_filter  = phpgw::get_var('status_filter');
+                       $status_new     = phpgw::get_var('status_new');
+                       $type                   = phpgw::get_var('type');
+                       $user_id                = phpgw::get_var('user_id', 
'int');
+                       $id_to_update   = phpgw::get_var('id_to_update');
+                       
+                       if($id_to_update)
+                       {
+                               $ids = 
array_values(explode(',',trim($id_to_update,',')));
+                       }
+                       else
+                       {
+                               $ids = array();
+                       }
+
+                       $link_data = array
+                       (
+                               'menuaction' => 'property.uiproject.index'
+                       );
+
+                       $jscal = CreateObject('phpgwapi.jscalendar');
+                       $jscal->add_listener('values_start_date');
+                       $jscal->add_listener('values_end_date');
+
+
+                       if(($execute || $get_list) && $type)
+                       {
+                               $list = 
$this->bo->bulk_update_status($start_date, $end_date, $status_filter, 
$status_new, $execute, $type, $user_id,$ids);
+                       }
+
+                       $total_records  = count($list);
+                       $datavalues[0] = array
+                       (
+                               'name'                                  => "0",
+                               'values'                                => 
json_encode($list),
+                               'total_records'                 => 
$total_records,
+                               'edit_action'                   => 
json_encode($GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
"property.ui{$type}.edit"))),
+                               'permission'                    => "''",
+                               'is_paginator'                  => 0,
+                               'footer'                                => 1
+                       );
+
+                       switch($type)
+                       {
+                               case 'project':
+                                       $_key = 'num_open';
+                                       $_label = lang('open');
+                                       break;
+                               case 'workorder':
+                                       $_key = 'actual_cost';
+                                       $_label = lang('actual cost');
+                                       break;
+                               default:
+                                       $_key = 'num_open';
+                                       $_label = lang('open');
+                       }
+
+                       $myColumnDefs[0] = array
+                               (
+                                       'name'          => "0",
+                                       'values'        =>      
json_encode(array(      array('key' => 
'id','label'=>lang('id'),'sortable'=>true,'resizeable'=>true,'formatter'=>'YAHOO.widget.DataTable.formatLink'),
+                                                                               
                                array('key' => 
'start_date','label'=>lang('date'),'sortable'=>false,'resizeable'=>true),
+                                                                               
                                array('key' => 
'title','label'=>lang('title'),'sortable'=>true,'resizeable'=>true),
+                                                                               
                                array('key' => 
'status','label'=>lang('status'),'sortable'=>true,'resizeable'=>true),
+                                                                               
                                array('key' => 
$_key,'label'=>$_label,'sortable'=>true,'resizeable'=>true 
,'formatter'=>'FormatterRight'),
+                                                                               
                                array('key' => 'select','label'=> 
lang('select'), 
'sortable'=>false,'resizeable'=>false,'formatter'=>'myFormatterCheck','width'=>30)
+                                                                               
                                ))
+                               );
+
+                       $user_list      = 
$this->bocommon->get_user_list('select',$user_id,$extra=false,$default=false,$start=-1,$sort='ASC',$order='account_lastname',$query='',$offset=-1);
+                       foreach ($user_list as &$entry)
+                       {
+                               $entry['id'] = $entry['user_id'];
+                       }
+                       unset($entry);
+
+                       switch($type)
+                       {
+                               case 'project':
+                                       $status_list_filter = 
execMethod('property.bogeneric.get_list', array('type' => 'project_status',     
  'selected' => $status_filter));
+                                       $status_list_new = 
execMethod('property.bogeneric.get_list', array('type' => 'project_status',  
'selected' => $status_new));
+                                       break;
+                               case 'workorder':
+                                       $status_list_filter = 
execMethod('property.bogeneric.get_list', array('type' => 'workorder_status',   
  'selected' => $status_filter));
+                                       $status_list_new = 
execMethod('property.bogeneric.get_list', array('type' => 'workorder_status',   
     'selected' => $status_new));
+                                       break;
+                               default:
+                                       $status_list_filter = array();
+                       }
+
+                       $type_array = array
+                       (
+                               array
+                               (
+                                       'id' => '0',
+                                       'name'  => lang('select')
+                               ),
+                               array
+                               (
+                                       'id' => 'project',
+                                       'name'  => lang('project')
+                               ),
+                               array
+                               (
+                                       'id' => 'workorder',
+                                       'name'  => lang('workorder')
+                               )
+                       );
+
+                       foreach ($type_array as &$entry)
+                       {
+                               $entry['selected'] = $entry['id'] == $type ? 1 
: 0;
+                       }
+
+                       $data = array
+                       (
+                               'property_js'                   => 
json_encode($GLOBALS['phpgw_info']['server']['webserver_url']."/property/js/yahoo/property2.js"),
+                               'datatable'                             => 
$datavalues,
+                               'myColumnDefs'                  => 
$myColumnDefs,
+                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'update_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiproject.bulk_update_status')),
+                               'img_cal'                               => 
$GLOBALS['phpgw']->common->image('phpgwapi','cal'),
+                               'status_list_filter'    => array('options' => 
$status_list_filter),
+                               'status_list_new'               => 
array('options' => $status_list_new),
+                               'type_list'                             => 
array('options' => $type_array),
+                               'user_list'                             => 
array('options' => $user_list),
+                               'start_date'                    => $start_date,
+                               'end_date'                              => 
$end_date,
+                               'total_records'                 => 
$total_records
+                       );
+
+
+                       $appname                        = lang('project');
+                       $function_msg           = lang('bulk update status');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
+
+                       phpgwapi_yui::load_widget('dragdrop');
+                       phpgwapi_yui::load_widget('datatable');
+                       phpgwapi_yui::load_widget('menu');
+                       phpgwapi_yui::load_widget('connection');
+                       phpgwapi_yui::load_widget('loader');
+                       phpgwapi_yui::load_widget('tabview');
+                       phpgwapi_yui::load_widget('paginator');
+                       phpgwapi_yui::load_widget('animation');
+
+                       $GLOBALS['phpgw']->css->validate_file('datatable');
+                       $GLOBALS['phpgw']->css->validate_file('property');
+                       
$GLOBALS['phpgw']->css->add_external_file('property/templates/base/css/property.css');
+                       
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/datatable/assets/skins/sam/datatable.css');
+                       
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/paginator/assets/skins/sam/paginator.css');
+                       
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/container/assets/skins/sam/container.css');
+
+                       $GLOBALS['phpgw']->js->validate_file( 'yahoo', 
'project.bulk_update_status', 'property' );
+
+
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('project'));
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('bulk_update_status' => 
$data));
+               }
+
+
                function view()
                {
                        if(!$this->acl_read)

Modified: branches/Version-1_0-branch/property/inc/class.uiworkorder.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uiworkorder.inc.php  
2011-12-23 14:09:08 UTC (rev 8430)
+++ branches/Version-1_0-branch/property/inc/class.uiworkorder.inc.php  
2011-12-23 14:22:25 UTC (rev 8431)
@@ -1519,6 +1519,7 @@
                                $content_invoice[] = array
                                (
                                        'voucher_id'                    => 
$entry['transfer_time'] ? -1*$entry['voucher_id'] : $entry['voucher_id'],
+                                       'voucher_out_id'                => 
$entry['voucher_out_id'],
                                        'status'                                
=> $entry['status'],
                                        'invoice_id'                    => 
$entry['invoice_id'],                                        
                                        'budget_account'                => 
$entry['budget_account'],
@@ -1552,6 +1553,7 @@
                                (
                                        'name'          => "2",
                                        'values'        =>      
json_encode(array(      array('key' => 
'voucher_id','label'=>lang('bilagsnr'),'sortable'=>false,'resizeable'=>true,'formatter'=>'YAHOO.widget.DataTable.formatLink'),
+                                                                               
                                array('key' => 'voucher_out_id','hidden'=>true),
                                                                                
                                array('key' => 
'invoice_id','label'=>lang('invoice 
number'),'sortable'=>false,'resizeable'=>true),
                                                                                
                                array('key' => 
'vendor','label'=>lang('vendor'),'sortable'=>false,'resizeable'=>true),
                                                                                
                                array('key' => 
'amount','label'=>lang('amount'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterRight'),

Modified: 
branches/Version-1_0-branch/property/inc/cron/default/Import_fra_basware_X205.php
===================================================================
--- 
branches/Version-1_0-branch/property/inc/cron/default/Import_fra_basware_X205.php
   2011-12-23 14:09:08 UTC (rev 8430)
+++ 
branches/Version-1_0-branch/property/inc/cron/default/Import_fra_basware_X205.php
   2011-12-23 14:22:25 UTC (rev 8431)
@@ -61,8 +61,7 @@
                        $this->like                             = & 
$this->db->like;
                        $this->dateformat               = 
$this->db->date_format();
                        $this->datetimeformat   = $this->db->datetime_format();
-                       $this->config   = 
CreateObject('phpgwapi.config','property');
-                       $this->config->read();
+                       $this->config   = 
CreateObject('admin.soconfig',$GLOBALS['phpgw']->locations->get_id('property', 
'.invoice'));
                }
 
                function pre_run($data = array())
@@ -145,7 +144,7 @@
                public function execute($cron='')
                {
                        $this->get_files();
-                       $dirname = $this->config->config_data['import_path'];
+                       $dirname = 
$this->config->config_data['import']['local_path'];
                        // prevent path traversal
                        if ( preg_match('/\./', $dirname) 
                         || !is_dir($dirname) )
@@ -222,11 +221,11 @@
 
                protected function get_files()
                {
-                       $server                         = 
$this->config->config_data['invoice_ftp_host'];
-                       $user                           = 
$this->config->config_data['invoice_ftp_user'];
-                       $password                       = 
$this->config->config_data['invoice_ftp_password'];
-                       $directory_remote       = 
rtrim($this->config->config_data['invoice_ftp_import_basedir'],'/');
-                       $directory_local        = 
rtrim($this->config->config_data['import_path'],'/');
+                       $server                         = 
$this->config->config_data['common']['host'];
+                       $user                           = 
$this->config->config_data['common']['user'];
+                       $password                       = 
$this->config->config_data['common']['password'];
+                       $directory_remote       = 
rtrim($this->config->config_data['common']['remote_basedir'],'/');
+                       $directory_local        = 
rtrim($this->config->config_data['import']['local_path'],'/');
                        $port                           = 22;
 
                        if (!function_exists("ssh2_connect"))
@@ -526,7 +525,7 @@
                        //FIXME - this should be configurable
                        if(!$order_info['budget_responsible'])
                        {
-                               $order_info['budget_responsible'] = 'karhal';
+                               $order_info['budget_responsible'] = 
isset($this->config->config_data['import']['budget_responsible']) && 
$this->config->config_data['import']['budget_responsible'] ? 
$this->config->config_data['import']['budget_responsible'] : 'karhal';
                        }
 
                        return $order_info;

Modified: branches/Version-1_0-branch/property/inc/export/default/Agresso
===================================================================
--- branches/Version-1_0-branch/property/inc/export/default/Agresso     
2011-12-23 14:09:08 UTC (rev 8430)
+++ branches/Version-1_0-branch/property/inc/export/default/Agresso     
2011-12-23 14:22:25 UTC (rev 8431)
@@ -43,12 +43,11 @@
                {
                        $GLOBALS['phpgw_info']['flags']['currentapp']   =       
'property';
                        $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
-       //              $this->db                       = $GLOBALS['phpgw']->db;
+       //              $this->db                               = 
$GLOBALS['phpgw']->db;
 
-                       $this->soXport = CreateObject('property.soXport');      
-                       $this->config = 
CreateObject('phpgwapi.config','property');
-                       $this->config->read_repository();
-                       $this->bocommon                 = 
CreateObject($this->currentapp.'.bocommon');
+                       $this->soXport                  = 
CreateObject('property.soXport');     
+                       $this->config                   = 
CreateObject('admin.soconfig',$GLOBALS['phpgw']->locations->get_id('property', 
'.invoice'));
+                       $this->bocommon                 = 
CreateObject('property.bocommon');
                        $this->db               = $this->bocommon->new_db();    
                
                }
 
@@ -438,7 +437,7 @@
                
                        if($antall > 0)
                        {               
-                               $fil_katalog = 
$this->config->config_data['export_path'];                       
+                               $fil_katalog = 
$this->config->config_data['export']['path'];                    
                        
                                if(unlink ($fil_katalog. '/' . $Filnavn))
                                {
@@ -464,7 +463,7 @@
                {       
                        if($pre_transfer)
                        {
-                               $fil_katalog = 
$this->config->config_data['export_pre_path'];
+                               $fil_katalog = 
$this->config->config_data['export']['pre_path'];
                        
                                // Slett gamle filer
 
@@ -497,7 +496,7 @@
                        }
                        else
                        {
-                               $fil_katalog = 
$this->config->config_data['export_path'];
+                               $fil_katalog = 
$this->config->config_data['export']['path'];
                                $continue = True;
                                $i = 1;
                                do
@@ -893,7 +892,7 @@
                                        $file_written=True;
                                }
 
-                               if($file_written && 
$this->config->config_data['invoice_export_method']!='ftp'):
+                               if($file_written && 
$this->config->config_data['common']['method']!='ftp'):
                                {
                                        $transfer_ok = True;
                                }
@@ -925,7 +924,7 @@
                                        $file_written=True;
                                }
                                
-                               if($file_written && 
$this->config->config_data['invoice_export_method']!='ftp'):
+                               if($file_written && 
$this->config->config_data['common']['method']!='ftp'):
                                {
                                        $transfer_ok = True;
                                }
@@ -960,11 +959,11 @@
                function transfer($buffer,$Filnavn,$batchid,$tranfser_bilag)
                {                       
 
-                       
if($this->config->config_data['invoice_export_method']=='ftp')
+                       
if($this->config->config_data['common']['method']=='ftp')
                        {
                                $ftp    = $this->phpftp_connect();      
                                
-                               $basedir = 
$this->config->config_data['invoice_ftp_basedir'];
+                               $basedir = 
$this->config->config_data['common']['remote_basedir'];
                                if($basedir)
                                {
                                        $newfile = $basedir . '/' . 
basename($Filnavn);
@@ -1002,15 +1001,15 @@
 
                function phpftp_connect() 
                {
-                       $host = $this->config->config_data['invoice_ftp_host'];
-                       $user = $this->config->config_data['invoice_ftp_user'];
-                       $pass = 
$this->config->config_data['invoice_ftp_password'];
+                       $host                           = 
$this->config->config_data['common']['host'];
+                       $user                           = 
$this->config->config_data['common']['user'];
+                       $password                       = 
$this->config->config_data['common']['password'];
                        
 //                     echo "connecting to $host with $user and $pass\n <br>";
                        $ftp = ftp_connect($host);
                        if($ftp) 
                        {
-                               if (ftp_login($ftp,$user,$pass)) 
+                               if (ftp_login($ftp,$user,$password)) 
                                {
                                        return $ftp;
                                }


@@ Diff output truncated at 153600 characters. @@



reply via email to

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