[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [8480] Merge 8474:8479 from trunk
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [8480] Merge 8474:8479 from trunk |
Date: |
Wed, 04 Jan 2012 07:47:57 +0000 |
Revision: 8480
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8480
Author: sigurdne
Date: 2012-01-04 07:47:56 +0000 (Wed, 04 Jan 2012)
Log Message:
-----------
Merge 8474:8479 from trunk
Modified Paths:
--------------
branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
branches/Version-1_0-branch/activitycalendar/inc/class.uiimport.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_item.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.uierror_report_message.inc.php
branches/Version-1_0-branch/controller/inc/model/class.check_item.inc.php
branches/Version-1_0-branch/controller/templates/base/create_error_report_message.xsl
branches/Version-1_0-branch/controller/templates/base/css/base.css
branches/Version-1_0-branch/controller/templates/base/edit_check_list.xsl
branches/Version-1_0-branch/controller/templates/base/view_calendar_year.xsl
branches/Version-1_0-branch/controller/templates/base/view_error_report_message.xsl
branches/Version-1_0-branch/property/inc/class.boinvoice.inc.php
branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php
branches/Version-1_0-branch/property/inc/class.uiinvoice.inc.php
branches/Version-1_0-branch/property/js/yahoo/invoice.index.js
branches/Version-1_0-branch/property/js/yahoo/invoice.list_sub.js
branches/Version-1_0-branch/property/js/yahoo/property.js
branches/Version-1_0-branch/property/setup/phpgw_no.lang
branches/Version-1_0-branch/property/templates/base/invoice.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
+
/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
Modified:
branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
2012-01-03 13:19:56 UTC (rev 8479)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
2012-01-04 07:47:56 UTC (rev 8480)
@@ -436,7 +436,7 @@
function select_district_list()
{
- $this->db->query("SELECT id, descr FROM fm_district where id
>'0' ORDER BY id ", __LINE__, __FILE__);
+ $this->db->query("SELECT id, descr FROM fm_district where id
>'0' AND NOT descr LIKE '%vrige%' ORDER BY id ", __LINE__, __FILE__);
$i = 0;
while ($this->db->next_record())
Modified:
branches/Version-1_0-branch/activitycalendar/inc/class.uiimport.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.uiimport.inc.php
2012-01-03 13:19:56 UTC (rev 8479)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.uiimport.inc.php
2012-01-04 07:47:56 UTC (rev 8480)
@@ -29,7 +29,8 @@
public $public_functions = array
(
- 'index' => true
+ 'index' => true,
+ 'import_organizations' => true
);
public function __construct()
@@ -171,7 +172,7 @@
// Import arenas if not done before and put them on the
users session
if (!phpgwapi_cache::session_get('activitycalendar',
'arenas')) {
- phpgwapi_cache::session_set('activitycalendar',
'arenas', $this->import_arenas());
+ phpgwapi_cache::session_set('activitycalendar',
'arenas', $this->import_organizations());
$this->log_messages(1);
return '1';
$this->clean_up();
@@ -481,14 +482,14 @@
else //add org unit without org no
{
$org_info = array();
- //if($activity_group &&
!$activity_group == '')
- //{
- // $org_info['name'] =
$activity_group;
- //}
- //else
- //{
+ if($activity_group && !$activity_group
== '')
+ {
+ $org_info['name'] =
$activity_group;
+ }
+ else
+ {
$org_info['name'] =
$org_name_tmp;
- //}
+ }
//$org_info['orgnr'] =
$this->decode($data[2]);
$org_info['homepage'] =
$this->decode($data[16]);
@@ -646,6 +647,149 @@
}
}
+ protected function import_organizations()
+ {
+ $soactivity =
activitycalendar_soactivity::get_instance();
+
+ $datalines = $this->csvdata;
+
+ $this->messages[] = "Read 'import_all.csv' file in " .
(time() - $start_time) . " seconds";
+ $this->messages[] = "'importfile.csv' contained " .
count($datalines) . " lines";
+
+ $db_activity = $soactivity->get_db();
+ $db_activity->transaction_begin();
+
+ foreach ($datalines as $data) {
+ $activityOK = true;
+ unset($activity_persons);
+ unset($activity_description);
+ unset($org_info);
+ unset($contact_person);
+ unset($contact1);
+ unset($contact2);
+ unset($contact3);
+ unset($contact4);
+ unset($new_org_id);
+
+ $activity_id = $this->decode($data[0]);
+ $org_name_tmp = $this->decode($data[1]);
+ if(strlen($org_name_tmp) > 50)
+ {
+ $org_name_tmp =
substr($org_name_tmp,0,49);
+ }
+ $org_email = $this->decode($data[5]);
+ if(strlen($org_email) > 50)
+ {
+ $org_email = substr($org_email,0,49);
+ }
+ $org_phone = $this->decode($data[4]);
+ if(strlen($org_phone) > 50)
+ {
+ $org_phone = substr($org_phone,0,49);
+ }
+ $contact_mail_2 = $this->decode($data[11]);
+ if(strlen($contact_mail_2) > 50)
+ {
+ $contact_mail_2 =
substr($contact_mail_2,0,49);
+ }
+
+ $contact1_name = $this->decode($data[3]);
+ if(strlen($contact1_name) > 50)
+ {
+ $contact1_name =
substr($contact1_name,0,49);
+ }
+ $contact1_phone = $this->decode($data[4]);
+ if(strlen($contact1_phone) > 50)
+ {
+ $contact1_phone =
substr($contact1_phone,0,49);
+ }
+ $contact2_name = $this->decode($data[7]);
+ if(strlen($contact2_name) > 50)
+ {
+ $contact2_name =
substr($contact2_name,0,49);
+ }
+ $contact2_phone = $this->decode($data[10]);
+ if(strlen($contact2_phone) > 50)
+ {
+ $contact2_phone =
substr($contact2_phone,0,49);
+ }
+
+ $activity =
$soactivity->get_single($activity_id);
+
+
+ $org_info = array();
+ $org_info['name'] = $org_name_tmp;
+
+ $org_info['homepage'] = $this->decode($data[6]);
+ $org_info['phone'] = $org_phone;
+ $org_info['email'] = $org_email;
+ $org_info['description'] =
$this->decode($data[2]);
+ $org_info['street'] = $this->decode($data[8]);
+ $org_info['zip'] = $this->decode($data[9]);
+ $org_info['activity_id'] = "";
+ $org_info['district'] =
$this->decode($data[12]);
+ $new_org_id =
$soactivity->add_organization($org_info);
+
+ $contact1 = array();
+ $contact1['name'] = $contact1_name;
+ $contact1['phone'] = $contact1_phone;
+ $contact1['mail'] = $org_email;
+ $contact1['org_id'] = $new_org_id;
+ $soactivity->add_contact_person_org($contact1);
+
+ $contact2 = array();
+ $contact2['name'] = $contact2_name;
+ $contact2['phone'] = $contact2_phone;
+ $contact2['mail'] = $contact_mail_2;
+ $contact2['org_id'] = $new_org_id;
+ $soactivity->add_contact_person_org($contact2);
+
+ $activity_persons =
activitycalendar_soorganization::get_instance()->get_contacts($new_org_id);
+
+ $activity_contact_person_2_address =
$this->decode($data[8]);
+ $activity_contact_person_2_zip =
$this->decode($data[9]);
+
+ if($activity){
+
$activity->set_organization_id($new_org_id);
+
//$activity->set_description($activity_description);
+
$activity->set_contact_person_2_address($activity_contact_person_2_address);
+
$activity->set_contact_person_2_zip($activity_contact_person_2_zip);
+ if($activity_persons)
+ {
+ //set contact persons
+
$activity->set_contact_persons($activity_persons);
+ }
+
+ if ($soactivity->store($activity)) {
+ $this->messages[] =
"Successfully updated activity: Title ({$activity->get_title()})";
+ } else {
+ $this->errors[] = "Error
updating activity: Title ({$activity->get_title()})";
+ $activityOK = false;
+ }
+ }
+ }
+
+ if($activityOK)
+ {
+ $this->messages[] = "Imported activities. (" .
(time() - $start_time) . " seconds)";
+ $db_activity->transaction_commit();
+ return true;
+ }
+ else
+ {
+ if(!$activityOK)
+ {
+ $this->messages[] = "Import of
activities failed. (" . (time() - $start_time) . " seconds)";
+ }
+ else
+ {
+ $this->messages[] = "Import of
activities/arenas failed. (" . (time() - $start_time) . " seconds)";
+ }
+ $db_activity->transaction_abort();
+ return false;
+ }
+ }
+
protected function getcsvdata($path, $skipfirstline = true)
{
// Open the csv file
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-03 13:19:56 UTC (rev 8479)
+++ branches/Version-1_0-branch/controller/inc/class.socheck_item.inc.php
2012-01-04 07:47:56 UTC (rev 8480)
@@ -60,7 +60,8 @@
'status',
'comment',
'check_list_id',
- 'message-ticket_id'
+ 'message_ticket_id',
+ 'measurement'
);
$values = array(
@@ -68,7 +69,8 @@
$this->marshal($check_item->get_status(),
'int'),
$this->marshal($check_item->get_comment(),
'string'),
$this->marshal($check_item->get_check_list_id(), 'int'),
-
$this->marshal($check_item->get_message_ticket_id(), 'int')
+
$this->marshal($check_item->get_message_ticket_id(), 'int'),
+ $this->marshal($check_item->get_measurement(),
'int')
);
$result = $this->db->query('INSERT INTO
controller_check_item (' . join(',', $cols) . ') VALUES (' . join(',', $values)
. ')', __LINE__,__FILE__);
@@ -82,10 +84,11 @@
$values = array(
'control_item_id = ' .
$this->marshal($check_item->get_control_item_id(), 'int'),
- 'status = ' .
$this->marshal($check_item->get_status(), 'int'),
+ 'status = ' . $check_item->get_status(),
'comment = ' .
$this->marshal($check_item->get_comment(), 'string'),
'check_list_id = ' .
$this->marshal($check_item->get_check_list_id(), 'int'),
- 'message_ticket_id = ' .
$this->marshal($check_item->get_message_ticket_id(), 'int')
+ 'message_ticket_id = ' .
$this->marshal($check_item->get_message_ticket_id(), 'int'),
+ 'measurement = ' .
$this->marshal($check_item->get_measurement(), 'int')
);
$result = $this->db->query('UPDATE
controller_check_item SET ' . join(',', $values) . " WHERE id=$id",
__LINE__,__FILE__);
@@ -132,6 +135,82 @@
return null;
}
}
+
+ public function get_check_items($check_list_id, $status, $type){
+ $sql = "SELECT ci.id as ci_id, ci.status,
control_item_id, ci.comment, ci.message_ticket_id, 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 ";
+ $sql .= "LEFT JOIN controller_control_item as coi ON
ci.control_item_id = coi.id ";
+ $sql .= "WHERE ci.check_list_id = $check_list_id ";
+
+ if($status == 'open')
+ $sql .= "AND ci.status = 0 ";
+ else if($status == 'handled')
+ $sql .= "AND ci.status = 1 ";
+
+ if($type != null)
+ $sql .= "AND coi.type = '$type'";
+
+ $this->db->query($sql);
+
+ while ($this->db->next_record()) {
+ $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_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_message_ticket_id($this->unmarshal($this->db->f('message_ticket_id',
true), 'int'));
+
$check_item->set_measurement($this->unmarshal($this->db->f('measurement',
true), 'int'));
+
+ $control_item = new
controller_control_item($this->unmarshal($this->db->f('coi_id', true), 'int'));
+ $control_item->set_title($this->db->f('title',
true), 'string');
+
$control_item->set_required($this->db->f('required', true), 'string');
+
$control_item->set_what_to_do($this->db->f('what_to_do', true), 'string');
+
$control_item->set_how_to_do($this->db->f('how_to_do', true), 'string');
+
$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();
+ }
+
+ return $check_items_array;
+ }
+
+ public function get_check_items_by_message($message_ticket_id){
+ $sql = "SELECT ci.id as ci_id, ci.status,
control_item_id, ci.comment, ci.message_ticket_id, 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 ";
+ $sql .= "LEFT JOIN controller_control_item as coi ON
ci.control_item_id = coi.id ";
+ $sql .= "WHERE ci.message_ticket_id =
$message_ticket_id ";
+
+ $this->db->query($sql);
+
+ while ($this->db->next_record()) {
+ $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_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_message_ticket_id($this->unmarshal($this->db->f('message_ticket_id',
true), 'int'));
+
$check_item->set_measurement($this->unmarshal($this->db->f('measurement',
true), 'int'));
+
+ $control_item = new
controller_control_item($this->unmarshal($this->db->f('coi_id', true), 'int'));
+ $control_item->set_title($this->db->f('title',
true), 'string');
+
$control_item->set_required($this->db->f('required', true), 'string');
+
$control_item->set_what_to_do($this->db->f('what_to_do', true), 'string');
+
$control_item->set_how_to_do($this->db->f('how_to_do', true), 'string');
+
$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();
+ }
+
+ return $check_items_array;
+ }
function get_id_field_name(){}
}
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-03 13:19:56 UTC (rev 8479)
+++ branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php
2012-01-04 07:47:56 UTC (rev 8480)
@@ -51,7 +51,13 @@
}
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,
completed_date, location_code, ci.id as ci_id, ci.status as ci_status,
control_item_id, ci.comment as ci_comment, check_list_id FROM
controller_check_list cl, controller_check_item ci WHERE cl.id = $check_list_id
AND cl.id = ci.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 .= "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 ";
+ $sql .= "WHERE cl.id = $check_list_id";
+
$this->db->query($sql);
$counter = 0;
@@ -90,9 +96,9 @@
public function get_single_with_check_items($check_list_id, $status,
$type){
$sql = "SELECT cl.id as cl_id, cl.status as cl_status,
cl.control_id, cl.comment as cl_comment, deadline, planned_date,
completed_date, location_code, ";
- $sql .= "ci.id as ci_id, ci.status as ci_status,
control_item_id, ci.comment as ci_comment, check_list_id, ";
+ $sql .= "ci.id as ci_id, ci.status as ci_status,
control_item_id, ci.comment as ci_comment, ci.measurement, check_list_id, ";
$sql .= "coi.title as coi_id, coi.title as coi_title,
coi.required as coi_required, coi.required as coi_required, ";
- $sql .= "coi.what_to_do as coi_what_to_do, coi.how_to_do as
coi_how_to_do, coi.control_group_id as coi_control_group_id ";
+ $sql .= "coi.what_to_do as coi_what_to_do, coi.how_to_do as
coi_how_to_do, coi.control_group_id as coi_control_group_id, coi.type ";
$sql .= "FROM controller_check_list cl ";
$sql .= "LEFT JOIN controller_check_item as ci ON cl.id =
ci.check_list_id ";
$sql .= "LEFT JOIN controller_control_item as coi ON
ci.control_item_id = coi.id ";
@@ -105,9 +111,7 @@
if($type != null)
$sql .= "AND coi.type = '$type'";
-
-
-
+
$this->db->query($sql);
$counter = 0;
@@ -132,6 +136,8 @@
$check_item->set_status($this->unmarshal($this->db->f('ci_status', true),
'bool'));
$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'));
+
$check_item->set_message_ticket_id($this->unmarshal($this->db->f('message_ticket_id',
true), 'int'));
+
$check_item->set_measurement($this->unmarshal($this->db->f('measurement',
true), 'int'));
$control_item = new
controller_control_item($this->unmarshal($this->db->f('coi_id', true), 'int'));
$control_item->set_title($this->db->f('coi_title', true), 'string');
@@ -139,6 +145,7 @@
$control_item->set_what_to_do($this->db->f('coi_what_to_do', true), 'string');
$control_item->set_how_to_do($this->db->f('coi_how_to_do', true), 'string');
$control_item->set_control_group_id($this->db->f('coi_control_group_id', true),
'string');
+ $control_item->set_type($this->db->f('type',
true), 'string');
$check_item->set_control_item($control_item->toArray());
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-03 13:19:56 UTC (rev 8479)
+++ branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php
2012-01-04 07:47:56 UTC (rev 8480)
@@ -323,6 +323,7 @@
$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'));
+
$control_item->set_type($this->unmarshal($this->db->f('type', true), 'string'));
$results[] = $control_item;
}
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-03 13:19:56 UTC (rev 8479)
+++ branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php
2012-01-04 07:47:56 UTC (rev 8480)
@@ -353,13 +353,19 @@
$check_list_id = phpgw::get_var('check_list_id');
$comment = phpgw::get_var('comment');
$status = phpgw::get_var('status');
-
+ $type = phpgw::get_var('type');
+
$check_item_obj = new controller_check_item();
$check_item_obj->set_status($status);
$check_item_obj->set_comment($comment);
$check_item_obj->set_check_list_id($check_list_id);
$check_item_obj->set_control_item_id($control_item_id);
-
+
+ if($type == 'control_item_type_2'){
+ $measurement = phpgw::get_var('measurement');
+ $check_item_obj->set_measurement($measurement);
+ }
+
$check_item_id = $this->so_check_item->store(
$check_item_obj );
if($check_item_id > 0)
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-03 13:19:56 UTC (rev 8479)
+++
branches/Version-1_0-branch/controller/inc/class.uicheck_list_for_location.inc.php
2012-01-04 07:47:56 UTC (rev 8480)
@@ -51,6 +51,7 @@
private $so_control;
private $so_check_list;
private $so_control_item;
+ private $so_check_item;
var $public_functions = array(
'index' => true,
@@ -72,6 +73,7 @@
$this->so_control =
CreateObject('controller.socontrol');
$this->so_check_list =
CreateObject('controller.socheck_list');
$this->so_control_item =
CreateObject('controller.socontrol_item');
+ $this->so_check_item =
CreateObject('controller.socheck_item');
$this->type_id =
$this->bo->type_id;
@@ -361,24 +363,39 @@
function edit_check_list_for_location(){
$check_list_id = phpgw::get_var('check_list_id');
+
+ $check_list =
$this->so_check_list->get_single($check_list_id);
+ print_r($check_list);
+ // Fetches with check items
+ $open_check_items =
$this->so_check_item->get_check_items($check_list_id, 'open',
'control_item_type_1');
// Fetches check list with check items
- $open_check_list_with_check_items =
$this->so_check_list->get_single_with_check_items($check_list_id, 'open');
-
- // Fetches check list with check items
- $handled_check_list_with_check_items =
$this->so_check_list->get_single_with_check_items($check_list_id, 'handled');
+ $handled_check_items =
$this->so_check_item->get_check_items($check_list_id, 'handled',
'control_item_type_1');
- $location_code =
$open_check_list_with_check_items["location_code"];
+ $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_id($open_check_list_with_check_items["control_id"]);
+ $control_items_for_check_list =
$this->so_control_item->get_control_items_by_control_id($check_list->get_control_id());
- // Puts ids for control items that is registered as
check item in an array
+ // Fetches check items that registeres measurement
+ $measurement_check_items =
$this->so_check_item->get_check_items($check_list_id, null,
'control_item_type_2');
+
+ // Puts ids for control items that is registered as
open check item in an array
$control_item_ids = array();
-
foreach($open_check_list_with_check_items["check_item_array"] as $check_item){
+ foreach($open_check_items as $check_item){
$control_item_ids[] =
$check_item["control_item_id"];
}
+ // Puts ids for control items that is registered as
handled check item in an array
+ foreach($handled_check_items as $check_item){
+ $control_item_ids[] =
$check_item["control_item_id"];
+ }
+
+ // Puts ids for control items that is registered check
item measurements in an array
+ foreach($measurement_check_items as $check_item){
+ $control_item_ids[] =
$check_item["control_item_id"];
+ }
+
// Puts control items not registered as check item in
an array
$control_items_not_registered = array();
foreach($control_items_for_check_list as $control_item){
@@ -386,22 +403,20 @@
$control_items_not_registered[] =
$control_item->toArray();
}
}
-
- // Fetches check items that registeres measurement
- $measurement_check_items =
$this->so_check_list->get_single_with_check_items($check_list_id, null,
'control_item_type_2');
-
+
$date_format =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
$location_array =
execMethod('property.bolocation.read_single', array('location_code' =>
$location_code));
$data = array
(
- 'open_check_list_with_check_items'
=> $open_check_list_with_check_items,
- 'handled_check_list_with_check_items' =>
$handled_check_list_with_check_items,
- 'control_items_not_registered'
=> $control_items_not_registered,
- 'measurement_check_items'
=> $measurement_check_items,
- 'location_array'
=> $location_array,
- 'date_format'
=> $date_format
+ 'check_list'
=> $check_list->toArray(),
+ 'open_check_items'
=> $open_check_items,
+ 'handled_check_items' =>
$handled_check_items,
+ 'measurement_check_items' =>
$measurement_check_items,
+ 'control_items_not_registered' =>
$control_items_not_registered,
+ 'location_array'
=> $location_array,
+ 'date_format'
=> $date_format
);
self::add_javascript('controller', 'controller',
'jquery.js');
Modified:
branches/Version-1_0-branch/controller/inc/class.uierror_report_message.inc.php
===================================================================
---
branches/Version-1_0-branch/controller/inc/class.uierror_report_message.inc.php
2012-01-03 13:19:56 UTC (rev 8479)
+++
branches/Version-1_0-branch/controller/inc/class.uierror_report_message.inc.php
2012-01-04 07:47:56 UTC (rev 8480)
@@ -68,7 +68,7 @@
function create_error_report_message(){
$check_list_id = phpgw::get_var('check_list_id');
- $check_list_with_check_items =
$this->so_check_list->get_single_with_check_items($check_list_id);
+ $check_list_with_check_items =
$this->so_check_list->get_single_with_check_items($check_list_id, null,
'control_item_type_1');
$control_id =
$check_list_with_check_items["control_id"];
$control = $this->so_control->get_single( $control_id );
@@ -110,21 +110,22 @@
$message_title = phpgw::get_var('message_title');
$message_cat_id = phpgw::get_var('message_cat_id');
- $check_list_with_check_items =
$this->so_check_list->get_single_with_check_items($check_list_id);
+ $check_list =
$this->so_check_list->get_single($check_list_id);
- $control_id =
$check_list_with_check_items["control_id"];
+ $control_id = $check_list->get_control_id();
$control = $this->so_control->get_single( $control_id );
- $location_code =
$check_list_with_check_items["location_code"];
+ $location_code = $check_list->get_location_code();
$date_format =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
$location_array =
execMethod('property.bolocation.read_single', array('location_code' =>
$location_code));
-
+
+ // Generates message details from comment field in
check item
foreach($check_item_ids as $check_item_id){
$check_item =
$this->so_check_item->get_single($check_item_id);
- $details .= "Gjøremål: ";
- $details .= $check_item->get_comment() .
"<br>";
+ $message_details .= "Gjøremål: ";
+ $message_details .= $check_item->get_comment()
. "<br>";
}
$ticket = array
@@ -135,19 +136,22 @@
'cat_id' =>
$message_cat_id,
'priority' => $priority,
//valgfri (1-3)
'title' =>
$message_title,
- 'details' => $details,
+ 'details' =>
$message_details,
'file_input_name' => 'file' // default,
men valgfri
);
$botts = CreateObject('property.botts',true);
$message_ticket_id = $botts->add_ticket($ticket);
+ // Registers message and updates check items with
message ticket id
foreach($check_item_ids as $check_item_id){
$check_item =
$this->so_check_item->get_single($check_item_id);
$check_item->set_message_ticket_id(
$message_ticket_id );
$this->so_check_item->update($check_item);
}
+ $registered_message_check_items =
$this->so_check_item->get_check_items_by_message($message_ticket_id);
+
$message_ticket =
$botts->read_single($message_ticket_id);
$catsObj = CreateObject('phpgwapi.categories', -1,
'property', '.ticket');
@@ -157,12 +161,13 @@
$data = array
(
- 'message_ticket' =>
$message_ticket,
- 'category' =>
$category[0]['name'],
- 'location_array' =>
$location_array,
- 'control_array' =>
$control->toArray(),
- 'check_list' =>
$check_list_with_check_items,
- 'date_format' => $date_format
+ 'message_ticket'
=> $message_ticket,
+ 'category'
=> $category[0]['name'],
+ 'location_array'
=> $location_array,
+ 'control_array'
=> $control->toArray(),
+ 'check_list'
=> $check_list->toArray(),
+ 'registered_message_check_items' =>
$registered_message_check_items,
+ 'date_format'
=> $date_format
);
self::add_javascript('controller', 'controller',
'jquery.js');
Modified:
branches/Version-1_0-branch/controller/inc/model/class.check_item.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/model/class.check_item.inc.php
2012-01-03 13:19:56 UTC (rev 8479)
+++ branches/Version-1_0-branch/controller/inc/model/class.check_item.inc.php
2012-01-04 07:47:56 UTC (rev 8480)
@@ -72,10 +72,10 @@
public function set_status($status)
{
- $this->status = $status;
+ $this->status = (int)$status;
}
- public function get_status() { return $this->status; }
+ public function get_status() { return (int)$this->status; }
public function set_comment($comment)
{
Modified:
branches/Version-1_0-branch/controller/templates/base/create_error_report_message.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/create_error_report_message.xsl
2012-01-03 13:19:56 UTC (rev 8479)
+++
branches/Version-1_0-branch/controller/templates/base/create_error_report_message.xsl
2012-01-04 07:47:56 UTC (rev 8480)
@@ -4,24 +4,28 @@
<div id="main_content">
- <h1>Send avviksmelding</h1>
+ <h1>Registrer avviksmelding</h1>
+ <div class="tab_menu">
+ <a class="active" href="#">Meldingen gjelder</a>
+ </div>
<div id="error_report_message_details">
- <h3>Bygg: <xsl:value-of
select="location_array/loc1_name"/></h3>
- <h3>Tittel på kontroll: <xsl:value-of
select="control_array/title"/></h3>
+ <h3 class="first">Tittel på kontroll: <xsl:value-of
select="control_array/title"/></h3>
<xsl:choose>
<xsl:when test="check_list/completed_date != 0">
- <h3>Kontroll ble utført dato:
<xsl:value-of select="php:function('date', $date_format,
number(check_list/completed_date))"/></h3>
+ <h3>Kontroll ble utført
dato:<xsl:value-of select="php:function('date', $date_format,
number(check_list/completed_date))"/></h3>
</xsl:when>
<xsl:otherwise>
- <h3>Kontroll ble utført dato: Ikke
registrert utført</h3>
+ <h3>Kontroll ble utført dato: Ikke
registrert utført</h3>
</xsl:otherwise>
</xsl:choose>
+ <h3 class="last">Bygg: <xsl:value-of
select="location_array/loc1_name"/></h3>
</div>
-
+
+ <div class="tab_menu">
+ <a class="active" href="#">Detaljer for meldingen</a>
+ </div>
<fieldset id="error_report_message_details">
-
-
<xsl:choose>
<xsl:when
test="check_list/check_item_array/child::node()">
@@ -42,12 +46,12 @@
</input>
<div>
- <label style="font-size:
15px;font-weight: bold;">Tittel på melding</label>
+ <label>Tittel på melding</label>
<input name="message_title"
type="text" />
</div>
<div>
- <label style="font-size:
15px;font-weight: bold;">Kategori</label>
+ <label>Kategori</label>
<select name="message_cat_id">
<option value="0">Velg
kategori</option>
<xsl:for-each
select="categories/cat_list">
@@ -81,7 +85,14 @@
</xsl:choose>
</fieldset>
-
+ <a class="btn">
+ <xsl:attribute name="href">
+
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.edit_check_list_for_location</xsl:text>
+ <xsl:text>&check_list_id=</xsl:text>
+ <xsl:value-of select="check_list/id"/>
+ </xsl:attribute>
+ Vis sjekkliste
+ </a>
</div>
</xsl:template>
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-03 13:19:56 UTC (rev 8479)
+++ branches/Version-1_0-branch/controller/templates/base/css/base.css
2012-01-04 07:47:56 UTC (rev 8480)
@@ -819,7 +819,7 @@
}
ul.calendar li div {
float: left;
- width: 24px;
+ width: 30px;
padding: 3px;
text-align: center;
}
@@ -837,6 +837,9 @@
height: 800px;
margin-left: 40px;
}
+ul.calendar.days li div {
+ width: 24px;
+}
ul.calendar.days {
position: absolute;
width: 1120px;
@@ -1011,7 +1014,7 @@
}
.frm_save_check_item input[type='submit']{
- width: 130px;
+ width: 185px;
}
ul.check_items {
width: 625px;
@@ -1019,31 +1022,33 @@
ul.check_items h5{
margin:10px;
- font-size: 12px;
+ font-size: 13px;
}
.tab_menu {
- height: 29px;
overflow: hidden;
}
.tab_menu a {
- background: none repeat scroll 0 0 #FAFAFA;
+ background: none repeat scroll 0 0 #FAFAFA;
+ border-left: 1px solid #A3A3A3;
+ border-right: 1px solid #A3A3A3;
+ border-top: 1px solid #A3A3A3;
color: #000000;
cursor: pointer;
display: block;
- height: 30px;
- width: 130px;
- padding-top: 9px;
- text-align: center;
- text-decoration: none;
- border: 1px solid #A3A3A3;
float: left;
font-size: 12px;
font-weight: normal;
margin-right: 3px;
+ padding: 7px 0;
+ text-align: center;
+ text-decoration: none;
+ width: 150px;
}
.tab_menu a.active {
background: #2647A0;
- border: none;
+ border-left: 1px solid #173073;
+ border-right: 1px solid #173073;
+ border-top: 1px solid #173073;
color: #FFF;
}
.tab_item {
@@ -1104,14 +1109,27 @@
#main_content #error_report_message_details {
background: none repeat scroll 0 0 #EDF5FF;
border: 1px solid #DDDDDD;
- margin: 20px 0;
+ margin-bottom: 20px;
padding: 15px;
width: 800px;
}
#error_report_message_details label{
display: inline-block;
- width: 130px;
+ width: 130px;
+ font-weight: normal;
+ font-size: 15px;
}
+#error_report_message_details h3 {
+ font-size: 15px;
+ font-weight: normal;
+ margin: 10px 0;
+}
+#error_report_message_details h3.first {
+ margin-top:0;
+}
+#error_report_message_details h3.last {
+ margin-bottom:0;
+}
.btn{
background: none repeat scroll 0 0 #2647A0;
color: #FFFFFF;
@@ -1144,4 +1162,8 @@
display:none;
float: right;
margin-top: 20px;
+}
+
+a#view_errors_measurements{
+ display:none;
}
\ No newline at end of file
Modified:
branches/Version-1_0-branch/controller/templates/base/edit_check_list.xsl
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/edit_check_list.xsl
2012-01-03 13:19:56 UTC (rev 8479)
+++ branches/Version-1_0-branch/controller/templates/base/edit_check_list.xsl
2012-01-04 07:47:56 UTC (rev 8480)
@@ -27,13 +27,13 @@
var thisTabMenu = $(this).parent(".tab_menu");
var showId = $(thisTabA).attr("href");
- var hideId = $(".tab_menu
a.active").attr("href");
-
- $(".tab_menu a").removeClass("active");
- $(".tab_item").removeClass("active");
+ var hideId =
$(thisTabMenu).find("a.active").attr("href");
+
+ $(thisTabMenu).find("a").removeClass("active");
$(thisTabA).addClass('active');
-
+
$(hideId).hide();
+ $(hideId).removeClass("active")
$(showId).fadeIn('10', function(){
$(showId).addClass('active');
@@ -49,40 +49,55 @@
$(hideId).hide();
$(showId).fadeIn('10');
- $(thisA).fadeOut('10');
-
+ $(thisA).hide();
+ $("a#view_errors_measurements").css("display",
"block");
+
return false;
});
+ $("#view_errors_measurements").click(function(){
+ var thisA = $(this);
+ var showId = $(thisA).attr("href");
+ var hideId = "#register_errors";
+
+ $(hideId).hide();
+ $(showId).fadeIn('10');
+ $(thisA).hide();
+ $("a#reg_errors").css("display", "block");
+
+ return false;
+ });
+
});
</script>
- <h1>Endre sjekkliste for <xsl:value-of
select="location_array/loc1_name"/></h1>
+ <h1>Sjekkliste for <xsl:value-of
select="location_array/loc1_name"/></h1>
+ <div class="tab_menu"><a class="active">Detaljer</a></div>
<fieldset class="check_list_details">
<form id="frm_update_check_list"
action="index.php?menuaction=controller.uicheck_list.update_check_list"
method="post">
- <xsl:variable name="check_list_id"><xsl:value-of
select="open_check_list_with_check_items/id"/></xsl:variable>
+ <xsl:variable name="check_list_id"><xsl:value-of
select="check_list/id"/></xsl:variable>
<input type="hidden" name="check_list_id"
value="{$check_list_id}" />
<div>
<label>ID</label>
<input>
<xsl:attribute
name="name">check_list_id</xsl:attribute>
- <xsl:attribute name="value"><xsl:value-of
select="open_check_list_with_check_items/id"/></xsl:attribute>
+ <xsl:attribute name="value"><xsl:value-of
select="check_list/id"/></xsl:attribute>
</input>
</div>
<div>
<label>Status</label>
- <xsl:variable name="status"><xsl:value-of
select="open_check_list_with_check_items/status"/></xsl:variable>
+ <xsl:variable name="status"><xsl:value-of
select="check_list/status"/></xsl:variable>
<select name="status">
<xsl:choose>
- <xsl:when
test="open_check_list_with_check_items/status = 0">
+ <xsl:when
test="check_list/status = 0">
<option value="0"
SELECTED="SELECTED">Ikke utført</option>
<option value="1"
>Utført</option>
</xsl:when>
- <xsl:when
test="open_check_list_with_check_items/status = 1">
+ <xsl:when
test="check_list/status = 1">
<option value="0">Ikke
utført</option>
<option value="1"
SELECTED="SELECTED">Utført</option>
</xsl:when>
@@ -95,8 +110,8 @@
<xsl:attribute
name="id">deadline_date</xsl:attribute>
<xsl:attribute
name="name">deadline_date</xsl:attribute>
<xsl:attribute name="type">text</xsl:attribute>
- <xsl:if
test="open_check_list_with_check_items/deadline != 0">
- <xsl:attribute name="value"><xsl:value-of
select="php:function('date', $date_format,
number(open_check_list_with_check_items/deadline))"/></xsl:attribute>
+ <xsl:if test="check_list/deadline != 0">
+ <xsl:attribute name="value"><xsl:value-of
select="php:function('date', $date_format,
number(check_list/deadline))"/></xsl:attribute>
</xsl:if>
</input>
</div>
@@ -106,8 +121,8 @@
<xsl:attribute
name="id">planned_date</xsl:attribute>
<xsl:attribute
name="name">planned_date</xsl:attribute>
<xsl:attribute name="type">text</xsl:attribute>
- <xsl:if
test="open_check_list_with_check_items/planned_date != 0">
- <xsl:attribute name="value"><xsl:value-of
select="php:function('date', $date_format,
number(open_check_list_with_check_items/planned_date))"/></xsl:attribute>
+ <xsl:if test="check_list/planned_date != 0">
+ <xsl:attribute name="value"><xsl:value-of
select="php:function('date', $date_format,
number(check_list/planned_date))"/></xsl:attribute>
</xsl:if>
</input>
</div>
@@ -117,8 +132,8 @@
<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="open_check_list_with_check_items/completed_date != 0">
- <xsl:attribute name="value"><xsl:value-of
select="php:function('date', $date_format,
number(open_check_list_with_check_items/completed_date))"/></xsl:attribute>
+ <xsl:if test="check_list/completed_date != 0">
+ <xsl:attribute name="value"><xsl:value-of
select="php:function('date', $date_format,
number(check_list/completed_date))"/></xsl:attribute>
</xsl:if>
</input>
</div>
@@ -126,13 +141,13 @@
<label class="comment">Kommentar</label>
<textarea>
<xsl:attribute
name="name">comment</xsl:attribute>
- <xsl:value-of
select="open_check_list_with_check_items/comment"/>
+ <xsl:value-of select="check_list/comment"/>
</textarea>
</div>
<div class="form-buttons">
<xsl:variable name="lang_save"><xsl:value-of
select="php:function('lang', 'save_check_list')" /></xsl:variable>
- <input class="btn not_active" type="submit"
name="save_control" value="{$lang_save}" title="{$lang_save}" />
+ <input style="width: 170px;" class="btn
not_active" type="submit" name="save_control" value="Lagre detaljer" />
</div>
</form>
</fieldset>
@@ -145,24 +160,32 @@
<xsl:attribute name="href">
<xsl:text>#register_errors</xsl:text>
</xsl:attribute>
- Registrer avvik
+ Registrer avvik/måling
</a>
<a class="btn">
+ <xsl:attribute name="id">
+
<xsl:text>view_errors_measurements</xsl:text>
+ </xsl:attribute>
<xsl:attribute name="href">
+ <xsl:text>#view_errors</xsl:text>
+ </xsl:attribute>
+ Vis avvik/måling
+ </a>
+ <a class="btn">
+ <xsl:attribute name="href">
<xsl:text>index.php?menuaction=controller.uierror_report_message.create_error_report_message</xsl:text>
<xsl:text>&check_list_id=</xsl:text>
- <xsl:value-of
select="open_check_list_with_check_items/id"/>
+ <xsl:value-of select="check_list/id"/>
</xsl:attribute>
Send avviksmelding
</a>
</div>
<div id="register_errors">
- <div class="tab_menu"><a class="active">Registrer
avvik</a></div>
+ <div class="tab_menu"><a class="active">Registrer
avvik/måling</a></div>
<div class="tab_item active">
- <h2 class="check_item_details">Velg sjekkpunkter som
skal registreres som avvik</h2>
-
+
<xsl:choose>
<xsl:when
test="control_items_not_registered/child::node()">
@@ -173,58 +196,64 @@
<form
class="frm_save_control_item"
action="index.php?menuaction=controller.uicheck_list.add_check_item_to_list"
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>
-
<xsl:attribute name="name">check_list_id</xsl:attribute>
-
<xsl:attribute name="type">hidden</xsl:attribute>
+ <input
name="check_list_id" type="hidden">
<xsl:attribute name="value">
-
<xsl:value-of select="//open_check_list_with_check_items/id"/>
+
<xsl:value-of select="//check_list/id"/>
</xsl:attribute>
</input>
- <input>
-
<xsl:attribute name="name">status</xsl:attribute>
-
<xsl:attribute name="type">hidden</xsl:attribute>
-
<xsl:attribute name="value">
-
<xsl:value-of select="0"/>
-
</xsl:attribute>
- </input>
-
- <div
class="check_item">
- <div>
- <label
class="comment">Påkrevd</label>
-
<input>
-
<xsl:attribute name="name">required</xsl:attribute>
-
<xsl:attribute name="type">checkbox</xsl:attribute>
-
<xsl:attribute name="value">
-
<xsl:value-of select="required"/>
-
</xsl:attribute>
-
</input>
- </div>
- <div>
-
<label class="comment">Kommentar</label>
-
<textarea name="comment">
-
<xsl:value-of select="comment"/>
-
</textarea>
+ <input
name="status" type="hidden" value="0" />
+
+ <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">Kommentar</label>
+
<textarea name="comment">
+
<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}" />
+
</div>
+
</div>
+
</xsl:when>
+
<xsl:when test="type = 'control_item_type_2'">
+
<input name="type" type="hidden" value="control_item_type_2" />
+
<div class="check_item">
+
<div>
+
<label class="comment">Registrer målingsverdi</label>
+
<input>
+
<xsl:attribute name="name">measurement</xsl:attribute>
+
<xsl:attribute name="type">text</xsl:attribute>
+
<xsl:attribute name="value">
+
<xsl:value-of select="measurement"/>
+
</xsl:attribute>
+
</input>
</div>
- <div>
- <label
style="vertical-align:top">Hva skal gjøres</label>
-
<textarea><xsl:value-of select="control_item/what_to_do"/></textarea>
- </div>
- <div>
- <label
style="vertical-align:top">Utførelsesbeskrivelse</label>
-
<textarea><xsl:value-of select="control_item/what_to_do"/></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}" />
+
<div>
+
<label class="comment">Kommentar</label>
+
<textarea name="comment">
+
<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="Registrer
avvik" class="not_active" title="{$lang_save}" />
+
</div>
</div>
- </div>
+
</xsl:when>
+ </xsl:choose>
+
</form>
</li>
</xsl:for-each>
</ul>
</xsl:when>
<xsl:otherwise>
- Ingen sjekkpunkter
+ Alle sjekkpunkter for kontroll
er registert som åpent/håndtert avvik eller måling
</xsl:otherwise>
</xsl:choose>
</div>
@@ -240,12 +269,12 @@
<div id="view_open_errors" class="tab_item active">
<xsl:choose>
- <xsl:when
test="open_check_list_with_check_items/check_item_array/child::node()">
+ <xsl:when test="open_check_items/child::node()">
<div class="expand_menu"><div
class="expand_all">Vis alle</div><div class="collapse_all focus">Skjul
alle</div></div>
<ul id="check_list_not_fixed_list"
class="check_items expand_list">
- <xsl:for-each
select="open_check_list_with_check_items/check_item_array">
+ <xsl:for-each
select="open_check_items">
<li>
<xsl:if
test="status = 0">
<h4><img src="controller/images/arrow_right.png"
width="14"/><span><xsl:value-of select="control_item/title"/></span></h4>
@@ -274,17 +303,9 @@
<xsl:value-of select="comment"/>
</textarea>
</div>
-
<div>
-
<label>Hva skal gjøres</label>
-
<textarea><xsl:value-of select="control_item/what_to_do"/></textarea>
-
</div>
-
<div>
-
<label>Utførelsesbeskrivelse</label>
-
<textarea><xsl:value-of select="control_item/what_to_do"/></textarea>
-
</div>
<div class="form-buttons">
<xsl:variable name="lang_save"><xsl:value-of
select="php:function('lang', 'save_check_item')" /></xsl:variable>
-
<input type="submit" name="save_control" value="{$lang_save}"
class="not_active" title="{$lang_save}" />
+
<input style="width: 200px;" type="submit" name="save_control"
value="Oppdater registrert avvik" class="not_active" title="{$lang_save}" />
</div>
</div>
</form>
@@ -301,12 +322,12 @@
<div id="view_handled_errors" class="tab_item">
<xsl:choose>
- <xsl:when
test="handled_check_list_with_check_items/check_item_array/child::node()">
+ <xsl:when
test="handled_check_items/child::node()">
<div class="expand_menu"><div
class="expand_all">Vis alle</div><div class="collapse_all focus">Skjul
alle</div></div>
<ul id="check_list_fixed_list"
class="check_items expand_list">
- <xsl:for-each
select="handled_check_list_with_check_items/check_item_array">
+ <xsl:for-each
select="handled_check_items">
<xsl:if
test="status = 1">
<li>
<h4><img
src="controller/images/arrow_right.png" width="14"/><span><xsl:value-of
select="control_item/title"/></span></h4>
@@ -335,17 +356,9 @@
<xsl:value-of select="comment"/>
</textarea>
</div>
-
<div>
-
<label>Hva skal gjøres</label>
-
<textarea><xsl:value-of select="control_item/what_to_do"/></textarea>
-
</div>
-
<div>
-
<label>Utførelsesbeskrivelse</label>
-
<textarea><xsl:value-of select="control_item/what_to_do"/></textarea>
-
</div>
<div class="form-buttons">
<xsl:variable name="lang_save"><xsl:value-of
select="php:function('lang', 'save_check_item')" /></xsl:variable>
-
<input type="submit" name="save_control" value="{$lang_save}"
class="not_active" title="{$lang_save}" />
+
<input type="submit" name="save_control" value="Oppdater
håndtert avvik" class="not_active" title="{$lang_save}" />
</div>
</div>
</form>
@@ -362,51 +375,41 @@
<div id="view_measurements" class="tab_item">
<xsl:choose>
- <xsl:when
test="measurement_check_items/check_item_array/child::node()">
+ <xsl:when
test="measurement_check_items/child::node()">
<div class="expand_menu"><div
class="expand_all">Vis alle</div><div class="collapse_all focus">Skjul
alle</div></div>
<ul id="check_list_not_fixed_list"
class="check_items expand_list">
- <xsl:for-each
select="handled_check_list_with_check_items/check_item_array">
+ <xsl:for-each
select="measurement_check_items">
<li>
<xsl:if
test="status = 0">
<h4><img src="controller/images/arrow_right.png"
width="14"/><span><xsl:value-of select="control_item/title"/></span></h4>
<form
class="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="check_item_id" value="{$check_item_id}" />
+
<input type="hidden" name="type" value="measurement" />
+
<div class="check_item">
<div>
-
<label>Status</label>
-
<select name="status">
-
<xsl:choose>
-
<xsl:when test="status = 0">
-
<option value="0" SELECTED="SELECTED">Feil på
sjekkpunkt</option>
-
<option value="1">Feil fikset</option>
-
</xsl:when>
-
<xsl:when test="status = 1">
-
<option value="0">Feil på sjekkpunkt</option>
-
<option value="1" SELECTED="SELECTED">Feil
fikset</option>
-
</xsl:when>
-
</xsl:choose>
-
</select>
+
<label>Målingsverdi</label>
+
<input>
+
<xsl:attribute name="name">measurement</xsl:attribute>
+
<xsl:attribute name="type">text</xsl:attribute>
+
<xsl:attribute name="value">
+
<xsl:value-of select="measurement"/>
+
</xsl:attribute>
+
</input>
</div>
+
<div>
<label class="comment">Kommentar</label>
<textarea name="comment">
<xsl:value-of select="comment"/>
</textarea>
</div>
-
<div>
-
<label>Hva skal gjøres</label>
-
<textarea><xsl:value-of select="control_item/what_to_do"/></textarea>
-
</div>
-
<div>
-
<label>Utførelsesbeskrivelse</label>
-
<textarea><xsl:value-of select="control_item/what_to_do"/></textarea>
-
</div>
<div class="form-buttons">
<xsl:variable name="lang_save"><xsl:value-of
select="php:function('lang', 'save_check_item')" /></xsl:variable>
-
<input type="submit" name="save_control" value="{$lang_save}"
class="not_active" title="{$lang_save}" />
+
<input type="submit" name="save_control" value="Oppdatert
registert måling" class="not_active" title="{$lang_save}" />
</div>
</div>
</form>
Modified:
branches/Version-1_0-branch/controller/templates/base/view_calendar_year.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/view_calendar_year.xsl
2012-01-03 13:19:56 UTC (rev 8479)
+++
branches/Version-1_0-branch/controller/templates/base/view_calendar_year.xsl
2012-01-04 07:47:56 UTC (rev 8480)
@@ -14,14 +14,13 @@
</fieldset>
</div>
- <ul id="icon_color_map">
- <li><img height="15"
src="controller/images/status_icon_yellow.png" /><span>Kontroll satt
opp</span></li>
- <li><img height="15"
src="controller/images/status_icon_light_green.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</span></li>
- <li><img height="15"
src="controller/images/status_icon_light_blue.png" /><span>Kontroll gjennomført
uten feil før frist</span></li>
- <li><img height="15"
src="controller/images/status_icon_dark_blue.png" /><span>Kontroll gjennomført
uten feil etter frist</span></li>
- <li><img height="15"
src="controller/images/status_icon_red.png" /><span>Kontroll gjennomført med
rapporterte feil</span></li>
- <li><img height="12"
src="controller/images/status_icon_red_cross.png" /><span>Kontroll ikke
gjennomført</span></li>
+ <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>
<ul class="calendar">
@@ -96,7 +95,7 @@
<xsl:text>&location_code=</xsl:text>
<xsl:value-of select="$location_code"/>
</xsl:attribute>
-
<img height="15" src="controller/images/status_icon_yellow.png" />
+
<img height="15" src="controller/images/status_icon_yellow_ring.png" />
</a>
</div>
</xsl:when>
@@ -108,7 +107,7 @@
<xsl:text>&check_list_id=</xsl:text>
<xsl:value-of select="info/check_list_id"/>
</xsl:attribute>
-
<img height="15" src="controller/images/status_icon_light_green.png" />
+
<img height="15" src="controller/images/status_icon_yellow.png" />
</a>
</div>
</xsl:when>
Modified:
branches/Version-1_0-branch/controller/templates/base/view_error_report_message.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/view_error_report_message.xsl
2012-01-03 13:19:56 UTC (rev 8479)
+++
branches/Version-1_0-branch/controller/templates/base/view_error_report_message.xsl
2012-01-04 07:47:56 UTC (rev 8480)
@@ -4,9 +4,11 @@
<div id="main_content">
- <h1>Send avviksmelding</h1>
+ <h1>Avviksmelding registrert</h1>
- <h3>Følgende meldingsdata ble sendt</h3>
+ <div class="tab_menu">
+ <a class="active" href="#">Meldingen gjaldt</a>
+ </div>
<div id="error_report_message_details">
<h3>Bygg: <xsl:value-of
select="location_array/loc1_name"/></h3>
<h3>Tittel på kontroll: <xsl:value-of
select="control_array/title"/></h3>
@@ -19,53 +21,31 @@
</xsl:otherwise>
</xsl:choose>
</div>
-
+
+ <div class="tab_menu">
+ <a class="active" href="#">Detaljer for melding</a>
+ </div>
<div id="error_report_message_details">
- <xsl:choose>
- <xsl:when
test="check_list/check_item_array/child::node()">
-
- <form class="frm_save_error_report_message"
action="index.php?menuaction=controller.uierror_report_message.save_error_report_message"
method="post">
- <input>
- <xsl:attribute
name="name">check_list_id</xsl:attribute>
- <xsl:attribute
name="type">hidden</xsl:attribute>
- <xsl:attribute name="value">
- <xsl:value-of select="check_list/id"/>
- </xsl:attribute>
- </input>
- <input>
- <xsl:attribute
name="name">location_code</xsl:attribute>
- <xsl:attribute
name="type">hidden</xsl:attribute>
- <xsl:attribute name="value">
- <xsl:value-of
select="location_array/location_code"/>
- </xsl:attribute>
- </input>
+ <div>
+ <label>Tittel på melding</label>
+ <xsl:value-of select="message_ticket/subject"/>
+ </div>
- <div>
- <label style="font-size:
15px;font-weight: bold;">Tittel på melding</label>
- <xsl:value-of
select="message_ticket/subject"/>
- </div>
-
- <div>
- <label style="font-size:
15px;font-weight: bold;">Kategori</label>
- <span><xsl:value-of
select="category"/></span>
- </div>
-
-
- <h3
class="check_item_details">Avviksmeldingen omfattet følgende sjekkpunkter</h3>
- <ul class="check_items">
- <xsl:for-each
select="check_list/check_item_array">
- <li>
- <xsl:variable
name="check_item_id"><xsl:value-of select="id" /></xsl:variable>
-
<h5><xsl:value-of select="control_item/title"/></h5>
- </li>
- </xsl:for-each>
- </ul>
- </form>
- </xsl:when>
- <xsl:otherwise>
- Ingen sjekkpunkter
- </xsl:otherwise>
- </xsl:choose>
+ <div>
+ <label>Kategori</label>
+ <span><xsl:value-of select="category"/></span>
+ </div>
+
+
+ <h3 class="check_item_details">Avviksmeldingen omfattet
følgende punkter</h3>
+ <ul class="check_items">
+ <xsl:for-each
select="registered_message_check_items">
+ <li>
+ <xsl:variable
name="check_item_id"><xsl:value-of select="id" /></xsl:variable>
+ <h5><xsl:value-of
select="control_item/title"/></h5>
+ </li>
+ </xsl:for-each>
+ </ul>
</div>
<a class="btn">
Modified: branches/Version-1_0-branch/property/inc/class.boinvoice.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.boinvoice.inc.php
2012-01-03 13:19:56 UTC (rev 8479)
+++ branches/Version-1_0-branch/property/inc/class.boinvoice.inc.php
2012-01-04 07:47:56 UTC (rev 8480)
@@ -657,4 +657,9 @@
$this->bocommon->download($values,$names,$descr);
}
}
+
+ public function forward($data)
+ {
+ return $this->so->forward($data);
+ }
}
Modified: branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php
2012-01-03 13:19:56 UTC (rev 8479)
+++ branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php
2012-01-04 07:47:56 UTC (rev 8480)
@@ -1499,4 +1499,57 @@
return $values;
}
+
+ /*
+ * Forward vouchers to other responsible
+ */
+ public function forward($data)
+ {
+ if(isset($data['forward']) &&
is_array($data['forward']) && isset($data['voucher_id']) && $data['voucher_id'])
+ {
+ $value_set = array();
+
+ foreach ($data['forward'] as $role => $user_lid)
+ {
+ $value_set[$role] = $user_lid;
+ }
+
+ if( $data['approve'] != $data['sign_orig'] )
+ {
+ switch ( $data['sign_orig'] )
+ {
+ case 'is_janitor':
+
$value_set['oppsynsigndato'] = null;
+ break;
+ case 'is_supervisor':
+
$value_set['saksigndato'] = null;
+ break;
+ case 'is_budget_responsible':
+
$value_set['budsjettsigndato'] = null;
+ break;
+ }
+
+ switch ( $data['approve'] )
+ {
+ case 'is_janitor':
+
$value_set['oppsynsigndato'] = date( $this->db->datetime_format() );
+
$value_set['oppsynsmannid'] = $data['my_initials'];
+ break;
+ case 'is_supervisor':
+
$value_set['saksigndato'] = date( $this->db->datetime_format() );
+
$value_set['saksbehandlerid'] = $data['my_initials'];
+ break;
+ case 'is_budget_responsible':
+
$value_set['budsjettsigndato'] = date( $this->db->datetime_format() );
+
$value_set['budsjettansvarligid'] = $data['my_initials'];
+ break;
+ }
+ }
+
+ $value_set =
$this->db->validate_update($value_set);
+ return $this->db->query("UPDATE fm_ecobilag SET
$value_set WHERE bilagsnr = '{$data['voucher_id']}'",__LINE__,__FILE__);
+ }
+
+ return false;
+ }
}
Modified: branches/Version-1_0-branch/property/inc/class.uiinvoice.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uiinvoice.inc.php
2012-01-03 13:19:56 UTC (rev 8479)
+++ branches/Version-1_0-branch/property/inc/class.uiinvoice.inc.php
2012-01-04 07:47:56 UTC (rev 8480)
@@ -60,7 +60,8 @@
'download_sub' => true,
'receipt' => true,
'edit' => true,
- 'reporting' => true
+ 'reporting' => true,
+ 'forward' => true
);
function property_uiinvoice()
@@ -1156,6 +1157,19 @@
)
);
+
+ $datatable['rowactions']['action'][] = array
+ (
+ 'my_name'
=> 'forward',
+ 'text' =>
lang('forward'),
+ 'action' =>
$GLOBALS['phpgw']->link('/index.php',array
+ (
+ 'menuaction' =>
'property.uiinvoice.forward',
+ 'target'
=> '_lightbox'
+ )),
+ 'parameters' => $parameters
+ );
+
if($this->acl_delete)
{
$datatable['rowactions']['action'][] =
array
@@ -3680,4 +3694,166 @@
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('reporting' => $data));
}
+ /**
+ * forward voucher to other persons
+ *
+ */
+
+ public function forward()
+ {
+ $GLOBALS['phpgw_info']['flags']['noframework'] = true;
+
+ $user_lid = phpgw::get_var('user_lid', 'string',
'GET', 'all');
+ $voucher_id = phpgw::get_var('voucher_id', 'int',
'GET');
+ $redirect = false;
+
+ $role_check = array
+ (
+ 'is_janitor' =>
lang('janitor'),
+ 'is_supervisor' =>
lang('supervisor'),
+ 'is_budget_responsible' => lang('b -
responsible')
+ );
+
+ $roles = $this->bo->check_role();
+
+ $approve = array();
+ foreach ($roles as $role => $role_value)
+ {
+ if ($role_value && isset($role_check[$role]))
+ {
+ $approve[] = array
+ (
+ 'id' => $role,
+ 'name' =>
$role_check[$role],
+ 'selected' => 0
+ );
+ }
+ }
+
+ $values = phpgw::get_var('values');
+
+ $receipt = array();
+ if (isset($values['save']))
+ {
+ if($GLOBALS['phpgw']->session->is_repost())
+ {
+
$receipt['error'][]=array('msg'=>lang('repost'));
+ }
+
+ if(!$approve)
+ {
+
$receipt['error'][]=array('msg'=>lang('you are not approved for this task'));
+ }
+
+ if (!$receipt['error'])
+ {
+ $redirect = true;
+ $values['voucher_id'] = $voucher_id;
+ $line = $this->bo->forward($values);
+ }
+ }
+
+ $voucher = $this->bo->read_single_voucher($voucher_id);
+ $orders = array();
+ foreach ($voucher as $line)
+ {
+ $orders[] = $line['order_id'];
+ }
+
+ $approved_list = array();
+
+ $approved_list[] = array
+ (
+ 'role' => $role_check['is_janitor'],
+ 'role_sign' => 'oppsynsmannid',
+ 'initials' => $line['janitor'] ?
$line['janitor'] : '',
+ 'date' => $line['oppsynsigndato'] ?
$GLOBALS['phpgw']->common->show_date( strtotime( $line['oppsynsigndato'] ) )
:'',
+ 'user_list' => !$line['oppsynsigndato'] ?
array('options_user' =>
$this->bocommon->get_user_list_right(32,isset($line['janitor'])?$line['janitor']:'','.invoice'))
: ''
+ );
+ $approved_list[] = array
+ (
+ 'role' => $role_check['is_supervisor'],
+ 'role_sign' => 'saksbehandlerid',
+ 'initials' => $line['supervisor'] ?
$line['supervisor'] : '',
+ 'date' => $line['saksigndato'] ?
$GLOBALS['phpgw']->common->show_date( strtotime( $line['saksigndato'] ) ) :'',
+ 'user_list' => !$line['saksigndato'] ?
array('options_user' =>
$this->bocommon->get_user_list_right(64,isset($line['supervisor'])?$line['supervisor']:'','.invoice'))
: ''
+ );
+ $approved_list[] = array
+ (
+ 'role' =>
$role_check['is_budget_responsible'],
+ 'role_sign' => 'budsjettansvarligid',
+ 'initials' => $line['budget_responsible']
? $line['budget_responsible'] : '',
+ 'date' => $line['budsjettsigndato'] ?
$GLOBALS['phpgw']->common->show_date( strtotime( $line['budsjettsigndato'] ) )
:'',
+ 'user_list' => !$line['budsjettsigndato'] ?
array('options_user' =>
$this->bocommon->get_user_list_right(128,isset($line['budget_responsible'])?$line['budget_responsible']:'','.invoice'))
: ''
+ );
+
+ $my_initials =
$GLOBALS['phpgw_info']['user']['account_lid'];
+
+ foreach($approve as &$_approve)
+ {
+ if($_approve['id'] == 'is_janitor' &&
$my_initials == $line['janitor'] && $line['oppsynsigndato'])
+ {
+ $_approve['selected'] = 1;
+ $sign_orig = 'is_janitor';
+ }
+ else if($_approve['id'] == 'is_supervisor' &&
$my_initials == $line['supervisor'] && $line['saksigndato'])
+ {
+ $_approve['selected'] = 1;
+ $sign_orig = 'is_supervisor';
+ }
+ else if($_approve['id'] ==
'is_budget_responsible' && $my_initials == $line['budget_responsible'] &&
$line['budsjettsigndato'])
+ {
+ $_approve['selected'] = 1;
+ $sign_orig = 'is_budget_responsible';
+ }
+ }
+
+ unset($_approve);
+
+ $approve_list = array();
+ foreach($approve as $_approve)
+ {
+ if($_approve['id'] == 'is_janitor')
+ {
+ if(($my_initials == $line['janitor'] &&
$line['oppsynsigndato']) || !$line['oppsynsigndato'])
+ {
+ $approve_list[] = $_approve;
+ }
+ }
+ if($_approve['id'] == 'is_supervisor')
+ {
+ if(($my_initials == $line['supervisor']
&& $line['saksigndato']) || !$line['saksigndato'])
+ {
+ $approve_list[] = $_approve;
+ }
+ }
+ if($_approve['id'] == 'is_budget_responsible')
+ {
+ if(($my_initials ==
$line['budget_responsible'] && $line['budsjettsigndato']) ||
!$line['budsjettsigndato'])
+ {
+ $approve_list[] = $_approve;
+ }
+ }
+ }
+
+ $data = array
+ (
+ 'redirect'
=> $redirect ? $GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uiinvoice.index', 'user_lid' => $user_lid)) : null,
+ 'msgbox_data' =>
$GLOBALS['phpgw']->common->msgbox($GLOBALS['phpgw']->common->msgbox_data($receipt)),
+ 'from_name'
=> $GLOBALS['phpgw_info']['user']['fullname'],
+ 'form_action' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction' =>
'property.uiinvoice.forward', 'user_lid' => $user_lid, 'voucher_id' =>
$voucher_id)),
+ 'approve_list' =>
$approve_list,
+ 'approved_list' =>
$approved_list,
+ 'sign_orig'
=> $sign_orig,
+ 'my_initials' =>
$my_initials,
+ 'project_group_data' =>
$project_group_data,
+ 'orders'
=> implode('</br>', $orders),
+ 'value_amount' =>
$line['amount'],
+ 'value_currency' =>
$line['currency'],
+ 'value_process_log' =>
isset($values['process_log']) && $values['process_log'] ?
$values['process_log'] : $line['process_log']
+ );
+
+ $GLOBALS['phpgw']->xslttpl->add_file('invoice');
+ $GLOBALS['phpgw']->xslttpl->set_var('phpgw',
array('forward' => $data));
+ }
}
Modified: branches/Version-1_0-branch/property/js/yahoo/invoice.index.js
===================================================================
--- branches/Version-1_0-branch/property/js/yahoo/invoice.index.js
2012-01-03 13:19:56 UTC (rev 8479)
+++ branches/Version-1_0-branch/property/js/yahoo/invoice.index.js
2012-01-04 07:47:56 UTC (rev 8480)
@@ -23,11 +23,13 @@
{order:0, name:'query', id:'txt_query'}
]
+ // define Link Buttons
+ var linktoolTips = [
+ ]
+
var toolTips = [
{name:'voucher_id_lnk',title:'Voucher ID', description:'click
this link to enter the list of sub-invoices',ColumnDescription:''},
- // {name:'vendor_id_lnk', title:'',
description:'',ColumnDescription: 'vendor_name'},
{name:'voucher_date_lnk', title:'Payment Date',
description:'',ColumnDescription:'payment_date'},
- //{name:'period', title:'Period', description:'click this
button to edit the period',ColumnDescription:''},
{name:'btn_export', title:'download', description:'Download
table to your browser',ColumnDescription:''}
]
@@ -409,6 +411,22 @@
}
}
+
+ this.showlightbox = function(sUrl)
+ {
+ var onDialogShow = function(e, args, o)
+ {
+ var frame = document.createElement('iframe');
+ frame.src = sUrl;
+ frame.width = "100%";
+ frame.height = "460";
+ o.setBody(frame);
+ };
+ lightbox.showEvent.subscribe(onDialogShow, lightbox);
+ lightbox.show();
+ }
+
+
//----------------------------------------------------------
YAHOO.util.Event.addListener(window, "load", function()
{
@@ -428,9 +446,3 @@
loader.insert();
});
-
-
-
-
-
-
Modified: branches/Version-1_0-branch/property/js/yahoo/invoice.list_sub.js
===================================================================
--- branches/Version-1_0-branch/property/js/yahoo/invoice.list_sub.js
2012-01-03 13:19:56 UTC (rev 8479)
+++ branches/Version-1_0-branch/property/js/yahoo/invoice.list_sub.js
2012-01-04 07:47:56 UTC (rev 8480)
@@ -33,21 +33,8 @@
var tableYUI;
- this.showlightbox = function(sUrl)//(parameters, oRecord)
+ this.showlightbox = function(sUrl)
{
-
-//alert(sUrl);
-/*
- var oArgs = {menuaction:'property.uiinvoice.edit'};
- var sUrl = phpGWLink('index.php', oArgs);
-
- for(f=0; f<parameters.parameter.length; f++)
- {
- param_name = parameters.parameter[f].name;
- param_source = parameters.parameter[f].source;
- sUrl = sUrl + "&"+param_name+"=" +
oRecord.getData(param_source);
- }
-*/
var onDialogShow = function(e, args, o)
{
var frame = document.createElement('iframe');
Modified: branches/Version-1_0-branch/property/js/yahoo/property.js
===================================================================
--- branches/Version-1_0-branch/property/js/yahoo/property.js 2012-01-03
13:19:56 UTC (rev 8479)
+++ branches/Version-1_0-branch/property/js/yahoo/property.js 2012-01-04
07:47:56 UTC (rev 8480)
@@ -843,9 +843,10 @@
if(typeof(linktoolTips)=='object')
{
show_link_tooltips();
- create_lightbox();
}
+ create_lightbox();
+
toolbars =
YAHOO.util.Dom.getElementsByClassName('toolbar','div');
for(i=0;i<toolbars.length;i++)
{
@@ -921,7 +922,6 @@
myDataTable.on('cellMouseoverEvent', function (oArgs)
{
- {
if (showTimer)
{
window.clearTimeout(showTimer);
@@ -938,59 +938,61 @@
var rowspepage=0;
var param1=0;
- for(var p=0;p<toolTips.length;p++)
+ if(values_ds.recordsReturned > 0)
{
- if (column.key == toolTips[p].name)
+ for(var p=0;p<toolTips.length;p++)
{
- var record = this.getRecord(target);
- if(myPaginator.getCurrentPage() > 2 &&
myDataTable.getRecordSet().getRecords()[0]==null )
+ if (column.key == toolTips[p].name)
{
- title = toolTips[p].title ||
myDataTable.getRecordSet().getRecords()[this.getRecordIndex(target)].getData(toolTips[p].name);
- description =
toolTips[p].description ||
myDataTable.getRecordSet().getRecords()[this.getRecordIndex(target)].getData(toolTips[p].ColumnDescription);
- }
+ var record =
this.getRecord(target);
+ if(myPaginator.getCurrentPage()
> 2 && myDataTable.getRecordSet().getRecords()[0]==null )
+ {
+ title =
toolTips[p].title ||
myDataTable.getRecordSet().getRecords()[this.getRecordIndex(target)].getData(toolTips[p].name);
+ description =
toolTips[p].description ||
myDataTable.getRecordSet().getRecords()[this.getRecordIndex(target)].getData(toolTips[p].ColumnDescription);
+ }
- if(myPaginator.getCurrentPage() == 2 &&
myDataTable.getRecordSet().getRecords()[0]==null)
- {
- title = toolTips[p].title ||
myDataTable.getRecordSet().getRecords()[this.getRecordIndex(target)].getData(toolTips[p].name);
- description =
toolTips[p].description ||
myDataTable.getRecordSet().getRecords()[this.getRecordIndex(target)].getData(toolTips[p].ColumnDescription);
- }
- if(myPaginator.getCurrentPage() == 2 &&
myDataTable.getRecordSet().getRecords()[0]!=null)
- {
- rowspepage =
myPaginator.getRowsPerPage();
- num =
this.getRecordIndex(target)-rowspepage;
- title = toolTips[p].title ||
myDataTable.getRecordSet().getRecords()[num].getData(toolTips[p].name);
- description =
toolTips[p].description ||
myDataTable.getRecordSet().getRecords()[num].getData(toolTips[p].ColumnDescription);
- }
- if(myPaginator.getCurrentPage() == 1 &&
myDataTable.getRecordSet().getRecords()[0]!=null)
- {
- title = toolTips[p].title ||
myDataTable.getRecordSet().getRecords()[this.getRecordIndex(target)].getData(toolTips[p].name);
- description =
toolTips[p].description ||
myDataTable.getRecordSet().getRecords()[this.getRecordIndex(target)].getData(toolTips[p].ColumnDescription);
- }
- if(myPaginator.getCurrentPage() > 2 &&
myDataTable.getRecordSet().getRecords()[0]!=null)
- {
- pages =
parseInt(myPaginator.getCurrentPage()-1);
- rowspepage =
myPaginator.getRowsPerPage();
- param1 = parseInt(pages *
rowspepage);
- num =
parseInt(this.getRecordIndex(target) - param1);
- title = toolTips[p].title ||
myDataTable.getRecordSet().getRecords()[num].getData(toolTips[p].name);
- description =
toolTips[p].description ||
myDataTable.getRecordSet().getRecords()[num].getData(toolTips[p].ColumnDescription);
- }
+ if(myPaginator.getCurrentPage()
== 2 && myDataTable.getRecordSet().getRecords()[0]==null)
+ {
+ title =
toolTips[p].title ||
myDataTable.getRecordSet().getRecords()[this.getRecordIndex(target)].getData(toolTips[p].name);
+ description =
toolTips[p].description ||
myDataTable.getRecordSet().getRecords()[this.getRecordIndex(target)].getData(toolTips[p].ColumnDescription);
+ }
+ if(myPaginator.getCurrentPage()
== 2 && myDataTable.getRecordSet().getRecords()[0]!=null)
+ {
+ rowspepage =
myPaginator.getRowsPerPage();
+ num =
this.getRecordIndex(target)-rowspepage;
+ title =
toolTips[p].title ||
myDataTable.getRecordSet().getRecords()[num].getData(toolTips[p].name);
+ description =
toolTips[p].description ||
myDataTable.getRecordSet().getRecords()[num].getData(toolTips[p].ColumnDescription);
+ }
+ if(myPaginator.getCurrentPage()
== 1 && myDataTable.getRecordSet().getRecords()[0]!=null)
+ {
+ title =
toolTips[p].title ||
myDataTable.getRecordSet().getRecords()[this.getRecordIndex(target)].getData(toolTips[p].name);
+ description =
toolTips[p].description ||
myDataTable.getRecordSet().getRecords()[this.getRecordIndex(target)].getData(toolTips[p].ColumnDescription);
+ }
+ if(myPaginator.getCurrentPage()
> 2 && myDataTable.getRecordSet().getRecords()[0]!=null)
+ {
+ pages =
parseInt(myPaginator.getCurrentPage()-1);
+ rowspepage =
myPaginator.getRowsPerPage();
+ param1 = parseInt(pages
* rowspepage);
+ num =
parseInt(this.getRecordIndex(target) - param1);
+ title =
toolTips[p].title ||
myDataTable.getRecordSet().getRecords()[num].getData(toolTips[p].name);
+ description =
toolTips[p].description ||
myDataTable.getRecordSet().getRecords()[num].getData(toolTips[p].ColumnDescription);
+ }
- var xy =
[parseInt(oArgs.event.clientX,10) + 10 ,parseInt(oArgs.event.clientY,10) + 10 ];
+ var xy =
[parseInt(oArgs.event.clientX,10) + 10 ,parseInt(oArgs.event.clientY,10) + 10 ];
- showTimer = window.setTimeout(function()
- {
- tt.setBody("<table
class='tooltip-table'><tr class='tooltip'><td
class='nolink'>"+title+"</td></tr><tr><td>"+description+"</td></tr></table>");
- tt.cfg.setProperty('xy',xy);
- tt.show();
- hideTimer =
window.setTimeout(function()
+ showTimer =
window.setTimeout(function()
{
- tt.hide();
- },5000);
- },100);
+ tt.setBody("<table
class='tooltip-table'><tr class='tooltip'><td
class='nolink'>"+title+"</td></tr><tr><td>"+description+"</td></tr></table>");
+
tt.cfg.setProperty('xy',xy);
+ tt.show();
+ hideTimer =
window.setTimeout(function()
+ {
+ tt.hide();
+ },5000);
+ },100);
+ }
}
}
- }
});
myDataTable.on('cellMouseoutEvent', function (oArgs)
Modified: branches/Version-1_0-branch/property/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/property/setup/phpgw_no.lang 2012-01-03
13:19:56 UTC (rev 8479)
+++ branches/Version-1_0-branch/property/setup/phpgw_no.lang 2012-01-04
07:47:56 UTC (rev 8480)
@@ -803,6 +803,7 @@
force year for period property no Overstyr år for periode
format type property no Format type
formats property no Formater
+forward property no Videresend
fraction property no Fraksjon
from property no Fra
from date property no Fra dato
Modified: branches/Version-1_0-branch/property/templates/base/invoice.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/invoice.xsl
2012-01-03 13:19:56 UTC (rev 8479)
+++ branches/Version-1_0-branch/property/templates/base/invoice.xsl
2012-01-04 07:47:56 UTC (rev 8480)
@@ -1522,7 +1522,7 @@
</xsl:template>
<!-- New template-->
- <xsl:template match="approved_list">
+ <xsl:template match="approved_list" xmlns:php="http://php.net/xsl">
<tr>
<td align="left" style="white-space: nowrap;">
<xsl:value-of select="role"/>
@@ -1532,7 +1532,108 @@
<xsl:value-of select="initials"/>
<xsl:text>: </xsl:text>
<xsl:value-of select="date"/>
+ </xsl:if>
+ </td>
+ <td align="left" style="white-space: nowrap;">
+ <xsl:if test="date = ''">
+ <select name="values[forward][{role_sign}]">
+ <xsl:attribute name="title">
+ <xsl:value-of select="role"/>
+ </xsl:attribute>
+ <xsl:apply-templates
select="user_list/options_user"/>
+ </select>
</xsl:if>
</td>
</tr>
</xsl:template>
+
+
+ <!-- forward voucher -->
+ <xsl:template xmlns:php="http://php.net/xsl" match="forward">
+ <xsl:choose>
+ <xsl:when test="normalize-space(redirect) != ''">
+ <script>
+ window.parent.location = '<xsl:value-of
select="redirect"/>';
+ window.close();
+ </script>
+ </xsl:when>
+ </xsl:choose>
+ <form name="form" method="post" action="{form_action}">
+ <table cellpadding="0" cellspacing="0" width="100%">
+ <xsl:choose>
+ <xsl:when test="msgbox_data != ''">
+ <tr>
+ <td align="left"
colspan="2">
+
<xsl:call-template name="msgbox"/>
+ </td>
+ </tr>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:apply-templates select="approved_list"/>
+ <tr>
+ <input type="hidden"
name="values[sign_orig]" value="{sign_orig}"/>
+ <input type="hidden"
name="values[my_initials]" value="{my_initials}"/>
+ <td class="th_text" align="left"
valign="top" style="white-space: nowrap;">
+ <xsl:value-of
select="php:function('lang', 'approve')"/>
+ </td>
+ <td class="th_text" valign="top"
align="left">
+ <select name="values[approve]">
+ <xsl:attribute
name="title">
+ <xsl:value-of
select="php:function('lang', 'grant')"/>
+ </xsl:attribute>
+ <option value="">
+ <xsl:value-of
select="php:function('lang', 'select')"/>
+ </option>
+ <xsl:apply-templates
select="approve_list"/>
+ </select>
+ </td>
+ </tr>
+
+<!--
+ <tr>
+ <td class="th_text" align="left"
valign="top" style="white-space: nowrap;">
+ <xsl:value-of
select="php:function('lang', 'voucher process log')"/>
+ </td>
+ <td align="left">
+ <textarea cols="60" rows="10"
name="values[process_log]" wrap="virtual">
+ <xsl:attribute
name="title">
+ <xsl:value-of
select="php:function('lang', 'voucher process log')"/>
+ </xsl:attribute>
+ <xsl:value-of
select="value_process_log"/>
+ </textarea>
+ </td>
+ </tr>
+-->
+ <tr height="50">
+ <td>
+ <xsl:variable name="lang_send">
+ <xsl:value-of
select="php:function('lang', 'save')"/>
+ </xsl:variable>
+ <input type="submit"
name="values[save]" value="{$lang_send}" title="{$lang_send}">
+ </input>
+ </td>
+ </tr>
+ <tr>
+ <td class="th_text" align="left"
valign="top" >
+ <xsl:value-of
select="php:function('lang', 'order id')"/>
+ </td>
+ <td align="left" class="th_text"
valign="top">
+ <xsl:value-of
disable-output-escaping="yes" select="orders"/>
+ </td>
+ </tr> </table>
+ </form>
+ </xsl:template>
+
+ <!-- New template-->
+ <xsl:template match="options_user">
+ <option value="{lid}">
+ <xsl:if test="selected = 'selected'">
+ <xsl:attribute name="selected"
value="selected"/>
+ </xsl:if>
+ <xsl:value-of disable-output-escaping="yes"
select="lastname"/>
+ <xsl:text>, </xsl:text>
+ <xsl:value-of disable-output-escaping="yes"
select="firstname"/>
+ </option>
+ </xsl:template>
+
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [8480] Merge 8474:8479 from trunk,
Sigurd Nes <=