[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [8553]
From: |
Torstein |
Subject: |
[Fmsystem-commits] [8553] |
Date: |
Tue, 10 Jan 2012 15:02:14 +0000 |
Revision: 8553
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8553
Author: vator
Date: 2012-01-10 15:02:13 +0000 (Tue, 10 Jan 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/controller/inc/class.socheck_item.inc.php
trunk/controller/inc/class.uicase.inc.php
trunk/controller/inc/class.uicheck_list.inc.php
trunk/controller/js/controller/ajax.js
trunk/controller/templates/base/case/create_case_message.xsl
trunk/controller/templates/base/case/view_case_message.xsl
trunk/controller/templates/base/check_list/cases_tab_menu.xsl
trunk/controller/templates/base/check_list/register_case.xsl
trunk/controller/templates/base/check_list/view_closed_cases.xsl
trunk/controller/templates/base/check_list/view_errors_for_check_list.xsl
trunk/controller/templates/base/check_list/view_measurements.xsl
trunk/controller/templates/base/check_list/view_open_cases.xsl
trunk/controller/templates/base/css/base.css
Modified: trunk/controller/inc/class.socheck_item.inc.php
===================================================================
--- trunk/controller/inc/class.socheck_item.inc.php 2012-01-10 11:32:56 UTC
(rev 8552)
+++ trunk/controller/inc/class.socheck_item.inc.php 2012-01-10 15:02:13 UTC
(rev 8553)
@@ -213,7 +213,7 @@
return $check_items_array;
}
- public function get_check_items_and_cases($check_list_id,
$status = "open", $returnType = "object"){
+ public function get_check_items_and_cases($check_list_id,
$status = "open", $messageStatus = null, $returnType = "return_object"){
$sql = "SELECT ci.id as ci_id, ci.status,
control_item_id, ci.comment, ci.measurement, check_list_id, cic.id as cic_id,
cic.*, ";
$sql .= "coi.id as coi_id, coi.* ";
$sql .= "FROM controller_check_item ci ";
@@ -225,6 +225,11 @@
$sql .= "AND cic.status = 0 ";
else if($status == 'closed')
$sql .= "AND cic.status = 1 ";
+
+ if($messageStatus != null & $messageStatus ==
'no_message_registered')
+ $sql .= "AND cic.location_item_id IS NULL ";
+ else if($messageStatus != null & $messageStatus ==
'message_registered')
+ $sql .= "AND cic.location_item_id > 0 ";
$this->db->query($sql);
@@ -237,7 +242,7 @@
if($check_item_id != 0){
$check_item->set_cases_array($cases_array);
- if($returnType == "array")
+ if($returnType ==
"return_array")
$check_items_array[] =
$check_item->toArray();
else
$check_items_array[] =
$check_item;
@@ -275,7 +280,7 @@
$case->set_modified_by($this->unmarshal($this->db->f('modified_by', true),
'int'));
- if($returnType == "array")
+ if($returnType == "return_array")
$cases_array[] =
$case->toArray();
else
$cases_array[] = $case;
@@ -287,7 +292,7 @@
if($check_item != null){
$check_item->set_cases_array($cases_array);
- if($returnType == "array")
+ if($returnType == "return_array")
$check_items_array[] =
$check_item->toArray();
else
$check_items_array[] = $check_item;
Modified: trunk/controller/inc/class.uicase.inc.php
===================================================================
--- trunk/controller/inc/class.uicase.inc.php 2012-01-10 11:32:56 UTC (rev
8552)
+++ trunk/controller/inc/class.uicase.inc.php 2012-01-10 15:02:13 UTC (rev
8553)
@@ -63,6 +63,7 @@
function register_case(){
$check_list_id = phpgw::get_var('check_list_id');
$control_item_id = phpgw::get_var('control_item_id');
+ $case_descr = phpgw::get_var('case_descr');
$check_list =
$this->so_check_list->get_single($check_list_id);
@@ -79,20 +80,27 @@
$case = new controller_check_item_case();
$case->set_check_item_id( $check_item->get_id() );
$case->set_status($status);
+ $case->set_descr($case_descr);
$case->set_location_id($location_id);
$case->set_user_id($user_id);
$case->set_entry_date($todays_date);
$case->set_modified_date($todays_date);
$case->set_modified_by($user_id);
- return $this->so->store($case);
+ $case_id = $this->so->store($case);
+
+ if($case_id > 0)
+ return json_encode( array( "saveStatus" =>
"saved" ) );
+ else
+ return json_encode( array( "saveStatus" =>
"not_saved" ) );
+
}
function create_case_message(){
$check_list_id = phpgw::get_var('check_list_id');
$check_list =
$this->so_check_list->get_single($check_list_id);
- $check_items_and_cases =
$this->so_check_item->get_check_items_and_cases($check_list_id, "array");
+ $check_items_and_cases =
$this->so_check_item->get_check_items_and_cases($check_list_id, "open",
"no_message_registered", "return_array");
$control_id = $check_list->get_control_id();
$control = $this->so_control->get_single( $control_id );
@@ -159,6 +167,7 @@
$location_array =
execMethod('property.bolocation.read_single', array('location_code' =>
$location_code));
$message_details = "Kontroll: " .
$control->get_title() . "\n\n";
+ //$message_details = "Kontrollområde: " .
$control->get_title() . "\n\n";
// Generates message details from comment field in
check item
foreach($case_ids as $case_id){
Modified: trunk/controller/inc/class.uicheck_list.inc.php
===================================================================
--- trunk/controller/inc/class.uicheck_list.inc.php 2012-01-10 11:32:56 UTC
(rev 8552)
+++ trunk/controller/inc/class.uicheck_list.inc.php 2012-01-10 15:02:13 UTC
(rev 8553)
@@ -386,7 +386,7 @@
$check_list =
$this->so_check_list->get_single($check_list_id);
- $open_check_items_and_cases =
$this->so_check_item->get_check_items_and_cases($check_list_id, 'open',
'array');
+ $open_check_items_and_cases =
$this->so_check_item->get_check_items_and_cases($check_list_id, 'open', null,
'return_array');
$data = array
(
@@ -394,7 +394,7 @@
'check_list'
=> $check_list->toArray()
);
- self::render_template_xsl('check_list/view_open_cases',
$data);
+ self::render_template_xsl(
array('check_list/cases_tab_menu', 'check_list/view_open_cases'), $data );
}
function view_closed_cases(){
@@ -402,7 +402,7 @@
$check_list =
$this->so_check_list->get_single($check_list_id);
- $closed_check_items_and_cases =
$this->so_check_item->get_check_items_and_cases($check_list_id, 'closed',
'array');
+ $closed_check_items_and_cases =
$this->so_check_item->get_check_items_and_cases($check_list_id, 'closed',
'return_array');
$data = array
(
@@ -410,7 +410,7 @@
'check_list'
=> $check_list->toArray()
);
-
self::render_template_xsl('check_list/view_closed_cases', $data);
+ self::render_template_xsl(
array('check_list/cases_tab_menu', 'check_list/view_closed_cases'), $data );
}
function view_measurements(){
@@ -427,7 +427,7 @@
'check_list' => $check_list->toArray()
);
-
self::render_template_xsl('check_list/view_measurements', $data);
+ self::render_template_xsl(
array('check_list/cases_tab_menu', 'check_list/view_measurements'), $data );
}
public function view_check_lists_for_control()
Modified: trunk/controller/js/controller/ajax.js
===================================================================
--- trunk/controller/js/controller/ajax.js 2012-01-10 11:32:56 UTC (rev
8552)
+++ trunk/controller/js/controller/ajax.js 2012-01-10 15:02:13 UTC (rev
8553)
@@ -298,13 +298,30 @@
if(data){
var obj = jQuery.parseJSON(data);
- if(obj.saveStatus == "updated"){
+ if(obj.saveStatus == "saved"){
var submitBnt =
$(thisForm).find("input[type='submit']");
$(submitBnt).val("Lagret");
+
+
$(thisForm).find(':input').each(function() {
+ switch(this.type) {
+ case 'password':
+ case 'select-multiple':
+ case 'select-one':
+ case 'text':
+ $(this).val('');
+ break;
+ case 'textarea':
+ $(this).val('');
+ break;
+ case 'checkbox':
+ case 'radio':
+ this.checked = false;
+ }
+ });
// Changes text on save button back
to original
window.setTimeout(function() {
- $(submitBnt).val('Lagre
sjekkpunkt');
+
$(submitBnt).val('Registrer sak');
$(submitBnt).addClass("not_active");
}, 1000);
}
Modified: trunk/controller/templates/base/case/create_case_message.xsl
===================================================================
--- trunk/controller/templates/base/case/create_case_message.xsl
2012-01-10 11:32:56 UTC (rev 8552)
+++ trunk/controller/templates/base/case/create_case_message.xsl
2012-01-10 15:02:13 UTC (rev 8553)
@@ -66,6 +66,11 @@
</xsl:for-each>
</select>
</div>
+
+ <div>
+ <label>Last opp filvedlegg til
meldingen:</label>
+ <input type="file" id="file"
name="file" />
+ </div>
<h3 class="check_item_details">Velg
sjekkpunkter som skal være med i avviksmelding</h3>
<ul class="check_items">
@@ -77,7 +82,7 @@
<ul>
<xsl:for-each select="cases_array">
<xsl:variable name="cases_id"><xsl:value-of
select="id"/></xsl:variable>
-
<li><xsl:number/>. <input type="checkbox" name="case_ids[]"
value="{$cases_id}" /><xsl:value-of select="descr"/></li>
+
<li style="list-style:none;"><input type="checkbox"
name="case_ids[]" value="{$cases_id}" /><xsl:value-of select="descr"/></li>
</xsl:for-each>
</ul>
</li>
Modified: trunk/controller/templates/base/case/view_case_message.xsl
===================================================================
--- trunk/controller/templates/base/case/view_case_message.xsl 2012-01-10
11:32:56 UTC (rev 8552)
+++ trunk/controller/templates/base/case/view_case_message.xsl 2012-01-10
15:02:13 UTC (rev 8553)
@@ -44,7 +44,7 @@
<ul>
<xsl:for-each select="cases_array">
<xsl:variable name="cases_id"><xsl:value-of select="id"/></xsl:variable>
-
<li><xsl:number/>. <input type="checkbox" name="case_ids[]"
value="{$cases_id}" /><xsl:value-of select="descr"/></li>
+
<li><xsl:value-of select="descr"/></li>
</xsl:for-each>
</ul>
</li>
Modified: trunk/controller/templates/base/check_list/cases_tab_menu.xsl
===================================================================
--- trunk/controller/templates/base/check_list/cases_tab_menu.xsl
2012-01-10 11:32:56 UTC (rev 8552)
+++ trunk/controller/templates/base/check_list/cases_tab_menu.xsl
2012-01-10 15:02:13 UTC (rev 8553)
@@ -1,6 +1,12 @@
-<xsl:template name="cases_tab_menu">
+<xsl:template name="cases_tab_menu" xmlns:php="http://php.net/xsl">
+
+<xsl:param name="active_tab" />
+
<div class="tab_menu">
- <a id="view_open_errors">
+ <a id="view_open_cases">
+ <xsl:if test="$active_tab = 'view_open_cases'">
+ <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>&check_list_id=</xsl:text>
@@ -9,7 +15,10 @@
</xsl:attribute>
Vis åpne saker
</a>
- <a class="active" id="view_closed_errors">
+ <a id="view_closed_cases">
+ <xsl:if test="$active_tab = 'view_closed_cases'">
+ <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>&check_list_id=</xsl:text>
@@ -18,7 +27,10 @@
</xsl:attribute>
Vis lukkede saker
</a>
- <a id="view_measurements">
+ <a id="view_measurements">
+ <xsl:if test="$active_tab = 'view_measurements'">
+ <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>&check_list_id=</xsl:text>
Modified: trunk/controller/templates/base/check_list/register_case.xsl
===================================================================
--- trunk/controller/templates/base/check_list/register_case.xsl
2012-01-10 11:32:56 UTC (rev 8552)
+++ trunk/controller/templates/base/check_list/register_case.xsl
2012-01-10 15:02:13 UTC (rev 8553)
@@ -3,9 +3,9 @@
<xsl:template match="data" xmlns:php="http://php.net/xsl">
<div id="error_message_menu">
- <a class="btn" id="view_open_errors">
+ <a class="btn" id="view_open_cases">
<xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicheck_list.view_open_errors</xsl:text>
+
<xsl:text>index.php?menuaction=controller.uicheck_list.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>
@@ -50,8 +50,8 @@
<div class="check_item">
<div>
-
<label class="comment">Kommentar</label>
-
<textarea name="comment">
+
<label class="comment">Beskrivelse av sak</label>
+
<textarea name="case_descr">
<xsl:value-of select="comment"/>
</textarea>
</div>
@@ -75,14 +75,14 @@
</input>
</div>
<div>
-
<label class="comment">Kommentar</label>
-
<textarea name="comment">
+
<label class="comment">Beskrivelse av sak</label>
+
<textarea name="case_descr">
<xsl:value-of select="comment"/>
</textarea>
</div>
<div class="form-buttons">
<xsl:variable name="lang_save"><xsl:value-of
select="php:function('lang', 'register_error')" /></xsl:variable>
-
<input type="submit" name="save_control" value="Registrer
avvik" class="not_active" title="{$lang_save}" />
+
<input type="submit" name="save_control" value="Registrer sak"
class="not_active" title="{$lang_save}" />
</div>
</div>
</xsl:when>
Modified: trunk/controller/templates/base/check_list/view_closed_cases.xsl
===================================================================
--- trunk/controller/templates/base/check_list/view_closed_cases.xsl
2012-01-10 11:32:56 UTC (rev 8552)
+++ trunk/controller/templates/base/check_list/view_closed_cases.xsl
2012-01-10 15:02:13 UTC (rev 8553)
@@ -24,35 +24,9 @@
<div id="view_errors">
- <div class="tab_menu">
- <a id="view_open_errors">
- <xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicheck_list.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>
- </xsl:attribute>
- Vis åpne saker
- </a>
- <a class="active" id="view_closed_errors">
- <xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicheck_list.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>
- </xsl:attribute>
- Vis lukkede saker
- </a>
- <a id="view_measurements">
- <xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicheck_list.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>
- </xsl:attribute>
- Vis målinger
- </a>
- </div>
+ <xsl:call-template name="cases_tab_menu">
+ <xsl:with-param
name="active_tab">view_closed_cases</xsl:with-param>
+ </xsl:call-template>
<div class="tab_item active">
<xsl:choose>
Modified:
trunk/controller/templates/base/check_list/view_errors_for_check_list.xsl
===================================================================
--- trunk/controller/templates/base/check_list/view_errors_for_check_list.xsl
2012-01-10 11:32:56 UTC (rev 8552)
+++ trunk/controller/templates/base/check_list/view_errors_for_check_list.xsl
2012-01-10 15:02:13 UTC (rev 8553)
@@ -14,7 +14,7 @@
// ====================== FUNKSJONALITET FOR LASTING AV TABS
===================
$(function() {
-
+
$("#register_case").live("click", function(){
var requestUrl = $(this).attr("href");
load_tab(requestUrl);
Modified: trunk/controller/templates/base/check_list/view_measurements.xsl
===================================================================
--- trunk/controller/templates/base/check_list/view_measurements.xsl
2012-01-10 11:32:56 UTC (rev 8552)
+++ trunk/controller/templates/base/check_list/view_measurements.xsl
2012-01-10 15:02:13 UTC (rev 8553)
@@ -24,35 +24,9 @@
<div id="view_errors">
- <div class="tab_menu">
- <a id="view_open_errors">
- <xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicheck_list.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>
- </xsl:attribute>
- Vis åpne saker
- </a>
- <a id="view_closed_errors">
- <xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicheck_list.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>
- </xsl:attribute>
- Vis lukkede saker
- </a>
- <a class="active" id="view_measurements">
- <xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicheck_list.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>
- </xsl:attribute>
- Vis målinger
- </a>
- </div>
+ <xsl:call-template name="cases_tab_menu">
+ <xsl:with-param
name="active_tab">view_measurements</xsl:with-param>
+ </xsl:call-template>
<div class="tab_item">
<xsl:choose>
Modified: trunk/controller/templates/base/check_list/view_open_cases.xsl
===================================================================
--- trunk/controller/templates/base/check_list/view_open_cases.xsl
2012-01-10 11:32:56 UTC (rev 8552)
+++ trunk/controller/templates/base/check_list/view_open_cases.xsl
2012-01-10 15:02:13 UTC (rev 8553)
@@ -24,39 +24,10 @@
<div id="view_errors">
+ <xsl:call-template name="cases_tab_menu">
+ <xsl:with-param
name="active_tab">view_open_cases</xsl:with-param>
+ </xsl:call-template>
- <xsl:include href="cases_tab_menu.xsl" />
-
- <div class="tab_menu">
- <a class="active" id="view_open_cases">
- <xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicheck_list.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>
- </xsl:attribute>
- Vis åpne saker
- </a>
- <a id="view_closed_cases">
- <xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicheck_list.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>
- </xsl:attribute>
- Vis lukkede saker
- </a>
- <a id="view_measurements">
- <xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicheck_list.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>
- </xsl:attribute>
- Vis målinger
- </a>
- </div>
-
<div class="tab_item active">
<xsl:choose>
<xsl:when
test="open_check_items_and_cases/child::node()">
@@ -72,8 +43,24 @@
<ul>
<xsl:for-each select="cases_array">
<xsl:variable name="cases_id"><xsl:value-of select="id"/></xsl:variable>
-
<li><xsl:number/>. <input type="checkbox" name="case_ids[]"
value="{$cases_id}" /><xsl:value-of select="descr"/>
-
<div><xsl:value-of select="location_item_id"/></div>
+
<li><xsl:value-of select="descr"/>
+
<xsl:choose>
+
<xsl:when test="location_item_id > 0">
+
<div style="float:right;">
+
<a>
+
<xsl:attribute name="href">
+
<xsl:text>index.php?menuaction=property.uitts.view</xsl:text>
+
<xsl:text>&id=</xsl:text>
+
<xsl:value-of
select="location_item_id"/>
+
</xsl:attribute>
+
Vis melding
+
</a>
+
</div>
+
</xsl:when>
+
<xsl:otherwise>
+
<div style="float:right;"><span style="color:red">Ingen
melding registrert!</span></div>
+
</xsl:otherwise>
+
</xsl:choose>
</li>
</xsl:for-each>
</ul>
Modified: trunk/controller/templates/base/css/base.css
===================================================================
--- trunk/controller/templates/base/css/base.css 2012-01-10 11:32:56 UTC
(rev 8552)
+++ trunk/controller/templates/base/css/base.css 2012-01-10 15:02:13 UTC
(rev 8553)
@@ -1218,6 +1218,7 @@
li.check_item_cases ul{
margin:10px;
}
-li.check_item_cases ul li{
- margin:5px 0;
+li.check_item_cases ul li {
+ list-style: disc outside none;
+ margin: 5px 0 0 20px;
}
\ No newline at end of file
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [8553],
Torstein <=