fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [11230] Merge 11190:11229 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [11230] Merge 11190:11229 from trunk
Date: Wed, 03 Jul 2013 07:18:29 +0000

Revision: 11230
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11230
Author:   sigurdne
Date:     2013-07-03 07:18:27 +0000 (Wed, 03 Jul 2013)
Log Message:
-----------
Merge 11190:11229 from trunk

Modified Paths:
--------------
    branches/Version-1_0-branch/controller/inc/class.hook_helper.inc.php
    branches/Version-1_0-branch/controller/inc/class.socase.inc.php
    branches/Version-1_0-branch/controller/inc/class.socheck_item.inc.php
    branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php
    branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php
    branches/Version-1_0-branch/controller/inc/class.socontrol_group.inc.php
    
branches/Version-1_0-branch/controller/inc/class.socontrol_group_list.inc.php
    branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php
    branches/Version-1_0-branch/controller/inc/class.socontrol_item_list.inc.php
    
branches/Version-1_0-branch/controller/inc/class.socontrol_item_option.inc.php
    branches/Version-1_0-branch/controller/inc/class.soprocedure.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.inc.php
    branches/Version-1_0-branch/controller/inc/class.uicontrol_group.inc.php
    
branches/Version-1_0-branch/controller/inc/component/class.date_generator.inc.php
    
branches/Version-1_0-branch/controller/js/controller/ajax_control_to_location.js
    
branches/Version-1_0-branch/controller/templates/base/calendar/select_buildings_on_property.xsl
    
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_month.xsl
    
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_year.xsl
    branches/Version-1_0-branch/controller/templates/base/case/add_case.xsl
    
branches/Version-1_0-branch/controller/templates/base/case/view_closed_cases.xsl
    
branches/Version-1_0-branch/controller/templates/base/case/view_open_cases.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/fragments/check_list_top_section.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_info.xsl
    
branches/Version-1_0-branch/controller/templates/base/control_group/control_group.xsl
    branches/Version-1_0-branch/frontend/inc/class.bofellesdata.inc.php
    branches/Version-1_0-branch/frontend/inc/class.borental.inc.php
    branches/Version-1_0-branch/frontend/inc/class.uifrontend.inc.php
    branches/Version-1_0-branch/phpgwapi/inc/class.categories.inc.php
    branches/Version-1_0-branch/phpgwapi/inc/class.custom_fields.inc.php
    branches/Version-1_0-branch/phpgwapi/inc/phpmailer/LICENSE
    branches/Version-1_0-branch/phpgwapi/inc/phpmailer/class.phpmailer.php
    branches/Version-1_0-branch/phpgwapi/inc/phpmailer/class.pop3.php
    branches/Version-1_0-branch/phpgwapi/inc/phpmailer/class.smtp.php
    branches/Version-1_0-branch/phpgwapi/inc/phpmailer/docs/extending.html
    branches/Version-1_0-branch/phpgwapi/inc/phpmailer/docs/faq.html
    branches/Version-1_0-branch/phpgwapi/inc/phpmailer/docs/pop3_article.txt
    branches/Version-1_0-branch/phpgwapi/inc/phpmailer/examples/contents.html
    branches/Version-1_0-branch/phpgwapi/inc/phpmailer/examples/index.html
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/language/phpmailer.lang-ar.php
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/language/phpmailer.lang-br.php
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/language/phpmailer.lang-ca.php
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/language/phpmailer.lang-ch.php
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/language/phpmailer.lang-cz.php
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/language/phpmailer.lang-de.php
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/language/phpmailer.lang-dk.php
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/language/phpmailer.lang-es.php
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/language/phpmailer.lang-et.php
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/language/phpmailer.lang-fi.php
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/language/phpmailer.lang-fo.php
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/language/phpmailer.lang-fr.php
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/language/phpmailer.lang-hu.php
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/language/phpmailer.lang-it.php
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/language/phpmailer.lang-ja.php
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/language/phpmailer.lang-nl.php
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/language/phpmailer.lang-no.php
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/language/phpmailer.lang-pl.php
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/language/phpmailer.lang-ro.php
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/language/phpmailer.lang-ru.php
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/language/phpmailer.lang-se.php
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/language/phpmailer.lang-tr.php
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/language/phpmailer.lang-zh.php
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/language/phpmailer.lang-zh_cn.php
    branches/Version-1_0-branch/phpgwapi/inc/phpmailer/test/phpmailerTest.php
    branches/Version-1_0-branch/phpgwapi/inc/phpmailer/test/test_callback.php
    branches/Version-1_0-branch/property/inc/class.bocondition_survey.inc.php
    branches/Version-1_0-branch/property/inc/class.boinvoice.inc.php
    branches/Version-1_0-branch/property/inc/class.bolocation.inc.php
    branches/Version-1_0-branch/property/inc/class.custom_fields.inc.php
    branches/Version-1_0-branch/property/inc/class.menu.inc.php
    branches/Version-1_0-branch/property/inc/class.socommon_core.inc.php
    branches/Version-1_0-branch/property/inc/class.socondition_survey.inc.php
    branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php
    branches/Version-1_0-branch/property/inc/class.sorequest.inc.php
    branches/Version-1_0-branch/property/inc/class.uicondition_survey.inc.php
    branches/Version-1_0-branch/property/inc/class.uientity.inc.php
    branches/Version-1_0-branch/property/inc/class.uilocation.inc.php
    branches/Version-1_0-branch/property/inc/class.uilookup.inc.php
    branches/Version-1_0-branch/property/inc/class.uirequest.inc.php
    branches/Version-1_0-branch/property/inc/class.uitts.inc.php
    
branches/Version-1_0-branch/property/inc/custom/default/BkBygg_editer_system_oversikt.php
    branches/Version-1_0-branch/property/inc/export/default/Basware_X114
    branches/Version-1_0-branch/property/setup/phpgw_no.lang
    branches/Version-1_0-branch/property/setup/setup.inc.php
    branches/Version-1_0-branch/property/setup/tables_current.inc.php
    branches/Version-1_0-branch/property/setup/tables_update.inc.php
    branches/Version-1_0-branch/property/templates/base/css/base.css
    branches/Version-1_0-branch/property/templates/base/entity.xsl
    branches/Version-1_0-branch/property/templates/base/location_form.xsl
    branches/Version-1_0-branch/property/templates/base/request.xsl
    branches/Version-1_0-branch/property/templates/base/tts.xsl
    branches/Version-1_0-branch/rental/inc/class.bofellesdata.inc.php
    branches/Version-1_0-branch/rental/inc/class.soparty.inc.php
    branches/Version-1_0-branch/rental/inc/class.uiresultunit.inc.php

Added Paths:
-----------
    branches/Version-1_0-branch/phpgwapi/inc/phpmailer/README.md
    branches/Version-1_0-branch/phpgwapi/inc/phpmailer/changelog.md
    branches/Version-1_0-branch/phpgwapi/inc/phpmailer/composer.json
    branches/Version-1_0-branch/phpgwapi/inc/phpmailer/docs/generatedocs.sh
    branches/Version-1_0-branch/phpgwapi/inc/phpmailer/examples/LGPLv3.txt
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/examples/code_generator.phps
    branches/Version-1_0-branch/phpgwapi/inc/phpmailer/examples/exceptions.phps
    branches/Version-1_0-branch/phpgwapi/inc/phpmailer/examples/gmail.phps
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/examples/images/phpmailer.png
    branches/Version-1_0-branch/phpgwapi/inc/phpmailer/examples/mail.phps
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/examples/mailing_list.phps
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/examples/pop_before_smtp.phps
    branches/Version-1_0-branch/phpgwapi/inc/phpmailer/examples/scripts/
    branches/Version-1_0-branch/phpgwapi/inc/phpmailer/examples/sendmail.phps
    branches/Version-1_0-branch/phpgwapi/inc/phpmailer/examples/smtp.phps
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/examples/smtp_no_auth.phps
    branches/Version-1_0-branch/phpgwapi/inc/phpmailer/examples/styles/
    branches/Version-1_0-branch/phpgwapi/inc/phpmailer/extras/
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/language/phpmailer.lang-eo.php
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/language/phpmailer.lang-fa.php
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/language/phpmailer.lang-he.php
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/language/phpmailer.lang-lt.php
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/language/phpmailer.lang-sk.php
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/language/phpmailer.lang-uk.php
    branches/Version-1_0-branch/phpgwapi/inc/phpmailer/test/fakesendmail.sh
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/test/phpmailerLangTest.php
    
branches/Version-1_0-branch/phpgwapi/inc/phpmailer/test/testbootstrap-dist.php

Removed Paths:
-------------
    branches/Version-1_0-branch/phpgwapi/inc/phpmailer/README
    branches/Version-1_0-branch/phpgwapi/inc/phpmailer/aboutus.html

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,10750-10796,10798-10939,10941,10943,10945,10947-10953,10955,10957-10961,10963,10965-10966,10968-11001,11003-11030,11032-11034,11036,11038,11040,11042-11053,11055-11059,11061-11062,11064-11068,11070-11073,11075-11077,11079-11083,11085,11087-11088,11090-11093,11095-11108,11110-11111,11113,11115-11116,11118-11120,11122,11124-11129,11131-11132,11134,11136,11138,11140-11151,11153-11161,11163-11185,11187-11189
   + 
/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,10798-10939,10941,10943,10945,10947-10953,10955,10957-10961,10963,10965-10966,10968-11001,11003-11030,11032-11034,11036,11038,11040,11042-11053,11055-11059,11061-11062,11064-11068,11070-11073,11075-11077,11079-11083,11085,11087-11088,11090-11093,11095-11108,11110-11111,11113,11115-11116,11118-11120,11122,11124-11129,11131-11132,11134,11136,11138,11140-11151,11153-11161,11163-11185,11187-11189,11191-11229

Modified: branches/Version-1_0-branch/controller/inc/class.hook_helper.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.hook_helper.inc.php        
2013-07-02 20:18:48 UTC (rev 11229)
+++ branches/Version-1_0-branch/controller/inc/class.hook_helper.inc.php        
2013-07-03 07:18:27 UTC (rev 11230)
@@ -64,6 +64,7 @@
                 */
                public function home()
                {
+
                        $location_array = array();
                        $component_short_desc = array();
 
@@ -158,8 +159,16 @@
 
                /* =======================================  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>";
-
+                       $my_planned_controls_HTML = <<<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>
+HTML;
                        // Todays date
                        $from_date_ts =  mktime(0, 0, 0, date("n"), date("j"), 
date("Y") );
                        // One month ahead in time
@@ -174,6 +183,17 @@
 
                        $my_check_lists = 
$this->get_my_assigned_check_list($from_date_ts, $to_date_ts, $repeat_type);
 
+                       $_assigned_list = array();
+                       foreach ($my_check_lists as $_key => $my_check_list)
+                       {
+                               
$_assigned_list[$my_check_list['location_code']][$_key] = $my_check_list;
+                       }
+
+                       foreach ($_assigned_list as $location_code => 
$controls_at_location)
+                       {
+                               $my_controls[] = array( $location_code, 
'assigned', $controls_at_location );
+                       } 
+
                        $my_planned_controls = array();
 
                        // Generates an array with planned controls
@@ -200,8 +220,7 @@
 
                                        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);
-
+                                               $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, 
$filter_assigned_to = true);
                                                foreach($check_list_array as 
$check_list)
                                                {
                                                        
$planned_date_for_check_list = $check_list->get_planned_date();
@@ -215,18 +234,31 @@
                                        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 );
+                                               
$check_lists_for_control_and_component = 
$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)
+                                               
foreach($check_lists_for_control_and_component['check_lists_array'] as 
$check_list)
                                                {
                                                        
$planned_date_for_check_list = $check_list->get_planned_date();
 
                                                        
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'] );
+                                                               
$my_planned_controls[$planned_date_for_check_list][] = 
array($check_list->get_deadline(), $my_control, $check_list->get_id(), 
"component", $component['location_id'], $component['id'] );
                                                        }
                                                }
                                        }
+                                       else if($control_type == "assigned")
+                                       {
+                                               $check_list_array = 
$container_arr[2];
+                                               foreach($check_list_array as 
$check_list)
+                                               {
+                                                       
$planned_date_for_check_list = $check_list['planned_date'];
+
+                                                       
if($planned_date_for_check_list > 0)
+                                                       {
+                                                               
$my_planned_controls[$planned_date_for_check_list][] = array( 
$check_list['deadline'], $my_control, $check_list['id'], "location", 
$location_code );
+                                                       }
+                                               }
+                                       }
                                }
                        }
 
@@ -265,10 +297,12 @@
                                $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";
+                       $my_planned_controls_HTML .= "</div>"; // home_portal
 
+                       echo "\n".'<!-- BEGIN checklist info -->'."\n <h2 
class='heading'>Mine planlagte kontroller</h2><div class='home-box'>" . 
$my_planned_controls_HTML . "</div>\n".'<!-- END checklist info -->'."\n";
 
-      {
+
+             {
                        /* =======================================  UNDONE 
ASSIGNED CONTROLS FOR CURRENT USER  ================================= */
 
                // from date is set to 3 months back in time
@@ -280,9 +314,6 @@
 
                // Fetches controls current user is responsible for 3 months 
back in time
                        $my_controls = $this->get_my_controls($my_locations, 
$from_date_ts, $to_date_ts, $repeat_type);
-
-                       $my_check_lists = 
$this->get_my_assigned_check_list($from_date_ts, $to_date_ts, $repeat_type);
-
                        $my_undone_controls = array();
 
                        // Generates an array containing undone controls
@@ -349,11 +380,36 @@
                                                        
$my_undone_controls[$deadline_ts][] = array("edit", $deadline_ts, $my_control, 
$check_list->get_id(), $location_code );
                                                }
                                        }
+
                                }
+
                        }
 
-                       $my_undone_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>";
+                       //Add assigned
+                       $my_check_lists = 
$this->get_my_assigned_check_list($from_date_ts, $to_date_ts, $repeat_type, 
true);
 
+                       $_assigned_list = array();
+                       foreach ($my_check_lists as $_key => $my_check_list)
+                       {
+                               
$_assigned_list[$my_check_list['location_code']][$_key] = $my_check_list;
+                       }
+
+                       foreach ($my_check_lists as $_key => $my_check_list)
+                       {
+                               
$my_undone_controls[$my_check_list['deadline']][] = array("edit", 
$my_check_list['deadline'], $my_check_list, $_key, 
$my_check_list['location_code'] );
+                       }
+       
+                       ksort($my_undone_controls);
+
+                       $my_undone_controls_HTML = <<<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>
+HTML;
                        // Sorts my_undone_controls by deadline date
                        ksort($my_undone_controls);
 
@@ -362,127 +418,135 @@
                        foreach($my_undone_controls as $date_ts => 
$controls_on_date)
                        {
                                // If number of controls on a date exceeds 1 it 
will be put in expand list
-                                       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'>"  . 
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'>";
-                                       }
+                               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'>"  . 
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'>";
+                               }
 
-                                       foreach($controls_on_date as 
$my_undone_control)
-                                       {
-                                               $check_list_status = 
$my_undone_control[0];
-                                               $deadline_ts = 
$my_undone_control[1];
-                                               $my_control = 
$my_undone_control[2];
+                               foreach($controls_on_date as $my_undone_control)
+                               {
+                                       $check_list_status = 
$my_undone_control[0];
+                                       $deadline_ts = $my_undone_control[1];
+                                       $my_control = $my_undone_control[2];
+                                       $control_area_name = 
$this->get_control_area_name( $my_control["control_area_id"] );
 
-                                               $control_area_name = 
$this->get_control_area_name( $my_control["control_area_id"] );
-       
-                                               $date_str = date($dateformat, 
$deadline_ts);
+                                       $date_str = date($dateformat, 
$deadline_ts);
 
-                                               if($check_list_status == "add")
+                                       if($check_list_status == "add")
+                                       {
+                                               $check_list_type = 
$my_undone_control[3];
+                                               if($check_list_type == 
"location")
                                                {
-                                                       $check_list_type = 
$my_undone_control[3];
+                                                       $location_code = 
$my_undone_control[4];
+                                                       
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"];
 
-                                                       if($check_list_type == 
"location")
+                                                       if(count( 
$controls_on_date) > 1 )
                                                        {
-                                                               $location_code 
= $my_undone_control[4];
-                                                               
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.add_check_list', 'type' => "location", 'control_id' => 
$my_control['id'], 'location_code' => $location_code, 'deadline_ts' => 
$deadline_ts));
 
-                                                               if(count( 
$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_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'>{$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 .= "<li><a href='{$link}'><div 
class='date'>{$date_str}</div><div 
class='control'>{$my_control['title']}</div><div 
class='title'>{$location_name}</div><div 
class='control-area'>{$control_area_name}</div></a></li>";
                                                        }
-                                                       else 
if($check_list_type == "component")
+                                                       else
                                                        {
-                                                               $location_id = 
$my_undone_control[4];
-                                                               $component_id = 
$my_undone_control[5];
+                                                               $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));
 
-                                                               
if(!isset($component_short_desc[$location_id][$component_id]))
-                                                               {
-                                                                       
$component_short_desc[$location_id][$component_id] = 
execMethod('property.soentity.get_short_description', array('location_id' => 
$location_id, 'id' => $component_id));
-                                                               }
+                                                               
$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>";
+                                                       }
 
-                                                               
if($component_short_desc[$location_id][$component_id])
-                                                               {
-                                                                       
$short_desc_arr = $component_short_desc[$location_id][$component_id];
-                                                               }
-
-                                                               if(count( 
$controls_on_date) > 1 )
-                                                               {
-                                                                       $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'>{$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'>{$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>";
-                                                               }
-                                                       }
                                                }
-                                               else if($check_list_status == 
"edit")
+                                               else if($check_list_type == 
"component")
                                                {
-                                                       $check_list_id = 
$my_undone_control[3];
-                                                       $location_code = 
$my_undone_control[4];
+                                                       $location_id = 
$my_undone_control[4];
+                                                       $component_id = 
$my_undone_control[5];
 
-                                                       
if(!isset($location_array[$location_code]) || !$location_array[$location_code])
+                                                       
if(!isset($component_short_desc[$location_id][$component_id]))
                                                        {
-                                                               
$location_array[$location_code] = execMethod('property.bolocation.read_single', 
array('location_code' => $location_code));
+                                                               
$component_short_desc[$location_id][$component_id] = 
execMethod('property.soentity.get_short_description', array('location_id' => 
$location_id, 'id' => $component_id));
                                                        }
-                                                       $location_name = 
$location_array[$location_code]["loc1_name"];
 
+                                                       
if($component_short_desc[$location_id][$component_id])
+                                                       {
+                                                               $short_desc_arr 
= $component_short_desc[$location_id][$component_id];
+                                                       }
+
                                                        if(count( 
$controls_on_date) > 1 )
                                                        {
                                                                $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'>{$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>";
+                                                               $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'>{$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.edit_check_list', 'check_list_id' => $check_list_id));
-       
-                                                               
$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>";
+                                                               $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'>{$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>";
                                                        }
                                                }
                                        }
+                                       else if($check_list_status == "edit")
+                                       {
+                                               $check_list_id = 
$my_undone_control[3];
+                                               $location_code = 
$my_undone_control[4];
 
-                                       if(count( $controls_on_date) > 1 )
-                                       {
-                                               $my_undone_controls_HTML .= 
"</ul>";
+                                               
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"];
+
+                                               if(count( $controls_on_date) > 
1 )
+                                               {
+                                                       $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'>{$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 .= "<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>";
+                                               }
                                        }
                                }
 
-                               $my_undone_controls_HTML .= "</div>"; // 
home_portal
+                               if(count( $controls_on_date ) > 1 )
+                               {
+                                       $my_undone_controls_HTML .= "</ul>";
+                                       $my_undone_controls_HTML .= "</li>";
+                               }
+                       }
 
-                               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";
+                       $my_undone_controls_HTML .= "</ul>";
 
+                       $my_undone_controls_HTML .= "</div>"; // home_portal
 
-                               /* ================================  CONTROLS 
ASSIGNED TO CURRENT USER  ================================= */
+                       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";
 
-                               $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>";
 
+                       /* ================================  CONTROLS ASSIGNED 
TO CURRENT USER  ================================= */
 
+                       $my_assigned_controls_HTML = <<<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>
+HTML;
+
                        $from_date_ts =  strtotime("now");
                        $to_date_ts = mktime(0, 0, 0, date("n")+1, date("j"), 
date("Y") );
 
@@ -556,7 +620,7 @@
                                                // 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 );
                                                }
                                        }
                                }
@@ -575,10 +639,6 @@
                                {
                                        $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'>"  . 
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'>";
                                }
 
@@ -650,7 +710,7 @@
                                                        
$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));
 
@@ -661,40 +721,43 @@
                                if(count( $assigned_controls_on_date ) > 1 )
                                {
                                        $my_assigned_controls_HTML .= "</li>";
+                                       $my_assigned_controls_HTML .= "</ul>";
                                }
 
-                               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";
-      }
+                       $my_assigned_controls_HTML .= "</ul>";
+                       $my_assigned_controls_HTML .= "</div>"; // home_portal
+
+                       echo "\n".'<!-- BEGIN checklist info -->'."\n <h2 
class='heading'>Mine tildelte kontroller</h2><div class='home-box'>" . 
$my_assigned_controls_HTML . "</div>\n".'<!-- END checklist info -->'."\n";
+               }
                }
                /* ================================  FUNCTIONS  
======================================== */
 
 
-               function get_my_assigned_check_list($from_date_ts, $to_date_ts, 
$repeat_type)
+               function get_my_assigned_check_list($from_date_ts, $to_date_ts, 
$repeat_type, $completed = null)
                {
                        $check_list_array = array();
 
                        $so_control = CreateObject('controller.socontrol');
 
                        $user_id = $GLOBALS['phpgw_info']['user']['account_id'];
-                       $assigned_check_list_at_location = 
$so_control->get_assigned_check_list_at_location( $from_date_ts, $to_date_ts, 
$repeat_type, $user_id,"return_array");
+                       $assigned_check_list_at_location = 
$so_control->get_assigned_check_list_at_location( $from_date_ts, $to_date_ts, 
$repeat_type, $user_id,$completed, 'return_array');
 
                        foreach ($assigned_check_list_at_location as 
$assigned_check_list)
                        {
                                $check_list_array[$assigned_check_list['id']] = 
$assigned_check_list;
                        }
+                       unset($assigned_check_list);
 
-                       $assigned_check_list_at_component = 
$so_control->get_assigned_check_list_by_component( $from_date_ts, $to_date_ts, 
$repeat_type, $user_id,"return_array");
+                       $assigned_check_list_at_component = 
$so_control->get_assigned_check_list_by_component( $from_date_ts, $to_date_ts, 
$repeat_type, $user_id, $completed, 'return_array');
 
-//_debug_array($check_list_array);
-//_debug_array($assigned_check_list_at_component);
+                       foreach ($assigned_check_list_at_component as 
$assigned_check_list)
+                       {
+                               $check_list_array[$assigned_check_list['id']] = 
$assigned_check_list;
+                       }
 
-
+                       return $check_list_array;
                }
 
 
@@ -702,10 +765,12 @@
                {
                        $so_control = CreateObject('controller.socontrol');
 
+                       $my_controls = array();
+
                        foreach($my_locations as $location)
                        {
-                               $my_controls = array();
-               //              $components_with_controls_array = array();
+                               $components_with_controls_array = array();
+                               $controls_at_location = 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"] );
@@ -725,13 +790,13 @@
                                        $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 )
+                               if( $controls_at_location )
                                {
                                        // 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 )
+                               if( $components_with_controls_array )
                                {
                                        foreach($components_with_controls_array 
as $component)
                                        {
@@ -741,8 +806,6 @@
                                }
                        }
 
-
-
                        return $my_controls;
                }
 
@@ -754,12 +817,12 @@
                        $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 )
                                {
-                       if( $area['cat_id'] == $control_area_id )
-                                       {
-                                               $control_area_name = 
$area['name'];
-                                       }
+                                       $control_area_name = $area['name'];
                                }
+                       }
 
                        return $control_area_name;
                }

Modified: branches/Version-1_0-branch/controller/inc/class.socase.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socase.inc.php     
2013-07-02 20:18:48 UTC (rev 11229)
+++ branches/Version-1_0-branch/controller/inc/class.socase.inc.php     
2013-07-03 07:18:27 UTC (rev 11230)
@@ -68,7 +68,7 @@
                        $sql .= "WHERE id = {$case_id}";
                        
 
-                       $this->db->limit_query($sql, 0, __LINE__, __FILE__, 1);
+                       $this->db->query($sql, __LINE__, __FILE__);
 
                        if($this->db->next_record())
                        {

Modified: branches/Version-1_0-branch/controller/inc/class.socheck_item.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socheck_item.inc.php       
2013-07-02 20:18:48 UTC (rev 11229)
+++ branches/Version-1_0-branch/controller/inc/class.socheck_item.inc.php       
2013-07-03 07:18:27 UTC (rev 11230)
@@ -116,7 +116,7 @@
                        $sql .= "WHERE ci.id = {$check_item_id} ";
                        $sql .= "AND ci.control_item_id=coi.id";
 
-                       $this->db->limit_query($sql, 0, __LINE__, __FILE__, 1);
+                       $this->db->query($sql, __LINE__, __FILE__);
 
                        if($this->db->next_record())
                        {
@@ -234,9 +234,9 @@
                        $sql .= "WHERE ci.check_list_id = {$check_list_id} ";
                        $sql .= "AND ci.control_item_id = coi.id ";
                        $sql .= "AND ci.control_item_id = {$control_item_id}";
-                       
-                       $this->db->limit_query($sql, 0, __LINE__, __FILE__, 1);
 
+                       $this->db->query($sql, __LINE__, __FILE__);
+
                        if($this->db->next_record())
                        {
                                $check_item = new 
controller_check_item($this->unmarshal($this->db->f('c_id'), 'int'));
@@ -326,6 +326,8 @@
                        
                        $check_item_id = 0;
                        $check_item = null;
+                       $check_items_array=array();
+
                        while ($this->db->next_record())
                        {
                                if( $this->db->f('ci_id') != $check_item_id )
@@ -381,13 +383,9 @@
                                $check_item->set_cases_array($cases_array);
                                                        
                                $check_items_array[] = $check_item;
-                               
-                               return $check_items_array;
                        }
-                       else
-                       {
-                               return null;
-                       }
+
+                       return $check_items_array;
                }
                
                /**

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-07-02 20:18:48 UTC (rev 11229)
+++ branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php       
2013-07-03 07:18:27 UTC (rev 11230)
@@ -273,6 +273,8 @@
                        $sql .= "AND status = {$status} ";
                }  
        
+               $sql .= "AND assigned_to IS NULL";
+
                $this->db->query($sql);
                
                $check_list = null;
@@ -565,7 +567,7 @@
         * @param $repeat_type_expr repeat type expression
         * @return array with check list objects
        */
-       function get_check_lists_for_control_and_location( $control_id, 
$location_code, $from_date_ts, $to_date_ts, $repeat_type = null )
+       function get_check_lists_for_control_and_location( $control_id, 
$location_code, $from_date_ts, $to_date_ts, $repeat_type = null , 
$filter_assigned_to = null)
        {
                $control_id = (int) $control_id;
 
@@ -582,7 +584,11 @@
                }
                
                $sql .= "AND deadline BETWEEN $from_date_ts AND $to_date_ts ";
-               
+               if($filter_assigned_to)
+               {
+                       $sql .= "AND assigned_to IS NULL";
+               }
+
                $this->db->query($sql);
                
                while ($this->db->next_record())
@@ -638,6 +644,7 @@
                
                $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'), 'int'));

Modified: branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php  
2013-07-02 20:18:48 UTC (rev 11229)
+++ branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php  
2013-07-03 07:18:27 UTC (rev 11230)
@@ -124,15 +124,15 @@
                 * @param $role_id responsible role for carrying out the 
control  
                 * @return array with controls as objects or arrays
                 */
-               public function get_assigned_check_list_at_location($from_date, 
$to_date, $repeat_type, $user_id, $return_type = "return_object")
+               public function get_assigned_check_list_at_location($from_date, 
$to_date, $repeat_type, $user_id,$completed = null, $return_type = 
"return_object")
                {
                        $user_id = (int) $user_id;
                        $repeat_type = (int) $repeat_type;
 
                        $check_list_array = array();
                        
-                       $sql  = "SELECT controller_check_list.location_code, 
controller_check_list.control_id, controller_check_list.id AS check_list_id,"
-                               . " 
procedure_id,requirement_id,costresponsibility_id,control_area_id,description, 
start_date, end_date,deadline,"
+                       $sql  = "SELECT DISTINCT 
controller_check_list.location_code, controller_check_list.control_id, 
controller_check_list.id AS check_list_id,"
+                               . " 
procedure_id,requirement_id,costresponsibility_id,description, start_date, 
end_date,deadline,planned_date, completed_date,"
                                . " control_area_id, 
repeat_type,repeat_interval, title"
                                . " FROM controller_check_list"
                                . " {$this->join} controller_control ON 
controller_check_list.control_id = controller_control.id"
@@ -146,8 +146,13 @@
                        }
 
                        
-                       $sql .= "AND ((controller_control.start_date <= 
$to_date AND controller_control.end_date IS NULL) ";
-                       $sql .= "OR (controller_control.start_date <= $to_date 
AND controller_control.end_date > $from_date ))";
+                       $sql .= " AND ((controller_control.start_date <= 
$to_date AND controller_control.end_date IS NULL) ";
+                       $sql .= " OR (controller_control.start_date <= $to_date 
AND controller_control.end_date > $from_date ))";
+
+                       if($completed)
+                       {
+                               $sql .= " AND 
controller_check_list.completed_date IS NULL ";                   
+                       }
                        
 //_debug_array($sql);
                        $this->db->query($sql);
@@ -161,13 +166,10 @@
                                
$check_list->set_start_date($this->unmarshal($this->db->f('start_date'), 
'int'));
                                
$check_list->set_end_date($this->unmarshal($this->db->f('end_date'), 'int'));
                                
$check_list->set_deadline($this->unmarshal($this->db->f('deadline'), 'int'));
-       //                      
$check_list->set_procedure_id($this->unmarshal($this->db->f('procedure_id'), 
'int'));
-       //                      
$check_list->set_requirement_id($this->unmarshal($this->db->f('requirement_id'),
 'int'));
-       //                      
$check_list->set_costresponsibility_id($this->unmarshal($this->db->f('costresponsibility_id'),
 'int'));
+                               
$check_list->set_planned_date($this->unmarshal($this->db->f('planned_date'), 
'int'));
+                               
$check_list->set_completed_date($this->unmarshal($this->db->f('completed_date'),
 'int'));       
                                
$check_list->set_control_area_id($this->unmarshal($this->db->f('control_area_id'),
 'int'));
-       //                      
$check_list->set_repeat_type($this->unmarshal($this->db->f('repeat_type'), 
'int'));
-       //                      
$check_list->set_repeat_type_label($this->unmarshal($this->db->f('repeat_type'),
 'int'));
-       //                      
$check_list->set_repeat_interval($this->unmarshal($this->db->f('repeat_interval'),
 'int'));
+                               
$check_list->set_location_code($this->unmarshal($this->db->f('location_code', 
true), 'string'));
                                
$check_list->set_assigned_to($this->unmarshal($user_id, 'int'));                
                
 
                                if($return_type == "return_object")
@@ -197,14 +199,14 @@
                 * @param $role_id responsible role for carrying out the 
control  
                 * @return array of components as objects or arrays
                 */
-               public function 
get_assigned_check_list_by_component($from_date, $to_date, $repeat_type, 
$user_id, $return_type = "return_object")
+               public function 
get_assigned_check_list_by_component($from_date, $to_date, $repeat_type, 
$user_id, $completed = null, $return_type = "return_object")
                {
                        $repeat_type = $repeat_type;
                        $user_id = (int)$user_id;
 
                
-                       $sql  = "SELECT controller_check_list.location_code, 
controller_check_list.control_id, controller_check_list.id AS check_list_id,"
-                               . " 
procedure_id,requirement_id,costresponsibility_id,control_area_id, 
controller_control.description, start_date, end_date, deadline,"
+                       $sql  = "SELECT DISTINCT 
controller_check_list.location_code, controller_check_list.control_id, 
controller_check_list.id AS check_list_id,"
+                               . " 
procedure_id,requirement_id,costresponsibility_id, 
controller_control.description, start_date, end_date, deadline,planned_date, 
completed_date,"
                                . " control_area_id, 
repeat_type,repeat_interval, title,"
                                . " bim_item.guid,bim_item.type as 
component_type, bim_item.id as component_id, bim_item.address,"
                                . " bim_item.loc1"
@@ -220,45 +222,21 @@
 //                             $sql .= "AND controller_control.repeat_type = 
$repeat_type ";
                        }
 
-                       $sql .= "AND ((controller_control.start_date <= 
$to_date AND controller_control.end_date IS NULL) ";
-                       $sql .= "OR (controller_control.start_date <= $to_date 
AND controller_control.end_date > $from_date ))";
-                       $sql .= "ORDER BY bim_item.id ";
+                       if($completed)
+                       {
+                               $sql .= " AND 
controller_check_list.completed_date IS NULL ";                   
+                       }
+
+                       $sql .= " AND ((controller_control.start_date <= 
$to_date AND controller_control.end_date IS NULL) ";
+                       $sql .= " OR (controller_control.start_date <= $to_date 
AND controller_control.end_date > $from_date ))";
+                       $sql .= " ORDER BY bim_item.id ";
                         
                        $this->db->query($sql);
                        
                        $check_list_array = array();
-                       $components_array = array();
-                       $component_id = 0;
-                       $component = null;
+
                        while($this->db->next_record()) 
                        {
-                               if( $this->db->f('component_id') != 
$component_id )
-                               {
-                                       if($component_id != 0)
-                                       {
-                                               
$component->set_controls_array($controls_array);
-                                               $controls_array = array();
-                                               
-                                               if($return_type == 
"return_array")
-                                               {
-                                                       $components_array[] = 
$component->toArray();
-                                               }
-                                               else
-                                               {
-                                                       $components_array[] = 
$component;
-                                               }
-                                       }
-                                       
-                                       $component = new controller_component();
-                                       
$component->set_type($this->unmarshal($this->db->f('component_type'), 'int'));
-                                       
$component->set_id($this->unmarshal($this->db->f('component_id'), 'int'));
-                                       
$component->set_location_id($this->unmarshal($this->db->f('location_id'), 
'int'));
-                                       
$component->set_guid($this->unmarshal($this->db->f('guid', true), 'string'));
-                                       
$component->set_location_code($this->unmarshal($this->db->f('location_code', 
true), 'string'));
-                                       
$component->set_loc_1($this->unmarshal($this->db->f('loc1', true), 'string'));
-                                       
$component->set_address($this->unmarshal($this->db->f('address', true), 
'string'));
-                               }
-                               
                                $check_list = new 
controller_check_list($this->unmarshal($this->db->f('check_list_id'), 'int'));
                                
$check_list->set_control_id($this->unmarshal($this->db->f('control_id'), 
'int'));
                                
$check_list->set_title($this->unmarshal($this->db->f('title', true), 'string'));
@@ -266,18 +244,12 @@
                                
$check_list->set_start_date($this->unmarshal($this->db->f('start_date'), 
'int'));
                                
$check_list->set_end_date($this->unmarshal($this->db->f('end_date'), 'int'));
                                
$check_list->set_deadline($this->unmarshal($this->db->f('deadline'), 'int'));
-       //                      
$check_list->set_procedure_id($this->unmarshal($this->db->f('procedure_id'), 
'int'));
-       //                      
$check_list->set_requirement_id($this->unmarshal($this->db->f('requirement_id'),
 'int'));
-       //                      
$check_list->set_costresponsibility_id($this->unmarshal($this->db->f('costresponsibility_id'),
 'int'));
                                
$check_list->set_control_area_id($this->unmarshal($this->db->f('control_area_id'),
 'int'));
-       //                      
$check_list->set_repeat_type($this->unmarshal($this->db->f('repeat_type'), 
'int'));
-       //                      
$check_list->set_repeat_type_label($this->unmarshal($this->db->f('repeat_type'),
 'int'));
-       //                      
$check_list->set_repeat_interval($this->unmarshal($this->db->f('repeat_interval'),
 'int'));
                                
$check_list->set_assigned_to($this->unmarshal($user_id, 'int'));                
                
+                               
$check_list->set_planned_date($this->unmarshal($this->db->f('planned_date'), 
'int'));
+                               
$check_list->set_completed_date($this->unmarshal($this->db->f('completed_date'),
 'int'));       
+                               
$check_list->set_location_code($this->unmarshal($this->db->f('location_code', 
true), 'string'));
 
-
-
-                       
                                if($return_type == "return_object")
                                {
                                        $check_list_array[] = $check_list;
@@ -286,29 +258,11 @@
                                {
                                        $check_list_array[] = 
$check_list->toArray();
                                }
-                                                       
-                               $component_id = $component->get_id();
                        }
-                                       
-                       if($component != null)
-                       {
-                               
$component->set_controls_array($check_list_array);
-                               
-                               if($return_type == "return_array")
-                               {
-                                       $components_array[] = 
$component->toArray();
-                               }
-                               else
-                               {
-                                       $components_array[] = $component;
-                               }
-                       }
 
-                       return $components_array;
+                       return $check_list_array;                               
        
                }
 
-
-
 //--------
 
 
@@ -330,12 +284,12 @@
 
                        $controls_array = array();
                        
-                       $sql  = "SELECT distinct c.*, 
fm_responsibility_role.name AS responsibility_name "; 
+                       $sql  = "SELECT distinct c.*, 
fm_responsibility_role.name AS responsibility_name,location_code "; 
                        $sql .= "FROM controller_control_location_list cll "; 
                        $sql .= "LEFT JOIN controller_control c on 
cll.control_id=c.id ";
                        $sql .= "LEFT JOIN fm_responsibility_role ON 
fm_responsibility_role.id = c.responsibility_id ";
-                       $sql .= "WHERE cll.location_code = '$location_code' ";
-                       
+       //              $sql .= "WHERE cll.location_code = '$location_code' ";
+                       $sql .= "WHERE cll.location_code LIKE '$location_code%' 
";                      
                        if( $repeat_type )
                        {
                                $sql .= "AND c.repeat_type = $repeat_type ";
@@ -354,8 +308,10 @@
 
                        while($this->db->next_record())
                        {
+                               $_location_code = $this->db->f('location_code', 
true);
+
                                $control = new 
controller_control($this->unmarshal($this->db->f('id'), 'int'));
-                               
$control->set_title($this->unmarshal($this->db->f('title', true), 'string'));
+                               
$control->set_title($this->unmarshal($this->db->f('title', true)  . " 
[{$_location_code}]", 'string'));
                                
$control->set_description($this->unmarshal($this->db->f('description', true), 
'string'));
                                
$control->set_start_date($this->unmarshal($this->db->f('start_date'), 'int'));
                                
$control->set_end_date($this->unmarshal($this->db->f('end_date'), 'int'));
@@ -368,7 +324,7 @@
                                
$control->set_repeat_type($this->unmarshal($this->db->f('repeat_type'), 'int'));
                                
$control->set_repeat_type_label($this->unmarshal($this->db->f('repeat_type'), 
'int'));
                                
$control->set_repeat_interval($this->unmarshal($this->db->f('repeat_interval'), 
'int'));
-                               
+
                                if($return_type == "return_object")
                                {
                                        $controls_array[] = $control;
@@ -744,8 +700,8 @@
                        $sql .= "WHERE control_id = $control_id ";
                        $sql .= "AND location_code = '$location_code'";
                        
-                       $this->db->limit_query($sql, 0, __LINE__, __FILE__, 1);
-                       
+                       $this->db->query($sql, __LINE__, __FILE__);
+
                        if($this->db->next_record())
                        {
                                $control_location = new 
controller_control_location($this->unmarshal($this->db->f('id'), 'int'));
@@ -987,7 +943,19 @@
                        }
                        if(isset($filters['control_areas']))
                        {
-                               $filter_clauses[] = 
"controller_control.control_area_id = 
{$this->marshal($filters['control_areas'],'int')}";
+//                             $filter_clauses[] = 
"controller_control.control_area_id = 
{$this->marshal($filters['control_areas'],'int')}";
+
+                               $cat_id = (int) $filters['control_areas'];
+                               $cats   = CreateObject('phpgwapi.categories', 
-1, 'controller', '.control');
+                               $cats->supress_info     = true;
+                               $cat_list       = $cats->return_sorted_array(0, 
false, '', '', '', false, $cat_id, false);
+                               $cat_filter = array($cat_id);
+                               foreach ($cat_list as $_category)
+                               {
+                                       $cat_filter[] = $_category['id'];
+                               }
+
+                               $filter_clauses[] = 
"controller_control.control_area_id IN (" .  implode(',', $cat_filter) .')';
                        }
                        if(isset($filters['responsibilities']))
                        {
@@ -1072,7 +1040,7 @@
                        $sql .= "FROM controller_control c {$joins} "; 
                        $sql .= "WHERE c.id = " . $id;
                        
-                       $this->db->limit_query($sql, 0, __LINE__, __FILE__, 1);
+                       $this->db->query($sql, __LINE__, __FILE__);
                        $this->db->next_record();
                        
                        $control = new controller_control((int) $id);

Modified: 
branches/Version-1_0-branch/controller/inc/class.socontrol_group.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socontrol_group.inc.php    
2013-07-02 20:18:48 UTC (rev 11229)
+++ branches/Version-1_0-branch/controller/inc/class.socontrol_group.inc.php    
2013-07-03 07:18:27 UTC (rev 11230)
@@ -128,7 +128,7 @@
                        $joins .= "     {$this->left_join} controller_procedure 
ON (p.procedure_id = controller_procedure.id)";
 
                        $sql = "SELECT p.*, fm_building_part.descr AS 
building_part_descr, controller_procedure.title as procedure_title FROM 
controller_control_group p {$joins} WHERE p.id = " . $id;
-                       $this->db->limit_query($sql, 0, __LINE__, __FILE__, 1);
+                       $this->db->query($sql, __LINE__, __FILE__);
                        $this->db->next_record();
 
                        $control_group = new 
controller_control_group($this->unmarshal($this->db->f('id'), 'int'));
@@ -290,7 +290,19 @@
                        }
                        if(isset($filters['control_areas']))
                        {
-                               $filter_clauses[] = 
"controller_control_group.control_area_id = 
{$this->marshal($filters['control_areas'],'int')}";
+//                             $filter_clauses[] = 
"controller_control_group.control_area_id = 
{$this->marshal($filters['control_areas'],'int')}";
+
+                               $cat_id = (int) $filters['control_areas'];
+                               $cats   = CreateObject('phpgwapi.categories', 
-1, 'controller', '.control');
+                               $cats->supress_info     = true;
+                               $cat_list       = $cats->return_sorted_array(0, 
false, '', '', '', false, $cat_id, false);
+                               $cat_filter = array($cat_id);
+                               foreach ($cat_list as $_category)
+                               {
+                                       $cat_filter[] = $_category['id'];
+                               }
+
+                               $filter_clauses[] = 
"controller_control_group.control_area_id IN (" .  implode(',', $cat_filter) 
.')';
                        }
 
                        if(count($filter_clauses))
@@ -349,11 +361,21 @@
                 */
                function get_control_groups_by_control_area($control_area_id)
                {
-                       $control_area_id = (int) $control_area_id;
-                       $controls_array = array();
 
-                       $sql = "SELECT * FROM controller_control_group WHERE 
control_area_id=$control_area_id";
+                       $cat_id = (int) $control_area_id;
+                       $cats   = CreateObject('phpgwapi.categories', -1, 
'controller', '.control');
+                       $cat_path = $cats->get_path($cat_id);
+                       foreach ($cat_path as $_category)
+                       {
+                               $cat_filter[] = $_category['id'];
+                       }
+
+                       $filter_control_area = "control_area_id IN (" .  
implode(',', $cat_filter) .')';
+
+                       $sql = "SELECT * FROM controller_control_group WHERE 
{$filter_control_area}";
+
                        $this->db->query($sql);
+                       $controls_array = array();
 
                        while($this->db->next_record())
                        {

Modified: 
branches/Version-1_0-branch/controller/inc/class.socontrol_group_list.inc.php
===================================================================
--- 
branches/Version-1_0-branch/controller/inc/class.socontrol_group_list.inc.php   
    2013-07-02 20:18:48 UTC (rev 11229)
+++ 
branches/Version-1_0-branch/controller/inc/class.socontrol_group_list.inc.php   
    2013-07-03 07:18:27 UTC (rev 11230)
@@ -118,7 +118,7 @@
                        $id = (int)$id;
 
                        $sql = "SELECT p.* FROM controller_control_group_list p 
WHERE p.id = " . $id;
-                       $this->db->limit_query($sql, 0, __LINE__, __FILE__, 1);
+                       $this->db->query($sql, __LINE__, __FILE__);
 
                        if($this->db->next_record())
                        {
@@ -148,7 +148,7 @@
                        $control_group_id = (int) $control_group_id;
 
                        $sql = "SELECT p.* FROM controller_control_group_list p 
WHERE p.control_id={$control_id} AND p.control_group_id={$control_group_id}";
-                       $this->db->limit_query($sql, 0, __LINE__, __FILE__, 1);
+                       $this->db->query($sql, __LINE__, __FILE__);
 
                        if($this->db->next_record())
                        {

Modified: 
branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php     
2013-07-02 20:18:48 UTC (rev 11229)
+++ branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php     
2013-07-03 07:18:27 UTC (rev 11230)
@@ -136,7 +136,7 @@
                        $id = (int)$id;
                        $joins = " {$this->left_join} controller_control_group 
ON (p.control_group_id = controller_control_group.id)";
                        $sql = "SELECT p.*, controller_control_group.group_name 
AS control_group_name FROM controller_control_item p {$joins} WHERE p.id = " . 
$id;
-                       $this->db->limit_query($sql, 0, __LINE__, __FILE__, 1);
+                       $this->db->query($sql, __LINE__, __FILE__);
                        $this->db->next_record();
 
                        $control_item = new 
controller_control_item($this->unmarshal($this->db->f('id'), 'int'));
@@ -219,7 +219,7 @@
                        $control_item_id = (int)$control_item_id;
                        $sql  = "delete from controller_control_item_option 
where control_item_id={$control_item_id}";
                        
-      return $this->db->query($sql);
+                       return $this->db->query($sql);
                }
 
                function get_control_item_array($start = 0, $results = 1000, 
$sort = null, $dir = '', $query = null, $search_option = null, $filters = 
array())
@@ -312,7 +312,19 @@
                        }
                        if(isset($filters['control_areas']))
                        {
-                               $filter_clauses[] = 
"controller_control_item.control_area_id = 
{$this->marshal($filters['control_areas'],'int')}";
+//                             $filter_clauses[] = 
"controller_control_item.control_area_id = 
{$this->marshal($filters['control_areas'],'int')}";
+
+                               $cat_id = (int) $filters['control_areas'];
+                               $cats   = CreateObject('phpgwapi.categories', 
-1, 'controller', '.control');
+                               $cats->supress_info     = true;
+                               $cat_list       = $cats->return_sorted_array(0, 
false, '', '', '', false, $cat_id, false);
+                               $cat_filter = array($cat_id);
+                               foreach ($cat_list as $_category)
+                               {
+                                       $cat_filter[] = $_category['id'];
+                               }
+
+                               $filter_clauses[] = 
"controller_control_item.control_area_id IN (" .  implode(',', $cat_filter) 
.')';
                        }
                        
 

Modified: 
branches/Version-1_0-branch/controller/inc/class.socontrol_item_list.inc.php
===================================================================
--- 
branches/Version-1_0-branch/controller/inc/class.socontrol_item_list.inc.php    
    2013-07-02 20:18:48 UTC (rev 11229)
+++ 
branches/Version-1_0-branch/controller/inc/class.socontrol_item_list.inc.php    
    2013-07-03 07:18:27 UTC (rev 11230)
@@ -114,7 +114,7 @@
                        $id = (int)$id;
 
                        $sql = "SELECT p.* FROM controller_control_item_list p 
WHERE p.id = " . $id;
-                       $this->db->limit_query($sql, 0, __LINE__, __FILE__, 1);
+                       $this->db->query($sql, __LINE__, __FILE__);
                        $this->db->next_record();
 
                        $control_item_list = new 
controller_control_item_list($this->unmarshal($this->db->f('id'), 'int'));
@@ -138,7 +138,7 @@
                        $control_item_id = (int) $control_item_id;
 
                        $sql = "SELECT cil.* FROM controller_control_item_list 
cil WHERE cil.control_id = " . $control_id . " AND cil.control_item_id = " . 
$control_item_id;
-                       $this->db->limit_query($sql, 0, __LINE__, __FILE__, 1);
+                       $this->db->query($sql, __LINE__, __FILE__);
                        $result = $this->db->next_record();
 
                        if( $result )
@@ -255,7 +255,7 @@
                        $sql .= "AND ci.control_group_id=$control_group_id ";
                        $sql .= "ORDER BY cl.order_nr";
                        
-                       $this->db->limit_query($sql, $start, __LINE__, 
__FILE__, $limit);
+                       $this->db->query($sql, __LINE__, __FILE__);
 
                        while ($this->db->next_record())
                        {
@@ -304,7 +304,7 @@
                        $sql .= "AND ci.control_group_id=$control_group_id ";
                        $sql .= "ORDER BY cl.order_nr";
                        
-                       $this->db->limit_query($sql, $start, __LINE__, 
__FILE__, $limit);
+                       $this->db->query($sql, __LINE__, __FILE__);
                        
                        $control_item_id = 0;
                        $control_item = null;

Modified: 
branches/Version-1_0-branch/controller/inc/class.socontrol_item_option.inc.php
===================================================================
--- 
branches/Version-1_0-branch/controller/inc/class.socontrol_item_option.inc.php  
    2013-07-02 20:18:48 UTC (rev 11229)
+++ 
branches/Version-1_0-branch/controller/inc/class.socontrol_item_option.inc.php  
    2013-07-03 07:18:27 UTC (rev 11230)
@@ -106,7 +106,7 @@
                {
                        $id = (int)$id;
                        $sql = "SELECT p.* FROM controller_control_item_option 
p {$joins} WHERE p.id = " . $id;
-                       $this->db->limit_query($sql, 0, __LINE__, __FILE__, 1);
+                       $this->db->query($sql, __LINE__, __FILE__);
                        $this->db->next_record();
 
                        $control_item_option = new 
controller_control_item_option($this->unmarshal($this->db->f('id'), 'int'));

Modified: branches/Version-1_0-branch/controller/inc/class.soprocedure.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.soprocedure.inc.php        
2013-07-02 20:18:48 UTC (rev 11229)
+++ branches/Version-1_0-branch/controller/inc/class.soprocedure.inc.php        
2013-07-03 07:18:27 UTC (rev 11230)
@@ -267,10 +267,19 @@
 
                function get_procedures_by_control_area($control_area_id)
                {
-                       $control_area_id = (int) $control_area_id;
+                       $cat_id = (int) $control_area_id;
+                       $cats   = CreateObject('phpgwapi.categories', -1, 
'controller', '.control');
+                       $cat_path = $cats->get_path($cat_id);
+                       foreach ($cat_path as $_category)
+                       {
+                               $cat_filter[] = $_category['id'];
+                       }
+
+                       $filter_control_area = 
"controller_procedure.control_area_id IN (" .  implode(',', $cat_filter) .')';
+
                        $results = array();
 
-                       $sql = "SELECT * FROM controller_procedure WHERE 
control_area_id={$control_area_id} AND end_date IS NULL ORDER BY title ASC";
+                       $sql = "SELECT * FROM controller_procedure WHERE 
{$filter_control_area} AND end_date IS NULL ORDER BY title ASC";
                        $this->db->query($sql);
 
                        while($this->db->next_record())
@@ -301,19 +310,42 @@
                        }
                }
 
-               function get_procedures($start = 0, $results = 1000, $sort = 
null, $dir = '', $query = null, $search_option = null, $filters = array())
+               function get_procedures($start = 0, $results = 0, $sort = null, 
$dir = '', $query = null, $search_option = null, $filters = array())
                {
-                       $results = array();
-
                        //$condition = $this->get_conditions($query, 
$filters,$search_option);
                        $order = $sort ? "ORDER BY $sort $dir ": '';
 
                        //$sql = "SELECT * FROM controller_procedure WHERE 
$condition $order";
 
                        $condition = "WHERE end_date IS NULL";
+
+                       if(isset($filters['control_areas']) && 
$filters['control_areas'])
+                       {
+                               $cat_id = (int) $filters['control_areas'];
+                               $cats   = CreateObject('phpgwapi.categories', 
-1, 'controller', '.control');
+                               $cats->supress_info     = true;
+                               $cat_list       = $cats->return_sorted_array(0, 
false, '', '', '', false, $cat_id, false);
+                               $cat_filter = array($cat_id);
+                               foreach ($cat_list as $_category)
+                               {
+                                       $cat_filter[] = $_category['id'];
+                               }
+
+                               $condition .= " AND control_area_id IN (" .  
implode(',', $cat_filter) .')';
+                       }
+
                        $sql = "SELECT * FROM controller_procedure $condition 
$order";
-                       $this->db->limit_query($sql, $start, __LINE__, 
__FILE__, $limit);
 
+                       if($results)
+                       {
+                               $this->db->limit_query($sql, $start, __LINE__, 
__FILE__, $results);
+                       }
+                       else
+                       {
+                               $this->db->query($sql, __LINE__, __FILE__);
+                       }
+
+                       $values = array();
                        while ($this->db->next_record())
                        {
                                $procedure = new 
controller_procedure($this->unmarshal($this->db->f('id'), 'int'));
@@ -329,10 +361,10 @@
                                
$procedure->set_revision_no($this->unmarshal($this->db->f('revision_no'), 
'int'));
                                
$procedure->set_revision_date($this->unmarshal($this->db->f('revision_date'), 
'int'));
 
-                               $results[] = $procedure;
+                               $values[] = $procedure;
                        }
 
-                       return $results;
+                       return $values;
                }
 
                function get_procedures_as_array($start = 0, $results = 1000, 
$sort = null, $dir = '', $query = null, $search_option = null, $filters = 
array())
@@ -346,7 +378,7 @@
 
                        //$condition = "WHERE end_date IS NULL";
                        $sql = "SELECT * FROM controller_procedure $condition 
$order";
-                       $this->db->limit_query($sql, $start, __LINE__, 
__FILE__, $limit);
+                       $this->db->limit_query($sql, $start, __LINE__, 
__FILE__, $results);
 
                        while ($this->db->next_record())
                        {
@@ -375,7 +407,7 @@
                        $results = array();
 
                        $sql = "SELECT p.* FROM controller_procedure p WHERE 
procedure_id = {$id} ORDER BY end_date DESC";
-                       $this->db->limit_query($sql, $start, __LINE__, 
__FILE__, $limit);
+                       $this->db->query($sql, __LINE__, __FILE__);
 
                        while ($this->db->next_record())
                        {
@@ -459,7 +491,19 @@
                        }
                        if(isset($filters['control_areas']))
                        {
-                               $filter_clauses[] = "procedure.control_area_id 
= {$this->marshal($filters['control_areas'], 'int')}";
+//                             $filter_clauses[] = "procedure.control_area_id 
= {$this->marshal($filters['control_areas'], 'int')}";
+
+                               $cat_id = (int) $filters['control_areas'];
+                               $cats   = CreateObject('phpgwapi.categories', 
-1, 'controller', '.control');
+                               $cats->supress_info     = true;
+                               $cat_list       = $cats->return_sorted_array(0, 
false, '', '', '', false, $cat_id, false);
+                               $cat_filter = array($cat_id);
+                               foreach ($cat_list as $_category)
+                               {
+                                       $cat_filter[] = $_category['id'];
+                               }
+
+                               $filter_clauses[] = "procedure.control_area_id 
IN (" .  implode(',', $cat_filter) .')';
                        }
 
                        if(count($filter_clauses))

Modified: branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php 
2013-07-02 20:18:48 UTC (rev 11229)
+++ branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php 
2013-07-03 07:18:27 UTC (rev 11230)
@@ -94,7 +94,7 @@
                        $location_code = phpgw::get_var('location_code');
                        $year = phpgw::get_var('year');
                        $month = phpgw::get_var('month');
-                       $role = phpgw::get_var('role');
+                       $role = phpgw::get_var('role', 'int', 'REQUEST', -1);
                        $repeat_type = phpgw::get_var('repeat_type');
 
                        // Validates year. If year is not set, current year is 
chosen
@@ -107,7 +107,7 @@
                        $repeat_type = 
$this->validate_repeat_type($repeat_type);
 
                        // Validates role.
-                       $role = $this->validate_role($role);
+//                     $role = $this->validate_role($role);
 
                        // Gets timestamp value of first day in month
                        $from_date_ts = 
month_calendar::get_start_date_month_ts($year, intval($month));
@@ -133,7 +133,8 @@
                                if ($level == 1)
                                {
                                        // Fetches all controls for the 
components for a location within time period
-                                       $filter = "bim_item.location_code = 
'$location_code' ";
+//                                     $filter = "bim_item.location_code = 
'$location_code' ";
+                                       $filter = "bim_item.location_code LIKE 
'$location_code%' ";
                                        $components_with_controls_array = 
$this->so_control->get_controls_by_component($from_date_ts, $to_date_ts, 
$repeat_type, "return_object", $role, $filter);
                                }
                                else
@@ -248,7 +249,8 @@
                {
                        $location_code = phpgw::get_var('location_code');
                        $year = phpgw::get_var('year');
-                       $role = phpgw::get_var('role');
+                       $role = phpgw::get_var('role', 'int', 'REQUEST', -1);
+
                        $repeat_type = phpgw::get_var('repeat_type');
 
                        // Validates year. If year is not set, current year is 
chosen
@@ -258,7 +260,7 @@
                        $repeat_type = 
$this->validate_repeat_type($repeat_type);
 
                        // Validates role.
-                       $role = $this->validate_role($role);
+//                     $role = $this->validate_role($role);
 
                        // Gets timestamp of first day in year
                        $from_date_ts = $this->get_start_date_year_ts($year);
@@ -287,7 +289,8 @@
                                if ($level == 1)
                                {
                                        // Fetches all controls for the 
components for a location within time period
-                                       $filter = "bim_item.location_code = 
'$location_code' ";
+//                                     $filter = "bim_item.location_code = 
'$location_code' ";
+                                       $filter = "bim_item.location_code LIKE 
'$location_code%' ";
                                        $components_with_controls_array = 
$this->so_control->get_controls_by_component($from_date_ts, $to_date_ts, 
$repeat_type, "return_object", $role, $filter);
                                }
                                else

Modified: branches/Version-1_0-branch/controller/inc/class.uicase.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicase.inc.php     
2013-07-02 20:18:48 UTC (rev 11229)
+++ branches/Version-1_0-branch/controller/inc/class.uicase.inc.php     
2013-07-03 07:18:27 UTC (rev 11230)
@@ -131,6 +131,7 @@
                                
                                $type = 'component';
                                $building_location_code = 
$this->location_finder->get_building_location_code($component_arr['location_code']);
+                               $buildings_on_property = array();
                        }
                        else
                        {
@@ -138,8 +139,34 @@
                                $location_code_search_components = 
$case_location_code ? $case_location_code : $location_code;
                                $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
                                $type = 'location';
+                               // Fetches buildings on property
+                               $buildings_on_property = 
$this->location_finder->get_buildings_on_property($user_role, $location_code, 
$level);
+                               foreach ( $buildings_on_property as &$building)
+                               {
+                                       $building['selected'] = $building['id'] 
== $case_location_code ? 1 : 0;
+                               }
                        }
 
+
+                       //------------- START find already registered cases 
-------------//
+
+                       $cases_at_component_group = array();
+                       $existing_check_items_and_cases = 
$this->so_check_item->get_check_items_with_cases($check_list_id, $_type = null, 
'all', null, null);//$location_code_search_components);
+                       foreach($existing_check_items_and_cases as $check_item)
+                       {
+                               foreach($check_item->get_cases_array() as $case)
+                               {
+                                       $component_id = 
$case->get_component_id();
+                                       if($component_id)
+                                       {
+                                               
$cases_at_component_group[$check_item->get_control_item()->get_control_group_id()][$component_id]
 ++;
+                                       }
+                               }
+                       }
+
+                       //------------- END find already registered cases 
-------------//
+
+
                        //Populating array with saved control items for each 
group
                        //Cache result
                        $components_at_location = array();
@@ -151,9 +178,10 @@
                                if(count($saved_control_items) > 0)
                                {                               
                                        $component_location_id = 
$control_group->get_component_location_id();
-                                       if($component_location_id)
+
+                                       if($component_location_id && $type == 
'location')
                                        {
-                                               //// start components
+                                               //--- start components 
-------------//
                                                $criterias_array = array();
                                                $loc_arr = 
$GLOBALS['phpgw']->locations->get_name($component_location_id);
                                                $criterias_array['location_id'] 
= $component_location_id;
@@ -162,18 +190,20 @@
 
                                                $component_criteria = 
$control_group->get_component_criteria();
                                                $conditions = array();
-                                               foreach ($component_criteria as 
$attribute_id => $condition_value)
+                                               foreach ($component_criteria as 
$attribute_id => $condition)
                                                {
-                                                       if($condition_value)
+                                                       if($condition['value'])
                                                        {
+                                                               
eval('$condition_value = ' . "{$condition['value']};");
                                                                $conditions[] = 
array
                                                                (
                                                                        
'attribute_id'  => $attribute_id,
-                                                                       
'operator'              => 'equal',
-                                                                       'value' 
                => $condition_value,
+                                                                       
'operator'              => $condition['operator'],
+                                                                       'value' 
                => $condition_value
                                                                );
                                                        }
                                                }
+
                                                $criterias_array['conditions'] 
= $conditions;
                                                
                                                if( 
!isset($components_at_location[$component_location_id][$location_code_search_components])
  || !$_components_at_location = 
$components_at_location[$component_location_id][$location_code_search_components])
@@ -182,10 +212,20 @@
                                                        
$components_at_location[$component_location_id][$location_code_search_components]
 = $_components_at_location;
                                                }
                                                
-                                               /// end components
+                                               //--- end components 
-------------//
 
                                                if($_components_at_location)
                                                {
+                                                       
foreach($_components_at_location as &$_component_at_location)
+                                                       {
+                                                               
if(isset($cases_at_component_group[$control_group->get_id()][$_component_at_location['id']]))
+                                                               {
+                                                                       
$_component_at_location['short_description'] .= ' (' . 
$cases_at_component_group[$control_group->get_id()][$_component_at_location['id']]
 . ')';
+                                                               }
+                                                       }
+                                                       
+                                                       array_unshift 
($_components_at_location, array('id'=>'', 'short_description' => 
lang('select')));
+                                                       
                                                        
$control_groups_with_items_array[] = array
                                                        (
                                                                'control_group' 
                        => $control_group->toArray(),
@@ -206,19 +246,13 @@
 
                        }
                        
+
                        $level = 
$this->location_finder->get_location_level($location_code);
                        $year = date("Y", $check_list->get_deadline());
                        $month = date("n", $check_list->get_deadline());
                                                        
                        $user_role = true;
 
-                       // Fetches buildings on property
-                       $buildings_on_property = 
$this->location_finder->get_buildings_on_property($user_role, $location_code, 
$level);
-                       foreach ( $buildings_on_property as &$building)
-                       {
-                               $building['selected'] = $building['id'] == 
$case_location_code ? 1 : 0;
-                       }
-
                        $data = array
                        (
                                'control'                                       
                => $control,
@@ -233,6 +267,7 @@
                                'current_year'                                  
        => $year,
                                'current_month_nr'                              
        => $month,
                            'cases_view'                                        
        => 'add_case',
+               //          'location_required'                                 
=> true
                        );
                        
                        phpgwapi_jquery::load_widget('core');
@@ -267,6 +302,8 @@
                        $check_list = 
$this->so_check_list->get_single($check_list_id);
                                                
                        $control_id = $check_list->get_control_id();
+                       
+                       $location_code = $location_code ? $location_code : 
$check_list->get_location_code();
                        $control = $this->so_control->get_single( $control_id );
                        
                        $check_item = 
$this->so_check_item->get_check_item_by_check_list_and_control_item($check_list_id,
 $control_item_id);
@@ -669,6 +706,8 @@
                
                        if($status)
                        {
+
+
                                return json_encode( array( "status" => 
"deleted" ) );
                        }
                        else
@@ -754,12 +793,15 @@
                                
                                $type = 'component';
                                $building_location_code = 
$this->location_finder->get_building_location_code($component_arr['location_code']);
+                               $buildings_on_property = array();
                        }
                        else
                        {
                                
                                $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$check_list_location_code));
                                $type = 'location';
+                               // Fetches locations on property
+                               $buildings_on_property = 
$this->location_finder->get_buildings_on_property($user_role, 
$check_list_location_code, $level);
                        }
       
       
@@ -769,20 +811,15 @@
                                                        
                        $user_role = true;
 
-                       // Fetches buildings on property
-                       $buildings_on_property = 
$this->location_finder->get_buildings_on_property($user_role, 
$check_list_location_code, $level);
+                       $open_check_items_and_cases = 
$this->so_check_item->get_check_items_with_cases($check_list_id, $_type = null, 
'open_or_waiting', null, $case_location_code);
+
       
-                       if( count($buildings_on_property) > 0 )
+                       if( $buildings_on_property )
                        {
-               //              $case_location_code = $case_location_code ? 
$case_location_code : $buildings_on_property[0]['id'];
-
-                               $open_check_items_and_cases = 
$this->so_check_item->get_check_items_with_cases($check_list_id, $type = null, 
'open_or_waiting', null, $case_location_code);
-
                                foreach ( $buildings_on_property as &$building)
                                {
                                        $building['selected'] = $building['id'] 
== $case_location_code ? 1 : 0;
                                }
-
                        }
       
                        foreach($open_check_items_and_cases as $key => 
$check_item)
@@ -807,7 +844,7 @@
       
                        $data = array
                        (
-                           'control'                              => $control,
+                           'control'                                           
=> $control,
                                'check_list'                                    
=> $check_list,
                                'buildings_on_property'         => 
$buildings_on_property,
                            'location_array'                            => 
$location_array,
@@ -858,12 +895,15 @@
                                
                                $type = 'component';
                                $building_location_code = 
$this->location_finder->get_building_location_code($component_arr['location_code']);
+                               $buildings_on_property = array();
                        }
                        else
                        {
                                $location_code = 
$check_list->get_location_code();
                                $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
                                $type = 'location';
+                               // Fetches buildings on property
+                               $buildings_on_property = 
$this->location_finder->get_buildings_on_property($user_role, $location_code, 
$level);
                        }
                        // Check list top section info
       
@@ -873,13 +913,10 @@
 
                        $user_role = true;
 
-                       // Fetches buildings on property
-                       $buildings_on_property = 
$this->location_finder->get_buildings_on_property($user_role, $location_code, 
$level);
+                       $closed_check_items_and_cases = 
$this->so_check_item->get_check_items_with_cases($check_list_id, null, 
'closed', null, $case_location_code);
 
-                       if( count($buildings_on_property) > 0 )
+                       if( $buildings_on_property )
                        {
-               //              $building_location_code = 
$buildings_on_property[0]['id'];
-                               $closed_check_items_and_cases = 
$this->so_check_item->get_check_items_with_cases($check_list_id, null, 
'closed', null, $case_location_code);
                                foreach ( $buildings_on_property as &$building)
                                {
                                        $building['selected'] = $building['id'] 
== $case_location_code ? 1 : 0;

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-07-02 20:18:48 UTC (rev 11229)
+++ branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php       
2013-07-03 07:18:27 UTC (rev 11230)
@@ -577,16 +577,16 @@
 
                        $data = array
                        (
-                               'control' => $control,
-                               'check_list' => $check_list,
-                               'buildings_on_property' => 
$buildings_on_property,
-                               'location_array' => $location_array,
-                               'component_array' => $component_array,
-                               'type' => $type,
-                               'current_year' => $year,
-                               'current_month_nr' => $month,
-                               'building_location_code' => 
$building_location_code,
-                               'location_level' => $level
+                               'control'                                       
=> $control,
+                               'check_list'                            => 
$check_list,
+                               'buildings_on_property'         => 
$buildings_on_property,
+                               'location_array'                        => 
$location_array,
+                               'component_array'                       => 
$component_array,
+                               'type'                                          
=> $type,
+                               'current_year'                          => 
$year,
+                               'current_month_nr'                      => 
$month,
+                               'building_location_code'        => 
$building_location_code,
+                               'location_level'                        => 
$level
                        );
 
                        phpgwapi_jquery::load_widget('core');

Modified: branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php  
2013-07-02 20:18:48 UTC (rev 11229)
+++ branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php  
2013-07-03 07:18:27 UTC (rev 11230)
@@ -287,7 +287,9 @@
                        $control_areas_array = $control_areas['cat_list'];
                
                        if($control != null)
+                       {
                                $procedures_array = 
$this->so_procedure->get_procedures_by_control_area($control->get_control_area_id());
+                       }
                        
                        $role_array = $this->so->get_roles();
                        

Modified: 
branches/Version-1_0-branch/controller/inc/class.uicontrol_group.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicontrol_group.inc.php    
2013-07-02 20:18:48 UTC (rev 11229)
+++ branches/Version-1_0-branch/controller/inc/class.uicontrol_group.inc.php    
2013-07-03 07:18:27 UTC (rev 11230)
@@ -201,9 +201,9 @@
                                'control_items'         => array('label' => 
lang('Control_items'), 'link' => '#control_items')
                        );
                        $tab_to_display = 'control_group';
-                       $control_group_id = phpgw::get_var('id');
+                       $control_group_id = phpgw::get_var('id', 'int');
                        $new_control_group = false;
-                       if(isset($control_group_id) && $control_group_id > 0)
+                       if( $control_group_id )
                        {
                                $control_group = 
$this->so->get_single($control_group_id);
                        }
@@ -232,8 +232,26 @@
                                        $control_group->set_control_area_id( 
phpgw::get_var('control_area') );
                                        $control_group->set_building_part_id( 
phpgw::get_var('building_part') );
                                        
$control_group->set_component_location_id($component_location_id);
-                                       $control_group->set_component_criteria( 
phpgw::get_var('attributes') );
+                                       
+                                       $attributes = 
phpgw::get_var('attributes');
+                                       $attributes_operator = 
phpgw::get_var('attributes_operator');
+                                       
+                                       $criteria = array();
+                                       if(is_array($attributes))
+                                       {
+                                               foreach ($attributes as $_key 
=> $_value)
+                                               {
+                                                       if($_value)
+                                                       {
+                                                               
$criteria[$_key]['value']               = $_value;
+                                                               
$criteria[$_key]['operator']    = $attributes_operator[$_key];
+                                                       }
+                                               
+                                               }
+                                       }
 
+                                       $control_group->set_component_criteria( 
$criteria );
+
                                        if(isset($control_group_id) && 
$control_group_id > 0)
                                        {
                                                $ctrl_group_id = 
$control_group_id;
@@ -313,12 +331,12 @@
                                        (
                                                'id'    => $cat_list['cat_id'],
                                                'name'  => $cat_list['name'],
+                                               'selected' => 
$control_group->get_control_area_id() == $cat_list['cat_id'] ? 1 : 0
                                        );
                                }
                                // END as categories
 
-                               //$control_area_array = 
$this->so_control_area->get_control_area_array();
-                               $procedure_array = 
$this->so_procedure->get_procedures(null,null,'title','ASC',null,null,null);
+                               $procedure_array = 
$this->so_procedure->get_procedures(0,0,'title','ASC',null,null,array('control_areas'
 => $control_group->get_control_area_id()));
 
                                if($this->flash_msgs)
                                {
@@ -326,27 +344,6 @@
                                        $msgbox_data = 
$GLOBALS['phpgw']->common->msgbox($msgbox_data);
                                }
 
-/*                             foreach ($control_area_array as $control_area)
-                               {
-                                       
if($control_group->get_control_area_id() && $control_area->get_id() == 
$control_group->get_control_area_id())
-                                       {
-                                               $control_area_options[] = array
-                                               (
-                                                       'id'    => 
$control_area->get_id(),
-                                                       'name'  => 
$control_area->get_title(),
-                                                       'selected' => 'yes'
-                                               );
-                                       }
-                                       else
-                                       {
-                                               $control_area_options[] = array
-                                               (
-                                                       'id'    => 
$control_area->get_id(),
-                                                       'name'  => 
$control_area->get_title()
-                                               );
-                                       }
-                               }*/
-
                                foreach ($procedure_array as $procedure)
                                {
                                        if($control_group->get_procedure_id() 
&& $procedure->get_id() == $control_group->get_procedure_id())
@@ -460,8 +457,7 @@
                                }
                                // END as categories
 
-                               //$control_area_array = 
$this->so_control_area->get_control_area_array();
-                               $procedure_array = 
$this->so_procedure->get_procedures(null,null,'title','ASC',null,null,null);
+                               $procedure_array = 
$this->so_procedure->get_procedures(0,0,'title','ASC',null,null,array('control_areas'
 => $control_group->get_control_area_id()));
 
                                if($this->flash_msgs)
                                {
@@ -509,7 +505,7 @@
                                $entity_so      = 
CreateObject('property.soadmin_entity');
                                $custom = 
createObject('phpgwapi.custom_fields');
                                $entity_list = $entity_so->read(array('allrows' 
=> true));
-
+                               $attributes = array();
                                array_unshift($entity_list,array 
('id'=>'','name'=> lang('select value')));
 
                                $component_location_id = 
$control_group->get_component_location_id();
@@ -539,20 +535,70 @@
 
                                        $attributes = 
$custom->find('property',".entity.{$entity_arr[2]}.{$entity_arr[3]}", 0, 
'','','',true, true);
 
+                                       $operator1 = array
+                                       (
+                                               array
+                                               (
+                                                       'id' => 'eq',
+                                                       'name'  => '='
+                                               ),
+                                       );
+
+                                       $operator2 = array
+                                       (
+                                               array
+                                               (
+                                                       'id' => 'eq',
+                                                       'name'  => '='
+                                               ),
+                                               array
+                                               (
+                                                       'id' => 'lt',
+                                                       'name'  => '<'
+                                               ),
+                                               array
+                                               (
+                                                       'id' => 'gt',
+                                                       'name'  => '>'
+                                               ),
+                                       );
+
                                        $component_criteria = 
$control_group->get_component_criteria();
+
                                        foreach ($attributes as $key => &$a)
                                        {
-                                               
if(isset($component_criteria[$key]) && $component_criteria[$key])
+                                               switch ($a['datatype'])
                                                {
-                                                       $a['value'] = 
$component_criteria[$key];
+                                                       case 'LB':
+                                                       case 'R':
+                                                       case 'CH':
+                                                               $a['operator'] 
= array('options' => $operator1);
+                                                               break;
+                                                       default:
+                                                               $a['operator'] 
= array('options' => $operator2);                                               
                                                  
+                                               }
+
+                                               
if(isset($component_criteria[$key]['value']) && 
$component_criteria[$key]['value'])
+                                               {
+                                                       $a['value'] = 
$component_criteria[$key]['value'];
                                                        if(isset($a['choice']) 
&& $a['choice'])
                                                        {
                                                                
foreach($a['choice'] as &$choise)
                                                                {
-                                                                       
$choise['selected'] = $choise['id'] == $component_criteria[$key] ? 1 : 0;
+                                                                       
$choise['selected'] = $choise['id'] == $component_criteria[$key]['value'] ? 1 : 
0;
                                                                }
                                                        }
                                                }
+                                               
if(isset($component_criteria[$key]['operator']) && 
$component_criteria[$key]['operator'])
+                                               {
+                                                       
if(isset($a['operator']) && $a['operator'])
+                                                       {
+                                                               
foreach($a['operator']['options'] as &$_operator)
+                                                               {
+                                                                       
$_operator['selected'] = $_operator['id'] == 
$component_criteria[$key]['operator'] ? 1 : 0;
+                                                               }
+                                                       }
+                                               }
                                        }
                                }
 
@@ -810,20 +856,70 @@
                                $custom = 
createObject('phpgwapi.custom_fields');
                                $attributes = 
$custom->find('property',".entity.{$entity_arr[2]}.{$entity_arr[3]}", 0, 
'','','',true, true);
 
+                               $operator1 = array
+                               (
+                                       array
+                                       (
+                                               'id' => 'eq',
+                                               'name'  => '='
+                                       ),
+                               );
+
+                               $operator2 = array
+                               (
+                                       array
+                                       (
+                                               'id' => 'eq',
+                                               'name'  => '='
+                                       ),
+                                       array
+                                       (
+                                               'id' => 'lt',
+                                               'name'  => '<'
+                                       ),
+                                       array
+                                       (
+                                               'id' => 'gt',
+                                               'name'  => '>'
+                                       ),
+                               );
+
                                $component_criteria = 
$control_group->get_component_criteria();
+
                                foreach ($attributes as $key => &$a)
                                {
-                                       if(isset($component_criteria[$key]) && 
$component_criteria[$key])
+                                       switch ($a['datatype'])
                                        {
-                                               $a['value'] = 
$component_criteria[$key];
+                                               case 'LB':
+                                               case 'R':
+                                               case 'CH':
+                                                       $a['operator'] = 
array('options' => $operator1);
+                                                       break;
+                                               default:
+                                                       $a['operator'] = 
array('options' => $operator2);                                                 
                                                
+                                       }
+
+                                       
if(isset($component_criteria[$key]['value']) && 
$component_criteria[$key]['value'])
+                                       {
+                                               $a['value'] = 
$component_criteria[$key]['value'];
                                                if(isset($a['choice']) && 
$a['choice'])
                                                {
                                                        foreach($a['choice'] as 
&$choise)
                                                        {
-                                                               
$choise['selected'] = $choise['id'] == $component_criteria[$key] ? 1 : 0;
+                                                               
$choise['selected'] = $choise['id'] == $component_criteria[$key]['value'] ? 1 : 
0;
                                                        }
                                                }
                                        }
+                                       
if(isset($component_criteria[$key]['operator']) && 
$component_criteria[$key]['operator'])
+                                       {
+                                               if(isset($a['operator']) && 
$a['operator'])
+                                               {
+                                                       
foreach($a['operator']['options'] as &$_operator)
+                                                       {
+                                                               
$_operator['selected'] = $_operator['id'] == 
$component_criteria[$key]['operator'] ? 1 : 0;
+                                                       }
+                                               }
+                                       }
                                }
 
                                $control_items_array = 
$this->so_control_item_list->get_control_items($control_group_id);

Modified: 
branches/Version-1_0-branch/controller/inc/component/class.date_generator.inc.php
===================================================================
--- 
branches/Version-1_0-branch/controller/inc/component/class.date_generator.inc.php
   2013-07-02 20:18:48 UTC (rev 11229)
+++ 
branches/Version-1_0-branch/controller/inc/component/class.date_generator.inc.php
   2013-07-03 07:18:27 UTC (rev 11230)
@@ -31,12 +31,15 @@
        {
                $control_start_date = $this->find_control_start_date();
                $control_end_date = $this->end_date;
-                               
+
                if($control_end_date == null)
                {
                        $control_end_date = $this->period_end_date;
                }
-               
+/*             
+_debug_array($control_start_date);
+_debug_array($control_end_date);
+*/
                $period_start_date = $this->find_start_date_for_period( 
$control_start_date );
          
                $interval_date = $period_start_date;

Modified: 
branches/Version-1_0-branch/controller/js/controller/ajax_control_to_location.js
===================================================================
--- 
branches/Version-1_0-branch/controller/js/controller/ajax_control_to_location.js
    2013-07-02 20:18:48 UTC (rev 11229)
+++ 
branches/Version-1_0-branch/controller/js/controller/ajax_control_to_location.js
    2013-07-03 07:18:27 UTC (rev 11230)
@@ -9,7 +9,7 @@
        //      $("#hidden_control_area_id").val( control_area_id );
     //     var control_id_init = $("#hidden_control_id").val();
          var htmlString = "";
-
+                var width = 35;
          $.ajax({
                        type: 'POST',
                        dataType: 'json',
@@ -22,16 +22,20 @@
                                        $.each(obj, function(i) {
 
                                                var selected = '';
-/*
-                                               if(obj[i].id == control_id_init)
+                                               var title = obj[i].title;
+                                               
+                                               if(title.length > width)
                                                {
-                                                       selected = ' selected';
+                                                       width = title.length;
                                                }
-*/
-                                                       htmlString  += "<option 
value='" + obj[i].id + "'" + selected + ">" + obj[i].title + "</option>";
+                                               
+                                               htmlString  += "<option 
value='" + obj[i].id + "'" + selected + ">" + obj[i].title + "</option>";
                                        });
                                         
                                        $("#control_id").html( htmlString );
+                                       //$('#control_id').css('width', width + 
'em');
+                                       width = width/2;
+                                       $('#control_id').width(width + 'em');
                                        }
                                        else
                                        {

Modified: 
branches/Version-1_0-branch/controller/templates/base/calendar/select_buildings_on_property.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/calendar/select_buildings_on_property.xsl
     2013-07-02 20:18:48 UTC (rev 11229)
+++ 
branches/Version-1_0-branch/controller/templates/base/calendar/select_buildings_on_property.xsl
     2013-07-03 07:18:27 UTC (rev 11230)
@@ -9,7 +9,7 @@
     </input>
                
     <select id="choose-building-on-property" class="select-location">
-      <option value="">Velg bygg</option>
+      <option value="">Velg lokalisering</option>
       <xsl:for-each select="buildings_on_property">
         <option>
           <xsl:if test="id = //current_location/location_code">

Modified: 
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_month.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_month.xsl
      2013-07-02 20:18:48 UTC (rev 11229)
+++ 
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_month.xsl
      2013-07-03 07:18:27 UTC (rev 11230)
@@ -184,7 +184,7 @@
                                                </a>
                                        </xsl:if>
 
-                                       <label>Velg et annet bygg på 
eiendommen</label>
+                                       <label>Velg en annen lokalisering på 
eiendommen</label>
                                        <xsl:call-template 
name="select_buildings_on_property" />
                                </div>
 
@@ -404,4 +404,4 @@
                        </div>
                </div>
        </div>
-</xsl:template>
\ No newline at end of file
+</xsl:template>

Modified: 
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_year.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_year.xsl
       2013-07-02 20:18:48 UTC (rev 11229)
+++ 
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_year.xsl
       2013-07-03 07:18:27 UTC (rev 11230)
@@ -124,7 +124,7 @@
                                                </a>
                                        </xsl:if>
 
-                                       <label>Velg et annet bygg på 
eiendommen</label>
+                                       <label>Velg en annen lokalisering på 
eiendommen</label>
                                        <xsl:call-template 
name="select_buildings_on_property" />
                                </div>
 

Modified: 
branches/Version-1_0-branch/controller/templates/base/case/add_case.xsl
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/case/add_case.xsl     
2013-07-02 20:18:48 UTC (rev 11229)
+++ branches/Version-1_0-branch/controller/templates/base/case/add_case.xsl     
2013-07-03 07:18:27 UTC (rev 11230)
@@ -4,11 +4,16 @@
 
 <div id="main_content" class="medium">
   
-       <xsl:call-template name="check_list_top_section" />
+    <xsl:call-template name="check_list_top_section">
+    </xsl:call-template>
                
-       <div id="choose-building-wrp">
-    <xsl:call-template name="select_buildings_on_property" />
-  </div>
+       <xsl:choose>
+               <xsl:when test="buildings_on_property/child::node()">
+                       <div id="choose-building-wrp">
+                               <xsl:call-template 
name="select_buildings_on_property" />
+                       </div>
+               </xsl:when>  
+  </xsl:choose>
 
        <div id="view_cases">
 
@@ -36,9 +41,21 @@
                                                                <li>
                                                                        
<h4><img src="controller/images/arrow_right.png" /><span><xsl:value-of 
select="title"/></span></h4>
                                                                                
<form class="frm_register_case expand_item" action="{$action_url}" 
method="post">
-                                                               <input 
type="hidden" name="location_code"  value="" class="required" />
+                                                               <!--input 
type="hidden" name="location_code"  value="" class="required" /-->
+                                                               <input 
type="hidden" name="location_code"  value="" >
+                                                                               
        <xsl:if test="//location_required = 1">
+                                                                               
                        <xsl:attribute name="class" >
+                                                                               
                                <xsl:text>required</xsl:text>
+                                                                               
                        </xsl:attribute>                        
+                                                                               
        </xsl:if>
+                                                               </input>
                                                                <input 
type="hidden" name="control_group_id"  value="{$control_group_id}" />
                                                                <input 
type="hidden" name="component_id"  value="" />
+                                                                               
<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 type="hidden" name="check_list_id">
+                                                                               
        <xsl:attribute name="value"><xsl:value-of 
select="//check_list/id"/></xsl:attribute
+                                                                               
></input>
 
                                                                                
<xsl:choose>
                                                                                
        <xsl:when test="what_to_do !=''">
@@ -66,15 +83,18 @@
 
                                                                                
<xsl:choose>
                                                                                
        <xsl:when test="type = 'control_item_type_1'">
-                                                                               
                        <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 type="hidden" 
name="check_list_id"><xsl:attribute name="value"><xsl:value-of 
select="//check_list/id"/></xsl:attribute></input>
                                                                                
                        <input type="hidden" name="status" value="0" />
                                                                                
        <input type="hidden" name="type" value="control_item_type_1" />
                                                                                
                    
                                                                                
                        <div>
                                                                                
                    <label class="comment">Beskrivelse av sak</label>
-                                                                               
                          <textarea name="case_descr" class="required">
+                                                                               
                          <textarea name="case_descr" >
+                                                                               
                                        <xsl:if test="required = 1">
+                                                                               
                                                <xsl:attribute name="class" >
+                                                                               
                                                        
<xsl:text>required</xsl:text>
+                                                                               
                                                </xsl:attribute>                
        
+                                                                               
                                        </xsl:if>
+
                                                                                
                                        <xsl:value-of select="comment"/>
                                                                                
                                </textarea>
                                                                                
                        </div>
@@ -82,10 +102,6 @@
 
                                                                                
        </xsl:when>
                                                                                
        <xsl:when test="type = 'control_item_type_2'">
-
-                                                                               
                <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="type" type="hidden" 
value="control_item_type_2" />
                                                                                
                
                                                                                
                        <div class="row">
@@ -99,6 +115,12 @@
                                                                                
               <div class="row">
                                                                                
                 <label class="comment">Registrer målingsverdi</label>
                                                                                
                   <input>
+                                                                               
                                <xsl:if test="required = 1">
+                                                                               
                                        <xsl:attribute name="class" >
+                                                                               
                                                <xsl:text>required</xsl:text>
+                                                                               
                                        </xsl:attribute>                        
+                                                                               
                                </xsl:if>
+
                                                                                
                              <xsl:attribute 
name="name">measurement</xsl:attribute>
                                                                                
                              <xsl:attribute name="type">text</xsl:attribute>
                                                                                
                              <xsl:attribute name="value">
@@ -117,10 +139,6 @@
 
                                                                                
        </xsl:when>
                                                                                
        <xsl:when test="type = 'control_item_type_3'">
-
-                                                                               
                        <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="type" type="hidden" 
value="control_item_type_3" />
                                                                                
                
                                                                                
                        <div class="row">
@@ -134,6 +152,12 @@
                                                                                
               <div class="row">
                                                                                
                 <label class="comment">Velg verdi fra liste</label>
                                                                                
                        <select name="option_value">
+                                                                               
                                        <xsl:if test="required = 1">
+                                                                               
                                                <xsl:attribute name="class" >
+                                                                               
                                                        
<xsl:text>required</xsl:text>
+                                                                               
                                                </xsl:attribute>                
        
+                                                                               
                                        </xsl:if>
+                                                                               
                                        <option value="" >Velg</option>
                                                                                
                                <xsl:for-each select="options_array"> 
                                                                                
                                                <option>
                                                                                
                                                        <xsl:attribute 
name="value"><xsl:value-of select="option_value"/></xsl:attribute>
@@ -154,9 +178,6 @@
                                                                                
        </xsl:when>
                                                                                
        <xsl:when test="type = 'control_item_type_4'">
 
-                                                                               
                        <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="type" type="hidden" 
value="control_item_type_4" />
                                                                                
                
                                                                                
                        <div class="row">
@@ -168,8 +189,14 @@
                                                                                
                                </select>
                                                                                
                   </div>
                                                                                
               <div class="row">
-                                                                               
                 <label class="comment">Velg verdi fra liste</label>
+                                                                               
                 <label class="comment">Velg verdi fra lister</label>
                                                                                
                        <select name="option_value">
+                                                                               
                                        <xsl:if test="required = 1">
+                                                                               
                                                <xsl:attribute name="class" >
+                                                                               
                                                        
<xsl:text>required</xsl:text>
+                                                                               
                                                </xsl:attribute>                
        
+                                                                               
                                        </xsl:if>
+                                                                               
                                        <option value="" >Velg</option>
                                                                                
                                <xsl:for-each select="options_array"> 
                                                                                
                                                <option>
                                                                                
                                                        <xsl:attribute 
name="value"><xsl:value-of select="option_value"/></xsl:attribute>
@@ -189,7 +216,7 @@
 
                                                                                
        </xsl:when>
                                                                                
</xsl:choose>   
-                                                                               
</form>
+                                                                       </form>
                                                                </li>
                                                        </xsl:for-each>
                                                </ul>

Modified: 
branches/Version-1_0-branch/controller/templates/base/case/view_closed_cases.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/case/view_closed_cases.xsl
    2013-07-02 20:18:48 UTC (rev 11229)
+++ 
branches/Version-1_0-branch/controller/templates/base/case/view_closed_cases.xsl
    2013-07-03 07:18:27 UTC (rev 11230)
@@ -5,9 +5,14 @@
 <div id="main_content" class="medium">
  <xsl:call-template name="check_list_top_section" />
 
- <div id="choose-building-wrp">
-                       <xsl:call-template name="select_buildings_on_property" 
/>
- </div>
+       <xsl:choose>
+               <xsl:when test="buildings_on_property/child::node()">
+                       <div id="choose-building-wrp">
+                               <xsl:call-template 
name="select_buildings_on_property" />
+                       </div>
+               </xsl:when>  
+  </xsl:choose>
+
  
 <div id="view_cases">
        <xsl:call-template name="cases_tab_menu">

Modified: 
branches/Version-1_0-branch/controller/templates/base/case/view_open_cases.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/case/view_open_cases.xsl  
    2013-07-02 20:18:48 UTC (rev 11229)
+++ 
branches/Version-1_0-branch/controller/templates/base/case/view_open_cases.xsl  
    2013-07-03 07:18:27 UTC (rev 11230)
@@ -2,12 +2,17 @@
 <xsl:template match="data" xmlns:php="http://php.net/xsl";>
 
 <div id="main_content" class="medium">
-  <xsl:call-template name="check_list_top_section" />
-  
-  <div id="choose-building-wrp">
-    <xsl:call-template name="select_buildings_on_property" />
-  </div>
-  
+   <xsl:call-template name="check_list_top_section">
+      <xsl:with-param name="active_tab">view_cases</xsl:with-param>
+    </xsl:call-template>
+
+       <xsl:choose>
+               <xsl:when test="buildings_on_property/child::node()">
+                       <div id="choose-building-wrp">
+                               <xsl:call-template 
name="select_buildings_on_property" />
+                       </div>
+               </xsl:when>  
+  </xsl:choose>
   <div id="view_cases">
     <xsl:call-template name="cases_tab_menu">
       <xsl:with-param name="active_tab">view_open_cases</xsl:with-param>

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-07-02 20:18:48 UTC (rev 11229)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/edit_check_list.xsl
        2013-07-03 07:18:27 UTC (rev 11230)
@@ -5,7 +5,10 @@
 
 <div id="main_content" class="medium">
                
-       <xsl:call-template name="check_list_top_section" />
+    <xsl:call-template name="check_list_top_section">
+      <xsl:with-param name="active_tab">view_details</xsl:with-param>
+    </xsl:call-template>
+
                        
        <!-- ==================  CHECKLIST DETAILS  ===================== -->
        <div id="check_list_details">

Modified: 
branches/Version-1_0-branch/controller/templates/base/check_list/fragments/check_list_top_section.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/fragments/check_list_top_section.xsl
       2013-07-02 20:18:48 UTC (rev 11229)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/fragments/check_list_top_section.xsl
       2013-07-03 07:18:27 UTC (rev 11230)
@@ -71,7 +71,9 @@
         <xsl:choose>
         <xsl:when test="count(check_list_type) = 0 or check_list_type != 
'add_check_list'">
             <xsl:call-template name="check_list_menu">
-                <xsl:with-param name="active_tab">view_details</xsl:with-param>
+                <xsl:with-param name="active_tab">
+                       <xsl:value-of select="$active_tab" />
+                       </xsl:with-param>
             </xsl:call-template>
         </xsl:when>
         <xsl:otherwise>

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-07-02 20:18:48 UTC (rev 11229)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_info.xsl
      2013-07-03 07:18:27 UTC (rev 11230)
@@ -67,7 +67,9 @@
                                
        </script>
                
-       <xsl:call-template name="check_list_top_section" />
+    <xsl:call-template name="check_list_top_section">
+      <xsl:with-param name="active_tab">view_control_info</xsl:with-param>
+    </xsl:call-template>
                                
        <div class="tab_menu">
                <a id="view_control_details" class="active">

Modified: 
branches/Version-1_0-branch/controller/templates/base/control_group/control_group.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/control_group/control_group.xsl
       2013-07-02 20:18:48 UTC (rev 11229)
+++ 
branches/Version-1_0-branch/controller/templates/base/control_group/control_group.xsl
       2013-07-03 07:18:27 UTC (rev 11230)
@@ -97,6 +97,11 @@
                                                                                
                        <xsl:value-of select="input_text" /> &nbsp;( 
<xsl:value-of select="trans_datatype" /> )
                                                                                
                </td>
                                                                                
                <td>
+                                                                               
                        <select name='attributes_operator[{id}]' 
id='attribute_{id}'>;
+                                                                               
                                <xsl:apply-templates select="operator/options"/>
+                                                                               
                        </select>
+                                                                               
                </td>
+                                                                               
                <td>
                                                                                
                        <xsl:choose>
                                                                                
                                <xsl:when test="choice!=''">
                                                                                
                                        <select name='attributes[{id}]' 
id='attribute_{id}'>;
@@ -112,7 +117,11 @@
                                                                                
                                        </select>
                                                                                
                                </xsl:when>
                                                                                
                                <xsl:otherwise>
-                                                                               
                                        <input type= 'text' 
name='attributes[{id}]' id='attribute_{id}' value = '{value}'/>                 
    
+                                                                               
                                        <input type= 'text' 
name='attributes[{id}]' id='attribute_{id}' value = '{value}'>
+                                                                               
                                                <xsl:attribute name="title" 
value="selected" >
+                                                                               
                                                        <xsl:text>Verdi eller 
formel - f.eks: date('Y') - 20</xsl:text>
+                                                                               
                                                </xsl:attribute>
+                                                                               
                                        </input>                        
                                                                                
                                </xsl:otherwise>
                                                                                
                        </xsl:choose>
                                                                                
                </td>
@@ -149,7 +158,17 @@
                                                                                
                                <xsl:value-of select="input_text" /> &nbsp;( 
<xsl:value-of select="trans_datatype" /> )
                                                                                
                        </td>
                                                                                
                         <td>
-                                                                               
                                 <xsl:text>     => </xsl:text>
+
+                                                                               
                                <xsl:choose>
+                                                                               
                                        <xsl:when test="operator/options!=''">
+                                                                               
                                                <xsl:for-each 
select="operator/options">
+                                                                               
                                                        <xsl:if test="selected 
!= 0">
+                                                                               
                                                                <xsl:value-of 
disable-output-escaping="yes" select="name"/>
+                                                                               
                                                        </xsl:if>
+                                                                               
                                                </xsl:for-each>
+                                                                               
                                        </xsl:when>
+                                                                               
                                </xsl:choose>
+
                                                                                
                         </td> 
                                                                                
                        <td>
                                                                                
                                <xsl:choose>

Modified: branches/Version-1_0-branch/frontend/inc/class.bofellesdata.inc.php
===================================================================
--- branches/Version-1_0-branch/frontend/inc/class.bofellesdata.inc.php 
2013-07-02 20:18:48 UTC (rev 11229)
+++ branches/Version-1_0-branch/frontend/inc/class.bofellesdata.inc.php 
2013-07-03 07:18:27 UTC (rev 11230)
@@ -3,10 +3,10 @@
 
        // Instance variable
            protected static $bo;
-               
+
        /**
                 * Get a static reference to the storage object associated with 
this model object
-                * 
+                *
                 * @return the storage object
                 */
                public static function get_instance()
@@ -23,7 +23,7 @@
                exec(sprintf('ping -c 1 -W 5 %s', escapeshellarg($host)), $res, 
$rval);
                return $rval === 0;
                }
-               
+
                public function get_db()
                {
                        if($this->db && is_object($this->db))
@@ -52,45 +52,46 @@
                        $db->Password = 
$config->config_data['external_db_password'];
 
                        $db->Halt_On_Error = 'no';
-                       
+
                        try
                        {
                                $db->connect();
                        }
                        catch(Exception $e)
                        {
-                               phpgwapi_cache::message_set('Could not connect 
to backend-server ' . $config->config_data['external_db_host'], 'error'); 
+                               phpgwapi_cache::message_set('Could not connect 
to backend-server ' . $config->config_data['external_db_host'], 'error');
                                $GLOBALS['phpgw']->redirect_link('/home.php');
                        }
                        $this->db = $db;
                        return $db;
 
                }
-               
+
                public function populate_result_units(array $unit_ids)
                {
                        $this->log(__class__, __function__);
 
                        $columns = "V_ORG_ENHET.ORG_ENHET_ID, 
V_ORG_ENHET.ORG_NAVN, V_ORG_ENHET.RESULTATENHET";
                $table = "V_ORG_ENHET";
-                       
+
                        if(!$db = $this->get_db())
                        {
                                return;
                        }
-              
+
                $result_units = array();
-               
+
                $unit_ids_string = implode(',',$unit_ids);
-               
-                       
-                       $sql = "SELECT $columns FROM $table WHERE 
V_ORG_ENHET.ORG_ENHET_ID IN ($unit_ids_string) AND V_ORG_ENHET.ORG_NIVAA = 4";
+
+
+                       $sql = "SELECT $columns FROM $table WHERE 
V_ORG_ENHET.ORG_ENHET_ID IN ($unit_ids_string)";
+                       //var_dump($sql);
                        if($db->Type == 'postgres')
                        {
                            $sql = strtolower($sql);
                        }
                        $db->query($sql,__LINE__,__FILE__);
-                                               
+
                        while ($db->next_record())
                        {
                            if($db->Type == 'postgres')
@@ -100,7 +101,7 @@
                                        "ORG_NAME" => $db->f('org_navn'),
                                        "UNIT_ID" => $db->f('resultatenhet'),
                                        "LEADER" => false
-                               );    
+                               );
                            }
                            else
                            {
@@ -112,13 +113,13 @@
                                );
                            }
                        }
-                       
+
                        return $result_units;
                }
-       
+
         /**
          * Method for retrieving the result units this user has access to
-         * 
+         *
          * @param string $username the username
          * @return an array of (result unit number => result unit name)
          */
@@ -132,14 +133,15 @@
              */
                $result_units = array();
                $org_unit_ids = array();
-               
+
                $columns = "V_ORG_ENHET.ORG_ENHET_ID, V_ORG_ENHET.ORG_NIVAA, 
V_ORG_ENHET.ORG_NAVN, V_ORG_ENHET.ENHET_ID, V_ORG_ENHET.RESULTATENHET";
                $table = "V_ORG_ENHET";
                $joins =        "LEFT JOIN V_ORG_PERSON_ENHET ON 
(V_ORG_PERSON_ENHET.ORG_ENHET_ID = V_ORG_ENHET.ORG_ENHET_ID) ".
                                        "LEFT JOIN V_ORG_PERSON ON 
(V_ORG_PERSON.ORG_PERSON_ID = V_ORG_PERSON_ENHET.ORG_PERSON_ID)";
-               
+
                $sql = "SELECT $columns FROM $table $joins WHERE 
V_ORG_PERSON.BRUKERNAVN = '$username'";
-               
+                                       //var_dump($sql);
+
                        if(!$db = $this->get_db())
                        {
                                return;
@@ -153,14 +155,14 @@
                        }
                        //var_dump($sql);
                $db->query($sql,__LINE__,__FILE__);
-               
-               
-               
+
+
+
                        while ($db->next_record())
                        {
                            if($db->Type == "postgres")
                            {
-                               $identifier  = (int)$db->f('org_enhet_id');
+                             $identifier  = (int)$db->f('org_enhet_id');
                                $level = (int)$db->f('org_nivaa','int');
                                $name = $db->f('org_navn');
                                $unit_id = $db->f('resultatenhet');
@@ -172,17 +174,17 @@
                                $name = $db->f('ORG_NAVN');
                                $unit_id = $db->f('RESULTATENHET');
                            }
-                               
+
                                switch($level)
                                {
                                        case 1: break;  // TODO: Access to all 
result units
-                                       case 2:                 // LEVEL: 
Byrådsavdeling 
+                                       case 2:                 // LEVEL: 
Byrådsavdeling
                                                //Must traverse down the 
hierarchy
                                                $columns = 
"V_ORG_ENHET.ORG_ENHET_ID, V_ORG_ENHET.ORG_NIVAA, V_ORG_ENHET.ORG_NAVN, 
V_ORG_ENHET.ENHET_ID, V_ORG_ENHET.RESULTATENHET";
                                                $tables = "V_ORG_ENHET";
                                                $joins = "LEFT JOIN 
V_ORG_KNYTNING ON (V_ORG_KNYTNING.ORG_ENHET_ID = V_ORG_ENHET.ORG_ENHET_ID)";
                                                $sql = "SELECT $columns FROM 
$tables $joins WHERE V_ORG_ENHET.ORG_NIVAA = 4 AND 
V_ORG_KNYTNING.ORG_ENHET_ID_KNYTNING = {$identifier}";
-                                               
+
                                        if($db1->Type == "postgres")
                                {
                                    $sql = strtolower($sql);
@@ -200,7 +202,7 @@
                                                                        
"UNIT_ID" => $db1->f('resultatenhet'),
                                                                        
"LEADER" => true
                                                                );
-                                                               
+
                                                                
$org_unit_ids[(int)$db1->f('org_enhet_id')] = true;
                                                        }
                                        }
@@ -214,7 +216,7 @@
                                                                        
"UNIT_ID" => $db1->f('RESULTATENHET'),
                                                                        
"LEADER" => true
                                                                );
-                                                               
+
                                                                
$org_unit_ids[(int)$db1->f('ORG_ENHET_ID')] = true;
                                                        }
                                        }
@@ -224,7 +226,7 @@
                                        case 4:                 // LEVEL: 
Resultatenhet
                                                //Insert in result array
                                                
if(!isset($org_unit_ids[$identifier]))
-                                               {       
+                                               {
                                                        $result_units[] = array(
                                                                "ORG_UNIT_ID" 
=> $identifier,
                                                                "ORG_NAME" => 
$name,
@@ -233,10 +235,10 @@
                                                        );
                                                        
$org_unit_ids[$identifier] = true;
                                                }
-                                               break;  
+                                               break;
                                }
                        }
-               
+
                return $result_units;
                /*
                        return array(
@@ -253,12 +255,12 @@
                        );
                        */
         }
-        
+
         /**
-         * 
+         *
          * @param int $number the result unit number
          */
-        public function get_organisational_unit_name($number) 
+        public function get_organisational_unit_name($number)
         {
                        $this->log(__class__, __function__);
 
@@ -286,7 +288,7 @@
                                {
                                    return      $db->f('ORG_NAVN', true);
                                }
-                       } 
+                       }
                }
                else
                {
@@ -294,8 +296,8 @@
                }
                //return "No name";
         }
-        
-        public function get_organisational_unit_info($number) 
+
+        public function get_organisational_unit_info($number)
         {
                        $this->log(__class__, __function__);
 
@@ -328,16 +330,16 @@
                                    );
                                }
                        }
-               } 
+               }
                else
                {
                        return lang('no_name_organisational_unit');
                }
         }
-        
+
         /**
          * Get user info from Fellesdata based on a username
-         * 
+         *
          * @param $username the username in question
          * @return an array containing username, firstname, lastname and email 
if user exist, false otherwise
          */
@@ -377,11 +379,11 @@
                                        'email'         => $db->f('EPOST', true)
                            );
                        }
-               } 
+               }
                else
                {
                        return false;
-               }               
+               }
         }
 
                protected function log($class, $function)

Modified: branches/Version-1_0-branch/frontend/inc/class.borental.inc.php
===================================================================
--- branches/Version-1_0-branch/frontend/inc/class.borental.inc.php     
2013-07-02 20:18:48 UTC (rev 11229)
+++ branches/Version-1_0-branch/frontend/inc/class.borental.inc.php     
2013-07-03 07:18:27 UTC (rev 11230)
@@ -6,7 +6,7 @@
        include_class('rental', 'contract', 'inc/model/');
 
     class frontend_borental {
-       
+
        public static function contract_exist_per_location($contract_id, 
$location_code, $contract_state_identifier)
        {
                $contracts_per_location = 
phpgwapi_cache::session_get('frontend', $contract_state_identifier);
@@ -20,20 +20,20 @@
                }
                return $exist;
        }
-       
+
        public static function send_contract_message(int $contract_id, string 
$contract_message, string $from_address)
        {
                $contract = 
rental_socontract::get_instance()->get_single($contract_id);
                if(isset($contract) && isset($contract_message) && 
$contract_message != '')
                {
-                       $title = lang('title_contract_message'); 
+                       $title = lang('title_contract_message');
                        $title .= " ".$contract->get_old_contract_id();
                        $title .= 
"(".lang($contract->get_contract_type_title()).")";
-                       
+
                        $config = CreateObject('phpgwapi.config','frontend');
                                $config->read();
                        $to = $config->config_data['email_contract_messages'];
-                       
+
                        if (isset($contract_message) && isset($to) && 
isset($from_address))
                                {
                                        if 
(isset($GLOBALS['phpgw_info']['server']['smtp_server']) && 
$GLOBALS['phpgw_info']['server']['smtp_server'] )
@@ -42,15 +42,15 @@
                                                {
                                                        $GLOBALS['phpgw']->send 
= CreateObject('phpgwapi.send');
                                                }
-                                       
+
                                                $from = 
"{$GLOBALS['phpgw_info']['user']['fullname']}<{$from_address}>";
-       
+
                                                $receive_notification = false;
                                                $rcpt = 
$GLOBALS['phpgw']->send->msg('email',$to,$title,
                                                         
stripslashes(nl2br($contract_message)), '', $from, '',
                                                         $from , 
$GLOBALS['phpgw_info']['user']['fullname'],
                                                         'html', '', array() , 
$receive_notification);
-       
+
                                                if($rcpt)
                                                {
                                                        return true;
@@ -58,40 +58,40 @@
                                        }
                                }
                }
-                       
-                       return false;   
+
+                       return false;
        }
-       
+
        public static function get_first_contract_per_location($location_code)
        {
                $contracts_per_location = 
phpgwapi_cache::session_get('frontend', 'contracts_per_location');
                return $contracts_per_location[$location_code][0];
        }
-       
+
                public static function 
get_first_contract_in_per_location($location_code)
        {
                $contracts_in_per_location = 
phpgwapi_cache::session_get('frontend', 'contracts_in_per_location');
                return $contracts_in_per_location[$location_code][0];
        }
-       
+
         /**
          *
          * @param integer $org_unit_ids
          */
         public static function get_property_locations($array)
         {
-               
+
                $property_locations = array();
                $property_locations_active = array();
-               
+
                $total_price_all_buildings = 0;
                $total_rented_area_all_builings = 0;
-               
+
                $types = 
rental_socontract::get_instance()->get_fields_of_responsibility();
                        $location_id_internal = 
array_search('contract_type_internleie', $types);
                $location_id_in = array_search('contract_type_innleie', $types);
                $location_id_ex = array_search('contract_type_eksternleie', 
$types);
-               
+
                foreach($array as $row){
                        /*
              * 1. hent alle kontraktsparter som har org unit id (foreløpig 
bruker vi result_unit_number i rentalparty)
@@ -111,49 +111,49 @@
                        {
                                $parties = 
rental_soparty::get_instance()->get(null, null, null, null, null, null, 
array('email' => $row));
                        }
-               
+
                        $contracts = array();
                        $composites = array();
-                       
-                       
+
+
                        //For all parties connected to the internal 
organization unit
                        foreach($parties as $party)
                        {
                                //... get the contracts
                                $contracts = 
rental_socontract::get_instance()->get(null, null, null, null, null, null, 
array('party_id' => $party->get_id()));
-                               
+
                                //... and for each contract connected to this 
contract part
                                foreach($contracts as $id => $contract)
                                {
                                        //... get the composites
                                        $composites = 
rental_socomposite::get_instance()->get(null, null, null, null, null, null, 
array('contract_id' => $contracts[$id]->get_id()));
-                                       
+
                                        //...and for each composite in the 
contract in which this contract part is connected
                                        foreach($composites as $composite)
                                        {
                                                //... get the units
                                                $units = 
$composite->get_units();
-                                               
+
                                                //... and for each unit 
retrieve the property locations we are after
                                                foreach($units as $unit)
                                                {
                                                        $property_location = 
$unit->get_location();
                                                        
$property_locations[$property_location->get_location_code()] = 
$property_location;
-                                                       
+
                                                        // Contract holders: 
contracts_per_location (internal) and contracts_in_per_location (in)
-                                                       
+
                                                        // Internal contract 
should have impact on total price
                                                        
if($contract->get_location_id() == $location_id_internal)
                                                        {
                                                                $total_price = 
rental_socontract_price_item::get_instance()->get_total_price($contract->get_id());
                                                                
$contract->set_total_price($total_price);
-                                                               
+
                                                                
if(!is_array($contracts_per_location[$property_location->get_location_code()]))
                                                                {
-                                                                       
$contracts_per_location[$property_location->get_location_code()] = array();     
+                                                                       
$contracts_per_location[$property_location->get_location_code()] = array();
                                                                }
                                                                
array_push($contracts_per_location[$property_location->get_location_code()], 
$contract);
-                                                               
+
                                                                
if($contract->is_active())
                                                                {
                                                                        
$property_locations_active[$property_location->get_location_code()] = true;
@@ -165,15 +165,15 @@
                                                        {
                                                                $total_price = 
rental_socontract_price_item::get_instance()->get_total_price($contract->get_id());
                                                                
$contract->set_total_price($total_price);
-                                                               
+
                                                                
if($contract->is_active())
                                                                {
                                                                        
$property_locations_active[$property_location->get_location_code()] = true;
                                                                }
-                                                               
+
                                                                
if(!is_array($contracts_in_per_location[$property_location->get_location_code()]))
                                                                {
-                                                                       
$contracts_in_per_location[$property_location->get_location_code()] = array();  
+                                                                       
$contracts_in_per_location[$property_location->get_location_code()] = array();
                                                                }
                                                                
array_push($contracts_in_per_location[$property_location->get_location_code()], 
$contract);
                                                        }
@@ -181,13 +181,13 @@
                                                        {
                                                                $total_price = 
rental_socontract_price_item::get_instance()->get_total_price($contract->get_id());
                                                                
$contract->set_total_price($total_price);
-                                                               
+
                                                                
if(!is_array($contracts_ex_per_location[$property_location->get_location_code()]))
                                                                {
-                                                                       
$contracts_ex_per_location[$property_location->get_location_code()] = array();  
+                                                                       
$contracts_ex_per_location[$property_location->get_location_code()] = array();
                                                                }
                                                                
array_push($contracts_ex_per_location[$property_location->get_location_code()], 
$contract);
-                                                               
+
                                                                
if($contract->is_active())
                                                                {
                                                                        
$property_locations_active[$property_location->get_location_code()] = true;
@@ -195,19 +195,19 @@
                                                                        
$rented_price_per_location[$property_location->get_location_code()] += 
$total_price;
                                                                }
                                                        }
-                                               }                       
+                                               }
                                        }
                                }
                        }
                }
-               
+
                phpgwapi_cache::session_set('frontend', 
'contracts_per_location', $contracts_per_location);
                phpgwapi_cache::session_set('frontend', 
'contracts_in_per_location', $contracts_in_per_location);
                phpgwapi_cache::session_set('frontend', 
'contracts_ex_per_location', $contracts_ex_per_location);
                phpgwapi_cache::session_set('frontend', 
'rented_area_per_location', $rented_area_per_location);
                phpgwapi_cache::session_set('frontend', 
'total_price_per_location', $rented_price_per_location);
-               
-  
+
+
                //Serialize the properties
                $serialized_properties = array();
                foreach($property_locations as $key => $property_location)

Modified: branches/Version-1_0-branch/frontend/inc/class.uifrontend.inc.php
===================================================================
--- branches/Version-1_0-branch/frontend/inc/class.uifrontend.inc.php   
2013-07-02 20:18:48 UTC (rev 11229)
+++ branches/Version-1_0-branch/frontend/inc/class.uifrontend.inc.php   
2013-07-03 07:18:27 UTC (rev 11230)
@@ -27,8 +27,8 @@
        phpgw::import_class('frontend.bofrontend');
        phpgw::import_class('frontend.bofellesdata');
        phpgw::import_class('frontend.borental');
-       
-       
+
+
        /**
         * Frontend main class
         *
@@ -41,7 +41,7 @@
                 * Used to save state of header (select box, ++) between 
requests
                 * @var array
                 */
-               public $header_state;   
+               public $header_state;
 
                public $public_functions = array
                        (
@@ -53,7 +53,7 @@
                {
                        // This module uses XSLT templates
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
-                       
+
                        $this->config   = 
CreateObject('phpgwapi.config','frontend');
                        $this->config->read();
                        $use_fellesdata = 
$this->config->config_data['use_fellesdata'];
@@ -62,7 +62,7 @@
                        // Get the mode: in frame or full screen
                        $mode = phpgwapi_cache::session_get('frontend', 
'noframework');
                        $noframework = isset($mode) ? $mode : true;
-                       
+
                        /* Get the tabs and check to see whether the user has 
specified a tab or has a selected tab on session */
                        $tabs = $this->get_tabs();
                        $location_id = phpgw::get_var('location_id', 'int', 
'REQUEST');
@@ -70,23 +70,23 @@
                        $selected = isset($tab) && $tab ? $tab : 
array_shift(array_keys($tabs));
                        $this->tabs = 
$GLOBALS['phpgw']->common->create_tabs($tabs, $selected);
                        phpgwapi_cache::session_set('frontend','tab',$selected);
-                       
+
                        // Get header state
                        $this->header_state = 
phpgwapi_cache::session_get('frontend', 'header_state');
                        $this->header_state['use_fellesdata'] = $use_fellesdata;
                        $this->header_state['logo_path'] = $logo_path;
                        $this->header_state['form_action'] = 
$tabs[$selected]['link'];
-                       
+
                        // Get navigation parameters
                        $param_selected_location = phpgw::get_var('location');  
                // New location selected from locations list
                        $param_selected_org_unit = 
phpgw::get_var('org_unit_id');                       // New organisational unit 
selected from organisational units list
                        $param_only_org_unit = phpgw::get_var('org_enhet_id');  
// Frontend access from rental module regarding specific organisational unit
-                       
+
                        //Refresh organisation list
-                       $refresh = phpgw::get_var('refresh','bool'); 
+                       $refresh = phpgw::get_var('refresh','bool');
 
                        $property_locations_update = false;
-                       
+
                        /* If the user has selected an organisational unit or 
all units */
                        if(isset($param_selected_org_unit))
                        {
@@ -120,15 +120,15 @@
                                //Update locations according to organisational 
unit specification
                                $property_locations = 
frontend_borental::get_property_locations($org_unit_ids);
                                $property_locations_update = true;
-                               
+
                        }
                        /* If the user selects a organisational unit in rental 
module */
-                       else if(isset($param_only_org_unit)) 
+                       else if(isset($param_only_org_unit))
                        {
                                //TODO: check permissions
                                if($use_fellesdata){
                                        $name_and_result_number = 
frontend_bofellesdata::get_instance()->get_organisational_unit_info($param_only_org_unit);
-                                                                       
+
                                        //Specify unit
                                        $org_unit_ids = array(
                                                array(
@@ -137,23 +137,23 @@
                                                        "UNIT_ID" => 
$name_and_result_number['UNIT_NUMBER']
                                                )
                                        );
-                                                                       
+
                                        //Update header state
                                        $this->header_state['org_unit'] = 
$org_unit_ids;
                                        
$this->header_state['number_of_org_units'] = '1';
                                        
//$this->header_state['selected_org_unit'] = 
$name_and_result_number['UNIT_NUMBER'];
                                        
$this->header_state['selected_org_unit'] = $param_only_org_unit;
-                                       
+
                                        //Update locations
                                        $property_locations = 
frontend_borental::get_property_locations($org_unit_ids);
                                        $property_locations_update = true;
-                                       
+
                                        $noframework = false; // In regular 
frames
                                        phpgwapi_cache::session_set('frontend', 
'noframework', $noframework); // Store mode on session
                                        
$GLOBALS['phpgw_info']['flags']['menu_selection'] = "frontend::{$selected}";
                                        $this->insert_links_on_header_state();
                                }
-                       } 
+                       }
                        /* No state, first visit after login, or refresh 
request*/
                        else if(!isset($this->header_state) || isset($refresh) 
|| !isset($this->header_state['locations']))
                        {
@@ -161,7 +161,7 @@
                                {
                                        //Specify organisational units
                                        $org_units = 
frontend_bofellesdata::get_instance()->get_result_units($GLOBALS['phpgw_info']['user']['account_lid']);
-                                       
+
                                        //Merge with delegation units
                                        $delegation_org_ids = 
frontend_bofrontend::get_delegations($GLOBALS['phpgw_info']['user']['account_id']);
                                        if(count($delegation_org_ids) > 0)
@@ -169,30 +169,30 @@
                                                $delegation_units = 
frontend_bofellesdata::get_instance()->populate_result_units($delegation_org_ids);
                                                $org_units = 
array_merge($org_units,$delegation_units);
                                        }
-                                       
+
                                        //Update org units on header state
                                        $this->header_state['org_unit'] = 
$org_units;
                                        
$this->header_state['number_of_org_units'] = count($org_units);
                                        
$this->header_state['selected_org_unit'] = 'all';
-                                       
+
                                        //Update locations
                                        $property_locations = 
frontend_borental::get_property_locations($org_units);
                                }
-                               else 
+                               else
                                {
                                        //If no organisational database is in 
use: get rented properties based on username
                                        $usernames[] = 
$GLOBALS['phpgw_info']['user']['account_lid'];
                                        $property_locations = 
frontend_borental::get_property_locations($usernames);
                                }
-                               
+
                                $property_locations_update = true;
                                $this->insert_links_on_header_state();
-                               
+
                        }
-                       
-                       
+
+
                        if($property_locations_update)
-                       {       
+                       {
                                if(count($property_locations) > 0)
                                {
                                        
$this->header_state['selected_location'] = 
$property_locations[0]['location_code'];
@@ -203,13 +203,13 @@
                                        
$this->header_state['selected_location'] = '';
                                        $param_selected_location = '';
                                }
-                               
+
                                $this->header_state['locations'] = 
$property_locations;
                                $this->header_state['number_of_locations'] = 
count($property_locations);
                                $this->calculate_totals($property_locations);
                        }
-                       
-                       
+
+
                        /* If the user has selected a location or as a 
side-effect from selecting organisational unit */
                        if(isset($param_selected_location))
                        {
@@ -254,15 +254,15 @@
                        }
                        else
                        {
-                               $this->header_state['new_messages'] = 
lang('no_new_messages');  
+                               $this->header_state['new_messages'] = 
lang('no_new_messages');
                        }
-                                               
+
                        phpgwapi_cache::session_set('frontend', 'header_state', 
$this->header_state);
 
                        
$GLOBALS['phpgw']->css->add_external_file('frontend/templates/base/base.css');
                        $GLOBALS['phpgw_info']['flags']['noframework'] = true;
                }
-               
+
                function get_tabs()
                {
                        // Get tabs from location hierarchy
@@ -284,8 +284,8 @@
                                }
                                unset($location);
                        }
-                       
 
+
                        // this one is for generic entitysupport from the app 
'property'
                        $entity_frontend = 
isset($this->config->config_data['entity_frontend']) && 
$this->config->config_data['entity_frontend'] ? 
$this->config->config_data['entity_frontend'] : array();
 
@@ -300,7 +300,7 @@
                                {
                                        $location_id = 
$GLOBALS['phpgw']->locations->get_id('property', $location);
                                        $location_arr = explode('.', $location);
-                                       
+
                                        $category = 
$entity->read_single_category($location_arr[2], $location_arr[3]);
                                        $tabs[$location_id] = array(
                                                'label' => $category['name'],
@@ -310,17 +310,17 @@
                        }
 
                        $extra_tabs = phpgwapi_cache::session_get('frontend', 
'extra_tabs');
-                       
+
                        if(isset($extra_tabs))
                        {
                                $tabs = array_merge($extra_tabs,$tabs);
                        }
-                       
+
                        phpgwapi_cache::session_clear('frontend', 'extra_tabs');
-                       
+
                        return $tabs;
                }
-               
+
                function insert_links_on_header_state()
                {
                        $help_url = "";
@@ -329,12 +329,12 @@
                        $fileName = '/frontend/help/NO/helpdesk.index.pdf';
                        $vfs = CreateObject('phpgwapi.vfs');
                        $vfs->override_acl = 1;
-       
+
                        $file = array('string' => $fileName, RELATIVE_NONE);
                        if($vfs->file_exists($file)){
                                $help_in_vfs = true;
                        }
-                       
+
                        if($help_in_vfs)
                        {
                                $help_url = "javascript:openwindow('"
@@ -343,7 +343,7 @@
                                                        'menuaction'=> 
'frontend.uidocumentupload.read_helpfile_from_vfs',
                                                        'app' => 'frontend'
                                                 )) . "','700','600')";
-                       }else{                  
+                       }else{
                                $help_url = "javascript:openwindow('"
                                                 . 
$GLOBALS['phpgw']->link('/index.php', array
                                                 (
@@ -353,7 +353,7 @@
                                                        'referer' => 
phpgw::get_var('menuaction')
                                                 )) . "','700','600')";
                        }
-                       
+
                        $contact_url = "javascript:openwindow('"
                                 . $GLOBALS['phpgw']->link('/index.php', array
                                 (
@@ -361,7 +361,7 @@
                                        'app' => 
$GLOBALS['phpgw_info']['flags']['currentapp'],
                                        'section' => 'contact'
                                 )) . "','700','600')";
-                
+
                        $folder_url = "javascript:openwindow('"
                                 . $GLOBALS['phpgw']->link('/index.php', array
                                 (
@@ -369,9 +369,9 @@
                                        'app' => 
$GLOBALS['phpgw_info']['flags']['currentapp'],
                                        'section' => 'folder'
                                 )) . "','700','600')";
-                                
+
                        $name_of_user = 
$GLOBALS['phpgw_info']['user']['firstname']." 
".$GLOBALS['phpgw_info']['user']['lastname'];
-                                
+
                        if(count($GLOBALS['phpgw_info']['user']['apps']) > 1)
                        {
                                $home_url = 
$GLOBALS['phpgw']->link('/home.php');
@@ -390,23 +390,23 @@
                        $this->header_state['folder_url'] = $folder_url;
                        $this->header_state['name_of_user'] = $name_of_user;
                }
-               
+
                function calculate_totals($property_locations)
                {
-                       
+
                        // Calculate
                        $total_area = 0;
                //      $rented_area_per_location = 
phpgwapi_cache::user_get('frontend','rented_area_per_location', 
$GLOBALS['phpgw_info']['user']['account_id']);
                        $rented_area_per_location = 
phpgwapi_cache::session_get('frontend','rented_area_per_location');
                        foreach($rented_area_per_location as $location_code => 
$area_per_location)
                        {
-                               
+
                                
if($this->location_in_selection($location_code,$property_locations))
                                {
                                        $total_area += $area_per_location;
                                }
                        }
-                       
+
                        $total_price = 0;
                //      $total_price_per_location = 
phpgwapi_cache::user_get('frontend','total_price_per_location', 
$GLOBALS['phpgw_info']['user']['account_id']);
                        $total_price_per_location = 
phpgwapi_cache::session_get('frontend','total_price_per_location');
@@ -420,7 +420,7 @@
                        $this->header_state['total_price'] = 
number_format($total_price, 0, ","," ")." kr";
                        $this->header_state['total_area'] = 
number_format($total_area, 0, ",", " ")." kvm";
                }
-               
+
                function location_in_selection($location_code, 
$property_locations)
                {
                        foreach($property_locations as $property_location)
@@ -432,7 +432,7 @@
                        }
                        return false;
                }
-               
+
                function org_unit_in_selection($unit_id, $org_units)
                {
                        foreach($org_units as $org_unit)
@@ -444,7 +444,7 @@
                        }
                        return false;
                }
-               
+
                public function get_org_enhet_id($result_unit_number, 
$org_units)
                {
                        foreach($org_units as $org_unit)

Modified: branches/Version-1_0-branch/phpgwapi/inc/class.categories.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.categories.inc.php   
2013-07-02 20:18:48 UTC (rev 11229)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.categories.inc.php   
2013-07-03 07:18:27 UTC (rev 11230)
@@ -1054,4 +1054,38 @@
                        $this->location_id      = 
$GLOBALS['phpgw']->locations->get_id($appname, $location);
                        $this->grants           = 
$GLOBALS['phpgw']->acl->get_grants($appname, $location);
                }
+
+               /**
+                * used for retrive the path for a particular node from a 
hierarchy
+                *
+                * @param integer $cat_id is the id of the node we want the 
path of
+                * @return array $path Path
+                */
+
+               public function get_path($cat_id)
+               {
+                       $cat_id = (int) $cat_id;
+                       $sql = "SELECT cat_parent, cat_name FROM 
phpgw_categories WHERE cat_id = {$cat_id}";
+
+                       $this->db->query($sql,__LINE__,__FILE__);
+                       $this->db->next_record();
+
+                       $parent_id = $this->db->f('cat_parent');
+                       $name = $this->db->f('cat_name', true);
+                       $path = array
+                       (
+                               array
+                               (
+                                       'id' => $cat_id,
+                                       'name' => $name
+                               )
+                       );
+
+                       if ($parent_id)
+                       {
+                               $path = 
array_merge($this->get_path($parent_id), $path);
+                       }
+
+                       return $path;
+               }
        }

Modified: branches/Version-1_0-branch/phpgwapi/inc/class.custom_fields.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.custom_fields.inc.php        
2013-07-02 20:18:48 UTC (rev 11229)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.custom_fields.inc.php        
2013-07-03 07:18:27 UTC (rev 11230)
@@ -795,26 +795,25 @@
 
                        }
 
-                       if($attrib_table)
+                       if($attrib_table) // not eav
                        {
                                $table_def = 
$this->get_table_def($attrib_table);       
                                $this->_oProc->m_aTables = $table_def;
 
-                       }
-
-                       if($OldColumnName !=$attrib['column_name'])
-                       {
-                               $value_set=array('column_name'  => 
$attrib['column_name']);
-
-                               if( !$doubled )
+                               if($OldColumnName !=$attrib['column_name'])
                                {
-                                       $value_set      = 
$this->_db->validate_update($value_set);
-                                       $this->_db->query("UPDATE 
phpgw_cust_attribute set $value_set WHERE location_id = {$location_id} AND id=" 
. $attrib_id,__LINE__,__FILE__);
-                               }
+                                       $value_set=array('column_name'  => 
$attrib['column_name']);
 
-                               if($attrib_table)
-                               {
-                                       
$this->_oProc->RenameColumn($attrib_table, $OldColumnName, 
$attrib['column_name']);
+                                       if( !$doubled )
+                                       {
+                                               $value_set      = 
$this->_db->validate_update($value_set);
+                                               $this->_db->query("UPDATE 
phpgw_cust_attribute set $value_set WHERE location_id = {$location_id} AND id=" 
. $attrib_id,__LINE__,__FILE__);
+                                       }
+       
+                                       if($attrib_table)
+                                       {
+                                               
$this->_oProc->RenameColumn($attrib_table, $OldColumnName, 
$attrib['column_name']);
+                                       }
                                }
                        }
 
@@ -853,14 +852,14 @@
                                        
unset($attrib['column_info']['default']);
                                }
 
-                               $value_set=array(
-                                       'column_name'   => 
$attrib['column_name'],
+                               $value_set=array
+                               (
                                        'datatype'              => 
$attrib['column_info']['type'],
                                        'precision_'    => 
$attrib['column_info']['precision'],
                                        'scale'                 => 
$attrib['column_info']['scale'],
                                        'default_value' => 
$attrib['column_info']['default'],
                                        'nullable'              => 
$attrib['column_info']['nullable']
-                                       );
+                               );
 
                                if( !$doubled )
                                {

Modified: branches/Version-1_0-branch/phpgwapi/inc/phpmailer/LICENSE
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/phpmailer/LICENSE  2013-07-02 
20:18:48 UTC (rev 11229)
+++ branches/Version-1_0-branch/phpgwapi/inc/phpmailer/LICENSE  2013-07-03 
07:18:27 UTC (rev 11230)
@@ -1,504 +1,504 @@
-                 GNU LESSER GENERAL PUBLIC LICENSE
-                      Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
-     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL.  It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
-                           Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
-  This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it.  You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
-  When we speak of free software, we are referring to freedom of use,
-not price.  Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
-  To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights.  These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
-  For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you.  You must make sure that they, too, receive or can get the source
-code.  If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it.  And you must show them these terms so they know their rights.
-
-  We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
-  To protect each distributor, we want to make it very clear that
-there is no warranty for the free library.  Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
-  Finally, software patents pose a constant threat to the existence of
-any free program.  We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder.  Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
-  Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License.  This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License.  We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
-  When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library.  The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom.  The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
-  We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License.  It also provides other free software developers Less
-of an advantage over competing non-free programs.  These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries.  However, the Lesser license provides advantages in certain
-special circumstances.
-
-  For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard.  To achieve this, non-free programs must be
-allowed to use the library.  A more frequent case is that a free
-library does the same job as widely used non-free libraries.  In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
-  In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software.  For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
-  Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.  Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library".  The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
-                 GNU LESSER GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
-  A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
-  The "Library", below, refers to any such software library or work
-which has been distributed under these terms.  A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language.  (Hereinafter, translation is
-included without limitation in the term "modification".)
-
-  "Source code" for a work means the preferred form of the work for
-making modifications to it.  For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
-  Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it).  Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-  
-  1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
-  You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
-  2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) The modified work must itself be a software library.
-
-    b) You must cause the files modified to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    c) You must cause the whole of the work to be licensed at no
-    charge to all third parties under the terms of this License.
-
-    d) If a facility in the modified Library refers to a function or a
-    table of data to be supplied by an application program that uses
-    the facility, other than as an argument passed when the facility
-    is invoked, then you must make a good faith effort to ensure that,
-    in the event an application does not supply such function or
-    table, the facility still operates, and performs whatever part of
-    its purpose remains meaningful.
-
-    (For example, a function in a library to compute square roots has
-    a purpose that is entirely well-defined independent of the
-    application.  Therefore, Subsection 2d requires that any
-    application-supplied function or table used by this function must
-    be optional: if the application does not supply it, the square
-    root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library.  To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License.  (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.)  Do not make any other change in
-these notices.
-
-  Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
-  This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
-  4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
-  If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library".  Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
-  However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library".  The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
-  When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library.  The
-threshold for this to be true is not precisely defined by law.
-
-  If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work.  (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
-  Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
-  6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
-  You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License.  You must supply a copy of this License.  If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License.  Also, you must do one
-of these things:
-
-    a) Accompany the work with the complete corresponding
-    machine-readable source code for the Library including whatever
-    changes were used in the work (which must be distributed under
-    Sections 1 and 2 above); and, if the work is an executable linked
-    with the Library, with the complete machine-readable "work that
-    uses the Library", as object code and/or source code, so that the
-    user can modify the Library and then relink to produce a modified
-    executable containing the modified Library.  (It is understood
-    that the user who changes the contents of definitions files in the
-    Library will not necessarily be able to recompile the application
-    to use the modified definitions.)
-
-    b) Use a suitable shared library mechanism for linking with the
-    Library.  A suitable mechanism is one that (1) uses at run time a
-    copy of the library already present on the user's computer system,
-    rather than copying library functions into the executable, and (2)
-    will operate properly with a modified version of the library, if
-    the user installs one, as long as the modified version is
-    interface-compatible with the version that the work was made with.
-
-    c) Accompany the work with a written offer, valid for at
-    least three years, to give the same user the materials
-    specified in Subsection 6a, above, for a charge no more
-    than the cost of performing this distribution.
-
-    d) If distribution of the work is made by offering access to copy
-    from a designated place, offer equivalent access to copy the above
-    specified materials from the same place.
-
-    e) Verify that the user has already received a copy of these
-    materials or that you have already sent this user a copy.
-
-  For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it.  However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
-  It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system.  Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
-  7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
-    a) Accompany the combined library with a copy of the same work
-    based on the Library, uncombined with any other library
-    facilities.  This must be distributed under the terms of the
-    Sections above.
-
-    b) Give prominent notice with the combined library of the fact
-    that part of it is a work based on the Library, and explaining
-    where to find the accompanying uncombined form of the same work.
-
-  8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License.  Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License.  However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
-  9. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Library or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
-  10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
-  11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot

@@ Diff output truncated at 153600 characters. @@



reply via email to

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