fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [11443] Merge 11430:11442 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [11443] Merge 11430:11442 from trunk
Date: Sun, 10 Nov 2013 19:01:47 +0000

Revision: 11443
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11443
Author:   sigurdne
Date:     2013-11-10 19:01:47 +0000 (Sun, 10 Nov 2013)
Log Message:
-----------
Merge 11430:11442 from trunk

Modified Paths:
--------------
    branches/Version-1_0-branch/phpgwapi/inc/class.pdf.inc.php
    branches/Version-1_0-branch/property/inc/class.botts.inc.php
    branches/Version-1_0-branch/property/inc/class.menu.inc.php
    branches/Version-1_0-branch/property/inc/class.soadmin_entity.inc.php
    branches/Version-1_0-branch/property/inc/class.soentity.inc.php
    branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php
    branches/Version-1_0-branch/property/inc/class.uiimport.inc.php
    branches/Version-1_0-branch/property/inc/class.uitts.inc.php
    branches/Version-1_0-branch/property/inc/import/import_update_generic.php
    branches/Version-1_0-branch/property/setup/default_records.inc.php
    branches/Version-1_0-branch/property/setup/setup.inc.php
    branches/Version-1_0-branch/property/setup/tables_current.inc.php
    branches/Version-1_0-branch/property/setup/tables_update.inc.php
    branches/Version-1_0-branch/property/templates/base/config.tpl
    branches/Version-1_0-branch/property/templates/base/tts.xsl

Property Changed:
----------------
    branches/Version-1_0-branch/
    branches/Version-1_0-branch/property/test_menu.php


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
   + 
/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

Modified: branches/Version-1_0-branch/phpgwapi/inc/class.pdf.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.pdf.inc.php  2013-11-10 
18:46:33 UTC (rev 11442)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.pdf.inc.php  2013-11-10 
19:01:47 UTC (rev 11443)
@@ -55,7 +55,7 @@
                        if(true)
                        {
                                $size = strlen($document);
-                               $browser->content_header($document_name 
.'.pdf','application/pdf', $size);
+                               $browser->content_header($document_name 
.'.pdf','application/x-pdf', $size);
                                echo $document;
                        }
                        else

Modified: branches/Version-1_0-branch/property/inc/class.botts.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.botts.inc.php        
2013-11-10 18:46:33 UTC (rev 11442)
+++ branches/Version-1_0-branch/property/inc/class.botts.inc.php        
2013-11-10 19:01:47 UTC (rev 11443)
@@ -451,29 +451,13 @@
                        return $status_text;
                }
 
-
-               function get_priority_list($selected='')
+               function get_priority_list($selected = 0)
                {
-
-                       $prioritylevels = 
isset($this->config->config_data['prioritylevels']) && 
$this->config->config_data['prioritylevels'] ? 
$this->config->config_data['prioritylevels'] : 3;
-
                        if(!$selected)
                        {
                                $selected = 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['prioritydefault'])
 ? $GLOBALS['phpgw_info']['user']['preferences']['property']['prioritydefault'] 
: $prioritylevels;
                        }
-
-                       $priority_comment[$prioritylevels]=' - '.lang('Lowest');
-                       //                      $priority_comment[2]=' - 
'.lang('Medium');
-                       $priority_comment[1]=' - '.lang('Highest');
-
-                       $priorities = array();
-                       for ($i=1; $i<= $prioritylevels; $i++)
-                       {
-                               $priorities[$i]['id'] =$i;
-                               $priorities[$i]['name'] =$i . 
(isset($priority_comment[$i])?$priority_comment[$i]:'');
-                       }
-
-                       return 
$this->bocommon->select_list($selected,$priorities);
+                       return execMethod('property.bogeneric.get_list', 
array('type' => 'ticket_priority', 'selected' => $selected) );
                }
 
                function get_category_name($cat_id)
@@ -901,8 +885,10 @@
                                $default_group = 0;
                        }
 
-                       $default_priority = 
isset($this->config->config_data['prioritylevels']) && 
$this->config->config_data['prioritylevels'] ? 
$this->config->config_data['prioritylevels'] : 3;
+                       $priority_list = $this->get_priority_list();
 
+                       $default_priority = 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['prioritydefault'])
 ? $GLOBALS['phpgw_info']['user']['preferences']['property']['prioritydefault'] 
: count($priority_list);
+
                        $ticket = array
                        (
                                'origin_id'                     => 
isset($data['origin_id']) ? $data['origin_id'] : null,
@@ -987,9 +973,6 @@
                        if ( (isset($ticket['send_mail']) && 
$ticket['send_mail']) 
                                || 
(isset($this->config->config_data['mailnotification'])
                                        && 
$this->config->config_data['mailnotification'])
-                               || 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['tts_notify_me'])
-                                       && 
$GLOBALS['phpgw_info']['user']['preferences']['property']['tts_notify_me']==1
-                               )
                        )
                        {
                                $receipt_mail = 
$this->mail_ticket($receipt['id'],false,$receipt,$ticket['location_code'], 
false, isset($ticket['send_mail']) && $ticket['send_mail'] ? true : false);

Modified: branches/Version-1_0-branch/property/inc/class.menu.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.menu.inc.php 2013-11-10 
18:46:33 UTC (rev 11442)
+++ branches/Version-1_0-branch/property/inc/class.menu.inc.php 2013-11-10 
19:01:47 UTC (rev 11443)
@@ -162,6 +162,11 @@
                                                        'text'  => lang('Ticket 
status'),
                                                        'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uigeneric.index', 'type' => 'ticket_status') )
                                                ),
+                                               'ticket_priority'       => array
+                                               (
+                                                       'text'  => lang('Ticket 
priority'),
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uigeneric.index', 'type' => 'ticket_priority') )
+                                               ),
                                                'ticket_config' => array
                                                (
                                                        'text'  => lang('ticket 
config'),

Modified: branches/Version-1_0-branch/property/inc/class.soadmin_entity.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soadmin_entity.inc.php       
2013-11-10 18:46:33 UTC (rev 11442)
+++ branches/Version-1_0-branch/property/inc/class.soadmin_entity.inc.php       
2013-11-10 19:01:47 UTC (rev 11443)
@@ -258,8 +258,9 @@
                        {
                                $this->category_tree[$category['id']] = array
                                (
-                                       'id'    => $category['id'],
-                                       'name'  => $category['name']
+                                       'id'                    => 
$category['id'],
+                                       'name'                  => 
$category['name'],
+                                       'location_id'   => 
$category['location_id']
                                );
                                $this->get_children2($entity_id, 
$category['id'], 1);
                        }
@@ -487,6 +488,7 @@
                                $category = array
                                (
                                        'id'                                    
        => $this->db->f('id'),
+                                       'entity_id'                             
        => $this->db->f('entity_id'),
                                        'name'                                  
        => $this->db->f('name',true),
                                        'descr'                                 
        => $this->db->f('descr',true),
                                        'prefix'                                
        => $this->db->f('prefix',true),

Modified: branches/Version-1_0-branch/property/inc/class.soentity.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soentity.inc.php     
2013-11-10 18:46:33 UTC (rev 11442)
+++ branches/Version-1_0-branch/property/inc/class.soentity.inc.php     
2013-11-10 19:01:47 UTC (rev 11443)
@@ -2281,8 +2281,8 @@
 
                        $cat_id = (int)$data['cat_id'];
                        $entity_id = (int)$data['entity_id'];
-                       $id = $data['id'];
-                       $location_id = 
$GLOBALS['phpgw']->locations->get_id($this->type_app[$this->type], 
".{$this->type}.{$entity_id}.{$cat_id}");
+                       $p_id = $data['id'];
+                       $p_location_id = 
$GLOBALS['phpgw']->locations->get_id($this->type_app[$this->type], 
".{$this->type}.{$entity_id}.{$cat_id}");
                        $entity = array();
 
                        foreach ($this->type_app as $type => $app)
@@ -2317,12 +2317,15 @@
 
                                        if($entry['is_eav'])
                                        {
-                                               $sql = "SELECT count(*) as hits 
FROM fm_bim_item WHERE p_location_id = {$location_id} AND p_id = '{$id}'";
+                                               $location_id = 
$GLOBALS['phpgw']->locations->get_id($this->type_app[$type], 
".{$type}.{$entry['entity_id']}.{$entry['cat_id']}");
+
+                                               $sql = "SELECT count(*) as hits 
FROM fm_bim_item WHERE location_id = {$location_id} AND p_location_id = 
{$p_location_id} AND p_id = '{$p_id}'";
                                        }
                                        else
                                        {
-                                               $sql = "SELECT count(*) as hits 
FROM fm_{$type}_{$entry['entity_id']}_{$entry['cat_id']} WHERE p_entity_id = 
{$entity_id} AND p_cat_id = {$cat_id} AND p_num = '{$id}'";
+                                               $sql = "SELECT count(*) as hits 
FROM fm_{$type}_{$entry['entity_id']}_{$entry['cat_id']} WHERE p_entity_id = 
{$entity_id} AND p_cat_id = {$cat_id} AND p_num = '{$p_id}'";
                                        }
+
                                        
$this->db->query($sql,__LINE__,__FILE__);
                                        $this->db->next_record();
                                        if($this->db->f('hits'))
@@ -2336,7 +2339,7 @@
                                                                        
'cat_id'                => $entry['cat_id'],
                                                                        
'p_entity_id'   => $entity_id,
                                                                        
'p_cat_id'              => $cat_id,
-                                                                       'p_num' 
                => $id,
+                                                                       'p_num' 
                => $p_id,
                                                                        'type'  
                => $type
                                                                )
                                                        ),
@@ -2347,7 +2350,7 @@
                                }
                        }
 
-                       $sql = "SELECT count(*) as hits FROM fm_tts_tickets 
WHERE p_entity_id = {$entity_id} AND p_cat_id = {$cat_id} AND p_num = '{$id}'";
+                       $sql = "SELECT count(*) as hits FROM fm_tts_tickets 
WHERE p_entity_id = {$entity_id} AND p_cat_id = {$cat_id} AND p_num = 
'{$p_id}'";
                        $this->db->query($sql,__LINE__,__FILE__);
                        $this->db->next_record();
                        if($this->db->f('hits'))
@@ -2358,14 +2361,14 @@
                                                'entity_link'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitts.index',
                                        //      'p_entity_id'   => $entity_id,
                                        //      'p_cat_id'              => 
$cat_id,
-                                               'p_num'                 => $id,
-                                               'query'=> 
"entity.{$entity_id}.{$cat_id}.{$id}")),
+                                               'p_num'                 => 
$p_id,
+                                               'query'=> 
"entity.{$entity_id}.{$cat_id}.{$p_id}")),
                                                'name'          => 
lang('Helpdesk') . " [{$hits}]",
                                                'descr'         => 
lang('Helpdesk')
                                        );
                        }
 
-                       $sql = "SELECT count(*) as hits FROM fm_request WHERE 
p_entity_id = {$entity_id} AND p_cat_id = {$cat_id} AND p_num = '{$id}'";
+                       $sql = "SELECT count(*) as hits FROM fm_request WHERE 
p_entity_id = {$entity_id} AND p_cat_id = {$cat_id} AND p_num = '{$p_id}'";
                        $this->db->query($sql,__LINE__,__FILE__);
                        $this->db->next_record();
                        if($this->db->f('hits'))
@@ -2376,14 +2379,14 @@
                                                'entity_link'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction' => 
'property.uirequest.index',
                                        //      'p_entity_id'   => $entity_id,
                                        //      'p_cat_id'              => 
$cat_id,
-                                               'p_num'                 => $id,
-                                               'query'=> 
"entity.{$entity_id}.{$cat_id}.{$id}")),
+                                               'p_num'                 => 
$p_id,
+                                               'query'=> 
"entity.{$entity_id}.{$cat_id}.{$p_id}")),
                                                'name'          => 
lang('request') . " [{$hits}]",
                                                'descr'         => 
lang('request')
                                        );
                        }
 
-                       $sql = "SELECT count(*) as hits FROM fm_project WHERE 
p_entity_id = {$entity_id} AND p_cat_id = {$cat_id} AND p_num = '{$id}'";
+                       $sql = "SELECT count(*) as hits FROM fm_project WHERE 
p_entity_id = {$entity_id} AND p_cat_id = {$cat_id} AND p_num = '{$p_id}'";
                        $this->db->query($sql,__LINE__,__FILE__);
                        $this->db->next_record();
                        if($this->db->f('hits'))
@@ -2392,14 +2395,14 @@
                                $entity['related'][] = array
                                        (
                                                'entity_link'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction' => 
'property.uiproject.index',
-                                               'query'=> 
"entity.{$entity_id}.{$cat_id}.{$id}",
+                                               'query'=> 
"entity.{$entity_id}.{$cat_id}.{$p_id}",
                                                'criteria_id' => 6)), //FIXME: 
criteria 6 is for entities should be altered to locations
                                                'name'          => 
lang('project') . " [{$hits}]",
                                                'descr'         => 
lang('project')
                                        );
                        }
 
-                       $sql = "SELECT count(*) as hits FROM fm_s_agreement 
{$this->join} fm_s_agreement_detail ON fm_s_agreement.id = 
fm_s_agreement_detail.agreement_id WHERE p_entity_id = {$entity_id} AND 
p_cat_id = {$cat_id} AND p_num = '{$id}'";
+                       $sql = "SELECT count(*) as hits FROM fm_s_agreement 
{$this->join} fm_s_agreement_detail ON fm_s_agreement.id = 
fm_s_agreement_detail.agreement_id WHERE p_entity_id = {$entity_id} AND 
p_cat_id = {$cat_id} AND p_num = '{$p_id}'";
                        $this->db->query($sql,__LINE__,__FILE__);
                        $this->db->next_record();
                        if($this->db->f('hits'))
@@ -2408,8 +2411,8 @@
                                $entity['related'][] = array
                                        (
                                                'entity_link'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction' => 
'property.uis_agreement.index',
-                                                                               
                                                'query' => 
"entity.{$entity_id}.{$cat_id}.{$id}",
-                                                                               
                                                'p_num' => $id)),
+                                                                               
                                                'query' => 
"entity.{$entity_id}.{$cat_id}.{$p_id}",
+                                                                               
                                                'p_num' => $p_id)),
                                                'name'                  => 
lang('service agreement') . " [{$hits}]",
                                                'descr'                 => 
lang('service agreement')
                                        );

Modified: branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php    
2013-11-10 18:46:33 UTC (rev 11442)
+++ branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php    
2013-11-10 19:01:47 UTC (rev 11443)
@@ -1223,6 +1223,30 @@
                                        );
                                break;
 
+                       case 'ticket_priority':
+                               $_lang_priority = lang('priority');
+                               $info = array
+                                       (
+                                               'table'                         
=> 'fm_tts_priority',
+                                               'id'                            
=> array('name' => 'id', 'type' => 'int'),
+                                               'fields'                        
=> array
+                                               (
+                                                       array
+                                                       (
+                                                               'name' => 
'name',
+                                                               'descr' => 
lang('name'),
+                                                               'type' => 
'varchar'
+                                                       ),
+                                               ),
+                                               'edit_msg'                      
=> lang('edit') . ' ' . $_lang_priority,
+                                               'add_msg'                       
=> lang('add') . ' ' . $_lang_priority,
+                                               'name'                          
=> $_lang_priority,
+                                               'acl_app'                       
=> 'property',
+                                               'acl_location'          => 
'.admin',
+                                               'menu_selection'        => 
'admin::property::ticket::ticket_priority'
+                                       );
+                               break;
+
                                //-------- ID type varchar
                        case 'project_status':
                                $info = array
@@ -1965,7 +1989,7 @@
                                                ),
                                                'edit_msg'                      
=> lang('edit'),
                                                'add_msg'                       
=> lang('add'),
-                                               'name'                          
=> lang('event action'),
+                                               'name'                          
=> lang('ticket status'),
                                                'acl_app'                       
=> 'property',
                                                'acl_location'          => 
'.admin',
                                                'menu_selection'        => 
'admin::property::ticket::ticket_status'

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-10 18:46:33 UTC (rev 11442)
+++ branches/Version-1_0-branch/property/inc/class.uiimport.inc.php     
2013-11-10 19:01:47 UTC (rev 11443)
@@ -9,12 +9,12 @@
 
                const DELIMITER = ";";
                const ENCLOSING = "'";
-               
+
                // List of messages, warnings and errors to be displayed to the 
user after the import
                protected $messages = array();
                protected $warnings = array();
                protected $errors = array();
-               
+
                // File system path to import folder on server
                protected $file;
                protected $district;
@@ -26,12 +26,12 @@
                protected $fields = array();
                protected $table;
                protected $debug;
-               
+
                // Label on the import button. Changes as we step through the 
import process.
                protected $import_button_label;
-               
+
                protected $defalt_values;
-               
+
                public function __construct()
                {
                        if ( !$GLOBALS['phpgw']->acl->check('run', 
phpgwapi_acl::READ, 'admin')
@@ -47,8 +47,8 @@
                        $this->db           = & $GLOBALS['phpgw']->db;
                        $this->table            = phpgw::get_var('table');
                }
-               
 
+
                /**
                 * Public method. 
                 * 
@@ -85,7 +85,7 @@
                                        }
 
                                        $file = PHPGW_SERVER_ROOT . 
"/property/inc/import/{$GLOBALS['phpgw_info']['user']['domain']}/{$this->conv_type}";
-       
+
                                        if ( is_file($file) )
                                        {
                                                require_once $file;
@@ -96,7 +96,8 @@
                                        require_once PHPGW_SERVER_ROOT . 
"/property/inc/import/import_update_generic.php";
                                }
 
-                               $this->import_conversion = new 
import_conversion;
+                               $location_id = phpgw::get_var('location_id', 
'int');
+                               $this->import_conversion = new 
import_conversion($location_id);
                                $this->debug = phpgw::get_var('debug', 'bool');
                                $this->import_conversion->debug = $this->debug;
 
@@ -110,7 +111,7 @@
                                                'name'  => 
$_FILES['file']['tmp_name'],
                                                'type'  => 
$_FILES['file']['type']
                                        );
-                                       
+
                                }
                                else
                                {
@@ -140,7 +141,7 @@
                                                        $valid_type = true;
                                                        break;
                                        }
-                                       
+
                                        if($valid_type)
                                        {
                                                $result = $this->import();
@@ -158,7 +159,7 @@
                                $difference = ($end_time - $start_time) / 60;
                                $end = date("G:i:s",$end_time);
                                echo "<h3>Import ended at: {$end}. Import 
lasted {$difference} minutes.";
-                               
+
                                if ($this->errors)
                                { 
                                        echo "<ul>";
@@ -166,10 +167,10 @@
                                        {
                                                echo '<li class="error">Error: 
' . $error . '</li>';
                                        }
-               
+
                                        echo "</ul>";
                                }
-               
+
                                if ($this->warnings)
                                { 
                                        echo "<ul>";
@@ -179,11 +180,11 @@
                                        }
                                        echo "</ul>";
                                }
-               
+
                                if ($this->messages)
                                {
                                        echo "<ul>";
-               
+
                                        foreach ($this->messages as $message)
                                        {
                                                echo '<li class="info">Message: 
' . $message . '</li>';
@@ -201,7 +202,7 @@
 
                                phpgwapi_cache::session_clear('property', 
'import_message');
                                $conv_list                      = 
$this->get_import_conv($import_settings['conv_type']);
-                               
+
                                $conv_option = '<option value="">' . lang('none 
selected') . '</option>' . "\n";
                                foreach ( $conv_list as $conv)
                                {
@@ -214,9 +215,13 @@
                                        $conv_option .=  <<<HTML
                                        <option 
value='{$conv['id']}'{$selected}>{$conv['name']}</option>
 HTML;
-                               }                       
+                               }
 
-                               $tables = $this->db->table_names();
+               //              $tables = $this->db->table_names();
+                               $tables = array
+                               (
+                                       'fm_vendor'
+                               );
                                sort($tables);
 
                                $table_option = '<option value="">' . 
lang('none selected') . '</option>' . "\n";
@@ -226,9 +231,24 @@
                                        $table_option .=  <<<HTML
                                        <option 
value='{$table}'{$selected}>{$table}</option>
 HTML;
-                               }                       
+                               }
 
+                               $entity                 = 
CreateObject('property.soadmin_entity');
+                               $entity_list    = $entity->read(array('allrows' 
=> true));
+                               $category_option = '<option value="">' . 
lang('none selected') . '</option>' . "\n";
+                               foreach($entity_list as $entry)
+                               {
+                                       $category_list = 
$entity->read_category_tree2($entry['id']);
 
+                                       foreach($category_list as $category)
+                                       {
+                                               $selected = 
$import_settings['category'] == $category ? 'selected =  "selected"' : '';
+                                               $category_option .=  <<<HTML
+                                               <option 
value="{$category['location_id']}"{$selected}>{$category['name']}</option>
+HTML;
+                                       }
+                               }
+
                                $home =  $GLOBALS['phpgw']->link('/home.php');
                                $action =  
$GLOBALS['phpgw']->link('/index.php', 
array('menuaction'=>'property.uiimport.index'));
 
@@ -258,6 +278,12 @@
                                                        {$table_option}
                                                </select>
                                                </p>
+                                               <p>
+                                                       <label 
for="category">Choose category:</label>
+                                                       <select 
name="location_id" id="category">
+                                                       {$category_option}
+                                               </select>
+                                               </p>
 
                                                <p>
                                                        <label 
for="debug">Debug:</label>
@@ -273,7 +299,7 @@
                                echo $html;
                        }
                }
-               
+
                /**
                 * Import Facilit data to Portico Estate's rental module
                 * The function assumes CSV files have been uploaded to a 
location on the server reachable by the
@@ -286,7 +312,7 @@
                public function import()
                {
                        $this->steps++;
-                       
+
                        /* Import logic:
                         * 
                         * 1. Do step logic if the session variable is not set
@@ -300,7 +326,7 @@
                        $this->log_messages($this->steps);
                        return $this->steps;
                }
-               
+
                protected function import_data()
                {
                        $metadata = array();
@@ -312,25 +338,44 @@
                                {
                                        _debug_array($metadata);
                                }
-                               
+
+
                                foreach($this->fields as $field)
                                {
-                                       if(!isset($metadata[$field]))
+                                       if($field && !isset($metadata[$field]))
                                        {
-                                               throw new Exception("Feltet 
'{$field}' finnes ikke i tabellen '{$this->table}'");
+                                               $this->messages[] = "Feltet 
'{$field}' finnes ikke i tabellen '{$this->table}'";
                                        }
                                }
-//                             _debug_array($metadata);die();
+
+                               
$this->import_conversion->set_table($this->table);
+                               
$this->import_conversion->set_metadata($metadata);
                        }
-                       
-                       $this->import_conversion->table = $this->table;
-                       $this->import_conversion->fields = $this->fields;
-                       $this->import_conversion->metadata = $metadata;
 
+                       if($this->fields)
+                       {
+                               $found_field = false;
+
+                               foreach($this->fields as $field)
+                               {
+                                       if($field && !$found_field)
+                                       {
+                                               $found_field = true;
+                                       }
+                               }
+
+                               if(!$found_field)
+                               {
+                                       throw new Exception("Felter er ikke 
definert");
+                               }
+                               $this->import_conversion->fields = 
$this->fields;
+                       }
+
+
                        $start_time = time();
-                       
+
                        $datalines = $this->csvdata;
-                       
+
                        $ok = true;
                        $_ok = false;
                        $this->db->transaction_begin();
@@ -338,12 +383,14 @@
                        //Do your magic...
                        foreach ($datalines as $data)
                        {
-                               if(!$_ok = $this->import_conversion->add($data))
+                               $_ok = $this->import_conversion->add($data);
+
+                               if( !$_ok )
                                {
                                        $ok = false;
                                }
                        }
-                       
+
                        if($ok)
                        {
                                $this->messages[] = "Imported data. (" . 
(time() - $start_time) . " seconds)";
@@ -371,22 +418,22 @@
                {
                        // Open the csv file
                        $handle = fopen($path, "r");
-                       
+
                        if ($skipfirstline)
                        {
                                // Read the first line to get the headers out 
of the way
                                $this->fields = $this->getcsv($handle);
                        }
-                       
+
                        $result = array();
-                       
+
                        while(($data = $this->getcsv($handle)) !== false)
                        {
                                $result[] = $data;
                        }
-                       
+
                        fclose($handle);
-                       
+
                        $this->messages[] = "Read '{$path}' file in " . (time() 
- $start_time) . " seconds";
                        $this->messages[] = "'{$path}' contained " . 
count($result) . " lines";
 
@@ -409,7 +456,7 @@
                        {
                                $this->fields = array_values($data[1]);
                        }
-                       
+
                        $rows = count($data)+1;
 
                        for ($i=$start; $i<$rows; $i++ )
@@ -430,7 +477,7 @@
                        return $result;
                }
 
-               
+
                /**
                 * Read the next line from the given file handle and parse it 
to CSV according to the rules set up
                 * in the class constants DELIMITER and ENCLOSING.  Returns 
FALSE like getcsv on EOF.
@@ -442,14 +489,14 @@
                {
                        return fgetcsv($handle, 1000, self::DELIMITER, 
self::ENCLOSING);
                }
-               
 
+
                private function log_messages($step)
         {
         //     sort($this->errors);
         //     sort($this->warnings);
         //     sort($this->messages);
-               
+        
             $msgs = array_merge(
                array('----------------Errors--------------------'),
                $this->errors,
@@ -506,7 +553,7 @@
                        }
 
                        $mime_magic = createObject('phpgwapi.mime_magic');
-                       
+
                        $file_list = array();
                        $dir = new DirectoryIterator($dirname); 
                        if ( is_object($dir) )

Modified: branches/Version-1_0-branch/property/inc/class.uitts.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uitts.inc.php        
2013-11-10 18:46:33 UTC (rev 11442)
+++ branches/Version-1_0-branch/property/inc/class.uitts.inc.php        
2013-11-10 19:01:47 UTC (rev 11443)
@@ -2774,6 +2774,14 @@
                        unset($_temp);
 
                        $preview_html = phpgw::get_var('preview_html', 'bool');
+                       $preview_pdf = phpgw::get_var('preview_pdf', 'bool');
+
+                       if($preview_pdf)
+                       {
+                               $this->_pdf_order($id, true);
+                               $GLOBALS['phpgw']->common->phpgw_exit();
+                       }
+
                        if($vendor_email || $preview_html)
                        {
                                $subject = lang('workorder').": 
{$ticket['order_id']}";
@@ -2794,7 +2802,7 @@
                                        $user_name = $ticket['assignedto_name'];
                                        
$GLOBALS['phpgw']->preferences->set_account_id($ticket['assignedto'], true);
                                        
$GLOBALS['phpgw_info']['user']['preferences'] = 
$GLOBALS['phpgw']->preferences->data;
-                                       if(!$preview_html)
+                                       if(!$preview_html && !$preview_pdf)
                                        {
                                                $_behalf_alert = lang('this 
order is sent by %1 on behalf of 
%2',$GLOBALS['phpgw_info']['user']['fullname'], $user_name);
                                                
$historylog->add('C',$id,$_behalf_alert);
@@ -2886,12 +2894,41 @@
                                        $GLOBALS['phpgw']->common->phpgw_exit();
                                }
 
+
                                if(isset($values['file_attach']) && 
is_array($values['file_attach']))
                                {
                                        $bofiles        = 
CreateObject('property.bofiles');
                                        $attachments = 
$bofiles->get_attachments("/fmticket/{$id}/", $values['file_attach']);
                                        $attachment_log = ' ' . 
lang('attachments') . ' : ' . implode(', ',$values['file_attach']);
                                }
+
+                               if(isset($values['send_order_format']) && 
$values['send_order_format'] == 'pdf')
+                               {
+                                       $pdfcode = $this->_pdf_order($id);
+                                       if($pdfcode)
+                                       {                                       
                
+                                               $dir =  
"{$GLOBALS['phpgw_info']['server']['temp_dir']}/pdf_files";
+
+                                               //save the file
+                                               if (!file_exists($dir))
+                                               {
+                                                       mkdir ($dir,0777);
+                                               }
+                                               $fname = 
tempnam($dir.'/','PDF_').'.pdf';
+                                               $fp = fopen($fname,'w');
+                                               fwrite($fp,$pdfcode);
+                                               fclose($fp);
+
+                                               $attachments[] = array
+                                               (
+                                                               'file' => 
$fname,
+                                                               'name' => 
"order_{$id}.pdf",
+                                                               'type' => 
'application/pdf'
+                                               );                              
                
+                                       }
+                                       $body = lang('order') . '.</br></br>' . 
lang('see attachment');
+                               }
+
                                if 
(isset($GLOBALS['phpgw_info']['server']['smtp_server']) && 
$GLOBALS['phpgw_info']['server']['smtp_server'])
                                {
                                        if (!is_object($GLOBALS['phpgw']->send))
@@ -3312,6 +3349,7 @@
                                        'order_dim1_list'                       
        => array('options' => 
$this->bocommon->select_category_list(array('type'=> 'order_dim1','selected' 
=>$ticket['order_dim1'], 'order' => 'id', 'id_in_name' => 'num' ))),
                                        'branch_list'                           
        => 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['tts_branch_list'])
 && 
$GLOBALS['phpgw_info']['user']['preferences']['property']['tts_branch_list']==1 
? array('options' => execMethod('property.boproject.select_branch_list', 
$values['branch_id'])) :'',
                                        'preview_html'                          
        => "javascript:preview_html($id)",
+                                       'preview_pdf'                           
        => "javascript:preview_pdf($id)",
 
                                );
 
@@ -3617,4 +3655,278 @@
                        return  phpgwapi_yui::tabview_generate($tabs, $tab);
                }
 
+
+               private function _pdf_order($id = 0, $preview = false , 
$show_cost = false)
+               {
+                       if(!$this->acl_read)
+                       {
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
+                       }
+
+                       $GLOBALS['phpgw_info']['flags']['noheader'] = true;
+                       $GLOBALS['phpgw_info']['flags']['nofooter'] = true;
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
+
+                       if(!$id)
+                       {
+                               $id = phpgw::get_var('id'); // in case of bigint
+                               $show_cost = phpgw::get_var('show_cost', 
'bool');
+                       }
+
+                       if(!$show_cost)
+                       {
+                               $show_cost = phpgw::get_var('show_cost', 
'bool');
+                       }
+
+                       $ticket = $this->bo->read_single($id, $values);
+
+                       if(isset($this->bo->config->config_data['invoice_acl']) 
&& $this->bo->config->config_data['invoice_acl'] == 'dimb')
+                       {
+                               $approve_role = 
execMethod('property.boinvoice.check_role', $ticket['ecodimb']);
+
+                               $_ok = false;
+                               if($approve_role['is_supervisor'])
+                               {
+                                       $_ok = true;
+                               }
+                               else if( $approve_role['is_budget_responsible'] 
)
+                               {
+                                       $_ok = true;                            
        
+                               }
+
+                               //FIXME
+                       /*
+                               else if( $common_data['workorder']['approved'] )
+                               {
+                                       $_ok = true;                            
        
+                               }
+                       */
+                               if(!$_ok)
+                               {
+                                       phpgwapi_cache::message_set( 
lang('order is not approved'), 'error' );
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uitts.view', 'id'=> $id));
+                               }
+                               unset($_ok);
+                       }
+
+                       //FIXME
+                       $content = array(); 
//$this->_get_order_details($common_data['content'],        $show_cost);
+
+                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+                       $date = 
$GLOBALS['phpgw']->common->show_date(time(),$dateformat);
+
+                       set_time_limit(1800);
+                       $pdf= CreateObject('phpgwapi.pdf');
+
+                       $pdf ->ezSetMargins(50,70,50,50);
+                       $pdf->selectFont(PHPGW_API_INC . 
'/pdf/fonts/Helvetica.afm');
+
+                       // put a line top and bottom on all the pages
+                       $all = $pdf->openObject();
+                       $pdf->saveState();
+
+                       if(isset($this->bo->config->config_data['order_logo']) 
&& $this->bo->config->config_data['order_logo'])
+                       {
+                               
$pdf->addJpegFromFile($this->bo->config->config_data['order_logo'],
+                                       40,
+                                       800,
+                                       
isset($this->bo->config->config_data['order_logo_width']) && 
$this->bo->config->config_data['order_logo_width'] ? 
$this->bo->config->config_data['order_logo_width'] : 80
+                               );
+                       }
+                       $pdf->setStrokeColor(0,0,0,1);
+                       $pdf->line(20,40,578,40);
+               //      $pdf->line(20,820,578,820);
+               //      $pdf->addText(50,823,6,lang('order'));
+                       
$pdf->addText(50,28,6,$this->bo->config->config_data['org_name']);
+                       $pdf->addText(300,28,6,$date);
+
+                       if($preview)
+                       {
+                               $pdf->setColor(1,0,0);
+                               $pdf->addText(200,400,40,lang('DRAFT'),-10);
+                               $pdf->setColor(1,0,0);
+                       }
+
+                       $pdf->restoreState();
+                       $pdf->closeObject();
+                       // note that object can be told to appear on just odd 
or even pages by changing 'all' to 'odd'
+                       // or 'even'.
+                       $pdf->addObject($all,'all');
+
+//                     $pdf->ezSetDy(-100);
+
+                       $pdf->ezStartPageNumbers(500,28,6,'right','{PAGENUM} ' 
. lang('of') . ' {TOTALPAGENUM}',1);
+
+                       $data = array
+                       (
+                               
array('col1'=>"{$this->bo->config->config_data['org_name']}\n\nOrg.nr: 
{$this->bo->config->config_data['org_unit_id']}",'col2'=>lang('Order'),'col3'=>lang('order
 id') . "\n\n{$ticket['order_id']}")
+                       );              
+
+                       
$pdf->ezTable($data,array('col1'=>'','col2'=>'','col3'=>''),''
+                               ,array('showHeadings'=>0,'shaded'=>0,'xPos'=>0
+                               ,'xOrientation'=>'right','width'=>500
+                               ,'cols'=>array
+                               (
+                                       
'col1'=>array('justification'=>'right','width'=>200, 'justification'=>'left'),
+                                       
'col2'=>array('justification'=>'right','width'=>100, 'justification'=>'center'),
+                                       
'col3'=>array('justification'=>'right','width'=>200),
+                               )
+
+                       ));
+
+
+                       $delivery_address = lang('delivery address'). ':';
+                       
if(isset($this->bo->config->config_data['delivery_address']) && 
$this->bo->config->config_data['delivery_address'])
+                       {
+                               $delivery_address .= 
"\n{$this->bo->config->config_data['delivery_address']}";
+                       }
+                       else
+                       {
+                               $location_code = 
$ticket['location_data']['location_code'];
+                               $address_element = 
execMethod('property.botts.get_address_element', $location_code);
+                               foreach($address_element as $entry)
+                               {
+                                       $delivery_address .= 
"\n{$entry['text']}: {$entry['value']}";
+                               }
+                       }
+
+                       $invoice_address = lang('invoice address') . 
":\n{$this->bo->config->config_data['invoice_address']}";
+
+                       
$GLOBALS['phpgw']->preferences->set_account_id($common_data['workorder']['user_id'],
 true);
+
+
+                       $on_behalf_of_assigned = 
phpgw::get_var('on_behalf_of_assigned', 'bool');
+                       if($on_behalf_of_assigned && 
isset($ticket['assignedto_name']))
+                       {
+                               $from_name = $ticket['assignedto_name'];
+                               
$GLOBALS['phpgw']->preferences->set_account_id($ticket['assignedto'], true);
+                               $GLOBALS['phpgw_info']['user']['preferences'] = 
$GLOBALS['phpgw']->preferences->data;
+                       }
+                       else
+                       {
+                               $from_name = 
$GLOBALS['phpgw_info']['user']['fullname'];
+                       }
+
+                       $from = lang('date') . ": {$date}\n";
+                       $from .= lang('dimb') .": {$ticket['ecodimb']}\n";
+                       $from .= lang('from') . ":\n   {$from_name}";
+                       $from .= "\n   
{$GLOBALS['phpgw']->preferences->data['property']['email']}";
+                       $from .= "\n   
{$GLOBALS['phpgw']->preferences->data['property']['cellphone']}";
+
+
+
+                       if(isset($ticket['vendor_id']) && $ticket['vendor_id'])
+                       {
+                               $contacts       = 
CreateObject('property.sogeneric');
+                               $contacts->get_location_info('vendor',false);
+
+                               $custom                 = 
createObject('property.custom_fields');
+                               $vendor_data['attributes'] = 
$custom->find('property','.vendor', 0, '', 'ASC', 'attrib_sort', true, true);
+
+                               $vendor_data    = 
$contacts->read_single(array('id' => $ticket['vendor_id']),$vendor_data);
+                               if(is_array($vendor_data))
+                               {
+                                       foreach($vendor_data['attributes'] as 
$attribute)
+                                       {
+                                               
if($attribute['name']=='org_name')
+                                               {
+                                                       
$ticket['vendor_name']=$attribute['value'];
+                                                       break;
+                                               }
+                                       }
+                               }
+                               unset($contacts);
+                       }
+
+                       $data = array
+                       (
+                               array('col1'=>lang('vendor') . 
":\n{$ticket['vendor_name']}",'col2' => $delivery_address),
+                               array('col1'=>$from,'col2'=>$invoice_address)
+                       );              
+
+                       $pdf->ezTable($data,array('col1'=>'','col2'=>''),''
+                               ,array('showHeadings'=>0,'shaded'=>0,'xPos'=>0
+                               
,'xOrientation'=>'right','width'=>500,'showLines'=> 2
+                               ,'cols'=>array
+                               (
+                                       
'col1'=>array('justification'=>'right','width'=>250, 'justification'=>'left'),
+                                       
'col2'=>array('justification'=>'right','width'=>250, 'justification'=>'left'),
+                               )
+
+                       ));
+
+                       $pdf->ezSetDy(-10);
+                       $pdf->selectFont(PHPGW_API_INC . 
'/pdf/fonts/Helvetica-Bold.afm');
+                       $pdf->ezText(lang('descr').':',20);
+                       $pdf->selectFont(PHPGW_API_INC . 
'/pdf/fonts/Helvetica.afm');
+                       $ressursnr = 
$GLOBALS['phpgw_info']['user']['preferences']['property']['ressursnr'];
+
+                       
$contact_data=$this->bocommon->initiate_ui_contact_lookup(array(
+                               'contact_id'            => 
$ticket['contact_id'],
+                               'field'                         => 'contact',
+                               'type'                          => 'form'));
+
+
+                       if(isset($contact_data['value_contact_name']) && 
$contact_data['value_contact_name'])
+                       {
+                               $contact_name = 
ltrim($contact_data['value_contact_name']);
+                       }
+                       if(isset($contact_data['value_contact_email']) && 
$contact_data['value_contact_email'])
+                       {
+                               $contact_email 
=$contact_data['value_contact_email'];
+                       }
+                       if(isset($contact_data['value_contact_tel']) && 
$contact_data['value_contact_tel'])
+                       {
+                               $contact_phone = 
$contact_data['value_contact_tel'];
+                       }
+
+                       $pdf->ezText($ticket['order_descr'],14);
+                       $pdf->ezSetDy(-20);
+                       $pdf->selectFont(PHPGW_API_INC . 
'/pdf/fonts/Helvetica-Bold.afm');
+                       $pdf->ezText('Kontakt på bygget:',14);
+                       $pdf->selectFont(PHPGW_API_INC . 
'/pdf/fonts/Helvetica.afm');
+                       $pdf->ezText($contact_name,14);
+                       $pdf->ezText($contact_email,14);
+                       $pdf->ezText($contact_phone,14);
+                       $pdf->ezSetDy(-20);
+
+                       $pdf->selectFont(PHPGW_API_INC . 
'/pdf/fonts/Helvetica-Bold.afm');
+                       $pdf->ezText("Faktura må merkes med ordrenummer: 
{$ticket['order_id']} og ressursnr.:{$ressursnr}",14);
+                       $pdf->selectFont(PHPGW_API_INC . 
'/pdf/fonts/Helvetica.afm');
+                       if($content)
+                       {
+                               $pdf->ezSetDy(-20);
+                               $pdf->ezTable($content,'',lang('details'),
+                                       
array('xPos'=>0,'xOrientation'=>'right','width'=>500,0,'shaded'=>0,'fontSize' 
=> 8,'showLines'=> 2,'titleFontSize' => 12,'outerLineThickness'=>2
+                                       ,'cols'=>array(
+                                               lang('bill per 
unit')=>array('justification'=>'right','width'=>50)
+                                               
,lang('quantity')=>array('justification'=>'right','width'=>50)
+                                               
,lang('cost')=>array('justification'=>'right','width'=>50)
+                                               
,lang('unit')=>array('width'=>40)
+                                               
,lang('descr')=>array('width'=>120))
+                                       ));
+                       }
+
+                       
if(isset($this->bo->config->config_data['order_footer_header']) && 
$this->bo->config->config_data['order_footer_header'])
+                       {
+                               if(!$content)
+                               {
+                                       $pdf->ezSetDy(-100);
+                               }
+                               
$pdf->ezText($this->bo->config->config_data['order_footer_header'],12);
+                               
$pdf->ezText($this->bo->config->config_data['order_footer'],10);
+                       }
+
+                       $document= $pdf->ezOutput();
+
+                       if($preview)
+                       {
+                               
$pdf->print_pdf($document,"order_{$ticket['order_id']}");
+                       }
+                       else
+                       {
+                               return $document;
+                       }
+               }
+
        }

Modified: 
branches/Version-1_0-branch/property/inc/import/import_update_generic.php
===================================================================
--- branches/Version-1_0-branch/property/inc/import/import_update_generic.php   
2013-11-10 18:46:33 UTC (rev 11442)
+++ branches/Version-1_0-branch/property/inc/import/import_update_generic.php   
2013-11-10 19:01:47 UTC (rev 11443)
@@ -6,19 +6,96 @@
                public $warnings = array();
                public $errors = array();
                public $debug = true;
-               public $fields = array();
-               public $table;
-               public $metadata = array();
+               protected $is_eav;
+               protected $location_id;
+               protected $bim_type_id = 0;
+               protected $table;
+               protected $entity_id;
+               protected $cat_id;
+               protected $metadata = array();
 
-               public function __construct()
+               public function __construct($location_id)
                {
+                       $location_id = (int) $location_id;
                        set_time_limit(10000); //Set the time limit for this 
request
                        $this->account          = 
(int)$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->db           = & $GLOBALS['phpgw']->db;
+                       $this->join                     = $this->db->join;
+
+                       if(! $category = 
execMethod('property.soadmin_entity.get_single_category', $location_id ))
+                       {
+                               throw new Exception("Not a valid location for 
{$location_id}");
+                       }
+
+                       $this->is_eav = !!$category['is_eav'];
+                       $this->location_id = $location_id;
+
+                       $this->entity_id = $category['entity_id'];
+                       $this->cat_id = $category['id'];
+
+                       
+                       if ($this->is_eav)
+                       {
+                               $this->table = 'fm_bim_item';
+                               $sql = "SELECT fm_bim_type.id FROM fm_bim_type 
WHERE location_id = {$location_id}";
+                               $this->db->query($sql,__LINE__,__FILE__);
+                               $this->db->next_record();
+                               $this->bim_type_id = $this->db->f('id');
+                               $custom                 = 
createObject('property.custom_fields');
+                               $attributes     = $custom->find2($location_id, 
0, '', 'ASC', 'attrib_sort', true, true);
+                               $this->metadata['id'] = array('primary_key' => 
true);
+                               $this->metadata['location_id'] = 
array('primary_key' => true);
+                               $this->metadata['model'] = array();
+                               $this->metadata['p_location_id'] = array();
+                               $this->metadata['p_id'] = array();
+                               $this->metadata['location_code'] = array();
+                               $this->metadata['loc1'] = array();
+                               $this->metadata['address'] = array();
+                               $this->metadata['entry_date'] = array();
+                               $this->metadata['user_id'] = array();
+
+                               foreach($attributes as $attribute)
+                               {
+                                       
$this->metadata[$attribute['column_name']] = array();
+                               }
+
+                       }
+                       else
+                       {
+                               $this->table = 
"fm_entity_{$category['entity_id']}_{$category['id']}";
+                               $this->metadata = 
$this->db->metadata($this->table);
+                       }
+
+
                }
 
+               public function set_table($table)
+               {
+                       $this->table = $table;
+               }
+               public function set_metadata($metadata)
+               {
+                       $this->metadata = $metadata;
+               }
+
                public function add($data)
                {
+                       if ($this->is_eav)
+                       {
+                               $ok = $this->_add_eav($data);
+                       }
+                       else
+                       {
+                               $ok = $this->_add_sql($data);
+                       }
+                       return $ok;
+               }
+               
+               private function _add_eav($data)
+               {
+                       static $count_records = 0;
+// -------- produce data_set
+
                        $error = false;
                        $table = $this->table;
                        $fields =  $this->fields;
@@ -28,6 +105,199 @@
                                throw new Exception("Tabell er ikke angitt");
                        }
 
+                       $remove_keys = array();
+                       foreach($this->metadata as $key => $info)
+                       {
+                               if(isset($info['primary_key']) && 
$info['primary_key'])
+                               {
+                                       $_value = $data[array_search($key, 
$fields)];
+                                       if(!array_search($key, $fields) || 
!$_value)
+                                       {
+                                               if(array_search($key, $fields) 
=== 0 && $_value)
+                                               {
+                                                       break;
+                                               }
+                                               if($count_records === 0)// 
first one
+                                               {
+                                                       throw new 
Exception("Fant ikke verdi for feltet 'primary key' $key");
+                                               }
+                                               else
+                                               {
+                                                       $found_data = false;
+                                                       foreach($data as $value)
+                                                       {
+                                                               if($value && 
!$found_data)
+                                                               {
+                                                                       
$found_data = true;
+                                                               }
+                                                       }
+                                                       if($found_data)
+                                                       {
+                                                               throw new 
Exception("Fant ikke verdi for feltet 'primary key' $key");
+                                                       }
+                                                       else
+                                                       {
+                                                               
$this->warnings[] = "Fant ikke verdi for feltet 'primary key' $key";
+                                                               return true;
+                                                       }
+                                               }
+                                       }
+                                       $remove_keys[] = $key;
+                               }
+                       }
+                       $count_records ++;
+                       unset($key);
+                       unset($info);
+                       unset($_value);
+
+                       $value_set = array();
+                       foreach ($fields as $key => $field)
+                       {
+                               if(isset($this->metadata[$field]))
+                               {
+                                       $value_set[$field]      = 
$this->validate_value($data[$key], $field);
+                               }
+                       }
+
+                       $id = (int) $value_set['id'];
+                       $filtermethod = "location_id = {$this->location_id} AND 
id = {$id}";
+
+//---------produce data_set
+
+                       $location_id = $this->location_id;
+                       $sql = "SELECT fm_bim_item.id FROM fm_bim_item WHERE 
{$filtermethod}";
+                       $this->db->query($sql,__LINE__,__FILE__);
+
+                       $type = (int)$this->bim_type_id;
+
+                       $location_name = 
"_entity_{$this->entity_id}_{$this->cat_id}";
+               
+                       if($this->db->next_record())
+                       {
+                               $this->warnings[] = "ID finnes fra før: {$id}, 
oppdaterer";
+
+                               foreach ($remove_keys as $remove_key)
+                               {
+                                       unset($value_set[$remove_key]);         
        
+                               }
+
+                               phpgw::import_class('phpgwapi.xmlhelper');
+
+                               $xmldata = 
phpgwapi_xmlhelper::toXML($value_set, $location_name);
+                               $doc = new DOMDocument;
+                               $doc->preserveWhiteSpace = true;
+                               $doc->loadXML( $xmldata );
+                               $domElement = 
$doc->getElementsByTagName($location_name)->item(0);
+                               $domAttribute = 
$doc->createAttribute('appname');
+                               $domAttribute->value = 'property';
+
+                               // Don't forget to append it to the element
+                               $domElement->appendChild($domAttribute);
+
+                               // Append it to the document itself
+                               $doc->appendChild($domElement);
+
+                               $doc->formatOutput = true;
+                               $xml = $doc->saveXML();
+
+                               $_value_set = array
+                               (
+                                       'xml_representation'    => 
$this->db->db_addslashes($xml),
+                                       'p_location_id'                 => 
isset($value_set['p_location_id']) && $value_set['p_location_id'] ? 
$value_set['p_location_id'] : '',
+                                       'p_id'                                  
=> isset($value_set['p_id']) && $value_set['p_id'] ? $value_set['p_id'] : '',
+                                       'location_code'                 => 
$value_set['location_code'],
+                                       'loc1'                                  
=> $value_set['loc1'],
+                                       'address'                               
=> $value_set['address'],
+                               );
+
+                               $_value_set     = 
$this->db->validate_update($_value_set);
+
+                               $sql = "UPDATE fm_bim_item SET $_value_set 
WHERE id = $id AND location_id = {$location_id}";
+                       }
+                       else
+                       {
+                               $this->warnings[] = "Denne er ny: {$id}, legger 
til";
+
+                               phpgw::import_class('phpgwapi.xmlhelper');
+                               $xmldata = 
phpgwapi_xmlhelper::toXML($value_set, $location_name);
+                               $doc = new DOMDocument;
+                               $doc->preserveWhiteSpace = true;
+                               $doc->loadXML( $xmldata );
+                               $domElement = 
$doc->getElementsByTagName($location_name)->item(0);
+                               $domAttribute = 
$doc->createAttribute('appname');
+                               $domAttribute->value = 'property';
+
+                               // Don't forget to append it to the element
+                               $domElement->appendChild($domAttribute);
+
+                               // Append it to the document itself
+                               $doc->appendChild($domElement);
+                               $doc->formatOutput = true;
+                       
+                               $xml = $doc->saveXML();
+
+                               if (function_exists('com_create_guid') === true)
+                               {
+                                       $guid = trim(com_create_guid(), '{}');
+                               }
+                               else
+                               {
+                                       $guid = 
sprintf('%04X%04X-%04X-%04X-%04X-%04X%04X%04X', mt_rand(0, 65535), mt_rand(0, 
65535), mt_rand(0, 65535), mt_rand(16384, 20479), mt_rand(32768, 49151), 
mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535));
+                               }
+
+                               $values_insert = array
+                               (
+                                       'id'                                    
=> $id,
+                                       'type'                                  
=> $type,
+                                       'location_id'                   => 
$location_id,
+                                       'guid'                                  
=> $guid,
+                                       'xml_representation'    => 
$this->db->db_addslashes($xml),
+                                       'model'                                 
=> 0,
+                                       'p_location_id'                 => 
isset($value_set['p_location_id']) && $value_set['p_location_id'] ? 
$value_set['p_location_id'] : '',
+                                       'p_id'                                  
=> isset($value_set['p_id']) && $value_set['p_id'] ? $value_set['p_id'] : '',
+                                       'location_code'                 => 
$value_set['location_code'],
+                                       'loc1'                                  
=> $value_set['loc1'],
+                                       'address'                               
=> $value_set['address'],
+                                       'entry_date'                    => 
time(),
+                                       'user_id'                               
=> $this->account
+                               );
+
+                               $sql = "INSERT INTO fm_bim_item (" . 
implode(',',array_keys($values_insert)) . ') VALUES ('
+                                . 
$this->db->validate_insert(array_values($values_insert)) . ')';
+                       }
+
+                       $ok = false;
+                       if($this->debug)
+                       {
+                               _debug_array($sql);
+                       }
+                       else
+                       {
+                               $ok = $this->db->query($sql,__LINE__,__FILE__);
+                       }
+
+                       if($ok)
+                       {
+                               $this->messages[] = "Successfully imported 
record: id ({$id})";
+                       }
+                       else
+                       {
+                               $this->errors[] = "Error importing record: id 
({$id})";
+                       }
+                       return $ok;
+               }
+
+               private function _add_sql($data)
+               {
+                       $error = false;
+                       $table = $this->table;
+                       $fields =  $this->fields;
+
+                       if(!$table)
+                       {
+                               throw new Exception("Tabell er ikke angitt");
+                       }
+
                        if(!$fields)
                        {
                                throw new Exception("Felter er ikke definert");
@@ -57,7 +327,10 @@
                        $value_set = array();
                        foreach ($fields as $key => $field)
                        {
-                               $value_set[$field]      = 
$this->validate_value($data[$key], $field);
+                               if(isset($this->metadata[$field]))
+                               {
+                                       $value_set[$field]      = 
$this->validate_value($data[$key], $field);
+                               }
                        }
 
                        $this->db->query("SELECT count(*) as cnt FROM {$table} 
WHERE {$filtermethod}",__LINE__,__FILE__);
@@ -91,35 +364,26 @@
                                $request_ok = 
$this->db->query($sql,__LINE__,__FILE__);
                        }
 
-                       if(!$error)
+                       if(!$request_ok)
                        {
-                               $this->messages[] = "Successfully updated 
entry: id ($filtermethod)";
+                               $this->messages[] = "Successfully imported 
record: id ({$id})";
                                $ok = true;
                        }
                        else
                        {
-                               $this->errors[] = "Error updating location: id 
({$filtermethod})";
+                               $this->errors[] = "Error importing record: id 
({$id})";
                                $ok = false;
                        }
                        return $ok;
                }
 
-
-               /**
-                * Test a value for null according to several formats that can 
exist in the export.
-                * Returns true if the value is null according to these rules, 
false otherwise.
-                * 
-                * @param string $value The value to test
-                * @return bool
-                */
-               protected function is_null($value)
-               {
-                       return ((trim($value) == "") || ($data == "<NULL>") || 
($data == "''"));
-               }
-
                protected function validate_value($value,$field)
                {
-                       $datatype = $this->metadata[$field]->type;
+                       if($value == '#N/A')
+                       {
+                               return '';
+                       }
+                       $datatype = $this->metadata[$field]['type'];
                        switch ($datatype)
                        {
                                case 'char':

Modified: branches/Version-1_0-branch/property/setup/default_records.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/default_records.inc.php  
2013-11-10 18:46:33 UTC (rev 11442)
+++ branches/Version-1_0-branch/property/setup/default_records.inc.php  
2013-11-10 19:01:47 UTC (rev 11443)
@@ -946,3 +946,7 @@
                $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
fm_ecodimb_role (id, name) VALUES (2, 'Attestant')",__LINE__,__FILE__);
                $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
fm_ecodimb_role (id, name) VALUES (3, 'Anviser')",__LINE__,__FILE__);
 
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
fm_tts_priority (id, name) VALUES (1, '1 - Highest')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
fm_tts_priority (id, name) VALUES (2, '2')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
fm_tts_priority (id, name) VALUES (3, '3 - Lowest')");
+

Modified: branches/Version-1_0-branch/property/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/setup.inc.php    2013-11-10 
18:46:33 UTC (rev 11442)
+++ branches/Version-1_0-branch/property/setup/setup.inc.php    2013-11-10 
19:01:47 UTC (rev 11443)
@@ -12,7 +12,7 @@
        */
 
        $setup_info['property']['name']                 = 'property';
-       $setup_info['property']['version']              = '0.9.17.672';
+       $setup_info['property']['version']              = '0.9.17.673';
        $setup_info['property']['app_order']    = 8;
        $setup_info['property']['enable']               = 1;
        $setup_info['property']['app_group']    = 'office';
@@ -135,6 +135,7 @@
                'fm_project_history',
                'fm_project_budget',
                'fm_tts_status',
+               'fm_tts_priority',
                'fm_tts_tickets',
                'fm_tts_history',
                'fm_tts_views',

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-10 18:46:33 UTC (rev 11442)
+++ branches/Version-1_0-branch/property/setup/tables_current.inc.php   
2013-11-10 19:01:47 UTC (rev 11443)
@@ -1009,6 +1009,16 @@
                        'ix' => array(),
                        'uc' => array()
                ),
+               'fm_tts_priority' => array(
+                       'fd' => array(
+                               'id' => array('type' => 'int','nullable' => 
False),
+                               'name' => array('type' => 'varchar','precision' 
=> '100','nullable' => true),
+                       ),
+                       'pk' => array('id'),
+                       'ix' => array(),
+                       'ix' => array(),
+                       'uc' => array()
+               ),
                'fm_tts_tickets' => array(
                        'fd' => array(
                                'id' => array('type' => 'auto','nullable' => 
False),

Modified: branches/Version-1_0-branch/property/setup/tables_update.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/tables_update.inc.php    
2013-11-10 18:46:33 UTC (rev 11442)
+++ branches/Version-1_0-branch/property/setup/tables_update.inc.php    
2013-11-10 19:01:47 UTC (rev 11443)
@@ -7738,3 +7738,49 @@
                }
        }
 
+       /**
+       * Update property version from 0.9.17.672 to 0.9.17.673
+       * Add configurable prioriy keys for tickets
+       */
+
+       $test[] = '0.9.17.672';
+       function property_upgrade0_9_17_672()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               $GLOBALS['phpgw_setup']->oProc->CreateTable(
+                       'fm_tts_priority', array(
+                               'fd' => array(
+                                       'id' => array('type' => 
'int','precision' => 4,'nullable' => False),
+                                       'name' => array('type' => 
'varchar','precision' => 100,'nullable' => true),
+                               ),
+                               'pk' => array('id'),
+                               'fk' => array(),
+                               'ix' => array(),
+                               'uc' => array()
+                       )
+               );
+
+               $GLOBALS['phpgw_setup']->oProc->query("SELECT config_value FROM 
phpgw_config WHERE config_app = 'property' AND config_name = 'prioritylevels'");
+               $GLOBALS['phpgw_setup']->oProc->next_record();
+               $prioritylevels = 
$GLOBALS['phpgw_setup']->oProc->f('config_value');
+
+               $prioritylevels = $prioritylevels ? $prioritylevels : 3;
+
+               $priority_comment = array();
+               $priority_comment[$prioritylevels]      = " - Lowest";
+               $priority_comment[1]                            = " - Highest";
+
+               for ($i=1; $i<= $prioritylevels; $i++)
+               {
+                       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
fm_tts_priority (id, name) VALUES ({$i}, '{$i}{$priority_comment[$i]}')");
+               }
+
+               $GLOBALS['phpgw_setup']->oProc->query("DELETE FROM phpgw_config 
WHERE config_app = 'property' AND config_name = 'prioritylevels'");
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.673';
+                       return $GLOBALS['setup_info']['property']['currentver'];
+               }
+       }

Modified: branches/Version-1_0-branch/property/templates/base/config.tpl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/config.tpl      
2013-11-10 18:46:33 UTC (rev 11442)
+++ branches/Version-1_0-branch/property/templates/base/config.tpl      
2013-11-10 19:01:47 UTC (rev 11443)
@@ -339,16 +339,6 @@
                                </select>
                        </td>
                </tr>
-               <tr class="row_on">
-                       <td>{lang_priority_levels_TTS}.</td>
-                       <td>
-                               <select name="newsettings[prioritylevels]">
-                                       <option value="" 
{selected_prioritylevels_}>3</option>
-                                       <option value="4" 
{selected_prioritylevels_4}>4</option>
-                                       <option value="5" 
{selected_prioritylevels_5}>5</option>
-                               </select>
-                       </td>
-               </tr>
                <tr class="row_off">
                        <td>{lang_mandatory_title_TTS}.</td>
                        <td>

Modified: branches/Version-1_0-branch/property/templates/base/tts.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/tts.xsl 2013-11-10 
18:46:33 UTC (rev 11442)
+++ branches/Version-1_0-branch/property/templates/base/tts.xsl 2013-11-10 
19:01:47 UTC (rev 11443)
@@ -406,6 +406,16 @@
                                
Window1=window.open(strURL,'Search',"left=50,top=100,width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");
 
                        }
+
+                       function preview_pdf(id)
+                       {
+                               var on_behalf_of_assigned = 
document.getElementById("on_behalf_of_assigned").checked ? 1 : 0;
+
+                               var oArgs = 
{menuaction:'property.uitts.view',id:id, preview_pdf:true, 
on_behalf_of_assigned: on_behalf_of_assigned};
+                               var strURL = phpGWLink('index.php', oArgs);
+                               
Window1=window.open(strURL,'Search',"left=50,top=100,width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");
+                       }
+
                </script>
                <table cellpadding="2" cellspacing="2" width="95%" 
align="center">
                        <xsl:choose>
@@ -819,8 +829,8 @@
                                                                                
                </td>
                                                                                
                <td>
                                                                                
                        <xsl:value-of select="value_order_id"/>
-                                                                               
                        <xsl:text> </xsl:text>
                                                                                
                        <input type="hidden" name="values[order_id]" 
value="{value_order_id}"/>
+                                                                               
                        <xsl:text> | </xsl:text>
                                                                                
                        <xsl:variable name="lang_preview_html">
                                                                                
                                <xsl:value-of select="php:function('lang', 
'preview html')"/>
                                                                                
                        </xsl:variable>
@@ -830,6 +840,16 @@
                                                                                
                                </xsl:attribute>
                                                                                
                                <xsl:value-of select="$lang_preview_html"/>
                                                                                
                        </a>
+                                                                               
                        <xsl:text> | </xsl:text>
+                                                                               
                        <xsl:variable name="lang_preview_pdf">
+                                                                               
                                <xsl:value-of select="php:function('lang', 
'preview pdf')"/>
+                                                                               
                        </xsl:variable>
+                                                                               
                        <a href="{preview_pdf}">
+                                                                               
                                <xsl:attribute name="title">
+                                                                               
                                <xsl:value-of select="$lang_preview_pdf"/>
+                                                                               
                                </xsl:attribute>
+                                                                               
                                <xsl:value-of select="$lang_preview_pdf"/>
+                                                                               
                        </a>
                                                                                
                </td>
                                                                                
        </tr>
                                                                                
        <tr>
@@ -991,8 +1011,27 @@
                                                                                
                        </label>
                                                                                
                </td>
                                                                                
                <td>
-                                                                               
                        <div id="paging_3"/>
-                                                                               
                        <div id="datatable-container_3"/>
+                                                                               
                        <table>
+                                                                               
                                <tr>
+                                                                               
                                        <td valign = 'top'>
+                                                                               
                                                <select 
name="values[send_order_format]" class="forms">
+                                                                               
                                                        <xsl:attribute 
name="title">
+                                                                               
                                                                <xsl:value-of 
select="php:function('lang', 'format')"/>
+                                                                               
                                                        </xsl:attribute>
+                                                                               
                                                        <option value="html">
+                                                                               
                                                                
<xsl:text>HTML</xsl:text>
+                                                                               
                                                        </option>
+                                                                               
                                                        <option value="pdf">
+                                                                               
                                                                
<xsl:text>PDF</xsl:text>
+                                                                               
                                                        </option>
+                                                                               
                                                </select>
+                                                                               
                                        </td>
+                                                                               
                                        <td>
+                                                                               
                                                <div id="paging_3"/>
+                                                                               
                                                <div 
id="datatable-container_3"/>
+                                                                               
                                        </td>
+                                                                               
                                </tr>
+                                                                               
                        </table>
                                                                                
                </td>
                                                                                
                <tr>
                                                                                
                        <td valign="top">


Property changes on: branches/Version-1_0-branch/property/test_menu.php
___________________________________________________________________
Added: svn:keywords
   + Revision Author Id




reply via email to

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