fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10797] Merge 10749:10796 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [10797] Merge 10749:10796 from trunk
Date: Tue, 12 Feb 2013 12:18:02 +0000

Revision: 10797
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10797
Author:   sigurdne
Date:     2013-02-12 12:18:01 +0000 (Tue, 12 Feb 2013)
Log Message:
-----------
Merge 10749:10796 from trunk

Modified Paths:
--------------
    branches/Version-1_0-branch/admin/templates/base/form_button_script.tpl
    branches/Version-1_0-branch/bim/setup/setup.inc.php
    branches/Version-1_0-branch/bim/setup/tables_current.inc.php
    branches/Version-1_0-branch/bim/setup/tables_update.inc.php
    branches/Version-1_0-branch/calendar/inc/class.bocalendar.inc.php
    branches/Version-1_0-branch/catch/setup/setup.inc.php
    branches/Version-1_0-branch/catch/setup/tables_current.inc.php
    branches/Version-1_0-branch/catch/setup/tables_update.inc.php
    branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php
    branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
    branches/Version-1_0-branch/controller/inc/class.uicase.inc.php
    branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php
    branches/Version-1_0-branch/controller/inc/class.uicontrol_item.inc.php
    branches/Version-1_0-branch/controller/inc/class.uiprocedure.inc.php
    
branches/Version-1_0-branch/controller/inc/component/class.check_list_status_manager.inc.php
    
branches/Version-1_0-branch/controller/inc/helper/class.check_list_status_updater.inc.php
    branches/Version-1_0-branch/controller/inc/hook_home.inc.php
    branches/Version-1_0-branch/controller/inc/model/class.check_list.inc.php
    branches/Version-1_0-branch/controller/js/controller/ajax.js
    branches/Version-1_0-branch/controller/js/controller/custom_ui.js
    
branches/Version-1_0-branch/controller/templates/base/calendar/check_list_status_manager.xsl
    
branches/Version-1_0-branch/controller/templates/base/calendar/icon_color_map.xsl
    
branches/Version-1_0-branch/controller/templates/base/case/view_case_message.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/add_case.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/case_row.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/cases_tab_menu.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/check_list_tab_menu.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/edit_check_list.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/view_cases_for_check_list.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/view_closed_cases.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_details.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_info.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_items.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/view_open_cases.xsl
    branches/Version-1_0-branch/controller/templates/base/css/base.css
    
branches/Version-1_0-branch/controller/templates/base/procedure/print_procedure.xsl
    
branches/Version-1_0-branch/logistic/inc/class.sorequirement_resource_allocation.inc.php
    
branches/Version-1_0-branch/logistic/inc/class.uirequirement_resource_allocation.inc.php
    
branches/Version-1_0-branch/logistic/inc/model/class.requirement_resource_allocation.inc.php
    branches/Version-1_0-branch/logistic/setup/phpgw_no.lang
    branches/Version-1_0-branch/logistic/setup/setup.inc.php
    branches/Version-1_0-branch/logistic/setup/tables_current.inc.php
    branches/Version-1_0-branch/logistic/setup/tables_update.inc.php
    
branches/Version-1_0-branch/logistic/templates/base/allocation/book_resources.xsl
    branches/Version-1_0-branch/phpgwapi/inc/class.xslttemplates.inc.php
    branches/Version-1_0-branch/property/inc/class.soadmin_entity.inc.php
    branches/Version-1_0-branch/property/inc/class.soagreement.inc.php
    branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php
    branches/Version-1_0-branch/property/inc/class.sopricebook.inc.php
    branches/Version-1_0-branch/property/inc/class.soproject.inc.php
    branches/Version-1_0-branch/property/inc/class.sotemplate.inc.php
    branches/Version-1_0-branch/property/inc/class.sowo_hour.inc.php
    branches/Version-1_0-branch/property/inc/class.soworkorder.inc.php
    branches/Version-1_0-branch/property/inc/class.uiadmin_entity.inc.php
    branches/Version-1_0-branch/property/inc/class.uiagreement.inc.php
    branches/Version-1_0-branch/property/inc/class.uipricebook.inc.php
    branches/Version-1_0-branch/property/inc/class.uiwo_hour.inc.php
    branches/Version-1_0-branch/property/inc/class.uiworkorder.inc.php
    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/setup.inc.php
    branches/Version-1_0-branch/property/setup/tables_current.inc.php
    branches/Version-1_0-branch/property/setup/tables_update.inc.php
    branches/Version-1_0-branch/property/templates/base/admin_entity.xsl
    branches/Version-1_0-branch/property/templates/base/hour_data_view.xsl
    branches/Version-1_0-branch/property/templates/base/wo_hour.xsl
    branches/Version-1_0-branch/property/templates/base/workorder.xsl

Added Paths:
-----------
    branches/Version-1_0-branch/controller/images/status_icon_black_cross.png
    branches/Version-1_0-branch/controller/images/status_icon_black_cross.psd
    
branches/Version-1_0-branch/controller/inc/helper/class.date_converter.inc.php
    
branches/Version-1_0-branch/controller/templates/base/check_list/nav_control_plan.xsl

Removed Paths:
-------------
    branches/Version-1_0-branch/controller/inc/model/class.control_area.inc.php

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


Property changes on: branches/Version-1_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538,7540-7542,7544-7549,7551-7552,7554-7561,7563,7565,7567-7573,7575-7578,7580-7584,7586-7591,7593-7624,7627-7636,7638-7656,7658-7718,7720-7732,7734,7736,7738-7750,7754-7759,7761-7767,7769-7780,7782,7784-7809,7811-7812,7814-7835,7837-7847,7849-7887,7889-7895,7897,7899,7901,7903-7905,7907-7921,7923-7925,7927-7933,7935,7937-7952,7954-7968,7970-7974,7976,7978-7979,7981-7982,7984-7988,7990-7992,7994-8041,8043-8066,8068-8087,8089,8091-8108,8110-8124,8126-8129,8131,8133-8150,8152-8154,8156-8162,8164-8167,8169-8170,8172-8179,8181,8183-8196,8198-8207,8209-8211,8213-8214,8216-8217,8219-8220,8222,8224-8225,8227-8247,8249,8251,8253-8282,8284-8352,8354-8368,8370-8396,8398-8430,8432,8434-8440,8442-8445,8447-8453,8455-8456,8458,8460,8462-8464,8466-8473,8475-8479,8481,8483-8501,8503-8523,8525,8527-8531,8533,8535-8536,8538-8550,8552-8554,8556-8557,8559-8579,8581-8587,8589,8591-8592,8594-8595,8597-8601,8603-8610,8612-8613,8615,8617,8619-8645,8647-8650,8652-8661,8663-8666,8668-8669,8671-8683,8685-8691,8693-8730,8732-8737,8739,8741-8767,8769,8771-8772,8774,8776-8797,8799-8812,8814-8819,8821,8823-8833,8835-8837,8839,8841,8843-8849,8852-8858,8860-8867,8869-8870,8872,8874-8877,8879,8881,8883-8888,8890,8892-8901,8903-8911,8913-8917,8920-8923,8925-8933,8935-8938,8940-8943,8945,8947-8948,8950,8952-8953,8955-8962,8964,8966,8968-8970,8972-8975,8977-8983,8985-8993,8995-9001,9003,9005,9007,9009,9011-9019,9021-9023,9025,9027-9028,9030-9044,9046-9047,9049-9050,9052-9056,9058-9059,9061,9063-9064,9066-9068,9071-9092,9094-9112,9114-9117,9119,9121-9160,9162-9166,9169-9207,9209-9211,9213-9215,9217,9219,9221-9253,9255,9257,9259-9260,9262,9264-9269,9271-9273,9275,9277-9278,9280,9282-9283,9285-9289,9291-9299,9301-9310,9312-9313,9315-9320,9322-9324,9326-9338,9340-9342,9344,9346-9348,9350-9358,9360-9362,9364-9366,9368-9374,9376-9382,9384,9386,9388-9390,9392-9396,9398-9402,9404-9410,9412,9414,9416-9417,9419-9425,9427,9429-9430,9432,9434-9463,9465-9502,9504-9506,9508-9521,9523-9526,9528,9530-9537,9539,9541-9551,9553,9555-9556,9558-9578,9580-9581,9583,9585,9587,9589,9591-9624,9626-9655,9657-9700,9702-9726,9728-9729,9731-9749,9751,9753-9754,9756-9832,9834-9836,9838-9839,9841-9846,9848-9850,9852-9858,9860-9863,9865,9867,9869-9871,9873-9893,9895,9897-9912,9914-9919,9921-9928,9930-9952,9954,9956,9958-9963,9965-9993,9995-9997,9999-10001,10003-10004,10006-10007,10009-10012,10014-10031,10033-10073,10075-10107,10109-10165,10167-10210,10222-10226,10228-10311,10313-10378,10380,10382,10384-10393,10395-10478,10480-10482,10484-10494,10496-10503,10505,10507,10509-10521,10523,10525-10528,10530-10540,10542-10543,10545-10568,10570-10584,10586-10590,10592-10594,10596,10598-10599,10601-10611,10613,10615,10617-10626,10628-10636,10638,10640-10654,10656-10658,10660,10662-10672,10674,10676-10682,10684,10686,10688-10690,10692-10694,10696-10697,10699-10701,10703,10705-10706,10708-10724,10726-10731,10734,10736-10748
   + 
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538,7540-7542,7544-7549,7551-7552,7554-7561,7563,7565,7567-7573,7575-7578,7580-7584,7586-7591,7593-7624,7627-7636,7638-7656,7658-7718,7720-7732,7734,7736,7738-7750,7754-7759,7761-7767,7769-7780,7782,7784-7809,7811-7812,7814-7835,7837-7847,7849-7887,7889-7895,7897,7899,7901,7903-7905,7907-7921,7923-7925,7927-7933,7935,7937-7952,7954-7968,7970-7974,7976,7978-7979,7981-7982,7984-7988,7990-7992,7994-8041,8043-8066,8068-8087,8089,8091-8108,8110-8124,8126-8129,8131,8133-8150,8152-8154,8156-8162,8164-8167,8169-8170,8172-8179,8181,8183-8196,8198-8207,8209-8211,8213-8214,8216-8217,8219-8220,8222,8224-8225,8227-8247,8249,8251,8253-8282,8284-8352,8354-8368,8370-8396,8398-8430,8432,8434-8440,8442-8445,8447-8453,8455-8456,8458,8460,8462-8464,8466-8473,8475-8479,8481,8483-8501,8503-8523,8525,8527-8531,8533,8535-8536,8538-8550,8552-8554,8556-8557,8559-8579,8581-8587,8589,8591-8592,8594-8595,8597-8601,8603-8610,8612-8613,8615,8617,8619-8645,8647-8650,8652-8661,8663-8666,8668-8669,8671-8683,8685-8691,8693-8730,8732-8737,8739,8741-8767,8769,8771-8772,8774,8776-8797,8799-8812,8814-8819,8821,8823-8833,8835-8837,8839,8841,8843-8849,8852-8858,8860-8867,8869-8870,8872,8874-8877,8879,8881,8883-8888,8890,8892-8901,8903-8911,8913-8917,8920-8923,8925-8933,8935-8938,8940-8943,8945,8947-8948,8950,8952-8953,8955-8962,8964,8966,8968-8970,8972-8975,8977-8983,8985-8993,8995-9001,9003,9005,9007,9009,9011-9019,9021-9023,9025,9027-9028,9030-9044,9046-9047,9049-9050,9052-9056,9058-9059,9061,9063-9064,9066-9068,9071-9092,9094-9112,9114-9117,9119,9121-9160,9162-9166,9169-9207,9209-9211,9213-9215,9217,9219,9221-9253,9255,9257,9259-9260,9262,9264-9269,9271-9273,9275,9277-9278,9280,9282-9283,9285-9289,9291-9299,9301-9310,9312-9313,9315-9320,9322-9324,9326-9338,9340-9342,9344,9346-9348,9350-9358,9360-9362,9364-9366,9368-9374,9376-9382,9384,9386,9388-9390,9392-9396,9398-9402,9404-9410,9412,9414,9416-9417,9419-9425,9427,9429-9430,9432,9434-9463,9465-9502,9504-9506,9508-9521,9523-9526,9528,9530-9537,9539,9541-9551,9553,9555-9556,9558-9578,9580-9581,9583,9585,9587,9589,9591-9624,9626-9655,9657-9700,9702-9726,9728-9729,9731-9749,9751,9753-9754,9756-9832,9834-9836,9838-9839,9841-9846,9848-9850,9852-9858,9860-9863,9865,9867,9869-9871,9873-9893,9895,9897-9912,9914-9919,9921-9928,9930-9952,9954,9956,9958-9963,9965-9993,9995-9997,9999-10001,10003-10004,10006-10007,10009-10012,10014-10031,10033-10073,10075-10107,10109-10165,10167-10210,10222-10226,10228-10311,10313-10378,10380,10382,10384-10393,10395-10478,10480-10482,10484-10494,10496-10503,10505,10507,10509-10521,10523,10525-10528,10530-10540,10542-10543,10545-10568,10570-10584,10586-10590,10592-10594,10596,10598-10599,10601-10611,10613,10615,10617-10626,10628-10636,10638,10640-10654,10656-10658,10660,10662-10672,10674,10676-10682,10684,10686,10688-10690,10692-10694,10696-10697,10699-10701,10703,10705-10706,10708-10724,10726-10731,10734,10736-10748,10750-10796

Modified: 
branches/Version-1_0-branch/admin/templates/base/form_button_script.tpl
===================================================================
--- branches/Version-1_0-branch/admin/templates/base/form_button_script.tpl     
2013-02-11 19:15:42 UTC (rev 10796)
+++ branches/Version-1_0-branch/admin/templates/base/form_button_script.tpl     
2013-02-12 12:18:01 UTC (rev 10797)
@@ -1,6 +1,6 @@
 <!-- $Id$ -->
 <!-- BEGIN form_button -->
 <form action="{action_url_button}" method="post" 
name="{action_text_button}form">
- {action_extra_field} <input type="submit" title="{action_text_button}" 
style="cursor:help" value="{submit_button}" {action_confirm_button}>
+ {action_extra_field} <input type="submit" title="{action_text_button}" 
value="{submit_button}" {action_confirm_button}>
 </form>
 <!-- END form_button -->

Modified: branches/Version-1_0-branch/bim/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/bim/setup/setup.inc.php 2013-02-11 19:15:42 UTC 
(rev 10796)
+++ branches/Version-1_0-branch/bim/setup/setup.inc.php 2013-02-12 12:18:01 UTC 
(rev 10797)
@@ -12,7 +12,7 @@
        */
 
        $setup_info['bim']['name']                      = 'bim';
-       $setup_info['bim']['version']           = '0.9.17.505';
+       $setup_info['bim']['version']           = '0.9.17.506';
        $setup_info['bim']['app_order']         = 8;
        $setup_info['bim']['enable']            = 1;
        $setup_info['bim']['app_group']         = 'office';
@@ -34,7 +34,8 @@
        (
                'fm_bim_type',
                'fm_bim_model',
-               'fm_bim_item'
+               'fm_bim_item',
+               'fm_bim_item_inventory'
        );
 
        /* The hooks this app includes, needed for hooks registration */

Modified: branches/Version-1_0-branch/bim/setup/tables_current.inc.php
===================================================================
--- branches/Version-1_0-branch/bim/setup/tables_current.inc.php        
2013-02-11 19:15:42 UTC (rev 10796)
+++ branches/Version-1_0-branch/bim/setup/tables_current.inc.php        
2013-02-12 12:18:01 UTC (rev 10797)
@@ -68,5 +68,30 @@
                                ),
                        'ix' => array(),
                        'uc' => array('guid')
-               )
+               ),
+               'fm_bim_item_inventory' => array(
+                       'fd' => array(
+                               'id' => array('type' => 'int', 'precision' => 
4,'nullable' => False),
+                               'location_id' => array('type' => 'int', 
'precision' => 4,'nullable' => False),
+                               'item_id' => array('type' => 'int', 'precision' 
=> 4,'nullable' => False),
+                               'p_location_id' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
+                               'p_id' => array('type' => 'int', 'precision' => 
4,'nullable' => True),
+                               'unit_id' => array('type' => 'int', 'precision' 
=> 4,'nullable' => False),
+                               'inventory' => array('type' => 'int', 
'precision' => 4,'nullable' => False),
+                               'write_off' => array('type' => 'int', 
'precision' => 4,'nullable' => False),
+                               'bookable' => array('type' => 'int', 
'precision' => 2,'nullable' => False),
+                               'active_from' => array('type' => 'int', 
'precision' => 8,'nullable' => True),
+                               'active_to' => array('type' => 'int', 
'precision' => 8,'nullable' => True),
+                               'created_on' => array('type' => 'int', 
'precision' => 8,'nullable' => False),
+                               'created_by' => array('type' => 'int', 
'precision' => 4,'nullable' => False),
+                               'expired_on' => array('type' => 'int', 
'precision' => 8,'nullable' => True),
+                               'expired_by' => array('type' => 'int', 
'precision' => 8,'nullable' => True),
+                               'remark' => array('type' => 'text','nullable' 
=> True)
+                       ),
+                       'pk' => array('id'),
+                       'fk' => array(),
+                       'ix' => array(),
+                       'uc' => array()
+               ),
+
        );

Modified: branches/Version-1_0-branch/bim/setup/tables_update.inc.php
===================================================================
--- branches/Version-1_0-branch/bim/setup/tables_update.inc.php 2013-02-11 
19:15:42 UTC (rev 10796)
+++ branches/Version-1_0-branch/bim/setup/tables_update.inc.php 2013-02-12 
12:18:01 UTC (rev 10797)
@@ -125,3 +125,44 @@
                        return $GLOBALS['setup_info']['bim']['currentver'];
                }
        }
+       /**
+       * Update bim version from 0.9.17.505 to 0.9.17.506
+       */
+       $test[] = '0.9.17.505';
+       function bim_upgrade0_9_17_505()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               $GLOBALS['phpgw_setup']->oProc->CreateTable(
+                       'fm_bim_item_inventory', array(
+                               'fd' => array(
+                                       'id' => array('type' => 'auto', 
'precision' => 4,'nullable' => False),
+                                       'location_id' => array('type' => 'int', 
'precision' => 4,'nullable' => False),
+                                       'item_id' => array('type' => 'int', 
'precision' => 4,'nullable' => False),
+                                       'p_location_id' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
+                                       'p_id' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
+                                       'unit_id' => array('type' => 'int', 
'precision' => 4,'nullable' => False),
+                                       'inventory' => array('type' => 'int', 
'precision' => 4,'nullable' => False),
+                                       'write_off' => array('type' => 'int', 
'precision' => 4,'nullable' => False),
+                                       'bookable' => array('type' => 'int', 
'precision' => 2,'nullable' => False),
+                                       'active_from' => array('type' => 'int', 
'precision' => 8,'nullable' => True),
+                                       'active_to' => array('type' => 'int', 
'precision' => 8,'nullable' => True),
+                                       'created_on' => array('type' => 'int', 
'precision' => 8,'nullable' => False),
+                                       'created_by' => array('type' => 'int', 
'precision' => 4,'nullable' => False),
+                                       'expired_on' => array('type' => 'int', 
'precision' => 8,'nullable' => True),
+                                       'expired_by' => array('type' => 'int', 
'precision' => 8,'nullable' => True),
+                                       'remark' => array('type' => 
'text','nullable' => True)
+                               ),
+                               'pk' => array('id'),
+                               'fk' => array(),//'fm_bim_item' => 
array('location_id' => 'location_id')), 'item_id'=> 'id')),
+                               'ix' => array(),
+                               'uc' => array()
+                       )
+               );
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['bim']['currentver'] = 
'0.9.17.506';
+                       return $GLOBALS['setup_info']['bim']['currentver'];
+               }
+       }

Modified: branches/Version-1_0-branch/calendar/inc/class.bocalendar.inc.php
===================================================================
--- branches/Version-1_0-branch/calendar/inc/class.bocalendar.inc.php   
2013-02-11 19:15:42 UTC (rev 10796)
+++ branches/Version-1_0-branch/calendar/inc/class.bocalendar.inc.php   
2013-02-12 12:18:01 UTC (rev 10797)
@@ -2437,7 +2437,7 @@
 
                        if (!$user)
                        {
-                               $user = $this->owner;
+                               $user =  
$GLOBALS['phpgw']->accounts->search_person($this->owner);
                        }
                        $GLOBALS['phpgw_info']['user']['preferences'] = 
$GLOBALS['phpgw']->preferences->create_email_preferences($user);
 
@@ -2911,7 +2911,9 @@
 
                        $cats = array();
                        $cat_string[] = '';
-                       $this->cat->categories($this->owner,'calendar');
+
+                       
$this->cat->__construct($GLOBALS['phpgw']->accounts->search_person($this->owner),'calendar');
+
                        if(strpos($event['category'],','))
                        {
                                $cats = explode(',',$event['category']);

Modified: branches/Version-1_0-branch/catch/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/catch/setup/setup.inc.php       2013-02-11 
19:15:42 UTC (rev 10796)
+++ branches/Version-1_0-branch/catch/setup/setup.inc.php       2013-02-12 
12:18:01 UTC (rev 10797)
@@ -27,7 +27,7 @@
         */
 
        $setup_info['catch']['name']                    = 'catch';
-       $setup_info['catch']['version']                 = '0.9.17.514';
+       $setup_info['catch']['version']                 = '0.9.17.515';
        $setup_info['catch']['app_order']               = 20;
        $setup_info['catch']['enable']                  = 1;
        $setup_info['catch']['globals_checked'] = True;

Modified: branches/Version-1_0-branch/catch/setup/tables_current.inc.php
===================================================================
--- branches/Version-1_0-branch/catch/setup/tables_current.inc.php      
2013-02-11 19:15:42 UTC (rev 10796)
+++ branches/Version-1_0-branch/catch/setup/tables_current.inc.php      
2013-02-12 12:18:01 UTC (rev 10797)
@@ -59,6 +59,7 @@
                                'start_project' => array('type' => 
'int','precision' => '4','nullable' => True),
                                'start_ticket' => array('type' => 
'int','precision' => '2','nullable' => True),
                                'is_eav' => array('type' => 'int','precision' 
=> '2','nullable' => True),
+                               'enable_bulk' => array('type' => 
'int','precision' => '2','nullable' => True),
                                'jasperupload' => array('type' => 
'int','precision' => 2,'nullable' => True),
                                'parent_id' => array('type' => 
'int','precision' => '4','nullable' => True),
                                'level' => array('type' => 'int','precision' => 
'4','nullable' => True),

Modified: branches/Version-1_0-branch/catch/setup/tables_update.inc.php
===================================================================
--- branches/Version-1_0-branch/catch/setup/tables_update.inc.php       
2013-02-11 19:15:42 UTC (rev 10796)
+++ branches/Version-1_0-branch/catch/setup/tables_update.inc.php       
2013-02-12 12:18:01 UTC (rev 10797)
@@ -463,3 +463,23 @@
                        return $GLOBALS['setup_info']['catch']['currentver'];
                }
        }
+
+       /**
+       * Update catch version from 0.9.17.514 to 0.9.17.515
+       * Add bulk-flag to entities
+       */
+
+       $test[] = '0.9.17.514';
+       function catch_upgrade0_9_17_514()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_catch_category','enable_bulk',array('type'
 => 'int','precision' => 2,'nullable' => True));
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['catch']['currentver'] = 
'0.9.17.515';
+                       return $GLOBALS['setup_info']['catch']['currentver'];
+               }
+       }
+

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

Copied: 
branches/Version-1_0-branch/controller/images/status_icon_black_cross.psd (from 
rev 10796, trunk/controller/images/status_icon_black_cross.psd)
===================================================================
(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       
2013-02-11 19:15:42 UTC (rev 10796)
+++ branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php       
2013-02-12 12:18:01 UTC (rev 10797)
@@ -251,7 +251,7 @@
          $sql  = "SELECT * "; 
                $sql .= "FROM controller_check_list ";
                $sql .= "WHERE control_id = {$control_id} ";
-               $sql .= "AND deadline = {$deadline_ts}";                
+               $sql .= "AND deadline = {$deadline_ts} ";               
 
                if($type == "location")
                {
@@ -265,8 +265,8 @@
                if($status != null)
                {
                        $sql .= "AND status = {$status} ";
-               }
-
+               }  
+    
                $this->db->query($sql);
                
                $check_list = null;
@@ -591,7 +591,7 @@
                        $check_lists_array[] = $check_list;
                }
                
-               return array( "location_code" => $location_code, 
"check_lists_array" => $check_lists_array);
+               return $check_lists_array;
        }
        
        /**
@@ -647,39 +647,6 @@
                return array( "location_code" => $location_code, 
"check_lists_array" => $check_lists_array);
        }
        
-/* Denne ser det ikke ut til at vi bruker: Torstein 9/7-12 
-       function get_check_list_for_date($control_id, $current_date){
-               $sql =  "SELECT c.id as c_id, title, description, start_date, 
end_date, control_area_id, c.location_code as c_location_code, repeat_type, 
repeat_interval, ";
-               $sql .= "cl.id as cl_id, cl.status as cl_status, cl.comment as 
cl_comment, deadline, planned_date, completed_date, ";
-               $sql .= "cl.component_id as cl_component_id, cl.location_code 
as cl_location_code, num_open_cases, num_pending_cases "; 
-               $sql .= "FROM controller_control c ";
-               $sql .= "LEFT JOIN controller_check_list cl on cl.control_id = 
c.id ";
-               $sql .= "WHERE c.id = {$control_id} "; 
-               $sql .= "AND NOT planned_date IS NULL ";
-
-               $this->db->query($sql);
-               
-               $check_lists_array = array();
-               while ($this->db->next_record()) {
-                       $check_list = new 
controller_check_list($this->unmarshal($this->db->f('cl_id', true), 'int'));
-                       $check_list->set_control_id($control_id);
-                       
$check_list->set_status($this->unmarshal($this->db->f('cl_status', true), 
'int'));
-                       
$check_list->set_comment($this->unmarshal($this->db->f('cl_comment', true), 
'string'));
-                       
$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_component_id($this->unmarshal($this->db->f('cl_component_id', 
true), 'int'));
-                       
$check_list->set_location_code($this->unmarshal($this->db->f('cl_location_code',
 true), 'string'));
-                       
$check_list->set_num_open_cases($this->unmarshal($this->db->f('num_open_cases', 
true), 'int'));
-                       
$check_list->set_num_pending_cases($this->unmarshal($this->db->f('num_pending_cases',
 true), 'int'));
-                       
-                       $check_lists_array[] = $check_list;
-               }
-
-               return $check_lists_array;
-       }
-       */
-       
        function get_query(string $sort_field, boolean $ascending, string 
$search_for, string $search_type, array $filters, boolean $return_count)
        {
                $current_time = time();

Modified: branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php 
2013-02-11 19:15:42 UTC (rev 10796)
+++ branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php 
2013-02-12 12:18:01 UTC (rev 10797)
@@ -115,7 +115,7 @@
                        // Validates location_code. If not set, first location 
among assigned locations
                        $location_code = 
$this->validate_location_code($location_code);
 
-                       if ($location_code != null && $location_code = "")
+                       if ($location_code != null && $location_code != "")
                        {
                                $level = 
$this->get_location_level($location_code);
 
@@ -516,10 +516,8 @@
                                        $curr_location_code = 
$location['location_code'];
 
                                        $repeat_type = 
$control->get_repeat_type();
-                                       $location_with_check_lists = 
$this->so->get_check_lists_for_control_and_location($control_id, 
$curr_location_code, $from_date_ts, $to_date_ts, $repeat_type);
+                                       $check_lists_array = 
$this->so->get_check_lists_for_control_and_location($control_id, 
$curr_location_code, $from_date_ts, $to_date_ts, $repeat_type);
 
-                                       $check_lists_array = 
$location_with_check_lists["check_lists_array"];
-
                                        $year_calendar = new 
year_calendar($control, $year, null, $curr_location_code, "location");
                                        $calendar_array = 
$year_calendar->build_calendar($check_lists_array);
 
@@ -597,12 +595,9 @@
                                $curr_location_code = 
$location['location_code'];
 
                                $repeat_type = $control->get_repeat_type();
-                               $location_with_check_lists = 
$this->so->get_check_lists_for_control_and_location($control_id, 
$curr_location_code, $from_date_ts, $to_date_ts, $control->get_repeat_type());
+                               $check_lists_array = 
$this->so->get_check_lists_for_control_and_location($control_id, 
$curr_location_code, $from_date_ts, $to_date_ts, $control->get_repeat_type());
 
-                               $check_lists_array = 
$location_with_check_lists["check_lists_array"];
-
-
-                               $month_calendar = new month_calendar($control, 
$year, $month, null, $curr_location_code, "location");
+        $month_calendar = new month_calendar($control, $year, $month, null, 
$curr_location_code, "location");
                                $calendar_array = 
$month_calendar->build_calendar($check_lists_array);
 
                                $locations_with_calendar_array[] = 
array("location" => $location, "calendar_array" => $calendar_array);

Modified: branches/Version-1_0-branch/controller/inc/class.uicase.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicase.inc.php     
2013-02-11 19:15:42 UTC (rev 10796)
+++ branches/Version-1_0-branch/controller/inc/class.uicase.inc.php     
2013-02-12 12:18:01 UTC (rev 10797)
@@ -351,7 +351,7 @@
                        $control_id = $check_list->get_control_id();
                        $control = $this->so_control->get_single( $control_id );
                
-                       $check_items_and_cases = 
$this->so_check_item->get_check_items_with_cases_by_message($message_ticket_id, 
"return_array");
+                       $check_items_and_cases = 
$this->so_check_item->get_check_items_with_cases_by_message($message_ticket_id);
                                                
                        $botts = CreateObject('property.botts',true);
                        $message_ticket = 
$botts->read_single($message_ticket_id);

Modified: branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php       
2013-02-11 19:15:42 UTC (rev 10796)
+++ branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php       
2013-02-12 12:18:01 UTC (rev 10797)
@@ -45,6 +45,7 @@
        include_class('controller', 'check_item', 'inc/model/');
        include_class('controller', 'date_generator', 'inc/component/');
        include_class('controller', 'check_list_status_updater', 'inc/helper/');
+  include_class('controller', 'date_converter', 'inc/helper/');
                
        class controller_uicheck_list extends phpgwapi_uicommon
        {
@@ -232,7 +233,7 @@
                                        $location_id = 
phpgw::get_var('location_id');
                                        
$check_list->set_location_id($location_id);
                                        $component_id = 
phpgw::get_var('component_id');
-                                       
$check_list->set_component_id($component_id);   
+                                       
$check_list->set_component_id($component_id);
                                }
                                
                                $component_arr = 
execMethod('property.soentity.read_single_eav', array('location_id' => 
$location_id, 'id' => $component_id));
@@ -240,7 +241,7 @@
                
                                $component = new controller_component();
                                $component->set_location_code( 
$component_arr['location_code'] );
-                       $component->set_xml_short_desc( $short_desc );
+               $component->set_xml_short_desc( $short_desc );
                                
                                $component_array = $component->toArray();
                                $building_location_code = 
$this->get_building_location_code($component_arr['location_code']);
@@ -250,7 +251,7 @@
                        {
                                $type = "location";
                        }
-                       
+                         
                        $control = $this->so_control->get_single( 
$check_list->get_control_id() );
                        
                        $year = date("Y", $deadline_ts);
@@ -260,8 +261,8 @@
                        (
                                'location_array'                                
        => $location_array,
                                'component_array'                               
        => $component_array,
-                               'control'                                       
                                => $control->toArray(),
-                               'check_list'                                    
                => $check_list->toArray(),
+                               'control'                                       
                                => $control,
+                               'check_list'                                    
                => $check_list,
                                'type'                                          
                                => $type,
                                'current_year'                                  
        => $year,
                                'current_month_nr'                              
=> $month_nr,
@@ -271,10 +272,10 @@
                        
                        $GLOBALS['phpgw']->jqcal->add_listener('planned_date');
                        
$GLOBALS['phpgw']->jqcal->add_listener('completed_date');
-
+      
                        self::add_javascript('controller', 'controller', 
'custom_ui.js');
                        self::add_javascript('controller', 'controller', 
'ajax.js');
-                       self::render_template_xsl('check_list/add_check_list', 
$data);
+                       self::render_template_xsl( 
array('check_list/add_check_list', 'check_list/nav_control_plan'), $data );
                }
                
                /**
@@ -290,9 +291,6 @@
                                $check_list = 
$this->so->get_single($check_list_id);
                        }
                        
-                       $cl_status_updater = new check_list_status_updater();
-                       $cl_status_updater->update_check_list_status( 
$check_list_id );
-               
                        $control = 
$this->so_control->get_single($check_list->get_control_id());
                        
                        $component_id = $check_list->get_component_id();
@@ -326,8 +324,8 @@
                        
                        $data = array
                        (
-                               'control'                                       
                        => $control->toArray(),
-                               'check_list'                                    
                => $check_list->toArray(),
+                               'control'                                       
                        => $control,
+                               'check_list'                                    
                => $check_list,
                                'location_array'                                
        => $location_array,
                                'component_array'                               
        => $component_array,
                                'type'                                          
                                => $type,
@@ -344,7 +342,7 @@
                        self::add_javascript('controller', 'controller', 
'custom_ui.js');
                        self::add_javascript('controller', 'controller', 
'ajax.js');
                        
-                       
self::render_template_xsl(array('check_list/check_list_tab_menu','check_list/edit_check_list'),
 $data);
+                       
self::render_template_xsl(array('check_list/check_list_tab_menu', 
'check_list/nav_control_plan', 'check_list/edit_check_list'), $data);
                }
                
                /**
@@ -363,9 +361,9 @@
                        $planned_date = phpgw::get_var('planned_date', 
'string');
                        $completed_date = phpgw::get_var('completed_date', 
'string');
                        $comment = phpgw::get_var('comment', 'string');
-                                       
-                       $deadline_date_ts = 
phpgwapi_datetime::date_to_timestamp( $deadline_date );
                        
+                       $deadline_date_ts = date_converter::date_to_timestamp( 
$deadline_date );
+                            
                        if($planned_date != '')
                        {
                                $planned_date_ts = 
phpgwapi_datetime::date_to_timestamp( $planned_date );
@@ -413,8 +411,11 @@
 
                        if( $check_list->validate() )
                        {
-                                       $check_list_id  = 
$this->so->store($check_list);
+                               $check_list_id  = $this->so->store($check_list);
                                
+        $cl_status_updater = new check_list_status_updater();
+        $cl_status_updater->update_check_list_status( $check_list_id );
+      
                                if( $check_list_id > 0 )
                                {
                                        $this->redirect(array('menuaction' => 
'controller.uicheck_list.edit_check_list', 'check_list_id' => $check_list_id)); 
  
@@ -475,8 +476,8 @@
                                                        
                        $data = array
                        (
-                               'control'                                       
                        => $control->toArray(),
-                               'check_list'                                    
                => $check_list->toArray(),
+                               'control'                                       
                        => $control,
+                               'check_list'                                    
                => $check_list,
                                'location_array'                                
        => $location_array,
                                'component_array'                               
        => $component_array,
                                'type'                                          
                                => $type,
@@ -492,7 +493,7 @@
                        self::add_javascript('controller', 'controller', 
'custom_ui.js');
                        self::add_javascript('controller', 'controller', 
'ajax.js');
                        
-                       
self::render_template_xsl(array('check_list/check_list_tab_menu', 
'check_list/view_cases_for_check_list'), $data);
+                       
self::render_template_xsl(array('check_list/check_list_tab_menu', 
'check_list/nav_control_plan', 'check_list/view_cases_for_check_list'), $data);
                }
                
                public function print_check_list()
@@ -518,7 +519,7 @@
                        $data = array
                        (
                                'saved_groups_with_items_array' => 
$saved_groups_with_items_array,
-                               'check_list'                                    
=> $check_list->toArray()
+                               'check_list'                                    
                                        => $check_list
                        );
                        
                        
self::render_template_xsl('check_list/print_check_list', $data);
@@ -562,8 +563,8 @@
                        
                        $data = array
                        (
-                               'control'                                       
                        => $control->toArray(),
-                               'check_list'                                    
                => $check_list->toArray(),
+                               'control'                                       
                        => $control,
+                               'check_list'                                    
                => $check_list,
                                'location_array'                                
        => $location_array,
                                'component_array'                               
        => $component_array,
                                'type'                                          
                                => $type,
@@ -575,7 +576,7 @@
 
                        phpgwapi_jquery::load_widget('core');
                        
-                       
self::render_template_xsl(array('check_list/check_list_tab_menu','check_list/view_control_info'),
 $data);
+                       
self::render_template_xsl(array('check_list/check_list_tab_menu', 
'check_list/nav_control_plan', 'check_list/view_control_info'), $data);
                }
                
                function view_control_details()
@@ -586,7 +587,7 @@
                        
                        $data = array
                        (
-                               'control'                                       
        => $control->toArray(),
+                               'control'       => $control,
                        );
                        
                        
self::render_template_xsl('check_list/view_control_details', $data);
@@ -688,8 +689,8 @@
                                                        
                        $data = array
                        (
-                               'control'                                       
                                                                => 
$control->toArray(),
-                               'check_list'                                    
                                                        => 
$check_list->toArray(),
+                               'control'                                       
                                                                => $control,
+                               'check_list'                                    
                                                        => $check_list,
                                'location_array'                                
                                                => $location_array,
                                'component_array'                               
                                                => $component_array,
                                'control_groups_with_items_array'       => 
$control_groups_with_items_array,
@@ -705,7 +706,7 @@
                        self::add_javascript('controller', 'controller', 
'custom_ui.js');
                        self::add_javascript('controller', 'controller', 
'ajax.js');
                        
-                       
self::render_template_xsl(array('check_list/check_list_tab_menu', 
'check_list/add_case'), $data);
+                       
self::render_template_xsl(array('check_list/check_list_tab_menu', 
'check_list/nav_control_plan', 'check_list/add_case'), $data);
                }
                
                function view_open_cases()
@@ -726,7 +727,7 @@
                        $data = array
                        (
                                'open_check_items_and_cases'    => 
$open_check_items_and_cases,
-                               'check_list'                                    
                                => $check_list->toArray()
+                               'check_list'                                    
                                => $check_list
                        );
                        
                        self::render_template_xsl( 
array('check_list/cases_tab_menu', 'check_list/view_open_cases', 
'check_list/case_row'), $data );                    
@@ -743,7 +744,7 @@
                        $data = array
                        (
                                'closed_check_items_and_cases'                  
        => $closed_check_items_and_cases,
-                               'check_list'                                    
                                                                => 
$check_list->toArray()
+                               'check_list'                                    
                                                                => $check_list
                        );
                        
                        self::render_template_xsl( 
array('check_list/cases_tab_menu', 'check_list/view_closed_cases'), $data );
@@ -772,7 +773,7 @@
                        $data = array
                        (
                                'saved_groups_with_items_array' => 
$saved_groups_with_items_array,
-                               'check_list'                                    
=> $check_list->toArray()
+                               'check_list'                                    
=> $check_list
                        );
                        
                        
self::render_template_xsl('check_list/view_control_items', $data);

Modified: 
branches/Version-1_0-branch/controller/inc/class.uicontrol_item.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicontrol_item.inc.php     
2013-02-11 19:15:42 UTC (rev 10796)
+++ branches/Version-1_0-branch/controller/inc/class.uicontrol_item.inc.php     
2013-02-12 12:18:01 UTC (rev 10797)
@@ -45,7 +45,6 @@
        class controller_uicontrol_item extends phpgwapi_uicommon
        {
                private $so;
-               private $so_control_item;
                private $so_control_group;
                private $so_control_item_option;
                
@@ -208,13 +207,12 @@
                                // Edit control item
                                if($control_item_id > 0)
                                {
-                                       $control_item_array = 
$this->so->get_single_with_options($control_item_id , "return_array"); 
+                                       $control_item = 
$this->so->get_single_with_options($control_item_id); 
                                }
                                // New control item
                                else
                                {
                                        $control_item = new 
controller_control_item();
-                                       $control_item_array = 
$control_item->toArray();
                                }       
                        }
                        
@@ -228,13 +226,16 @@
                        $control_groups_array = 
$this->so_control_group->get_control_group_array();
 
                        // Hack to fix display of &nbsp; char
-                       $control_item_array['what_to_do'] = 
str_replace("&nbsp;", " ",$control_item_array['what_to_do']);
-                       $control_item_array['how_to_do'] = 
str_replace('&nbsp;', ' ', $control_item_array['how_to_do']);
+      $what_to_do_fixed = str_replace( "&nbsp;", " 
",$control_item->get_what_to_do() );
+      $control_item->set_what_to_do( $what_to_do_fixed );
+      
+      $how_to_do_fixed = str_replace( "&nbsp;", " 
",$control_item->get_how_to_do() );
+      $control_item->set_how_to_do( $how_to_do_fixed );
                        
                        $data = array
                        (
                                'editable'                              => true,
-                               'control_item'          => $control_item_array,
+                               'control_item'          => $control_item,
                                'control_areas'         => $control_areas_array,
                                'control_groups'        => 
$control_groups_array,
                        );
@@ -277,19 +278,55 @@
                        $control_item->set_type($type);
                        $control_item->set_what_to_do($what_to_do_txt);
                        $control_item->set_how_to_do($how_to_do_txt);
-                       
+      
                        if( $control_item->validate() )
                        {
+        $transaction_status = true;
+        
+        $db_control_item = $this->so->get_db();
+        $db_control_item->transaction_begin();
+                               
                                $saved_control_item_id = 
$this->so->store($control_item);
+        
+        if($saved_control_item_id == 0)
+        {
+          $transaction_status = false;
+        }
        
-                               $this->so->delete_option_values( 
$saved_control_item_id );
+        // Delete item option values
+                               $delete_status = 
$this->so->delete_option_values( $saved_control_item_id );
                                
-                               if(($saved_control_item_id > 0) & 
($control_item->get_type() == 'control_item_type_3' | $control_item->get_type() 
== 'control_item_type_4'))
+        if($delete_status == 0)
+        {
+          $transaction_status = false;
+        }
+        
+        if( $transaction_status == true)
+        {
+          $db_control_item->transaction_commit();
+        }
+        else
+        {
+          $db_control_item->transaction_abort();
+        }
+        
+        $option_values = array();
+        $option_values = phpgw::get_var('option_values');
+                       
+        $option_values_array = array();
+        foreach($option_values as $option_value){
+          $control_item_option = new 
controller_control_item_option($option_value, $saved_control_item_id);
+          $option_values_array[] = $control_item_option;
+        }
+      
+        $control_item->set_options_array($option_values_array);
+        
+        // Add new control item option values
+                               if( ($transaction_status) & 
($saved_control_item_id > 0) & ($control_item->get_type() == 
'control_item_type_3' | $control_item->get_type() == 'control_item_type_4'))
                                {
-                                       $option_values = 
phpgw::get_var('option_values');
+                                       $control_item_options_array = 
$control_item->get_options_array();
                                        
-                                       foreach($option_values as 
$option_value){
-                                               $control_item_option = new 
controller_control_item_option($option_value, $saved_control_item_id);
+                                       foreach($control_item_options_array as 
$control_item_option){
                                                $control_item_option_id = 
$this->so_control_item_option->store( $control_item_option );
                                        }
                                }
@@ -312,7 +349,7 @@
                
                        if(isset($control_item_id) && $control_item_id > 0)
                        {
-                               $control_item_array = 
$this->so->get_single_with_options($control_item_id, "return_array");
+                               $control_item = 
$this->so->get_single_with_options($control_item_id);
                        }
                        else
                        {
@@ -320,17 +357,19 @@
                                return;
                        }
                        
-                       $category = 
execMethod('phpgwapi.categories.return_single', 
$control_item_array['control_area_id']);
-                       $control_item_array['control_area_name'] = 
$category[0]['name'];
+                       $category = 
execMethod('phpgwapi.categories.return_single', 
$control_item->get_control_area_id());
+                       $control_item->set_control_area_name( 
$category[0]['name'] );
                        
-                       /* Hack to fix display of &nbsp; char */
-                       $control_item_array['what_to_do'] = 
str_replace("&nbsp;", " ",$control_item_array['what_to_do']);
-                       $control_item_array['how_to_do'] = 
str_replace('&nbsp;', ' ', $control_item_array['how_to_do']);
+      // Hack to fix display of &nbsp; char
+      $what_to_do_fixed = str_replace( "&nbsp;", " 
",$control_item->get_what_to_do() );
+      $control_item->set_what_to_do( $what_to_do_fixed );
+      
+      $how_to_do_fixed = str_replace( "&nbsp;", " 
",$control_item->get_how_to_do() );
+      $control_item->set_how_to_do( $how_to_do_fixed );
                        
                        $data = array
                        (
-                               'value_id'                      => 
!empty($control_item) ? $control_item->get_id() : 0,
-                               'control_item'  => $control_item_array,
+                               'control_item'  => $control_item,
                                'view'                                  => true
                        );
                        

Modified: branches/Version-1_0-branch/controller/inc/class.uiprocedure.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uiprocedure.inc.php        
2013-02-11 19:15:42 UTC (rev 10796)
+++ branches/Version-1_0-branch/controller/inc/class.uiprocedure.inc.php        
2013-02-12 12:18:01 UTC (rev 10797)
@@ -559,7 +559,7 @@
                        $data = array
                        (
                                'location'                                      
=> $location_array,
-                               'control'                                       
=> $control->toArray(),
+                               'control'                                       
=> $control,
                                'control_procedure'                     => 
$control_procedure,
                                'group_procedures_array'        => 
$group_procedures_array
                        );

Modified: 
branches/Version-1_0-branch/controller/inc/component/class.check_list_status_manager.inc.php
===================================================================
--- 
branches/Version-1_0-branch/controller/inc/component/class.check_list_status_manager.inc.php
        2013-02-11 19:15:42 UTC (rev 10796)
+++ 
branches/Version-1_0-branch/controller/inc/component/class.check_list_status_manager.inc.php
        2013-02-12 12:18:01 UTC (rev 10797)
@@ -57,9 +57,9 @@
                                {
                                        $status = "CONTROL_PLANNED";
                                }
-                               else if( $this->check_list->get_status() == 
controller_check_list::STATUS_NOT_DONE & $this->check_list->get_deadline() < 
$todays_date_ts )
+        else if( $this->check_list->get_status() == 
controller_check_list::STATUS_NOT_DONE & $this->check_list->get_deadline() >= 
$todays_date_ts )
                                {
-                                       $status = 
"CONTROL_NOT_DONE_WITH_CHECKLIST";
+                                       $status = "CONTROL_REGISTERED";
                                }
                                else if( $this->check_list->get_status() == 
controller_check_list::STATUS_NOT_DONE & $this->check_list->get_planned_date() 
> 0 & $this->check_list->get_deadline() < $todays_date_ts )
                                {
@@ -82,16 +82,16 @@
                                {
                                        $status = "CONTROL_CANCELED";
                                }
-                               
+        
                                $check_list_status_info->set_check_list_id( 
$this->check_list->get_id() );
                        }
-                       
+      
                        $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
                        $check_list_status_info->set_control_id( 
$this->check_list->get_control_id() );
                        $check_list_status_info->set_deadline_date_txt( 
date($dateformat, $this->check_list->get_deadline()) );
                        $check_list_status_info->set_deadline_date_ts( 
$this->check_list->get_deadline() );
                        $check_list_status_info->set_type( $this->type );
-                       
+                     
                        if($this->type == "component"){
                                $check_list_status_info->set_component_id( 
$this->check_list->get_component_id() );
                                $check_list_status_info->set_location_id( 
$this->check_list->get_location_id() );

Modified: 
branches/Version-1_0-branch/controller/inc/helper/class.check_list_status_updater.inc.php
===================================================================
--- 
branches/Version-1_0-branch/controller/inc/helper/class.check_list_status_updater.inc.php
   2013-02-11 19:15:42 UTC (rev 10796)
+++ 
branches/Version-1_0-branch/controller/inc/helper/class.check_list_status_updater.inc.php
   2013-02-12 12:18:01 UTC (rev 10797)
@@ -15,32 +15,42 @@
                        
                public function update_check_list_status( $check_list_id )
                {
+      //$db_check_list = $this->so_check_list->get_db();
+                       //$db_check_list->transaction_begin();
+    
                        $check_list = $this->so_check_list->get_single( 
$check_list_id );
                
-                       $check_items = 
$this->so_check_item->get_check_items_with_cases($check_list_id, 
$control_item_type = null, $status = null, $messageStatus = null, 
"return_object");
+                       $check_items = 
$this->so_check_item->get_check_items_with_cases($check_list_id, 
$control_item_type = null, $status = null, $messageStatus = null);
                
                        $num_open_cases = 0;
                        $num_pending_cases = 0;
                                        
-                       foreach($check_items as $check_item){
-                               foreach($check_item->get_cases_array() as 
$case){
+                       foreach($check_items as $check_item)
+      {
+                               foreach($check_item->get_cases_array() as $case)
+        {
                                        
-                                       if($case->get_status() == 
controller_check_item_case::STATUS_OPEN){
+                                       if($case->get_status() == 
controller_check_item_case::STATUS_OPEN)
+          {
                                                $num_open_cases++;
                                        }
                                        
-                                       if($case->get_status() == 
controller_check_item_case::STATUS_PENDING){
+                                       if($case->get_status() == 
controller_check_item_case::STATUS_PENDING)
+          {
                                                $num_pending_cases++;
                                        }
                                }       
                        }
                        
                        if($num_open_cases > 0)
+      {
                                
$check_list->set_status(controller_check_list::STATUS_DONE);
-                               
+      }
+      
                        $check_list->set_num_open_cases($num_open_cases);
                        $check_list->set_num_pending_cases($num_pending_cases);
                        
                        $this->so_check_list->store($check_list);
+      
                }
-}
+}
\ No newline at end of file

Copied: 
branches/Version-1_0-branch/controller/inc/helper/class.date_converter.inc.php 
(from rev 10796, trunk/controller/inc/helper/class.date_converter.inc.php)
===================================================================
--- 
branches/Version-1_0-branch/controller/inc/helper/class.date_converter.inc.php  
                            (rev 0)
+++ 
branches/Version-1_0-branch/controller/inc/helper/class.date_converter.inc.php  
    2013-02-12 12:18:01 UTC (rev 10797)
@@ -0,0 +1,187 @@
+<?php
+
+  class date_converter
+  {
+  
+    /**
+               * Convert a date array to a unix timestamp
+               *
+               * @param string $date the date to convert, must contain keys 
day, month & year
+               * @return int unix timestamp
+               */
+               public static function date_to_timestamp($datestr = '')
+               {
+                       if ( !$datestr )
+                       {
+                               return 0;
+                       }
+
+                       $hour   = 0;
+                       $minute = 0;
+                       $second = 0;
+
+                       if( strpos($datestr, ':') )
+                       {
+                               $date_part = explode(' ', $datestr);
+                               $time_part = explode(':', $date_part[1]);
+
+                               $hour   = (int) $time_part[0];
+                               $minute = (int) $time_part[1];
+                               $second = isset($time_part[2]) && $time_part[2] 
? (int)$time_part[2] : 0;
+                       }
+
+
+                       if( version_compare(PHP_VERSION, '5.3.0') >= 0  && 
strpos($datestr, ':'))
+                       {
+                               return self::datetime_to_timestamp($datestr);
+                       }
+
+                       $date_array     = self::date_array($datestr);
+                       return mktime ($hour, $minute, $second, 
$date_array['month'], $date_array['day'], $date_array['year']);
+               }
+    
+    /**
+               * Convert a date string to an array containing date parts
+               *
+               * @param string $datestr the date string to convert - must 
match user's preferred date format
+               * @return array date parts: year,month and day
+               */
+               public static function date_array($datestr)
+               {
+                       $dateformat =& 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+
+                       $pattern = '/[\.\/\-]/';
+                       $fields = preg_split($pattern, $datestr);
+                       foreach(preg_split($pattern, $dateformat) as $n => 
$field)
+                       {
+                               $date[$field] = (int) $fields[$n];
+
+                               if ( $field == 'M' )
+                               {
+                                       $date['m'] = 
self::convert_M_to_int($fields[$n]);
+                               }
+                       }
+
+                       return array
+                       (
+                               'year'  => $date['Y'],
+                               'month' => $date['m'],
+                               'day'   => $date['d']
+                       );
+               }
+    
+       /**
+               * Convert a datetime to a unix timestamp
+               *
+               * @param string $date the date convert
+               * @return int unix timestamp
+               */
+               public static function datetime_to_timestamp($datestr = '')
+               {
+                       if ( !$datestr )
+                       {
+                               return 0;
+                       }
+
+                       $format = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+                       if(substr_count($datestr, ':') == 1 )
+                       {
+                               $format .= ' H:i';
+                       }
+                       else if(substr_count($datestr, ':') == 2 )
+                       {
+                               $format .= ' H:i:s';
+                       }
+                       
+                       $date = DateTime::createFromFormat("{$format}", 
$datestr);
+                       if($date)
+                       {
+                               return $date->getTimestamp();
+                       }
+                       else
+                       {
+                               return 0;
+                       }
+               }
+
+               /**
+               * Convert a M month string to an int
+               *
+               * @param string $str abbreviated month name string
+               * @return int the month number - 0 is returned for invalid input
+               */
+               private static function convert_M_to_int($str)
+               {
+                       for($i=1; $i <=12; ++$i)
+                       {
+                               if ( date('M', mktime(0, 0, 0, $i, 1, 2000)) == 
$str )
+                               {
+                                       return $i;
+                               }
+                       }
+                       return 0;
+               }
+
+               /**
+               * Get a list of translated day names
+               *
+               * @return array list of day names
+               */
+               public static function get_dow_fullnames()
+               {
+                       static $dow_list = null;
+                       if ( is_null($dow_list) )
+                       {
+                               $dow_list = array();
+                               foreach ( self::$dow_fullnames as $id => 
$dow_name )
+                               {
+                                       $dow_list[$id] = lang($dow_name);
+                               }
+                       }
+                       return $dow_list;
+               }
+
+               /**
+               * Get a list of translated month names
+               *
+               * @return array list of month names
+               */
+               public static function get_month_fullnames()
+               {
+                       static $month_list = null;
+                       if ( is_null($month_list) )
+                       {
+                               $raw_list =  self::$month_fullnames;
+                               unset($raw_list[0]); // WAR month index hack
+                               
+                               $month_list = array();
+                               foreach ( $raw_list as $id => $month )
+                               {
+                                       if ( $id == 0 )
+                                       {
+                                               continue;
+                                       }
+                                       $month_list[$id] = lang($month);
+                               }
+                       }
+                       return $month_list;
+               }
+
+               /**
+               * Convert an ISO 8601 day of week number to a local name
+               *
+               * @param int $dow ISO 8601 day of week number
+               * @return string local say of week name
+               */
+               public static function nr2weekday($dow = 0)
+               {
+                       $dow_list = self::get_dow_fullnames();
+                       if ( isset($dow_list[$dow]) )
+                       {
+                               return $dow_list[$dow];
+                       }
+                       return lang('Unknown');
+               }
+  }
+  
+?>

Modified: branches/Version-1_0-branch/controller/inc/hook_home.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/hook_home.inc.php        
2013-02-11 19:15:42 UTC (rev 10796)
+++ branches/Version-1_0-branch/controller/inc/hook_home.inc.php        
2013-02-12 12:18:01 UTC (rev 10797)
@@ -50,17 +50,16 @@
        $styling  = "\n".'<!-- BEGIN checklist info -->'."\n ";
        $styling .= "<style>";
        $styling .= " .home-box { background: none repeat scroll 0 0 #EDF5FF; 
border-color: #DBE5EF; border-radius: 4px; margin: 5px 20px 20px;}";
-       $styling .= " .home-box .home_portal { margin: 0;border: 1px solid 
#DEEAF8;}";
-
+       $styling .= " .home-box .home_portal { margin: 0;border: 1px solid 
#EBF3FC;}";
        $styling .= " .home_portal { margin:20px 20px 0 10px; }"; 
-       $styling .= " .home_portal a { color:#0066CC;text-decoration: 
none;text-transform: uppercase;}"; 
-       $styling .= " .home_portal h2 { overflow:hidden;clear:left;font-size: 
13px;font-weight: bold;text-transform:uppercase; background: #DEEAF8; margin: 
0; padding: 2px 10px; color: #1C3C6F;}";
+       $styling .= " .home_portal a { color:#0066CC;text-decoration: 
none;text-transform: uppercase; clear:both;display:block;}"; 
+       $styling .= " .home_portal h2 { overflow:hidden;clear:left;font-size: 
13px;font-weight: bold;text-transform:uppercase; background: #D0DEF4; margin: 
0; padding: 2px 10px; color: #1C3C6F;}";
        $styling .= " .home_portal h2 div{ display:block;float:left;cursor: 
pointer;vertical-align: middle;}";
        $styling .= " .home_portal .title { width:300px;margin:0 20px 0 0;}"; 
        $styling .= " .home_portal .control-area { width:200px;}";
        $styling .= " .home_portal .control { width:300px;}";
-       $styling .= " .home_portal .date { width:300px;}";
-       $styling .= " .home_portal li { margin: 5px;}";
+       $styling .= " .home_portal .date { margin-left: 20px;width:130px;}";
+       $styling .= " .home_portal li { overflow: hidden;margin: 10px;}";
        $styling .= " .home_portal li div { display: block;float:left;cursor: 
pointer;vertical-align: middle;}";
        
        $styling .= " .home_portal_content ul li { clear: both; overflow: 
hidden;}";
@@ -69,14 +68,14 @@
        
        $styling .= " h2.heading { font-size: 22px; font-weight: normal;margin: 
0 0 0 20px;}";
        
-       $styling .= " h4.expand_trigger { clear:both;overflow:hidden;font-size: 
12px;color:#031647;background: #D0DEF4;padding:2px 4px;margin:0; }";
+       $styling .= " h4.expand_trigger { clear:both;overflow:hidden;font-size: 
12px;color:#031647;background: #DEEAF8;padding:2px 4px;margin:0; }";
        $styling .= " h4.expand_trigger img { 
float:left;vertical-align:middle;margin-right:3px; }";
        $styling .= " h4.expand_trigger span { 
float:left;display:block;vertical-align:middle; }";
-       $styling .= " h4.expand_trigger span.deadline { width:805px; }";
+       $styling .= " h4.expand_trigger span.deadline { margin-right: 10px; }";
        $styling .= " h4.expand_trigger span.num_check_lists { width:200px; }";
        
        $styling .= " .expand_list{ display:none; overflow:hidden; }";
-       $styling .= " .expand_list li{ clear:both;overflow:hidden; }";
+       $styling .= " .expand_list li{ clear:both;overflow:hidden;margin:5px 0; 
}";
        
        $styling .= "</style>"; 
        $styling .= "\n".'<!-- END checklist info -->'."\n";
@@ -125,55 +124,129 @@
        
        $my_locations = array_merge($my_properties, $my_buildings);
        
+  
+  /* =======================================  PLANNED CONTROLS FOR CURRENT 
USER  ================================= */
        
+       $my_planned_controls_HTML = "<div class='home_portal'><h2><div 
class='date heading'>Planlagt dato</div><div class='date 
heading'>Fristdato</div><div class='control heading'>Tittel på 
kontroll</div><div class='title heading'>Lokasjonsnavn</div><div 
class='control-area heading'>Kontrollområde</div></h2>";
        
-       /* =======================================  UNDONE ASSIGNED CONTROLS 
FOR CURRENT USER  ================================= */
-       
-       $my_controls = array();
+       // Todays date
+       $from_date_ts =  mktime(0, 0, 0, date("n"), date("j"), date("Y") );
+       // One month ahead in time
+  $to_date_ts = mktime(0, 0, 0, date("n")+1, date("j"), date("Y") );
+         
+  // fetch all repeat types
        $repeat_type = null;
+  
+  // Fetches controls current user is responsible for 1 month ahead
+  $my_controls = array();
+  $my_controls = get_my_controls($my_locations, $from_date_ts, $to_date_ts, 
$repeat_type);
        
-       // from date is set to 3 months back in time
-       $from_date_ts =  mktime(0, 0, 0, date("n")-3, date("j"), date("Y") );
-       $to_date_ts =  mktime(0, 0, 0, date("n"), date("j"), date("Y") );
-       
-       // Fetches controls current user is responsible for 3 months back in 
time
-       foreach($my_locations as $location)
-       {
-               $controls = array();
-               $components_with_controls_array = array();
-               $location_code = $location["location_code"];
+  $my_planned_controls = array();
+  
+       // Generates an array with planned controls
+       foreach($my_controls as $container_arr)
+       {       
+               $location_code = $container_arr[0];
+               $control_type = $container_arr[1];
+               $controls = $container_arr[2];
+                               
+               foreach($controls as $my_control)
+               {
+                       if($my_control["repeat_type"] == 
controller_control::REPEAT_TYPE_DAY)
+                       {
+                               // Daily control: To_date assigned to one week 
ahead in time if repeat type is daily
+                               $to_date_ts =  mktime(0, 0, 0, date("n"), 
date("j")+7, date("Y") );
+                       }
+                       else if(($my_control["repeat_type"] == 
controller_control::REPEAT_TYPE_WEEK) 
+                                               | ($my_control["repeat_type"] 
== controller_control::REPEAT_TYPE_MONTH) 
+                                               | ($my_control["repeat_type"] 
== controller_control::REPEAT_TYPE_YEAR))
+                       {
+                               // Daily, monthly yearly control: to_date in 
one month
+                               $to_date_ts =  mktime(0, 0, 0, date("n")+1, 
date("j"), date("Y") ); 
+                       }
+               
+                       if($control_type == "location")
+                       {
+        $check_list_array = 
$so_check_list->get_check_lists_for_control_and_location( $my_control['id'], 
$location_code, $from_date_ts, $to_date_ts, $repeat_type = null);
+        
+        foreach($check_list_array as $check_list)
+        {
+          $planned_date_for_check_list = $check_list->get_planned_date();
 
-               $controls_at_location = $so_control->get_controls_by_location( 
$location_code, $from_date_ts, $to_date_ts, $repeat_type, "return_array", 
$location["role_id"] );
-                                   
-               $level = count(explode('-', $location_code));
+          if($planned_date_for_check_list > 0)
+          {
+            $my_planned_controls[$planned_date_for_check_list][] = array( 
$check_list->get_deadline(), $my_control, $check_list->get_id(), "location", 
$location_code );
+          }
+        }
+                       }
+                       else if($control_type == "component")
+                       {
+                               $component = $container_arr[3];
+                               $check_list_array = 
$so_check_list->get_check_lists_for_control_and_component( $my_control['id'], 
$component['location_id'], $component['id'], $from_date_ts, $to_date_ts, 
$repeat_type = null );
+        
+        foreach($check_list_array as $check_list)
+        {
+          $planned_date_for_check_list = $check_list->get_planned_date();
 
-               if($level == 1){
-                       // Fetches all controls for the components for a 
location within time period
-                       $filter = "bim_item.location_code = '$location_code' ";
-                       $components_with_controls_array = 
$so_control->get_controls_by_component($from_date_ts, $to_date_ts, 
$repeat_type, "return_array", $location["role_id"], $filter);      
-               }else
-               {
-                       // Fetches all controls for the components for a 
location within time period
-                       $filter = "bim_item.location_code LIKE 
'$location_code%' ";
-                       $components_with_controls_array = 
$so_control->get_controls_by_component($from_date_ts, $to_date_ts, 
$repeat_type, "return_array", $location["role_id"], $filter);      
-               }
+          if($planned_date_for_check_list > 0)
+          {
+            $my_planned_controls[$planned_date_for_check_list][] = 
array($check_list->get_deadline(), $my_control, "component", 
$component['location_id'], $component['id'] );
+          }
+        }
+                       }
+         }
+  }
 
-               if( count($controls_at_location) > 0 )
+       $my_planned_controls_HTML .= "<ul style='overflow:hidden;'>";
+       
+       foreach($my_planned_controls as $planned_date_ts => 
$planned_controls_on_date)
+       {                       
+               foreach($planned_controls_on_date as $my_planned_control)
                {
-                       // Saves location code, location type and an array 
containing controls at locations
-                       $my_controls[] = array( $location_code, 'location', 
$controls_at_location );
-               }
+                       $deadline_ts = $my_planned_control[0];
+                       $my_control = $my_planned_control[1];
+                       
+      $control_area_name = get_control_area_name( 
$my_control["control_area_id"] );
+                       
+                       $deadline_formatted = date($dateformat, $deadline_ts);
+      $planned_formatted = date($dateformat, $planned_date_ts);
+               
+      $check_list_id = $my_planned_control[2];
+      $location_code = $my_planned_control[3];
 
-               if( count($components_with_controls_array) > 0 )
-               {
-                       foreach($components_with_controls_array as $component)
-                       {
-                               // Saves location code, location type, an array 
containing controls at locations and component object 
-                               $my_controls[] = array( $location_code, 
'component', $component['controls_array'], $component );
-                       }
-               }
+      if(!isset($location_array[$location_code]) || 
!$location_array[$location_code])
+      {
+        $location_array[$location_code] = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
+      }
+      $location_name = $location_array[$location_code]["loc1_name"];
+     
+      $link = "";
+      $link = $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'controller.uicheck_list.edit_check_list', 'check_list_id' => $check_list_id));
+
+      $my_planned_controls_HTML .= "<li><a href='$link'><div 
class='date'>{$planned_formatted}</div><div 
class='date'>{$deadline_formatted}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$location_name}</div><div 
class='control-area'>{$control_area_name}</div></a></li>";
+    }
        }
+               
+       if(count( $planned_controls_on_date ) > 1 )
+       {
+               $my_planned_controls_HTML .= "</li></ul>";
+       }
        
+       echo "\n".'<!-- BEGIN checklist info -->'."\n <h2 class='heading'>Mine 
planlagte kontroller</h2><div class='home-box'>" . $my_planned_controls_HTML . 
"</div></div>\n".'<!-- END checklist info -->'."\n";
+
+       
+       /* =======================================  UNDONE ASSIGNED CONTROLS 
FOR CURRENT USER  ================================= */
+       
+  // from date is set to 3 months back in time
+       $from_date_ts =  mktime(0, 0, 0, date("n")-3, date("j"), date("Y") );
+       $to_date_ts =  mktime(0, 0, 0, date("n"), date("j"), date("Y") );
+  
+  // fetch all repeat types
+       $repeat_type = null;
+  
+  // Fetches controls current user is responsible for 3 months back in time
+  $my_controls = get_my_controls($my_locations, $from_date_ts, $to_date_ts, 
$repeat_type);
+  
        $my_undone_controls = array();
 
        // Generates an array containing undone controls
@@ -224,7 +297,6 @@
                                        
                                        $check_list = 
$so_check_list->get_check_list_for_control_by_date($my_control['id'], 
$deadline_ts, null, null, $component['location_id'], $component['id'], 
"component"  );
                                }
-
                                $control_id = $my_control['id'];
                                
                                if($check_list == null & $control_type == 
"location")
@@ -236,7 +308,7 @@
                                        $component = $container_arr[3];
                                        $my_undone_controls[$deadline_ts][]= 
array("add", $deadline_ts, $my_control, "component", $component['location_id'], 
$component['id'] );
                                }
-                               else if($check_list->get_status() == 
controller_check_list::STATUS_NOT_DONE)
+                               else if( ($check_list->get_status() == 
controller_check_list::STATUS_NOT_DONE) || ($check_list->get_status() == 
controller_check_list::STATUS_CANCELED) ) 
                                {
                                        $my_undone_controls[$deadline_ts][] = 
array("edit", $deadline_ts, $my_control, $check_list->get_id(), $location_code 
);
                                }
@@ -257,7 +329,7 @@
                        if(count( $controls_on_date) > 1 )
                        {
                                $my_undone_controls_HTML .= "<li>";
-                               $my_undone_controls_HTML .= "<a href='#'><h4 
class='expand_trigger'><img height='12' src='controller/images/arrow_right.png' 
/><span class='deadline'>Frist: "  . date($dateformat, $date_ts) .  
"</span><span class='num_check_lists'>Antall kontroller: " .  
count($controls_on_date) . "</span></h4></a>";
+                               $my_undone_controls_HTML .= "<a href='#'><h4 
class='expand_trigger'><img height='12' src='controller/images/arrow_right.png' 
/><span class='deadline'>"  . date($dateformat, $date_ts) .  "</span><span 
class='num_check_lists'>(" .  count($controls_on_date) . " 
kontroller)</span></h4></a>";
                                $my_undone_controls_HTML .= "<ul 
class='expand_list'>";
                        }
                
@@ -267,18 +339,8 @@
                        $deadline_ts = $my_undone_control[1];
                        $my_control = $my_undone_control[2];
                        
-                       $cats   = CreateObject('phpgwapi.categories', -1, 
'controller', '.control');
-                       $cats->supress_info     = true;
-                       $control_areas = 
$cats->formatted_xslt_list(array('format'=>'filter','selected' => '','globals' 
=> true,'use_acl' => $this->_category_acl));
-                       
-                       foreach($control_areas['cat_list'] as $area)
-                       {
-                               if($area['cat_id'] == 
$my_control["control_area_id"])
-                               {
-                                       $control_area_name = $area['name'];
-                               }
-                       }
-                       
+      $control_area_name = get_control_area_name( 
$my_control["control_area_id"] );
+                       
                        $date_str = date($dateformat, $deadline_ts);
                        
                        if($check_list_status == "add")
@@ -299,14 +361,14 @@
                                                $link = "";
                                                $link = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'controller.uicheck_list.add_check_list', 'type' => "location", 'control_id' => 
$my_control['id'], 'location_code' => $location_code, 'deadline_ts' => 
$deadline_ts));
                                        
-                                               $my_undone_controls_HTML .= 
"<li><a href='{$link}'><div class='date'>Fristdato {$date_str}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$location_name}</div><div 
class='control-area'>{$control_area_name}</div></a></li>";
+                                               $my_undone_controls_HTML .= 
"<li><a href='{$link}'><div class='date'>{$date_str}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$location_name}</div><div 
class='control-area'>{$control_area_name}</div></a></li>";
                                        }
                                        else
                                        {
                                                $link = "";
                                                $link = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'controller.uicheck_list.add_check_list', 'type' => "location", 'control_id' => 
$my_control['id'], 'location_code' => $location_code, 'deadline_ts' => 
$deadline_ts));
                                        
-                                               $my_undone_controls_HTML .= "<a 
href='{$link}'><div class='date'>Fristdato {$date_str}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$location_name}</div><div 
class='control-area'>{$control_area_name}</div></a>";
+                                               $my_undone_controls_HTML .= "<a 
href='{$link}'><div class='date'>{$date_str}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$location_name}</div><div 
class='control-area'>{$control_area_name}</div></a>";
                                        }
                                        
                                }
@@ -330,14 +392,14 @@
                                                $link = "";
                                                $link = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'controller.uicheck_list.add_check_list', 'type' => "component", 'control_id' 
=> $my_control['id'], 'location_id' => $location_id, 'component_id' => 
$component_id, 'deadline_ts' => $deadline_ts));
                                        
-                                               $my_undone_controls_HTML .= 
"<li><a href='{$link}'><div class='date'>Fristdato {$date_str}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$short_desc_arr}</div><div 
class='control-area'>{$control_area_name}</div></a></li>";
+                                               $my_undone_controls_HTML .= 
"<li><a href='{$link}'><div class='date'>{$date_str}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$short_desc_arr}</div><div 
class='control-area'>{$control_area_name}</div></a></li>";
                                        }
                                        else
                                        {
                                                $link = "";
                                                $link = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'controller.uicheck_list.add_check_list', 'type' => "component", 'control_id' 
=> $my_control['id'], 'location_id' => $location_id, 'component_id' => 
$component_id, 'deadline_ts' => $deadline_ts));
                                
-                                               $my_undone_controls_HTML .= "<a 
href='{$link}'><div class='date'>Fristdato {$date_str}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$short_desc_arr}</div><div 
class='control-area'>{$control_area_name}</div></a>";
+                                               $my_undone_controls_HTML .= "<a 
href='{$link}'><div class='date'>{$date_str}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$short_desc_arr}</div><div 
class='control-area'>{$control_area_name}</div></a>";
                                        }
                                }       
                        }
@@ -357,14 +419,14 @@
                                        $link = "";
                                        $link = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'controller.uicheck_list.edit_check_list', 'check_list_id' => $check_list_id));
                        
-                                       $my_undone_controls_HTML .= "<li><a 
href='{$link}'><div class='date'>Fristdato {$date_str}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$location_name}</div><div 
class='control-area'>{$control_area_name}</div></a></li>";
+                                       $my_undone_controls_HTML .= "<li><a 
href='{$link}'><div class='date'>{$date_str}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$location_name}</div><div 
class='control-area'>{$control_area_name}</div></a></li>";
                                }       
                                else
                                {
                                        $link = "";
                                        $link = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'controller.uicheck_list.edit_check_list', 'check_list_id' => $check_list_id));
                        
-                                       $my_undone_controls_HTML .= "<a 
href='{$link}'><div class='date'>Fristdato {$date_str}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$location_name}</div><div 
class='control-area'>{$control_area_name}</div></a>";
+                                       $my_undone_controls_HTML .= "<a 
href='{$link}'><div class='date'>{$date_str}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$location_name}</div><div 
class='control-area'>{$control_area_name}</div></a>";
                                }
                        }
                }
@@ -377,173 +439,24 @@
        
        $my_undone_controls_HTML .= "</div>"; // home_portal
        
-       echo "\n".'<!-- BEGIN checklist info -->'."\n <h2 class='heading'>Mine 
glemte kontroller</h2><div 
class='home-box'>".$my_undone_controls_HTML."</div>\n".'<!-- END checklist info 
-->'."\n";
+       echo "\n".'<!-- BEGIN checklist info -->'."\n <h2 class='heading'>Mine 
ugjorte kontroller</h2><div 
class='home-box'>".$my_undone_controls_HTML."</div>\n".'<!-- END checklist info 
-->'."\n";
 
        
-       /* =======================================  PLANNED CONTROLS FOR 
CURRENT USER  ================================= */
-
-       $repeat_type = null;
-       $controls_for_location_array = array();
-       foreach($my_locations as $location)
-       {
-
-               $controls = array();
-               $controls_loc = 
$so_control->get_controls_by_location($location["location_code"], 
$from_date_ts, $to_date_ts, $repeat_type, "return_array", $location["role_id"] 
);
-               $controls_comp = 
$so_control->get_controls_for_components_by_location($location["location_code"],
 $from_date_ts, $to_date_ts, $repeat_type, $location["role_id"] );
-           
-               foreach($controls_loc as $cl)
-               {
-                       $controls[] = $cl;
-               }
-           
-               foreach($controls_comp as $cc)
-         {
-                       $controls[] = $cc;
-               }
-           
-               $controls_for_location_array[] = 
array($location["location_code"], $controls);
-       }
-
-       $controls_array = array();
-       $control_dates = array();
-       foreach($controls_for_location_array as $control_arr)
-       {
-               $current_location = $control_arr[0];
-               $controls_for_loc_array = $control_arr[1];
-               foreach($controls_for_loc_array as $control)
-               {
-                       $date_generator = new 
date_generator($control["start_date"], $control["end_date"], $from_date_ts, 
$to_date_ts, $control["repeat_type"], $control["repeat_interval"]);
-                       $controls_array[] = array($current_location, $control, 
$date_generator->get_dates());
-               }
-       }
-
-       $portalbox1 = CreateObject('phpgwapi.listbox', array
-       (
-               'title'         => "<div class='date 
heading'>Fristdato</div><div class='control heading'>Tittel på 
kontroll</div><div class='title heading'>Lokasjonsnavn</div><div 
class='control-area heading'>Kontrollområde</div>",
-               'primary'       => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
-               'secondary'     => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
-               'tertiary'      => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
-               'width' => '100%',
-               'outerborderwidth'      => '0',
-               'header_background_image'       => 
$GLOBALS['phpgw']->common->image('phpgwapi','bg_filler', '.png', False)
-       ));
-
-       $category_name = array(); // caching
-       
-       $cats   = CreateObject('phpgwapi.categories', -1, 'controller', 
'.control');
-       $cats->supress_info     = true;
-       $control_areas = 
$cats->formatted_xslt_list(array('format'=>'filter','selected' => '','globals' 
=> true,'use_acl' => $this->_category_acl));
-
-       $portalbox1->data = array();
-       $portalbox1_data = array();
-       foreach ($controls_array as $control_instance)
-       {
-               $curr_location = $control_instance[0];
-               $current_control = $control_instance[1];
-               $check_lists = 
$so_check_list->get_planned_check_lists_for_control($current_control["id"], 
$curr_location, $current_control['location_id'], 
$current_control['component_id']);
-
-               if(!isset($location_array[$curr_location]) || 
!$location_array[$curr_location])
-               {
-                       $location_array[$curr_location] = 
execMethod('property.bolocation.read_single', array('location_code' => 
$curr_location));
-               }
-               $location_name = $location_array[$curr_location]["loc1_name"];
-
-               if(isset($current_control['component_id']) && 
$current_control['component_id'])
-               {
-//_debug_array($current_control);
-                       
if(!isset($component_short_desc[$current_control['location_id']][$current_control['component_id']]))
-                       {
-                               
$component_short_desc[$current_control['location_id']][$current_control['component_id']]
 = execMethod('property.soentity.get_short_description', array('location_id' => 
$current_control['location_id'], 'id' => $current_control['component_id']));
-                       }
-                       
-                       
if($component_short_desc[$current_control['location_id']][$current_control['component_id']])
-                       {
-                               $location_name .= 
"::{$component_short_desc[$current_control['location_id']][$current_control['component_id']]}";
-                       }
-               }
-
-               foreach($control_areas['cat_list'] as $area)
-               {
-                       if($area['cat_id'] == 
$current_control["control_area_id"])
-                       {
-                               $control_area_name = $area['name'];
-                       }
-               }
-               foreach($check_lists as $check_list)
-               {
-                       $next_date = "Planlagt: " . date($dateformat, 
$check_list->get_planned_date());
-                       $portalbox1_data[] = array(
-                               $check_list->get_planned_date(), array(
-                                       'text' => "<div 
class='date'>{$next_date}</div><div 
class='control'>{$current_control["title"]}</div><div 
class='title'>{$location_name}</div><div 
class='control-area'>{$control_area_name}</div>",
-                                       'link' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'controller.uicheck_list.edit_check_list', 'check_list_id' => 
$check_list->get_id()))
-                       ));
-               }
-       }
-       //sort data by planned date for check list
-       sort($portalbox1_data);
-       //$limit = 5;
-       $tmp = 0;
-       foreach($portalbox1_data as $check_list_dates)
-       {
-               if($tmp < $limit_no_of_planned)
-               {
-                       $portalbox1->data[] = $check_list_dates[1];
-               }
-               $tmp++;
-       }
-       echo "\n".'<!-- BEGIN checklist info -->'."\n<h2 class='heading'>Mine 
planlagte kontroller</h2><div 
class='home-box'>".$portalbox1->draw()."</div>\n".'<!-- END checklist info 
-->'."\n";
-
-       
-       
        /* ================================  CONTROLS ASSIGNED TO CURRENT USER  
================================= */
        
        $my_assigned_controls_HTML = "<div class='home_portal'><h2><div 
class='date heading'>Fristdato</div><div class='control heading'>Tittel på 
kontroll</div><div class='title heading'>Lokasjonsnavn</div><div 
class='control-area heading'>Kontrollområde</div></h2>";
        
-       $my_controls = array();
-       $repeat_type = null;
        
        $from_date_ts =  strtotime("now");
        $to_date_ts = mktime(0, 0, 0, date("n")+1, date("j"), date("Y") );
+         
+  // fetch all repeat types
+       $repeat_type = null;
+  
+  // Fetches controls current user is responsible for 1 month ahead in time
+  $my_controls = array();
+  $my_controls = get_my_controls($my_locations, $from_date_ts, $to_date_ts, 
$repeat_type);
        
-       // Fetches controls current user is responsible for
-       $my_controls = array();
-       foreach($my_locations as $location)
-       {
-               $controls = array();
-               $components_with_controls_array = array();
-               $location_code = $location["location_code"];
-                                               
-               $controls_loc = $so_control->get_controls_by_location( 
$location_code, $from_date_ts, $to_date_ts, $repeat_type, "return_array", 
$location["role_id"] );
-                                   
-               $level = count(explode('-', $location_code));
-
-               if($level == 1)
-               {
-                       // Fetches all controls for the components for a 
location within time period
-                       $filter = "bim_item.location_code = '$location_code' ";
-                       $components_with_controls_array = 
$so_control->get_controls_by_component($from_date_ts, $to_date_ts, 
$repeat_type, "return_array", $location["role_id"], $filter);      
-               }
-               else
-               {
-                       // Fetches all controls for the components for a 
location within time period
-                       $filter = "bim_item.location_code LIKE 
'$location_code%' ";
-                       $components_with_controls_array = 
$so_control->get_controls_by_component($from_date_ts, $to_date_ts, 
$repeat_type, "return_array", $location["role_id"], $filter);      
-               }
-
-               if( count($controls_loc) > 0 )
-               {
-                       $my_controls[] = array( $location_code, 'location', 
$controls_loc );
-               }
-
-               if( count($components_with_controls_array) > 0 )
-               {
-                       foreach($components_with_controls_array as $component)
-                       {
-                   $my_controls[] = array( $location_code, 'component', 
$component['controls_array'], $component );
-                       }
-               }
-       }
-       
        $my_assigned_controls = array();
 
        $from_date_ts =  mktime(0, 0, 0, date("n"), date("j"), date("Y") );
@@ -566,10 +479,10 @@
                                                | ($my_control["repeat_type"] 
== controller_control::REPEAT_TYPE_MONTH) 
                                                | ($my_control["repeat_type"] 
== controller_control::REPEAT_TYPE_YEAR))
                        {
-                               // Daily, monthly yearly control: Todate in one 
month
+                               // Daily, monthly yearly control: to_date in 
one month
                                $to_date_ts =  mktime(0, 0, 0, date("n")+1, 
date("j"), date("Y") ); 
                        }
-
+      
                        $date_generator = new 
date_generator($my_control["start_date"], $my_control["end_date"], 
$from_date_ts, $to_date_ts, $my_control["repeat_type"], 
$my_control["repeat_interval"]);
                        $deadline_dates_for_control = 
$date_generator->get_dates();
 
@@ -580,14 +493,18 @@
                                
                                if($control_type == "location")
                                {
+          // Gets checklist for control with current date as deadline if there 
exists one
                                        $check_list = 
$so_check_list->get_check_list_for_control_by_date($my_control['id'], 
$deadline_ts, null, $location_code, null, null, "location"  );
                                }
                                else if($control_type == "component")
                                {
                                        $component = $container_arr[3];
+          
+          // Gets checklist for control with current date as deadline if there 
exists one
                                        $check_list = 
$so_check_list->get_check_list_for_control_by_date($my_control['id'], 
$deadline_ts, null, null, $component['location_id'], $component['id'], 
"component"  );
                                }
-                               
+        
+        // Check if there is a checklist on the deadline
                                if($check_list == null)
                                {      
                                        if($control_type == "location")
@@ -600,9 +517,10 @@
                                                
$my_assigned_controls[$deadline_ts][] =  array("add", $deadline_ts, 
$my_control, "component", $component['location_id'], $component['id'] );
                      }
                                }
-                               else if($check_list->get_status() == 
controller_check_list::STATUS_NOT_DONE)
+        // Do not put checklist with status planned in list
+                               else if( ($check_list->get_planned_date() == '' 
|| $check_list->get_planned_date() == 0 ) && ( $check_list->get_status() == 
controller_check_list::STATUS_NOT_DONE || ($check_list->get_status() == 
controller_check_list::STATUS_CANCELED)) )
                                {
-                                       $my_assigned_controls[$deadline_ts][] = 
array("edit", $deadline_ts, $my_control, $check_list->get_id(), $location_code 
);
+                       $my_assigned_controls[$deadline_ts][] = array("edit", 
$deadline_ts, $my_control, $check_list->get_id(), $location_code );
                                }
                        }
                }
@@ -620,21 +538,21 @@
                if(count( $assigned_controls_on_date) > 1 )
                {
                        $my_assigned_controls_HTML .= "<li>";
-                       $my_assigned_controls_HTML .= "<a href='#'><h4 
class='expand_trigger'><img height='12' src='controller/images/arrow_right.png' 
/><span class='deadline'>Frist: "  . date($dateformat, $date_ts) .  
"</span><span class='num_controls'>Antall kontroller: " .  
count($assigned_controls_on_date) . "</span></h4></a>";
+                       $my_assigned_controls_HTML .= "<a href='#'><h4 
class='expand_trigger'><img height='12' src='controller/images/arrow_right.png' 
/><span class='deadline'>"  . date($dateformat, $date_ts) .  "</span><span 
class='num_controls'>(" .  count($assigned_controls_on_date) . " 
kontroller)</span></h4></a>";
                }
                
                if(count( $assigned_controls_on_date ) > 1 )
                {
                        $my_assigned_controls_HTML .= "<ul 
class='expand_list'>";
                } 
-                       
+               
                foreach($assigned_controls_on_date as $my_assigned_control)
                {
                        $check_list_status = $my_assigned_control[0];
                        $deadline_ts = $my_assigned_control[1];
                        $my_control = $my_assigned_control[2];
                        
-                   reset($control_areas['cat_list']);    
+                 reset($control_areas['cat_list']);    
                        
                        foreach($control_areas['cat_list'] as $area)
                        {
@@ -660,20 +578,19 @@
                                        }
                                        $location_name = 
$location_array[$location_code]["loc1_name"];
                        
-                                       
-                               if(count( $assigned_controls_on_date) > 1 )
+          if(count( $assigned_controls_on_date) > 1 )
                                        {
                                                $link = "";
                                                $link = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'controller.uicheck_list.add_check_list', 'type' => "location", 'control_id' => 
$my_control['id'], 'location_code' => $location_code, 'deadline_ts' => 
$deadline_ts));
                                                
-                                               $my_assigned_controls_HTML .= 
"<li><a href='$link'><div class='date'>Fristdato {$date_str}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$location_name}</div><div 
class='control-area'>{$control_area_name}</div></a></li>";
+                                               $my_assigned_controls_HTML .= 
"<li><a href='$link'><div class='date'>{$date_str}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$location_name}</div><div 
class='control-area'>{$control_area_name}</div></a></li>";
                                        }
                                        else
                                        {
                                                $link = "";
                                                $link = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'controller.uicheck_list.add_check_list', 'type' => "location", 'control_id' => 
$my_control['id'], 'location_code' => $location_code, 'deadline_ts' => 
$deadline_ts));
                                                
-                                               $my_assigned_controls_HTML .= 
"<a href='$link'><div class='date'>Fristdato {$date_str}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$location_name}</div><div 
class='control-area'>{$control_area_name}</div></a>";
+                                               $my_assigned_controls_HTML .= 
"<a href='$link'><div class='date'>{$date_str}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$location_name}</div><div 
class='control-area'>{$control_area_name}</div></a>";
                                        }
                                }
                                else if($check_list_type == "component")
@@ -696,14 +613,14 @@
                                                $link = "";
                                                $link = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'controller.uicheck_list.add_check_list', 'type' => "component", 'control_id' 
=> $my_control['id'], 'location_id' => $location_id, 'component_id' => 
$component_id, 'deadline_ts' => $deadline_ts));
                                                
-                                               $my_assigned_controls_HTML .= 
"<li><a href='$link'><div class='date'>Fristdato {$date_str}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$short_desc_arr}</div><div 
class='control-area'>{$control_area_name}</div></a></li>";
+                                               $my_assigned_controls_HTML .= 
"<li><a href='$link'><div class='date'>{$date_str}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$short_desc_arr}</div><div 
class='control-area'>{$control_area_name}</div></a></li>";
                                        }
                                        else
                                        {
                                                $link = "";
                                                $link = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'controller.uicheck_list.add_check_list', 'type' => "component", 'control_id' 
=> $my_control['id'], 'location_id' => $location_id, 'component_id' => 
$component_id, 'deadline_ts' => $deadline_ts));
                                                
-                                               $my_assigned_controls_HTML .= 
"<a href='$link'><div class='date'>Fristdato {$date_str}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$short_desc_arr}</div><div 
class='control-area'>{$control_area_name}</div></a>";
+                                               $my_assigned_controls_HTML .= 
"<a href='$link'><div class='date'>{$date_str}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$short_desc_arr}</div><div 
class='control-area'>{$control_area_name}</div></a>";
                                        }
                                }       
                        }
@@ -723,14 +640,14 @@
                                        $link = "";
                                        $link = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'controller.uicheck_list.edit_check_list', 'check_list_id' => $check_list_id));
                                        
-                                       $my_assigned_controls_HTML .= "<li><a 
href='$link'><div class='date'>Fristdato {$date_str}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$location_name}</div><div 
class='control-area'>{$control_area_name}</div></a></li>";
+                                       $my_assigned_controls_HTML .= "<li><a 
href='$link'><div class='date'>{$date_str}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$location_name}</div><div 
class='control-area'>{$control_area_name}</div></a></li>";
                                }
                                else
                                {
                                        $link = "";
                                        $link = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'controller.uicheck_list.edit_check_list', 'check_list_id' => $check_list_id));
                                        
-                                       $my_assigned_controls_HTML .= "<a 
href='$link'><div class='date'>Fristdato {$date_str}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$location_name}</div><div 
class='control-area'>{$control_area_name}</div></a>";
+                                       $my_assigned_controls_HTML .= "<a 
href='$link'><div class='date'>{$date_str}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$location_name}</div><div 
class='control-area'>{$control_area_name}</div></a>";
                                }
                        }
                }
@@ -743,8 +660,77 @@
                if(count( $assigned_controls_on_date ) > 1 )
                {
                        $my_assigned_controls_HTML .= "</ul>";
-                }
-                 
+    }
        }
 
        echo "\n".'<!-- BEGIN checklist info -->'."\n <h2 class='heading'>Mine 
tildelte kontroller</h2><div class='home-box'>" . $my_assigned_controls_HTML . 
"</div></div>\n".'<!-- END checklist info -->'."\n";
+
+  
+  
+  /* ================================  FUNCTIONS  
======================================== */
+  
+  
+  function get_my_controls($my_locations, $from_date_ts, $to_date_ts, 
$repeat_type)
+  {
+    $so_control = CreateObject('controller.socontrol');
+    
+    foreach($my_locations as $location)
+    {
+      
+      $controls = array();
+      $components_with_controls_array = array();
+      $location_code = $location["location_code"];
+      
+      $controls_at_location = $so_control->get_controls_by_location( 
$location_code, $from_date_ts, $to_date_ts, $repeat_type, "return_array", 
$location["role_id"] );
+
+      $level = count(explode('-', $location_code));
+
+      if($level == 1)
+      {
+        // Fetches all controls for the components for a location within time 
period
+        $filter = "bim_item.location_code = '$location_code' ";
+        $components_with_controls_array = 
$so_control->get_controls_by_component($from_date_ts, $to_date_ts, 
$repeat_type, "return_array", $location["role_id"], $filter);     
+      }
+      else
+      {
+        // Fetches all controls for the components for a location within time 
period
+        $filter = "bim_item.location_code LIKE '$location_code%' ";
+        $components_with_controls_array = 
$so_control->get_controls_by_component($from_date_ts, $to_date_ts, 
$repeat_type, "return_array", $location["role_id"], $filter);     
+      }
+
+      if( count($controls_at_location) > 0 )
+      {
+        // Saves location code, location type and an array containing controls 
at locations
+        $my_controls[] = array( $location_code, 'location', 
$controls_at_location );
+      }
+
+      if( count($components_with_controls_array) > 0 )
+      {
+        foreach($components_with_controls_array as $component)
+        {
+          // Saves location code, location type, an array containing controls 
at locations and component object 
+          $my_controls[] = array( $location_code, 'component', 
$component['controls_array'], $component );
+        }
+      }
+    }
+    
+    return $my_controls;
+  }
+  
+  function get_control_area_name( $control_area_id ) 
+  {
+    $cats      = CreateObject('phpgwapi.categories', -1, 'controller', 
'.control');
+    $cats->supress_info        = true;
+    
+    $control_areas = 
$cats->formatted_xslt_list(array('format'=>'filter','selected' => '','globals' 
=> true,'use_acl' => 0));
+   
+    foreach($control_areas['cat_list'] as $area)
+               {
+      if( $area['cat_id'] == $control_area_id )
+                       {
+                               $control_area_name = $area['name'];
+                       }
+               }
+   
+    return $control_area_name;
+  }
\ No newline at end of file

Modified: 
branches/Version-1_0-branch/controller/inc/model/class.check_list.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/model/class.check_list.inc.php   
2013-02-11 19:15:42 UTC (rev 10796)
+++ branches/Version-1_0-branch/controller/inc/model/class.check_list.inc.php   
2013-02-12 12:18:01 UTC (rev 10797)
@@ -205,19 +205,12 @@
                  }
                 
                  // Validate STATUS                              
-                       if( $this->status != 0 and $this->status != 1 )
+                       if( ($this->status != 
controller_check_list::STATUS_NOT_DONE) && ($this->status != 
controller_check_list::STATUS_DONE) && ($this->status != 
controller_check_list::STATUS_CANCELED))
                  { 
                        $status = false;
                        $this->error_msg_array['status'] = "error_msg_2";
                  }
-                 
-                       // Validate STATUS ON PLANNED DATE                      
          
-                       if( $this->status == 0 and ( $this->planned_date == '' 
or $this->planned_date == 0) )
-                 { 
-                       $status = false;
-                       $this->error_msg_array['status'] = "error_msg_7";
-                 }
-
+                   
                  // Validate COMPLETED DATE when STATUS:DONE                   
          
                        if( ($this->status == 
controller_check_list::STATUS_DONE) && empty($this->completed_date) )
                  {

Deleted: 
branches/Version-1_0-branch/controller/inc/model/class.control_area.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/model/class.control_area.inc.php 
2013-02-11 19:15:42 UTC (rev 10796)
+++ branches/Version-1_0-branch/controller/inc/model/class.control_area.inc.php 
2013-02-12 12:18:01 UTC (rev 10797)
@@ -1,78 +0,0 @@
-<?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$
-       */
-
-       include_class('controller', 'model', 'inc/model/');
-       /*
-       class controller_control_area extends controller_model
-       {
-               public static $so;
-
-               protected $id;
-               protected $title;
-               
-               
-               public function __construct(int $id = null)
-               {
-                       $this->id = (int)$id;
-               }
-               
-               public function set_id($id)
-               {
-                       $this->id = $id;
-               }
-               
-               public function get_id() { return $this->id; }
-
-               public function set_title($title)
-               {
-                       $this->title = $title;
-               }
-               
-               public function get_title(){ return $this->title; }
-                       
-               public function serialize()
-               {
-                       return array(
-                                       'id' => $this->get_id(),
-                                       'title' => $this->get_title()
-                       );
-               }
-               
-       
-               public static function get_so()
-               {
-                       if (self::$so == null) {
-                               self::$so = 
CreateObject('controller_control_area');
-                       }
-                       
-                       return self::$so;
-               }
-               */
-       }

Modified: branches/Version-1_0-branch/controller/js/controller/ajax.js
===================================================================
--- branches/Version-1_0-branch/controller/js/controller/ajax.js        
2013-02-11 19:15:42 UTC (rev 10796)
+++ branches/Version-1_0-branch/controller/js/controller/ajax.js        
2013-02-12 12:18:01 UTC (rev 10797)
@@ -1,11 +1,5 @@
 $(document).ready(function(){
-
        
-       function ajaxRequest(request, callback_func, elem){
-               
-               
-       }
-       
        $("#curtain").click(function() {
                $("#curtain").hide();
                $("#popupBox").hide();
@@ -536,25 +530,18 @@
                
                $(thisForm).find(".input_error_msg").remove();
                
-               // Checks that COMPLETE DATE is set if status is set to DONE 
+               // Is COMPLETED DATE assigned when STATUS is done 
                if(statusFieldVal == 1 && completedDateVal == ''){
                        e.preventDefault();
                        // Displays error message above completed date
                        $(completedDateRow).before("<div 
class='input_error_msg'>Vennligst angi når kontrollen ble utført</div>");
                }
+    // Is COMPLETED DATE assigned when STATUS is not done
                else if(statusFieldVal == 0 && completedDateVal != ''){
                        e.preventDefault();
                        // Displays error message above completed date
                        $(statusRow).before("<div class='input_error_msg'>Du 
har angitt utførtdato, men status er Ikke utført. Vennligst endre status til 
utført</div>");
                }
-               else if(statusFieldVal == 0 & plannedDateVal == ''){
-                       e.preventDefault();
-                       // Displays error message above planned date
-                       if( 
!$(plannedDateRow).prev().hasClass("input_error_msg") )
-                       {
-                         $(plannedDateRow).before("<div 
class='input_error_msg'>Vennligst endre status for kontroll eller angi 
planlagtdato</div>");   
-                       }
-               }               
        });     
        
        // Display submit button on click
@@ -605,13 +592,14 @@
        });
        
        // Display submit button on click
-       $("#frm_update_check_list").live("click", function(e){
+       /*
+  $("#frm_update_check_list").live("click", function(e){
                var thisForm = $(this);
                var submitBnt = $(thisForm).find("input[type='submit']");
                $(submitBnt).removeClass("not_active");
        });
+       */
        
-       
        //=======================================  CASE  
======================================
        
        // REGISTER CASE

Modified: branches/Version-1_0-branch/controller/js/controller/custom_ui.js
===================================================================
--- branches/Version-1_0-branch/controller/js/controller/custom_ui.js   
2013-02-11 19:15:42 UTC (rev 10796)
+++ branches/Version-1_0-branch/controller/js/controller/custom_ui.js   
2013-02-12 12:18:01 UTC (rev 10797)
@@ -17,27 +17,18 @@
                        $(this).parent().parent().addClass('active');
                }
        });
-       
-       
-       /* ==========================  EXPANDING/COLLAPSING ALL LISTS 
====================== */
-       
-       $(".expand_all").live("click", function(){
-               
-               $(this).addClass("focus");
-               $(".collapse_all").removeClass("focus");
-                       
-               $("ul.expand_list").find(".expand_item").slideDown("slow");
-               $("ul.expand_list").find(".expand_item").addClass("active");
-               $("ul.expand_list").find("li h4 img").attr("src", 
"controller/images/arrow_down.png");
+  
+  $(".expand-trigger").live("click", function(){
+    var parentNode = $(this).closest("li");
+    
+               if( $(parentNode).hasClass('expanded')){
+                       $(parentNode).find(".expand_list").slideUp("slow");
+                       $(parentNode).find("img").first().attr("src", 
"controller/images/arrow_right.png");
+                       $(parentNode).removeClass('expanded');
+               }else{
+                       $(parentNode).find(".expand_list").slideDown("slow");
+                       $(parentNode).find("img").first().attr("src", 
"controller/images/arrow_down.png");
+                       $(parentNode).addClass('expanded');
+               }
        });
-       
-       $(".collapse_all").live("click", function(){
-               $(this).addClass("focus");
-               $(".expand_all").removeClass("focus");
-               
-               $("ul.expand_list").find(".expand_item").slideUp("slow");
-               $("ul.expand_list").find(".expand_item").removeClass("active");
-               $("ul.expand_list").find("li h4 img").attr("src", 
"controller/images/arrow_right.png");
-       });
-       
 });
\ No newline at end of file

Modified: 
branches/Version-1_0-branch/controller/templates/base/calendar/check_list_status_manager.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/calendar/check_list_status_manager.xsl
        2013-02-11 19:15:42 UTC (rev 10796)
+++ 
branches/Version-1_0-branch/controller/templates/base/calendar/check_list_status_manager.xsl
        2013-02-12 12:18:01 UTC (rev 10797)
@@ -3,7 +3,7 @@
 
   <xsl:param name="location_code" />
   <xsl:variable name="session_url">&amp;<xsl:value-of 
select="php:function('get_phpgw_session_url')" /></xsl:variable>
- 
+
   <xsl:choose>
     <xsl:when test="status = 'CONTROL_REGISTERED'">
       <a>
@@ -24,7 +24,7 @@
             </xsl:when>
             <xsl:otherwise>
               <xsl:text>&amp;location_code=</xsl:text>
-              <xsl:value-of select="info/location_code"/>  
+              <xsl:value-of select="info/location_code"/>
             </xsl:otherwise>
           </xsl:choose>
                 <xsl:value-of select="$session_url"/>
@@ -62,7 +62,7 @@
             </xsl:when>
             <xsl:otherwise>
               <xsl:text>&amp;location_code=</xsl:text>
-              <xsl:value-of select="info/location_code"/>  
+              <xsl:value-of select="info/location_code"/>
             </xsl:otherwise>
           </xsl:choose>
                 <xsl:value-of select="$session_url"/>
@@ -98,7 +98,7 @@
           
<xsl:text>index.php?menuaction=controller.uicheck_list.edit_check_list</xsl:text>
           <xsl:text>&amp;check_list_id=</xsl:text>
           <xsl:value-of select="info/check_list_id"/>
-                <xsl:value-of select="$session_url"/>
+            <xsl:value-of select="$session_url"/>
         </xsl:attribute>
         <span class="ext_info">
           <xsl:value-of select="info/id"/>
@@ -114,7 +114,7 @@
             
<xsl:text>index.php?menuaction=controller.uicheck_list.edit_check_list</xsl:text>
             <xsl:text>&amp;check_list_id=</xsl:text>
             <xsl:value-of select="info/check_list_id"/>
-                <xsl:value-of select="$session_url"/>
+              <xsl:value-of select="$session_url"/>
           </xsl:attribute>
           <span class="ext_info">
             <xsl:value-of select="info/id"/>
@@ -131,7 +131,7 @@
             
<xsl:text>index.php?menuaction=controller.uicheck_list.edit_check_list</xsl:text>
             <xsl:text>&amp;check_list_id=</xsl:text>
             <xsl:value-of select="info/check_list_id"/>
-                <xsl:value-of select="$session_url"/>
+              <xsl:value-of select="$session_url"/>
           </xsl:attribute>
           <span class="ext_info">
             <xsl:text>&amp;check_list_id=</xsl:text>
@@ -143,7 +143,15 @@
       </div>
     </xsl:when>
     <xsl:when test="status = 'CONTROL_CANCELED'">
-      <img height="15" src="controller/images/status_icon_red_cross.png" />
+      <a>
+        <xsl:attribute name="href">
+          
<xsl:text>index.php?menuaction=controller.uicheck_list.edit_check_list</xsl:text>
+          <xsl:text>&amp;check_list_id=</xsl:text>
+          <xsl:value-of select="info/check_list_id"/>
+            <xsl:value-of select="$session_url"/>
+        </xsl:attribute>
+        <img height="15" src="controller/images/status_icon_black_cross.png" />
+      </a>
     </xsl:when>
     <xsl:when test="status = 'CONTROLS_DONE_WITH_ERRORS'">
       <div class="info_box_wrp">
@@ -196,7 +204,7 @@
           <xsl:value-of select="//current_year"/>
           <xsl:text>&amp;month=</xsl:text>
           <xsl:number />
-                <xsl:value-of select="$session_url"/>
+          <xsl:value-of select="$session_url"/>
         </xsl:attribute>
         <img height="15" src="controller/images/status_icon_red_cross.png" />
       </a>
@@ -214,7 +222,7 @@
               
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
               <xsl:text>&amp;location_code=</xsl:text>
               <xsl:value-of select="info/location_code"/>
-            </xsl:when> 
+            </xsl:when>
           </xsl:choose>
           <xsl:text>&amp;month=</xsl:text>
           <xsl:value-of select="info/month"/>

Modified: 
branches/Version-1_0-branch/controller/templates/base/calendar/icon_color_map.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/calendar/icon_color_map.xsl
   2013-02-11 19:15:42 UTC (rev 10796)
+++ 
branches/Version-1_0-branch/controller/templates/base/calendar/icon_color_map.xsl
   2013-02-12 12:18:01 UTC (rev 10797)
@@ -1,7 +1,6 @@
 <!-- $Id: view_calendar_month.xsl 9200 2012-04-21 20:05:34Z vator $ -->
 <xsl:template name="icon_color_map" xmlns:php="http://php.net/xsl";>
-
-  <ul id="icon_color_map">
+   <ul id="icon_color_map">
     <li>
       <img height="15" src="controller/images/status_icon_yellow_ring.png" />
       <span>Kontroll satt opp</span>
@@ -26,6 +25,9 @@
       <img height="15" src="controller/images/status_icon_red_cross.png" />
       <span>Kontroll ikke gjennomført</span>
     </li>
+    <li>
+      <img height="15" src="controller/images/status_icon_black_cross.png" />
+      <span>Kontroll kansellert</span>
+    </li>
   </ul>
-                               
 </xsl:template>

Modified: 
branches/Version-1_0-branch/controller/templates/base/case/view_case_message.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/case/view_case_message.xsl
    2013-02-11 19:15:42 UTC (rev 10796)
+++ 
branches/Version-1_0-branch/controller/templates/base/case/view_case_message.xsl
    2013-02-12 12:18:01 UTC (rev 10797)
@@ -39,7 +39,7 @@
                                                </xsl:otherwise>
                                        </xsl:choose>
                                </xsl:attribute>
-                               Kontrollplan for bygg/eiendom (år)
+                               Vis kontrollplan (år)
                        </a>
                                
                        <a class="last">
@@ -59,7 +59,7 @@
                                                </xsl:otherwise>
                                        </xsl:choose>
                                </xsl:attribute>
-                               Kontrolplan for bygg/eiendom (måned)
+                               Vis kontrollplan (måned)
                        </a>
                </div>
                

Modified: 
branches/Version-1_0-branch/controller/templates/base/check_list/add_case.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/add_case.xsl   
    2013-02-11 19:15:42 UTC (rev 10796)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/add_case.xsl   
    2013-02-12 12:18:01 UTC (rev 10797)
@@ -1,11 +1,8 @@
 <!-- $Id: choose_control_items.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
-
 <xsl:template match="data" xmlns:php="http://php.net/xsl";>
-
 <xsl:variable name="session_url">&amp;<xsl:value-of 
select="php:function('get_phpgw_session_url')" /></xsl:variable>
 
 <div id="main_content" class="medium">
-       
        <div id="check-list-heading">
                <div class="box-1">
                        <h1>Kontroll: <xsl:value-of 
select="control/title"/></h1>
@@ -26,44 +23,7 @@
                        </xsl:choose>
                </div>
                <div class="box-2 select-box">
-                       <a>
-                               <xsl:attribute name="href">
-                                       
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_year</xsl:text>
-                                       <xsl:text>&amp;year=</xsl:text>
-                                       <xsl:value-of select="current_year"/>
-                                       <xsl:text>&amp;location_code=</xsl:text>
-                                       <xsl:choose>
-                                         <xsl:when test="type = 'component'">
-                                                 <xsl:value-of 
select="building_location_code"/>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                 <xsl:value-of 
select="location_array/location_code"/>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       <xsl:value-of select="$session_url"/>
-                               </xsl:attribute>
-                               Kontrolplan for bygg/eiendom (år)
-                       </a>
-                       <a class="last">
-                               <xsl:attribute name="href">
-                                       
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
-                                       <xsl:text>&amp;year=</xsl:text>
-                                       <xsl:value-of select="current_year"/>
-                                       <xsl:text>&amp;month=</xsl:text>
-                                       <xsl:value-of 
select="current_month_nr"/>
-                                       <xsl:text>&amp;location_code=</xsl:text>
-                                       <xsl:choose>
-                                         <xsl:when test="type = 'component'">
-                                                 <xsl:value-of 
select="building_location_code"/>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                 <xsl:value-of 
select="location_array/location_code"/>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       <xsl:value-of select="$session_url"/>
-                               </xsl:attribute>
-                               Kontrolplan for bygg/eiendom (måned)
-                       </a>
+      <xsl:call-template name="nav_control_plan" />
                </div>
                
                <!-- ==================  CHECKLIST TAB MENU  
===================== -->
@@ -77,17 +37,15 @@
                <h3 class="box_header ext">Registrer sak/måling</h3>
                <div class="tab_item active ext">
                
-               <div class="expand_menu"><div class="expand_all">Vis 
alle</div><div class="collapse_all focus">Skjul alle</div></div>
-               
                <xsl:variable name="action_url"><xsl:value-of 
select="php:function('get_phpgw_link', '/index.php', 
'menuaction:controller.uicase.add_case,phpgw_return_as:json')" /></xsl:variable>
 
-               <ul class="control_groups">
+               <ul class="add-cases">
                        <xsl:for-each select="control_groups_with_items_array">
                        <xsl:choose>
                                <xsl:when test="control_items/child::node()">
                                        <li>
-                                               <h3><xsl:value-of 
select="control_group/group_name"/></h3>                              
-                                               <ul class="expand_list">
+                                               <h3 class="expand-trigger"><img 
src="controller/images/arrow_right.png" /><xsl:value-of 
select="control_group/group_name"/></h3>                                
+                                               <ul class="expand_list" 
style="display:none;">
                                                        <xsl:for-each 
select="control_items">
                                                                <li>
                                                                        
<h4><img src="controller/images/arrow_right.png" /><span><xsl:value-of 
select="title"/></span></h4>     
@@ -97,16 +55,32 @@
                                                                                
                        <xsl:variable name="control_item_id"><xsl:value-of 
select="id"/></xsl:variable>
                                                                                
                        <input type="hidden" name="control_item_id" 
value="{$control_item_id}" /> 
                                                                                
                        <input name="check_list_id" 
type="hidden"><xsl:attribute name="value"><xsl:value-of 
select="//check_list/id"/></xsl:attribute></input>
-                                                                               
                    <input name="status" type="hidden" value="0" />
-                                                                               
                        <input name="type" type="hidden" 
value="control_item_type_1" />
-                                                                               
                            
-                                                                               
                <div>
-                                                                               
                        <label class="comment">Beskrivelse av sak</label>
-                                                                               
                            <textarea name="case_descr">
+                                                                               
                  <input name="status" type="hidden" value="0" />
+                          <input name="type" type="hidden" 
value="control_item_type_1" />
+                                                                               
                          
+                          <!--  WHAT TO DO -->
+                          <div class="row what-to-do">
+                            <label>Hva skal sjekkes:</label> 
+                            <div>
+                              <xsl:value-of select="what_to_do"/>
+                            </div>
+                          </div>
+
+                          <!--  HOW TO DO -->
+                          <div class="row how-to-do">
+                            <label>Utførelsesbeskrivelse:</label> 
+                            <div>
+                              <xsl:value-of select="how_to_do"/>
+                            </div>
+                          </div>
+                            
+                                                                               
            <div>
+                            <label class="comment">Beskrivelse av sak</label>
+                                                                               
                          <textarea name="case_descr">
                                                                                
                                        <xsl:value-of select="comment"/>
                                                                                
                                </textarea>
                                                                                
                        </div>
-                                                                               
                        <input type="submit" class="btn not_active" 
name="save_control" value="Lagre sak" />
+                                                                               
                        <input type="submit" class="btn" name="save_control" 
value="Lagre sak" />
                                                                                
                </form>
                                                                                
        </xsl:when>
                                                                                
        <xsl:when test="type = 'control_item_type_2'">
@@ -141,7 +115,7 @@
                                                                                
                                 </textarea>
                                                                                
                   </div>
                                                                                
               <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'register_error')" /></xsl:variable>
-                                                                               
                   <input type="submit" name="save_control" value="Lagre 
måling" class="not_active" title="{$lang_save}" />
+                                                                               
                   <input type="submit" name="save_control" value="Lagre 
måling" title="{$lang_save}" />
                                                                                
                </form>
                                                                                
        </xsl:when>
                                                                                
        <xsl:when test="type = 'control_item_type_3'">
@@ -177,7 +151,7 @@
                                                                                
                                 </textarea>
                                                                                
                   </div>
                                                                                
               <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'register_error')" /></xsl:variable>
-                                                                               
                   <input type="submit" name="save_control" value="Lagre 
sak/måling" class="not_active" title="{$lang_save}" />
+                                                                               
                   <input type="submit" name="save_control" value="Lagre 
sak/måling" title="{$lang_save}" />
                                                                                
                </form>
                                                                                
        </xsl:when>
                                                                                
        <xsl:when test="type = 'control_item_type_4'">
@@ -213,11 +187,10 @@
                                                                                
                                 </textarea>
                                                                                
                   </div>
                                                                                
               <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'register_error')" /></xsl:variable>
-                                                                               
                   <input type="submit" name="save_control" value="Lagre 
sak/måling" class="not_active" title="{$lang_save}" />
+                                                                               
                   <input type="submit" name="save_control" value="Lagre 
sak/måling" title="{$lang_save}" />
                                                                                
                </form>
                                                                                
        </xsl:when>
                                                                                
</xsl:choose>   
-                                                                       
                                                                </li>
                                                        </xsl:for-each>
                                                </ul>

Modified: 
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list.xsl
 2013-02-11 19:15:42 UTC (rev 10796)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list.xsl
 2013-02-12 12:18:01 UTC (rev 10797)
@@ -2,9 +2,7 @@
 <xsl:template match="data" xmlns:php="http://php.net/xsl";>
 <xsl:variable name="date_format"><xsl:value-of 
select="php:function('get_phpgw_info', 'user|preferences|common|dateformat')" 
/></xsl:variable>
 
-
 <!-- ==================  ADD CHECKLIST  ========================= -->
-
 <div id="main_content" class="medium">
        <div id="check-list-heading">
                <div class="box-1">
@@ -26,44 +24,7 @@
                        </xsl:choose>
                </div>
                <div class="box-2 select-box">
-               
-                       <a>
-                               <xsl:attribute name="href">
-                                       <xsl:value-of 
select="php:function('get_phpgw_link', '/index.php', 
'menuaction:controller.uicalendar.view_calendar_for_year' )" />
-                                       <xsl:text>&amp;year=</xsl:text>
-                                       <xsl:value-of select="current_year"/>
-                                       <xsl:text>&amp;location_code=</xsl:text>
-                                       <xsl:choose>
-                                         <xsl:when test="type = 'component'">
-                                                 <xsl:value-of 
select="building_location_code"/>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                 <xsl:value-of 
select="location_array/location_code"/>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                               </xsl:attribute>
-                               Kontrollplan for bygg/eiendom (år)
-                       </a>
-                               
-                       <a class="last">
-                               <xsl:attribute name="href">
-                                       <xsl:value-of 
select="php:function('get_phpgw_link', '/index.php', 
'menuaction:controller.uicalendar.view_calendar_for_month' )" />
-                                       <xsl:text>&amp;year=</xsl:text>
-                                       <xsl:value-of select="current_year"/>
-                                       <xsl:text>&amp;month=</xsl:text>
-                                       <xsl:value-of 
select="current_month_nr"/>
-                                       <xsl:text>&amp;location_code=</xsl:text>
-                                       <xsl:choose>
-                                         <xsl:when test="type = 'component'">
-                                                 <xsl:value-of 
select="building_location_code"/>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                 <xsl:value-of 
select="location_array/location_code"/>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                               </xsl:attribute>
-                               Kontrolplan for bygg/eiendom (måned)
-                       </a>
+      <xsl:call-template name="nav_control_plan" />
                </div>
        </div>
                
@@ -121,15 +82,23 @@
                                                <xsl:choose>
                                                        <xsl:when 
test="check_list/status = 0">
                                                                <option 
value="1">Utført</option>
-                                                               <option 
value="0" SELECTED="SELECTED" >Ikke utført</option>
+                                                               <option 
value="0" SELECTED="SELECTED">Ikke utført</option>
+                <option value="3">Kansellert</option>
                                                        </xsl:when>
                                                        <xsl:when 
test="check_list/status = 1">
                                                                <option 
value="1" SELECTED="SELECTED">Utført</option>
                                                                <option 
value="0">Ikke utført</option>
+                <option value="3">Kansellert</option>
                                                        </xsl:when>
-                                                       <xsl:otherwise>
+              <xsl:when test="check_list/status = 3">
+                                                               <option 
value="3" SELECTED="SELECTED">Kansellert</option>
                                                                <option 
value="0">Ikke utført</option>
+                <option value="1">Utført</option>
+                                                       </xsl:when>
+                                                       <xsl:otherwise>
+                                                               <option 
value="0" SELECTED="SELECTED">Ikke utført</option>
                                                                <option 
value="1">Utført</option>
+                <option value="3">Kansellert</option>
                                                        </xsl:otherwise>
                                                </xsl:choose>
                                        </select>
@@ -183,7 +152,7 @@
                        
                        <div class="form-buttons">
                                <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save_check_list')" /></xsl:variable>
-                               <input class="btn not_active" type="submit" 
value="Lagre detaljer" />
+                               <input class="btn" type="submit" value="Lagre 
detaljer" />
                        </div>
                </form> 
         </div>

Modified: 
branches/Version-1_0-branch/controller/templates/base/check_list/case_row.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/case_row.xsl   
    2013-02-11 19:15:42 UTC (rev 10796)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/case_row.xsl   
    2013-02-12 12:18:01 UTC (rev 10797)
@@ -46,6 +46,7 @@
                         </xsl:choose>
                       </span>
                     </div>
+                    
                     <!--  MEASUREMENT -->
                     <div class="row">
                       <label>Måleverdi:</label> 
@@ -54,6 +55,7 @@
                       </span>
                     </div>
                   </xsl:if>
+
                   <!--  DESCRIPTION -->
                   <div class="row">
                     <label>Beskrivelse:</label> 
@@ -75,7 +77,7 @@
                         <xsl:text>&amp;check_list_id=</xsl:text>
                         <xsl:value-of select="//check_list/id"/>
                         <xsl:text>&amp;phpgw_return_as=json</xsl:text>
-                                               <xsl:value-of 
select="$session_url"/>
+                        <xsl:value-of select="$session_url"/>
                       </xsl:attribute>
                       lukk
                     </a>
@@ -89,7 +91,7 @@
                             <xsl:text>&amp;check_list_id=</xsl:text>
                             <xsl:value-of select="//check_list/id"/>
                             <xsl:text>&amp;phpgw_return_as=json</xsl:text>
-                                                       <xsl:value-of 
select="$session_url"/>
+                            <xsl:value-of select="$session_url"/>
                           </xsl:attribute>
                           slett
                         </a>
@@ -109,7 +111,7 @@
                     <xsl:text>&amp;control_item_type=</xsl:text>
                     <xsl:value-of select="//control_item/type" />
                     <xsl:text>&amp;phpgw_return_as=json</xsl:text>
-                                       <xsl:value-of select="$session_url"/>
+                    <xsl:value-of select="$session_url"/>
                   </xsl:attribute>
                   <input type="hidden" name="control_item_type">
                    <xsl:attribute name="value"><xsl:value-of 
select="//control_item/type" /></xsl:attribute>
@@ -203,7 +205,7 @@
                         
<xsl:text>index.php?menuaction=property.uitts.view</xsl:text>
                         <xsl:text>&amp;id=</xsl:text>
                         <xsl:value-of select="location_item_id"/>
-                                               <xsl:value-of 
select="$session_url"/>
+                        <xsl:value-of select="$session_url"/>
                       </xsl:attribute>
                       Vis melding
                     </a>

Modified: 
branches/Version-1_0-branch/controller/templates/base/check_list/cases_tab_menu.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/cases_tab_menu.xsl
 2013-02-11 19:15:42 UTC (rev 10796)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/cases_tab_menu.xsl
 2013-02-12 12:18:01 UTC (rev 10797)
@@ -1,7 +1,5 @@
 <xsl:template name="cases_tab_menu" xmlns:php="http://php.net/xsl";>
-
 <xsl:param name="active_tab" />
-
 <xsl:variable name="session_url">&amp;<xsl:value-of 
select="php:function('get_phpgw_session_url')" /></xsl:variable>
 
 <div class="tab_menu">

Modified: 
branches/Version-1_0-branch/controller/templates/base/check_list/check_list_tab_menu.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/check_list_tab_menu.xsl
    2013-02-11 19:15:42 UTC (rev 10796)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/check_list_tab_menu.xsl
    2013-02-12 12:18:01 UTC (rev 10797)
@@ -1,8 +1,7 @@
 <xsl:template name="check_list_tab_menu" xmlns:php="http://php.net/xsl";>
-
 <xsl:param name="active_tab" />
-
 <xsl:variable name="session_url">&amp;<xsl:value-of 
select="php:function('get_phpgw_session_url')" /></xsl:variable>
+
 <div id="check_list_menu">
                <!-- ==================  LOADS VIEW CHECKLIST DETAILS   
===================== -->
                <div class="left_btns">

Modified: 
branches/Version-1_0-branch/controller/templates/base/check_list/edit_check_list.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/edit_check_list.xsl
        2013-02-11 19:15:42 UTC (rev 10796)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/edit_check_list.xsl
        2013-02-12 12:18:01 UTC (rev 10797)
@@ -1,5 +1,5 @@
 <!-- $Id$ -->
-<xsl:template match="data" name="view_check_list" 
xmlns:php="http://php.net/xsl";>
+<xsl:template match="data" name="edit_check_list" 
xmlns:php="http://php.net/xsl";>
 <xsl:variable name="date_format"><xsl:value-of 
select="php:function('get_phpgw_info', 'user|preferences|common|dateformat')" 
/></xsl:variable>
 <xsl:variable name="session_url">&amp;<xsl:value-of 
select="php:function('get_phpgw_session_url')" /></xsl:variable>
 
@@ -26,45 +26,9 @@
                                </xsl:otherwise>
                        </xsl:choose>
                </div>
+               
                <div class="box-2 select-box">
-                       <a>
-                               <xsl:attribute name="href">
-                                       
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_year</xsl:text>
-                                       <xsl:text>&amp;year=</xsl:text>
-                                       <xsl:value-of select="current_year"/>
-                                       <xsl:text>&amp;location_code=</xsl:text>
-                                       <xsl:choose>
-                                         <xsl:when test="type = 'component'">
-                                                 <xsl:value-of 
select="building_location_code"/>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                 <xsl:value-of 
select="location_array/location_code"/>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       <xsl:value-of select="$session_url"/>
-                               </xsl:attribute>
-                               Kontrolplan for bygg/eiendom (år)
-                       </a>
-                       <a class="last">
-                               <xsl:attribute name="href">
-                                       
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
-                                       <xsl:text>&amp;year=</xsl:text>
-                                       <xsl:value-of select="current_year"/>
-                                       <xsl:text>&amp;month=</xsl:text>
-                                       <xsl:value-of 
select="current_month_nr"/>
-                                       <xsl:text>&amp;location_code=</xsl:text>
-                                       <xsl:choose>
-                                         <xsl:when test="type = 'component'">
-                                                 <xsl:value-of 
select="building_location_code"/>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                 <xsl:value-of 
select="location_array/location_code"/>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       <xsl:value-of select="$session_url"/>
-                               </xsl:attribute>
-                               Kontrolplan for bygg/eiendom (måned)
-                       </a>
+      <xsl:call-template name="nav_control_plan" />
                </div>
                
                <!-- ==================  CHECKLIST TAB MENU  
===================== -->
@@ -85,22 +49,30 @@
                        <div class="row">
                                <label>Status</label>
                                <xsl:variable name="status"><xsl:value-of 
select="check_list/status"/></xsl:variable>
-                               <select id="status" name="status">
-                                       <xsl:choose>
-                                               <xsl:when 
test="check_list/status = 0">
-                                                       <option 
value="1">Utført</option>
-                                                       <option value="0" 
SELECTED="SELECTED" >Ikke utført</option>
-                                               </xsl:when>
-                                               <xsl:when 
test="check_list/status = 1">
-                                                       <option value="1" 
SELECTED="SELECTED">Utført</option>
-                                                       <option value="0">Ikke 
utført</option>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <option 
value="1">Utført</option>
-                                                       <option value="0">Ikke 
utført</option>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                               </select>
+                                       <select id="status" name="status">
+                                               <xsl:choose>
+                                                       <xsl:when 
test="check_list/status = 0">
+                                                               <option 
value="1">Utført</option>
+                                                               <option 
value="0" SELECTED="SELECTED">Ikke utført</option>
+                <option value="3">Kansellert</option>
+                                                       </xsl:when>
+                                                       <xsl:when 
test="check_list/status = 1">
+                                                               <option 
value="1" SELECTED="SELECTED">Utført</option>
+                                                               <option 
value="0">Ikke utført</option>
+                <option value="3">Kansellert</option>
+                                                       </xsl:when>
+              <xsl:when test="check_list/status = 3">
+                                                               <option 
value="3" SELECTED="SELECTED">Kansellert</option>
+                                                               <option 
value="0">Ikke utført</option>
+                <option value="1">Utført</option>
+                                                       </xsl:when>
+                                                       <xsl:otherwise>
+                                                               <option 
value="0" SELECTED="SELECTED">Ikke utført</option>
+                                                               <option 
value="1">Utført</option>
+                <option value="3">Kansellert</option>
+                                                       </xsl:otherwise>
+                                               </xsl:choose>
+                                       </select>
                        </div>
                        <div class="row">
                                <label>Skal utføres innen</label>
@@ -157,9 +129,9 @@
                        
                        <div class="form-buttons">
                                <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save_check_list')" /></xsl:variable>
-                               <input class="btn not_active" type="submit" 
name="save_control" value="Lagre detaljer" />
+                               <input class="btn" type="submit" 
name="save_control" value="Lagre detaljer" />
                        </div>
                        </form>
                </div>
        </div>
-</xsl:template>
+</xsl:template>
\ No newline at end of file

Copied: 
branches/Version-1_0-branch/controller/templates/base/check_list/nav_control_plan.xsl
 (from rev 10796, 
trunk/controller/templates/base/check_list/nav_control_plan.xsl)
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/nav_control_plan.xsl
                               (rev 0)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/nav_control_plan.xsl
       2013-02-12 12:18:01 UTC (rev 10797)
@@ -0,0 +1,42 @@
+  <xsl:template name="nav_control_plan" xmlns:php="http://php.net/xsl";>
+  <xsl:variable name="session_url">&amp;<xsl:value-of 
select="php:function('get_phpgw_session_url')" /></xsl:variable>
+
+  <a>
+    <xsl:attribute name="href">
+      
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_year</xsl:text>
+      <xsl:text>&amp;year=</xsl:text>
+      <xsl:value-of select="current_year"/>
+      <xsl:text>&amp;location_code=</xsl:text>
+      <xsl:choose>
+        <xsl:when test="type = 'component'">
+          <xsl:value-of select="building_location_code"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="location_array/location_code"/>
+        </xsl:otherwise>
+      </xsl:choose>
+      <xsl:value-of select="$session_url"/>
+    </xsl:attribute>
+    Vis kontrolplan for år
+  </a>
+  <a class="last">
+    <xsl:attribute name="href">
+      
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
+      <xsl:text>&amp;year=</xsl:text>
+      <xsl:value-of select="current_year"/>
+      <xsl:text>&amp;month=</xsl:text>
+      <xsl:value-of select="current_month_nr"/>
+      <xsl:text>&amp;location_code=</xsl:text>
+      <xsl:choose>
+        <xsl:when test="type = 'component'">
+          <xsl:value-of select="building_location_code"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="location_array/location_code"/>
+        </xsl:otherwise>
+      </xsl:choose>
+      <xsl:value-of select="$session_url"/>
+    </xsl:attribute>
+    Vis kontrolplan for måned
+  </a>         
+  </xsl:template>
\ No newline at end of file

Modified: 
branches/Version-1_0-branch/controller/templates/base/check_list/view_cases_for_check_list.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/view_cases_for_check_list.xsl
      2013-02-11 19:15:42 UTC (rev 10796)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/view_cases_for_check_list.xsl
      2013-02-12 12:18:01 UTC (rev 10797)
@@ -4,7 +4,6 @@
 <xsl:variable name="session_url">&amp;<xsl:value-of 
select="php:function('get_phpgw_session_url')" /></xsl:variable>
 
 <div id="main_content" class="medium">
-               
        <script>
        
                // ======================  LASTER FANEN view_open_errors NÅR 
SIDEN LASTES FØRSTE GANG  ===================
@@ -81,44 +80,7 @@
                        </xsl:choose>
                </div>
                <div class="box-2 select-box">
-                       <a>
-                               <xsl:attribute name="href">
-                                       
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_year</xsl:text>
-                                       <xsl:text>&amp;year=</xsl:text>
-                                       <xsl:value-of select="current_year"/>
-                                       <xsl:text>&amp;location_code=</xsl:text>
-                                       <xsl:choose>
-                                         <xsl:when test="type = 'component'">
-                                                 <xsl:value-of 
select="building_location_code"/>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                 <xsl:value-of 
select="location_array/location_code"/>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       <xsl:value-of select="$session_url"/>
-                               </xsl:attribute>
-                               Kontrolplan for bygg/eiendom (år)
-                       </a>
-                       <a class="last">
-                               <xsl:attribute name="href">
-                                       
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
-                                       <xsl:text>&amp;year=</xsl:text>
-                                       <xsl:value-of select="current_year"/>
-                                       <xsl:text>&amp;month=</xsl:text>
-                                       <xsl:value-of 
select="current_month_nr"/>
-                                       <xsl:text>&amp;location_code=</xsl:text>
-                                       <xsl:choose>
-                                         <xsl:when test="type = 'component'">
-                                                 <xsl:value-of 
select="building_location_code"/>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                 <xsl:value-of 
select="location_array/location_code"/>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       <xsl:value-of select="$session_url"/>
-                               </xsl:attribute>
-                               Kontrolplan for bygg/eiendom (måned)
-                       </a>
+      <xsl:call-template name="nav_control_plan" />
                </div>
                
                <!-- ==================  CHECKLIST TAB MENU  
===================== -->

Modified: 
branches/Version-1_0-branch/controller/templates/base/check_list/view_closed_cases.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/view_closed_cases.xsl
      2013-02-11 19:15:42 UTC (rev 10796)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/view_closed_cases.xsl
      2013-02-12 12:18:01 UTC (rev 10797)
@@ -1,11 +1,8 @@
 <!-- $Id: choose_control_items.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
-
 <xsl:template match="data" xmlns:php="http://php.net/xsl";>
-
 <xsl:variable name="session_url">&amp;<xsl:value-of 
select="php:function('get_phpgw_session_url')" /></xsl:variable>   
 
 <div id="view_cases">
-       
        <xsl:call-template name="cases_tab_menu">
                <xsl:with-param 
name="active_tab">view_closed_cases</xsl:with-param>
        </xsl:call-template>    

Modified: 
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_details.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_details.xsl
   2013-02-11 19:15:42 UTC (rev 10796)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_details.xsl
   2013-02-12 12:18:01 UTC (rev 10797)
@@ -69,25 +69,20 @@
                      </xsl:otherwise>
              </xsl:choose>
                </div>
-               <div class="row">
-                       <label>Frekvenstype</label>
-                       <xsl:choose>
-                     <xsl:when test="control/repeat_type = 0">Dag</xsl:when>
-                     <xsl:when test="control/repeat_type = 1">Uke</xsl:when>
-                     <xsl:when test="control/repeat_type = 2">Måned</xsl:when>
-                     <xsl:when test="control/repeat_type = 3">År</xsl:when>
-             </xsl:choose>
-               </div>
-               <div class="row">
+               <div class="row frequency">
                        <label>Frekvens</label>
                        <xsl:choose>
-                               <xsl:when test="editable">
-                                       <input size="2" type="text" 
name="repeat_interval" value="{control/repeat_interval}" />
-                               </xsl:when>
-                               <xsl:otherwise>
-                                       <xsl:value-of 
select="control/repeat_interval" />
-                               </xsl:otherwise>
-                       </xsl:choose>
+                               <xsl:when test="control/repeat_interval = 1">
+                       <span class="pre">Hver</span>
+               </xsl:when>
+               <xsl:when test="control/repeat_interval = 2">
+                       <span class="pre">Annenhver</span>
+               </xsl:when>
+               <xsl:when test="control/repeat_interval > 2">
+                       <span class="pre">Hver</span><span><xsl:value-of 
select="control/repeat_interval"/>.</span>
+               </xsl:when>
+            </xsl:choose>
+            <span class="val"><xsl:value-of 
select="control/repeat_type_label"/></span>
                </div>
                <div class="row">
                        <label>Rolle</label>

Modified: 
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_info.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_info.xsl
      2013-02-11 19:15:42 UTC (rev 10796)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_info.xsl
      2013-02-12 12:18:01 UTC (rev 10797)
@@ -4,7 +4,6 @@
 <xsl:variable name="session_url">&amp;<xsl:value-of 
select="php:function('get_phpgw_session_url')" /></xsl:variable>
 
 <div id="main_content" class="medium">
-               
        <script>
          
                $(document).ready(function() {
@@ -88,44 +87,7 @@
                        </xsl:choose>
                </div>
                <div class="box-2 select-box">
-                       <a>
-                               <xsl:attribute name="href">
-                                       
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_year</xsl:text>
-                                       <xsl:text>&amp;year=</xsl:text>
-                                       <xsl:value-of select="current_year"/>
-                                       <xsl:text>&amp;location_code=</xsl:text>
-                                       <xsl:choose>
-                                         <xsl:when test="type = 'component'">
-                                                 <xsl:value-of 
select="building_location_code"/>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                 <xsl:value-of 
select="location_array/location_code"/>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       <xsl:value-of select="$session_url"/>
-                               </xsl:attribute>
-                               Kontrolplan for bygg/eiendom (år)
-                       </a>
-                       <a class="last">
-                               <xsl:attribute name="href">
-                                       
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
-                                       <xsl:text>&amp;year=</xsl:text>
-                                       <xsl:value-of select="current_year"/>
-                                       <xsl:text>&amp;month=</xsl:text>
-                                       <xsl:value-of 
select="current_month_nr"/>
-                                       <xsl:text>&amp;location_code=</xsl:text>
-                                       <xsl:choose>
-                                         <xsl:when test="type = 'component'">
-                                                 <xsl:value-of 
select="building_location_code"/>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                 <xsl:value-of 
select="location_array/location_code"/>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       <xsl:value-of select="$session_url"/>
-                               </xsl:attribute>
-                               Kontrolplan for bygg/eiendom (måned)
-                       </a>
+      <xsl:call-template name="nav_control_plan" />
                </div>
                
                <!-- ==================  CHECKLIST TAB MENU  
===================== -->

Modified: 
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_items.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_items.xsl
     2013-02-11 19:15:42 UTC (rev 10796)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_items.xsl
     2013-02-12 12:18:01 UTC (rev 10797)
@@ -1,7 +1,5 @@
 <!-- $Id: choose_control_items.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
-
 <xsl:template match="data" xmlns:php="http://php.net/xsl";>
-
 <xsl:variable name="session_url">&amp;<xsl:value-of 
select="php:function('get_phpgw_session_url')" /></xsl:variable>   
 
 <div id="control-items">

Modified: 
branches/Version-1_0-branch/controller/templates/base/check_list/view_open_cases.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/view_open_cases.xsl
        2013-02-11 19:15:42 UTC (rev 10796)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/view_open_cases.xsl
        2013-02-12 12:18:01 UTC (rev 10797)
@@ -1,9 +1,7 @@
 <!-- $Id: choose_control_items.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
-
 <xsl:template match="data" xmlns:php="http://php.net/xsl";>
 
   <div id="view_cases">
-       
     <xsl:call-template name="cases_tab_menu">
       <xsl:with-param name="active_tab">view_open_cases</xsl:with-param>
     </xsl:call-template>

Modified: branches/Version-1_0-branch/controller/templates/base/css/base.css
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/css/base.css  
2013-02-11 19:15:42 UTC (rev 10796)
+++ branches/Version-1_0-branch/controller/templates/base/css/base.css  
2013-02-12 12:18:01 UTC (rev 10797)
@@ -554,6 +554,14 @@
   margin-top: 20px;    
 }
 
+#control-items .groups li{
+  margin-bottom: 2px;  
+}
+
+#control-items .groups h3 {
+  margin: 15px 0 0;
+}
+
 /* =======================================  ADD CONTROL ITEM LIST VALUES  
========================================= */
 
 #add_control_item_option_panel {
@@ -1163,9 +1171,9 @@
 }
 
 #no-loc #search-location {
-    clear: both;
-    float: left;
-    margin-bottom: 10px;
+  clear: both;
+  float: left;
+  margin-bottom: 10px;
 }
 
 #search-location-name {
@@ -1252,7 +1260,7 @@
   border: 1px solid #DDDDDD;
   border-radius: 4px 4px 4px 4px;
   float: right;
-  padding: 1em;
+  padding: 6px 10px;
 }
 
 ul#icon_color_map li {
@@ -1260,8 +1268,9 @@
   padding: 3px 0;
 }
 
-ul#icon_color_map span{
+ul#icon_color_map span {
   margin-left: 10px;
+  vertical-align: middle;
 }
 
 #calendar {
@@ -1474,11 +1483,15 @@
 #info_box .case {
        text-align:left;        
 }
+ 
+.empty_list h4{
+    font-size: 14px;
+    font-weight: bold;
+    display: inline-block;
+}
 
-.empty_list{
-  font-size: 16px;
-  font-weight: bold;
-  padding: 0 0 5px;
+.empty_list {
+    margin-left: 20px;
 }
 
 .yui-pg-first{
@@ -1833,15 +1846,14 @@
 
 /* ===============================  FORM REGISTER CASE  
============================= */
 
-.frm_register_case {
-  margin-bottom: 1em;
-}
 .frm_register_case input[type="text"]{
        width: 170px;  
 }
+
 .frm_register_case select {
   width: 184px;
 }
+
 .frm_register_case textarea {
   display: block;
   height: 100px;
@@ -1849,12 +1861,42 @@
   margin-bottom: 1em;
   width: 63%;
 }
+
 .frm_register_case label {
   display: inline-block;
   width: 18%;
 }
 
+.frm_register_case .what-to-do, .frm_register_case .how-to-do {
+  line-height: 20px;
+}
 
+.frm_register_case .how-to-do {
+  margin-bottom: 10px;
+}
+
+.add-cases .expand_list li{
+  background: none repeat scroll 0 0 #EEEEEE;
+  margin-bottom: 10px;
+  padding: 10px; 
+}
+
+.add-cases .expand_list h4{
+  margin-bottom: 0;
+}
+
+.add-cases h3 img {
+  height: 15px;
+  margin-right: 5px;
+}
+
+.add-cases .expand-trigger {
+  background: none repeat scroll 0 0 #DDDDDD;
+  cursor: pointer;
+  padding: 7px 10px;
+}
+
+
 /* ================================ CASE MESSAGE ============================= 
*/
 
 #caseMessage a#showMessage {
@@ -2022,6 +2064,11 @@
   margin-bottom: 1em;  
 }
 
+#control_details .frequency .val {
+  margin-left: 5px;
+  text-transform: lowercase;   
+}
+
 #repeat_interval {
   width: 28px;
 }
@@ -2054,9 +2101,11 @@
   margin-left: 11px;
   vertical-align: middle;
 }
+
 #view-procedures .box {
-  background: none repeat scroll 0 0 #E7EFF8;
-  border: 1px solid #DDDDDD;
+  background: none repeat scroll 0 0 #FFFFFF;
+  border: 1px solid #DBE5EF;
+  border-radius: 4px 4px 4px 4px;
   margin-bottom: 20px;
   padding: 0 20px;
 }

Modified: 
branches/Version-1_0-branch/controller/templates/base/procedure/print_procedure.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/procedure/print_procedure.xsl
 2013-02-11 19:15:42 UTC (rev 10796)
+++ 
branches/Version-1_0-branch/controller/templates/base/procedure/print_procedure.xsl
 2013-02-12 12:18:01 UTC (rev 10797)
@@ -49,7 +49,9 @@
                </div>
                <div>
                        <label for="reference"><xsl:value-of 
select="php:function('lang','Procedure Reference')" /></label>
-                       <xsl:value-of select="procedure/reference" 
disable-output-escaping="yes"/>
+      <span style="display: inline-block;width: 600px;">
+        <xsl:value-of select="procedure/reference" 
disable-output-escaping="yes"/>
+      </span>
                </div>
                <a href="#print" class="btn" onClick="window.print()">Skriv 
ut</a>              
 </div>

Modified: 
branches/Version-1_0-branch/logistic/inc/class.sorequirement_resource_allocation.inc.php
===================================================================
--- 
branches/Version-1_0-branch/logistic/inc/class.sorequirement_resource_allocation.inc.php
    2013-02-11 19:15:42 UTC (rev 10796)
+++ 
branches/Version-1_0-branch/logistic/inc/class.sorequirement_resource_allocation.inc.php
    2013-02-12 12:18:01 UTC (rev 10797)
@@ -45,33 +45,59 @@
 
                protected function add(&$resource_alloc)
                {
-                       $cols = array(
-                               'requirement_id',
-                               'resource_id',
-                               'location_id',
-                               'create_user',
-                               'create_date'
-                       );
+                       $this->db->transaction_begin();
 
-                       $values = array(
-                               
$this->marshal($resource_alloc->get_requirement_id(), 'int'),
-                               
$this->marshal($resource_alloc->get_resource_id(), 'int'),
-                               
$this->marshal($resource_alloc->get_location_id(), 'int'),
-                               
$this->marshal($resource_alloc->get_create_user(), 'int'),
-                               $this->marshal(strtotime('now'), 'int')
+                       $value_set = array
+                       (
+                               'location_id'           => 
$resource_alloc->get_location_id(),
+                               'item_id'                       => 
$this->marshal($resource_alloc->get_resource_id(), 'int'),
+                               'allocation_id'         => 0,//not known yet
+                               'create_user'           => 
$resource_alloc->get_create_user(),
+                               'create_date'           => time(),
+                               'start_date'            => 
$resource_alloc->get_start_date(),
+                               'end_date'                      => 
$resource_alloc->get_end_date(),
                        );
 
-                       $sql = 'INSERT INTO lg_requirement_resource_allocation 
(' . join(',', $cols) . ') VALUES (' . join(',', $values) . ')';
+                       $sql = 'INSERT INTO lg_calendar (' . implode(',', 
array_keys($value_set)) . ') VALUES (' . implode(',', array_values($value_set)) 
. ')';
                        $result = $this->db->query($sql, __LINE__,__FILE__);
 
                        if($result)
                        {
-                               return 
$this->db->get_last_insert_id('lg_requirement_resource_allocation', 'id');
+                               $calendar_id = 
$this->db->get_last_insert_id('lg_calendar', 'id');
                        }
                        else
                        {
                                return 0;
                        }
+
+                       $value_set = array
+                       (
+                               'requirement_id'        => 
$this->marshal($resource_alloc->get_requirement_id(), 'int'),
+                               'resource_id'           => 
$this->marshal($resource_alloc->get_resource_id(), 'int'),
+                               'location_id'           => 
$this->marshal($resource_alloc->get_location_id(), 'int'),
+       //                      'start_date'            => 
$this->marshal($resource_alloc->get_start_date(), 'int'),
+       //                      'end_date'                      => 
$this->marshal($resource_alloc->get_end_date(), 'int'),
+                               'create_user'           => 
$this->marshal($resource_alloc->get_create_user(), 'int'),
+                               'create_date'           => time(),
+                               'calendar_id'           => $calendar_id
+                       );
+
+                       $sql = 'INSERT INTO lg_requirement_resource_allocation 
(' . implode(',', array_keys($value_set)) . ') VALUES (' . implode(',', 
array_values($value_set)) . ')';
+                       $result = $this->db->query($sql, __LINE__,__FILE__);
+
+                       if($result)
+                       {
+                               $allocation_id =  
$this->db->get_last_insert_id('lg_requirement_resource_allocation', 'id');
+                               $this->db->query("UPDATE lg_calendar SET 
allocation_id = {$allocation_id} WHERE id = {$calendar_id}", __LINE__,__FILE__);
+                       }
+                       else
+                       {
+                               $allocation_id = 0;
+                       }
+
+                       $this->db->transaction_commit();
+
+                       return $allocation_id;
                }
 
                protected function update($resource_alloc)
@@ -183,37 +209,79 @@
                        return $allocation;
                }
                
-               function delete($resource_allocation_id)
+
+               /**
+               * Finds allocated items within timespan
+               *
+               */
+               public function check_calendar($location_id = 0, $ids = 
array(), $start_date, $end_date)
                {
-                       $resource_allocation_id = (int) $resource_allocation_id;
-                       $status = $this->db->query("DELETE FROM 
lg_requirement_resource_allocation WHERE id = $resource_allocation_id");
-                                       
-                       if( $status )
+                       $location_id = (int)$location_id;
+                       $values = array();
+                       $items = array();
+                       
+                       if (!$ids)
                        {
-                               return true;
+                               return $values;
                        }
-                       else
+                       $sql = "SELECT lg_calendar.item_id, 
lg_requirement.activity_id,"
+                       . " lg_calendar.start_date, lg_calendar.end_date"
+                       . " FROM lg_requirement_resource_allocation"
+                       . " {$this->join} lg_calendar ON 
lg_requirement_resource_allocation.calendar_id = lg_calendar.id"
+                       . " {$this->join} lg_requirement ON 
lg_requirement_resource_allocation.requirement_id = lg_requirement.id"
+                       . " WHERE lg_calendar.location_id = {$location_id}"
+                       . " AND lg_calendar.item_id IN (" . implode(',', $ids) 
. ')'
+                       . " AND lg_calendar.end_date >= {$start_date} AND 
lg_calendar.start_date <= {$end_date}";
+                       $this->db->query($sql,__LINE__,__FILE__);
+
+                       while ($this->db->next_record())
                        {
-                               return false;
+                               $item_id = $this->db->f('item_id');
+                               $items[$item_id] = true;
+                               $values[$item_id][] = array
+                               (
+                                       'start_date'    => 
$this->db->f('start_date'),
+                                       'end_date'              => 
$this->db->f('end_date'),
+                                       'activity_id'   => 
$this->db->f('activity_id'),
+                                       'item_id'               => $item_id
+                               );
                        }
+                       return array('calendar' => $values, 'items' => $items);
                }
+
+               function delete($resource_allocation_id)
+               {
+                       $this->db->transaction_begin();
+
+                       $resource_allocation_id = (int) $resource_allocation_id;
+                       $this->db->query("DELETE FROM 
lg_requirement_resource_allocation WHERE id = $resource_allocation_id");
+                       $this->db->query("DELETE FROM lg_calendar WHERE 
allocation_id = $resource_allocation_id");
+
+                       return !!$this->db->transaction_commit();
+               }
                
                public function delete_resources($requirement_id)
                {
                        
                        echo "i delete_resources: " . $requirement_id;
                        
+                       $this->db->transaction_begin();
+
                        $requirement_id = (int) $requirement_id;
-                       $status = $this->db->query("DELETE FROM 
lg_requirement_resource_allocation WHERE requirement_id = $requirement_id");
-                                       
-                       if( $status )
+                       $this->db->query("SELECT id FROM 
lg_requirement_resource_allocation WHERE requirement_id = 
$requirement_id",__LINE__,__FILE__);
+                       $ids = array();
+                       while ($this->db->next_record())
                        {
-                               return true;
+                               $ids[] = $this->db->f('id');
                        }
-                       else
+                       
+                       if($ids)
                        {
-                               return false;
+                               $this->db->query("DELETE FROM lg_calendar WHERE 
allocation_id = IN ( " . explode(',', $id) . ')',__LINE__,__FILE__);
                        }
+                       $this->db->query("DELETE FROM 
lg_requirement_resource_allocation WHERE requirement_id = 
$requirement_id",__LINE__,__FILE__);
+
+                       return !!$this->db->transaction_commit();
                }
 
                public static function get_instance()

Modified: 
branches/Version-1_0-branch/logistic/inc/class.uirequirement_resource_allocation.inc.php
===================================================================
--- 
branches/Version-1_0-branch/logistic/inc/class.uirequirement_resource_allocation.inc.php
    2013-02-11 19:15:42 UTC (rev 10796)
+++ 
branches/Version-1_0-branch/logistic/inc/class.uirequirement_resource_allocation.inc.php
    2013-02-12 12:18:01 UTC (rev 10797)
@@ -297,22 +297,10 @@
                                $allocation = new 
logistic_requirement_resource_allocation();
                        }
 
-                       $accounts = 
$GLOBALS['phpgw']->acl->get_user_list_right(PHPGW_ACL_READ, 'run', 'logistic');
+//                     $accounts = 
$GLOBALS['phpgw']->acl->get_user_list_right(PHPGW_ACL_READ, 'run', 'logistic');
 
                        if($requirement)
                        {
-// find allocated
-                               $allocated_objects = $this->so->get(null, null, 
null, null, null, null, array('requirement_id' => $requirement->get_id()));
-                               
-                               $allocated = array();
-                               if($allocated_objects)
-                               {
-                                       foreach ($allocated_objects as 
$allocated_object)
-                                       {
-                                               $allocated[] = 
$allocated_object->get_resource_id();
-                                       }
-                               }
-//
                                $requirement_values = 
$this->so_requirement_value->get(null, null, null, null, null, null, 
array('requirement_id' => $requirement->get_id()));
 
                                $criterias_array = array();
@@ -365,10 +353,54 @@
                        }
                    
                        $allocation_suggestions = 
execMethod('property.soentity.get_eav_list', $criterias_array);
+
+//Start fuzzy
+                       $suggestion_ids = array();
+
+
+                       foreach ($allocation_suggestions as 
$allocation_suggestion)
+                       {
+                               $suggestion_ids[] = 
$allocation_suggestion['id'];
+                       }
+
+                       reset($allocation_suggestions);
+
+                       $allocated = $this->so->check_calendar($location_id, 
$suggestion_ids, $requirement->get_start_date(), $requirement->get_end_date() );
+//_debug_array($allocated);die();
+//end fuzzy
+                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+                       $activities = array();
                        
                        foreach ($allocation_suggestions as 
&$allocation_suggestion)
                        {
-                               $allocation_suggestion['allocated'] = 
in_array($allocation_suggestion['id'],$allocated);
+                               
if(isset($allocated['items'][$allocation_suggestion['id']]))
+                               {
+                                       $allocation_suggestion['allocated'] = 
true;
+                                       $allocated_where = array();
+                                       $allocated_date = array();
+                                       foreach 
($allocated['calendar'][$allocation_suggestion['id']] as $calendar_entry)
+                                       {
+                                               $allocated_date[] = 
$GLOBALS['phpgw']->common->show_date($calendar_entry['start_date'] ,$dateformat)
+                                                                               
        . ' - ' . 
$GLOBALS['phpgw']->common->show_date($calendar_entry['end_date'] ,$dateformat);
+
+                                               
if(!isset($activities[$calendar_entry['activity_id']]))
+                                               {
+                                                       
$activities[$calendar_entry['activity_id']] = $this->so_activity->get_single( 
$calendar_entry['activity_id'] );
+                                               }
+                                               
+                                               
if($activities[$calendar_entry['activity_id']])
+                                               {
+                                                       $allocated_where[] = 
$activities[$calendar_entry['activity_id']]->get_name();
+                                               }
+                                               else
+                                               {
+                                                       $allocated_where[] = 
'N/A';
+                                               }
+                                       }
+
+                                       
$allocation_suggestion['allocated_date'] = implode('; ', $allocated_date);
+                                       
$allocation_suggestion['allocated_where'] = implode('; ', $allocated_where);
+                               }
                        }
 
                        $activity = $this->so_activity->get_single( 
$requirement->get_activity_id() );
@@ -392,6 +424,7 @@
                        if($requirement_id && is_numeric($requirement_id))
                        {
                                $requirement = 
$this->so_requirement->get_single($requirement_id);
+                               $activity_id = $requirement->get_activity_id();
                        }
 
                        $user_id = $GLOBALS['phpgw_info']['user']['id'];
@@ -413,12 +446,12 @@
                                        $resource_alloc->set_resource_id( 
$resource_id );
                                        $resource_alloc->set_location_id( 
$requirement->get_location_id() );
                                        $resource_alloc->set_create_user( 
$user_id );
+                                       $resource_alloc->set_start_date( 
$requirement->get_start_date() );
+                                       $resource_alloc->set_end_date( 
$requirement->get_start_date() );
 
                                        $resource_alloc_id = $this->so->store( 
$resource_alloc );
                                }
 
-                               $activity = 
$this->so_activity->get_single($requirement->get_activity_id()); 
-
                                $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'logistic.uiactivity.view_resource_allocation', 
'activity_id' => $requirement->get_activity_id()));
                        }
                        else
@@ -433,10 +466,12 @@
 
                        $status = $this->so->delete($resource_allocation_id);
 
-                       if($status){
+                       if($status)
+                       {
                                return json_encode( array( "status" => 
"deleted" ) );
                        }
-                       else{
+                       else
+                       {
                                return json_encode( array( "status" => 
"not_deleted" ) );
                        }
                } 

Modified: 
branches/Version-1_0-branch/logistic/inc/model/class.requirement_resource_allocation.inc.php
===================================================================
--- 
branches/Version-1_0-branch/logistic/inc/model/class.requirement_resource_allocation.inc.php
        2013-02-11 19:15:42 UTC (rev 10796)
+++ 
branches/Version-1_0-branch/logistic/inc/model/class.requirement_resource_allocation.inc.php
        2013-02-12 12:18:01 UTC (rev 10797)
@@ -43,6 +43,8 @@
                protected $location_code;
                protected $fm_bim_item_address;
                protected $fm_bim_item_name;
+               protected $start_date;
+               protected $end_date;
                
                /**
                 * Constructor.  Takes an optional ID.  If a contract is 
created from outside
@@ -145,6 +147,27 @@
                        return $this->fm_bim_item_name;
                }
 
+
+               public function set_end_date($end_date)
+               {
+                       $this->end_date = $end_date;
+               }
+
+               public function get_end_date()
+               {
+                       return $this->end_date;
+               }
+
+               public function set_start_date($start_date)
+               {
+                       $this->start_date = $start_date;
+               }
+
+               public function get_start_date()
+               {
+                       return $this->start_date;
+               }
+
                /**
                * Get a static reference to the storage object associated with 
this model object
                *
@@ -162,14 +185,16 @@
                public function serialize()
                {
                        return array(
-                               'id'                                            
                        => $this->get_id(),
-                               'resource_type_descr' => 
$this->get_resource_type_descr(),
-                               'requirement_id'                        => 
$this->get_requirement_id(),
-                               'resource_id'                           => 
$this->get_resource_id(),
-                               'location_id'                                   
=> $this->get_location_id(),
-                               'location_code'                         => 
$this->get_location_code(),
+                               'id'                                    => 
$this->get_id(),
+                               'resource_type_descr'   => 
$this->get_resource_type_descr(),
+                               'requirement_id'                => 
$this->get_requirement_id(),
+                               'resource_id'                   => 
$this->get_resource_id(),
+                               'location_id'                   => 
$this->get_location_id(),
+                               'location_code'                 => 
$this->get_location_code(),
                                'fm_bim_item_address'   => 
$this->get_fm_bim_item_address(),
-                               'fm_bim_item_name'              => 
$this->get_fm_bim_item_name()
+                               'fm_bim_item_name'              => 
$this->get_fm_bim_item_name(),
+                               'start_date'                    => 
$this->get_start_date(),
+                               'end_date'                              => 
$this->get_end_date()
                        );
                }
-       }
\ No newline at end of file
+       }

Modified: branches/Version-1_0-branch/logistic/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/logistic/setup/phpgw_no.lang    2013-02-11 
19:15:42 UTC (rev 10796)
+++ branches/Version-1_0-branch/logistic/setup/phpgw_no.lang    2013-02-12 
12:18:01 UTC (rev 10797)
@@ -112,4 +112,6 @@
 Start date     logistic        no      Startdato
 End date       logistic        no      Sluttdato
 Responsible person     logistic        no      Ansvarlig bruker
-Responsible person for activity        logistic        no      Angi hvilken 
person som skal være ansvarlig for aktiviteten
\ No newline at end of file
+Responsible person for activity        logistic        no      Angi hvilken 
person som skal være ansvarlig for aktiviteten
+allocated date logistic        no      Allokert når
+allocated where        logistic        no      Allokert hvor

Modified: branches/Version-1_0-branch/logistic/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/logistic/setup/setup.inc.php    2013-02-11 
19:15:42 UTC (rev 10796)
+++ branches/Version-1_0-branch/logistic/setup/setup.inc.php    2013-02-12 
12:18:01 UTC (rev 10797)
@@ -1,6 +1,6 @@
 <?php
        $setup_info['logistic']['name'] = 'logistic';
-       $setup_info['logistic']['version'] = '0.0.4';
+       $setup_info['logistic']['version'] = '0.0.5';
        $setup_info['logistic']['app_order'] = 70;
        $setup_info['logistic']['enable'] = 1;
        $setup_info['logistic']['app_group']    = 'office';
@@ -11,10 +11,10 @@
                        'lg_project_type',
                        'lg_activity',
                        'lg_requirement',
-                       'lg_requirement_resource_allocation',
                        'lg_resource_type_requirement',
                        'lg_requirement_value',
-                       'lg_calendar'
+                       'lg_calendar',
+                       'lg_requirement_resource_allocation',
        );
 
        $setup_info['logistic']['description'] = 'Bergen kommune logistics 
module';

Modified: branches/Version-1_0-branch/logistic/setup/tables_current.inc.php
===================================================================
--- branches/Version-1_0-branch/logistic/setup/tables_current.inc.php   
2013-02-11 19:15:42 UTC (rev 10796)
+++ branches/Version-1_0-branch/logistic/setup/tables_current.inc.php   
2013-02-12 12:18:01 UTC (rev 10797)
@@ -6,7 +6,7 @@
                                                'id' => array('type' => 'auto', 
'precision' => 4, 'nullable' => false),
                                                'name' => array('type' => 
'varchar', 'precision' => '255', 'nullable' => false),
                                                'create_user' => array('type' 
=> 'int', 'precision' => 4, 'nullable' => false),
-                                               'create_date' => array('type' 
=> 'int', 'precision' => 4, 'nullable' => false),
+                                               'create_date' => array('type' 
=> 'int', 'precision' => 8, 'nullable' => false),
                                ),
                                'pk' => array('id'),
                                'fk' => array(),
@@ -20,9 +20,9 @@
                                                'project_type_id' => 
array('type' => 'int', 'precision' => 4, 'nullable' => false),
                                                'description' => array('type' 
=> 'text', 'nullable' => false),
                                                'create_user' => array('type' 
=> 'int', 'precision' => 4, 'nullable' => false),
-                                               'create_date' => array('type' 
=> 'int', 'precision' => 4, 'nullable' => false),
-                                               'start_date' => array('type' => 
'int', 'precision' => 4, 'nullable' => true),
-                                               'end_date' => array('type' => 
'int', 'precision' => 4, 'nullable' => true),
+                                               'create_date' => array('type' 
=> 'int', 'precision' => 8, 'nullable' => false),
+                                               'start_date' => array('type' => 
'int', 'precision' => 8, 'nullable' => true),
+                                               'end_date' => array('type' => 
'int', 'precision' => 8, 'nullable' => true),
                                ),
                                'pk' => array('id'),
                                'fk' => array('lg_project_type' => 
array('project_type_id' => 'id')),
@@ -36,13 +36,13 @@
                                                'name' => array('type' => 
'varchar', 'precision' => '255', 'nullable' => false),
                                                'description' => array('type' 
=> 'text', 'nullable' => false),
                                                'project_id' => array('type' => 
'int', 'precision' => 4, 'nullable' => false),
-                                               'start_date' => array('type' => 
'int', 'precision' => 4, 'nullable' => true),
-                                               'end_date' => array('type' => 
'int', 'precision' => 4, 'nullable' => true),
+                                               'start_date' => array('type' => 
'int', 'precision' => 8, 'nullable' => true),
+                                               'end_date' => array('type' => 
'int', 'precision' => 8, 'nullable' => true),
                                                'responsible_user_id' => 
array('type' => 'int', 'precision' => 4, 'nullable'=> false),
                                                'create_user' => array('type' 
=> 'int', 'precision' => 4, 'nullable' => false),
-                                               'create_date' => array('type' 
=> 'int', 'precision' => 4, 'nullable' => false),
+                                               'create_date' => array('type' 
=> 'int', 'precision' => 8, 'nullable' => false),
                                                'update_user' => array('type' 
=> 'int', 'precision' => 4, 'nullable' => false),
-                                               'update_date' => array('type' 
=> 'int', 'precision' => 4, 'nullable' => false)
+                                               'update_date' => array('type' 
=> 'int', 'precision' => 8, 'nullable' => false)
                                ),
                                'pk' => array('id'),
                                'fk' => array(
@@ -56,12 +56,12 @@
                                'fd' => array(
                                                'id' => array('type' => 'auto', 
'precision' => 4, 'nullable' => false),
                                                'activity_id' => array('type' 
=> 'int', 'precision' => 4, 'nullable' => false),
-                                               'start_date' => array('type' => 
'int', 'precision' => 4, 'nullable' => false),
-                                               'end_date' => array('type' => 
'int', 'precision' => 4, 'nullable' => false),
+                                               'start_date' => array('type' => 
'int', 'precision' => 8, 'nullable' => false),
+                                               'end_date' => array('type' => 
'int', 'precision' => 8, 'nullable' => false),
                                                'no_of_elements' => 
array('type' => 'int', 'precision' => 4, 'nullable' => false),
                                                'location_id' => array('type' 
=> 'int', 'precision' => 4, 'nullable' => false),
                                                'create_user' => array('type' 
=> 'int', 'precision' => 4, 'nullable' => false),
-                                               'create_date' => array('type' 
=> 'int', 'precision' => 4, 'nullable' => false),
+                                               'create_date' => array('type' 
=> 'int', 'precision' => 8, 'nullable' => false),
                                ),
                                'pk' => array('id'),
                                'fk' => array(
@@ -71,19 +71,39 @@
                                'ix' => array(),
                                'uc' => array()
                ),
+               'lg_calendar' => array(
+                               'fd' => array(
+                                               'id' => array('type' => 'auto', 
'precision' => 4, 'nullable' => false),
+                                               'location_id' => array('type' 
=> 'int', 'precision' => 4, 'nullable' => false),
+                                               'item_id' => array('type' => 
'int', 'precision' => 4, 'nullable' => false),
+                                               'item_inventory_id' => 
array('type' => 'int', 'precision' => 4, 'nullable' => false),
+                                               'create_user' => array('type' 
=> 'int', 'precision' => 4, 'nullable' => false),
+                                               'create_date' => array('type' 
=> 'int', 'precision' => 8, 'nullable' => false),
+                                               'start_date' => array('type' => 
'int', 'precision' => 8, 'nullable' => false),
+                                               'end_date' => array('type' => 
'int', 'precision' => 8, 'nullable' => false),
+                               ),
+                               'pk' => array('id'),
+                               'fk' => array(
+                                               'phpgw_locations' => 
array('location_id' => 'location_id')
+                               ),
+                               'ix' => array(),
+                               'uc' => array()
+               ),
                'lg_requirement_resource_allocation' => array(
                                'fd' => array(
                                                'id' => array('type' => 'auto', 
'precision' => 4, 'nullable' => false),
                                                'requirement_id' => 
array('type' => 'int', 'precision' => 4, 'nullable' => false),
                                                'resource_id' => array('type' 
=> 'int', 'precision' => 4, 'nullable' => false),
                                                'location_id' => array('type' 
=> 'int', 'precision' => 4, 'nullable' => false),
+                                               'calendar_id' => array('type' 
=> 'int', 'precision' => 4, 'nullable' => false),
                                                'create_user' => array('type' 
=> 'int', 'precision' => 4, 'nullable' => false),
-                                               'create_date' => array('type' 
=> 'int', 'precision' => 4, 'nullable' => false),
+                                               'create_date' => array('type' 
=> 'int', 'precision' => 8, 'nullable' => false),
                                ),
                                'pk' => array('id'),
                                'fk' => array(
                                                'lg_requirement' => 
array('requirement_id' => 'id'),
-                                               'phpgw_locations' => 
array('location_id' => 'location_id')
+                                               'phpgw_locations' => 
array('location_id' => 'location_id'),
+                                               'lg_calendar' => 
array('calendar_id' => 'id')
                                ),
                                'ix' => array(),
                                'uc' => array()
@@ -95,7 +115,7 @@
                                                'project_type_id' => 
array('type' => 'int', 'precision' => 4, 'nullable' => false),
                                                'cust_attribute_id' => 
array('type' => 'int', 'precision' => 4, 'nullable' => false),
                                                'create_user' => array('type' 
=> 'int', 'precision' => 4, 'nullable' => false),
-                                               'create_date' => array('type' 
=> 'int', 'precision' => 4, 'nullable' => false),
+                                               'create_date' => array('type' 
=> 'int', 'precision' => 8, 'nullable' => false),
                                ),
                                'pk' => array('id'),
                                'fk' => array(
@@ -112,7 +132,7 @@
                                                'operator' => array('type' => 
'varchar', 'precision' => '255', 'nullable' => false),

@@ Diff output truncated at 153600 characters. @@



reply via email to

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