[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [7896] Merge 7888:7895 from trunk
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [7896] Merge 7888:7895 from trunk |
Date: |
Wed, 19 Oct 2011 07:04:39 +0000 |
Revision: 7896
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7896
Author: sigurdne
Date: 2011-10-19 07:04:36 +0000 (Wed, 19 Oct 2011)
Log Message:
-----------
Merge 7888:7895 from trunk
Modified Paths:
--------------
branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php
branches/Version-1_0-branch/controller/inc/class.socontrol_group.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.soprocedure.inc.php
branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
branches/Version-1_0-branch/controller/inc/class.uicontrol_group.inc.php
branches/Version-1_0-branch/controller/inc/class.uicontrol_item.inc.php
branches/Version-1_0-branch/controller/inc/class.uiprocedure.inc.php
branches/Version-1_0-branch/controller/inc/model/class.control.inc.php
branches/Version-1_0-branch/controller/setup/phpgw_no.lang
branches/Version-1_0-branch/controller/templates/base/control.xsl
branches/Version-1_0-branch/controller/templates/base/control_tabs.xsl
branches/Version-1_0-branch/controller/templates/base/procedure_item.xsl
branches/Version-1_0-branch/property/inc/class.borequest.inc.php
branches/Version-1_0-branch/property/inc/class.sorequest.inc.php
branches/Version-1_0-branch/property/inc/class.uilocation.inc.php
branches/Version-1_0-branch/property/inc/class.uirequest.inc.php
branches/Version-1_0-branch/property/inc/hook_config.inc.php
branches/Version-1_0-branch/property/js/yahoo/request.index.js
branches/Version-1_0-branch/property/templates/base/config.tpl
branches/Version-1_0-branch/property/templates/base/request.xsl
Added Paths:
-----------
branches/Version-1_0-branch/controller/setup/default_records.inc.php
branches/Version-1_0-branch/controller/templates/base/control_equipment.xsl
branches/Version-1_0-branch/controller/templates/base/control_locations.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
+
/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
Modified: branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php
2011-10-19 06:58:43 UTC (rev 7895)
+++ branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php
2011-10-19 07:04:36 UTC (rev 7896)
@@ -139,11 +139,15 @@
$clauses[] = '(' . join(' OR ', $like_clauses)
. ')';
}
}
-
+ //var_dump($filters);
if(isset($filters[$this->get_id_field_name()]))
{
$filter_clauses[] = "controller_control.id =
{$this->marshal($filters[$this->get_id_field_name()],'int')}";
}
+ if(isset($filters['control_areas']))
+ {
+ $filter_clauses[] = "controller_control.control_area_id
= {$this->marshal($filters['control_areas'],'int')}";
+ }
if(count($filter_clauses))
{
@@ -155,6 +159,8 @@
$tables = "controller_control";
//$joins = " {$this->left_join} rental_document_types ON
(rental_document.type_id = rental_document_types.id)";
+ $joins = " {$this->left_join} controller_control_area ON
(controller_control.control_area_id = controller_control_area.id)";
+ $joins .= " {$this->left_join} controller_procedure ON
(controller_control.procedure_id = controller_procedure.id)";
if($return_count)
{
@@ -162,7 +168,7 @@
}
else
{
- $cols = 'id, title, description, start_date, end_date,
procedure_id, requirement_id, costresponsibility_id, responsibility_id,
equipment_type_id, equipment_id, location_code, repeat_type, repeat_interval,
enabled ';
+ $cols = 'controller_control.id,
controller_control.title, controller_control.description,
controller_control.start_date, controller_control.end_date, procedure_id,
control_area_id, requirement_id, costresponsibility_id, responsibility_id,
equipment_type_id, equipment_id, location_code, repeat_type, repeat_interval,
enabled, controller_control_area.title AS control_area_name,
controller_procedure.title AS procedure_name ';
}
$dir = $ascending ? 'ASC' : 'DESC';
@@ -170,9 +176,13 @@
{
$sort_field = 'controller_control.title';
}
+ else if($sort_field == 'id')
+ {
+ $sort_field = 'controller_control.id';
+ }
$order = $sort_field ? "ORDER BY {$this->marshal($sort_field,
'field')} $dir ": '';
- return "SELECT {$cols} FROM {$tables} WHERE {$condition}
{$order}";
+ return "SELECT {$cols} FROM {$tables} {$joins} WHERE
{$condition} {$order}";
}
@@ -186,10 +196,12 @@
$control->set_start_date($this->unmarshal($this->db->f('start_date', true),
'int'));
$control->set_end_date($this->unmarshal($this->db->f('end_date', true), 'int'));
$control->set_procedure_id($this->unmarshal($this->db->f('procedure_id', true),
'int'));
+
$control->set_procedure_name($this->unmarshal($this->db->f('procedure_name',
true), 'string'));
$control->set_requirement_id($this->unmarshal($this->db->f('requirement_id',
true), 'int'));
$control->set_costresponsibility_id($this->unmarshal($this->db->f('costresponsibility_id',
true), 'int'));
$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'));
@@ -211,7 +223,10 @@
{
$id = (int)$id;
- $sql = "SELECT c.* FROM controller_control c WHERE c.id = " .
$id;
+ $joins = " {$this->left_join} controller_control_area ON
(c.control_area_id = controller_control_area.id)";
+ $joins .= " {$this->left_join} controller_procedure ON
(c.procedure_id = controller_procedure.id)";
+
+ $sql = "SELECT c.*, controller_control_area.title AS
control_area_name, controller_procedure.title AS procedure_name FROM
controller_control c {$joins} WHERE c.id = " . $id;
$this->db->limit_query($sql, 0, __LINE__, __FILE__, 1);
$this->db->next_record();
@@ -222,10 +237,12 @@
$control->set_start_date($this->unmarshal($this->db->f('start_date', true),
'int'));
$control->set_end_date($this->unmarshal($this->db->f('end_date', true), 'int'));
$control->set_procedure_id($this->unmarshal($this->db->f('procedure_id', true),
'int'));
+
$control->set_procedure_name($this->unmarshal($this->db->f('procedure_name',
true), 'string'));
$control->set_requirement_id($this->unmarshal($this->db->f('requirement_id',
true), 'int'));
$control->set_costresponsibility_id($this->unmarshal($this->db->f('costresponsibility_id',
true), 'int'));
$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'));
Modified:
branches/Version-1_0-branch/controller/inc/class.socontrol_group.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socontrol_group.inc.php
2011-10-19 06:58:43 UTC (rev 7895)
+++ branches/Version-1_0-branch/controller/inc/class.socontrol_group.inc.php
2011-10-19 07:04:36 UTC (rev 7896)
@@ -346,6 +346,10 @@
{
$filter_clauses[] = "controller_control_group.id =
{$this->marshal($filters[$this->get_id_field_name()],'int')}";
}
+ if(isset($filters['control_areas']))
+ {
+ $filter_clauses[] =
"controller_control_group.control_area_id =
{$this->marshal($filters['control_areas'],'int')}";
+ }
if(count($filter_clauses))
{
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
2011-10-19 06:58:43 UTC (rev 7895)
+++ branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php
2011-10-19 07:04:36 UTC (rev 7896)
@@ -47,7 +47,7 @@
);
$result = $this->db->query('INSERT INTO controller_control_item
(' . join(',', $cols) . ') VALUES (' . join(',', $values) . ')',
__LINE__,__FILE__);
- $result = $this->db->query($sql, __LINE__,__FILE__);
+ //$result = $this->db->query($sql, __LINE__,__FILE__);
if(isset($result)) {
// return the new control item ID
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
2011-10-19 06:58:43 UTC (rev 7895)
+++
branches/Version-1_0-branch/controller/inc/class.socontrol_item_list.inc.php
2011-10-19 07:04:36 UTC (rev 7896)
@@ -39,7 +39,7 @@
);
$result = $this->db->query( 'INSERT INTO
controller_control_item_list (' . join(',', $cols) . ') VALUES (' . join(',',
$values) . ')', __LINE__,__FILE__);
- $result = $this->db->query($sql, __LINE__,__FILE__);
+ //$result = $this->db->query($sql, __LINE__,__FILE__);
if(isset($result)) {
// return the new control item ID
Modified: branches/Version-1_0-branch/controller/inc/class.soprocedure.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.soprocedure.inc.php
2011-10-19 06:58:43 UTC (rev 7895)
+++ branches/Version-1_0-branch/controller/inc/class.soprocedure.inc.php
2011-10-19 07:04:36 UTC (rev 7896)
@@ -34,7 +34,9 @@
'responsibility',
'description',
'reference',
- 'attachment'
+ 'attachment',
+ 'start_date',
+ 'end_date'
);
$values = array(
@@ -43,7 +45,9 @@
$this->marshal($procedure->get_responsibility(),
'string'),
$this->marshal($procedure->get_description(), 'string'),
$this->marshal($procedure->get_reference(), 'string'),
- $this->marshal($procedure->get_attachment(), 'string')
+ $this->marshal($procedure->get_attachment(), 'string'),
+ $this->marshal($procedure->get_start_date(), 'int'),
+ $this->marshal($procedure->get_end_date(), 'int')
);
$result = $this->db->query('INSERT INTO controller_procedure ('
. join(',', $cols) . ') VALUES (' . join(',', $values) . ')',
__LINE__,__FILE__);
@@ -76,7 +80,9 @@
'responsibility = ' .
$this->marshal($procedure->get_responsibility(), 'string'),
'description = ' .
$this->marshal($procedure->get_description(), 'string'),
'reference = ' .
$this->marshal($procedure->get_reference(), 'string'),
- 'attachment = ' .
$this->marshal($procedure->get_attachment(), 'string')
+ 'attachment = ' .
$this->marshal($procedure->get_attachment(), 'string'),
+ 'start_date = ' .
$this->marshal($procedure->get_start_date(), 'int'),
+ 'end_date = ' .
$this->marshal($procedure->get_end_date(), 'int')
);
$result = $this->db->query('UPDATE controller_procedure SET ' .
join(',', $values) . " WHERE id=$id", __LINE__,__FILE__);
@@ -105,6 +111,8 @@
$procedure->set_description($this->unmarshal($this->db->f('description', true),
'string'));
$procedure->set_reference($this->unmarshal($this->db->f('reference', true),
'string'));
$procedure->set_attachment($this->unmarshal($this->db->f('attachment', true),
'string'));
+
$procedure->set_start_date($this->unmarshal($this->db->f('start_date'), 'int'));
+
$procedure->set_end_date($this->unmarshal($this->db->f('end_date'), 'int'));
return $procedure;
}
@@ -128,6 +136,8 @@
$procedure->set_description($this->unmarshal($this->db->f('description', true),
'string'));
$procedure->set_reference($this->unmarshal($this->db->f('reference', true),
'string'));
$procedure->set_attachment($this->unmarshal($this->db->f('attachment', true),
'string'));
+
$procedure->set_start_date($this->unmarshal($this->db->f('start_date'), 'int'));
+
$procedure->set_end_date($this->unmarshal($this->db->f('end_date'), 'int'));
$results[] = $procedure;
}
@@ -154,6 +164,8 @@
$procedure->set_description($this->unmarshal($this->db->f('description', true),
'string'));
$procedure->set_reference($this->unmarshal($this->db->f('reference', true),
'string'));
$procedure->set_attachment($this->unmarshal($this->db->f('attachment', true),
'string'));
+
$procedure->set_start_date($this->unmarshal($this->db->f('start_date'), 'int'));
+
$procedure->set_end_date($this->unmarshal($this->db->f('end_date'), 'int'));
$results[] = $procedure->toArray();;
}
@@ -312,7 +324,7 @@
}
else
{
- $cols .= "controller_procedure.id,
controller_procedure.title, controller_procedure.purpose,
controller_procedure.responsibility, controller_procedure.description,
controller_procedure.reference, controller_procedure.attachment ";
+ $cols .= "controller_procedure.id,
controller_procedure.title, controller_procedure.purpose,
controller_procedure.responsibility, controller_procedure.description,
controller_procedure.reference, controller_procedure.attachment,
controller_procedure.start_date, controller_procedure.end_date ";
}
$dir = $ascending ? 'ASC' : 'DESC';
$order = $sort_field ? "ORDER BY {$this->marshal($sort_field,
'field')} $dir ": '';
@@ -334,6 +346,8 @@
$procedure->set_description($this->unmarshal($this->db->f('description'),
'string'));
$procedure->set_reference($this->unmarshal($this->db->f('reference'),
'string'));
$procedure->set_attachment($this->unmarshal($this->db->f('attachment'),
'string'));
+
$procedure->set_start_date($this->unmarshal($this->db->f('start_date'), 'int'));
+
$procedure->set_end_date($this->unmarshal($this->db->f('end_date'), 'int'));
}
return $procedure;
Modified: branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
2011-10-19 06:58:43 UTC (rev 7895)
+++ branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
2011-10-19 07:04:36 UTC (rev 7896)
@@ -121,7 +121,7 @@
),
array(
'key' => 'title',
- 'label' =>
lang('Control title'),
+ 'label' =>
lang('Title'),
'sortable' =>
false
),
array(
@@ -130,11 +130,16 @@
'sortable' => false
),
array(
- 'key' =>
'control_area_id',
+ 'key' =>
'control_area_name',
'label' =>
lang('Control area'),
'sortable' => false
),
array(
+ 'key' =>
'procedurename',
+ 'label' =>
lang('Procedure'),
+ 'sortable' => false
+ ),
+ array(
'key' => 'link',
'hidden' => true
)
@@ -165,6 +170,16 @@
{
$this->edit_control_groups();
}
+ // Save locations and show tab control items
+ else if( isset($_POST['save_control_locations']) ||
phpgw::get_var('view') == "view_control_locations")
+ {
+ $this->edit_control_locations();
+ }
+ // Save equipment and show tab control items
+ else if( isset($_POST['save_control_equipment']) ||
phpgw::get_var('view') == "view_control_equipment")
+ {
+ $this->edit_control_equipment();
+ }
// Save control items and show tab receipt
else if( isset($_POST['save_control_items']) )
{
@@ -198,6 +213,10 @@
), array(
'label' =>
lang('Control_groups')
), array(
+ 'label' =>
lang('Control_locations')
+ ), array(
+ 'label' =>
lang('Control_equipment')
+ ), array(
'label' =>
lang('Control_items')
), array(
'label' =>
lang('Receipt')
@@ -212,7 +231,7 @@
'control_areas_array' =>
$control_areas_array,
'procedures_array' =>
$procedures_array,
'start_date' =>
$GLOBALS['phpgw']->yuical->add_listener('start_date',date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],
time())),
- 'end_date'
=>
$GLOBALS['phpgw']->yuical->add_listener('end_date',date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],
time()))
+ 'end_date'
=>
$GLOBALS['phpgw']->yuical->add_listener('end_date',date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],
''))
);
self::add_javascript('controller', 'yahoo',
'control_tabs.js');
@@ -251,14 +270,15 @@
array(
'label' =>
lang('Details'),
'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.index', 'view' => "view_control", 'control_id' =>
$control_id))
- ),
- array(
+ ), array(
'label' =>
lang('Control_groups')
- ),
- array(
+ ), array(
+ 'label' =>
lang('Control_locations')
+ ), array(
+ 'label' =>
lang('Control_equipment')
+ ), array(
'label' =>
lang('Control_items')
- ),
- array(
+ ), array(
'label' =>
lang('Receipt')
)
);
@@ -305,11 +325,13 @@
'label' =>
lang('Control_groups'),
'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.index', 'view' => "view_control_groups",
'control_id' => $control_id, 'control_group_ids' => $control_group_ids))
- ),
- array(
+ ), array(
+ 'label' =>
lang('Control_locations')
+ ), array(
+ 'label' =>
lang('Control_equipment')
+ ), array(
'label' =>
lang('Control_items')
- ),
- array(
+ ), array(
'label' =>
lang('Receipt')
)
);
@@ -317,7 +339,7 @@
$data = array
(
- 'tabs'
=> $GLOBALS['phpgw']->common->create_tabs($tabs, 2),
+ 'tabs'
=> $GLOBALS['phpgw']->common->create_tabs($tabs, 4),
'view'
=> 'control_items',
'control_group_ids' =>
implode($control_group_ids, ","),
'control_id' =>
$control_id,
@@ -389,20 +411,26 @@
'label' =>
lang('Control_groups'),
'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.index', 'view' => "view_control_groups",
'control_id' => $control_id, 'control_group_ids' => $control_group_ids))
- ),
- array(
+ ), array(
+ 'label' =>
lang('Control_locations'),
+ 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.index', 'view' => "view_control_locations",
+
'control_id' => $control_id, 'location_ids' => $location_ids))
+ ), array(
+ 'label' =>
lang('Control_equipment'),
+ 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.index', 'view' => "view_control_equipment",
+
'control_id' => $control_id, 'location_ids' => $euqipment_ids))
+ ), array(
'label' =>
lang('Control_items'),
'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.index', 'view' => "view_control_items",
'control_id' => $control_id, 'control_group_ids' => $control_group_ids))
- ),
- array(
+ ), array(
'label' =>
lang('Receipt')
)
);
$data = array
(
- 'tabs' =>
$GLOBALS['phpgw']->common->create_tabs($tabs, 3),
+ 'tabs' =>
$GLOBALS['phpgw']->common->create_tabs($tabs, 5),
'view' =>
"receipt",
'control_id' => $control_id,
'control_receipt_items' =>
$saved_groups_with_items_array
@@ -448,9 +476,115 @@
self::render_template_xsl(array('control_tabs',
'control_items_receipt'), $data);
}
+ public function edit_control_locations(){
+
+ $control_id = phpgw::get_var('control_id', 'int');
+
+ $control_group_ids = array();
+ $control_group_ids =
phpgw::get_var('control_group_ids');
+
+ $groups_with_control_items = array();
+
+ // Fetching control items for each control group and
populates array
+ foreach ($control_group_ids as $control_group_id)
+ {
+ $group_control_items_array =
$this->so_control_item->get_control_items_as_array($control_group_id);
+
+ $control_group =
$this->so_control_group->get_single($control_group_id);
+
+ $groups_with_control_items[] =
array("control_group" => $control_group->toArray(), "group_control_items" =>
$group_control_items_array);
+ }
+
+ $tabs = array(
+ array(
+ 'label' =>
lang('Details'),
+ 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.index', 'view' => "view_control", 'control_id' =>
$control_id))
+ ),
+ array(
+ 'label' =>
lang('Control_groups'),
+ 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.index', 'view' => "view_control_groups",
+
'control_id' => $control_id, 'control_group_ids' => $control_group_ids))
+ ), array(
+ 'label' =>
lang('Control_locations'),
+ 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.index', 'view' => "view_control_locations",
+
'control_id' => $control_id, 'location_ids' => $location_ids))
+ ), array(
+ 'label' =>
lang('Control_equipment')
+ ), array(
+ 'label' =>
lang('Control_items')
+ ), array(
+ 'label' =>
lang('Receipt')
+ )
+ );
+
+
+ $data = array
+ (
+ 'tabs'
=> $GLOBALS['phpgw']->common->create_tabs($tabs, 4),
+ 'view'
=> 'control_items',
+ 'control_group_ids' =>
implode($control_group_ids, ","),
+ 'control_id' =>
$control_id,
+ 'location_ids' =>
implode($location_ids, ","),
+ );
+
+ self::add_javascript('controller', 'yahoo',
'control_tabs.js');
+ self::add_javascript('controller', 'controller',
'jquery.js');
+ self::add_javascript('controller', 'controller',
'custom_ui.js');
+ self::render_template_xsl(array('control_tabs',
'control_items'), $data);
+ }
+ public function edit_control_equipment(){
+
+ $control_id = phpgw::get_var('control_id', 'int');
+
+ $equipment_ids = array();
+ $equipment_ids = phpgw::get_var('equipment_ids');
+
+ $groups_with_control_items = array();
+
+ $tabs = array(
+ array(
+ 'label' =>
lang('Details'),
+ 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.index', 'view' => "view_control", 'control_id' =>
$control_id))
+ ),
+ array(
+ 'label' =>
lang('Control_groups'),
+ 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.index', 'view' => "view_control_groups",
+
'control_id' => $control_id, 'control_group_ids' => $control_group_ids))
+ ), array(
+ 'label' =>
lang('Control_locations'),
+ 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.index', 'view' => "view_control_locations",
+
'control_id' => $control_id, 'location_ids' => $location_ids))
+ ), array(
+ 'label' =>
lang('Control_equipment'),
+ 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.index', 'view' => "view_control_euqipment",
+
'control_id' => $control_id, 'equipmentids' => $equipment_ids))
+ ), array(
+ 'label' =>
lang('Control_items')
+ ), array(
+ 'label' =>
lang('Receipt')
+ )
+ );
+
+
+ $data = array
+ (
+ 'tabs'
=> $GLOBALS['phpgw']->common->create_tabs($tabs, 4),
+ 'view'
=> 'control_items',
+ 'control_group_ids' =>
implode($control_group_ids, ","),
+ 'control_id' =>
$control_id,
+ 'groups_with_control_items' =>
$groups_with_control_items
+ );
+
+ self::add_javascript('controller', 'yahoo',
'control_tabs.js');
+ self::add_javascript('controller', 'controller',
'jquery.js');
+ self::add_javascript('controller', 'controller',
'custom_ui.js');
+ self::render_template_xsl(array('control_tabs',
'control_items'), $data);
+ }
+
public function query()
{
+ $filters = array();
$params = array(
'start' => phpgw::get_var('startIndex', 'int',
'REQUEST', 0),
'results' => phpgw::get_var('results', 'int',
'REQUEST', null),
@@ -459,6 +593,12 @@
'dir' => phpgw::get_var('dir'),
'filters' => $filters
);
+ //var_dump(phpgw::get_var('control_areas'));
+ $ctrl_area = phpgw::get_var('control_areas');
+ if(isset($ctrl_area) && $ctrl_area > 0)
+ {
+ $filters['control_areas'] = $ctrl_area;
+ }
$search_for = phpgw::get_var('query');
@@ -486,10 +626,11 @@
$control_id = phpgw::get_var('control_id');
if(isset($control_id))
{
- $control = $this->so->get_single($control_id);
+ $control =
$this->so_control->get_single($control_id);
}
- $result_objects = $this->so->get($start_index,
$num_of_objects, $sort_field, $sort_ascending, $search_for, $search_type,
$filters);
+ $result_objects = $this->so_control->get($start_index,
$num_of_objects, $sort_field, $sort_ascending, $search_for, $search_type,
$filters);
+ $object_count =
$this->so_control->get_count($search_for, $search_type, $filters);
//var_dump($result_objects);
$results = array();
@@ -498,6 +639,11 @@
{
$results['results'][] =
$control_obj->serialize();
}
+
+ $results['total_records'] = $object_count;
+ $results['start'] = $params['start'];
+ $results['sort'] = $params['sort'];
+ $results['dir'] = $params['dir'];
array_walk($results["results"], array($this,
"_add_links"), "controller.uicontrol.view");
@@ -517,7 +663,7 @@
{
if(isset($control_id) && $control_id > 0)
{
- $control =
$this->so->get_single($control_id);
+ $control =
$this->so_control->get_single($control_id);
}
else
{
@@ -528,16 +674,29 @@
$control_array = $control->toArray();
//var_dump($control);
- $tabs = array
- (
- 'details' => array('label' =>
lang('Details'), 'link' => '#details'),
- 'control_groups' =>
array('label' => lang('Control_groups'), 'link' => '#control_groups'),
- 'control_items' =>
array('label' => lang('Control_items'), 'link' => '#control_items')
- );
+ $tabs = array(
+ array(
+ 'label' =>
lang('Details'),
+ 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.index', 'view' => "view_control", 'control_id' =>
$control_id))
+ ),
+ array(
+ 'label' =>
lang('Control_groups'),
+ 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.index', 'view' => "view_control_groups",
+
'control_id' => $control->get_id(), 'control_group_ids' => $control_group_ids))
+ ), array(
+ 'label' =>
lang('Control_locations')
+ ), array(
+ 'label' =>
lang('Control_equipment')
+ ), array(
+ 'label' =>
lang('Control_items'),
+ 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.index', 'view' => "view_control_items",
+
'control_id' => $control->get_id(), 'control_group_ids' => $control_group_ids))
+ )
+ );
$add_document_link =
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=>
'controller.uiexample.index') );
- $procedure_array =
$this->so_proc->get_procedure_array();
+ $procedure_array =
$this->so_procedure->get_procedures();
foreach ($procedure_array as $procedure)
{
@@ -550,14 +709,20 @@
{
$control_area_options[] =
$control_area->toArray();
}
+
+ if($control->get_start_date() &&
$control->get_start_date() != null)
+ $control_start_date =
date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],
$control->get_start_date());
+ if($control->get_end_date() &&
$control->get_end_date() != null)
+ $control_end_date =
date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],
$control->get_end_date());
phpgwapi_yui::tabview_setup('control_tabview');
$data = array
(
'tabs'
=> phpgwapi_yui::tabview_generate($tabs, 'details'),
- 'start_date'
=>
$GLOBALS['phpgw']->yuical->add_listener('start_date',date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],
time())),
- 'end_date'
=>
$GLOBALS['phpgw']->yuical->add_listener('end_date',date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],
time())),
+ 'view'
=> 'control_details',
+ 'start_date'
=> $control_start_date,
+ 'end_date'
=> $control_end_date,
'value_id'
=> !empty($control) ? $control->get_id() : 0,
'img_go_home'
=> 'rental/templates/base/images/32x32/actions/go-home.png',
'control'
=> $control_array,
Modified:
branches/Version-1_0-branch/controller/inc/class.uicontrol_group.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicontrol_group.inc.php
2011-10-19 06:58:43 UTC (rev 7895)
+++ branches/Version-1_0-branch/controller/inc/class.uicontrol_group.inc.php
2011-10-19 07:04:36 UTC (rev 7896)
@@ -473,6 +473,12 @@
);
$search_for = phpgw::get_var('query');
+
+ $ctrl_area = phpgw::get_var('control_areas');
+ if(isset($ctrl_area) && $ctrl_area > 0)
+ {
+ $filters['control_areas'] = $ctrl_area;
+ }
if($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] > 0)
{
@@ -502,6 +508,7 @@
}*/
//var_dump($start_index.'-'.$num_of_objects.'-'.$sort_field.'-'.$sort_ascending.'-'.$search_for.'-'.$search_type.'-'.$filters);
$result_objects = $this->so->get($start_index,
$num_of_objects, $sort_field, $sort_ascending, $search_for, $search_type,
$filters);
+ $object_count = $this->so->get_count($search_for,
$search_type, $filters);
//var_dump($result_objects);
$results = array();
@@ -511,6 +518,11 @@
$results['results'][] =
$control_group_obj->serialize();
}
+ $results['total_records'] = $object_count;
+ $results['start'] = $params['start'];
+ $results['sort'] = $params['sort'];
+ $results['dir'] = $params['dir'];
+
array_walk($results["results"], array($this,
"_add_links"), "controller.uicontrol_group.view");
return $this->yui_results($results);
Modified:
branches/Version-1_0-branch/controller/inc/class.uicontrol_item.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicontrol_item.inc.php
2011-10-19 06:58:43 UTC (rev 7895)
+++ branches/Version-1_0-branch/controller/inc/class.uicontrol_item.inc.php
2011-10-19 07:04:36 UTC (rev 7896)
@@ -532,6 +532,7 @@
}
$result_objects =
$this->so_control_item->get($start_index, $num_of_objects, $sort_field,
$sort_ascending, $search_for, $search_type, $filters);
+ $object_count =
$this->so_control_item->get_count($search_for, $search_type, $filters);
//var_dump($result_objects);
$results = array();
@@ -540,6 +541,11 @@
{
$results['results'][] =
$control_item_obj->serialize();
}
+
+ $results['total_records'] = $object_count;
+ $results['start'] = $params['start'];
+ $results['sort'] = $params['sort'];
+ $results['dir'] = $params['dir'];
array_walk($results["results"], array($this,
"_add_links"), "controller.uicontrol_item.view");
Modified: branches/Version-1_0-branch/controller/inc/class.uiprocedure.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uiprocedure.inc.php
2011-10-19 06:58:43 UTC (rev 7895)
+++ branches/Version-1_0-branch/controller/inc/class.uiprocedure.inc.php
2011-10-19 07:04:36 UTC (rev 7896)
@@ -111,6 +111,8 @@
$procedure->set_description(phpgw::get_var('description','html'));
$procedure->set_reference(phpgw::get_var('reference'));
$procedure->set_attachment(phpgw::get_var('attachment'));
+
$procedure->set_start_date(strtotime(phpgw::get_var('start_date_hidden')));
+
$procedure->set_end_date(strtotime(phpgw::get_var('end_date_hidden')));
if(isset($procedure_id) &&
$procedure_id > 0)
{
@@ -164,6 +166,8 @@
$data = array
(
'value_id'
=> !empty($procedure) ? $procedure->get_id() : 0,
+ 'start_date' =>
$GLOBALS['phpgw']->yuical->add_listener('start_date',date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],
($procedure->get_start_date())?$procedure->get_start_date():time())),
+ 'end_date'
=>
$GLOBALS['phpgw']->yuical->add_listener('end_date',date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],
($procedure->get_end_date())?$procedure->get_end_date():'')),
'img_go_home' =>
'rental/templates/base/images/32x32/actions/go-home.png',
'editable'
=> true,
'procedure'
=> $procedure_array,
@@ -224,6 +228,10 @@
}
$procedure_array = $procedure->toArray();
+ if($procedure->get_start_date() &&
$procedure->get_start_date() != null)
+ $procedure_start_date =
date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],
$procedure->get_start_date());
+ if($procedure->get_end_date() &&
$procedure->get_end_date() != null)
+ $procedure_end_date =
date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],
$procedure->get_end_date());
//_debug_array($procedure_array);
$data = array
@@ -231,6 +239,8 @@
'value_id'
=> !empty($procedure) ? $procedure->get_id() : 0,
'img_go_home' =>
'rental/templates/base/images/32x32/actions/go-home.png',
'procedure'
=> $procedure_array,
+ 'start_date' =>
$procedure_start_date,
+ 'end_date'
=> $procedure_end_date
);
@@ -242,6 +252,15 @@
public function query()
{
+ $params = array(
+ 'start' => phpgw::get_var('startIndex', 'int',
'REQUEST', 0),
+ 'results' => phpgw::get_var('results', 'int',
'REQUEST', null),
+ 'query' => phpgw::get_var('query'),
+ 'sort' => phpgw::get_var('sort'),
+ 'dir' => phpgw::get_var('dir'),
+ 'filters' => $filters
+ );
+
if($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] > 0)
{
$user_rows_per_page =
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
@@ -293,8 +312,13 @@
}
// ... add result data
- $result_data = array('results' => $rows,
'total_records' => $object_count);
+ $result_data = array('results' => $rows);
+ $result_data['total_records'] = $object_count;
+ $result_data['start'] = $params['start'];
+ $result_data['sort'] = $params['sort'];
+ $result_data['dir'] = $params['dir'];
+
$editable = phpgw::get_var('editable') == 'true' ? true
: false;
if(!$export){
@@ -305,7 +329,7 @@
"controller.uiprocedure.view");
}
//_debug_array($result_data);
- return $this->yui_results($result_data,
'total_records', 'results');
+ return $this->yui_results($result_data);
}
Modified: branches/Version-1_0-branch/controller/inc/model/class.control.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/model/class.control.inc.php
2011-10-19 06:58:43 UTC (rev 7895)
+++ branches/Version-1_0-branch/controller/inc/model/class.control.inc.php
2011-10-19 07:04:36 UTC (rev 7896)
@@ -13,6 +13,7 @@
protected $repeat_type;
protected $repeat_interval;
protected $procedure_id;
+ protected $procedure_name;
protected $enabled;
protected $requirement_id;
protected $costresponsibility_id;
@@ -21,6 +22,7 @@
protected $equipment_type_id;
protected $location_code;
protected $control_area_id;
+ protected $control_area_name;
/*
var $validate = array(
@@ -104,6 +106,13 @@
public function get_procedure_id() { return
$this->procedure_id; }
+ public function set_procedure_name($procedure_name)
+ {
+ $this->procedure_name = $procedure_name;
+ }
+
+ public function get_procedure_name() { return
$this->procedure_name; }
+
public function set_enabled($enabled)
{
$this->enabled = $enabled;
@@ -160,6 +169,13 @@
public function get_control_area_id() { return
$this->control_area_id; }
+ public function set_control_area_name($control_area_name)
+ {
+ $this->control_area_name = $control_area_name;
+ }
+
+ public function get_control_area_name() { return
$this->control_area_name; }
+
/**
* Get a static reference to the storage object associated with
this model object
*
@@ -193,7 +209,9 @@
'start_date' => $this->get_start_date(),
'end_date' => $this->get_end_date(),
'procedure_id' => $this->get_procedure_id(),
- 'control_area_id' =>
$this->get_control_area_id()
+ 'procedure_name' => $this->get_procedure_name(),
+ 'control_area_id' =>
$this->get_control_area_id(),
+ 'control_area_name' =>
$this->get_control_area_name()
);
}
}
Copied: branches/Version-1_0-branch/controller/setup/default_records.inc.php
(from rev 7895, trunk/controller/setup/default_records.inc.php)
===================================================================
--- branches/Version-1_0-branch/controller/setup/default_records.inc.php
(rev 0)
+++ branches/Version-1_0-branch/controller/setup/default_records.inc.php
2011-10-19 07:04:36 UTC (rev 7896)
@@ -0,0 +1,187 @@
+<?php
+/**
+ * Holds the queries inserting default data (not test data):
+ *
+ * $oProc->query("sql_statement");
+ *
+ */
+/*
+// Default groups and users
+$GLOBALS['phpgw']->accounts = createObject('phpgwapi.accounts');
+$GLOBALS['phpgw']->acl = CreateObject('phpgwapi.acl');
+$GLOBALS['phpgw']->acl->enable_inheritance = true;
+
+
+$modules = array
+(
+ 'manual',
+ 'preferences',
+ 'controller',
+ 'property'
+);
+
+$acls = array
+(
+ array
+ (
+ 'appname' => 'preferences',
+ 'location' => 'changepassword',
+ 'rights' => 1
+ ),
+ array
+ (
+ 'appname' => 'controller',
+ 'location' => '.',
+ 'rights' => 1
+ ),
+ array
+ (
+ 'appname' => 'controller',
+ 'location' => 'run',
+ 'rights' => 1
+ ),
+ array
+ (
+ 'appname' => 'property',
+ 'location' => 'run',
+ 'rights' => 1
+ ),
+ array
+ (
+ 'appname' => 'property',
+ 'location' => '.',
+ 'rights' => 1
+ )
+);
+
+$aclobj =& $GLOBALS['phpgw']->acl;
+
+if (!$GLOBALS['phpgw']->accounts->exists('controller_group') ) // no
controller accounts already exists
+{
+ $account = new phpgwapi_group();
+ $account->lid = 'controller_group';
+ $account->firstname = 'Controller';
+ $account->lastname = 'Group';
+ $controller_group =
$GLOBALS['phpgw']->accounts->create($account, array(), array(), $modules);
+}
+else
+{
+ $controller_group =
$GLOBALS['phpgw']->accounts->name2id('controller_group');
+}
+
+$aclobj->set_account_id($controller_group, true);
+$aclobj->add('controller', '.', 1);
+$aclobj->add('controller', 'run', 1);
+$aclobj->add('property', '.', 1);
+$aclobj->add('property', 'run', 1);
+$aclobj->add('preferences', 'changepassword',1);
+$aclobj->add('preferences', '.',1);
+$aclobj->add('preferences', 'run',1);
+$aclobj->save_repository();
+
+// Create new users: create ($account, $goups, $acls, $arrays)
+// - Administrator
+if (!$GLOBALS['phpgw']->accounts->exists('controller_admin') ) // no rental
accounts already exists
+{
+ $account = new phpgwapi_user();
+ $account->lid = 'controller_admin';
+ $account->firstname = 'Controller';
+ $account->lastname = 'Administrator';
+ $account->passwd = 'EState12=';
+ $account->enabled = true;
+ $account->expires = -1;
+ $controller_admin = $GLOBALS['phpgw']->accounts->create($account,
array($rental_group), array(), array('admin'));
+}
+else
+{
+ $controller_admin =
$GLOBALS['phpgw']->accounts->name2id('controller_admin');
+ //Sigurd: seems to be needed for old installs
+ $GLOBALS['phpgw']->accounts->add_user2group($controller_admin,
$controller_group);
+}
+
+$aclobj->set_account_id($controller_admin, true);
+$aclobj->add('controller', '.', 31);
+$aclobj->save_repository();
+*/
+
+/*
+ * insert default records (test data)
+ * TODO: !!Remove before production!!
+ */
+
+//insert control areas
+$oProc->query("INSERT INTO controller_control_area (title) VALUES ('Miljø')");
+$oProc->query("INSERT INTO controller_control_area (title) VALUES ('IK -
Brann')");
+$oProc->query("INSERT INTO controller_control_area (title) VALUES ('IK -
Løfteinnretning')");
+$oProc->query("INSERT INTO controller_control_area (title) VALUES ('IK -
Elektro')");
+$oProc->query("INSERT INTO controller_control_area (title) VALUES ('IK -
Vannforsyning')");
+$oProc->query("INSERT INTO controller_control_area (title) VALUES
('Svømmeanlegg')");
+$oProc->query("INSERT INTO controller_control_area (title) VALUES ('IK -
Tilfluktsrom')");
+$oProc->query("INSERT INTO controller_control_area (title) VALUES
('Varmeanlegg')");
+$oProc->query("INSERT INTO controller_control_area (title) VALUES
('Ventilasjonsanlegg')");
+$oProc->query("INSERT INTO controller_control_area (title) VALUES ('Helse')");
+$oProc->query("INSERT INTO controller_control_area (title) VALUES
('Sikkerhet')");
+$oProc->query("INSERT INTO controller_control_area (title) VALUES ('Enøk')");
+$oProc->query("INSERT INTO controller_control_area (title) VALUES ('Divese -
Leietaker')");
+$oProc->query("INSERT INTO controller_control_area (title) VALUES ('Diverse -
Byggforvalter')");
+$oProc->query("INSERT INTO controller_control_area (title) VALUES
('Legionella')");
+
+//insert control groups
+$oProc->query("INSERT INTO controller_control_group (group_name,
control_area_id, procedure_id) VALUES ('Utstyr, f. eks blomster - og
plantekasser', 1, NULL)");
+$oProc->query("INSERT INTO controller_control_group (group_name,
control_area_id, procedure_id) VALUES ('Benker', 1, NULL)");
+$oProc->query("INSERT INTO controller_control_group (group_name,
control_area_id, procedure_id) VALUES ('Stell og vedlikehold av grøntanlegg/
utomhusanlegg', 1, NULL)");
+$oProc->query("INSERT INTO controller_control_group (group_name,
control_area_id, procedure_id) VALUES ('Utendørs fontener og springvann', 1,
NULL)");
+$oProc->query("INSERT INTO controller_control_group (group_name,
control_area_id, procedure_id) VALUES ('Kummer og tanker for tekniske
installasjoner', 1, NULL)");
+
+$oProc->query("INSERT INTO controller_control_group (group_name,
control_area_id, procedure_id) VALUES ('Brannbeskyttelse bærende konstruksjon',
2, NULL)");
+$oProc->query("INSERT INTO controller_control_group (group_name,
control_area_id, procedure_id) VALUES ('Brannsmitte', 2, NULL)");
+$oProc->query("INSERT INTO controller_control_group (group_name,
control_area_id, procedure_id) VALUES ('Rømningsvinduer', 2, NULL)");
+$oProc->query("INSERT INTO controller_control_group (group_name,
control_area_id, procedure_id) VALUES ('Branncellebegrensende konstruksjoner/
branntetting', 2, NULL)");
+$oProc->query("INSERT INTO controller_control_group (group_name,
control_area_id, procedure_id) VALUES ('Branndekker', 2, NULL)");
+$oProc->query("INSERT INTO controller_control_group (group_name,
control_area_id, procedure_id) VALUES ('Merking og ledesystem', 2, NULL)");
+$oProc->query("INSERT INTO controller_control_group (group_name,
control_area_id, procedure_id) VALUES ('Installasjon for manuell brannslokking
med vann', 2, NULL)");
+$oProc->query("INSERT INTO controller_control_group (group_name,
control_area_id, procedure_id) VALUES ('Installasjon for brannslokking med
sprinkler', 2, NULL)");
+$oProc->query("INSERT INTO controller_control_group (group_name,
control_area_id, procedure_id) VALUES ('Brannalarm', 2, NULL)");
+$oProc->query("INSERT INTO controller_control_group (group_name,
control_area_id, procedure_id) VALUES ('Anlegg for røyk- og brannventilasjon
generelt', 2, NULL)");
+$oProc->query("INSERT INTO controller_control_group (group_name,
control_area_id, procedure_id) VALUES ('Nødlysutstyr', 2, NULL)");
+
+$oProc->query("INSERT INTO controller_control_group (group_name,
control_area_id, procedure_id) VALUES ('Elkraft, generelt', 4, NULL)");
+
+$oProc->query("INSERT INTO controller_control_group (group_name,
control_area_id, procedure_id) VALUES ('Rutine for avviksbehandling', 5,
NULL)");
+$oProc->query("INSERT INTO controller_control_group (group_name,
control_area_id, procedure_id) VALUES ('Logg for avviksbehandling', 5, NULL)");
+$oProc->query("INSERT INTO controller_control_group (group_name,
control_area_id, procedure_id) VALUES ('Reparasjoner og utbedringer/ renhold
basseng', 5, NULL)");
+$oProc->query("INSERT INTO controller_control_group (group_name,
control_area_id, procedure_id) VALUES ('Vannstand/ vannfylling', 5, NULL)");
+$oProc->query("INSERT INTO controller_control_group (group_name,
control_area_id, procedure_id) VALUES ('Driftslogg generelt tilsyn/
trykkpumpe', 5, NULL)");
+$oProc->query("INSERT INTO controller_control_group (group_name,
control_area_id, procedure_id) VALUES ('Sjekkliste og rutiner', 5, NULL)");
+$oProc->query("INSERT INTO controller_control_group (group_name,
control_area_id, procedure_id) VALUES ('Sjekklister, rutiner og logg', 5,
NULL)");
+$oProc->query("INSERT INTO controller_control_group (group_name,
control_area_id, procedure_id) VALUES ('Vannprøver og resultater', 5, NULL)");
+
+//insert control items
+$oProc->query("INSERT INTO controller_control_item (title, required,
what_to_do, how_to_do, control_group_id) VALUES ('Er alle elektriske kabler
betryggende festet?', false, 'Kommer', 'Kommer', 1)");
+$oProc->query("INSERT INTO controller_control_item (title, required,
what_to_do, how_to_do, control_group_id) VALUES ('Er alle
svakstrøm/sterkstrømkabler forlagt adskilt?', false, 'Kommer', 'Kommer', 1)");
+$oProc->query("INSERT INTO controller_control_item (title, required,
what_to_do, how_to_do, control_group_id) VALUES ('Er noen kabler eller
ledninger skadet?', false, 'Kommer', 'Kommer', 1)");
+
+$oProc->query("INSERT INTO controller_control_item (title, required,
what_to_do, how_to_do, control_group_id) VALUES ('Er stikkontakter/brytere
betryggende festet?', false, 'Kommer', 'Kommer', 2)");
+$oProc->query("INSERT INTO controller_control_item (title, required,
what_to_do, how_to_do, control_group_id) VALUES ('Er det jordet og ujordet
anlegg i samme rom?', false, 'Kommer', 'Kommer', 2)");
+
+$oProc->query("INSERT INTO controller_control_item (title, required,
what_to_do, how_to_do, control_group_id) VALUES ('Er lysarmaturer betryggende
festet?', false, 'Kommer', 'Kommer', 3)");
+$oProc->query("INSERT INTO controller_control_item (title, required,
what_to_do, how_to_do, control_group_id) VALUES ('Er rørholdere på lysarmaturer
ok?', false, 'Kommer', 'Kommer', 3)");
+
+$oProc->query("INSERT INTO controller_control_item (title, required,
what_to_do, how_to_do, control_group_id) VALUES ('Foreligger dokumentasjon med
branntegning og oversiktsskjema der samsvarende referansenr på brann- og
røyktettinger er angitt?', false, 'Kommer', 'Kommer', 9)");
+$oProc->query("INSERT INTO controller_control_item (title, required,
what_to_do, how_to_do, control_group_id) VALUES ('Finnes
klassifisering/sertifikat på benyttede produkter samt tilhørende
monteringsanvisning?', false, 'Kommer', 'Kommer', 9)");
+$oProc->query("INSERT INTO controller_control_item (title, required,
what_to_do, how_to_do, control_group_id) VALUES ('Er oppgitt brannmotstand på
benyttede produkter ihht bygningskonstruksjonen/bygningsdelen?', false,
'Kommer', 'Kommer', 9)");
+$oProc->query("INSERT INTO controller_control_item (title, required,
what_to_do, how_to_do, control_group_id) VALUES ('Er den estetiske utformingen
av brann- og røyktettinger tilfredsstillende?', false, 'Kommer', 'Kommer', 9)");
+$oProc->query("INSERT INTO controller_control_item (title, required,
what_to_do, how_to_do, control_group_id) VALUES ('Foreligger dokumentasjon med
branntegning og oversiktsskjema der samsvarende referansenr på brann- og
røyktettinger er angitt?', false, 'Kommer', 'Kommer', 9)");
+$oProc->query("INSERT INTO controller_control_item (title, required,
what_to_do, how_to_do, control_group_id) VALUES ('Mangler den
brannklassifiserte bygningsdelen brann- og røyktettinger?', false, 'Kommer',
'Kommer', 9)");
+$oProc->query("INSERT INTO controller_control_item (title, required,
what_to_do, how_to_do, control_group_id) VALUES ('Merking av gjennomføringer
ivaretatt?', false, 'Kommer', 'Kommer', 9)");
+
+$oProc->query("INSERT INTO controller_control_item (title, required,
what_to_do, how_to_do, control_group_id) VALUES ('Påse at merking/armaturer er
på plass og fri for skader (hel, ren og ikke tildekket)', false, 'Kommer',
'Kommer', 11)");
+$oProc->query("INSERT INTO controller_control_item (title, required,
what_to_do, how_to_do, control_group_id) VALUES ('Kontroller alle armaturer
ift. funksjonalitet i normaldrift (nett tilkoblet)', false, 'Kontroller alle
armaturer ift. funksjonalitet i normaldrift (nett tilkoblet)<ul><li>Grønn
lysidiode på sentralen indikerer OK</li><li>Markeringslysets lyskilde
lyser</li><li>Ledelysets lyskilde lyser hvor ledelyset er koblet som en del av
allmennbelysningen</li></ul>', 'Kommer', 11)");
+$oProc->query("INSERT INTO controller_control_item (title, required,
what_to_do, how_to_do, control_group_id) VALUES ('Kontroller alle armaturer
ift. funksjonalitet i normaldrift (nett frakoblet)', false, 'Kontroller alle
armaturer ift. funksjonalitet i normaldrift (nett frakoblet)<ul><li>Sentralen
settes over i nøddrift</li><li>Oppsøk alle armaturer og utfør visuell sjekk av
armaturens funksjonalitet (også ledelys i tak/panikkbelysning)</li><li>Test
skal ikke vare lenger enn 25 % av total batterikapasitet for
sentralen</li></ul>', 'Kommer', 11)");
+$oProc->query("INSERT INTO controller_control_item (title, required,
what_to_do, how_to_do, control_group_id) VALUES ('Etter utført kontroll - Sett
sentralen i normal drift - Kontroller at indikatorlampe lyser.', false,
'Kontroller alle armaturer ift. funksjonalitet i normaldrift (nett
frakoblet)<ul><li>Sentralen settes over i nøddrift</li><li>Oppsøk alle
armaturer og utfør visuell sjekk av armaturens funksjonalitet (også ledelys i
tak/panikkbelysning)</li><li>Test skal ikke vare lenger enn 25 % av total
batterikapasitet for sentralen</li></ul>', 'Kommer', 11)");
+
+//insert procedures
+$oProc->query("INSERT INTO controller_procedure (title, purpose,
responsibility, description, reference, attachment) VALUES ('P40 Hvordan utføre
egenkontroll av elektriske anlegg i kommunale bygg', 'Å sikre at elektriske
anlegg i holdes forsvarlig stand i.h.t. forskrift om internkontroll av
elektriske installasjoner', 'Bergen kommunale bygg er ansvarlig for oppdatering
av rutiner og informasjon', 'Elektriske installasjoner skal kontrolleres i.h.t.
internkontrollforskriftens § 5', '', '')");
+$oProc->query("INSERT INTO controller_procedure (title, purpose,
responsibility, description, reference, attachment) VALUES ('P3811 Vannprøver
og resultater', 'Ved jevnlig prøvetaking kan vi avklare avvik så tidlig så
mulig og dermed sikre stabil vannkvalitet', 'Byggeier representert ved
ansvarlig drifts- og vedlikeholdsingeniør BBE KF.', '<ol><li><span>Drifts- og
vedlikeholdsingeniør skal sørge for at det foretas jevnlig prøvetaking med maks
3 måneders intervaller.
</span></li><li><span><span></span></span><span>Prøvetakingsutstyret skal være
godkjent av Næringsmiddeltilsynet og teknisk hygiene for Bergen og
Omland.</span></li><li><span>Personell som skal innhente vannprøver skal ha
nødvendig opplæring i dette. </span>Opplæring blir gitt av
Næringsmiddeltilsynet.</li><li><span><span></span></span><span>Prøvetaking skal
foregå iht. rutiner for prøvetaking som er vedlagt.
</span></li><li><span><span></span></span><span>Analyseresultater blir sendt
til BBE KF og tjenestested.</span></li><li><span><span></span></span><span>Kopi
analyseresultat settes i denne IK-perm kap.
3.</span></li><li><span><span></span></span><span>Dersom vannkvalitet ikke
tilfredsstiller kravet må DV-ingeniør konferere Næringsmiddeltilsynet for
korrigerende tiltak.</span></li><li><span><span></span></span><span>Eventuelle
avvik og korrigerende tiltak loggføres under kap. 6.</span></li><li><span>Punkt
9<br></span></li></ol></li>', '', '')");
+$oProc->query("INSERT INTO controller_procedure (title, purpose,
responsibility, description, reference, attachment) VALUES ('P3812
Sjekkliste/Rutiner/Logg', ' Ved bruk av sjekklister og faste
tilsynsrutiner oppnås stabil drift. Tilsyn og nødvendige kontrollpunkter skal
dokumenteres (loggføres) for at vi på en bedre måte kan vurdere anleggets
tilstand og dermed raskere oppdage avvik.', 'Driftsleder i bydel skal sørge for
at nødvendig tilsyn blir utført i tråd med fastalgte rutiner.',
'<ol><li>Drifts- og vedlikeholdsingeniør skal sørge for at denne IK-håndbok
ettterleves.</li><li>Driftsleder skal påse at ansvarlig driftspersonell foretar
rutinemessig tilsyn/ inspeksjon iht. kapittel 5.</li><li>Evt. avvik i forhold
til beskrevne rutiner skal begrunnes under kap. 6 avviksbehandling- (bruk
rapportskjema under kap. 6)</li><li>Avvik skal rapporteres til drifts- og
vedlikeholdsingeniør. Avvik kan være rutiner som ikke er fulgt, tekniske feil/
mangler, vannkvalitet som ikke tilfredsstiller gjeldende krav
o.l.</li></ol></li>', '', '')");
+
Modified: branches/Version-1_0-branch/controller/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/controller/setup/phpgw_no.lang 2011-10-19
06:58:43 UTC (rev 7895)
+++ branches/Version-1_0-branch/controller/setup/phpgw_no.lang 2011-10-19
07:04:36 UTC (rev 7896)
@@ -230,6 +230,8 @@
Procedure description controller no Beskrivelse
Procedure reference controller no Referanse
Procedure attachment controller no Vedlegg
+Procedure start date controller no Start dato
+Procedure end date controller no Slutt dato
New control item controller no Nytt kontrollpunkt
Control item title controller no Tittel
Control_group controller no Kontrollgruppe
@@ -248,4 +250,9 @@
New control group controller no Ny kontrollgruppe
Control group title controller no Tittel
Building part controller no Bygningsdel
-remove controller no Fjern valgte elementer
\ No newline at end of file
+remove controller no Fjern valgte elementer
+Locations controller no Lokasjoner
+Equipment controller no Utstyr
+Control_locations controller no Lokasjoner
+Control_equipment controller no Utstyr
+New control controller no Ny kontroll
\ No newline at end of file
Modified: branches/Version-1_0-branch/controller/templates/base/control.xsl
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/control.xsl
2011-10-19 06:58:43 UTC (rev 7895)
+++ branches/Version-1_0-branch/controller/templates/base/control.xsl
2011-10-19 07:04:36 UTC (rev 7896)
@@ -34,7 +34,7 @@
</select>
</xsl:when>
<xsl:otherwise>
- <xsl:value-of
select="control/control_area_id" />
+ <xsl:value-of
select="control/control_area_name" />
</xsl:otherwise>
</xsl:choose>
</dd>
@@ -62,7 +62,7 @@
</select>
</xsl:when>
<xsl:otherwise>
- <xsl:value-of
select="control/procedure_id" />
+ <xsl:value-of
select="control/procedure_name" />
</xsl:otherwise>
</xsl:choose>
</dd>
Copied:
branches/Version-1_0-branch/controller/templates/base/control_equipment.xsl
(from rev 7895, trunk/controller/templates/base/control_equipment.xsl)
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/control_equipment.xsl
(rev 0)
+++ branches/Version-1_0-branch/controller/templates/base/control_equipment.xsl
2011-10-19 07:04:36 UTC (rev 7896)
@@ -0,0 +1,23 @@
+<xsl:template name="control_equipment" xmlns:php="http://php.net/xsl">
+
+<div class="yui-content">
+ <div>
+
+ <!-- =========================== CHOOSE EQUIPMENT
=============================== -->
+ <h2>Velg Utstyrskategori/utstyr</h2>
+
+ <h4 class="expand_header"><div class="expand_all">Vis
alle</div><div class="collapse_all">Skjul alle</div></h4>
+ <form id="frm_control_items" action="#" method="post">
+
+ <xsl:variable name="control_id"><xsl:value-of
select="control_id"/></xsl:variable>
+ <input type="hidden" name="control_id" value="{control_id}" />
+ <strong>Velg utstyrskategori/utstyr</strong>
+ <div class="form-buttons">
+ <xsl:variable name="lang_save"><xsl:value-of
select="php:function('lang', 'save')" /></xsl:variable>
+ <input type="submit" name="save_control_equipment"
value="{$lang_save}" title = "{$lang_save}" />
+ </div>
+ </form>
+
+ </div>
+</div>
+</xsl:template>
\ No newline at end of file
Copied:
branches/Version-1_0-branch/controller/templates/base/control_locations.xsl
(from rev 7895, trunk/controller/templates/base/control_locations.xsl)
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/control_locations.xsl
(rev 0)
+++ branches/Version-1_0-branch/controller/templates/base/control_locations.xsl
2011-10-19 07:04:36 UTC (rev 7896)
@@ -0,0 +1,23 @@
+<xsl:template name="control_locations" xmlns:php="http://php.net/xsl">
+
+<div class="yui-content">
+ <div>
+
+ <!-- =========================== CHOOSE CONTROL LOCATIONS
=============================== -->
+ <h2>Velg Byggkategori/Eiendom/Bygg</h2>
+
+ <h4 class="expand_header"><div class="expand_all">Vis
alle</div><div class="collapse_all">Skjul alle</div></h4>
+ <form id="frm_control_items" action="#" method="post">
+
+ <xsl:variable name="control_id"><xsl:value-of
select="control_id"/></xsl:variable>
+ <input type="hidden" name="control_id" value="{control_id}" />
+ <strong>Liste over byggkategorier/eiendommer/bygg el.</strong>
+ <div class="form-buttons">
+ <xsl:variable name="lang_save"><xsl:value-of
select="php:function('lang', 'save')" /></xsl:variable>
+ <input type="submit" name="save_control_locations"
value="{$lang_save}" title = "{$lang_save}" />
+ </div>
+ </form>
+
+ </div>
+</div>
+</xsl:template>
\ No newline at end of file
Modified: branches/Version-1_0-branch/controller/templates/base/control_tabs.xsl
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/control_tabs.xsl
2011-10-19 06:58:43 UTC (rev 7895)
+++ branches/Version-1_0-branch/controller/templates/base/control_tabs.xsl
2011-10-19 07:04:36 UTC (rev 7896)
@@ -18,6 +18,20 @@
<xsl:value-of disable-output-escaping="yes"
select="tabs" />
<xsl:call-template name="control_groups" />
</xsl:when>
+ <xsl:when test="view = 'control_locations'">
+ <div class="identifier-header">
+ <h1><xsl:value-of select="php:function('lang',
'Control_locations')"/></h1>
+ </div>
+ <xsl:value-of disable-output-escaping="yes"
select="tabs" />
+ <xsl:call-template name="control_locations" />
+ </xsl:when>
+ <xsl:when test="view = 'control_equipment'">
+ <div class="identifier-header">
+ <h1><xsl:value-of select="php:function('lang',
'Control_equipment')"/></h1>
+ </div>
+ <xsl:value-of disable-output-escaping="yes"
select="tabs" />
+ <xsl:call-template name="control_equipment" />
+ </xsl:when>
<xsl:when test="view = 'control_items'">
<div class="identifier-header">
<h1><xsl:value-of select="php:function('lang',
'Control_items')"/></h1>
Modified:
branches/Version-1_0-branch/controller/templates/base/procedure_item.xsl
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/procedure_item.xsl
2011-10-19 06:58:43 UTC (rev 7895)
+++ branches/Version-1_0-branch/controller/templates/base/procedure_item.xsl
2011-10-19 07:04:36 UTC (rev 7896)
@@ -68,6 +68,18 @@
</xsl:choose>
</dd>
<dt>
+ <label
for="start_date"><xsl:value-of select="php:function('lang','Procedure start
date')" /></label>
+ </dt>
+ <dd>
+ <xsl:value-of
disable-output-escaping="yes" select="start_date"/>
+ </dd>
+ <dt>
+ <label
for="end_date"><xsl:value-of select="php:function('lang','Procedure end date')"
/></label>
+ </dt>
+ <dd>
+ <xsl:value-of
disable-output-escaping="yes" select="end_date"/>
+ </dd>
+ <dt>
<label
for="reference"><xsl:value-of select="php:function('lang','Procedure
Reference')" /></label>
</dt>
<dd>
Modified: branches/Version-1_0-branch/property/inc/class.borequest.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.borequest.inc.php
2011-10-19 06:58:43 UTC (rev 7895)
+++ branches/Version-1_0-branch/property/inc/class.borequest.inc.php
2011-10-19 07:04:36 UTC (rev 7896)
@@ -83,6 +83,7 @@
$start_date = phpgw::get_var('start_date');
$end_date = phpgw::get_var('end_date');
+ $building_part = phpgw::get_var('building_part');
if(isset($_POST['start']) || isset($_GET['start']))
{
@@ -125,6 +126,11 @@
{
$this->criteria_id = $criteria_id;
}
+ if(isset($_POST['building_part']) ||
isset($_GET['building_part']))
+ {
+ $this->building_part = $building_part;
+ }
+
if($allrows)
{
$this->allrows = $allrows;
@@ -162,9 +168,9 @@
$this->cat_id = $data['cat_id'];
$this->property_cat_id = $data['property_cat_id'];
$this->status_id = $data['status_id'];
+ $this->building_part = $data['building_part'];
$this->start_date =
isset($data['start_date']) ? $data['start_date']: '';
$this->end_date =
isset($data['end_date']) ? $data['end_date']: '';
-
}
@@ -404,7 +410,7 @@
'filter' => $this->filter,'district_id' =>
$this->district_id,'cat_id' => $this->cat_id,'status_id' => $this->status_id,
'project_id' =>
$data['project_id'],'allrows'=>$data['allrows'],'list_descr' =>
$data['list_descr'],
'dry_run'=>$data['dry_run'], 'p_num' =>
$this->p_num,'start_date'=>$this->start_date,'end_date'=>$this->end_date,
- 'property_cat_id' => $this->property_cat_id));
+ 'property_cat_id' => $this->property_cat_id,
'building_part' => $this->building_part));
$this->total_records = $this->so->total_records;
$this->sum_budget = $this->so->sum_budget;
Modified: branches/Version-1_0-branch/property/inc/class.sorequest.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sorequest.inc.php
2011-10-19 06:58:43 UTC (rev 7895)
+++ branches/Version-1_0-branch/property/inc/class.sorequest.inc.php
2011-10-19 07:04:36 UTC (rev 7896)
@@ -211,6 +211,7 @@
$p_num = isset($data['p_num']) ?
$data['p_num'] : '';
$start_date = isset($data['start_date']) &&
$data['start_date'] ? phpgwapi_datetime::date_to_timestamp($data['start_date'])
: 0;
$end_date = isset($data['end_date']) &&
$data['end_date'] ? phpgwapi_datetime::date_to_timestamp($data['end_date']) : 0;
+ $building_part = isset($data['building_part']) &&
$data['building_part'] ? (int)$data['building_part'] : 0;
$location_id =
$GLOBALS['phpgw']->locations->get_id('property', '.project.request');
$attribute_table = 'phpgw_cust_attribute';
@@ -398,10 +399,12 @@
$paranthesis .= '(';
$joinmethod .= "{$this->left_join} fm_request_consume
ON {$entity_table}.id = fm_request_consume.request_id)";
-
+ $GLOBALS['phpgw']->config->read();
+ $_location_level =
isset($GLOBALS['phpgw']->config->config_data['request_location_level']) &&
$GLOBALS['phpgw']->config->config_data['request_location_level'] ?
$GLOBALS['phpgw']->config->config_data['request_location_level'] : 0;
$sql =
$this->bocommon->generate_sql(array('entity_table'=>$entity_table,'cols'=>$cols,'cols_return'=>$cols_return,
'uicols'=>array(),'joinmethod'=>$joinmethod,'paranthesis'=>$paranthesis,
- 'query'=>$query,'force_location'=>true));
+ 'query'=>$query,'force_location'=>true,
'location_level' => $_location_level));
+ unset($_location_level);
$cols_group[] = "{$entity_table}.id";
$cols_group[] = 'fm_request_status.descr';
@@ -421,7 +424,6 @@
$where = 'WHERE';
$filtermethod = '';
- $GLOBALS['phpgw']->config->read();
if(isset($GLOBALS['phpgw']->config->config_data['acl_at_location']) &&
$GLOBALS['phpgw']->config->config_data['acl_at_location'])
{
$access_location =
$this->bocommon->get_location_list(PHPGW_ACL_READ);
@@ -429,9 +431,6 @@
$where= 'AND';
}
-
-
-
if ($property_cat_id > 0)
{
$filtermethod .= " $where
fm_location1.category='{$property_cat_id}' ";
@@ -440,16 +439,22 @@
if ($cat_id > 0)
{
- $filtermethod .= " $where
fm_request.category='{$cat_id}' ";
+ $filtermethod .= " $where
fm_request.category='{$cat_id}'";
$where = 'AND';
}
if ($status_id)
{
- $filtermethod .= " $where
fm_request.status='{$status_id}' ";
+ $filtermethod .= " $where
fm_request.status='{$status_id}'";
$where = 'AND';
}
+ if ($building_part)
+ {
+ $filtermethod .= " $where
fm_request.building_part='{$building_part}'";
+ $where = 'AND';
+ }
+
if ($start_date)
{
$end_date = $end_date + 3600 * 16 +
phpgwapi_datetime::user_timezone();
Modified: branches/Version-1_0-branch/property/inc/class.uilocation.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uilocation.inc.php
2011-10-19 06:58:43 UTC (rev 7895)
+++ branches/Version-1_0-branch/property/inc/class.uilocation.inc.php
2011-10-19 07:04:36 UTC (rev 7896)
@@ -1713,6 +1713,7 @@
$this->bocommon->no_access();
return;
}
+ $mode = 'view';
}
else
{
@@ -1721,6 +1722,7 @@
$this->bocommon->no_access();
return;
}
+ $mode = 'edit';
}
$values = array();
@@ -2076,7 +2078,7 @@
(
'entity_link' => $GLOBALS['phpgw']->link('/index.php',array
(
-
'menuaction'=> 'property.uilocation.edit',
+
'menuaction'=> "property.uilocation.{$mode}",
'location_code'=>implode('-',array_slice($location, 0, $location_type['id']))
)
),
Modified: branches/Version-1_0-branch/property/inc/class.uirequest.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uirequest.inc.php
2011-10-19 06:58:43 UTC (rev 7895)
+++ branches/Version-1_0-branch/property/inc/class.uirequest.inc.php
2011-10-19 07:04:36 UTC (rev 7896)
@@ -90,7 +90,7 @@
$this->district_id =
$this->bo->district_id;
$this->start_date =
$this->bo->start_date;
$this->end_date =
$this->bo->end_date;
-
+ $this->building_part =
$this->bo->building_part;
$this->allrows =
$this->bo->allrows;
$this->p_num =
$this->bo->p_num;
}
@@ -111,6 +111,7 @@
'start_date' => $this->start_date,
'end_date' =>
$this->end_date,
'property_cat_id' =>
$this->property_cat_id,
+ 'building_part' => $this->building_part
);
$this->bo->save_sessiondata($data);
}
@@ -241,7 +242,8 @@
."district_id: '{$this->district_id}',"
."start_date:'{$this->start_date}',"
."end_date: '{$this->end_date}',"
- ."cat_id:'{$this->cat_id}'";
+ ."cat_id:'{$this->cat_id}',"
+
."building_part:'{$this->building_part}'";
$values_combo_box[0] =
$this->bocommon->select_category_list(array
(
@@ -272,11 +274,22 @@
$default_value = array
('user_id'=>'','name'=>lang('no user'));
array_unshift
($values_combo_box[4],$default_value);
+ $_filter_buildingpart = array();
+ $filter_buildingpart =
isset($this->bo->config->config_data['filter_buildingpart']) ?
$this->bo->config->config_data['filter_buildingpart'] : array();
+
+ if($filter_key =
array_search('.project.request', $filter_buildingpart))
+ {
+ $_filter_buildingpart =
array("filter_{$filter_key}" => 1);
+ }
+
+ $building_part_list =
$this->bocommon->select_category_list(array('type'=> 'building_part','selected'
=>$this->building_part, 'order' => 'id', 'id_in_name' => 'num', 'filter' =>
$_filter_buildingpart));
+ array_unshift ($building_part_list, array
('id'=>'','name'=> lang('building part')));
+
$datatable['actions']['form'] = array
+ (
+ array
(
- array
- (
- 'action' =>
$GLOBALS['phpgw']->link('/index.php',
+ 'action' =>
$GLOBALS['phpgw']->link('/index.php',
array
(
'menuaction'
=> 'property.uirequest.index',
@@ -289,7 +302,8 @@
'district_id'
=> $this->district_id,
'query'
=> $this->query,
'start_date'
=> $this->start_date,
- 'end_date'
=> $this->end_date
+ 'end_date'
=> $this->end_date,
+ 'building_part'
=> $this->building_part
)
),
@@ -313,7 +327,7 @@
'value'
=> lang('district'),
'type'
=> 'button',
'style'
=> 'filter',
-
'tab_index' => 1
+
'tab_index' => 2
),
array
( //boton
CATEGORY
@@ -323,7 +337,7 @@
'value'
=> lang('Category'),
'type'
=> 'button',
'style'
=> 'filter',
-
'tab_index' => 2
+
'tab_index' => 3
),
array
( //boton
STATUS
@@ -332,30 +346,41 @@
'value'
=> lang('Status'),
'type'
=> 'button',
'style'
=> 'filter',
-
'tab_index' => 3
+
'tab_index' => 4
),
array
+ (
+ 'id' =>
'sel_building_part', // traditional listbox for long list
+ 'name'
=> 'building_part',
+ 'value'
=> lang('building part'),
+ 'type'
=> 'select',
+ 'style'
=> 'filter',
+
'values' => $building_part_list,
+
'onchange'=> 'onChangeSelect("building_part");',
+
'tab_index' => 5
+ ),
+ array
( //boton
FILTER
'id' =>
'btn_user_id',
'name'
=> 'filter',
'value'
=> lang('User'),
'type'
=> 'button',
'style'
=> 'filter',
-
'tab_index' => 4
+
'tab_index' => 6
),
array
(
'type'
=> 'button',
'id'
=> 'btn_update',
'value'
=> lang('Update project'),
-
'tab_index' => 9
+
'tab_index' => 14
),
array
(
'type'
=> 'button',
'id'
=> 'btn_export',
'value'
=> lang('download'),
-
'tab_index' => 8
+
'tab_index' => 13
),
array
@@ -363,7 +388,7 @@
'type'
=> 'button',
'id'
=> 'btn_new',
'value'
=> lang('add'),
-
'tab_index' => 7
+
'tab_index' => 12
),
array
(
@@ -391,7 +416,7 @@
'menuaction' => 'property.uiproject.date_search')
)."','','width=350,height=250')",
'value'
=> lang('Date search'),
-
'tab_index' => 9
+
'tab_index' => 11
),
array
@@ -401,7 +426,7 @@
'value'
=> lang('search'),
'onkeypress' => 'return pulsar(event)',
'type'
=> 'button',
-
'tab_index' => 6
+
'tab_index' => 10
),
array
( //hidden
request
@@ -418,7 +443,7 @@
'type'
=> 'text',
'size'
=> 28,
'onkeypress' => 'return pulsar(event)',
-
'tab_index' => 5
+
'tab_index' => 9
),
array
(
@@ -429,7 +454,7 @@
(
'menuaction' =>
'property.uirequest.priority_key'))."','','left=50,top=100,width=350,height=350,scrollbars=1')",
'value' => lang('Priority key'),
-
'tab_index' => 4
+
'tab_index' => 8
),
array
(
@@ -440,54 +465,54 @@
(
'menuaction' =>
'property.uirequest.columns'))."','','width=300,height=600,scrollbars=1')",
'value' => lang('columns'),
-
'tab_index' => 10
+
'tab_index' => 7
),
),
- 'hidden_value'
=> array
- (
- array
- ( //div
values combo_box_0
-
'id' => 'values_combo_box_0',
-
'value' => $this->bocommon->select2String($values_combo_box[0])
- ),
- array
- ( //div
values combo_box_1
-
'id' => 'values_combo_box_1',
-
'value' => $this->bocommon->select2String($values_combo_box[1])
- ),
- array
- ( //div
values combo_box_2
-
'id' => 'values_combo_box_2',
-
'value' => $this->bocommon->select2String($values_combo_box[2]['cat_list'],
'cat_id') //i.e. id,value/id,vale/
- ),
- array
- ( //div
values combo_box_3
-
'id' => 'values_combo_box_3',
-
'value' => $this->bocommon->select2String($values_combo_box[3])
- ),
- array
- ( //div
values combo_box_4
-
'id' => 'values_combo_box_4',
-
'value' => $this->bocommon->select2String($values_combo_box[4], 'user_id')
- )
+ 'hidden_value' => array
+ (
+ array
+ ( //div values
combo_box_0
+ 'id' =>
'values_combo_box_0',
+ 'value'
=> $this->bocommon->select2String($values_combo_box[0])
+ ),
+ array
+ ( //div values
combo_box_1
+ 'id' =>
'values_combo_box_1',
+ 'value'
=> $this->bocommon->select2String($values_combo_box[1])
+ ),
+ array
+ ( //div values
combo_box_2
+ 'id' =>
'values_combo_box_2',
+ 'value'
=> $this->bocommon->select2String($values_combo_box[2]['cat_list'], 'cat_id')
//i.e. id,value/id,vale/
+ ),
+ array
+ ( //div values
combo_box_3
+ 'id' =>
'values_combo_box_3',
+ 'value'
=> $this->bocommon->select2String($values_combo_box[3])
+ ),
+ array
+ ( //div values
combo_box_4
+ 'id' =>
'values_combo_box_4',
+ 'value'
=> $this->bocommon->select2String($values_combo_box[4], 'user_id')
)
)
)
- );
+ )
+ );
- if(!$this->acl_manage)
+ if(!$this->acl_manage)//priority_key
{
-
unset($datatable['actions']['form'][0]['fields']['field'][9]);
+
unset($datatable['actions']['form'][0]['fields']['field'][16]);
}
- if(!$this->acl_add)
+ if(!$this->acl_add) //add
{
-
unset($datatable['actions']['form'][0]['fields']['field'][5]);
+
unset($datatable['actions']['form'][0]['fields']['field'][8]);
}
- if(!$project_id)
+ if(!$project_id) // update project
{
-
unset($datatable['actions']['form'][0]['fields']['field'][4]);
+
unset($datatable['actions']['form'][0]['fields']['field'][6]);
}
$dry_run = true;
}
@@ -1213,12 +1238,11 @@
$lookup_type = $mode == 'edit' ? 'form' : 'view';
-
$location_data=$this->bolocation->initiate_ui_location(array
- (
- 'values' =>
$values['location_data'],
- 'type_id' => -1, // calculated
from location_types
- 'no_link' => false, // disable
lookup links for location type less than type_id
- 'tenant' => true,
+
$location_data=$this->bolocation->initiate_ui_location(array(
+ 'values' =>
$values['location_data'],
+ 'type_id' =>
isset($this->config->config_data['request_location_level']) &&
$this->config->config_data['request_location_level'] ?
$this->config->config_data['request_location_level'] : -1,
+ 'no_link' => false, //
disable lookup links for location type less than type_id
+ 'tenant' => true,
'lookup_type' => $lookup_type,
'lookup_entity' =>
$this->bocommon->get_lookup_entity('request'),
'entity_data' => $values['p']
@@ -1277,8 +1301,8 @@
$jscal->add_listener('values_consume_date');
$jscal->add_listener('values_planning_date');
- $msgbox_data = $this->bocommon->msgbox_data($receipt);
+
$link_file_data = array
(
'menuaction' =>
'property.uirequest.view_file',
@@ -1365,7 +1389,17 @@
}
}
-
+
+ $value_diff = (int)$values['budget'] -
($_consume_amount + $_planning_amount);
+ $value_diff2 = (int)$values['budget'] -
$_consume_amount;
+
+ if ($value_diff < 0 || $value_diff2 < 0)
+ {
+ $receipt['error'][]=array('msg'=>lang('negative
value for budget'));
+ }
+
+ $msgbox_data = $this->bocommon->msgbox_data($receipt);
+
$datavalues[2] = array
(
'name'
=> "2",
@@ -1515,8 +1549,8 @@
'lang_budget'
=> lang('Budget'),
'value_budget'
=> number_format($values['budget'], 0, ',', ' '),
'lang_budget_statustext'
=> lang('Enter the budget'),
- 'value_diff'
=> number_format(((int)$values['budget'] - ($_consume_amount +
$_planning_amount)), 0, ',', ' '),
- 'value_diff2'
=> number_format(((int)$values['budget'] - $_consume_amount),
0, ',', ' '),
+ 'value_diff'
=> number_format($value_diff, 0, ',', ' '),
+ 'value_diff2'
=> number_format($value_diff2, 0, ',', ' '),
'location_data'
=> $location_data,
'location_type'
=> 'form',
Modified: branches/Version-1_0-branch/property/inc/hook_config.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/hook_config.inc.php
2011-10-19 06:58:43 UTC (rev 7895)
+++ branches/Version-1_0-branch/property/inc/hook_config.inc.php
2011-10-19 07:04:36 UTC (rev 7896)
@@ -199,7 +199,35 @@
return $out;
}
+
/**
+ * Get HTML options with location levels that should be listed in a
listbox
+ *
+ * @param $config
+ * @return string HTML options to be placed in a select
+ */
+
+ function list_location_level_otions($config)
+ {
+ $location_types =
execMethod('property.soadmin_location.select_location_type');
+
+ $level_assigned = isset($config['request_location_level']) ?
$config['request_location_level'] : 0;
+ $out = '';
+ foreach ( $location_types as $dummy => $level)
+ {
+ $selected = '';
+ if ( ($level['id'] == $level_assigned))
+ {
+ $selected = ' selected';
+ }
+ $out .= <<<HTML
+ <option value="{$level['id']}"
{$selected}><label>{$level['name']}</label></option>
+HTML;
+ }
+ return $out;
+ }
+
+ /**
* Get HTML checkbox with filter buildingpart
*
* @param $config
Modified: branches/Version-1_0-branch/property/js/yahoo/request.index.js
===================================================================
--- branches/Version-1_0-branch/property/js/yahoo/request.index.js
2011-10-19 06:58:43 UTC (rev 7895)
+++ branches/Version-1_0-branch/property/js/yahoo/request.index.js
2011-10-19 07:04:36 UTC (rev 7896)
@@ -48,6 +48,21 @@
elCell.innerHTML = "<div
align=\"right\">"+YAHOO.util.Number.format(oData, {thousandsSeparator:"
"})+"</div>";
}
+
+ this.onChangeSelect = function(type)
+ {
+ var myselect=document.getElementById("sel_"+ type);
+ for (var i=0; i<myselect.options.length; i++)
+ {
+ if (myselect.options[i].selected==true)
+ {
+ break;
+ }
+ }
+ eval("path_values." +type +"='"+myselect.options[i].value+"'");
+ execute_ds();
+ }
+
var tableYUI;
this.particular_setting = function()
Modified: branches/Version-1_0-branch/property/templates/base/config.tpl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/config.tpl
2011-10-19 06:58:43 UTC (rev 7895)
+++ branches/Version-1_0-branch/property/templates/base/config.tpl
2011-10-19 07:04:36 UTC (rev 7896)
@@ -405,6 +405,16 @@
</td>
</tr>
+ <tr class="row_off">
+ <td>{lang_request_location_level}.</td>
+ <td>
+ <select
name="newsettings[request_location_level]">
+ {hook_list_location_level_otions}
+ </select>
+ </td>
+ </tr>
+
+
<tr class="row_on">
<td>{lang_meter_table}:</td>
<td><input name="newsettings[meter_table]"
value="{value_meter_table}"></td>
Modified: branches/Version-1_0-branch/property/templates/base/request.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/request.xsl
2011-10-19 06:58:43 UTC (rev 7895)
+++ branches/Version-1_0-branch/property/templates/base/request.xsl
2011-10-19 07:04:36 UTC (rev 7896)
@@ -331,38 +331,7 @@
</xsl:choose>
<tr>
- <td
valign="top">
-
<xsl:value-of select="php:function('lang', 'total cost estimate')" />
- </td>
<td>
- <input
type="text" name="values[budget]" value="{value_budget}">
-
<xsl:attribute name="title">
-
<xsl:value-of select="lang_budget_statustext"/>
-
</xsl:attribute>
- </input>
-
<xsl:text> </xsl:text> [ <xsl:value-of select="currency"/> ]
- </td>
- </tr>
- <tr>
- <td
valign="top">
-
<xsl:value-of select="php:function('lang', 'not allocated')" />
- </td>
- <td>
-
<xsl:value-of select="value_diff"/>
-
<xsl:text> </xsl:text> [ <xsl:value-of select="currency"/> ]
- </td>
- </tr>
- <tr>
- <td
valign="top">
-
<xsl:value-of select="php:function('lang', 'residual demand')" />
- </td>
- <td>
-
<xsl:value-of select="value_diff2"/>
-
<xsl:text> </xsl:text> [ <xsl:value-of select="currency"/> ]
- </td>
- </tr>
- <tr>
- <td>
<xsl:value-of select="php:function('lang', 'building part')" />
</td>
<td>
@@ -433,6 +402,38 @@
<tr>
<td
valign="top">
+
<xsl:value-of select="php:function('lang', 'total cost estimate')" />
+ </td>
+ <td>
+ <input
type="text" name="values[budget]" value="{value_budget}">
+
<xsl:attribute name="title">
+
<xsl:value-of select="lang_budget_statustext"/>
+
</xsl:attribute>
+ </input>
+
<xsl:text> </xsl:text> [ <xsl:value-of select="currency"/> ]
+ </td>
+ </tr>
+ <tr>
+ <td
valign="top">
+
<xsl:value-of select="php:function('lang', 'not allocated')" />
+ </td>
+ <td>
+
<xsl:value-of select="value_diff"/>
+
<xsl:text> </xsl:text> [ <xsl:value-of select="currency"/> ]
+ </td>
+ </tr>
+ <tr>
+ <td
valign="top">
+
<xsl:value-of select="php:function('lang', 'residual demand')" />
+ </td>
+ <td>
+
<xsl:value-of select="value_diff2"/>
+
<xsl:text> </xsl:text> [ <xsl:value-of select="currency"/> ]
+ </td>
+ </tr>
+
+ <tr>
+ <td
valign="top">
<xsl:value-of select="php:function('lang', 'planning date')" />
</td>
<td>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [7896] Merge 7888:7895 from trunk,
Sigurd Nes <=