[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [11109] Merge 11094:11108 from trunk
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [11109] Merge 11094:11108 from trunk |
Date: |
Wed, 15 May 2013 08:03:57 +0000 |
Revision: 11109
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11109
Author: sigurdne
Date: 2013-05-15 08:03:03 +0000 (Wed, 15 May 2013)
Log Message:
-----------
Merge 11094:11108 from trunk
Modified Paths:
--------------
branches/Version-1_0-branch/controller/inc/class.hook_helper.inc.php
branches/Version-1_0-branch/controller/inc/class.socase.inc.php
branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php
branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
branches/Version-1_0-branch/controller/inc/class.uicase.inc.php
branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php
branches/Version-1_0-branch/controller/inc/model/class.check_item_case.inc.php
branches/Version-1_0-branch/controller/inc/model/class.check_list.inc.php
branches/Version-1_0-branch/controller/setup/setup.inc.php
branches/Version-1_0-branch/controller/setup/tables_current.inc.php
branches/Version-1_0-branch/controller/setup/tables_update.inc.php
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list.xsl
branches/Version-1_0-branch/controller/templates/base/check_list/edit_check_list.xsl
branches/Version-1_0-branch/mobilefrontend/templates/base/config.tpl
branches/Version-1_0-branch/phpgwapi/inc/auth/class.auth_custom_sso.inc.php
branches/Version-1_0-branch/phpgwapi/inc/class.login.inc.php
branches/Version-1_0-branch/phpgwapi/inc/class.ofphpgwapi.inc.php
branches/Version-1_0-branch/phpgwapi/inc/class.phpgw.inc.php
branches/Version-1_0-branch/phpgwapi/inc/functions.inc.php
branches/Version-1_0-branch/phpgwapi/templates/base/datatable_common.xsl
branches/Version-1_0-branch/property/inc/class.botts.inc.php
branches/Version-1_0-branch/property/inc/class.soresponsible.inc.php
branches/Version-1_0-branch/property/inc/class.sotts.inc.php
branches/Version-1_0-branch/property/inc/class.uicondition_survey.inc.php
branches/Version-1_0-branch/property/inc/class.uitts.inc.php
branches/Version-1_0-branch/property/inc/hook_config.inc.php
branches/Version-1_0-branch/property/templates/base/config.tpl
branches/Version-1_0-branch/property/templates/base/tts.xsl
branches/Version-1_0-branch/rental/inc/class.bofellesdata.inc.php
Added Paths:
-----------
branches/Version-1_0-branch/mobilefrontend/controller/images/green_ring.png
branches/Version-1_0-branch/mobilefrontend/controller/images/green_ring.psd
branches/Version-1_0-branch/mobilefrontend/controller/images/red_ring.png
branches/Version-1_0-branch/mobilefrontend/controller/images/red_ring.psd
branches/Version-1_0-branch/phpgwapi/inc/auth/class.auth_customsso.inc.php
Removed Paths:
-------------
branches/Version-1_0-branch/controller/inc/helper/class.check_list_status_updater.inc.php
Property Changed:
----------------
branches/Version-1_0-branch/
Property changes on: branches/Version-1_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
-
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538,7540-7542,7544-7549,7551-7552,7554-7561,7563,7565,7567-7573,7575-7578,7580-7584,7586-7591,7593-7624,7627-7636,7638-7656,7658-7718,7720-7732,7734,7736,7738-7750,7754-7759,7761-7767,7769-7780,7782,7784-7809,7811-7812,7814-7835,7837-7847,7849-7887,7889-7895,7897,7899,7901,7903-7905,7907-7921,7923-7925,7927-7933,7935,7937-7952,7954-7968,7970-7974,7976,7978-7979,7981-7982,7984-7988,7990-7992,7994-8041,8043-8066,8068-8087,8089,8091-8108,8110-8124,8126-8129,8131,8133-8150,8152-8154,8156-8162,8164-8167,8169-8170,8172-8179,8181,8183-8196,8198-8207,8209-8211,8213-8214,8216-8217,8219-8220,8222,8224-8225,8227-8247,8249,8251,8253-8282,8284-8352,8354-8368,8370-8396,8398-8430,8432,8434-8440,8442-8445,8447-8453,8455-8456,8458,8460,8462-8464,8466-8473,8475-8479,8481,8483-8501,8503-8523,8525,8527-8531,8533,8535-8536,8538-8550,8552-8554,8556-8557,8559-8579,8581-8587,8589,8591-8592,8594-8595,8597-8601,8603-8610,8612-8613,8615,8617,8619-8645,8647-8650,8652-8661,8663-8666,8668-8669,8671-8683,8685-8691,8693-8730,8732-8737,8739,8741-8767,8769,8771-8772,8774,8776-8797,8799-8812,8814-8819,8821,8823-8833,8835-8837,8839,8841,8843-8849,8852-8858,8860-8867,8869-8870,8872,8874-8877,8879,8881,8883-8888,8890,8892-8901,8903-8911,8913-8917,8920-8923,8925-8933,8935-8938,8940-8943,8945,8947-8948,8950,8952-8953,8955-8962,8964,8966,8968-8970,8972-8975,8977-8983,8985-8993,8995-9001,9003,9005,9007,9009,9011-9019,9021-9023,9025,9027-9028,9030-9044,9046-9047,9049-9050,9052-9056,9058-9059,9061,9063-9064,9066-9068,9071-9092,9094-9112,9114-9117,9119,9121-9160,9162-9166,9169-9207,9209-9211,9213-9215,9217,9219,9221-9253,9255,9257,9259-9260,9262,9264-9269,9271-9273,9275,9277-9278,9280,9282-9283,9285-9289,9291-9299,9301-9310,9312-9313,9315-9320,9322-9324,9326-9338,9340-9342,9344,9346-9348,9350-9358,9360-9362,9364-9366,9368-9374,9376-9382,9384,9386,9388-9390,9392-9396,9398-9402,9404-9410,9412,9414,9416-9417,9419-9425,9427,9429-9430,9432,9434-9463,9465-9502,9504-9506,9508-9521,9523-9526,9528,9530-9537,9539,9541-9551,9553,9555-9556,9558-9578,9580-9581,9583,9585,9587,9589,9591-9624,9626-9655,9657-9700,9702-9726,9728-9729,9731-9749,9751,9753-9754,9756-9832,9834-9836,9838-9839,9841-9846,9848-9850,9852-9858,9860-9863,9865,9867,9869-9871,9873-9893,9895,9897-9912,9914-9919,9921-9928,9930-9952,9954,9956,9958-9963,9965-9993,9995-9997,9999-10001,10003-10004,10006-10007,10009-10012,10014-10031,10033-10073,10075-10107,10109-10165,10167-10210,10222-10226,10228-10311,10313-10378,10380,10382,10384-10393,10395-10478,10480-10482,10484-10494,10496-10503,10505,10507,10509-10521,10523,10525-10528,10530-10540,10542-10543,10545-10568,10570-10584,10586-10590,10592-10594,10596,10598-10599,10601-10611,10613,10615,10617-10626,10628-10636,10638,10640-10654,10656-10658,10660,10662-10672,10674,10676-10682,10684,10686,10688-10690,10692-10694,10696-10697,10699-10701,10703,10705-10706,10708-10724,10726-10731,10734,10736-10748,10750-10796,10798-10939,10941,10943,10945,10947-10953,10955,10957-10961,10963,10965-10966,10968-11001,11003-11030,11032-11034,11036,11038,11040,11042-11053,11055-11059,11061-11062,11064-11068,11070-11073,11075-11077,11079-11083,11085,11087-11088,11090-11093
+
/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
Modified: branches/Version-1_0-branch/controller/inc/class.hook_helper.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.hook_helper.inc.php
2013-05-13 14:35:08 UTC (rev 11108)
+++ branches/Version-1_0-branch/controller/inc/class.hook_helper.inc.php
2013-05-15 08:03:03 UTC (rev 11109)
@@ -55,14 +55,14 @@
*/
public function home_mobilefrontend()
{
- $this->home('mobilefrontend');
+ $this->home();
}
/**
* Show info for homepage
*
* @return void
*/
- public function home($url_correction = '')
+ public function home()
{
$location_array = array();
$component_short_desc = array();
@@ -265,7 +265,7 @@
echo "\n".'<!-- BEGIN checklist info -->'."\n <h2
class='heading'>Mine planlagte kontroller</h2><div class='home-box'>" .
$my_planned_controls_HTML . "</div></div>\n".'<!-- END checklist info -->'."\n";
- // if($url_correction != 'mobilefrontend')
+
{
/* ======================================= UNDONE
ASSIGNED CONTROLS FOR CURRENT USER ================================= */
@@ -678,42 +678,42 @@
foreach($my_locations as $location)
{
- $controls = array();
- $components_with_controls_array = array();
- $location_code = $location["location_code"];
+ $controls = array();
+ $components_with_controls_array = array();
+ $location_code = $location["location_code"];
- $controls_at_location =
$so_control->get_controls_by_location( $location_code, $from_date_ts,
$to_date_ts, $repeat_type, "return_array", $location["role_id"] );
+ $controls_at_location =
$so_control->get_controls_by_location( $location_code, $from_date_ts,
$to_date_ts, $repeat_type, "return_array", $location["role_id"] );
- $level = count(explode('-', $location_code));
+ $level = count(explode('-', $location_code));
- if($level == 1)
- {
- // Fetches all controls for the components for
a location within time period
- $filter = "bim_item.location_code =
'$location_code' ";
- $components_with_controls_array =
$so_control->get_controls_by_component($from_date_ts, $to_date_ts,
$repeat_type, "return_array", $location["role_id"], $filter);
- }
- else
- {
- // Fetches all controls for the components for
a location within time period
- $filter = "bim_item.location_code LIKE
'$location_code%' ";
- $components_with_controls_array =
$so_control->get_controls_by_component($from_date_ts, $to_date_ts,
$repeat_type, "return_array", $location["role_id"], $filter);
- }
+ if($level == 1)
+ {
+ // Fetches all controls for the
components for a location within time period
+ $filter = "bim_item.location_code =
'$location_code' ";
+ $components_with_controls_array =
$so_control->get_controls_by_component($from_date_ts, $to_date_ts,
$repeat_type, "return_array", $location["role_id"], $filter);
+ }
+ else
+ {
+ // Fetches all controls for the
components for a location within time period
+ $filter = "bim_item.location_code LIKE
'$location_code%' ";
+ $components_with_controls_array =
$so_control->get_controls_by_component($from_date_ts, $to_date_ts,
$repeat_type, "return_array", $location["role_id"], $filter);
+ }
- if( count($controls_at_location) > 0 )
- {
- // Saves location code, location type and an
array containing controls at locations
- $my_controls[] = array( $location_code,
'location', $controls_at_location );
- }
+ if( count($controls_at_location) > 0 )
+ {
+ // Saves location code, location type
and an array containing controls at locations
+ $my_controls[] = array( $location_code,
'location', $controls_at_location );
+ }
- if( count($components_with_controls_array) > 0 )
- {
- foreach($components_with_controls_array as
$component)
+ if( count($components_with_controls_array) > 0 )
{
- // Saves location code, location type, an array
containing controls at locations and component object
- $my_controls[] = array( $location_code,
'component', $component['controls_array'], $component );
+ foreach($components_with_controls_array
as $component)
+ {
+ // Saves location code, location type,
an array containing controls at locations and component object
+ $my_controls[] = array( $location_code,
'component', $component['controls_array'], $component );
+ }
}
}
- }
return $my_controls;
}
Modified: branches/Version-1_0-branch/controller/inc/class.socase.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socase.inc.php
2013-05-13 14:35:08 UTC (rev 11108)
+++ branches/Version-1_0-branch/controller/inc/class.socase.inc.php
2013-05-15 08:03:03 UTC (rev 11109)
@@ -83,7 +83,7 @@
$case->set_modified_date($this->unmarshal($this->db->f('modified_date'),
'int'));
$case->set_modified_by($this->unmarshal($this->db->f('modified_by'), 'int'));
$case->set_measurement($this->unmarshal($this->db->f('measurement'), 'string'));
-
$case->set_location_code($this->unmarshal($this->db->f('location_code'),
'string'));
+
$case->set_location_code($this->unmarshal($this->db->f('location_code'),
'string'));
return $case;
}
@@ -123,7 +123,7 @@
$case->set_modified_date($this->unmarshal($this->db->f('modified_date'),
'int'));
$case->set_modified_by($this->unmarshal($this->db->f('modified_by'), 'int'));
$case->set_measurement($this->unmarshal($this->db->f('measurement'), 'string'));
-
$case->set_location_code($this->unmarshal($this->db->f('location_code'),
'string'));
+
$case->set_location_code($this->unmarshal($this->db->f('location_code'),
'string'));
$cases_array[] = $case;
}
@@ -139,6 +139,8 @@
*/
function add(&$case)
{
+ $this->db->transaction_begin();
+
$cols = array(
'check_item_id',
'status',
@@ -150,7 +152,7 @@
'modified_date',
'modified_by',
'measurement',
- 'location_code'
+ 'location_code'
);
$values = array(
@@ -164,15 +166,78 @@
$this->marshal($case->get_modified_date(),
'int'),
$this->marshal($case->get_modified_by(), 'int'),
$this->marshal($case->get_measurement(),
'string'),
- $this->marshal($case->get_location_code(), 'string')
+ $this->marshal($case->get_location_code(),
'string')
);
- $sql = 'INSERT INTO controller_check_item_case (' . join(',', $cols) .
') VALUES (' . join(',', $values) . ')';
- $result = $this->db->query( $sql, __LINE__,__FILE__);
+ $sql = 'INSERT INTO controller_check_item_case (' .
join(',', $cols) . ') VALUES (' . join(',', $values) . ')';
+ $this->db->query( $sql, __LINE__,__FILE__);
+ $case_id =
$this->db->get_last_insert_id('controller_check_item_case', 'id');
+
+//--------
- return $result ?
$this->db->get_last_insert_id('controller_check_item_case', 'id') : 0;
+
$this->update_cases_on_check_list($case->get_check_item_id());
+
+
+//------
+
+ if($this->db->transaction_commit())
+ {
+ return $case_id;
+ }
+ else
+ {
+ return 0;
+ }
}
+
+ function update_cases_on_check_list($check_item_id = 0)
+ {
+ $check_item_id = (int) $check_item_id;
+ $sql = "SELECT check_list_id FROM
controller_check_item WHERE id = {$check_item_id}";
+
+ $this->db->query($sql, __LINE__,__FILE__);
+ $this->db->next_record();
+ $check_list_id = (int) $this->db->f('check_list_id');
+
+ $so_check_item =
CreateObject('controller.socheck_item');
+ $check_items =
$so_check_item->get_check_items_with_cases($check_list_id, $control_item_type =
null, $status = null, $messageStatus = null);
+
+ $num_open_cases = 0;
+ $num_pending_cases = 0;
+
+ foreach($check_items as $check_item)
+ {
+ foreach($check_item->get_cases_array() as $case)
+ {
+
+ if($case->get_status() ==
controller_check_item_case::STATUS_OPEN)
+ {
+ $num_open_cases++;
+ }
+
+ if($case->get_status() ==
controller_check_item_case::STATUS_PENDING)
+ {
+ $num_pending_cases++;
+ }
+ }
+ }
+
+ $values = array
+ (
+ 'num_open_cases' => $num_open_cases,
+ 'num_pending_cases' => $num_pending_cases,
+ );
+
+ if($num_open_cases > 0)
+ {
+ $values['status'] =
controller_check_list::STATUS_DONE;
+ }
+
+ $value_set = $this->db->validate_update($values);
+ $this->db->query("UPDATE controller_check_list SET
{$value_set} WHERE id = '{$check_list_id}'",__LINE__,__FILE__);
+ }
+
/**
* Updates an existing case object in database
*
@@ -181,6 +246,8 @@
*/
function update($case)
{
+ $this->db->transaction_begin();
+
$id = (int) $case->get_id();
$values = array(
@@ -194,12 +261,14 @@
'modified_date = ' .
$this->marshal($case->get_modified_date(), 'int'),
'modified_by = ' .
$this->marshal($case->get_modified_by(), 'int'),
'measurement = ' .
$this->marshal($case->get_measurement(), 'string'),
- 'location_code = ' . $this->marshal($case->get_location_code(),
'string')
+ 'location_code = ' .
$this->marshal($case->get_location_code(), 'string')
);
$result = $this->db->query('UPDATE
controller_check_item_case SET ' . join(',', $values) . " WHERE id=$id",
__LINE__,__FILE__);
- if( $result )
+
$this->update_cases_on_check_list($case->get_check_item_id());
+
+ if($this->db->transaction_commit())
{
return $id;
}
Modified: branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php
2013-05-13 14:35:08 UTC (rev 11108)
+++ branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php
2013-05-15 08:03:03 UTC (rev 11109)
@@ -61,7 +61,7 @@
public function get_single($check_list_id)
{
$check_list_id = (int) $check_list_id;
- $sql = "SELECT cl.id as cl_id, cl.status as cl_status,
cl.control_id, cl.comment as cl_comment, deadline, planned_date, ";
+ $sql = "SELECT cl.id as cl_id, cl.status as cl_status,
cl.control_id, cl.comment as cl_comment, deadline, planned_date,assigned_to,
billable_hours, ";
$sql .= "completed_date, location_code, component_id,
num_open_cases, num_pending_cases, location_id, ci.id as ci_id, control_item_id
";
$sql .= "FROM controller_check_list cl ";
$sql .= "LEFT JOIN controller_check_item as ci ON cl.id =
ci.check_list_id ";
@@ -81,7 +81,10 @@
$check_list->set_component_id($this->unmarshal($this->db->f('component_id'),
'int'));
$check_list->set_location_id($this->unmarshal($this->db->f('location_id'),
'int'));
$check_list->set_num_open_cases($this->unmarshal($this->db->f('num_open_cases'),
'int'));
-
$check_list->set_num_pending_cases($this->unmarshal($this->db->f('num_pending_cases'),
'int'));
+
$check_list->set_num_pending_cases($this->unmarshal($this->db->f('num_pending_cases'),
'int'));
+
$check_list->set_assigned_to($this->unmarshal($this->db->f('assigned_to'),
'int'));
+ $check_list->set_billable_hours($this->db->f('billable_hours'));
+
if($check_list != null)
{
@@ -104,7 +107,7 @@
public function get_single_with_check_items($check_list_id, $status,
$type)
{
$check_list_id = (int) $check_list_id;
- $sql = "SELECT cl.id as cl_id, cl.status as cl_status,
cl.control_id, cl.comment as cl_comment, deadline, planned_date,
completed_date, num_open_cases, location_code, num_pending_cases, ";
+ $sql = "SELECT cl.id as cl_id, cl.status as cl_status,
cl.control_id, cl.comment as cl_comment, deadline, planned_date,
completed_date,assigned_to, num_open_cases, location_code, num_pending_cases, ";
$sql .= "ci.id as ci_id, control_item_id, check_list_id, ";
$sql .= "coi.title as coi_title, coi.required as coi_required,
";
$sql .= "coi.what_to_do as coi_what_to_do, coi.how_to_do as
coi_how_to_do, coi.control_group_id as coi_control_group_id, coi.type ";
@@ -145,6 +148,8 @@
$check_list->set_location_code($this->unmarshal($this->db->f('location_code',
true), 'string'));
$check_list->set_num_open_cases($this->unmarshal($this->db->f('num_open_cases'),
'int'));
$check_list->set_num_pending_cases($this->unmarshal($this->db->f('num_pending_cases'),
'int'));
+
$check_list->set_assigned_to($this->unmarshal($this->db->f('assigned_to'),
'int'));
+
}
if($this->db->f('ci_id'))
@@ -189,7 +194,7 @@
{
$control_id = (int) $control_id;
- $sql = "SELECT cl.id as cl_id, cl.status as cl_status,
cl.comment as cl_comment, deadline, planned_date, ";
+ $sql = "SELECT cl.id as cl_id, cl.status as cl_status,
cl.comment as cl_comment, deadline, planned_date, assigned_to, ";
$sql .= "completed_date, component_id, location_code,
num_open_cases, num_pending_cases ";
$sql .= "ci.id as ci_id, control_item_id, check_list_id ";
$sql .= "FROM controller_check_list cl, controller_check_item
ci ";
@@ -221,6 +226,7 @@
$check_list->set_location_code($this->unmarshal($this->db->f('location_code',
true), 'string'));
$check_list->set_num_open_cases($this->unmarshal($this->db->f('num_open_cases'),
'int'));
$check_list->set_num_pending_cases($this->unmarshal($this->db->f('num_pending_cases'),
'int'));
+
$check_list->set_assigned_to($this->unmarshal($this->db->f('assigned_to'),
'int'));
$check_items_array = array();
}
@@ -266,7 +272,7 @@
{
$sql .= "AND status = {$status} ";
}
-
+
$this->db->query($sql);
$check_list = null;
@@ -282,6 +288,7 @@
$check_list->set_location_code($this->unmarshal($this->db->f('location_code',
true), 'string'));
$check_list->set_num_open_cases($this->unmarshal($this->db->f('num_open_cases'),
'int'));
$check_list->set_num_pending_cases($this->unmarshal($this->db->f('num_pending_cases'),
'int'));
+
$check_list->set_assigned_to($this->unmarshal($this->db->f('assigned_to'),
'int'));
}
return $check_list;
@@ -308,7 +315,7 @@
$component_filter = " AND component_id =
{$component_id} AND location_id = {$location_id} ";
}
- $sql = "SELECT cl.id as cl_id, cl.status as cl_status,
cl.comment as cl_comment, deadline, planned_date, ";
+ $sql = "SELECT cl.id as cl_id, cl.status as cl_status,
cl.comment as cl_comment, deadline, planned_date, assigned_to,";
$sql .= "completed_date, component_id, location_code,
num_open_cases, num_pending_cases ";
$sql .= "FROM controller_check_list cl ";
$sql .= "WHERE cl.control_id = {$control_id} ";
@@ -340,6 +347,7 @@
$check_list->set_location_code($this->unmarshal($this->db->f('location_code',
true), 'string'));
$check_list->set_num_open_cases($this->unmarshal($this->db->f('num_open_cases'),
'int'));
$check_list->set_num_pending_cases($this->unmarshal($this->db->f('num_pending_cases'),
'int'));
+
$check_list->set_assigned_to($this->unmarshal($this->db->f('assigned_to'),
'int'));
}
$check_list_id = $check_list->get_id();
}
@@ -371,12 +379,12 @@
if($cl_criteria->get_component_id() > 0 &&
$cl_criteria->get_location_id() > 0)
{
- $sql .= "WHERE cl.component_id =
{$cl_criteria->get_component_id()} ";
- $sql .= "AND cl.location_id =
{$cl_criteria->get_location_id()} ";
+ $sql .= "WHERE cl.component_id =
{$cl_criteria->get_component_id()} ";
+ $sql .= "AND cl.location_id =
{$cl_criteria->get_location_id()} ";
}
else
{
- $sql .= "WHERE cl.location_code =
'{$cl_criteria->get_location_code()}' ";
+ $sql .= "WHERE cl.location_code =
'{$cl_criteria->get_location_code()}' ";
}
$sql .= "AND c.id = {$cl_criteria->get_control_id()} ";
@@ -410,7 +418,7 @@
function get_check_lists_for_location( $location_code, $from_date_ts,
$to_date_ts, $repeat_type_expr = null )
{
$sql = "SELECT c.id as c_id, ";
- $sql .= "cl.id as cl_id, cl.status as cl_status, cl.comment as
cl_comment, deadline, planned_date, completed_date, ";
+ $sql .= "cl.id as cl_id, cl.status as cl_status, cl.comment as
cl_comment, deadline, planned_date, completed_date, assigned_to, ";
$sql .= "cl.component_id as cl_component_id, cl.location_code
as cl_location_code, num_open_cases, num_pending_cases ";
$sql .= "FROM controller_control c ";
$sql .= "LEFT JOIN controller_check_list cl on cl.control_id =
c.id ";
@@ -454,6 +462,7 @@
$check_list->set_location_code($this->unmarshal($this->db->f('cl_location_code',
true), 'string'));
$check_list->set_num_open_cases($this->unmarshal($this->db->f('num_open_cases'),
'int'));
$check_list->set_num_pending_cases($this->unmarshal($this->db->f('num_pending_cases'),
'int'));
+
$check_list->set_assigned_to($this->unmarshal($this->db->f('assigned_to'),
'int'));
$check_lists_array[] = $check_list;
@@ -484,7 +493,7 @@
$component_id = (int) $component_id;
$sql = "SELECT c.id as c_id, ";
- $sql .= "cl.id as cl_id, cl.status as cl_status, cl.comment as
cl_comment, deadline, planned_date, completed_date, ";
+ $sql .= "cl.id as cl_id, cl.status as cl_status, cl.comment as
cl_comment, deadline, planned_date, completed_date, assigned_to, ";
$sql .= "cl.component_id, cl.location_id, cl.location_code as
cl_location_code, num_open_cases, num_pending_cases ";
$sql .= "FROM controller_control c ";
$sql .= "LEFT JOIN controller_check_list cl on cl.control_id =
c.id ";
@@ -530,7 +539,8 @@
$check_list->set_location_code($this->unmarshal($this->db->f('cl_location_code',
true), 'string'));
$check_list->set_num_open_cases($this->unmarshal($this->db->f('num_open_cases'),
'int'));
$check_list->set_num_pending_cases($this->unmarshal($this->db->f('num_pending_cases'),
'int'));
-
+
$check_list->set_assigned_to($this->unmarshal($this->db->f('assigned_to'),
'int'));
+
$check_lists_array[] = $check_list;
$control_id = $control->get_id();
@@ -559,7 +569,7 @@
{
$control_id = (int) $control_id;
- $sql = "SELECT cl.id as cl_id, cl.status as cl_status,
cl.comment as cl_comment, deadline, planned_date, completed_date, ";
+ $sql = "SELECT cl.id as cl_id, cl.status as cl_status,
cl.comment as cl_comment, deadline, planned_date, completed_date, assigned_to,
";
$sql .= "cl.component_id as cl_component_id, cl.location_code
as cl_location_code, num_open_cases, num_pending_cases ";
$sql .= "FROM controller_check_list cl ";
$sql .= "LEFT JOIN controller_control c on cl.control_id = c.id
";
@@ -587,6 +597,7 @@
$check_list->set_location_code($this->unmarshal($this->db->f('cl_location_code',
true), 'string'));
$check_list->set_num_open_cases($this->unmarshal($this->db->f('num_open_cases'),
'int'));
$check_list->set_num_pending_cases($this->unmarshal($this->db->f('num_pending_cases'),
'int'));
+
$check_list->set_assigned_to($this->unmarshal($this->db->f('assigned_to'),
'int'));
$check_lists_array[] = $check_list;
}
@@ -610,7 +621,7 @@
$location_id = (int) $location_id;
$component_id = (int) $component_id;
- $sql = "SELECT cl.id as cl_id, cl.status as cl_status,
cl.comment as cl_comment, deadline, planned_date, completed_date, ";
+ $sql = "SELECT cl.id as cl_id, cl.status as cl_status,
cl.comment as cl_comment, deadline, planned_date, completed_date, assigned_to,
";
$sql .= "cl.component_id as cl_component_id, cl.location_id as
cl_location_id, cl.location_code as cl_location_code, num_open_cases,
num_pending_cases ";
$sql .= "FROM controller_check_list cl ";
$sql .= "LEFT JOIN controller_control c on cl.control_id = c.id
";
@@ -640,6 +651,7 @@
$check_list->set_location_code($this->unmarshal($this->db->f('cl_location_code',
true), 'string'));
$check_list->set_num_open_cases($this->unmarshal($this->db->f('num_open_cases'),
'int'));
$check_list->set_num_pending_cases($this->unmarshal($this->db->f('num_pending_cases'),
'int'));
+
$check_list->set_assigned_to($this->unmarshal($this->db->f('assigned_to'),
'int'));
$check_lists_array[] = $check_list;
}
@@ -753,7 +765,8 @@
'num_open_cases',
'num_pending_cases',
'location_id',
- 'status'
+ 'status',
+ 'assigned_to'
);
$values = array(
@@ -767,7 +780,8 @@
$this->marshal($check_list->get_num_open_cases(),
'int'),
$this->marshal($check_list->get_num_pending_cases(),
'int'),
$this->marshal($check_list->get_location_id(), 'int'),
- $check_list->get_status()
+ $check_list->get_status(),
+ $this->marshal($check_list->get_assigned_to(), 'int'),
);
$result = $this->db->query('INSERT INTO controller_check_list
(' . join(',', $cols) . ') VALUES (' . join(',', $values) . ')',
__LINE__,__FILE__);
@@ -777,8 +791,51 @@
function update($check_list)
{
- $id = intval($check_list->get_id());
+ $id = (int)$check_list->get_id();
+ $sql = "SELECT billable_hours FROM controller_check_list WHERE
controller_check_list.id = {$id}";
+
+ $this->db->query($sql);
+ $this->db->next_record();
+
+ $old_billable_hours = (float) $this->db->f('billable_hours');
+
+ $billable_hours = $old_billable_hours +
$check_list->get_billable_hours();
+
+//--------
+ $so_check_item = CreateObject('controller.socheck_item');
+ $check_items = $so_check_item->get_check_items_with_cases($id,
$control_item_type = null, $status = null, $messageStatus = null);
+
+ $num_open_cases = 0;
+ $num_pending_cases = 0;
+
+ foreach($check_items as $check_item)
+ {
+ foreach($check_item->get_cases_array() as $case)
+ {
+
+ if($case->get_status() ==
controller_check_item_case::STATUS_OPEN)
+ {
+ $num_open_cases++;
+ }
+
+ if($case->get_status() ==
controller_check_item_case::STATUS_PENDING)
+ {
+ $num_pending_cases++;
+ }
+ }
+ }
+
+ if($num_open_cases > 0)
+ {
+
$check_list->set_status(controller_check_list::STATUS_DONE);
+ }
+
+ $check_list->set_num_open_cases($num_open_cases);
+ $check_list->set_num_pending_cases($num_pending_cases);
+
+//-------
+
$values = array(
'control_id = ' .
$this->marshal($check_list->get_control_id(), 'int'),
'status = ' . $check_list->get_status(),
@@ -790,11 +847,15 @@
'component_id = ' .
$this->marshal($check_list->get_component_id(), 'int'),
'location_id = ' .
$this->marshal($check_list->get_location_id(), 'int'),
'num_open_cases = ' .
$this->marshal($check_list->get_num_open_cases(), 'int'),
- 'num_pending_cases = ' .
$this->marshal($check_list->get_num_pending_cases(), 'int')
+ 'num_pending_cases = ' .
$this->marshal($check_list->get_num_pending_cases(), 'int'),
+ 'assigned_to = ' .
$this->marshal($check_list->get_assigned_to(), 'int'),
+ 'billable_hours = ' . $billable_hours
);
- $result = $this->db->query('UPDATE controller_check_list SET '
. join(',', $values) . " WHERE id=$id", __LINE__,__FILE__);
+ $sql = 'UPDATE controller_check_list SET ' . join(',', $values)
. " WHERE id = {$id}";
+ $result = $this->db->query($sql, __LINE__,__FILE__);
+
if($result)
{
return $id;
Modified: branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
2013-05-13 14:35:08 UTC (rev 11108)
+++ branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
2013-05-15 08:03:03 UTC (rev 11109)
@@ -443,6 +443,8 @@
public function view_calendar_year_for_locations()
{
+ static $_location_name = array();
+
$control_id = phpgw::get_var('control_id');
$control = $this->so_control->get_single($control_id);
$year = phpgw::get_var('year');
@@ -530,6 +532,28 @@
foreach ($components_for_control_array as
$component)
{
$short_desc_arr =
execMethod('property.soentity.get_short_description', array('location_id' =>
$component->get_location_id(), 'id' => $component->get_id()));
+
+ //FIXME - make generic
+
+ /*=>*/
+
if(!isset($_location_name[$component->get_location_code()]))
+ {
+ $_location =
execMethod('property.solocation.read_single', $component->get_location_code());
+ $location_arr = explode('-',
$component->get_location_code());
+ $i=1;
+ $name_arr = array();
+ foreach($location_arr as
$_dummy)
+ {
+ $name_arr[] =
$_location["loc{$i}_name"];
+ $i++;
+ }
+
+
$_location_name[$component->get_location_code()]= implode('::', $name_arr);
+ }
+
+ $short_desc_arr .= ' ['.
$_location_name[$component->get_location_code()] . ']';
+ /*<=*/
+
$component->set_xml_short_desc($short_desc_arr);
$repeat_type =
$control->get_repeat_type();
Modified: branches/Version-1_0-branch/controller/inc/class.uicase.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicase.inc.php
2013-05-13 14:35:08 UTC (rev 11108)
+++ branches/Version-1_0-branch/controller/inc/class.uicase.inc.php
2013-05-15 08:03:03 UTC (rev 11109)
@@ -44,7 +44,6 @@
include_class('controller', 'check_item_case', 'inc/model/');
include_class('controller', 'component', 'inc/model/');
- include_class('controller', 'check_list_status_updater', 'inc/helper/');
include_class('controller', 'location_finder', 'inc/helper/');
class controller_uicase extends phpgwapi_uicommon
@@ -256,9 +255,6 @@
if($case_id > 0)
{
- $cl_status_updater = new
check_list_status_updater();
- $cl_status_updater->update_check_list_status(
$check_list_id );
-
return json_encode( array( "status" => "saved"
) );
}
else
@@ -295,9 +291,6 @@
if($case_id > 0)
{
- $cl_status_updater = new
check_list_status_updater();
-
$cl_status_updater->update_check_list_status( $check_list_id );
-
$check_item =
$this->so_check_item->get_single($case->get_check_item_id());
$control_item =
$this->so_control_item->get_single($check_item->get_control_item_id());
@@ -595,10 +588,6 @@
// Gets check_list from check_item
$check_item = $this->so_check_item->get_single(
$check_item_id );
$check_list_id =
$check_item->get_check_list_id();
-
- // Updates number of open cases for check list
- $cl_status_updater = new
check_list_status_updater();
- $cl_status_updater->update_check_list_status(
$check_list_id );
}
}
@@ -616,9 +605,6 @@
if($status)
{
- $cl_status_updater = new
check_list_status_updater();
- $cl_status_updater->update_check_list_status(
$check_list_id );
-
return json_encode( array( "status" =>
"deleted" ) );
}
else
@@ -642,10 +628,8 @@
$case_id = $this->so->store($case);
- if($case_id > 0){
- $cl_status_updater = new
check_list_status_updater();
- $cl_status_updater->update_check_list_status(
$check_list_id );
-
+ if($case_id > 0)
+ {
return json_encode( array( "status" => "true" )
);
}
else
@@ -671,9 +655,6 @@
if($case_id > 0)
{
- $cl_status_updater = new
check_list_status_updater();
- $cl_status_updater->update_check_list_status(
$check_list_id );
-
return json_encode( array( "status" => "true" )
);
}
else
Modified: branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php
2013-05-13 14:35:08 UTC (rev 11108)
+++ branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php
2013-05-15 08:03:03 UTC (rev 11109)
@@ -44,7 +44,6 @@
include_class('controller', 'check_list', 'inc/model/');
include_class('controller', 'check_item', 'inc/model/');
include_class('controller', 'date_generator', 'inc/component/');
- include_class('controller', 'check_list_status_updater', 'inc/helper/');
include_class('controller', 'date_converter', 'inc/helper/');
include_class('controller', 'location_finder', 'inc/helper/');
@@ -64,6 +63,7 @@
private $add;
private $edit;
private $delete;
+ private $acl_location;
var $public_functions = array(
'index' => true,
@@ -94,6 +94,8 @@
$this->location_finder = new location_finder();
+ $this->acl_location = '.control';
+
$this->read =
$GLOBALS['phpgw']->acl->check('.control', PHPGW_ACL_READ, 'controller');//1
$this->add =
$GLOBALS['phpgw']->acl->check('.control', PHPGW_ACL_ADD, 'controller');//2
$this->edit =
$GLOBALS['phpgw']->acl->check('.control', PHPGW_ACL_EDIT, 'controller');//4
@@ -239,6 +241,7 @@
$level =
$this->location_finder->get_location_level($location_code);
}
+
if($type == "component")
{
if($check_list != null)
@@ -250,6 +253,15 @@
}
$component_arr =
execMethod('property.soentity.read_single_eav', array('location_id' =>
$location_id, 'id' => $component_id));
+
+//
+ $location_code =
$component_arr['location_code'];
+
+ $check_list->set_location_code($location_code);
+ $location_array =
execMethod('property.bolocation.read_single', array('location_code' =>
$check_list->get_location_code()));
+ $level =
$this->location_finder->get_location_level($location_code);
+
+//
$short_desc =
execMethod('property.soentity.get_short_description', array('location_id' =>
$location_id, 'id' => $component_id));
$component = new controller_component();
@@ -258,6 +270,7 @@
$component_array = $component->toArray();
$building_location_code =
$this->location_finder->get_building_location_code($component_arr['location_code']);
+
$type = "component";
}
else
@@ -267,6 +280,14 @@
$control =
$this->so_control->get_single($check_list->get_control_id());
+ $responsible_user_id =
execMethod('property.soresponsible.get_responsible_user_id',
+ array
+ (
+ 'responsibility_id' =>
$control->get_responsibility_id(),
+ 'location_code' =>
$location_code
+ )
+ );
+
$year = date("Y", $deadline_ts);
$month_nr = date("n", $deadline_ts);
@@ -276,8 +297,22 @@
// Fetches buildings on property
$buildings_on_property =
$this->location_finder->get_buildings_on_property($user_role, $location_code,
$level);
+ $users =
$GLOBALS['phpgw']->acl->get_user_list_right(PHPGW_ACL_ADD, $this->acl_location);
+
+ $user_list_options = array();
+ foreach ($users as $user)
+ {
+ $user_list_options[] = array
+ (
+ 'id' => $user['account_id'],
+ 'name' => $user['account_lastname'] .
', ' . $user['account_firstname'],
+ 'selected' => $responsible_user_id
== $user['account_id'] ? 1 : 0
+ );
+ }
+
$data = array
(
+ 'user_list' => array('options' =>
$user_list_options),
'location_array' => $location_array,
'component_array' => $component_array,
'control' => $control,
@@ -354,8 +389,24 @@
// Fetches buildings on property
$buildings_on_property =
$this->location_finder->get_buildings_on_property($user_role, $location_code,
$level);
+ $users =
$GLOBALS['phpgw']->acl->get_user_list_right(PHPGW_ACL_ADD, $this->acl_location);
+
+ $responsible_user_id = $check_list->get_assigned_to();
+
+ $user_list_options = array();
+ foreach ($users as $user)
+ {
+ $user_list_options[] = array
+ (
+ 'id' => $user['account_id'],
+ 'name' => $user['account_lastname'] .
', ' . $user['account_firstname'],
+ 'selected' => $responsible_user_id
== $user['account_id'] ? 1 : 0
+ );
+ }
+
$data = array
(
+ 'user_list' => array('options' =>
$user_list_options),
'control' => $control,
'check_list' => $check_list,
'$buildings_on_property' =>
$buildings_on_property,
@@ -403,6 +454,8 @@
$planned_date = phpgw::get_var('planned_date',
'string');
$completed_date = phpgw::get_var('completed_date',
'string');
$comment = phpgw::get_var('comment', 'string');
+ $assigned_to = phpgw::get_var('assigned_to', 'int');
+ $billable_hours = phpgw::get_var('billable_hours',
'float');
$deadline_date_ts =
date_converter::date_to_timestamp($deadline_date);
@@ -450,14 +503,13 @@
$check_list->set_deadline($deadline_date_ts);
$check_list->set_planned_date($planned_date_ts);
$check_list->set_completed_date($completed_date_ts);
+ $check_list->set_assigned_to($assigned_to);
+ $check_list->set_billable_hours($billable_hours);
if($check_list->validate())
{
$check_list_id = $this->so->store($check_list);
- $cl_status_updater = new
check_list_status_updater();
-
$cl_status_updater->update_check_list_status($check_list_id);
-
if($check_list_id > 0)
{
$this->redirect(array('menuaction' =>
'controller.uicheck_list.edit_check_list', 'check_list_id' => $check_list_id));
@@ -472,7 +524,8 @@
if($check_list->get_id() > 0)
{
$this->edit_check_list($check_list);
- } else
+ }
+ else
{
$this->add_check_list($check_list);
}
Deleted:
branches/Version-1_0-branch/controller/inc/helper/class.check_list_status_updater.inc.php
===================================================================
---
branches/Version-1_0-branch/controller/inc/helper/class.check_list_status_updater.inc.php
2013-05-13 14:35:08 UTC (rev 11108)
+++
branches/Version-1_0-branch/controller/inc/helper/class.check_list_status_updater.inc.php
2013-05-15 08:03:03 UTC (rev 11109)
@@ -1,56 +0,0 @@
-<?php
- phpgw::import_class('controller.socheck_list');
- phpgw::import_class('controller.socheck_item');
-
- include_class('controller', 'check_list', 'inc/model/');
- include_class('controller', 'check_item', 'inc/model/');
-
- class check_list_status_updater {
-
- public function __construct()
- {
- $this->so_check_list =
CreateObject('controller.socheck_list');
- $this->so_check_item =
CreateObject('controller.socheck_item');
- }
-
- public function update_check_list_status( $check_list_id )
- {
- //$db_check_list = $this->so_check_list->get_db();
- //$db_check_list->transaction_begin();
-
- $check_list = $this->so_check_list->get_single(
$check_list_id );
-
- $check_items =
$this->so_check_item->get_check_items_with_cases($check_list_id,
$control_item_type = null, $status = null, $messageStatus = null);
-
- $num_open_cases = 0;
- $num_pending_cases = 0;
-
- foreach($check_items as $check_item)
- {
- foreach($check_item->get_cases_array() as $case)
- {
-
- if($case->get_status() ==
controller_check_item_case::STATUS_OPEN)
- {
- $num_open_cases++;
- }
-
- if($case->get_status() ==
controller_check_item_case::STATUS_PENDING)
- {
- $num_pending_cases++;
- }
- }
- }
-
- if($num_open_cases > 0)
- {
-
$check_list->set_status(controller_check_list::STATUS_DONE);
- }
-
- $check_list->set_num_open_cases($num_open_cases);
- $check_list->set_num_pending_cases($num_pending_cases);
-
- $this->so_check_list->store($check_list);
-
- }
-}
\ No newline at end of file
Modified:
branches/Version-1_0-branch/controller/inc/model/class.check_item_case.inc.php
===================================================================
---
branches/Version-1_0-branch/controller/inc/model/class.check_item_case.inc.php
2013-05-13 14:35:08 UTC (rev 11108)
+++
branches/Version-1_0-branch/controller/inc/model/class.check_item_case.inc.php
2013-05-15 08:03:03 UTC (rev 11109)
@@ -49,7 +49,7 @@
protected $modified_date;
protected $modified_by;
protected $measurement;
- protected $location_code;
+ protected $location_code;
/**
Modified:
branches/Version-1_0-branch/controller/inc/model/class.check_list.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/model/class.check_list.inc.php
2013-05-13 14:35:08 UTC (rev 11108)
+++ branches/Version-1_0-branch/controller/inc/model/class.check_list.inc.php
2013-05-15 08:03:03 UTC (rev 11109)
@@ -48,6 +48,8 @@
protected $location_code;
protected $component_id;
protected $location_id;
+ protected $assigned_to;
+ protected $billable_hours;
// Aggregate fields. Fields not in a table
protected $num_open_cases;
@@ -175,21 +177,43 @@
{
$this->error_msg_array = $error_msg_array;
}
+
+ public function set_assigned_to($assigned_to)
+ {
+ $this->assigned_to = $assigned_to;
+ }
+ public function get_assigned_to()
+ {
+ return $this->assigned_to;
+ }
+
+ public function set_billable_hours($billable_hours)
+ {
+ $this->billable_hours = $billable_hours;
+ }
+
+ public function get_billable_hours()
+ {
+ return $this->billable_hours;
+ }
+
public function serialize()
{
return array(
- 'id'
=> $this->get_id(),
- 'control_id' =>
$this->get_control_id(),
- 'status'
=> $this->get_status(),
- 'comment' =>
$this->get_comment(),
- 'deadline' =>
$this->get_deadline(),
+ 'id' =>
$this->get_id(),
+ 'control_id' =>
$this->get_control_id(),
+ 'status' =>
$this->get_status(),
+ 'comment' =>
$this->get_comment(),
+ 'deadline' =>
$this->get_deadline(),
'planned_date' =>
$this->get_planned_date(),
'completed_date' =>
$this->get_completed_date(),
'location_code' =>
$this->get_location_code(),
'component_id' =>
$this->get_component_id(),
'location_id' =>
$this->get_location_id(),
- 'num_open_cases' =>
$this->get_num_open_cases()
+ 'num_open_cases' =>
$this->get_num_open_cases(),
+ 'assigned_to' =>
$this->get_assigned_to(),
+ 'billable_hours' =>
$this->get_billable_hours()
);
}
@@ -199,40 +223,40 @@
// Validate CONTROL ID
if( empty( $this->control_id ) )
- {
- $status = false;
- $this->error_msg_array['control_id'] = "error_msg_4";
- }
+ {
+ $status = false;
+ $this->error_msg_array['control_id'] =
"error_msg_4";
+ }
- // Validate STATUS
+ // Validate STATUS
if( ($this->status !=
controller_check_list::STATUS_NOT_DONE) && ($this->status !=
controller_check_list::STATUS_DONE) && ($this->status !=
controller_check_list::STATUS_CANCELED))
- {
- $status = false;
- $this->error_msg_array['status'] = "error_msg_2";
- }
+ {
+ $status = false;
+ $this->error_msg_array['status'] =
"error_msg_2";
+ }
- // Validate COMPLETED DATE when STATUS:DONE
+ // Validate COMPLETED DATE when STATUS:DONE
if( ($this->status ==
controller_check_list::STATUS_DONE) && empty($this->completed_date) )
- {
- $status = false;
- $this->error_msg_array['completed_date'] =
"error_msg_5";
- }
+ {
+ $status = false;
+ $this->error_msg_array['completed_date'] =
"error_msg_5";
+ }
- // Validate DEADLINE
+ // Validate DEADLINE
if( empty( $this->deadline ) )
- {
- $status = false;
- $this->error_msg_array['deadline'] = "error_msg_1";
- }
+ {
+ $status = false;
+ $this->error_msg_array['deadline'] =
"error_msg_1";
+ }
// Validate connection to COMPONENT/LOCATION
if( empty( $this->location_code ) && empty(
$this->component_id ) )
- {
- echo "FAILED: " . $this->location_code;
- $status = false;
- $this->error_msg_array['location_code'] = "error_msg_6";
- }
+ {
+ echo "FAILED: " . $this->location_code;
+ $status = false;
+ $this->error_msg_array['location_code'] =
"error_msg_6";
+ }
- return $status;
+ return $status;
}
}
Modified: branches/Version-1_0-branch/controller/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/setup/setup.inc.php 2013-05-13
14:35:08 UTC (rev 11108)
+++ branches/Version-1_0-branch/controller/setup/setup.inc.php 2013-05-15
08:03:03 UTC (rev 11109)
@@ -1,6 +1,6 @@
<?php
$setup_info['controller']['name'] = 'controller';
- $setup_info['controller']['version'] = '0.1.43';
+ $setup_info['controller']['version'] = '0.1.44';
$setup_info['controller']['app_order'] = 100;
$setup_info['controller']['enable'] = 1;
$setup_info['controller']['app_group'] = 'office';
Modified: branches/Version-1_0-branch/controller/setup/tables_current.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/setup/tables_current.inc.php
2013-05-13 14:35:08 UTC (rev 11108)
+++ branches/Version-1_0-branch/controller/setup/tables_current.inc.php
2013-05-15 08:03:03 UTC (rev 11109)
@@ -73,7 +73,9 @@
'location_code' => array('type' => 'varchar',
'precision' => 30, 'nullable' => True),
'location_id' => array('type' => 'int',
'precision' => 4, 'nullable' => true),
'num_open_cases' => array('type' => 'int',
'precision' => 4, 'nullable' => True),
- 'num_pending_cases' => array('type' => 'int',
'precision' => 4, 'nullable' => True)
+ 'num_pending_cases' => array('type' => 'int',
'precision' => 4, 'nullable' => True),
+ 'assigned_to' => array('type' => 'int',
'precision' => 4, 'nullable' => True),
+ 'billable_hours' => array('type' =>
'decimal','precision' => '20','scale' => '2','nullable' => True),
),
'pk' => array('id'),
'fk' => array(),
Modified: branches/Version-1_0-branch/controller/setup/tables_update.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/setup/tables_update.inc.php
2013-05-13 14:35:08 UTC (rev 11108)
+++ branches/Version-1_0-branch/controller/setup/tables_update.inc.php
2013-05-15 08:03:03 UTC (rev 11109)
@@ -865,4 +865,27 @@
}
}
+ $test[] = '0.1.43';
+ function controller_upgrade0_1_43()
+ {
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('controller_check_list','assigned_to',array(
+ 'type' => 'int',
+ 'precision' => '4',
+ 'nullable' => true
+ ));
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('controller_check_list','billable_hours',array(
+ 'type' => 'decimal',
+ 'precision' => '20',
+ 'scale' => '2',
+ 'nullable' => true
+ ));
+
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
+ $GLOBALS['setup_info']['controller']['currentver'] =
'0.1.44';
+ return
$GLOBALS['setup_info']['controller']['currentver'];
+ }
+ }
Modified:
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list.xsl
2013-05-13 14:35:08 UTC (rev 11108)
+++
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list.xsl
2013-05-15 08:03:03 UTC (rev 11109)
@@ -1,158 +1,181 @@
<!-- $Id$ -->
<xsl:template match="data" xmlns:php="http://php.net/xsl">
- <xsl:variable name="date_format">
- <xsl:value-of select="php:function('get_phpgw_info',
'user|preferences|common|dateformat')" />
- </xsl:variable>
+ <xsl:variable name="date_format">
+ <xsl:value-of select="php:function('get_phpgw_info',
'user|preferences|common|dateformat')" />
+ </xsl:variable>
- <!-- ================== ADD CHECKLIST ========================= -->
- <div id="main_content" class="medium">
-
- <!-- ================== CHECK LIST TOP SECTION =====================
-->
- <xsl:call-template name="check_list_top_section" />
+ <!-- ================== ADD CHECKLIST ========================= -->
+ <div id="main_content" class="medium">
+
+ <!-- ================== CHECK LIST TOP SECTION
===================== -->
+ <xsl:call-template name="check_list_top_section" />
- <!-- ================== CHECKLIST DETAILS ===================== -->
- <div id="check_list_details">
- <h3 class="box_header">Sjekklistedetaljer</h3>
+ <!-- ================== CHECKLIST DETAILS
===================== -->
+ <div id="check_list_details">
+ <h3 class="box_header">Sjekklistedetaljer</h3>
- <xsl:variable name="action_url">
- <xsl:value-of select="php:function('get_phpgw_link',
'/index.php', 'menuaction:controller.uicheck_list.save_check_list')" />
- </xsl:variable>
+ <xsl:variable name="action_url">
+ <xsl:value-of
select="php:function('get_phpgw_link', '/index.php',
'menuaction:controller.uicheck_list.save_check_list')" />
+ </xsl:variable>
- <form id="frm_add_check_list" action="{$action_url}" method="post">
- <xsl:variable name="control_id">
- <xsl:value-of select="control/id"/>
- </xsl:variable>
- <input type="hidden" name="control_id" value="{$control_id}" />
- <xsl:variable name="type">
- <xsl:value-of select="type"/>
- </xsl:variable>
- <input type="hidden" name="type" value="{$type}" />
+ <form id="frm_add_check_list" action="{$action_url}"
method="post">
+ <xsl:variable name="control_id">
+ <xsl:value-of select="control/id"/>
+ </xsl:variable>
+ <input type="hidden" name="control_id"
value="{$control_id}" />
+ <xsl:variable name="type">
+ <xsl:value-of select="type"/>
+ </xsl:variable>
+ <input type="hidden" name="type"
value="{$type}" />
- <xsl:variable name="location_code">
- <xsl:value-of select="location_array/location_code"/>
- </xsl:variable>
+ <xsl:variable name="location_code">
+ <xsl:value-of
select="location_array/location_code"/>
+ </xsl:variable>
- <xsl:choose>
- <xsl:when test="type = 'component'">
- <xsl:variable name="location_id">
- <xsl:value-of select="check_list/location_id"/>
- </xsl:variable>
- <input type="hidden" name="location_id"
value="{$location_id}" />
- <xsl:variable name="component_id">
- <xsl:value-of select="check_list/component_id"/>
- </xsl:variable>
- <input type="hidden" name="component_id"
value="{$component_id}" />
- <input type="hidden" name="location_code"
value="{$location_code}" />
- </xsl:when>
- <xsl:otherwise>
- <input type="hidden" name="location_code"
value="{$location_code}" />
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="type = 'component'">
+ <xsl:variable
name="location_id">
+ <xsl:value-of
select="check_list/location_id"/>
+ </xsl:variable>
+ <input type="hidden"
name="location_id" value="{$location_id}" />
+ <xsl:variable
name="component_id">
+ <xsl:value-of
select="check_list/component_id"/>
+ </xsl:variable>
+ <input type="hidden"
name="component_id" value="{$component_id}" />
+ <input type="hidden"
name="location_code" value="{$location_code}" />
+ </xsl:when>
+ <xsl:otherwise>
+ <input type="hidden"
name="location_code" value="{$location_code}" />
+ </xsl:otherwise>
+ </xsl:choose>
- <fieldset>
- <!-- STATUS -->
- <div class="row">
- <xsl:if test="check_list/error_msg_array/status != ''">
- <xsl:variable name="error_msg">
- <xsl:value-of
select="check_list/error_msg_array/status" />
- </xsl:variable>
- <div class='input_error_msg'>
- <xsl:value-of select="php:function('lang',
$error_msg)" />
- </div>
- </xsl:if>
- <label>Status</label>
- <xsl:variable name="status">
- <xsl:value-of select="check_list/status"/>
- </xsl:variable>
- <select id="status" name="status">
- <xsl:choose>
- <xsl:when test="check_list/status = 0">
- <option value="1">Utført</option>
- <option value="0" SELECTED="SELECTED">Ikke
utført</option>
- <option value="3">Kansellert</option>
- </xsl:when>
- <xsl:when test="check_list/status = 1">
- <option value="1"
SELECTED="SELECTED">Utført</option>
- <option value="0">Ikke utført</option>
- <option value="3">Kansellert</option>
- </xsl:when>
- <xsl:when test="check_list/status = 3">
- <option value="3"
SELECTED="SELECTED">Kansellert</option>
- <option value="0">Ikke utført</option>
- <option value="1">Utført</option>
- </xsl:when>
- <xsl:otherwise>
- <option value="0" SELECTED="SELECTED">Ikke
utført</option>
- <option value="1">Utført</option>
- <option value="3">Kansellert</option>
- </xsl:otherwise>
- </xsl:choose>
- </select>
- </div>
- <!-- DEADLINE -->
- <div class="row">
- <xsl:if test="check_list/error_msg_array/deadline !=
''">
- <xsl:variable name="error_msg">
- <xsl:value-of
select="check_list/error_msg_array/deadline" />
- </xsl:variable>
- <div class='input_error_msg'>
- <xsl:value-of select="php:function('lang',
$error_msg)" />
- </div>
- </xsl:if>
- <label>Fristdato</label>
- <input type="text" id="deadline_date"
name="deadline_date" class="date" readonly="readonly" >
- <xsl:attribute name="value">
- <xsl:value-of select="php:function('date',
$date_format, number(check_list/deadline))"/>
- </xsl:attribute>
- </input>
- </div>
- <!-- PLANNED DATE -->
- <div class="row">
- <label>Planlagt dato</label>
- <input type="text" id="planned_date"
name="planned_date" class="date" readonly="readonly">
- <xsl:if test="check_list/planned_date != 0 and
check_list/planned_date != ''">
- <xsl:attribute name="value">
- <xsl:value-of select="php:function('date',
$date_format, number(check_list/planned_date))"/>
- </xsl:attribute>
- </xsl:if>
- </input>
- </div>
- <!-- COMPLETED DATE -->
- <div class="row">
- <xsl:if
test="check_list/error_msg_array/completed_date != ''">
- <xsl:variable name="error_msg">
- <xsl:value-of
select="check_list/error_msg_array/completed_date" />
- </xsl:variable>
- <div class='input_error_msg'>
- <xsl:value-of select="php:function('lang',
$error_msg)" />
- </div>
- </xsl:if>
- <label>Utført dato</label>
- <input type="text" id="completed_date"
name="completed_date" class="date" readonly="readonly" >
- <xsl:if test="check_list/completed_date != 0 and
check_list/completed_date != ''">
- <xsl:attribute name="value">
- <xsl:value-of select="php:function('date',
$date_format, number(check_list/completed_date))"/>
- </xsl:attribute>
- </xsl:if>
- </input>
- </div>
- </fieldset>
- <!-- COMMENT -->
- <div class="comment">
- <label>Kommentar</label>
- <textarea>
- <xsl:attribute name="name">comment</xsl:attribute>
- <xsl:value-of select="check_list/comment"/>
- </textarea>
- </div>
+ <fieldset>
+ <!-- STATUS -->
+ <div class="row">
+ <xsl:if
test="check_list/error_msg_array/status != ''">
+ <xsl:variable
name="error_msg">
+ <xsl:value-of
select="check_list/error_msg_array/status" />
+ </xsl:variable>
+ <div
class='input_error_msg'>
+ <xsl:value-of
select="php:function('lang', $error_msg)" />
+ </div>
+ </xsl:if>
+ <label>Status</label>
+ <xsl:variable name="status">
+ <xsl:value-of
select="check_list/status"/>
+ </xsl:variable>
+ <select id="status"
name="status">
+ <xsl:choose>
+ <xsl:when
test="check_list/status = 0">
+ <option
value="1">Utført</option>
+ <option
value="0" SELECTED="SELECTED">Ikke utført</option>
+ <option
value="3">Kansellert</option>
+ </xsl:when>
+ <xsl:when
test="check_list/status = 1">
+ <option
value="1" SELECTED="SELECTED">Utført</option>
+ <option
value="0">Ikke utført</option>
+ <option
value="3">Kansellert</option>
+ </xsl:when>
+ <xsl:when
test="check_list/status = 3">
+ <option
value="3" SELECTED="SELECTED">Kansellert</option>
+ <option
value="0">Ikke utført</option>
+ <option
value="1">Utført</option>
+ </xsl:when>
+ <xsl:otherwise>
+ <option
value="0" SELECTED="SELECTED">Ikke utført</option>
+ <option
value="1">Utført</option>
+ <option
value="3">Kansellert</option>
+ </xsl:otherwise>
+ </xsl:choose>
+ </select>
+ </div>
+ <!-- DEADLINE -->
+ <div class="row">
+ <xsl:if
test="check_list/error_msg_array/deadline != ''">
+ <xsl:variable
name="error_msg">
+ <xsl:value-of
select="check_list/error_msg_array/deadline" />
+ </xsl:variable>
+ <div
class='input_error_msg'>
+ <xsl:value-of
select="php:function('lang', $error_msg)" />
+ </div>
+ </xsl:if>
+ <label>Fristdato</label>
+ <input type="text"
id="deadline_date" name="deadline_date" class="date" readonly="readonly" >
+ <xsl:attribute
name="value">
+ <xsl:value-of
select="php:function('date', $date_format, number(check_list/deadline))"/>
+ </xsl:attribute>
+ </input>
+ </div>
+ <!-- PLANNED DATE -->
+ <div class="row">
+ <label>Planlagt dato</label>
+ <input type="text"
id="planned_date" name="planned_date" class="date" readonly="readonly">
+ <xsl:if
test="check_list/planned_date != 0 and check_list/planned_date != ''">
+ <xsl:attribute
name="value">
+
<xsl:value-of select="php:function('date', $date_format,
number(check_list/planned_date))"/>
+ </xsl:attribute>
+ </xsl:if>
+ </input>
+ </div>
+ <!-- COMPLETED DATE -->
+ <div class="row">
+ <xsl:if
test="check_list/error_msg_array/completed_date != ''">
+ <xsl:variable
name="error_msg">
+ <xsl:value-of
select="check_list/error_msg_array/completed_date" />
+ </xsl:variable>
+ <div
class='input_error_msg'>
+ <xsl:value-of
select="php:function('lang', $error_msg)" />
+ </div>
+ </xsl:if>
+ <label>Utført dato</label>
+ <input type="text"
id="completed_date" name="completed_date" class="date" readonly="readonly" >
+ <xsl:if
test="check_list/completed_date != 0 and check_list/completed_date != ''">
+ <xsl:attribute
name="value">
+
<xsl:value-of select="php:function('date', $date_format,
number(check_list/completed_date))"/>
+ </xsl:attribute>
+ </xsl:if>
+ </input>
+ </div>
+ </fieldset>
+ <!-- ASSIGNMET -->
+ <div class="row">
+ <label>Tildelt</label>
+ <select name="assigned_to">
+ <xsl:attribute name="title">
+ <xsl:value-of
select="php:function('lang', 'select')"/>
+ </xsl:attribute>
+ <option value="0">
+ <xsl:value-of
select="php:function('lang', 'select')"/>
+ </option>
+ <xsl:apply-templates
select="user_list/options"/>
+ </select>
+ </div>
+ <!-- COMMENT -->
+ <div class="comment">
+ <label>Kommentar</label>
+ <textarea>
+ <xsl:attribute
name="name">comment</xsl:attribute>
+ <xsl:value-of
select="check_list/comment"/>
+ </textarea>
+ </div>
- <div class="form-buttons">
- <xsl:variable name="lang_save">
- <xsl:value-of select="php:function('lang',
'save_check_list')" />
- </xsl:variable>
- <input class="btn" type="submit" value="Lagre detaljer" />
- </div>
- </form>
- </div>
- </div>
+ <div class="form-buttons">
+ <xsl:variable name="lang_save">
+ <xsl:value-of
select="php:function('lang', 'save_check_list')" />
+ </xsl:variable>
+ <input class="btn" type="submit"
value="Lagre detaljer" />
+ </div>
+ </form>
+ </div>
+ </div>
</xsl:template>
+
+ <!-- New template-->
+ <xsl:template match="options">
+ <option value="{id}">
+ <xsl:if test="selected != 0">
+ <xsl:attribute name="selected"
value="selected"/>
+ </xsl:if>
+ <xsl:value-of disable-output-escaping="yes"
select="name"/>
+ </option>
+ </xsl:template>
Modified:
branches/Version-1_0-branch/controller/templates/base/check_list/edit_check_list.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/check_list/edit_check_list.xsl
2013-05-13 14:35:08 UTC (rev 11108)
+++
branches/Version-1_0-branch/controller/templates/base/check_list/edit_check_list.xsl
2013-05-15 08:03:03 UTC (rev 11109)
@@ -77,6 +77,30 @@
</xsl:if>
</input>
</div>
+ <!-- ASSIGNMET -->
+ <div class="row">
+ <label>Tildelt</label>
+ <select name="assigned_to">
+ <xsl:attribute name="title">
+ <xsl:value-of
select="php:function('lang', 'select')"/>
+ </xsl:attribute>
+ <option value="0">
+ <xsl:value-of
select="php:function('lang', 'select')"/>
+ </option>
+ <xsl:apply-templates
select="user_list/options"/>
+ </select>
+ </div>
+ <div class="row">
+ <label>Egne Timer</label>
+ <input class="date">
+ <xsl:attribute
name="id">billable_hours</xsl:attribute>
+ <xsl:attribute
name="name">billable_hours</xsl:attribute>
+ <xsl:attribute name="type">text</xsl:attribute>
+ </input>
+ <xsl:text> </xsl:text>
+ <xsl:value-of
select="check_list/billable_hours"/>
+ </div>
+
</fieldset>
<fieldset class="col_2">
<div class="row">
@@ -105,3 +129,14 @@
</div>
</div>
</xsl:template>
+
+
+ <!-- New template-->
+ <xsl:template match="options">
+ <option value="{id}">
+ <xsl:if test="selected != 0">
+ <xsl:attribute name="selected"
value="selected"/>
+ </xsl:if>
+ <xsl:value-of disable-output-escaping="yes"
select="name"/>
+ </option>
+ </xsl:template>
Copied:
branches/Version-1_0-branch/mobilefrontend/controller/images/green_ring.png
(from rev 11108, trunk/mobilefrontend/controller/images/green_ring.png)
===================================================================
(Binary files differ)
Copied:
branches/Version-1_0-branch/mobilefrontend/controller/images/green_ring.psd
(from rev 11108, trunk/mobilefrontend/controller/images/green_ring.psd)
===================================================================
(Binary files differ)
Copied:
branches/Version-1_0-branch/mobilefrontend/controller/images/red_ring.png (from
rev 11108, trunk/mobilefrontend/controller/images/red_ring.png)
===================================================================
(Binary files differ)
Copied:
branches/Version-1_0-branch/mobilefrontend/controller/images/red_ring.psd (from
rev 11108, trunk/mobilefrontend/controller/images/red_ring.psd)
===================================================================
(Binary files differ)
Modified: branches/Version-1_0-branch/mobilefrontend/templates/base/config.tpl
===================================================================
--- branches/Version-1_0-branch/mobilefrontend/templates/base/config.tpl
2013-05-13 14:35:08 UTC (rev 11108)
+++ branches/Version-1_0-branch/mobilefrontend/templates/base/config.tpl
2013-05-15 08:03:03 UTC (rev 11109)
@@ -18,7 +18,7 @@
<select name="newsettings[auth_type]">
<option value="0"
{selected_auth_type_0}>Same as framework</option>
<option value="sql"
{selected_auth_type_sql}>SQL</option>
- <option value="custom_sso"
{selected_auth_type_custom_sso}>Custom SSO</option>
+ <option value="customsso"
{selected_auth_type_customsso}>Custom SSO</option>
</select>
</td>
</tr>
Modified:
branches/Version-1_0-branch/phpgwapi/inc/auth/class.auth_custom_sso.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/auth/class.auth_custom_sso.inc.php
2013-05-13 14:35:08 UTC (rev 11108)
+++ branches/Version-1_0-branch/phpgwapi/inc/auth/class.auth_custom_sso.inc.php
2013-05-15 08:03:03 UTC (rev 11109)
@@ -8,7 +8,7 @@
* @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General
Public License
* @package phpgwapi
* @subpackage accounts
- * @version $Id: class.auth_custom_sso.inc.php 10127 2012-10-07
17:06:01Z sigurdne $
+ * @version $Id: class.auth_sql.inc.php 10166 2012-10-09 07:54:03Z
sigurdne $
*/
/*
@@ -44,13 +44,13 @@
}
/**
- * Authenticate a user based on SSO
+ * Authenticate a user
*
* @param string $username the login to authenticate
* @param string $passwd the password supplied by the user
* @return bool did the user sucessfully authenticate
*/
- public function authenticate($username, $passwd='')
+ public function authenticate($username, $passwd)
{
$username =
$GLOBALS['phpgw']->db->db_addslashes($username);
@@ -60,6 +60,7 @@
$GLOBALS['phpgw']->db->query($sql, __LINE__, __FILE__);
return !!$GLOBALS['phpgw']->db->next_record();
+
}
/* php ping function
@@ -70,6 +71,7 @@
return $rval === 0;
}
+
public function get_username()
{
$config = CreateObject('phpgwapi.config','rental');
Copied:
branches/Version-1_0-branch/phpgwapi/inc/auth/class.auth_customsso.inc.php
(from rev 11108, trunk/phpgwapi/inc/auth/class.auth_customsso.inc.php)
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/auth/class.auth_customsso.inc.php
(rev 0)
+++ branches/Version-1_0-branch/phpgwapi/inc/auth/class.auth_customsso.inc.php
2013-05-15 08:03:03 UTC (rev 11109)
@@ -0,0 +1,183 @@
+<?php
+ /**
+ * Authentication based on SQL table
+ * @author Dan Kuykendall <address@hidden>
+ * @author Joseph Engo <address@hidden>
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2013 Free Software Foundation, Inc.
http://www.fsf.org/
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General
Public License
+ * @package phpgwapi
+ * @subpackage accounts
+ * @version $Id: class.auth_sql.inc.php 10166 2012-10-09 07:54:03Z
sigurdne $
+ */
+
+ /*
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+ /**
+ * Authentication based on SQL table
+ *
+ * @package phpgwapi
+ * @subpackage accounts
+ */
+ class phpgwapi_auth_customsso extends phpgwapi_auth_
+ {
+
+ /**
+ * Constructor
+ */
+ public function __construct()
+ {
+ parent::__construct();
+ }
+
+ /**
+ * Authenticate a user
+ *
+ * @param string $username the login to authenticate
+ * @param string $passwd the password supplied by the user
+ * @return bool did the user sucessfully authenticate
+ */
+ public function authenticate($username, $passwd)
+ {
+ $username =
$GLOBALS['phpgw']->db->db_addslashes($username);
+
+ $sql = 'SELECT account_pwd FROM phpgw_accounts'
+ . " WHERE account_lid = '{$username}'"
+ . " AND account_status = 'A'";
+
+ $GLOBALS['phpgw']->db->query($sql, __LINE__, __FILE__);
+ return !!$GLOBALS['phpgw']->db->next_record();
+
+ }
+
+ /* php ping function
+ */
+ private function ping($host)
+ {
+ exec(sprintf('ping -c 1 -W 5 %s', escapeshellarg($host)), $res,
$rval);
+ return $rval === 0;
+ }
+
+
+ public function get_username()
+ {
+ $config = CreateObject('phpgwapi.config','rental');
+ $config->read();
+
+ if(! $config->config_data['external_db_host'] ||
!$this->ping($config->config_data['external_db_host']))
+ {
+ $message ="Database server
{$config->config_data['external_db_host']} is not accessible";
+ phpgwapi_cache::message_set($message, 'error');
+ return false;
+ }
+
+ $db = createObject('phpgwapi.db', null, null, true);
+
+ $db->debug =
!!$config->config_data['external_db_debug'];
+ $db->Host = $config->config_data['external_db_host'];
+ $db->Port = $config->config_data['external_db_port'];
+ $db->Type = $config->config_data['external_db_type'];
+ $db->Database =
$config->config_data['external_db_name'];
+ $db->User = $config->config_data['external_db_user'];
+ $db->Password =
$config->config_data['external_db_password'];
+
+ try
+ {
+ $db->connect();
+ }
+ catch(Exception $e)
+ {
+ $message =
lang('unable_to_connect_to_database');
+ phpgwapi_cache::message_set($message, 'error');
+ return false;
+ }
+
+ $headers = getallheaders();
+
+// $headers['Osso-User-Dn'] =
'cn=02035701829,cn=users,dc=usrv,dc=ubergenkom,dc=no';// test
+
+ $header_regular_expression = '/^cn=(.*),cn=users.*$/';
+ $header_key = 'Osso-User-Dn';
+ $matches = array();
+
preg_match_all($header_regular_expression,$headers[$header_key], $matches);
+ $fodsels_nr = $matches[1][0];
+
+ $sql = "SELECT BRUKERNAVN FROM V_IDM_KOBLINGER WHERE
FODSELSNR ='{$fodsels_nr}'";
+ $db->query($sql,__LINE__,__FILE__);
+ $db->next_record();
+ return $db->f('BRUKERNAVN',true);
+ }
+
+ /**
+ * Set the user's password to a new value
+ *
+ * @param string $old_passwd the user's old password
+ * @param string $new_passwd the user's new password
+ * @param int $account_id the account to change the password for
- defaults to current user
+ * @return string the new encrypted hash, or an empty string on
failure
+ */
+ public function change_password($old_passwd, $new_passwd,
$account_id = 0)
+ {
+ $account_id = (int) $account_id;
+ // Don't allow passwords changes for other accounts
when using XML-RPC
+ if ( !$account_id )
+ {
+ $account_id =
$GLOBALS['phpgw_info']['user']['account_id'];
+ }
+
+ if ( $GLOBALS['phpgw_info']['flags']['currentapp'] ==
'login')
+ {
+ if (
!$this->authenticate($GLOBALS['phpgw']->accounts->id2lid($account_id),
$old_passwd) )
+ {
+ return '';
+ }
+ }
+
+ $hash = $this->create_hash($new_passwd);
+ $hash_safe =
$GLOBALS['phpgw']->db->db_addslashes($hash); // just to be safe :)
+ $now = time();
+
+ $sql = 'UPDATE phpgw_accounts'
+ . " SET account_pwd = '{$hash_safe}',
account_lastpwd_change = {$now}"
+ . " WHERE account_id = {$account_id}";
+
+ if ( !!$GLOBALS['phpgw']->db->query($sql, __LINE__,
__FILE__) )
+ {
+ return $hash;
+ }
+ return '';
+ }
+
+ /**
+ * Update when the user last logged in
+ *
+ * @param int $account_id the user's account id
+ * @param string $ip the source IP adddress for the request
+ */
+ public function update_lastlogin($account_id, $ip)
+ {
+ $ip = $GLOBALS['phpgw']->db->db_addslashes($ip);
+ $account_id = (int) $account_id;
+ $now = time();
+
+ $sql = 'UPDATE phpgw_accounts'
+ . " SET account_lastloginfrom = '{$ip}',"
+ . " account_lastlogin = {$now}"
+ . " WHERE account_id = {$account_id}";
+
+ $GLOBALS['phpgw']->db->query($sql, __LINE__, __FILE__);
+ }
+ }
Modified: branches/Version-1_0-branch/phpgwapi/inc/class.login.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.login.inc.php
2013-05-13 14:35:08 UTC (rev 11108)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.login.inc.php
2013-05-15 08:03:03 UTC (rev 11109)
@@ -204,7 +204,7 @@
unset($sslattributes);
}
- if ($GLOBALS['phpgw_info']['server']['auth_type'] ==
'custom_sso' && !isset($_GET['cd']))
+ if ($GLOBALS['phpgw_info']['server']['auth_type'] ==
'customsso' && !isset($_GET['cd']))
{
//Reset auth object
Modified: branches/Version-1_0-branch/phpgwapi/inc/class.ofphpgwapi.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.ofphpgwapi.inc.php
2013-05-13 14:35:08 UTC (rev 11108)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.ofphpgwapi.inc.php
2013-05-15 08:03:03 UTC (rev 11109)
@@ -109,7 +109,7 @@
case 'ldap':
case 'mail':
// case 'nis': - doesn't currently work AFAIK -
skwashd may08
- case 'custom_sso':
+ case 'customsso':
case 'ntlm':
case 'remoteuser':
case 'sql':
Modified: branches/Version-1_0-branch/phpgwapi/inc/class.phpgw.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.phpgw.inc.php
2013-05-13 14:35:08 UTC (rev 11108)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.phpgw.inc.php
2013-05-15 08:03:03 UTC (rev 11109)
@@ -418,6 +418,7 @@
case 'float':
case 'double':
+ $value = str_replace(array('
',','),array('','.'), $value);
if ( (float) $value == $value )
{
return (float)
$value;
Modified: branches/Version-1_0-branch/phpgwapi/inc/functions.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/functions.inc.php 2013-05-13
14:35:08 UTC (rev 11108)
+++ branches/Version-1_0-branch/phpgwapi/inc/functions.inc.php 2013-05-15
08:03:03 UTC (rev 11109)
@@ -129,7 +129,8 @@
$link_data[trim($__param_set[0])] =
trim($__param_set[1]);
}
}
- $ret = $GLOBALS['phpgw']->link($path, $link_data, true);
+
+ $ret = $GLOBALS['phpgw']->link($path, $link_data, true);//true:
want '&';rather than '&';
return $ret;
}
Modified:
branches/Version-1_0-branch/phpgwapi/templates/base/datatable_common.xsl
===================================================================
--- branches/Version-1_0-branch/phpgwapi/templates/base/datatable_common.xsl
2013-05-13 14:35:08 UTC (rev 11108)
+++ branches/Version-1_0-branch/phpgwapi/templates/base/datatable_common.xsl
2013-05-15 08:03:03 UTC (rev 11109)
@@ -32,8 +32,12 @@
</xsl:template>
-<xsl:template name="datatable">
- <iframe id="yui-history-iframe"
src="phpgwapi/js/yahoo/history/assets/blank.html"></iframe>
+<xsl:template name="datatable" xmlns:php="http://php.net/xsl">
+ <iframe id="yui-history-iframe"
src="phpgwapi/js/yahoo/history/assets/blank.html">
+ <xsl:attribute name="src">
+ <xsl:value-of select="php:function('get_phpgw_link',
'/phpgwapi/js/yahoo/history/assets/blank.html')" />
+ </xsl:attribute>
+ </iframe>
<input id="yui-history-field" type="hidden"/>
<xsl:call-template name="yui_phpgw_i18n"/>
<xsl:apply-templates select="form" />
Modified: branches/Version-1_0-branch/property/inc/class.botts.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.botts.inc.php
2013-05-13 14:35:08 UTC (rev 11108)
+++ branches/Version-1_0-branch/property/inc/class.botts.inc.php
2013-05-15 08:03:03 UTC (rev 11109)
@@ -316,8 +316,50 @@
return $columns;
}
+ function get_group_list($selected = 0)
+ {
+ $query='';
+ $group_list =
$this->bocommon->get_group_list('select', $selected, $start=-1, $sort='ASC',
$order='account_firstname', $query, $offset=-1);
+ $_candidates = array();
+
if(isset($this->config->config_data['fmtts_assign_group_candidates']) &&
is_array($this->config->config_data['fmtts_assign_group_candidates']))
+ {
+
foreach($this->config->config_data['fmtts_assign_group_candidates'] as
$group_candidate)
+ {
+ if( $group_candidate )
+ {
+ $_candidates[] =
$group_candidate;
+ }
+ }
+ }
+ if( $_candidates )
+ {
+ if($selected)
+ {
+ if( !in_array( $selected, $_candidates)
)
+ {
+ $_candidates[] = $selected;
+ }
+ }
+ $values = array();
+ foreach ($group_list as $group)
+ {
+ if( in_array( $group['id'],
$_candidates) )
+ {
+ $values[] = $group;
+ }
+ }
+
+ return $values;
+ }
+ else
+ {
+ return $group_list;
+
+ }
+ }
+
function filter($data=0)
{
if(is_array($data))
Modified: branches/Version-1_0-branch/property/inc/class.soresponsible.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soresponsible.inc.php
2013-05-13 14:35:08 UTC (rev 11108)
+++ branches/Version-1_0-branch/property/inc/class.soresponsible.inc.php
2013-05-15 08:03:03 UTC (rev 11109)
@@ -929,20 +929,25 @@
}
/**
- * Get the user_id for a particular responsibility
+ * Get the user_id for a particular responsibility at a location
*
- * @param integer $person_id the ID of the given contact
+ * @param array
*
* @return user_id
*/
- public function get_responsible_user_id($responsibility_id)
+ public function get_responsible_user_id($data = array())
{
- $responsibility_id = (int)$responsibility_id;
+ $responsibility_id = (int)$data['responsibility_id'];
+ $location_code = $data['location_code'];
$now = time();
+
$sql = "SELECT contact_id FROM
fm_responsibility_contact"
. " {$this->join} fm_responsibility ON
fm_responsibility_contact.responsibility_id = fm_responsibility.id"
- . " AND active = 1 AND active_from < {$now} AND
active_to > {$now} AND expired_on IS NULL";
+ . " WHERE fm_responsibility.id =
{$responsibility_id}"
+ . " AND active_from < {$now}"
+ . " AND expired_on IS NULL"
+ . " AND location_code = '{$location_code}'";
$this->db->query($sql, __LINE__, __FILE__);
$this->db->next_record();
Modified: branches/Version-1_0-branch/property/inc/class.sotts.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sotts.inc.php
2013-05-13 14:35:08 UTC (rev 11108)
+++ branches/Version-1_0-branch/property/inc/class.sotts.inc.php
2013-05-15 08:03:03 UTC (rev 11109)
@@ -1009,7 +1009,7 @@
$old_status =
$this->db->f('status');
$ticket['old_status'] = $old_status; // used for
custom functions
$old_budget =
$this->db->f('budget');
- $old_billable_hours =
$this->db->f('billable_hours');
+ $old_billable_hours =
(float)$this->db->f('billable_hours');
// $old_billable_rate = $this->db->f('billable_rate');
$old_subject =
$this->db->f('subject');
$old_contact_id =
$this->db->f('contact_id');
@@ -1215,9 +1215,10 @@
if($ticket['billable_hours'])
{
$ticket['billable_hours'] =
(float)str_replace(',','.', $ticket['billable_hours']);
- }
- if ((float)$old_billable_hours !=
$ticket['billable_hours'])
- {
+ $ticket['billable_hours'] +=
(float)$old_billable_hours;
+// }
+// if ((float)$old_billable_hours !=
$ticket['billable_hours'])
+// {
$this->db->query("UPDATE fm_tts_tickets SET
billable_hours='{$ticket['billable_hours']}'"
. " WHERE
id='{$id}'",__LINE__,__FILE__);
$this->historylog->add('H',$id,$ticket['billable_hours'],$old_billable_hours);
Modified:
branches/Version-1_0-branch/property/inc/class.uicondition_survey.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uicondition_survey.inc.php
2013-05-13 14:35:08 UTC (rev 11108)
+++ branches/Version-1_0-branch/property/inc/class.uicondition_survey.inc.php
2013-05-15 08:03:03 UTC (rev 11109)
@@ -989,7 +989,7 @@
'import_type'
=> 'import type',
'building_part'
=> 'bygningsdels kode',
'descr'
=> 'Tilstandbeskrivelse',
- 'title'
=> 'Tiltak',
+ 'title'
=> 'Tiltak/overskrift',
'hjemmel'
=> 'Hjemmel/ krav',
'condition_degree'
=> 'Tilstandsgrad',
'condition_type'
=> 'Konsekvenstype',
Modified: branches/Version-1_0-branch/property/inc/class.uitts.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uitts.inc.php
2013-05-13 14:35:08 UTC (rev 11108)
+++ branches/Version-1_0-branch/property/inc/class.uitts.inc.php
2013-05-15 08:03:03 UTC (rev 11109)
@@ -1999,9 +1999,10 @@
'lang_user_statustext'
=> lang('Select the user the selection belongs to. To do not use a user select
NO USER'),
'select_user_name'
=> 'values[assignedto]',
'user_list'
=>
$this->bocommon->get_user_list_right2('select',4,$values['assignedto'],$this->acl_location),
+ 'disable_userassign_on_add'
=>
isset($this->bo->config->config_data['tts_disable_userassign_on_add'])?$this->bo->config->config_data['tts_disable_userassign_on_add']:'',
'lang_no_group'
=> lang('No group'),
- 'group_list'
=>
$this->bocommon->get_group_list('select',$values['group_id'],$start=-1,$sort='ASC',$order='account_firstname',$query='',$offset=-1),
+ 'group_list'
=> $this->bo->get_group_list(),
'select_group_name'
=> 'values[group_id]',
'lang_priority_statustext'
=> lang('Select the priority the selection belongs to.'),
@@ -3163,7 +3164,9 @@
'user_list'
=>
$this->bocommon->get_user_list_right2('select',4,$ticket['assignedto'],$this->acl_location),
'lang_no_group'
=> lang('No group'),
- 'group_list'
=>
$this->bocommon->get_group_list('select',$ticket['group_id'],$start=-1,$sort='ASC',$order='account_firstname',$query='',$offset=-1),
+// 'group_list'
=>
$this->bocommon->get_group_list('select',$ticket['group_id'],$start=-1,$sort='ASC',$order='account_firstname',$query='',$offset=-1),
+ 'group_list'
=> $this->bo->get_group_list($ticket['group_id']),
+
'select_group_name'
=> 'values[group_id]',
'value_group_id'
=> $ticket['group_id'],
Modified: branches/Version-1_0-branch/property/inc/hook_config.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/hook_config.inc.php
2013-05-13 14:35:08 UTC (rev 11108)
+++ branches/Version-1_0-branch/property/inc/hook_config.inc.php
2013-05-15 08:03:03 UTC (rev 11109)
@@ -33,6 +33,32 @@
* @param $config
* @return string HTML checkboxes to be placed in a table
*/
+ function fmtts_assign_group_candidates($config)
+ {
+ $groups = $GLOBALS['phpgw']->accounts->get_list('groups');
+ $groups_assigned =
isset($config['fmtts_assign_group_candidates']) ?
$config['fmtts_assign_group_candidates'] : array();
+ $out = '';
+ foreach ( $groups as $group => $label)
+ {
+ $checked = '';
+ if ( in_array($group, $groups_assigned))
+ {
+ $checked = ' checked';
+ }
+
+ $out .= <<<HTML
+ <tr><td><input type="checkbox"
name="newsettings[fmtts_assign_group_candidates][]" value="{$group}"
{$checked}><label>{$label}</label></td></tr>
+HTML;
+ }
+ return $out;
+ }
+
+ /**
+ * Get HTML checkbox with groups that are candidates for simplified tts
interface
+ *
+ * @param $config
+ * @return string HTML checkboxes to be placed in a table
+ */
function fmttssimple_group($config)
{
$groups = $GLOBALS['phpgw']->accounts->get_list('groups');
Modified: branches/Version-1_0-branch/property/templates/base/config.tpl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/config.tpl
2013-05-13 14:35:08 UTC (rev 11108)
+++ branches/Version-1_0-branch/property/templates/base/config.tpl
2013-05-15 08:03:03 UTC (rev 11109)
@@ -238,7 +238,26 @@
{lang_default}: {lang_Open}</td>
<td><input name="newsettings[tts_lang_open]"
value="{value_tts_lang_open}"></td>
</tr>
+ <tr class="row_off">
+ <td valign =
'top'>{lang_TTS_assign_group_candidates}:</td>
+ <td>
+ <!--to be able to blank the setting - need an
empty value-->
+ <input type = 'hidden'
name="newsettings[fmtts_assign_group_candidates][]" value="">
+ <table>
+ {hook_fmtts_assign_group_candidates}
+ </table>
+ </td>
+ </tr>
<tr class="row_on">
+ <td >{lang_TTS_disable_assign_to_user_on_add}:</td>
+ <td>
+ <select
name="newsettings[tts_disable_userassign_on_add]">
+ <option value=""
{selected_tts_disable_userassign_on_add_}>NO</option>
+ <option value="1"
{selected_tts_disable_userassign_on_add_1}>YES</option>
+ </select>
+ </td>
+ </tr>
+ <tr class="row_off">
<td valign = 'top'>{lang_TTS_simplified_group}:</td>
<td>
<!--to be able to blank the setting - need an
empty value-->
@@ -266,7 +285,7 @@
</select>
</td>
</tr>
- <tr class="row_off">
+ <tr class="row_on">
<td>{lang_Owner_Notification_TTS}.</td>
<td>
<select name="newsettings[ownernotification]">
@@ -275,7 +294,7 @@
</select>
</td>
</tr>
- <tr class="row_on">
+ <tr class="row_off">
<td>{lang_Assigned_Notification_TTS}.</td>
<td>
<select
name="newsettings[assignednotification]">
@@ -284,7 +303,7 @@
</select>
</td>
</tr>
- <tr class="row_off">
+ <tr class="row_on">
<td>{lang_Group_Notification_TTS}.</td>
<td>
<select name="newsettings[groupnotification]">
Modified: branches/Version-1_0-branch/property/templates/base/tts.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/tts.xsl 2013-05-13
14:35:08 UTC (rev 11108)
+++ branches/Version-1_0-branch/property/templates/base/tts.xsl 2013-05-15
08:03:03 UTC (rev 11109)
@@ -89,16 +89,20 @@
<xsl:call-template name="group_select"/>
</td>
</tr>
- <tr>
- <td
valign="top">
-
<label>
-
<xsl:value-of select="php:function('lang', 'Assign to')"/>
-
</label>
- </td>
- <td>
-
<xsl:call-template name="user_id_select"/>
- </td>
- </tr>
+ <xsl:choose>
+
<xsl:when test="disable_userassign_on_add !='1'">
+
<tr>
+
<td valign="top">
+
<label>
+
<xsl:value-of select="php:function('lang', 'Assign
to')"/>
+
</label>
+
</td>
+
<td>
+
<xsl:call-template name="user_id_select"/>
+
</td>
+
</tr>
+
</xsl:when>
+ </xsl:choose>
<xsl:call-template name="contact_form"/>
<tr>
<td>
@@ -650,11 +654,16 @@
</label>
</td>
<td>
-
<input type="text" id="values_billable_hour"
name="values[billable_hours]" size="10" value="{value_billable_hours}">
+
<input type="text" id="values_billable_hour"
name="values[billable_hours]" size="10" value="">
<xsl:attribute name="title">
<xsl:value-of
select="php:function('lang', 'enter the billable hour for the task')"/>
</xsl:attribute>
</input>
+
<input type="text" id="values_billable_hour_orig"
name="values[billable_hours_orig]" size="10" value="{value_billable_hours}"
readonly="readonly">
+
<xsl:attribute name="title">
+
<xsl:value-of
select="php:function('lang', 'enter the billable hour for the task')"/>
+
</xsl:attribute>
+
</input>
</td>
</tr>
</xsl:when>
Modified: branches/Version-1_0-branch/rental/inc/class.bofellesdata.inc.php
===================================================================
--- branches/Version-1_0-branch/rental/inc/class.bofellesdata.inc.php
2013-05-13 14:35:08 UTC (rev 11108)
+++ branches/Version-1_0-branch/rental/inc/class.bofellesdata.inc.php
2013-05-15 08:03:03 UTC (rev 11109)
@@ -459,7 +459,7 @@
{
$this->log(__class__, __function__);
- $columns = "count(*)";
+ $columns = "count(*) as COUNT";
$tables = "V_ORG_ENHET";
$joins = "LEFT JOIN V_ORG_PERSON_ENHET ON
(V_ORG_ENHET.ORG_ENHET_ID = V_ORG_PERSON_ENHET.ORG_ENHET_ID AND
V_ORG_PERSON_ENHET.prioritet = 1) ".
"LEFT JOIN V_ORG_PERSON ON
(V_ORG_PERSON.ORG_PERSON_ID = V_ORG_PERSON_ENHET.ORG_PERSON_ID)";
@@ -500,7 +500,7 @@
if($db->next_record())
{
- return $db->f('count');
+ return $db->f('COUNT');
}
return 0;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [11109] Merge 11094:11108 from trunk,
Sigurd Nes <=