[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [8602] Merge 8596:8601 from trunk
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [8602] Merge 8596:8601 from trunk |
Date: |
Wed, 18 Jan 2012 12:26:22 +0000 |
Revision: 8602
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8602
Author: sigurdne
Date: 2012-01-18 12:26:21 +0000 (Wed, 18 Jan 2012)
Log Message:
-----------
Merge 8596:8601 from trunk
Modified Paths:
--------------
branches/Version-1_0-branch/controller/inc/class.socase.inc.php
branches/Version-1_0-branch/controller/inc/class.socheck_item.inc.php
branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php
branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php
branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php
branches/Version-1_0-branch/controller/inc/class.socontrol_item_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/class.uicheck_list_for_location.inc.php
branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
branches/Version-1_0-branch/controller/inc/component/class.calendar_builder.inc.php
branches/Version-1_0-branch/controller/inc/component/class.date_generator.inc.php
branches/Version-1_0-branch/controller/inc/helper/class.location_finder.inc.php
branches/Version-1_0-branch/controller/inc/helper/class.status_checker.inc.php
branches/Version-1_0-branch/controller/inc/model/class.check_list.inc.php
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_month.xsl
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_year.xsl
branches/Version-1_0-branch/controller/templates/base/check_list/edit_check_list.xsl
branches/Version-1_0-branch/controller/templates/base/check_list/register_case.xsl
branches/Version-1_0-branch/controller/templates/base/check_list/view_closed_cases.xsl
branches/Version-1_0-branch/controller/templates/base/check_list/view_measurements.xsl
branches/Version-1_0-branch/controller/templates/base/check_list/view_open_cases.xsl
branches/Version-1_0-branch/controller/templates/base/css/base.css
branches/Version-1_0-branch/property/inc/cron/default/Import_fra_basware_X205.php
Added Paths:
-----------
branches/Version-1_0-branch/controller/inc/helper/class.date_helper.inc.php
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list.xsl
Removed Paths:
-------------
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list_for_location.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
+
/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
Modified: branches/Version-1_0-branch/controller/inc/class.socase.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socase.inc.php
2012-01-18 12:24:33 UTC (rev 8601)
+++ branches/Version-1_0-branch/controller/inc/class.socase.inc.php
2012-01-18 12:26:21 UTC (rev 8602)
@@ -125,7 +125,7 @@
$values = array(
$this->marshal($case->get_check_item_id(),
'int'),
- $this->marshal($case->get_status(), 'int'),
+ $case->get_status(),
$this->marshal($case->get_location_id(), 'int'),
$this->marshal($case->get_location_item_id(),
'int'),
$this->marshal($case->get_descr(), 'string'),
@@ -143,10 +143,10 @@
function update($case)
{
$id = $case->get_id();
-
+
$values = array(
'check_item_id = ' .
$this->marshal($case->get_check_item_id(), 'int'),
- 'status = ' . $case->get_status(),
+ 'status = ' .
$this->marshal($case->get_status(), 'int'),
'location_id = ' .
$this->marshal($case->get_location_id(), 'int'),
'location_item_id = ' .
$this->marshal($case->get_location_item_id(), 'int'),
'descr = ' . $this->marshal($case->get_descr(),
'string'),
Modified: branches/Version-1_0-branch/controller/inc/class.socheck_item.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socheck_item.inc.php
2012-01-18 12:24:33 UTC (rev 8601)
+++ branches/Version-1_0-branch/controller/inc/class.socheck_item.inc.php
2012-01-18 12:26:21 UTC (rev 8602)
@@ -61,7 +61,6 @@
'status',
'comment',
'check_list_id',
- 'message_ticket_id',
'measurement'
);
@@ -135,7 +134,7 @@
}
}
- public function get_single_with_cases($check_item_id,
$returnType = "return_object"){
+ public function get_single_with_cases($check_item_id,
$return_type = "return_object"){
$sql = "SELECT ci.id as ci_id, ci.status as ci_status,
control_item_id, ci.comment, ci.measurement, check_list_id, ";
$sql .= "cic.id as cic_id, cic.status as cic_status,
cic.*, ";
$sql .= "coi.id as coi_id, coi.* ";
@@ -167,7 +166,7 @@
$control_item->set_control_group_id($this->db->f('control_group_id', true),
'string');
$control_item->set_type($this->db->f('type', true), 'string');
- if($returnType == "return_array")
+ if($return_type == "return_array")
$check_item->set_control_item($control_item->toArray());
else
$check_item->set_control_item($control_item);
@@ -188,7 +187,7 @@
$case->set_modified_by($this->unmarshal($this->db->f('modified_by', true),
'int'));
- if($returnType == "return_array")
+ if($return_type == "return_array")
$cases_array[] =
$case->toArray();
else
$cases_array[] = $case;
@@ -201,7 +200,7 @@
if($check_item != null){
$check_item->set_cases_array($cases_array);
- if($returnType == "return_array")
+ if($return_type == "return_array")
return $check_item->toArray();
else
return $check_item;
@@ -244,7 +243,7 @@
}
}
- public function get_check_items($check_list_id, $status, $type){
+ public function get_check_items($check_list_id, $status, $type,
$return_type = "return_object"){
$sql = "SELECT ci.id as ci_id, ci.status,
control_item_id, ci.comment, ci.measurement, check_list_id, ";
$sql .= "coi.id as coi_id, coi.title, coi.required,
coi.what_to_do, coi.how_to_do, coi.control_group_id, coi.type ";
$sql .= "FROM controller_check_item ci ";
@@ -258,7 +257,7 @@
if($type != null)
$sql .= "AND coi.type = '$type'";
-
+
$this->db->query($sql);
while ($this->db->next_record()) {
@@ -277,16 +276,22 @@
$control_item->set_control_group_id($this->db->f('control_group_id', true),
'string');
$control_item->set_type($this->db->f('type',
true), 'string');
-
$check_item->set_control_item($control_item->toArray());
-
- $check_items_array[] = $check_item->toArray();
+ if($return_type == "return_array"){
+
$check_item->set_control_item($control_item->toArray());
+ $check_items_array[] =
$check_item->toArray();
+ }
+ else{
+
$check_item->set_control_item($control_item);
+ $check_items_array[] = $check_item;
+ }
}
return $check_items_array;
}
- public function get_check_items_with_cases($check_list_id,
$status = "open", $messageStatus = null, $returnType = "return_object"){
- $sql = "SELECT ci.id as ci_id, ci.status,
control_item_id, ci.comment, ci.measurement, check_list_id, cic.id as cic_id,
cic.*, ";
+ public function get_check_items_with_cases($check_list_id,
$status = "open", $messageStatus = null, $return_type = "return_object"){
+ $sql = "SELECT ci.id as ci_id, ci.status as ci_status,
control_item_id, ci.comment, ci.measurement, check_list_id, ";
+ $sql .= "cic.id as cic_id, cic.status as cic_status,
cic.*, ";
$sql .= "coi.id as coi_id, coi.* ";
$sql .= "FROM controller_check_item ci ";
$sql .= "LEFT JOIN controller_control_item as coi ON
ci.control_item_id = coi.id ";
@@ -314,7 +319,7 @@
if($check_item_id != 0){
$check_item->set_cases_array($cases_array);
- if($returnType ==
"return_array")
+ if($return_type ==
"return_array")
$check_items_array[] =
$check_item->toArray();
else
$check_items_array[] =
$check_item;
@@ -322,7 +327,7 @@
$check_item = new
controller_check_item($this->unmarshal($this->db->f('ci_id', true), 'int'));
$check_item->set_control_item_id($this->unmarshal($this->db->f('control_item_id',
true), 'int'));
-
$check_item->set_status($this->unmarshal($this->db->f('status', true), 'bool'));
+
$check_item->set_status($this->db->f('ci_status', true), 'int');
$check_item->set_comment($this->unmarshal($this->db->f('comment', true),
'string'));
$check_item->set_check_list_id($this->unmarshal($this->db->f('check_list_id',
true), 'int'));
$check_item->set_measurement($this->unmarshal($this->db->f('measurement',
true), 'int'));
@@ -335,14 +340,18 @@
$control_item->set_control_group_id($this->db->f('control_group_id', true),
'string');
$control_item->set_type($this->db->f('type', true), 'string');
-
$check_item->set_control_item($control_item->toArray());
-
+ if($return_type == "return_array")
+
$check_item->set_control_item($control_item->toArray());
+ else
+
$check_item->set_control_item($control_item);
+
$cases_array = array();
}
if($this->db->f('cic_id', true) != ''){
$case = new
controller_check_item_case($this->unmarshal($this->db->f('cic_id', true),
'int'));
$case->set_check_item_id($this->unmarshal($this->db->f('check_item_id', true),
'int'));
+
$case->set_status($this->unmarshal($this->db->f('cic_status', true), 'int'));
$case->set_location_id($this->unmarshal($this->db->f('location_id', true),
'int'));
$case->set_location_item_id($this->unmarshal($this->db->f('location_item_id',
true), 'int'));
$case->set_descr($this->unmarshal($this->db->f('descr', true), 'string'));
@@ -352,19 +361,19 @@
$case->set_modified_by($this->unmarshal($this->db->f('modified_by', true),
'int'));
- if($returnType == "return_array")
+ if($return_type == "return_array")
$cases_array[] =
$case->toArray();
else
$cases_array[] = $case;
}
- $check_item_id = $check_item->get_id();
+ $check_item_id = $check_item->get_id();
}
if($check_item != null){
$check_item->set_cases_array($cases_array);
- if($returnType == "return_array")
+ if($return_type == "return_array")
$check_items_array[] =
$check_item->toArray();
else
$check_items_array[] = $check_item;
@@ -375,7 +384,7 @@
}
}
- public function
get_check_items_with_cases_by_message($message_ticket_id, $returnType =
"return_object"){
+ public function
get_check_items_with_cases_by_message($message_ticket_id, $return_type =
"return_object"){
$sql = "SELECT ci.id as ci_id, ci.status as ci_status,
control_item_id, ci.comment, ci.measurement, ";
$sql .= "check_list_id, cic.id as cic_id, cic.status as
cic_status, cic.*, ";
$sql .= "coi.id as coi_id, coi.* ";
@@ -395,7 +404,7 @@
if($check_item_id != 0){
$check_item->set_cases_array($cases_array);
- if($returnType ==
"return_array")
+ if($return_type ==
"return_array")
$check_items_array[] =
$check_item->toArray();
else
$check_items_array[] =
$check_item;
@@ -416,7 +425,7 @@
$control_item->set_control_group_id($this->db->f('control_group_id', true),
'string');
$control_item->set_type($this->db->f('type', true), 'string');
- if($returnType == "return_array")
+ if($return_type == "return_array")
$check_item->set_control_item($control_item->toArray());
else
$check_item->set_control_item($control_item);
@@ -437,7 +446,7 @@
$case->set_modified_by($this->unmarshal($this->db->f('modified_by', true),
'int'));
- if($returnType == "return_array")
+ if($return_type == "return_array")
$cases_array[] =
$case->toArray();
else
$cases_array[] = $case;
@@ -449,7 +458,7 @@
if($check_item != null){
$check_item->set_cases_array($cases_array);
- if($returnType == "return_array")
+ if($return_type == "return_array")
$check_items_array[] =
$check_item->toArray();
else
$check_items_array[] = $check_item;
@@ -460,7 +469,7 @@
}
}
- public function get_check_items_by_message($message_ticket_id,
$returnType = "return_array" ){
+ public function get_check_items_by_message($message_ticket_id,
$return_type = "return_array" ){
$sql = "SELECT ci.* ";
$sql .= "FROM controller_check_item ci ";
$sql .= "LEFT JOIN controller_check_item_case as cic ON
ci.id = cic.check_item_id ";
@@ -476,7 +485,7 @@
$check_item->set_check_list_id($this->unmarshal($this->db->f('check_list_id',
true), 'int'));
$check_item->set_measurement($this->unmarshal($this->db->f('measurement',
true), 'int'));
- if($returnType == "return_array")
+ if($return_type == "return_array")
$check_items_array[] =
$check_item->toArray();
else
$check_items_array[] = $check_item;
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
2012-01-18 12:24:33 UTC (rev 8601)
+++ branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php
2012-01-18 12:26:21 UTC (rev 8602)
@@ -27,6 +27,7 @@
* @subpackage controller
* @version $Id$
*/
+
phpgw::import_class('controller.socommon');
include_class('controller', 'check_list', 'inc/model/');
@@ -52,7 +53,7 @@
public function get_single($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 .= "completed_date, location_code, ci.id as ci_id,
ci.status as ci_status, control_item_id, ";
+ $sql .= "completed_date, location_code, component_id,
num_open_cases, ci.id as ci_id, ci.status as ci_status, control_item_id, ";
$sql .= "ci.comment as ci_comment, check_list_id ";
$sql .= "FROM controller_check_list cl ";
$sql .= "LEFT JOIN controller_check_item as ci ON cl.id =
ci.check_list_id ";
@@ -67,17 +68,19 @@
if($counter == 0){
$check_list = new
controller_check_list($this->unmarshal($this->db->f('cl_id', true), 'int'));
$check_list->set_control_id($this->unmarshal($this->db->f('control_id', true),
'int'));
-
$check_list->set_status($this->unmarshal($this->db->f('cl_status', true),
'bool'));
+
$check_list->set_status($this->unmarshal($this->db->f('cl_status', true),
'int'));
$check_list->set_comment($this->unmarshal($this->db->f('cl_comment', true),
'string'));
$check_list->set_deadline($this->unmarshal($this->db->f('deadline', true),
'int'));
$check_list->set_planned_date($this->unmarshal($this->db->f('planned_date',
true), 'int'));
$check_list->set_completed_date($this->unmarshal($this->db->f('completed_date',
true), 'int'));
-
$check_list->set_location_code($this->unmarshal($this->db->f('location_code',
true), 'int'));
+
$check_list->set_location_code($this->unmarshal($this->db->f('location_code',
true), 'int'));
+
$check_list->set_component_id($this->unmarshal($this->db->f('component_id',
true), 'int'));
+
$check_list->set_num_open_cases($this->unmarshal($this->db->f('num_open_cases',
true), 'int'));
}
$check_item = new
controller_check_item($this->unmarshal($this->db->f('ci_id', true), 'int'));
$check_item->set_control_item_id($this->unmarshal($this->db->f('control_item_id',
true), 'int'));
-
$check_item->set_status($this->unmarshal($this->db->f('ci_status', true),
'bool'));
+
$check_item->set_status($this->unmarshal($this->db->f('ci_status', true),
'int'));
$check_item->set_comment($this->unmarshal($this->db->f('ci_comment', true),
'string'));
$check_item->set_check_list_id($this->unmarshal($this->db->f('check_list_id',
true), 'int'));
@@ -224,7 +227,7 @@
}
$check_list = new
controller_check_list($this->unmarshal($this->db->f('cl_id', true), 'int'));
-
$check_list->set_status($this->unmarshal($this->db->f('cl_status', true),
'bool'));
+
$check_list->set_status($this->unmarshal($this->db->f('cl_status', true),
'int'));
$check_list->set_comment($this->unmarshal($this->db->f('cl_comment', true),
'string'));
$check_list->set_deadline($this->unmarshal($this->db->f('deadline', true),
'int'));
$check_list->set_planned_date($this->unmarshal($this->db->f('planned_date',
true), 'int'));
@@ -238,7 +241,7 @@
$check_item = new
controller_check_item($this->unmarshal($this->db->f('ci_id', true), 'int'));
$check_item->set_control_item_id($this->unmarshal($this->db->f('control_item_id',
true), 'int'));
-
$check_item->set_status($this->unmarshal($this->db->f('ci_status', true),
'bool'));
+
$check_item->set_status($this->unmarshal($this->db->f('ci_status', true),
'int'));
$check_item->set_comment($this->unmarshal($this->db->f('ci_comment', true),
'string'));
$check_item->set_check_list_id($this->unmarshal($this->db->f('check_list_id',
true), 'int'));
@@ -257,7 +260,7 @@
}
}
- function get_agg_check_lists_for_location( $location_code, $from_date,
$to_date ){
+ function get_agg_check_lists_for_location( $location_code,
$from_date_ts, $to_date_ts ){
$sql = "SELECT c.id as c_id, title, start_date, end_date,
cl.id as cl_id, c.repeat_type, c.repeat_interval, cl.deadline, count(ci.id) ";
$sql .= "FROM controller_check_list cl, controller_control c,
controller_check_item ci ";
@@ -266,7 +269,7 @@
$sql .= "AND cl.control_id = c.id ";
$sql .= "AND cl.id = ci.check_list_id ";
$sql .= "AND ci.status = 0 ";
- $sql .= "AND deadline BETWEEN $from_date AND $to_date ";
+ $sql .= "AND deadline BETWEEN $from_date_ts AND $to_date_ts ";
$sql .= "GROUP BY c.id, title, start_date, end_date, cl.id,
cl.deadline, c.repeat_type, c.repeat_interval ";
$sql .= "ORDER BY c.id";
@@ -311,7 +314,32 @@
}
}
- function get_check_lists_for_location( $location_code, $from_date,
$to_date, $repeat_type ){
+ function get_num_open_cases_for_control( $control_id, $location_code,
$from_date_ts, $to_date_ts ){
+
+ $sql = "SELECT c.id as c_id, sum(cl.num_open_cases) as count ";
+ $sql .= "FROM controller_check_list cl, controller_control c ";
+ $sql .= "WHERE cl.location_code = $location_code ";
+ $sql .= "AND c.id = $control_id ";
+ $sql .= "AND c.repeat_type < 2 ";
+ $sql .= "AND cl.control_id = c.id ";
+ $sql .= "AND cl.deadline >= $from_date_ts AND $to_date_ts >
cl.deadline ";
+ $sql .= "GROUP BY c.id";
+
+ $this->db->query($sql);
+
+ if ($this->db->next_record() & $this->db->f('count', true) > 0)
{
+
+ $control_array = array(
+ "id"
=> $this->unmarshal($this->db->f('c_id', true), 'int'),
+ "count"
=> $this->db->f('count', true)
+ );
+ }
+
+
+ return $control_array;
+ }
+
+ function get_check_lists_for_location( $location_code, $from_date_ts,
$to_date_ts, $repeat_type ){
$sql = "SELECT c.id as c_id, title, description, start_date,
end_date, control_area_id, c.location_code as c_location_code, repeat_type,
repeat_interval, ";
$sql .= "cl.id as cl_id, cl.status as cl_status, cl.comment as
cl_comment, deadline, planned_date, completed_date, ";
$sql .= "cl.component_id as cl_component_id, cl.location_code
as cl_location_code, num_open_cases ";
@@ -319,7 +347,7 @@
$sql .= "LEFT JOIN controller_check_list cl on cl.control_id =
c.id ";
$sql .= "WHERE cl.location_code = $location_code ";
$sql .= "AND c.repeat_type = $repeat_type ";
- $sql .= "AND deadline BETWEEN $from_date AND $to_date ";
+ $sql .= "AND deadline BETWEEN $from_date_ts AND $to_date_ts ";
$sql .= "ORDER BY c.id;";
$this->db->query($sql);
@@ -372,7 +400,7 @@
return $controls_array;
}
- function get_check_lists_for_location_2( $location_code, $from_date,
$to_date, $repeat_type ){
+ function get_check_lists_for_location_2( $location_code, $from_date_ts,
$to_date_ts, $repeat_type ){
$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.component_id as cl_component_id, cl.location_code
as cl_location_code, num_open_cases ";
@@ -380,7 +408,7 @@
$sql .= "LEFT JOIN controller_check_list cl on cl.control_id =
c.id ";
$sql .= "WHERE cl.location_code = $location_code ";
$sql .= "AND c.repeat_type = $repeat_type ";
- $sql .= "AND deadline BETWEEN $from_date AND $to_date ";
+ $sql .= "AND deadline BETWEEN $from_date_ts AND $to_date_ts ";
$sql .= "ORDER BY c.id;";
$this->db->query($sql);
@@ -510,7 +538,6 @@
$control->set_responsibility_id($this->unmarshal($this->db->f('responsibility_id',
true), 'int'));
$control->set_control_area_id($this->unmarshal($this->db->f('control_area_id',
true), 'int'));
$control->set_control_area_name($this->unmarshal($this->db->f('control_area_name',
true), 'string'));
-//
$control->set_control_group_id($this->unmarshal($this->db->f('control_group_id',
true), 'int'));
$control->set_equipment_type_id($this->unmarshal($this->db->f('equipment_type_id',
true), 'int'));
$control->set_equipment_id($this->unmarshal($this->db->f('equipment_id', true),
'int'));
$control->set_location_code($this->unmarshal($this->db->f('location_code',
true), 'int'));
@@ -531,17 +558,20 @@
'planned_date',
'completed_date',
'location_code',
+ 'component_id',
+ 'num_open_cases'
);
$values = array(
$this->marshal($check_list->get_control_id(), 'int'),
- $this->marshal($check_list->get_status(), 'bool'),
+ $this->marshal($check_list->get_status(), 'int'),
$this->marshal($check_list->get_comment(), 'string'),
$this->marshal($check_list->get_deadline(), 'int'),
$this->marshal($check_list->get_planned_date(), 'int'),
$this->marshal($check_list->get_completed_date(),
'int'),
$this->marshal($check_list->get_location_code(), 'int'),
-// $this->marshal($check_list->get_equipment_id(), 'int')
+ $this->marshal($check_list->get_component_id(), 'int'),
+ $this->marshal($check_list->get_num_open_cases(), 'int')
);
$result = $this->db->query('INSERT INTO controller_check_list
(' . join(',', $cols) . ') VALUES (' . join(',', $values) . ')',
__LINE__,__FILE__);
@@ -552,16 +582,17 @@
function update($check_list)
{
$id = intval($check_list->get_id());
-
+
$values = array(
'control_id = ' .
$this->marshal($check_list->get_control_id(), 'int'),
- 'status = ' . $this->marshal($check_list->get_status(),
'int'),
+ 'status = ' . $check_list->get_status(),
'comment = ' .
$this->marshal($check_list->get_comment(), 'string'),
'deadline = ' .
$this->marshal($check_list->get_deadline(), 'int'),
'planned_date = ' .
$this->marshal($check_list->get_planned_date(), 'int'),
'completed_date = ' .
$this->marshal($check_list->get_completed_date(), 'int'),
'location_code = ' .
$this->marshal($check_list->get_location_code(), 'int'),
'component_id = ' .
$this->marshal($check_list->get_component_id(), 'int'),
+ 'num_open_cases = ' .
$this->marshal($check_list->get_num_open_cases(), 'int')
);
$result = $this->db->query('UPDATE controller_check_list SET '
. join(',', $values) . " WHERE id=$id", __LINE__,__FILE__);
Modified: branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php
2012-01-18 12:24:33 UTC (rev 8601)
+++ branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php
2012-01-18 12:26:21 UTC (rev 8602)
@@ -108,7 +108,7 @@
}
// Kommenterte denne ut midlertidig.
- //Trenger id-en som ble lagret når controllen blir
lagret.
+ //Trenger id-en når controllen blir lagret.
//return isset($result);
}
@@ -119,7 +119,10 @@
$sql = "SELECT distinct c.* FROM
controller_control_location_list cll ";
$sql .= "LEFT JOIN controller_control c on
cll.control_id=c.id ";
$sql .= "WHERE cll.location_code = $location_code ";
- $sql .= "AND c.repeat_type = $repeat_type ";
+
+ if( is_numeric($repeat_type) )
+ $sql .= "AND c.repeat_type = $repeat_type ";
+
$sql .= "AND (c.start_date <= $from_date AND c.end_date
IS NULL ";
$sql .= "OR c.start_date > $from_date AND c.start_date
< $to_date)";
Modified:
branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php
2012-01-18 12:24:33 UTC (rev 8601)
+++ branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php
2012-01-18 12:26:21 UTC (rev 8602)
@@ -267,12 +267,12 @@
return "SELECT {$cols} FROM {$tables} {$joins} WHERE
{$condition} {$order}";
}
- function get_control_items($control_group_id)
+ function get_control_items($control_group_id, $return_type =
"return_object")
{
$results = array();
$sql = "SELECT * FROM controller_control_item WHERE
control_group_id={$control_group_id}";
- $this->db->limit_query($sql, $start, __LINE__,
__FILE__, $limit);
+ $this->db->query($sql);
while ($this->db->next_record()) {
$control_item = new
controller_control_item($this->unmarshal($this->db->f('id', true), 'int'));
@@ -282,39 +282,23 @@
$control_item->set_how_to_do($this->unmarshal($this->db->f('how_to_do', true),
'string'));
$control_item->set_control_group_id($this->unmarshal($this->db->f('control_group_id',
true), 'int'));
- $results[] = $control_item;
+ if($return_type == "return_object")
+ $results[] = $control_item;
+ else
+ $results[] = $control_item->toArray();
}
return $results;
}
- function get_control_items_as_array($control_group_id)
+ function get_control_items_by_control($control_id, $returnType
= "return_object")
{
$results = array();
- $sql = "SELECT * FROM controller_control_item WHERE
control_group_id=$control_group_id";
- $this->db->limit_query($sql, $start, __LINE__,
__FILE__, $limit);
-
- while ($this->db->next_record()) {
- $control_item = new
controller_control_item($this->unmarshal($this->db->f('id', true), 'int'));
-
$control_item->set_title($this->unmarshal($this->db->f('title', true),
'string'));
-
$control_item->set_required($this->unmarshal($this->db->f('required', true),
'boolean'));
-
$control_item->set_what_to_do($this->unmarshal($this->db->f('what_to_do',
true), 'string'));
-
$control_item->set_how_to_do($this->unmarshal($this->db->f('how_to_do', true),
'string'));
-
$control_item->set_control_group_id($this->unmarshal($this->db->f('control_group_id',
true), 'int'));
-
- $results[] = $control_item->toArray();
- }
-
- return $results;
- }
-
- function get_control_items_by_control($control_id, $returnType
= "object")
- {
- $results = array();
-
- $sql = "SELECT ci.* FROM controller_control_item ci,
controller_control_item_list cl ";
- $sql .= "WHERE cl.control_id=$control_id AND
cl.control_item_id=ci.id";
+ $sql = "SELECT ci.* ";
+ $sql .= "FROM controller_control_item ci,
controller_control_item_list cl ";
+ $sql .= "WHERE cl.control_id=$control_id AND
cl.control_item_id = ci.id ";
+
$this->db->query($sql);
while ($this->db->next_record()) {
@@ -326,7 +310,7 @@
$control_item->set_control_group_id($this->unmarshal($this->db->f('control_group_id',
true), 'int'));
$control_item->set_type($this->unmarshal($this->db->f('type', true), 'string'));
- if($returnType == "array")
+ if($returnType == "return_array")
$results[] = $control_item->toArray();
else
$results[] = $control_item;
Modified:
branches/Version-1_0-branch/controller/inc/class.socontrol_item_list.inc.php
===================================================================
---
branches/Version-1_0-branch/controller/inc/class.socontrol_item_list.inc.php
2012-01-18 12:24:33 UTC (rev 8601)
+++
branches/Version-1_0-branch/controller/inc/class.socontrol_item_list.inc.php
2012-01-18 12:26:21 UTC (rev 8602)
@@ -147,25 +147,10 @@
return isset($result);
}
- function get_control_item_array($start = 0, $results = 1000,
$sort = null, $dir = '', $query = null, $search_option = null, $filters =
array()){}
+ function get_id_field_name($extended_info = false){}
- function get_id_field_name($extended_info = false)
- {
- }
+ protected function get_query(string $sort_field, boolean
$ascending, string $search_for, string $search_type, array $filters, boolean
$return_count){}
- protected function get_query(string $sort_field, boolean
$ascending, string $search_for, string $search_type, array $filters, boolean
$return_count)
- {
+ function populate(int $control_item_id, &$control_item){}
- }
-
- function get_control_items($control_group_id)
- {
-
- }
-
- function populate(int $control_item_id, &$control_item)
- {
-
- }
-
}
Modified: branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
2012-01-18 12:24:33 UTC (rev 8601)
+++ branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
2012-01-18 12:26:21 UTC (rev 8602)
@@ -85,15 +85,22 @@
$year = intval( $year );
$from_month = intval( $month );
- $from_date = strtotime("$from_month/01/$year");
- $to_month = $from_month + 1;
- $to_date = strtotime("$to_month/01/$year+1");
-
+ $from_date_ts = strtotime("$from_month/01/$year");
+
+ if(($from_month + 1) > 12){
+ $to_month = 1;
+ $year++;
+ }else{
+ $to_month = $from_month + 1;
+ }
+
+ $to_date_ts = strtotime("$to_month/01/$year");
+
if(empty($location_code)){
$location_code = "1101";
}
- $this->calendar_builder = new
calendar_builder($from_date, $to_date);
+ $this->calendar_builder = new
calendar_builder($from_date_ts, $to_date_ts);
$repeat_type = 0;
@@ -107,14 +114,14 @@
$location_finder = new location_finder();
$locations = $location_finder->get_responsibilities(
$criteria );
-
- $controls_for_location_array =
$this->so_control->get_controls_by_location($location_code, $from_date,
$to_date, $repeat_type);
+
+ $controls_for_location_array =
$this->so_control->get_controls_by_location($location_code, $from_date_ts,
$to_date_ts, $repeat_type);
- $control_id_with_check_list_array =
$this->so->get_check_lists_for_location_2($location_code, $from_date, $to_date,
$repeat_type);
+ $control_id_with_check_list_array =
$this->so->get_check_lists_for_location_2($location_code, $from_date_ts,
$to_date_ts, $repeat_type);
$controls_with_check_list =
$this->populate_controls_with_check_lists($controls_for_location_array,
$control_id_with_check_list_array);
- $controls_calendar_array =
$this->calendar_builder->build_calendar_array( $controls_with_check_list, null,
31, "view_days" );
+ $controls_calendar_array =
$this->calendar_builder->build_calendar_array( $controls_with_check_list, 31,
"view_days" );
$location_array =
execMethod('property.bolocation.read_single', array('location_code' =>
$location_code));
@@ -160,25 +167,79 @@
$year = phpgw::get_var('year');
$year = intval($year);
-
- $from_date = strtotime("01/01/$year");
+
+ $from_date_ts = strtotime("01/01/$year");
$to_year = $year + 1;
- $to_date = strtotime("01/01/$to_year");
+ $to_date_ts = strtotime("01/01/$to_year");
if(empty($location_code)){
$location_code = "1101";
}
- $this->calendar_builder = new
calendar_builder($from_date, $to_date);
+ $criteria = array
+ (
+ 'user_id' =>
$GLOBALS['phpgw_info']['user']['account_id'],
+ 'type_id' => 1,
+ 'role_id' => 0, // For å begrense til en
bestemt rolle - ellers listes alle roller for brukeren
+ 'allrows' => false
+ );
+
+ $location_finder = new location_finder();
+ $locations = $location_finder->get_responsibilities(
$criteria );
- // Gets an array of controls that contains check_lists
for the specified location
- $agg_check_list_array =
$this->so->get_agg_check_lists_for_location( $location_code, $from_date,
$to_date );
- $controls_calendar_array =
$this->calendar_builder->build_agg_calendar_array( $agg_check_list_array );
+ $repeat_type = null;
+ $controls_for_location_array =
$this->so_control->get_controls_by_location($location_code, $from_date_ts,
$to_date_ts, $repeat_type );
+
+ $this->calendar_builder = new
calendar_builder($from_date_ts, $to_date_ts);
+
+ foreach($controls_for_location_array as $control){
+
+ if($control->get_repeat_type() == 0){
+
+ $twelve_month_array = array();
+
+ $trail_year = $year;
+
+
for($from_month=1;$from_month<=12;$from_month++){
+
+ $trail_from_date_ts =
strtotime("$from_month/01/$trail_year");
+
+ if(($from_month + 1) > 12)
+ {
+ $to_month = 1;
+ $cal_to_year = $year +
1;
+ }
+ else
+ {
+ $to_month = $from_month
+ 1;
+ }
+
+ $trail_to_date_ts =
strtotime("$to_month/01/$trail_year");
+
+
$num_open_cases_for_control_array = array();
+
$num_open_cases_for_control_array =
$this->so_check_list->get_num_open_cases_for_control( $control->get_id(),
$location_code, $trail_from_date_ts, $trail_to_date_ts );
+
+ $status =
"control_agg_accomplished_with_errors";
+
+
$twelve_month_array[$from_month-1]["status"] = $status;
+
$twelve_month_array[$from_month-1]["info"] =
$num_open_cases_for_control_array["count"];
+
+ }
+
+ $days_controls_calendar_array[] =
array("control" => $control->toArray(), "calendar_array" =>
$twelve_month_array);
+ }
+
+ }
+
+
$repeat_type = 2;
- $control_check_list_array =
$this->so->get_check_lists_for_location( $location_code, $from_date, $to_date,
$repeat_type );
- $controls_calendar_array =
$this->calendar_builder->build_calendar_array( $control_check_list_array,
$controls_calendar_array, 12, "view_months" );
+ $control_check_list_array =
$this->so->get_check_lists_for_location( $location_code, $from_date_ts,
$to_date_ts, $repeat_type );
+
+ $month_controls_calendar_array =
$this->calendar_builder->build_calendar_array( $control_check_list_array, 12,
"view_months" );
+ $controls_calendar_array =
array_merge($days_controls_calendar_array, $month_controls_calendar_array);
+
$location_array =
execMethod('property.bolocation.read_single', array('location_code' =>
$location_code));
$heading_array = array("Jan", "Feb", "Mar", "Apr",
"Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des");
Modified: branches/Version-1_0-branch/controller/inc/class.uicase.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicase.inc.php
2012-01-18 12:24:33 UTC (rev 8601)
+++ branches/Version-1_0-branch/controller/inc/class.uicase.inc.php
2012-01-18 12:26:21 UTC (rev 8602)
@@ -36,6 +36,7 @@
phpgw::import_class('controller.socontrol');
include_class('controller', 'check_item_case', 'inc/model/');
+ include_class('controller', 'status_checker', 'inc/helper/');
class controller_uicase extends controller_uicommon
{
@@ -65,7 +66,7 @@
$check_list_id = phpgw::get_var('check_list_id');
$control_item_id = phpgw::get_var('control_item_id');
$case_descr = phpgw::get_var('case_descr');
-
+
$check_list =
$this->so_check_list->get_single($check_list_id);
$control_id = $check_list->get_control_id();
@@ -73,16 +74,26 @@
$check_item =
$this->so_check_item->get_check_item_by_check_list_and_control_item($check_list_id,
$control_item_id);
+ if($check_item == null){
+ $new_check_item = new controller_check_item();
+ $new_check_item->set_check_list_id(
$check_list_id );
+ $new_check_item->set_control_item_id(
$control_item_id );
+ $new_check_item->set_status( 0 );
+ $new_check_item->set_comment( "" );
+
+ $saved_check_item_id =
$this->so_check_item->store( $new_check_item );
+ $check_item =
$this->so_check_item->get_single($saved_check_item_id);
+ }
+
$todays_date = mktime(0,0,0,date("m"), date("d"),
date("Y"));
$user_id = $GLOBALS['phpgw_info']['user']['id'];
- $status = 0;
+ $case_status = 0;
$case = new controller_check_item_case();
$case->set_check_item_id( $check_item->get_id() );
- $case->set_status($status);
+ $case->set_status($case_status);
$case->set_descr($case_descr);
- $case->set_location_id($location_id);
$case->set_user_id($user_id);
$case->set_entry_date($todays_date);
$case->set_modified_date($todays_date);
@@ -90,8 +101,12 @@
$case_id = $this->so->store($case);
- if($case_id > 0)
+ if($case_id > 0){
+ $status_checker = new status_checker();
+ $status_checker->update_check_list_status(
$check_list_id );
+
return json_encode( array( "saveStatus" =>
"saved" ) );
+ }
else
return json_encode( array( "saveStatus" =>
"not_saved" ) );
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
2012-01-18 12:24:33 UTC (rev 8601)
+++ branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php
2012-01-18 12:26:21 UTC (rev 8602)
@@ -33,6 +33,8 @@
include_class('controller', 'check_list', 'inc/model/');
include_class('controller', 'check_item', 'inc/model/');
+ include_class('controller', 'status_checker', 'inc/helper/');
+ include_class('controller', 'date_helper', 'inc/helper/');
class controller_uicheck_list extends controller_uicommon
{
@@ -86,15 +88,6 @@
public function index()
{
-/* $check_list_array = $this->so->get_check_list();
-
- $data = array
- (
- 'check_list_array' => $check_list_array
- );
-
- self::render_template_xsl('control_check_lists', $data);
- */
if(phpgw::get_var('phpgw_return_as') == 'json') {
return $this->query();
}
@@ -243,8 +236,8 @@
$completed_date = phpgw::get_var('completed_date');
$planned_date = phpgw::get_var('planned_date');
- $planned_date_ts = $this->get_timestamp_from_date(
$planned_date );
- $completed_date_ts = $this->get_timestamp_from_date(
$completed_date );
+ $planned_date_ts =
date_helper::get_timestamp_from_date( $planned_date );
+ $completed_date_ts =
date_helper::get_timestamp_from_date( $completed_date );
// Fetches check_list from DB
$update_check_list =
$this->so_check_list->get_single($check_list_id);
@@ -376,18 +369,36 @@
$check_list =
$this->so_check_list->get_single($check_list_id);
- $location_code = $check_list->get_location_code();
-
// Fetches all control items for check list
- $control_items_for_check_list =
$this->so_control_item->get_control_items_by_control($check_list->get_control_id(),
"array");
-
+ $control_items_for_check_list = array();
+
+ $control_items =
$this->so_control_item->get_control_items_by_control($check_list->get_control_id());
+ $check_items =
$this->so_check_item->get_check_items($check_list_id, null, null,
"return_object");
+
+ $remove_control_item_ids_array = array();
+
+ foreach($check_items as $check_item){
+ if($check_item->get_control_item()->get_type()
== "control_item_type_2" & $check_item->get_status() == 1){
+ $remove_control_item_ids_array[] =
$check_item->get_control_item_id();
+ }
+ }
+
+ foreach($control_items as $control_item){
+ if( !in_array($control_item->get_id(),
$remove_control_item_ids_array) ){
+ $control_items_for_check_list[] =
$control_item->toArray();
+ }
+ }
+
$data = array
(
'control_items_for_check_list' =>
$control_items_for_check_list,
- 'check_list' => $check_list->toArray()
+ 'check_list'
=> $check_list->toArray()
);
self::render_template_xsl(array('check_list/check_list_tab_menu',
'check_list/register_case'), $data);
+ self::add_javascript('controller', 'controller',
'jquery.js');
+ self::add_javascript('controller', 'controller',
'custom_ui.js');
+ self::add_javascript('controller', 'controller',
'ajax.js');
}
function view_open_cases(){
@@ -428,12 +439,12 @@
$check_list =
$this->so_check_list->get_single($check_list_id);
// Fetches check items that registeres measurement
- $measurement_check_items =
$this->so_check_item->get_check_items($check_list_id, null,
'control_item_type_2');
-
+ $measurement_check_items =
$this->so_check_item->get_check_items($check_list_id, null,
'control_item_type_2', "return_array");
+
$data = array
(
- 'measurement_check_items' =>
$measurement_check_items,
- 'check_list' => $check_list->toArray()
+ 'measurement_check_items' =>
$measurement_check_items,
+ 'check_list' =>
$check_list->toArray()
);
self::render_template_xsl(
array('check_list/cases_tab_menu', 'check_list/view_measurements'), $data );
@@ -524,8 +535,12 @@
$check_item_id = $this->so_check_item->store(
$check_item );
- if($check_item_id > 0)
+ if($check_item_id > 0){
+ $status_checker = new status_checker();
+ $status_checker->update_check_list_status(
$check_item->get_check_list_id() );
+
return json_encode( array( "saveStatus" =>
"saved" ) );
+ }
else
return json_encode( array( "status" =>
"not_saved" ) );
}
@@ -702,17 +717,4 @@
return $this->yui_results($results);
}
-
- function get_timestamp_from_date( $date_string ){
- $pos_day = strpos($date_string, "/");
- $day = substr($date_string, 0, $pos_day);
-
- $pos_month = strpos($date_string, "-");
- $len_month = $pos_month - $pos_day -1;
- $month = substr($date_string, $pos_day+1, $len_month);
-
- $year = substr($date_string, $pos_month + $len_month-1,
strlen($date_string)-1);
-
- return mktime(0, 0, 0, $month, $day, $year);
- }
}
Modified:
branches/Version-1_0-branch/controller/inc/class.uicheck_list_for_location.inc.php
===================================================================
---
branches/Version-1_0-branch/controller/inc/class.uicheck_list_for_location.inc.php
2012-01-18 12:24:33 UTC (rev 8601)
+++
branches/Version-1_0-branch/controller/inc/class.uicheck_list_for_location.inc.php
2012-01-18 12:26:21 UTC (rev 8602)
@@ -34,6 +34,8 @@
include_class('controller', 'check_list', 'inc/model/');
include_class('controller', 'date_generator', 'inc/component/');
+ include_class('controller', 'status_checker', 'inc/helper/');
+ include_class('controller', 'date_helper', 'inc/helper/');
class controller_uicheck_list_for_location extends controller_uicommon
{
@@ -58,12 +60,12 @@
'index' => true,
'view_locations_for_control' => true,
'add_location_to_control' => true,
-
'add_check_list_for_location' => true,
-
'save_check_list_for_location' => true,
+
'add_check_list' => true,
+
'save_check_list' => true,
'edit_check_list' => true,
'create_case_message' => true,
'view_control_info' => true,
-
'view_cases_for_check_list' => true
+
'view_cases_for_check_list' => true
);
function __construct()
@@ -314,7 +316,7 @@
self::render_template_xsl(array('control_location_tabs', 'common',
'add_location_to_control'), $data);
}
- function add_check_list_for_location(){
+ function add_check_list(){
$location_code = phpgw::get_var('location_code');
$control_id = phpgw::get_var('control_id');
$date = phpgw::get_var('date');
@@ -362,7 +364,7 @@
$GLOBALS['phpgw']->css->add_external_file('controller/templates/base/css/jquery-ui.custom.css');
-
self::render_template_xsl(array('add_check_list_for_location'), $data);
+
self::render_template_xsl(array('check_list/check_list_tab_menu','check_list/add_check_list'),
$data);
}
function edit_check_list(){
@@ -374,7 +376,7 @@
$location_code = $check_list->get_location_code();
$location_array =
execMethod('property.bolocation.read_single', array('location_code' =>
$location_code));
-
+
$data = array
(
'check_list'
=> $check_list->toArray(),
@@ -419,27 +421,33 @@
self::render_template_xsl(array('check_list/check_list_tab_menu',
'check_list/view_cases_for_check_list'), $data);
}
- function save_check_list_for_location(){
+ function save_check_list(){
$location_code = phpgw::get_var('location_code');
$control_id = phpgw::get_var('control_id');
$status = phpgw::get_var('status');
-
+
+ $deadline_date = phpgw::get_var('deadline_date',
'string');
$planned_date = phpgw::get_var('planned_date',
'string');
$completed_date = phpgw::get_var('completed_date',
'string');
- $deadline_date = phpgw::get_var('deadline_date',
'string');
-
- $planned_date_ts = $this->get_timestamp_from_date(
$planned_date );
- $deadline_date_ts = $this->get_timestamp_from_date(
$deadline_date );
+
+ if($planned_date != '')
+ $planned_date_ts =
date_helper::get_timestamp_from_date( $planned_date );
+
+ if($deadline_date != '')
+ $deadline_date_ts =
date_helper::get_timestamp_from_date( $deadline_date );
+ if($completed_date != '')
+ $completed_date_ts =
date_helper::get_timestamp_from_date( $completed_date );
+
$check_list = new controller_check_list();
$check_list->set_location_code($location_code);
$check_list->set_control_id($control_id);
$check_list->set_status($status);
$check_list->set_deadline( $deadline_date_ts );
$check_list->set_planned_date($planned_date_ts);
- $check_list->set_completed_date($completed_date);
+ $check_list->set_completed_date($completed_date_ts);
- $check_list_id = $this->so_check_list->add($check_list);
+ $check_list_id =
$this->so_check_list->store($check_list);
$this->redirect(array('menuaction' =>
'controller.uicheck_list_for_location.edit_check_list',
'check_list_id'=>$check_list_id));
}
@@ -523,19 +531,6 @@
self::render_template_xsl(array('check_list/check_list_tab_menu','check_list/view_control_info'),
$data);
}
- function get_timestamp_from_date( $date_string ){
- $pos_day = strpos($date_string, "/");
- $day = substr($date_string, 0, $pos_day);
-
- $pos_month = strpos($date_string, "-");
- $len_month = $pos_month - $pos_day -1;
- $month = substr($date_string, $pos_day+1, $len_month);
-
- $year = substr($date_string, $pos_month + $len_month-1,
strlen($date_string)-1);
-
- return mktime(0, 0, 0, $month, $day, $year);
- }
-
public function query(){
$type_id = phpgw::get_var('type_id');
$return_results = phpgw::get_var('results', 'int',
'REQUEST', 0);
Modified: branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
2012-01-18 12:24:33 UTC (rev 8601)
+++ branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
2012-01-18 12:26:21 UTC (rev 8602)
@@ -433,7 +433,7 @@
// Fetches control items for control group and
populates groups_with_control_items with groups and chosen control items
foreach ($control_group_ids as $control_group_id)
{
- $group_control_items_array =
$this->so_control_item->get_control_items_as_array($control_group_id);
+ $group_control_items_array =
$this->so_control_item->get_control_items($control_group_id, "return_array");
$control_items_for_group_array = array();
@@ -734,7 +734,7 @@
$value['parameters'] = array();
$value['ajax'][] = false;
- $value['actions'][] =
html_entity_decode(self::link(array('menuaction' =>
'controller.uicheck_list_for_location.add_check_list_for_location',
'location_code' => $value['location_code'])));
+ $value['actions'][] =
html_entity_decode(self::link(array('menuaction' =>
'controller.uicheck_list_for_location.add_check_list', 'location_code' =>
$value['location_code'])));
$value['labels'][] = lang('add_check_list_to_location');
$value['parameters'][] = "control_id";
}
Modified:
branches/Version-1_0-branch/controller/inc/component/class.calendar_builder.inc.php
===================================================================
---
branches/Version-1_0-branch/controller/inc/component/class.calendar_builder.inc.php
2012-01-18 12:24:33 UTC (rev 8601)
+++
branches/Version-1_0-branch/controller/inc/component/class.calendar_builder.inc.php
2012-01-18 12:26:21 UTC (rev 8602)
@@ -12,41 +12,12 @@
$this->period_end_date = $period_end_date;
}
- public function build_calendar_array( $control_array,
$controls_calendar_array, $num, $period_type ){
+ public function build_calendar_array( $control_array, $num,
$period_type ){
foreach($control_array as $control){
-
- // Initialises twelve_months_array
- for($i=1;$i<=$num;$i++){
- $calendar_array[$i] = null;
- }
- $date_generator = new
date_generator($control->get_start_date(), $control->get_end_date(),
$this->period_start_date, $this->period_end_date, $control->get_repeat_type(),
$control->get_repeat_interval());
- $dates_array = $date_generator->get_dates();
-
- // Inserts dates on behalf of repeat type and repeat
interval
- foreach($dates_array as $date){
-
- $todays_date = mktime(0,0,0,date("m"),
date("d"), date("Y"));
-
- if($date < $todays_date){
- $status = "control_not_accomplished";
- }else{
- $status = "control_registered";
- }
-
- if( $period_type == "view_months" )
- {
- $calendar_array[ date("n", $date)
]["status"] = $status;
- $calendar_array[ date("n", $date)
]["info"] = array("date" => $date, "control_id" => $control->get_id());
- }
- else if( $period_type == "view_days" )
- {
- $calendar_array[ date("j", $date)
]["status"] = $status;
- $calendar_array[ date("j", $date)
]["info"] = array("date" => $date, "control_id" => $control->get_id());
- }
- }
-
+ $calendar_array = $this->init_calendar( $control,
$calendar_array, $num, $period_type );
+
// Inserts check_list object on deadline month in
twelve_months_array
foreach($control->get_check_lists_array() as
$check_list){
@@ -68,15 +39,15 @@
{
$status = "control_not_accomplished";
}
- else if( $check_list->get_status() == 1 &
$check_list->get_completed_date() > $check_list->get_deadline() )
+ else if( $check_list->get_status() == 1 &
$check_list->get_completed_date() > $check_list->get_deadline() &
$check_list->get_num_open_cases() == 0)
{
$status =
"control_accomplished_over_time_without_errors";
}
- else if( $check_list->get_status() == 1 &
$check_list->get_completed_date() < $check_list->get_deadline() )
+ else if( $check_list->get_status() == 1 &
$check_list->get_completed_date() < $check_list->get_deadline() &
$check_list->get_num_open_cases() == 0)
{
$status =
"control_accomplished_in_time_without_errors";
}
- else if( $check_list->get_status() == 2 ){
+ else if( $check_list->get_status() == 1 &
$check_list->get_num_open_cases() > 0){
$status =
"control_accomplished_with_errors";
$check_list_status_info->set_num_open_cases($check_list->get_num_open_cases());
}
@@ -135,4 +106,40 @@
return $control_calendar_array;
}
+
+ function init_calendar( $control, $calendar_array, $num, $period_type ){
+
+ // Initialises twelve_months_array
+ for($i=1;$i<=$num;$i++){
+ $calendar_array[$i] = null;
+ }
+
+ $date_generator = new
date_generator($control->get_start_date(), $control->get_end_date(),
$this->period_start_date, $this->period_end_date, $control->get_repeat_type(),
$control->get_repeat_interval());
+ $dates_array = $date_generator->get_dates();
+
+ // Inserts dates on behalf of repeat type and repeat interval
+ foreach($dates_array as $date){
+
+ $todays_date = mktime(0,0,0,date("m"), date("d"),
date("Y"));
+
+ if($date < $todays_date){
+ $status = "control_not_accomplished";
+ }else{
+ $status = "control_registered";
+ }
+
+ if( $period_type == "view_months" )
+ {
+ $calendar_array[ date("n", $date) ]["status"]
= $status;
+ $calendar_array[ date("n", $date) ]["info"] =
array("date" => $date, "control_id" => $control->get_id());
+ }
+ else if( $period_type == "view_days" )
+ {
+ $calendar_array[ date("j", $date) ]["status"]
= $status;
+ $calendar_array[ date("j", $date) ]["info"] =
array("date" => $date, "control_id" => $control->get_id());
+ }
+ }
+
+ return $calendar_array;
+ }
}
\ No newline at end of file
Modified:
branches/Version-1_0-branch/controller/inc/component/class.date_generator.inc.php
===================================================================
---
branches/Version-1_0-branch/controller/inc/component/class.date_generator.inc.php
2012-01-18 12:24:33 UTC (rev 8601)
+++
branches/Version-1_0-branch/controller/inc/component/class.date_generator.inc.php
2012-01-18 12:26:21 UTC (rev 8602)
@@ -30,7 +30,7 @@
$interval_date = $period_start_date;
- while($interval_date <= $this->period_end_date){
+ while($interval_date < $this->period_end_date){
$this->calendar_array[] = $interval_date;
Copied:
branches/Version-1_0-branch/controller/inc/helper/class.date_helper.inc.php
(from rev 8601, trunk/controller/inc/helper/class.date_helper.inc.php)
===================================================================
--- branches/Version-1_0-branch/controller/inc/helper/class.date_helper.inc.php
(rev 0)
+++ branches/Version-1_0-branch/controller/inc/helper/class.date_helper.inc.php
2012-01-18 12:26:21 UTC (rev 8602)
@@ -0,0 +1,18 @@
+<?php
+ class date_helper {
+
+ public function __construct(){}
+
+ public static function get_timestamp_from_date( $date_string ){
+ $pos_day = strpos($date_string, "/");
+ $day = substr($date_string, 0, $pos_day);
+
+ $pos_month = strpos($date_string, "-");
+ $len_month = $pos_month - $pos_day -1;
+ $month = substr($date_string, $pos_day+1, $len_month);
+
+ $year = substr($date_string, $pos_month + $len_month-1,
strlen($date_string)-1);
+
+ return mktime(0, 0, 0, $month, $day, $year);
+ }
+}
\ No newline at end of file
Modified:
branches/Version-1_0-branch/controller/inc/helper/class.location_finder.inc.php
===================================================================
---
branches/Version-1_0-branch/controller/inc/helper/class.location_finder.inc.php
2012-01-18 12:24:33 UTC (rev 8601)
+++
branches/Version-1_0-branch/controller/inc/helper/class.location_finder.inc.php
2012-01-18 12:26:21 UTC (rev 8602)
@@ -43,6 +43,7 @@
{
$data['filter_role_on_contact'] =
$GLOBALS['phpgw']->accounts->get($data['user_id'])->person_id;
$locations = $this->so->read($data);
+
$total_records = $this->so->total_records;
return $locations;
Modified:
branches/Version-1_0-branch/controller/inc/helper/class.status_checker.inc.php
===================================================================
---
branches/Version-1_0-branch/controller/inc/helper/class.status_checker.inc.php
2012-01-18 12:24:33 UTC (rev 8601)
+++
branches/Version-1_0-branch/controller/inc/helper/class.status_checker.inc.php
2012-01-18 12:26:21 UTC (rev 8602)
@@ -1,138 +1,43 @@
<?php
-
-include_class('controller', 'date_generator', 'inc/component/');
-
-class calendar_builder {
+ phpgw::import_class('controller.socheck_list');
+ phpgw::import_class('controller.socheck_item');
- private $period_start_date;
- private $period_end_date;
+ include_class('controller', 'check_list', 'inc/model/');
+ include_class('controller', 'check_item', 'inc/model/');
- public function __construct($period_start_date, $period_end_date){
- $this->period_start_date = $period_start_date;
- $this->period_end_date = $period_end_date;
- }
+ class status_checker {
- public function build_calendar_array( $control_array,
$controls_calendar_array, $num, $period_type ){
+ public function __construct()
+ {
+ $this->so_check_list = CreateObject('controller.socheck_list');
+ $this->so_check_item = CreateObject('controller.socheck_item');
+ }
- foreach($control_array as $control){
-
- // Initialises twelve_months_array
- for($i=1;$i<=$num;$i++){
- $calendar_array[$i] = null;
- }
-
- $date_generator = new
date_generator($control->get_start_date(), $control->get_end_date(),
$this->period_start_date, $this->period_end_date, $control->get_repeat_type(),
$control->get_repeat_interval());
- $dates_array = $date_generator->get_dates();
+ public function update_check_list_status( $check_list_id )
+ {
+ $check_list = $this->so_check_list->get_single( $check_list_id
);
+
+ $status = null;
+ $control_item_type = null;
+ $check_items =
$this->so_check_item->get_check_items_with_cases($check_list_id, $status,
$control_item_type, "return_object");
- // Inserts dates on behalf of repeat type and repeat
interval
- foreach($dates_array as $date){
-
- $todays_date = mktime(0,0,0,date("m"),
date("d"), date("Y"));
-
- if($date < $todays_date){
- $status = "control_not_accomplished";
- }else{
- $status = "control_registered";
- }
-
- if( $period_type == "view_months" )
- {
- $calendar_array[ date("n", $date)
]["status"] = $status;
- $calendar_array[ date("n", $date)
]["info"] = array("date" => $date, "control_id" => $control->get_id());
- }
- else if( $period_type == "view_days" )
- {
- $calendar_array[ date("j", $date)
]["status"] = $status;
- $calendar_array[ date("j", $date)
]["info"] = array("date" => $date, "control_id" => $control->get_id());
- }
- }
-
- // Inserts check_list object on deadline month in
twelve_months_array
- foreach($control->get_check_lists_array() as
$check_list){
-
- $check_list_status_info = new
check_list_status_info();
- $check_list_status_info->set_check_list_id(
$check_list->get_id() );
+ $num_open_cases = 0;
- $todays_date = mktime(0,0,0,date("m"),
date("d"), date("Y"));
-
- if( $check_list->get_status() == 0 &
$check_list->get_planned_date() > 0 & $check_list->get_deadline() >
$todays_date)
- {
- $status = "control_planned";
-
$check_list_status_info->set_info_text("Planlagt utført: " .
$check_list->get_planned_date());
- }
- else if( $check_list->get_status() == 0 &
$check_list->get_planned_date() > 0 & $check_list->get_deadline() <
$todays_date)
- {
- $status =
"control_not_accomplished_with_info";
- }
- else if( $check_list->get_status() == 0 &
$check_list->get_deadline() > $todays_date )
- {
- $status = "control_not_accomplished";
- }
- else if( $check_list->get_status() == 1 &
$check_list->get_completed_date() > $check_list->get_deadline() )
- {
- $status =
"control_accomplished_over_time_without_errors";
- }
- else if( $check_list->get_status() == 1 &
$check_list->get_completed_date() < $check_list->get_deadline() )
- {
- $status =
"control_accomplished_in_time_without_errors";
- }
- else if( $check_list->get_status() == 2 ){
- $status =
"control_accomplished_with_errors";
-
$check_list_status_info->set_num_open_cases($check_list->get_num_open_cases());
- }
- else if( $check_list->get_status() == 3 )
- {
- $status = "control_canceled";
- }
-
- $check_list_status_info->set_deadline_date(
date("d/m-Y", $check_list->get_deadline()) );
-
- if($period_type == "view_months")
- {
- $calendar_array[ date("n",
$check_list->get_deadline()) ]["status"] = $status;
- $calendar_array[ date("n",
$check_list->get_deadline()) ]["info"] = $check_list_status_info->serialize();
- }
- else if( $period_type == "view_days" )
- {
- $calendar_array[ date("j",
$check_list->get_deadline()) ]["status"] = $status;
- $calendar_array[ date("j",
$check_list->get_deadline()) ]["info"] = $check_list_status_info->serialize();
- }
- }
+ foreach($check_items as $check_item){
- $controls_calendar_array[] = array("control" =>
$control->toArray(), "calendar_array" => $calendar_array);
- }
-
- return $controls_calendar_array;
- }
-
- // Function receives array with control objects that each contain
check_lists for a certain period
- public function build_agg_calendar_array( $controls_array ){
-
- $calendar_array = array();
-
- foreach($controls_array as $control_array){
-
- $control_info = $control_array['control'];
- $check_list_array = $control_array['check_list'];
-
- $control_id = $control_info['id'];
-
- // Initialises twelve_months_array
- for($i=0;$i<12;$i++){
- $calendar_array[$i] = null;
+ if($check_item->get_control_item()->get_type() ==
"control_item_type_2" & $check_item->get_status() == 0){
+ $num_open_cases++;
+ }else{
+ foreach($check_item->get_cases_array() as
$case){
+ if($case->get_status() == 0){
+ $num_open_cases++;
+ }
+ }
}
-
- $status = "control_agg_accomplished_with_errors";
-
- // Inserts check_list object on deadline month in
twelve_months_array
- foreach($check_list_array as $check_list){
- $calendar_array[ date("m",
$check_list['deadline']) - 1 ] ["status"] = $status;
- $calendar_array[ date("m",
$check_list['deadline']) - 1 ] ["info"] = $check_list['count'];
- }
-
- $control_calendar_array[] = array("control" =>
$control_info, "calendar_array" => $calendar_array);
}
-
- return $control_calendar_array;
+
+ $check_list->set_num_open_cases($num_open_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_list.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/model/class.check_list.inc.php
2012-01-18 12:24:33 UTC (rev 8601)
+++ branches/Version-1_0-branch/controller/inc/model/class.check_list.inc.php
2012-01-18 12:26:21 UTC (rev 8602)
@@ -153,7 +153,12 @@
'control_id' => $this->get_control_id(),
'status' => $this->get_status(),
'comment' => $this->get_comment(),
- 'deadline' => $this->get_deadline()
- );
+ '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(),
+ 'num_open_cases' => $this->get_num_open_cases()
+ );
}
}
Modified:
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_month.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_month.xsl
2012-01-18 12:24:33 UTC (rev 8601)
+++
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_month.xsl
2012-01-18 12:26:21 UTC (rev 8602)
@@ -123,7 +123,7 @@
<div>
<a>
<xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.add_check_list_for_location</xsl:text>
+
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.add_check_list</xsl:text>
<xsl:text>&date=</xsl:text>
<xsl:value-of select="info/date"/>
<xsl:text>&control_id=</xsl:text>
@@ -207,7 +207,18 @@
</xsl:when>
<xsl:when test="status = 'control_not_accomplished'">
<div>
-
<img height="15" src="controller/images/status_icon_red_cross.png" />
+
<a>
+
<xsl:attribute name="href">
+
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.add_check_list</xsl:text>
+
<xsl:text>&date=</xsl:text>
+
<xsl:value-of select="info/date"/>
+
<xsl:text>&control_id=</xsl:text>
+
<xsl:value-of select="info/control_id"/>
+
<xsl:text>&location_code=</xsl:text>
+
<xsl:value-of select="$location_code"/>
+
</xsl:attribute>
+
<img height="15"
src="controller/images/status_icon_red_cross.png" />
+
</a>
</div>
</xsl:when>
<xsl:when test="status = 'control_canceled'">
Modified:
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_year.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_year.xsl
2012-01-18 12:24:33 UTC (rev 8601)
+++
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_year.xsl
2012-01-18 12:26:21 UTC (rev 8602)
@@ -11,13 +11,13 @@
<h3 style="margin:0;font-size:19px;">Kalenderoversikt
for <xsl:value-of select="period"/></h3>
</div>
- <ul id="icon_color_map">
- <li><img height="13"
src="controller/images/status_icon_yellow_ring.png" /><span>Kontroll satt
opp</span></li>
- <li><img height="13"
src="controller/images/status_icon_yellow.png" /><span>Kontroll har planlagt
dato</span></li>
- <li><img height="13"
src="controller/images/status_icon_dark_green.png" /><span>Kontroll gjennomført
uten feil før frist</span></li>
- <li><img height="13"
src="controller/images/status_icon_light_green.png" /><span>Kontroll
gjennomført uten feil etter frist</span></li>
- <li><img height="13"
src="controller/images/status_icon_red_empty.png" /><span>Kontroll gjennomført
med rapporterte feil</span></li>
- <li><img height="11"
src="controller/images/status_icon_red_cross.png" /><span>Kontroll ikke
gjennomført</span></li>
+ <ul id="icon_color_map">
+ <li><img height="15"
src="controller/images/status_icon_yellow_ring.png" /><span>Kontroll satt
opp</span></li>
+ <li><img height="15"
src="controller/images/status_icon_yellow.png" /><span>Kontroll har planlagt
dato</span></li>
+ <li><img height="15"
src="controller/images/status_icon_dark_green.png" /><span>Kontroll gjennomført
uten feil før frist</span></li>
+ <li><img height="15"
src="controller/images/status_icon_light_green.png" /><span>Kontroll
gjennomført uten feil etter frist</span></li>
+ <li><img height="15"
src="controller/images/status_icon_red_empty.png" /><span>Kontroll gjennomført
med rapporterte feil</span></li>
+ <li><img height="15"
src="controller/images/status_icon_red_cross.png" /><span>Kontroll ikke
gjennomført</span></li>
</ul>
<ul class="calendar">
@@ -84,7 +84,7 @@
<div>
<a>
<xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.add_check_list_for_location</xsl:text>
+
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.add_check_list</xsl:text>
<xsl:text>&date=</xsl:text>
<xsl:value-of select="info/date"/>
<xsl:text>&control_id=</xsl:text>
@@ -140,7 +140,7 @@
<div id="info_box" style="position:absolute;display:none;"></div>
<a class="view_check_list">
<xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.edit_check_list_for_location</xsl:text>
+
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.edit_check_list</xsl:text>
<xsl:text>&check_list_id=</xsl:text>
<xsl:value-of select="info/check_list_id"/>
</xsl:attribute>
@@ -153,17 +153,22 @@
</div>
</xsl:when>
<xsl:when test="status = 'control_agg_accomplished_with_errors'">
-
<div style="background: url(controller/images/status_icon_red_empty.png)
no-repeat 50% 50%;">
-
<a style="color:#fff;font-weight:bold;text-decoration: none;font-size:10px;"
class="view_check_list">
+
<div style="position:relative;background:
url(controller/images/status_icon_red_empty.png) no-repeat 50% 50%;">
+
<div id="info_box" style="position:absolute;display:none;"></div>
+
<a class="view_check_list">
<xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicheck_list.get_check_list_info</xsl:text>
-
<xsl:text>&phpgw_return_as=json</xsl:text>
+
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.edit_check_list</xsl:text>
<xsl:text>&check_list_id=</xsl:text>
-
<xsl:value-of select="info/id"/>
+
<xsl:value-of select="info/check_list_id"/>
</xsl:attribute>
-
<span><xsl:value-of select="info"/></span>
+
<span style="display:none">
+
<xsl:text>&check_list_id=</xsl:text><xsl:value-of
select="info/check_list_id"/>
+
<xsl:text>&phpgw_return_as=json</xsl:text>
+
</span>
+
<xsl:value-of select="info"/>
</a>
</div>
+
</xsl:when>
<xsl:when test="status = 'control_canceled'">
<div>
Copied:
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list.xsl
(from rev 8601, trunk/controller/templates/base/check_list/add_check_list.xsl)
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list.xsl
(rev 0)
+++
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list.xsl
2012-01-18 12:26:21 UTC (rev 8602)
@@ -0,0 +1,95 @@
+<!-- $Id$ -->
+<xsl:template match="data" xmlns:php="http://php.net/xsl">
+<xsl:variable name="date_format">d/m-Y</xsl:variable>
+
+
+<script>
+ $(function() {
+ $( "#planned_date" ).datepicker({
+ monthNames:
['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],
+ dayNamesMin: ['Sø', 'Ma', 'Ti', 'On', 'To', 'Fr', 'Lø'],
+ dateFormat: 'dd/mm-yy'
+ });
+ $( "#completed_date" ).datepicker({
+ monthNames:
['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],
+ dayNamesMin: ['Sø', 'Ma', 'Ti', 'On', 'To', 'Fr', 'Lø'],
+ dateFormat: 'dd/mm-yy'
+ });
+ });
+</script>
+
+
+<div id="main_content">
+
+ <h1>Registrere sjekkliste for <xsl:value-of
select="location_array/loc1_name"/></h1>
+
+ <xsl:call-template name="check_list_tab_menu">
+ <xsl:with-param name="active_tab">view_details</xsl:with-param>
+ </xsl:call-template>
+
+ <h3 class="box_header">Sjekklistedetaljer</h3>
+ <fieldset class="check_list_details">
+ <form id="frm_add_check_list"
action="index.php?menuaction=controller.uicheck_list_for_location.save_check_list"
method="post">
+
+ <div id="calendar_dates">
+ <xsl:for-each select="calendar_array">
+ <xsl:variable
name="cal_date"><xsl:value-of select="."/></xsl:variable>
+
+ <span><xsl:value-of
select="php:function('date', $date_format, number( $cal_date ) )"/></span>
+ </xsl:for-each>
+ </div>
+
+ <xsl:variable name="location_code"><xsl:value-of
select="location_array/location_code"/></xsl:variable>
+ <xsl:variable name="control_id"><xsl:value-of
select="control_array/id"/></xsl:variable>
+
+ <input type="hidden" name="control_id"
value="{$control_id}" />
+ <input type="hidden" name="location_code"
value="{$location_code}" />
+
+ <fieldset class="add_check_list">
+ <div>
+ <label>Status</label>
+ <select name="status">
+ <option value="0"
SELECTED="SELECTED">Ikke utført</option>
+ <option value="1"
>Utført</option>
+ </select>
+ </div>
+ <div>
+ <label>Fristdato</label>
+ <input>
+ <xsl:attribute
name="id">deadline_date</xsl:attribute>
+ <xsl:attribute
name="name">deadline_date</xsl:attribute>
+ <xsl:attribute
name="type">text</xsl:attribute>
+ <xsl:attribute name="value"><xsl:value-of
select="php:function('date', $date_format, number(deadline))"/></xsl:attribute>
+ </input>
+ </div>
+ <div>
+ <label>Planlagt dato</label>
+ <input>
+ <xsl:attribute
name="id">planned_date</xsl:attribute>
+ <xsl:attribute
name="name">planned_date</xsl:attribute>
+ <xsl:attribute
name="type">text</xsl:attribute>
+ <xsl:attribute
name="value"></xsl:attribute>
+ </input>
+ </div>
+ <div>
+ <label>Utført dato</label>
+ <input>
+ <xsl:attribute
name="id">completed_date</xsl:attribute>
+ <xsl:attribute
name="name">completed_date</xsl:attribute>
+ <xsl:attribute
name="type">text</xsl:attribute>
+ <xsl:if
test="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>
+ <div><label>Utstyr</label><input
name="equipment_id" /></div>
+ </fieldset>
+ <div class="form-buttons">
+ <xsl:variable name="lang_save"><xsl:value-of
select="php:function('lang', 'save_check_list')" /></xsl:variable>
+ <input style="width: 170px;" class="btn
not_active" type="submit" name="save_control" value="Lagre detaljer" />
+ </div>
+ </form>
+ </fieldset>
+
+ </div>
+</xsl:template>
Deleted:
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list_for_location.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list_for_location.xsl
2012-01-18 12:24:33 UTC (rev 8601)
+++
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list_for_location.xsl
2012-01-18 12:26:21 UTC (rev 8602)
@@ -1,91 +0,0 @@
-<!-- $Id$ -->
-<xsl:template match="data" xmlns:php="http://php.net/xsl">
-<xsl:variable name="date_format">d/m-Y</xsl:variable>
-
-
-<script>
- $(function() {
- $( "#planned_date" ).datepicker({
- monthNames:
['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],
- dayNamesMin: ['Sø', 'Ma', 'Ti', 'On', 'To', 'Fr', 'Lø'],
- dateFormat: 'dd/mm-yy'
- });
- $( "#completed_date" ).datepicker({
- monthNames:
['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],
- dayNamesMin: ['Sø', 'Ma', 'Ti', 'On', 'To', 'Fr', 'Lø'],
- dateFormat: 'dd/mm-yy'
- });
- });
-</script>
-
-
-<div id="main_content">
-
- <h1>Registrere sjekkliste for <xsl:value-of
select="location_array/loc1_name"/></h1>
-
- <div class="tab_menu"><a class="active">Sjekklistedetaljer</a></div>
- <fieldset class="check_list_details">
- <form id="frm_add_check_list"
action="index.php?menuaction=controller.uicheck_list_for_location.save_check_list_for_location"
method="post">
-
- <div id="calendar_dates">
- <xsl:for-each select="calendar_array">
- <xsl:variable
name="cal_date"><xsl:value-of select="."/></xsl:variable>
-
- <span><xsl:value-of
select="php:function('date', $date_format, number( $cal_date ) )"/></span>
- </xsl:for-each>
- </div>
-
- <xsl:variable name="location_code"><xsl:value-of
select="location_array/location_code"/></xsl:variable>
- <xsl:variable name="control_id"><xsl:value-of
select="control_array/id"/></xsl:variable>
-
- <input type="hidden" name="control_id"
value="{$control_id}" />
- <input type="hidden" name="location_code"
value="{$location_code}" />
-
- <fieldset class="add_check_list">
- <div>
- <label>Status</label>
- <select name="status">
- <option value="0"
SELECTED="SELECTED">Ikke utført</option>
- <option value="1"
>Utført</option>
- </select>
- </div>
- <div>
- <label>Fristdato</label>
- <input>
- <xsl:attribute
name="id">deadline_date</xsl:attribute>
- <xsl:attribute
name="name">deadline_date</xsl:attribute>
- <xsl:attribute
name="type">text</xsl:attribute>
- <xsl:attribute name="value"><xsl:value-of
select="php:function('date', $date_format, number(deadline))"/></xsl:attribute>
- </input>
- </div>
- <div>
- <label>Planlagt dato</label>
- <input>
- <xsl:attribute
name="id">planned_date</xsl:attribute>
- <xsl:attribute
name="name">planned_date</xsl:attribute>
- <xsl:attribute
name="type">text</xsl:attribute>
- <xsl:attribute
name="value"></xsl:attribute>
- </input>
- </div>
- <div>
- <label>Utført dato</label>
- <input>
- <xsl:attribute
name="id">completed_date</xsl:attribute>
- <xsl:attribute
name="name">completed_date</xsl:attribute>
- <xsl:attribute
name="type">text</xsl:attribute>
- <xsl:if
test="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>
- <div><label>Utstyr</label><input
name="equipment_id" /></div>
- </fieldset>
- <div class="form-buttons">
- <xsl:variable name="lang_save"><xsl:value-of
select="php:function('lang', 'save_check_list')" /></xsl:variable>
- <input style="width: 170px;" class="btn
not_active" type="submit" name="save_control" value="Lagre detaljer" />
- </div>
- </form>
- </fieldset>
-
- </div>
-</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
2012-01-18 12:24:33 UTC (rev 8601)
+++
branches/Version-1_0-branch/controller/templates/base/check_list/edit_check_list.xsl
2012-01-18 12:26:21 UTC (rev 8602)
@@ -62,6 +62,10 @@
</select>
</div>
<div>
+ <label>Antall åpne avvik</label>
+ <xsl:value-of select="check_list/num_open_cases"/>
+ </div>
+ <div>
<label>Skal utføres innen</label>
<input>
<xsl:attribute
name="id">deadline_date</xsl:attribute>
Modified:
branches/Version-1_0-branch/controller/templates/base/check_list/register_case.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/check_list/register_case.xsl
2012-01-18 12:24:33 UTC (rev 8601)
+++
branches/Version-1_0-branch/controller/templates/base/check_list/register_case.xsl
2012-01-18 12:26:21 UTC (rev 8602)
@@ -20,38 +20,39 @@
<ul id="control_items_list" class="check_items
expand_list">
<xsl:for-each
select="control_items_for_check_list">
<li>
- <h4><img
src="controller/images/arrow_right.png" width="14"/><span><xsl:value-of
select="title"/></span></h4>
- <form
id="frm_register_case"
action="index.php?menuaction=controller.uicase.register_case&phpgw_return_as=json"
method="post">
- <xsl:variable
name="control_item_id"><xsl:value-of select="id"/></xsl:variable>
- <input
type="hidden" name="control_item_id" value="{$control_item_id}" />
- <input
name="check_list_id" type="hidden">
- <xsl:attribute
name="value">
- <xsl:value-of
select="//check_list/id"/>
- </xsl:attribute>
- </input>
- <input
name="status" type="hidden" value="0" />
-
+ <h4><img
src="controller/images/arrow_right.png" width="14"/><span><xsl:value-of
select="title"/></span></h4>
<xsl:choose>
<xsl:when
test="type = 'control_item_type_1'">
- <input
name="type" type="hidden" value="control_item_type_1" />
-
- <div
class="check_item">
- <div>
-
<label class="comment">Beskrivelse av sak</label>
-
<textarea name="case_descr">
-
<xsl:value-of select="comment"/>
-
</textarea>
-
</div>
- <div
class="form-buttons">
-
<xsl:variable name="lang_save"><xsl:value-of
select="php:function('lang', 'register_error')" /></xsl:variable>
-
<input type="submit" name="save_control" value="{$lang_save}"
class="not_active" title="{$lang_save}" />
+ <form
id="frm_register_case"
action="index.php?menuaction=controller.uicase.register_case&phpgw_return_as=json"
method="post">
+
<xsl:variable name="control_item_id"><xsl:value-of select="id"/></xsl:variable>
+
<input type="hidden" name="control_item_id" value="{$control_item_id}" />
+
<input name="check_list_id" type="hidden"><xsl:attribute
name="value"><xsl:value-of select="//check_list/id"/></xsl:attribute></input>
+
<input name="status" type="hidden" value="0" />
+
<input name="type" type="hidden" value="control_item_type_1" />
+
+
<div class="check_item">
+
<div>
+
<label class="comment">Beskrivelse av sak</label>
+
<textarea name="case_descr">
+
<xsl:value-of select="comment"/>
+
</textarea>
+
</div>
+
<div class="form-buttons">
+
<input type="submit" name="save_control" value="Registrer sak"
class="not_active" />
+
</div>
</div>
- </div>
+ </form>
</xsl:when>
<xsl:when
test="type = 'control_item_type_2'">
+ <form
id="frm_save_check_item"
action="index.php?menuaction=controller.uicheck_list.save_check_item&phpgw_return_as=json"
method="post">
+
<xsl:variable name="control_item_id"><xsl:value-of select="id"/></xsl:variable>
+ <input
type="hidden" name="control_item_id" value="{$control_item_id}" />
+ <input
name="status" type="hidden" value="1" />
<input
name="type" type="hidden" value="control_item_type_2" />
+ <input
name="check_list_id" type="hidden"><xsl:attribute name="value"><xsl:value-of
select="//check_list/id"/></xsl:attribute></input>
+
<div
class="check_item">
- <div>
+ <div>
<label
class="comment">Registrer målingsverdi</label>
<input>
<xsl:attribute name="name">measurement</xsl:attribute>
@@ -69,13 +70,12 @@
</div>
<div
class="form-buttons">
<xsl:variable name="lang_save"><xsl:value-of
select="php:function('lang', 'register_error')" /></xsl:variable>
-
<input type="submit" name="save_control" value="Registrer sak"
class="not_active" title="{$lang_save}" />
+
<input type="submit" name="save_control" value="Registrer måling"
class="not_active" title="{$lang_save}" />
</div>
</div>
+ </form>
</xsl:when>
</xsl:choose>
-
- </form>
</li>
</xsl:for-each>
</ul>
Modified:
branches/Version-1_0-branch/controller/templates/base/check_list/view_closed_cases.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/check_list/view_closed_cases.xsl
2012-01-18 12:24:33 UTC (rev 8601)
+++
branches/Version-1_0-branch/controller/templates/base/check_list/view_closed_cases.xsl
2012-01-18 12:26:21 UTC (rev 8602)
@@ -36,7 +36,7 @@
</div>
</xsl:when>
<xsl:otherwise>
-
<div style="float:right;"><span style="color:red">Ingen
melding registrert!</span></div>
+
<div style="float:right;"><span style="color:red">Ingen
melding registrert</span></div>
</xsl:otherwise>
</xsl:choose>
</li>
Modified:
branches/Version-1_0-branch/controller/templates/base/check_list/view_measurements.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/check_list/view_measurements.xsl
2012-01-18 12:24:33 UTC (rev 8601)
+++
branches/Version-1_0-branch/controller/templates/base/check_list/view_measurements.xsl
2012-01-18 12:26:21 UTC (rev 8602)
@@ -21,7 +21,7 @@
<form
id="frm_save_check_item"
action="index.php?menuaction=controller.uicheck_list.save_check_item"
method="post">
<xsl:variable name="check_item_id"><xsl:value-of select="id"/></xsl:variable>
<input
type="hidden" name="check_item_id" value="{$check_item_id}" />
- <input
type="hidden" name="type" value="measurement" />
+ <input
type="hidden" name="type" value="control_item_type_2" />
<div
class="check_item">
<div>
Modified:
branches/Version-1_0-branch/controller/templates/base/check_list/view_open_cases.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/check_list/view_open_cases.xsl
2012-01-18 12:24:33 UTC (rev 8601)
+++
branches/Version-1_0-branch/controller/templates/base/check_list/view_open_cases.xsl
2012-01-18 12:26:21 UTC (rev 8602)
@@ -36,7 +36,7 @@
</div>
</xsl:when>
<xsl:otherwise>
-
<div style="float:right;"><span style="color:red">Ingen
melding registrert!</span></div>
+
<div style="float:right;"><span style="color:red">Ingen
melding registrert</span></div>
</xsl:otherwise>
</xsl:choose>
</li>
Modified: branches/Version-1_0-branch/controller/templates/base/css/base.css
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/css/base.css
2012-01-18 12:24:33 UTC (rev 8601)
+++ branches/Version-1_0-branch/controller/templates/base/css/base.css
2012-01-18 12:26:21 UTC (rev 8602)
@@ -1002,7 +1002,7 @@
width: 440px;
padding:0;
}
-.calendar .months a{
+.calendar .heading a{
text-decoration: none;
color:#000;
}
@@ -1245,6 +1245,9 @@
text-decoration: none;
width: 24px;
}
+.months a.view_check_list {
+ width: 30px;
+}
.cal_info_msg{
font-size: 16px;
padding: 40px 20px;
Modified:
branches/Version-1_0-branch/property/inc/cron/default/Import_fra_basware_X205.php
===================================================================
---
branches/Version-1_0-branch/property/inc/cron/default/Import_fra_basware_X205.php
2012-01-18 12:24:33 UTC (rev 8601)
+++
branches/Version-1_0-branch/property/inc/cron/default/Import_fra_basware_X205.php
2012-01-18 12:26:21 UTC (rev 8602)
@@ -483,12 +483,13 @@
if
(isset($GLOBALS['phpgw_info']['server']['smtp_server']) &&
$GLOBALS['phpgw_info']['server']['smtp_server'])
{
+ $send =
CreateObject('phpgwapi.send');
$subject = 'Ny faktura venter
på behandling';
$body = '<a href ="' .
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uiinvoice.index', 'voucher_id' => $bilagsnr, 'query' => $bilagsnr,
'user_lid' =>'all'),false,true).'">Link til fakturabehandling</a>';
try
{
- $rc =
$this->send->msg('email', $to, $subject, stripslashes($body), '', $cc,
$bcc,'','','html');
+ $rc =
$send->msg('email', $to, $subject, stripslashes($body), '', $cc,
$bcc,'','','html');
}
catch (phpmailerException $e)
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [8602] Merge 8596:8601 from trunk,
Sigurd Nes <=