[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [9701] Merge 9656:9700 from trunk
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [9701] Merge 9656:9700 from trunk |
Date: |
Thu, 28 Jun 2012 11:57:02 +0000 |
Revision: 9701
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9701
Author: sigurdne
Date: 2012-06-28 11:56:58 +0000 (Thu, 28 Jun 2012)
Log Message:
-----------
Merge 9656:9700 from trunk
Modified Paths:
--------------
branches/Version-1_0-branch/controller/inc/class.menu.inc.php
branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php
branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php
branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php
branches/Version-1_0-branch/controller/inc/class.socontrol_item_option.inc.php
branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php
branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
branches/Version-1_0-branch/controller/inc/class.uicontrol_item.inc.php
branches/Version-1_0-branch/controller/inc/class.uicontrol_location.inc.php
branches/Version-1_0-branch/controller/inc/class.uidocument.inc.php
branches/Version-1_0-branch/controller/inc/class.uiprocedure.inc.php
branches/Version-1_0-branch/controller/inc/hook_home.inc.php
branches/Version-1_0-branch/controller/inc/model/class.component.inc.php
branches/Version-1_0-branch/controller/js/controller/ajax.js
branches/Version-1_0-branch/controller/templates/base/calendar/select_buildings_on_property.xsl
branches/Version-1_0-branch/controller/templates/base/calendar/select_my_locations.xsl
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_month.xsl
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_year.xsl
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_year_for_locations.xsl
branches/Version-1_0-branch/controller/templates/base/check_list/view_open_cases.xsl
branches/Version-1_0-branch/controller/templates/base/control_item/control_item.xsl
branches/Version-1_0-branch/controller/templates/base/control_location/control_location_tabs.xsl
branches/Version-1_0-branch/controller/templates/base/control_location/register_control_to_component.xsl
branches/Version-1_0-branch/controller/templates/base/control_location/register_control_to_location.xsl
branches/Version-1_0-branch/controller/templates/base/control_location/view_locations_for_control.xsl
branches/Version-1_0-branch/controller/templates/base/css/base.css
branches/Version-1_0-branch/controller/templates/base/procedure/procedure_documents.xsl
branches/Version-1_0-branch/phpgwapi/inc/class.uicommon.inc.php
branches/Version-1_0-branch/phpgwapi/js/yahoo/common.js
branches/Version-1_0-branch/phpgwapi/js/yahoo/datatable.js
branches/Version-1_0-branch/phpgwapi/templates/base/datatable_common.xsl
branches/Version-1_0-branch/property/inc/class.bogeneric.inc.php
branches/Version-1_0-branch/property/inc/class.solocation.inc.php
branches/Version-1_0-branch/property/inc/class.uigeneric.inc.php
branches/Version-1_0-branch/property/setup/setup.inc.php
Added Paths:
-----------
branches/Version-1_0-branch/controller/templates/base/calendar/calendar_filters.xsl
branches/Version-1_0-branch/controller/templates/base/calendar/nav_calendar_month.xsl
branches/Version-1_0-branch/controller/templates/base/calendar/nav_calendar_year.xsl
branches/Version-1_0-branch/property/inc/class.uigeneric_test.inc.php
Property Changed:
----------------
branches/Version-1_0-branch/
Property changes on: branches/Version-1_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
-
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538,7540-7542,7544-7549,7551-7552,7554-7561,7563,7565,7567-7573,7575-7578,7580-7584,7586-7591,7593-7624,7627-7636,7638-7656,7658-7718,7720-7732,7734,7736,7738-7750,7754-7759,7761-7767,7769-7780,7782,7784-7809,7811-7812,7814-7835,7837-7847,7849-7887,7889-7895,7897,7899,7901,7903-7905,7907-7921,7923-7925,7927-7933,7935,7937-7952,7954-7968,7970-7974,7976,7978-7979,7981-7982,7984-7988,7990-7992,7994-8041,8043-8066,8068-8087,8089,8091-8108,8110-8124,8126-8129,8131,8133-8150,8152-8154,8156-8162,8164-8167,8169-8170,8172-8179,8181,8183-8196,8198-8207,8209-8211,8213-8214,8216-8217,8219-8220,8222,8224-8225,8227-8247,8249,8251,8253-8282,8284-8352,8354-8368,8370-8396,8398-8430,8432,8434-8440,8442-8445,8447-8453,8455-8456,8458,8460,8462-8464,8466-8473,8475-8479,8481,8483-8501,8503-8523,8525,8527-8531,8533,8535-8536,8538-8550,8552-8554,8556-8557,8559-8579,8581-8587,8589,8591-8592,8594-8595,8597-8601,8603-8610,8612-8613,8615,8617,8619-8645,8647-8650,8652-8661,8663-8666,8668-8669,8671-8683,8685-8691,8693-8730,8732-8737,8739,8741-8767,8769,8771-8772,8774,8776-8797,8799-8812,8814-8819,8821,8823-8833,8835-8837,8839,8841,8843-8849,8852-8858,8860-8867,8869-8870,8872,8874-8877,8879,8881,8883-8888,8890,8892-8901,8903-8911,8913-8917,8920-8923,8925-8933,8935-8938,8940-8943,8945,8947-8948,8950,8952-8953,8955-8962,8964,8966,8968-8970,8972-8975,8977-8983,8985-8993,8995-9001,9003,9005,9007,9009,9011-9019,9021-9023,9025,9027-9028,9030-9044,9046-9047,9049-9050,9052-9056,9058-9059,9061,9063-9064,9066-9068,9071-9092,9094-9112,9114-9117,9119,9121-9160,9162-9166,9169-9207,9209-9211,9213-9215,9217,9219,9221-9253,9255,9257,9259-9260,9262,9264-9269,9271-9273,9275,9277-9278,9280,9282-9283,9285-9289,9291-9299,9301-9310,9312-9313,9315-9320,9322-9324,9326-9338,9340-9342,9344,9346-9348,9350-9358,9360-9362,9364-9366,9368-9374,9376-9382,9384,9386,9388-9390,9392-9396,9398-9402,9404-9410,9412,9414,9416-9417,9419-9425,9427,9429-9430,9432,9434-9463,9465-9502,9504-9506,9508-9521,9523-9526,9528,9530-9537,9539,9541-9551,9553,9555-9556,9558-9578,9580-9581,9583,9585,9587,9589,9591-9624,9626-9655
+
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538,7540-7542,7544-7549,7551-7552,7554-7561,7563,7565,7567-7573,7575-7578,7580-7584,7586-7591,7593-7624,7627-7636,7638-7656,7658-7718,7720-7732,7734,7736,7738-7750,7754-7759,7761-7767,7769-7780,7782,7784-7809,7811-7812,7814-7835,7837-7847,7849-7887,7889-7895,7897,7899,7901,7903-7905,7907-7921,7923-7925,7927-7933,7935,7937-7952,7954-7968,7970-7974,7976,7978-7979,7981-7982,7984-7988,7990-7992,7994-8041,8043-8066,8068-8087,8089,8091-8108,8110-8124,8126-8129,8131,8133-8150,8152-8154,8156-8162,8164-8167,8169-8170,8172-8179,8181,8183-8196,8198-8207,8209-8211,8213-8214,8216-8217,8219-8220,8222,8224-8225,8227-8247,8249,8251,8253-8282,8284-8352,8354-8368,8370-8396,8398-8430,8432,8434-8440,8442-8445,8447-8453,8455-8456,8458,8460,8462-8464,8466-8473,8475-8479,8481,8483-8501,8503-8523,8525,8527-8531,8533,8535-8536,8538-8550,8552-8554,8556-8557,8559-8579,8581-8587,8589,8591-8592,8594-8595,8597-8601,8603-8610,8612-8613,8615,8617,8619-8645,8647-8650,8652-8661,8663-8666,8668-8669,8671-8683,8685-8691,8693-8730,8732-8737,8739,8741-8767,8769,8771-8772,8774,8776-8797,8799-8812,8814-8819,8821,8823-8833,8835-8837,8839,8841,8843-8849,8852-8858,8860-8867,8869-8870,8872,8874-8877,8879,8881,8883-8888,8890,8892-8901,8903-8911,8913-8917,8920-8923,8925-8933,8935-8938,8940-8943,8945,8947-8948,8950,8952-8953,8955-8962,8964,8966,8968-8970,8972-8975,8977-8983,8985-8993,8995-9001,9003,9005,9007,9009,9011-9019,9021-9023,9025,9027-9028,9030-9044,9046-9047,9049-9050,9052-9056,9058-9059,9061,9063-9064,9066-9068,9071-9092,9094-9112,9114-9117,9119,9121-9160,9162-9166,9169-9207,9209-9211,9213-9215,9217,9219,9221-9253,9255,9257,9259-9260,9262,9264-9269,9271-9273,9275,9277-9278,9280,9282-9283,9285-9289,9291-9299,9301-9310,9312-9313,9315-9320,9322-9324,9326-9338,9340-9342,9344,9346-9348,9350-9358,9360-9362,9364-9366,9368-9374,9376-9382,9384,9386,9388-9390,9392-9396,9398-9402,9404-9410,9412,9414,9416-9417,9419-9425,9427,9429-9430,9432,9434-9463,9465-9502,9504-9506,9508-9521,9523-9526,9528,9530-9537,9539,9541-9551,9553,9555-9556,9558-9578,9580-9581,9583,9585,9587,9589,9591-9624,9626-9655,9657-9700
Modified: branches/Version-1_0-branch/controller/inc/class.menu.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.menu.inc.php
2012-06-28 11:53:08 UTC (rev 9700)
+++ branches/Version-1_0-branch/controller/inc/class.menu.inc.php
2012-06-28 11:56:58 UTC (rev 9701)
@@ -72,12 +72,6 @@
)
)
),
-/* 'location_for_check_list' => array
- (
- 'text' =>
lang('location_connections'),
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=>
'controller.uicontrol_location.index') ),
- 'image' => array('property',
'location_1')
- ),*/
'control_item' => array
(
'text' => lang('Control_item'),
@@ -104,12 +98,6 @@
'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=>
'controller.uiprocedure.index') ),
'image' => array('property',
'location_1'),
),
- 'check_list' => array
- (
- 'text' => lang('Check_list'),
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=>
'controller.uicheck_list.index') ),
- 'image' => array('property',
'location_1'),
- ),
'calendar_overview' => array
(
'text' =>
lang('Calendar_overview'),
@@ -118,25 +106,7 @@
)
);
}
- else
- {
- $menus['navigation'] = array
- (
- 'check_list' => array
- (
- 'text' => lang('Check_list'),
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=>
'controller.uicheck_list.index') ),
- 'image' => array('property',
'location_1'),
- ),
- 'location_check_list' => array
- (
- 'text' =>
lang('Check_list_location'),
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=>
'controller.uilocation_check_list.view_check_lists_for_location') ),
- 'image' => array('property',
'location_1'),
- ),
- );
- }
-
+
if ( $GLOBALS['phpgw']->acl->check('run',
phpgwapi_acl::READ, 'admin')
|| $GLOBALS['phpgw']->acl->check('admin',
phpgwapi_acl::ADD, 'controller'))
{
@@ -194,14 +164,6 @@
'url' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'preferences.uiadmin_acl.aclprefs', 'acl_app'=> 'controller') )
)
);
-/*
- $menus['toolbar'][] = array
- (
- 'text' =>
$GLOBALS['phpgw']->translation->translate('Preferences', array(), true),
- 'url' =>
$GLOBALS['phpgw']->link('/preferences/preferences.php', array('appname' =>
'controller')),
- 'image' => array('hrm', 'preferences')
- );
-*/
}
//Nothing...
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-06-28 11:53:08 UTC (rev 9700)
+++ branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php
2012-06-28 11:56:58 UTC (rev 9701)
@@ -659,13 +659,14 @@
}
// Fetches check lists for component and control id
- function get_check_lists_for_control_and_component( $control_id,
$component_id, $from_date_ts, $to_date_ts, $repeat_type = null ){
+ function get_check_lists_for_control_and_component( $control_id,
$location_id, $component_id, $from_date_ts, $to_date_ts, $repeat_type = null ){
$sql = "SELECT cl.id as cl_id, cl.status as cl_status,
cl.comment as cl_comment, deadline, planned_date, completed_date, ";
- $sql .= "cl.component_id as cl_component_id, cl.location_code
as cl_location_code, num_open_cases, num_pending_cases ";
+ $sql .= "cl.component_id as cl_component_id, cl.location_id as
cl_location_id, cl.location_code as cl_location_code, num_open_cases,
num_pending_cases ";
$sql .= "FROM controller_check_list cl ";
$sql .= "LEFT JOIN controller_control c on cl.control_id = c.id
";
$sql .= "WHERE cl.control_id = {$control_id} ";
$sql .= "AND cl.component_id = {$component_id} ";
+ $sql .= "AND cl.location_id = {$location_id} ";
if( $repeat_type != null )
$sql .= "AND c.repeat_type = $repeat_type ";
@@ -682,6 +683,7 @@
$check_list->set_planned_date($this->unmarshal($this->db->f('planned_date',
true), 'int'));
$check_list->set_completed_date($this->unmarshal($this->db->f('completed_date',
true), 'int'));
$check_list->set_component_id($this->unmarshal($this->db->f('cl_component_id',
true), 'int'));
+
$check_list->set_location_id($this->unmarshal($this->db->f('cl_location_id',
true), 'int'));
$check_list->set_location_code($this->unmarshal($this->db->f('cl_location_code',
true), 'string'));
$check_list->set_num_open_cases($this->unmarshal($this->db->f('num_open_cases',
true), 'int'));
$check_list->set_num_pending_cases($this->unmarshal($this->db->f('num_pending_cases',
true), 'int'));
Modified: branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php
2012-06-28 11:53:08 UTC (rev 9700)
+++ branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php
2012-06-28 11:56:58 UTC (rev 9701)
@@ -110,7 +110,7 @@
}
}
- function get_controls_for_location($location_code, $role_id,
$from_date, $to_date, $repeat_type)
+/* function get_controls_for_location($location_code, $role_id,
$from_date, $to_date, $repeat_type)
{
$controls = array();
$controls_loc =
$this->get_controls_by_location($location_code, $from_date, $to_date,
$repeat_type, '', $role_id );
@@ -127,6 +127,7 @@
return $controls;
}
+*/
public function get_controls_by_location($location_code,
$from_date, $to_date, $repeat_type, $return_type = "return_object", $role_id =
'')
{
@@ -196,7 +197,7 @@
$sql .= "AND (c.start_date <= $from_date AND c.end_date
IS NULL ";
$sql .= "OR c.end_date > $from_date AND c.start_date <
$to_date)";
-
+
$this->db->query($sql);
while($this->db->next_record()) {
@@ -234,20 +235,21 @@
$sql = "SELECT c.id as control_id, c.*, ";
$sql .= "bim_item.type as component_type, bim_item.id
as component_id, bim_item.location_code, bim_item.address, ";
- //$sql .= "cast(xpath('*/text()', xml_representation)
as text[]) AS xml ";
- //$sql .= "xpath('/', bim_item.xml_representation) as
xml ";
- $sql .= "bim_item.xml_representation as xml,
cl.location_id ";
+ $sql .= "bim_item.xml_representation as xml,
cl.location_id, fm_responsibility_role.name AS responsibility_name ";
$sql .= "FROM controller_control_component_list cl ";
$sql .= "JOIN fm_bim_item bim_item on cl.component_id
= bim_item.id ";
$sql .= "JOIN fm_bim_type bim_type on cl.location_id =
bim_type.location_id ";
$sql .= "JOIN controller_control c on cl.control_id =
c.id ";
+ $sql .= "JOIN fm_responsibility_role ON
fm_responsibility_role.id = c.responsibility_id ";
$sql .= "AND bim_item.type = bim_type.id ";
$sql .= "AND bim_item.location_code LIKE
'$location_code%' ";
- if( is_numeric($repeat_type)){
+ if( is_numeric($repeat_type))
+ {
$sql .= "AND c.repeat_type = $repeat_type ";
}
- if( is_numeric($role_id)){
+ if( is_numeric($role_id))
+ {
$sql .= "AND c.responsibility_id = $role_id ";
}
@@ -260,15 +262,21 @@
$component_id = 0;
$component = null;
- while($this->db->next_record()) {
- if( $this->db->f('component_id', true) !=
$component_id ){
- if($component_id != 0){
+ while($this->db->next_record())
+ {
+ if( $this->db->f('component_id', true) !=
$component_id )
+ {
+ if($component_id != 0)
+ {
$component->set_controls_array($controls_array);
$controls_array = array();
- if($return_type ==
"return_array"){
+ if($return_type ==
"return_array")
+ {
$components_array[] =
$component->toArray();
- }else{
+ }
+ else
+ {
$components_array[] =
$component;
}
}
@@ -294,29 +302,42 @@
$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_responsibility_name($this->unmarshal($this->db->f('responsibility_name',
true), 'string'));
$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_repeat_type($this->unmarshal($this->db->f('repeat_type', true),
'int'));
+
$control->set_repeat_type_label($this->unmarshal($this->db->f('repeat_type',
true), 'int'));
$control->set_repeat_interval($this->unmarshal($this->db->f('repeat_interval',
true), 'int'));
if($return_type == "return_object")
+ {
$controls_array[] = $control;
+ }
else
+ {
$controls_array[] = $control->toArray();
-
+ }
+
$component_id = $component->get_id();
}
- if($component != null){
+ if($component != null)
+ {
$component->set_controls_array($controls_array);
if($return_type == "return_array")
+ {
$components_array[] =
$component->toArray();
+ }
else
+ {
$components_array[] = $component;
+ }
return $components_array;
- }else {
+ }
+ else
+ {
return null;
}
}
@@ -329,7 +350,8 @@
$sql = "SELECT * FROM controller_control WHERE
control_area_id=$control_area_id";
$this->db->query($sql);
- while($this->db->next_record()) {
+ while($this->db->next_record())
+ {
$control = new
controller_control($this->unmarshal($this->db->f('id', true), 'int'));
$control->set_title($this->unmarshal($this->db->f('title', true), 'string'));
$control->set_description($this->unmarshal($this->db->f('description', true),
'boolean'));
@@ -348,9 +370,12 @@
$controls_array[] = $control->toArray();
}
- if( count( $controls_array ) > 0 ){
+ if( count( $controls_array ) > 0 )
+ {
return $controls_array;
- }else {
+ }
+ else
+ {
return null;
}
}
@@ -388,14 +413,14 @@
}
}
- function get_components_for_control($control_id)
+ function get_components_for_control($control_id)
{
$controls_array = array();
- $sql = "SELECT c.id, c.title, ccl.component_id,
bim_type.description, bim.location_code ";
+ $sql = "SELECT c.id, c.title, ccl.component_id,
ccl.location_id, bim_type.description, bim.location_code ";
$sql .= "FROM controller_control c, controller_control_component_list
ccl, fm_bim_item bim, fm_bim_type bim_type ";
$sql .= "WHERE ccl.control_id = $control_id ";
- $sql .= "AND ccl.control_id = c.id ";
+ $sql .= "AND ccl.control_id = c.id ";
$sql .= "AND bim.id = ccl.component_id ";
$sql .= "AND bim_type.id = bim.type";
@@ -405,6 +430,7 @@
$control_id =
$this->unmarshal($this->db->f('id', true), 'int');
$title = $this->unmarshal($this->db->f('title',
true), 'string');
$component_id =
$this->unmarshal($this->db->f('component_id', true), 'int');
+ $location_id =
$this->unmarshal($this->db->f('location_id', true), 'int');
$component_type =
$this->unmarshal($this->db->f('description', true), 'string');
$component_location_code =
$this->unmarshal($this->db->f('location_code', true), 'string');
//$component_guid =
$this->unmarshal($this->db->f('guid', true), 'string');
@@ -414,7 +440,7 @@
$location_array =
execMethod('property.bolocation.read_single', array('location_code' =>
$component_location_code));
- $controls_array[] = array("id" => $control_id,
"title" => $title, "component_id" => $component_id, "component_description" =>
$component_type, "component_location" => $location_array["loc1_name"]);
+ $controls_array[] = array("id" => $control_id,
"title" => $title, "component_id" => $component_id, "location_id" =>
$location_id, "component_description" => $component_type, "component_location"
=> $location_array["loc1_name"]);
}
if( count( $controls_array ) > 0 ){
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-06-28 11:53:08 UTC (rev 9700)
+++ branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php
2012-06-28 11:56:58 UTC (rev 9701)
@@ -83,8 +83,6 @@
if(isset($result)) {
// return the new control item ID
return
$this->db->get_last_insert_id('controller_control_item', 'id');
- // Forward this request to the update method
- //return $this->update($control_item);
}
else
{
@@ -116,7 +114,14 @@
//var_dump('UPDATE controller_control_item SET ' .
join(',', $values) . " WHERE id=$id");
$result = $this->db->query('UPDATE
controller_control_item SET ' . join(',', $values) . " WHERE id=$id",
__LINE__,__FILE__);
- return isset($result);
+ if(isset($result)) {
+ // return the new control item ID
+ return $id;
+ }
+ else
+ {
+ return 0;
+ }
}
/**
@@ -148,47 +153,71 @@
return $control_item;
}
- public function get_single_with_options($id){
- $sql = "SELECT ci.id as ci_id, ci.*, cio.id as cio_id,
cio.* ";
+ public function get_single_with_options($id, $return_type =
"return_object"){
+ $sql = "SELECT ci.id as ci_id, ci.*, cio.id as cio_id,
cio.*, cg.group_name ";
$sql .= "FROM controller_control_item ci ";
$sql .= "LEFT JOIN controller_control_item_option as
cio ON cio.control_item_id = ci.id ";
+ $sql .= "LEFT JOIN controller_control_group as cg ON
ci.control_group_id = cg.id ";
$sql .= "WHERE ci.id = $id";
-
+
$this->db->query($sql);
$counter = 0;
$control_item = null;
- while ($this->db->next_record()) {
-
- if( $counter == 0 ){
+ while ($this->db->next_record())
+ {
+ if( $counter == 0 )
+ {
$control_item = new
controller_control_item($this->unmarshal($this->db->f('ci_id', true), 'int'));
$control_item->set_title($this->unmarshal($this->db->f('title', true),
'string'));
$control_item->set_required($this->unmarshal($this->db->f('required', true),
'bool'));
$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_control_group_name($this->unmarshal($this->db->f('control_group_name',
true), 'string'));
+
$control_item->set_control_group_name($this->unmarshal($this->db->f('group_name',
true), 'string'));
$control_item->set_control_area_id($this->unmarshal($this->db->f('control_area_id')));
$category =
execMethod('phpgwapi.categories.return_single',
$this->unmarshal($this->db->f('control_area_id', true), 'int'));
$control_item->set_control_area_name($category[0]['name']);
$control_item->set_type($this->unmarshal($this->db->f('type', true), 'string'));
}
- if($this->db->f('cio_id', true) != ''){
+ if($this->db->f('cio_id', true) != '')
+ {
$control_item_option = new
controller_control_item_option();
$control_item_option->set_id($this->unmarshal($this->db->f('cio_id', true),
'int'));
$control_item_option->set_option_value($this->unmarshal($this->db->f('option_value',
true), 'string'));
$control_item_option->set_control_item_id($this->unmarshal($this->db->f('control_item_id',
true), 'int'));
-
- $options_array[] =
$control_item_option->toArray();
+
+ if($return_type == "return_object")
+ {
+ $options_array[] =
$control_item_option;
+ }
+ else
+ {
+ $options_array[] =
$control_item_option->toArray();
+ }
}
-
+
$counter++;
}
+
$control_item->set_options_array( $options_array );
- return $control_item->toArray();
+ if($return_type == "return_object")
+ {
+ return $control_item;
+ }
+ else
+ {
+ return $control_item->toArray();
+ }
}
+
+ function delete_option_values($control_item_id)
+ {
+ $sql = "delete from controller_control_item_option
where control_item_id=$control_item_id";
+ $this->db->query($sql);
+ }
function get_control_item_array($start = 0, $results = 1000,
$sort = null, $dir = '', $query = null, $search_option = null, $filters =
array())
{
Modified:
branches/Version-1_0-branch/controller/inc/class.socontrol_item_option.inc.php
===================================================================
---
branches/Version-1_0-branch/controller/inc/class.socontrol_item_option.inc.php
2012-06-28 11:53:08 UTC (rev 9700)
+++
branches/Version-1_0-branch/controller/inc/class.socontrol_item_option.inc.php
2012-06-28 11:56:58 UTC (rev 9701)
@@ -96,6 +96,21 @@
return $control_item_option;
}
+ /**
+ * Get a static reference to the storage object associated with
this model object
+ *
+ * @return the storage object
+ */
+ public static function get_so()
+ {
+ if (self::$so == null)
+ {
+ self::$so =
CreateObject('controller.socontrol_item_option');
+ }
+
+ return self::$so;
+ }
+
function get_id_field_name(){}
function get_query(string $sort_field, boolean $ascending,
string $search_for, string $search_type, array $filters, boolean
$return_count){}
function populate(int $object_id, &$object){}
Modified: branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
2012-06-28 11:53:08 UTC (rev 9700)
+++ branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
2012-06-28 11:56:58 UTC (rev 9701)
@@ -84,6 +84,8 @@
$location_code = phpgw::get_var('location_code');
$year = phpgw::get_var('year');
$month = phpgw::get_var('month');
+ $role = phpgw::get_var('role');
+ $repeat_type = phpgw::get_var('repeat_type');
// Validates year. If year is not set, current year is
chosen
$year = $this->validate_year($year);
@@ -91,6 +93,12 @@
// Validates month. If year is not set, current month
in current year is chosen
$month = $this->validate_month($month);
+ // Validates year.
+ $repeat_type =
$this->validate_repeat_type($repeat_type);
+
+ // Validates role.
+ $role = $this->validate_role($role);
+
// Gets timestamp value of first day in month
$from_date_ts =
month_calendar::get_start_month_date_ts($year, intval( $month ));
@@ -117,7 +125,8 @@
$controls_with_check_list_array =
$this->populate_controls_with_check_lists($controls_for_location_array,
$control_id_with_check_list_array);
$controls_calendar_array = array();
- foreach($controls_with_check_list_array as $control){
+ foreach($controls_with_check_list_array as $control)
+ {
$month_calendar = new month_calendar($control,
$year, $month);
$calendar_array =
$month_calendar->build_calendar( $control->get_check_lists_array() );
@@ -125,11 +134,13 @@
}
// COMPONENTS
- foreach($components_with_controls_array as $component){
+ foreach($components_with_controls_array as $component)
+ {
$controls_for_component_array =
$component->get_controls_array();
$controls_components_calendar_array = array();
- foreach($controls_for_component_array as $control){
+ foreach($controls_for_component_array as $control)
+ {
// Fetches control ids with check lists for
specified time period
$control_id_with_check_list_array =
$this->so->get_check_lists_for_component($component->get_type(),
$component->get_id(), $from_date_ts, $to_date_ts, $repeat_type = ">=2");
@@ -150,12 +161,19 @@
$property_array =
execMethod('property.solocation.read', array('type_id' => 1, 'allrows' =>
true));
// Gets array of locations assigned to current user
- $my_locations = $this->get_my_assigned_locations();
+ $my_locations =
$this->get_my_assigned_locations($location_code);
$heading_array =
month_calendar::get_heading_array($year, $month);
$roles_array = $this->so_control->get_roles();
+ $repeat_type_array = array(
+
array('id' => "0", 'value' => "Dag"),
+
array('id' => "1", 'value' => "Uke"),
+
array('id' => "2", 'value' => "Måned"),
+
array('id' => "3", 'value' => "År")
+ );
+
$data = array
(
'buildings_on_property' =>
$buildings_on_property,
@@ -169,6 +187,9 @@
'current_month_nr' =>
$month,
'location_level'
=> $level,
'roles_array'
=> $roles_array,
+ 'repeat_type_array' =>
$repeat_type_array,
+ 'current_role'
=> $role,
+ 'current_repeat_type' => $repeat_type
);
self::add_javascript('controller', 'controller',
'jquery.js');
@@ -178,7 +199,8 @@
self::render_template_xsl(array('calendar/view_calendar_month',
'calendar/check_list_status_checker',
'calendar/icon_color_map', 'calendar/select_my_locations',
-
'calendar/select_buildings_on_property'), $data);
+
'calendar/select_buildings_on_property', 'calendar/nav_calendar_month',
+
'calendar/calendar_filters'), $data);
}
public function view_calendar_for_year()
@@ -190,7 +212,13 @@
// Validates year. If year is not set, current year is
chosen
$year = $this->validate_year($year);
+
+ // Validates year.
+ $repeat_type =
$this->validate_repeat_type($repeat_type);
+ // Validates role.
+ $role = $this->validate_role($role);
+
// Gets timestamp of first day in year
$from_date_ts = $this->get_start_date_year_ts($year);
@@ -220,17 +248,21 @@
// Loops through controls with repeat type day or week
// and populates array that contains aggregated open
cases pr month.
- foreach($controls_for_location_array as $control){
- if($control->get_repeat_type() == 0 |
$control->get_repeat_type() == 1){
-
+ foreach($controls_for_location_array as $control)
+ {
+ if($control->get_repeat_type() == 0 |
$control->get_repeat_type() == 1)
+ {
$cl_criteria = new
controller_check_list();
$cl_criteria->set_control_id($control->get_id());
$cl_criteria->set_location_code($location_code);
+ $from_month =
$this->get_start_month_for_control($control);
+ $to_month =
$this->get_end_month_for_control($control);
+
// Loops through controls and populates
aggregate open cases pr month array.
- $agg_open_cases_pr_month_array =
$this->build_agg_open_cases_pr_month_array($cl_criteria, $year);
+ $agg_open_cases_pr_month_array =
$this->build_agg_open_cases_pr_month_array($cl_criteria, $year, $from_month,
$to_month);
- $year_calendar = new
year_calendar($control, $year);
+ $year_calendar = new
year_calendar($control, $year, null, $location_code, "location");
$calendar_array =
$year_calendar->build_agg_month_calendar($agg_open_cases_pr_month_array);
$controls_calendar_array[] =
array("control" => $control->toArray(), "calendar_array" => $calendar_array);
@@ -244,9 +276,10 @@
// Loops through all controls for location and
populates controls with check lists
$controls_for_location_array =
$this->populate_controls_with_check_lists($controls_for_location_array,
$control_id_with_check_list_array);
- foreach($controls_for_location_array as $control){
- if($control->get_repeat_type() == 2 |
$control->get_repeat_type() == 3){
-
+ foreach($controls_for_location_array as $control)
+ {
+ if($control->get_repeat_type() == 2 |
$control->get_repeat_type() == 3)
+ {
$year_calendar = new
year_calendar($control, $year, null, $location_code, "location" );
$calendar_array =
$year_calendar->build_calendar( $control->get_check_lists_array() );
@@ -255,46 +288,52 @@
}
// COMPONENTS
- foreach($components_with_controls_array as $component){
-
- //$location_id = 2295; //Eksempel: Valglokaler
-
+ foreach($components_with_controls_array as $component)
+ {
$location_id = $component->get_location_id();
- echo " location_id: " . $location_id;
+
$system_location =
$GLOBALS['phpgw']->locations->get_name($location_id);
+
$filters = array("short_description" => "IS NOT
NULL");
- $attributes['attributes'] =
$GLOBALS['phpgw']->custom_fields->find($system_location['appname'],$system_location['location'],
0, '', 'ASC', 'attrib_sort', true, true);
-
- print_r( $attributes['attributes'][1] );
-
- $fields['attributes']= $attributes[0][0];
- //print_r($fields);
+ $attributes['attributes'] =
$GLOBALS['phpgw']->custom_fields->find($system_location['appname'],$system_location['location'],
0, '', 'ASC', 'short_description', true, true,$filters);
+
$params = array
(
- 'location_id' => $component->get_type(),
+ 'location_id' =>
$component->get_location_id(),
'id' => $component->get_id()
);
- $prop_array =
execMethod('property.soentity.read_single_eav', $params, $attributes);
- //print_r($prop_array);
-
- $controls_for_component_array =
$component->get_controls_array();
+ $soentity =
createObject('property.soentity');
+ $prop_array = $soentity->read_single_eav($params, $attributes);
+
+ $attr_arr =
array_pop($prop_array['attributes']);
+ $xml_short_desc = $attr_arr['value'];
+ $component->set_xml_short_desc($xml_short_desc);
+
+ $controls_for_component_array =
$component->get_controls_array();
$controls_components_calendar_array = array();
- foreach($controls_for_component_array as $control){
- if($control->get_repeat_type() == 0 |
$control->get_repeat_type() == 1){
+ foreach($controls_for_component_array as $control)
+ {
+ if($control->get_repeat_type() == 0 |
$control->get_repeat_type() == 1)
+ {
$cl_criteria = new
controller_check_list();
$cl_criteria->set_control_id(
$control->get_id() );
$cl_criteria->set_component_id(
$component->get_id() );
$cl_criteria->set_location_id(
$component->get_type() );
- $agg_open_cases_pr_month_array =
$this->build_agg_open_cases_pr_month_array($cl_criteria, $year);
+ $from_month =
$this->get_start_month_for_control($control);
+ $to_month =
$this->get_end_month_for_control($control);
+
+ $agg_open_cases_pr_month_array =
$this->build_agg_open_cases_pr_month_array($cl_criteria, $year, $from_month,
$to_month);
$year_calendar = new
year_calendar($control, $year);
$calendar_array =
$year_calendar->build_agg_month_calendar($agg_open_cases_pr_month_array);
$controls_components_calendar_array[]
= array("control" => $control->toArray(), "calendar_array" => $calendar_array);
- }else {
+ }
+ else
+ {
// Fetches control ids with check lists for
specified time period
$control_id_with_check_list_array =
$this->so->get_check_lists_for_component($component->get_type(),
$component->get_id(), $from_date_ts, $to_date_ts, $repeat_type = ">=2");
@@ -314,11 +353,12 @@
$location_array =
execMethod('property.bolocation.read_single', array('location_code' =>
$location_code));
// Gets array of locations assigned to current user
- $my_locations = $this->get_my_assigned_locations();
+ $my_locations =
$this->get_my_assigned_locations($location_code);
$heading_array = year_calendar::get_heading_array();
$roles_array = $this->so_control->get_roles();
+
$repeat_type_array = array(
array('id' => "0", 'value' => "Dag"),
array('id' => "1", 'value' => "Uke"),
@@ -338,12 +378,15 @@
'current_year'
=> $year,
'location_level'
=> $level,
'roles_array'
=> $roles_array,
- 'repeat_type_array'
=> $repeat_type_array
+ 'repeat_type_array'
=> $repeat_type_array,
+ 'current_role'
=> $role,
+ 'current_repeat_type' =>
$repeat_type
);
self::render_template_xsl(array('calendar/view_calendar_year',
'calendar/check_list_status_checker',
'calendar/icon_color_map', 'calendar/select_my_locations',
-
'calendar/select_buildings_on_property'), $data);
+
'calendar/select_buildings_on_property', 'calendar/nav_calendar_year',
+
'calendar/calendar_filters'), $data);
self::add_javascript('controller', 'controller',
'jquery.js');
self::add_javascript('controller', 'controller',
'ajax.js');
@@ -375,27 +418,42 @@
$locations_with_calendar_array = array();
// Process aggregated values for controls with repeat
type day or week
- if($control->get_repeat_type() <= 1 ){
- foreach($locations_for_control_array as
$location){
+ if($control->get_repeat_type() <= 1 )
+ {
+ foreach($locations_for_control_array as
$location)
+ {
$curr_location_code =
$location['location_code'];
$cl_criteria = new
controller_check_list();
$cl_criteria->set_control_id(
$control->get_id() );
$cl_criteria->set_location_code(
$curr_location_code );
+
+ $from_month =
$this->get_start_month_for_control($control);
+ $to_month =
$this->get_end_month_for_control($control);
// Loops through controls in
controls_for_location_array and populates aggregate open cases pr month array.
- $agg_open_cases_pr_month_array =
$this->build_agg_open_cases_pr_month_array($cl_criteria, $year);
+ $agg_open_cases_pr_month_array =
$this->build_agg_open_cases_pr_month_array($cl_criteria, $year, $from_month,
$to_month);
$year_calendar = new
year_calendar($control, $year);
$calendar_array =
$year_calendar->build_agg_month_calendar($agg_open_cases_pr_month_array);
$locations_with_calendar_array[] =
array( "location" => $location, "calendar_array" => $calendar_array );
}
- foreach($components_for_control_array as $component){
- $curr_component_id =
$component['component_id'];
+ foreach($components_for_control_array as $component)
+ {
+ $component_id =
$component['component_id'];
+ $location_id =
$component['location_id'];
+ $cl_criteria = new
controller_check_list();
+ $cl_criteria->set_control_id(
$control->get_id() );
+ $cl_criteria->set_component_id(
$component_id);
+ $cl_criteria->set_location_id( $location_id );
+
+ $from_month =
$this->get_start_month_for_control($control);
+ $to_month =
$this->get_end_month_for_control($control);
+
// Loops through controls in
controls_for_location_array and populates aggregate open cases pr month array.
- $agg_open_cases_pr_month_array =
$this->build_agg_open_cases_pr_month_array($control, $curr_component_id, $year,
true);
+ $agg_open_cases_pr_month_array =
$this->build_agg_open_cases_pr_month_array($cl_criteria, $year, $from_month,
$to_month);
$year_calendar = new
year_calendar($control, $year);
$calendar_array =
$year_calendar->build_agg_calendar($agg_open_cases_pr_month_array);
@@ -403,8 +461,10 @@
}
}
// Process values for controls with repeat type month
or year
- else if($control->get_repeat_type() > 1){
- foreach($locations_for_control_array as
$location){
+ else if($control->get_repeat_type() > 1)
+ {
+ foreach($locations_for_control_array as
$location)
+ {
$curr_location_code =
$location['location_code'];
$repeat_type =
$control->get_repeat_type();
@@ -418,11 +478,13 @@
$locations_with_calendar_array[] =
array("location" => $location, "calendar_array" => $calendar_array);
}
- foreach($components_for_control_array as $component){
+ foreach($components_for_control_array as $component)
+ {
$curr_component_id =
$component['component_id'];
+ $curr_location_id =
$component['location_id'];
$repeat_type =
$control->get_repeat_type();
- $component_with_check_lists =
$this->so->get_check_lists_for_control_and_component($control_id,
$curr_component_id, $from_date_ts, $to_date_ts, $repeat_type);
+ $component_with_check_lists =
$this->so->get_check_lists_for_control_and_component($control_id,
$curr_location_id, $curr_component_id, $from_date_ts, $to_date_ts,
$repeat_type);
$check_lists_array =
$component_with_check_lists["check_lists_array"];
@@ -434,7 +496,7 @@
}
// Gets array of locations assigned to current user
- $my_locations = $this->get_my_assigned_locations();
+ $my_locations =
$this->get_my_assigned_locations($location_code);
$heading_array = year_calendar::get_heading_array();
@@ -483,7 +545,8 @@
$locations_with_calendar_array = array();
- foreach($locations_for_control_array as $location){
+ foreach($locations_for_control_array as $location)
+ {
$curr_location_code =
$location['location_code'];
$repeat_type = $control->get_repeat_type();
@@ -498,7 +561,7 @@
}
// Gets array of locations assigned to current user
- $my_locations = $this->get_my_assigned_locations();
+ $my_locations =
$this->get_my_assigned_locations($location_code);
$heading_array =
month_calendar::get_heading_array($year, $month);
@@ -522,13 +585,18 @@
self::add_javascript('controller', 'controller',
'ajax.js');
}
- public function
populate_controls_with_check_lists($controls_for_location_array,
$control_id_with_check_list_array){
+ public function
populate_controls_with_check_lists($controls_for_location_array,
$control_id_with_check_list_array)
+ {
$controls_with_check_list = array();
- foreach($controls_for_location_array as $control){
- foreach($control_id_with_check_list_array as
$control_id){
+ foreach($controls_for_location_array as $control)
+ {
+ foreach($control_id_with_check_list_array as
$control_id)
+ {
if($control->get_id() ==
$control_id->get_id())
-
$control->set_check_lists_array($control_id->get_check_lists_array());
+ {
+
$control->set_check_lists_array($control_id->get_check_lists_array());
+ }
}
$controls_with_check_list[] = $control;
@@ -538,27 +606,14 @@
}
// Generates array of aggregated number of open cases for each
month in time period
- function build_agg_open_cases_pr_month_array( $cl_criteria,
$year ){
-
- // Checks if control starts in the year that is
displayed
- if( date("Y", $control->get_start_date()) == $year ){
- $from_month = date("n",
$control->get_start_date());
- }else{
- $from_month = 1;
- }
-
- // Checks if control ends in the year that is displayed
- if( date("Y", $control->get_end_date()) == $year ){
- $to_month = date("n", $control->get_end_date());
- }else{
- $to_month = 12;
- }
+ function build_agg_open_cases_pr_month_array( $cl_criteria,
$year, $from_month, $to_month )
+ {
$agg_open_cases_pr_month_array = array();
// Fetches aggregate value for open cases in each month
in time period
- for($from_month; $from_month <= $to_month;
$from_month++){
-
+ for($from_month; $from_month <= $to_month;
$from_month++)
+ {
$month_start_ts =
$this->get_month_start_date_ts($year, $from_month);
$month_end_ts =
$this->get_month_start_date_ts($year, $from_month+1);
@@ -568,7 +623,8 @@
$num_open_cases_for_control_array =
$this->so_check_list->get_num_open_cases_for_control( $cl_criteria,
$month_start_ts, $month_end_ts );
// If there is a aggregated value for the
month, add aggregated status object to agg_open_cases_pr_month_array
- if( !empty($num_open_cases_for_control_array) ){
+ if( !empty($num_open_cases_for_control_array) )
+ {
$status_agg_month_info = new
status_agg_month_info();
$status_agg_month_info->set_month_nr($from_month);
$status_agg_month_info->set_agg_open_cases(
$num_open_cases_for_control_array["count"] );
@@ -579,39 +635,77 @@
return $agg_open_cases_pr_month_array;
}
- function get_buildings_on_property($user_role, $location_code,
$level){
+ function get_buildings_on_property($user_role, $location_code,
$level)
+ {
// Property level
- if($level == 1){
+ if($level == 1)
+ {
$property_location_code = $location_code;
}
// Building level
- else if($level > 1){
+ else if($level > 1)
+ {
$split_loc_code_array = explode('-',
$location_code);
$property_location_code =
$split_loc_code_array[0];
}
- if($user_role){
+ if($user_role)
+ {
$criteria = array();
$criteria['location_code'] =
$property_location_code;
$criteria['field_name'] = 'loc2_name';
$criteria['child_level'] = '2';
$buildings_on_property = execMethod('property.solocation.get_children',
$criteria);
- }else{
+ }
+ else
+ {
$buildings_on_property =
execMethod('property.solocation.get_children', $property_location_code);
}
return $buildings_on_property;
}
- function get_location_level($location_code){
+ function get_start_month_for_control($control)
+ {
+ // Checks if control starts in the year that is displayed
+ if( date("Y", $control->get_start_date()) == $year )
+ {
+ $from_month = date("n",
$control->get_start_date());
+ }
+ else
+ {
+ $from_month = 1;
+ }
+
+ return $from_month;
+ }
+
+ function get_end_month_for_control($control)
+ {
+ // Checks if control ends in the year that is displayed
+ if( date("Y", $control->get_end_date()) == $year )
+ {
+ $to_month = date("n", $control->get_end_date());
+ }
+ else
+ {
+ $to_month = 12;
+ }
+
+ return $to_month;
+ }
+
+ function get_location_level($location_code)
+ {
$level = count(explode('-', $location_code));
return $level;
}
- function validate_location_code($location_code){
+ function validate_location_code($location_code)
+ {
$criteria = array
(
'user_id' =>
$GLOBALS['phpgw_info']['user']['account_id'],
@@ -630,7 +724,8 @@
return $location_code;
}
- function get_my_assigned_locations($location_code){
+ function get_my_assigned_locations($current_location_code)
+ {
$criteria = array
(
'user_id' =>
$GLOBALS['phpgw_info']['user']['account_id'], //
@@ -642,11 +737,23 @@
$location_finder = new location_finder();
$my_locations = $location_finder->get_responsibilities(
$criteria );
- return $my_locations;
+ $my_washed_locations = array();
+
+ foreach($my_locations as $location)
+ {
+ if($location['location_code'] !=
$current_location_code)
+ {
+ $my_washed_locations[] = $location;
+ }
+ }
+
+ return $my_washed_locations;
}
- function get_month_start_ts($year, $month){
- if($month > 12){
+ function get_month_start_ts($year, $month)
+ {
+ if($month > 12)
+ {
$year = $year + 1;
$month = $month % 12;
}
@@ -654,22 +761,25 @@
return strtotime("$month/01/$year");
}
- function get_start_date_year_ts($year){
+ function get_start_date_year_ts($year)
+ {
$start_date_year_ts = strtotime("01/01/$year");
return $start_date_year_ts;
}
- function get_end_date_year_ts($year){
+ function get_end_date_year_ts($year)
+ {
$to_year = $year + 1;
$end_date_year_ts = strtotime("01/01/$to_year");
return $end_date_year_ts;
}
- function validate_year($validate_year){
-
- if( empty( $validate_year ) ){
+ function validate_year($validate_year)
+ {
+ if( empty( $validate_year ) )
+ {
$validate_year = date("Y");
}
@@ -678,8 +788,28 @@
return $validate_year;
}
- function validate_month($month){
+ function validate_repeat_type($validate_repeat_type)
+ {
+ if( $validate_repeat_type != 0 & (empty(
$validate_repeat_type ) | ($validate_repeat_type > 3)) )
+ {
+ $validate_repeat_type = '';
+ }
+ return $validate_repeat_type;
+ }
+
+ function validate_role($validate_role)
+ {
+ if( empty( $validate_role ) |
(!is_numeric($validate_role)) | ($validate_role < 1) )
+ {
+ $validate_role = '';
+ }
+
+ return $validate_role;
+ }
+
+ function validate_month($month)
+ {
if( empty( $month ) ){
$month = date("n");
}
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-06-28 11:53:08 UTC (rev 9700)
+++ branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php
2012-06-28 11:56:58 UTC (rev 9701)
@@ -331,7 +331,8 @@
self::render_template_xsl(array('check_list/check_list_tab_menu','check_list/edit_check_list'),
$data);
}
- function view_cases_for_check_list(){
+ function view_cases_for_check_list()
+ {
$check_list_id = phpgw::get_var('check_list_id');
$check_list = $this->so->get_single($check_list_id);
@@ -360,7 +361,8 @@
self::render_template_xsl(array('check_list/check_list_tab_menu',
'check_list/view_cases_for_check_list'), $data);
}
- function create_case_message(){
+ function create_case_message()
+ {
$check_list_id = phpgw::get_var('check_list_id');
$check_list_with_check_items =
$this->so->get_single_with_check_items($check_list_id);
@@ -393,7 +395,8 @@
}
// Saves a check list that already exists. Returns status for
update as a JSON array with values update/not updated
- public function update_check_list(){
+ public function update_check_list()
+ {
$check_list_id = phpgw::get_var('check_list_id');
$status = (int)phpgw::get_var('status');
$comment = phpgw::get_var('comment');
@@ -428,7 +431,8 @@
return json_encode( array( "status" =>
"not_updated" ) );
}
- public function print_check_list(){
+ public function print_check_list()
+ {
$check_list_id = phpgw::get_var('check_list_id');
$check_list = $this->so->get_single($check_list_id);
@@ -456,7 +460,8 @@
self::render_template_xsl('check_list/print_check_list', $data);
}
- public function view_control_info(){
+ public function view_control_info()
+ {
$check_list_id = phpgw::get_var('check_list_id');
$check_list = $this->so->get_single($check_list_id);
@@ -478,7 +483,8 @@
self::render_template_xsl(array('check_list/check_list_tab_menu','check_list/view_control_info'),
$data);
}
- function view_control_details(){
+ function view_control_details()
+ {
$control_id = phpgw::get_var('control_id');
$control = $this->so_control->get_single($control_id);
@@ -492,7 +498,8 @@
}
// Displays control groups and control items for a check list
- function register_case(){
+ function register_case()
+ {
$check_list_id = phpgw::get_var('check_list_id');
$check_list = $this->so->get_single($check_list_id);
@@ -507,7 +514,8 @@
{
$saved_control_items =
$this->so_control_item_list->get_control_items_and_options_by_control_and_group($control->get_id(),
$control_group->get_id(), "return_array");
- if(count($saved_control_items) > 0){
+ if(count($saved_control_items) > 0)
+ {
$control_groups_with_items_array[] =
array("control_group" => $control_group->toArray(), "control_items" =>
$saved_control_items);
}
}
@@ -556,10 +564,10 @@
$data = array
(
- 'control'
=> $control->toArray(),
- 'check_list'
=> $check_list->toArray(),
- 'location_array'
=> $location_array,
- 'control_groups_with_items_array' =>
$control_groups_with_items_array
+ 'control'
=> $control->toArray(),
+ 'check_list'
=> $check_list->toArray(),
+ 'location_array'
=> $location_array,
+ 'control_groups_with_items_array' =>
$control_groups_with_items_array
);
self::add_javascript('controller', 'controller',
'jquery.js');
@@ -569,31 +577,32 @@
self::render_template_xsl(array('check_list/check_list_tab_menu',
'check_list/register_case'), $data);
}
- function view_open_cases(){
+ function view_open_cases()
+ {
$check_list_id = phpgw::get_var('check_list_id');
$check_list = $this->so->get_single($check_list_id);
$open_check_items_and_cases =
$this->so_check_item->get_check_items_with_cases($check_list_id, $type = null,
'open_or_waiting', null, 'return_array');
- foreach($open_check_items_and_cases as $key =>
$check_item){
-
- $check_item_with_options =
$this->so_control_item->get_single_with_options($check_item['control_item_id']);
- $check_item['control_item']['options_array'] =
$check_item_with_options['options_array'];
-
+ foreach($open_check_items_and_cases as $key =>
$check_item)
+ {
+ $control_item_with_options =
$this->so_control_item->get_single_with_options($check_item['control_item_id'],
"return_array");
+ $check_item['control_item']['options_array'] =
$control_item_with_options['options_array'];
$open_check_items_and_cases[$key] = $check_item;
}
-
+
$data = array
(
- 'open_check_items_and_cases' =>
$open_check_items_and_cases,
- 'check_list'
=> $check_list->toArray()
+ 'open_check_items_and_cases' =>
$open_check_items_and_cases,
+ 'check_list'
=> $check_list->toArray()
);
self::render_template_xsl(
array('check_list/cases_tab_menu', 'check_list/view_open_cases'), $data );
}
- function view_closed_cases(){
+ function view_closed_cases()
+ {
$check_list_id = phpgw::get_var('check_list_id');
$check_list = $this->so->get_single($check_list_id);
@@ -603,15 +612,16 @@
$data = array
(
- 'closed_check_items_and_cases'
=> $closed_check_items_and_cases,
+ 'closed_check_items_and_cases'
=> $closed_check_items_and_cases,
'closed_check_items_and_measurements' =>
$closed_check_items_and_measurements,
- 'check_list'
=> $check_list->toArray()
+ 'check_list'
=>
$check_list->toArray()
);
self::render_template_xsl(
array('check_list/cases_tab_menu', 'check_list/view_closed_cases'), $data );
}
- function view_control_items(){
+ function view_control_items()
+ {
$check_list_id = phpgw::get_var('check_list_id');
$check_list = $this->so->get_single($check_list_id);
Modified: branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
2012-06-28 11:53:08 UTC (rev 9700)
+++ branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
2012-06-28 11:56:58 UTC (rev 9701)
@@ -185,7 +185,13 @@
'type' =>
'submit',
'name' =>
'search',
'value' =>
lang('Search')
- )
+ ),
+ array(
+ 'type' =>
'link',
+ 'value' =>
lang('New control'),
+ 'href' =>
self::link(array('menuaction' => 'controller.uicontrol.view_control_details')),
+ 'class' =>
'new_item'
+ ),
),
),
),
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
2012-06-28 11:53:08 UTC (rev 9700)
+++ branches/Version-1_0-branch/controller/inc/class.uicontrol_item.inc.php
2012-06-28 11:56:58 UTC (rev 9701)
@@ -53,7 +53,8 @@
'query' => true,
'edit' => true,
'view' => true,
- 'add' => true,
+ 'add' => true,
+ 'save' => true,
'display_control_items' => true,
'delete_item_list' => true
);
@@ -197,8 +198,18 @@
public function edit()
{
$control_item_id = phpgw::get_var('id');
- $control_item = $this->so->get_single( $control_item_id
);
+ $control_item_array = array();
+ if($control_item_id > 0)
+ {
+ $control_item_array =
$this->so->get_single_with_options( $control_item_id , "return_array");
+ }
+ else
+ {
+ $control_item = new controller_control_item();
+ $control_item_array = $control_item->toArray();
+ }
+
// Sigurd: START as categories
$cats = CreateObject('phpgwapi.categories', -1,
'controller', '.control');
$cats->supress_info = true;
@@ -209,17 +220,15 @@
$control_groups_array =
$this->so_control_group->get_control_group_array();
// Hack to fix display of char
- $control_item->set_what_to_do(str_replace(" ", "
",$control_item->get_what_to_do()));
- $control_item->set_how_to_do(str_replace(' ', ' ',
$control_item->get_how_to_do()));
+ $control_item_array['what_to_do'] =
str_replace(" ", " ",$control_item_array['what_to_do']);
+ $control_item_array['how_to_do'] =
str_replace(' ', ' ', $control_item_array['how_to_do']);
- $control_item_array = $control_item->toArray();
-
$data = array
(
'editable' => true,
- 'control_item' =>
$control_item_array,
- 'control_areas' =>
$control_areas_array,
- 'control_groups' =>
$control_groups_array,
+ 'control_item' => $control_item_array,
+ 'control_areas' => $control_areas_array,
+ 'control_groups' =>
$control_groups_array,
);
$this->use_yui_editor(array('what_to_do','how_to_do'));
@@ -234,37 +243,87 @@
public function save()
{
$control_item_id = phpgw::get_var('id');
+ $title = phpgw::get_var('title');
+ $required = phpgw::get_var('required') == 'on' ? true :
false;
+ $type = phpgw::get_var('control_item_type');
+ $control_group_id = phpgw::get_var('control_group');
+ $control_area_id = phpgw::get_var('control_area');
+ $type = phpgw::get_var('control_item_type');
$what_to_do_txt = phpgw::get_var('what_to_do','html');
$what_to_do_txt = str_replace(" ", " ",
$what_to_do_txt);
$how_to_do_txt = phpgw::get_var('how_to_do','html');
$how_to_do_txt = str_replace(" ", " ",
$how_to_do_txt);
- $control_item->set_title(phpgw::get_var('title'));
- $control_item->set_required(phpgw::get_var('required')
== 'on' ? true : false);
-
$control_item->set_type(phpgw::get_var('control_item_type'));
- $control_item->set_what_to_do( $what_to_do_txt );
- $control_item->set_how_to_do( $how_to_do_txt );
- $control_item->set_control_group_id(
phpgw::get_var('control_group') );
- $control_item->set_control_area_id(
phpgw::get_var('control_area') );
-
- $control_item_id = $this->so->store($control_item);
-
+
if($control_item_id > 0)
{
- $message = lang('messages_saved_form');
+ $control_item = $this->so->get_single(
$control_item_id );
+ }
+ else
+ {
+ $control_item = new controller_control_item();
+ }
+
+ $control_item->set_title($title);
+ $control_item->set_required($required);
+ $control_item->set_control_group_id($control_group_id);
+ $control_item->set_control_area_id($control_area_id);
+ $control_item->set_type($type);
+ $control_item->set_what_to_do($what_to_do_txt);
+ $control_item->set_how_to_do($how_to_do_txt);
+
+ $saved_control_item_id =
$this->so->store($control_item);
+
+ $this->so->delete_option_values( $saved_control_item_id
);
+
+ if(($saved_control_item_id > 0) &
($control_item->get_type() == 'control_item_type_3' | $control_item->get_type()
== 'control_item_type_4'))
+ {
+ $option_values =
phpgw::get_var('option_values');
- if($control_item->get_type() ==
'control_item_type_3' | $control_item->get_type() == 'control_item_type_4'){
- $option_values =
phpgw::get_var('option_values');
-
- foreach($option_values as
$option_value){
- $control_item_option = new
controller_control_item_option($option_value, $control_item_id);
- $control_item_option_id =
$this->so_control_item_option->store( $control_item_option );
- }
+ foreach($option_values as $option_value){
+ $control_item_option = new
controller_control_item_option($option_value, $saved_control_item_id);
+ $control_item_option_id =
$this->so_control_item_option->store( $control_item_option );
}
}
- $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'controller.uicontrol_item.index', 'dir' => 'desc'));
+ $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'controller.uicontrol_item.view', 'id' =>
$saved_control_item_id));
}
+ /**
+ * Public method. Called when a user wants to view information
about a control item.
+ * @param HTTP::id the control_item ID
+ */
+ public function view()
+ {
+ //Retrieve the control_item object
+ $control_item_id = (int)phpgw::get_var('id');
+
+ if(isset($control_item_id) && $control_item_id > 0)
+ {
+ $control_item_array =
$this->so->get_single_with_options($control_item_id, "return_array");
+ }
+ else
+ {
+
$this->render('permission_denied.php',array('error' =>
lang('invalid_request')));
+ return;
+ }
+
+ $category =
execMethod('phpgwapi.categories.return_single',
$control_item_array['control_area_id']);
+ $control_item_array['control_area_name'] =
$category[0]['name'];
+
+ /* Hack to fix display of char */
+ $control_item_array['what_to_do'] =
str_replace(" ", " ",$control_item_array['what_to_do']);
+ $control_item_array['how_to_do'] =
str_replace(' ', ' ', $control_item_array['how_to_do']);
+
+ $data = array
+ (
+ 'value_id' =>
!empty($control_item) ? $control_item->get_id() : 0,
+ 'control_item' => $control_item_array,
+ 'view' => true
+ );
+
+ self::render_template_xsl('control_item/control_item',
$data);
+ }
+
public function query()
{
$params = array(
@@ -348,63 +407,4 @@
return $this->yui_results($results);
}
-
- /**
- * Public method. Called when a user wants to view information
about a control item.
- * @param HTTP::id the control_item ID
- */
- public function view()
- {
- $GLOBALS['phpgw_info']['flags']['app_header'] .=
'::'.lang('view');
- //Retrieve the control_item object
- $control_item_id = (int)phpgw::get_var('id');
- if(isset($_POST['edit_control_item']))
- {
- $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'controller.uicontrol_item.edit', 'id' =>
$control_item_id));
- }
- else
- {
- if(isset($control_item_id) && $control_item_id
> 0)
- {
- $control_item =
$this->so->get_single($control_item_id);
- }
- else
- {
-
$this->render('permission_denied.php',array('error' =>
lang('invalid_request')));
- return;
- }
- //var_dump($control_item);
-
- if($this->flash_msgs)
- {
- $msgbox_data =
$GLOBALS['phpgw']->common->msgbox_data($this->flash_msgs);
- $msgbox_data =
$GLOBALS['phpgw']->common->msgbox($msgbox_data);
- }
-
- $category =
execMethod('phpgwapi.categories.return_single',
$control_item->get_control_area_id());
-
$control_item->set_control_area_name($category[0]['name']);
-
- /*
- * hack to fix display of char
- */
-
$control_item->set_what_to_do(str_replace(" ", "
",$control_item->get_what_to_do()));
-
$control_item->set_how_to_do(str_replace(' ', ' ',
$control_item->get_how_to_do()));
-
- $control_item_array = $control_item->toArray();
-
- $data = array
- (
- 'value_id'
=> !empty($control_item) ? $control_item->get_id() : 0,
- 'img_go_home' =>
'rental/templates/base/images/32x32/actions/go-home.png',
- 'control_item' =>
$control_item_array,
- );
-
-
- $GLOBALS['phpgw_info']['flags']['app_header'] =
lang('controller') . '::' . lang('Control item');
-
-
self::render_template_xsl('control_item/control_item', $data);
- }
- }
-
-
}
Modified:
branches/Version-1_0-branch/controller/inc/class.uicontrol_location.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicontrol_location.inc.php
2012-06-28 11:53:08 UTC (rev 9700)
+++ branches/Version-1_0-branch/controller/inc/class.uicontrol_location.inc.php
2012-06-28 11:56:58 UTC (rev 9701)
@@ -114,101 +114,6 @@
function index()
{
- if(phpgw::get_var('phpgw_return_as') == 'json') {
- return $this->query();
- }
-
- // Sigurd: START as categories
- $cats = CreateObject('phpgwapi.categories', -1,
'controller', '.control');
- $cats->supress_info = true;
-
- $control_areas =
$cats->formatted_xslt_list(array('format'=>'filter','globals' => true,'use_acl'
=> $this->_category_acl));
-
- $control_areas_array = array();
- foreach($control_areas['cat_list'] as $cat_list)
- {
- $control_areas_array[] = array
- (
- 'id' => $cat_list['cat_id'],
- 'name' => $cat_list['name'],
- );
- }
- // END as categories
-
- $tabs = array
- (
- array
- (
- 'label' =>
lang('View_locations_for_control')
- ),
- array
- (
- 'label' =>
lang('Add_locations_for_control'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol_location.register_control_to_location'))
- ),
- array
- (
- 'label' => lang('add components for
control'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol_location.register_control_to_component'))
- )
- );
-
- $data = array(
- 'tabs' =>
$GLOBALS['phpgw']->common->create_tabs($tabs, 0),
- 'view' =>
"view_locations_for_control",
- 'control_areas_array' => $control_areas_array,
- 'locations_table' => array(
- 'source' =>
self::link(array('menuaction' =>
'controller.uicontrol_location.get_locations_for_control', 'control_id' =>
$control_id ,'phpgw_return_as' => 'json')),
- 'field' => array(
- array(
- 'key' => 'id',
- 'label' =>
lang('ControlId'),
- 'sortable' => true,
- ),
- array(
- 'key' => 'title',
- 'label' =>
lang('Control title'),
- 'sortable' =>
false
- ),
- array(
- 'key' =>
'location_code',
- 'label' =>
lang('location_code'),
- 'sortable' => false
- ),
- array(
- 'key' => 'loc1_name',
- 'label' =>
lang('Property name'),
- 'sortable' => false
- ),
- array(
- 'key' => 'actions',
- 'hidden' => true
- ),
- array(
- 'key' => 'labels',
- 'hidden' => true
- ),
- array(
- 'key' => 'ajax',
- 'hidden' => true
- ),array(
- 'key' => 'parameters',
- 'hidden' => true
- )
- )
- )
- );
-
- phpgwapi_yui::load_widget('paginator');
-
- self::add_javascript('controller', 'controller',
'jquery.js');
- self::add_javascript('controller', 'controller',
'ajax.js');
-
-
self::render_template_xsl(array('control_location/control_location_tabs',
'control_location/view_locations_for_control', 'common' ), $data);
- }
-
- function register_control_to_location()
- {
$control_id = phpgw::get_var('control_id');
if(phpgw::get_var('save_location'))
{
@@ -219,16 +124,7 @@
$ok =
$this->so_control->register_control_to_location($control_id, $values);
-/* if($ok)
- {
- return json_encode( array( "status" =>
"saved" ) );
- }
- else
- {
- return json_encode( array( "status" =>
"not_saved" ) );
- }
-*/
- $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' =>
'controller.uicontrol_location.register_control_to_location', 'control_id' =>
$control_id));
+ $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'controller.uicontrol_location.index', 'control_id' =>
$control_id));
}
else
@@ -284,41 +180,16 @@
'name' => $cat_list['name'],
);
}
-
-/*
- $control_info =
execMethod('controller.socontrol.get_single', $control_id);
- if($control_info)
- {
- $control_array = array
- (
- 'id' => $control_id,
- 'title' =>
$control_info->get_title()
- );
- }
-*/
- $tabs = array
- (
- array
- (
- 'label' =>
lang('View_locations_for_control'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol_location.index'))
- ),
- array
- (
- 'label' =>
lang('Add_locations_for_control')
- )
- );
$data = array(
- 'tabs'
=> $GLOBALS['phpgw']->common->create_tabs($tabs, 1),
- 'view'
=> "register_control_to_location",
- 'control_id'
=> $control_id,
- 'control_areas_array' =>
$control_areas_array,
+ 'view'
=> "register_control_to_location",
+ 'control_id'
=> $control_id,
+ 'control_areas_array' =>
$control_areas_array,
'filter_form'
=> array(
- 'building_types'
=> $building_types,
- 'category_types'
=> $category_types,
- 'district_list'
=> $district_list,
- 'part_of_town_list'
=> $part_of_town_list
+ 'building_types'
=> $building_types,
+ 'category_types'
=> $category_types,
+ 'district_list'
=> $district_list,
+ 'part_of_town_list' =>
$part_of_town_list
),
'datatable' => array(
'source' =>
self::link(array('menuaction' => 'controller.uicontrol_location.index',
'phpgw_return_as' => 'json', 'view_type' =>
'register_control','control_id_init' => $control_id)),
@@ -389,8 +260,6 @@
}
}
-
-
// Returns locations for a control
public function get_locations_for_control()
{
@@ -497,12 +366,6 @@
$value['actions'] = array();
$value['labels'] = array();
$value['parameters'] = array();
-/*
- $value['ajax'][] = true;
- $value['actions'][] =
html_entity_decode(self::link(array('menuaction' =>
'controller.uicontrol_location.register_control_to_location_2','location_code'
=> $value['location_code'], 'phpgw_return_as' => 'json')));
- $value['labels'][] = lang('add_location');
- $value['parameters'][] = "control_id";
- */
}
/*
@@ -626,27 +489,10 @@
array_unshift ($control_area_list ,array
('id'=>'','name'=>lang('select')));
- $tabs = array
- (
-/* array
- (
- 'label' =>
lang('View_locations_for_control'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol_location.index'))
- ),
- array
- (
- 'label' =>
lang('Add_locations_for_control'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol_location.register_control_to_location'))
- ),*/
- array
- (
- 'label' => lang('add components for
control')
- )
- );
+
$data = array
(
- 'tabs'
=> $GLOBALS['phpgw']->common->create_tabs($tabs, 2),
'td_count'
=> '""',
// 'property_js'
=>
json_encode($GLOBALS['phpgw_info']['server']['webserver_url']."/property/js/yahoo/property2.js"),
'datatable'
=> $datavalues,
@@ -739,7 +585,7 @@
'className' => ''
);
- $count_fields = 16;//count($uicols['name']);
+ $count_fields = count($uicols['name']);
for ($i=0;$i<$count_fields;$i++)
{
Modified: branches/Version-1_0-branch/controller/inc/class.uidocument.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uidocument.inc.php
2012-06-28 11:53:08 UTC (rev 9700)
+++ branches/Version-1_0-branch/controller/inc/class.uidocument.inc.php
2012-06-28 11:56:58 UTC (rev 9701)
@@ -289,15 +289,19 @@
{
$document_id = intval(phpgw::get_var('id'));
$document = $this->so->get_single($document_id);
+
+ $procedure_id = intval(phpgw::get_var('procedure_id'));
+ $procedure = $this->so_procedure->get_single($procedure_id);
+
$document_properties = $this->get_type_and_id($document);
- if(!$this->check_permissions($document,$document_properties))
+ /*if(!$this->check_permissions($document,$document_properties))
{
$this->render('permission_denied.php');
return;
- }
+ }*/
- $result =
rental_sodocument::get_instance()->delete_document_from_vfs
+ $result = $this->so->delete_document_from_vfs
(
$document_properties['document_type'],
$document_properties['id'],
@@ -306,7 +310,10 @@
if($result)
{
- return $this->so->delete_document($document_id);
+ $this->so->delete_document($document_id);
+ $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'controller.uidocument.show',
+
'procedure_id' => $procedure->get_id(),
+
'tab' => 'documents'));
}
// TODO: communicate error/message to user
return false;
@@ -429,6 +436,8 @@
$doc_array = $document->toArray();
$doc_array['link'] = self::link(array('menuaction' =>
'controller.uidocument.view',
'id' => $doc_array['id']));
+ $doc_array['delete_link'] = self::link(array('menuaction'
=> 'controller.uidocument.delete',
+
'id' => $doc_array['id'], 'procedure_id' => $procedure_id));
$table_values[] = array('document' => $doc_array);
}
Modified: branches/Version-1_0-branch/controller/inc/class.uiprocedure.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uiprocedure.inc.php
2012-06-28 11:53:08 UTC (rev 9700)
+++ branches/Version-1_0-branch/controller/inc/class.uiprocedure.inc.php
2012-06-28 11:56:58 UTC (rev 9701)
@@ -118,7 +118,13 @@
'type' =>
'submit',
'name' =>
'search',
'value' =>
lang('Search')
- )
+ ),
+ array(
+ 'type' =>
'link',
+ 'value' =>
lang('t_new_procedure'),
+ 'href' =>
self::link(array('menuaction' => 'controller.uiprocedure.add')),
+ 'class' =>
'new_item'
+ ),
),
),
),
Modified: branches/Version-1_0-branch/controller/inc/hook_home.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/hook_home.inc.php
2012-06-28 11:53:08 UTC (rev 9700)
+++ branches/Version-1_0-branch/controller/inc/hook_home.inc.php
2012-06-28 11:56:58 UTC (rev 9701)
@@ -33,7 +33,7 @@
include_class('controller', 'check_list_status_info', 'inc/helper/');
include_class('controller', 'date_generator', 'inc/component/');
include_class('controller', 'location_finder', 'inc/helper/');
-
+
$so = CreateObject('controller.socheck_list');
$so_control = CreateObject('controller.socontrol');
@@ -42,8 +42,6 @@
$limit_no_of_planned =
isset($GLOBALS['phpgw_info']['user']['preferences']['controller']['no_of_planned_controls'])?
$GLOBALS['phpgw_info']['user']['preferences']['controller']['no_of_planned_controls']
: (isset($config->config_data['no_of_planned_controls']) &&
$config->config_data['no_of_planned_controls'] > 0 ?
$config->config_data['no_of_planned_controls']:5);
$limit_no_of_assigned =
isset($GLOBALS['phpgw_info']['user']['preferences']['controller']['no_of_assigned_controls'])?
$GLOBALS['phpgw_info']['user']['preferences']['controller']['no_of_assigned_controls']
: (isset($config->config_data['no_of_assigned_controls']) &&
$config->config_data['no_of_assigned_controls'] > 0 ?
$config->config_data['no_of_assigned_controls']:10);
- //echo '<H1> Hook for controller </H1>';
- //$location_code = '1101';
$year = phpgw::get_var('year');
if(empty($year)){
@@ -52,7 +50,6 @@
$year = intval($year);
- //$from_date_ts = strtotime("01/01/$year");
$from_date_ts = strtotime("now");
$to_year = $year + 1;
$to_date_ts = strtotime("01/01/$to_year");
@@ -72,7 +69,20 @@
$controls_for_location_array = array();
foreach($my_locations as $location)
{
- $controls_for_location_array[] = array($location["location_code"],
$so_control->get_controls_for_location($location["location_code"],
$location["role_id"], $from_date_ts, $to_date_ts, $repeat_type ));
+ $controls = array();
+ $controls_loc =
$so_control->get_controls_by_location($location["location_code"],
$from_date_ts, $to_date_ts, $repeat_type, '', $location["role_id"] );
+ $controls_comp =
$so_control->get_controls_for_components_by_location($location["location_code"],
$from_date_ts, $to_date_ts, $repeat_type, '', $location["role_id"] );
+
+ foreach($controls_loc as $cl)
+ {
+ $controls[] = $cl;
+ }
+ foreach($controls_comp as $cc)
+ {
+ $controls[] = $cc;
+ }
+
+ $controls_for_location_array[] = array($location["location_code"],
$controls);
}
@@ -113,11 +123,6 @@
'edit' => array('url' => '/set_box.php', 'app' =>
$app_id)
);
- foreach ( $var as $key => $value )
- {
- // $portalbox->set_controls($key,$value);
- }
-
$category_name = array(); // caching
$cats = CreateObject('phpgwapi.categories', -1, 'controller',
'.control');
@@ -146,7 +151,7 @@
$portalbox0_data[] = array
($check_list->get_deadline(), array
(
- 'text' => "{$location_name} -
{$control_area_name} - {$current_control["title"]} :: {$next_date}",
+ 'text' => "<span
class='title'>{$location_name}</span><span
class='control-area'>{$control_area_name}</span> <span
class='control'>{$current_control["title"]}</span> <span
class='date'>{$next_date}</span>",
'link' => $GLOBALS['phpgw']->link('/index.php',
array('menuaction' => 'controller.uicheck_list.edit_check_list',
'check_list_id' => $check_list->get_id()))
));
}
@@ -164,8 +169,19 @@
$tmp++;
}
- echo "\n".'<!-- BEGIN checklist info -->'."\n<div
class='controller_checklist' style='padding-left: 10px; background-color:
red;'>".$portalbox0->draw()."</div>\n".'<!-- END checklist info -->'."\n";
+ $styling = "\n".'<!-- BEGIN checklist info -->'."\n ";
+ $styling .= "<style> .home_portal_content
a{color:#0066CC;text-decoration: none;text-transform: uppercase;}
.home_portal{margin: 20px 10px 0;} ";
+ $styling .= " .home-box {background: none repeat scroll 0 0 #EDF5FF;
border-color: #DBE5EF; border-radius: 4px; margin: 20px;}";
+ $styling .= " .home-box .home_portal{margin: 0;border: 1px solid
#DEEAF8;} .home_portal_content{padding:10px;} ";
+ $styling .= " .home_portal_title h2{ background: #DEEAF8; margin: 0;
padding: 5px 10px;} .home_portal_content ul li{padding: 3px;}";
+ $styling .= " .home_portal_content
.title{display:inline-block;width:300px;} .home_portal_content
.control-area{display:inline-block;width:200px;}";
+ $styling .= " .home_portal_content
.control{display:inline-block;width:300px;} .home_portal_content
.date{display:inline-block;width:300px;}";
+ $styling .= "</style>";
+ $styling .= "\n".'<!-- END checklist info -->'."\n";
+ echo $styling;
+ echo "\n".'<!-- BEGIN checklist info -->'."\n <div
class='home-box'>".$portalbox0->draw()."</div>\n".'<!-- END checklist info
-->'."\n";
+
$portalbox1 = CreateObject('phpgwapi.listbox', array
(
'title' => "Mine planlagte kontroller",
@@ -191,11 +207,6 @@
'edit' => array('url' => '/set_box.php', 'app' =>
$app_id)
);
- foreach ( $var as $key => $value )
- {
- // $portalbox->set_controls($key,$value);
- }
-
$category_name = array(); // caching
$cats = CreateObject('phpgwapi.categories', -1, 'controller',
'.control');
@@ -224,7 +235,7 @@
$portalbox1_data[] = array
($check_list->get_planned_date(), array
(
- 'text' => "{$location_name} -
{$control_area_name} - {$current_control["title"]} :: {$next_date}",
+ 'text' => "<span
class='title'>{$location_name}</span><span
class='control-area'>{$control_area_name}</span> <span
class='control'>{$current_control["title"]}</span> <span
class='date'>{$next_date}</span>",
'link' => $GLOBALS['phpgw']->link('/index.php',
array('menuaction' => 'controller.uicheck_list.edit_check_list',
'check_list_id' => $check_list->get_id()))
));
}
@@ -241,7 +252,7 @@
}
$tmp++;
}
- echo "\n".'<!-- BEGIN checklist info -->'."\n<div
class='controller_checklist' style='padding-left:
10px;'>".$portalbox1->draw()."</div>\n".'<!-- END checklist info -->'."\n";
+ echo "\n".'<!-- BEGIN checklist info -->'."\n<div
class='home-box'>".$portalbox1->draw()."</div>\n".'<!-- END checklist info
-->'."\n";
$portalbox2 = CreateObject('phpgwapi.listbox', array
(
@@ -308,19 +319,22 @@
$portalbox2_data[] = array
($current_date, array
(
- 'text' =>
"{$location_name} - {$control_area_name} - {$current_control["title"]} ::
{$next_date}",
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicheck_list.add_check_list', 'date' => $current_date, 'control_id'
=> $current_control["id"], 'location_code' => $curr_location))
+ 'text' => "<span
class='title'>{$location_name}</span><span
class='control-area'>{$control_area_name}</span> <span
class='control'>{$current_control["title"]}</span> <span
class='date'>{$next_date}</span>",
+ 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicheck_list.add_check_list', 'deadline_ts' => $current_date,
'control_id' => $current_control["id"], 'location_code' => $curr_location))
));
}
else
{
- $next_date = "Fristdato: " .
date('d/m/Y', $check_list->get_deadline());
- $portalbox2_data[] = array
- ($check_list->get_deadline(),
array
- (
- 'text' =>
"{$location_name} - {$control_area_name} - {$current_control["title"]} ::
{$next_date}",
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicheck_list.edit_check_list', 'check_list_id' =>
$check_list->get_id()))
- ));
+ if(!$check_list->get_planned_date())
+ {
+ $next_date = "Fristdato: " .
date('d/m/Y', $check_list->get_deadline());
+ $portalbox2_data[] = array
+ ($check_list->get_deadline(),
array
+ (
+ 'text' => "<span
class='title'>{$location_name}</span><span
class='control-area'>{$control_area_name}</span> <span
class='control'>{$current_control["title"]}</span> <span
class='date'>{$next_date}</span>",
+ 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicheck_list.edit_check_list', 'check_list_id' =>
$check_list->get_id()))
+ ));
+ }
}
}
}
@@ -330,8 +344,8 @@
$portalbox2_data[] = array
($current_date, array
(
- 'text' => "{$location_name} -
{$control_area_name} - {$current_control["title"]} :: {$next_date}",
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicheck_list.add_check_list', 'date' => $current_date, 'control_id'
=> $current_control["id"], 'location_code' => $curr_location))
+ 'text' => "<span
class='title'>{$location_name}</span><span
class='control-area'>{$control_area_name}</span> <span
class='control'>{$current_control["title"]}</span> <span
class='date'>{$next_date}</span>",
+ 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicheck_list.add_check_list', 'deadline_ts' => $current_date,
'control_id' => $current_control["id"], 'location_code' => $curr_location))
));
}
}
@@ -349,4 +363,4 @@
}
$tmp++;
}
- echo "\n".'<!-- BEGIN assigned checklist info -->'."\n<div
class='controller_checklist' style='padding-left:
10px;'>".$portalbox2->draw()."</div>\n".'<!-- END assigned checklist info
-->'."\n";
+ echo "\n".'<!-- BEGIN assigned checklist info -->'."\n<div
class='home-box'>".$portalbox2->draw()."</div>\n".'<!-- END assigned checklist
info -->'."\n";
Modified:
branches/Version-1_0-branch/controller/inc/model/class.component.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/model/class.component.inc.php
2012-06-28 11:53:08 UTC (rev 9700)
+++ branches/Version-1_0-branch/controller/inc/model/class.component.inc.php
2012-06-28 11:56:58 UTC (rev 9701)
@@ -82,7 +82,6 @@
public function get_guid() { return $this->guid; }
-
public function set_xml($xml)
{
$this->xml = $xml;
@@ -90,6 +89,13 @@
public function get_xml() { return $this->xml; }
+ public function set_xml_short_desc($xml_short_desc)
+ {
+ $this->xml_short_desc = $xml_short_desc;
+ }
+
+ public function get_xml_short_desc() { return
$this->xml_short_desc; }
+
public function set_location_code($location_code)
{
$this->location_code = $location_code;
Modified: branches/Version-1_0-branch/controller/js/controller/ajax.js
===================================================================
--- branches/Version-1_0-branch/controller/js/controller/ajax.js
2012-06-28 11:53:08 UTC (rev 9700)
+++ branches/Version-1_0-branch/controller/js/controller/ajax.js
2012-06-28 11:56:58 UTC (rev 9701)
@@ -49,6 +49,8 @@
window.location.href = requestUrl;
});
+ /* ================================ FILTERS
================================== */
+
$("#filter-repeat_type").change(function () {
var repeat_type = $(this).val();
var thisForm = $(this).closest("form");
@@ -374,7 +376,7 @@
/* ========================= CONTROL OPTION
======================================== */
// Changes control type location level between building and property in
search location select box
- $(".control_item_type").click(function(){
+ $(".control_item_type").live("click", function(){
var thisBtn = $(this).find(".btn");
var thisRadio = $(this).find("input[type=radio]");
@@ -402,7 +404,7 @@
});
$("#control_item_options li .delete").live("click", function(e){
- $(this).closest("li").fadeOut();
+ $(this).closest("li").remove();
});
$("#add_control_item_list_value input[type=button]").live("click",
function(e){
@@ -411,15 +413,22 @@
var listValue =
$(this).parent().find("input[name=option_value]").val();
var order_nr = 1;
- if($("ul#control_item_options").children().length == 0){
+ if(listValue.length > 0){
+
+ $("#add_control_item_option_panel
.input_error_msg").remove();
+
+ if($("ul#control_item_options").children().length == 0){
order_nr = 1;
+ }else{
+ order_nr =
$("ul#control_item_options").find("li").last().find(".order_nr").text();
+ order_nr++;
+ }
+
+
$("ul#control_item_options").append("<li><label>Listeverdi<span
class='order_nr'>" + order_nr + "</span></label><input type='text'
name='option_values[]' value='" + listValue + "' /><span class='btn
delete'>Slett</span></li>")
+ $(this).parent().find("input[name=option_value]").val('');
}else{
- order_nr =
$("ul#control_item_options").find("li").last().find(".order_nr").text();
- order_nr++;
+ $(this).closest(".row").before("<div
class='input_error_msg'>Listeverdien kan ikke være tom</div>");
}
-
- $("ul#control_item_options").append("<li><label>Listeverdi<span
class='order_nr'>" + order_nr + "</span></label><input type='text'
name='option_values[]' value='" + listValue + "' /><span class='btn
delete'>Slett</span></li>")
- $(this).parent().find("input[name=option_value]").val('');
});
/* ========================= CONTROL
=============================================== */
@@ -534,6 +543,8 @@
$("#frm_add_check_list").live("submit", function(e){
var thisForm = $(this);
var statusFieldVal = $("#status").val();
+ var plannedDateVal = $("#planned_date").val();
+ var plannedDateRow = $("#planned_date").closest(".row");
var completedDateVal = $("#completed_date").val();
var completedDateRow = $("#completed_date").closest(".row");
@@ -542,6 +553,10 @@
e.preventDefault();
// Displays error message above completed date
$(completedDateRow).before("<div
class='input_error_msg'>Vennligst angi når kontrollen ble utført</div>");
+ }else if(statusFieldVal == 0 & plannedDateVal == ''){
+ e.preventDefault();
+ // Displays error message above completed date
+ $(plannedDateRow).before("<div
class='input_error_msg'>Vennligst endre status for kontroll eller angi
planlagtdato</div>");
}
});
Copied:
branches/Version-1_0-branch/controller/templates/base/calendar/calendar_filters.xsl
(from rev 9700, trunk/controller/templates/base/calendar/calendar_filters.xsl)
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/calendar/calendar_filters.xsl
(rev 0)
+++
branches/Version-1_0-branch/controller/templates/base/calendar/calendar_filters.xsl
2012-06-28 11:56:58 UTC (rev 9701)
@@ -0,0 +1,85 @@
+<!-- $Id: view_calendar_month.xsl 9200 2012-04-21 20:05:34Z vator $ -->
+<xsl:template name="calendar_filters" xmlns:php="http://php.net/xsl">
+
+<xsl:param name="view_period" />
+
+<form id="cal-filters" class="select-box" method="post">
+ <xsl:choose>
+ <xsl:when test="$view_period = 'month'">
+ <xsl:attribute
name="action">index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute
name="action">index.php?menuaction=controller.uicalendar.view_calendar_for_year</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <input type="hidden" name="year">
+ <xsl:attribute name="value">
+ <xsl:value-of select="current_year"/>
+ </xsl:attribute>
+ </input>
+ <xsl:if test="$view_period = 'month'">
+ <input type="hidden" name="month">
+ <xsl:attribute name="value">
+ <xsl:value-of select="current_month_nr"/>
+ </xsl:attribute>
+ </input>
+ </xsl:if>
+ <input type="hidden" name="location_code">
+ <xsl:attribute name="value">
+ <xsl:value-of select="current_location/location_code"/>
+ </xsl:attribute>
+ </input>
+ <input type="hidden" name="repeat_type">
+ <xsl:attribute name="value">
+ <xsl:value-of select="current_repeat_type"/>
+ </xsl:attribute>
+ </input>
+ <input type="hidden" name="role">
+ <xsl:attribute name="value">
+ <xsl:value-of select="current_role"/>
+ </xsl:attribute>
+ </input>
+
+ <div class="filter first">
+ <label>Filtrer på rolle</label>
+ <select id="filter-role">
+ <xsl:for-each select="roles_array">
+ <xsl:variable name="role_id"><xsl:value-of
select="id"/></xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$role_id =
//current_role">
+ <option value="{$role_id}"
selected="selected">
+ <xsl:value-of
disable-output-escaping="yes" select="name"/>
+ </option>
+ </xsl:when>
+ <xsl:otherwise>
+ <option value="{$role_id}">
+ <xsl:value-of
disable-output-escaping="yes" select="name"/>
+ </option>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </select>
+ </div>
+ <div class="filter">
+ <label>Filtrer på frekvenstype</label>
+ <select id="filter-repeat_type" name="repeat_type">
+ <option value="">Velg frekvenstype</option>
+ <xsl:for-each select="repeat_type_array">
+ <xsl:choose>
+ <xsl:when test="id =
//current_repeat_type">
+ <option value="{id}"
selected="selected">
+ <xsl:value-of
disable-output-escaping="yes" select="value"/>
+ </option>
+ </xsl:when>
+ <xsl:otherwise>
+ <option value="{id}">
+ <xsl:value-of
disable-output-escaping="yes" select="value"/>
+ </option>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </select>
+ </div>
+</form>
+</xsl:template>
Copied:
branches/Version-1_0-branch/controller/templates/base/calendar/nav_calendar_month.xsl
(from rev 9700,
trunk/controller/templates/base/calendar/nav_calendar_month.xsl)
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/calendar/nav_calendar_month.xsl
(rev 0)
+++
branches/Version-1_0-branch/controller/templates/base/calendar/nav_calendar_month.xsl
2012-06-28 11:56:58 UTC (rev 9701)
@@ -0,0 +1,78 @@
+<!-- $Id: view_calendar_month.xsl 9200 2012-04-21 20:05:34Z vator $ -->
+<xsl:template name="nav_calendar_month" xmlns:php="http://php.net/xsl">
+
+<div id="calNav">
+ <xsl:choose>
+ <xsl:when test="current_month_nr > 1">
+ <a class="showPrev month">
+ <xsl:attribute name="href">
+
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
+ <xsl:text>&year=</xsl:text>
+ <xsl:value-of select="current_year"/>
+ <xsl:text>&month=</xsl:text>
+ <xsl:value-of select="current_month_nr
- 1"/>
+ <xsl:text>&location_code=</xsl:text>
+ <xsl:value-of
select="//current_location/location_code"/>
+ </xsl:attribute>
+ <img height="17"
src="controller/images/left_arrow_simple_light_blue.png" />
+ <xsl:variable name="month_str">month
<xsl:value-of select="current_month_nr - 1"/> capitalized</xsl:variable>
+ <xsl:value-of select="php:function('lang',
$month_str)" />
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ <a class="showPrev month">
+ <xsl:attribute name="href">
+
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
+ <xsl:text>&year=</xsl:text>
+ <xsl:value-of select="current_year -
1"/>
+ <xsl:text>&month=12</xsl:text>
+ <xsl:text>&location_code=</xsl:text>
+ <xsl:value-of
select="//current_location/location_code"/>
+ </xsl:attribute>
+ <img height="17"
src="controller/images/left_arrow_simple_light_blue.png" />
+ <xsl:variable name="month_str">month 12
capitalized</xsl:variable>
+ <xsl:value-of select="php:function('lang',
$month_str)" />
+ </a>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <span class="current">
+ <xsl:variable name="month_str">month <xsl:value-of
select="current_month_nr"/> capitalized</xsl:variable>
+ <xsl:value-of select="php:function('lang', $month_str)" />
+ </span>
+ <xsl:choose>
+ <xsl:when test="12 > current_month_nr">
+ <a class="showNext">
+ <xsl:attribute name="href">
+
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
+ <xsl:text>&year=</xsl:text>
+ <xsl:value-of select="current_year"/>
+ <xsl:text>&month=</xsl:text>
+ <xsl:value-of select="current_month_nr
+ 1"/>
+ <xsl:text>&location_code=</xsl:text>
+ <xsl:value-of
select="//current_location/location_code"/>
+ </xsl:attribute>
+ <xsl:variable name="month_str">month
<xsl:value-of select="current_month_nr + 1"/> capitalized</xsl:variable>
+ <xsl:value-of select="php:function('lang',
$month_str)" />
+ <img height="17"
src="controller/images/right_arrow_simple_light_blue.png" />
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ <a class="showNext">
+ <xsl:attribute name="href">
+
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
+ <xsl:text>&year=</xsl:text>
+ <xsl:value-of select="current_year +
1"/>
+ <xsl:text>&month=1</xsl:text>
+ <xsl:text>&location_code=</xsl:text>
+ <xsl:value-of
select="//current_location/location_code"/>
+ </xsl:attribute>
+ <xsl:variable name="month_str">month 1
capitalized</xsl:variable>
+ <xsl:value-of select="php:function('lang',
$month_str)" />
+ <img height="17"
src="controller/images/right_arrow_simple_light_blue.png" />
+ </a>
+ </xsl:otherwise>
+ </xsl:choose>
+</div>
+
+</xsl:template>
Copied:
branches/Version-1_0-branch/controller/templates/base/calendar/nav_calendar_year.xsl
(from rev 9700, trunk/controller/templates/base/calendar/nav_calendar_year.xsl)
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/calendar/nav_calendar_year.xsl
(rev 0)
+++
branches/Version-1_0-branch/controller/templates/base/calendar/nav_calendar_year.xsl
2012-06-28 11:56:58 UTC (rev 9701)
@@ -0,0 +1,32 @@
+<!-- $Id: view_calendar_month.xsl 9200 2012-04-21 20:05:34Z vator $ -->
+<xsl:template name="nav_calendar_year" xmlns:php="http://php.net/xsl">
+
+<div id="calNav">
+ <a class="showPrev">
+ <xsl:attribute name="href">
+
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_year</xsl:text>
+ <xsl:text>&year=</xsl:text>
+ <xsl:value-of select="current_year - 1"/>
+ <xsl:text>&location_code=</xsl:text>
+ <xsl:value-of select="current_location/location_code"/>
+ </xsl:attribute>
+ <img height="17"
src="controller/images/left_arrow_simple_light_blue.png" />
+ <xsl:value-of select="current_year - 1"/>
+ </a>
+ <span class="current">
+ <xsl:value-of select="current_year"/>
+ </span>
+ <a class="showNext">
+ <xsl:attribute name="href">
+
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_year</xsl:text>
+ <xsl:text>&year=</xsl:text>
+ <xsl:value-of select="current_year + 1"/>
+ <xsl:text>&location_code=</xsl:text>
+ <xsl:value-of select="current_location/location_code"/>
+ </xsl:attribute>
+ <xsl:value-of select="current_year + 1"/>
+ <img height="17"
src="controller/images/right_arrow_simple_light_blue.png" />
+ </a>
+</div>
+
+</xsl:template>
Modified:
branches/Version-1_0-branch/controller/templates/base/calendar/select_buildings_on_property.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/calendar/select_buildings_on_property.xsl
2012-06-28 11:53:08 UTC (rev 9700)
+++
branches/Version-1_0-branch/controller/templates/base/calendar/select_buildings_on_property.xsl
2012-06-28 11:56:58 UTC (rev 9701)
@@ -1,6 +1,5 @@
<!-- $Id: view_calendar_month.xsl 9200 2012-04-21 20:05:34Z vator $ -->
<xsl:template name="select_buildings_on_property"
xmlns:php="http://php.net/xsl">
-<xsl:variable name="loc_code"><xsl:value-of
select="current_location/location_code"/></xsl:variable>
<form action="#">
<input type="hidden" name="period_type" value="view_year" />
@@ -10,16 +9,16 @@
</xsl:attribute>
</input>
-
<select id="choose_building_on_property" class="selectLocation">
+ <option>Velg bygg</option>
<xsl:for-each select="buildings_on_property">
- <option>
- <xsl:if test="id = $loc_code">
- <xsl:attribute
name="selected">"selected"</xsl:attribute>
- </xsl:if>
- <xsl:attribute
name="value"><xsl:value-of select="id"/></xsl:attribute>
- <xsl:value-of select="name" />
- </option>
+ <option>
+ <xsl:if test="id =
//current_location/location_code">
+ <xsl:attribute
name="selected">selected</xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="value"><xsl:value-of
select="id"/></xsl:attribute>
+ <xsl:value-of select="name" />
+ </option>
</xsl:for-each>
</select>
</form>
Modified:
branches/Version-1_0-branch/controller/templates/base/calendar/select_my_locations.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/calendar/select_my_locations.xsl
2012-06-28 11:53:08 UTC (rev 9700)
+++
branches/Version-1_0-branch/controller/templates/base/calendar/select_my_locations.xsl
2012-06-28 11:56:58 UTC (rev 9701)
@@ -1,6 +1,5 @@
<!-- $Id: view_calendar_month.xsl 9200 2012-04-21 20:05:34Z vator $ -->
<xsl:template name="select_my_locations" xmlns:php="http://php.net/xsl">
-<xsl:variable name="loc_code"><xsl:value-of
select="../current_location/location_code"/></xsl:variable>
<form action="#">
<input type="hidden" name="period_type" value="view_year" />
@@ -11,9 +10,10 @@
</input>
<select id="choose_my_location" class="selectLocation">
+ <option>Velg bygg</option>
<xsl:for-each select="my_locations">
<option>
- <xsl:if test="location_code = loc_code">
+ <xsl:if test="location_code =
current_location/location_code">
<xsl:attribute
name="selected">selected</xsl:attribute>
</xsl:if>
<xsl:attribute name="value"><xsl:value-of
disable-output-escaping="yes" select="location_code"/></xsl:attribute>
Modified:
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_month.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_month.xsl
2012-06-28 11:53:08 UTC (rev 9700)
+++
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_month.xsl
2012-06-28 11:56:58 UTC (rev 9701)
@@ -73,7 +73,7 @@
</xsl:choose>
<xsl:variable name="month_str">month <xsl:value-of
select="current_month_nr"/> capitalized</xsl:variable>
- <h3>Kalenderoversikt for <xsl:value-of
select="php:function('lang', $month_str)" /><span class="year"><xsl:value-of
select="current_year"/></span></h3>
+ <h3>Kalenderoversikt for <span
class="month"><xsl:value-of select="php:function('lang', $month_str)"
/></span><span class="year"><xsl:value-of select="current_year"/></span></h3>
<!-- ===================== SEARCH FOR LOCATION
================= -->
<div id="search-location" class="select-box">
@@ -98,10 +98,43 @@
<input type="text" value=""
id="search-location-name" />
</div>
- <!-- ===================== SELECT LIST FOR MY
LOCATIONS ================= -->
+ <!-- ===================== SELECT LIST FOR MY ASSIGNED
LOCATIONS ================= -->
<div id="choose-my-location" class="select-box">
<label>Velg et annet bygg du har ansvar
for</label>
- <xsl:call-template name="select_my_locations" />
+
+ <form action="#">
+ <input type="hidden" name="period_type"
value="view_month" />
+ <input type="hidden" name="year">
+ <xsl:attribute name="value">
+ <xsl:value-of select="current_year"/>
+ </xsl:attribute>
+ </input>
+ <input type="hidden" name="month">
+ <xsl:attribute name="value">
+ <xsl:value-of
select="current_month_nr"/>
+ </xsl:attribute>
+ </input>
+
+ <select id="choose_my_location"
class="selectLocation">
+ <option>Velg bygg</option>
+ <xsl:for-each
select="my_locations">
+ <xsl:choose>
+
<xsl:when test="location_code = //current_location/location_code">
+
<option selected="SELECTED">
+
<xsl:attribute name="value"><xsl:value-of disable-output-escaping="yes"
select="location_code"/></xsl:attribute>
+
<xsl:value-of disable-output-escaping="yes" select="loc1_name"/>
+
</option>
+
</xsl:when>
+
<xsl:otherwise>
+
<option>
+
<xsl:attribute name="value"><xsl:value-of disable-output-escaping="yes"
select="location_code"/></xsl:attribute>
+
<xsl:value-of disable-output-escaping="yes" select="loc1_name"/>
+
</option>
+
</xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </select>
+ </form>
</div>
</div>
<div class="middle">
@@ -117,57 +150,7 @@
</xsl:attribute>
<img height="20"
src="controller/images/left_arrow_simple_light_blue.png" />Årsoversikt
</a>
-
- <!-- ===================== COLOR ICON MAP =================
-->
- <xsl:call-template name="icon_color_map" />
- <!-- ===================== FILTERS ================= -->
- <form id="filters" class="select-box"
action="index.php?menuaction=controller.uicalendar.view_calendar_for_year"
method="post">
- <input type="hidden" name="year">
- <xsl:attribute name="value">
- <xsl:value-of select="current_year"/>
- </xsl:attribute>
- </input>
- <input type="hidden" name="location_code">
- <xsl:attribute name="value">
- <xsl:value-of
select="current_location/location_code"/>
- </xsl:attribute>
- </input>
- <input type="hidden" name="repeat_type">
- <xsl:attribute name="value">
- <xsl:value-of
select="current_repeat_type"/>
- </xsl:attribute>
- </input>
- <input type="hidden" name="role">
- <xsl:attribute name="value">
- <xsl:value-of
select="current_role"/>
- </xsl:attribute>
- </input>
-
- <div class="filter first">
- <label>Filtrer på rolle</label>
- <select id="filter-role">
- <xsl:for-each
select="roles_array">
- <xsl:variable
name="role_id"><xsl:value-of select="id"/></xsl:variable>
- <option
value="{$role_id}">
- <xsl:value-of
disable-output-escaping="yes" select="name"/>
- </option>
- </xsl:for-each>
- </select>
- </div>
- <div class="filter">
- <label>Filtrer på frekvenstype</label>
- <select class="required"
id="filter-repeat_type" name="repeat_type">
- <option value=""
selected="selected" >Velg frekvenstype</option>
- <xsl:for-each
select="repeat_type_array">
- <option value="{id}">
- <xsl:value-of
disable-output-escaping="yes" select="value"/>
- </option>
- </xsl:for-each>
- </select>
- </div>
- </form>
-
<!-- ===================== CHOOSE ANOTHER BUILDING ON PROPERTY
================= -->
<div id="choose-building" class="select-box">
<xsl:if test="location_level > 1">
@@ -187,80 +170,16 @@
<xsl:call-template
name="select_buildings_on_property" />
</div>
- <!-- ===================== CALENDAR NAVIGATION
================= -->
- <div id="calNav">
- <xsl:choose>
- <xsl:when test="current_month_nr > 1">
- <a class="showPrev month">
- <xsl:attribute
name="href">
-
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
-
<xsl:text>&year=</xsl:text>
- <xsl:value-of
select="current_year"/>
-
<xsl:text>&month=</xsl:text>
- <xsl:value-of
select="current_month_nr - 1"/>
-
<xsl:text>&location_code=</xsl:text>
- <xsl:value-of
select="//current_location/location_code"/>
- </xsl:attribute>
- <img height="17"
src="controller/images/left_arrow_simple_light_blue.png" />
- <xsl:variable
name="month_str">month <xsl:value-of select="current_month_nr - 1"/>
capitalized</xsl:variable>
- <xsl:value-of
select="php:function('lang', $month_str)" />
- </a>
- </xsl:when>
- <xsl:otherwise>
- <a class="showPrev month">
- <xsl:attribute
name="href">
-
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
-
<xsl:text>&year=</xsl:text>
- <xsl:value-of
select="current_year - 1"/>
-
<xsl:text>&month=12</xsl:text>
-
<xsl:text>&location_code=</xsl:text>
- <xsl:value-of
select="//current_location/location_code"/>
- </xsl:attribute>
- <img height="17"
src="controller/images/left_arrow_simple_light_blue.png" />
- <xsl:variable
name="month_str">month 12 capitalized</xsl:variable>
- <xsl:value-of
select="php:function('lang', $month_str)" />
- </a>
- </xsl:otherwise>
- </xsl:choose>
+ <!-- ===================== COLOR ICON MAP
================= -->
+ <xsl:call-template name="icon_color_map" />
+
+ <!-- ===================== FILTERS =================
-->
+ <xsl:call-template name="calendar_filters" >
+ <xsl:with-param
name="view_period">month</xsl:with-param>
+ </xsl:call-template>
- <span class="current">
- <xsl:variable name="month_str">month
<xsl:value-of select="current_month_nr"/> capitalized</xsl:variable>
- <xsl:value-of
select="php:function('lang', $month_str)" />
- </span>
- <xsl:choose>
- <xsl:when test="12 > current_month_nr">
- <a class="showNext">
- <xsl:attribute
name="href">
-
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
-
<xsl:text>&year=</xsl:text>
- <xsl:value-of
select="current_year"/>
-
<xsl:text>&month=</xsl:text>
- <xsl:value-of
select="current_month_nr + 1"/>
-
<xsl:text>&location_code=</xsl:text>
- <xsl:value-of
select="//current_location/location_code"/>
- </xsl:attribute>
- <xsl:variable
name="month_str">month <xsl:value-of select="current_month_nr + 1"/>
capitalized</xsl:variable>
- <xsl:value-of
select="php:function('lang', $month_str)" />
- <img height="17"
src="controller/images/right_arrow_simple_light_blue.png" />
- </a>
- </xsl:when>
- <xsl:otherwise>
- <a class="showNext">
- <xsl:attribute
name="href">
-
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
-
<xsl:text>&year=</xsl:text>
- <xsl:value-of
select="current_year + 1"/>
-
<xsl:text>&month=1</xsl:text>
-
<xsl:text>&location_code=</xsl:text>
- <xsl:value-of
select="//current_location/location_code"/>
- </xsl:attribute>
- <xsl:variable
name="month_str">month 1 capitalized</xsl:variable>
- <xsl:value-of
select="php:function('lang', $month_str)" />
- <img height="17"
src="controller/images/right_arrow_simple_light_blue.png" />
- </a>
- </xsl:otherwise>
- </xsl:choose>
- </div>
+ <!-- ===================== CALENDAR NAVIGATION
================= -->
+ <xsl:call-template name="nav_calendar_month" />
</div>
<div id="cal_wrp">
Modified:
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_year.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_year.xsl
2012-06-28 11:53:08 UTC (rev 9700)
+++
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_year.xsl
2012-06-28 11:56:58 UTC (rev 9701)
@@ -125,84 +125,16 @@
<xsl:call-template name="icon_color_map" />
<!-- ===================== FILTERS =================
-->
- <form id="filters" class="select-box"
action="index.php?menuaction=controller.uicalendar.view_calendar_for_year"
method="post">
- <input type="hidden" name="year">
- <xsl:attribute name="value">
- <xsl:value-of select="current_year"/>
- </xsl:attribute>
- </input>
- <input type="hidden" name="location_code">
- <xsl:attribute name="value">
- <xsl:value-of
select="current_location/location_code"/>
- </xsl:attribute>
- </input>
- <input type="hidden" name="repeat_type">
- <xsl:attribute name="value">
- <xsl:value-of
select="current_repeat_type"/>
- </xsl:attribute>
- </input>
- <input type="hidden" name="role">
- <xsl:attribute name="value">
- <xsl:value-of
select="current_role"/>
- </xsl:attribute>
- </input>
-
- <div class="filter first">
- <label>Filtrer på rolle</label>
- <select id="filter-role">
- <xsl:for-each
select="roles_array">
- <xsl:variable
name="role_id"><xsl:value-of select="id"/></xsl:variable>
- <option
value="{$role_id}">
- <xsl:value-of
disable-output-escaping="yes" select="name"/>
- </option>
- </xsl:for-each>
- </select>
- </div>
- <div class="filter">
- <label>Filtrer på frekvenstype</label>
- <select class="required"
id="filter-repeat_type" name="repeat_type">
- <option value=""
selected="selected" >Velg frekvenstype</option>
- <xsl:for-each
select="repeat_type_array">
- <option value="{id}">
- <xsl:value-of
disable-output-escaping="yes" select="value"/>
- </option>
- </xsl:for-each>
- </select>
- </div>
- </form>
+ <xsl:call-template name="calendar_filters" >
+ <xsl:with-param
name="view_period">year</xsl:with-param>
+ </xsl:call-template>
<!-- ===================== CALENDAR NAVIGATION
================= -->
- <div id="calNav">
- <a class="showPrev">
- <xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_year</xsl:text>
- <xsl:text>&year=</xsl:text>
- <xsl:value-of
select="current_year - 1"/>
-
<xsl:text>&location_code=</xsl:text>
- <xsl:value-of
select="current_location/location_code"/>
- </xsl:attribute>
- <img height="17"
src="controller/images/left_arrow_simple_light_blue.png" />
- <xsl:value-of select="current_year -
1"/>
- </a>
- <span class="current">
- <xsl:value-of
select="current_year"/>
- </span>
- <a class="showNext">
- <xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_year</xsl:text>
- <xsl:text>&year=</xsl:text>
- <xsl:value-of
select="current_year + 1"/>
-
<xsl:text>&location_code=</xsl:text>
- <xsl:value-of
select="current_location/location_code"/>
- </xsl:attribute>
- <xsl:value-of select="current_year +
1"/>
- <img height="17"
src="controller/images/right_arrow_simple_light_blue.png" />
- </a>
- </div>
-
+ <xsl:call-template name="nav_calendar_year" />
</div>
<div id="cal_wrp">
+ <h2>Bygg/eiendom</h2>
<table id="calendar" class="year">
<tr class="heading">
<th
class="title"><span>Tittel</span></th>
@@ -283,14 +215,19 @@
</xsl:choose>
</table>
- <h2>Komponenter</h2>
-
+ <h2 class="components">Komponenter</h2>
+ <xsl:choose>
+ <xsl:when
test="components_calendar_array/child::node()">
+ <xsl:for-each select="components_calendar_array">
+
+ <h3><xsl:value-of
select="component/xml_short_desc"/></h3>
+
<table id="calendar" class="year">
<tr class="heading">
<th
class="title"><span>Tittel</span></th>
<th
class="assigned"><span>Tildelt</span></th>
<th
class="frequency"><span>Frekvens</span></th>
- <xsl:for-each select="heading_array">
+ <xsl:for-each select="//heading_array">
<th>
<a>
<xsl:attribute
name="href">
@@ -298,7 +235,7 @@
<xsl:text>&year=</xsl:text>
<xsl:value-of select="//current_year"/>
<xsl:text>&location_code=</xsl:text>
-
<xsl:value-of select="current_location/location_code"/>
+
<xsl:value-of select="//current_location/location_code"/>
<xsl:text>&month=</xsl:text>
<xsl:number/>
</xsl:attribute>
@@ -309,14 +246,6 @@
</th>
</xsl:for-each>
</tr>
-
-
- <xsl:for-each select="components_calendar_array">
- <tr>
- <td>
- <h3><xsl:value-of select="component/xml"/></h3>
- </td>
- </tr>
<xsl:for-each select="controls_calendar">
<xsl:variable
name="control_id"><xsl:value-of select="control/id"/></xsl:variable>
@@ -362,12 +291,14 @@
</xsl:call-template>
</xsl:for-each>
</tr>
- </xsl:for-each>
-
+ </xsl:for-each>
+ </table>
</xsl:for-each>
-
-
- </table>
+ </xsl:when>
+ <xsl:otherwise>
+ <p class="no-comp-msg">Ingen komponenter
tilknyttet kontroll</p>
+ </xsl:otherwise>
+ </xsl:choose>
</div>
</div>
</div>
Modified:
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_year_for_locations.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_year_for_locations.xsl
2012-06-28 11:53:08 UTC (rev 9700)
+++
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_year_for_locations.xsl
2012-06-28 11:56:58 UTC (rev 9701)
@@ -9,9 +9,6 @@
<h1>Kontrollplan for <xsl:value-of
select="control/title"/></h1>
<h3>Periode: <xsl:value-of select="current_year"/></h3>
- <!-- ===================== SELECT MY LOCATIONS
================= -->
- <xsl:call-template name="select_my_locations" />
-
</div>
<div class="middle">
@@ -20,12 +17,13 @@
</div>
<div id="cal_wrp">
+ <h2>Bygg/Eiendom</h2>
<table id="calendar" class="year">
<tr>
- <th>
+ <th class="title">
<span
class="location_code">Lokasjonskode</span>
</th>
- <th>
+ <th class="title">
<span
class="location_name">Lokasjonsnavn</span>
</th>
<xsl:for-each select="heading_array">
@@ -62,7 +60,7 @@
</xsl:otherwise>
</xsl:choose>
- <td>
+ <td class="title">
<xsl:value-of
select="location/location_code"/>
</td>
<td class="location_name">
@@ -86,11 +84,11 @@
<div id="cal_wrp">
<table id="calendar" class="year">
<tr>
- <th>
- <span
class="location_code">Lokasjon</span>
+ <th class="location_name">
+ <span>Lokasjon</span>
</th>
- <th>
- <span
class="location_name">Komponenttype</span>
+ <th class="component_type">
+ <span>Komponenttype</span>
</th>
<xsl:for-each select="heading_array">
<th>
@@ -111,6 +109,8 @@
</th>
</xsl:for-each>
</tr>
+
+ <h2 class="components">Komponenter</h2>
<xsl:choose>
<xsl:when
test="components_with_calendar_array/child::node()">
@@ -126,7 +126,7 @@
</xsl:otherwise>
</xsl:choose>
- <td>
+ <td class="title">
<xsl:value-of
select="component/component_location"/>
</td>
<td class="location_name">
Modified:
branches/Version-1_0-branch/controller/templates/base/check_list/view_open_cases.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/check_list/view_open_cases.xsl
2012-06-28 11:53:08 UTC (rev 9700)
+++
branches/Version-1_0-branch/controller/templates/base/check_list/view_open_cases.xsl
2012-06-28 11:56:58 UTC (rev 9701)
@@ -411,7 +411,7 @@
</ul>
</xsl:when>
<xsl:otherwise>
- <p>Ingen åpne målinger</p>
+ <p>Ingen åpne saker eller målinger</p>
</xsl:otherwise>
</xsl:choose>
</div>
Modified:
branches/Version-1_0-branch/controller/templates/base/control_item/control_item.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/control_item/control_item.xsl
2012-06-28 11:53:08 UTC (rev 9700)
+++
branches/Version-1_0-branch/controller/templates/base/control_item/control_item.xsl
2012-06-28 11:56:58 UTC (rev 9701)
@@ -1,4 +1,4 @@
-<!-- $Id$ -->
+ <!-- $Id$ -->
<!-- item -->
<xsl:template match="data" xmlns:php="http://php.net/xsl">
@@ -15,19 +15,10 @@
<h1><xsl:value-of select="php:function('lang', 'View control
item')" /></h1>
</xsl:otherwise>
</xsl:choose>
-
-<ul class="check_list">
- <xsl:for-each select="check_list_array">
- <li>
- <span>Tittel:</span><xsl:value-of
select="title"/><span>Start dato:</span><xsl:value-of select="start_date"/>
- </li>
- </xsl:for-each>
-</ul>
<div id="control_item_details">
- <form action="#" method="post">
- <input type="hidden" name="id"
value="{control_item/id}">
- </input>
+ <form
action="index.php?menuaction=controller.uicontrol_item.save" method="post">
+ <input type="hidden" name="id"
value="{control_item/id}" />
<dl class="proplist">
<dt>
<label for="title">Tittel</label>
@@ -41,7 +32,7 @@
</xsl:choose>
</dt>
<dt>
- <label for="required">Skal det være
obligatorisk å sjekke kontrollpunktet</label>
+ <label for="required" class="line">Skal
det være obligatorisk å sjekke kontrollpunktet</label>
<xsl:variable
name="required_item"><xsl:value-of select="control_item/required"
/></xsl:variable>
<xsl:choose>
<xsl:when test="editable">
@@ -71,51 +62,140 @@
<div class="styleWrp">
<xsl:variable
name="control_item_type"><xsl:value-of select="control_item/type"
/></xsl:variable>
<xsl:choose>
+ <xsl:when test="view">
+ <xsl:variable
name="lang_type"><xsl:value-of select="control_item/type" /></xsl:variable>
+ <xsl:value-of
select="php:function('lang', $lang_type)" />
+
+ <xsl:if
test="control_item/options_array/child::node()">
+ <h4
class="option-list-heading">Verdier i liste</h4>
+ <ul
class="option-list">
+
<xsl:for-each select="control_item/options_array">
+
<li><xsl:value-of select="option_value" /></li>
+
</xsl:for-each>
+ </ul>
+ </xsl:if>
+ </xsl:when>
<xsl:when
test="editable">
<!--
============== RADIOBUTTONS FOR CHOOSING CONTROL ITEM TYPE ============== -->
- <xsl:for-each
select="control_item/control_item_types">
-
-
<xsl:variable name="classes">
+ <xsl:choose>
+ <xsl:when
test="control_item/type = ''">
+
<xsl:for-each select="control_item/control_item_types">
+
<xsl:variable name="classes">
+
<xsl:choose>
+
<xsl:when test="position() = 1">
+
btn active
+
</xsl:when>
+
<xsl:otherwise>
+
btn
+
</xsl:otherwise>
+
</xsl:choose>
+
</xsl:variable>
+
+
<div class="control_item_type">
+
<xsl:variable name="lang_type"><xsl:value-of select="."
/></xsl:variable>
+
<xsl:variable name="current_control_item_type"><xsl:value-of select="."
/></xsl:variable>
+
+
<input class="{$classes}" type="button" value="Velg" />
+
<input type="radio" name="control_item_type"
value="{$current_control_item_type}" />
+
<xsl:value-of select="php:function('lang', $lang_type)" />
+
</div>
+
</xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+
<xsl:for-each select="control_item/control_item_types">
+
<xsl:variable name="current_type"><xsl:value-of select="."
/></xsl:variable>
+
+
<xsl:choose>
+
<xsl:when test="//control_item/type = $current_type">
+
<div class="control_item_type">
+
<xsl:variable
name="lang_type"><xsl:value-of select="." /></xsl:variable>
+
<xsl:variable
name="current_control_item_type"><xsl:value-of select="." /></xsl:variable>
+
+
<input class="btn active" type="button"
value="Velg" />
+
<input type="radio"
name="control_item_type" value="{$current_control_item_type}"
checked="checked"/>
+
<xsl:value-of
select="php:function('lang', $lang_type)" />
+
</div>
+
</xsl:when>
+
<xsl:otherwise>
+
<div class="control_item_type">
+
<xsl:variable
name="lang_type"><xsl:value-of select="." /></xsl:variable>
+
<xsl:variable
name="current_control_item_type"><xsl:value-of select="." /></xsl:variable>
+
+
<input class="btn" type="button"
value="Velg" />
+
<input type="radio"
name="control_item_type" value="{$current_control_item_type}" />
+
<xsl:value-of
select="php:function('lang', $lang_type)" />
+
</div>
+
</xsl:otherwise>
+
</xsl:choose>
+
+
</xsl:for-each>
+ </xsl:otherwise>
+ </xsl:choose>
+
+
+ <!--
============== FORM FOR SAVING OPTION VALUES FOR LIST ============= -->
+ <xsl:choose>
+ <xsl:when
test="control_item/options_array/child::node()">
+ <div
id="add_control_item_option_panel" style="display:block;">
+
<hr />
+
<xsl:choose>
-
<xsl:when test="position() = 1">
-
btn active
+
<xsl:when test="//control_item/type = 'control_item_type_3'">
+
<h2 class="type">Nedtrekksliste</h2>
</xsl:when>
<xsl:otherwise>
-
btn
+
<h2 class="type">Radioknapper</h2>
</xsl:otherwise>
</xsl:choose>
-
</xsl:variable>
-
- <div
class="control_item_type">
-
<xsl:variable name="lang_type"><xsl:value-of select="." /></xsl:variable>
-
<xsl:variable name="current_control_item_type"><xsl:value-of select="."
/></xsl:variable>
-
<input class="{$classes}" type="button" value="Velg" />
-
<input type="radio" name="control_item_type"
value="{$current_control_item_type}" />
-
<xsl:value-of select="php:function('lang', $lang_type)" />
+
<h3>Legg til verdier som listen skal inneholde</h3>
+
+
<input type="hidden" name="control_item_id">
+
<xsl:attribute name="value"><xsl:value-of
select="control_item/id"/></xsl:attribute>
+
</input>
+
+
<ul id="control_item_options">
+
+
<xsl:for-each select="control_item/options_array">
+
<li>
+
<label>Listeverdi<span class="order_nr"><xsl:number
/></span></label>
+
<xsl:variable name="option_value"><xsl:value-of
select="option_value" /></xsl:variable>
+
<input type="text" name="option_values[]"
value="{$option_value}" />
+
<span class="btn delete">Slett</span>
+
</li>
+
</xsl:for-each>
+
</ul>
+
+
<div id="add_control_item_list_value" class="row">
+
<label>Ny listeverdi</label>
+
<input type="text" name="option_value" />
+
<input class="btn" type="button" value="Legg til" />
+
</div>
</div>
- </xsl:for-each>
-
- <!--
============== FORM FOR SAVING OPTION VALUES FOR LIST ============= -->
- <div
id="add_control_item_option_panel">
- <hr />
-
- <h2
class="type"></h2>
-
<h3>Legg til verdier som listen skal inneholde</h3>
-
- <input
type="hidden" name="control_item_id">
-
<xsl:attribute name="value"><xsl:value-of
select="control_item/id"/></xsl:attribute>
- </input>
+ </xsl:when>
+ <xsl:otherwise>
+ <div
id="add_control_item_option_panel">
+
<hr />
- <ul
id="control_item_options"></ul>
+
<h2 class="type"></h2>
+
<h3>Legg til verdier som listen skal inneholde</h3>
+
+
<input type="hidden" name="control_item_id">
+
<xsl:attribute name="value"><xsl:value-of
select="control_item/id"/></xsl:attribute>
+
</input>
+
+
<ul id="control_item_options"></ul>
+
+
<div id="add_control_item_list_value" class="row">
+
<label>Ny listeverdi</label>
+
<input type="text" name="option_value" />
+
<input class="btn" type="button" value="Legg til" />
+
</div>
+ </div>
+ </xsl:otherwise>
+ </xsl:choose>
- <div
id="add_control_item_list_value" class="row">
-
<label>Ny listeverdi</label>
-
<input type="text" name="option_value" />
-
<input class="btn" type="button" value="Legg til" />
- </div>
- </div>
</xsl:when>
<xsl:otherwise>
<xsl:variable
name="lang_type"><xsl:value-of select="control_item/type" /></xsl:variable>
@@ -188,33 +268,28 @@
</dt>
<dt>
<label for="what_to_do">Hva skal
utføres</label>
+ <xsl:choose>
+ <xsl:when test="editable">
+ <textarea
name="what_to_do" id="what_to_do" rows="5" cols="60">
+ <xsl:value-of
select="control_item/what_to_do" disable-output-escaping="yes" />
+ </textarea>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
select="control_item/what_to_do" disable-output-escaping="yes" />
+ </xsl:otherwise>
+ </xsl:choose>
</dt>
- <dd>
- <xsl:choose>
- <xsl:when test="editable">
- <textarea name="what_to_do"
id="what_to_do" rows="5" cols="60">
- <xsl:value-of
select="control_item/what_to_do" disable-output-escaping="yes" />
- </textarea>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of
select="control_item/what_to_do" disable-output-escaping="yes" />
- </xsl:otherwise>
- </xsl:choose>
- </dd>
<dt>
<label
for="how_to_do">Utførelsesbeskrivelse</label>
+ <xsl:choose>
+ <xsl:when test="editable">
+ <textarea
name="how_to_do" id="how_to_do" rows="5" cols="60"><xsl:value-of
select="control_item/how_to_do" disable-output-escaping="yes" /></textarea>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
select="control_item/how_to_do" disable-output-escaping="yes" />
+ </xsl:otherwise>
+ </xsl:choose>
</dt>
- <dd>
- <xsl:choose>
- <xsl:when test="editable">
- <textarea name="how_to_do"
id="how_to_do" rows="5" cols="60"><xsl:value-of select="control_item/how_to_do"
disable-output-escaping="yes" /></textarea>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of
select="control_item/how_to_do" disable-output-escaping="yes" />
- </xsl:otherwise>
- </xsl:choose>
- </dd>
-
</dl>
<div class="form-buttons">
@@ -226,8 +301,14 @@
<input type="submit"
name="cancel_control_item" value="{$lang_cancel}" title = "{$lang_cancel}" />
</xsl:when>
<xsl:otherwise>
- <xsl:variable
name="lang_edit"><xsl:value-of select="php:function('lang', 'edit')"
/></xsl:variable>
- <input type="submit"
name="edit_control_item" value="{$lang_edit}" title = "{$lang_edit}" />
+ <a class="btn">
+ <xsl:attribute
name="href">
+
<xsl:text>index.php?menuaction=controller.uicontrol_item.edit</xsl:text>
+
<xsl:text>&id=</xsl:text>
+ <xsl:value-of
select="control_item/id"/>
+ </xsl:attribute>
+ <xsl:value-of
select="php:function('lang', 'edit')" />
+ </a>
</xsl:otherwise>
</xsl:choose>
</div>
Modified:
branches/Version-1_0-branch/controller/templates/base/control_location/control_location_tabs.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/control_location/control_location_tabs.xsl
2012-06-28 11:53:08 UTC (rev 9700)
+++
branches/Version-1_0-branch/controller/templates/base/control_location/control_location_tabs.xsl
2012-06-28 11:56:58 UTC (rev 9701)
@@ -3,44 +3,6 @@
<xsl:template match="data" xmlns:php="http://php.net/xsl">
<div class="yui-navset yui-navset-top" id="control_location_tabview">
-
-<div id="choose_control" class="select-box">
-
- <!-- When control area is chosen, an ajax
request is executed.
- The operation fetches controls from db
and populates the control list.
- The ajax operation is handled in
ajax.js
- -->
- <label>Velg kontrollen du vil vise bygg
for</label>
- <select id="control_area_list"
name="control_area_list">
- <option value="">Velg
kontrollområde</option>
- <xsl:for-each
select="control_areas_array">
- <option value="{id}">
- <xsl:value-of
disable-output-escaping="yes" select="name"/>
- </option>
- </xsl:for-each>
- </select>
-
- <form id="loc_form" action="" method="GET">
- <select id="control_id"
name="control_id">
- <xsl:choose>
- <xsl:when
test="control_array/child::node()">
- <xsl:for-each
select="control_array">
-
<xsl:variable name="control_id"><xsl:value-of select="id"/></xsl:variable>
- <option
value="{$control_id}">
-
<xsl:value-of select="title"/>
-
</option>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <option>
- Ingen
kontroller
- </option>
- </xsl:otherwise>
- </xsl:choose>
- </select>
- </form>
- </div>
-
<xsl:choose>
<xsl:when test="view = 'view_locations_for_control'">
<div class="identifier-header">
Modified:
branches/Version-1_0-branch/controller/templates/base/control_location/register_control_to_component.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/control_location/register_control_to_component.xsl
2012-06-28 11:53:08 UTC (rev 9700)
+++
branches/Version-1_0-branch/controller/templates/base/control_location/register_control_to_component.xsl
2012-06-28 11:56:58 UTC (rev 9701)
@@ -21,19 +21,7 @@
<xsl:template match="data" xmlns:php="http://php.net/xsl">
<xsl:call-template name="yui_phpgw_i18n"/>
- <style type="text/css">
- select { width: 100px; }
- </style>
- <div id="choose_control" class="select-box">
- <label>Velg kontrollen du vil vise komponent for</label>
- <select id="control_area_id" name="control_area_id">
- <xsl:apply-templates
select="control_area_list/options"/>
- </select>
- <select id="control_id" name="control_id">
- <xsl:apply-templates select="control/options"/>
- </select>
- </div>
-
+
<div class="yui-navset yui-navset-top" id="control_location_tabview">
<div class="identifier-header">
<h1><xsl:value-of select="php:function('lang', 'components for
control')"/></h1>
@@ -44,13 +32,6 @@
</xsl:template>
<xsl:template name="register_control_to_component"
xmlns:php="http://php.net/xsl">
- <!-- loads translations into array for use with javascripts -->
- <!--
- <script type="text/javascript">
- var lang = <xsl:value-of select="php:function('js_lang',
'edit')"/>;
- </script>
- -->
-
<div class="yui-content">
<div id="invoice-layout">
<div class="header">
@@ -62,18 +43,25 @@
</xsl:when>
</xsl:choose>
<div class="body">
- <div id="voucher_details">
- <table align = "center"
width="95%">
+
+ <style type="text/css">
+
+ </style>
+ <div id="choose_control">
+ <h4>Velg kontrollen du vil vise
komponent for</h4>
+ <select id="control_area_id"
name="control_area_id">
+ <xsl:apply-templates
select="control_area_list/options"/>
+ </select>
+ <select id="control_id"
name="control_id">
+ <xsl:apply-templates
select="control/options"/>
+ </select>
+ </div>
+
+ <div id="choose-location">
<xsl:apply-templates
select="filter_form" />
- </table>
+
<form action="{update_action}"
name="acl_form" id="acl_form" method="post">
- <table align = "center"
width="95%">
- <tr>
- <td
colspan = '6'>
-
<xsl:apply-templates select="datatable"/>
- </td>
- </tr>
- </table>
+
<xsl:apply-templates select="datatable"/>
</form>
</div>
</div>
@@ -86,130 +74,97 @@
</xsl:template>
<xsl:template name="filter_list" xmlns:php="http://php.net/xsl">
- <tr>
- <td colspan = '6'>
- <table>
- <tr>
- <tr>
- <td>
- <xsl:value-of select="php:function('lang', 'entity')" />
- </td>
- <td>
- <xsl:value-of select="php:function('lang', 'category')"
/>
- </td>
- <td>
- <xsl:value-of select="php:function('lang', 'district')"
/>
- </td>
- <td>
- <xsl:value-of select="php:function('lang', 'part of
town')" />
- </td>
- <td>
- <xsl:value-of select="php:function('lang', 'property')"
/>
- </td>
- <td>
- <xsl:value-of select="php:function('lang', 'building')"
/>
- </td>
-<!--
- <td >
- <xsl:value-of select="php:function('lang', 'search')" />
- </td>
--->
- </tr>
- <tr id="filter2">
- <td>
- <select id="entity_id" name="entity_id">
- <xsl:apply-templates select="entity_list/options"/>
- </select>
- </td>
- <td>
- <select id="cat_id" name="cat_id">
- <xsl:apply-templates select="category_list/options"/>
- </select>
- </td>
- <td>
- <select id="district_id" name="district_id">
- <xsl:apply-templates select="district_list/options"/>
- </select>
- </td>
- <td>
- <select id="part_of_town_id" name="part_of_town_id">
- <xsl:apply-templates
select="part_of_town_list/options"/>
- </select>
- </td>
- <td>
- <select id="loc1" name="loc1">
- <xsl:apply-templates select="loc1_list/options"/>
- </select>
- </td>
- <td>
- <select id="loc2" name="loc2">
- <xsl:apply-templates select="loc2_list/options"/>
- </select>
- </td>
-<!--
- <td>
- <xsl:variable name="lang_search"><xsl:value-of
select="php:function('lang', 'Search')" /></xsl:variable>
- <input type="button" id = "search" name="search"
value="{$lang_search}" title = "{$lang_search}" />
- </td>
--->
- </tr>
-
- <td>
- <xsl:value-of select="php:function('lang',
'registered')" />
- </td>
- <td>
- <xsl:value-of select="php:function('lang', 'location
type')" />
- </td>
- <td>
- <xsl:value-of select="php:function('lang', 'location
category')" />
- </td>
- <td>
- <xsl:value-of select="php:function('lang', 'name')" />
- </td>
- </tr>
- <tr id="filter1">
- <td >
- <input id= "control_registered" type="checkbox"
name="control_registered" value="1"/>
- </td>
-
- <td >
- <input id= "control_id_hidden" type="hidden"
name="control_id"/>
- <select id="location_type" name="location_type">
- <xsl:apply-templates
select="location_type_list/options"/>
- </select>
- </td>
- <td >
- <select id="location_type_category"
name="location_type_category">
- </select>
- </td>
- <td colspan = '2'>
+ <h4>Velg komponenter som du vil knytte til kontrollen</h4>
+ <fieldset id="comp-filters">
+ <input id= "control_id_hidden" type="hidden" name="control_id"/>
+
+ <div class="select-box">
+ <label><xsl:value-of select="php:function('lang',
'registered')" /></label>
+ <input id= "control_registered" type="checkbox"
name="control_registered" value="1"/>
+ </div>
+
+ <div class="select-box">
+ <div class="filter">
+ <label><xsl:value-of
select="php:function('lang', 'entity')" /></label>
+ <select id="entity_id" name="entity_id">
+ <xsl:apply-templates
select="entity_list/options"/>
+ </select>
+ </div>
+ <div class="filter">
+ <label><xsl:value-of select="php:function('lang',
'category')" /></label>
+ <select id="cat_id" name="cat_id">
+ <xsl:apply-templates
select="category_list/options"/>
+ </select>
+ </div>
+ </div>
+
+ <div class="select-box">
+ <div class="filter">
+ <label><xsl:value-of select="php:function('lang',
'district')" /></label>
+ <select id="district_id" name="district_id">
+ <xsl:apply-templates
select="district_list/options"/>
+ </select>
+ </div>
+ <div class="filter">
+ <label><xsl:value-of
select="php:function('lang', 'part of town')" /></label>
+ <select id="part_of_town_id"
name="part_of_town_id">
+ <xsl:apply-templates
select="part_of_town_list/options"/>
+ </select>
+ </div>
+ </div>
+
+ <div class="select-box">
+ <div class="filter">
+ <label><xsl:value-of
select="php:function('lang', 'property')" /></label>
+ <select id="loc1" name="loc1">
+ <xsl:apply-templates
select="loc1_list/options"/>
+ </select>
+ </div>
+ <div class="filter">
+ <label><xsl:value-of select="php:function('lang',
'building')" /></label>
+ <select id="loc2" name="loc2">
+ <xsl:apply-templates
select="loc2_list/options"/>
+ </select>
+ </div>
+ </div>
+
+ <div class="select-box">
+ <div class="filter">
+ <label><xsl:value-of
select="php:function('lang', 'location type')" /></label>
+ <select id="location_type" name="location_type">
+ <xsl:apply-templates
select="location_type_list/options"/>
+ </select>
+ </div>
+ <div class="filter">
+ <label><xsl:value-of
select="php:function('lang', 'location category')" /></label>
+ <select id="location_type_category"
name="location_type_category"></select>
+ </div>
+ </div>
+
+ <div class="select-box">
+ <label>Søk etter eiendom/bygg/rom</label>
<input type="text" value="" id="search-location-name" />
<input id= "search-location_code" type="hidden"
name="search-location_code"/>
- </td>
- </tr>
- </table>
- </td>
- </tr>
+ </div>
+
+ </fieldset>
</xsl:template>
-
-
<xsl:template match="datatable" xmlns:php="http://php.net/xsl">
<div id="paging"></div>
<div id="datatable-container"></div>
- <xsl:call-template name="datasource-definition" />
+ <xsl:call-template name="datasource-definition" />
<div id="receipt"></div>
- <xsl:variable name="label_submit"><xsl:value-of
select="php:function('lang', 'save')" /></xsl:variable>
- <div><input type="submit" name="update_acl" id="frm_update_acl"
value="{$label_submit}"/></div>
+ <xsl:variable name="label_submit"><xsl:value-of select="php:function('lang',
'save')" /></xsl:variable>
+ <input type="submit" name="update_acl" id="frm_update_acl" class="btn"
value="{$label_submit}"/>
- <xsl:variable name="label_select_add"><xsl:value-of
select="php:function('lang', 'select add')" /></xsl:variable>
- <div><input type="button" name="select_add" id="frm_update_add"
value="{$label_select_add}" onclick="checkAll('mychecks_add')"/></div>
+ <xsl:variable name="label_select_add"><xsl:value-of
select="php:function('lang', 'select add')" /></xsl:variable>
+ <input type="button" name="select_add" id="frm_update_add" class="btn"
value="{$label_select_add}" onclick="checkAll('mychecks_add')"/>
- <xsl:variable name="label_select_delete"><xsl:value-of
select="php:function('lang', 'select delete')" /></xsl:variable>
- <div><input type="button" name="select_add" id="frm_update_delete"
value="{$label_select_delete}" onclick="checkAll('mychecks_delete')"/></div>
-
+ <xsl:variable name="label_select_delete"><xsl:value-of
select="php:function('lang', 'select delete')" /></xsl:variable>
+ <input type="button" name="select_add" id="frm_update_delete"
class="btn" value="{$label_select_delete}"
onclick="checkAll('mychecks_delete')"/>
</xsl:template>
<xsl:template name="datasource-definition" xmlns:php="http://php.net/xsl">
@@ -239,8 +194,6 @@
myButtons[<xsl:value-of select="name"/>] =
<xsl:value-of select="values"/>
</xsl:for-each>
</script>
-
-
</xsl:template>
<!-- options for use with select-->
Modified:
branches/Version-1_0-branch/controller/templates/base/control_location/register_control_to_location.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/control_location/register_control_to_location.xsl
2012-06-28 11:53:08 UTC (rev 9700)
+++
branches/Version-1_0-branch/controller/templates/base/control_location/register_control_to_location.xsl
2012-06-28 11:56:58 UTC (rev 9701)
@@ -21,9 +21,9 @@
<xsl:call-template name="common"/>
<div class="yui-content">
- <div id="control_details">
+ <div>
<xsl:call-template name="yui_phpgw_i18n"/>
- <xsl:apply-templates select="control_filters" />
+ <xsl:call-template name="control_filters" />
<xsl:apply-templates select="filter_form" />
<xsl:apply-templates select="paging"/>
<xsl:apply-templates select="datatable"/>
@@ -32,7 +32,46 @@
</div>
</xsl:template>
-<xsl:template match="control_filters" name="control_filters"
xmlns:php="http://php.net/xsl"></xsl:template>
+<xsl:template name="control_filters" xmlns:php="http://php.net/xsl">
+
+ <div id="choose_control">
+ <!--
+ When control area is chosen, an ajax request is
executed.
+ The operation fetches controls from db and populates
the control list.
+ The ajax opearation is handled in ajax.js
+ -->
+ <div class="error_msg">Du må velge kontroll før du kan legge
til bygg</div>
+ <h4>Velg kontroll</h4>
+ <select id="control_area_list" name="control_area_list">
+ <option value="">Velg kontrollområde</option>
+ <xsl:for-each select="control_areas_array">
+ <option value="{id}">
+ <xsl:value-of
disable-output-escaping="yes" select="name"/>
+ </option>
+ </xsl:for-each>
+ </select>
+
+ <form id="loc_form" action="" method="GET">
+ <select id="control_id" name="control_id">
+ <xsl:choose>
+ <xsl:when
test="control_array/child::node()">
+ <xsl:for-each
select="control_array">
+ <xsl:variable
name="control_id"><xsl:value-of select="id"/></xsl:variable>
+ <option
value="{$control_id}">
+ <xsl:value-of
select="title"/>
+ </option>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <option>
+ Ingen kontroller
+ </option>
+ </xsl:otherwise>
+ </xsl:choose>
+ </select>
+ </form>
+ </div>
+</xsl:template>
<xsl:template match="filter_form" xmlns:php="http://php.net/xsl">
@@ -52,6 +91,8 @@
</xsl:template>
<xsl:template name="filter_list" xmlns:php="http://php.net/xsl">
+ <div id="choose-location">
+ <h4>Velg bygg/eiendom</h4>
<ul id="filters">
<li>
<input type="hidden" id="hidden_control_id"
name="control_id">
@@ -112,6 +153,7 @@
<input type="submit" name="search"
value="{$lang_search}" title = "{$lang_search}" />
</li>
</ul>
+ </div>
</xsl:template>
<xsl:template match="datatable" xmlns:php="http://php.net/xsl">
Modified:
branches/Version-1_0-branch/controller/templates/base/control_location/view_locations_for_control.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/control_location/view_locations_for_control.xsl
2012-06-28 11:53:08 UTC (rev 9700)
+++
branches/Version-1_0-branch/controller/templates/base/control_location/view_locations_for_control.xsl
2012-06-28 11:56:58 UTC (rev 9701)
@@ -22,8 +22,44 @@
<xsl:call-template name="common"/>
<div class="yui-content">
- <div id="control_location">
-
+ <div id="control_details">
+ <div id="choose_control">
+
+ <!-- When control area is chosen, an ajax
request is executed.
+ The operation fetches controls from db
and populates the control list.
+ The ajax operation is handled in
ajax.js
+ -->
+ <select id="control_area_list"
name="control_area_list">
+ <option value="">Velg
kontrollområde</option>
+ <xsl:for-each
select="control_areas_array">
+ <option value="{id}">
+ <xsl:value-of
disable-output-escaping="yes" select="name"/>
+ </option>
+ </xsl:for-each>
+ </select>
+
+ <form id="loc_form" action="" method="GET">
+ <select id="control_id"
name="control_id">
+ <xsl:choose>
+ <xsl:when
test="control_array/child::node()">
+ <xsl:for-each
select="control_array">
+
<xsl:variable name="control_id"><xsl:value-of select="id"/></xsl:variable>
+ <option
value="{$control_id}">
+
<xsl:value-of select="title"/>
+
</option>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <option>
+ Ingen
kontroller
+ </option>
+ </xsl:otherwise>
+ </xsl:choose>
+ </select>
+ </form>
+ </div>
+ </div>
+
<div id="addedProperties">
<ul id="locations_for_control"
name="locations_for_control">
<xsl:for-each
select="locations_for_control">
@@ -43,7 +79,6 @@
<xsl:call-template name="yui_phpgw_i18n"/>
</div>
- </div>
</xsl:template>
<xsl:template match="locations_table" xmlns:php="http://php.net/xsl">
Modified: branches/Version-1_0-branch/controller/templates/base/css/base.css
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/css/base.css
2012-06-28 11:53:08 UTC (rev 9700)
+++ branches/Version-1_0-branch/controller/templates/base/css/base.css
2012-06-28 11:56:58 UTC (rev 9701)
@@ -355,6 +355,10 @@
padding: 3px 6px;
}
+input[type="checkbox"] {
+ margin: 5px;
+}
+
#innertoolbar-button, input[type="submit"] {
background: none repeat scroll 0 0 #4F9AEA;
border: 1px solid #4685C8;
@@ -491,10 +495,16 @@
width: 100%;
}
-#control_item_details label{
- margin-right: 10px;
+#control_item_details label {
+ display: block;
+ margin-bottom: 2px;
+ margin-right: 10px;
}
+#control_item_details label.line{
+ display: inline-block;
+}
+
#control_item_details label.top {
display: block;
margin-bottom: 7px;
@@ -518,7 +528,8 @@
}
#control_item_details .control_item_type .active {
- background: none repeat scroll 0 0 #0F6CCF;
+ background: none repeat scroll 0 0 #F57056;
+ border: 1px solid #CB563F;
}
#control_item_details input[type=radio] {
@@ -867,11 +878,11 @@
margin-top:0;
}
-.content-wrp{
+.content-wrp {
background: none repeat scroll 0 0 #EDF5FF;
border: 1px solid #DBE5EF;
margin-top: 1em;
- padding: 1em;
+ padding: 0;
}
/* ======================================= CHECK LIST DETAILS
========================================= */
@@ -1008,15 +1019,15 @@
/* ======================================= CHECK ITEM
========================================= */
.check_item div{
- margin: 5px 0;
- clear:left;
+ margin: 5px 0;
+ clear:left;
}
.check_item textarea {
- display: block;
- height: 100px;
- margin-top: 6px;
- width: 63%;
+ display: block;
+ height: 100px;
+ margin-top: 6px;
+ width: 63%;
}
.check_item label{
@@ -1024,9 +1035,9 @@
}
.new_item a#innertoolbar-button {
- background: none repeat scroll 0 0 grey;
- border: 1px solid #666666;
- font-weight: bold;
+ background: none repeat scroll 0 0 #FCF0DD;
+ border: 1px solid #CDBFAC;
+ color: #333333;
}
#frm_save_check_items input[type="submit"]{
@@ -1056,10 +1067,11 @@
float: left;
font-size: 19px;
margin: 0;
+ padding: 0;
}
-#control_plan .top h3 .year{
- margin-left:5px;
+#control_plan .top h3 .month {
+ margin-right: 5px;
}
#control_plan .middle {
@@ -1073,6 +1085,33 @@
padding: 1em 1em 0;
}
+#control_plan h2 {
+ background: none repeat scroll 0 0 #FFFFFF;
+ color: #000000;
+ display: inline-block;
+ font-size: 23px;
+ padding: 0.2em 0.5em;
+}
+
+#control_plan h2.components {
+ margin-top: 40px;
+}
+
+#control_plan h3 {
+ padding-left: 1em;
+}
+
+#cal-filters {
+ clear: left;
+ float: left;
+ margin-top: 1em;
+}
+
+#cal_wrp h3 {
+ font-size: 1.4em;
+ margin-bottom: 5px;
+}
+
/* ============================= SEARCH LOCATION BOX =======================
*/
#search-location {
float: right;
@@ -1096,19 +1135,18 @@
#filters {
clear: left;
float: left;
- margin-top: 1em;
}
-#filters.select-box {
+#cal-filters.select-box {
background: none repeat scroll 0 0 #DEEAF8;
border: 1px solid #BDD3ED;
}
-#filters .filter {
+#cal-filters .filter {
float: left;
}
-#filters .filter.first {
+#cal-filters .filter.first {
margin-right: 1em;
}
@@ -1156,11 +1194,11 @@
/* ================== COLOR MAP ============================= */
ul#icon_color_map {
- background: none repeat scroll 0 0 #FEFBF4;
- border: 1px solid #DDDDDD;
- border-radius: 5px 5px 5px 5px;
- float: right;
- padding: 1em;
+ background: none repeat scroll 0 0 #FEFBF4;
+ border: 1px solid #DDDDDD;
+ border-radius: 5px 5px 5px 5px;
+ float: right;
+ padding: 1em;
}
ul#icon_color_map li {
@@ -1173,35 +1211,42 @@
}
#calendar {
- table-layout: fixed;
- width: 100%;
+ table-layout: fixed;
+ width: 100%;
}
#calendar th {
- font-weight: bold;
- font-size:15px;
- background:none;
+ font-weight: bold;
+ font-size:15px;
+ background:none;
}
#calendar th, #calendar td {
- padding: 10px;
- text-align: center;
+ padding: 10px;
+ text-align: center;
}
#calendar.month th, #calendar.month td {
- padding: 5px 3px;
+ padding: 5px 3px;
}
#calendar .even {
- background: none repeat scroll 0 0 #DEEAF8;
+ background: none repeat scroll 0 0 #DEEAF8;
}
+#calendar h3 {
+ padding-left: 1em;
+ text-align: left;
+}
+
#cal_wrp {
- border: 1px solid #DBE5EF;
background: none repeat scroll 0 0 #EDF5FF;
border-top: none;
+ border-style: solid;
+ border-width: 0 1px 1px 1px;
+ border-color: #DBE5EF;
clear: both;
- padding: 1em;
+ padding: 0 1em 1em;
}
.control_details_wrp div {
@@ -1215,6 +1260,10 @@
width: 150px;
}
+#calendar .location_name, #calendar .component_type {
+ width: 150px;
+}
+
#calendar .frequency {
margin-right: 10px;
width: 100px;
@@ -1295,6 +1344,8 @@
display: block;
font-size: 10px;
font-weight: bold;
+ height: 15px;
+ padding-top: 1px;
text-align: center;
text-decoration: none;
}
@@ -1325,8 +1376,8 @@
display: none;
float: none;
font-size: 12px;
- height: 200px;
left: 40px;
+ overflow: hidden;
padding: 10px;
position: absolute;
text-align: left;
@@ -1334,28 +1385,34 @@
width: 400px;
z-index: 1;
}
+
#info_box h3 {
background: none repeat scroll 0 0 #D1E3F8;
margin: 0 0 10px;
padding: 5px 0;
text-align: center;
}
+
#info_box h5 {
font-size: 13px;
font-weight: bold;
margin: 0 0 4px;
text-align: left;
}
+
#info_box .check_item {
width: 100%
}
+
#info_box .check_item label{
display:inline;
margin-left:20px;
}
+
#info_box .case {
text-align:left;
}
+
.empty_list{
font-size: 16px;
font-weight: bold;
@@ -1366,32 +1423,46 @@
margin-left: 14px;
margin-top: 5px;
}
+
#data_paginator, #loc_paginator{
margin:8px;
clear:left;
}
+
ul#filters li, ul#search_list li{
float:left;
}
+
ul#filters input[type="text"], ul#filters select {
margin-right: 5px;
padding: 3px;
}
+
#choose_control select {
+ float: left;
margin-right: 5px;
}
+
+#choose_control form {
+ float: left;
+}
+
ul#search_list input[type="submit"] {
margin: 0;
padding: 2px 15px;
}
+
ul#search_list input[type="text"] {
margin: 0 5px 0 0;
padding: 3px;
}
-#queryForm{
- overflow:hidden;
- margin: 20px;
+
+#queryForm {
+ clear: both;
+ margin: 20px;
+ overflow: hidden;
}
+
fieldset.add_check_list div{
padding:2px;
}
@@ -1454,6 +1525,8 @@
font-size: 13px;
}
+/* ======================== TAB MENU ========================== */
+
.tab_menu a {
background: none repeat scroll 0 0 #F9F5F0;
border: 1px solid #F0F0F0;
@@ -1475,6 +1548,12 @@
border-bottom: 0;
}
+#tab_content {
+ background: none repeat scroll 0 0 #EDF5FF;
+ border: 1px solid #DBE5EF;
+ padding: 0 20px 20px;
+}
+
/* ======================== CHECK LIST MENU ========================== */
#check_list_menu {
margin: 0 0 20px;
@@ -1777,14 +1856,57 @@
/* ===================== CONTROL LOCATION ===================== */
#choose_control {
- float: right;
- width: 500px;
+ float: left;
+ margin: 20px;
+ width: 500px;
+}
+#choose_control h4 {
+ display: block;
+ font-size: 17px;
+ margin: 5px 0;
}
#choose_control select {
- width: 245px;
+ width: 245px;
}
+#choose-location {
+ clear: both;
+ margin: 20px;
+}
+
+#queryForm #choose-location {
+ margin: 0;
+}
+
+#choose-location h4{
+ display: block;
+ font-size: 17px;
+ margin: 5px 0;
+}
+
+#comp-filters label {
+ font-size: 1em;
+ font-weight: bold;
+}
+
+#comp-filters .select-box {
+ background: none repeat scroll 0 0 #DEEAF8;
+ border: 1px solid #BDD3ED;
+ float: left;
+ height: 40px;
+ margin-right: 5px;
+}
+
+#comp-filters .filter {
+ float: left;
+}
+
+
+#choose-location #datatable-container{
+ margin: 20px 0;
+}
+
.error_msg {
color: red;
display: none;
@@ -1804,16 +1926,26 @@
margin:20px;
}
+#select_all {
+ float: right;
+ margin-right: 805px;
+}
+
+#save_location {
+ margin-left:20px;
+ margin-bottom:20px;
+}
+
/* ========================== CONTROL DETAILS ============================
*/
#control_details label {
- display: inline-block;
- font-weight: bold;
- width: 100px;
+ display: inline-block;
+ font-weight: bold;
+ width: 100px;
}
#control_details .date {
- margin-right:0;
+ margin-right:0;
}
#control_details #select_all{
@@ -1830,11 +1962,11 @@
}
.help_text {
- background: none repeat scroll 0 0 #CCDBED;
- display: none;
- margin-left: 5px;
- padding: 6px 10px;
- vertical-align: baseline;
+ background: none repeat scroll 0 0 #CCDBED;
+ display: none;
+ margin-left: 5px;
+ padding: 6px 10px;
+ vertical-align: baseline;
}
.help_text.ext {
margin-left: 0;
@@ -1979,3 +2111,19 @@
p.no_items_msg {
padding: 5px;
}
+
+.no-comp-msg {
+ font-size: 16px;
+ padding-left: 12px;
+}
+
+.option-list-heading {
+ margin-bottom: 5px;
+}
+
+.option-list{
+ margin-top: 5px;
+}
+.option-list{
+ padding-left:10px;
+}
\ No newline at end of file
Modified:
branches/Version-1_0-branch/controller/templates/base/procedure/procedure_documents.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/procedure/procedure_documents.xsl
2012-06-28 11:53:08 UTC (rev 9700)
+++
branches/Version-1_0-branch/controller/templates/base/procedure/procedure_documents.xsl
2012-06-28 11:56:58 UTC (rev 9701)
@@ -32,13 +32,14 @@
</xsl:template>
<xsl:template name="table_header_documents">
- <th>
+ <tr>
<xsl:for-each select="table_header" >
- <td>
+ <th>
<xsl:value-of select="header"/>
- </td>
+ </th>
</xsl:for-each>
- </th>
+ <td> </td>
+ </tr>
</xsl:template>
<xsl:template name="values_documents">
@@ -46,6 +47,7 @@
<tr>
<xsl:for-each select="document" >
<xsl:variable name="doc_link"><xsl:value-of
select='link'/></xsl:variable>
+ <xsl:variable
name="delete_doc_link"><xsl:value-of select='delete_link'/></xsl:variable>
<td>
<a href="{$doc_link}"><xsl:value-of
select="title"/></a>
</td>
@@ -55,6 +57,9 @@
<td>
@@ Diff output truncated at 153600 characters. @@
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [9701] Merge 9656:9700 from trunk,
Sigurd Nes <=