fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [11265] Merge 11234:11264 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [11265] Merge 11234:11264 from trunk
Date: Tue, 13 Aug 2013 11:26:37 +0000

Revision: 11265
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11265
Author:   sigurdne
Date:     2013-08-13 11:26:34 +0000 (Tue, 13 Aug 2013)
Log Message:
-----------
Merge 11234:11264 from trunk

Modified Paths:
--------------
    
branches/Version-1_0-branch/controller/templates/base/case/create_case_message.xsl
    branches/Version-1_0-branch/frontend/inc/class.uientity.inc.php
    branches/Version-1_0-branch/index.php
    branches/Version-1_0-branch/logistic/inc/class.socommon.inc.php
    branches/Version-1_0-branch/logistic/inc/class.sorequirement.inc.php
    
branches/Version-1_0-branch/logistic/inc/class.sorequirement_resource_allocation.inc.php
    branches/Version-1_0-branch/logistic/inc/class.sorequirement_value.inc.php
    branches/Version-1_0-branch/logistic/inc/class.uiactivity.inc.php
    branches/Version-1_0-branch/logistic/inc/class.uirequirement.inc.php
    
branches/Version-1_0-branch/logistic/inc/class.uirequirement_resource_allocation.inc.php
    branches/Version-1_0-branch/logistic/index.php
    
branches/Version-1_0-branch/logistic/templates/base/activity/activity_tabs.xsl
    
branches/Version-1_0-branch/logistic/templates/base/requirement/requirement_overview.xsl
    branches/Version-1_0-branch/phpgwapi/inc/class.menu.inc.php
    branches/Version-1_0-branch/phpgwapi/inc/class.uicommon.inc.php
    branches/Version-1_0-branch/phpgwapi/inc/class.yui.inc.php
    branches/Version-1_0-branch/phpgwapi/templates/base/login.tpl
    branches/Version-1_0-branch/phpgwapi/templates/mobilefrontend/head.inc.php
    branches/Version-1_0-branch/phpgwapi/templates/mobilefrontend/head.tpl
    branches/Version-1_0-branch/phpgwapi/templates/portico/head.inc.php
    branches/Version-1_0-branch/phpgwapi/templates/portico/navbar.inc.php
    branches/Version-1_0-branch/phpgwapi/templates/portico/navbar.tpl
    branches/Version-1_0-branch/preferences/inc/hook_settings.inc.php
    branches/Version-1_0-branch/property/inc/class.soadmin_entity.inc.php
    branches/Version-1_0-branch/property/inc/class.soentity.inc.php
    branches/Version-1_0-branch/property/inc/class.uientity.inc.php
    branches/Version-1_0-branch/property/inc/class.uitts.inc.php
    branches/Version-1_0-branch/property/js/yahoo/entity.edit.js
    branches/Version-1_0-branch/property/templates/base/entity.xsl

Added Paths:
-----------
    branches/Version-1_0-branch/logistic/js/logistic/requirement_overview.js
    branches/Version-1_0-branch/phpgwapi/templates/portico/js/menu.js
    branches/Version-1_0-branch/property/js/yahoo/test.menu.js
    branches/Version-1_0-branch/property/test_menu.php

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


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

Modified: 
branches/Version-1_0-branch/controller/templates/base/case/create_case_message.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/case/create_case_message.xsl
  2013-08-13 11:21:08 UTC (rev 11264)
+++ 
branches/Version-1_0-branch/controller/templates/base/case/create_case_message.xsl
  2013-08-13 11:26:34 UTC (rev 11265)
@@ -121,7 +121,10 @@
                                        <!-- === UPLOAD FILE === -->
                                        <div class="row">
                                                <label>Filvedlegg:</label>
-                                               <input type="file" id="file" 
name="file" />
+                                               <input type="file" id="file" 
name="file" >
+                                                       <xsl:attribute 
name="accept">image/*</xsl:attribute>
+                                                       <xsl:attribute 
name="capture">camera</xsl:attribute>                                
+                                               </input>
                                        </div>
                        
                                        <h3>Velg hvilke saker meldingen 
gjelder</h3>                                    

Modified: branches/Version-1_0-branch/frontend/inc/class.uientity.inc.php
===================================================================
--- branches/Version-1_0-branch/frontend/inc/class.uientity.inc.php     
2013-08-13 11:21:08 UTC (rev 11264)
+++ branches/Version-1_0-branch/frontend/inc/class.uientity.inc.php     
2013-08-13 11:26:34 UTC (rev 11265)
@@ -347,7 +347,7 @@
                                        $i = 0;
                                        foreach ( $attrib_data as $attrib )
                                        {
-                                               if($attrib['datatype'] == 'LB' 
|| $attrib['datatype'] == 'CH' || $attrib['datatype'] == 'R')
+                                               if(($attrib['datatype'] == 'LB' 
|| $attrib['datatype'] == 'CH' || $attrib['datatype'] == 'R') && 
$attrib['choice'])
                                                {
                                                        
$datatable['actions']['form'][0]['fields']['field'][] = array
                                                        (

Modified: branches/Version-1_0-branch/index.php
===================================================================
--- branches/Version-1_0-branch/index.php       2013-08-13 11:21:08 UTC (rev 
11264)
+++ branches/Version-1_0-branch/index.php       2013-08-13 11:26:34 UTC (rev 
11265)
@@ -124,6 +124,11 @@
                }
                else
                {
+                       if(phpgw::get_var('phpgw_return_as', 'string', 'GET') 
=='noframes')
+                       {
+                               $GLOBALS['phpgw_info']['flags']['noframework'] 
= true;
+                               
$GLOBALS['phpgw_info']['flags']['headonly']=true;
+                       }
                        $GLOBALS[$class]->$method();
                }
                unset($app);

Modified: branches/Version-1_0-branch/logistic/inc/class.socommon.inc.php
===================================================================
--- branches/Version-1_0-branch/logistic/inc/class.socommon.inc.php     
2013-08-13 11:21:08 UTC (rev 11264)
+++ branches/Version-1_0-branch/logistic/inc/class.socommon.inc.php     
2013-08-13 11:26:34 UTC (rev 11265)
@@ -33,6 +33,7 @@
                protected $like;
                protected $join;
                protected $left_join;
+               protected $global_lock = false;
 
                public function __construct()
                {

Modified: branches/Version-1_0-branch/logistic/inc/class.sorequirement.inc.php
===================================================================
--- branches/Version-1_0-branch/logistic/inc/class.sorequirement.inc.php        
2013-08-13 11:21:08 UTC (rev 11264)
+++ branches/Version-1_0-branch/logistic/inc/class.sorequirement.inc.php        
2013-08-13 11:26:34 UTC (rev 11265)
@@ -94,6 +94,25 @@
                        }
                }
 
+
+               /**
+               * Called from uirequirement - where transactions are initiated
+               */
+               public function delete($id)
+               {
+                       $id = (int) $id;
+
+                       if ( !$this->db->get_transaction() )
+                       {
+                               throw new Exception('sorequirement::delete() 
really need to be part of a transaction');
+                               return false;   
+                       }
+
+                       $result = $this->db->query("DELETE FROM lg_requirement 
WHERE id={$id}", __LINE__,__FILE__);
+                       return $result; 
+               }
+
+
                protected function get_id_field_name()
                {
                        if(!$extended_info)

Modified: 
branches/Version-1_0-branch/logistic/inc/class.sorequirement_resource_allocation.inc.php
===================================================================
--- 
branches/Version-1_0-branch/logistic/inc/class.sorequirement_resource_allocation.inc.php
    2013-08-13 11:21:08 UTC (rev 11264)
+++ 
branches/Version-1_0-branch/logistic/inc/class.sorequirement_resource_allocation.inc.php
    2013-08-13 11:26:34 UTC (rev 11265)
@@ -58,7 +58,7 @@
                        (
                                'location_id'                   => 
$resource_alloc->get_location_id(),
                                'item_id'                               => 
$this->marshal($resource_alloc->get_resource_id(), 'int'),
-                               'item_inventory_id'             => 
$this->marshal($resource_alloc->get_inventory_id(), 'int'),
+                               'item_inventory_id'             => 
(int)$resource_alloc->get_inventory_id(),
                                'item_inventory_amount' => 
$this->marshal($resource_alloc->get_allocated_amount(), 'int'),
        //                      'allocation_id'                 => 0,//not 
known yet
                                'create_user'                   => 
$resource_alloc->get_create_user(),
@@ -111,15 +111,15 @@
 
                protected function update($resource_alloc)
                {
-                       $id = intval($resource_alloc->get_id());
+                       $id = (int)$resource_alloc->get_id();
                
                        $values = array(
-                               'requirement_id=' . 
$this->marshal($resource_alloc->get_requirement_id(), 'string'),
-                               'resource_id=' . 
$this->marshal($resource_alloc->get_resource_id(), 'string'),
+                               'requirement_id=' . 
$this->marshal($resource_alloc->get_requirement_id(), 'int'),
+                               'resource_id=' . 
$this->marshal($resource_alloc->get_resource_id(), 'int'),
                                'location_id=' . 
$this->marshal($resource_alloc->get_location_id(), 'int')
                        );
 
-                       $result = $this->db->query('UPDATE 
lg_requirement_resource_allocation SET ' . join(',', $values) . " WHERE 
id=$id", __LINE__,__FILE__);
+                       $result = $this->db->query('UPDATE 
lg_requirement_resource_allocation SET ' . join(',', $values) . " WHERE 
id={$id}", __LINE__,__FILE__);
 
                        $item_inventory_amount = 
(int)$resource_alloc->get_allocated_amount();
 
@@ -364,10 +364,17 @@
                public function delete_resources($requirement_id)
                {
                        
-                       echo "i delete_resources: " . $requirement_id;
-                       
-                       $this->db->transaction_begin();
+//                     echo "i delete_resources: " . $requirement_id;
 
+                       if ( $this->db->get_transaction() )
+                       {
+                               $this->global_lock = true;
+                       }
+                       else
+                       {
+                               $this->db->transaction_begin();
+                       }
+
                        $requirement_id = (int) $requirement_id;
                        $this->db->query("SELECT id FROM 
lg_requirement_resource_allocation WHERE requirement_id = 
$requirement_id",__LINE__,__FILE__);
                        $ids = array();
@@ -380,9 +387,16 @@
                        {
                                $this->db->query("DELETE FROM lg_calendar WHERE 
allocation_id = IN ( " . explode(',', $id) . ')',__LINE__,__FILE__);
                        }
-                       $this->db->query("DELETE FROM 
lg_requirement_resource_allocation WHERE requirement_id = 
$requirement_id",__LINE__,__FILE__);
 
-                       return !!$this->db->transaction_commit();
+                       $ret = $this->db->query("DELETE FROM 
lg_requirement_resource_allocation WHERE requirement_id = 
$requirement_id",__LINE__,__FILE__);
+
+
+                       if ( !$this->global_lock )
+                       {
+                               $ret = $this->db->transaction_commit();
+                       }
+
+                       return $ret;
                }
 
                public static function get_instance()

Modified: 
branches/Version-1_0-branch/logistic/inc/class.sorequirement_value.inc.php
===================================================================
--- branches/Version-1_0-branch/logistic/inc/class.sorequirement_value.inc.php  
2013-08-13 11:21:08 UTC (rev 11264)
+++ branches/Version-1_0-branch/logistic/inc/class.sorequirement_value.inc.php  
2013-08-13 11:26:34 UTC (rev 11265)
@@ -203,4 +203,4 @@
                        }
                        return self::$so;
                }
-       }
\ No newline at end of file
+       }

Modified: branches/Version-1_0-branch/logistic/inc/class.uiactivity.inc.php
===================================================================
--- branches/Version-1_0-branch/logistic/inc/class.uiactivity.inc.php   
2013-08-13 11:21:08 UTC (rev 11264)
+++ branches/Version-1_0-branch/logistic/inc/class.uiactivity.inc.php   
2013-08-13 11:26:34 UTC (rev 11265)
@@ -45,6 +45,12 @@
                private $so_requirement;
                private $so_resource_allocation;
 
+           private $read;
+           private $add;
+           private $edit;
+           private $delete;
+           private $manage;
+
                public $public_functions = array(
                        'query'                 => true,
                        'add'                   => true,
@@ -66,6 +72,13 @@
                        $this->so_resource_allocation = 
CreateObject('logistic.sorequirement_resource_allocation');
 
                        $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
"logistic::project::activity";
+
+                       $this->read    = 
$GLOBALS['phpgw']->acl->check('.activity', PHPGW_ACL_READ, 'logistic');//1 
+                       $this->add     = 
$GLOBALS['phpgw']->acl->check('.activity', PHPGW_ACL_ADD, 'logistic');//2 
+                       $this->edit    = 
$GLOBALS['phpgw']->acl->check('.activity', PHPGW_ACL_EDIT, 'logistic');//4 
+                       $this->delete  = 
$GLOBALS['phpgw']->acl->check('.activity', PHPGW_ACL_DELETE, 'logistic');//8 
+                       $this->manage  = 
$GLOBALS['phpgw']->acl->check('.activity', 16, 'logistic');//16
+
                }
 
                public function index()
@@ -301,6 +314,7 @@
                        switch ($query_type)
                        {
                                case 'children':
+                                       $num_of_objects = null;//get them all
                                        $activity_id = 
phpgw::get_var('activity_id');
                                        $filters = array('id' => $activity_id);
                                        $result_objects = 
$this->so->get($start_index, $num_of_objects, $sort_field, $sort_ascending, 
$search_for, $search_type, $filters);
@@ -329,7 +343,7 @@
                                if (isset($activity))
                                {
                                        $filters = array('activity' => 
$activity->get_id());
-                                       $requirements_for_activity = 
$this->so_requirement->get($start_index, $num_of_objects, $sort_field, 
$sort_ascending, $search_for, $search_type, $filters);
+                                       $requirements_for_activity = 
$this->so_requirement->get(0, null, null, null, null, null, $filters);
 
                                        if( count( $requirements_for_activity ) 
> 0 )
                                        {
@@ -339,7 +353,7 @@
                                                
foreach($requirements_for_activity as $requirement)
                                                {
                                                        $filters = 
array('requirement_id' => $requirement->get_id());
-                                                       $num_allocated = 
$this->so_resource_allocation->get_count($search_for, $search_type, $filters);
+                                                       $num_allocated = 
$this->so_resource_allocation->get_count(null, null, $filters);
                                                         
                                                        $num_required = 
$requirement->get_no_of_items();
 
@@ -678,20 +692,40 @@
                                                        'label' => lang('Status 
requirement'),
                                                        'sortable' => false,
                                                ),
-                                               array(
-                                                       'key' => 'alloc_link',
-                                                       'label' => 
lang('Allocate resources'),
-                                                       'sortable' => false,
-                                               ),
-                                               array(
-                                                       'key' => 
'edit_requirement_link',
-                                                       'label' => lang('Edit 
requirement'),
-                                                       'sortable' => false,
-                                               )
                                        )
                                ),
                        );
 
+
+                       if($this->add)
+                       {
+                               $data['datatable']['field'][] = array
+                               (
+                                       'key'           => 'alloc_link',
+                                       'label'         => lang('Allocate 
resources'),
+                                       'sortable'      => false,
+                               );
+                       }
+                       if($this->add)
+                       {
+                               $data['datatable']['field'][] = array
+                               (
+                                       'key'           => 
'edit_requirement_link',
+                                       'label'         => lang('Edit 
requirement'),
+                                       'sortable'      => false,
+                               );
+                       }
+
+                       if($this->delete)
+                       {
+                               $data['datatable']['field'][] = array
+                               (
+                                       'key'           => 
'delete_requirement_link',
+                                       'label'         => lang('Delete 
requirement'),
+                                       'sortable'      => false,
+                               );
+                       }
+
                        phpgwapi_yui::load_widget('datatable');
                        phpgwapi_yui::load_widget('paginator');
                        phpgwapi_jquery::load_widget('core');
@@ -704,6 +738,8 @@
                        $data['breadcrumb'] = $this->_get_breadcrumb( 
$activity_id, 'logistic.uiactivity.view_resource_allocation', 'activity_id');
 
                        self::add_javascript('logistic', 'logistic', 
'resource_allocation.js');
+                       self::add_javascript('logistic', 'logistic', 
'requirement_overview.js');
+
                        self::add_javascript('logistic', 'logistic', 
'requirement.js');
                        self::add_javascript('phpgwapi', 'tinybox2', 
'packed.js');
                        
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/tinybox2/style.css');

Modified: branches/Version-1_0-branch/logistic/inc/class.uirequirement.inc.php
===================================================================
--- branches/Version-1_0-branch/logistic/inc/class.uirequirement.inc.php        
2013-08-13 11:21:08 UTC (rev 11264)
+++ branches/Version-1_0-branch/logistic/inc/class.uirequirement.inc.php        
2013-08-13 11:26:34 UTC (rev 11265)
@@ -51,17 +51,26 @@
                private $so_resource_allocation;
                private $nonavbar;
 
-               public $public_functions = array(
-                       'query'                                                 
                        => true,
-                       'index'                                                 
                        => true,
-                       'add'                                                   
                        => true,
-                       'edit'                                                  
                        => true,
-                       'view'                                                  
                        => true,
-                       'save'                                                  
                        => true,
-                       'add_requirement_values'        => true,
-                       'view_requirement_values' => true,
-                       'save_requirement_values' => true,
-                       'get_custom_attributes'         => true
+           private $read;
+           private $add;
+           private $edit;
+           private $delete;
+           private $manage;
+
+               public $public_functions = array
+               (
+                       'query'                                                 
=> true,
+                       'index'                                                 
=> true,
+                       'add'                                                   
=> true,
+                       'edit'                                                  
=> true,
+                       'delete'                                                
=> true,
+                       'view'                                                  
=> true,
+                       'save'                                                  
=> true,
+                       'add_requirement_values'                => true,
+                       'view_requirement_values'               => true,
+                       'save_requirement_values'               => true,
+                       'get_custom_attributes'                 => true,
+                       'assign_job'                                    => true
                );
 
                public function __construct()
@@ -89,6 +98,14 @@
                        $GLOBALS['phpgw_info']['flags']['nonavbar'] = true;
                        $GLOBALS['phpgw_info']['flags']['noheader_xsl'] = true;
                        $GLOBALS['phpgw_info']['flags']['nofooter']             
= true;
+
+
+                       $this->read    = 
$GLOBALS['phpgw']->acl->check('.activity', PHPGW_ACL_READ, 'logistic');//1 
+                       $this->add     = 
$GLOBALS['phpgw']->acl->check('.activity', PHPGW_ACL_ADD, 'logistic');//2 
+                       $this->edit    = 
$GLOBALS['phpgw']->acl->check('.activity', PHPGW_ACL_EDIT, 'logistic');//4 
+                       $this->delete  = 
$GLOBALS['phpgw']->acl->check('.activity', PHPGW_ACL_DELETE, 'logistic');//8 
+                       $this->manage  = 
$GLOBALS['phpgw']->acl->check('.activity', 16, 'logistic');//16
+
                }
 
 
@@ -240,6 +257,9 @@
                                //$href = self::link(array('menuaction' => 
'logistic.uirequirement.edit', 'id' => $entry['id']));
                                $href = 
"javascript:load_requirement_edit_id({$entry['id']});";
                                $entry['edit_requirement_link'] = "<a 
class=\"btn-sm alloc\" href=\"{$href}\">Endre behov</a>";
+
+                               $href = 
"javascript:load_requirement_delete_id({$entry['id']});";
+                               $entry['delete_requirement_link'] = "<a 
class=\"btn-sm alloc\" href=\"{$href}\">Slett behov</a>";
                        }
 
                        // ... add result data
@@ -255,8 +275,7 @@
                        if (!$export)
                        {
                                //Add action column to each row in result table
-                               array_walk(
-                                                               
$result_data['results'], array($this, '_add_links'), 
"logistic.uirequirement.view");
+                               array_walk($result_data['results'], 
array($this, '_add_links'), "logistic.uirequirement.view");
                        }
                        return $this->yui_results($result_data);
                }
@@ -525,6 +544,12 @@
                                $GLOBALS['phpgw_info']['flags']['nofooter']     
        = true;
                        }
 
+                       if(!$this->read)
+                       {
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'logistic.uirequirement.view', 'id' => $requirement_id, 
'nonavbar' => $nonavbar));
+                               return false; // in case redirect fail;         
        
+                       }
+
                        if ($requirement_id)
                        {
                                $requirement = 
$this->so->get_single($requirement_id);
@@ -569,6 +594,42 @@
                                $this->edit($requirement);
                        }
                }
+
+               public function delete()
+               {
+                       if(!$this->delete)
+                       {
+                               return false;
+                       }
+
+                       $requirement_id = phpgw::get_var('id', 'int');
+                       $GLOBALS['phpgw']->db->transaction_begin();
+                       try
+                       {
+                               $this->so_requirement_value->delete_values( 
$requirement_id );
+                               
$this->so_resource_allocation->delete_resources( $requirement_id );     
+                               $this->so->delete( $requirement_id );
+                       }
+                       catch (Exception $e)
+                       {
+                               if($e)
+                               {
+                                       
$GLOBALS['phpgw']->db->transaction_abort();
+       
+                                       $GLOBALS['phpgw']->log->error(array(
+                                               'text'  => 
'uirequirement::delete() : error when trying to delete requirement: %1',
+                                               'p1'    => $e->getMessage(),
+                                               'p2'    => '',
+                                               'line'  => __LINE__,
+                                               'file'  => __FILE__
+                                       ));
+
+                               }
+
+                               return $e->getMessage();
+                       }
+                       $GLOBALS['phpgw']->db->transaction_commit();
+               }
                
                public function add_requirement_values()
                {
@@ -800,48 +861,54 @@
                                $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'logistic.uirequirement.view_requirement_values', 
'requirement_id' => $requirement_id, 'nonavbar' => $this->nonavbar));
                }               
                
-               public function get_custom_attributes($location_id, 
$activity_id){
+               public function get_custom_attributes($location_id, 
$activity_id)
+               {
+                       if($location_id == "")
+                       {
+                               $location_id = phpgw::get_var('location_id');
+                       }
 
-                               if($location_id == "")
-                               {
-                                       $location_id = 
phpgw::get_var('location_id');
-                               }
+                       if($activity_id == "")
+                       {
+                               $activity_id = phpgw::get_var('activity_id');
+                       }
 
-                               if($activity_id == "")
-                               {
-                                       $activity_id = 
phpgw::get_var('activity_id');
-                               }
+                       $activity = $this->so_activity->get_single( 
$activity_id );
+                       $project = $this->so_project->get_single( 
$activity->get_project_id() );
+                       $project_type_id = $project->get_project_type_id();
 
-                               $activity = $this->so_activity->get_single( 
$activity_id );
-                               $project = $this->so_project->get_single( 
$activity->get_project_id() );
-                               $project_type_id = 
$project->get_project_type_id();
+                       $filters = array('location_id' => $location_id, 
'project_type_id' => $project_type_id);
+                       $requirement_custom_attributes_array = 
$this->so_resource_type_requirement->get($start_index, $num_of_objects, 
$sort_field, $sort_ascending, $search_for, $search_type, $filters);
 
-                               $filters = array('location_id' => $location_id, 
'project_type_id' => $project_type_id);
-                               $requirement_custom_attributes_array = 
$this->so_resource_type_requirement->get($start_index, $num_of_objects, 
$sort_field, $sort_ascending, $search_for, $search_type, $filters);
+                       $custom = createObject('phpgwapi.custom_fields');
 
-                               $custom = 
createObject('phpgwapi.custom_fields');
+                       $attribute_requirement_array = array();
 
-                               $attribute_requirement_array = array();
+                       foreach($requirement_custom_attributes_array as 
$attribute_requirement)
+                       {
+                               $location_id = 
$attribute_requirement->get_location_id();
+                               $cust_attribute_id = 
$attribute_requirement->get_cust_attribute_id();
 
-                               foreach($requirement_custom_attributes_array as 
$attribute_requirement){
-                                       $location_id = 
$attribute_requirement->get_location_id();
-                                       $cust_attribute_id = 
$attribute_requirement->get_cust_attribute_id();
+                               $loc_arr = 
$GLOBALS['phpgw']->locations->get_name($location_id);
+                               $entity_arr = explode('.',$loc_arr['location']);
 
-                                       $loc_arr = 
$GLOBALS['phpgw']->locations->get_name($location_id);
-                                       $entity_arr = 
explode('.',$loc_arr['location']);
+                               $entity_id = $entity_arr[2];
+                               $cat_id = $entity_arr[3];
 
-                                       $entity_id = $entity_arr[2];
-                                       $cat_id = $entity_arr[3];
+                               $attrib_data = $custom->get('property', 
".entity.{$entity_id}.{$cat_id}", $cust_attribute_id);
 
-                                       $attrib_data = $custom->get('property', 
".entity.{$entity_id}.{$cat_id}", $cust_attribute_id);
+                               $attribute_requirement_array[] = $attrib_data;
+                       }
 
-                                       $attribute_requirement_array[] = 
$attrib_data;
-                               }
+                       return $attribute_requirement_array;
+               }
 
-                               return $attribute_requirement_array;
+               public function assign_job()
+               {
+               
                }
 
-               function make_tab_menu($requirement_id)
+               private function make_tab_menu($requirement_id)
                {
                        $tabs = array();
 

Modified: 
branches/Version-1_0-branch/logistic/inc/class.uirequirement_resource_allocation.inc.php
===================================================================
--- 
branches/Version-1_0-branch/logistic/inc/class.uirequirement_resource_allocation.inc.php
    2013-08-13 11:21:08 UTC (rev 11264)
+++ 
branches/Version-1_0-branch/logistic/inc/class.uirequirement_resource_allocation.inc.php
    2013-08-13 11:26:34 UTC (rev 11265)
@@ -226,6 +226,8 @@
                        }
 
                        $rows = array();
+                       $lang_delete = lang('delete');
+                       $lang_assign = lang('assign');
                        foreach ($result_objects as $result)
                        {
                                if (isset($result))
@@ -274,7 +276,13 @@
                                                                                
                                                        'id' => 
$requirement['id'],
                                                                                
                                                        'phpgw_return_as' => 
'json')
                                                                                
                                                );
-                                       $requirement['delete_link'] = "<a 
class=\"btn-sm delete\" href=\"{$delete_href}\">Slett</a>";
+
+                                       $requirement['delete_link'] = "<a 
class=\"btn-sm delete\" href=\"{$delete_href}\">{$lang_delete}</a>";
+
+                                       $assign_href = 
"javascript:load_assign_task(document.assign_task, {$requirement['id']});";
+
+                                       $requirement['assign_job'] = "<input 
name='assign_requirement' type='checkbox' 
value='{$requirement['id']}_{$requirement['location_id']}_{$requirement['resource_id']}'
 /><a class=\"btn-sm assign\" href=\"{$assign_href}\">{$lang_assign}</a>";
+
                                        $rows[] = $requirement;
                                }
                        }

Modified: branches/Version-1_0-branch/logistic/index.php
===================================================================
--- branches/Version-1_0-branch/logistic/index.php      2013-08-13 11:21:08 UTC 
(rev 11264)
+++ branches/Version-1_0-branch/logistic/index.php      2013-08-13 11:26:34 UTC 
(rev 11265)
@@ -5,8 +5,7 @@
        (
                'noheader'      => true,
                'nonavbar'      => true,
-               'currentapp'    => APP_NAME,
-               'enable_vfs_class' => True,
+               'currentapp'    => APP_NAME
        );
 
        include('../header.inc.php');
@@ -18,8 +17,6 @@
        }
        else
        {
-               $start_page = array('menuaction'=> 
APP_NAME.'.uifrontpage.index');
+               $start_page = array('menuaction'=> APP_NAME.'.uiproject.index');
        }
        $GLOBALS['phpgw']->redirect_link('/index.php',$start_page);
-       
-?>

Copied: 
branches/Version-1_0-branch/logistic/js/logistic/requirement_overview.js (from 
rev 11264, trunk/logistic/js/logistic/requirement_overview.js)
===================================================================
--- branches/Version-1_0-branch/logistic/js/logistic/requirement_overview.js    
                        (rev 0)
+++ branches/Version-1_0-branch/logistic/js/logistic/requirement_overview.js    
2013-08-13 11:26:34 UTC (rev 11265)
@@ -0,0 +1,86 @@
+       function load_requirement_edit( activity_id ){
+               var oArgs = {menuaction: 'logistic.uirequirement.edit', 
activity_id:activity_id, nonavbar: true, lean: true};
+               var requestUrl = phpGWLink('index.php', oArgs);
+
+               TINY.box.show({iframe:requestUrl, 
boxid:'frameless',width:750,height:450,fixed:false,maskid:'darkmask',maskopacity:40,
 mask:true, animate:true, close: true,closejs:function(){closeJS_local()}});
+       }
+
+       function load_requirement_edit_id( id ){
+               var oArgs = {menuaction: 'logistic.uirequirement.edit', id:id, 
nonavbar: true, lean: true};
+               var requestUrl = phpGWLink('index.php', oArgs);
+
+               TINY.box.show({iframe:requestUrl, 
boxid:'frameless',width:750,height:450,fixed:false,maskid:'darkmask',maskopacity:40,
 mask:true, animate:true, close: true,closejs:function(){closeJS_local()}});
+       }
+
+       function load_requirement_delete_id( id ){
+               confirm_msg = 'Slette behov?';
+               if(confirm(confirm_msg))
+               {
+                       var oArgs = {menuaction: 
'logistic.uirequirement.delete', id:id};
+                       var requestUrl = phpGWLink('index.php', oArgs, true);
+
+                       var callback =  {       success: function(o){
+                                                               //      var 
message_delete = o.responseText.toString().replace("\"","").replace("\"","");
+                                                                       var 
reqUrl = datatable_source;
+                                                                       
YAHOO.portico.inlineTableHelper('requirement-container', reqUrl, 
YAHOO.portico.columnDefs);
+                                                                       },
+                                                       failure: 
function(o){window.alert('failed')},
+                                                       timeout: 10000
+                                               };
+                       var request = YAHOO.util.Connect.asyncRequest('POST', 
requestUrl, callback);
+               }
+       }
+
+
+       function load_assign_task(frm, id ){
+
+               var assign_requirement = new Array();
+               var message = "";
+
+               //For each checkbox see if it has been checked, record the 
value.
+               for (i = 0; i < frm.assign_requirement.length; i++)
+               {
+                       if (!frm.assign_requirement[i].disabled)
+                       {
+                               if (frm.assign_requirement[i].checked)
+                               {
+                               
assign_requirement.push(frm.assign_requirement[i].value)
+                       }
+               }
+       }
+
+//console.log(assign_requirement);
+
+               assign_requirement = 
encodeURI(YAHOO.lang.JSON.stringify(assign_requirement));
+
+//alert(assign_requirement);
+
+               var oArgs = {menuaction: 'logistic.uirequirement.assign_job', 
id:id, assign_requirement: assign_requirement};
+               var requestUrl = phpGWLink('index.php', oArgs);
+
+
+               TINY.box.show({iframe:requestUrl, 
boxid:'frameless',width:750,height:450,fixed:false,maskid:'darkmask',maskopacity:40,
 mask:true, animate:true, close: 
true,closejs:function(){closeJS_local_allocation(id)}});
+       }
+
+
+       function closeJS_local()
+       {
+               var reqUrl = datatable_source;
+               YAHOO.portico.inlineTableHelper('requirement-container', 
reqUrl, YAHOO.portico.columnDefs);
+       }
+
+
+       function closeJS_local_allocation(requirement_id)
+       {
+
+                       
YAHOO.portico.updateinlineTableHelper('allocation-container');
+/*
+                       var oArgs = {
+                                       
menuaction:'logistic.uirequirement_resource_allocation.index',
+                                       requirement_id: requirement_id,
+                                       type: "requirement_id"
+                               };
+                               
+                               var requestUrl = phpGWLink('index.php', oArgs, 
true);
+*/
+       }

Modified: 
branches/Version-1_0-branch/logistic/templates/base/activity/activity_tabs.xsl
===================================================================
--- 
branches/Version-1_0-branch/logistic/templates/base/activity/activity_tabs.xsl  
    2013-08-13 11:21:08 UTC (rev 11264)
+++ 
branches/Version-1_0-branch/logistic/templates/base/activity/activity_tabs.xsl  
    2013-08-13 11:26:34 UTC (rev 11265)
@@ -3,10 +3,9 @@
 
 <xsl:template match="data" xmlns:php="http://php.net/xsl";>
 <div class="yui-navset yui-navset-top" id="activity-tabview">
-
+       <xsl:call-template name="yui_phpgw_i18n"/>
        <xsl:choose>
                <xsl:when test="view = 'activity_details'">
-                       <xsl:call-template name="yui_phpgw_i18n"/>
 
                        <!-- =========== HEADING ============== -->
                        <xsl:choose>

Modified: 
branches/Version-1_0-branch/logistic/templates/base/requirement/requirement_overview.xsl
===================================================================
--- 
branches/Version-1_0-branch/logistic/templates/base/requirement/requirement_overview.xsl
    2013-08-13 11:21:08 UTC (rev 11264)
+++ 
branches/Version-1_0-branch/logistic/templates/base/requirement/requirement_overview.xsl
    2013-08-13 11:26:34 UTC (rev 11265)
@@ -35,7 +35,12 @@
                        <div style="margin-bottom: 40px;" 
id="requirement-container"></div>
                                
                        <h2 style="clear:both;"><xsl:value-of 
select="php:function('lang', 'Allocated resouces')" /><span 
style="margin-left:470px;font-size:14px;">(<xsl:value-of 
select="php:function('lang', 'Click on table above to get allocations')" 
/>)</span></h2>
-                       <div id="allocation-container"></div>
+                       <form name='assign_task'>
+                               
+                               <!-- // Needed for case of only one checkbox in 
datatable-->
+                               <input type='hidden' name='assign_requirement' 
value = '0'/>
+                               <div id="allocation-container"></div>
+                       </form>
        </div>
        <xsl:call-template name="datasource-def" />
 </xsl:template>
@@ -44,26 +49,8 @@
 
        <script>
 
-       function load_requirement_edit( activity_id ){
-               var oArgs = {menuaction: 'logistic.uirequirement.edit', 
activity_id:activity_id, nonavbar: true, lean: true};
-               var requestUrl = phpGWLink('index.php', oArgs);
+       var datatable_source = '<xsl:value-of select="//datatable/source"/>';
 
-               TINY.box.show({iframe:requestUrl, 
boxid:'frameless',width:750,height:450,fixed:false,maskid:'darkmask',maskopacity:40,
 mask:true, animate:true, close: true,closejs:function(){closeJS_local()}});
-       }
-
-       function load_requirement_edit_id( id ){
-               var oArgs = {menuaction: 'logistic.uirequirement.edit', id:id, 
nonavbar: true, lean: true};
-               var requestUrl = phpGWLink('index.php', oArgs);
-
-               TINY.box.show({iframe:requestUrl, 
boxid:'frameless',width:750,height:450,fixed:false,maskid:'darkmask',maskopacity:40,
 mask:true, animate:true, close: true,closejs:function(){closeJS_local()}});
-       }
-
-       function closeJS_local()
-       {
-               var reqUrl = '<xsl:value-of select="//datatable/source"/>';
-               YAHOO.portico.inlineTableHelper('requirement-container', 
reqUrl, YAHOO.portico.columnDefs);
-       }
-
        YAHOO.util.Event.onDOMReady(function(){
         
        YAHOO.portico.columnDefs = [
@@ -104,23 +91,25 @@
                        var oArgs = {
                                        
menuaction:'logistic.uirequirement_resource_allocation.index',
                                        requirement_id: requirement_id,
-                                       type: "requirement_id",
-                                       phpgw_return_as: 'json'
+                                       type: "requirement_id"
                                };
                                
                                var requestUrl = phpGWLink('index.php', oArgs, 
true);
                        
-                               var myColumnDefs = [ 
+                               YAHOO.portico.columnDefs_allocation = [ 
                                {key:"id", label:'Id', sortable:true},
                                {key:"fm_bim_item_name", label:'Navn på 
ressurs', sortable:true},
                                {key:"resource_type_descr", 
label:'Ressurstype', sortable:true}, 
                                {key:"allocated_amount", label:'Antall', 
sortable:false},
                                {key:"location_code", label:'Lokasjonskode', 
sortable:true},
                                {key:"fm_bim_item_address", label:'Adresse', 
sortable:true},
-                               {key:"delete_link", label:'Slett bestilling', 
sortable:true}
+                               {key:"delete_link", label:'Slett bestilling', 
sortable:true},
+                               {key:"assign_job", label:'Tildel oppdrag', 
sortable:false},
+                               {key:"related", label:'Link til oppdrag', 
sortable:false},
+                               {key:"status", label:'status', sortable:true}
                            ]; 
                        
-                               
YAHOO.portico.inlineTableHelper('allocation-container', requestUrl, 
myColumnDefs);
+                               
YAHOO.portico.inlineTableHelper('allocation-container', requestUrl, 
YAHOO.portico.columnDefs_allocation);
                }
   </script>
 </xsl:template>

Modified: branches/Version-1_0-branch/phpgwapi/inc/class.menu.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.menu.inc.php 2013-08-13 
11:21:08 UTC (rev 11264)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.menu.inc.php 2013-08-13 
11:26:34 UTC (rev 11265)
@@ -33,6 +33,11 @@
         */
        class phpgwapi_menu
        {
+               var $public_functions = array
+               (
+                       'get_local_menu_ajax' => true
+               );
+               
                /**
                * Clear the user's menu so it can be regenerated cleanly
                *
@@ -364,6 +369,109 @@
                        return $menu;
                }
 
+               public function get_local_menu_ajax()
+               {
+                       $node           = phpgw::get_var('node');
+
+                       $selection = explode('|',$node);
+                       $app = $selection[0];
+
+                       if(!isset($GLOBALS['phpgw_info']['user']['apps'][$app]))
+                       {
+                               return array();
+                       }
+                       $menu = array();
+
+                       $_section = 'navigation';
+                       if($app == 'admin')
+                       {
+                               if(!isset($selection[1]))
+                               {
+
+                                       $navbar         = $this->get('navbar');
+                                       $navigation = $this->get('admin');
+
+                                       foreach ( 
$GLOBALS['phpgw_info']['user']['apps'] as $_app => $app_info )
+                                       {
+                                               if(!in_array($_app, 
array('logout', 'about', 'preferences')) && isset($navbar[$_app]))
+                                               {
+                                                       
if(isset($navigation[$_app]))
+                                                       {
+                                                               $menu[] = array
+                                                               (
+                                                                       'key'   
        => $_app,
+                                                                       
'is_leaf'       => count($navigation[$_app]) > 1 ? false : true,
+                                                                       'text'  
        => $GLOBALS['phpgw']->translation->translate($_app, array(), true),
+                                                                       'url'   
        => $GLOBALS['phpgw']->link('/index.php',
+                                                                               
                        array('menuaction' => 'admin.uiconfig.index', 'appname' 
=> $_app))
+
+                                                               );
+                                                       }
+                                               }
+                                       }
+
+                                       return $menu;                           
+                               }
+                               else
+                               {
+                                       $_section =  'admin';
+                                       $app =  $selection[1];
+                                       array_shift($selection);
+                               }
+                       }
+
+
+                       if(!$menu_gross = 
phpgwapi_cache::session_get('phpgwapi', "menu_{$app}"))
+                       {
+                               $menu_gross = 
execMethod("{$app}.menu.get_menu");
+                               phpgwapi_cache::session_set('phpgwapi', 
"menu_{$app}",$menu_gross);
+                       }
+
+                       $menu_gross = $menu_gross[$_section];
+
+                       $count_selection = count($selection);
+                       if($count_selection > 1)
+                       {
+                               for ($i=1;$i<count($selection);$i++)
+                               {
+                                       if(isset($menu_gross[$selection[$i]]))
+                                       {
+                                               $menu_gross = 
$menu_gross[$selection[$i]];
+                                       }
+                                       else if 
(isset($menu_gross['children'][$selection[$i]]))
+                                       {
+                                               $menu_gross = 
$menu_gross['children'][$selection[$i]];
+                                       }
+                                       else
+                                       {
+                                               $menu_gross = array();
+                                       }
+                               }
+                               $children = isset($menu_gross['children']) ? 
$menu_gross['children'] : array();
+                       }
+                       else
+                       {
+                               $children = $menu_gross;
+                       }
+
+                       $i=0;
+                       foreach($children as $key => $vals)
+                       {
+                               $vals['url'] = str_replace('&amp;','&', 
$vals['url']);
+                               $menu[$i] = $vals;
+                               $menu[$i]['key'] = $key;
+                               $menu[$i]['is_leaf'] = true;
+                               if(isset($menu[$i]['children']))
+                               {
+                                       $menu[$i]['is_leaf'] = false;
+                                       unset($menu[$i]['children']);
+                               }
+                               $i++;
+                       }
+
+                       return $menu;
+               }
+
                protected static function _get_sub_menu($children = array(), 
$selection=array(),$level=0)
                {
                        $level++;
@@ -371,20 +479,24 @@
                        $menu = array();
                        foreach($children as $key => $vals)
                        {
-                               $menu[] = $vals;
+                               $menu[$i] = $vals;
                                $menu[$i]['this'] = false;
+                               $menu[$i]['key'] = $key;
+                               $menu[$i]['is_leaf'] = true;
                                if($key == $selection[$level])
                                {
                                        $menu[$i]['this'] = true;
                                        if(isset($menu[$i]['children']))
                                        {
                                                $menu[$i]['children'] = 
self::_get_sub_menu($menu[$i]['children'],$selection,$level);
+                                               $menu[$i]['is_leaf'] = false;
                                        }
                                }
                                else
                                {
                                        if(isset($menu[$i]['children']))
                                        {
+                                               $menu[$i]['is_leaf'] = false;
                                                unset($menu[$i]['children']);
                                        }
                                }

Modified: branches/Version-1_0-branch/phpgwapi/inc/class.uicommon.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.uicommon.inc.php     
2013-08-13 11:21:08 UTC (rev 11264)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.uicommon.inc.php     
2013-08-13 11:26:34 UTC (rev 11265)
@@ -281,6 +281,15 @@
                        $shows_from = lang('shows from');
                        $of_total = lang('of total');
 
+                       if 
(isset($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs']) && 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] > 0)
+                       {
+                               $rows_per_page = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
+                       }
+                       else
+                       {
+                               $rows_per_page = 10;
+                       }
+
                        $data['yui_phpgw_i18n'] = array(
                                'Calendar' => array(
                                        'WEEKDAYS_SHORT' => 
json_encode($this->lang_array('Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa')),
@@ -303,7 +312,8 @@
                                        'firstPageLinkLabel' => 
json_encode("&lt;&lt; {$first}"),
                                        'lastPageLinkLabel' => 
json_encode("{$last} &gt;&gt;"),
                                        'template' => 
json_encode("{CurrentPageReport}<br/>  {FirstPageLink} {PreviousPageLink} 
{PageLinks} {NextPageLink} {LastPageLink}"),
-                                       'pageReportTemplate' => 
json_encode("{$shows_from} {startRecord} {$to} {endRecord} {$of_total} 
{totalRecords}.")
+                                       'pageReportTemplate' => 
json_encode("{$shows_from} {startRecord} {$to} {endRecord} {$of_total} 
{totalRecords}."),
+                                       'rowsPerPage'   => $rows_per_page
                                ),
                                'common' => array(
                                        'LBL_NAME' => json_encode(lang('Name')),

Modified: branches/Version-1_0-branch/phpgwapi/inc/class.yui.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.yui.inc.php  2013-08-13 
11:21:08 UTC (rev 11264)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.yui.inc.php  2013-08-13 
11:26:34 UTC (rev 11265)
@@ -75,6 +75,10 @@
                                        $load = array("calendar{$_type}");
                                        break;
 
+                               case 'cookie':
+                                       $load = array("json{$_type}", 
"cookie{$_type}");
+                                       break;
+
                                case 'colorpicker':
                                case 'colourpicker': // be nice to the speakers 
of H.M. English :)
                                        $load = array("colorpicker{$_type}");

Modified: branches/Version-1_0-branch/phpgwapi/templates/base/login.tpl
===================================================================
--- branches/Version-1_0-branch/phpgwapi/templates/base/login.tpl       
2013-08-13 11:21:08 UTC (rev 11264)
+++ branches/Version-1_0-branch/phpgwapi/templates/base/login.tpl       
2013-08-13 11:26:34 UTC (rev 11265)
@@ -25,6 +25,19 @@
        <link rel="stylesheet" href="{rounded_css}" type="text/css">
 
        {onload}
+
+       <script type="text/javascript">
+               function do_login()
+               {
+                       if(typeof(Storage)!=="undefined")
+                       {
+                               sessionStorage.cached_menu_tree_data = '';
+                               sessionStorage.cached_mapping = '';
+                       }
+                       document.login.submit();
+               }
+       </script>
+
 </head>
 
 <body>
@@ -124,7 +137,7 @@
                                                                        <div 
class="button_holder">
                                                                                
<div class="button1">
                                                                                
        <div class="next">
-                                                                               
                <a onclick="document.login.submit();">{lang_login}</a>
+                                                                               
                <a onclick="do_login();">{lang_login}</a>
                                                                                
        </div>
                                                                                
</div>
                                                                        </div>

Modified: 
branches/Version-1_0-branch/phpgwapi/templates/mobilefrontend/head.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/templates/mobilefrontend/head.inc.php  
2013-08-13 11:21:08 UTC (rev 11264)
+++ branches/Version-1_0-branch/phpgwapi/templates/mobilefrontend/head.inc.php  
2013-08-13 11:26:34 UTC (rev 11265)
@@ -70,7 +70,8 @@
                'str_base_url'  => $GLOBALS['phpgw']->link('/', array(), true),
                'webserver_url' => 
$GLOBALS['phpgw_info']['server']['webserver_url'],
                'win_on_events' => $GLOBALS['phpgw']->common->get_on_events(),
-               'current_app_header' => 
isset($GLOBALS['phpgw_info']['flags']['app_header']) && 
$GLOBALS['phpgw_info']['flags']['app_header'] ? 
$GLOBALS['phpgw_info']['flags']['app_header'] : ''
+               'current_app_header' => 
isset($GLOBALS['phpgw_info']['flags']['app_header']) && 
$GLOBALS['phpgw_info']['flags']['app_header'] ? 
$GLOBALS['phpgw_info']['flags']['app_header'] : '',
+               'current_user'  => $GLOBALS['phpgw']->accounts->get( 
$GLOBALS['phpgw_info']['user']['id'] )->__toString()
        );
 
        $tpl_vars['home_text'] = lang('home');

Modified: branches/Version-1_0-branch/phpgwapi/templates/mobilefrontend/head.tpl
===================================================================
--- branches/Version-1_0-branch/phpgwapi/templates/mobilefrontend/head.tpl      
2013-08-13 11:21:08 UTC (rev 11264)
+++ branches/Version-1_0-branch/phpgwapi/templates/mobilefrontend/head.tpl      
2013-08-13 11:26:34 UTC (rev 11265)
@@ -36,6 +36,7 @@
                                        <a href="{home_url}">{home_text}</a>
                                        <a href="{logout_url}">{logout_text}</a>
                                </div>
+                       <div id="current_user">{current_user}</div>
                                <div id="app_header">{current_app_header}</div>
                        <!--<div id="logo">     </div>
                                <div id="centerimage"></div>-->

Modified: branches/Version-1_0-branch/phpgwapi/templates/portico/head.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/templates/portico/head.inc.php 
2013-08-13 11:21:08 UTC (rev 11264)
+++ branches/Version-1_0-branch/phpgwapi/templates/portico/head.inc.php 
2013-08-13 11:26:34 UTC (rev 11265)
@@ -34,6 +34,15 @@
                $javascripts[] = "/phpgwapi/templates/portico/js/base.js";
        }
 
+       if( !$GLOBALS['phpgw_info']['flags']['noframework'] && 
!$GLOBALS['phpgw_info']['flags']['nonavbar'] )
+       {
+               
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/examples/treeview/assets/css/folders/tree.css');
+               phpgwapi_yui::load_widget('treeview');
+               phpgwapi_yui::load_widget('datasource');
+               $javascripts[] = "/phpgwapi/templates/portico/js/menu.js";
+       }
+
+
        phpgwapi_yui::load_widget('button');
 
        $stylesheets = array();

Copied: branches/Version-1_0-branch/phpgwapi/templates/portico/js/menu.js (from 
rev 11264, trunk/phpgwapi/templates/portico/js/menu.js)
===================================================================
--- branches/Version-1_0-branch/phpgwapi/templates/portico/js/menu.js           
                (rev 0)
+++ branches/Version-1_0-branch/phpgwapi/templates/portico/js/menu.js   
2013-08-13 11:26:34 UTC (rev 11265)
@@ -0,0 +1,340 @@
+//an anonymous function wraps our code to keep our variables
+//in function scope rather than in the global namespace:
+(function() {
+       var tree;
+
+       function loadNodeData(node, fnLoadComplete)  {
+               //We'll load node data based on what we get back when we
+               //use Connection Manager topass the text label of the
+               //expanding node to the Yahoo!
+               //Music track search API.  Here, we're at the
+               //first part of the request -- we'll make the request to the
+               //server.  In our success handler, we'll build our new children
+               //and then return fnLoadComplete back to the tree.
+
+               mapping_id = node.index;
+               var app = mapping[mapping_id]['name'];
+               //var app = node.data['app'];
+
+               //prepare URL for XHR request:
+               var oArgs = 
{menuaction:'phpgwapi.menu.get_local_menu_ajax',node:app};
+               var sUrl = phpGWLink('index.php', oArgs, true);
+
+               //prepare our callback object
+               var callback = {
+
+                       //if our XHR call is successful, we want to make use
+                       //of the returned data and create child nodes.
+                       success: function(oResponse) {
+
+                               var oResults = eval("(" + 
oResponse.responseText + ")");
+
+                               var title, url, titles, tempNode;
+
+                               if (YAHOO.lang.isArray(oResults)) {
+
+                                       titles = {};
+                                       for (var i = 0, len = oResults.length; 
i < len; i++) {
+                                               title = oResults[i].text;
+                                               key = oResults[i].key;
+                                               url = oResults[i].url;
+                                               is_leaf = !!oResults[i].is_leaf;
+                                               // prevent duplicate track 
titles by creating a hash of titles
+                                               if (!titles[title]) {
+                                                       titles[title] = true;
+
+                                                       var myobj = {
+                                                               label: title,
+                                                               href:url,
+                                                               data:{app: app 
+ '|' + key}
+                                                       }//,target:"_self" };
+                                                       tempNode = new 
YAHOO.widget.TextNode( myobj, node, false);
+
+                                                       mapping_id = 
tempNode.index;
+                                                       mapping[mapping_id] = 
{id: mapping_id, name: app + '|' + key, expanded: false, highlight: false, 
is_leaf:is_leaf};
+
+
+                                                       parent_mapping_id = 
node.index;
+
+                                                       myobj['parent'] = 
parent_mapping_id;
+                                                       myobj['id'] = 
mapping_id;
+                                                       myobj['isLeaf'] = 
is_leaf;
+                                                       myobj['expanded'] = 
false;
+
+                                                       proxy_data[mapping_id] 
=  myobj;
+                                                       if(parent_mapping_id)
+                                                       {
+                               //                              
proxy_data[parent_mapping_id]['expanded'] = true;
+                                                               
mapping[parent_mapping_id]['expanded'] = true;
+                                                       }
+
+                                                       // we can tell the tree 
node that this is a leaf node so
+                                                       // that it doesn't try 
to dynamically load children.
+
+
+                                                        if(is_leaf)
+                                                        {
+                                                               tempNode.isLeaf 
= is_leaf;
+                                                        }
+                                                        else
+                                                        {
+                                                               
tempNode.setDynamicLoad(loadNodeData);
+                                                        }
+
+                                                       // Define a href so 
that a click on the node will navigate
+                                                       // to the page that has 
the track that you may be able
+                                                       // to listen to.
+                                                       tempNode.href = url;
+                                               }
+                                       }
+
+                                       sessionStorage.cached_menu_tree_data = 
YAHOO.lang.JSON.stringify(proxy_data);
+                                       sessionStorage.cached_mapping = 
YAHOO.lang.JSON.stringify(mapping);
+                               }
+
+                               //When we're done creating child nodes, we 
execute the node's
+                               //loadComplete callback method which comes in 
via the argument
+                               //in the response object (we could also access 
it at node.loadComplete,
+                               //if necessary):
+                               oResponse.argument.fnLoadComplete();
+                       },
+
+                       //if our XHR call is not successful, we want to
+                       //fire the TreeView callback and let the Tree
+                       //proceed with its business.
+                       failure: function(oResponse) {
+                               oResponse.argument.fnLoadComplete();
+                       },
+
+                       //our handlers for the XHR response will need the same
+                       //argument information we got to loadNodeData, so
+                       //we'll pass those along:
+                       argument: {
+                               "node": node,
+                               "fnLoadComplete": fnLoadComplete
+                       },
+
+                       //timeout -- if more than 7 seconds go by, we'll abort
+                       //the transaction and assume there are no children:
+                       timeout: 7000
+               };
+
+               //With our callback object ready, it's now time to
+               //make our XHR call using Connection Manager's
+               //asyncRequest method:
+               YAHOO.util.Connect.asyncRequest('GET', sUrl, callback);
+       }
+
+       function init() {
+
+               var reset = false;
+
+               if(reset)
+               {
+                       sessionStorage.cached_menu_tree_data = '';
+                       sessionStorage.cached_mapping = '';
+               }
+
+               var menu_tree_data;
+               var cached_menu_tree_data;
+               var cached_mapping;
+               var new_mapping = [{name:'first_element_is_dummy'}];
+               var new_proxy_data = ['first_element_is_dummy'];
+
+               if(typeof(Storage)!=="undefined")
+               {
+                       cached_menu_tree_data = 
sessionStorage.cached_menu_tree_data;
+                       cached_mapping = sessionStorage.cached_mapping;
+               }
+               else
+               {
+                       alert('Sorry! No web storage support..');
+               }
+
+               if(cached_mapping)
+               {
+                       mapping = YAHOO.lang.JSON.parse(cached_mapping);
+               }
+
+               menu_tree_data = apps;
+               if(cached_menu_tree_data)
+               {
+                       cached_menu_tree_data = 
YAHOO.lang.JSON.parse(cached_menu_tree_data);
+                       menu_tree_data = buildHierarchy(cached_menu_tree_data);
+               }
+
+               //create a new tree:
+               tree = new YAHOO.widget.TreeView("MenutreeDiv1");
+//             tree.singleNodeHighlight = true;
+               tree.setNodesProperty('propagateHighlightUp',true);
+
+
+       //      Expand and collapse happen prior to the actual expand/collapse,
+       //      and can be used to cancel the operation
+               tree.subscribe("expand", function(node) {
+                       //var mapping_str = node.labelElId
+                       var mapping_id = node.index; 
//mapping_str.replace('ygtvlabelel','');
+                       mapping[mapping_id]['expanded'] = true;
+                       sessionStorage.cached_mapping = JSON.stringify(mapping);
+                       sessionStorage.cached_menu_tree_data = 
JSON.stringify(proxy_data);
+               });
+
+               tree.subscribe("collapse", function(node) {
+                       //var mapping_str = node.labelElId
+                       var mapping_id = node.index; 
//mapping_str.replace('ygtvlabelel','');
+                       mapping[mapping_id]['expanded'] = false;
+                       sessionStorage.cached_mapping = JSON.stringify(mapping);
+                       sessionStorage.cached_menu_tree_data = 
JSON.stringify(proxy_data);
+               });
+
+               tree.subscribe('clickEvent',tree.onEventToggleHighlight);
+
+               //get root node for tree:
+               var root = tree.getRoot();
+
+               //add child nodes for tree; our top level nodes are apps - 
defined in html
+
+               function buildTree(menu_tree_data)
+               {
+                       //Reset proxy_data
+                       proxy_data = ['first_element_is_dummy'];
+                       var buildBranch = function(node, branch)
+                       {
+                               for (var i = 0; i < branch.length; i++)
+                               {
+
+                                       var myobj = {
+                                               label: 
branch[i]['value']['label'],
+                                               href: branch[i]['value']['href']
+                                       //      data:{app: app + '|' + key}
+                                               }//,target:"_self" };
+
+                                       var tempNode = new 
YAHOO.widget.TextNode(myobj, node, 
mapping[branch[i]['value']['id']]['expanded']);
+
+                                       
if(mapping[branch[i]['value']['id']]['name'] == menu_selection)
+                                       {
+                                               tempNode.label = '[' + 
tempNode.label + ']';
+                                               tempNode.highlight();
+                                       }
+
+                                       var mapping_id = tempNode.index;
+                                       new_mapping[mapping_id] = 
mapping[branch[i]['value']['id']];
+                                       new_mapping[mapping_id]['id'] = 
mapping_id;
+
+                                       parent_mapping_id = node.index;
+
+                                       myobj['parent'] = parent_mapping_id;
+                                       myobj['id'] = mapping_id;
+                                       proxy_data[mapping_id] =  myobj;
+
+                                       if(typeof(branch[i]['children']) != 
'undefined' && branch[i]['children'].length)
+                                       {
+                                               buildBranch(tempNode, 
branch[i]['children']);
+                                       }
+                                       else
+                                       {
+                                               tempNode.isLeaf = 
mapping[branch[i]['value']['id']]['is_leaf'];
+                                               
tempNode.setDynamicLoad(loadNodeData);
+                                       }
+                               }
+                       };
+
+                       for (var i=0, j=menu_tree_data.length; i<j; i++)
+                       {
+                               var myobj = {
+                                       label: 
menu_tree_data[i]['value']['label'],
+                                       href: 
menu_tree_data[i]['value']['href'],
+                                       enableHighlight: true
+                                       }
+
+
+                               var tempNode = new YAHOO.widget.TextNode(myobj, 
root, mapping[menu_tree_data[i]['value']['id']]['expanded']);
+
+                               
if(mapping[menu_tree_data[i]['value']['id']]['highlight'])
+                               {
+                                       tempNode.highlight();
+                               }
+
+                               
if(mapping[menu_tree_data[i]['value']['id']]['name'] == menu_selection)
+                               {
+                                       tempNode.label = '[' + tempNode.label + 
']';
+                                       tempNode.highlight();
+                               }
+
+                               var mapping_id = tempNode.index;
+
+                               var old_id = menu_tree_data[i]['value']['id'];
+                               new_mapping[mapping_id] = 
mapping[menu_tree_data[i]['value']['id']];
+                               new_mapping[mapping_id]['id'] = mapping_id;
+
+                               if(typeof(proxy_data[old_id]) != 'undefined')
+                               {
+                                       new_proxy_data[mapping_id] = 
proxy_data[old_id];
+                               }
+
+                               myobj['parent'] = '';
+                               myobj['id'] = mapping_id;
+                               proxy_data[mapping_id] =  myobj;
+
+                               if(typeof(menu_tree_data[i]['children']) != 
'undefined' && menu_tree_data[i]['children'].length)
+                               {
+                                       buildBranch(tempNode, 
menu_tree_data[i]['children']);
+                               }
+                               else
+                               {
+                                       tempNode.setDynamicLoad(loadNodeData);
+                               }
+                       }
+
+                       //render tree with these toplevel nodes; all 
descendants of these nodes
+                       //will be generated as needed by the dynamic loader.
+
+                       tree.draw();
+                       mapping = new_mapping;
+               }
+
+
+               buildTree(menu_tree_data);
+
+               function buildHierarchy(arry) {
+
+                       var roots = [], children = {};
+
+                       // find the top level nodes and hash the children based 
on parent
+                       // First element is dummy
+                       for (var i = 1, len = arry.length; i < len; ++i)
+                       {
+                               var item = arry[i],
+                                       p = item.parent,
+                                       target = !p ? roots : (children[p] || 
(children[p] = []));
+
+                               target.push({ value: item });
+                       }
+
+                       // function to recursively build the tree
+                       var findChildren = function(parent)
+                       {
+                               if (children[parent.value.id])
+                               {
+                                       parent.children = 
children[parent.value.id];
+                                       for (var i = 0, len = 
parent.children.length; i < len; ++i)
+                                       {
+                                               
findChildren(parent.children[i]);
+                                       }
+                               }
+                       };
+
+                       // enumerate through to handle the case where there are 
multiple roots
+                       for (var i = 0, len = roots.length; i < len; ++i) {
+                               findChildren(roots[i]);
+                       }
+
+                       return roots;
+               }
+
+       }
+
+       //once the DOM has loaded, we can go ahead and set up our tree:
+       YAHOO.util.Event.onDOMReady(init);
+
+})();

Modified: branches/Version-1_0-branch/phpgwapi/templates/portico/navbar.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/templates/portico/navbar.inc.php       
2013-08-13 11:21:08 UTC (rev 11264)
+++ branches/Version-1_0-branch/phpgwapi/templates/portico/navbar.inc.php       
2013-08-13 11:26:34 UTC (rev 11265)
@@ -97,13 +97,10 @@
                phpgwapi_cache::session_set('phpgwapi','breadcrumbs', 
$breadcrumbs);
                $breadcrumbs = array_reverse($breadcrumbs);
                
-//             $var['breadcrumbs'] = implode(' >> ', $history_url);
-
                $navigation = array();
                if( 
!isset($GLOBALS['phpgw_info']['user']['preferences']['property']['nonavbar']) 
|| $GLOBALS['phpgw_info']['user']['preferences']['property']['nonavbar'] != 
'yes' )
                {
                        prepare_navbar($navbar);
-                       $navigation = execMethod('phpgwapi.menu.get', 
'navigation');
                }
                else
                {
@@ -113,22 +110,77 @@
                        }
                }
 
-               $treemenu = '';
-               foreach($navbar as $app => $app_data)
+               if 
(isset($GLOBALS['phpgw_info']['user']['preferences']['common']['sidecontent']) 
&& $GLOBALS['phpgw_info']['user']['preferences']['common']['sidecontent'] == 
'ajax_menu')
                {
-                       if(!in_array($app, array('logout', 'about', 
'preferences')))
+                       $exclude = array('logout', 'about', 'preferences');
+                       $i = 1;
+                       foreach ( $navbar as $app => $app_data )
                        {
-                               $submenu = isset($navigation[$app]) ? 
render_submenu($app, $navigation[$app]) : '';
-                               $treemenu .= render_item($app_data, 
"navbar::{$app}", $submenu);
+                               if ( in_array($app, $exclude) )
+                               {
+                                       continue;
+                               }
+
+                               $applications[] = array
+                               (
+                                       'value'=> array
+                                       (
+                                               'id'    => $i,
+                                               'app'   => $app,
+                                               'label' => $app_data['text'],
+                                               'href'  => 
str_replace('&amp;','&', $app_data['url']),
+                                       ),
+                                       'children'      => array()
+                               );
+
+                               $mapping[$i] = array
+                               (
+                                       'id'            => $i,
+                                       'name'          => $app,
+                                       'expanded'      => false,
+                                       'highlight'     => $app == $currentapp 
? true : false,
+                                       'is_leaf'       => false
+                               );
+                               
+                               $i ++;
                        }
+                       $applications = json_encode($applications);
+                       $mapping = json_encode($mapping);
+                       $_menu_selection = str_replace('::', '|', 
$GLOBALS['phpgw_info']['flags']['menu_selection']);
+
+                       $var['treemenu'] = <<<HTML
+                               <div id="MenutreeDiv1"></div>
+                               <script type="text/javascript">
+                                       var apps = {$applications};
+                                       var mapping = {$mapping};
+                                       var proxy_data = 
['first_element_is_dummy'];
+                                       var menu_selection = 
'{$_menu_selection}';
+                               </script>
+HTML;
                }
-               $var['treemenu'] = <<<HTML
+               else
+               {               
+//                     prepare_navbar($navbar);
+                       $navigation = execMethod('phpgwapi.menu.get', 
'navigation');
+                       $treemenu = '';
+                       foreach($navbar as $app => $app_data)
+                       {
+                               if(!in_array($app, array('logout', 'about', 
'preferences')))
+                               {
+                                       $submenu = isset($navigation[$app]) ? 
render_submenu($app, $navigation[$app]) : '';
+                                       $treemenu .= render_item($app_data, 
"navbar::{$app}", $submenu);
+                               }
+                       }
+                       $var['treemenu'] = <<<HTML
                        <ul id="navbar">
 {$treemenu}
                        </ul>
 
 HTML;
+               }
 
+
+
                $GLOBALS['phpgw']->template->set_var($var);
                $GLOBALS['phpgw']->template->pfp('out','navbar');
 

Modified: branches/Version-1_0-branch/phpgwapi/templates/portico/navbar.tpl
===================================================================
--- branches/Version-1_0-branch/phpgwapi/templates/portico/navbar.tpl   
2013-08-13 11:21:08 UTC (rev 11264)
+++ branches/Version-1_0-branch/phpgwapi/templates/portico/navbar.tpl   
2013-08-13 11:26:34 UTC (rev 11265)
@@ -1,6 +1,20 @@
 <div id="debug-navbar">
 {debug}
 </div>
+       <script type="text/javascript">
+               function logout()
+               {
+                       if(typeof(Storage)!=="undefined")
+                       {
+                               sessionStorage.cached_menu_tree_data = '';
+                               sessionStorage.cached_mapping = '';
+                       }
+
+                       var sUrl = phpGWLink('logout.php');
+                       window.open(sUrl,'_self');
+               }
+       </script>
+
                <div id="theme-gray">
                        <div class="border-layout" id="border-layout">
                                <div class="layout-north">
@@ -25,7 +39,7 @@
                                                        <a 
href="{preferences_url}" class="icon icon-preferences">
                                                                
{preferences_text}
                                                        </a>
-                                                       <a href="{logout_url}" 
class="icon icon-logout">
+                                                       <a 
href="javascript:logout();" class="icon icon-logout">
                                                                {logout_text}
                                                        </a>
                                                </div>

Modified: branches/Version-1_0-branch/preferences/inc/hook_settings.inc.php
===================================================================
--- branches/Version-1_0-branch/preferences/inc/hook_settings.inc.php   
2013-08-13 11:21:08 UTC (rev 11264)
+++ branches/Version-1_0-branch/preferences/inc/hook_settings.inc.php   
2013-08-13 11:26:34 UTC (rev 11265)
@@ -155,6 +155,7 @@
        $menu_formats = array(
                'sidebox' => lang('Sidebox'),
                'jsmenu' => lang('JS-menu'),
+               'ajax_menu' => lang('ajax menu'),
                'no_sidecontent' => lang('No SideContent')
        );
        create_select_box('SideContent','sidecontent',$menu_formats,

Modified: branches/Version-1_0-branch/property/inc/class.soadmin_entity.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soadmin_entity.inc.php       
2013-08-13 11:21:08 UTC (rev 11264)
+++ branches/Version-1_0-branch/property/inc/class.soadmin_entity.inc.php       
2013-08-13 11:26:34 UTC (rev 11265)
@@ -256,11 +256,11 @@
 
                        foreach($categories as $category)
                        {
-                               $this->category_tree[] = array
-                                       (
-                                               'id'    => $category['id'],
-                                               'name'  => $category['name']
-                                       );
+                               $this->category_tree[$category['id']] = array
+                               (
+                                       'id'    => $category['id'],
+                                       'name'  => $category['name']
+                               );
                                $this->get_children2($entity_id, 
$category['id'], 1);
                        }
                        return $this->category_tree;

Modified: branches/Version-1_0-branch/property/inc/class.soentity.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soentity.inc.php     
2013-08-13 11:21:08 UTC (rev 11264)
+++ branches/Version-1_0-branch/property/inc/class.soentity.inc.php     
2013-08-13 11:26:34 UTC (rev 11265)
@@ -272,7 +272,7 @@
                                                        case '=':
                                                        case 'equal':
                                                        case 'eq':
-                                                               
$_querymethod[]= "xmlexists_('//{$attribute_name}[text() = 
''{$condition['value']}'']' PASSING BY REF xml_representation)";
+                                                               
$_querymethod[]= "xmlexists('//{$attribute_name}[text() = 
''{$condition['value']}'']' PASSING BY REF xml_representation)";
                                                                break;
                                                        case 'gt':
                                                        case '>':
@@ -2196,7 +2196,7 @@
                        $cat_id         = (int) $cat_id;
                        $id                     = (int) $id;
 
-                       $location2_id   = 
$GLOBALS['phpgw']->locations->get_id($this->type_app[$this->type], 
".{$this->type}.{$entity_id}.{$cat_id}");
+                       $location_id    = 
$GLOBALS['phpgw']->locations->get_id($this->type_app[$this->type], 
".{$this->type}.{$entity_id}.{$cat_id}");
 
                        $admin_entity   = 
CreateObject('property.soadmin_entity');
                        $admin_entity->type = $this->type;
@@ -2217,8 +2217,9 @@
                                $this->db->query("DELETE FROM $table WHERE id = 
$id",__LINE__,__FILE__);
                        }
 
+                       $this->db->query("DELETE FROM phpgw_interlink WHERE 
location1_id ={$location_id} AND location1_item_id = {$id}",__LINE__,__FILE__);
+                       $this->db->query("DELETE FROM phpgw_interlink WHERE 
location2_id ={$location_id} AND location2_item_id = {$id}",__LINE__,__FILE__);
 
-                       $this->db->query("DELETE FROM phpgw_interlink WHERE 
location2_id ={$location2_id} AND location2_item_id = {$id}",__LINE__,__FILE__);
                        $this->db->transaction_commit();
                }
 
@@ -2432,6 +2433,7 @@
                                (
                                        'inventory_id'  => $this->db->f('id'),
                                        'inventory'             => 
$this->db->f('inventory'),
+                                       'allocated'             => 0,
                                        'unit_id'               => 
$this->db->f('unit_id'),
                                        'unit'                  => 
$this->db->f('unit', true),
                                        'remark'                => 
$this->db->f('remark', true),
@@ -2444,6 +2446,28 @@
                                );
                        }
 
+
+                       
if(isset($GLOBALS['phpgw_info']['user']['apps']['logistic']))
+                       {
+                               $start_date     = time();
+                               $end_date       = time();
+
+                               foreach ($inventory as &$entry)
+                               {
+                                       $sql = "SELECT 
SUM(item_inventory_amount) AS allocated"
+                                       . " FROM lg_calendar"
+                                       . " WHERE location_id = {$location_id}"
+                                       . " AND lg_calendar.item_id = {$id}"
+                                       . " AND item_inventory_id = 
{$entry['inventory_id']}"
+                                       . " AND lg_calendar.end_date >= 
{$start_date} AND lg_calendar.start_date <= {$end_date}";
+
+                                       
$this->db->query($sql,__LINE__,__FILE__);
+                       
+                                       $this->db->next_record();
+                                       $entry['allocated'] = (int) 
$this->db->f('allocated');
+                               }
+                       }
+
                        return $inventory;
                }
 

Modified: branches/Version-1_0-branch/property/inc/class.uientity.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uientity.inc.php     
2013-08-13 11:21:08 UTC (rev 11264)
+++ branches/Version-1_0-branch/property/inc/class.uientity.inc.php     
2013-08-13 11:26:34 UTC (rev 11265)
@@ -68,7 +68,8 @@
                                'get_files'                     => true,
                                'get_inventory'         => true,
                                'add_inventory'         => true,
-                               'edit_inventory'        => true
+                               'edit_inventory'        => true,
+                               'inventory_calendar'=> true
                        );
 
                function property_uientity()
@@ -2186,7 +2187,10 @@
                                        }
                                }
 
-                               $tabs['related']        = array('label' => 
lang('log'), 'link' => '#related', 'function' => "set_tab('related')");
+                               if (!$category['enable_bulk'])
+                               {
+                                       $tabs['related']        = array('label' 
=> lang('log'), 'link' => '#related', 'function' => "set_tab('related')");
+                               }
                                $_target = array();
                                if(isset($values['target']) && 
$values['target'])
                                {
@@ -2294,8 +2298,9 @@
                                                        //      array('key' => 
'delete','label'=>lang('delete'),'sortable'=>false,'resizeable'=>true, 
'formatter' => 'FormatterCenter'),
                                                                array('key' => 
'unit','label'=>lang('unit'),'sortable'=>false,'resizeable'=>true),
                                                                array('key' => 
'inventory','label'=>lang('count'),'sortable'=>false,'resizeable'=>true, 
'formatter' => 'FormatterAmount0'),
+                                                               array('key' => 
'allocated','label'=>lang('allocated'),'sortable'=>false,'resizeable'=>true, 
'formatter' => 'FormatterAmount0'),
                                                                array('key' => 
'bookable','label'=>lang('bookable'),'sortable'=>false,'resizeable'=>true, 
'formatter' => 'FormatterCenter'),
-                                                               array('key' => 
'calendar','label'=>lang('calendar'),'sortable'=>false,'resizeable'=>true),
+                                                               array('key' => 
'calendar','label'=>lang('calendar'),'sortable'=>false,'resizeable'=>true, 
'formatter' => 'FormatterCalendar'),
                                                                array('key' => 
'remark','label'=>lang('remark'),'sortable'=>false,'resizeable'=>true),
                                                                array('key' => 
'location_id','hidden'=>true),
                                                                array('key' => 
'id','hidden'=>true),
@@ -3276,6 +3281,24 @@
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
$system_location['appname'] . '::' . $system_location['descr'] . '::' . 
$function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('add_inventory' => $data));
 
+               }
 
+               public function inventory_calendar()
+               {
+                       $location_id    = phpgw::get_var('location_id', 'int');
+                       $id                             = phpgw::get_var('id', 
'int');
+                       $inventory_id   = phpgw::get_var('inventory_id', 'int');
+
+                       $system_location = 
$GLOBALS['phpgw']->locations->get_name($location_id);
+
+                       $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();
+                       }
+                       echo "Planlagt: Visning av kalenderoppføringer for 
ressursen";
+                       $GLOBALS['phpgw']->common->phpgw_exit();
                }
        }

Modified: branches/Version-1_0-branch/property/inc/class.uitts.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uitts.inc.php        
2013-08-13 11:21:08 UTC (rev 11264)
+++ branches/Version-1_0-branch/property/inc/class.uitts.inc.php        
2013-08-13 11:26:34 UTC (rev 11265)
@@ -2011,7 +2011,7 @@
                                        'disable_userassign_on_add'             
=> 
isset($this->bo->config->config_data['tts_disable_userassign_on_add'])?$this->bo->config->config_data['tts_disable_userassign_on_add']:'',
 
                                        'lang_no_group'                         
        => lang('No group'),
-                                       'group_list'                            
        => $this->bo->get_group_list(),
+                                       'group_list'                            
        => $this->bo->get_group_list($values['group_id']),
                                        'select_group_name'                     
        => 'values[group_id]',
 
                                        'lang_priority_statustext'              
=> lang('Select the priority the selection belongs to.'),

Modified: branches/Version-1_0-branch/property/js/yahoo/entity.edit.js
===================================================================
--- branches/Version-1_0-branch/property/js/yahoo/entity.edit.js        
2013-08-13 11:21:08 UTC (rev 11264)
+++ branches/Version-1_0-branch/property/js/yahoo/entity.edit.js        
2013-08-13 11:26:34 UTC (rev 11265)
@@ -21,9 +21,17 @@
                var location_id = oRecord.getData('location_id');
                var id = oRecord.getData('id');
                var inventory_id = oRecord.getData('inventory_id');
-               elCell.innerHTML = "<a 
href=\"javascript:showlightbox_edit_inventory(" + location_id + ',' + id + ',' 
+ inventory_id + ')">' + 'Editer' + "</a>";
+               elCell.innerHTML = "<a 
href=\"javascript:showlightbox_edit_inventory(" + location_id + ',' + id + ',' 
+ inventory_id + ')">' + oColumn.label + "</a>";
        }       
 
+       var FormatterCalendar = function(elCell, oRecord, oColumn, oData)
+       {
+               var location_id = oRecord.getData('location_id');
+               var id = oRecord.getData('id');
+               var inventory_id = oRecord.getData('inventory_id');
+               elCell.innerHTML = "<a 
href=\"javascript:showlightbox_show_calendar(" + location_id + ',' + id + ',' + 
inventory_id + ')">' + oColumn.label + "</a>";
+       }       
+
        var FormatterCenter = function(elCell, oRecord, oColumn, oData)
        {
                var amount = YAHOO.util.Number.format(oData, {decimalPlaces:0, 
decimalSeparator:",", thousandsSeparator:" "});
@@ -108,6 +116,18 @@
                });
        }
 
+       this.showlightbox_show_calendar = function(location_id, id, 
inventory_id)
+       {
+               var oArgs = {menuaction:'property.uientity.inventory_calendar', 
location_id:location_id, id: id, inventory_id: inventory_id};
+               var sUrl = phpGWLink('index.php', oArgs);
+
+               TINY.box.show({iframe:sUrl, 
boxid:'frameless',width:750,height:550,fixed:false,maskid:'darkmask',maskopacity:40,
 mask:true, animate:true,
+               close: true,
+               closejs:function(){refresh_inventory(location_id, id)}
+               });
+       }
+
+
        this.refresh_inventory = function(location_id, id)
        {
                var oArgs = {menuaction:'property.uientity.get_inventory', 
location_id:location_id, id: id};

Copied: branches/Version-1_0-branch/property/js/yahoo/test.menu.js (from rev 
11264, trunk/property/js/yahoo/test.menu.js)
===================================================================
--- branches/Version-1_0-branch/property/js/yahoo/test.menu.js                  
        (rev 0)
+++ branches/Version-1_0-branch/property/js/yahoo/test.menu.js  2013-08-13 
11:26:34 UTC (rev 11265)
@@ -0,0 +1,340 @@
+//an anonymous function wraps our code to keep our variables
+//in function scope rather than in the global namespace:
+(function() {
+       var tree;
+
+       function loadNodeData(node, fnLoadComplete)  {
+               //We'll load node data based on what we get back when we
+               //use Connection Manager topass the text label of the
+               //expanding node to the Yahoo!
+               //Music track search API.  Here, we're at the
+               //first part of the request -- we'll make the request to the
+               //server.  In our success handler, we'll build our new children
+               //and then return fnLoadComplete back to the tree.
+
+               mapping_id = node.index;
+               var app = mapping[mapping_id]['name'];
+               //var app = node.data['app'];
+
+               //prepare URL for XHR request:
+               var oArgs = 
{menuaction:'phpgwapi.menu.get_local_menu_ajax',node:app};
+               var sUrl = phpGWLink('index.php', oArgs, true);
+
+               //prepare our callback object
+               var callback = {
+
+                       //if our XHR call is successful, we want to make use
+                       //of the returned data and create child nodes.
+                       success: function(oResponse) {
+
+                               var oResults = eval("(" + 
oResponse.responseText + ")");
+
+                               var title, url, titles, tempNode;
+
+                               if (YAHOO.lang.isArray(oResults)) {
+
+                                       titles = {};
+                                       for (var i = 0, len = oResults.length; 
i < len; i++) {
+                                               title = oResults[i].text;
+                                               key = oResults[i].key;
+                                               url = oResults[i].url;
+                                               is_leaf = !!oResults[i].is_leaf;
+                                               // prevent duplicate track 
titles by creating a hash of titles
+                                               if (!titles[title]) {
+                                                       titles[title] = true;
+
+                                                       var myobj = {
+                                                               label: title,
+                                                               href:url,
+                                                               data:{app: app 
+ '|' + key}
+                                                       }//,target:"_self" };
+                                                       tempNode = new 
YAHOO.widget.TextNode( myobj, node, false);
+
+                                                       mapping_id = 
tempNode.index;
+                                                       mapping[mapping_id] = 
{id: mapping_id, name: app + '|' + key, expanded: false, highlight: false, 
is_leaf:is_leaf};
+
+
+                                                       parent_mapping_id = 
node.index;
+
+                                                       myobj['parent'] = 
parent_mapping_id;
+                                                       myobj['id'] = 
mapping_id;
+                                                       myobj['isLeaf'] = 
is_leaf;
+                                                       myobj['expanded'] = 
false;
+
+                                                       proxy_data[mapping_id] 
=  myobj;
+                                                       if(parent_mapping_id)
+                                                       {
+                               //                              
proxy_data[parent_mapping_id]['expanded'] = true;
+                                                               
mapping[parent_mapping_id]['expanded'] = true;
+                                                       }
+
+                                                       // we can tell the tree 
node that this is a leaf node so
+                                                       // that it doesn't try 
to dynamically load children.
+
+
+                                                        if(is_leaf)
+                                                        {
+                                                               tempNode.isLeaf 
= is_leaf;
+                                                        }
+                                                        else
+                                                        {
+                                                               
tempNode.setDynamicLoad(loadNodeData);
+                                                        }
+
+                                                       // Define a href so 
that a click on the node will navigate
+                                                       // to the page that has 
the track that you may be able
+                                                       // to listen to.
+                                                       tempNode.href = url;
+                                               }
+                                       }
+
+                                       sessionStorage.cached_menu_tree_data = 
YAHOO.lang.JSON.stringify(proxy_data);
+                                       sessionStorage.cached_mapping = 
YAHOO.lang.JSON.stringify(mapping);
+                               }
+
+                               //When we're done creating child nodes, we 
execute the node's
+                               //loadComplete callback method which comes in 
via the argument
+                               //in the response object (we could also access 
it at node.loadComplete,
+                               //if necessary):
+                               oResponse.argument.fnLoadComplete();
+                       },
+
+                       //if our XHR call is not successful, we want to
+                       //fire the TreeView callback and let the Tree
+                       //proceed with its business.
+                       failure: function(oResponse) {
+                               oResponse.argument.fnLoadComplete();
+                       },
+
+                       //our handlers for the XHR response will need the same
+                       //argument information we got to loadNodeData, so
+                       //we'll pass those along:
+                       argument: {
+                               "node": node,
+                               "fnLoadComplete": fnLoadComplete
+                       },
+
+                       //timeout -- if more than 7 seconds go by, we'll abort
+                       //the transaction and assume there are no children:
+                       timeout: 7000
+               };
+
+               //With our callback object ready, it's now time to
+               //make our XHR call using Connection Manager's
+               //asyncRequest method:
+               YAHOO.util.Connect.asyncRequest('GET', sUrl, callback);
+       }
+
+       function init() {
+
+               var reset = false;
+
+               if(reset)
+               {
+                       sessionStorage.cached_menu_tree_data = '';
+                       sessionStorage.cached_mapping = '';
+               }
+
+               var menu_tree_data;
+               var cached_menu_tree_data;
+               var cached_mapping;
+               var new_mapping = [{name:'first_element_is_dummy'}];
+               var new_proxy_data = ['first_element_is_dummy'];
+
+               if(typeof(Storage)!=="undefined")
+               {
+                       cached_menu_tree_data = 
sessionStorage.cached_menu_tree_data;
+                       cached_mapping = sessionStorage.cached_mapping;
+               }
+               else
+               {
+                       alert('Sorry! No web storage support..');
+               }
+
+               if(cached_mapping)
+               {
+                       mapping = YAHOO.lang.JSON.parse(cached_mapping);
+               }
+
+               menu_tree_data = apps;
+               if(cached_menu_tree_data)
+               {
+                       cached_menu_tree_data = 
YAHOO.lang.JSON.parse(cached_menu_tree_data);
+                       menu_tree_data = buildHierarchy(cached_menu_tree_data);
+               }
+
+               //create a new tree:
+               tree = new YAHOO.widget.TreeView("MenutreeDiv1");
+//             tree.singleNodeHighlight = true;
+               tree.setNodesProperty('propagateHighlightUp',true);
+
+
+       //      Expand and collapse happen prior to the actual expand/collapse,
+       //      and can be used to cancel the operation
+               tree.subscribe("expand", function(node) {
+                       //var mapping_str = node.labelElId
+                       var mapping_id = node.index; 
//mapping_str.replace('ygtvlabelel','');
+                       mapping[mapping_id]['expanded'] = true;
+                       sessionStorage.cached_mapping = JSON.stringify(mapping);
+                       sessionStorage.cached_menu_tree_data = 
JSON.stringify(proxy_data);
+               });
+
+               tree.subscribe("collapse", function(node) {
+                       //var mapping_str = node.labelElId
+                       var mapping_id = node.index; 
//mapping_str.replace('ygtvlabelel','');
+                       mapping[mapping_id]['expanded'] = false;
+                       sessionStorage.cached_mapping = JSON.stringify(mapping);
+                       sessionStorage.cached_menu_tree_data = 
JSON.stringify(proxy_data);
+               });
+
+               tree.subscribe('clickEvent',tree.onEventToggleHighlight);
+
+               //get root node for tree:
+               var root = tree.getRoot();
+
+               //add child nodes for tree; our top level nodes are apps - 
defined in html
+
+               function buildTree(menu_tree_data)
+               {
+                       //Reset proxy_data
+                       proxy_data = ['first_element_is_dummy'];
+                       var buildBranch = function(node, branch)
+                       {
+                               for (var i = 0; i < branch.length; i++)
+                               {
+
+                                       var myobj = {
+                                               label: 
branch[i]['value']['label'],
+                                               href: branch[i]['value']['href']
+                                       //      data:{app: app + '|' + key}
+                                               }//,target:"_self" };
+
+                                       var tempNode = new 
YAHOO.widget.TextNode(myobj, node, 
mapping[branch[i]['value']['id']]['expanded']);
+
+                                       
if(mapping[branch[i]['value']['id']]['name'] == menu_selection)
+                                       {
+                                               tempNode.label = '[' + 
tempNode.label + ']';
+                                               tempNode.highlight();
+                                       }
+
+                                       var mapping_id = tempNode.index;
+                                       new_mapping[mapping_id] = 
mapping[branch[i]['value']['id']];
+                                       new_mapping[mapping_id]['id'] = 
mapping_id;
+
+                                       parent_mapping_id = node.index;
+
+                                       myobj['parent'] = parent_mapping_id;
+                                       myobj['id'] = mapping_id;
+                                       proxy_data[mapping_id] =  myobj;
+
+                                       if(typeof(branch[i]['children']) != 
'undefined' && branch[i]['children'].length)
+                                       {
+                                               buildBranch(tempNode, 
branch[i]['children']);
+                                       }
+                                       else
+                                       {
+                                               tempNode.isLeaf = 
mapping[branch[i]['value']['id']]['is_leaf'];
+                                               
tempNode.setDynamicLoad(loadNodeData);
+                                       }
+                               }
+                       };
+
+                       for (var i=0, j=menu_tree_data.length; i<j; i++)
+                       {
+                               var myobj = {
+                                       label: 
menu_tree_data[i]['value']['label'],
+                                       href: 
menu_tree_data[i]['value']['href'],
+                                       enableHighlight: true
+                                       }
+
+
+                               var tempNode = new YAHOO.widget.TextNode(myobj, 
root, mapping[menu_tree_data[i]['value']['id']]['expanded']);
+
+                               
if(mapping[menu_tree_data[i]['value']['id']]['highlight'])
+                               {
+                                       tempNode.highlight();
+                               }
+
+                               
if(mapping[menu_tree_data[i]['value']['id']]['name'] == menu_selection)
+                               {
+                                       tempNode.label = '[' + tempNode.label + 
']';
+                                       tempNode.highlight();
+                               }
+
+                               var mapping_id = tempNode.index;
+
+                               var old_id = menu_tree_data[i]['value']['id'];
+                               new_mapping[mapping_id] = 
mapping[menu_tree_data[i]['value']['id']];
+                               new_mapping[mapping_id]['id'] = mapping_id;
+
+                               if(typeof(proxy_data[old_id]) != 'undefined')
+                               {
+                                       new_proxy_data[mapping_id] = 
proxy_data[old_id];
+                               }
+
+                               myobj['parent'] = '';
+                               myobj['id'] = mapping_id;
+                               proxy_data[mapping_id] =  myobj;
+
+                               if(typeof(menu_tree_data[i]['children']) != 
'undefined' && menu_tree_data[i]['children'].length)
+                               {
+                                       buildBranch(tempNode, 
menu_tree_data[i]['children']);
+                               }
+                               else
+                               {
+                                       tempNode.setDynamicLoad(loadNodeData);
+                               }
+                       }
+
+                       //render tree with these toplevel nodes; all 
descendants of these nodes
+                       //will be generated as needed by the dynamic loader.
+
+                       tree.draw();
+                       mapping = new_mapping;
+               }
+
+
+               buildTree(menu_tree_data);
+
+               function buildHierarchy(arry) {
+
+                       var roots = [], children = {};
+
+                       // find the top level nodes and hash the children based 
on parent
+                       // First element is dummy
+                       for (var i = 1, len = arry.length; i < len; ++i)
+                       {
+                               var item = arry[i],
+                                       p = item.parent,
+                                       target = !p ? roots : (children[p] || 
(children[p] = []));
+
+                               target.push({ value: item });
+                       }
+
+                       // function to recursively build the tree
+                       var findChildren = function(parent)
+                       {
+                               if (children[parent.value.id])
+                               {
+                                       parent.children = 
children[parent.value.id];
+                                       for (var i = 0, len = 
parent.children.length; i < len; ++i)
+                                       {
+                                               
findChildren(parent.children[i]);
+                                       }
+                               }
+                       };
+
+                       // enumerate through to handle the case where there are 
multiple roots
+                       for (var i = 0, len = roots.length; i < len; ++i) {
+                               findChildren(roots[i]);
+                       }
+
+                       return roots;
+               }
+
+       }
+
+       //once the DOM has loaded, we can go ahead and set up our tree:
+       YAHOO.util.Event.onDOMReady(init);
+
+})();

Modified: branches/Version-1_0-branch/property/templates/base/entity.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/entity.xsl      
2013-08-13 11:21:08 UTC (rev 11264)
+++ branches/Version-1_0-branch/property/templates/base/entity.xsl      
2013-08-13 11:26:34 UTC (rev 11265)
@@ -672,7 +672,7 @@
                                        </xsl:choose>
 
                                        <xsl:choose>
-                                               <xsl:when test="value_id !=''">
+                                               <xsl:when test="value_id !='' 
and enable_bulk = ''">
                                                        <div id="related">
                                                                <table 
cellpadding="2" cellspacing="2" width="80%" align="center">
                                                                        <tr>

Copied: branches/Version-1_0-branch/property/test_menu.php (from rev 11264, 
trunk/property/test_menu.php)
===================================================================
--- branches/Version-1_0-branch/property/test_menu.php                          
(rev 0)
+++ branches/Version-1_0-branch/property/test_menu.php  2013-08-13 11:26:34 UTC 
(rev 11265)
@@ -0,0 +1,87 @@
+<?php
+
+       $GLOBALS['phpgw_info'] = array();
+
+       $GLOBALS['phpgw_info']['flags'] = array
+       (
+               'noheader'                => true,
+               'nonavbar'                => false,
+               'currentapp'              => 'home',
+               'enable_network_class'    => true,
+               'enable_contacts_class'   => true,
+               'enable_nextmatchs_class' => true
+       );
+
+
+       include_once('../header.inc.php');
+
+// Start-------------------------------------------------
+
+       phpgw::import_class('phpgwapi.yui');
+       
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/examples/treeview/assets/css/folders/tree.css');
+       phpgwapi_yui::load_widget('treeview');
+       phpgwapi_yui::load_widget('cookie');
+       $GLOBALS['phpgw']->js->validate_file( 'yahoo', 'test.menu', 'property' 
);
+
+               $currentapp = $GLOBALS['phpgw_info']['flags']['currentapp'];
+               $applications = array();
+               $mapping = array(0 => array('name' => 
'first_element_is_dummy'));
+               $exclude = array('home', 'preferences', 'about', 'logout');
+               $navbar = execMethod('phpgwapi.menu.get', 'navbar');
+
+               $i = 1;
+               foreach ( $navbar as $app => $app_data )
+               {
+                       if ( in_array($app, $exclude) )
+                       {
+                               continue;
+                       }
+
+                       $applications[] = array
+                       (
+                               'value'=> array
+                               (
+                                       'id'    => $i,
+                                       'app'   => $app,
+                                       'label' => $app_data['text'],
+                               //      'href'  => str_replace('&amp;','&', 
$app_data['url']) . '&phpgw_return_as=noframes',
+                                       'href'  => str_replace('&amp;','&', 
$app_data['url']),
+                               ),
+                               'children'      => array()
+                       );
+
+                       $mapping[$i] = array
+                       (
+                               'id'            => $i,
+                               'name'          => $app,
+                               'expanded'      => false,
+                               'highlight'     => true,//$app == $currentapp ? 
true : false,
+                               'is_leaf'       => false
+                       );
+                               
+                       $i ++;
+               }
+               $applications = json_encode($applications);
+               $mapping = json_encode($mapping);
+
+$html = <<<HTML
+               <div id="MenutreeDiv1"></div>
+               <script type="text/javascript">
+                  var apps = {$applications};
+                  var mapping = {$mapping};
+                       var proxy_data = ['first_element_is_dummy'];
+               </script>
+HTML;
+
+
+// End--------------------------------------------------
+
+       $GLOBALS['phpgw']->common->phpgw_header();
+       echo parse_navbar();
+
+       echo $html;
+
+
+       $GLOBALS['phpgw']->common->phpgw_footer();
+
+




reply via email to

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