[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [9174]
From: |
Torstein |
Subject: |
[Fmsystem-commits] [9174] |
Date: |
Wed, 18 Apr 2012 10:54:48 +0000 |
Revision: 9174
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9174
Author: vator
Date: 2012-04-18 10:54:48 +0000 (Wed, 18 Apr 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/controller/inc/class.socase.inc.php
trunk/controller/inc/class.uicalendar.inc.php
trunk/controller/inc/class.uicase.inc.php
trunk/controller/inc/class.uitest.inc.php
trunk/controller/js/controller/ajax.js
trunk/controller/js/controller/custom_ui.js
trunk/controller/templates/base/calendar/view_calendar_month.xsl
trunk/controller/templates/base/calendar/view_calendar_year.xsl
trunk/controller/templates/base/case/create_case_message.xsl
trunk/controller/templates/base/case/view_case_message.xsl
trunk/controller/templates/base/check_list/register_case.xsl
trunk/controller/templates/base/css/base.css
Modified: trunk/controller/inc/class.socase.inc.php
===================================================================
--- trunk/controller/inc/class.socase.inc.php 2012-04-18 10:46:44 UTC (rev
9173)
+++ trunk/controller/inc/class.socase.inc.php 2012-04-18 10:54:48 UTC (rev
9174)
@@ -92,6 +92,7 @@
while ($this->db->next_record()) {
$case = new
controller_check_item_case($this->unmarshal($this->db->f('id', true), 'int'));
$case->set_check_item_id($this->unmarshal($this->db->f('check_item_id', true),
'int'));
+
$case->set_status($this->unmarshal($this->db->f('status', true), 'int'));
$case->set_location_id($this->unmarshal($this->db->f('location_id', true),
'int'));
$case->set_location_item_id($this->unmarshal($this->db->f('location_item_id',
true), 'int'));
$case->set_descr($this->unmarshal($this->db->f('descr', true), 'string'));
Modified: trunk/controller/inc/class.uicalendar.inc.php
===================================================================
--- trunk/controller/inc/class.uicalendar.inc.php 2012-04-18 10:46:44 UTC
(rev 9173)
+++ trunk/controller/inc/class.uicalendar.inc.php 2012-04-18 10:54:48 UTC
(rev 9174)
@@ -122,9 +122,6 @@
$controls_calendar_array =
$this->calendar_builder->build_calendar_array( $control_with_check_list_array,
$num_days_in_month, "view_days" );
- //print_r($controls_calendar_array);
-
-
foreach($controls_calendar_array as &$inst)
{
$curr_control = &$inst['control'];
Modified: trunk/controller/inc/class.uicase.inc.php
===================================================================
--- trunk/controller/inc/class.uicase.inc.php 2012-04-18 10:46:44 UTC (rev
9173)
+++ trunk/controller/inc/class.uicase.inc.php 2012-04-18 10:54:48 UTC (rev
9174)
@@ -103,6 +103,7 @@
$new_check_item->set_status(
controller_check_item_case::STATUS_OPEN );
else
$new_check_item->set_status(
controller_check_item_case::STATUS_CLOSED );
+
$new_check_item->set_comment( null );
$saved_check_item_id =
$this->so_check_item->store( $new_check_item );
@@ -266,7 +267,8 @@
$counter++;
}
- $location_id =
$GLOBALS['phpgw']->locations->get_id("controller", ".checklist");
+ // This value represents the type
+ $location_id =
$GLOBALS['phpgw']->locations->get_id("property", ".ticket");
$ticket = array
(
@@ -290,6 +292,7 @@
// Registers message and updates check items with
message ticket id
foreach($case_ids as $case_id){
$case = $this->so->get_single($case_id);
+ $case->set_location_id($location_id);
$case->set_location_item_id($message_ticket_id);
$this->so->store($case);
}
@@ -316,7 +319,7 @@
$botts = CreateObject('property.botts',true);
$message_ticket =
$botts->read_single($message_ticket_id);
-
+ print_r($message_ticket);
$catsObj = CreateObject('phpgwapi.categories', -1,
'property', '.ticket');
$catsObj->supress_info = true;
@@ -324,6 +327,8 @@
$data = array
(
+ 'control'
=> $control->toArray(),
+ 'message_ticket_id'
=> $message_ticket_id,
'message_ticket'
=> $message_ticket,
'category'
=> $category[0]['name'],
'location_array'
=> $location_array,
@@ -345,24 +350,30 @@
public function updateStatusForCases($location_id,
$location_item_id, $updateStatus = 0){
+ _debug_array(array($location_id, $location_item_id));
+ die();
+
+
$cases_array = $this->so->get_cases_by_message(
$location_id, $location_item_id );
- // Updates status for cases related to message
- foreach($cases_array as $case){
- $case->set_status( $updateStatus );
- $this->so->update( $case );
+ if(!empty ( $cases_array ) ){
+ // Updates status for cases related to message
+ foreach($cases_array as $case){
+ $case->set_status( $updateStatus );
+ $this->so->update( $case );
+ }
+
+ $case = $cases_array[0];
+
+ $check_item_id = $case->get_check_item_id();
+
+ $check_item = $this->so_check_item->get_single(
$check_item_id );
+ $check_list_id =
$check_item->get_check_list_id();
+
+ // Updates status for check list
+ $status_checker = new status_checker();
+ $status_checker->update_check_list_status(
$check_list_id );
}
-
- $case = $cases_array[0];
-
- $check_item_id = $case->get_check_item_id();
-
- $check_item = $this->so_check_item->get_single(
$check_item_id );
- $check_list_id = $check_item->get_check_list_id();
-
- // Updates status for check list
- $status_checker = new status_checker();
- $status_checker->update_check_list_status(
$check_list_id );
}
public function delete_case()
Modified: trunk/controller/inc/class.uitest.inc.php
===================================================================
--- trunk/controller/inc/class.uitest.inc.php 2012-04-18 10:46:44 UTC (rev
9173)
+++ trunk/controller/inc/class.uitest.inc.php 2012-04-18 10:54:48 UTC (rev
9174)
@@ -28,7 +28,7 @@
* @version $Id: class.uicontrol.inc.php 8744 2012-01-31 18:38:02Z vator
$
*/
- phpgw::import_class('controller.socheck_list');
+ phpgw::import_class('controller.uicase');
include_class('controller', 'control', 'inc/model/');
include_class('controller', 'check_list', 'inc/model/');
@@ -43,16 +43,10 @@
public function index()
{
- $so_check_list =
CreateObject('controller.socheck_list');
+ $uicase = new controller_uicase();
- $location_code = "1101";
- $from_date_ts = "";
- $end_date_ts = "";
- $repeat_type = "";
+ $uicase->updateStatusForCases(506, 17230, 0);
- $control_check_list_array =
$so_check_list->get_check_lists_for_location($location_code, $from_date_ts,
$to_date_ts, $repeat_type);
-
- print_r( $control_check_list_array );
}
}
\ No newline at end of file
Modified: trunk/controller/js/controller/ajax.js
===================================================================
--- trunk/controller/js/controller/ajax.js 2012-04-18 10:46:44 UTC (rev
9173)
+++ trunk/controller/js/controller/ajax.js 2012-04-18 10:54:48 UTC (rev
9174)
@@ -1,6 +1,6 @@
$(document).ready(function(){
- // file: uicalendar.xsl
+ //
$("#choose_my_location").change(function () {
var location_code = $(this).val();
var thisForm = $(this).parents("form");
@@ -56,7 +56,6 @@
});
//update part of town category based on district
- //file:
$("#district_id").change(function () {
var district_id = $(this).val();
var oArgs =
{menuaction:'controller.uicontrol_location.get_district_part_of_town'};
@@ -334,7 +333,8 @@
var $required_input_fields = $(this).find(".required");
var status = true;
-
+
+ // Checking that required fields (fields with class required)
is not null
$required_input_fields.each(function() {
if($(this).val() == ''){
@@ -552,7 +552,62 @@
$(submitBnt).removeClass("not_active");
});
+ //============================= MESSAGE ===========================
+ // REGISTER MESSAGE
+ $("#frmRegCaseMessage").submit(function(e){
+
+ var thisForm = $(this);
+
+ var $required_input_fields = $(this).find(".required");
+ var status = true;
+
+ // Checking that required fields (fields with class required)
is not null
+ $required_input_fields.each(function() {
+
+ // User has selected a vlaue from select list
+ if( $(this).is("select") & $(this).val() == 0 ){
+ var nextElem = $(this).next();
+
+ if( !$(nextElem).hasClass("input_error_msg") )
+ $(this).after("<div
class='input_error_msg'>Vennligst velg fra listen</div>");
+
+ status = false;
+ }
+ // Input field is not empty
+ else if( $(this).is("input") & $(this).val() == '' ){
+ var nextElem = $(this).next();
+
+ if( !$(nextElem).hasClass("input_error_msg") )
+ $(this).after("<div
class='input_error_msg'>Vennligst fyll ut dette feltet</div>");
+
+ status = false;
+ }
+ else{
+ var nextElem = $(this).next();
+
+ if( $(nextElem).hasClass("input_error_msg") )
+ $(nextElem).remove();
+ }
+ });
+
+ if( $(thisForm).find('input[type=checkbox]:checked').length == 0){
+
+ if(
!$(thisForm).find("ul.cases").prev().hasClass("input_error_msg") )
+ $(thisForm).find("ul.cases").before("<div
class='input_error_msg'>Vennligst velg en sak som meldingen omfatter</div>");
+
+ status = false;
+ }
+
+ if( !status ){
+ e.preventDefault();
+ }
+
+ });
+
+
+
+
//============================= CASE ===========================
// REGISTER CASE
@@ -561,8 +616,9 @@
var thisForm = $(this);
var submitBnt = $(thisForm).find("input[type='submit']");
+ var type = $(thisForm).find("input[name='type']").val();
var requestUrl = $(thisForm).attr("action");
-
+
$.ajax({
type: 'POST',
url: requestUrl + "&" + $(thisForm).serialize(),
@@ -578,7 +634,11 @@
// Changes text on save button back
to original
window.setTimeout(function() {
-
$(submitBnt).val('Registrer sak');
+ if( type ==
"control_item_type_2")
+
$(submitBnt).val('Registrer måling');
+ else
+
$(submitBnt).val('Registrer sak');
+
$(submitBnt).addClass("not_active");
}, 1000);
}
@@ -651,7 +711,7 @@
return false;
});
- // Delete a case item from list
+ // DELETE CASE
$(".delete_case").live("click", function(){
var clickElem = $(this);
var clickRow = $(this).closest("li");
@@ -692,7 +752,7 @@
return false;
});
- // Closes a case
+ // CLOSE CASE
$("a.close_case").live("click", function(){
var clickElem = $(this);
var clickRow = $(this).closest("li");
@@ -733,7 +793,7 @@
return false;
});
- // Open case
+ // OPEN CASE
$("a.open_case").live("click", function(){
var clickElem = $(this);
var clickRow = $(this).closest("li");
@@ -774,6 +834,24 @@
return false;
});
+ /* ============================ PUTS BORDER AROUND DATE WHEN ITS
CLICKED ======================== */
+
+ $("#calendar_dates span").click(function(){
+ var thisSpan = $(this);
+
+ $("#calendar_dates span").css("border", "2px solid black");
+ $(thisSpan).css("border", "2px solid red");
+
+ var date = $(thisSpan).text();
+ var day = date.substring(0, date.indexOf("/"));
+ var month = date.substring(date.indexOf("/")+1,
date.indexOf("-"));
+ var year = date.substring(date.indexOf("-")+1, date.length);
+
+ var valid_save_date = year + "-" + month + "-" + day;
+
+ $("#deadline_date").val(valid_save_date);
+ });
+
$(".frm_save_check_item").live("click", function(e){
var thisForm = $(this);
var submitBnt = $(thisForm).find("input[type='submit']");
@@ -806,23 +884,20 @@
$(wrpElem).find(".help_text").fadeOut(300);
});
- /* ============================ PUTS BORDER AROUND DATE WHEN ITS
CLICKED ========================================== */
+ $(".frm_save_check_item").click(function(e){
+ var thisForm = $(this);
+ var submitBnt = $(thisForm).find("input[type='submit']");
+
+ $(submitBnt).removeClass("not_active");
+ });
- $("#calendar_dates span").click(function(){
- var thisSpan = $(this);
+ $(".frm_save_control_item").click(function(e){
+ var thisForm = $(this);
+ var submitBnt = $(thisForm).find("input[type='submit']");
- $("#calendar_dates span").css("border", "2px solid black");
- $(thisSpan).css("border", "2px solid red");
+ $(submitBnt).removeClass("not_active");
+ });
- var date = $(thisSpan).text();
- var day = date.substring(0, date.indexOf("/"));
- var month = date.substring(date.indexOf("/")+1,
date.indexOf("-"));
- var year = date.substring(date.indexOf("-")+1, date.length);
-
- var valid_save_date = year + "-" + month + "-" + day;
-
- $("#deadline_date").val(valid_save_date);
- });
});
Modified: trunk/controller/js/controller/custom_ui.js
===================================================================
--- trunk/controller/js/controller/custom_ui.js 2012-04-18 10:46:44 UTC (rev
9173)
+++ trunk/controller/js/controller/custom_ui.js 2012-04-18 10:54:48 UTC (rev
9174)
@@ -42,6 +42,7 @@
/*
==============================================================================
*/
+
if( $("#frm_control_items").length > 0 ){
var check_box_arr =
$("#frm_control_items").find("input[type='checkbox']");
@@ -73,18 +74,4 @@
$("#frm_control_items").prepend("<input type='hidden'
id=hid_" + control_item_id + " name='control_tag_ids[]' value=" +
control_group_id + ":" + control_item_id + " />");
}
});
-
- $(".frm_save_check_item").click(function(e){
- var thisForm = $(this);
- var submitBnt = $(thisForm).find("input[type='submit']");
-
- $(submitBnt).removeClass("not_active");
- });
-
- $(".frm_save_control_item").click(function(e){
- var thisForm = $(this);
- var submitBnt = $(thisForm).find("input[type='submit']");
-
- $(submitBnt).removeClass("not_active");
- });
});
\ No newline at end of file
Modified: trunk/controller/templates/base/calendar/view_calendar_month.xsl
===================================================================
--- trunk/controller/templates/base/calendar/view_calendar_month.xsl
2012-04-18 10:46:44 UTC (rev 9173)
+++ trunk/controller/templates/base/calendar/view_calendar_month.xsl
2012-04-18 10:54:48 UTC (rev 9174)
@@ -106,6 +106,7 @@
<li class="heading">
<div class="id">ID</div>
<div class="title">Tittel</div>
+ <div class="assigned">Tildelt</div>
<div class="date">Startdato</div>
<div class="date">Sluttdato</div>
<div
class="frequency">Frekvenstype</div>
@@ -121,6 +122,9 @@
<div class="title">
<xsl:value-of
select="control/title"/>
</div>
+ <div class="assigned">
+ <xsl:value-of
select="control/responsibility_name"/>
+ </div>
<div class="date">
<xsl:value-of
select="php:function('date', $date_format, number(control/start_date))"/>
</div>
Modified: trunk/controller/templates/base/calendar/view_calendar_year.xsl
===================================================================
--- trunk/controller/templates/base/calendar/view_calendar_year.xsl
2012-04-18 10:46:44 UTC (rev 9173)
+++ trunk/controller/templates/base/calendar/view_calendar_year.xsl
2012-04-18 10:54:48 UTC (rev 9174)
@@ -65,7 +65,7 @@
<ul class="calendar">
<li class="heading">
<xsl:if test="show_location">
- <div class="location">Lokasjon</div>
+ <div
class="location">Lokasjon</div>
</xsl:if>
<div class="title">Tittel</div>
<div class="assigned">Tildelt</div>
Modified: trunk/controller/templates/base/case/create_case_message.xsl
===================================================================
--- trunk/controller/templates/base/case/create_case_message.xsl
2012-04-18 10:46:44 UTC (rev 9173)
+++ trunk/controller/templates/base/case/create_case_message.xsl
2012-04-18 10:54:48 UTC (rev 9174)
@@ -23,13 +23,19 @@
<xsl:value-of
select="check_list/id"/>
</xsl:attribute>
</input>
+
+ <!-- === TITLE === -->
+ <div class="row">
+ <label>Tittel på
melding:</label>
+ <input name="message_title"
type="text" class="required" />
+ </div>
<!-- ================== BYGG
===================== -->
<div class="row">
<xsl:choose>
<xsl:when
test="buildings_array/child::node()">
<label>Bygg:</label>
- <select
id="building_id" name="building_id">
+ <select
id="building_id" name="building_id" class="required">
<option value="0">
Velg bygning
</option>
@@ -45,17 +51,11 @@
</xsl:otherwise>
</xsl:choose>
</div>
-
- <!-- === TITLE === -->
- <div class="row">
- <label>Tittel på
melding:</label>
- <input name="message_title"
type="text" />
- </div>
<!-- === CATEGORY === -->
<div class="row">
<label>Kategori:</label>
- <select name="message_cat_id">
+ <select name="message_cat_id"
class="required">
<option value="0">Velg
kategori</option>
<xsl:for-each
select="categories/cat_list">
<xsl:variable
name="cat_id"><xsl:value-of select="./cat_id"/></xsl:variable>
Modified: trunk/controller/templates/base/case/view_case_message.xsl
===================================================================
--- trunk/controller/templates/base/case/view_case_message.xsl 2012-04-18
10:46:44 UTC (rev 9173)
+++ trunk/controller/templates/base/case/view_case_message.xsl 2012-04-18
10:54:48 UTC (rev 9174)
@@ -13,30 +13,37 @@
<h3 class="box_header ext">Melding registrert</h3>
<div id="caseMessage" class="box ext">
- <!-- ================== BYGG ===================== -->
- <div class="row">
- <label>Bygg:</label> <xsl:value-of
select="location_array/loc1_name"/>
- </div>
-
+ <a id="showMessage">
+ <xsl:attribute name="href">
+
<xsl:text>index.php?menuaction=property.uitts.view</xsl:text>
+ <xsl:text>&id=</xsl:text>
+ <xsl:value-of
select="message_ticket_id"/>
+ </xsl:attribute>
+ Vis melding
+ </a>
- <!-- === TITLE === -->
- <div class="row">
- <label>Tittel på melding:</label>
- <xsl:value-of select="message_ticket/subject"/>
- </div>
- <!-- === CATEGORY === -->
- <div class="row">
- <label>Kategori</label><span><xsl:value-of
select="category"/></span>
- </div>
- <!-- === UPLOAD FILE === -->
- <div class="row">
- <label>Filvedlegg:</label>
- <xsl:for-each select="message_ticket/files">
- <li><xsl:value-of select="."/></li>
- </xsl:for-each>
- </div>
-
- <h3>Saker for meldingen</h3>
+ <!-- === BYGG === -->
+ <div class="row">
+ <label>Bygg:</label><span><xsl:value-of
select="location_array/loc1_name"/></span>
+ </div>
+
+ <!-- === TITLE === -->
+ <div class="row">
+ <label>Tittel på
melding:</label><span><xsl:value-of select="message_ticket/subject"/></span>
+ </div>
+ <!-- === CATEGORY === -->
+ <div class="row">
+ <label>Kategori</label><span><xsl:value-of
select="category"/></span>
+ </div>
+ <!-- === UPLOAD FILE === -->
+ <div class="row">
+ <label>Filvedlegg:</label>
+ <xsl:for-each
select="message_ticket/files">
+ <li><xsl:value-of
select="."/></li>
+ </xsl:for-each>
+ </div>
+
+ <h3>Meldingen inneholder disse sakene</h3>
<ul class="cases">
<xsl:for-each select="check_items_and_cases">
<xsl:choose>
Modified: trunk/controller/templates/base/check_list/register_case.xsl
===================================================================
--- trunk/controller/templates/base/check_list/register_case.xsl
2012-04-18 10:46:44 UTC (rev 9173)
+++ trunk/controller/templates/base/check_list/register_case.xsl
2012-04-18 10:54:48 UTC (rev 9174)
@@ -51,15 +51,15 @@
<input name="check_list_id"
type="hidden"><xsl:attribute name="value"><xsl:value-of
select="//check_list/id"/></xsl:attribute></input>
<input name="type" type="hidden"
value="control_item_type_2" />
-
<div>
+
<div class="row">
<label>Status</label>
<select name="status">
-
<option value="0"
SELECTED="SELECTED">Ikke utført</option>
-
<option value="1" >Utført</option>
+
<option value="0"
SELECTED="SELECTED">Åpen</option>
+
<option value="1" >Lukket</option>
<option value="2" >Venter på
tilbakemelding</option>
</select>
</div>
-
<div>
+
<div class="row">
<label class="comment">Registrer målingsverdi</label>
<input>
<xsl:attribute
name="name">measurement</xsl:attribute>
@@ -69,7 +69,7 @@
</xsl:attribute>
</input>
</div>
-
<div>
+
<div class="row">
<label class="comment">Beskrivelse av sak</label>
<textarea name="case_descr">
<xsl:value-of select="comment"/>
Modified: trunk/controller/templates/base/css/base.css
===================================================================
--- trunk/controller/templates/base/css/base.css 2012-04-18 10:46:44 UTC
(rev 9173)
+++ trunk/controller/templates/base/css/base.css 2012-04-18 10:54:48 UTC
(rev 9174)
@@ -1414,7 +1414,6 @@
.frm_register_case {
margin-bottom: 1em;
}
-
.frm_register_case input[type="text"]{
width: 170px;
}
@@ -1428,7 +1427,10 @@
margin-bottom: 1em;
width: 63%;
}
-
+.frm_register_case label {
+ display: inline-block;
+ width: 18%;
+}
a.view_check_list{
color: #FFFFFF;
display: block;
@@ -1440,6 +1442,12 @@
}
/* ================================ CASE MESSAGE =============================
*/
+#caseMessage a#showMessage {
+ float: right;
+ font-size: 17px;
+ font-weight: bold;
+ text-decoration: none;
+}
#caseMessage label {
width: 13%;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [9174],
Torstein <=