[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [10612] Merge 10600:10611 from trunk
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [10612] Merge 10600:10611 from trunk |
Date: |
Wed, 19 Dec 2012 07:54:58 +0000 |
Revision: 10612
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10612
Author: sigurdne
Date: 2012-12-19 07:54:58 +0000 (Wed, 19 Dec 2012)
Log Message:
-----------
Merge 10600:10611 from trunk
Modified Paths:
--------------
branches/Version-1_0-branch/phpgwapi/inc/class.phpgw.inc.php
branches/Version-1_0-branch/phpgwapi/inc/class.vfs_sql.inc.php
branches/Version-1_0-branch/property/inc/class.boproject.inc.php
branches/Version-1_0-branch/property/inc/class.soproject.inc.php
branches/Version-1_0-branch/property/inc/class.uicondition_survey.inc.php
branches/Version-1_0-branch/property/inc/class.uiproject.inc.php
branches/Version-1_0-branch/property/js/yahoo/project.edit.js
branches/Version-1_0-branch/property/js/yahoo/project.index.js
branches/Version-1_0-branch/property/setup/phpgw_no.lang
branches/Version-1_0-branch/property/setup/setup.inc.php
branches/Version-1_0-branch/property/setup/tables_current.inc.php
branches/Version-1_0-branch/property/setup/tables_update.inc.php
branches/Version-1_0-branch/property/templates/base/project.xsl
branches/Version-1_0-branch/property/templates/base/request.xsl
Property Changed:
----------------
branches/Version-1_0-branch/
Property changes on: branches/Version-1_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
-
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538,7540-7542,7544-7549,7551-7552,7554-7561,7563,7565,7567-7573,7575-7578,7580-7584,7586-7591,7593-7624,7627-7636,7638-7656,7658-7718,7720-7732,7734,7736,7738-7750,7754-7759,7761-7767,7769-7780,7782,7784-7809,7811-7812,7814-7835,7837-7847,7849-7887,7889-7895,7897,7899,7901,7903-7905,7907-7921,7923-7925,7927-7933,7935,7937-7952,7954-7968,7970-7974,7976,7978-7979,7981-7982,7984-7988,7990-7992,7994-8041,8043-8066,8068-8087,8089,8091-8108,8110-8124,8126-8129,8131,8133-8150,8152-8154,8156-8162,8164-8167,8169-8170,8172-8179,8181,8183-8196,8198-8207,8209-8211,8213-8214,8216-8217,8219-8220,8222,8224-8225,8227-8247,8249,8251,8253-8282,8284-8352,8354-8368,8370-8396,8398-8430,8432,8434-8440,8442-8445,8447-8453,8455-8456,8458,8460,8462-8464,8466-8473,8475-8479,8481,8483-8501,8503-8523,8525,8527-8531,8533,8535-8536,8538-8550,8552-8554,8556-8557,8559-8579,8581-8587,8589,8591-8592,8594-8595,8597-8601,8603-8610,8612-8613,8615,8617,8619-8645,8647-8650,8652-8661,8663-8666,8668-8669,8671-8683,8685-8691,8693-8730,8732-8737,8739,8741-8767,8769,8771-8772,8774,8776-8797,8799-8812,8814-8819,8821,8823-8833,8835-8837,8839,8841,8843-8849,8852-8858,8860-8867,8869-8870,8872,8874-8877,8879,8881,8883-8888,8890,8892-8901,8903-8911,8913-8917,8920-8923,8925-8933,8935-8938,8940-8943,8945,8947-8948,8950,8952-8953,8955-8962,8964,8966,8968-8970,8972-8975,8977-8983,8985-8993,8995-9001,9003,9005,9007,9009,9011-9019,9021-9023,9025,9027-9028,9030-9044,9046-9047,9049-9050,9052-9056,9058-9059,9061,9063-9064,9066-9068,9071-9092,9094-9112,9114-9117,9119,9121-9160,9162-9166,9169-9207,9209-9211,9213-9215,9217,9219,9221-9253,9255,9257,9259-9260,9262,9264-9269,9271-9273,9275,9277-9278,9280,9282-9283,9285-9289,9291-9299,9301-9310,9312-9313,9315-9320,9322-9324,9326-9338,9340-9342,9344,9346-9348,9350-9358,9360-9362,9364-9366,9368-9374,9376-9382,9384,9386,9388-9390,9392-9396,9398-9402,9404-9410,9412,9414,9416-9417,9419-9425,9427,9429-9430,9432,9434-9463,9465-9502,9504-9506,9508-9521,9523-9526,9528,9530-9537,9539,9541-9551,9553,9555-9556,9558-9578,9580-9581,9583,9585,9587,9589,9591-9624,9626-9655,9657-9700,9702-9726,9728-9729,9731-9749,9751,9753-9754,9756-9832,9834-9836,9838-9839,9841-9846,9848-9850,9852-9858,9860-9863,9865,9867,9869-9871,9873-9893,9895,9897-9912,9914-9919,9921-9928,9930-9952,9954,9956,9958-9963,9965-9993,9995-9997,9999-10001,10003-10004,10006-10007,10009-10012,10014-10031,10033-10073,10075-10107,10109-10165,10167-10210,10222-10226,10228-10311,10313-10378,10380,10382,10384-10393,10395-10478,10480-10482,10484-10494,10496-10503,10505,10507,10509-10521,10523,10525-10528,10530-10540,10542-10543,10545-10568,10570-10584,10586-10590,10592-10594,10596,10598-10599
+
/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
Modified: branches/Version-1_0-branch/phpgwapi/inc/class.phpgw.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.phpgw.inc.php
2012-12-19 07:44:29 UTC (rev 10611)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.phpgw.inc.php
2012-12-19 07:54:58 UTC (rev 10612)
@@ -408,6 +408,7 @@
$value =
htmlspecialchars($value, ENT_COMPAT, 'UTF-8');
break;
+ case 'boolean':
case 'bool':
if (
preg_match('/^[false|0|no]$/', $value) )
{
Modified: branches/Version-1_0-branch/phpgwapi/inc/class.vfs_sql.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.vfs_sql.inc.php
2012-12-19 07:44:29 UTC (rev 10611)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.vfs_sql.inc.php
2012-12-19 07:54:58 UTC (rev 10612)
@@ -1066,6 +1066,11 @@
*/
function cp ($data)
{
+ if(!$data['from'])
+ {
+ throw new Exception('nothing to copy from');
+ }
+
if (!is_array ($data))
{
$data = array ();
Modified: branches/Version-1_0-branch/property/inc/class.boproject.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.boproject.inc.php
2012-12-19 07:44:29 UTC (rev 10611)
+++ branches/Version-1_0-branch/property/inc/class.boproject.inc.php
2012-12-19 07:54:58 UTC (rev 10612)
@@ -42,6 +42,7 @@
var $order;
var $cat_id;
var $allrows;
+ var $project_type_id;
var $public_functions = array
(
@@ -78,6 +79,8 @@
$wo_hour_cat_id =
phpgw::get_var('wo_hour_cat_id', 'int');
$district_id =
phpgw::get_var('district_id', 'int');
$criteria_id =
phpgw::get_var('criteria_id', 'int');
+ $project_type_id =
phpgw::get_var('project_type_id', 'int');
+
$this->allrows =
phpgw::get_var('allrows', 'bool');
$this->start = $start ? $start : 0;
@@ -122,6 +125,10 @@
{
$this->criteria_id = $criteria_id;
}
+ if(isset($_POST['project_type_id']) ||
isset($_GET['project_type_id']))
+ {
+ $this->project_type_id = $project_type_id;
+ }
}
function save_sessiondata($data)
@@ -147,6 +154,7 @@
$this->wo_hour_cat_id =
isset($data['wo_hour_cat_id'])?$data['wo_hour_cat_id']:'';
$this->district_id =
isset($data['district_id'])?$data['district_id']:'';
$this->criteria_id =
isset($data['criteria_id'])?$data['criteria_id']:'';
+ $this->project_type_id =
isset($data['project_type_id'])?$data['project_type_id']:'';
}
function column_list($selected = array())
@@ -208,6 +216,30 @@
return $columns;
}
+ public function get_project_types($selected)
+ {
+ $values = array
+ (
+ array
+ (
+ 'id' => 1,
+ 'name' => lang('operation')
+ ),
+ array
+ (
+ 'id' => 2,
+ 'name' => lang('investment')
+ ),
+ array
+ (
+ 'id' => 3,
+ 'name' => lang('buffer')
+ ),
+
+ );
+ return $this->bocommon->select_list($selected, $values);
+ }
+
function select_status_list($format='',$selected='')
{
switch($format)
@@ -414,7 +446,9 @@
$project = $this->so->read(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
'filter' => $this->filter,'cat_id' =>
$this->cat_id,'status_id' => $this->status_id,'wo_hour_cat_id' =>
$this->wo_hour_cat_id,
'start_date'=>$start_date,'end_date'=>$end_date,'allrows'=>isset($data['allrows'])
? $data['allrows'] : '','dry_run' => $data['dry_run'],
- 'district_id' => $this->district_id, 'criteria'
=> $this->get_criteria($this->criteria_id)));
+ 'district_id' => $this->district_id, 'criteria'
=> $this->get_criteria($this->criteria_id),
+ 'project_type_id' =>
$this->project_type_id));
+
$this->total_records = $this->so->total_records;
$dateformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
Modified: branches/Version-1_0-branch/property/inc/class.soproject.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soproject.inc.php
2012-12-19 07:44:29 UTC (rev 10611)
+++ branches/Version-1_0-branch/property/inc/class.soproject.inc.php
2012-12-19 07:54:58 UTC (rev 10612)
@@ -117,6 +117,7 @@
$district_id =
isset($data['district_id'])?$data['district_id']:'';
$dry_run = isset($data['dry_run']) ?
$data['dry_run'] : '';
$criteria = isset($data['criteria']) &&
$data['criteria'] ? $data['criteria'] : array();
+ $project_type_id = $data['project_type_id'] ?
(int)$data['project_type_id']:0;
$sql = $this->bocommon->fm_cache('sql_project_' .
!!$wo_hour_cat_id);
@@ -475,10 +476,15 @@
$where= 'AND';
}
+ if($project_type_id)
+ {
+ $filtermethod .= " {$where}
fm_project.project_type_id={$project_type_id}";
+ $where= 'AND';
+ }
if($wo_hour_cat_id)
{
- $filtermethod .= " $where
fm_wo_hours_category.id=$wo_hour_cat_id ";
+ $filtermethod .= " $where
fm_wo_hours_category.id=$wo_hour_cat_id";
$where= 'AND';
}
@@ -665,10 +671,14 @@
$project['actual_cost'] = 0;
$project['billable_hours'] = 0;
- $sql_workder = 'SELECT contract_sum,
addition, calculation, budget, actual_cost,'
- . ' billable_hours,closed'
+ $sql_workder = 'SELECT combined_cost,
actual_cost, billable_hours,closed'//, contract_sum, addition, calculation,
budget'
. " FROM fm_workorder {$this->join}
fm_workorder_status ON fm_workorder.status = fm_workorder_status.id"
. " WHERE project_id =
'{$project['project_id']}'";
+//_debug_array($sql_workder);
+ if ($start_date)
+ {
+ $sql_workder .= " AND
fm_workorder.start_date >= $start_date AND fm_workorder.start_date <= $end_date
";
+ }
$this->db->query($sql_workder);
while ($this->db->next_record())
@@ -679,6 +689,11 @@
$_sum = 0;
$closed = true;
}
+ else
+ {
+ $_sum =
$this->db->f('combined_cost');
+ }
+/*
else
if(abs($this->db->f('contract_sum')) > 0)
{
$_sum =
$this->db->f('contract_sum') * ( 1 + ((int)$this->db->f('addition')/100));
@@ -695,7 +710,7 @@
{
$_sum = 0;
}
-
+*/
$_actual_cost =
(int)$this->db->f('actual_cost');
if($closed)
@@ -796,6 +811,7 @@
$project = array
(
'project_id'
=> $this->db->f('id'),
+ 'project_type_id'
=> $this->db->f('project_type_id'),
'title'
=> $this->db->f('title'),
'name'
=> $this->db->f('name'),
'location_code'
=> $this->db->f('location_code'),
@@ -998,6 +1014,7 @@
$values= array
(
$id,
+ $project['project_type_id'],
$project['project_group'],
$project['name'],
'public',
@@ -1026,7 +1043,7 @@
$values = $this->db->validate_insert($values);
- $this->db->query("INSERT INTO fm_project
(id,project_group,name,access,category,entry_date,start_date,end_date,coordinator,status,"
+ $this->db->query("INSERT INTO fm_project
(id,project_type_id,project_group,name,access,category,entry_date,start_date,end_date,coordinator,status,"
.
"descr,budget,reserve,location_code,address,key_deliver,key_fetch,other_branch,key_responsible,user_id,ecodimb,account_group,contact_id,inherit_location,periodization_id
$cols) "
. "VALUES ($values $vals )",__LINE__,__FILE__);
@@ -1177,6 +1194,7 @@
$project['name'] =
$this->db->db_addslashes($project['name']);
$value_set=array(
+ 'project_type_id' =>
$project['project_type_id'],
'project_group' =>
$project['project_group'],
'name' =>
$project['name'],
'status' =>
$project['status'],
@@ -1239,9 +1257,17 @@
'closed_b_period' =>
isset($project['closed_b_period']) && $project['closed_b_period'] ?
$project['closed_b_period'] : array(),
'closed_orig_b_period' =>
isset($project['closed_orig_b_period']) && $project['closed_orig_b_period'] ?
$project['closed_orig_b_period'] : array()
);
+ $_active_period = array
+ (
+ 'active_b_period' =>
isset($project['active_b_period']) && $project['active_b_period'] ?
$project['active_b_period'] : array(),
+ 'active_orig_b_period' =>
isset($project['active_orig_b_period']) && $project['active_orig_b_period'] ?
$project['active_orig_b_period'] : array()
+ );
$this->close_period_from_budget($project['id'],
$_closed_period);
+ $this->activate_period_from_budget($project['id'],
$_active_period);
+
unset($_close_period);
+ unset($_active_period);
if($project['delete_b_period'])
{
@@ -1451,7 +1477,9 @@
'budget'
=> (int)$this->db->f('budget'),
'user_id'
=> $this->db->f('user_id'),
'entry_date' =>
$this->db->f('entry_date'),
- 'modified_date' =>
$this->db->f('modified_date')
+ 'modified_date' =>
$this->db->f('modified_date'),
+ 'closed'
=> $this->db->f('closed'),
+ 'active'
=> $this->db->f('active')
);
}
@@ -1474,7 +1502,10 @@
'budget'
=> $entry['budget'],
'user_id'
=> $entry['user_id'],
'entry_date'
=> $entry['entry_date'],
- 'modified_date'
=> $entry['modified_date']
+ 'modified_date'
=> $entry['modified_date'],
+ 'closed'
=> $entry['closed'],
+ 'active'
=> $entry['active']
+
);
$cols = implode(',',
array_keys($value_set));
$values =
$this->db->validate_insert(array_values($value_set));
@@ -1601,7 +1632,8 @@
'budget' =>
$budget,
'user_id' =>
$this->account,
'entry_date' => $now,
- 'modified_date' => $now
+ 'modified_date' => $now,
+ 'active' => 1
);
$cols = implode(',', array_keys($value_set));
@@ -1616,27 +1648,23 @@
{
$project_id = (int) $project_id;
$closed_period = array();
+ $active_period = array();
$project_budget = array();
$project_order_amount = array();
-
$sql = "SELECT * FROM fm_project_budget WHERE
project_id = {$project_id}";
$this->db->query($sql,__LINE__,__FILE__);
while ($this->db->next_record())
{
- $year = $this->db->f('year');
- $month = $this->db->f('month');
- // $period = $month ? $year . sprintf("%02s",
$month) : $year . date('m');
- $period = $year . sprintf("%02s", $month);
+ $period = $this->db->f('year') .
sprintf("%02s", $this->db->f('month'));
$project_budget[$period] =
(int)$this->db->f('budget');
$project_order_amount[$period] =
$this->db->f('order_amount');
$closed_period[$period] =
!!$this->db->f('closed');
+ $active_period[$period] =
!!$this->db->f('active');
}
- unset($year);
-
$sql = "SELECT id AS order_id FROM fm_workorder WHERE
project_id = {$project_id}";
$this->db->query($sql,__LINE__,__FILE__);
@@ -1659,7 +1687,6 @@
$periode = $this->db->f('periode');
$year = substr( $periode, 0, 4 );
- // $month = substr( $periode, 4, 2 );
$_found = false;
if(isset($project_budget[$periode]))
@@ -1693,7 +1720,6 @@
{
$periode = $this->db->f('periode');
$year = substr( $periode, 0, 4 );
- // $month = substr( $periode, 4, 2 );
if(!$periode)
{
$year = date('Y');
@@ -1823,7 +1849,7 @@
$sort_period = array();
$values = array();
- foreach ($project_budget as $period => $budget)
+ foreach ($project_budget as $period => $_budget)
{
$_sum_orders = 0;
$_actual_cost = 0;
@@ -1835,7 +1861,7 @@
$_sum_orders +=
$order['amount'];
// $_sum_orders -=
$order['actual_cost'];
- if($budget >= 0)
+ if($_budget >= 0)
{
if($order['actual_cost'] >= 0)
{
@@ -1869,7 +1895,6 @@
{
$_sum_orders = 0;
}
-
}
unset($orders[$period]);
@@ -1877,11 +1902,11 @@
$values[] = array
(
- 'project_id' => $project_id,
- 'period' =>
$period,
- 'budget' =>
$budget,
- 'sum_orders' => $_sum_orders,
- 'actual_cost' =>
$_actual_cost,
+ 'project_id' =>
$project_id,
+ 'period'
=> $period,
+ 'budget'
=> $_budget,
+ 'sum_orders' =>
$_sum_orders,
+ 'actual_cost' =>
$_actual_cost,
);
$sort_period[] = $period;
@@ -1922,15 +1947,16 @@
{
$_sum_orders = 0;
}
+
}
$values[] = array
(
- 'project_id' => $project_id,
- 'period' =>
$period,
- 'budget' => 0,
- 'sum_orders' => $_sum_orders,
- 'actual_cost' =>
$_actual_cost,
+ 'project_id' =>
$project_id,
+ 'period'
=> $period,
+ 'budget'
=> 0,
+ 'sum_orders' =>
$_sum_orders,
+ 'actual_cost' =>
$_actual_cost,
);
$sort_period[] = $period;
@@ -1947,11 +1973,20 @@
$entry['year'] = substr( $entry['period'], 0, 4
);
$month = substr( $entry['period'], 4, 2 );
$entry['month'] = $month == '00' ? '' : $month;
- $entry['diff'] = $entry['budget'] -
$entry['sum_orders'] - $entry['actual_cost'];
+ if($active_period[$entry['period']])
+ {
+ $entry['diff'] = $entry['budget'] -
$entry['sum_orders'] - $entry['actual_cost'];
+ }
+ else
+ {
+ $entry['diff'] = 0;
+ }
+
$deviation = $entry['budget'] -
$entry['actual_cost'];
$entry['deviation'] = $deviation;
$entry['deviation_percent'] =
$deviation/$entry['budget'] * 100;
$entry['closed'] =
$closed_period[$entry['period']];
+ $entry['active'] =
$active_period[$entry['period']];
}
//_debug_array( $values);die();
@@ -2010,6 +2045,47 @@
}
+ function activate_period_from_budget($project_id, $data)
+ {
+ $project_id = (int) $project_id;
+ $close_period = array();
+ $open_period = array();
+
+ foreach($data['active_orig_b_period'] as $period)
+ {
+ if(!in_array($period, $data['active_b_period']))
+ {
+ $inactive_period[] = $period;
+ }
+ }
+
+ foreach($data['active_b_period'] as $period)
+ {
+ if(!in_array($period,
$data['active_orig_b_period']))
+ {
+ $active_period[] = $period;
+ }
+ }
+
+ foreach ($active_period as $period)
+ {
+ $when = explode('_', $period);
+ $sql = "UPDATE fm_project_budget SET active = 1
WHERE project_id = {$project_id} AND year =" . (int) $when[0] . ' AND month = '
. (int) $when[1];
+ $this->db->query($sql,__LINE__,__FILE__);
+ }
+
+ foreach ($inactive_period as $period)
+ {
+ $when = explode('_', $period);
+ $sql = "UPDATE fm_project_budget SET active = 0
WHERE project_id = {$project_id} AND year =" . (int) $when[0] . ' AND month = '
. (int) $when[1];
+ $this->db->query($sql,__LINE__,__FILE__);
+ }
+//_debug_array($close_period);
+//_debug_array($open_period);die();
+
+
+ }
+
function
update_request_status($project_id='',$status='',$category=0,$coordinator=0)
{
$historylog_r =
CreateObject('property.historylog','request');
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
2012-12-19 07:44:29 UTC (rev 10611)
+++ branches/Version-1_0-branch/property/inc/class.uicondition_survey.inc.php
2012-12-19 07:54:58 UTC (rev 10612)
@@ -50,7 +50,8 @@
'get_related' => true,
'get_summation' => true,
'view_file' => true,
- 'import' => true
+ 'import' => true,
+ 'download' => true
);
public function __construct()
@@ -72,6 +73,34 @@
}
+ public function download()
+ {
+ if(!$this->acl_read)
+ {
+ $this->bocommon->no_access();
+ return;
+ }
+
+ $values = $this->query();
+
+ $descr = array();
+ $columns = array();
+ $columns[] = 'id';
+ $columns[] = 'title';
+ $columns[] = 'descr';
+ $columns[] = 'address';
+ $columns[] = 'cnt';
+
+ foreach($columns as $_column)
+ {
+ $descr[] = lang(str_replace('_', ' ',
$_column));
+ }
+
+ $this->bocommon->download($values,$columns,$descr);
+
+ }
+
+
public function index()
{
if(!$this->acl_read)
@@ -120,7 +149,7 @@
array(
'type' =>
'link',
'value' =>
lang('download'),
- 'href' =>
self::link(array('menuaction' => 'property.uicondition_survey.index', 'export'
=> true, 'allrows' => true)),
+ 'href' =>
'javascript:window.open("'. self::link(array('menuaction' =>
'property.uicondition_survey.download', 'export' => true, 'allrows' => true)) .
'","window")',
'class' =>
'new_item'
),
array(
@@ -221,13 +250,14 @@
'allrows' => phpgw::get_var('allrows', 'bool')
);
- // Create an empty result set
$result_objects = array();
$result_count = 0;
- $export = phpgw::get_var('export');
-
$values = $this->bo->read($params);
+ if ( phpgw::get_var('export', 'bool'))
+ {
+ return $values;
+ }
$result_data = array('results' => $values);
@@ -236,15 +266,8 @@
$result_data['sort'] = $params['sort'];
$result_data['dir'] = $params['dir'];
+ array_walk( $result_data['results'], array($this,
'_add_links'), "property.uicondition_survey.view" );
- if ($export)
- {
-
- }
- else
- {
- array_walk( $result_data['results'],
array($this, '_add_links'), "property.uicondition_survey.view" );
- }
return $this->yui_results($result_data);
}
@@ -744,6 +767,12 @@
if($file_name)
{
+ if(!is_file($_FILES['file']['tmp_name']))
+ {
+
phpgwapi_cache::message_set(lang('Failed to upload file !'), 'error');
+ return;
+ }
+
$to_file = $bofiles->fakebase .
'/condition_survey/' . $id . '/' . $file_name;
if($bofiles->vfs->file_exists(array(
'string' => $to_file,
@@ -829,8 +858,13 @@
}
- if(!$cached_file =
phpgwapi_cache::session_get('property', 'condition_survey_import_file'))
+ if($step > 1)
{
+ $cached_file =
phpgwapi_cache::session_get('property', 'condition_survey_import_file');
+ }
+
+ if($step ==1 ||
isset($_FILES['import_file']['tmp_name']))
+ {
$file = $_FILES['import_file']['tmp_name'];
$cached_file ="{$file}_temporary_import_file";
// save a copy to survive multiple steps
Modified: branches/Version-1_0-branch/property/inc/class.uiproject.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uiproject.inc.php
2012-12-19 07:44:29 UTC (rev 10611)
+++ branches/Version-1_0-branch/property/inc/class.uiproject.inc.php
2012-12-19 07:54:58 UTC (rev 10612)
@@ -53,6 +53,7 @@
var $currentapp;
var $district_id;
var $criteria_id;
+ var $project_type_id;
var $public_functions = array
(
@@ -97,23 +98,25 @@
$this->district_id =
$this->bo->district_id;
$this->user_id = $this->bo->user_id;
$this->criteria_id =
$this->bo->criteria_id;
+ $this->project_type_id = $this->bo->project_type_id;
}
function save_sessiondata()
{
$data = array
(
- 'start' => $this->start,
- 'query' => $this->query,
- 'sort' => $this->sort,
- 'order' => $this->order,
- 'filter' =>
$this->filter,
- 'cat_id' =>
$this->cat_id,
- 'status_id' =>
$this->status_id,
- 'wo_hour_cat_id'=>
$this->wo_hour_cat_id,
- 'district_id' => $this->district_id,
- 'user_id' =>
$this->user_id,
- 'criteria_id' => $this->criteria_id
+ 'start' =>
$this->start,
+ 'query' =>
$this->query,
+ 'sort' =>
$this->sort,
+ 'order' =>
$this->order,
+ 'filter' =>
$this->filter,
+ 'cat_id' =>
$this->cat_id,
+ 'status_id' =>
$this->status_id,
+ 'wo_hour_cat_id' =>
$this->wo_hour_cat_id,
+ 'district_id' =>
$this->district_id,
+ 'user_id' =>
$this->user_id,
+ 'criteria_id' =>
$this->criteria_id,
+ 'project_type_id' =>
$this->project_type_id
);
$this->bo->save_sessiondata($data);
}
@@ -227,6 +230,7 @@
."cat_id:'{$this->cat_id}',"
."user_id:'{$this->user_id}',"
."criteria_id:'{$this->criteria_id}',"
+
."project_type_id:':{$this->project_type_id}',"
."wo_hour_cat_id:'{$this->wo_hour_cat_id}',"
."second_display:1,"
."status_id:'{$this->status_id}'";
@@ -252,30 +256,33 @@
'second_display'=>true
);
*/
- $values_combo_box[0] =
$this->bocommon->select_district_list('filter',$this->district_id);
+ $values_combo_box[0] =
$this->bo->get_project_types($this->project_type_id);
+ array_unshift ($values_combo_box[0],array
('id'=>'','name'=> lang('project type')));
+
+ $values_combo_box[1] =
$this->bocommon->select_district_list('filter',$this->district_id);
$default_value = array
('id'=>'','name'=>lang('no district'));
- array_unshift
($values_combo_box[0],$default_value);
+ array_unshift
($values_combo_box[1],$default_value);
- $values_combo_box[1] =
$this->cats->formatted_xslt_list(array('format'=>'filter','selected' =>
$this->cat_id,'globals' => True));
+ $values_combo_box[2] =
$this->cats->formatted_xslt_list(array('format'=>'filter','selected' =>
$this->cat_id,'globals' => True));
$default_value = array ('cat_id'=>'','name'=>
lang('no category'));
- array_unshift
($values_combo_box[1]['cat_list'],$default_value);
+ array_unshift
($values_combo_box[2]['cat_list'],$default_value);
- $values_combo_box[2] =
$this->bo->select_status_list('filter',$this->status_id);
- array_unshift ($values_combo_box[2],array
('id'=>'all','name'=> lang('all')));
- array_unshift ($values_combo_box[2],array
('id'=>'open','name'=> lang('open')));
+ $values_combo_box[3] =
$this->bo->select_status_list('filter',$this->status_id);
+ array_unshift ($values_combo_box[3],array
('id'=>'all','name'=> lang('all')));
+ array_unshift ($values_combo_box[3],array
('id'=>'open','name'=> lang('open')));
- $values_combo_box[3] =
$this->bocommon->select_category_list(array('format'=>'filter','selected' =>
$this->wo_hour_cat_id,'type' =>'wo_hours','order'=>'id'));
+ $values_combo_box[4] =
$this->bocommon->select_category_list(array('format'=>'filter','selected' =>
$this->wo_hour_cat_id,'type' =>'wo_hours','order'=>'id'));
$default_value = array
('id'=>'','name'=>lang('no hour category'));
- array_unshift
($values_combo_box[3],$default_value);
+ array_unshift
($values_combo_box[4],$default_value);
- $values_combo_box[4] =
$this->bo->get_criteria_list($this->criteria_id);
+ $values_combo_box[5] =
$this->bo->get_criteria_list($this->criteria_id);
$default_value = array
('id'=>'','name'=>lang('no criteria'));
- array_unshift
($values_combo_box[4],$default_value);
+ array_unshift
($values_combo_box[5],$default_value);
- $values_combo_box[5] =
$this->bo->get_user_list($this->filter);
- array_unshift
($values_combo_box[5],array('id'=>$GLOBALS['phpgw_info']['user']['account_id'],'name'=>lang('mine
projects')));
+ $values_combo_box[6] =
$this->bo->get_user_list($this->filter);
+ array_unshift
($values_combo_box[6],array('id'=>$GLOBALS['phpgw_info']['user']['account_id'],'name'=>lang('mine
projects')));
$default_value = array
('id'=>'','name'=>lang('no user'));
- array_unshift
($values_combo_box[5],$default_value);
+ array_unshift
($values_combo_box[6],$default_value);
$datatable['actions']['form'] = array
@@ -298,12 +305,21 @@
(
array
( //boton
DISTRICT
+ 'id' =>
'btn_project_type',
+ 'name'
=> 'project_type_id',
+ 'value'
=> lang('project type'),
+ 'type'
=> 'button',
+ 'style'
=> 'filter',
+
'tab_index' => 1
+ ),
+ array
+ ( //boton
DISTRICT
'id' =>
'btn_district_id',
'name'
=> 'district_id',
'value'
=> lang('district'),
'type'
=> 'button',
'style'
=> 'filter',
-
'tab_index' => 1
+
'tab_index' => 2
),
array
( //boton
CATEGORY
@@ -312,7 +328,7 @@
'value'
=> lang('Category'),
'type'
=> 'button',
'style'
=> 'filter',
-
'tab_index' => 2
+
'tab_index' => 3
),
array
( //boton
STATUS
@@ -321,7 +337,7 @@
'value'
=> lang('Status'),
'type'
=> 'button',
'style'
=> 'filter',
-
'tab_index' => 3
+
'tab_index' => 4
),
array
( //boton
HOUR CATEGORY
@@ -330,7 +346,7 @@
'value'
=> lang('Hour category'),
'type'
=> 'button',
'style'
=> 'filter',
-
'tab_index' => 4
+
'tab_index' => 5
),
array
( //boton
search criteria
@@ -339,7 +355,7 @@
'value'
=> lang('search criteria'),
'type'
=> 'button',
'style'
=> 'filter',
-
'tab_index' => 5
+
'tab_index' => 6
),/*
array
( //boton
USER
@@ -348,7 +364,7 @@
'value'
=> lang('User'),
'type'
=> 'button',
'style'
=> 'filter',
-
'tab_index' => 5
+
'tab_index' => 6
),*/
array
(
//boton USER
@@ -358,9 +374,9 @@
'value' => lang('User'),
'type' => 'select',
'style' => 'filter',
-
'values' => $values_combo_box[5],
+
'values' => $values_combo_box[6],
'onchange'=> 'onChangeSelect("filter");',
-
'tab_index' => 6
+
'tab_index' => 7
),
//for link
"columns", next to Export button
array
@@ -373,21 +389,21 @@
'menuaction' => 'property.uiproject.columns'
))."','','width=300,height=600,scrollbars=1')",
'value'
=> lang('columns'),
-
'tab_index' => 12
+
'tab_index' => 13
),
array
(
'type'
=> 'button',
'id'
=> 'btn_export',
'value'
=> lang('download'),
-
'tab_index' => 11
+
'tab_index' => 12
),
array
(
'type'
=> 'button',
'id'
=> 'btn_new',
'value'
=> lang('add'),
-
'tab_index' => 10
+
'tab_index' => 11
),
array
( //hidden
start_date
@@ -415,7 +431,7 @@
'menuaction' => 'property.uiproject.date_search')
)."','','width=350,height=250')",
'value'
=> lang('Date search'),
-
'tab_index' => 9
+
'tab_index' => 10
),
// FIXME test
on lightbox for date search
/*
@@ -434,7 +450,7 @@
'name'
=> 'search',
'value'
=> lang('search'),
'type'
=> 'button',
-
'tab_index' => 8
+
'tab_index' => 9
),
array
( // TEXT INPUT
@@ -444,7 +460,7 @@
'type'
=> 'text',
'onkeypress' => 'return pulsar(event)',
'size'
=> 28,
-
'tab_index' => 7
+
'tab_index' => 8
),
),
'hidden_value' => array
@@ -457,12 +473,12 @@
array
( //div values
combo_box_1
'id' =>
'values_combo_box_1',
- 'value'
=> $this->bocommon->select2String($values_combo_box[1]['cat_list'], 'cat_id')
//i.e. id,value/id,vale/
+ 'value'
=> $this->bocommon->select2String($values_combo_box[1])
),
array
( //div values
combo_box_2
'id' =>
'values_combo_box_2',
- 'value'
=> $this->bocommon->select2String($values_combo_box[2])
+ 'value'
=> $this->bocommon->select2String($values_combo_box[2]['cat_list'], 'cat_id')
//i.e. id,value/id,vale/
),
array
( //div values
combo_box_3
@@ -473,6 +489,11 @@
( //div values
combo_box_4
'id' =>
'values_combo_box_4',
'value'
=> $this->bocommon->select2String($values_combo_box[4])
+ ),
+ array
+ ( //div values
combo_box_5
+ 'id' =>
'values_combo_box_5',
+ 'value'
=> $this->bocommon->select2String($values_combo_box[5])
)/*,
array
( //div values
combo_box_5
@@ -1427,7 +1448,7 @@
$values['origin'] = '';
}
- if(!isset($values['workorder_budget']) && $save
&& !$_transfer_new_project)
+ if(!isset($values['workorder_budget']) && $save
&& !$_transfer_new_project && !$values['project_type_id']==3)
{
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
'property.uiworkorder.edit', 'project_id'=> $id));
}
@@ -1681,14 +1702,20 @@
{
$content_budget = $this->bo->get_budget($id);
$lang_delete = lang('Check to delete period');
- $lang_delete = lang('Check to close period');
+ $lang_close = lang('Check to close period');
+ $lang_active = lang('Check to activate period');
+
foreach($content_budget as & $b_entry)
{
$checked = $b_entry['closed'] ?
'checked="checked"' : '';
-
+ $checked2 = $b_entry['active'] ?
'checked="checked"' : '';
+
+ $b_entry['flag_active'] =
$b_entry['active'];
$b_entry['delete_year'] = "<input
type='checkbox' name='values[delete_b_period][]'
value='{$b_entry['year']}_{$b_entry['month']}' title='{$lang_delete}'>";
$b_entry['closed'] = "<input
type='checkbox' name='values[closed_b_period][]'
value='{$b_entry['year']}_{$b_entry['month']}' title='{$lang_close}' $checked>";
$b_entry['closed_orig'] = "<input
type='checkbox' name='values[closed_orig_b_period][]'
value='{$b_entry['year']}_{$b_entry['month']}' $checked>";
+ $b_entry['active'] = "<input
type='checkbox' name='values[active_b_period][]'
value='{$b_entry['year']}_{$b_entry['month']}' title='{$lang_active}'
$checked2>";
+ $b_entry['active_orig'] = "<input
type='checkbox' name='values[active_orig_b_period][]'
value='{$b_entry['year']}_{$b_entry['month']}' $checked2>";
$value_remainder -=
$b_entry['sum_orders'];
$value_remainder -=
$b_entry['actual_cost'];
}
@@ -1724,9 +1751,19 @@
array('key' =>
'deviation_percent','label'=>lang('deviation') . '::' .
lang('percent'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterAmount2'),
array('key' =>
'closed','label'=>lang('closed'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterCenter'),
array('key' => 'closed_orig','hidden' => true),
+
array('key' =>
'active','label'=>lang('active'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterCenter'),
+
array('key' => 'active_orig','hidden' => true),
+
array('key' => 'flag_active','hidden' => true),
array('key' =>
'delete_year','label'=>lang('Delete'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterCenter')))
);
+/*
+
array('key' => 'subtract_sum_orders','hidden'
=> true),
+
array('key' => 'subtract_actual_cost','hidden'
=> true),
+
array('key' => 'subtract_budget','hidden' =>
true),
+
+*/
+
//_debug_array($values['workorder_budget']);die();
$datavalues[1] = array
(
@@ -1884,8 +1921,31 @@
$periodization_list =
$this->bo->get_periodizations_with_outline();
+ $sub_entry_action_data = array();
+
+ if($id && !$values['project_type_id']==3)
+ {
+ $sub_entry_action_data = array
+ (
+ 'menuaction' =>
'property.uiworkorder.edit',
+ 'project_id' => $id
+ );
+ }
+ else if($id && $values['project_type_id']==3)
+ {
+ $sub_entry_action_data = array
+ (
+ 'menuaction' =>
'property.uiproject.edit',
+ 'bypass' => 1,
+ 'parent_id' => $id,
+ 'origin' => '.project',
+ 'origin_id' => $id
+ );
+ }
+
$data = array
(
+ 'project_types'
=> array('options' =>
$this->bo->get_project_types($values['project_type_id'])),
'inherit_location'
=> $id ? $values['inherit_location'] : 1,
'mode'
=> $mode,
'suppressmeter'
=> isset($config->config_data['project_suppressmeter']) &&
$config->config_data['project_suppressmeter'] ? 1 : '',
@@ -1912,9 +1972,11 @@
'lang_delete_request_statustext'
=> lang('Check to delete this request from this project'),
'link_select_request'
=> $GLOBALS['phpgw']->link('/index.php',$link_request_data),
'link_request'
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uirequest.view')),
- 'add_workorder_action'
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uiworkorder.edit')),
- 'lang_add_workorder'
=> lang('Add workorder'),
- 'lang_add_workorder_statustext'
=> lang('Add a workorder to this project'),
+
+ 'add_sub_entry_action'
=> $GLOBALS['phpgw']->link('/index.php', $sub_entry_action_data ),
+
+ 'lang_add_sub_entry'
=> $values['project_type_id']==3 ? lang('add project') : lang('Add
workorder'),
+ 'lang_add_sub_entry_statustext'
=> $values['project_type_id']==3 ? lang('add a project to this buffer') :
lang('Add a workorder to this project'),
'lang_no_workorders'
=> lang('No workorder budget'),
'workorder_link'
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uiworkorder.edit')),
'record_history'
=> $record_history,
@@ -2128,6 +2190,7 @@
{
$ids =
array_values(explode(',',trim($id_to_update,',')));
}
+
else
{
$ids = array();
@@ -2281,6 +2344,7 @@
function view()
{
+
if(!$this->acl_read)
{
$this->bocommon->no_access();
@@ -2422,7 +2486,7 @@
'myColumnDefs'
=> $myColumnDefs,
'myButtons'
=> $myButtons,
'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
- 'add_workorder_action'
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uiworkorder.edit')),
+ 'add_sub_entry_action'
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uiworkorder.edit')),
'lang_start_date_statustext' =>
lang('Select the estimated end date for the Project'),
'lang_start_date'
=> lang('Project start date'),
'value_start_date'
=> $values['start_date'],
Modified: branches/Version-1_0-branch/property/js/yahoo/project.edit.js
===================================================================
--- branches/Version-1_0-branch/property/js/yahoo/project.edit.js
2012-12-19 07:44:29 UTC (rev 10611)
+++ branches/Version-1_0-branch/property/js/yahoo/project.edit.js
2012-12-19 07:54:58 UTC (rev 10612)
@@ -90,14 +90,37 @@
}
/********************************************************************************/
+
+ this.getTotalSum_active =
function(name_column,round,paginator,datatable)
+ {
+ if(!paginator.getPageRecords())
+ {
+ return '0,00';
+ }
+ begin = end = 0;
+ end = datatable.getRecordSet().getLength();
+
+ tmp_sum = 0;
+ for(i = begin; i < end; i++)
+ {
+
if(datatable.getRecordSet().getRecords(0)[i].getData('flag_active'))
+ {
+ tmp_sum = tmp_sum +
parseFloat(datatable.getRecordSet().getRecords(0)[i].getData(name_column));
+ }
+ }
+
+ return tmp_sum = YAHOO.util.Number.format(tmp_sum,
{decimalPlaces:round, decimalSeparator:",", thousandsSeparator:" "});
+ }
+
+
this.addFooterDatatable0 = function(paginator,datatable)
{
//call getTotalSum(name of column) in property.js
- tmp_sum1 = getTotalSum('budget',0,paginator,datatable);
- tmp_sum2 = getTotalSum('sum_orders',0,paginator,datatable);
- tmp_sum3 = getTotalSum('actual_cost',0,paginator,datatable);
- tmp_sum4 = getTotalSum('diff',0,paginator,datatable);
- tmp_sum5 = getTotalSum('deviation',0,paginator,datatable);
+ tmp_sum1 = getTotalSum_active('budget',0,paginator,datatable);
+ tmp_sum2 =
getTotalSum_active('sum_orders',0,paginator,datatable);
+ tmp_sum3 =
getTotalSum_active('actual_cost',0,paginator,datatable);
+ tmp_sum4 = getTotalSum_active('diff',0,paginator,datatable);
+ tmp_sum5 =
getTotalSum_active('deviation',0,paginator,datatable);
if(typeof(tableYUI0)=='undefined')
{
@@ -119,7 +142,7 @@
td_sum(tmp_sum3);
td_sum(tmp_sum4);
td_sum(tmp_sum5);
- td_empty(4);
+ td_empty(7);
myfoot = tableYUI0.createTFoot();
myfoot.setAttribute("id","myfoot");
Modified: branches/Version-1_0-branch/property/js/yahoo/project.index.js
===================================================================
--- branches/Version-1_0-branch/property/js/yahoo/project.index.js
2012-12-19 07:44:29 UTC (rev 10611)
+++ branches/Version-1_0-branch/property/js/yahoo/project.index.js
2012-12-19 07:54:58 UTC (rev 10612)
@@ -2,14 +2,15 @@
// Declaration of location.index vars
//--------------------------------------------------------
//define SelectButton
- var oMenuButton_0, oMenuButton_1, oMenuButton_2, oMenuButton_3,
oMenuButton_4;
+ var oMenuButton_0, oMenuButton_1, oMenuButton_2, oMenuButton_3,
oMenuButton_4, oMenuButton_5;
var selectsButtons = [
- {order:0,
var_URL:'district_id',name:'btn_district_id',style:'districtbutton',dependiente:''},
- {order:1,
var_URL:'cat_id',name:'btn_cat_id',style:'categorybutton',dependiente:''},
- {order:2,
var_URL:'status_id',name:'btn_status_id',style:'districtbutton',dependiente:''},
- {order:3,
var_URL:'wo_hour_cat_id',name:'btn_hour_category_id',style:'partOFTownbutton',dependiente:''},
+ {order:0,
var_URL:'project_type_id',name:'btn_project_type',style:'districtbutton',dependiente:''},
+ {order:1,
var_URL:'district_id',name:'btn_district_id',style:'districtbutton',dependiente:''},
+ {order:2,
var_URL:'cat_id',name:'btn_cat_id',style:'categorybutton',dependiente:''},
+ {order:3,
var_URL:'status_id',name:'btn_status_id',style:'districtbutton',dependiente:''},
+ {order:4,
var_URL:'wo_hour_cat_id',name:'btn_hour_category_id',style:'partOFTownbutton',dependiente:''},
// {order:4, var_URL:'filter',
name:'btn_user_id',style:'ownerIdbutton',dependiente:''},
- {order:4, var_URL:'criteria_id',
name:'btn_criteria_id',style:'criteriabutton',dependiente:''}
+ {order:5, var_URL:'criteria_id',
name:'btn_criteria_id',style:'criteriabutton',dependiente:''}
];
// define buttons
@@ -81,41 +82,48 @@
{
if(flag_particular_setting=='init')
{
- //district
- index =
locate_in_array_options(0,"value",path_values.district_id);
+ //project_type
+ index =
locate_in_array_options(0,"value",path_values.project_type_id);
if(index)
{
oMenuButton_0.set("label", ("<em>" +
array_options[0][index][1] + "</em>"));
}
- //category
- index =
locate_in_array_options(1,"value",path_values.cat_id);
+ //district
+ index =
locate_in_array_options(1,"value",path_values.district_id);
if(index)
{
oMenuButton_1.set("label", ("<em>" +
array_options[1][index][1] + "</em>"));
}
- //status
- index =
locate_in_array_options(2,"value",path_values.status_id);
+ //category
+ index =
locate_in_array_options(2,"value",path_values.cat_id);
if(index)
{
oMenuButton_2.set("label", ("<em>" +
array_options[2][index][1] + "</em>"));
}
- //wo_hour_cat_id
- index =
locate_in_array_options(3,"value",path_values.wo_hour_cat_id);
+ //status
+ index =
locate_in_array_options(3,"value",path_values.status_id);
if(index)
{
oMenuButton_3.set("label", ("<em>" +
array_options[3][index][1] + "</em>"));
}
- //criteria
- index =
locate_in_array_options(4,"value",path_values.criteria_id);
+ //wo_hour_cat_id
+ index =
locate_in_array_options(4,"value",path_values.wo_hour_cat_id);
if(index)
{
oMenuButton_4.set("label", ("<em>" +
array_options[4][index][1] + "</em>"));
}
+ //criteria
+ index =
locate_in_array_options(5,"value",path_values.criteria_id);
+ if(index)
+ {
+ oMenuButton_5.set("label", ("<em>" +
array_options[5][index][1] + "</em>"));
+ }
+
/*
//user
index =
locate_in_array_options(4,"value",path_values.user_id);
Modified: branches/Version-1_0-branch/property/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/property/setup/phpgw_no.lang 2012-12-19
07:44:29 UTC (rev 10611)
+++ branches/Version-1_0-branch/property/setup/phpgw_no.lang 2012-12-19
07:54:58 UTC (rev 10612)
@@ -227,6 +227,7 @@
billable rate changed property no Fakturerbar sats endret
billable hours has been updated property no Egne timer er
oppdatert
bill per unit property no Pris pr enhet, ex mva
+buffer property no Buffer
bulk update status property no Masseoppdatering av status
branch property no Fag
b - responsible property no Anviser
@@ -1164,6 +1165,7 @@
open edit in new window property no Åpne endring i nytt
vindu
open JasperReport %1 in new window property no Åpne
JasperReport %1 i nytt vindu
open view in new window property no Åpne visning i nytt
vindu
+operation property no Drift
order property no Bestilling
order approval revoked property no Bestillingsgodkjenning opphevet
order approved property no Bestilling godkjent
@@ -1294,6 +1296,7 @@
prizing property no Priser
probability property no Sannsynlighet
project property no prosjekt
+project type property no Prosjekt type
.project property no Prosjekt
project.condition_survey property no Tilstandsanalyse
project.workorder property no Prosjekt::Bestilling
Modified: branches/Version-1_0-branch/property/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/setup.inc.php 2012-12-19
07:44:29 UTC (rev 10611)
+++ branches/Version-1_0-branch/property/setup/setup.inc.php 2012-12-19
07:54:58 UTC (rev 10612)
@@ -12,7 +12,7 @@
*/
$setup_info['property']['name'] = 'property';
- $setup_info['property']['version'] = '0.9.17.657';
+ $setup_info['property']['version'] = '0.9.17.658';
$setup_info['property']['app_order'] = 8;
$setup_info['property']['enable'] = 1;
$setup_info['property']['app_group'] = 'office';
Modified: branches/Version-1_0-branch/property/setup/tables_current.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/tables_current.inc.php
2012-12-19 07:44:29 UTC (rev 10611)
+++ branches/Version-1_0-branch/property/setup/tables_current.inc.php
2012-12-19 07:54:58 UTC (rev 10612)
@@ -1481,6 +1481,8 @@
'fm_project' => array(
'fd' => array(
'id' => array('type' => 'int','precision' =>
'4','nullable' => False),
+ 'parent_id' => array('type' =>
'int','precision' => '4','nullable' => true),
+ 'project_type_id' => array('type' =>
'int','precision' => '2','nullable' => true),
'name' => array('type' => 'varchar','precision'
=> '255','nullable' => False),
'user_id' => array('type' => 'int','precision'
=> '4','nullable' => False),
'access' => array('type' =>
'varchar','precision' => '7','nullable' => True),
@@ -1530,6 +1532,7 @@
'budget' => array('type' =>
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' =>
'0.00'),
'order_amount' => array('type' =>
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' =>
'0.00'),
'closed' => array('type' => 'int','precision'
=> 2,'nullable' => True),
+ 'active' => array('type' => 'int','precision'
=> 2,'nullable' => True),
'user_id' => array('type' => 'int','precision'
=> 4,'nullable' => True),
'entry_date' => array('type' =>
'int','precision' => 4,'nullable' => True),
'modified_date' => array('type' =>
'int','precision' => 4,'nullable' => True)
@@ -1539,6 +1542,23 @@
'ix' => array(),
'uc' => array()
),
+ 'fm_project_buffer_budget' => array(
+ 'fd' => array(
+ 'id' => array('type' => 'auto','precision' =>
'4','nullable' => False),
+ 'buffer_project_id' => array('type' =>
'int','precision' => '4','nullable' => False),
+ 'entry_date' => array('type' =>
'int','precision' => '4','nullable' => False),
+ 'amount_in' => array('type' =>
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' =>
'0.00'),
+ 'from_project' => array('type' =>
'int','precision' => '4','nullable' => true),
+ 'amount_out' => array('type' =>
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' =>
'0.00'),
+ 'to_project' => array('type' =>
'int','precision' => '4','nullable' => true),
+ 'user_id' => array('type' => 'int','precision'
=> '4','nullable' => False),
+ 'remark' => array('type' => 'text','nullable'
=> true),
+ ),
+ 'pk' => array('id'),
+ 'fk' => array(),
+ 'ix' => array(),
+ 'uc' => array()
+ ),
'fm_project_group' => array(
'fd' => array(
'id' => array('type' => 'int','precision' =>
'4','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
2012-12-19 07:44:29 UTC (rev 10611)
+++ branches/Version-1_0-branch/property/setup/tables_update.inc.php
2012-12-19 07:54:58 UTC (rev 10612)
@@ -7011,3 +7011,61 @@
return $GLOBALS['setup_info']['property']['currentver'];
}
}
+
+ /**
+ * Update property version from 0.9.17.657 to 0.9.17.658
+ * Add project types
+ */
+ $test[] = '0.9.17.657';
+ function property_upgrade0_9_17_657()
+ {
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_project','parent_id',array(
+ 'type' => 'int',
+ 'precision' => 4,
+ 'nullable' => true
+ )
+ );
+
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_project','project_type_id',array(
+ 'type' => 'int',
+ 'precision' => 2,
+ 'nullable' => true
+ )
+ );
+
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_project_budget','active',array(
+ 'type' => 'int',
+ 'precision' => 2,
+ 'nullable' => true
+ )
+ );
+
+ $GLOBALS['phpgw_setup']->oProc->CreateTable(
+ 'fm_project_buffer_budget', array(
+ 'fd' => array(
+ 'id' => array('type' =>
'auto','precision' => '4','nullable' => False),
+ 'buffer_project_id' => array('type' =>
'int','precision' => '4','nullable' => False),
+ 'entry_date' => array('type' =>
'int','precision' => '4','nullable' => False),
+ 'amount_in' => array('type' =>
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' =>
'0.00'),
+ 'from_project' => array('type' =>
'int','precision' => '4','nullable' => true),
+ 'amount_out' => array('type' =>
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' =>
'0.00'),
+ 'to_project' => array('type' =>
'int','precision' => '4','nullable' => true),
+ 'user_id' => array('type' =>
'int','precision' => '4','nullable' => False),
+ 'remark' => array('type' =>
'text','nullable' => true),
+ ),
+ 'pk' => array('id'),
+ 'fk' => array(),
+ 'ix' => array(),
+ 'uc' => array()
+ )
+ );
+
+
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
+ $GLOBALS['setup_info']['property']['currentver'] =
'0.9.17.658';
+ return $GLOBALS['setup_info']['property']['currentver'];
+ }
+ }
Modified: branches/Version-1_0-branch/property/templates/base/project.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/project.xsl
2012-12-19 07:44:29 UTC (rev 10611)
+++ branches/Version-1_0-branch/property/templates/base/project.xsl
2012-12-19 07:54:58 UTC (rev 10612)
@@ -36,9 +36,9 @@
<script type="text/javascript">
self.name="first_Window";
<xsl:value-of select="lookup_functions"/>
- function add_workorder()
+ function add_sub_entry()
{
- document.add_workorder_form.submit();
+ document.add_sub_entry_form.submit();
}
</script>
<table cellpadding="2" cellspacing="2" align="center">
@@ -54,12 +54,12 @@
<xsl:choose>
<xsl:when test="value_project_id > 0 and
mode='edit'">
<td valign="top">
- <xsl:variable
name="lang_add_workorder">
- <xsl:value-of
select="lang_add_workorder"/>
+ <xsl:variable
name="lang_add_sub_entry">
+ <xsl:value-of
select="lang_add_sub_entry"/>
</xsl:variable>
- <input type="button"
name="add_workorder" value="{$lang_add_workorder}" onClick="add_workorder()">
+ <input type="button"
name="add_sub_entry" value="{$lang_add_sub_entry}" onClick="add_sub_entry()">
<xsl:attribute
name="title">
- <xsl:value-of
select="lang_add_workorder_statustext"/>
+ <xsl:value-of
select="lang_add_sub_entry_statustext"/>
</xsl:attribute>
</input>
</td>
@@ -169,6 +169,22 @@
</xsl:choose>
<tr>
<td
valign="top">
+
<xsl:value-of select="php:function('lang', 'project type')"/>
+ </td>
+ <td>
+ <select
name="values[project_type_id]">
+
<xsl:attribute name="title">
+
<xsl:value-of select="php:function('lang', 'project type')"/>
+
</xsl:attribute>
+
<option value="0">
+
<xsl:value-of select="php:function('lang', 'select')"/>
+
</option>
+
<xsl:apply-templates select="project_types/options"/>
+
</select>
+ </td>
+ </tr>
+ <tr>
+ <td
valign="top">
<xsl:value-of select="lang_name"/>
</td>
<td>
@@ -714,8 +730,8 @@
<!-- AQUI VA EL SCRIPT -->
<xsl:choose>
<xsl:when test="mode='edit'">
- <xsl:variable
name="add_workorder_action"><xsl:value-of
select="add_workorder_action"/>&project_id=<xsl:value-of
select="value_project_id"/></xsl:variable>
- <form method="post" name="add_workorder_form"
action="{$add_workorder_action}">
+ <xsl:variable
name="add_sub_entry_action"><xsl:value-of
select="add_sub_entry_action"/></xsl:variable>
+ <form method="post" name="add_sub_entry_form"
action="{$add_sub_entry_action}">
</form>
</xsl:when>
</xsl:choose>
Modified: branches/Version-1_0-branch/property/templates/base/request.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/request.xsl
2012-12-19 07:44:29 UTC (rev 10611)
+++ branches/Version-1_0-branch/property/templates/base/request.xsl
2012-12-19 07:54:58 UTC (rev 10612)
@@ -173,24 +173,6 @@
<dd>
<xsl:value-of select="value_request_id"/>
</dd>
-
<xsl:choose>
-
<xsl:when test="mode ='edit'">
-
<xsl:call-template name="location_form2"/>
-
</xsl:when>
-
<xsl:otherwise>
-
<xsl:call-template name="location_view2"/>
-
<xsl:choose>
-
<xsl:when test="contact_phone !=''">
-
<dt><label>
-
<xsl:value-of
select="lang_contact_phone"/>
-
</label></dt>
-
<dd>
-
<xsl:value-of select="contact_phone"/>
-
</dd>
-
</xsl:when>
-
</xsl:choose>
-
</xsl:otherwise>
-
</xsl:choose>
<dt><label>
<xsl:value-of select="php:function('lang', 'entry date')"/>
@@ -293,6 +275,26 @@
</dd>
</xsl:for-each>
+
+ <xsl:choose>
+ <xsl:when
test="mode ='edit'">
+
<xsl:call-template name="location_form2"/>
+ </xsl:when>
+ <xsl:otherwise>
+
<xsl:call-template name="location_view2"/>
+
<xsl:choose>
+
<xsl:when test="contact_phone !=''">
+
<dt><label>
+
<xsl:value-of select="lang_contact_phone"/>
+
</label></dt>
+
<dd>
+
<xsl:value-of select="contact_phone"/>
+
</dd>
+
</xsl:when>
+
</xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+
<xsl:variable
name="lang_request_title">
<xsl:value-of
select="php:function('lang', 'enter request title')"/>
</xsl:variable>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [10612] Merge 10600:10611 from trunk,
Sigurd Nes <=