fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [11002] Merge 10967:11001 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [11002] Merge 10967:11001 from trunk
Date: Tue, 19 Mar 2013 11:15:08 +0000

Revision: 11002
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11002
Author:   sigurdne
Date:     2013-03-19 11:15:08 +0000 (Tue, 19 Mar 2013)
Log Message:
-----------
Merge 10967:11001 from trunk

Modified Paths:
--------------
    
branches/Version-1_0-branch/controller/inc/class.socontrol_group_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/js/controller/case.js
    branches/Version-1_0-branch/controller/js/controller/custom_drag_drop.js
    branches/Version-1_0-branch/controller/setup/setup.inc.php
    branches/Version-1_0-branch/controller/setup/tables_current.inc.php
    branches/Version-1_0-branch/controller/setup/tables_update.inc.php
    
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/edit_check_list.xsl
    branches/Version-1_0-branch/controller/templates/base/css/base.css
    branches/Version-1_0-branch/phpgwapi/setup/tables_current.inc.php
    branches/Version-1_0-branch/phpgwapi/setup/tables_update.inc.php
    branches/Version-1_0-branch/property/inc/class.bocommon.inc.php
    branches/Version-1_0-branch/property/inc/class.boentity.inc.php
    branches/Version-1_0-branch/property/inc/class.boproject.inc.php
    branches/Version-1_0-branch/property/inc/class.borequest.inc.php
    branches/Version-1_0-branch/property/inc/class.menu.inc.php
    branches/Version-1_0-branch/property/inc/class.soXport.inc.php
    branches/Version-1_0-branch/property/inc/class.sobudget.inc.php
    branches/Version-1_0-branch/property/inc/class.socondition_survey.inc.php
    branches/Version-1_0-branch/property/inc/class.soentity.inc.php
    branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php
    branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php
    branches/Version-1_0-branch/property/inc/class.soproject.inc.php
    branches/Version-1_0-branch/property/inc/class.sorequest.inc.php
    branches/Version-1_0-branch/property/inc/class.soworkorder.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.uiproject.inc.php
    branches/Version-1_0-branch/property/inc/class.uirequest.inc.php
    branches/Version-1_0-branch/property/inc/class.uiworkorder.inc.php
    branches/Version-1_0-branch/property/inc/hook_config.inc.php
    branches/Version-1_0-branch/property/js/yahoo/entity.edit.js
    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/config.tpl
    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/request.xsl
    branches/Version-1_0-branch/property/templates/base/tts.xsl
    branches/Version-1_0-branch/property/templates/base/workorder.xsl

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


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

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-03-19 11:10:55 UTC (rev 11001)
+++ 
branches/Version-1_0-branch/controller/inc/class.socontrol_group_list.inc.php   
    2013-03-19 11:15:08 UTC (rev 11002)
@@ -210,7 +210,7 @@
                        $sql .= "FROM controller_control_group_list cgl, 
controller_control_group cg "; 
                        $sql .= "WHERE cgl.control_id={$control_id} ";
                        $sql .= "AND cgl.control_group_id=cg.id ";
-                       $sql .= "ORDER BY cgl.order_nr";
+                       $sql .= "ORDER BY cgl.order_nr ASC";
                        
                        $this->db->query($sql);
 

Modified: branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php  
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php  
2013-03-19 11:15:08 UTC (rev 11002)
@@ -106,7 +106,19 @@
                        self::set_active_menu('controller::control');
                }
                
+
                /**
+                * Wrapper for control_list
+                *
+                * @return void
+                */
+
+               public function index()
+               {
+                       $this->control_list();
+               }
+
+               /**
                 * Fetches controls and returns to datatable 
                 *
                 * @param HTTP::phpgw_return_as specifies how data should be 
returned
@@ -367,15 +379,18 @@
                 * @param HTTP:: control id 
                 * @return data array 
                 */
-               public function view_control_groups(){
+               public function view_control_groups()
+               {
                        $control_id = phpgw::get_var('control_id');
                        $control = $this->so->get_single($control_id);  
                                                                        
                        // Fetches saved control groups from db
                        $saved_control_groups = 
$this->so_control_group_list->get_control_groups_by_control($control_id);
+
                        $saved_control_group_ids = array();
                        
-                       foreach($saved_control_groups as $control_group){
+                       foreach($saved_control_groups as $control_group)
+                       {
                                $saved_control_group_ids[] = 
$control_group->get_id();
                        }
                        
@@ -384,10 +399,12 @@
                        $control_groups_as_array = 
$this->so_control_group->get_control_groups_as_array($control->get_control_area_id());
                        
                        $control_groups = array();
-                       foreach($control_groups_as_array as $control_group){
+                       foreach($control_groups_as_array as $control_group)
+                       {
                                $control_group_id = $control_group['id'];
                                
-                               if( in_array($control_group_id, 
$saved_control_group_ids )){
+                               if( in_array($control_group_id, 
$saved_control_group_ids ))
+                               {
                                        $control_groups[] = array("checked" => 
1, "control_group" => $control_group);
                                }
                                else
@@ -400,10 +417,10 @@
                        
                        $data = array
                        (
-                               'tabs'                                          
=> $GLOBALS['phpgw']->common->create_tabs($tabs, 1),
-                               'view'                                          
=> "control_groups",
-                               'editable'                              => true,
-                               'control'                                       
=> $control,
+                               'tabs'                          => 
$GLOBALS['phpgw']->common->create_tabs($tabs, 1),
+                               'view'                          => 
"control_groups",
+                               'editable'                      => true,
+                               'control'                       => $control,
                                'control_area'          => $control_area,
                                'control_groups'        => $control_groups,
                        );

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-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/controller/inc/class.uicontrol_group.inc.php    
2013-03-19 11:15:08 UTC (rev 11002)
@@ -26,7 +26,7 @@
        * @package property
        * @subpackage controller
        * @version $Id$
-       */      
+       */
 
        /**
        * Import the jQuery class
@@ -78,7 +78,7 @@
                        if(phpgw::get_var('phpgw_return_as') == 'json') {
                                return $this->query();
                        }
-                       
+
                        // Sigurd: Start categories
                        $cats   = CreateObject('phpgwapi.categories', -1, 
'controller', '.control');
                        $cats->supress_info     = true;
@@ -92,7 +92,7 @@
                                (
                                        'id'    => $cat_list['cat_id'],
                                        'name'  => $cat_list['name'],
-                               );              
+                               );
                        }
                        // END categories
                        self::add_javascript('phpgwapi', 'yahoo', 
'datatable.js');
@@ -271,14 +271,14 @@
                                         
                                        
$this->so_control_item->store($curr_control_item);
                                }
-                               
+
                                // Sigurd: START as categories
                                $cats   = CreateObject('phpgwapi.categories', 
-1, 'controller', '.control');
                                $cats->supress_info     = true;
-                               
+
                                $control_areas = 
$cats->formatted_xslt_list(array('format'=>'filter','globals' => true,'use_acl' 
=> $this->_category_acl));
                                array_unshift($control_areas['cat_list'],array 
('cat_id'=>'','name'=> lang('select value')));
-                                                               
+
                                $control_area_array = array();
                                foreach($control_areas['cat_list'] as $cat_list)
                                {
@@ -286,7 +286,7 @@
                                        (
                                                'id'    => $cat_list['cat_id'],
                                                'name'  => $cat_list['name'],
-                                       );              
+                                       );
                                }
                                // END as categories
 
@@ -411,10 +411,10 @@
                                // Sigurd: START as categories
                                $cats   = CreateObject('phpgwapi.categories', 
-1, 'controller', '.control');
                                $cats->supress_info     = true;
-                               
+
                                $control_areas = 
$cats->formatted_xslt_list(array('format'=>'filter','globals' => true,'use_acl' 
=> $this->_category_acl));
                                array_unshift($control_areas['cat_list'],array 
('cat_id'=>'','name'=> lang('select value')));
-                                                               
+
                                $control_area_array = array();
                                foreach($control_areas['cat_list'] as $cat_list)
                                {
@@ -422,7 +422,7 @@
                                        (
                                                'id'    => $cat_list['cat_id'],
                                                'name'  => $cat_list['name'],
-                                       );              
+                                       );
                                }
                                // END as categories
 
@@ -532,76 +532,92 @@
                        }
                }
 
-               public function save_group_and_item_order(){
+               public function save_group_and_item_order()
+               {
                        $control_id = phpgw::get_var('control_id');
                        $item_order_str = phpgw::get_var('item_order');
                        $group_order_str = phpgw::get_var('group_order');
-                       
+
                        $status = 1;
-                       
+
                        $group_order_arr = explode(",", $group_order_str);
                        $item_order_arr = explode(",", $item_order_str);
-                       
+
                        $db_control_group_list = 
$this->so_control_group_list->get_db();
-                       
+
                        // Saves order for control groups
-                       foreach($group_order_arr as $group_id_order){
+                       foreach($group_order_arr as $group_id_order)
+                       {
                                $group_id_order_arr = explode(":", 
$group_id_order);
                                $group_id = $group_id_order_arr[0];
                                $group_order_nr = $group_id_order_arr[1];
-                               
+
                                // Gets control_group_list object from db if it 
exists
                                $control_group_list = 
$this->so_control_group_list->get_group_list_by_control_and_group($control_id, 
$group_id);
-                               
+
                                $db_control_group_list->transaction_begin();
-                               
-                               // Updates group order if control_group_list 
object exists      
-                               if( $control_group_list != null ){
+
+                               // Updates group order if control_group_list 
object exists
+                               if( $control_group_list != null )
+                               {
                                        $control_group_list->set_order_nr( 
$group_order_nr );
                                        $id = 
$this->so_control_group_list->update( $control_group_list );
-                                       
+
                                        if($id > 0)
+                                       {
                                                
$db_control_group_list->transaction_commit();
+                                       }
                                        else
+                                       {
                                                
$db_control_group_list->transaction_abort();
+                                               $status  = 0;
+                                       }
                                }
                                // If group is not in db, report error
-                               else{
+                               else
+                               {
                                        echo "Error: group not found";
                                        $status  = 0;
                                }
-                       }                       
-                       
+                       }
+
                        $db_control_item_list = 
$this->so_control_item_list->get_db();
-               
-                       // Saves order for control items        
-                       foreach($item_order_arr as $item_id_order){
+
+                       // Saves order for control items
+                       foreach($item_order_arr as $item_id_order)
+                       {
                                $item_id_order_arr = explode(":", 
$item_id_order);
                                $control_item_id = $item_id_order_arr[0];
                                $item_order_nr = $item_id_order_arr[1];
-                               
+
                                $control_item_list = 
$this->so_control_item_list->get_single_2($control_id, $control_item_id);
-                               
+
                                $db_control_item_list->transaction_begin();
-                               $status = 0;
-                               
-                               // Updates item order if control_item_list 
object exists        
-                               if( $control_item_list != null ){
+
+                               // Updates item order if control_item_list 
object exists
+                               if( $control_item_list != null )
+                               {
                                        $control_item_list->set_order_nr( 
$item_order_nr );
                                        $id = 
$this->so_control_item_list->update( $control_item_list );
-                                       
+
                                        if($id > 0)
+                                       {
                                                
$db_control_item_list->transaction_commit();
+                                       }
                                        else
+                                       {
                                                
$db_control_item_list->transaction_abort();
+                                               $status = 0;
+                                       }
                                }
                                // if item does not exists report error
-                               else{
+                               else
+                               {
                                        echo "Error: item not found";
-                                       $status  = 0;                           
        
+                                       $status  = 0;
                                }
                        }
-                       
+
                        return $status;
                }
 
@@ -752,20 +768,20 @@
                        }
                        else
                                $control_groups_array = 
$this->so->get_control_groups_by_control_area($control_area_id);
-                       
+
                        if(count($control_groups_array)>0)
                                return json_encode( $control_groups_array );
                        else
                                return null;
                }
-               
+
                public function get_control_area_by_control_group()
                {
                        $control_group_id = phpgw::get_var('control_group_id');
                        if($control_group_id)
                        {
                                $control_areas = 
$cats->formatted_xslt_list(array('format'=>'filter','globals' => true,'use_acl' 
=> $this->_category_acl));
-                                                               
+
                                $control_area_array = array();
                                foreach($control_areas['cat_list'] as $cat_list)
                                {
@@ -773,14 +789,14 @@
                                        (
                                                'id'    => $cat_list['cat_id'],
                                                'name'  => $cat_list['name'],
-                                       );              
+                                       );
                                }
                        }
                        else
                        {
                                $control_areas_array = 
$this->so->get_control_areas_by_control_group($control_group_id);
                        }
-                       
+
                        if(count($control_areas_array)>0)
                                return json_encode( $control_areas_array );
                        else

Modified: branches/Version-1_0-branch/controller/js/controller/case.js
===================================================================
--- branches/Version-1_0-branch/controller/js/controller/case.js        
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/controller/js/controller/case.js        
2013-03-19 11:15:08 UTC (rev 11002)
@@ -113,7 +113,7 @@
        
        $("a.quick_edit_case").live("click", function(e){
     e.preventDefault();
-    console.log("sdfsdfsd");
+ //   console.log("sdfsdfsd");
                var clickRow = $(this).closest("li");
                                                                        
                $(clickRow).find(".case_info").hide();

Modified: 
branches/Version-1_0-branch/controller/js/controller/custom_drag_drop.js
===================================================================
--- branches/Version-1_0-branch/controller/js/controller/custom_drag_drop.js    
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/controller/js/controller/custom_drag_drop.js    
2013-03-19 11:15:08 UTC (rev 11002)
@@ -147,4 +147,4 @@
        
   // Updating order number in front of row
   $(element).text(updated_order_nr);
-}
\ No newline at end of file
+}

Modified: branches/Version-1_0-branch/controller/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/setup/setup.inc.php  2013-03-19 
11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/controller/setup/setup.inc.php  2013-03-19 
11:15:08 UTC (rev 11002)
@@ -1,6 +1,6 @@
 <?php
        $setup_info['controller']['name'] = 'controller';
-       $setup_info['controller']['version'] = '0.1.42';
+       $setup_info['controller']['version'] = '0.1.43';
        $setup_info['controller']['app_order'] = 100;
        $setup_info['controller']['enable'] = 1;
        $setup_info['controller']['app_group']  = 'office';

Modified: branches/Version-1_0-branch/controller/setup/tables_current.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/setup/tables_current.inc.php 
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/controller/setup/tables_current.inc.php 
2013-03-19 11:15:08 UTC (rev 11002)
@@ -119,7 +119,7 @@
                                'id' => array('type' => 'auto', 'nullable' => 
false),
                                'control_id' => array('type' => 'int', 
'precision' => '4', 'nullable' => false),
                                'control_group_id' => array('type' => 'int', 
'precision' => '4', 'nullable' => false),
-                               'order_nr' => array('type' => 'varchar', 
'precision' => '3', 'nullable' => false)
+                               'order_nr' => array('type' => 'int', 
'precision' => 4, 'nullable' => true),
                        ),
                        'pk' => array('id'),
                        'fk' => array(),

Modified: branches/Version-1_0-branch/controller/setup/tables_update.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/setup/tables_update.inc.php  
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/controller/setup/tables_update.inc.php  
2013-03-19 11:15:08 UTC (rev 11002)
@@ -839,3 +839,30 @@
                        return 
$GLOBALS['setup_info']['controller']['currentver'];
                }
        }
+
+       $test[] = '0.1.42';
+       function controller_upgrade0_1_42()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+               
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('controller_control_group_list','temp_order_nr',array(
+                       'type' => 'int', 
+                       'precision' => '4',
+                       'nullable' => true
+               ));
+
+               $sql = "UPDATE controller_control_group_list SET temp_order_nr 
= CAST(order_nr AS integer) ";
+               $GLOBALS['phpgw_setup']->oProc->query($sql,__LINE__,__FILE__);
+
+               
$GLOBALS['phpgw_setup']->oProc->DropColumn('controller_control_group_list', 
array(), 'order_nr');
+               
+               
$GLOBALS['phpgw_setup']->oProc->RenameColumn('controller_control_group_list','temp_order_nr','order_nr');
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['controller']['currentver'] = 
'0.1.43';
+                       return 
$GLOBALS['setup_info']['controller']['currentver'];
+               }
+       }
+
+

Modified: 
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list.xsl
 2013-03-19 11:10:55 UTC (rev 11001)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list.xsl
 2013-03-19 11:15:08 UTC (rev 11002)
@@ -100,7 +100,7 @@
                             </div>
                         </xsl:if>
                         <label>Fristdato</label>
-                        <input type="text" id="deadline_date" 
name="deadline_date" class="date">
+                        <input type="text" id="deadline_date" 
name="deadline_date" class="date" readonly="readonly" >
                             <xsl:attribute name="value">
                                 <xsl:value-of select="php:function('date', 
$date_format, number(check_list/deadline))"/>
                             </xsl:attribute>
@@ -109,7 +109,7 @@
                     <!-- PLANNED DATE -->
                     <div class="row">
                         <label>Planlagt dato</label>
-                        <input type="text" id="planned_date" 
name="planned_date" class="date">
+                        <input type="text" id="planned_date" 
name="planned_date" class="date" readonly="readonly">
                             <xsl:if test="check_list/planned_date != 0 and 
check_list/planned_date != ''">
                                 <xsl:attribute name="value">
                                     <xsl:value-of select="php:function('date', 
$date_format, number(check_list/planned_date))"/>
@@ -128,7 +128,7 @@
                             </div>
                         </xsl:if>
                         <label>Utført dato</label>
-                        <input type="text" id="completed_date" 
name="completed_date" class="date">
+                        <input type="text" id="completed_date" 
name="completed_date" class="date" readonly="readonly" >
                             <xsl:if test="check_list/completed_date != 0 and 
check_list/completed_date != ''">
                                 <xsl:attribute name="value">
                                     <xsl:value-of select="php:function('date', 
$date_format, number(check_list/completed_date))"/>

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-03-19 11:10:55 UTC (rev 11001)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/edit_check_list.xsl
        2013-03-19 11:15:08 UTC (rev 11002)
@@ -46,7 +46,7 @@
                        </div>
                        <div class="row">
                                <label>Skal utføres innen</label>
-                               <input class="date">
+                               <input class="date" readonly="readonly">
                              <xsl:attribute 
name="id">deadline_date</xsl:attribute>
                              <xsl:attribute 
name="name">deadline_date</xsl:attribute>
                              <xsl:attribute name="type">text</xsl:attribute>
@@ -57,7 +57,7 @@
                        </div>
                        <div class="row">
                                <label>Planlagt dato</label>
-                               <input class="date">
+                               <input class="date" readonly="readonly">
                              <xsl:attribute 
name="id">planned_date</xsl:attribute>
                              <xsl:attribute 
name="name">planned_date</xsl:attribute>
                              <xsl:attribute name="type">text</xsl:attribute>
@@ -68,7 +68,7 @@
                    </div>
                    <div class="row">
                                <label>Utført dato</label>
-                               <input class="date">
+                               <input class="date" readonly="readonly">
                              <xsl:attribute 
name="id">completed_date</xsl:attribute>
                              <xsl:attribute 
name="name">completed_date</xsl:attribute>
                              <xsl:attribute name="type">text</xsl:attribute>
@@ -104,4 +104,4 @@
                        </form>
                </div>
        </div>
-</xsl:template>
\ No newline at end of file
+</xsl:template>

Modified: branches/Version-1_0-branch/controller/templates/base/css/base.css
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/css/base.css  
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/controller/templates/base/css/base.css  
2013-03-19 11:15:08 UTC (rev 11002)
@@ -731,15 +731,25 @@
 }
 
 ul.expand_list li ul {
-  display:none;
+/*  display:none;*/
   margin-left:21px;
 }
 
+
 ul.expand_list li ul li {
   margin-bottom: 3px;
   padding: 3px;
+ list-style-type:circle;
 }
 
+
+ul.expand_list li ol li {
+  margin-bottom: 3px;
+  padding: 3px;
+ list-style-type:decimal;
+}
+
+
 ul.expand_list h4 span {
   padding-left: 5px;
   vertical-align: middle;
@@ -2323,4 +2333,4 @@
   border: 1px solid #DDDDDD;
   margin: 20px 0;
   padding: 15px;
-}
\ No newline at end of file
+}

Modified: branches/Version-1_0-branch/phpgwapi/setup/tables_current.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/setup/tables_current.inc.php   
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/phpgwapi/setup/tables_current.inc.php   
2013-03-19 11:15:08 UTC (rev 11002)
@@ -560,9 +560,9 @@
                (
                        'fd' => array
                        (
-                               'location_id' => array('type' => 
'int','precision' => 2,'nullable' => false),
-                               'group_id' => array('type' => 'int','precision' 
=> 2,'nullable' => true, 'default' => 0),
-                               'id' => array('type' => 'int','precision' => 
2,'nullable' => false),
+                               'location_id' => array('type' => 
'int','precision' => 4,'nullable' => false),
+                               'group_id' => array('type' => 'int','precision' 
=> 4,'nullable' => true, 'default' => 0),
+                               'id' => array('type' => 'int','precision' => 
4,'nullable' => false),
                                'column_name' => array('type' => 
'varchar','precision' => 50,'nullable' => false),
                                'input_text' => array('type' => 
'varchar','precision' => 255,'nullable' => false),
                                'statustext' => array('type' => 
'varchar','precision' => '255','nullable' => false),

Modified: branches/Version-1_0-branch/phpgwapi/setup/tables_update.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/setup/tables_update.inc.php    
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/phpgwapi/setup/tables_update.inc.php    
2013-03-19 11:15:08 UTC (rev 11002)
@@ -3155,4 +3155,36 @@
                }
        }
 
+/*
+       $test[] = '0.9.17.542';
+       function phpgwapi_upgrade0_9_17_542()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
 
+               
$GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_cust_attribute','location_id',array(
+                       'type' => 'int',
+                       'precision' => 4,
+                       'nullable' => false,
+               ));
+               
$GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_cust_attribute','id',array(
+                       'type' => 'int',
+                       'precision' => 4,
+                       'nullable' => false,
+               ));
+
+               
$GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_cust_attribute','group_id',array(
+                       'type' => 'int',
+                       'precision' => 4,
+                       'nullable' => true,
+                       'default' => 0
+               ));
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['phpgwapi']['currentver'] = 
'0.9.17.543';
+                       return $GLOBALS['setup_info']['phpgwapi']['currentver'];
+               }
+       }
+
+*/
+

Modified: branches/Version-1_0-branch/property/inc/class.bocommon.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.bocommon.inc.php     
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/property/inc/class.bocommon.inc.php     
2013-03-19 11:15:08 UTC (rev 11002)
@@ -1048,7 +1048,7 @@
                {
                        $datatype_text = array(
                                'V' => 'varchar',
-                               'I' => 'number',
+                               'I' => 'integer',
                                'C' => 'char',
                                'N' => 'float',
                                'D' => 'date',
@@ -1139,6 +1139,9 @@
                        $cols_extra             = array();
                        $cols_return_lookup     = array();
 
+                       $GLOBALS['phpgw']->config->read();
+                       $list_location_level = 
isset($GLOBALS['phpgw']->config->config_data['list_location_level'])     && 
$GLOBALS['phpgw']->config->config_data['list_location_level'] ? 
$GLOBALS['phpgw']->config->config_data['list_location_level'] : array();
+
                        $soadmin_location       = 
CreateObject('property.soadmin_location');
                        $location_types = 
$soadmin_location->select_location_type();
                        $config = $soadmin_location->read_config('');
@@ -1168,23 +1171,20 @@
                                $no_address     = true;
                        }
 
-                       $GLOBALS['phpgw']->config->read();
-                       $list_location_level = 
isset($GLOBALS['phpgw']->config->config_data['list_location_level'])     && 
$GLOBALS['phpgw']->config->config_data['list_location_level'] ? 
$GLOBALS['phpgw']->config->config_data['list_location_level'] : array();
 
-
                        $this->type_id  = $type_id;
                        $_level = 1;
                        for ($i=0; $i<$type_id; $i++)
                        {
-               //              if($_level > 1) // very expensive 
-                               if($_level == 2 && in_array(2, 
$list_location_level))
+                               if($_level > 1) // very expensive 
+               //              if($_level == 2 && in_array(2, 
$list_location_level))
                                {
                                        $joinmethod .= " {$this->left_join} 
fm_location{$_level}";
                                        $paranthesis .='(';
                                        $on = 'ON';
                                        for ($k=($_level-1); $k>0; $k--)
                                        {
-                                               $joinmethod .= " $on 
(fm_location{$_level}.loc{$k} = fm_location" . ($_level-1) . ".loc{$k})";
+                                               $joinmethod .= " $on 
(fm_location{$_level}.loc{$k} = fm_location" . ($_level-1) . ".loc{$k} AND  
fm_location{$_level}.loc{$_level} = $entity_table.loc{$_level})";
                                                $on = 'AND';
                                                if($k==1)
                                                {
@@ -1193,18 +1193,30 @@
                                        }
                                }
                                $_level ++;
+                       }
 
-                               $uicols['input_type'][]         = 'text';
-                               $uicols['name'][]                       = 'loc' 
. $location_types[$i]['id'];
-                               $uicols['descr'][]                      = 
$location_types[$i]['name'];
-                               $uicols['statustext'][]         = 
$location_types[$i]['descr'];
-                               $uicols['exchange'][]           = false;
-                               $uicols['align'][]                      = '';
-                               $uicols['datatype'][]           = '';
-                               $uicols['formatter'][]          = '';
-                               $uicols['classname'][]          = '';
-                               $uicols['sortable'][]           = $i === 0;
+                       unset($_level);
+
+                       foreach ($list_location_level as $_key => $_level)
+                       {
+                               if($_level)
+                               {
+                                       $i = $_level -1;
+                                       $uicols['input_type'][]         = 
'text';
+                                       $uicols['name'][]                       
= 'loc' . $location_types[$i]['id'];
+                                       $uicols['descr'][]                      
= $location_types[$i]['name'];
+                                       $uicols['statustext'][]         = 
$location_types[$i]['descr'];
+                                       $uicols['exchange'][]           = false;
+                                       $uicols['align'][]                      
= '';
+                                       $uicols['datatype'][]           = '';
+                                       $uicols['formatter'][]          = '';
+                                       $uicols['classname'][]          = '';
+                                       $uicols['sortable'][]           = 
$_level === 1;
+                               }
                        }
+
+
+//_debug_array($uicols);die();
 //_debug_array($joinmethod);die();
                        unset($soadmin_location);
 
@@ -1215,6 +1227,7 @@
 
                        for ($i=1;$i<($type_id+1);$i++)
                        {
+                               $cols.= ",loc{$i}_name";
                                $cols_return[]                          = 
"loc{$i}_name";
                                $cols_extra[]                           = 
"loc{$i}_name";
                                $cols_return_lookup[]           = 
"loc{$i}_name";
@@ -1423,7 +1436,6 @@
                        }
 
                        $categories = 
execMethod('property.sogeneric.get_list',$data);
-
                        return 
$this->select_list($data['selected'],$categories);
                }
 

Modified: branches/Version-1_0-branch/property/inc/class.boentity.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.boentity.inc.php     
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/property/inc/class.boentity.inc.php     
2013-03-19 11:15:08 UTC (rev 11002)
@@ -680,4 +680,18 @@
                        return $this->so->read_entity_to_link($data);
                }
 
+               public function get_inventory($id = 0)
+               {
+                       $location_id = 
$GLOBALS['phpgw']->locations->get_id($this->type_app[$this->type], 
".{$this->type}.{$this->entity_id}.{$this->cat_id}");
+                       $values = $this->so->get_inventory( array('id' => $id, 
'location_id' => $location_id) );
+                       return $values;
+               }
+
+               public function save_inventory($values)
+               {
+                       $values['active_from']  = 
$this->bocommon->date_to_timestamp($values['active_from']);
+                       $values['active_to']    = 
$this->bocommon->date_to_timestamp($values['active_to']);
+                       return $this->so->save_inventory($values);
+               }
+
        }

Modified: branches/Version-1_0-branch/property/inc/class.boproject.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.boproject.inc.php    
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/property/inc/class.boproject.inc.php    
2013-03-19 11:15:08 UTC (rev 11002)
@@ -833,7 +833,6 @@
 
                function save($project,$action='',$values_attribute = array())
                {
-
                        //_debug_array($project);
                        while (is_array($project['location']) && list(,$value) 
= each($project['location']))
                        {
@@ -855,7 +854,18 @@
 
                        if ($action=='edit')
                        {
-                               $receipt = $this->so->edit($project, 
$values_attribute);
+                               try
+                               {
+                                       $receipt = $this->so->edit($project, 
$values_attribute);
+                               }
+                               catch(Exception $e)
+                               {
+                                       if ( $e )
+                                       {
+                                               
phpgwapi_cache::message_set($e->getMessage(), 'error');
+                                               $receipt['id'] = $project['id'];
+                                       }
+                               }
                        }
                        else
                        {

Modified: branches/Version-1_0-branch/property/inc/class.borequest.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.borequest.inc.php    
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/property/inc/class.borequest.inc.php    
2013-03-19 11:15:08 UTC (rev 11002)
@@ -46,6 +46,7 @@
                public $sum_potential_grants = 0;
                public $sum_consume = 0;
                public $acl_location = '.project.request';
+               public $responsible_unit;
 
                var $public_functions = array
                        (
@@ -62,7 +63,7 @@
                        $this->bocommon                         = 
CreateObject('property.bocommon');
                        $this->solocation                       = 
CreateObject('property.solocation');
                        $this->historylog                       = 
CreateObject('property.historylog','request');
-                       $this->cats                                     = 
CreateObject('phpgwapi.categories', -1,  'property', '.project');
+                       $this->cats                                     = 
CreateObject('phpgwapi.categories', -1,  'property', '.project.request');
                        $this->cats->supress_info       = true;
                        $this->custom                           = & 
$this->so->custom;
 //                     $this->acl_location                     = 
'.project.request';
@@ -72,22 +73,23 @@
                                $this->use_session = true;
                        }
 
-                       $start                  = phpgw::get_var('start', 
'int', 'REQUEST', 0);
-                       $query                  = phpgw::get_var('query');
-                       $sort                   = phpgw::get_var('sort');
-                       $order                  = phpgw::get_var('order');
-                       $filter                 = phpgw::get_var('filter', 
'int');
-                       $property_cat_id= phpgw::get_var('property_cat_id', 
'int');
-                       $district_id    = phpgw::get_var('district_id', 'int');
-                       $cat_id                 = phpgw::get_var('cat_id', 
'int');
-                       $status_id              = phpgw::get_var('status_id');
-                       $degree_id              = phpgw::get_var('degree_id', 
'int');
-                       $allrows                = phpgw::get_var('allrows', 
'bool');
-                       $this->p_num    = phpgw::get_var('p_num');
+                       $start                          = 
phpgw::get_var('start', 'int', 'REQUEST', 0);
+                       $query                          = 
phpgw::get_var('query');
+                       $sort                           = 
phpgw::get_var('sort');
+                       $order                          = 
phpgw::get_var('order');
+                       $filter                         = 
phpgw::get_var('filter', 'int');
+                       $property_cat_id        = 
phpgw::get_var('property_cat_id', 'int');
+                       $district_id            = phpgw::get_var('district_id', 
'int');
+                       $cat_id                         = 
phpgw::get_var('cat_id', 'int');
+                       $status_id                      = 
phpgw::get_var('status_id');
+                       $degree_id                      = 
phpgw::get_var('degree_id', 'int');
+                       $allrows                        = 
phpgw::get_var('allrows', 'bool');
+                       $this->p_num            = phpgw::get_var('p_num');
 
-                       $start_date             = phpgw::get_var('start_date');
-                       $end_date               = phpgw::get_var('end_date');
-                       $building_part  = phpgw::get_var('building_part');
+                       $start_date                     = 
phpgw::get_var('start_date');
+                       $end_date                       = 
phpgw::get_var('end_date');
+                       $building_part          = 
phpgw::get_var('building_part');
+                       $responsible_unit       = 
phpgw::get_var('responsible_unit', 'int');
 
                        $this->condition_survey_id = 
phpgw::get_var('condition_survey_id', 'int', 'REQUEST', 0);
 
@@ -141,6 +143,11 @@
                                $this->building_part = $building_part;
                        }
 
+                       if(isset($_POST['responsible_unit']) || 
isset($_GET['responsible_unit']))
+                       {
+                               $this->responsible_unit = $responsible_unit;
+                       }
+
                        if($allrows)
                        {
                                $this->allrows = $allrows;
@@ -180,6 +187,7 @@
                        $this->status_id                = $data['status_id'];
                        $this->degree_id                = $data['degree_id'];
                        $this->building_part    = $data['building_part'];
+                       $this->responsible_unit = $data['responsible_unit'];
                        $this->start_date               = 
isset($data['start_date']) ? $data['start_date']: '';
                        $this->end_date                 = 
isset($data['end_date']) ? $data['end_date']: '';
                }
@@ -244,7 +252,8 @@
                        $degree_comment[1]=' - '.lang('minor symptoms');
                        $degree_comment[2]=' - '.lang('medium symptoms');
                        $degree_comment[3]=' - '.lang('serious symptoms');
-                       for ($i=0; $i<=3; $i++)
+                       $degree_comment[4]=' - '.lang('condition not assessed');
+                       for ($i=0; $i<=4; $i++)
                        {
                                $degree_list[$i]['id'] = $i;
                                $degree_list[$i]['name'] = $i . 
$degree_comment[$i];
@@ -479,7 +488,8 @@
                                'project_id' => 
$data['project_id'],'allrows'=>$data['allrows'],'list_descr' => 
$data['list_descr'],
                                'dry_run'=>$data['dry_run'], 'p_num' => 
$this->p_num,'start_date'=>$this->start_date,'end_date'=>$this->end_date,
                                'property_cat_id' => $this->property_cat_id, 
'building_part' => $this->building_part,
-                               'degree_id' => $this->degree_id, 
'attrib_filter' => $attrib_filter, 'condition_survey_id' => 
$this->condition_survey_id));
+                               'degree_id' => $this->degree_id, 
'attrib_filter' => $attrib_filter, 'condition_survey_id' => 
$this->condition_survey_id,
+                               'responsible_unit' => $this->responsible_unit));
 
                        $this->total_records                    = 
$this->so->total_records;
                        $this->sum_investment                   = 
$this->so->sum_investment;

Modified: branches/Version-1_0-branch/property/inc/class.menu.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.menu.inc.php 2013-03-19 
11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/property/inc/class.menu.inc.php 2013-03-19 
11:15:08 UTC (rev 11002)
@@ -472,11 +472,21 @@
                                                        'text'  => lang('User 
contact info'),
                                                        'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiadmin.contact_info') )
                                                ),
+                                               'request_cats'  => array
+                                               (
+                                                       'text'  => 
lang('request categories'),
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uicategories.index', 'appname' => 'property', 'location' => 
'.project.request', 'global_cats' => 'true', 'menu_selection' => 
'admin::property::request_cats') )
+                                               ),
                                                'request_status'        => array
                                                (
                                                        'text'  => 
lang('Request status'),
                                                        'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uigeneric.index', 'type' => 'request_status') )
                                                ),
+                                               'request_responsible_unit'      
=> array
+                                               (
+                                                       'text'  => 
lang('responsible unit'),
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uigeneric.index', 'type' => 'request_responsible_unit') )
+                                               ),
                                                'request_condition'     => array
                                                (
                                                        'text'  => 
lang('Request condition_type'),

Modified: branches/Version-1_0-branch/property/inc/class.soXport.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soXport.inc.php      
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/property/inc/class.soXport.inc.php      
2013-03-19 11:15:08 UTC (rev 11002)
@@ -786,6 +786,7 @@
 
                                foreach ($orders as $order)
                                {
+                                       
phpgwapi_cache::system_clear('property', "budget_order_{$order['order_id']}");
                                        $this->db->query("UPDATE fm_workorder 
SET actual_cost = '{$order['actual_cost']}' WHERE id = 
'{$order['order_id']}'",__LINE__,__FILE__);
                                }
                        }
@@ -795,6 +796,8 @@
                // operator="-" ved tilbakerulling
                public function correct_actual_cost($order_id, $amount, 
$actual_cost_field, $operator)
                {
+                       phpgwapi_cache::system_clear('property', 
"budget_order_{$order_id}");
+
                        $sql = "SELECT type FROM fm_orders WHERE 
id='{$order_id}'";
                        $this->db->query($sql,__LINE__,__FILE__);
                        $this->db->next_record();

Modified: branches/Version-1_0-branch/property/inc/class.sobudget.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sobudget.inc.php     
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/property/inc/class.sobudget.inc.php     
2013-03-19 11:15:08 UTC (rev 11002)
@@ -565,7 +565,6 @@
 
                        $filtermethod = '';
                        $filtermethod_order = " WHERE (fm_workorder_budget.year 
= $year OR fm_workorder_status.closed IS NULL)";
-                       $filtermethod_paid = " WHERE 
(fm_orders_paid_or_pending_view.periode > {$year}00 and 
fm_orders_paid_or_pending_view.periode < {$year}13)";
 
                        $where = 'AND';
 
@@ -651,131 +650,101 @@
                                $_taxcode[$this->db->f('id')] = 
$this->db->f('percent');
                        }
 
-                       $sql = "SELECT fm_workorder.id AS id, 
sum(fm_orders_paid_or_pending_view.amount) AS actual_cost,fm_location1.mva,"
-                               . " fm_b_account.{$b_account_field} as 
{$b_account_field}, district_id, fm_workorder.ecodimb"
+                       $sql = "SELECT DISTINCT fm_workorder.id AS id, 
fm_location1.mva,project_id,"
+                               . " fm_b_account.{$b_account_field} AS 
b_account, district_id, fm_workorder.ecodimb"
                                . " FROM fm_workorder"
                                . " {$this->join} fm_workorder_status ON 
fm_workorder.status = fm_workorder_status.id"
                                . " {$this->join} fm_workorder_budget ON 
(fm_workorder.id = fm_workorder_budget.order_id)"
                                . " {$this->join} fm_b_account ON 
fm_workorder.account_id = fm_b_account.id"
                                . " {$this->join} fm_project ON  
fm_workorder.project_id = fm_project.id"
-                               . " {$this->left_join} 
fm_orders_paid_or_pending_view ON fm_workorder.id = 
fm_orders_paid_or_pending_view.order_id"
                                . " {$_join_district}"
                                . " {$this->join} fm_part_of_town ON 
fm_location1.part_of_town_id = fm_part_of_town.part_of_town_id"
-                               . " {$filtermethod_paid}{$filtermethod} 
{$querymethod} {$where} {$filtermethod_direction}"
-                               . " GROUP BY fm_workorder.id, fm_location1.mva,"
-                               . " fm_b_account.{$b_account_field}, 
district_id, fm_workorder.ecodimb";
+                               . " {$filtermethod_order}{$filtermethod} 
{$querymethod} {$where} {$filtermethod_direction}"
+                               . " ORDER BY fm_workorder.id ASC";
 
 //                     _debug_array($sql);
                        //die();
                        $this->db->query($sql,__LINE__,__FILE__);
                        $_temp_paid_info = array();
+$projects = array();
 
+
                        while ($this->db->next_record())
                        {
+
                                $_id = $this->db->f('id');
+
+
+$projects[$this->db->f('project_id')] = 0;
+$projects2[$_id] = $this->db->f('project_id');
+
                                $_temp_paid_info[$_id] = array
                                (
-                                       'actual_cost'                   => 
$this->db->f('actual_cost'),
+                                       'actual_cost'                   => 0,
                                        'mva'                                   
=> (int)$this->db->f('mva'),
                                        'district_id'                   => 
(int)$this->db->f('district_id'),
                                        'ecodimb'                               
=> (int)$this->db->f('ecodimb'),
-                                       $b_account_field                => 
$this->db->f($b_account_field),
+                                       'b_account'                             
=> $this->db->f('b_account'),
                                );
                        }
+ksort($projects);
+//_debug_array(count($projects2));
+//_debug_array($projects2);
 
+                       $soworkorder = CreateObject('property.soworkorder');
 
-                       $sql = "SELECT fm_workorder.id, 
fm_workorder_status.closed, fm_workorder.budget, 
fm_workorder.combined_cost,fm_location1.mva,fm_workorder.start_date,"
-                               . " fm_b_account.{$b_account_field} as 
{$b_account_field}, district_id, fm_workorder.ecodimb"
-                               . " FROM fm_workorder"
-                               . " {$this->join} fm_workorder_status ON 
fm_workorder.status = fm_workorder_status.id"
-                               . " {$this->join} fm_workorder_budget ON 
fm_workorder.id = fm_workorder_budget.order_id"
-                               . " {$this->join} fm_b_account ON 
fm_workorder.account_id = fm_b_account.id"
-                               . " {$this->join} fm_project ON  
fm_workorder.project_id = fm_project.id"
-                               . " {$_join_district}"
-                               . " {$this->join} fm_part_of_town ON 
fm_location1.part_of_town_id = fm_part_of_town.part_of_town_id"
-                               . " {$filtermethod_order}{$filtermethod} 
{$querymethod} {$where} {$filtermethod_direction}";
-
-                       $this->db->query($sql . $ordermethod,__LINE__,__FILE__);
-
                        $sum_actual_cost = 0;
                        $actual_cost = array();
                        $sum_obligation_cost = 0;
                        $obligations = array();
                        $sum_hits = 0;
-                       $_local_combined_cost = array();
-//$_test=array();
-                       while ($this->db->next_record())
+
+                       $sum_hits = count($_temp_paid_info);
+
+                       foreach ($_temp_paid_info as $order_id => &$order_info)
                        {
-                               $_id = $this->db->f('id');
-                               if (!isset($_local_combined_cost[$_id]) && ! 
$_combined_cost = $_local_combined_cost[$_id])
+                               $order_budget = 
$soworkorder->get_budget($order_id);
+                               foreach($order_budget as $budget)
                                {
-                                       $_local_combined_cost[$_id] = 
round($this->db->f('combined_cost'));
-                                       $_combined_cost = 
$_local_combined_cost[$_id];
-                               }
+                                       if($budget['year'] == $year)
+                                       {
+$projects3[$projects2[$order_id]]['actual_cost']+= $budget['actual_cost'];
+$projects3[$projects2[$order_id]]['combined_cost']+= $budget['sum_orders'];
+$projects3[$projects2[$order_id]]['budget']+= $budget['budget'];
+$projects3[$projects2[$order_id]]['obligation']+= $budget['sum_oblications'];
 
-                               $_taxfactor = 1 + 
($_taxcode[(int)$this->db->f('mva')]/100);
-                               $_actual_cost = 
isset($_temp_paid_info[$_id]['actual_cost']) && 
$_temp_paid_info[$_id]['actual_cost'] ? 
round($_temp_paid_info[$_id]['actual_cost']/$_taxfactor) : 0;
-               //              $_actual_cost = 
round($_temp_paid_info[$_id]['actual_cost']);
-                               $_obligation = $_combined_cost - $_actual_cost;
+                                               $order_info['actual_cost']      
        += $budget['actual_cost'];
+                                               $order_info['combined_cost']    
+= $budget['sum_orders'];
+                                               $order_info['budget']           
        += $budget['budget'];
+                                               $order_info['obligation']       
        += $budget['sum_oblications'];
 
-                               unset($_temp_paid_info[$_id]);
-                               unset($_id);
+                                               $sum_obligation_cost += 
$budget['sum_oblications'];
+                                               
$obligations[$order_info['b_account']][$order_info['district_id']][$order_info['ecodimb']]
 += $budget['sum_oblications'];
 
-                               // only the current year
-                               if($this->db->f('start_date') < $start_date)
-                               {
-//                                     $_actual_cost = 0;
-                               }
 
-                               $sum_hits += 1;
+                                               $_taxfactor             = 1 + 
($_taxcode[(int)$order_info['mva']]/100);
+                                               $_actual_cost   = 
round($order_info['actual_cost']/$_taxfactor);
 
-                               if(!$this->db->f('closed'))
-                               {
-                                       if((int)$this->db->f('budget') >= 0)
-                                       {
-                                               if($_obligation < 0)
-                                               {
-//$_test[] = $_obligation;
-                                                       $_obligation = 0;
-                                               }
-                                       }
-                                       else
-                                       {
-                                               if($_obligation > 0)
-                                               {
-                                                       $_obligation = 0;
-                                               }
-                                       }
-
-                                       $sum_obligation_cost += $_obligation;
-                                       
$obligations[$this->db->f($b_account_field)][(int)$this->db->f('district_id')][(int)$this->db->f('ecodimb')]
 += $_obligation;
-                               }
 //_debug_array($_test);
-                               
$hits[$this->db->f($b_account_field)][(int)$this->db->f('district_id')][(int)$this->db->f('ecodimb')]
 += 1;
-                               $accout_info[$this->db->f($b_account_field)] = 
true;
-                               $district[$this->db->f('district_id')] = true;
-                               $ecodimb[(int)$this->db->f('ecodimb')] = true;
 
-                               $sum_actual_cost += $_actual_cost;
-                               
$actual_cost[$this->db->f($b_account_field)][(int)$this->db->f('district_id')][(int)$this->db->f('ecodimb')]
 += $_actual_cost;
+                                               $sum_actual_cost += 
$_actual_cost;
+                                               
$actual_cost[$order_info['b_account']][$order_info['district_id']][$order_info['ecodimb']]
 += $_actual_cost;
 
-                       }
 
 
-//                     _debug_array($_temp_paid_info);
-                       
-                       foreach ($_temp_paid_info as $_id => $_paid)
-                       {
-                               $accout_info[$_paid[$b_account_field]] = true;
-                               $district[$_paid['district_id']] = true;
-                               $ecodimb[$_paid['ecodimb']] = true;
+                                       }
 
-                               $_taxfactor = 1 + 
($_taxcode[(int)$_paid['mva']]/100);
-                               $_actual_cost =  
round($_paid['actual_cost']/$_taxfactor);
-                               $sum_actual_cost += $_actual_cost;
-                               
$actual_cost[$_paid[$b_account_field]][(int)$_paid['district_id']][(int)$_paid['ecodimb']]
 += $_actual_cost;
+                                       
$hits[$order_info['b_account']][$order_info['district_id']][$order_info['ecodimb']]
 += 1;
+                                       $accout_info[$order_info['b_account']] 
= true;
+                                       $district[$order_info['district_id']] = 
true;
+                                       $ecodimb[$order_info['ecodimb']] = true;
+
+
+                               }
                        }
+//_debug_array($projects3);
 
+
 //                     _debug_array($obligations);
 
                        //----------- ad hoc order

Modified: 
branches/Version-1_0-branch/property/inc/class.socondition_survey.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.socondition_survey.inc.php   
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/property/inc/class.socondition_survey.inc.php   
2013-03-19 11:15:08 UTC (rev 11002)
@@ -295,12 +295,16 @@
                                throw new 
Exception('property_socondition_survey::import - condition survey import 
categories not configured');
                        }
 
-
                        
if(!isset($config->config_data['condition_survey_initial_status']) || 
!$config->config_data['condition_survey_initial_status'])
                        {
                                throw new 
Exception('property_socondition_survey::import - condition survey initial 
status not configured');
                        }
 
+                       
if(!isset($config->config_data['condition_survey_hidden_status']) || 
!$config->config_data['condition_survey_hidden_status'])
+                       {
+                               throw new 
Exception('property_socondition_survey::import - condition survey hidden status 
not configured');
+                       }
+
                        $cats   = CreateObject('phpgwapi.categories', -1, 
'property', '.project');
                        $cats->supress_info = true;
                        $categories = $cats->return_sorted_array(0, false, '', 
'', '', $globals = true, '', $use_acl = false);
@@ -314,6 +318,19 @@
                        3 => 'Users/Customers responsibility',
                );
 */
+
+
+               $import_type_responsibility = array();
+               
+               $import_type_responsibility[1] = 1; //hidden => 
responsible_unit 1
+               $import_type_responsibility[2] = 1; //'Normal import' => 
responsible_unit 1
+               $import_type_responsibility[3] = 2; //'Customers' => 
responsible_unit 2
+               $import_type_responsibility[4] = 3; //'Customers' => 
responsible_unit 3
+               $import_type_responsibility[5] = 4; //'Customers' => 
responsible_unit 3
+               $import_type_responsibility[6] = 5; //'Customers' => 
responsible_unit 3
+               $import_type_responsibility[7] = 6; //'Customers' => 
responsible_unit 3
+               $import_type_responsibility[8] = 7; //'Customers' => 
responsible_unit 3
+
 /*
                $cats_candidates = array
                (
@@ -331,8 +348,8 @@
                                $_update_buildingpart = 
array("filter_{$filter_key}" => 1);
                        }
 
-
-_debug_array($import_data);die();
+//_debug_array($import_data);die();
+                       $origin_id = 
$GLOBALS['phpgw']->locations->get_id('property', '.project.condition_survey');
                        foreach ($import_data as $entry)
                        {
 
@@ -375,19 +392,32 @@
                                        $request['street_number']               
        = $location_data['street_number'];
                                        $request['location']                    
        = $location;
                                        $request['location_code']               
        = $survey['location_code'];
-                                       $request['origin_id']                   
        = $GLOBALS['phpgw']->locations->get_id('property', 
'.project.condition_survey');
+                                       $request['origin_id']                   
        = $origin_id;
                                        $request['origin_item_id']              
        = (int)$survey['id'];
                                        $request['title']                       
                = substr($entry['title'], 0, 255);
                                        $request['descr']                       
                = $entry['descr'];
                                        $request['building_part']               
        = $entry['building_part'];
                                        $request['coordinator']                 
        = $survey['coordinator_id'];
-                                       $request['status']                      
                = $config->config_data['condition_survey_initial_status'];
+
+                                       if($entry['import_type'] == 1)
+                                       {
+                                               $request['status']              
                = $config->config_data['condition_survey_hidden_status'];
+                                       }
+                                       else
+                                       {
+                                               $request['status']              
                = $config->config_data['condition_survey_initial_status'];      
                                
+                                       }
+
                                        $request['amount_investment']           
= $entry['amount_investment'];
                                        $request['amount_operation']            
= $entry['amount_operation'];
                                        $request['amount_potential_grants']     
= $entry['amount_potential_grants'];
 
-                                       $request['planning_value']              
= $entry['amount'];
-                                       $request['planning_date']               
= mktime(13,0,0,7,1, $entry['due_year']?$entry['due_year']:date('Y'));
+                                       $request['planning_value']              
        = $entry['amount'];
+                                       $request['planning_date']               
        = mktime( 13,0,0,7,1, $entry['due_year'] ? (int) $entry['due_year'] : 
date('Y') );
+                                       $request['recommended_year']            
= $entry['due_year'] ? (int)$entry['due_year'] : date('Y');
+
+                                       $request['responsible_unit']            
= (int)$import_type_responsibility[$entry['import_type']];
+
                                        $request['condition']                   
= array
                                        (
                                                array
@@ -399,6 +429,7 @@
                                                )
                                        );
 
+//_debug_array($request);
                                        $sorequest->add($request, 
$values_attribute = array());
                                }
                        }
@@ -428,8 +459,10 @@
                        $table = 'fm_request';
 
                        $condition_survey_id            = (int)$id;
-                       $sql = "SELECT category as cat_id, 
left(building_part,1) as building_part_, sum(fm_request_planning.amount) as 
amount , EXTRACT(YEAR from to_timestamp(fm_request_planning.date) ) as year"
-                       ." FROM {$table} {$this->_join} fm_request_planning ON 
fm_request_planning.request_id = {$table}.id"
+                       $sql = "SELECT category as cat_id, 
left(building_part,1) as building_part_,"
+                       . " sum(amount_investment) as investment 
,sum(amount_operation) as operation,"
+                       . " recommended_year as year"
+                       ." FROM {$table}"
                        ." WHERE condition_survey_id={$condition_survey_id}"
                        ." GROUP BY building_part_ ,category, year ORDER BY 
building_part_";
 
@@ -438,11 +471,13 @@
                        $values = array();
                        while ($this->_db->next_record())
                        {
+                               $amount = $this->_db->f('investment') + 
$this->_db->f('operation');
+                               
                                $values[] = array
                                (
                                        'building_part'         => 
$this->_db->f('building_part_'),
-                                       'amount'                        => 
$this->_db->f('amount'),
-                                       'year'                          => 
$this->_db->f('year'),//date('Y', $this->_db->f('date')),
+                                       'amount'                        => 
$amount,
+                                       'year'                          => 
$this->_db->f('year'),
                                        'cat_id'                        => 
$this->_db->f('cat_id'),
                                );
                        }

Modified: branches/Version-1_0-branch/property/inc/class.soentity.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soentity.inc.php     
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/property/inc/class.soentity.inc.php     
2013-03-19 11:15:08 UTC (rev 11002)
@@ -151,10 +151,10 @@
                                switch($order)
                                {
                                        case 'user_id':
-               //                              $ordermethod = " ORDER BY 
phpgw_accounts.account_lastname {$sort}";  // Don't work with LDAP. 
+               //                              $ordermethod = " ORDER BY 
phpgw_accounts.account_lastname {$sort}";  // Don't work with LDAP.
                                                break;
                                        case 'loc1_name':
-                                               $ordermethod = " ORDER BY 
fm_location1.loc1_name {$sort}";  // Don't work with LDAP. 
+                                               $ordermethod = " ORDER BY 
fm_location1.loc1_name {$sort}";  // Don't work with LDAP.
                                                break;
                                        default:
                                                $ordermethod = " ORDER BY 
$entity_table.$order $sort";
@@ -220,7 +220,7 @@
 
                /**
                 * Method for retreiving sublevels of a hierarchy.
-                * 
+                *
                 * @param $data array array holding input parametres
                 * @return array of entities
                 */
@@ -768,7 +768,7 @@
                                switch($order)
                                {
                                        case 'user_id':
-               //                              $ordermethod = " ORDER BY 
phpgw_accounts.account_lastname {$sort}";  // Don't work with LDAP. 
+               //                              $ordermethod = " ORDER BY 
phpgw_accounts.account_lastname {$sort}";  // Don't work with LDAP.
                                                break;
                                        case 'loc1_name':
                                                $ordermethod = " ORDER BY 
fm_location1.loc1_name {$sort}";
@@ -1176,10 +1176,10 @@
                                switch($order)
                                {
                                        case 'user_id':
-               //                              $ordermethod = " ORDER BY 
phpgw_accounts.account_lastname {$sort}";  // Don't work with LDAP. 
+               //                              $ordermethod = " ORDER BY 
phpgw_accounts.account_lastname {$sort}";  // Don't work with LDAP.
                                                break;
                                        case 'loc1_name':
-                                               $ordermethod = " ORDER BY 
fm_location1.loc1_name {$sort}";  // Don't work with LDAP. 
+                                               $ordermethod = " ORDER BY 
fm_location1.loc1_name {$sort}";  // Don't work with LDAP.
                                                break;
                                        default:
                                                $metadata = 
$this->db->metadata($entity_table);
@@ -2349,4 +2349,107 @@
 
                        return $entity;
                }
+
+               /**
+                * Method for retreiving inventory of bulk items.
+                *
+                * @param $data array array holding input parametres
+                * @return array of entities
+                */
+
+               public function get_inventory($data = array())
+               {
+
+                       $location_id    = isset($data['location_id']) && 
$data['location_id'] ? (int)$data['location_id'] : 0;
+                       $id                             = (int)$data['id'];
+
+                       if(!$location_id || ! $id)
+                       {
+                               return array();
+                       }
+
+                       $sql = "SELECT fm_bim_item_inventory.*, 
fm_standard_unit.name AS unit FROM fm_bim_item_inventory"
+                       . " {$this->join} fm_standard_unit ON 
fm_bim_item_inventory.unit_id = fm_standard_unit.id"
+                       . "  WHERE location_id = {$location_id} AND 
fm_bim_item_inventory.item_id = {$id} AND expired_on IS NULL";
+                       $this->db->query($sql,__LINE__,__FILE__);
+                       $inventory = array();
+                       while ($this->db->next_record())
+                       {
+                               $inventory[] = array
+                               (
+                                       'inventory'             => 
$this->db->f('inventory'),
+                                       'unit'                  => 
$this->db->f('unit', true),
+                                       'remark'                => 
$this->db->f('remark', true),
+                                       'p_location_id' => 
$this->db->f('p_location_id'),
+                                       'p_id'                  => 
$this->db->f('p_id'),
+                                       'bookable'              => 
$this->db->f('bookable'),
+                                       'active_from'   => 
$this->db->f('active_from'),
+                                       'active_to'             => 
$this->db->f('active_to'),
+                                       'bookable'              => 
$this->db->f('bookable'),
+                               );
+                       }
+
+//_debug_array($inventory);
+                       return $inventory;
+/*
+  id integer NOT NULL DEFAULT nextval('seq_fm_bim_item_inventory'::regclass),
+  location_id integer NOT NULL,
+  item_id integer NOT NULL,
+  p_location_id integer,
+  p_id integer,
+  unit_id integer NOT NULL,
+  inventory integer NOT NULL,
+  write_off integer NOT NULL,
+  bookable smallint NOT NULL,
+  active_from bigint,
+  active_to bigint,
+  created_on bigint NOT NULL,
+  created_by integer NOT NULL,
+  expired_on bigint,
+  expired_by bigint,
+  remark text,
+
+*/
+
+               }
+
+               public function save_inventory($values)
+               {
+                       $p_location_id = 
$GLOBALS['phpgw']->locations->get_id('property', '.location.' . 
count(explode('-', $values['location_code'])));
+                       
+                       $sql = "SELECT id FROM fm_locations WHERE location_code 
= '{$values['location_code']}'";
+                       $this->db->query($sql,__LINE__,__FILE__);
+                       $this->db->next_record();
+                       $p_id   = $this->db->f('id');
+                       
+                       if(!$p_location_id && !$p_id)
+                       {
+                               throw new Exception('ERROR: Not a valid 
location');                     
+                       }
+                       
+                       $table = 'fm_bim_item_inventory';
+
+                       $value_set = array
+                       (
+                               'location_id'           => 
$values['location_id'],
+                               'item_id'                       => 
$values['item_id'],
+                               'p_location_id'         => $p_location_id,
+                               'p_id'                          => $p_id,
+                               'unit_id'                       => 
$values['unit_id'],
+                               'inventory'                     => 
(int)$values['inventory'],
+                               'write_off'                     => 
(int)$values['write_off'],
+                               'bookable'                      => 
(int)$values['bookable'],
+                               'active_from'           => 
$values['active_from'],
+                               'active_to'                     => 
$values['active_to'],
+                               'created_on'            => time(),
+                               'created_by'            => $this->account,
+       //                      'expired_on'            => ,
+       //                      'expired_by'            => ,
+                               'remark'                        => 
$this->db->db_addslashes($values['remark'])
+                       );
+
+                       return  $this->db->query("INSERT INTO {$table} (" . 
implode(',',array_keys($value_set)) . ') VALUES ('
+                                . 
$this->db->validate_insert(array_values($value_set)) . ')',__LINE__,__FILE__);
+
+               }
        }

Modified: branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php    
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php    
2013-03-19 11:15:08 UTC (rev 11002)
@@ -1193,6 +1193,37 @@
                                        );
                                break;
 
+                       case 'request_responsible_unit':
+                               $_lang_responsible_unit = lang('responsible 
unit');
+                               $info = array
+                                       (
+                                               'table'                         
=> 'fm_request_responsible_unit',
+                                               'id'                            
=> array('name' => 'id', 'type' => 'int'),
+                                               'fields'                        
=> array
+                                               (
+                                                       array
+                                                       (
+                                                               'name' => 
'name',
+                                                               'descr' => 
lang('name'),
+                                                               'type' => 
'varchar'
+                                                       ),
+                                                       array
+                                                       (
+                                                               'name' => 
'descr',
+                                                               'descr' => 
lang('descr'),
+                                                               'type' => 
'varchar'
+                                                       )
+                                               ),
+                                               'edit_msg'                      
=> lang('edit') . ' ' . $_lang_responsible_unit,
+                                               'add_msg'                       
=> lang('add') . ' ' . $_lang_responsible_unit,
+                                               'name'                          
=> $_lang_responsible_unit,
+                                               'acl_app'                       
=> 'property',
+                                               'acl_location'          => 
'.admin',
+                                               'menu_selection'        => 
'admin::property::request_responsible_unit'
+                                       );
+                               break;
+
+
                                //-------- ID type varchar
                        case 'project_status':
                                $info = array

Modified: branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php    
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php    
2013-03-19 11:15:08 UTC (rev 11002)
@@ -2063,7 +2063,30 @@
                        }
 
                        $GLOBALS['phpgw']->db->transaction_begin();
+                       $this->db->query("SELECT * FROM fm_ecobilag WHERE id =" 
. (int)$line_id,__LINE__,__FILE__);
+
+                       $this->db->next_record();
+                       $old_janitor                    =  
$this->db->f('oppsynsmannid');
+                       $old_supervisor                 =  
$this->db->f('saksbehandlerid');
+                       $old_budget_responsible =  
$this->db->f('budsjettansvarligid');
+
                        $value_set = array();
+                       
+                       if($old_janitor != $order_info['janitor'])
+                       {
+                               $value_set['oppsynsigndato']    = '';           
        
+                       }
+
+                       if($old_supervisor != $order_info['supervisor'])
+                       {
+                               $value_set['saksigndato']       = '';           
        
+                       }
+
+                       if($old_budget_responsible != 
$order_info['budget_responsible'])
+                       {
+                               $value_set['budsjettsigndato']  = '';           
        
+                       }
+
                        $value_set['pmwrkord_code']                     = 
$order_id;
                        $value_set['dima']                                      
= $order_info['dima'];
                        $value_set['dimb']                                      
= $order_info['dimb'];

Modified: branches/Version-1_0-branch/property/inc/class.soproject.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soproject.inc.php    
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/property/inc/class.soproject.inc.php    
2013-03-19 11:15:08 UTC (rev 11002)
@@ -133,6 +133,21 @@
                                $cols = $entity_table . '.location_code';
                                $cols_return[] = 'location_code';
 
+                               $cols.= ",project_type_id";
+                               $cols_return[]                          = 
'project_type_id';
+/*
+                               $uicols['input_type'][]         = 'hidden';
+                               $uicols['name'][]                       = 
'project_type_id';
+                               $uicols['descr'][]                      = '';
+                               $uicols['statustext'][]         = '';
+                               $uicols['exchange'][]           = false;
+                               $uicols['align'][]                      = '';
+                               $uicols['datatype'][]           = '';
+                               $uicols['formatter'][]          = '';
+                               $uicols['classname'][]          = '';
+                               $uicols['sortable'][]           = '';
+*/
+
                                $cols .= ",$entity_table.id as project_id";
                                $cols_return[]                          = 
'project_id';
                                $uicols['input_type'][]         = 'text';
@@ -321,7 +336,7 @@
                                //----- wo_hour_status
 
                                $sql    = 
$this->bocommon->generate_sql(array('entity_table'=>$entity_table,'cols'=>$cols,'cols_return'=>$cols_return,
-                                       
'uicols'=>$uicols,'joinmethod'=>$joinmethod,'paranthesis'=>$paranthesis,'query'=>$query,'force_location'=>true));
+                                       
'uicols'=>$uicols,'joinmethod'=>$joinmethod,'paranthesis'=>$paranthesis,'query'=>$query,'force_location'=>true,'location_level'
 => 2));
 
                                $this->bocommon->fm_cache('sql_project_' . 
!!$wo_hour_cat_id,$sql);
 
@@ -658,7 +673,7 @@
                                }
 
                                $project_list = array();
-
+//_debug_array($cols_return);
                                $count_cols_return=count($cols_return);
 
                                while ($this->db->next_record())
@@ -672,7 +687,7 @@
                                {
                                        $this->db->query("{$sql} WHERE 
fm_project.id = '{$project['project_id']}' {$group_method}");
                                        $this->db->next_record();
-
+//_debug_array("{$sql} WHERE fm_project.id = '{$project['project_id']}' 
{$group_method}");
                                        for ($i=0;$i<$count_cols_return;$i++)
                                        {
                                                $project[$cols_return[$i]] = 
$this->db->f($cols_return[$i]);
@@ -694,7 +709,7 @@
                                        $project['billable_hours']      = 0;
 
                                }
-
+//_debug_array($project_list);
                                unset($project);
 
                                $_datatype = array();
@@ -728,37 +743,32 @@
                                        $project['obligation'] = 0;
                                        $project['actual_cost'] = 0;
 
-                                       $budget = 
$this->get_budget($project['project_id']);
-                                       foreach($budget as $entry)
+                                       if($project['project_type_id'] == 
3)//buffer
                                        {
-                                               if($entry['active'])
+                                               $buffer_budget = 
$this->get_buffer_budget($project['project_id']);
+
+                                               foreach($buffer_budget as 
$entry)
                                                {
-                                                       $project['actual_cost'] 
+= $entry['actual_cost'];
-                                               }
+                                                       $project['budget']      
                += $entry['amount_in'];
+                                                       $project['budget']      
                -= $entry['amount_out'];
 
-                                               if ($filter_year && 
$filter_year != 'all')
-                                               {
-                                                       if($entry['year'] == 
$filter_year)
-                                                       {
-                                                               
$project['combined_cost'] += $entry['sum_orders'];
-                                                               
$project['budget'] += $entry['budget'];
-                                                               
$project['obligation']  += $entry['sum_oblications'];
-                                                       }
                                                }
-                                               else 
+                                               unset($entry);
+                                       }
+                                       else
+                                       {
+                                               $workorder_data = 
$this->project_workorder_data(array('project_id' => $project['project_id'], 
'year' => (int)$filter_year));
+                                               foreach($workorder_data as 
$entry)
                                                {
-                                                       if($entry['active'])
-                                                       {
-                                                               
$project['combined_cost'] += $entry['sum_orders'];
-                                                               
$project['budget'] += $entry['budget'];
-                                                               
$project['obligation'] += $entry['sum_oblications'];
-                                                       }
+                                                       $project['actual_cost'] 
        += $entry['actual_cost'];
+                                                       
$project['combined_cost']       += $entry['combined_cost'];
+                                                       $project['budget']      
                += $entry['budget'];
+                                                       $project['obligation']  
        += $entry['obligation'];
                                                }
+                                               unset($entry);
+                                               $_diff_start = 
abs($project['budget']) > 0 ? $project['budget'] : $project['combined_cost'];
+                                               $project['diff'] = $_diff_start 
- $project['obligation'] - $project['actual_cost'];
                                        }
-
-                                       $_diff_start = abs($project['budget']) 
> 0 ? $project['budget'] : $project['combined_cost'];
-                                       $project['diff'] = $_diff_start - 
$project['obligation'] - $project['actual_cost'];
-
                                }
 
 //_debug_array($values);
@@ -870,7 +880,7 @@
                        $filter_year = '';
                        if($year)
                        {
-                               $filter_year = "AND fm_workorder_budget.year = 
{$year}";
+                               $filter_year = "AND (fm_workorder_budget.year = 
{$year} OR fm_workorder_status.closed IS NULL)";
                        }
 
                        $this->db->query("SELECT DISTINCT fm_workorder.id AS 
workorder_id, fm_workorder.title, fm_workorder.vendor_id, 
fm_workorder.addition,"
@@ -1451,13 +1461,11 @@
                        }
                        else // investment or operation
                        {
-
-
                                if(isset($project['transfer_amount']) && 
$project['transfer_amount'] && isset($project['transfer_target']) && 
$project['transfer_target'])
                                {
                                        $this->db->query("SELECT 
project_type_id FROM fm_project WHERE id = " . 
(int)$project['transfer_target'],__LINE__,__FILE__);
                                        $this->db->next_record();
-                                       if(!$this->db->f('project_type_id') ==3)
+                                       if($this->db->f('project_type_id') !=3)
                                        {
                                                throw new 
Exception('property_soproject::edit() - target project is not a 
buffer-project');
                                        }
@@ -2166,12 +2174,18 @@
                                        $period = $budget_entry['period'];
                                        $year = $budget_entry['year'];
 
+                                       $_found_actual_cost = false;
+                                       if(isset($project_budget[$period]))
+                                       {
+                                               
$_orders[$period]['actual_cost'] += $budget_entry['actual_cost'];
+                                               $_found_actual_cost = true;
+                                       }
+
                                        $_found = false;
                                        if(isset($project_budget[$period]) && 
!$budget_entry['closed_order'])
                                        {
 //_debug_array($_order_id);
 //_debug_array($budget_entry);
-                                               
$_orders[$period]['actual_cost'] += $budget_entry['actual_cost'];
                                                
$_orders[$period]['sum_oblications'] += $budget_entry['sum_oblications'];
                                                $_orders[$period]['sum_orders'] 
+= $budget_entry['sum_orders'];
                                                $_found = true;
@@ -2183,7 +2197,11 @@
                                                        $_period = $year . 
sprintf("%02s", $i);
                                                        
if(isset($project_budget[$_period]))
                                                        {
-                                                               
$_orders[$_period]['actual_cost'] += $budget_entry['actual_cost'];
+                                                               
if(!$_found_actual_cost)
+                                                               {
+                                                                       
$_orders[$_period]['actual_cost'] += $budget_entry['actual_cost'];
+                                                                       
$_found_actual_cost = true;
+                                                               }
                                                                
$_orders[$_period]['sum_oblications'] += $budget_entry['sum_oblications'];
                                                                
$_orders[$_period]['sum_orders'] += $budget_entry['sum_orders'];
 
@@ -2193,6 +2211,10 @@
                                                }
                                        }
 
+                                       if(!$_found_actual_cost)
+                                       {
+                                               
$_orders[$period]['actual_cost'] += $budget_entry['actual_cost'];
+                                       }
                                        if(!$_found)
                                        {
                                                
$_orders[$period]['actual_cost'] += $budget_entry['actual_cost'];
@@ -2200,7 +2222,6 @@
                                                $_orders[$period]['sum_orders'] 
+= $budget_entry['sum_orders'];
                                        }
                                }
-
                        }
                        $sort_period = array();
 //_debug_array($_orders);
@@ -2295,8 +2316,14 @@
                                $deviation = abs($entry['actual_cost']) > 0 ? 
$_deviation : 0;
                                $entry['deviation_period'] = $deviation;
                                $budget_acc +=$entry['budget'];
-                               $deviation_acc += $deviation;
+
+                               if($active_period[$entry['period']])
+                               {
+                                       $deviation_acc += $deviation;
+                               }
+
                                $entry['deviation_acc'] = abs($deviation) > 0 ? 
$deviation_acc : 0;
+
                                $entry['deviation_percent_period'] = 
$deviation/$entry['budget'] * 100;
                                $entry['deviation_percent_acc'] = 
$entry['deviation_acc']/$budget_acc * 100;
                                $entry['closed'] = 
$closed_period[$entry['period']];
@@ -2776,8 +2803,7 @@
 
                function check_request($request_id)
                {
-                       $target = 
$this->interlink->get_specific_relation('property', '.project.request', 
'.project', $request_id);
-
+                       $target = 
$this->interlink->get_specific_relation('property', '.project.request', 
'.project', $request_id, 'target');
                        if ( $target)
                        {
                                return $target[0];
@@ -2788,7 +2814,7 @@
                {
                        for ($i=0;$i<count($add_request['request_id']);$i++)
                        {
-                               
$project_id=$this->check_request($add_request['request_id'][$i]);
+                               $project_id = 
$this->check_request($add_request['request_id'][$i]);
 
                                if(!$project_id)
                                {
@@ -2803,7 +2829,7 @@
 
                                        $this->interlink->add($interlink_data);
 
-                                       $this->db->query("UPDATE fm_request SET 
project_id='$id' where id='". $add_request['request_id'][$i] . 
"'",__LINE__,__FILE__);
+                                       $this->db->query("UPDATE fm_request SET 
project_id='$id' WHERE id='". $add_request['request_id'][$i] . 
"'",__LINE__,__FILE__);
 
                                        $receipt['message'][] = 
array('msg'=>lang('request %1 has been added',$add_request['request_id'][$i]));
                                }

Modified: branches/Version-1_0-branch/property/inc/class.sorequest.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sorequest.inc.php    
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/property/inc/class.sorequest.inc.php    
2013-03-19 11:15:08 UTC (rev 11002)
@@ -206,8 +206,11 @@
                        {
                                switch($order)
                                {
+                                       case 'recommended_year':
+                                               $ordermethod = " ORDER BY 
recommended_year $sort";
+                                               break;
                                        case 'planned_year':
-                                               $ordermethod = " ORDER BY 
planned_year $sort";
+                                               $ordermethod = " ORDER BY 
start_date $sort";
                                                break;
                                        case 'url':
                                                $ordermethod = " ORDER BY 
fm_request.id $sort";
@@ -232,17 +235,20 @@
                        $sql = "SELECT DISTINCT fm_request.id as 
request_id,fm_request_status.descr as status,fm_request.building_part,"
                        . " 
fm_request.start_date,fm_request.closed_date,fm_request.in_progress_date,fm_request.category
 as cat_id,"
                        . " fm_request.delivered_date,fm_request.title as 
title,max(fm_request_condition.degree) as condition_degree,"
-                       . " sum(fm_request_planning.amount) as planned_budget, 
fm_request.amount_investment,"
-                       . " 
fm_request.amount_operation,fm_request.amount_potential_grants,fm_request.score,min(fm_request_planning.date)
 as planned_year"
-                       . " FROM (((( fm_request  LEFT JOIN fm_request_status 
ON fm_request.status = fm_request_status.id)"
-                       . " LEFT JOIN fm_request_planning ON fm_request.id = 
fm_request_planning.request_id)"
-                       . " LEFT JOIN fm_request_consume ON fm_request.id = 
fm_request_consume.request_id)"
+       //              . " sum(fm_request_planning.amount) as planned_budget,"
+                       . " fm_request.amount_investment,"
+                       . " 
fm_request.amount_operation,fm_request.amount_potential_grants,fm_request.score,"
+                       . " fm_request.recommended_year,"
+                       . " fm_request.start_date"
+                       . " FROM (( fm_request  LEFT JOIN fm_request_status ON 
fm_request.status = fm_request_status.id)"
+       //              . " LEFT JOIN fm_request_planning ON fm_request.id = 
fm_request_planning.request_id)"
+       //              . " LEFT JOIN fm_request_consume ON fm_request.id = 
fm_request_consume.request_id)"
                        . " LEFT JOIN fm_request_condition ON fm_request.id = 
fm_request_condition.request_id)"
                        . " {$filtermethod}"
                        . " GROUP BY fm_request_status.descr,"
                        . " 
building_part,fm_request.start_date,fm_request.entry_date,fm_request.closed_date,"
                        . " 
fm_request.in_progress_date,fm_request.delivered_date,title,amount_investment,amount_operation,amount_potential_grants,score,fm_request.id,fm_request_status.descr";
-
+//_debug_array($sql);
                        $sql2 = "SELECT count(*) as cnt, sum(amount_investment) 
as sum_investment, sum(amount_operation) as sum_operation, 
sum(amount_potential_grants) as sum_potential_grants FROM ({$sql}) as t";
 
                        $this->_db->query($sql2,__LINE__,__FILE__);
@@ -252,8 +258,8 @@
                        $this->sum_operation    = 
$this->_db->f('sum_operation');
                        $this->sum_potential_grants     = 
$this->_db->f('sum_potential_grants');
        
-//_debug_array($sql);
 
+
 /*
                        $sql3 = "SELECT sum(fm_request_consume.amount) as 
sum_consume  FROM {$sql_arr[1]}";
                        $this->_db->query($sql3,__LINE__,__FILE__);
@@ -286,7 +292,8 @@
                                        'amount_potential_grants'       => 
$this->_db->f('amount_potential_grants'),
                                        'planned_budget'                        
=> $this->_db->f('planned_budget'),
                                        'score'                                 
        => $this->_db->f('score'),
-                                       'planned_year'                          
=> $this->_db->f('planned_year') ? date('Y', $this->_db->f('planned_year')) : 
'',
+                                       'recommended_year'                      
=> $this->_db->f('recommended_year') ?  $this->_db->f('recommended_year') : '',
+                                       'planned_year'                          
=> $this->_db->f('start_date') ? date('Y', $this->_db->f('start_date')) : '',
                                        'cat_id'                                
        => $this->_db->f('cat_id'),
                                );
                        }
@@ -295,26 +302,27 @@
 
                function read($data)
                {
-                       $start                  = isset($data['start']) && 
$data['start'] ? (int)$data['start'] : 0;
-                       $filter                 = 
isset($data['filter'])?$data['filter']:'';
-                       $query                  = 
isset($data['query'])?$data['query']:'';
-                       $sort                   = isset($data['sort']) && 
$data['sort'] ? $data['sort'] : 'DESC';
-                       $order                  = 
isset($data['order'])?$data['order']:'';
-                       $cat_id                 = 
isset($data['cat_id'])?$data['cat_id']:0;
-                       $property_cat_id= 
isset($data['property_cat_id'])?$data['property_cat_id']:0;
-                       $status_id              = isset($data['status_id']) && 
$data['status_id'] ? $data['status_id']:'';
-                       $district_id    = isset($data['district_id']) && 
$data['district_id'] ? $data['district_id']:0;
-                       $project_id             = 
isset($data['project_id'])?$data['project_id']:'';
-                       $allrows                = 
isset($data['allrows'])?$data['allrows']:'';
-                       $list_descr             = 
isset($data['list_descr'])?$data['list_descr']:'';
-                       $dry_run                = isset($data['dry_run']) ? 
$data['dry_run'] : '';
-                       $p_num                  = isset($data['p_num']) ? 
$data['p_num'] : '';
-                       $start_date             = isset($data['start_date']) && 
$data['start_date'] ? phpgwapi_datetime::date_to_timestamp($data['start_date']) 
: 0;
-                       $end_date               = isset($data['end_date']) && 
$data['end_date'] ? phpgwapi_datetime::date_to_timestamp($data['end_date']) : 0;
-                       $building_part  = isset($data['building_part']) && 
$data['building_part'] ? (int)$data['building_part'] : 0;
-                       $degree_id              = $data['degree_id'];
-                       $attrib_filter  = $data['attrib_filter'] ? 
$data['attrib_filter'] : array();
-                       $condition_survey_id = $data['condition_survey_id'] ? 
(int) $data['condition_survey_id'] : 0;
+                       $start                                  = 
isset($data['start']) && $data['start'] ? (int)$data['start'] : 0;
+                       $filter                                 = 
isset($data['filter'])?$data['filter']:'';
+                       $query                                  = 
isset($data['query'])?$data['query']:'';
+                       $sort                                   = 
isset($data['sort']) && $data['sort'] ? $data['sort'] : 'DESC';
+                       $order                                  = 
isset($data['order'])?$data['order']:'';
+                       $cat_id                                 = 
isset($data['cat_id'])?$data['cat_id']:0;
+                       $property_cat_id                = 
isset($data['property_cat_id'])?$data['property_cat_id']:0;
+                       $status_id                              = 
isset($data['status_id']) && $data['status_id'] ? $data['status_id'] : 'open';
+                       $district_id                    = 
isset($data['district_id']) && $data['district_id'] ? $data['district_id']:0;
+                       $project_id                             = 
isset($data['project_id'])?$data['project_id']:'';
+                       $allrows                                = 
isset($data['allrows'])?$data['allrows']:'';
+                       $list_descr                             = 
isset($data['list_descr'])?$data['list_descr']:'';
+                       $dry_run                                = 
isset($data['dry_run']) ? $data['dry_run'] : '';
+                       $p_num                                  = 
isset($data['p_num']) ? $data['p_num'] : '';
+                       $start_date                             = 
isset($data['start_date']) && $data['start_date'] ? 
phpgwapi_datetime::date_to_timestamp($data['start_date']) : 0;
+                       $end_date                               = 
isset($data['end_date']) && $data['end_date'] ? 
phpgwapi_datetime::date_to_timestamp($data['end_date']) : 0;
+                       $building_part                  = 
isset($data['building_part']) && $data['building_part'] ? 
(int)$data['building_part'] : 0;
+                       $degree_id                              = 
$data['degree_id'];
+                       $attrib_filter                  = 
$data['attrib_filter'] ? $data['attrib_filter'] : array();
+                       $condition_survey_id    = $data['condition_survey_id'] 
? (int) $data['condition_survey_id'] : 0;
+                       $responsible_unit               = 
(int)$data['responsible_unit'];
 
                        $location_id = 
$GLOBALS['phpgw']->locations->get_id('property', '.project.request');
                        $attribute_table = 'phpgw_cust_attribute';
@@ -366,12 +374,12 @@
                        $cols_return[]                          = 
"in_progress_date";
                        $cols_return[]                          = 
"delivered_date";
 
-                       $cols_group[]                           = 
"{$entity_table}.start_date";
+//                     $cols_group[]                           = 
"{$entity_table}.start_date";
                        $cols_group[]                           = 
"{$entity_table}.entry_date";
                        $cols_group[]                           = 
"{$entity_table}.closed_date";
                        $cols_group[]                           = 
"{$entity_table}.in_progress_date";
                        $cols_group[]                           = 
"{$entity_table}.delivered_date";
-
+/*
                        $uicols['input_type'][]         = 'text';
                        $uicols['name'][]                       = 'start_date';
                        $uicols['descr'][]                      = lang('start 
date');
@@ -382,14 +390,14 @@
                        $uicols['formatter'][]          = '';
                        $uicols['classname'][]          = '';
                        $uicols['sortable'][]           = true;
+*/
 
-
                        $cols.= ",$entity_table.title as title";
                        $cols_return[]                          = 'title';
                        $cols_group[]                           = "title";
                        $uicols['input_type'][]         = 'text';
                        $uicols['name'][]                       = 'title';
-                       $uicols['descr'][]                      = lang('request 
description');
+                       $uicols['descr'][]                      = lang('request 
title');
                        $uicols['statustext'][]         = lang('Request title');
                        $uicols['exchange'][]           = '';
                        $uicols['align'][]                      = '';
@@ -501,9 +509,23 @@
                        $uicols['sortable'][]           = true;
 
 
-                       $cols.= ",min(fm_request_planning.date) as 
planned_year";
+                       $cols.= ",recommended_year";
+                       $cols_return[]                          = 
'recommended_year';
+                       $cols_group[]                           = 
'recommended_year';
+                       $uicols['input_type'][]         = 'text';
+                       $uicols['name'][]                       = 
'recommended_year';
+                       $uicols['descr'][]                      = 
lang('recommended year');
+                       $uicols['statustext'][]         = lang('recommended 
year');
+                       $uicols['exchange'][]           = '';
+                       $uicols['align'][]                      = '';
+                       $uicols['datatype'][]           = '';
+                       $uicols['formatter'][]          = '';
+                       $uicols['classname'][]          = '';
+                       $uicols['sortable'][]           = true;
+
+                       $cols.= ",start_date AS planned_year";
                        $cols_return[]                          = 
'planned_year';
-//                     $cols_group[]                           = 
'planned_year';
+                       $cols_group[]                           = 'start_date';
                        $uicols['input_type'][]         = 'text';
                        $uicols['name'][]                       = 
'planned_year';
                        $uicols['descr'][]                      = lang('planned 
year');
@@ -571,6 +593,13 @@
                                
'uicols'=>array(),'joinmethod'=>$joinmethod,'paranthesis'=>$paranthesis,
                                'query'=>$query,'force_location'=>true, 
'location_level' => $_location_level));
 
+
+                       for ($i=2; $i< ($_location_level +1); $i++)
+                       {
+                               $cols_group[] = "fm_location{$i}.loc{$i}_name";
+                       }
+
+
                        $cols_group[] = "{$entity_table}.id";
                        $cols_group[] = 'fm_request_status.descr';
                        $cols_group[] = "{$entity_table}.address";
@@ -689,6 +718,12 @@
                                $where= 'AND';
                        }
 
+                       if ($responsible_unit)
+                       {
+                               $filtermethod .= " $where 
fm_request.responsible_unit='$responsible_unit'";
+                               $where = 'AND';
+                       }
+
                        if($query)
                        {
                                if(stristr($query, '.') && $p_num)
@@ -741,7 +776,8 @@
 
                        $this->_db->fetchmode = 'ASSOC';
 
-                       $sql2 = "SELECT count(*) as cnt, sum(amount_investment) 
as sum_investment, sum(amount_operation) as sum_operation, 
sum(amount_potential_grants) as sum_potential_grants FROM ({$sql}) as t";
+//                     $sql2 = "SELECT count(*) as cnt, sum(amount_investment) 
as sum_investment, sum(amount_operation) as sum_operation, 
sum(amount_potential_grants) as sum_potential_grants FROM ({$sql}) as t";
+                       $sql2 = "SELECT count(*) as cnt, sum(amount_investment) 
as sum_investment, sum(amount_operation) as sum_operation, 
sum(amount_potential_grants) as sum_potential_grants FROM {$sql_arr[1]}";
 
                        $this->_db->query($sql2,__LINE__,__FILE__);
                        $this->_db->next_record();
@@ -828,6 +864,7 @@
                                $amount_operation                       =  
$this->_db->f('amount_operation');
                                $amount_potential_grants        =  
$this->_db->f('amount_potential_grants');
                                $budget = $amount_investment + 
$amount_operation;
+                               $recommended_year = 
$this->_db->f('recommended_year');
 
                                $request = array
                                (
@@ -844,6 +881,8 @@
                                        'tenant_id'                             
        => $this->_db->f('tenant_id'),
                                        'owner'                                 
        => $this->_db->f('owner'),
                                        'coordinator'                           
=> $this->_db->f('coordinator'),
+                                       'responsible_unit'                      
=> $this->_db->f('responsible_unit'),
+                                       'recommended_year'                      
=> $recommended_year ? $recommended_year : '',//hide '0' - which is needed for 
sorting
                                        'access'                                
        => $this->_db->f('access'),
                                        'start_date'                            
=> $this->_db->f('start_date'),
                                        'end_date'                              
        => $this->_db->f('end_date'),
@@ -991,6 +1030,8 @@
                        $value_set['end_date']                                  
= $request['end_date'];
                        $value_set['regulations']                               
= $request['regulations'] ? ',' . implode(',',$request['regulations']) . ',' : 
'';
                        $value_set['condition_survey_id']               = 
$request['condition_survey_id'];
+                       $value_set['responsible_unit']                  = 
$request['responsible_unit'];
+                       $value_set['recommended_year']                  = (int) 
$request['recommended_year'];
 
                        $cols = implode(',', array_keys($value_set));
                        $values = 
$this->_db->validate_insert(array_values($value_set));
@@ -1132,7 +1173,9 @@
                                'address'                                       
=> $address,
                                'authorities_demands'           => 
$request['authorities_demands'],
                                'building_part'                         => 
$request['building_part'],
-                               'regulations'                           => 
$request['regulations'] ? ',' . implode(',',$request['regulations']) . ',' : ''
+                               'regulations'                           => 
$request['regulations'] ? ',' . implode(',',$request['regulations']) . ',' : '',
+                               'responsible_unit'                      => 
$request['responsible_unit'],
+                               'recommended_year'                      => 
(int) $request['recommended_year'],
                        );
 
                        while (is_array($request['location']) && 
list($input_name,$value) = each($request['location']))

Modified: branches/Version-1_0-branch/property/inc/class.soworkorder.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soworkorder.inc.php  
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/property/inc/class.soworkorder.inc.php  
2013-03-19 11:15:08 UTC (rev 11002)
@@ -305,8 +305,8 @@
                                $uicols['classname'][]          = 'rightClasss';
                                $uicols['sortable'][]           = false;
 
-                               $cols .= ',fm_workorder.combined_cost';
-                               $cols_return[] = 'combined_cost';
+//                             $cols .= ',fm_workorder.combined_cost';
+//                             $cols_return[] = 'combined_cost';
                                $uicols['input_type'][]         = 'text';
                                $uicols['name'][]                       = 
'obligation';
                                $uicols['descr'][]                      = 
lang('sum orders');
@@ -408,7 +408,7 @@
 
                                $sql    = 
$this->bocommon->generate_sql(array('entity_table'=>$entity_table,'location_table'=>$location_table,'cols'=>$cols,'cols_return'=>$cols_return,
                                        
'uicols'=>$uicols,'joinmethod'=>$joinmethod,'paranthesis'=>$paranthesis,'query'=>$query,
-                                       'force_location'=>true, 'no_address' => 
$no_address));
+                                       'force_location'=>true, 'no_address' => 
$no_address,'location_level' => 2));
 
                                
$this->bocommon->fm_cache('sql_workorder'.!!$search_vendor . '_' . 
!!$wo_hour_cat_id . '_' . !!$b_group,$sql);
 
@@ -619,7 +619,7 @@
                        if ($filter_year && $filter_year != 'all')
                        {
                                $filter_year = (int)$filter_year;
-                               $filtermethod .= " $where 
(fm_workorder_budget.year={$filter_year})";
+                               $filtermethod .= " $where 
(fm_workorder_budget.year={$filter_year} OR fm_workorder_status.closed IS 
NULL)";
                                $where= 'AND';
                        }
 
@@ -794,15 +794,11 @@
                                $order_budget = 
$this->get_budget($workorder['workorder_id']);
                                foreach($order_budget as $entry)
                                {
-                                       if($entry['active'])
-                                       {
-                                               $workorder['actual_cost'] += 
$entry['actual_cost'];
-                                       }
-
                                        if ($filter_year && $filter_year != 
'all')
                                        {
                                                if($entry['year'] == 
$filter_year)
                                                {
+                                                       
$workorder['actual_cost'] += $entry['actual_cost'];
                                                        
$workorder['combined_cost'] += $entry['sum_orders'];
                                                        $workorder['budget'] += 
$entry['budget'];
                                                        
$workorder['obligation']  += $entry['sum_oblications'];
@@ -810,6 +806,8 @@
                                        }
                                        else 
                                        {
+                                               $workorder['actual_cost'] += 
$entry['actual_cost'];
+
                                                if($entry['active'])
                                                {
                                                        
$workorder['combined_cost'] += $entry['sum_orders'];
@@ -1255,6 +1253,8 @@
                        $workorder['title'] = 
$this->db->db_addslashes($workorder['title']);
                        $workorder['billable_hours'] = 
(float)str_replace(',','.', $workorder['billable_hours']);
 
+                       phpgwapi_cache::system_clear('property', 
"budget_order_{$workorder['id']}");
+
                        $this->db->query("SELECT 
status,calculation,billable_hours,approved FROM fm_workorder WHERE id = 
{$workorder['id']}",__LINE__,__FILE__);
                        $this->db->next_record();
 
@@ -1682,6 +1682,13 @@
                                return array();
                        }
 
+                       $cached_info = phpgwapi_cache::system_get('property', 
"budget_order_{$order_id}");
+
+                       if($cached_info)
+                       {
+                               return $cached_info;
+                       }
+
                        $closed_period = array();
                        $active_period = array();
 
@@ -1848,11 +1855,10 @@
                        }
 
 //_debug_array($values);die();
+                       $deviation_acc = 0;
+                       $budget_acc = 0;
                        foreach ($values as &$entry)
                        {
-       //                      $entry['year'] = substr( $entry['period'], 0, 4 
);
-       //                      $month = substr( $entry['period'], 4, 2 );
-       //                      $entry['month'] = $month == '00' ? '' : $month;
                                if($active_period[$entry['period']])
                                {
                                        $_diff_start = abs($entry['budget']) > 
0 ? $entry['budget'] : $entry['sum_orders'];
@@ -1865,12 +1871,25 @@
                                $_deviation = $entry['budget'] - 
$entry['actual_cost'];
                                $deviation = abs($entry['actual_cost']) > 0 ? 
$_deviation : 0;
                                $entry['deviation_period'] = $deviation;
-                               $entry['deviation_acc'] += $deviation;
+                               $budget_acc +=$entry['budget'];
+
+                               if($active_period[$entry['period']])
+                               {
+                                       $deviation_acc += $deviation;
+                               }
+
+                               $entry['deviation_acc'] = abs($deviation) > 0 ? 
$deviation_acc : 0;
+
+
                                $entry['deviation_percent_period'] = 
$deviation/$entry['budget'] * 100;
-                               $entry['deviation_percent_acc'] = 
$entry['deviation_acc']/$entry['budget'] * 100;
+                               $entry['deviation_percent_acc'] = 
$entry['deviation_acc']/$budget_acc * 100;
+
                                $entry['closed'] = 
$closed_period[$entry['period']];
                                $entry['active'] = 
$active_period[$entry['period']];
                        }
+
+                       phpgwapi_cache::system_set('property', 
"budget_order_{$order_id}", $values);
+
                        return $values;
                }
 

Modified: 
branches/Version-1_0-branch/property/inc/class.uicondition_survey.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uicondition_survey.inc.php   
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/property/inc/class.uicondition_survey.inc.php   
2013-03-19 11:15:08 UTC (rev 11002)
@@ -400,7 +400,8 @@
                                array('key' => 
'amount_operation','label'=>lang('operation'),'sortable'=>true,'resizeable'=>true,'formatter'=>'YAHOO.portico.FormatterAmount0'),
                                array('key' => 
'amount_potential_grants','label'=>lang('potential 
grants'),'sortable'=>true,'resizeable'=>true,'formatter'=>'YAHOO.portico.FormatterAmount0'),
 //                             array('key' => 
'planned_budget','label'=>lang('planned 
budget'),'sortable'=>true,'resizeable'=>true,'formatter'=>'YAHOO.portico.FormatterAmount0'),
-                               array('key' => 
'planned_year','label'=>lang('year'),'sortable'=>true,'resizeable'=>true),
+                               array('key' => 
'recommended_year','label'=>lang('recommended 
year'),'sortable'=>true,'resizeable'=>true),
+                               array('key' => 
'planned_year','label'=>lang('planned 
year'),'sortable'=>true,'resizeable'=>true),
                                array('key' => 
'related','label'=>lang('related'),'sortable'=>false,'resizeable'=>true),
                        );
 

Modified: branches/Version-1_0-branch/property/inc/class.uientity.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uientity.inc.php     
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/property/inc/class.uientity.inc.php     
2013-03-19 11:15:08 UTC (rev 11002)
@@ -57,9 +57,10 @@
                                'attrib_history'=> true,
                                'attrib_help'   => true,
                                'print_pdf'             => true,
-                               'index'         => true,
+                               'index'                 => true,
                                'addfiles'              => true,
-                               'get_files'             => true
+                               'get_files'             => true,
+                               'add_inventory' => true
                        );
 
                function property_uientity()
@@ -2123,6 +2124,41 @@
                                                )
                                        )
                                );
+
+
+                               if($category['enable_bulk'])
+                               {
+                                       $tabs['inventory']      = array('label' 
=> lang('inventory'), 'link' => '#inventory');
+
+                                       $_inventory = $this->get_inventory($id);
+
+                                       $datavalues[3] = array
+                                       (
+                                               'name'                          
        => "3",
+                                               'values'                        
        => json_encode($_inventory),
+                                               'total_records'                 
=> count($_inventory),
+                                               'edit_action'                   
=> "''",
+                                               'is_paginator'                  
=> 1,
+                                               'footer'                        
        => 0
+                                       );
+
+       
+                                       $myColumnDefs[3] = array
+                                       (
+                                               'name'          => "3",
+                                               'values'        =>      
json_encode(array(      
+                                                               array('key' => 
'where','label'=>lang('where'),'sortable'=>false,'resizeable'=>true),
+                                                               array('key' => 
'unit','label'=>lang('unit'),'sortable'=>false,'resizeable'=>true),
+                                                               array('key' => 
'inventory','label'=>lang('count'),'sortable'=>false,'resizeable'=>true),
+                                                               array('key' => 
'bookable','label'=>lang('bookable'),'sortable'=>false,'resizeable'=>true),
+                                                               array('key' => 
'calendar','label'=>lang('calendar'),'sortable'=>false,'resizeable'=>true),
+                                                               array('key' => 
'remark','label'=>lang('remark'),'sortable'=>false,'resizeable'=>true),
+                                                       )
+                                               )
+                                       );
+                               
+                               }
+
                        }
 
                        $data = array
@@ -2130,7 +2166,8 @@
                                        'property_js'                           
        => 
json_encode($GLOBALS['phpgw_info']['server']['webserver_url']."/property/js/yahoo/property2.js"),
                                        'datatable'                             
                => $datavalues,
                                        'myColumnDefs'                          
        => $myColumnDefs,       
-//                                     'related_link'                          
        => $related_link,                       
+                                       'enable_bulk'                           
        => $category['enable_bulk'],
+                                       'value_location_id'                     
=> $GLOBALS['phpgw']->locations->get_id($this->type_app[$this->type], 
$this->acl_location),
                                        'link_pdf'                              
                => $GLOBALS['phpgw']->link('/index.php',$pdf_data),
                                        'start_project'                         
        => $category['start_project'],
                                        'lang_start_project'                    
=> lang('start project'),
@@ -2231,6 +2268,8 @@
                        
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/container/assets/skins/sam/container.css');
                        $GLOBALS['phpgw']->js->validate_file( 'yahoo', 
'entity.edit', 'property' );
 
+                       $GLOBALS['phpgw']->js->validate_file( 'tinybox2', 
'packed', 'phpgwapi' );
+                       
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/tinybox2/style.css');
 
 
                        $criteria = array
@@ -2810,4 +2849,121 @@
                        $document = $pdf->ezOutput();
                        $pdf->print_pdf($document,$entity['name'] . '_' . 
str_replace(' ','_',$GLOBALS['phpgw']->accounts->id2name($this->account)));
                }
+
+               public function get_inventory($id = 0)
+               {
+                       return $this->bo->get_inventory($id);
+               }
+
+               public function add_inventory()
+               {
+                       $location_id    = phpgw::get_var('location_id', 'int');
+                       $item_id                = phpgw::get_var('id', 'int');
+                       $system_location = 
$GLOBALS['phpgw']->locations->get_name($location_id);
+/*
+_debug_array($location_id);
+_debug_array($item_id);
+_debug_array($system_location);
+*/
+                       $this->acl_add  = 
$this->acl->check($system_location['location'], PHPGW_ACL_ADD, 
$system_location['appname']);
+
+                       if(!$this->acl_add)
+                       {
+                               echo lang('No Access');
+                               $GLOBALS['phpgw']->common->phpgw_exit();
+                       }
+
+                       $values         = phpgw::get_var('values');
+                       
+
+                       if (isset($values['save']) && $values['save'])
+                       {
+                               $values['location_id']  = $location_id;
+                               $values['item_id']              = $item_id;
+                               $insert_record                  = 
$GLOBALS['phpgw']->session->appsession('insert_record','property');
+
+                               if(is_array($insert_record_entity))
+                               {
+                                       for 
($j=0;$j<count($insert_record_entity);$j++)
+                                       {
+                                               
$insert_record['extra'][$insert_record_entity[$j]]      = 
$insert_record_entity[$j];
+                                       }
+                               }
+
+                               $values = 
$this->bocommon->collect_locationdata($values,$insert_record);
+
+                               if(!$values['location'])
+                               {
+                                       
$receipt['error'][]=array('msg'=>lang('Please select a location !'));
+                               }
+
+                               if(isset($values_attribute) && 
is_array($values_attribute))
+                               {
+                                       foreach ($values_attribute as 
$attribute )
+                                       {
+                                               if($attribute['nullable'] != 1 
&& (!$attribute['value'] && !$values['extra'][$attribute['name']]))
+                                               {
+                                                       
$receipt['error'][]=array('msg'=>lang('Please enter value for attribute %1', 
$attribute['input_text']));
+                                               }
+
+                                               if(isset($attribute['value']) 
&& $attribute['value'] && $attribute['datatype'] == 'I' && ! 
ctype_digit($attribute['value']))
+                                               {
+                                                       
$receipt['error'][]=array('msg'=>lang('Please enter integer for attribute %1', 
$attribute['input_text']));                                              
+                                               }
+                                       }
+                               }
+
+                               if(!isset($receipt['error']))
+                               {
+                                       $receipt = 
$this->bo->save_inventory($values);
+                               }
+                       }
+
+
+                       $unit_id        = $values['unit_id'];
+                       
+                       $unit_list = execMethod('property.bogeneric.get_list', 
array('type' => 'unit',  'selected' => $unit_id));
+
+                       $location_data = 
execMethod('property.bolocation.initiate_ui_location', array
+                       (
+                               'values'                => 
$values['location_data'],
+                               'type_id'               => 5,
+                               'no_link'               => false,
+                               'lookup_type'   => 'form',
+                               'tenant'                => false,
+                               'lookup_entity' => $lookup_entity,
+                               'entity_data'   => 
isset($values['p'])?$values['p']:''
+                       ));
+                       
+                       $data = array
+                       (
+                               'location_data'         => $location_data,
+                               'system_location'       => $system_location,
+                               'location_id'           => $location_id,
+                               'item_id'                       => $item_id,
+                               'unit_list'                     => 
array('options' => $unit_list),
+
+                               'value_inventory'       => $values['inventory'],
+                               'value_write_off'       => $values['write_off'],
+                               'bookable'                      => 
$values['bookable'],
+                               'value_active_from'     => 
$values['active_from'],
+                               'value_active_to'       => $values['active_to'],
+                               'value_remark'          => $values['remark'],
+                       );
+
+
+                       $GLOBALS['phpgw']->jqcal->add_listener('active_from');
+                       $GLOBALS['phpgw']->jqcal->add_listener('active_to');
+                       
$GLOBALS['phpgw']->xslttpl->add_file(array('entity','attributes_form', 
'files'));
+                       $GLOBALS['phpgw_info']['flags']['noframework'] = true;
+
+//                     $GLOBALS['phpgw']->js->validate_file( 'yahoo', 
'entity.add_inventory', 'property' );
+
+                       $function_msg   = lang('add inventory');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
$system_location['appname'] . '::' . $system_location['descr'] . '::' . 
$function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('add_inventory' => $data));
+
+
+               }
        }

Modified: branches/Version-1_0-branch/property/inc/class.uiproject.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uiproject.inc.php    
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/property/inc/class.uiproject.inc.php    
2013-03-19 11:15:08 UTC (rev 11002)
@@ -1049,9 +1049,13 @@
                                        }
                                }
 
-
-
                                $bypass = phpgw::get_var('bypass', 'bool');
+//_debug_array($_REQUEST);
+                               if ( phpgw::get_var('origin') == 
'.project.request' &&  phpgw::get_var('origin_id', 'int') && !$bypass)
+                               {
+                                       $id = phpgw::get_var('project_id', 
'int');
+                                       $add_request = array('request_id'=> 
array(phpgw::get_var('origin_id', 'int')));
+                               }
 
                                if($add_request)
                                {
@@ -1076,7 +1080,6 @@
                                        $origin                         = 
phpgw::get_var('origin');
                                        $origin_id                      = 
phpgw::get_var('origin_id', 'int');
 
-                                       //23.jun 08: This will be handled by 
the interlink code - just doing a quick hack for now...
                                        if($origin == '.ticket' && $origin_id 
&& !$values['descr'])
                                        {
                                                $boticket= 
CreateObject('property.botts');

Modified: branches/Version-1_0-branch/property/inc/class.uirequest.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uirequest.inc.php    
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/property/inc/class.uirequest.inc.php    
2013-03-19 11:15:08 UTC (rev 11002)
@@ -97,6 +97,7 @@
                        $this->p_num                            = 
$this->bo->p_num;
                        $this->condition_survey_id      = 
$this->bo->condition_survey_id;
                        $this->nonavbar                         = 
phpgw::get_var('nonavbar', 'bool');
+                       $this->responsible_unit         = 
$this->bo->responsible_unit;
 
                        if( $this->nonavbar )
                        {
@@ -124,7 +125,8 @@
                                'start_date'            => $this->start_date,
                                'end_date'                      => 
$this->end_date,
                                'property_cat_id'       => 
$this->property_cat_id,
-                               'building_part'         => $this->building_part
+                               'building_part'         => $this->building_part,
+                               'responsible_unit'      => 
$this->responsible_unit
                        );
                        $this->bo->save_sessiondata($data);
                }
@@ -261,6 +263,7 @@
                                        ."start_date:'{$this->start_date}',"
                                        ."end_date: '{$this->end_date}',"
                                        ."cat_id:'{$this->cat_id}',"
+                                       
."responsible_unit:'{$this->responsible_unit}',"
                                        
."building_part:'{$this->building_part}'";
 
                                $values_combo_box[0]  = 
$this->bocommon->select_category_list(array
@@ -299,6 +302,10 @@
                                $default_value = array 
('user_id'=>'','name'=>lang('no user'));
                                array_unshift 
($values_combo_box[5],$default_value);
 
+
+                               $responsible_unit_list  = 
$this->bocommon->select_category_list(array('type'=> 
'request_responsible_unit','selected' =>$this->responsible_unit, 'order' => 
'id', 'fields' => array('descr')));
+                               array_unshift ($responsible_unit_list,array 
('id'=>'0','name'=> lang('responsible unit')));
+
                                $_filter_buildingpart = array();
                                $filter_buildingpart = 
isset($this->bo->config->config_data['filter_buildingpart']) ? 
$this->bo->config->config_data['filter_buildingpart'] : array();
                        
@@ -331,8 +338,8 @@
                                                                'query'         
                => $this->query,
                                                                'start_date'    
        => $this->start_date,
                                                                'end_date'      
                => $this->end_date,
-                                                               'building_part' 
        => $this->building_part
-
+                                                               'building_part' 
        => $this->building_part,
+                                                               
'responsible_unit'      => $this->responsible_unit,
                                                        )
                                                ),
                                                'fields'        => array
@@ -397,27 +404,38 @@
                                                                        
'tab_index' => 6
                                                                ),
                                                                array
+                                                               (
+                                                                       'id' => 
'sel_responsible_unit',
+                                                                       'name' 
=> 'responsible_unit',
+                                                                       'value' 
=> lang('responsible unit'),
+                                                                       'type' 
=> 'select',
+                                                                       'style' 
=> 'filter',
+                                                                       
'values'        => $responsible_unit_list,
+                                                                       
'onchange'=> 'onChangeSelect("responsible_unit");',
+                                                                       
'tab_index' => 7
+                                                               ),
+                                                               array
                                                                ( //boton       
FILTER
                                                                        'id' => 
'btn_user_id',
                                                                        'name' 
=> 'filter',
                                                                        'value' 
=> lang('User'),
                                                                        'type' 
=> 'button',
                                                                        'style' 
=> 'filter',
-                                                                       
'tab_index' => 7
+                                                                       
'tab_index' => 8
                                                                ),
                                                                array
                                                                (
                                                                        'type'  
=> 'button',
                                                                        'id'    
=> 'btn_update',
                                                                        'value' 
=> lang('Update project'),
-                                                                       
'tab_index' => 15
+                                                                       
'tab_index' => 16
                                                                ),
                                                                array
                                                                (
                                                                        'type'  
=> 'button',
                                                                        'id'    
=> 'btn_export',
                                                                        'value' 
=> lang('download'),
-                                                                       
'tab_index' => 14
+                                                                       
'tab_index' => 15
                                                                ),
 
                                                                array
@@ -425,7 +443,7 @@
                                                                        'type'  
=> 'button',
                                                                        'id'    
=> 'btn_new',
                                                                        'value' 
=> lang('add'),
-                                                                       
'tab_index' => 13
+                                                                       
'tab_index' => 14
                                                                ),
                                                                array
                                                                (
@@ -453,7 +471,7 @@
                                                                                
'menuaction' => 'property.uiproject.date_search')
                                                                        
)."','','width=350,height=250')",
                                                                        'value' 
=> lang('Date search'),
-                                                                       
'tab_index' => 12
+                                                                       
'tab_index' => 13
                                                                ),
 
                                                                array
@@ -463,7 +481,7 @@
                                                                        'value' 
   => lang('search'),
                                                                        
'onkeypress' => 'return pulsar(event)',
                                                                        'type' 
=> 'button',
-                                                                       
'tab_index' => 11
+                                                                       
'tab_index' => 12
                                                                ),
                                                                array
                                                                ( //hidden 
request
@@ -480,7 +498,7 @@
                                                                        'type' 
=> 'text',
                                                                        'size'  
  => 28,
                                                                        
'onkeypress' => 'return pulsar(event)',
-                                                                       
'tab_index' => 10
+                                                                       
'tab_index' => 11
                                                                ),
                                                                array
                                                                (
@@ -491,7 +509,7 @@
                                                                        (
                                                                                
'menuaction' => 
'property.uirequest.priority_key'))."','','left=50,top=100,width=350,height=350,scrollbars=1')",
                                                                                
'value' => lang('Priority key'),
-                                                                               
'tab_index' => 9
+                                                                               
'tab_index' => 10
                                                                ),
                                                                array
                                                                (
@@ -502,7 +520,7 @@
                                                                        (
                                                                                
'menuaction' => 
'property.uirequest.columns'))."','','width=300,height=600,scrollbars=1')",
                                                                                
'value' => lang('columns'),
-                                                                               
'tab_index' => 8
+                                                                               
'tab_index' => 9
                                                                ),
                                                        ),
                                                        'hidden_value' => array
@@ -544,17 +562,17 @@
 
                                if(!$this->acl_manage)//priority_key
                                {
-                                       
unset($datatable['actions']['form'][0]['fields']['field'][17]);
+                                       
unset($datatable['actions']['form'][0]['fields']['field'][18]);
                                }
 
                                if(!$this->acl_add) //add
                                {
-                                       
unset($datatable['actions']['form'][0]['fields']['field'][9]);
+                                       
unset($datatable['actions']['form'][0]['fields']['field'][10]);
                                }
 
                                if(!$project_id) // update project
                                {
-                                       
unset($datatable['actions']['form'][0]['fields']['field'][7]);
+                                       
unset($datatable['actions']['form'][0]['fields']['field'][8]);
                                }
 
 
@@ -1697,6 +1715,7 @@
                                        'value_amount_investment'               
        => number_format($values['amount_investment'], 0, ',', ' '),
                                        'value_amount_operation'                
        => number_format($values['amount_operation'], 0, ',', ' '),
 
+                                       'loc1'                                  
                        => $values['location_data']['loc1'],
                                        'location_data2'                        
                => $location_data,
                        //              'location_type'                         
                => 'form2',
                                        'form_action'                           
                => $GLOBALS['phpgw']->link('/index.php',$link_data),
@@ -1731,6 +1750,9 @@
                                        'lang_status'                           
                => lang('Status'),
                                        'lang_status_statustext'                
        => lang('What is the current status of this request ?'),
 
+                                       'responsible_unit_list'                 
        => array('options' => 
$this->bocommon->select_category_list(array('type'=> 
'request_responsible_unit','selected' =>$values['responsible_unit'], 'order' => 
'id', 'fields' => array('descr')))),
+                                       'value_recommended_year'                
        => $values['recommended_year'],
+
                                        'branch_list'                           
                => array('options' => 
$this->boproject->select_branch_list($values['branch_id'])),
                                        'lang_branch'                           
                => lang('branch'),
                                        'lang_no_branch'                        
                => lang('Select branch'),
@@ -1841,7 +1863,6 @@
                        $tabs = array
                                (
                                        'general'               => 
array('label' => lang('general'), 'link' => '#general'),
-                                       'condition'             => 
array('label' => lang('condition'), 'link' => '#condition'),
                                        'budget'                => 
array('label' => lang('documents'), 'link' => '#documents'),
                                        'history'               => 
array('label' => lang('history'), 'link' => '#history')
                                );

Modified: branches/Version-1_0-branch/property/inc/class.uiworkorder.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uiworkorder.inc.php  
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/property/inc/class.uiworkorder.inc.php  
2013-03-19 11:15:08 UTC (rev 11002)
@@ -934,8 +934,7 @@
 
                                        $values['location_data'] = 
$ticket['location_data'];
                                }
-
-                               if ( preg_match("/(^.entity.|^.catch.)/i", 
$origin) && $origin_id )
+                               else if ( preg_match("/(^.entity.|^.catch.)/i", 
$origin) && $origin_id )
                                {
                                        $_origin = explode('.', $origin);
                                        $_boentity= 
CreateObject('property.boentity', false, $_origin[1], $_origin[2], $_origin[3]);
@@ -945,6 +944,17 @@
                                        unset($_boentity);
                                        unset($_entity);
                                }
+                               else if ( $origin == '.project.request' && 
$origin_id )
+                               {
+                                       $_borequest     = 
CreateObject('property.borequest', false);
+                                       $_request = 
$_borequest->read_single($origin_id, array(),true);
+                                       $values['descr'] = $_request['descr'];
+                                       $values['title'] = $_request['title'];
+                                       $values['location_data'] = 
$_request['location_data'];
+                                       unset($_origin);
+                                       unset($_borequest);
+                                       unset($_request);
+                               }
 
                                if(isset($values['origin']) && 
$values['origin'])
                                {
@@ -1284,6 +1294,26 @@
                                        }
                                }
 
+
+                               if( phpgw::get_var('send_workorder', 'bool') && 
!$receipt['error'])
+                               {
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array(
+                                               'menuaction'    
=>'property.uiwo_hour.view',
+                                               'workorder_id'  => $id,
+                                               'from'                  
=>'index'
+                                               )
+                                       );
+                               }
+
+                               if( phpgw::get_var('calculate_workorder', 
'bool') && !$receipt['error'])
+                               {
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array(
+                                               'menuaction'    
=>'property.uiwo_hour.index',
+                                               'workorder_id'  => $id,
+                                               )
+                                       );
+                               }
+
                                if( phpgw::get_var('phpgw_return_as') == 'json' 
)
                                {
 
@@ -1945,11 +1975,10 @@
                                'value_origin'                                  
                => isset($values['origin']) ? $values['origin'] : '',
                                'value_origin_type'                             
                => isset($origin)?$origin:'',
                                'value_origin_id'                               
                => isset($origin_id)?$origin_id:'',
-                               'calculate_action'                              
                => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiwo_hour.index')),
+
                                'lang_calculate'                                
                => lang('Calculate Workorder'),
                                'lang_calculate_statustext'                     
        => lang('Calculate workorder by adding items from vendors prizebook or 
adding general hours'),
 
-                               'send_action'                                   
                => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'property.uiwo_hour.view',
 'from'=>'index')),
                                'lang_send'                                     
                        => $this->bo->order_sent_adress ? lang('ReSend 
Workorder') :lang('Send Workorder'),
                                'lang_send_statustext'                          
        => lang('send this workorder to vendor'),
 

Modified: branches/Version-1_0-branch/property/inc/hook_config.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/hook_config.inc.php        
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/property/inc/hook_config.inc.php        
2013-03-19 11:15:08 UTC (rev 11002)
@@ -352,7 +352,7 @@
                        3 => 'Combined::Investment/Operation',
                );
 
-               $cats   = CreateObject('phpgwapi.categories', -1, 'property', 
'.project');
+               $cats   = CreateObject('phpgwapi.categories', -1, 'property', 
'.project.request');
                $cats->supress_info = true;
                $values = $cats->return_sorted_array(0, false, '', '', '', 
$globals = true, '', $use_acl = false);
 
@@ -419,3 +419,31 @@
                return $out;
        }
 
+       /**
+       * Get HTML listbox with initial status that are to be set when 
condition survey are imported
+       *
+       * @param $config
+       * @return string HTML listboxes to be placed in a table
+       */
+       function condition_survey_hidden_status($config)
+       {
+               $status_entries = 
execMethod('property.sorequest.select_status_list');
+
+               $status_assigned = 
isset($config['condition_survey_hidden_status']) ? 
$config['condition_survey_hidden_status'] : array();
+
+               $out = '<option value="">' . lang('none selected') . 
'</option>' . "\n";
+               foreach ( $status_entries as $status)
+               {
+                       $selected = '';
+                       if ( $status_assigned == $status['id'])
+                       {
+                               $selected = 'selected =  "selected"';
+                       }
+
+                       $out .=  <<<HTML
+                       <option 
value='{$status['id']}'{$selected}>{$status['name']}</option>
+HTML;
+               }
+
+               return $out;
+       }

Modified: branches/Version-1_0-branch/property/js/yahoo/entity.edit.js
===================================================================
--- branches/Version-1_0-branch/property/js/yahoo/entity.edit.js        
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/property/js/yahoo/entity.edit.js        
2013-03-19 11:15:08 UTC (rev 11002)
@@ -35,7 +35,19 @@
                execute_async(myDataTable_0);
        }
 
+       this.showlightbox_add_inventory = function(location_id, id)
+       {
+               var oArgs = {menuaction:'property.uientity.add_inventory', 
location_id:location_id, id: id};
+               var sUrl = phpGWLink('index.php', oArgs);
 
+               TINY.box.show({iframe:sUrl, 
boxid:'frameless',width:750,height:450,fixed:false,maskid:'darkmask',maskopacity:40,
 mask:true, animate:true,
+               close: true
+       //      closejs:function(){closeJS_local()}
+               });
+       }
+
+
+
 YAHOO.util.Event.addListener(window, "load", function()
                {
                        var loader = new YAHOO.util.YUILoader();

Modified: branches/Version-1_0-branch/property/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/property/setup/phpgw_no.lang    2013-03-19 
11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/property/setup/phpgw_no.lang    2013-03-19 
11:15:08 UTC (rev 11002)
@@ -118,6 +118,8 @@
 add property   property        no      legg til prosjekt
 add request    property        no      Legg til behov
 add request for this project   property        no      Legg til behov til 
dette prosjektet
+add to project as order        property        no      Legg bestilling til 
prosjekt
+add to project as relation     property        no      Kople til prosjekt
 addressmasters common  no      AddresseMaster
 address        property        no      Adresse
 address not defined    property        no      Adresse er ikke definert
@@ -381,6 +383,7 @@
 periodization  property        no      Periodisering
 periodization start    property        no      Startperiode
 periodization outline  property        no      Periodiseringsfordeling
+planned year   property        no      Planlagt år
 planning       property        no      Planlagt
 planning date  property        no      Dato planlagt disponering
 planning value property        no      Beløp planlagt disponering
@@ -577,6 +580,7 @@
 do you really want to update the categories again      property        no      
vil du virkelig oppdatere kategoriene igjen
 do you want to perform this action     property        no      Vil du 
gjennomføre denne handlingen
 draft  property        no      UTKAST
+economy and progress   property        no      Økonomi og fremdrift
 edit activity  property        no      rette aktivitet
 edit agreement property        no      rette avtale
 edit agreement group   property        no      Rette avtale gruppe
@@ -847,7 +851,7 @@
 generate a project from this request   property        no      generer et 
prosjekt basert på denne anmodningen
 generate id ?  property        no      generer ID
 generate order property        no      Lag bestilling
-generate project       property        no      generer prosjekt
+generate project       property        no      Lag nytt prosjekt
 generate request       property        no      Registrer behov
 generate new project   property        no      Registrer nytt prosjekt
 get list       property        no      Hent liste
@@ -917,6 +921,8 @@
 insert the value at the start-date as a positive amount        property        
no      angi verdie ved startdatoen som en positiv verdi
 integer        property        no      heltall
 interval       property        no      intervall
+inventory      common  no      Beholdning
+add inventory  common  no      Legg til beholdning
 investment     property        no      investering
 investment added !     property        no      Investering er lagt til
 investment history     property        no      Investerings historie
@@ -1345,6 +1351,7 @@
 receipt        property        no      Kvittering
 receipt date   property        no      Kvitteringsdato
 reconciliation property        no      Avstemming
+recommended year       property        no      Anbefalt år
 record property        no      Post
 reference level        property        no      Referanse nivå
 regulations    property        no      Forskrifter
@@ -1393,6 +1400,7 @@
 responsibility property        no      Ansvar
 responsible matrix     property        no      Ansvarsmatrise
 responsibility role    property        no      Rolle for Ansvarsmatrise
+responsible unit       property        no      Ansvarlig enhet
 result property        no      Resultat
 return back to the list        property        no      Returner til oversikt
 revision       property        no      Revisjon
@@ -1964,16 +1972,17 @@
 closed date    property        no      Avsluttet dato
 cost categories        property        no      Kostnadskategori
 negative value for budget      property        no      Negativ verdi for 
kostnadsestimat
-no symptoms    property        no      Ingen Symptomer
-minor symptoms property        no      Svake Symptomer
-medium symptoms        property        no      Middels Symptomer
-serious symptoms       property        no      Kraftige Symptomer
+no symptoms    property        no      Ingen avvik
+minor symptoms property        no      Ikke vesentlig avvik
+medium symptoms        property        no      Vesentlig avvik
+serious symptoms       property        no      Stort eller vesentlig avvik
+condition not assessed property        no      Ikke udersøkt. Mulig risiko
 low probability        property        no      Liten sannsynlighet
 medium probability     property        no      Middels sannsynlighet
 modified date  property        no      Oppdatert dato
 high probability       property        no      Stor sannsynlighet
-weight property        property        no      Vekt
-risk   property        property        no      Risiko
+weight property        no      Vekt
+risk   property        no      Risiko
 elements_pr_page       property        no      Poster pr side
 shows_from     property        no      Viser
 of_total       property        no      av

Modified: branches/Version-1_0-branch/property/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/setup.inc.php    2013-03-19 
11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/property/setup/setup.inc.php    2013-03-19 
11:15:08 UTC (rev 11002)
@@ -12,7 +12,7 @@
        */
 
        $setup_info['property']['name']                 = 'property';
-       $setup_info['property']['version']              = '0.9.17.666';
+       $setup_info['property']['version']              = '0.9.17.667';
        $setup_info['property']['app_order']    = 8;
        $setup_info['property']['enable']               = 1;
        $setup_info['property']['app_group']    = 'office';

Modified: branches/Version-1_0-branch/property/setup/tables_current.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/tables_current.inc.php   
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/property/setup/tables_current.inc.php   
2013-03-19 11:15:08 UTC (rev 11002)
@@ -854,8 +854,6 @@
                        'ix' => array(),
                        'uc' => array()
                ),
-
-
                'fm_request' => array(
                        'fd' => array(
                                'id' => array('type' => 'int','precision' => 
'4','nullable' => False),
@@ -885,8 +883,10 @@
                                'status' => array('type' => 
'varchar','precision' => '10','nullable' => True),
                                'branch_id' => array('type' => 
'int','precision' => '4','nullable' => True),
                                'coordinator' => array('type' => 
'int','precision' => '4','nullable' => True),
+                               'responsible_unit' => array('type' => 
'int','precision' => '4','nullable' => True),
                                'authorities_demands' => array('type' => 
'int','precision' => '2','default' => '0','nullable' => True),
                                'score' => array('type' => 'int','precision' => 
'4','default' => '0','nullable' => True),
+                               'recommended_year' => array('type' => 
'int','precision' => '4','default' => '0','nullable' => True),
                                'start_date' => array('type' => 
'int','precision' => '8','default' => '0','nullable' => True),
                                'end_date' => array('type' => 'int','precision' 
=> '8','default' => '0','nullable' => True),
                                'building_part'=> array('type' => 
'varchar','precision' => 4,'nullable' => True),
@@ -900,6 +900,19 @@
                        'ix' => array('location_code'),
                        'uc' => array()
                ),
+
+               'fm_request_responsible_unit' => array(
+                       'fd' => array(
+                               'id' => array('type' => 'int','precision' => 
'2','nullable' => False),
+                               'name' => array('type' => 'varchar','precision' 
=> '50','nullable' => False),
+                               'descr' => array('type' => 'text','nullable' => 
True)
+                       ),
+                       'pk' => array('id'),
+                       'ix' => array(),
+                       'fk' => array(),
+                       'uc' => array()
+               ),
+
                'fm_request_condition' => array(
                        'fd' => array(
                                'request_id' => array('type' => 
'int','precision' => '4','nullable' => False),
@@ -945,6 +958,7 @@
                        'ix' => array(),
                        'uc' => array()
                ),
+
                'fm_request_planning' => array(
                        'fd' => array(
                                'id' => array('type' => 'auto','nullable' => 
False),

Modified: branches/Version-1_0-branch/property/setup/tables_update.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/tables_update.inc.php    
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/property/setup/tables_update.inc.php    
2013-03-19 11:15:08 UTC (rev 11002)
@@ -7424,3 +7424,121 @@
                }
        }
 
+       /**
+       * Update property version from 0.9.17.666 to 0.9.17.667
+       * Add recommended year
+       */
+       $test[] = '0.9.17.666';
+       function property_upgrade0_9_17_666()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_request','recommended_year',array(
+                               'type' =>       'int',
+                               'precision' => 4,
+                               'default' => '0',
+                               'nullable' => true
+                       )
+               );
+
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_request','responsible_unit',array(
+                               'type' =>       'int',
+                               'precision' => 4,
+                               'nullable' => true
+                       )
+               );
+
+               $GLOBALS['phpgw_setup']->oProc->CreateTable(
+                       'fm_request_responsible_unit',  array(
+                               'fd' => array(
+                                       'id' => array('type' => 
'int','precision' => 4,'nullable' => False),
+                                       'name' => array('type' => 
'varchar','precision' => 50,'nullable' => False),
+                                       'descr' => array('type' => 
'text','nullable' => True)
+                               ),
+                               'pk' => array('id'),
+                               'fk' => array(),
+                               'ix' => array(),
+                               'uc' => array()
+                       )
+               );
+
+               $GLOBALS['phpgw_setup']->oProc->query("SELECT DISTINCT 
fm_request.category, phpgw_categories.cat_name, 
phpgw_categories.cat_description FROM fm_request JOIN phpgw_categories ON 
fm_request.category = phpgw_categories.cat_id");
+               $request_cats = array();
+
+               while ($GLOBALS['phpgw_setup']->oProc->next_record())
+               {
+                       $request_cats[]= array
+                       (
+                               'id'                            => 
$GLOBALS['phpgw_setup']->oProc->f('category'),
+                               'cat_name'                      => 
$GLOBALS['phpgw_setup']->oProc->f('cat_name'),
+                               'cat_description'       => 
$GLOBALS['phpgw_setup']->oProc->f('cat_description'),
+                       );
+               }
+
+               $location_id    = 
$GLOBALS['phpgw']->locations->get_id('property', '.project.request');
+
+               $i = 1;
+               foreach($request_cats as $old_cat)
+               {
+                       $value_set = array
+                       (
+                               'cat_main'                      => 0,
+                               'cat_parent'            => 0,
+                               'cat_level'                     => 0,
+                               'cat_owner'                     => -1,
+                               'cat_access'            =>'public',
+                               'cat_appname'           => 'property',
+                               'cat_name'                      => 
$old_cat['cat_name'],
+                               'cat_description'       => 
$old_cat['cat_description'] ? $old_cat['cat_description'] : 
$old_cat['cat_name'],
+                               'last_mod'                      => time(),
+                               'location_id'           => $location_id
+                       );
+                       $i++;
+
+                       $cols = implode(',', array_keys($value_set));
+                       $values = 
$GLOBALS['phpgw_setup']->oProc->validate_insert(array_values($value_set));
+                       $sql = "INSERT INTO phpgw_categories ({$cols}) VALUES 
({$values})";
+                       
$GLOBALS['phpgw_setup']->oProc->query($sql,__LINE__,__FILE__);
+                       $cat_id = 
(int)$GLOBALS['phpgw_setup']->oProc->m_odb->get_last_insert_id('phpgw_categories','cat_id');
+                       $GLOBALS['phpgw_setup']->oProc->query("UPDATE 
fm_request SET category = {$cat_id} WHERE category = {$old_cat['id']}");
+                       $GLOBALS['phpgw_setup']->oProc->query("UPDATE 
phpgw_categories SET cat_main= {$cat_id} WHERE 
cat_id={$cat_id}",__LINE__,__FILE__);
+               }
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.667';
+                       return $GLOBALS['setup_info']['property']['currentver'];
+               }
+       }
+       /**
+       * Update property version from 0.9.17.667 to 0.9.17.668
+       * Add inventory for bulk items
+       */
+       $test[] = '0.9.17.667';
+       function property_upgrade0_9_17_667()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               $GLOBALS['phpgw_setup']->oProc->query("DELETE FROM fm_cache");
+
+               $GLOBALS['phpgw_setup']->oProc->CreateTable(
+                       'fm_bim_item_inventory',  array(
+                               'fd' => array(
+                                       'id' => array('type' => 
'int','precision' => 4,'nullable' => False),
+                                       'name' => array('type' => 
'varchar','precision' => 50,'nullable' => False),
+                                       'descr' => array('type' => 
'text','nullable' => True)
+                               ),
+                               'pk' => array('id'),
+                               'fk' => array(),
+                               'ix' => array(),
+                               'uc' => array()
+                       )
+               );
+
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.667';
+                       return $GLOBALS['setup_info']['property']['currentver'];
+               }
+       }

Modified: branches/Version-1_0-branch/property/templates/base/config.tpl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/config.tpl      
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/property/templates/base/config.tpl      
2013-03-19 11:15:08 UTC (rev 11002)
@@ -522,6 +522,14 @@
                </td>
        </tr>
 
+       <tr class="row_off">
+               
<td>{lang_hidden_status_that_are_to_be_set_when_condition_survey_are_imported}:</td>
+               <td>
+                       <select 
name="newsettings[condition_survey_hidden_status]">
+                               {hook_condition_survey_hidden_status}
+                       </select>
+               </td>
+       </tr>
 
                <!--
                groupnotification

Modified: branches/Version-1_0-branch/property/templates/base/css/base.css
===================================================================
--- branches/Version-1_0-branch/property/templates/base/css/base.css    
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/property/templates/base/css/base.css    
2013-03-19 11:15:08 UTC (rev 11002)
@@ -133,12 +133,17 @@
   vertical-align: middle;
 }
 fieldset {
-  margin-top: 0.5em;   
+  margin-top: 0.5em;
+  border:1px solid #1E90FF;
 }
 
 legend {
+  padding: 0.2em 0.5em;
+  border:1px solid #1E90FF;
+/*  color:#cccccc;*/
+  font-size:90%;
+  text-align:right;
   font-weight: bolder;
-  margin-bottom: 0.2em;        
 }
 
 label {
@@ -1381,4 +1386,4 @@
 
 .yui-skin-sam .autocomplete .yui-ac-content li {
     white-space: wrap;
-}
\ No newline at end of file
+}

Modified: branches/Version-1_0-branch/property/templates/base/entity.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/entity.xsl      
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/property/templates/base/entity.xsl      
2013-03-19 11:15:08 UTC (rev 11002)
@@ -7,9 +7,182 @@
                        <xsl:when test="empty">
                                <xsl:apply-templates select="empty"/>
                        </xsl:when>
+                       <xsl:when test="add_inventory">
+                               <xsl:apply-templates select="add_inventory"/>
+                       </xsl:when>
                </xsl:choose>
        </xsl:template>
 
+
+       <!-- add inventory -->
+       <xsl:template xmlns:php="http://php.net/xsl"; match="add_inventory">
+
+        <div align = 'left'>
+
+               <xsl:variable name="action_url">
+                       <xsl:value-of select="php:function('get_phpgw_link', 
'/index.php', 'menuaction:property.uientity.add_inventory')" />
+               </xsl:variable>
+
+                       <form name="form" id="form" action="{$action_url}" 
method="post">
+
+        <fieldset>
+               <legend>
+                       <xsl:value-of select="system_location/descr"/>
+                       <xsl:text>::</xsl:text>                 
+                       <xsl:value-of select="php:function('lang', 'add 
inventory')" />
+               </legend>
+
+                       <table>
+                               <tr>
+                                       <td>
+                                       <label><xsl:value-of 
select="php:function('lang', 'id')" /></label>
+                                       </td>
+                                       <td>
+                                               <xsl:value-of select="item_id"/>
+                                               <input type="hidden" 
name="location_id" value="{location_id}"/>
+                                               <input type="hidden" name="id" 
value="{item_id}"/>
+                                       </td>
+                               </tr>
+
+                               <xsl:call-template name="location_form"/>
+                               <tr>
+                                       <td>
+                                               <label 
for="unit_id"><xsl:value-of select="php:function('lang', 'unit')" /></label>
+                                       </td>
+                                       <td>
+                                               <select id = 'unit_id' 
name="values[unit_id]" class="forms">
+                                                       <xsl:apply-templates 
select="unit_list/options"/>
+                                               </select>
+                                       </td>
+                                       </tr>
+                                       <tr>
+                                       <td>
+                                               <label 
for="inventory"><xsl:value-of select="php:function('lang', 'inventory')" 
/></label>
+                                       </td>
+                                       <td>
+
+                                               <input type="text" id = 
'inventory' name="values[inventory]" value="{value_inventory}" size="12">
+                                                       <xsl:attribute 
name="title">
+                                                               <xsl:value-of 
select="lang_inventory_statustext"/>
+                                                       </xsl:attribute>
+                                               </input>
+                                       </td>
+                                       </tr>
+
+                                       <tr>
+                                       <td>
+                                               <label ><xsl:value-of 
select="php:function('lang', 'write off')" /></label>
+                                       </td>
+                                       <td>
+                                               <input type="text" 
name="values[write_off]" value="{value_write_off}" size="12">
+                                                       <xsl:attribute 
name="title">
+                                                               <xsl:value-of 
select="lang_write_off_statustext"/>
+                                                       </xsl:attribute>
+                                               </input>
+                                       </td>
+                                       </tr>
+                                       <tr>
+                                       <td>
+                                               <label><xsl:value-of 
select="php:function('lang', 'bookable')" /></label>
+                                       </td>
+                                       <td>
+                                               <input type="checkbox" 
name="values[bookable]" value="1">
+                                                       <xsl:attribute 
name="title">
+                                                               <xsl:value-of 
select="php:function('lang', 'bookable')"/>
+                                                       </xsl:attribute>
+                                                       <xsl:if test="bookable 
= '1'">
+                                                               <xsl:attribute 
name="checked">
+                                                                       
<xsl:text>checked</xsl:text>
+                                                               </xsl:attribute>
+                                                       </xsl:if>
+                                               </input>
+                                       </td>
+                                       </tr>
+                                       <tr>
+                                       <td>
+                                               <label>
+                                                       <xsl:value-of 
select="php:function('lang', 'active from')"/>
+                                               </label>
+                                       </td>
+                                       <td>
+                                               <input type="text" 
id="active_from" name="values[active_from]" size="10" 
value="{value_active_from}" readonly="readonly">
+                                                       <xsl:attribute 
name="title">
+                                                               <xsl:value-of 
select="lang_active_from_statustext"/>
+                                                       </xsl:attribute>
+                                               </input>
+                                       </td>
+                                       </tr>
+                                       <tr>
+                                       <td>
+                                       <label>
+                                               <xsl:value-of 
select="php:function('lang', 'active to')"/>
+                                       </label>
+                                       </td>
+                                       <td>
+                                               <input type="text" 
id="active_to" name="values[active_to]" size="10" value="{value_active_to}" 
readonly="readonly">
+                                                       <xsl:attribute 
name="title">
+                                                               <xsl:value-of 
select="lang_active_to_statustext"/>
+                                                       </xsl:attribute>
+                                               </input>
+                                       </td>
+                                       </tr>
+                                       <tr>
+
+                                       <td>
+                                               <label><xsl:value-of 
select="php:function('lang', 'remark')" /></label>
+                                       </td>
+                                       <td>
+                                               <textarea cols="60" rows="10" 
name="values[remark]">
+                                                       <xsl:attribute 
name="title">
+                                                               <xsl:value-of 
select="php:function('lang', 'remark')"/>
+                                                       </xsl:attribute>
+                                                       <xsl:value-of 
select="value_remark"/>
+                                               </textarea>
+                                       </td>
+                                       </tr>
+                       </table>
+                        </fieldset>
+               <table>
+                       <tr>
+                               <td valign="bottom">
+                                       <xsl:variable name="lang_save">
+                                               <xsl:value-of 
select="php:function('lang', 'save')"/>
+                                       </xsl:variable>
+                                       <input type="submit" 
name="values[save]" value="{$lang_save}">
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="php:function('lang', 'save values and exit')"/>
+                                               </xsl:attribute>
+                                       </input>
+                               </td>
+                               <td align="right" valign="bottom">
+                                       <xsl:variable name="lang_cancel">
+                                               <xsl:value-of 
select="php:function('lang', 'cancel')"/>
+                                       </xsl:variable>
+                                       <input type="submit" 
name="values[cancel]" value="{$lang_cancel}">
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="php:function('lang', 'Back to the list')"/>
+                                               </xsl:attribute>
+                                       </input>
+                               </td>
+                       </tr>
+               </table>
+
+                       </form>
+
+
+
+        </div>
+       </xsl:template>
+
+       <xsl:template match="options">
+               <option value="{id}">
+                       <xsl:if test="selected != 0">
+                               <xsl:attribute name="selected" 
value="selected"/>
+                       </xsl:if>
+                       <xsl:value-of disable-output-escaping="yes" 
select="name"/>
+               </option>
+       </xsl:template>
+
        <!-- add / edit -->
        <xsl:template xmlns:php="http://php.net/xsl"; match="edit">
                <xsl:choose>
@@ -310,6 +483,34 @@
                                                        </div>
                                                </xsl:when>
                                        </xsl:choose>
+
+                                       <xsl:choose>
+                                               <xsl:when test="enable_bulk = 
1">
+                                                       <div id="inventory">
+                                                               <table 
cellpadding="2" cellspacing="2" width="80%" align="center">
+                                                                       <tr>
+                                                                               
<td align="left" valign="top">
+                                                                               
        <xsl:value-of select="php:function('lang', 'inventory')"/>
+                                                                               
</td>
+                                                                               
<td>
+                                                                               
        <div id="datatable-container_3"/>
+                                                                               
</td>
+                                                                       </tr>
+                                                                       
<xsl:choose>
+                                                                               
<xsl:when test="value_id!='' and mode = 'edit'">
+                                                                               
        <xsl:variable name="lang_add_inventory">
+                                                                               
                <xsl:value-of select="php:function('lang', 'add inventory')"/>
+                                                                               
        </xsl:variable>
+                                                                               
        <a 
href="javascript:showlightbox_add_inventory({value_location_id},{value_id})" 
title="{$lang_add_inventory}">
+                                                                               
                <xsl:value-of select="$lang_add_inventory"/>
+                                                                               
        </a>
+                                                                               
</xsl:when>
+                                                                       
</xsl:choose>
+                                                               </table>
+                                                       </div>
+                                               </xsl:when>
+                                       </xsl:choose>
+
                                </div>
                                <xsl:choose>
                                        <xsl:when test="mode = 'edit'">

Modified: branches/Version-1_0-branch/property/templates/base/request.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/request.xsl     
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/property/templates/base/request.xsl     
2013-03-19 11:15:08 UTC (rev 11002)
@@ -136,6 +136,38 @@
                                                                        </input>
                                                                </form>
                                                        </td>
+                                               <td valign="top">
+                                                       <xsl:variable 
name="add_to_project_link">
+                                                               <xsl:value-of 
select="php:function('get_phpgw_link', '/index.php', 
'menuaction:property.uiproject.index,from:workorder,lookup:true,origin:.project.request')"
 />
+                                                       </xsl:variable>
+                                                       <form method="post" 
action="{$add_to_project_link}">
+                                                               <xsl:variable 
name="lang_add_to_project">
+                                                                       
<xsl:value-of select="php:function('lang', 'add to project as order')"/>
+                                                               </xsl:variable>
+                                                               <input 
type="hidden" name="origin_id" value="{value_request_id}"/>
+                                                               <input 
type="hidden" name="query" value="{loc1}"/>
+                                                               <input 
type="submit" name="location" value="{$lang_add_to_project}">
+                                                                       
<xsl:attribute name="title">
+                                                                               
<xsl:value-of select="php:function('lang', 'click this to add an order to an 
existing project')"/>
+                                                                       
</xsl:attribute>
+                                                               </input>
+                                                       </form>
+                                               </td>
+                                               <td valign="top">
+                                                       <xsl:variable 
name="add_to_project_link2">
+                                                               <xsl:value-of 
select="php:function('get_phpgw_link', '/index.php', 
'menuaction:property.uiproject.index,from:project,lookup:true,origin:.project.request')"
 />
+                                                       </xsl:variable>
+                                                       <form method="post" 
action="{$add_to_project_link2}">
+                                                               <input 
type="hidden" name="origin_id" value="{value_request_id}"/>
+                                                               <input 
type="hidden" name="query" value="{loc1}"/>
+                                                               <input 
type="submit" name="location" value="{php:function('lang', 'add to project as 
relation')}">
+                                                                       
<xsl:attribute name="title">
+                                                                               
<xsl:value-of select="php:function('lang', 'click this to add an order to an 
existing project')"/>
+                                                                       
</xsl:attribute>
+                                                               </input>
+                                                       </form>
+                                               </td>
+
                                                        <td>
                                                                <form 
method="post" action="{ticket_link}">
                                                                        
<xsl:variable name="lang_start_ticket">
@@ -160,10 +192,8 @@
                                <xsl:value-of disable-output-escaping="yes" 
select="tabs"/>
                                <div class="yui-content">
                                        <div id="general" class="content-wrp">
-                                               <dl class="proplist-col">
-                                                       <input type="hidden" 
name="values[origin]" value="{value_origin_type}"/>
-                                                       <input type="hidden" 
name="values[origin_id]" value="{value_origin_id}"/>
-                                                       <xsl:choose>
+ 
+                                                       <xsl:choose>
                                                                <xsl:when 
test="value_request_id!=''">
                                                                        
                                                                                
<dt><label>
@@ -184,38 +214,20 @@
                                                                                
<dd>
                                                                                
        <xsl:value-of select="value_request_id"/>
                                                                                
</dd>
-                                                                       
-                                                                               
<dt><label>
-                                                                               
        <xsl:value-of select="php:function('lang', 'entry date')"/>
-                                                                               
</label></dt>
-                                                                               
<dd>
-                                                                               
        <xsl:value-of select="value_entry_date"/>
-                                                                               
</dd>
-                                                                       
-                                                                       
-                                                                               
<dt><label>
-                                                                               
        <xsl:value-of select="php:function('lang', 'in progress date')"/>
-                                                                               
</label></dt>
-                                                                               
<dd>
-                                                                               
        <xsl:value-of select="value_in_progress_date"/>
-                                                                               
</dd>
-                                                                       
-                                                                       
-                                                                               
<dt><label>
-                                                                               
        <xsl:value-of select="php:function('lang', 'delivered date')"/>
-                                                                               
</label></dt>
-                                                                               
<dd>
-                                                                               
        <xsl:value-of select="value_delivered_date"/>
-                                                                               
</dd>
-                                                                       
-                                                                       
-                                                                               
<dt><label>
-                                                                               
        <xsl:value-of select="php:function('lang', 'closed date')"/>
-                                                                               
</label></dt>
-                                                                               
<dd>
-                                                                               
        <xsl:value-of select="value_closed_date"/>
-                                                                               
</dd>
-                                                                       
+
+                                               </xsl:when>
+                                       </xsl:choose>
+
+ <fieldset>
+  <legend>
+                       <xsl:value-of select="php:function('lang', 
'location')"/>
+  </legend>
+                                               <dl class="proplist-col">
+                                                       <input type="hidden" 
name="values[origin]" value="{value_origin_type}"/>
+                                                       <input type="hidden" 
name="values[origin_id]" value="{value_origin_id}"/>
+                                                       <xsl:choose>
+                                                               <xsl:when 
test="value_request_id!=''">
+                                                               
                                                                        
<xsl:for-each select="value_origin">
                                                                                
                                                                                
        <dt><label>
@@ -306,6 +318,54 @@
                                                                </xsl:otherwise>
                                                        </xsl:choose>
 
+                                                               <dt><label>
+                                                                       
<xsl:value-of select="php:function('lang', 'building part')"/>
+                                                               </label></dt>
+                                                               <dd>
+                                                                       <select 
name="values[building_part]">
+                                                                               
<xsl:attribute name="title">
+                                                                               
        <xsl:value-of select="php:function('lang', 'select building part')"/>
+                                                                               
</xsl:attribute>
+                                                                               
<option value="0">
+                                                                               
        <xsl:value-of select="php:function('lang', 'select building part')"/>
+                                                                               
</option>
+                                                                               
<xsl:apply-templates select="building_part_list/options"/>
+                                                                       
</select>
+                                                               </dd>
+
+                                                       <xsl:choose>
+                                                               <xsl:when 
test="suppressmeter =''">
+                                                                       
+                                                                               
<dt><label>
+                                                                               
        <xsl:value-of select="lang_power_meter"/>
+                                                                               
</label></dt>
+                                                                               
<dd>
+                                                                               
        <input type="text" name="values[power_meter]" 
value="{value_power_meter}" size="12">
+                                                                               
                <xsl:attribute name="title">
+                                                                               
                        <xsl:value-of select="lang_power_meter_statustext"/>
+                                                                               
                </xsl:attribute>
+                                                                               
        </input>
+                                                                               
</dd>
+                                                                       
+                                                               </xsl:when>
+                                                       </xsl:choose>
+
+                                               </dl>
+
+ </fieldset>
+ <fieldset>
+  <legend>
+                       <xsl:value-of select="php:function('lang', 
'description')"/>
+  </legend>
+                                               <dl class="proplist-col">
+
+                                                       <dt><label>
+                                                               <xsl:value-of 
select="php:function('lang', 'category')"/>
+                                                       </label></dt>
+                                                       <dd>
+                                                               
<xsl:call-template name="categories"/>
+                                                       </dd>
+
                                                        <xsl:variable 
name="lang_request_title">
                                                                <xsl:value-of 
select="php:function('lang', 'enter request title')"/>
                                                        </xsl:variable>
@@ -331,75 +391,187 @@
                                                                        
</textarea>
                                                                </dd>
                                                        
-                                                       
-                                                               <dt><label>
-                                                                       
<xsl:value-of select="php:function('lang', 'cost categories')"/>
-                                                               </label></dt>
-                                                               <dd>
-                                                                       
<xsl:call-template name="categories"/>
-                                                               </dd>
-                                                       
+                                               </dl>
+ </fieldset>
+ <fieldset>
+  <legend>
+                       <xsl:value-of select="php:function('lang', 
'condition')"/>
+  </legend>
+                                               <dl class="proplist-col">
+
+                                               <table>
+                                                       <xsl:apply-templates 
select="custom_attributes/attributes"/>
+                                                       <tr>
+                                                               <td colspan="2">
+                                                                       <table 
border="1" width="100%" cellpadding="2" cellspacing="2" align="center">
+                                                                               
<xsl:call-template name="table_header_importance"/>
+                                                                               
<xsl:apply-templates select="condition_list"/>
+                                                                       </table>
+                                                               </td>
+                                                       </tr>
+                                                       <tr>
+                                                               <td>
+                                                                       <br/>
+                                                               </td>
+                                                       </tr>
                                                        <xsl:choose>
-                                                               <xsl:when 
test="suppressmeter =''">
-                                                                       
-                                                                               
<dt><label>
-                                                                               
        <xsl:value-of select="lang_power_meter"/>
-                                                                               
</label></dt>
-                                                                               
<dd>
-                                                                               
        <input type="text" name="values[power_meter]" 
value="{value_power_meter}" size="12">
+                                                               <xsl:when 
test="authorities_demands/options!=''">
+                                                                       <tr>
+                                                                               
<td align="left">
+                                                                               
        <xsl:value-of select="php:function('lang', 'Authorities Demands')"/>
+                                                                               
</td>
+                                                                               
<td>
+                                                                               
        <select name="values[authorities_demands]" class="forms">
                                                                                
                <xsl:attribute name="title">
-                                                                               
                        <xsl:value-of select="lang_power_meter_statustext"/>
+                                                                               
                        <xsl:value-of select="php:function('lang', 'Is there a 
demand from the authorities to correct this condition?')"/>
+                                                                               
                        <xsl:text> + </xsl:text>
+                                                                               
                        <xsl:value-of select="value_authorities_demands"/>
                                                                                
                </xsl:attribute>
-                                                                               
        </input>
-                                                                               
</dd>
-                                                                       
+                                                                               
                <option value="0">
+                                                                               
                        <xsl:value-of select="php:function('lang', 'no 
authorities demands')"/>
+                                                                               
                </option>
+                                                                               
                <xsl:apply-templates select="authorities_demands/options"/>
+                                                                               
        </select>
+                                                                               
</td>
+                                                                       </tr>
+                                                                       <tr>
+                                                                               
<td>
+                                                                               
        <br/>
+                                                                               
</td>
+                                                                       </tr>
                                                                </xsl:when>
                                                        </xsl:choose>
+                                                       <!--
+<tr>
+<td valign='top' align="left">
+<xsl:value-of select="php:function('lang', 'regulations')" />
+</td>
+<td colspan='3'>
+<table cellpadding="2" cellspacing="2" width="50%" align="left">
+<xsl:for-each select="regulations" >
+<tr>
+<xsl:attribute name="class">
+<xsl:choose>
+<xsl:when test="@class">
+<xsl:value-of select="@class"/>
+</xsl:when>
+<xsl:when test="position() mod 2 = 0">
+<xsl:text>row_off</xsl:text>
+</xsl:when>
+<xsl:otherwise>
+<xsl:text>row_on</xsl:text>
+</xsl:otherwise>
+</xsl:choose>
+</xsl:attribute>
+<td align="left" title='{descr}'>
+<xsl:text> </xsl:text>
+<xsl:choose>
+<xsl:when test="external_ref!=''">
+<a href="{external_ref}" target="_blank"><xsl:value-of select="name"/></a>
+</xsl:when>
+<xsl:otherwise>
+<xsl:value-of select="name"/>
+</xsl:otherwise>
+</xsl:choose>
+</td>
+<td align="left">
+<input type="checkbox" name="values[regulations][]" value="{id}">
+<xsl:if test="selected = '1'">
+<xsl:attribute name="checked">
+<xsl:text>checked</xsl:text>
+</xsl:attribute>
+</xsl:if>
+<xsl:attribute name="title">
+<xsl:value-of select="descr"/>
+</xsl:attribute>
+</input>
+</td>
+</tr>
+</xsl:for-each>
+</table>
+</td>
+</tr>
+-->
+                                                       <tr>
+                                                               <td>
+                                                                       <br/>
+                                                               </td>
+                                                       </tr>
+                                               </table>
+
+<!--
+                                                               <dt>
+                                                                       <label>
+                                                                               
<xsl:value-of select="php:function('lang', 'score')"/>
+                                                                       </label>
+                                                               </dt>
+                                                               <dd>
+                                                                       
<xsl:value-of select="value_score"/>
+                                                               </dd>
+-->
+                                               </dl>
+ </fieldset>
+ <fieldset>
+  <legend>
+                       <xsl:value-of select="php:function('lang', 'economy and 
progress')"/>
+  </legend>
+
+                                               <dl class="proplist-col">       
                                
                                                        
                                                                <dt><label>
-                                                                       
<xsl:value-of select="php:function('lang', 'building part')"/>
+                                                                       
<xsl:value-of select="php:function('lang', 'status')"/>
                                                                </label></dt>
                                                                <dd>
-                                                                       <select 
name="values[building_part]">
+                                                                       <select 
name="values[status]" class="forms">
                                                                                
<xsl:attribute name="title">
-                                                                               
        <xsl:value-of select="php:function('lang', 'select building part')"/>
+                                                                               
        <xsl:value-of select="php:function('lang', 'Set the status of the 
ticket')"/>
                                                                                
</xsl:attribute>
                                                                                
<option value="0">
-                                                                               
        <xsl:value-of select="php:function('lang', 'select building part')"/>
+                                                                               
        <xsl:value-of select="php:function('lang', 'no status')"/>
                                                                                
</option>
-                                                                               
<xsl:apply-templates select="building_part_list/options"/>
+                                                                               
<xsl:apply-templates select="status_list/options"/>
                                                                        
</select>
                                                                </dd>
                                                        
-                                                       
                                                                <dt><label>
+                                                                       
<xsl:value-of select="php:function('lang', 'responsible unit')"/>
+                                                               </label></dt>
+                                                               <dd>
+                                                                       <select 
name="values[responsible_unit]" class="forms">
+                                                                               
<xsl:attribute name="title">
+                                                                               
        <xsl:value-of select="php:function('lang', 'Set responsible unit')"/>
+                                                                               
</xsl:attribute>
+                                                                               
<option value="0">
+                                                                               
        <xsl:value-of select="php:function('lang', 'select')"/>
+                                                                               
</option>
+                                                                               
<xsl:apply-templates select="responsible_unit_list/options"/>
+                                                                       
</select>
+                                                               </dd>
+
+                                                               <dt><label>
                                                                        
<xsl:value-of select="lang_coordinator"/>
                                                                </label></dt>
                                                                <dd>
                                                                        
<xsl:call-template name="user_id_select"/>
                                                                </dd>
                                                        
-                                                       
+
                                                                <dt><label>
-                                                                       
<xsl:value-of select="php:function('lang', 'status')"/>
+                                                                       
<xsl:value-of select="php:function('lang', 'recommended year')"/>
                                                                </label></dt>
                                                                <dd>
-                                                                       <select 
name="values[status]" class="forms">
+                                                                       <input 
type="text" id="recommended_year" name="values[recommended_year]" size="10" 
value="{value_recommended_year}">
                                                                                
<xsl:attribute name="title">
-                                                                               
        <xsl:value-of select="php:function('lang', 'Set the status of the 
ticket')"/>
+                                                                               
        <xsl:value-of select="php:function('lang', 'year')"/>
                                                                                
</xsl:attribute>
-                                                                               
<option value="0">
-                                                                               
        <xsl:value-of select="php:function('lang', 'no status')"/>
-                                                                               
</option>
-                                                                               
<xsl:apply-templates select="status_list/options"/>
-                                                                       
</select>
+                                                                       </input>
                                                                </dd>
-                                                       
+
                                                        <xsl:choose>
                                                                <xsl:when 
test="show_dates !=''">
                                                                        
                                                                                
<dt><label>
-                                                                               
        <xsl:value-of select="lang_start_date"/>
+                                                                               
        <xsl:value-of select="php:function('lang', 'start date')"/>
                                                                                
</label></dt>
                                                                                
<dd>
                                                                                
        <input type="text" id="values_start_date" name="values[start_date]" 
size="10" value="{value_start_date}" readonly="readonly">
@@ -408,10 +580,8 @@
                                                                                
                </xsl:attribute>
                                                                                
        </input>
                                                                                
</dd>
-                                                                       
-                                                                       
                                                                                
<dt><label>
-                                                                               
        <xsl:value-of select="lang_end_date"/>
+                                                                               
        <xsl:value-of select="php:function('lang', 'end date')"/>
                                                                                
</label></dt>
                                                                                
<dd>
                                                                                
        <input type="text" id="values_end_date" name="values[end_date]" 
size="10" value="{value_end_date}" readonly="readonly">
@@ -423,6 +593,37 @@
                                                                        
                                                                </xsl:when>
                                                        </xsl:choose>
+
+                                                                               
<dt><label>
+                                                                               
        <xsl:value-of select="php:function('lang', 'entry date')"/>
+                                                                               
</label></dt>
+                                                                               
<dd>
+                                                                               
        <xsl:value-of select="value_entry_date"/>
+                                                                               
</dd>
+<!--                                                                   
+                                                                               
<dt><label>
+                                                                               
        <xsl:value-of select="php:function('lang', 'in progress date')"/>
+                                                                               
</label></dt>
+                                                                               
<dd>
+                                                                               
        <xsl:value-of select="value_in_progress_date"/>
+                                                                               
</dd>
+                                                                       
+                                                                       
+                                                                               
<dt><label>
+                                                                               
        <xsl:value-of select="php:function('lang', 'delivered date')"/>
+                                                                               
</label></dt>
+                                                                               
<dd>
+                                                                               
        <xsl:value-of select="value_delivered_date"/>
+                                                                               
</dd>
+                                                                       
+                                                                       
+                                                                               
<dt><label>
+                                                                               
        <xsl:value-of select="php:function('lang', 'closed date')"/>
+                                                                               
</label></dt>
+                                                                               
<dd>
+                                                                               
        <xsl:value-of select="value_closed_date"/>
+                                                                               
</dd>
+-->
                                                        
                                                                <dt><label>
                                                                        
<xsl:value-of select="php:function('lang', 'investment')"/>
@@ -458,8 +659,8 @@
                                                                <dd>
                                                                        
<xsl:value-of select="value_budget"/><xsl:text> </xsl:text> [ <xsl:value-of 
select="currency"/> ]
                                                                </dd>
+<!--                                                   
                                                        
-                                                       
                                                                <dt><label>
                                                                        
<xsl:value-of select="php:function('lang', 'not allocated')"/>
                                                                </label></dt>
@@ -530,8 +731,8 @@
                                                                <dd>
                                                                        <div 
id="datatable-container_3"/>
                                                                </dd>
+-->                                                    
                                                        
-                                                       
                                                                <xsl:choose>
                                                                        
<xsl:when test="notify='yes'">
                                                                                
<dt><label>
@@ -553,116 +754,8 @@
                                                                </xsl:choose>
                                                        
                                                </dl>
+ </fieldset>
                                        </div>
-                                       <div id="condition">
-                                               <table>
-                                                       <xsl:apply-templates 
select="custom_attributes/attributes"/>
-                                                       <tr>
-                                                               <td colspan="2">
-                                                                       <table 
border="1" width="100%" cellpadding="2" cellspacing="2" align="center">
-                                                                               
<xsl:call-template name="table_header_importance"/>
-                                                                               
<xsl:apply-templates select="condition_list"/>
-                                                                       </table>
-                                                               </td>
-                                                       </tr>
-                                                       <tr>
-                                                               <td>
-                                                                       <br/>
-                                                               </td>
-                                                       </tr>
-                                                       <xsl:choose>
-                                                               <xsl:when 
test="authorities_demands/options!=''">
-                                                                       <tr>
-                                                                               
<td align="left">
-                                                                               
        <xsl:value-of select="php:function('lang', 'Authorities Demands')"/>
-                                                                               
</td>
-                                                                               
<td>
-                                                                               
        <select name="values[authorities_demands]" class="forms">
-                                                                               
                <xsl:attribute name="title">
-                                                                               
                        <xsl:value-of select="php:function('lang', 'Is there a 
demand from the authorities to correct this condition?')"/>
-                                                                               
                        <xsl:text> + </xsl:text>
-                                                                               
                        <xsl:value-of select="value_authorities_demands"/>
-                                                                               
                </xsl:attribute>
-                                                                               
                <option value="0">
-                                                                               
                        <xsl:value-of select="php:function('lang', 'no 
authorities demands')"/>
-                                                                               
                </option>
-                                                                               
                <xsl:apply-templates select="authorities_demands/options"/>
-                                                                               
        </select>
-                                                                               
</td>
-                                                                       </tr>
-                                                                       <tr>
-                                                                               
<td>
-                                                                               
        <br/>
-                                                                               
</td>
-                                                                       </tr>
-                                                               </xsl:when>
-                                                       </xsl:choose>
-                                                       <!--
-<tr>
-<td valign='top' align="left">
-<xsl:value-of select="php:function('lang', 'regulations')" />
-</td>
-<td colspan='3'>
-<table cellpadding="2" cellspacing="2" width="50%" align="left">
-<xsl:for-each select="regulations" >
-<tr>
-<xsl:attribute name="class">
-<xsl:choose>
-<xsl:when test="@class">
-<xsl:value-of select="@class"/>
-</xsl:when>
-<xsl:when test="position() mod 2 = 0">
-<xsl:text>row_off</xsl:text>
-</xsl:when>
-<xsl:otherwise>
-<xsl:text>row_on</xsl:text>
-</xsl:otherwise>
-</xsl:choose>
-</xsl:attribute>
-<td align="left" title='{descr}'>
-<xsl:text> </xsl:text>
-<xsl:choose>
-<xsl:when test="external_ref!=''">
-<a href="{external_ref}" target="_blank"><xsl:value-of select="name"/></a>
-</xsl:when>
-<xsl:otherwise>
-<xsl:value-of select="name"/>
-</xsl:otherwise>
-</xsl:choose>
-</td>
-<td align="left">
-<input type="checkbox" name="values[regulations][]" value="{id}">
-<xsl:if test="selected = '1'">
-<xsl:attribute name="checked">
-<xsl:text>checked</xsl:text>
-</xsl:attribute>
-</xsl:if>
-<xsl:attribute name="title">
-<xsl:value-of select="descr"/>
-</xsl:attribute>
-</input>
-</td>
-</tr>
-</xsl:for-each>
-</table>
-</td>
-</tr>
--->
-                                                       <tr>
-                                                               <td>
-                                                                       <br/>
-                                                               </td>
-                                                       </tr>
-                                                       <tr>
-                                                               <td 
align="left">
-                                                                       
<xsl:value-of select="lang_score"/>
-                                                               </td>
-                                                               <td>
-                                                                       
<xsl:value-of select="value_score"/>
-                                                               </td>
-                                                       </tr>
-                                               </table>
-                                       </div>
                                        <div id="documents">
                                                <table>
                                                        <xsl:choose>

Modified: branches/Version-1_0-branch/property/templates/base/tts.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/tts.xsl 2013-03-19 
11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/property/templates/base/tts.xsl 2013-03-19 
11:15:08 UTC (rev 11002)
@@ -1087,7 +1087,7 @@
                                                <xsl:value-of 
select="php:function('lang', 'done')"/>
                                        </xsl:variable>
                                        <form method="post" 
action="{$done_action}">
-                                               <input type="submit" 
name="done" value="{$lang_done}" onMouseout="window.status='';return true;">
+                                               <input type="submit" 
name="done" value="{$lang_done}">
                                                        <xsl:attribute 
name="title">
                                                                <xsl:value-of 
select="php:function('lang', 'Back to the ticket list')"/>
                                                        </xsl:attribute>
@@ -1109,7 +1109,7 @@
                                                                <xsl:variable 
name="lang_generate_request">
                                                                        
<xsl:value-of select="php:function('lang', 'Generate Request')"/>
                                                                </xsl:variable>
-                                                               <input 
type="submit" name="location" value="{$lang_generate_request}" 
onMouseout="window.status='';return true;">
+                                                               <input 
type="submit" name="location" value="{$lang_generate_request}">
                                                                        
<xsl:attribute name="title">
                                                                                
<xsl:value-of select="php:function('lang', 'click this to generate a request 
with this information')"/>
                                                                        
</xsl:attribute>
@@ -1128,7 +1128,7 @@
                                                                <xsl:variable 
name="lang_generate_project">
                                                                        
<xsl:value-of select="php:function('lang', 'generate new project')"/>
                                                                </xsl:variable>
-                                                               <input 
type="submit" name="location" value="{$lang_generate_project}" 
onMouseout="window.status='';return true;">
+                                                               <input 
type="submit" name="location" value="{$lang_generate_project}">
                                                                        
<xsl:attribute name="title">
                                                                                
<xsl:value-of select="php:function('lang', 'click this to generate a project 
with this information')"/>
                                                                        
</xsl:attribute>
@@ -1143,7 +1143,7 @@
                                                                <xsl:variable 
name="lang_add_to_project">
                                                                        
<xsl:value-of select="php:function('lang', 'add to project')"/>
                                                                </xsl:variable>
-                                                               <input 
type="submit" name="location" value="{$lang_add_to_project}" 
onMouseout="window.status='';return true;">
+                                                               <input 
type="submit" name="location" value="{$lang_add_to_project}">
                                                                        
<xsl:attribute name="title">
                                                                                
<xsl:value-of select="php:function('lang', 'click this to add an order to an 
existing project')"/>
                                                                        
</xsl:attribute>

Modified: branches/Version-1_0-branch/property/templates/base/workorder.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/workorder.xsl   
2013-03-19 11:10:55 UTC (rev 11001)
+++ branches/Version-1_0-branch/property/templates/base/workorder.xsl   
2013-03-19 11:15:08 UTC (rev 11002)
@@ -82,11 +82,13 @@
                <script type="text/javascript">
                        function calculate_workorder()
                        {
-                               document.calculate_workorder_form.submit();
+                               
document.getElementsByName("calculate_workorder")[0].value = 1;
+                               document.form.submit();
                        }
                        function send_workorder()
                        {
-                               document.send_workorder_form.submit();
+                               
document.getElementsByName("send_workorder")[0].value = 1;
+                               document.form.submit();
                        }
                        function set_tab(tab)
                        {
@@ -166,6 +168,9 @@
                        <xsl:value-of select="form_action"/>
                </xsl:variable>
                <form ENCTYPE="multipart/form-data" method="post" 
id='workorder_edit' name="form" action="{$form_action}">
+                       <input type="hidden" name="send_workorder" value=""/>
+                       <input type="hidden" name='calculate_workorder'  
value=""/>
+
                        <input type="hidden" name="tab" value=""/>
                        <div class="yui-navset" id="workorder_tabview">
                                <xsl:value-of disable-output-escaping="yes" 
select="tabs"/>
@@ -943,16 +948,6 @@
                        </tr>
                </table>
                <hr noshade="noshade" width="100%" align="center" size="1"/>
-               <xsl:choose>
-                       <xsl:when test="mode='edit'">
-                               <xsl:variable 
name="calculate_action"><xsl:value-of 
select="calculate_action"/>&amp;workorder_id=<xsl:value-of 
select="value_workorder_id"/></xsl:variable>
-                               <form method="post" 
name="calculate_workorder_form" action="{$calculate_action}">
-                               </form>
-                               <xsl:variable name="send_action"><xsl:value-of 
select="send_action"/>&amp;workorder_id=<xsl:value-of 
select="value_workorder_id"/></xsl:variable>
-                               <form method="post" name="send_workorder_form" 
action="{$send_action}">
-                               </form>
-                       </xsl:when>
-               </xsl:choose>
        </xsl:template>
 
        <!-- New template-->




reply via email to

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