[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [8535]
From: |
Torstein |
Subject: |
[Fmsystem-commits] [8535] |
Date: |
Mon, 09 Jan 2012 10:14:46 +0000 |
Revision: 8535
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8535
Author: vator
Date: 2012-01-09 10:14:45 +0000 (Mon, 09 Jan 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/controller/inc/class.socheck_item.inc.php
trunk/controller/inc/class.socheck_list.inc.php
trunk/controller/inc/class.uicheck_list.inc.php
Added Paths:
-----------
trunk/controller/inc/class.uicase.inc.php
Removed Paths:
-------------
trunk/controller/inc/class.uierror_report_message.inc.php
Modified: trunk/controller/inc/class.socheck_item.inc.php
===================================================================
--- trunk/controller/inc/class.socheck_item.inc.php 2012-01-09 09:55:26 UTC
(rev 8534)
+++ trunk/controller/inc/class.socheck_item.inc.php 2012-01-09 10:14:45 UTC
(rev 8535)
@@ -137,7 +137,7 @@
}
public function get_check_items($check_list_id, $status, $type){
- $sql = "SELECT ci.id as ci_id, ci.status,
control_item_id, ci.comment, ci.message_ticket_id, ci.measurement,
check_list_id, ";
+ $sql = "SELECT ci.id as ci_id, ci.status,
control_item_id, ci.comment, ci.measurement, check_list_id, ";
$sql .= "coi.id as coi_id, coi.title, coi.required,
coi.what_to_do, coi.how_to_do, coi.control_group_id, coi.type ";
$sql .= "FROM controller_check_item ci ";
$sql .= "LEFT JOIN controller_control_item as coi ON
ci.control_item_id = coi.id ";
@@ -159,7 +159,6 @@
$check_item->set_status($this->unmarshal($this->db->f('status', true), 'bool'));
$check_item->set_comment($this->unmarshal($this->db->f('comment', true),
'string'));
$check_item->set_check_list_id($this->unmarshal($this->db->f('check_list_id',
true), 'int'));
-
$check_item->set_message_ticket_id($this->unmarshal($this->db->f('message_ticket_id',
true), 'int'));
$check_item->set_measurement($this->unmarshal($this->db->f('measurement',
true), 'int'));
$control_item = new
controller_control_item($this->unmarshal($this->db->f('coi_id', true), 'int'));
Modified: trunk/controller/inc/class.socheck_list.inc.php
===================================================================
--- trunk/controller/inc/class.socheck_list.inc.php 2012-01-09 09:55:26 UTC
(rev 8534)
+++ trunk/controller/inc/class.socheck_list.inc.php 2012-01-09 10:14:45 UTC
(rev 8535)
@@ -96,7 +96,7 @@
public function get_single_with_check_items($check_list_id, $status,
$type){
$sql = "SELECT cl.id as cl_id, cl.status as cl_status,
cl.control_id, cl.comment as cl_comment, deadline, planned_date,
completed_date, location_code, ";
- $sql .= "ci.id as ci_id, ci.status as ci_status,
control_item_id, ci.comment as ci_comment, ci.measurement, check_list_id, ";
+ $sql .= "ci.id as ci_id, ci.status as ci_status,
control_item_id, ci.comment as ci_comment, check_list_id, ";
$sql .= "coi.title as coi_id, coi.title as coi_title,
coi.required as coi_required, coi.required as coi_required, ";
$sql .= "coi.what_to_do as coi_what_to_do, coi.how_to_do as
coi_how_to_do, coi.control_group_id as coi_control_group_id, coi.type ";
$sql .= "FROM controller_check_list cl ";
@@ -136,7 +136,6 @@
$check_item->set_status($this->unmarshal($this->db->f('ci_status', true),
'bool'));
$check_item->set_comment($this->unmarshal($this->db->f('ci_comment', true),
'string'));
$check_item->set_check_list_id($this->unmarshal($this->db->f('check_list_id',
true), 'int'));
-
$check_item->set_message_ticket_id($this->unmarshal($this->db->f('message_ticket_id',
true), 'int'));
$check_item->set_measurement($this->unmarshal($this->db->f('measurement',
true), 'int'));
$control_item = new
controller_control_item($this->unmarshal($this->db->f('coi_id', true), 'int'));
Copied: trunk/controller/inc/class.uicase.inc.php (from rev 8489,
trunk/controller/inc/class.uierror_report_message.inc.php)
===================================================================
--- trunk/controller/inc/class.uicase.inc.php (rev 0)
+++ trunk/controller/inc/class.uicase.inc.php 2012-01-09 10:14:45 UTC (rev
8535)
@@ -0,0 +1,186 @@
+<?php
+ /**
+ * phpGroupWare - controller: a part of a Facilities Management System.
+ *
+ * @author Erink 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.
+ *
+ * phpGroupWare is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * phpGroupWare is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with phpGroupWare; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA
+ *
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/
+ * @package property
+ * @subpackage controller
+ * @version $Id: class.uicheck_list_for_location.inc.php 8419 2011-12-23
09:54:15Z vator $
+ */
+
+ phpgw::import_class('phpgwapi.yui');
+ phpgw::import_class('controller.uicommon');
+ phpgw::import_class('controller.socontrol_area');
+
+ include_class('controller', 'check_list', 'inc/model/');
+ include_class('controller', 'date_generator', 'inc/component/');
+
+ class controller_uierror_report_message extends controller_uicommon
+ {
+ private $so_control_area;
+ private $so_control;
+ private $so_check_list;
+ private $so_control_item;
+ private $so_check_item;
+
+ var $public_functions = array(
+
'create_case' => true,
+
'save_case' => 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_control_item =
CreateObject('controller.socontrol_item');
+ $this->so_check_item =
CreateObject('controller.socheck_item');
+
+ $this->type_id =
$this->bo->type_id;
+
+
self::set_active_menu('controller::control::location_for_check_list');
+ }
+
+ function create_case(){
+ $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, null,
'control_item_type_1');
+
+ $control_id =
$check_list_with_check_items["control_id"];
+ $control = $this->so_control->get_single( $control_id );
+
+ $location_code =
$check_list_with_check_items["location_code"];
+
+ $date_format =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+
+ $location_array =
execMethod('property.bolocation.read_single', array('location_code' =>
$location_code));
+
+ $catsObj = CreateObject('phpgwapi.categories', -1,
'property', '.ticket');
+ $catsObj->supress_info = true;
+
+ $categories =
$catsObj->formatted_xslt_list(array('select_name' =>
'values[cat_id]','selected' => $this->cat_id, 'use_acl' =>
$this->_category_acl));
+
+ $data = array
+ (
+ 'categories' => $categories,
+ 'location_array' =>
$location_array,
+ 'control_array' =>
$control->toArray(),
+ 'check_list' =>
$check_list_with_check_items,
+ 'date_format' => $date_format
+ );
+
+ self::add_javascript('controller', 'controller',
'jquery.js');
+ self::add_javascript('controller', 'controller',
'jquery-ui.custom.min.js');
+ self::add_javascript('controller', 'controller',
'custom_ui.js');
+ self::add_javascript('controller', 'controller',
'ajax.js');
+
+
$GLOBALS['phpgw']->css->add_external_file('controller/templates/base/css/jquery-ui.custom.css');
+
+ self::render_template_xsl('create_case', $data);
+ }
+
+ function save_case(){
+ $check_list_id = phpgw::get_var('check_list_id');
+ $check_item_ids = phpgw::get_var('check_item_ids');
+ $location_code = phpgw::get_var('location_code');
+ $message_title = phpgw::get_var('message_title');
+ $message_cat_id = phpgw::get_var('message_cat_id');
+
+ $check_list =
$this->so_check_list->get_single($check_list_id);
+
+ $control_id = $check_list->get_control_id();
+ $control = $this->so_control->get_single( $control_id );
+
+ $location_code = $check_list->get_location_code();
+
+ $date_format =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+
+ $location_array =
execMethod('property.bolocation.read_single', array('location_code' =>
$location_code));
+
+ // Generates message details from comment field in
check item
+ foreach($check_item_ids as $check_item_id){
+ $check_item =
$this->so_check_item->get_single($check_item_id);
+ $message_details .= "Gjøremål: ";
+ $message_details .= $check_item->get_comment()
. "<br>";
+ }
+
+ $location_id =
$GLOBALS['phpgw']->locations->get_id("controller", ".checklist");
+
+ $ticket = array
+ (
+ 'origin' => $location_id,
+ 'origin_id' =>
$check_list_id,
+ 'location_code' => $location_code,
+ 'cat_id' =>
$message_cat_id,
+ 'priority' => $priority,
//valgfri (1-3)
+ 'title' =>
$message_title,
+ 'details' =>
$message_details,
+ 'file_input_name' => 'file' // navn på
felt som inneholder fil
+ );
+
+ $botts = CreateObject('property.botts',true);
+ $message_ticket_id = $botts->add_ticket($ticket);
+
+ // Registers message and updates check items with
message ticket id
+ foreach($check_item_ids as $check_item_id){
+ $check_item =
$this->so_check_item->get_single($check_item_id);
+ $check_item->set_message_ticket_id(
$message_ticket_id );
+ $this->so_check_item->update($check_item);
+ }
+
+ $registered_message_check_items =
$this->so_check_item->get_check_items_by_message($message_ticket_id);
+
+ $message_ticket =
$botts->read_single($message_ticket_id);
+
+ $catsObj = CreateObject('phpgwapi.categories', -1,
'property', '.ticket');
+ $catsObj->supress_info = true;
+
+ $category =
$catsObj->return_single($message_ticket["cat_id"]);
+
+ $data = array
+ (
+ 'message_ticket'
=> $message_ticket,
+ 'category'
=> $category[0]['name'],
+ 'location_array'
=> $location_array,
+ 'control_array'
=> $control->toArray(),
+ 'check_list'
=> $check_list->toArray(),
+ 'registered_message_check_items' =>
$registered_message_check_items,
+ 'date_format'
=> $date_format
+ );
+
+ self::add_javascript('controller', 'controller',
'jquery.js');
+ self::add_javascript('controller', 'controller',
'jquery-ui.custom.min.js');
+ self::add_javascript('controller', 'controller',
'custom_ui.js');
+ self::add_javascript('controller', 'controller',
'ajax.js');
+
+
$GLOBALS['phpgw']->css->add_external_file('controller/templates/base/css/jquery-ui.custom.css');
+
+ self::render_template_xsl('view_case', $data);
+ }
+
+ public function query(){}
+ }
Modified: trunk/controller/inc/class.uicheck_list.inc.php
===================================================================
--- trunk/controller/inc/class.uicheck_list.inc.php 2012-01-09 09:55:26 UTC
(rev 8534)
+++ trunk/controller/inc/class.uicheck_list.inc.php 2012-01-09 10:14:45 UTC
(rev 8535)
@@ -296,7 +296,7 @@
'check_list'
=> $check_list->toArray()
);
-
self::render_template_xsl('check_list/view_control_items',
array('view_control_items' => $data));
+
self::render_template_xsl('check_list/view_control_items', $data);
}
public function view_control_details(){
@@ -331,7 +331,7 @@
'role_array' =>
$role_array
);
-
self::render_template_xsl('check_list/view_control_details',
array('view_control_details' => $data));
+
self::render_template_xsl('check_list/view_control_details', $data);
}
public function print_check_list(){
@@ -359,7 +359,7 @@
'check_list'
=> $check_list->toArray()
);
-
self::render_template_xsl('check_list/print_check_list',
array('view_control_items' => $data));
+
self::render_template_xsl('check_list/print_check_list', $data);
}
function register_errors(){
@@ -411,7 +411,7 @@
'check_list' => $check_list->toArray()
);
- self::render_template_xsl('check_list/register_errors',
array('register_errors' => $data));
+ self::render_template_xsl('check_list/register_errors',
$data);
}
function view_open_errors(){
@@ -428,7 +428,7 @@
'check_list' =>
$check_list->toArray()
);
-
self::render_template_xsl('check_list/view_open_errors',
array('view_open_errors' => $data));
+
self::render_template_xsl('check_list/view_open_errors', $data);
}
function view_closed_errors(){
@@ -445,7 +445,7 @@
'check_list' => $check_list->toArray()
);
-
self::render_template_xsl('check_list/view_closed_errors',
array('view_closed_errors' => $data));
+
self::render_template_xsl('check_list/view_closed_errors', $data);
}
function view_measurements(){
@@ -462,7 +462,7 @@
'check_list' => $check_list->toArray()
);
-
self::render_template_xsl('check_list/view_measurements',
array('view_measurements' => $data));
+
self::render_template_xsl('check_list/view_measurements', $data);
}
public function view_check_lists_for_control()
Deleted: trunk/controller/inc/class.uierror_report_message.inc.php
===================================================================
--- trunk/controller/inc/class.uierror_report_message.inc.php 2012-01-09
09:55:26 UTC (rev 8534)
+++ trunk/controller/inc/class.uierror_report_message.inc.php 2012-01-09
10:14:45 UTC (rev 8535)
@@ -1,186 +0,0 @@
-<?php
- /**
- * phpGroupWare - controller: a part of a Facilities Management System.
- *
- * @author Erink 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.
- *
- * phpGroupWare is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * phpGroupWare is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with phpGroupWare; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA
- *
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
- * @internal Development of this application was funded by
http://www.bergen.kommune.no/
- * @package property
- * @subpackage controller
- * @version $Id: class.uicheck_list_for_location.inc.php 8419 2011-12-23
09:54:15Z vator $
- */
-
- phpgw::import_class('phpgwapi.yui');
- phpgw::import_class('controller.uicommon');
- phpgw::import_class('controller.socontrol_area');
-
- include_class('controller', 'check_list', 'inc/model/');
- include_class('controller', 'date_generator', 'inc/component/');
-
- class controller_uierror_report_message extends controller_uicommon
- {
- private $so_control_area;
- private $so_control;
- private $so_check_list;
- private $so_control_item;
- private $so_check_item;
-
- var $public_functions = array(
-
'create_error_report_message' => true,
-
'save_error_report_message' => 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_control_item =
CreateObject('controller.socontrol_item');
- $this->so_check_item =
CreateObject('controller.socheck_item');
-
- $this->type_id =
$this->bo->type_id;
-
-
self::set_active_menu('controller::control::location_for_check_list');
- }
-
- function create_error_report_message(){
- $check_list_id = phpgw::get_var('check_list_id');
-
- $check_list_with_check_items =
$this->so_check_list->get_single_with_check_items($check_list_id, null,
'control_item_type_1');
-
- $control_id =
$check_list_with_check_items["control_id"];
- $control = $this->so_control->get_single( $control_id );
-
- $location_code =
$check_list_with_check_items["location_code"];
-
- $date_format =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
-
- $location_array =
execMethod('property.bolocation.read_single', array('location_code' =>
$location_code));
-
- $catsObj = CreateObject('phpgwapi.categories', -1,
'property', '.ticket');
- $catsObj->supress_info = true;
-
- $categories =
$catsObj->formatted_xslt_list(array('select_name' =>
'values[cat_id]','selected' => $this->cat_id, 'use_acl' =>
$this->_category_acl));
-
- $data = array
- (
- 'categories' => $categories,
- 'location_array' =>
$location_array,
- 'control_array' =>
$control->toArray(),
- 'check_list' =>
$check_list_with_check_items,
- 'date_format' => $date_format
- );
-
- self::add_javascript('controller', 'controller',
'jquery.js');
- self::add_javascript('controller', 'controller',
'jquery-ui.custom.min.js');
- self::add_javascript('controller', 'controller',
'custom_ui.js');
- self::add_javascript('controller', 'controller',
'ajax.js');
-
-
$GLOBALS['phpgw']->css->add_external_file('controller/templates/base/css/jquery-ui.custom.css');
-
-
self::render_template_xsl('create_error_report_message', $data);
- }
-
- function save_error_report_message(){
- $check_list_id = phpgw::get_var('check_list_id');
- $check_item_ids = phpgw::get_var('check_item_ids');
- $location_code = phpgw::get_var('location_code');
- $message_title = phpgw::get_var('message_title');
- $message_cat_id = phpgw::get_var('message_cat_id');
-
- $check_list =
$this->so_check_list->get_single($check_list_id);
-
- $control_id = $check_list->get_control_id();
- $control = $this->so_control->get_single( $control_id );
-
- $location_code = $check_list->get_location_code();
-
- $date_format =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
-
- $location_array =
execMethod('property.bolocation.read_single', array('location_code' =>
$location_code));
-
- // Generates message details from comment field in
check item
- foreach($check_item_ids as $check_item_id){
- $check_item =
$this->so_check_item->get_single($check_item_id);
- $message_details .= "Gjøremål: ";
- $message_details .= $check_item->get_comment()
. "<br>";
- }
-
- $location_id =
$GLOBALS['phpgw']->locations->get_id("controller", ".checklist");
-
- $ticket = array
- (
- 'origin' => $location_id,
- 'origin_id' =>
$check_list_id,
- 'location_code' => $location_code,
- 'cat_id' =>
$message_cat_id,
- 'priority' => $priority,
//valgfri (1-3)
- 'title' =>
$message_title,
- 'details' =>
$message_details,
- 'file_input_name' => 'file' // navn på
felt som inneholder fil
- );
-
- $botts = CreateObject('property.botts',true);
- $message_ticket_id = $botts->add_ticket($ticket);
-
- // Registers message and updates check items with
message ticket id
- foreach($check_item_ids as $check_item_id){
- $check_item =
$this->so_check_item->get_single($check_item_id);
- $check_item->set_message_ticket_id(
$message_ticket_id );
- $this->so_check_item->update($check_item);
- }
-
- $registered_message_check_items =
$this->so_check_item->get_check_items_by_message($message_ticket_id);
-
- $message_ticket =
$botts->read_single($message_ticket_id);
-
- $catsObj = CreateObject('phpgwapi.categories', -1,
'property', '.ticket');
- $catsObj->supress_info = true;
-
- $category =
$catsObj->return_single($message_ticket["cat_id"]);
-
- $data = array
- (
- 'message_ticket'
=> $message_ticket,
- 'category'
=> $category[0]['name'],
- 'location_array'
=> $location_array,
- 'control_array'
=> $control->toArray(),
- 'check_list'
=> $check_list->toArray(),
- 'registered_message_check_items' =>
$registered_message_check_items,
- 'date_format'
=> $date_format
- );
-
- self::add_javascript('controller', 'controller',
'jquery.js');
- self::add_javascript('controller', 'controller',
'jquery-ui.custom.min.js');
- self::add_javascript('controller', 'controller',
'custom_ui.js');
- self::add_javascript('controller', 'controller',
'ajax.js');
-
-
$GLOBALS['phpgw']->css->add_external_file('controller/templates/base/css/jquery-ui.custom.css');
-
- self::render_template_xsl('view_error_report_message',
$data);
- }
-
- public function query(){}
- }
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [8535],
Torstein <=