[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [8541]
From: |
Torstein |
Subject: |
[Fmsystem-commits] [8541] |
Date: |
Mon, 09 Jan 2012 12:11:43 +0000 |
Revision: 8541
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8541
Author: vator
Date: 2012-01-09 12:11:42 +0000 (Mon, 09 Jan 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/controller/inc/class.socontrol_item.inc.php
trunk/controller/inc/class.uicalendar.inc.php
trunk/controller/inc/class.uicase.inc.php
trunk/controller/inc/class.uicheck_list.inc.php
trunk/controller/inc/class.uicontrol.inc.php
trunk/controller/inc/class.uiprocedure.inc.php
trunk/controller/templates/base/case/create_case.xsl
trunk/controller/templates/base/check_list/register_errors.xsl
trunk/controller/templates/base/css/base.css
trunk/controller/templates/base/procedure/print_procedure.xsl
trunk/controller/templates/base/procedure/view_procedures_for_control.xsl
Modified: trunk/controller/inc/class.socontrol_item.inc.php
===================================================================
--- trunk/controller/inc/class.socontrol_item.inc.php 2012-01-09 12:06:08 UTC
(rev 8540)
+++ trunk/controller/inc/class.socontrol_item.inc.php 2012-01-09 12:11:42 UTC
(rev 8541)
@@ -308,7 +308,7 @@
return $results;
}
- function get_control_items_by_control_id($control_id,
$returnType = "object")
+ function get_control_items_by_control($control_id, $returnType
= "object")
{
$results = array();
@@ -327,12 +327,14 @@
if($returnType == "array")
$results[] = $control_item->toArray();
+ else
+ $results[] = $control_item;
}
return $results;
}
- function get_control_items_by_control_id_and_group($control_id,
$control_group_id)
+ function get_control_items_by_control_and_group($control_id,
$control_group_id)
{
$results = array();
Modified: trunk/controller/inc/class.uicalendar.inc.php
===================================================================
--- trunk/controller/inc/class.uicalendar.inc.php 2012-01-09 12:06:08 UTC
(rev 8540)
+++ trunk/controller/inc/class.uicalendar.inc.php 2012-01-09 12:11:42 UTC
(rev 8541)
@@ -234,7 +234,7 @@
foreach ($control_groups_array as $control_group)
{
$control_group_id = $control_group->get_id();
- $saved_control_items =
$this->so_control_item->get_control_items_by_control_id_and_group($control_id,
$control_group_id);
+ $saved_control_items =
$this->so_control_item->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);
}
@@ -289,7 +289,7 @@
$check_list_id = $this->so_check_list->store(
$new_check_list );
- $control_items_list =
$this->so_control_item->get_control_items_by_control_id($control_id);
+ $control_items_list =
$this->so_control_item->get_control_items_by_control($control_id);
foreach($control_items_list as $control_item){
@@ -332,7 +332,7 @@
$check_list_id = $this->so_check_list->store(
$new_check_list );
- $control_items_list =
$this->so_control_item->get_control_items_by_control_id($control_id);
+ $control_items_list =
$this->so_control_item->get_control_items_by_control($control_id);
foreach($control_items_list as $control_item){
Modified: trunk/controller/inc/class.uicase.inc.php
===================================================================
--- trunk/controller/inc/class.uicase.inc.php 2012-01-09 12:06:08 UTC (rev
8540)
+++ trunk/controller/inc/class.uicase.inc.php 2012-01-09 12:11:42 UTC (rev
8541)
@@ -35,7 +35,7 @@
include_class('controller', 'check_list', 'inc/model/');
include_class('controller', 'date_generator', 'inc/component/');
- class controller_uierror_report_message extends controller_uicommon
+ class controller_uicase extends controller_uicommon
{
private $so_control_area;
private $so_control;
@@ -73,8 +73,13 @@
$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"];
-
+ $location_code =
$check_list_with_check_items["location_code"];
+
+ $level = count(explode('-',location_code));
+
+ if($level == 1)
+ $buildings_array =
execMethod('property.solocation.get_children',$location_code);
+
$date_format =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
$location_array =
execMethod('property.bolocation.read_single', array('location_code' =>
$location_code));
@@ -87,12 +92,18 @@
$data = array
(
'categories' => $categories,
- 'location_array' =>
$location_array,
'control_array' =>
$control->toArray(),
'check_list' =>
$check_list_with_check_items,
+ 'buildings_array' =>
$buildings_array,
'date_format' => $date_format
);
+ if(count( $buildings_array ) > 0){
+ $data['buildings_array'] = $buildings_array;
+ }else{
+ $data['building_array'] = $building_array;
+ }
+
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');
@@ -100,7 +111,7 @@
$GLOBALS['phpgw']->css->add_external_file('controller/templates/base/css/jquery-ui.custom.css');
- self::render_template_xsl('create_case', $data);
+ self::render_template_xsl('case/create_case', $data);
}
function save_case(){
@@ -152,7 +163,7 @@
$this->so_check_item->update($check_item);
}
- $registered_message_check_items =
$this->so_check_item->get_check_items_by_message($message_ticket_id);
+ $registered_message_check_items =
$this->so_check_item->get_check_items_by_message($message_ticket_id);
$message_ticket =
$botts->read_single($message_ticket_id);
@@ -179,7 +190,7 @@
$GLOBALS['phpgw']->css->add_external_file('controller/templates/base/css/jquery-ui.custom.css');
- self::render_template_xsl('view_case', $data);
+ self::render_template_xsl('case/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 12:06:08 UTC
(rev 8540)
+++ trunk/controller/inc/class.uicheck_list.inc.php 2012-01-09 12:11:42 UTC
(rev 8541)
@@ -283,7 +283,7 @@
//Populating array with saved control items for each
group
foreach ($control_groups as $control_group)
{
- $saved_control_items =
$this->so_control_item->get_control_items_by_control_id_and_group($control->get_id(),
$control_group->get_id());
+ $saved_control_items =
$this->so_control_item->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);
@@ -346,7 +346,7 @@
//Populating array with saved control items for each
group
foreach ($control_groups as $control_group)
{
- $saved_control_items =
$this->so_control_item->get_control_items_by_control_id_and_group($control->get_id(),
$control_group->get_id());
+ $saved_control_items =
$this->so_control_item->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);
@@ -366,48 +366,15 @@
$check_list_id = phpgw::get_var('check_list_id');
$check_list =
$this->so_check_list->get_single($check_list_id);
-
- // Fetches with check items
- $open_check_items =
$this->so_check_item->get_check_items($check_list_id, 'open',
'control_item_type_1');
-
- // Fetches check list with check items
- $handled_check_items =
$this->so_check_item->get_check_items($check_list_id, 'handled',
'control_item_type_1');
-
+
$location_code = $check_list->get_location_code();
// Fetches all control items for check list
- $control_items_for_check_list =
$this->so_control_item->get_control_items_by_control_id($check_list->get_control_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');
-
- // Puts ids for control items that is registered as
open check item in an array
- $control_item_ids = array();
- foreach($open_check_items as $check_item){
- $control_item_ids[] =
$check_item["control_item_id"];
- }
-
- // Puts ids for control items that is registered as
handled check item in an array
- foreach($handled_check_items as $check_item){
- $control_item_ids[] =
$check_item["control_item_id"];
- }
-
- // Puts ids for control items that is registered check
item measurements in an array
- foreach($measurement_check_items as $check_item){
- $control_item_ids[] =
$check_item["control_item_id"];
- }
-
- // Puts control items not registered as check item in
an array
- $control_items_not_registered = array();
- foreach($control_items_for_check_list as $control_item){
- if( !in_array($control_item->get_id(),
$control_item_ids) ){
- $control_items_not_registered[] =
$control_item->toArray();
- }
- }
+ $control_items_for_check_list =
$this->so_control_item->get_control_items_by_control($check_list->get_control_id(),
"array");
$data = array
(
- 'control_items_not_registered' =>
$control_items_not_registered,
+ 'control_items_for_check_list' =>
$control_items_for_check_list,
'check_list' => $check_list->toArray()
);
@@ -496,7 +463,7 @@
foreach ($control_groups_array as $control_group)
{
$control_group_id = $control_group->get_id();
- $saved_control_items =
$this->so_control_item->get_control_items_by_control_id_and_group($control_id,
$control_group_id);
+ $saved_control_items =
$this->so_control_item->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);
}
@@ -599,7 +566,7 @@
$check_list_id = $this->so_check_list->store(
$new_check_list );
- $control_items_list =
$this->so_control_item->get_control_items_by_control_id($control_id);
+ $control_items_list =
$this->so_control_item->get_control_items_by_control($control_id);
foreach($control_items_list as $control_item){
@@ -642,7 +609,7 @@
$check_list_id = $this->so_check_list->store(
$new_check_list );
- $control_items_list =
$this->so_control_item->get_control_items_by_control_id($control_id);
+ $control_items_list =
$this->so_control_item->get_control_items_by_control($control_id);
foreach($control_items_list as $control_item){
Modified: trunk/controller/inc/class.uicontrol.inc.php
===================================================================
--- trunk/controller/inc/class.uicontrol.inc.php 2012-01-09 12:06:08 UTC
(rev 8540)
+++ trunk/controller/inc/class.uicontrol.inc.php 2012-01-09 12:11:42 UTC
(rev 8541)
@@ -420,7 +420,7 @@
$control_group_ids =
phpgw::get_var('control_group_ids');
// Fetches saved control items from db
- $saved_control_items =
$this->so_control_item->get_control_items_by_control_id($control_id);
+ $saved_control_items =
$this->so_control_item->get_control_items_by_control($control_id);
$saved_control_item_ids = array();
foreach($saved_control_items as $control_item){
@@ -558,7 +558,7 @@
//Populating array with saved control items for each
group
foreach ($control_group_ids as $control_group_id)
{
- $saved_control_items =
$this->so_control_item->get_control_items_by_control_id_and_group($control_id,
$control_group_id);
+ $saved_control_items =
$this->so_control_item->get_control_items_by_control_and_group($control_id,
$control_group_id);
$control_group =
$this->so_control_group->get_single($control_group_id);
@@ -628,7 +628,7 @@
$check_list_id = $this->so_check_list->store(
$new_check_list );
- $control_items_list =
$this->so_control_item->get_control_items_by_control_id($control_id);
+ $control_items_list =
$this->so_control_item->get_control_items_by_control($control_id);
foreach($control_items_list as $control_item){
Modified: trunk/controller/inc/class.uiprocedure.inc.php
===================================================================
--- trunk/controller/inc/class.uiprocedure.inc.php 2012-01-09 12:06:08 UTC
(rev 8540)
+++ trunk/controller/inc/class.uiprocedure.inc.php 2012-01-09 12:11:42 UTC
(rev 8541)
@@ -505,7 +505,7 @@
'group_procedures_array' =>
$group_procedures_array
);
-
self::render_template_xsl('procedure/view_procedures_for_control',
array('view_procedures_for_control' => $data));
+
self::render_template_xsl('procedure/view_procedures_for_control', $data);
}
public function print_procedure(){
@@ -518,7 +518,7 @@
'procedure' =>
$procedure->toArray()
);
- self::render_template_xsl('procedure/print_procedure',
array('print_procedure' => $data));
+ self::render_template_xsl('procedure/print_procedure',
$data);
}
public function query()
Modified: trunk/controller/templates/base/case/create_case.xsl
===================================================================
--- trunk/controller/templates/base/case/create_case.xsl 2012-01-09
12:06:08 UTC (rev 8540)
+++ trunk/controller/templates/base/case/create_case.xsl 2012-01-09
12:11:42 UTC (rev 8541)
@@ -5,10 +5,8 @@
<div id="main_content">
<h1>Registrer avviksmelding</h1>
-
- <div class="tab_menu">
- <a class="active" href="#">Meldingen gjelder</a>
- </div>
+
+ <h3 class="box_header">Meldingen gjelder</h3>
<div id="case_details">
<h3 class="first">Tittel på kontroll: <xsl:value-of
select="control_array/title"/></h3>
<xsl:choose>
@@ -19,12 +17,27 @@
<h3>Kontroll ble utført dato: Ikke
registrert utført</h3>
</xsl:otherwise>
</xsl:choose>
- <h3 class="last">Bygg: <xsl:value-of
select="location_array/loc1_name"/></h3>
+ <xsl:choose>
+ <xsl:when test="buildings_array/child::node()">
+ <select id="building_id"
name="building_id">
+ <option value="0">
+ Velg bygning
+ </option>
+ <xsl:for-each
select="buildings_array">
+ <option
value="{id}">
+
<xsl:value-of disable-output-escaping="yes" select="name"/>
+ </option>
+ </xsl:for-each>
+ </select>
+ </xsl:when>
+ <xsl:otherwise>
+ <h3 class="last">Bygg: <xsl:value-of
select="building_array/loc1_name"/></h3>
+ </xsl:otherwise>
+ </xsl:choose>
+
</div>
- <div class="tab_menu">
- <a class="active" href="#">Detaljer for meldingen</a>
- </div>
+ <h3 class="box_header">Detaljer for meldingen</h3>
<fieldset id="case_details">
<xsl:choose>
<xsl:when
test="check_list/check_item_array/child::node()">
@@ -75,7 +88,7 @@
<div class="form-buttons">
<xsl:variable
name="lang_save"><xsl:value-of select="php:function('lang', 'save')"
/></xsl:variable>
- <input class="btn"
type="submit" name="save_control" value="Registrer avviksmelding"
title="{$lang_save}" />
+ <input class="btn focus"
type="submit" name="save_control" value="Registrer avviksmelding"
title="{$lang_save}" />
</div>
</form>
</xsl:when>
Modified: trunk/controller/templates/base/check_list/register_errors.xsl
===================================================================
--- trunk/controller/templates/base/check_list/register_errors.xsl
2012-01-09 12:06:08 UTC (rev 8540)
+++ trunk/controller/templates/base/check_list/register_errors.xsl
2012-01-09 12:11:42 UTC (rev 8541)
@@ -28,10 +28,10 @@
<div class="tab_item active">
<xsl:choose>
- <xsl:when
test="control_items_not_registered/child::node()">
+ <xsl:when
test="control_items_for_check_list/child::node()">
<ul id="control_items_list"
class="check_items expand_list">
- <xsl:for-each
select="control_items_not_registered">
+ <xsl:for-each
select="control_items_for_check_list">
<li>
<h4><img
src="controller/images/arrow_right.png" width="14"/><span><xsl:value-of
select="title"/></span></h4>
<form
class="frm_save_control_item"
action="index.php?menuaction=controller.uicheck_list.add_check_item_to_list"
method="post">
Modified: trunk/controller/templates/base/css/base.css
===================================================================
--- trunk/controller/templates/base/css/base.css 2012-01-09 12:06:08 UTC
(rev 8540)
+++ trunk/controller/templates/base/css/base.css 2012-01-09 12:11:42 UTC
(rev 8541)
@@ -1111,28 +1111,28 @@
position:absolute;
z-index: 1;
}
-#main_content #error_report_message_details {
+#main_content #case_details {
background: none repeat scroll 0 0 #EDF5FF;
border: 1px solid #DDDDDD;
margin-bottom: 20px;
padding: 15px;
width: 800px;
}
-#error_report_message_details label{
+#case_details label{
display: inline-block;
width: 130px;
font-weight: normal;
font-size: 15px;
}
-#error_report_message_details h3 {
+#case_details h3 {
font-size: 15px;
font-weight: normal;
margin: 10px 0;
}
-#error_report_message_details h3.first {
+#case_details h3.first {
margin-top:0;
}
-#error_report_message_details h3.last {
+#case_details h3.last {
margin-bottom:0;
}
.btn{
@@ -1146,10 +1146,12 @@
cursor: pointer;
}
-.focus{
+.btn.focus{
background: none repeat scroll 0 0 #DD624B;
border-bottom: 1px solid #CB563F;
border-top: 1px solid #EE836F;
+ border-left:0;
+ border-right:0;
box-shadow: 0 1px 0 #A9422E, 0 -1px 0 #A9422E;
color: #FFFFFF;
margin-top: 1px;
@@ -1195,4 +1197,18 @@
margin-bottom: 20px;
padding: 15px;
width: 800px;
+}
+
+.box_header {
+ background: none repeat scroll 0 0 #2647A0;
+ border-left: 1px solid #173073;
+ border-right: 1px solid #173073;
+ border-top: 1px solid #173073;
+ color: #FFFFFF;
+ font-size: 13px;
+ font-weight: normal;
+ margin: 0;
+ padding: 3px 0 3px 15px;
+ text-align: left;
+ width: 815px;
}
\ No newline at end of file
Modified: trunk/controller/templates/base/procedure/print_procedure.xsl
===================================================================
--- trunk/controller/templates/base/procedure/print_procedure.xsl
2012-01-09 12:06:08 UTC (rev 8540)
+++ trunk/controller/templates/base/procedure/print_procedure.xsl
2012-01-09 12:11:42 UTC (rev 8541)
@@ -1,7 +1,7 @@
<!-- $Id: procedure_item.xsl 8503 2012-01-06 08:13:27Z erikhl $ -->
<!-- item -->
-<xsl:template match="print_procedure" xmlns:php="http://php.net/xsl">
+<xsl:template match="data" xmlns:php="http://php.net/xsl">
<xsl:variable name="dateformat"><xsl:value-of select="dateformat"
/></xsl:variable>
<div style="margin:40px 0 0 40px;">
Modified:
trunk/controller/templates/base/procedure/view_procedures_for_control.xsl
===================================================================
--- trunk/controller/templates/base/procedure/view_procedures_for_control.xsl
2012-01-09 12:06:08 UTC (rev 8540)
+++ trunk/controller/templates/base/procedure/view_procedures_for_control.xsl
2012-01-09 12:11:42 UTC (rev 8541)
@@ -1,6 +1,6 @@
<!-- $Id: procedure_item.xsl 8485 2012-01-05 08:21:03Z erikhl $ -->
-<xsl:template match="view_procedures_for_control">
+<xsl:template match="data">
<h3 style="margin:5px 0;">Prosedyre for kontroll</h3>
<span>Tittel: </span><xsl:value-of select="control_procedure/title"/>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [8541],
Torstein <=