[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [8684] Merge 8669:8683 from trunk
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [8684] Merge 8669:8683 from trunk |
Date: |
Wed, 25 Jan 2012 10:03:54 +0000 |
Revision: 8684
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8684
Author: sigurdne
Date: 2012-01-25 10:03:54 +0000 (Wed, 25 Jan 2012)
Log Message:
-----------
Merge 8669:8683 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.uicalendar.inc.php
branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php
branches/Version-1_0-branch/controller/inc/class.uicheck_list_for_location.inc.php
branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
branches/Version-1_0-branch/controller/inc/class.uicontrol_location.inc.php
branches/Version-1_0-branch/controller/inc/component/class.calendar_builder.inc.php
branches/Version-1_0-branch/controller/inc/component/class.date_generator.inc.php
branches/Version-1_0-branch/controller/inc/hook_home.inc.php
branches/Version-1_0-branch/controller/js/controller/ajax.js
branches/Version-1_0-branch/controller/js/controller/custom_drag_drop.js
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_year.xsl
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list.xsl
branches/Version-1_0-branch/controller/templates/base/check_list/cases_tab_menu.xsl
branches/Version-1_0-branch/controller/templates/base/check_list/check_list_tab_menu.xsl
branches/Version-1_0-branch/controller/templates/base/check_list/edit_check_list.xsl
branches/Version-1_0-branch/controller/templates/base/check_list/register_case.xsl
branches/Version-1_0-branch/controller/templates/base/check_list/view_cases_for_check_list.xsl
branches/Version-1_0-branch/controller/templates/base/check_list/view_check_list.xsl
branches/Version-1_0-branch/controller/templates/base/check_list/view_check_lists.xsl
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_info.xsl
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_items.xsl
branches/Version-1_0-branch/controller/templates/base/check_list/view_measurements.xsl
branches/Version-1_0-branch/controller/templates/base/check_list/view_open_cases.xsl
branches/Version-1_0-branch/controller/templates/base/control/control.xsl
branches/Version-1_0-branch/controller/templates/base/control_item/view_control_item_list.xsl
branches/Version-1_0-branch/controller/templates/base/css/base.css
branches/Version-1_0-branch/controller/templates/base/tab_view_check_lists_garbage.xsl
branches/Version-1_0-branch/controller/templates/base/view_check_lists_for_location_garbage.xsl
branches/Version-1_0-branch/phpgwapi/inc/class.db.inc.php
branches/Version-1_0-branch/phpgwapi/inc/class.setup.inc.php
branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php
branches/Version-1_0-branch/property/inc/class.uiinvoice.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
+
/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
Modified: branches/Version-1_0-branch/controller/inc/class.menu.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.menu.inc.php
2012-01-25 09:59:42 UTC (rev 8683)
+++ branches/Version-1_0-branch/controller/inc/class.menu.inc.php
2012-01-25 10:03:54 UTC (rev 8684)
@@ -99,7 +99,7 @@
'check_list' => array
(
'text' => lang('Check_list'),
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=>
'controller.uicheck_list.index') ),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=>
'controller.uicheck_list_for_location.index') ),
'image' => array('property',
'location_1'),
),
'calendar_overview' => array
@@ -117,7 +117,7 @@
'check_list' => array
(
'text' => lang('Check_list'),
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=>
'controller.uicheck_list.index') ),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=>
'controller.uicheck_list_for_location.index') ),
'image' => array('property',
'location_1'),
),
'location_check_list' => array
Modified: branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php
2012-01-25 09:59:42 UTC (rev 8683)
+++ branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php
2012-01-25 10:03:54 UTC (rev 8684)
@@ -564,7 +564,7 @@
$values = array(
$this->marshal($check_list->get_control_id(), 'int'),
- $this->marshal($check_list->get_status(), 'int'),
+ $check_list->get_status(),
$this->marshal($check_list->get_comment(), 'string'),
$this->marshal($check_list->get_deadline(), 'int'),
$this->marshal($check_list->get_planned_date(), 'int'),
Modified: branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
2012-01-25 09:59:42 UTC (rev 8683)
+++ branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
2012-01-25 10:03:54 UTC (rev 8684)
@@ -51,12 +51,6 @@
public $public_functions = array
(
'index' => true,
- 'view_check_lists_for_control' => true,
- 'save_check_list'
=> true,
- 'view_check_list'
=> true,
- 'edit_check_list'
=> true,
- 'save_check_items'
=> true,
- 'view_check_lists_for_location' => true,
'view_calendar_for_month' =>
true,
'view_calendar_for_year' =>
true
);
@@ -218,8 +212,6 @@
$controls_calendar_array =
$this->calendar_builder->build_calendar_array( $controls_calendar_array,
$control_check_list_array, 12, "view_months" );
- //print_r($controls_calendar_array);
-
$location_array =
execMethod('property.bolocation.read_single', array('location_code' =>
$location_code));
$heading_array = array("Jan", "Feb", "Mar", "Apr",
"Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des");
@@ -242,267 +234,5 @@
self::add_javascript('controller', 'controller',
'ajax.js');
}
- /* Kommentert ut av Torstein 21.01.2012 - Tror ikke vi bruker
denne... Kanskje den bør slettes...
- *
- public function view_check_lists_for_location()
- {
- $control_id = phpgw::get_var('control_id');
- $control = $this->so_control->get_single($control_id);
-
- $location_code = "1101";
-
- $from_date = strtotime("01/01/2011");
- $num_days_in_dec = cal_days_in_month(CAL_GREGORIAN, 12,
2011);
- $to_date = strtotime("12/$num_days_in_dec/2011");
-
- // Gets an array of controls that contains check_lists
for the specified location
- $control_array =
$this->so->get_check_lists_for_location( $location_code, $from_date, $to_date );
-
- $controls_calendar_array =
$this->calendar_builder->build_calendar_array( $control_array, $from_date,
$to_date );
-
- $location_array =
execMethod('property.bolocation.read_single', array('location_code' =>
$location_code));
-
- $data = array
- (
- 'location_array' =>
$location_array,
- 'controls_calendar_array' =>
$controls_calendar_array,
- 'date_format' =>
$date_format,
- 'from_date' => $from_date,
- 'to_date' =>
$to_date
- );
-
- self::add_javascript('controller', 'controller',
'jquery.js');
- self::add_javascript('controller', 'controller',
'ajax.js');
-
self::render_template_xsl('view_check_lists_for_location', $data);
- }
- */
-
- /* Kommentert ut av Torstein 21.01.2012 - Tror ikke vi bruker
denne... Kanskje den bør slettes...
- *
- public function view_check_lists_for_control()
- {
- $control_id = phpgw::get_var('id');
- $control = $this->so_control->get_single($control_id);
-
- $date_format =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
-
- $check_list_array =
$this->so->get_check_lists_for_control( $control_id );
-
- $data = array
- (
- 'control_as_array' => $control->toArray(),
- 'check_list_array' => $check_list_array,
- 'date_format' => $date_format
- );
-
- self::render_template_xsl('view_check_lists', $data);
- }
- */
-
- /* Kommentert ut av Torstein 21.01.2012 - Tror ikke vi bruker
denne... Kanskje den bør slettes...
- *
- public function view_control_items_for_control()
- {
- $control_id = phpgw::get_var('control_id');
- $control = $this->so_control->get_single($control_id);
-
- $control_groups_array =
$this->so_control_group_list->get_control_groups_by_control( $control_id );
-
- $saved_groups_with_items_array = array();
-
- foreach ($control_groups_array as $control_group)
- {
- $control_group_id = $control_group->get_id();
- $saved_control_items =
$this->so_control_item_list->get_control_items_by_control_and_group($control_id,
$control_group_id);
-
- $saved_groups_with_items_array[] =
array("control_group" => $control_group->toArray(), "control_items" =>
$saved_control_items);
- }
-
- $data = array
- (
- 'control_as_array'
=> $control->toArray(),
- 'saved_groups_with_items_array' =>
$saved_groups_with_items_array
- );
-
- self::render_template_xsl('view_check_list', $data);
- }
- */
-
- public function save_check_items(){
- $check_item_ids = phpgw::get_var('check_item_ids');
- $check_list_id = phpgw::get_var('check_list_id');
-
- foreach($check_item_ids as $check_item_id){
- $status = phpgw::get_var('status_' .
$check_item_id);
- $comment = phpgw::get_var('comment_' .
$check_item_id);
-
- $check_item =
$this->so_check_item->get_single($check_item_id);
-
- $check_item->set_status( $status );
- $check_item->set_comment( $comment );
-
- $this->so_check_item->store( $check_item );
- }
-
- $this->redirect(array('menuaction' =>
'controller.uicheck_list.view_check_list', 'check_list_id'=>$check_list_id));
- }
-
- /* Kommentert ut av Torstein 21.01.2012 - Tror ikke vi bruker
denne... Kanskje den bør slettes...
- *
- public function save_check_list(){
- $control_id = phpgw::get_var('control_id');
- $control = $this->so_control->get_single($control_id);
-
- $start_date = $control->get_start_date();
- $end_date = $control->get_end_date();
- $repeat_type = $control->get_repeat_type();
- $repeat_interval = $control->get_repeat_interval();
-
- $status = true;
- $comment = "Kommentar for sjekkliste";
- $deadline = $start_date;
-
- // Saving check_list
- $new_check_list = new controller_check_list();
- $new_check_list->set_control_id( $control_id );
- $new_check_list->set_status( $status );
- $new_check_list->set_comment( $comment );
- $new_check_list->set_deadline( $deadline );
-
- $check_list_id = $this->so_check_list->store(
$new_check_list );
-
- $control_items_list =
$this->so_control_item_list->get_control_items_by_control($control_id);
-
- foreach($control_items_list as $control_item){
-
- $status = true;
- $comment = "Kommentar for sjekk item";
-
- // Saving check_items for a list
- $new_check_item = new controller_check_item();
- $new_check_item->set_check_list_id(
$check_list_id );
-
- $new_check_item->set_control_item_id(
$control_item->get_id() );
- $new_check_item->set_status( $status );
- $new_check_item->set_comment( $comment );
-
- $saved_check_item =
$this->so_check_item->store( $new_check_item );
- }
-
- $this->redirect(array('menuaction' =>
'controller.uicheck_list.view_check_list_for_control',
'control_id'=>$control_id));
- }
- */
-
- /* Kommentert ut av Torstein 21.01.2012 - Tror ikke vi bruker
denne... Kanskje den bør slettes...
- *
- public function make_check_list_for_control(){
- $control_id = phpgw::get_var('control_id');
- $control = $this->so_control->get_single($control_id);
-
- $start_date = $control->get_start_date();
- $end_date = $control->get_end_date();
- $repeat_type = $control->get_repeat_type();
- $repeat_interval = $control->get_repeat_interval();
-
- $status = true;
- $comment = "Kommentar for sjekkliste";
- $deadline = $start_date;
-
- // Saving check_list
- $new_check_list = new controller_check_list();
- $new_check_list->set_control_id( $control_id );
- $new_check_list->set_status( $status );
- $new_check_list->set_comment( $comment );
- $new_check_list->set_deadline( $deadline );
-
- $check_list_id = $this->so_check_list->store(
$new_check_list );
-
- $control_items_list =
$this->so_control_item_list->get_control_items_by_control($control_id);
-
- foreach($control_items_list as $control_item){
-
- $status = true;
- $comment = "Kommentar for sjekk item";
-
- // Saving check_items for a list
- $new_check_item = new controller_check_item();
- $new_check_item->set_check_list_id(
$check_list_id );
-
- $new_check_item->set_control_item_id(
$control_item->get_id() );
- $new_check_item->set_status( $status );
- $new_check_item->set_comment( $comment );
-
- $saved_check_item =
$this->so_check_item->store( $new_check_item );
- }
-
- $this->redirect(array('menuaction' =>
'controller.uicheck_list.view_check_list_for_control',
'control_id'=>$control_id));
- }
- */
-
- /* Kommentert ut av Torstein 21.01.2012 - Tror ikke vi bruker
denne... Kanskje den bør slettes...
- *
- public function query()
- {
- $params = array(
- 'start' => phpgw::get_var('startIndex', 'int',
'REQUEST', 0),
- 'results' => phpgw::get_var('results', 'int',
'REQUEST', null),
- 'query' => phpgw::get_var('query'),
- 'sort' => phpgw::get_var('sort'),
- 'dir' => phpgw::get_var('dir'),
- 'filters' => $filters
- );
-
- $search_for = phpgw::get_var('query');
-
-
if($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] > 0)
- {
- $user_rows_per_page =
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
- }
- else {
- $user_rows_per_page = 10;
- }
-
- // YUI variables for paging and sorting
- $start_index = phpgw::get_var('startIndex', 'int');
- $num_of_objects = phpgw::get_var('results', 'int',
'GET', $user_rows_per_page);
- $sort_field = phpgw::get_var('sort');
- if($sort_field == null)
- {
- $sort_field = 'control_id';
- }
- $sort_ascending = phpgw::get_var('dir') == 'desc' ?
false : true;
- //Create an empty result set
- $records = array();
-
- //Retrieve a contract identifier and load corresponding
contract
-/* $control_id = phpgw::get_var('control_id');
- if(isset($control_id))
- {
- $control = $this->so->get_single($control_id);
- }
-*/
- /*
- $result_objects = $this->so->get($start_index,
$num_of_objects, $sort_field, $sort_ascending, $search_for, $search_type,
$filters);
- $object_count = $this->so->get_count($search_for,
$search_type, $filters);
- //var_dump($result_objects);
-
- $results = array();
-
- foreach($result_objects as $check_list_obj)
- {
- $results['results'][] =
$check_list_obj->serialize();
- }
-
- $results['total_records'] = $object_count;
- $results['start'] = $params['start'];
- $results['sort'] = $params['sort'];
- $results['dir'] = $params['dir'];
-
- array_walk($results["results"], array($this,
"_add_links"), "controller.uicheck_list.view_check_lists_for_control");
-
- return $this->yui_results($results);
- }
- */
-
public function query(){}
}
\ No newline at end of file
Modified: branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php
2012-01-25 09:59:42 UTC (rev 8683)
+++ branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php
2012-01-25 10:03:54 UTC (rev 8684)
@@ -59,14 +59,12 @@
'get_check_list_info' =>
true,
// 'control_calendar_status_overview' => true,
'add_check_item_to_list' =>
true,
- 'update_check_list'
=> true,
'view_control_items' =>
true,
- 'view_control_details' =>
true,
- 'print_check_list'
=> true,
- 'register_case'
=> true,
- 'view_open_cases'
=> true,
- 'view_closed_cases'
=> true,
- 'view_measurements'
=> true,
+ //'view_control_details'
=> true,
+ //'register_case'
=> true,
+ //'view_open_cases'
=> true,
+ //'view_closed_cases'
=> true,
+ //'view_measurements'
=> true,
'get_cases_for_check_list' =>
true
);
@@ -85,7 +83,7 @@
$GLOBALS['phpgw_info']['flags']['menu_selection'] =
"controller::check_list";
}
-
+/*
public function index()
{
if(phpgw::get_var('phpgw_return_as') == 'json') {
@@ -177,7 +175,7 @@
self::render_template_xsl('datatable', $data);
}
-
+ */
/* Kommentert ut av Torstein 21.01.2012 - Tror ikke vi bruker
denne... Kanskje den bør slettes...
*
public function view_check_list()
@@ -195,8 +193,8 @@
self::render_template_xsl('view_check_list', $data);
}
- */
+
// Returns check list info as JSON
public function get_check_list_info()
{
@@ -233,32 +231,7 @@
self::render_template_xsl('edit_check_list', $data);
}
*/
- 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');
- $deadline_date = phpgw::get_var('deadline_date');
- $completed_date = phpgw::get_var('completed_date');
- $planned_date = phpgw::get_var('planned_date');
-
- $planned_date_ts =
date_helper::get_timestamp_from_date( $planned_date, "d/m-Y" );
- $completed_date_ts =
date_helper::get_timestamp_from_date( $completed_date, "d/m-Y" );
-
- // Fetches check_list from DB
- $update_check_list =
$this->so_check_list->get_single($check_list_id);
- $update_check_list->set_status( $status );
- $update_check_list->set_comment( $comment );
- $update_check_list->set_completed_date(
$completed_date_ts );
- $update_check_list->set_planned_date( $planned_date_ts
);
-
- $check_list_id = $this->so_check_list->update(
$update_check_list );
-
- if($check_list_id > 0)
- return json_encode( array( "saveStatus" =>
"updated" ) );
- else
- return json_encode( array( "saveStatus" =>
"not_updated" ) );
- }
-
+
/* Kommentert ut av Torstein 21.01.2012 - Tror ikke vi bruker
denne... Kanskje den bør slettes...
*
public function control_calendar_status_overview()
@@ -281,6 +254,7 @@
}
*/
+ /*
public function view_control_items(){
$check_list_id = phpgw::get_var('check_list_id');
$check_list =
$this->so_check_list->get_single($check_list_id);
@@ -343,35 +317,7 @@
self::render_template_xsl('check_list/view_control_details', $data);
}
-
- public function print_check_list(){
- $check_list_id = phpgw::get_var('check_list_id');
- $check_list =
$this->so_check_list->get_single($check_list_id);
-
- $control =
$this->so_control->get_single($check_list->get_control_id());
- $control_groups =
$this->so_control_group_list->get_control_groups_by_control($control->get_id());
-
- $saved_groups_with_items_array = array();
-
- //Populating array with saved control items for each
group
- foreach ($control_groups as $control_group)
- {
- $saved_control_items =
$this->so_control_item_list->get_control_items_by_control_and_group($control->get_id(),
$control_group->get_id());
- $control_item =
$this->so_control_item->get_single($control_item_id);
-
- $saved_groups_with_items_array[] =
array("control_group" => $control_group->toArray(), "control_items" =>
$saved_control_items);
- }
-
- $data = array
- (
- 'saved_groups_with_items_array' =>
$saved_groups_with_items_array,
- 'check_list'
=> $check_list->toArray()
- );
-
-
self::render_template_xsl('check_list/print_check_list', $data);
- }
-
function register_case(){
$check_list_id = phpgw::get_var('check_list_id');
@@ -462,7 +408,7 @@
self::render_template_xsl(
array('check_list/cases_tab_menu', 'check_list/view_measurements'), $data );
}
-
+*/
/* Kommentert ut av Torstein 21.01.2012 - Tror ikke vi bruker
denne... Kanskje den bør slettes...
*
public function view_check_lists_for_control()
@@ -513,7 +459,7 @@
self::render_template_xsl('view_check_list', $data);
}
*/
-
+ /*
public function save_check_items(){
$check_item_ids = phpgw::get_var('check_item_ids');
$check_list_id = phpgw::get_var('check_list_id');
@@ -741,4 +687,4 @@
return $this->yui_results($results);
}
- }
+ }
\ No newline at end of file
Modified:
branches/Version-1_0-branch/controller/inc/class.uicheck_list_for_location.inc.php
===================================================================
---
branches/Version-1_0-branch/controller/inc/class.uicheck_list_for_location.inc.php
2012-01-25 09:59:42 UTC (rev 8683)
+++
branches/Version-1_0-branch/controller/inc/class.uicheck_list_for_location.inc.php
2012-01-25 10:03:54 UTC (rev 8684)
@@ -31,72 +31,61 @@
phpgw::import_class('phpgwapi.yui');
phpgw::import_class('controller.uicommon');
phpgw::import_class('controller.socontrol_area');
+ phpgw::import_class('controller.socheck_list');
include_class('controller', 'check_list', 'inc/model/');
include_class('controller', 'date_generator', 'inc/component/');
include_class('controller', 'status_checker', 'inc/helper/');
include_class('controller', 'date_helper', 'inc/helper/');
-
+ include_class('controller', 'check_item', 'inc/model/');
+
class controller_uicheck_list_for_location extends controller_uicommon
{
- var $cat_id;
- var $start;
- var $query;
- var $sort;
- var $order;
- var $filter;
- var $currentapp;
- var $type_id;
- var $location_code;
-
+ private $so;
private $so_control_area;
private $so_control;
- private $so_check_list;
private $so_control_item;
private $so_check_item;
private $so_procedure;
+ private $so_control_group_list;
+ private $so_control_item_list;
var $public_functions = array(
-
'index' => true,
-
'view_locations_for_control' => true,
-
'add_location_to_control' => true,
'add_check_list' => true,
'save_check_list' => true,
'edit_check_list' => true,
'create_case_message' => true,
'view_control_info' => true,
-
'view_cases_for_check_list' => true
+
'view_cases_for_check_list' => true,
+
'update_check_list' => true,
+
'print_check_list' => true,
+
'register_case' => true,
+
'view_open_cases' => true,
+
'view_closed_cases' => true,
+
'view_measurements' => true,
+
'view_control_details' => true,
+
'view_control_items' => true,
+
'add_check_item_to_list' => true,
+
'save_check_items' => true,
+
'save_check_item' => true,
+
'get_check_list_info' => true,
+
'get_cases_for_check_list' => true
);
function __construct()
{
parent::__construct();
-
- $this->bo =
CreateObject('property.bolocation',true);
- $this->bocommon = &
$this->bo->bocommon;
+
$this->so_control_area =
CreateObject('controller.socontrol_area');
$this->so_control =
CreateObject('controller.socontrol');
- $this->so_check_list =
CreateObject('controller.socheck_list');
+ $this->so =
CreateObject('controller.socheck_list');
$this->so_control_item =
CreateObject('controller.socontrol_item');
$this->so_check_item =
CreateObject('controller.socheck_item');
$this->so_procedure =
CreateObject('controller.soprocedure');
-
- $this->type_id =
$this->bo->type_id;
-
- $this->start =
$this->bo->start;
- $this->query =
$this->bo->query;
- $this->sort =
$this->bo->sort;
- $this->order =
$this->bo->order;
- $this->filter =
$this->bo->filter;
- $this->cat_id =
$this->bo->cat_id;
- $this->part_of_town_id =
$this->bo->part_of_town_id;
- $this->district_id =
$this->bo->district_id;
- $this->status =
$this->bo->status;
- $this->allrows =
$this->bo->allrows;
- $this->lookup =
$this->bo->lookup;
- $this->location_code =
$this->bo->location_code;
-
-
self::set_active_menu('controller::control::location_for_check_list');
+ $this->so_control_group_list =
CreateObject('controller.socontrol_group_list');
+ $this->so_control_item_list =
CreateObject('controller.socontrol_item_list');
+
+
self::set_active_menu('controller::control::check_list');
}
function add_check_list(){
@@ -153,7 +142,7 @@
function edit_check_list(){
$check_list_id = phpgw::get_var('check_list_id');
- $check_list =
$this->so_check_list->get_single($check_list_id);
+ $check_list = $this->so->get_single($check_list_id);
$control =
$this->so_control->get_single($check_list->get_control_id());
$date_format =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
@@ -182,7 +171,7 @@
function view_cases_for_check_list(){
$check_list_id = phpgw::get_var('check_list_id');
- $check_list =
$this->so_check_list->get_single($check_list_id);
+ $check_list = $this->so->get_single($check_list_id);
$control =
$this->so_control->get_single($check_list->get_control_id());
$date_format =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
@@ -216,6 +205,8 @@
$deadline_date = phpgw::get_var('deadline_date',
'string');
$planned_date = phpgw::get_var('planned_date',
'string');
$completed_date = phpgw::get_var('completed_date',
'string');
+
+ $comment = phpgw::get_var('comment', 'string');
if($planned_date != '')
$planned_date_ts =
date_helper::get_timestamp_from_date( $planned_date, "d/m-Y" );
@@ -230,11 +221,12 @@
$check_list->set_location_code($location_code);
$check_list->set_control_id($control_id);
$check_list->set_status($status);
+ $check_list->set_comment($comment);
$check_list->set_deadline( $deadline_date_ts );
$check_list->set_planned_date($planned_date_ts);
$check_list->set_completed_date($completed_date_ts);
- $check_list_id =
$this->so_check_list->store($check_list);
+ $check_list_id = $this->so->store($check_list);
$this->redirect(array('menuaction' =>
'controller.uicheck_list_for_location.edit_check_list',
'check_list_id'=>$check_list_id));
}
@@ -242,7 +234,7 @@
function create_case_message(){
$check_list_id = phpgw::get_var('check_list_id');
- $check_list_with_check_items =
$this->so_check_list->get_single_with_check_items($check_list_id);
+ $check_list_with_check_items =
$this->so->get_single_with_check_items($check_list_id);
$control_id =
$check_list_with_check_items["control_id"];
$control = $this->so_control->get_single( $control_id );
@@ -274,7 +266,7 @@
public function view_control_info(){
$check_list_id = phpgw::get_var('check_list_id');
- $check_list =
$this->so_check_list->get_single($check_list_id);
+ $check_list = $this->so->get_single($check_list_id);
$control =
$this->so_control->get_single($check_list->get_control_id());
$cats = CreateObject('phpgwapi.categories', -1,
'controller', '.control');
@@ -318,5 +310,307 @@
self::render_template_xsl(array('check_list/check_list_tab_menu','check_list/view_control_info'),
$data);
}
- public function query(){}
+ 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');
+ $deadline_date = phpgw::get_var('deadline_date');
+ $completed_date = phpgw::get_var('completed_date');
+ $planned_date = phpgw::get_var('planned_date');
+
+ $planned_date_ts =
date_helper::get_timestamp_from_date( $planned_date, "d/m-Y" );
+ $completed_date_ts =
date_helper::get_timestamp_from_date( $completed_date, "d/m-Y" );
+
+ // Fetches check_list from DB
+ $update_check_list =
$this->so->get_single($check_list_id);
+ $update_check_list->set_status( $status );
+ $update_check_list->set_comment( $comment );
+ $update_check_list->set_completed_date(
$completed_date_ts );
+ $update_check_list->set_planned_date( $planned_date_ts
);
+
+ $check_list_id = $this->so->update( $update_check_list
);
+
+ if($check_list_id > 0)
+ return json_encode( array( "saveStatus" =>
"updated" ) );
+ else
+ return json_encode( array( "saveStatus" =>
"not_updated" ) );
+ }
+
+ public function print_check_list(){
+ $check_list_id = phpgw::get_var('check_list_id');
+ $check_list = $this->so->get_single($check_list_id);
+
+ $control =
$this->so_control->get_single($check_list->get_control_id());
+ $control_groups =
$this->so_control_group_list->get_control_groups_by_control($control->get_id());
+
+ $saved_groups_with_items_array = array();
+
+ //Populating array with saved control items for each
group
+ foreach ($control_groups as $control_group)
+ {
+ $saved_control_items =
$this->so_control_item_list->get_control_items_by_control_and_group($control->get_id(),
$control_group->get_id());
+
+ $control_item =
$this->so_control_item->get_single($control_item_id);
+
+ $saved_groups_with_items_array[] =
array("control_group" => $control_group->toArray(), "control_items" =>
$saved_control_items);
+ }
+
+ $data = array
+ (
+ 'saved_groups_with_items_array' =>
$saved_groups_with_items_array,
+ 'check_list'
=> $check_list->toArray()
+ );
+
+
self::render_template_xsl('check_list/print_check_list', $data);
+ }
+
+ function view_control_details(){
+ $control_id = phpgw::get_var('control_id');
+
+ $control = $this->so_control->get_single($control_id);
+
+ // Sigurd: START as categories
+ $cats = CreateObject('phpgwapi.categories', -1,
'controller', '.control');
+ $cats->supress_info = true;
+
+ $control_areas =
$cats->formatted_xslt_list(array('format'=>'filter','selected' =>
$control_area_id,'globals' => true,'use_acl' => $this->_category_acl));
+ array_unshift($control_areas['cat_list'],array
('cat_id'=>'','name'=> lang('select value')));
+ $control_areas_array2 = array();
+ foreach($control_areas['cat_list'] as $cat_list)
+ {
+ $control_areas_array2[] = array
+ (
+ 'id' => $cat_list['cat_id'],
+ 'name' => $cat_list['name'],
+ );
+ }
+ // END as categories
+ $control_area_id = $control_areas_array2[1]['id'];
+ $procedures_array =
$this->so_procedure->get_procedures_by_control_area($control_area_id);
+ $role_array = $this->so_control->get_roles();
+
+ $data = array
+ (
+ 'control' => $control->toArray(),
+ 'procedures_array' =>
$procedures_array,
+ 'role_array' =>
$role_array
+ );
+
+
self::render_template_xsl('check_list/view_control_details', $data);
+ }
+
+ function register_case(){
+ $check_list_id = phpgw::get_var('check_list_id');
+
+ $check_list = $this->so->get_single($check_list_id);
+ $control =
$this->so_control->get_single($check_list->get_control_id());
+
+ // Fetches all control items for check list
+ $control_items_for_check_list = array();
+
+ $control_items =
$this->so_control_item_list->get_control_items_by_control($check_list->get_control_id());
+ $check_items =
$this->so_check_item->get_check_items($check_list_id, null, null,
"return_object");
+
+ $remove_control_item_ids_array = array();
+
+ foreach($check_items as $check_item){
+ if($check_item->get_control_item()->get_type()
== "control_item_type_2" & $check_item->get_status() == 1){
+ $remove_control_item_ids_array[] =
$check_item->get_control_item_id();
+ }
+ }
+
+ foreach($control_items as $control_item){
+ if( !in_array($control_item->get_id(),
$remove_control_item_ids_array) ){
+ $control_items_for_check_list[] =
$control_item->toArray();
+ }
+ }
+
+ $location_array = execMethod(
'property.bolocation.read_single', array('location_code' =>
$check_list->get_location_code()) );
+
+ $data = array
+ (
+ 'control'
=> $control->toArray(),
+ 'check_list'
=> $check_list->toArray(),
+ 'location_array' => $location_array,
+ 'control_items_for_check_list' =>
$control_items_for_check_list,
+ );
+
+
self::render_template_xsl(array('check_list/check_list_tab_menu',
'check_list/register_case'), $data);
+ self::add_javascript('controller', 'controller',
'jquery.js');
+ self::add_javascript('controller', 'controller',
'custom_ui.js');
+ self::add_javascript('controller', 'controller',
'ajax.js');
+ }
+
+ function view_open_cases(){
+ $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, 'open', null,
'return_array');
+
+ $data = array
+ (
+ '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(){
+ $check_list_id = phpgw::get_var('check_list_id');
+
+ $check_list = $this->so->get_single($check_list_id);
+
+ $closed_check_items_and_cases =
$this->so_check_item->get_check_items_with_cases($check_list_id, 'closed',
null, 'return_array');
+
+ $data = array
+ (
+ 'closed_check_items_and_cases' =>
$closed_check_items_and_cases,
+ 'check_list'
=> $check_list->toArray()
+ );
+
+ self::render_template_xsl(
array('check_list/cases_tab_menu', 'check_list/view_closed_cases'), $data );
+ }
+
+ function view_measurements(){
+ $check_list_id = phpgw::get_var('check_list_id');
+
+ $check_list = $this->so->get_single($check_list_id);
+
+ // Fetches check items that registeres measurement
+ $measurement_check_items =
$this->so_check_item->get_check_items($check_list_id, null,
'control_item_type_2', "return_array");
+
+ $data = array
+ (
+ 'measurement_check_items' =>
$measurement_check_items,
+ 'check_list' =>
$check_list->toArray()
+ );
+
+ self::render_template_xsl(
array('check_list/cases_tab_menu', 'check_list/view_measurements'), $data );
+ }
+
+ function view_control_items(){
+ $check_list_id = phpgw::get_var('check_list_id');
+ $check_list = $this->so->get_single($check_list_id);
+
+ $control =
$this->so_control->get_single($check_list->get_control_id());
+ $control_groups =
$this->so_control_group_list->get_control_groups_by_control($control->get_id());
+
+ $saved_groups_with_items_array = array();
+
+ //Populating array with saved control items for each
group
+ foreach ($control_groups as $control_group)
+ {
+ $saved_control_items =
$this->so_control_item_list->get_control_items_by_control_and_group($control->get_id(),
$control_group->get_id());
+
+ $control_item =
$this->so_control_item->get_single($control_item_id);
+
+ $saved_groups_with_items_array[] =
array("control_group" => $control_group->toArray(), "control_items" =>
$saved_control_items);
+ }
+
+ $data = array
+ (
+ 'saved_groups_with_items_array' =>
$saved_groups_with_items_array,
+ 'check_list'
=> $check_list->toArray()
+ );
+
+
self::render_template_xsl('check_list/view_control_items', $data);
+ }
+
+ function add_check_item_to_list(){
+ $control_item_id = phpgw::get_var('control_item_id');
+ $check_list_id = phpgw::get_var('check_list_id');
+ $comment = phpgw::get_var('comment');
+ $status = (int)phpgw::get_var('status');
+ $type = phpgw::get_var('type');
+
+ $check_item_obj = new controller_check_item();
+ $check_item_obj->set_status($status);
+ $check_item_obj->set_comment($comment);
+ $check_item_obj->set_check_list_id($check_list_id);
+ $check_item_obj->set_control_item_id($control_item_id);
+
+ if($type == 'control_item_type_2'){
+ $measurement = phpgw::get_var('measurement');
+ $check_item_obj->set_measurement($measurement);
+ }
+
+ $check_item_id = $this->so_check_item->store(
$check_item_obj );
+
+ if($check_item_id > 0)
+ return json_encode( array( "saveStatus" =>
"saved" ) );
+ else
+ return json_encode( array( "saveStatus" =>
"not_saved" ) );
+ }
+
+ public function save_check_items(){
+ $check_item_ids = phpgw::get_var('check_item_ids');
+ $check_list_id = phpgw::get_var('check_list_id');
+
+ foreach($check_item_ids as $check_item_id){
+ $status = phpgw::get_var('status_' .
$check_item_id);
+ $comment = phpgw::get_var('comment_' .
$check_item_id);
+
+ $check_item =
$this->so_check_item->get_single($check_item_id);
+
+ $check_item->set_status( $status );
+ $check_item->set_comment( $comment );
+
+ $this->so_check_item->store( $check_item );
+ }
+
+ $this->redirect(array('menuaction' =>
'controller.uicheck_list_for_location.view_check_list',
'check_list_id'=>$check_list_id));
+ }
+
+ public function save_check_item(){
+ $check_item_id = phpgw::get_var('check_item_id');
+ $comment = phpgw::get_var('comment');
+ $status = (int)phpgw::get_var('status');
+
+ $check_item =
$this->so_check_item->get_single($check_item_id);
+ $control_item_id = $check_item->get_control_item_id();
+
+ $control_item =
$this->so_control_item->get_single($check_item->get_control_item_id());
+
+ if($control_item->get_type() == 'control_item_type_2')
+ {
+ $measurement = phpgw::get_var('measurement');
+ $check_item->set_measurement( $measurement );
+ }
+
+ $check_item->set_status( $status );
+ $check_item->set_comment( $comment );
+
+ $check_item_id = $this->so_check_item->store(
$check_item );
+
+ if($check_item_id > 0){
+ $status_checker = new status_checker();
+ $status_checker->update_check_list_status(
$check_item->get_check_list_id() );
+
+ return json_encode( array( "saveStatus" =>
"saved" ) );
+ }
+ else
+ return json_encode( array( "status" =>
"not_saved" ) );
+ }
+
+ // Returns check list info as JSON
+ public function get_check_list_info()
+ {
+ $check_list_id = phpgw::get_var('check_list_id');
+ $check_list =
$this->so_check_list->get_single_with_check_items($check_list_id, "open");
+
+ return json_encode( $check_list );
+ }
+
+ public function get_cases_for_check_list()
+ {
+ $check_list_id = phpgw::get_var('check_list_id');
+
+ $check_items_with_cases =
$this->so_check_item->get_check_items_with_cases($check_list_id, "open", null,
"return_array");
+
+ return json_encode( $check_items_with_cases );
+ }
+
+ public function query(){}
}
Modified: branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
2012-01-25 09:59:42 UTC (rev 8683)
+++ branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
2012-01-25 10:03:54 UTC (rev 8684)
@@ -59,9 +59,9 @@
public $public_functions = array
(
- 'index' => true,
- 'control_list' => true,
- 'view' => true,
+ 'index'
=> true,
+ 'control_list'
=> true,
+ 'view'
=> true,
'view_control_details' =>
true,
'save_control_details' =>
true,
'view_control_groups' =>
true,
@@ -271,41 +271,11 @@
array('id' => "2", 'value' => "Måned"),
array('id' => "3", 'value' => "År")
);
-
- if( $control != null )
- {
- $tabs = array(
- array(
- 'label' => "1: " .
lang('Details'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_control_details',
-
'id' => $control->get_id()))
- ),array(
- 'label' => "2: " .
lang('Choose_control_groups'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_control_groups',
-
'control_id' => $control->get_id()))
- ),array(
- 'label' => "3: " .
lang('Choose_control_items'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_control_items',
-
'control_id' => $control->get_id()))
- ),array('label' => "4: " .
lang('Sort_check_list'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_check_list',
-
'control_id' => $control->get_id()))
- )
- );
- }
- else
- {
- $tabs = array( array(
- 'label' => "1: " .
lang('Details')
- ), array(
- 'label' => "2: " .
lang('Choose_control_groups')
- ), array(
- 'label' => "3: " .
lang('Choose_control_items')
- ), array(
- 'label' => "4: " .
lang('Sort_check_list')
- ));
- }
+
+ $tabs = $this->make_tab_menu($control_id);
+ print_r( $tabs );
+
$data = array
(
'tabs'
=> $GLOBALS['phpgw']->common->create_tabs($tabs, 0),
@@ -349,7 +319,7 @@
$control_area_id_from_req =
$control->get_control_area_id();
- if($control_area_id_in_db != $control_area_id_from_req
){
+ if( $control_area_id_in_db > 0 & $control_area_id_in_db
!= $control_area_id_from_req ){
// Deleting earlier saved control groups
$this->so_control_group_list->delete_control_groups($control_id);
@@ -397,24 +367,7 @@
}
}
- $tabs = array(
- array(
- 'label' => "1: " .
lang('Details'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_control_details',
-
'id' => $control->get_id()))
- ),array(
- 'label' => "2: " .
lang('Choose_control_groups'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_control_groups',
-
'control_id' => $control->get_id()))
- ),array(
- 'label' => "3: " .
lang('Choose_control_items'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_control_items',
-
'control_id' => $control->get_id()))
- ),array('label' => "4: " .
lang('Sort_check_list'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_check_list',
-
'control_id' => $control->get_id()))
- )
- );
+ $tabs = $this->make_tab_menu($control_id);
$data = array
(
@@ -498,24 +451,7 @@
$groups_with_control_items[] =
array("control_group" => $control_group->toArray(), "group_control_items" =>
$control_items_for_group_array);
}
- $tabs = array(
- array(
- 'label' => "1: " .
lang('Details'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_control_details',
-
'id' => $control->get_id()))
- ),array(
- 'label' => "2: " .
lang('Choose_control_groups'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_control_groups',
-
'control_id' => $control->get_id()))
- ),array(
- 'label' => "3: " .
lang('Choose_control_items'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_control_items',
-
'control_id' => $control->get_id()))
- ),array('label' => "4: " .
lang('Sort_check_list'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_check_list',
-
'control_id' => $control->get_id()))
- )
- );
+ $tabs = $this->make_tab_menu($control_id);
$data = array
(
@@ -542,6 +478,7 @@
// Deleting earlier saved control items
$this->so_control_item_list->delete_control_items($control_id);
+ $order_nr = 1;
// Saving control items if submit save control items is
clicked
foreach ($control_tag_ids as $control_item_tag)
{
@@ -552,7 +489,10 @@
$control_item_list = new
controller_control_item_list();
$control_item_list->set_control_id($control_id);
$control_item_list->set_control_item_id($control_item_id);
+ $control_item_list->set_order_nr($order_nr);
$this->so_control_item_list->add($control_item_list);
+
+ $order_nr++;
}
$this->redirect(array('menuaction' =>
'controller.uicontrol.view_check_list', 'control_id'=>$control_id ));
@@ -575,29 +515,13 @@
$saved_groups_with_items_array[] =
array("control_group" => $control_group->toArray(), "control_items" =>
$saved_control_items);
}
- $tabs = array(
- array(
- 'label' => "1: " .
lang('Details'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_control_details',
-
'id' => $control_id))
- ),array(
- 'label' => "2: " .
lang('Choose_control_groups'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_control_groups',
-
'control_id' => $control_id))
- ),array(
- 'label' => "3: " .
lang('Choose_control_items'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_control_items',
-
'control_id' => $control_id))
- ),array('label' => "4: " .
lang('Sort_check_list')
- )
-
- );
+ $tabs = $this->make_tab_menu($control_id);
$data = array
(
- 'tabs' =>
$GLOBALS['phpgw']->common->create_tabs($tabs, 3),
- 'view' =>
"sort_check_list",
- 'control' =>
$control->toArray(),
+ 'tabs'
=> $GLOBALS['phpgw']->common->create_tabs($tabs, 3),
+ 'view'
=> "sort_check_list",
+ 'control'
=> $control->toArray(),
'saved_groups_with_items_array' =>
$saved_groups_with_items_array
);
@@ -610,95 +534,78 @@
self::render_template_xsl(array('control/control_tabs',
'control_item/sort_check_list'), $data);
}
- /* Kommentert ut av Torstein 21.01.2012 - Tror ikke vi bruker
denne... Kanskje den bør slettes...
- *
- public function generate_check_lists_for_control(){
- $control_id = phpgw::get_var('control_id');
- $control = $this->so->get_single($control_id);
-
- $start_date = $control->get_start_date();
- $end_date = $control->get_end_date();
- $repeat_type = $control->get_repeat_type();
- $repeat_interval = $control->get_repeat_interval();
+ function make_tab_menu($control_id){
+ $tabs = array();
- $status = FALSE;
- $comment = "Kommentar for sjekkliste";
- $deadline = $start_date;
-
- // Saving check_list
- $new_check_list = new controller_check_list();
- $new_check_list->set_control_id( $control_id );
- $new_check_list->set_status( $status );
- $new_check_list->set_comment( $comment );
- $new_check_list->set_deadline( $deadline );
-
- $check_list_id = $this->so_check_list->store(
$new_check_list );
-
- $control_items_list =
$this->so_control_item_list->get_control_items_by_control($control_id);
-
- foreach($control_items_list as $control_item){
+ if($control_id > 0){
- $status = '0';
- $comment = "Kommentar for sjekk item";
+ echo " Detaljer ";
+ $control = $this->so->get_single($control_id);
- // Saving check_items for a list
- $new_check_item = new controller_check_item();
- $new_check_item->set_check_list_id(
$check_list_id );
+ $tabs[] = array(
+ 'label' => "1: " .
lang('Details'),
+ 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_control_details',
+
'id' => $control->get_id()))
+ );
- $new_check_item->set_control_item_id(
$control_item->get_id() );
- $new_check_item->set_status( $status );
- $new_check_item->set_comment( $comment );
-
- $saved_check_item =
$this->so_check_item->store( $new_check_item );
- }
+ $saved_control_groups =
$this->so_control_group_list->get_control_groups_by_control( $control->get_id()
);
+
+ if(count($saved_control_groups) > 0)
+ {
+ echo " Grupper ";
+ $tabs[] = array(
+ 'label' => "2:
" . lang('Choose_control_groups'),
+ 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_control_groups',
+
'control_id' => $control->get_id()))
+ );
+
+ $saved_control_items =
$this->so_control_item_list->get_control_items_by_control( $control->get_id() );
+
+ if(count($saved_control_items) > 0)
+ {
+ echo " Punkter ";
+ $tabs[] = array(
+ 'label'
=> "3: " . lang('Choose_control_items'),
+ 'link'
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_control_items',
+
'control_id' => $control->get_id())));
+ $tabs[] = array('label' => "4:
" . lang('Sort_check_list'),
+ 'link'
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_check_list',
+
'control_id' => $control->get_id())));
+ }else{
+ $tabs[] = array('label' => "3:
" . lang('Choose_control_items'));
+ $tabs[] = array('label' => "4:
" . lang('Sort_check_list'));
+ }
+ }else{
+ $tabs[] = array('label' => "2: " .
lang('Choose_control_groups'));
+ $tabs[] = array('label' => "3: " .
lang('Choose_control_items'));
+ $tabs[] = array('label' => "4: " .
lang('Sort_check_list'));
+ }
+ }else{
+ $tabs = array(
+ array(
+ 'label' => "1: " .
lang('Details')
+ ), array(
+ 'label' => "2: " .
lang('Choose_control_groups')
+ ), array(
+ 'label' => "3: " .
lang('Choose_control_items')
+ ), array(
+ 'label' => "4: " .
lang('Sort_check_list')
+ ));
+ }
- $this->redirect(array('menuaction' =>
'controller.uicontrol.view_check_lists_for_control', 'control_id'=>$control_id
));
- }
-
-
- public function view_check_lists_for_control()
- {
- $control_id = phpgw::get_var('control_id');
- $control = $this->so->get_single($control_id);
- $date_format =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
-
- $check_list_array =
$this->so_check_list->get_check_lists_for_control( $control_id );
- $tabs = array(
- array(
- 'label' => "1: " .
lang('Details'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_control_details',
-
'view' => "view_control_details", 'id' => $control_id))
- ),array(
- 'label' => "2: " .
lang('Choose_control_groups'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_control_groups',
-
'view' => "view_control_groups", 'control_id' => $control_id,
-
'control_group_ids' => $control_group_ids,
-
'control_area_id' => $control->get_control_area_id()))
- ),array(
- 'label' => "3: " .
lang('Choose_control_items'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_control_items',
-
'view' => "view_control_items", 'control_id' => $control_id,
-
'control_group_ids' => $control_group_ids))
- ),array('label' => "4: " .
lang('Sort_check_list')
- )
- );
- $data = array
- (
- 'tabs' =>
$GLOBALS['phpgw']->common->create_tabs($tabs, 4),
- 'view' =>
"view_check_lists",
- 'control_as_array' => $control->toArray(),
- 'check_list_array' => $check_list_array,
- 'date_format' => $date_format
- );
- self::render_template_xsl(array('control/control_tabs',
'tab_view_check_lists'), $data);
- self::add_javascript('controller', 'yahoo',
'control_tabs.js');
- }
- */
+ echo " 2: ";
+ print_r($tabs);
+
+ return $tabs;
+ }
+
+
+
// Returns control list info as JSON
public function get_controls_by_control_area()
{
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-01-25 09:59:42 UTC (rev 8683)
+++ branches/Version-1_0-branch/controller/inc/class.uicontrol_location.inc.php
2012-01-25 10:03:54 UTC (rev 8684)
@@ -60,12 +60,6 @@
'index' => true,
'view_locations_for_control' => true,
'add_location_to_control' => true,
-
'add_check_list' => true,
-
'save_check_list' => true,
-
'edit_check_list' => true,
-
'create_case_message' => true,
-
'view_control_info' => true,
-
'view_cases_for_check_list' => true
);
function __construct()
Modified:
branches/Version-1_0-branch/controller/inc/component/class.calendar_builder.inc.php
===================================================================
---
branches/Version-1_0-branch/controller/inc/component/class.calendar_builder.inc.php
2012-01-25 09:59:42 UTC (rev 8683)
+++
branches/Version-1_0-branch/controller/inc/component/class.calendar_builder.inc.php
2012-01-25 10:03:54 UTC (rev 8684)
@@ -17,7 +17,7 @@
foreach($control_array as $control){
- $calendar_array = $this->init_calendar( $control,
$calendar_array, $num_days_in_month, $period_type );
+ $calendar_array = $this->init_calendar( $control,
$calendar_array, $num, $period_type );
// Inserts check_list object on deadline month in
twelve_months_array
foreach($control->get_check_lists_array() as
$check_list){
@@ -106,7 +106,7 @@
$twelve_month_array[$i-1]["status"] = $status;
}
-
+
for($from_month;$from_month<=$to_month;$from_month++){
$trail_from_date_ts = strtotime("$from_month/01/$year");
@@ -122,7 +122,7 @@
$twelve_month_array[$from_month-1]["status"] =
$status;
$twelve_month_array[$from_month-1]["info"] =
$num_open_cases_for_control_array["count"];
- }else{
+ }else if( empty($num_open_cases_for_control_array) &
$todays_date_ts > $trail_to_date_ts){
$status =
"controls_accomplished_without_errors";
$twelve_month_array[$from_month-1]["status"] =
$status;
@@ -134,10 +134,10 @@
return $controls_calendar_array;
}
- function init_calendar( $control, $calendar_array, $num_days_in_month,
$period_type ){
+ function init_calendar( $control, $calendar_array, $num, $period_type ){
// Initialises twelve_months_array
- for($i=1;$i<=$num_days_in_month;$i++){
+ for($i=1;$i<=$num;$i++){
$calendar_array[$i] = null;
}
Modified:
branches/Version-1_0-branch/controller/inc/component/class.date_generator.inc.php
===================================================================
---
branches/Version-1_0-branch/controller/inc/component/class.date_generator.inc.php
2012-01-25 09:59:42 UTC (rev 8683)
+++
branches/Version-1_0-branch/controller/inc/component/class.date_generator.inc.php
2012-01-25 10:03:54 UTC (rev 8684)
@@ -25,12 +25,17 @@
function generate_calendar(){
$control_start_date = $this->find_control_start_date();
+ $control_end_date = $this->end_date;
+ if($control_end_date == null)
+ {
+ $control_end_date = $this->period_end_date;
+ }
$period_start_date = $this->find_start_date_for_period(
$control_start_date );
$interval_date = $period_start_date;
- while($interval_date < $this->period_end_date){
+ while(($interval_date < $this->period_end_date) &&
($interval_date <= $control_end_date)){
$this->calendar_array[] = $interval_date;
Modified: branches/Version-1_0-branch/controller/inc/hook_home.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/hook_home.inc.php
2012-01-25 09:59:42 UTC (rev 8683)
+++ branches/Version-1_0-branch/controller/inc/hook_home.inc.php
2012-01-25 10:03:54 UTC (rev 8684)
@@ -2,7 +2,7 @@
/**
* phpGroupWare - controller: a part of a Facilities Management System.
*
- * @author Erink Holm-Larsen <address@hidden>
+ * @author Erik Holm-Larsen <address@hidden>
* @author Torstein Vadla <address@hidden>
* @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc.
http://www.fsf.org/
* This file is part of phpGroupWare.
@@ -28,4 +28,104 @@
* @version $Id$
*/
- echo '<H1> Hook for controller </H1>';
+ include_class('controller', 'check_list', 'inc/model/');
+ include_class('controller', 'check_item', 'inc/model/');
+ 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');
+
+ //echo '<H1> Hook for controller </H1>';
+ $location_code = '1101';
+ $year = phpgw::get_var('year');
+
+ if(empty($year)){
+ $year = date("Y");
+ }
+
+ $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");
+
+ $criteria = array
+ (
+ 'user_id' => $GLOBALS['phpgw_info']['user']['account_id'],
+ 'type_id' => 1,
+ 'role_id' => 0, // For å begrense til en bestemt rolle - ellers
listes alle roller for brukeren
+ 'allrows' => false
+ );
+
+ $location_finder = new location_finder();
+ $my_locations = $location_finder->get_responsibilities( $criteria );
+ //print_r($my_locations);
+
+ if(empty($location_code)){
+ $location_code = $my_locations[0]["location_code"];
+ }
+
+ $repeat_type = null;
+
+ $controls_for_location_array =
$so_control->get_controls_by_location($location_code, $from_date_ts,
$to_date_ts, $repeat_type );
+ //var_dump($controls_for_location_array);
+ $controls_array = array();
+ $control_dates = array();
+ foreach($controls_for_location_array as $control){
+ $date_generator = new
date_generator($control->get_start_date(), $control->get_end_date(),
$from_date_ts, $to_date_ts, $control->get_repeat_type(),
$control->get_repeat_interval());
+ $controls_array[] = array($control,
$date_generator->get_dates());
+ }
+
+ $location_array = execMethod('property.bolocation.read_single',
array('location_code' => $location_code));
+
+ $portalbox = CreateObject('phpgwapi.listbox', array
+ (
+ 'title' => "Mine kontroller",
+ 'primary' => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
+ 'secondary' => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
+ 'tertiary' => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
+ 'width' => '100%',
+ 'outerborderwidth' => '0',
+ 'header_background_image' =>
$GLOBALS['phpgw']->common->image('phpgwapi','bg_filler', '.png', False)
+ ));
+
+ $app_id = $GLOBALS['phpgw']->applications->name2id('controller');
+ if( !isset($GLOBALS['portal_order']) ||!in_array($app_id,
$GLOBALS['portal_order']) )
+ {
+ $GLOBALS['portal_order'][] = $app_id;
+ }
+ $var = array
+ (
+ 'up' => array('url' => '/set_box.php', 'app' =>
$app_id),
+ 'down' => array('url' => '/set_box.php', 'app' =>
$app_id),
+ 'close' => array('url' => '/set_box.php', 'app' =>
$app_id),
+ 'question' => array('url' => '/set_box.php', 'app'
=> $app_id),
+ 'edit' => array('url' => '/set_box.php', 'app' =>
$app_id)
+ );
+
+ foreach ( $var as $key => $value )
+ {
+ // $portalbox->set_controls($key,$value);
+ }
+
+ $category_name = array(); // caching
+
+ $portalbox->data = array();
+ foreach ($controls_array as $control_instance)
+ {
+ $current_control = $control_instance[0];
+ $current_dates = $control_instance[1];
+ foreach($current_dates as $current_date)
+ {
+ $next_date = date('d/m/Y', $current_date);
+ $portalbox->data[] = array
+ (
+ 'text' => "{$current_control->get_title()} ::
Fristdato: {$next_date}",
+ 'link' => $GLOBALS['phpgw']->link('/index.php',
array('menuaction' => 'controller.uicheck_list_for_location.add_check_list',
'date' => $current_date, 'control_id' => $current_control->get_id(),
'location_code' => '1101'))
+ );
+ }
+ }
+ echo "\n".'<!-- BEGIN checklist info
-->'."\n".$portalbox->draw()."\n".'<!-- END checklist info -->'."\n";
Modified: branches/Version-1_0-branch/controller/js/controller/ajax.js
===================================================================
--- branches/Version-1_0-branch/controller/js/controller/ajax.js
2012-01-25 09:59:42 UTC (rev 8683)
+++ branches/Version-1_0-branch/controller/js/controller/ajax.js
2012-01-25 10:03:54 UTC (rev 8684)
@@ -1,5 +1,5 @@
$(document).ready(function(){
-
+
// file: uicalendar.xsl
$("#choose_my_location option").click(function () {
var location_code = $(this).val();
@@ -144,22 +144,57 @@
}
});
});
+
+ $("#frm_save_control_details input").focus(function(e){
+
$("#frm_save_control_details").find(".focus").removeClass("focus");
+ $(this).addClass("focus");
+ });
+ $("#frm_save_control_details select").focus(function(e){
+
$("#frm_save_control_details").find(".focus").removeClass("focus");
+ $(this).addClass("focus");
+ });
+
$("#frm_save_control_details").submit(function(e){
-
+
var thisForm = $(this);
-
- var hidden_control_area_id =
$(thisForm).find("input[name='control_area_id_hidden']").val();
- var control_area_id = $("#control_area_id").val();
-
- if(hidden_control_area_id != control_area_id)
- {
- var answer = confirm("Du har endret kontrollområde til
kontrollen. " +
- "Hvis du
lagrer vil kontrollgrupper og kontrollpunkter til kontrollen bli slettet.")
- if (!answer){
- e.preventDefault();
- }
- }
+
+ var $required_input_fields = $(this).find(".required");
+ var status = true;
+
+ $required_input_fields.each(function() {
+
+ if($(this).val() == ''){
+ var nextElem = $(this).next();
+
+ if( !$(nextElem).hasClass("input_error_msg") )
+ $(this).after("<div class='input_error_msg'>Du
må fylle ut dette feltet</div>");
+
+ status = false;
+ }else{
+ var nextElem = $(this).next();
+
+ if( $(nextElem).hasClass("input_error_msg") )
+ $(nextElem).remove();
+ }
+ });
+
+ if( status ){
+ var saved_control_area_id =
$(thisForm).find("input[name='saved_control_area_id']").val();
+ var new_control_area_id = $("#control_area_id").val();
+
+ if(saved_control_area_id != '' & saved_control_area_id !=
new_control_area_id)
+ {
+ var answer = confirm("Du har endret kontrollområde til
kontrollen. " +
+ "Hvis du
lagrer vil kontrollgrupper og kontrollpunkter til kontrollen bli slettet.")
+ if (!answer){
+ e.preventDefault();
+ }
+ }
+ }else{
+ e.preventDefault();
+ }
+
});
// file: view_check_lists_for_location.xsl
@@ -170,7 +205,7 @@
var add_param = $(thisA).find("span").text();
- var requestUrl =
"http://portico/pe/index.php?menuaction=controller.uicheck_list.get_cases_for_check_list"
+ add_param;
+ var requestUrl =
"http://portico/pe/index.php?menuaction=controller.uicheck_list_for_location.get_cases_for_check_list"
+ add_param;
$.ajax({
type: 'POST',
@@ -342,9 +377,6 @@
});
});
-
-
-
// Delete a case item from list
$(".delete_case").live("click", function(){
var clickElem = $(this);
@@ -386,13 +418,6 @@
return false;
});
- $(".make_case_editable").live("click", function(e){
- var thisForm = $(this);
- var submitBnt = $(thisForm).find("input[type='submit']");
- $(submitBnt).removeClass("not_active");
- });
-
-
$("#frm_update_check_list").live("click", function(e){
var thisForm = $(this);
var submitBnt = $(thisForm).find("input[type='submit']");
Modified:
branches/Version-1_0-branch/controller/js/controller/custom_drag_drop.js
===================================================================
--- branches/Version-1_0-branch/controller/js/controller/custom_drag_drop.js
2012-01-25 09:59:42 UTC (rev 8683)
+++ branches/Version-1_0-branch/controller/js/controller/custom_drag_drop.js
2012-01-25 10:03:54 UTC (rev 8684)
@@ -3,6 +3,9 @@
var next_elem;
var prev_elem;
var adj_y;
+var status_drag_group = false;
+var status_drag = false;
+var saveOrderForm;
$(document).ready(function(){
@@ -23,7 +26,9 @@
$(drag_elem).css("left", $(placeholder).position().left + "px");
$(drag_elem).css("top", $(placeholder).position().top + "px");
-
+
+ saveOrderForm = $(this).parents("form");
+
start_drag();
});
@@ -47,33 +52,33 @@
start_drag_group();
});
+});
+
+//Delete a control item list
+$(".delete").live("click", function(){
+ var clickElem = $(this);
+ var clickRow = $(this).parent();
- // Delete a control item list
- $(".delete").live("click", function(){
- var clickElem = $(this);
- var clickRow = $(this).parent();
-
- var url = $(clickElem).attr("href");
+ var url = $(clickElem).attr("href");
+
+ // Sending request for deleting a control item list
+ $.ajax({
+ type: 'POST',
+ url: url,
+ success: function() {
+ $(clickRow).fadeOut("slow");
+
+ var next_row = $(clickRow).next();
+
+ // Updating order numbers for rows below deleted row
+ while( $(next_row).length > 0){
+ update_order_nr(next_row, "-");
+ next_row = $(next_row).next();
+ }
+ }
+ });
- // Sending request for deleting a control item list
- $.ajax({
- type: 'POST',
- url: url,
- success: function() {
- $(clickRow).fadeOut("slow");
-
- var next_row = $(clickRow).next();
-
- // Updating order numbers for rows below
deleted row
- while( $(next_row).length > 0){
- update_order_nr(next_row, "-");
- next_row = $(next_row).next();
- }
- }
- });
-
- return false;
- });
+ return false;
});
function start_drag(){
@@ -96,6 +101,8 @@
// Updating order number for drag element and previous
element
update_order_nr(placeholder, "+");
update_order_nr(prev_elem, "-");
+
+ status_drag = true;
}
// Move drag element over previous element
else if( $(prev_elem).length > 0 && e.pageY <
$(prev_elem).offset().top + $(prev_elem).height()/2 ){
@@ -106,10 +113,27 @@
// Updating order number for drag element and next
element
update_order_nr(placeholder, "-");
update_order_nr(next_elem, "+");
+
+ status_drag = true;
}
});
}
+// Release binding for mouse events
+function stop_drag(){
+ $(drag_elem).remove();
+
+ $(document).unbind("mousemove");
+ $(document).unbind("mouseup");
+
+ if(status_drag)
+ {
+ var this_submit_btn =
$(saveOrderForm).find("input[type='submit']");
+ $(this_submit_btn).css({opacity: 1 });
+ $(this_submit_btn).removeAttr('disabled');
+ }
+}
+
function start_drag_group(){
$(document).bind("mouseup", stop_drag_group);
@@ -117,7 +141,7 @@
var x = 0;
var y = e.pageY - adj_y;
-
+
$(drag_elem).css("left", x + "px");
$(drag_elem).css("top", y + "px");
@@ -130,9 +154,12 @@
// Updating order number for drag element and previous
element
update_group_order_nr(placeholder, "+");
update_group_order_nr(prev_elem, "-");
+
+ status_drag_group = true;
}
// Move drag element over previous element
else if( $(prev_elem).length > 0 && e.pageY <
$(prev_elem).offset().top + $(prev_elem).height()/2 ){
+
$(placeholder).insertBefore(prev_elem);
prev_elem = $(placeholder).prev();
next_elem = $(placeholder).next();
@@ -140,45 +167,35 @@
// Updating order number for drag element and next
element
update_group_order_nr(placeholder, "-");
update_group_order_nr(next_elem, "+");
+
+ status_drag_group = true;
}
});
}
-
-
-// Release binding for mouse events
-function stop_drag(){
- $(drag_elem).remove();
-
- $(document).unbind("mousemove");
- $(document).unbind("mouseup");
-
- var thisForm = $(this);
- var this_submit_btn = $(thisForm).find("input[type='submit']");
- $(this_submit_btn).css({opacity: 1 });
- $(this_submit_btn).removeAttr('disabled');
-}
-
//Release binding for mouse events
function stop_drag_group(){
$(drag_elem).remove();
- $('li.drag_group').each(function() {
- var group_order_nr = $(this).find("span.group_order_nr").text();
- var control_group_id =
$(this).find("input[name='control_group_id']").val();
- var control_id = $("#control_id").val();
+ if(status_drag_group){
+ $('li.drag_group').each(function() {
+ var group_order_nr =
$(this).find("span.group_order_nr").text();
+ var control_group_id =
$(this).find("input[name='control_group_id']").val();
+ var control_id = $("#control_id").val();
+
+ var requestUrl =
"index.php?menuaction=controller.uicontrol_group.save_group_order";
+
+ $.ajax({
+ type: 'POST',
+ url: requestUrl + "&control_id=" + control_id
+ "&control_group_id=" + control_group_id + "&group_order_nr=" + group_order_nr,
+ success: function() {
+
+ }
+ });
- var requestUrl =
"index.php?menuaction=controller.uicontrol_group.save_group_order";
-
- $.ajax({
- type: 'POST',
- url: requestUrl + "&control_id=" + control_id +
"&control_group_id=" + control_group_id + "&group_order_nr=" + group_order_nr,
- success: function() {
-
- }
});
+ }
- });
$(document).unbind("mousemove");
$(document).unbind("mouseup");
Modified:
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_year.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_year.xsl
2012-01-25 09:59:42 UTC (rev 8683)
+++
branches/Version-1_0-branch/controller/templates/base/calendar/view_calendar_year.xsl
2012-01-25 10:03:54 UTC (rev 8684)
@@ -109,7 +109,7 @@
<div class="months">
<xsl:for-each
select="calendar_array">
<xsl:choose>
-
<xsl:when test="status = 'control_registered' or status =
'controls_registered'">
+
<xsl:when test="status = 'control_registered'">
<div>
<a>
<xsl:attribute name="href">
@@ -125,6 +125,11 @@
</a>
</div>
</xsl:when>
+
<xsl:when test="status = 'controls_registered'">
+
<div>
+
<img height="15" src="controller/images/status_icon_yellow_ring.png" />
+
</div>
+
</xsl:when>
<xsl:when test="status = 'control_planned'">
<div>
<a>
Modified:
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list.xsl
2012-01-25 09:59:42 UTC (rev 8683)
+++
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list.xsl
2012-01-25 10:03:54 UTC (rev 8684)
@@ -83,6 +83,13 @@
</input>
</div>
<div><label>Utstyr</label><input
name="equipment_id" /></div>
+ <div>
+ <label class="comment">Kommentar</label>
+ <textarea>
+ <xsl:attribute
name="name">comment</xsl:attribute>
+ <xsl:value-of
select="check_list/comment"/>
+ </textarea>
+ </div>
</fieldset>
<div class="form-buttons">
<xsl:variable name="lang_save"><xsl:value-of
select="php:function('lang', 'save_check_list')" /></xsl:variable>
Modified:
branches/Version-1_0-branch/controller/templates/base/check_list/cases_tab_menu.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/check_list/cases_tab_menu.xsl
2012-01-25 09:59:42 UTC (rev 8683)
+++
branches/Version-1_0-branch/controller/templates/base/check_list/cases_tab_menu.xsl
2012-01-25 10:03:54 UTC (rev 8684)
@@ -8,7 +8,7 @@
<xsl:attribute
name="class">active</xsl:attribute>
</xsl:if>
<xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicheck_list.view_open_cases</xsl:text>
+
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.view_open_cases</xsl:text>
<xsl:text>&check_list_id=</xsl:text>
<xsl:value-of select="check_list/id"/>
<xsl:text>&phpgw_return_as=stripped_html</xsl:text>
@@ -20,7 +20,7 @@
<xsl:attribute
name="class">active</xsl:attribute>
</xsl:if>
<xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicheck_list.view_closed_cases</xsl:text>
+
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.view_closed_cases</xsl:text>
<xsl:text>&check_list_id=</xsl:text>
<xsl:value-of select="check_list/id"/>
<xsl:text>&phpgw_return_as=stripped_html</xsl:text>
@@ -32,7 +32,7 @@
<xsl:attribute
name="class">active</xsl:attribute>
</xsl:if>
<xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicheck_list.view_measurements</xsl:text>
+
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.view_measurements</xsl:text>
<xsl:text>&check_list_id=</xsl:text>
<xsl:value-of select="check_list/id"/>
<xsl:text>&phpgw_return_as=stripped_html</xsl:text>
Modified:
branches/Version-1_0-branch/controller/templates/base/check_list/check_list_tab_menu.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/check_list/check_list_tab_menu.xsl
2012-01-25 09:59:42 UTC (rev 8683)
+++
branches/Version-1_0-branch/controller/templates/base/check_list/check_list_tab_menu.xsl
2012-01-25 10:03:54 UTC (rev 8684)
@@ -40,7 +40,7 @@
<div>
<a class="btn focus first">
<xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicheck_list.register_case</xsl:text>
+
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.register_case</xsl:text>
<xsl:text>&check_list_id=</xsl:text>
<xsl:value-of select="check_list/id"/>
</xsl:attribute>
Modified:
branches/Version-1_0-branch/controller/templates/base/check_list/edit_check_list.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/check_list/edit_check_list.xsl
2012-01-25 09:59:42 UTC (rev 8683)
+++
branches/Version-1_0-branch/controller/templates/base/check_list/edit_check_list.xsl
2012-01-25 10:03:54 UTC (rev 8684)
@@ -34,7 +34,7 @@
<h3 class="box_header">Sjekklistedetaljer</h3>
<fieldset class="check_list_details">
- <form id="frm_update_check_list"
action="index.php?menuaction=controller.uicheck_list.update_check_list"
method="post">
+ <form id="frm_update_check_list"
action="index.php?menuaction=controller.uicheck_list_for_location.update_check_list"
method="post">
<xsl:variable name="check_list_id"><xsl:value-of
select="check_list/id"/></xsl:variable>
<input id="check_list_id" type="hidden"
name="check_list_id" value="{$check_list_id}" />
Modified:
branches/Version-1_0-branch/controller/templates/base/check_list/register_case.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/check_list/register_case.xsl
2012-01-25 09:59:42 UTC (rev 8683)
+++
branches/Version-1_0-branch/controller/templates/base/check_list/register_case.xsl
2012-01-25 10:03:54 UTC (rev 8684)
@@ -46,7 +46,7 @@
</form>
</xsl:when>
<xsl:when
test="type = 'control_item_type_2'">
- <form
id="frm_save_check_item"
action="index.php?menuaction=controller.uicheck_list.save_check_item&phpgw_return_as=json"
method="post">
+ <form
id="frm_save_check_item"
action="index.php?menuaction=controller.uicheck_list_for_location.save_check_item&phpgw_return_as=json"
method="post">
<xsl:variable name="control_item_id"><xsl:value-of select="id"/></xsl:variable>
<input
type="hidden" name="control_item_id" value="{$control_item_id}" />
<input
name="status" type="hidden" value="1" />
Modified:
branches/Version-1_0-branch/controller/templates/base/check_list/view_cases_for_check_list.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/check_list/view_cases_for_check_list.xsl
2012-01-25 09:59:42 UTC (rev 8683)
+++
branches/Version-1_0-branch/controller/templates/base/check_list/view_cases_for_check_list.xsl
2012-01-25 10:03:54 UTC (rev 8684)
@@ -64,7 +64,7 @@
<a style="display:none;" id="view_open_cases">
<xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicheck_list.view_open_cases</xsl:text>
+
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.view_open_cases</xsl:text>
<xsl:text>&check_list_id=</xsl:text>
<xsl:value-of select="check_list/id"/>
<xsl:text>&phpgw_return_as=stripped_html</xsl:text>
Modified:
branches/Version-1_0-branch/controller/templates/base/check_list/view_check_list.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/check_list/view_check_list.xsl
2012-01-25 09:59:42 UTC (rev 8683)
+++
branches/Version-1_0-branch/controller/templates/base/check_list/view_check_list.xsl
2012-01-25 10:03:54 UTC (rev 8684)
@@ -53,7 +53,7 @@
<a>
<xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicheck_list.edit_check_list</xsl:text>
+
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.edit_check_list</xsl:text>
<xsl:text>&check_list_id=</xsl:text>
<xsl:value-of select="check_list/id"/>
</xsl:attribute>
Modified:
branches/Version-1_0-branch/controller/templates/base/check_list/view_check_lists.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/check_list/view_check_lists.xsl
2012-01-25 09:59:42 UTC (rev 8683)
+++
branches/Version-1_0-branch/controller/templates/base/check_list/view_check_lists.xsl
2012-01-25 10:03:54 UTC (rev 8684)
@@ -51,7 +51,7 @@
<div>
<a>
<xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicheck_list.view_check_list</xsl:text>
+
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.view_check_list</xsl:text>
<xsl:text>&check_list_id=</xsl:text>
<xsl:value-of select="id"/>
</xsl:attribute>
@@ -81,7 +81,7 @@
</ul>
<a>
<xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicheck_list.control_calendar_status_overview</xsl:text>
+
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.control_calendar_status_overview</xsl:text>
<xsl:text>&control_id=</xsl:text>
<xsl:value-of
select="control_as_array/id"/>
</xsl:attribute>
Modified:
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_info.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_info.xsl
2012-01-25 09:59:42 UTC (rev 8683)
+++
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_info.xsl
2012-01-25 10:03:54 UTC (rev 8684)
@@ -76,7 +76,7 @@
<div class="tab_menu">
<a id="view_control_details" class="active">
<xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicheck_list.view_control_details</xsl:text>
+
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.view_control_details</xsl:text>
<xsl:text>&control_id=</xsl:text>
<xsl:value-of select="control/id"/>
<xsl:text>&phpgw_return_as=stripped_html</xsl:text>
@@ -85,7 +85,7 @@
</a>
<a id="view_control_items">
<xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicheck_list.view_control_items</xsl:text>
+
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.view_control_items</xsl:text>
<xsl:text>&check_list_id=</xsl:text>
<xsl:value-of select="check_list/id"/>
<xsl:text>&phpgw_return_as=stripped_html</xsl:text>
Modified:
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_items.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_items.xsl
2012-01-25 09:59:42 UTC (rev 8683)
+++
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_items.xsl
2012-01-25 10:03:54 UTC (rev 8684)
@@ -38,7 +38,7 @@
</ul>
<a style="margin-top:20px;" id="print_control_items" class="btn"
target="_blank">
<xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicheck_list.print_check_list</xsl:text>
+
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.print_check_list</xsl:text>
<xsl:text>&check_list_id=</xsl:text>
<xsl:value-of select="check_list/id"/>
<xsl:text>&phpgw_return_as=stripped_html</xsl:text>
Modified:
branches/Version-1_0-branch/controller/templates/base/check_list/view_measurements.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/check_list/view_measurements.xsl
2012-01-25 09:59:42 UTC (rev 8683)
+++
branches/Version-1_0-branch/controller/templates/base/check_list/view_measurements.xsl
2012-01-25 10:03:54 UTC (rev 8684)
@@ -18,7 +18,7 @@
<xsl:for-each
select="measurement_check_items">
<li>
<h4><img
src="controller/images/arrow_right.png" width="14"/><span><xsl:value-of
select="control_item/title"/></span></h4>
- <form
id="frm_save_check_item"
action="index.php?menuaction=controller.uicheck_list.save_check_item"
method="post">
+ <form
id="frm_save_check_item"
action="index.php?menuaction=controller.uicheck_list_for_location.save_check_item"
method="post">
<xsl:variable name="check_item_id"><xsl:value-of select="id"/></xsl:variable>
<input
type="hidden" name="check_item_id" value="{$check_item_id}" />
<input
type="hidden" name="type" value="control_item_type_2" />
Modified:
branches/Version-1_0-branch/controller/templates/base/check_list/view_open_cases.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/check_list/view_open_cases.xsl
2012-01-25 09:59:42 UTC (rev 8683)
+++
branches/Version-1_0-branch/controller/templates/base/check_list/view_open_cases.xsl
2012-01-25 10:03:54 UTC (rev 8684)
@@ -78,7 +78,7 @@
<a style="font-size: 11px;margin-top: 20px;padding: 3px
20px;" class="btn focus">
<xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicheck_list.register_case</xsl:text>
+
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.register_case</xsl:text>
<xsl:text>&check_list_id=</xsl:text>
<xsl:value-of select="check_list/id"/>
</xsl:attribute>
Modified:
branches/Version-1_0-branch/controller/templates/base/control/control.xsl
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/control/control.xsl
2012-01-25 09:59:42 UTC (rev 8683)
+++ branches/Version-1_0-branch/controller/templates/base/control/control.xsl
2012-01-25 10:03:54 UTC (rev 8684)
@@ -22,12 +22,11 @@
});
});
</script>
-
<div class="yui-content">
<div id="control_details">
<form id="frm_save_control_details"
action="index.php?menuaction=controller.uicontrol.save_control_details"
method="post">
<input type="hidden" name="control_id"
value="{$control_id}" />
- <input type="hidden" name="control_area_id_hidden"
value="{$control_area_id}" />
+ <input type="hidden" name="saved_control_area_id"
value="{$control_area_id}" />
<dl class="proplist-col">
<dt>
@@ -36,7 +35,7 @@
<dd>
<xsl:choose>
<xsl:when test="editable">
- <select id="control_area_id"
name="control_area_id">
+ <select class="required"
id="control_area_id" name="control_area_id">
<option value="">Velg
kontrollområde</option>
<xsl:for-each
select="control_areas_array2">
<xsl:choose>
@@ -94,7 +93,7 @@
<dd>
<xsl:choose>
<xsl:when test="editable">
- <input type="text"
name="title" id="title" value="{control/title}" size="80"/>
+ <input class="required"
type="text" name="title" id="title" value="{control/title}" size="80"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of
select="control/title" />
@@ -105,7 +104,7 @@
<label
for="start_date">Startdato</label>
</dt>
<dd>
- <input id="start_date"
name="start_date" type="text">
+ <input class="required" id="start_date"
name="start_date" type="text">
<xsl:if test="control/start_date != ''">
<xsl:attribute
name="value"><xsl:value-of select="php:function('date', $date_format,
number(control/start_date))"/></xsl:attribute>
</xsl:if>
@@ -125,7 +124,7 @@
<label>Frekvenstype</label>
</dt>
<dd>
- <select id="repeat_type"
name="repeat_type">
+ <select class="required"
id="repeat_type" name="repeat_type">
<option value="">Velg
frekvenstype</option>
<xsl:for-each
select="repeat_type_array">
<xsl:choose>
@@ -149,7 +148,7 @@
<dd>
<xsl:choose>
<xsl:when test="editable">
- <input size="2" type="text"
name="repeat_interval" value="{control/repeat_interval}" />
+ <input class="required"
style="width:20px;" size="2" type="text" name="repeat_interval"
value="{control/repeat_interval}" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of
select="control/repeat_interval" />
@@ -162,7 +161,7 @@
<dd>
<xsl:choose>
<xsl:when test="editable">
- <select id="responsibility_id"
name="responsibility_id">
+ <select class="required"
id="responsibility_id" name="responsibility_id">
<option value="">Velg
rolle</option>
<xsl:for-each
select="role_array">
<xsl:choose>
Modified:
branches/Version-1_0-branch/controller/templates/base/control_item/view_control_item_list.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/control_item/view_control_item_list.xsl
2012-01-25 09:59:42 UTC (rev 8683)
+++
branches/Version-1_0-branch/controller/templates/base/control_item/view_control_item_list.xsl
2012-01-25 10:03:54 UTC (rev 8684)
@@ -51,7 +51,7 @@
<div style="margin:20px 0;">
<a
style="text-decoration:underline;font-size:20px;color:#333;">
<xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicheck_list.save_check_list</xsl:text>
+
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.save_check_list</xsl:text>
<xsl:text>&control_id=</xsl:text>
<xsl:value-of
select="control_as_array/id"/>
</xsl:attribute>
Modified: branches/Version-1_0-branch/controller/templates/base/css/base.css
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/css/base.css
2012-01-25 09:59:42 UTC (rev 8683)
+++ branches/Version-1_0-branch/controller/templates/base/css/base.css
2012-01-25 10:03:54 UTC (rev 8684)
@@ -1266,4 +1266,16 @@
}
ul#groups h4{
margin: 4px 0;
+}
+.input_error_msg{
+ background:#FBE3E4;
+ border-bottom-right-radius: 4px;
+ color: #D12F19;
+ display: block;
+ padding: 4px 5px;
+ width: 150px;
+}
+
+input.focus, select.focus{
+ border: 2px solid #dae6f4;
}
\ No newline at end of file
Modified:
branches/Version-1_0-branch/controller/templates/base/tab_view_check_lists_garbage.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/tab_view_check_lists_garbage.xsl
2012-01-25 09:59:42 UTC (rev 8683)
+++
branches/Version-1_0-branch/controller/templates/base/tab_view_check_lists_garbage.xsl
2012-01-25 10:03:54 UTC (rev 8684)
@@ -48,7 +48,7 @@
<div>
<a>
<xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicheck_list.view_check_list</xsl:text>
+
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.view_check_list</xsl:text>
<xsl:text>&check_list_id=</xsl:text>
<xsl:value-of select="id"/>
</xsl:attribute>
Modified:
branches/Version-1_0-branch/controller/templates/base/view_check_lists_for_location_garbage.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/view_check_lists_for_location_garbage.xsl
2012-01-25 09:59:42 UTC (rev 8683)
+++
branches/Version-1_0-branch/controller/templates/base/view_check_lists_for_location_garbage.xsl
2012-01-25 10:03:54 UTC (rev 8684)
@@ -62,7 +62,7 @@
<xsl:otherwise>
<a class="view_check_list">
<xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicheck_list.get_check_list_info</xsl:text>
+
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.get_check_list_info</xsl:text>
<xsl:text>&phpgw_return_as=json</xsl:text>
<xsl:text>&check_list_id=</xsl:text>
<xsl:value-of select="id"/>
Modified: branches/Version-1_0-branch/phpgwapi/inc/class.db.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.db.inc.php 2012-01-25
09:59:42 UTC (rev 8683)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.db.inc.php 2012-01-25
10:03:54 UTC (rev 8684)
@@ -54,10 +54,10 @@
/**
* @var string $join the sql syntax to use for JOIN
*/
- var $join = ' INNER JOIN ';
+ var $join = 'INNER JOIN';
- var $left_join = ' LEFT JOIN ';
+ var $left_join = 'LEFT JOIN';
/**
* @var string $like the sql syntax to use for a case
insensitive LIKE
*/
@@ -138,7 +138,7 @@
switch ( $this->Type )
{
case 'postgres':
- $this->join = " JOIN ";
+ $this->join = "JOIN";
$this->like = "ILIKE";
break;
default:
Modified: branches/Version-1_0-branch/phpgwapi/inc/class.setup.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.setup.inc.php
2012-01-25 09:59:42 UTC (rev 8683)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.setup.inc.php
2012-01-25 10:03:54 UTC (rev 8684)
@@ -536,11 +536,11 @@
$setup_info =& $GLOBALS['setup_info'];
// Clean up locations, custom fields and ACL
- $this->db->query("SELECT app_id FROM phpgw_applications
WHERE app_name = '{$appname}'");
+ $this->db->query("SELECT app_id FROM phpgw_applications
WHERE app_name = '{$appname}'",__LINE__,__FILE__);
$this->db->next_record();
$app_id = (int)$this->db->f('app_id');
- $this->db->query("SELECT location_id FROM
phpgw_locations WHERE app_id = {$app_id}");
+ $this->db->query("SELECT location_id FROM
phpgw_locations WHERE app_id = {$app_id}",__LINE__,__FILE__);
$locations = array();
while ($this->db->next_record())
@@ -550,23 +550,26 @@
if(count($locations))
{
- $this->db->query('DELETE FROM phpgw_cust_choice
WHERE location_id IN ('. implode (',',$locations) . ')');
- $this->db->query('DELETE FROM
phpgw_cust_attribute WHERE location_id IN ('. implode (',',$locations). ')');
- $this->db->query('DELETE FROM phpgw_acl WHERE
location_id IN ('. implode (',',$locations) . ')');
+ $this->db->query('DELETE FROM phpgw_cust_choice
WHERE location_id IN ('. implode (',',$locations) . ')',__LINE__,__FILE__);
+ $this->db->query('DELETE FROM
phpgw_cust_attribute WHERE location_id IN ('. implode (',',$locations).
')',__LINE__,__FILE__);
+ $this->db->query('DELETE FROM phpgw_acl WHERE
location_id IN ('. implode (',',$locations) . ')',__LINE__,__FILE__);
- $this->db->query('SELECT id FROM
phpgw_config2_section WHERE location_id IN ('. implode (',',$locations) . ')');
+ $this->db->query('SELECT id FROM
phpgw_config2_section WHERE location_id IN ('. implode (',',$locations) .
')',__LINE__,__FILE__);
$sections = array();
while ($this->db->next_record())
{
$sections[] = $this->db->f('id');
}
- $this->db->query('DELETE FROM
phpgw_config2_value WHERE section_id IN ('. implode (',',$sections) . ')');
- $this->db->query('DELETE FROM
phpgw_config2_choice WHERE section_id IN ('. implode (',',$sections) . ')');
- $this->db->query('DELETE FROM
phpgw_config2_attrib WHERE section_id IN ('. implode (',',$sections) . ')');
- $this->db->query('DELETE FROM
phpgw_config2_section WHERE location_id IN ('. implode (',',$locations) . ')');
+ if($sections)
+ {
+ $this->db->query('DELETE FROM
phpgw_config2_value WHERE section_id IN ('. implode (',',$sections) .
')',__LINE__,__FILE__);
+ $this->db->query('DELETE FROM
phpgw_config2_choice WHERE section_id IN ('. implode (',',$sections) .
')',__LINE__,__FILE__);
+ $this->db->query('DELETE FROM
phpgw_config2_attrib WHERE section_id IN ('. implode (',',$sections) .
')',__LINE__,__FILE__);
+ $this->db->query('DELETE FROM
phpgw_config2_section WHERE location_id IN ('. implode (',',$locations) .
')',__LINE__,__FILE__);
+ }
}
- $this->db->query("DELETE FROM phpgw_locations WHERE
app_id = {$app_id}");
+ $this->db->query("DELETE FROM phpgw_locations WHERE
app_id = {$app_id}",__LINE__,__FILE__);
$this->db->query("DELETE FROM phpgw_config WHERE
config_app='{$appname}'",__LINE__,__FILE__);
//echo 'DELETING application: ' . $appname;
$this->db->query("DELETE FROM phpgw_applications WHERE
app_name='{$appname}'",__LINE__,__FILE__);
Modified: branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php
2012-01-25 09:59:42 UTC (rev 8683)
+++ branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php
2012-01-25 10:03:54 UTC (rev 8684)
@@ -915,8 +915,17 @@
{
$receipt = array();
$this->db->transaction_begin();
+
+ if($periodization)
+ {
+ $value = "'{$periodization}'";
+ }
+ else
+ {
+ $value = 'NULL';
+ }
- $this->db->query("UPDATE fm_ecobilag set
periodization='$periodization' where bilagsnr='$voucher_id'");
+ $this->db->query("UPDATE fm_ecobilag SET
periodization={$value} where bilagsnr='{$voucher_id}'");
$this->db->transaction_commit();
Modified: branches/Version-1_0-branch/property/inc/class.uiinvoice.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uiinvoice.inc.php
2012-01-25 09:59:42 UTC (rev 8683)
+++ branches/Version-1_0-branch/property/inc/class.uiinvoice.inc.php
2012-01-25 10:03:54 UTC (rev 8684)
@@ -668,6 +668,10 @@
);
$periodization_list =
execMethod('property.bogeneric.get_list', array('type'=>'periodization'));
+ if($periodization_list)
+ {
+ array_unshift ($periodization_list,array('id'
=> '0', 'name' => lang('none')));
+ }
$jscode = <<<JS
var myPeriodizationDropDown = function(elCell,
oRecord, oColumn, oData)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [8684] Merge 8669:8683 from trunk,
Sigurd Nes <=