fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [11488] Merge 11479:11487 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [11488] Merge 11479:11487 from trunk
Date: Mon, 25 Nov 2013 13:18:07 +0000

Revision: 11488
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11488
Author:   sigurdne
Date:     2013-11-25 13:18:06 +0000 (Mon, 25 Nov 2013)
Log Message:
-----------
Merge 11479:11487 from trunk

Modified Paths:
--------------
    branches/Version-1_0-branch/frontend/inc/class.borental.inc.php
    branches/Version-1_0-branch/frontend/inc/class.uicontract.inc.php
    branches/Version-1_0-branch/frontend/inc/class.uicontract_ex.inc.php
    branches/Version-1_0-branch/frontend/inc/class.uicontract_in.inc.php
    branches/Version-1_0-branch/frontend/inc/class.uicontract_internal.inc.php
    branches/Version-1_0-branch/frontend/inc/class.uifrontend.inc.php
    branches/Version-1_0-branch/manual/inc/hook_help.inc.php
    branches/Version-1_0-branch/manual/inc/hook_sidebox_menu.inc.php
    branches/Version-1_0-branch/manual/setup/setup.inc.php
    branches/Version-1_0-branch/manual/setup/tables_update.inc.php
    branches/Version-1_0-branch/property/inc/class.bocondition_survey.inc.php
    branches/Version-1_0-branch/property/inc/class.fileuploader.inc.php
    branches/Version-1_0-branch/property/inc/class.socondition_survey.inc.php
    branches/Version-1_0-branch/property/inc/class.sorequest.inc.php
    branches/Version-1_0-branch/property/inc/class.uicondition_survey.inc.php
    branches/Version-1_0-branch/property/inc/class.uiimport.inc.php
    branches/Version-1_0-branch/property/inc/class.uirequest.inc.php
    branches/Version-1_0-branch/property/setup/setup.inc.php
    branches/Version-1_0-branch/property/setup/tables_current.inc.php
    branches/Version-1_0-branch/property/setup/tables_update.inc.php
    branches/Version-1_0-branch/property/templates/base/condition_survey.xsl
    branches/Version-1_0-branch/property/templates/base/request.xsl

Added Paths:
-----------
    branches/Version-1_0-branch/manual/inc/class.bodocuments.inc.php
    branches/Version-1_0-branch/manual/inc/class.cat_hooks.inc.php
    branches/Version-1_0-branch/manual/inc/class.menu.inc.php
    branches/Version-1_0-branch/manual/inc/class.uidocuments.inc.php
    branches/Version-1_0-branch/manual/js/
    branches/Version-1_0-branch/manual/setup/default_records.inc.php
    branches/Version-1_0-branch/manual/templates/base/config.tpl
    branches/Version-1_0-branch/manual/templates/base/documents_add.xsl

Property Changed:
----------------
    branches/Version-1_0-branch/
    branches/Version-1_0-branch/manual/help/EN/home.php
    branches/Version-1_0-branch/manual/help/EN/overview.php
    branches/Version-1_0-branch/manual/inc/class.help.inc.php
    branches/Version-1_0-branch/manual/inc/class.help_helper.inc.php
    branches/Version-1_0-branch/manual/inc/class.uimanual.inc.php
    branches/Version-1_0-branch/manual/inc/class.uisupport.inc.php
    branches/Version-1_0-branch/manual/inc/hook_help.inc.php
    branches/Version-1_0-branch/manual/inc/hook_sidebox_menu.inc.php
    branches/Version-1_0-branch/manual/index.php
    branches/Version-1_0-branch/manual/setup/setup.inc.php
    branches/Version-1_0-branch/manual/setup/tables_update.inc.php
    branches/Version-1_0-branch/manual/templates/base/app_data.xsl
    branches/Version-1_0-branch/manual/templates/base/help.tpl
    branches/Version-1_0-branch/manual/templates/base/help.xsl
    branches/Version-1_0-branch/manual/templates/base/help_data.xsl
    branches/Version-1_0-branch/manual/templates/base/odt2html.xsl
    branches/Version-1_0-branch/manual/templates/base/odt2xhtml.xsl
    branches/Version-1_0-branch/manual/templates/base/support.xsl
    branches/Version-1_0-branch/manual/templates/base/sxw2xhtml.xsl


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,11235-11264,11266-11267,11269-11278,11280-11282,11284-11291,11293-11295,11297,11299-11302,11304,11306,11309,11311,11313-11316,11318-11323,11325-11332,11334,11336-11344,11346,11348-11354,11356,11358-11360,11363-11386,11388-11389,11391-11392,11394,11396-11403,11405-11406,11408,11410,11412,11415,11417,11419-11420,11422,11424-11429,11431-11442,11444-11445,11447-11460,11462-11464,11466-11470,11472-11475,11477-11478
   + 
/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,11266-11267,11269-11278,11280-11282,11284-11291,11293-11295,11297,11299-11302,11304,11306,11309,11311,11313-11316,11318-11323,11325-11332,11334,11336-11344,11346,11348-11354,11356,11358-11360,11363-11386,11388-11389,11391-11392,11394,11396-11403,11405-11406,11408,11410,11412,11415,11417,11419-11420,11422,11424-11429,11431-11442,11444-11445,11447-11460,11462-11464,11466-11470,11472-11475,11477-11478,11480-11487

Modified: branches/Version-1_0-branch/frontend/inc/class.borental.inc.php
===================================================================
--- branches/Version-1_0-branch/frontend/inc/class.borental.inc.php     
2013-11-25 12:44:37 UTC (rev 11487)
+++ branches/Version-1_0-branch/frontend/inc/class.borental.inc.php     
2013-11-25 13:18:06 UTC (rev 11488)
@@ -33,6 +33,7 @@
     class frontend_borental
     {
 
+/*             //FIXME Sigurd 22. nov 2013: - not used?
        public static function contract_exist_per_location($contract_id, 
$location_code, $contract_state_identifier)
        {
                $contracts_per_location = 
phpgwapi_cache::session_get('frontend', $contract_state_identifier);
@@ -46,7 +47,7 @@
                }
                return $exist;
        }
-
+*/
        public static function send_contract_message(int $contract_id, string 
$contract_message, string $from_address)
        {
                $contract = 
rental_socontract::get_instance()->get_single($contract_id);

Modified: branches/Version-1_0-branch/frontend/inc/class.uicontract.inc.php
===================================================================
--- branches/Version-1_0-branch/frontend/inc/class.uicontract.inc.php   
2013-11-25 12:44:37 UTC (rev 11487)
+++ branches/Version-1_0-branch/frontend/inc/class.uicontract.inc.php   
2013-11-25 13:18:06 UTC (rev 11488)
@@ -14,15 +14,18 @@
        protected $form_url;
        
        
-       public $public_functions = array(
-            'index'     => true
+       public $public_functions = array
+       (
+               'index'  => true
        );
 
        public function __construct()
        {
                parent::__construct();
+//             $this->get_contracts_per_location();
        }
        
+
        /**
         * Show single contract details
         */
@@ -36,19 +39,19 @@
                // The user wants to change the contract status filter
                if(isset($filter)) 
                {
-                               $this->contract_filter = $filter;
-                               phpgwapi_cache::session_set('frontend', 
'contract_filter', $filter);                            
+                       $this->contract_filter = $filter;
+                       phpgwapi_cache::session_set('frontend', 
'contract_filter', $filter);                            
 
-                               // ... if the user changes filter that may 
cause the
-                               if($filter == 'active' || $filter == 
'not_active')
-                               {
-                                       $change_contract = true;
-                               }       
+                       // ... if the user changes filter that may cause the
+                       if($filter == 'active' || $filter == 'not_active')
+                       {
+                               $change_contract = true;
+                       }       
                }
                else
                {
                        $filter = phpgwapi_cache::session_get('frontend', 
'contract_filter');
-                       $this->contract_filter = isset($filter) ? $filter : 
'active';
+                       $this->contract_filter = isset($filter) && $filter ? 
$filter : 'active';
                }
                
                if(isset($_POST['send']))
@@ -99,9 +102,12 @@
                // The current state of the contract view of this user's session
                $this->contract_state = phpgwapi_cache::session_get('frontend', 
$this->contract_state_identifier);
                $new_contract = phpgw::get_var('contract_id');
-               $contracts_per_location = 
phpgwapi_cache::session_get('frontend', 
$this->contracts_per_location_identifier);
+
+               $contracts_per_location = $this->get_contracts_per_location();
+
                $contracts_for_selection = array();
                $number_of_valid_contracts = 0;
+
                
foreach($contracts_per_location[$this->header_state['selected_location']] as 
$contract)
                {
                        if(     ($this->contract_filter == 'active' && 
$contract->is_active()) ||
@@ -186,9 +192,105 @@
                                'form_url' => $this->form_url
                        )
                );
-                       
+                                       
                $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('app_data' => 
$data));
                
$GLOBALS['phpgw']->xslttpl->add_file(array('frontend','contract'));
+       }
+
+
+       private function get_contracts_per_location()
+       {
+               $org_unit = $this->header_state['selected_org_unit'];
+               if($org_unit == 'all' || $org_unit == 'none')
+               {
+                       phpgwapi_cache::message_set('Velg organisasjon', 
'error');
+                       return array();
+               }
+
+               $values = phpgwapi_cache::session_get('frontend', 
$this->contracts_per_location_identifier);
                
+               if(isset($values[$org_unit]))
+               {
+                       return $values[$org_unit];
+               }
+
+               $parties = rental_soparty::get_instance()->get(null, null, 
null, null, null, null, array('org_unit_id' => $org_unit));
+
+               $types = 
rental_socontract::get_instance()->get_fields_of_responsibility();
+               $location_id_internal = 
array_search('contract_type_internleie', $types);
+               $location_id_in = array_search('contract_type_innleie', $types);
+               $location_id_ex = array_search('contract_type_eksternleie', 
$types);
+
+               $contracts_per_location         = array();
+               $contracts_in_per_location      = array();
+               $contracts_ex_per_location      = array();
+               
+               //For all parties connected to the internal organization unit
+               foreach($parties as $party)
+               {
+                       //... get the contracts
+                       $contracts = 
rental_socontract::get_instance()->get(null, null, null, null, null, null, 
array('party_id' => $party->get_id()));
+                       //... and for each contract connected to this contract 
part
+                       foreach($contracts as $id => $contract)
+                       {
+                               //... get the composites
+                               $composites = 
rental_socomposite::get_instance()->get(null, null, null, null, null, null, 
array('contract_id' => $contracts[$id]->get_id()));
+
+                               //...and for each composite in the contract in 
which this contract part is connected
+                               foreach($composites as $composite)
+                               {
+                                       //... get the units
+                                       $units = $composite->get_units();
+
+                                       //... and for each unit retrieve the 
property locations we are after
+                                       foreach($units as $unit)
+                                       {
+                                               $property_location = 
$unit->get_location();
+                                               
$property_locations[$property_location->get_location_code()] = 
$property_location;
+
+                                               // Contract holders: 
contracts_per_location (internal) and contracts_in_per_location (in)
+
+                                               // Internal contract should 
have impact on total price
+                                               if($contract->get_location_id() 
== $location_id_internal)
+                                               {
+                                                       $total_price = 
rental_socontract_price_item::get_instance()->get_total_price($contract->get_id());
+                                                       
$contract->set_total_price($total_price);
+
+                                                       
if(!is_array($contracts_per_location[$org_unit][$property_location->get_location_code()]))
+                                                       {
+                                                               
$contracts_per_location[$org_unit][$property_location->get_location_code()] = 
array();
+                                                       }
+                                                       
array_push($contracts_per_location[$org_unit][$property_location->get_location_code()],
 $contract);
+                                               }
+                                               else 
if($contract->get_location_id() == $location_id_in)
+                                               {
+                                                       $total_price = 
rental_socontract_price_item::get_instance()->get_total_price($contract->get_id());
+                                                       
$contract->set_total_price($total_price);
+
+                                                       
if(!is_array($contracts_in_per_location[$org_unit][$property_location->get_location_code()]))
+                                                       {
+                                                               
$contracts_in_per_location[$org_unit][$property_location->get_location_code()] 
= array();
+                                                       }
+                                                       
array_push($contracts_in_per_location[$org_unit][$property_location->get_location_code()],
 $contract);
+                                               }
+                                               else 
if($contract->get_location_id() == $location_id_ex)
+                                               {
+                                                       $total_price = 
rental_socontract_price_item::get_instance()->get_total_price($contract->get_id());
+                                                       
$contract->set_total_price($total_price);
+
+                                                       
if(!is_array($contracts_ex_per_location[$org_unit][$property_location->get_location_code()]))
+                                                       {
+                                                               
$contracts_ex_per_location[$org_unit][$property_location->get_location_code()] 
= array();
+                                                       }
+                                                       
array_push($contracts_ex_per_location[$org_unit][$property_location->get_location_code()],
 $contract);
+                                               }
+                                       }
+                               }
+                       }
+               }
+               phpgwapi_cache::session_set('frontend', 
'contracts_per_location', $contracts_per_location);
+               phpgwapi_cache::session_set('frontend', 
'contracts_in_per_location', $contracts_in_per_location);
+               phpgwapi_cache::session_set('frontend', 
'contracts_ex_per_location', $contracts_ex_per_location);
+               return $$this->contracts_per_location_identifier[$org_unit];
        }
 }

Modified: branches/Version-1_0-branch/frontend/inc/class.uicontract_ex.inc.php
===================================================================
--- branches/Version-1_0-branch/frontend/inc/class.uicontract_ex.inc.php        
2013-11-25 12:44:37 UTC (rev 11487)
+++ branches/Version-1_0-branch/frontend/inc/class.uicontract_ex.inc.php        
2013-11-25 13:18:06 UTC (rev 11488)
@@ -31,7 +31,8 @@
                {
                        $this->contract_state_identifier = "contract_state_ex";
                        $this->contracts_per_location_identifier = 
"contracts_ex_per_location";
-                       $this->form_url = 
"index.php?menuaction=frontend.uicontract_ex.index";
+               //      $this->form_url = 
"index.php?menuaction=frontend.uicontract_ex.index";
+                       $this->form_url = 
$GLOBALS['phpgw']->link('/',array('menuaction' => 
'frontend.uicontract_ex.index'));
                        
phpgwapi_cache::session_set('frontend','tab',$GLOBALS['phpgw']->locations->get_id('frontend','.rental.contract_ex'));
                        parent::__construct();
                }

Modified: branches/Version-1_0-branch/frontend/inc/class.uicontract_in.inc.php
===================================================================
--- branches/Version-1_0-branch/frontend/inc/class.uicontract_in.inc.php        
2013-11-25 12:44:37 UTC (rev 11487)
+++ branches/Version-1_0-branch/frontend/inc/class.uicontract_in.inc.php        
2013-11-25 13:18:06 UTC (rev 11488)
@@ -8,7 +8,8 @@
        {
                $this->contract_state_identifier = "contract_state_in";
                $this->contracts_per_location_identifier = 
"contracts_in_per_location";
-               $this->form_url = 
"index.php?menuaction=frontend.uicontract_in.index";
+//             $this->form_url = 
"index.php?menuaction=frontend.uicontract_in.index";
+               $this->form_url = 
$GLOBALS['phpgw']->link('/',array('menuaction' => 
'frontend.uicontract_in.index'));
                
phpgwapi_cache::session_set('frontend','tab',$GLOBALS['phpgw']->locations->get_id('frontend','.rental.contract_in'));
                parent::__construct();
        }

Modified: 
branches/Version-1_0-branch/frontend/inc/class.uicontract_internal.inc.php
===================================================================
--- branches/Version-1_0-branch/frontend/inc/class.uicontract_internal.inc.php  
2013-11-25 12:44:37 UTC (rev 11487)
+++ branches/Version-1_0-branch/frontend/inc/class.uicontract_internal.inc.php  
2013-11-25 13:18:06 UTC (rev 11488)
@@ -8,7 +8,8 @@
        {
                $this->contract_state_identifier = "contract_state";
                $this->contracts_per_location_identifier = 
"contracts_per_location";
-               $this->form_url = 
"index.php?menuaction=frontend.uicontract_internal.index";
+       //      $this->form_url = 
"index.php?menuaction=frontend.uicontract_internal.index";
+               $this->form_url = 
$GLOBALS['phpgw']->link('/',array('menuaction' => 
'frontend.uicontract_internal.index'));
                
phpgwapi_cache::session_set('frontend','tab',$GLOBALS['phpgw']->locations->get_id('frontend','.rental.contract'));
                parent::__construct();
        }

Modified: branches/Version-1_0-branch/frontend/inc/class.uifrontend.inc.php
===================================================================
--- branches/Version-1_0-branch/frontend/inc/class.uifrontend.inc.php   
2013-11-25 12:44:37 UTC (rev 11487)
+++ branches/Version-1_0-branch/frontend/inc/class.uifrontend.inc.php   
2013-11-25 13:18:06 UTC (rev 11488)
@@ -346,7 +346,8 @@
                        $vfs->override_acl = 1;
 
                        $file = array('string' => $fileName, RELATIVE_NONE);
-                       if($vfs->file_exists($file)){
+                       if($vfs->file_exists($file))
+                       {
                                $help_in_vfs = true;
                        }
 
@@ -358,7 +359,9 @@
                                                        'menuaction'=> 
'frontend.uidocumentupload.read_helpfile_from_vfs',
                                                        'app' => 'frontend'
                                                 )) . "','700','600')";
-                       }else{
+                       }
+                       else
+                       {
                                $help_url = "javascript:openwindow('"
                                                 . 
$GLOBALS['phpgw']->link('/index.php', array
                                                 (


Property changes on: branches/Version-1_0-branch/manual/help/EN/home.php
___________________________________________________________________
Modified: svn:keywords
   - Id
   + Revision Author Id


Property changes on: branches/Version-1_0-branch/manual/help/EN/overview.php
___________________________________________________________________
Modified: svn:keywords
   - Id
   + Revision Author Id

Copied: branches/Version-1_0-branch/manual/inc/class.bodocuments.inc.php (from 
rev 11487, trunk/manual/inc/class.bodocuments.inc.php)
===================================================================
--- branches/Version-1_0-branch/manual/inc/class.bodocuments.inc.php            
                (rev 0)
+++ branches/Version-1_0-branch/manual/inc/class.bodocuments.inc.php    
2013-11-25 13:18:06 UTC (rev 11488)
@@ -0,0 +1,106 @@
+<?php
+       /**
+       * phpGroupWare - manual
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2012 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * This file is part of phpGroupWare.
+       *
+       * phpGroupWare is free software; you can redistribute it and/or modify
+       * it under the terms of the GNU General Public License as published by
+       * the Free Software Foundation; either version 2 of the License, or
+       * (at your option) any later version.
+       *
+       * phpGroupWare is distributed in the hope that it will be useful,
+       * but WITHOUT ANY WARRANTY; without even the implied warranty of
+       * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+       * GNU General Public License for more details.
+       *
+       * You should have received a copy of the GNU General Public License
+       * along with phpGroupWare; if not, write to the Free Software
+       * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 
 USA
+       *
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package manual
+        */
+
+       class manual_bodocuments
+       {
+               var $start;
+               var $query;
+               var $filter;
+               var $sort;
+               var $order;
+               var $cat_id;
+               var $location_info = array();
+               var $appname;
+               var $allrows;
+               public $acl_location = '.documents';
+
+               var $public_functions = array
+               (
+                       'addfiles'              => true
+               );
+
+               function __construct()
+               {
+
+               }
+
+               public function addfiles()
+               {
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
+                       $GLOBALS['phpgw_info']['flags']['noframework'] = true;
+                       $GLOBALS['phpgw_info']['flags']['nofooter'] = true;
+
+                       $acl                    = & $GLOBALS['phpgw']->acl;
+                       $acl_add                = 
$acl->check($this->acl_location, PHPGW_ACL_ADD, 'manual');
+                       $acl_edit               = 
$acl->check($this->acl_location, PHPGW_ACL_EDIT, 'manual');
+                       $cat_id                 = phpgw::get_var('id', 'int');
+                       $check                  = phpgw::get_var('check', 
'bool');
+                       $fileuploader   = CreateObject('property.fileuploader');
+
+                       if(!$acl_add && !$acl_edit)
+                       {
+                               $GLOBALS['phpgw']->common->phpgw_exit();
+                       }
+
+                       if(!$cat_id)
+                       {
+                               $GLOBALS['phpgw']->common->phpgw_exit();
+                       }
+
+                       $test = false;
+
+                       if ($test)
+                       {
+                               if (!empty($_FILES))
+                               {
+                                       $tempFile = 
$_FILES['Filedata']['tmp_name'];
+                                       $targetPath = 
"{$GLOBALS['phpgw_info']['server']['temp_dir']}/";
+                                       $targetFile =  
str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];
+                                       
move_uploaded_file($tempFile,$targetFile);
+                                       echo 
str_replace($GLOBALS['phpgw_info']['server']['temp_dir'],'',$targetFile);
+                               }
+                               $GLOBALS['phpgw']->common->phpgw_exit();
+                       }
+       
+                       if($check)
+                       {
+                               $fileuploader->check($cat_id, '/manual');
+                       }
+                       else
+                       {
+                               $fileuploader->upload($cat_id, '/manual');
+                       }
+               }
+
+       }

Copied: branches/Version-1_0-branch/manual/inc/class.cat_hooks.inc.php (from 
rev 11487, trunk/manual/inc/class.cat_hooks.inc.php)
===================================================================
--- branches/Version-1_0-branch/manual/inc/class.cat_hooks.inc.php              
                (rev 0)
+++ branches/Version-1_0-branch/manual/inc/class.cat_hooks.inc.php      
2013-11-25 13:18:06 UTC (rev 11488)
@@ -0,0 +1,170 @@
+<?php
+       /**
+       * phpGroupWare - property: a Facilities Management System.
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003,2004,2005,2006,2007 Free Software 
Foundation, Inc. http://www.fsf.org/
+       * This file is part of phpGroupWare.
+       *
+       * phpGroupWare is free software; you can redistribute it and/or modify
+       * it under the terms of the GNU General Public License as published by
+       * the Free Software Foundation; either version 2 of the License, or
+       * (at your option) any later version.
+       *
+       * phpGroupWare is distributed in the hope that it will be useful,
+       * but WITHOUT ANY WARRANTY; without even the implied warranty of
+       * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+       * GNU General Public License for more details.
+       *
+       * You should have received a copy of the GNU General Public License
+       * along with phpGroupWare; if not, write to the Free Software
+       * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 
 USA
+       *
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package property
+       * @subpackage entity
+       * @version $Id$
+       */
+
+       /**
+       * hook management for categories
+       * @package property
+       */
+       class manual_cat_hooks
+       {
+               private $basedir;
+               private $fakebase;
+
+               function __construct()
+               {
+                       $fakebase = '/manual';
+                       $this->vfs     = CreateObject('phpgwapi.vfs');
+                       $this->basedir = $this->vfs->basedir;
+                       $this->fakebase = $fakebase;
+                       $this->vfs->fakebase = $this->fakebase;
+
+                       if(!$this->vfs->file_exists(array(
+                               'string' => $this->fakebase,
+                               'relatives' => array(RELATIVE_NONE)
+                       )))
+                       {
+                               if 
(!$this->create_document_dir($this->fakebase))
+                               {
+                                       throw new Exception("unable to create 
{$this->fakebase}");
+                               }
+                       }
+               }
+
+
+               /**
+                * Handle a new category being added, create location to hold 
ACL-data
+                */
+               function cat_add($data)
+               {
+                       if ( isset($data['cat_owner']) && $data['cat_owner'] != 
-1 )
+                       {
+                               return false; //nothing needed to be done, we 
only care about global cats
+                       }
+                       if($data['location_id'])
+                       {
+                               $dir = "{$this->fakebase}/{$data['cat_id']}";
+                               if (!$this->create_document_dir($dir))
+                               {
+                                       throw new Exception("unable to create 
{$this->fakebase}");
+                               }
+                       }
+               }
+
+               /**
+                * Handle a category being deleted, remove the location 
+                */
+               function cat_delete($data)
+               {
+                       if ( isset($data['cat_owner']) && $data['cat_owner'] != 
-1 )
+                       {
+                               return false; //nothing needed to be done, we 
only care about global cats
+                       }
+                       if($data['location_id'])
+                       {
+                               $dir = "{$this->fakebase}/{$data['cat_id']}";
+
+                               $this->vfs->override_acl = 1;
+                               if(!$this->vfs->rm(array(
+                                       'string' => $dir,
+                                       'relatives' => array(
+                                               RELATIVE_NONE
+                                       )
+                               )))
+                               {
+                                       $message = lang('failed to remove 
directory') . ' :'. $dir;
+                                       phpgwapi_cache::message_set($message, 
'error');
+                               }
+                               else
+                               {
+                                       $message = lang('directory deleted') . 
' :'. $dir;
+                                       phpgwapi_cache::message_set($message, 
'message');
+                               }
+                               $this->vfs->override_acl = 0;
+                       }
+               }
+
+               /**
+                * Handle a category being edited, update the location info
+                */
+               function cat_edit($data)
+               {
+                       if ( isset($data['cat_owner']) && $data['cat_owner'] != 
-1 )
+                       {
+                               return false; //nothing needed to be done, we 
only care about global cats
+                       }
+
+//_debug_array($data);die();
+                       if($data['location_id'])
+                       {
+                               $dir = "{$this->fakebase}/{$data['cat_id']}";
+                               if(!$this->vfs->file_exists(array(
+                                       'string' => $dir,
+                                       'relatives' => array(RELATIVE_NONE)
+                               )))
+                               {
+                                       if (!$this->create_document_dir($dir))
+                                       {
+                                               throw new Exception("unable to 
create {$dir}");
+                                       }
+                               }
+                       }
+               }
+
+               /**
+                * Create catalog - starting with fakebase
+                *
+                * @param string $type part of path pointing to end target
+                *
+                * @return bool true on success.
+                */
+
+               private function create_document_dir($dir)
+               {
+                       $ok = false;
+                       $this->vfs->override_acl = 1;
+                       if(!$this->vfs->mkdir(array(
+                               'string' => $dir,
+                               'relatives' => array(
+                                       RELATIVE_NONE
+                               )
+                       )))
+                       {
+                               $message = lang('failed to create directory') . 
' :'. $dir;
+                               phpgwapi_cache::message_set($message, 'error');
+                       }
+                       else
+                       {
+                               $message = lang('directory created') . ' :'. 
$dir;
+                               phpgwapi_cache::message_set($message, 
'message');
+                               $ok = true;
+                       }
+                       $this->vfs->override_acl = 0;
+                       return $ok;
+               }
+       }


Property changes on: branches/Version-1_0-branch/manual/inc/class.help.inc.php
___________________________________________________________________
Modified: svn:keywords
   - Id
   + Revision Author Id


Property changes on: 
branches/Version-1_0-branch/manual/inc/class.help_helper.inc.php
___________________________________________________________________
Modified: svn:keywords
   - Id
   + Revision Author Id

Copied: branches/Version-1_0-branch/manual/inc/class.menu.inc.php (from rev 
11487, trunk/manual/inc/class.menu.inc.php)
===================================================================
--- branches/Version-1_0-branch/manual/inc/class.menu.inc.php                   
        (rev 0)
+++ branches/Version-1_0-branch/manual/inc/class.menu.inc.php   2013-11-25 
13:18:06 UTC (rev 11488)
@@ -0,0 +1,110 @@
+<?php
+       /**
+        * Admin - Menus
+        *
+        * @author Dave Hall <address@hidden>
+        * @copyright Copyright (C) 2007 - 2008 Free Software Foundation, Inc. 
http://www.fsf.org/
+        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+        * @package addressbook
+        * @version $Id$
+        */
+
+       /*
+          This program is free software: you can redistribute it and/or modify
+          it under the terms of the GNU General Public License as published by
+          the Free Software Foundation, either version 2 of the License, or
+          (at your option) any later version.
+
+          This program is distributed in the hope that it will be useful,
+          but WITHOUT ANY WARRANTY; without even the implied warranty of
+          MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+          GNU General Public License for more details.
+
+          You should have received a copy of the GNU General Public License
+          along with this program.  If not, see <http://www.gnu.org/licenses/>.
+        */
+
+
+       /**
+        * Menus
+        *
+        * @package admin
+        */
+       class manual_menu
+       {
+               /**
+                * Get the menus for admin
+                *
+                * @return array available menus for the current user
+                */
+               function get_menu()
+               {
+                       $menus = array();
+
+                       $menus['navbar'] = array
+                       (
+                               'manual'        => array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('manual', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', 
+                                                               array
+                                                               (
+                                                                       
'menuaction'            => 'manual.uidocuments.index'
+                                                               )
+                                                       ),
+                                       'image' => array('hrm', 'navbar'),
+                                       'order' => -5,
+                                       'group' => 'systools'
+                               )
+                       );
+
+                       $menus['admin'] = array();
+
+                       if ( $GLOBALS['phpgw']->acl->check('run', 
phpgwapi_acl::READ, 'admin'))
+                       {
+                               $menus['admin'] = array
+                               (
+                                       'index' => array
+                                       (
+                                               'text'  => 
$GLOBALS['phpgw']->translation->translate('Categories', array(), true),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', 
+                                                               array
+                                                               (
+                                                                       
'menuaction'            => 'admin.uicategories.index',
+                                                                       
'appname'                       => 'manual',
+                                                                       
'location'                      => '.documents',
+                                                                       
'global_cats'           => 'true',
+                                                                       
'menu_selection'        => 'admin::manual::index'
+                                                               )
+                                                       )
+                                       ),
+                                       'acl'   => array
+                                       (
+                                               'text'  => lang('Configure 
Access Permissions'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'preferences.uiadmin_acl.list_acl', 'acl_app' => 'manual') )
+                                       )
+                               );
+                       }
+
+
+                       $menus['navigation'] =  array
+                       (
+                               'add' => array
+                               (
+                                       'text'  => lang('add'),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array( 'menuaction' => 
'manual.uidocuments.add' )),
+                                       'image' => array('property', 
'location_1'),
+                               ),
+                       );
+
+                       if ( 
isset($GLOBALS['phpgw_info']['user']['apps']['preferences']) )
+                       {
+                               $menus['preferences'] = array();
+                       }
+
+                       $menus['toolbar'] = array();
+
+
+                       return $menus;
+               }
+       }

Copied: branches/Version-1_0-branch/manual/inc/class.uidocuments.inc.php (from 
rev 11487, trunk/manual/inc/class.uidocuments.inc.php)
===================================================================
--- branches/Version-1_0-branch/manual/inc/class.uidocuments.inc.php            
                (rev 0)
+++ branches/Version-1_0-branch/manual/inc/class.uidocuments.inc.php    
2013-11-25 13:18:06 UTC (rev 11488)
@@ -0,0 +1,661 @@
+<?php
+
+       /**
+        * phpGroupWare - property: a part of a Facilities Management System.
+        *
+        * @author Sigurd Nes <address@hidden>
+        * @copyright Copyright (C) 2012 Free Software Foundation, Inc. 
http://www.fsf.org/
+        * This file is part of phpGroupWare.
+        *
+        * phpGroupWare is free software; you can redistribute it and/or modify
+        * it under the terms of the GNU General Public License as published by
+        * the Free Software Foundation; either version 2 of the License, or
+        * (at your option) any later version.
+        *
+        * phpGroupWare is distributed in the hope that it will be useful,
+        * but WITHOUT ANY WARRANTY; without even the implied warranty of
+        * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+        * GNU General Public License for more details.
+        *
+        * You should have received a copy of the GNU General Public License
+        * along with phpGroupWare; if not, write to the Free Software
+        * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  
02110-1301  USA
+        *
+        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/
+        * @package property
+        * @subpackage logistic
+        * @version $Id$
+        */
+       phpgw::import_class('phpgwapi.uicommon');
+       phpgw::import_class('phpgwapi.jquery');
+
+       class manual_uidocuments extends phpgwapi_uicommon
+       {
+
+               private $bo;
+               private $receipt = array();
+               public $public_functions = array
+               (
+                       'query'                                         => true,
+                       'index'                                         => true,
+                       'view'                                          => true,
+                       'add'                                           => true,
+                       'edit'                                          => true,
+                       'save'                                          => true,
+                       'delete'                                        => true,
+                       'delete_imported_records'       => true,
+                       'get_vendors'                           => true,
+                       'get_users'                                     => true,
+                       'edit_survey_title'                     => true,
+                       'get_files'                                     => true,
+                       'get_request'                           => true,
+                       'get_summation'                         => true,
+                       'view_file'                                     => true,
+                       'import'                                        => true,
+                       'download'                                      => true
+               );
+
+               public function __construct()
+               {
+                       parent::__construct();
+
+                       $this->bo                                       = 
CreateObject('property.bocondition_survey');
+                       $this->bocommon                         = & 
$this->bo->bocommon;
+                       $this->acl                                      = & 
$GLOBALS['phpgw']->acl;
+                       $this->acl_location                     = '.documents';
+                       $this->acl_read                         = 
$this->acl->check($this->acl_location, PHPGW_ACL_READ, 'manual');
+                       $this->acl_add                          = 
$this->acl->check($this->acl_location, PHPGW_ACL_ADD, 'manual');
+                       $this->acl_edit                         = 
$this->acl->check($this->acl_location, PHPGW_ACL_EDIT, 'manual');
+                       $this->acl_delete                       = 
$this->acl->check($this->acl_location, PHPGW_ACL_DELETE, 'manual');
+                       $this->acl_manage                       = 
$this->acl->check($this->acl_location, 16, 'manual');
+
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
"manual";
+               }
+
+
+               public function download()
+               {
+                       if(!$this->acl_read)
+                       {
+                               $this->bocommon->no_access();
+                               return;
+                       }
+
+                       $values = $this->query();
+
+                       $descr = array();
+                       $columns = array();
+                       $columns[]      = 'id';
+                       $columns[]      = 'title';
+                       $columns[]      = 'descr';
+                       $columns[]      = 'address';
+                       $columns[]      = 'cnt';
+
+                       foreach($columns as $_column)
+                       {
+                               $descr[] = lang(str_replace('_', ' ', 
$_column));
+                       }
+
+                       $this->bocommon->download($values,$columns,$descr);
+
+               }
+
+
+               public function index()
+               {
+                       if(!$this->acl_read)
+                       {
+                               $this->bocommon->no_access();
+                               return;
+                       }
+
+                       if (phpgw::get_var('phpgw_return_as') == 'json')
+                       {
+                               return $this->query();
+                       }
+
+                       self::add_javascript('phpgwapi', 'yahoo', 
'datatable.js');
+                       phpgwapi_yui::load_widget('datatable');
+                       phpgwapi_yui::load_widget('paginator');
+
+                       $categories = $this->_get_categories();
+
+
+                       $data = array(
+                               'datatable_name'        => lang('condition 
survey'),
+                               'form' => array(
+                                       'toolbar' => array(
+                                               'item' => array(
+                                                       array('type' => 
'filter',
+                                                               'name' => 
'cat_id',
+                                                               'text' => 
lang('category') . ':',
+                                                               'list' => 
$categories,
+                                                       ),
+                                                       array('type' => 'text',
+                                                               'text' => 
lang('search'),
+                                                               'name' => 
'query'
+                                                       ),
+                                                       array(
+                                                               'type' => 
'submit',
+                                                               'name' => 
'search',
+                                                               'value' => 
lang('Search')
+                                                       ),
+                                                       array(
+                                                               'type' => 
'link',
+                                                               'value' => 
lang('new'),
+                                                               'href' => 
self::link(array('menuaction' => 'property.uicondition_survey.add')),
+                                                               'class' => 
'new_item'
+                                                       ),
+                                                       array(
+                                                               'type' => 
'link',
+                                                               'value' => 
lang('download'),
+                                                               'href' => 
'javascript:window.open("'. self::link(array('menuaction' => 
'property.uicondition_survey.download', 'export' => true, 'allrows' => true)) . 
'","window")',
+                                                               'class' => 
'new_item'
+                                                       ),
+                                                       array(
+                                                               'type' => 
'link',
+                                                               'value' => 
$_SESSION['allrows'] ? lang('Show only active') : lang('Show all'),
+                                                               'href' => 
self::link(array('menuaction' => 'property.uicondition_survey.index', 'allrows' 
=> true))
+                                                       ),
+
+                                               ),
+                                       ),
+                               ),
+                               'datatable' => array(
+                                       'source' => 
self::link(array('menuaction' => 'property.uicondition_survey.index', 
'phpgw_return_as' => 'json')),
+                                       'editor_action' => 
'property.uicondition_survey.edit_survey_title',
+                                       'field' => array(
+                                               array(
+                                                       'key' => 'id',
+                                                       'label' => lang('ID'),
+                                                       'sortable' => true,
+                                                       'formatter' => 
'YAHOO.portico.formatLink'
+                                               ),
+               /*                              array(
+                                                       'key' => 'title',
+                                                       'label' => 
lang('title'),
+                                                       'sortable' => true,
+                                                       'editor' => 'new 
YAHOO.widget.TextboxCellEditor({disableBtns:false})'
+                                               ),
+                                               array(
+                                                       'key' => 'descr',
+                                                       'label' => 
lang('description'),
+                                                       'sortable' => false,
+                                               ),*/
+                                               array(
+                                                       'key' => 'address',
+                                                       'label' => 
lang('buildingname'),
+                                                       'sortable' => true
+                                               ),
+                                               array(
+                                                       'key' => 'vendor',
+                                                       'label' => 
lang('vendor'),
+                                                       'sortable' => true
+                                               ),
+                                               array(
+                                                       'key' => 'year',
+                                                       'label' => lang('year'),
+                                                       'sortable' => true,
+                                               ),
+                                               array(
+                                                       'key' => 'multiplier',
+                                                       'label' => 
lang('multiplier'),
+                                                       'sortable' => false,
+                                               ),
+                                               array(
+                                                       'key' => 'cnt',
+                                                       'label' => 
lang('count'),
+                                                       'sortable' => false,
+                                               ),
+                                               array(
+                                                       'key' => 'link',
+                                                       'hidden' => true
+                                               )
+                                       )
+                               ),
+                       );
+
+                       $parameters = array
+                               (
+                                       'parameter' => array
+                                       (
+                                               array
+                                               (
+                                                       'name'          => 'id',
+                                                       'source'        => 'id'
+                                               ),
+                                       )
+                               );
+
+                       $data['datatable']['actions'][] = array
+                                       (
+                                               'my_name'               => 
'view_survey',
+                                               'text'                  => 
lang('view'),
+                                               'action'                => 
$GLOBALS['phpgw']->link('/index.php',array
+                                               (
+                                                       'menuaction'    => 
'property.uicondition_survey.view'
+                                               )),
+                                               'parameters'    => 
json_encode($parameters)
+                                       );
+
+                       $data['datatable']['actions'][] = array
+                                       (
+                                               'my_name'               => 
'edit_survey',
+                                               'text'                  => 
lang('edit'),
+                                               'action'                => 
$GLOBALS['phpgw']->link('/index.php',array
+                                               (
+                                                       'menuaction'    => 
'property.uicondition_survey.edit'
+                                               )),
+                                               'parameters'    => 
json_encode($parameters)
+                                       );
+
+                       $data['datatable']['actions'][] = array
+                                       (
+                                               'my_name'               => 
'import_survey',
+                                               'text'                  => 
lang('import'),
+                                               'action'                => 
$GLOBALS['phpgw']->link('/index.php',array
+                                               (
+                                                       'menuaction'    => 
'property.uicondition_survey.import'
+                                               )),
+                                               'parameters'    => 
json_encode($parameters)
+                                       );
+
+
+                       if($GLOBALS['phpgw']->acl->check('.admin', 
PHPGW_ACL_DELETE, 'property'))
+                       {
+                               $data['datatable']['actions'][] = array
+                                       (
+                                               'my_name'               => 
'delete_imported_records',
+                                               'text'                  => 
lang('delete imported records'),
+                                               'confirm_msg'   => lang('do you 
really want to delete this entry') . '?',
+                                               'action'                => 
$GLOBALS['phpgw']->link('/index.php',array
+                                               (
+                                                       'menuaction'    => 
'property.uicondition_survey.delete_imported_records'
+                                               )),
+                                               'parameters'    => 
json_encode($parameters)
+                                       );
+                       }
+
+                       if($GLOBALS['phpgw']->acl->check('.admin', 
PHPGW_ACL_DELETE, 'property'))
+                       {
+                               $data['datatable']['actions'][] = array
+                                       (
+                                               'my_name'               => 
'delete_survey',
+                                               'text'                  => 
lang('delete'),
+                                               'confirm_msg'   => lang('do you 
really want to delete this entry') . '?',
+                                               'action'                => 
$GLOBALS['phpgw']->link('/index.php',array
+                                               (
+                                                       'menuaction'    => 
'property.uicondition_survey.delete'
+                                               )),
+                                               'parameters'    => 
json_encode($parameters)
+                                       );
+                       }
+
+                       self::render_template_xsl('datatable_common', $data);
+               }
+
+
+               public function query()
+               {
+                       $params = array(
+                               'start' => phpgw::get_var('startIndex', 'int', 
'REQUEST', 0),
+                               'results' => phpgw::get_var('results', 'int', 
'REQUEST', 0),
+                               'query' => phpgw::get_var('query'),
+                               'sort' => phpgw::get_var('sort'),
+                               'dir' => phpgw::get_var('dir'),
+                               'cat_id' => phpgw::get_var('cat_id', 'int', 
'REQUEST', 0),
+                               'allrows' => phpgw::get_var('allrows', 'bool')
+                       );
+
+                       $result_objects = array();
+                       $result_count = 0;
+
+                       $values = $this->bo->read($params);
+                       if ( phpgw::get_var('export', 'bool'))
+                       {
+                               return $values;
+                       }
+
+                       $result_data = array('results' => $values);
+
+                       $result_data['total_records'] = 
$this->bo->total_records;
+                       $result_data['start'] = $params['start'];
+                       $result_data['sort'] = $params['sort'];
+                       $result_data['dir'] = $params['dir'];
+
+                       array_walk(     $result_data['results'], array($this, 
'_add_links'), "property.uicondition_survey.view" );
+
+                       return $this->yui_results($result_data);
+               }
+
+
+               public function view()
+               {
+                       if(!$this->acl_read)
+                       {
+                               $this->bocommon->no_access();
+                               return;
+                       }
+                       $this->edit(null, $mode = 'view');
+               }
+
+               public function add()
+               {
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
"manual::add";
+                       $this->edit();
+               }
+
+               /**
+               * Prepare data for view and edit - depending on mode
+               *
+               * @param int    $cat_id  type of documents
+               * @param string $mode    edit or view
+               *
+               * @return void
+               */
+
+               public function edit($cat_id = 0, $mode = 'edit')
+               {
+                       if(!$cat_id)
+                       {
+                               $cat_id = phpgw::get_var('cat_id', 'int');
+                       }
+
+                       if(!$this->acl_add && !$this->acl_edit)
+                       {
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'manual.uidocuments.view', 'cat_id'=> $cat_id));
+                       }
+
+                       if($mode == 'view')
+                       {
+                               if( !$this->acl_read)
+                               {
+                                       $this->bocommon->no_access();
+                                       return;
+                               }
+                       }
+                       else
+                       {
+                               if(!$this->acl_add && !$this->acl_edit)
+                               {
+                                       $this->bocommon->no_access();
+                                       return;
+                               }
+                       }
+
+
+                       $categories = $this->_get_categories($cat_id);
+
+
+                       $msgbox_data = 
$this->bocommon->msgbox_data($this->receipt);
+
+                       $file_def = array
+                       (
+                               array('key' => 
'file_name','label'=>lang('Filename'),'sortable'=>false,'resizeable'=>true),
+                               array('key' => 
'delete_file','label'=>lang('Delete 
file'),'sortable'=>false,'resizeable'=>true),
+                       );
+
+
+                       $datatable_def = array();
+                       $datatable_def[] = array
+                       (
+                               'container'             => 
'datatable-container_0',
+                               'requestUrl'    => 
json_encode(self::link(array('menuaction' => 'manual.uidocuments.get_files', 
'cat_id' => $cat_id,'phpgw_return_as'=>'json'))),
+                               'ColumnDefs'    => $file_def,
+
+                       );
+
+                       $data = array
+                       (
+                               'datatable_def'                                 
=> $datatable_def,
+                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'categories'                                    
=> array('options' => $categories),
+                               'editable'                                      
        => $mode == 'edit',
+                               'multiple_uploader'                             
=> $mode == 'edit' ? true : '',
+                       );
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . '::' . lang('condition survey');
+
+                       if($mode == 'edit')
+                       {
+                               phpgwapi_jquery::load_widget('core');
+                               self::add_javascript('phpgwapi', 'yui3', 
'yui/yui-min.js');
+                               self::add_javascript('phpgwapi', 'yui3', 
'gallery-formvalidator/gallery-formvalidator-min.js');
+                               
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yui3/gallery-formvalidator/validatorCss.css');
+                       }
+
+                       self::add_javascript('manual', 'portico', 
'documents.add.js');
+
+                       self::add_javascript('phpgwapi', 'tinybox2', 
'packed.js');
+                       
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/tinybox2/style.css');
+
+//                     $GLOBALS['phpgw_info']['server']['no_jscombine'] = true;
+
+                       self::render_template_xsl(array('documents_add'), 
$data);
+               }
+
+
+               /**
+               * Saves an entry to the database for new/edit - redirects to 
view
+               *
+               * @param int  $id  entity id - no id means 'new'
+               *
+               * @return void
+               */
+
+               public function save()
+               {
+                       $cat_id = phpgw::get_var('cat_id', 'int');
+
+                       if( !$cat_id )
+                       {
+                               $this->edit();
+                       }
+                       else
+                       {
+                               try
+                               {
+                                       $this->_handle_files($cat_id);
+                               }
+
+                               catch(Exception $e)
+                               {
+                                       if ( $e )
+                                       {
+                                               
phpgwapi_cache::message_set($e->getMessage(), 'error'); 
+                                               $this->edit( $values );
+                                               return;
+                                       }
+                               }
+
+                               phpgwapi_cache::message_set('ok!', 'message'); 
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'manual.uidocuments.edit', 'cat_id' => $cat_id));
+                       }
+               }
+
+               /**
+               * Fetch a list of files to be displayed in view/edit
+               *
+               * @param int  $id  entity id
+               *
+               * @return array $ResultSet json resultset
+               */
+
+               public function get_files()
+               {
+                       $cat_id         = phpgw::get_var('cat_id', 'int', 
'REQUEST');
+
+                       if( !$this->acl_read)
+                       {
+                               return;
+                       }
+
+                       $link_file_data = array
+                       (
+                               'menuaction'    => 
'manual.uidocuments.view_file',
+                               'cat_id'                => $cat_id
+                       );
+
+
+                       $link_view_file = self::link($link_file_data);
+
+                       $vfs = CreateObject('phpgwapi.vfs');
+                       $vfs->override_acl = 1;
+
+                       $files = $vfs->ls(array(
+                               'string' => "/manual/{$cat_id}",
+                               'relatives' => array(RELATIVE_NONE)));
+
+                       $vfs->override_acl = 0;
+
+
+//------ Start pagination
+
+                       $start = phpgw::get_var('startIndex', 'int', 'REQUEST', 
0);
+                       $total_records = count($files);
+
+                       $num_rows = 
isset($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs']) && 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] ? (int) 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] : 15;
+
+                       if($allrows)
+                       {
+                               $out = $files;
+                       }
+                       else
+                       {
+                       //      $page = ceil( ( $start / $total_records ) * 
($total_records/ $num_rows) );
+                               $page = ceil( ( $start / $num_rows) );
+                               $files_part = array_chunk($files, $num_rows);
+                               $out = $files_part[$page];
+                       }
+
+//------ End pagination
+
+
+                       $lang_view = lang('click to view file');
+                       $lang_delete = lang('click to delete file');
+
+                       $values = array();
+                       foreach($out as $_entry )
+                       {
+                               $values[] = array
+                               (
+                                       'file_name' => "<a 
href='{$link_view_file}&amp;file_name={$_entry['name']}' target='_blank' 
title='{$lang_view}'>{$_entry['name']}</a>",
+                                       'delete_file' => "<input 
type='checkbox' name='file_action[]' value='{$_entry['name']}' 
title='$lang_delete'>",
+                               );
+                       }
+
+                       $data = array(
+                                'ResultSet' => array(
+                                       'totalResultsAvailable' => 
$total_records,
+                                       'startIndex' => $start,
+                                       'sortKey' => 'type', 
+                                       'sortDir' => "ASC", 
+                                       'Result' => $values,
+                                       'pageSize' => $num_rows,
+                                       'activePage' => floor($start / 
$num_rows) + 1
+                               )
+                       );
+                       return $data;
+
+               }
+
+
+
+               /**
+               * Dowloads a single file to the browser
+               *
+               * @param int  $id  entity id
+               *
+               * @return file
+               */
+
+               function view_file()
+               {
+                       if(!$this->acl_read)
+                       {
+                               return lang('no access');
+                       }
+
+                       $bofiles        = CreateObject('property.bofiles', 
'/manual');
+
+                       $cat_id         = phpgw::get_var('cat_id', 'int', 
'REQUEST');
+                       $file_name      = 
html_entity_decode(urldecode(phpgw::get_var('file_name')));
+                       $file           = 
"{$bofiles->fakebase}/{$cat_id}/{$file_name}";
+
+                       $bofiles->view_file('',$file);
+               }
+
+
+               /**
+               * Store and / or delete files related to an entity
+               *
+               * @param int  $cat_id  entity id
+               *
+               * @return void
+               */
+               private function _handle_files($cat_id)
+               {
+                       $cat_id = (int)$cat_id;
+                       if(!$cat_id)
+                       {
+                               throw new 
Exception('uidocuments::_handle_files() - missing cat_id');
+                       }
+                       $bofiles        = CreateObject('property.bofiles', 
'/manual');
+
+                       if(isset($_POST['file_action']) && 
is_array($_POST['file_action']))
+                       {
+                               $bofiles->delete_file("/{$cat_id}/", 
array('file_action' => $_POST['file_action']));
+                       }
+                       $file_name=str_replace(' ','_',$_FILES['file']['name']);
+
+                       if($file_name)
+                       {
+                               if(!is_file($_FILES['file']['tmp_name']))
+                               {
+                                       
phpgwapi_cache::message_set(lang('Failed to upload file !'), 'error');
+                                       return;
+                               }
+
+                               $to_file = 
"{$bofiles->fakebase}/{$cat_id}/{$file_name}";
+                               if($bofiles->vfs->file_exists(array(
+                                       'string' => $to_file,
+                                       'relatives' => Array(RELATIVE_NONE)
+                               )))
+                               {
+                                       phpgwapi_cache::message_set(lang('This 
file already exists !'), 'error'); 
+                               }
+                               else
+                               {
+               //                      $bofiles->create_document_dir($cat_id);
+                                       $bofiles->vfs->override_acl = 1;
+
+                                       if(!$bofiles->vfs->cp (array (
+                                               'from'  => 
$_FILES['file']['tmp_name'],
+                                               'to'    => $to_file,
+                                               'relatives'     => array 
(RELATIVE_NONE|VFS_REAL, RELATIVE_ALL))))
+                                       {
+                                               
phpgwapi_cache::message_set(lang('Failed to upload file !'), 'error'); 
+                                       }
+                                       $bofiles->vfs->override_acl = 0;
+                               }
+                       }
+               }
+
+
+               private function _get_categories($selected = 0)
+               {
+                       $cats   = CreateObject('phpgwapi.categories', -1, 
'manual', $this->acl_location);
+                       $cats->supress_info     = true;
+                       $categories = 
$cats->formatted_xslt_list(array('format'=>'filter','selected' => 
$selected,'globals' => true,'use_acl' => $this->_category_acl));
+                       $default_value = array ('cat_id'=>'','name'=> lang('no 
category'));
+                       array_unshift ($categories['cat_list'],$default_value);
+
+                       foreach ($categories['cat_list'] as & $_category)
+                       {
+                               $_category['id'] = $_category['cat_id'];
+                       }
+
+                       return $categories['cat_list'];
+               }
+       }


Property changes on: 
branches/Version-1_0-branch/manual/inc/class.uimanual.inc.php
___________________________________________________________________
Modified: svn:keywords
   - Id
   + Revision Author Id


Property changes on: 
branches/Version-1_0-branch/manual/inc/class.uisupport.inc.php
___________________________________________________________________
Modified: svn:keywords
   - Id Revision
   + Revision Author Id

Modified: branches/Version-1_0-branch/manual/inc/hook_help.inc.php
===================================================================
--- branches/Version-1_0-branch/manual/inc/hook_help.inc.php    2013-11-25 
12:44:37 UTC (rev 11487)
+++ branches/Version-1_0-branch/manual/inc/hook_help.inc.php    2013-11-25 
13:18:06 UTC (rev 11488)
@@ -33,4 +33,3 @@
        );
 
        $GLOBALS['phpgw']->help->draw();
-?>


Property changes on: branches/Version-1_0-branch/manual/inc/hook_help.inc.php
___________________________________________________________________
Modified: svn:keywords
   - Id
   + Revision Author Id

Modified: branches/Version-1_0-branch/manual/inc/hook_sidebox_menu.inc.php
===================================================================
--- branches/Version-1_0-branch/manual/inc/hook_sidebox_menu.inc.php    
2013-11-25 12:44:37 UTC (rev 11487)
+++ branches/Version-1_0-branch/manual/inc/hook_sidebox_menu.inc.php    
2013-11-25 13:18:06 UTC (rev 11488)
@@ -8,4 +8,3 @@
                        
display_sidebox($appname,$values['title'],$values['listbox'],$use_lang = false);
                }
        }
-?>


Property changes on: 
branches/Version-1_0-branch/manual/inc/hook_sidebox_menu.inc.php
___________________________________________________________________
Modified: svn:keywords
   - Id
   + Revision Author Id


Property changes on: branches/Version-1_0-branch/manual/index.php
___________________________________________________________________
Modified: svn:keywords
   - Id
   + Revision Author Id

Copied: branches/Version-1_0-branch/manual/setup/default_records.inc.php (from 
rev 11487, trunk/manual/setup/default_records.inc.php)
===================================================================
--- branches/Version-1_0-branch/manual/setup/default_records.inc.php            
                (rev 0)
+++ branches/Version-1_0-branch/manual/setup/default_records.inc.php    
2013-11-25 13:18:06 UTC (rev 11488)
@@ -0,0 +1,11 @@
+<?php
+// clean up from previous install
+
+$GLOBALS['phpgw_setup']->oProc->query("SELECT app_id FROM phpgw_applications 
WHERE app_name = 'manual'");
+$GLOBALS['phpgw_setup']->oProc->next_record();
+$app_id = $GLOBALS['phpgw_setup']->oProc->f('app_id');
+
+$GLOBALS['phpgw_setup']->oProc->query("DELETE FROM phpgw_locations WHERE 
app_id = {$app_id} AND name != 'run'");
+
+
+$GLOBALS['phpgw']->locations->add('.documents', 'Documents', 'manual');

Modified: branches/Version-1_0-branch/manual/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/manual/setup/setup.inc.php      2013-11-25 
12:44:37 UTC (rev 11487)
+++ branches/Version-1_0-branch/manual/setup/setup.inc.php      2013-11-25 
13:18:06 UTC (rev 11488)
@@ -2,7 +2,7 @@
        /**
        * Manual - User manual
        *
-       * @copyright Copyright (C) 2000-2002,2005 Free Software Foundation, 
Inc. http://www.fsf.org/
+       * @copyright Copyright (C) 2000-2002,2005,2013 Free Software 
Foundation, Inc. http://www.fsf.org/
        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
        * @package manual
        * @subpackage setup
@@ -11,14 +11,21 @@
 
        // Basic information about this app
        $setup_info['manual']['name']      = 'manual';
-       $setup_info['manual']['version']   = '0.9.17.500';
+       $setup_info['manual']['version']   = '0.9.17.501';
        $setup_info['manual']['app_order'] = 5;
        $setup_info['manual']['enable']    = 1;
        $setup_info['manual']['app_group']      = 'accessories';
 
        // The hooks this app includes, needed for hooks registration
-       $setup_info['manual']['hooks'][] = 'help';
-       $setup_info['manual']['hooks'][] = 'sidebox_menu';
+       $setup_info['manual']['hooks'] = array
+       (
+               'help',
+               'sidebox_menu',
+               'menu'                  => 'manual.menu.get_menu',
+               'cat_add'               => 'manual.cat_hooks.cat_add',
+               'cat_edit'              => 'manual.cat_hooks.cat_edit',
+               'cat_delete'    => 'manual.cat_hooks.cat_delete'
+       );
 
        // Dependencies for this app to work
        $setup_info['manual']['depends'][] = array
@@ -26,4 +33,3 @@
                 'appname' => 'phpgwapi',
                 'versions' => Array('0.9.17', '0.9.18')
        );
-?>


Property changes on: branches/Version-1_0-branch/manual/setup/setup.inc.php
___________________________________________________________________
Modified: svn:keywords
   - Id
   + Revision Author Id

Modified: branches/Version-1_0-branch/manual/setup/tables_update.inc.php
===================================================================
--- branches/Version-1_0-branch/manual/setup/tables_update.inc.php      
2013-11-25 12:44:37 UTC (rev 11487)
+++ branches/Version-1_0-branch/manual/setup/tables_update.inc.php      
2013-11-25 13:18:06 UTC (rev 11488)
@@ -19,3 +19,12 @@
                return $GLOBALS['setup_info']['manual']['currentver'] = 
'0.9.17.500';
        }
 
+       $test[] = '0.9.17.500';
+       function manual_upgrade0_9_17_500()
+       {
+
+               $GLOBALS['phpgw']->locations->add('.documents', 'Documents', 
'manual');
+
+               return $GLOBALS['setup_info']['manual']['currentver'] = 
'0.9.17.501';
+       }
+


Property changes on: 
branches/Version-1_0-branch/manual/setup/tables_update.inc.php
___________________________________________________________________
Modified: svn:keywords
   - Id
   + Revision Author Id


Property changes on: 
branches/Version-1_0-branch/manual/templates/base/app_data.xsl
___________________________________________________________________
Modified: svn:keywords
   - Id
   + Revision Author Id

Copied: branches/Version-1_0-branch/manual/templates/base/config.tpl (from rev 
11487, trunk/manual/templates/base/config.tpl)
===================================================================
--- branches/Version-1_0-branch/manual/templates/base/config.tpl                
                (rev 0)
+++ branches/Version-1_0-branch/manual/templates/base/config.tpl        
2013-11-25 13:18:06 UTC (rev 11488)
@@ -0,0 +1,40 @@
+<!-- $Id$ -->
+<!-- BEGIN header -->
+<form method="POST" action="{action_url}">
+       <table border="0" align="center" width="85%">
+               <tr class="th">
+                       <td colspan="2"><font 
color="{th_text}">&nbsp;<b>{title}</b></font></td>
+               </tr>
+               <!-- END header -->
+               <!-- BEGIN body -->
+               <tr class="row_on">
+                       <td colspan="2">&nbsp;</td>
+               </tr>
+               <tr class="row_off">
+                       <td colspan="2">&nbsp;<b>{lang_manual} 
{lang_settings}</b></td>
+               </tr>
+               <tr class="row_off">
+                       <td>{lang_Use_ACL_for_document_types}.(not 
implementet)</td>
+                       <td>
+                               <select name="newsettings[acl_at_control_area]">
+                                       <option value="2" 
{selected_acl_at_control_area_2}>NO</option>
+                                       <option value="1" 
{selected_acl_at_control_area_1}>YES</option>
+                               </select>
+                       </td>
+               </tr>
+               <!-- END body -->
+               <!-- BEGIN footer -->
+               <tr class="th">
+                       <td colspan="2">
+                               &nbsp;
+                       </td>
+               </tr>
+               <tr>
+                       <td colspan="2" align="center">
+                               <input type="submit" name="submit" 
value="{lang_submit}">
+                               <input type="submit" name="cancel" 
value="{lang_cancel}">
+                       </td>
+               </tr>
+       </table>
+</form>
+<!-- END footer -->

Copied: branches/Version-1_0-branch/manual/templates/base/documents_add.xsl 
(from rev 11487, trunk/manual/templates/base/documents_add.xsl)
===================================================================
--- branches/Version-1_0-branch/manual/templates/base/documents_add.xsl         
                (rev 0)
+++ branches/Version-1_0-branch/manual/templates/base/documents_add.xsl 
2013-11-25 13:18:06 UTC (rev 11488)
@@ -0,0 +1,213 @@
+<!-- $Id$ -->
+
+<func:function name="phpgw:conditional">
+       <xsl:param name="test"/>
+       <xsl:param name="true"/>
+       <xsl:param name="false"/>
+
+       <func:result>
+               <xsl:choose>
+                       <xsl:when test="$test">
+                       <xsl:value-of select="$true"/>
+                       </xsl:when>
+                       <xsl:otherwise>
+                               <xsl:value-of select="$false"/>
+                       </xsl:otherwise>
+               </xsl:choose>
+       </func:result>
+</func:function>
+
+       <!-- add / edit -->
+<xsl:template match="data" xmlns:formvalidator="http://www.w3.org/TR/html4/"; 
xmlns:php="http://php.net/xsl";>
+               <xsl:call-template name="yui_phpgw_i18n"/>
+
+               <div class="yui-navset" id="survey_edit_tabview">
+
+               <h1>
+                       <xsl:value-of select="php:function('lang', 
'documents')" />
+               </h1>
+
+
+               <xsl:variable name="action_url">
+                       <xsl:value-of select="php:function('get_phpgw_link', 
'/index.php', 'menuaction:manual.uidocuments.save')" />
+               </xsl:variable>
+
+                       <form name="form" id="form" action="{$action_url}" 
method="post" ENCTYPE="multipart/form-data">
+                       <dl>
+                                       <xsl:choose>
+                                               <xsl:when test="msgbox_data != 
''">
+                                                               <dt>
+                                                                       
<xsl:call-template name="msgbox"/>
+                                                               </dt>
+                                               </xsl:when>
+                                       </xsl:choose>
+                               </dl>
+
+                               <div class="yui-content">
+                               <div id="generic" class="content-wrp">
+
+                               <dl class="proplist-col">
+
+                                       <dt>
+                                               <label 
for="category"><xsl:value-of select="php:function('lang', 'category')" 
/></label>
+                                       </dt>
+                                       <dd>
+                                               <xsl:choose>
+                                                       <xsl:when 
test="editable = 1">
+                                                               <select 
id="cat_id" name="cat_id" onChange="update_fileuploader_action();" 
+                                                                       
formvalidator:FormField="yes"
+                                                                       
formvalidator:Type="SelectField">
+                                                                       
<xsl:apply-templates select="categories/options"/>
+                                                               </select>
+                                                       </xsl:when>
+                                                       <xsl:otherwise>
+                                                               <xsl:for-each 
select="categories/options">
+                                                                       <xsl:if 
test="selected = 'selected' or selected = 1">
+                                                                               
<xsl:value-of disable-output-escaping="yes" select="name"/>
+                                                                       
</xsl:if>
+                                                               </xsl:for-each>
+                                                       </xsl:otherwise>
+                                               </xsl:choose>
+                                       </dd>
+
+                               </dl>
+                       </div>
+
+                       <div id="documents">
+                               <xsl:call-template name="datasource-definition" 
/>
+
+                               <dl class="proplist-col">
+
+                                               <dt>
+                                                       <label><xsl:value-of 
select="php:function('lang', 'files')"/></label>
+                                               </dt>
+                                               <dd>
+                                                       <div 
style="clear:both;" id="datatable-container_0"></div>
+                                               </dd>
+
+                                       <xsl:choose>
+                                               <xsl:when test="editable = 1">
+                                                       <xsl:call-template 
name="file_upload"/>
+                                               </xsl:when>
+                                       </xsl:choose>
+                               </dl>
+                       </div>
+                       </div>
+                               <dl class="proplist-col">
+                                               <div class="form-buttons">
+                                                       <xsl:variable 
name="lang_cancel"><xsl:value-of select="php:function('lang', 'cancel')" 
/></xsl:variable>
+                                                       <xsl:choose>
+                                                               <xsl:when 
test="editable = 1">
+                                                                       
<xsl:variable name="lang_save"><xsl:value-of select="php:function('lang', 
'save')" /></xsl:variable>
+                                                                       <input 
type="submit" name="save_project" value="{$lang_save}" title = "{$lang_save}" />
+                                                                       <input 
class="button" type="button" name="cancelButton" id ='cancelButton' 
value="{$lang_cancel}" title = "{$lang_cancel}" 
onClick="document.cancel_form.submit();"/>
+                                                               </xsl:when>
+                                                               <xsl:otherwise>
+                                                                       
<xsl:variable name="lang_edit"><xsl:value-of select="php:function('lang', 
'edit')" /></xsl:variable>
+                                                                       
<xsl:variable name="lang_new_survey"><xsl:value-of select="php:function('lang', 
'new')" /></xsl:variable>
+                                                                       <input 
type="button" name="edit_survey" value="{$lang_edit}" title = "{$lang_edit}"  
onClick="document.load_edit_form.submit();"/>
+                                                                       <input 
type="button" name="new_survey" value="{$lang_new_survey}" title = 
"{$lang_new_survey}" onClick="document.new_form.submit();"/>
+                                                                       <input 
class="button" type="button" name="cancelButton" id ='cancelButton' 
value="{$lang_cancel}" title = "{$lang_cancel}" 
onClick="document.cancel_form.submit();"/>
+                                                               </xsl:otherwise>
+                                                       </xsl:choose>
+                                               </div>
+                               </dl>
+                       </form>
+               </div>
+
+               <xsl:variable name="cancel_url">
+                       <xsl:value-of select="php:function('get_phpgw_link', 
'/index.php', 'menuaction:manual.uidocuments.index')" />
+               </xsl:variable>
+
+               <form name="cancel_form" id="cancel_form" 
action="{$cancel_url}" method="post">
+               </form>
+               <xsl:variable name="new_url">
+                       <xsl:value-of select="php:function('get_phpgw_link', 
'/index.php', 'menuaction:manual.uidocuments.add')" />
+               </xsl:variable>
+               <form name="new_form" id="new_form" action="{$new_url}" 
method="post">
+               </form>
+
+               <xsl:variable name="edit_params">
+                       <xsl:text>menuaction:manual.uidocuments.edit</xsl:text>
+               </xsl:variable>
+               <xsl:variable name="edit_url">
+                               <xsl:value-of 
select="php:function('get_phpgw_link', '/index.php', $edit_params )" />
+               </xsl:variable>
+
+               <form name="load_edit_form" id="load_edit_form" 
action="{$edit_url}" method="post">
+               </form>
+
+       </xsl:template>
+
+<xsl:template name="datasource-definition">
+       <script>
+               var columnDefs = [];
+               YAHOO.util.Event.onDOMReady(function(){
+                       <xsl:for-each select="datatable_def">
+                               columnDefs = [
+                                       <xsl:for-each select="ColumnDefs">
+                                       {
+                                               resizeable: true,
+                                               key: "<xsl:value-of 
select="key"/>",
+                                               <xsl:if test="label">
+                                               label: "<xsl:value-of 
select="label"/>",
+                                               </xsl:if>
+                                               sortable: <xsl:value-of 
select="phpgw:conditional(not(sortable = 0), 'true', 'false')"/>,
+                                               <xsl:if test="hidden">
+                                               hidden: true,
+                                               </xsl:if>
+                                               <xsl:if test="formatter">
+                                               formatter: <xsl:value-of 
select="formatter"/>,
+                                               </xsl:if>
+                                               <xsl:if test="editor">
+                                               editor: <xsl:value-of 
select="editor"/>,
+                                           </xsl:if>
+                                               className: "<xsl:value-of 
select="className"/>"
+                                       }<xsl:value-of 
select="phpgw:conditional(not(position() = last()), ',', '')"/>
+                               </xsl:for-each>
+                               ];
+                       
+                       YAHOO.portico.inlineTableHelper("<xsl:value-of 
select="container"/>", <xsl:value-of select="requestUrl"/>, columnDefs);
+               </xsl:for-each>
+
+       });
+  </script>
+
+</xsl:template>
+
+
+<xsl:template match="options">
+       <option value="{id}">
+               <xsl:if test="selected = 'selected' or selected = 1">
+                       <xsl:attribute name="selected" value="selected" />
+               </xsl:if>
+               <xsl:attribute name="title" value="description" />
+               <xsl:value-of disable-output-escaping="yes" select="name"/>
+       </option>
+</xsl:template>
+
+       <xsl:template xmlns:php="http://php.net/xsl"; name="file_upload">
+               <dt>
+                       <label><xsl:value-of select="php:function('lang', 
'upload file')"/></label>
+               </dt>
+               <dd>
+                       <input type="file" name="file" size="40">
+                               <xsl:attribute name="title">
+                                       <xsl:value-of 
select="php:function('lang', 'Select file to upload')"/>
+                               </xsl:attribute>
+                       </input>
+               </dd>
+               <xsl:choose>
+                       <xsl:when test="multiple_uploader!=''">
+                               <dt>
+                                       <label><a 
href="javascript:fileuploader()">
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="php:function('lang', 'upload multiple files')"/>
+                                               </xsl:attribute>
+                                               <xsl:value-of 
select="php:function('lang', 'upload multiple files')"/>
+                                       </a></label>
+                               </dt>
+                       </xsl:when>
+               </xsl:choose>
+       </xsl:template>
+


Property changes on: branches/Version-1_0-branch/manual/templates/base/help.tpl
___________________________________________________________________
Modified: svn:keywords
   - Id
   + Revision Author Id


Property changes on: branches/Version-1_0-branch/manual/templates/base/help.xsl
___________________________________________________________________
Modified: svn:keywords
   - Id
   + Revision Author Id


Property changes on: 
branches/Version-1_0-branch/manual/templates/base/help_data.xsl
___________________________________________________________________
Modified: svn:keywords
   - Id
   + Revision Author Id


Property changes on: 
branches/Version-1_0-branch/manual/templates/base/odt2html.xsl
___________________________________________________________________
Modified: svn:keywords
   - Id
   + Revision Author Id


Property changes on: 
branches/Version-1_0-branch/manual/templates/base/odt2xhtml.xsl
___________________________________________________________________
Modified: svn:keywords
   - Id
   + Revision Author Id


Property changes on: 
branches/Version-1_0-branch/manual/templates/base/support.xsl
___________________________________________________________________
Modified: svn:keywords
   - Id Revision
   + Revision Author Id


Property changes on: 
branches/Version-1_0-branch/manual/templates/base/sxw2xhtml.xsl
___________________________________________________________________
Modified: svn:keywords
   - Id
   + Revision Author Id

Modified: 
branches/Version-1_0-branch/property/inc/class.bocondition_survey.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.bocondition_survey.inc.php   
2013-11-25 12:44:37 UTC (rev 11487)
+++ branches/Version-1_0-branch/property/inc/class.bocondition_survey.inc.php   
2013-11-25 13:18:06 UTC (rev 11488)
@@ -311,6 +311,8 @@
 
                public function get_summation($id)
                {
+                       $survey = $this->so->read_single(array('id' => $id));
+
                        $data = $this->so->get_summation($id);
 //$total = 0;
 //_debug_array($data);
@@ -318,6 +320,7 @@
                        $i=0;
                        foreach ($data as $entry)
                        {
+                               $entry['amount'] = $entry['amount'] * 
$survey['multiplier'];
                                $i = $entry['building_part'] . '_' . 
$entry['category'];
                                
                                $values[$i]['building_part'] = 
$entry['building_part'];

Modified: branches/Version-1_0-branch/property/inc/class.fileuploader.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.fileuploader.inc.php 
2013-11-25 12:44:37 UTC (rev 11487)
+++ branches/Version-1_0-branch/property/inc/class.fileuploader.inc.php 
2013-11-25 13:18:06 UTC (rev 11488)
@@ -260,9 +260,9 @@
 
 
 
-               public function check($save_path = '')
+               public function check($save_path = '', $fakebase = '/property')
                {
-                       $bofiles        = CreateObject('property.bofiles');
+                       $bofiles        = CreateObject('property.bofiles', 
$fakebase);
 
                        $to_file        = 
"{$bofiles->fakebase}/{$save_path}/{$_POST['filename']}";
                        //Return true if the file exists
@@ -318,9 +318,9 @@
 
  */
 
-               function upload($save_path = '')
+               function upload($save_path = '', $fakebase = '/property')
                {
-                       $bofiles        = CreateObject('property.bofiles');
+                       $bofiles        = CreateObject('property.bofiles', 
$fakebase);
                        $use_vfs = true;
                        // Check post_max_size 
(http://us3.php.net/manual/en/features.file-upload.php#73762)
                        $POST_MAX_SIZE = ini_get('post_max_size');

Modified: 
branches/Version-1_0-branch/property/inc/class.socondition_survey.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.socondition_survey.inc.php   
2013-11-25 12:44:37 UTC (rev 11487)
+++ branches/Version-1_0-branch/property/inc/class.socondition_survey.inc.php   
2013-11-25 13:18:06 UTC (rev 11488)
@@ -89,8 +89,8 @@
                                $querymethod    = " {$where} {$table}.title 
{$this->_like} '%{$query}%'";
                        }
 
-                       $groupmethod = "GROUP BY 
$table.id,$table.title,$table.descr,$table.address,$table.entry_date,$table.user_id,
 org_name";
-                       $sql = "SELECT DISTINCT 
$table.id,$table.title,$table.descr,$table.address,$table.entry_date,$table.user_id,"
+                       $groupmethod = "GROUP BY $table.id, $table.title, 
$table.descr, $table.address, $table.entry_date, $table.user_id, org_name, 
$table.multiplier";
+                       $sql = "SELECT DISTINCT $table.id, $table.title, 
$table.descr, $table.address, $table.entry_date, $table.user_id, 
$table.multiplier,"
                        . " count(condition_survey_id) AS cnt, org_name as 
vendor FROM {$table} "
                        . " {$this->_join} fm_vendor ON {$table}.vendor_id = 
fm_vendor.id"
                        . " {$this->_left_join} fm_request ON {$table}.id 
=fm_request.condition_survey_id {$filtermethod} {$querymethod} {$groupmethod}";
@@ -120,6 +120,7 @@
                                        'vendor'                => 
$this->_db->f('vendor',true),
                                        'entry_date'    => 
$this->_db->f('entry_date'),
                                        'user'                  => 
$this->_db->f('user_id'),
+                                       'multiplier'    => 
$this->_db->f('multiplier'),
                                        'cnt'                   => 
$this->_db->f('cnt'),
                                );
                        }
@@ -151,6 +152,7 @@
                                        'user_id'                       => 
(int)$this->_db->f('user_id'),
                                        'entry_date'            => 
(int)$this->_db->f('entry_date'),
                                        'modified_date'         => 
(int)$this->_db->f('modified_date'),
+                                       'multiplier'            => 
(float)$this->_db->f('multiplier'),
                                );
 
                                if ( isset($data['attributes']) && 
is_array($data['attributes']) )
@@ -188,8 +190,8 @@
                        $value_set['report_date']               = 
phpgwapi_datetime::date_to_timestamp($data['report_date']);
                        $value_set['user_id']                   = 
$this->account;
                        $value_set['modified_date']             = time();
+                       $value_set['multiplier']                = 
(float)$data['multiplier'];
 
-
                        $cols = implode(',', array_keys($value_set));
                        $values = 
$this->_db->validate_insert(array_values($value_set));
                        $sql = "INSERT INTO {$table} ({$cols}) VALUES 
({$values})";
@@ -236,9 +238,9 @@
                        $value_set['report_date']               = 
phpgwapi_datetime::date_to_timestamp($data['report_date']);
                        $value_set['user_id']                   = 
$this->account;
                        $value_set['modified_date']             = time();
+                       $value_set['multiplier']                = 
(float)$data['multiplier'];
 
 
-
                        $this->_db->query("SELECT coordinator_id FROM 
fm_condition_survey WHERE id = {$id}",__LINE__,__FILE__);
                        $this->_db->next_record();
                        $old_coordinator_id             = 
(int)$this->_db->f('coordinator_id');
@@ -257,6 +259,7 @@
                                }
 
                                $this->_edit($id, $value_set, 
'fm_condition_survey');
+                               $this->_db->query("UPDATE fm_request SET 
multiplier = '{$data['multiplier']}' WHERE condition_survey_id = 
{$id}",__LINE__,__FILE__);                            
                                $this->_db->Exception_On_Error = false;
                        }
 

Modified: branches/Version-1_0-branch/property/inc/class.sorequest.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sorequest.inc.php    
2013-11-25 12:44:37 UTC (rev 11487)
+++ branches/Version-1_0-branch/property/inc/class.sorequest.inc.php    
2013-11-25 13:18:06 UTC (rev 11488)
@@ -236,8 +236,10 @@
                        . " 
fm_request.start_date,fm_request.closed_date,fm_request.in_progress_date,fm_request.category
 as cat_id,"
                        . " fm_request.delivered_date,fm_request.title as 
title,max(fm_request_condition.degree) as condition_degree,"
        //              . " sum(fm_request_planning.amount) as planned_budget,"
-                       . " fm_request.amount_investment,"
-                       . " 
fm_request.amount_operation,fm_request.amount_potential_grants,fm_request.score,"
+                       . " (fm_request.amount_investment * 
fm_request.multiplier) as amount_investment,"
+                       . " (fm_request.amount_operation * 
fm_request.multiplier) as amount_operation,"
+                       . " (fm_request.amount_potential_grants * 
fm_request.multiplier) as amount_potential_grants,"
+                       . " fm_request.score,"
                        . " fm_request.recommended_year,"
                        . " fm_request.start_date"
                        . " FROM (( fm_request  LEFT JOIN fm_request_status ON 
fm_request.status = fm_request_status.id)"
@@ -441,7 +443,7 @@
                        $uicols['sortable'][]           = true;
 
 
-                       $cols.= ",$entity_table.amount_investment as 
amount_investment";
+                       $cols.= ",($entity_table.amount_investment * 
multiplier) as amount_investment";
                        $cols_return[]                          = 
'amount_investment';
                        $cols_group[]                           = 
'amount_investment';
                        $uicols['input_type'][]         = 'text';
@@ -455,7 +457,7 @@
                        $uicols['classname'][]          = 'rightClasss';
                        $uicols['sortable'][]           = true;
 
-                       $cols.= ",$entity_table.amount_operation as 
amount_operation";
+                       $cols.= ",($entity_table.amount_operation * multiplier) 
as amount_operation";
                        $cols_return[]                          = 
'amount_operation';
                        $cols_group[]                           = 
'amount_operation';
                        $uicols['input_type'][]         = 'text';
@@ -469,7 +471,7 @@
                        $uicols['classname'][]          = 'rightClasss';
                        $uicols['sortable'][]           = true;
 
-                       $cols.= ",$entity_table.amount_potential_grants as 
amount_potential_grants";
+                       $cols.= ",($entity_table.amount_potential_grants * 
multiplier) as amount_potential_grants";
                        $cols_return[]                          = 
'amount_potential_grants';
                        $cols_group[]                           = 
'amount_potential_grants';
                        $uicols['input_type'][]         = 'text';
@@ -784,7 +786,7 @@
                        $this->_db->fetchmode = 'ASSOC';
 
 //                     $sql2 = "SELECT count(*) as cnt, sum(amount_investment) 
as sum_investment, sum(amount_operation) as sum_operation, 
sum(amount_potential_grants) as sum_potential_grants FROM ({$sql}) as t";
-                       $sql2 = "SELECT count(*) as cnt, sum(amount_investment) 
as sum_investment, sum(amount_operation) as sum_operation, 
sum(amount_potential_grants) as sum_potential_grants FROM {$sql_arr[1]}";
+                       $sql2 = "SELECT count(*) as cnt, (sum(amount_investment 
* multiplier)) as sum_investment, (sum(amount_operation * multiplier)) as 
sum_operation, (sum(amount_potential_grants * multiplier)) as 
sum_potential_grants FROM {$sql_arr[1]}";
 
                        $this->_db->query($sql2,__LINE__,__FILE__);
                        $this->_db->next_record();
@@ -906,7 +908,8 @@
                                        'closed_date'                           
=> $this->_db->f('closed_date'),
                                        'in_progress_date'                      
=> $this->_db->f('in_progress_date'),
                                        'delivered_date'                        
=> $this->_db->f('delivered_date'),
-                                       'regulations'                           
=> explode(',', $this->_db->f('regulations'))
+                                       'regulations'                           
=> explode(',', $this->_db->f('regulations')),
+                                       'multiplier'                            
=> (float) $this->_db->f('multiplier'),
                                );
 
                                if ( isset($values['attributes']) && 
is_array($values['attributes']) )

Modified: 
branches/Version-1_0-branch/property/inc/class.uicondition_survey.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uicondition_survey.inc.php   
2013-11-25 12:44:37 UTC (rev 11487)
+++ branches/Version-1_0-branch/property/inc/class.uicondition_survey.inc.php   
2013-11-25 13:18:06 UTC (rev 11488)
@@ -200,6 +200,11 @@
                                                        'sortable' => true,
                                                ),
                                                array(
+                                                       'key' => 'multiplier',
+                                                       'label' => 
lang('multiplier'),
+                                                       'sortable' => false,
+                                               ),
+                                               array(
                                                        'key' => 'cnt',
                                                        'label' => 
lang('count'),
                                                        'sortable' => false,
@@ -1379,6 +1384,12 @@
                                        'type'  => 'string',
                                        'required'      => false
                                ),
+                               array
+                               (
+                                       'name' => 'multiplier',
+                                       'type'  => 'float',
+                                       'required'      => false
+                               ),
                        );
 
 

Modified: branches/Version-1_0-branch/property/inc/class.uiimport.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uiimport.inc.php     
2013-11-25 12:44:37 UTC (rev 11487)
+++ branches/Version-1_0-branch/property/inc/class.uiimport.inc.php     
2013-11-25 13:18:06 UTC (rev 11488)
@@ -34,11 +34,7 @@
                protected $defalt_values;
 
 
-               private $valid_tables = array
-                               (
-                                       'fm_vendor',
-                                       'fm_condition_survey'
-                               );
+               private $valid_tables = array();
 
                public function __construct()
                {
@@ -55,8 +51,21 @@
                        $this->db           = & $GLOBALS['phpgw']->db;
                        $this->table            = phpgw::get_var('table');
                        
-                       if($this->table && !in_array($this->table, 
$this->valid_tables))
+                       $this->valid_tables = array
+                       (
+                               'fm_vendor'                             => 
'fm_vendor (' . lang('vendor') . ')',
+                               'fm_condition_survey'   => 'fm_condition_survey 
(' . lang('condition survey') . ')'
+                       );
+
+                       $location_types = 
execMethod('property.soadmin_location.select_location_type');
+                       
+                       foreach ($location_types as $location_type)
                        {
+                               
$this->valid_tables["fm_location{$location_type['id']}"] = 
"fm_location{$location_type['id']} ({$location_type['name']})";
+                       }
+
+                       if($this->table && !in_array($this->table, 
array_keys($this->valid_tables)))
+                       {
                                throw new Exception("Not a valid table: 
{$this->table}");                       
                        }
                }
@@ -261,14 +270,14 @@
 
                                $tables = $this->valid_tables;
 
-                               sort($tables);
+                               ksort($tables);
 
                                $table_option = '<option value="">' . 
lang('none selected') . '</option>' . "\n";
-                               foreach ( $tables as $table)
+                               foreach ( $tables as $table => $table_info)
                                {
                                        $selected = $import_settings['table'] 
== $table ? 'selected =  "selected"' : '';
                                        $table_option .=  <<<HTML
-                                       <option 
value='{$table}'{$selected}>{$table}</option>
+                                       <option 
value='{$table}'{$selected}>{$table_info}</option>
 HTML;
                                }
 

Modified: branches/Version-1_0-branch/property/inc/class.uirequest.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uirequest.inc.php    
2013-11-25 12:44:37 UTC (rev 11487)
+++ branches/Version-1_0-branch/property/inc/class.uirequest.inc.php    
2013-11-25 13:18:06 UTC (rev 11488)
@@ -1774,7 +1774,9 @@
 
                                        'condition_list'                        
                => $this->bo->select_conditions($id),
                                        'building_part_list'                    
        => array('options' => 
$this->bocommon->select_category_list(array('type'=> 'building_part','selected' 
=>$values['building_part'], 'order' => 'id', 'id_in_name' => 'num', 'filter' => 
$_filter_buildingpart))),
-                                       'value_consume'                         
                => isset($receipt['error']) ? $values['consume_value'] : ''
+                                       'value_consume'                         
                => isset($receipt['error']) ? $values['consume_value'] : '',
+                                       'value_multiplier'                      
                => $values['multiplier'],
+                                       'value_total_cost_estimate'             
        => $values['multiplier'] ? number_format(($values['budget'] * 
$values['multiplier']) , 0, ',', ' ') : ''
                                );
 //_debug_array($data);die();
                        phpgwapi_yui::load_widget('dragdrop');

Modified: branches/Version-1_0-branch/property/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/setup.inc.php    2013-11-25 
12:44:37 UTC (rev 11487)
+++ branches/Version-1_0-branch/property/setup/setup.inc.php    2013-11-25 
13:18:06 UTC (rev 11488)
@@ -12,7 +12,7 @@
        */
 
        $setup_info['property']['name']                 = 'property';
-       $setup_info['property']['version']              = '0.9.17.673';
+       $setup_info['property']['version']              = '0.9.17.675';
        $setup_info['property']['app_order']    = 8;
        $setup_info['property']['enable']               = 1;
        $setup_info['property']['app_group']    = 'office';

Modified: branches/Version-1_0-branch/property/setup/tables_current.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/tables_current.inc.php   
2013-11-25 12:44:37 UTC (rev 11487)
+++ branches/Version-1_0-branch/property/setup/tables_current.inc.php   
2013-11-25 13:18:06 UTC (rev 11488)
@@ -831,6 +831,7 @@
                                'user_id' => array('type' => 'int', 'precision' 
=> 4,'nullable' => True),
                                'entry_date' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
                                'modified_date' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
+                               'multiplier' => array('type' => 
'decimal','precision' => '20','scale' => '2','default' => '1','nullable' => 
True),
                        ),
                        'pk' => array('id'),
                        'fk' => array(),
@@ -894,6 +895,7 @@
                                'in_progress_date' => array('type' => 
'int','precision' => '4','nullable' => True),
                                'delivered_date' => array('type' => 
'int','precision' => '4','nullable' => True),
                                'regulations' => array('type' => 
'varchar','precision' => 100,'nullable' => True),
+                               'multiplier' => array('type' => 
'decimal','precision' => '20','scale' => '2','default' => '1','nullable' => 
True),
                        ),
                        'pk' => array('id'),
                        'fk' => array(),

Modified: branches/Version-1_0-branch/property/setup/tables_update.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/tables_update.inc.php    
2013-11-25 12:44:37 UTC (rev 11487)
+++ branches/Version-1_0-branch/property/setup/tables_update.inc.php    
2013-11-25 13:18:06 UTC (rev 11488)
@@ -7637,9 +7637,9 @@
                $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
 
                $GLOBALS['phpgw_setup']->oProc->query("DELETE FROM fm_cache");
-               
+
                $GLOBALS['phpgw_setup']->oProc->query("SELECT * FROM 
fm_entity_category");
-               
+
                $categories = array();
                while ($GLOBALS['phpgw_setup']->oProc->next_record())
                {
@@ -7655,7 +7655,7 @@
                }
 
                $tables = $GLOBALS['phpgw_setup']->oProc->m_odb->table_names();
-               
+
                foreach ($tables as $table)
                {
                        if(preg_match('/^fm_/', $table))
@@ -7676,7 +7676,7 @@
 
                                        foreach ($categories as $category)
                                        {
-                                       
+
                                                $cols = 
array_merge($primary_keys, array('p_num'));
                                                $records = array();
                                                $i = 0;
@@ -7690,7 +7690,7 @@
                                                        }
                                                        $i++;
                                                }
-                                               
+
                                                foreach ($records as $record)
                                                {
                                                        $p_num = (int) 
ltrim($record['p_num'], $category['prefix']);
@@ -7784,3 +7784,60 @@
                        return $GLOBALS['setup_info']['property']['currentver'];
                }
        }
+
+       /**
+       * Update property version from 0.9.17.673 to 0.9.17.674
+       * Add multiplier to condition survey
+       */
+
+       $test[] = '0.9.17.673';
+       function property_upgrade0_9_17_673()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_condition_survey', 'multiplier', 
array
+                               (
+                                       'type'          => 'decimal',
+                                       'precision' => '20',
+                                       'scale'         => '2',
+                                       'default'       => '1.00',
+                                       'nullable'      => True
+                               )
+                       );
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.674';
+                       return $GLOBALS['setup_info']['property']['currentver'];
+               }
+       }
+
+       /**
+       * Update property version from 0.9.17.674 to 0.9.17.675
+       * Add multiplier to condition survey
+       */
+
+       $test[] = '0.9.17.674';
+       function property_upgrade0_9_17_674()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               $GLOBALS['phpgw_setup']->oProc->query("DELETE FROM fm_cache");
+
+               $GLOBALS['phpgw_setup']->oProc->AddColumn('fm_request', 
'multiplier', array
+                               (
+                                       'type'          => 'decimal',
+                                       'precision' => '20',
+                                       'scale'         => '2',
+                                       'default'       => '1.00',
+                                       'nullable'      => True
+                               )
+                       );
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.675';
+                       return $GLOBALS['setup_info']['property']['currentver'];
+               }
+       }
+

Modified: 
branches/Version-1_0-branch/property/templates/base/condition_survey.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/condition_survey.xsl    
2013-11-25 12:44:37 UTC (rev 11487)
+++ branches/Version-1_0-branch/property/templates/base/condition_survey.xsl    
2013-11-25 13:18:06 UTC (rev 11488)
@@ -108,7 +108,6 @@
                                                </xsl:choose>
                                        </dd>
 
-
                                        <dt>
                                                <label 
for="category"><xsl:value-of select="php:function('lang', 'category')" 
/></label>
                                        </dt>
@@ -131,6 +130,26 @@
                                                </xsl:choose>
                                        </dd>
                                        <dt>
+                                               <label 
for="multiplier"><xsl:value-of select="php:function('lang', 'multiplier')" 
/></label>
+                                       </dt>
+                                       <dd>
+                                               <xsl:choose>
+                                                       <xsl:when 
test="editable = 1">
+                                                               <input 
id="multiplier" name='values[multiplier]' type="text" 
value="{survey/multiplier}"
+                                                                       
formvalidator:FormField="yes" 
+                                                                       
formvalidator:Type="DoubleField" 
+                                                                       
formvalidator:min="1" 
+                                                                       
formvalidator:maxDecimalPlaces="2" 
+                                                                       
formvalidator:minInclusive="true" 
+                                                                       
formvalidator:maxInclusive="true" /> 
+                                                       </xsl:when>
+                                                       <xsl:otherwise>
+                                                               <xsl:value-of 
select="survey/multiplier"/>
+                                                       </xsl:otherwise>
+                                               </xsl:choose>
+                                       </dd>
+
+                                       <dt>
                                                        <label 
for="date"><xsl:value-of select="php:function('lang', 'date')" /></label>
                                        </dt>
                                        <dd>

Modified: branches/Version-1_0-branch/property/templates/base/request.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/request.xsl     
2013-11-25 12:44:37 UTC (rev 11487)
+++ branches/Version-1_0-branch/property/templates/base/request.xsl     
2013-11-25 13:18:06 UTC (rev 11488)
@@ -540,8 +540,24 @@
                                                                                
</input>
                                                                                
<xsl:text> </xsl:text>
                                                                        </div>
-                                                                       
<div><label class="requirement-action-label"><xsl:value-of 
select="php:function('lang', 'total cost estimate')"/></label><xsl:value-of 
select="value_budget"/><xsl:text> </xsl:text> [ <xsl:value-of 
select="currency"/> ]
+                                                                       <div>
+                                                                               
<label class="requirement-action-label">
+                                                                               
        <xsl:value-of select="php:function('lang', 'cost estimate')"/>
+                                                                               
</label>
+                                                                               
<xsl:value-of select="value_budget"/><xsl:text> </xsl:text> [ <xsl:value-of 
select="currency"/> ]
                                                                        </div>
+                                                                       <div>
+                                                                               
<label class="requirement-action-label">
+                                                                               
        <xsl:value-of select="php:function('lang', 'multiplier')"/>
+                                                                               
</label>
+                                                                               
<xsl:value-of select="value_multiplier"/>
+                                                                       </div>
+                                                                       <div>
+                                                                               
<label class="requirement-action-label">
+                                                                               
        <xsl:value-of select="php:function('lang', 'total cost estimate')"/>
+                                                                               
</label>
+                                                                               
<xsl:value-of select="value_total_cost_estimate"/><xsl:text> </xsl:text> [ 
<xsl:value-of select="currency"/> ]
+                                                                       </div>
                                                                </div>
                                                                <div 
class="requirement-action-sub-right">
                                                                        <div>




reply via email to

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