fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [8508]


From: Torstein
Subject: [Fmsystem-commits] [8508]
Date: Fri, 06 Jan 2012 13:30:09 +0000

Revision: 8508
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8508
Author:   vator
Date:     2012-01-06 13:30:08 +0000 (Fri, 06 Jan 2012)
Log Message:
-----------


Modified Paths:
--------------
    trunk/controller/inc/class.uicheck_list.inc.php
    trunk/controller/templates/base/check_list/edit_check_list.xsl
    trunk/controller/templates/base/css/base.css

Added Paths:
-----------
    trunk/controller/templates/base/check_list/register_errors.xsl
    trunk/controller/templates/base/check_list/view_closed_errors.xsl
    trunk/controller/templates/base/check_list/view_measurements.xsl
    trunk/controller/templates/base/check_list/view_open_errors.xsl

Modified: trunk/controller/inc/class.uicheck_list.inc.php
===================================================================
--- trunk/controller/inc/class.uicheck_list.inc.php     2012-01-06 10:49:07 UTC 
(rev 8507)
+++ trunk/controller/inc/class.uicheck_list.inc.php     2012-01-06 13:30:08 UTC 
(rev 8508)
@@ -60,7 +60,12 @@
                        'update_check_list'                                     
=>      true,
                        'view_control_items'                            =>      
true,
                        'view_control_details'                          =>      
true,
-                       'print_check_list'                                      
=>      true
+                       'print_check_list'                                      
=>      true,
+                       'register_errors'                                       
=>      true,
+                       'view_open_errors'                                      
=>      true,
+                       'view_closed_errors'                            =>      
true,
+                       'view_measurements'                                     
=>      true
+               
                );
 
                public function __construct()
@@ -420,7 +425,199 @@
                        
                echo $html; 
                }
+               
+               
+               function register_errors(){
+                       $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();
+                               }
+                       }
+
+                       $data = array
+                       (
+                               'control_items_not_registered'  => 
$control_items_not_registered,
+                               'check_list'    => $check_list->toArray()
+                       );
+                       
+                       $xslttemplate = CreateObject('phpgwapi.xslttemplates');
+                       
+            $xslttemplate->add_file(array(PHPGW_SERVER_ROOT . 
'/controller/templates/base/check_list/register_errors'));
+           
+            $xslttemplate->set_var('phpgw',array('register_errors' => $data));
+            
+            $xslttemplate->xsl_parse();
+               $xslttemplate->xml_parse();
+       
+               $xml = new DOMDocument;
+               $xml->loadXML($xslttemplate->xmldata);
+
+               $xsl = new DOMDocument;
+               $xsl->loadXML($xslttemplate->xsldata);
+               
+               // Configure the transformer
+               $proc = new XSLTProcessor;
+               $proc->importStyleSheet($xsl); // attach the xsl rules
+                       $proc->registerPHPFunctions();
+       
+               $html = $proc->transformToXML($xml);
+
+               echo $html;
+               }
+               
+               function view_open_errors(){
+                       $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');
+
+                       $data = array
+                       (
+                               'open_check_items'                              
=> $open_check_items,
+                               'check_list'    => $check_list->toArray()
+                       );
+                       
+                       $xslttemplate = CreateObject('phpgwapi.xslttemplates');
+                       
+            $xslttemplate->add_file(array(PHPGW_SERVER_ROOT . 
'/controller/templates/base/check_list/view_open_errors'));
+           
+            $xslttemplate->set_var('phpgw',array('view_open_errors' => $data));
+            
+            $xslttemplate->xsl_parse();
+               $xslttemplate->xml_parse();
+       
+               $xml = new DOMDocument;
+               $xml->loadXML($xslttemplate->xmldata);
+
+               $xsl = new DOMDocument;
+               $xsl->loadXML($xslttemplate->xsldata);
+               
+               // Configure the transformer
+               $proc = new XSLTProcessor;
+               $proc->importStyleSheet($xsl); // attach the xsl rules
+                       $proc->registerPHPFunctions();
+       
+               $html = $proc->transformToXML($xml);
+
+               echo $html;
+               }
+               
+               function view_closed_errors(){
+                       $check_list_id = phpgw::get_var('check_list_id');
+                       
+                       $check_list = 
$this->so_check_list->get_single($check_list_id);
+                       
+                       // Fetches check list with check items
+                       $handled_check_items = 
$this->so_check_item->get_check_items($check_list_id, 'handled', 
'control_item_type_1');
+                                                       
+                       $data = array
+                       (
+                               'handled_check_items'   => $handled_check_items,
+                               'check_list'    => $check_list->toArray()
+                       );
+                       
+                       $xslttemplate = CreateObject('phpgwapi.xslttemplates');
+                       
+            $xslttemplate->add_file(array(PHPGW_SERVER_ROOT . 
'/controller/templates/base/check_list/view_closed_errors'));
+           
+            $xslttemplate->set_var('phpgw',array('view_closed_errors' => 
$data));
+            
+            $xslttemplate->xsl_parse();
+               $xslttemplate->xml_parse();
+       
+               $xml = new DOMDocument;
+               $xml->loadXML($xslttemplate->xmldata);
+
+               $xsl = new DOMDocument;
+               $xsl->loadXML($xslttemplate->xsldata);
+               
+               // Configure the transformer
+               $proc = new XSLTProcessor;
+               $proc->importStyleSheet($xsl); // attach the xsl rules
+                       $proc->registerPHPFunctions();
+       
+               $html = $proc->transformToXML($xml);
+
+               echo $html;
+               }
+               
+               function view_measurements(){
+                       $check_list_id = phpgw::get_var('check_list_id');
+                       
+                       $check_list = 
$this->so_check_list->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');
+                                               
+                       $data = array
+                       (
+                               'measurement_check_items'               => 
$measurement_check_items,
+                               'check_list'    => $check_list->toArray()
+                       );
+                       
+                       $xslttemplate = CreateObject('phpgwapi.xslttemplates');
+                       
+            $xslttemplate->add_file(array(PHPGW_SERVER_ROOT . 
'/controller/templates/base/check_list/view_measurements'));
+           
+            $xslttemplate->set_var('phpgw',array('view_measurements' => 
$data));
+            
+            $xslttemplate->xsl_parse();
+               $xslttemplate->xml_parse();
+       
+               $xml = new DOMDocument;
+               $xml->loadXML($xslttemplate->xmldata);
+
+               $xsl = new DOMDocument;
+               $xsl->loadXML($xslttemplate->xsldata);
+               
+               // Configure the transformer
+               $proc = new XSLTProcessor;
+               $proc->importStyleSheet($xsl); // attach the xsl rules
+                       $proc->registerPHPFunctions();
+       
+               $html = $proc->transformToXML($xml);
+
+               echo $html;
+               }
+                               
                public function view_check_lists_for_control()
                {
                        $control_id = phpgw::get_var('id');

Modified: trunk/controller/templates/base/check_list/edit_check_list.xsl
===================================================================
--- trunk/controller/templates/base/check_list/edit_check_list.xsl      
2012-01-06 10:49:07 UTC (rev 8507)
+++ trunk/controller/templates/base/check_list/edit_check_list.xsl      
2012-01-06 13:30:08 UTC (rev 8508)
@@ -5,6 +5,12 @@
 <div id="main_content">
                
        <script>
+       
+               $(document).ready(function() {
+                               var requestUrl = 
$("#view_open_errors").attr("href");
+                               load_tab(requestUrl);
+                       });
+                       
                $(function() {
                        $( "#planned_date" ).datepicker({ 
                                monthNames: 
['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],
@@ -41,34 +47,45 @@
                        
                                return false;
                        });
+                       
+                       $("#register_errors").live("click", function(){
+                               var requestUrl = $(this).attr("href");
+                               load_tab(requestUrl);
+                       
+                               return false;
+                       });
                                                
-                       $("#reg_errors").click(function(){
-                               var thisA = $(this);
-                               var showId = $(thisA).attr("href");
-                               var hideId = "#view_errors";
-                                                                       
-                               $(hideId).hide();
-                               $(showId).fadeIn('10');
-                               $(thisA).hide();
-                               $("a#view_errors_measurements").css("display", 
"block");
+                       $("#view_open_errors").live("click", function(){
+                               var requestUrl = $(this).attr("href");
+                               load_tab(requestUrl);
                        
                                return false;
                        });
                        
-                       $("#view_errors_measurements").click(function(){
-                               var thisA = $(this);
-                               var showId = $(thisA).attr("href");
-                               var hideId = "#register_errors";
-                                                                       
-                               $(hideId).hide();
-                               $(showId).fadeIn('10');
-                               $(thisA).hide();
-                               $("a#reg_errors").css("display", "block");
+                       $("#view_closed_errors").live("click", function(){
+                               var requestUrl = $(this).attr("href");
+                               load_tab(requestUrl);
                        
                                return false;
                        });
                        
+                       $("#view_measurements").live("click", function(){
+                               var requestUrl = $(this).attr("href");
+                               load_tab(requestUrl);
+                       
+                               return false;
+                       });
                });
+
+               function load_tab(requestUrl){
+                       $.ajax({
+                                 type: 'POST',
+                                 url: requestUrl,
+                                 success: function(data) {
+                                       $("#load_view_content").html(data);
+                                 }
+                       });
+               }
        </script>
                
                <h1>Sjekkliste for <xsl:value-of 
select="location_array/loc1_name"/></h1>
@@ -92,7 +109,7 @@
                        <form id="frm_update_check_list" 
action="index.php?menuaction=controller.uicheck_list.update_check_list" 
method="post">
                                
                        <xsl:variable name="check_list_id"><xsl:value-of 
select="check_list/id"/></xsl:variable>
-                       <input type="hidden" name="check_list_id" 
value="{$check_list_id}" />
+                       <input id="check_list_id" type="hidden" 
name="check_list_id" value="{$check_list_id}" />
                                
                        <div>
                                <label>ID</label>
@@ -165,278 +182,14 @@
                        </form>
                </fieldset>
                
-               <div id="error_message_menu">
-                       <a class="btn">
-                               <xsl:attribute name="id">
-                                       <xsl:text>reg_errors</xsl:text>
-                               </xsl:attribute>                                
        
-                               <xsl:attribute name="href">
-                                       <xsl:text>#register_errors</xsl:text>
-                               </xsl:attribute>
-                               Registrer sak/måling
-                       </a>
-                       <a class="btn">
-                               <xsl:attribute name="id">
-                                       
<xsl:text>view_errors_measurements</xsl:text>
-                               </xsl:attribute>                                
        
-                               <xsl:attribute name="href">
-                                       <xsl:text>#view_errors</xsl:text>
-                               </xsl:attribute>
-                               Vis avvik/måling
-                       </a>
-                       <a class="btn">
-                               <xsl:attribute name="href">
-                                       
<xsl:text>index.php?menuaction=controller.uierror_report_message.create_error_report_message</xsl:text>
-                                       <xsl:text>&amp;check_list_id=</xsl:text>
-                                       <xsl:value-of select="check_list/id"/>
-                               </xsl:attribute>
-                               Registrer avviksmelding
-                       </a>
-               </div>
-               
-               <div id="register_errors">
-                       <div class="tab_menu"><a class="active">Registrer 
sak/måling</a></div>
-                                       
-                       <div class="tab_item active">
-                       
-                       <xsl:choose>
-                               <xsl:when 
test="control_items_not_registered/child::node()">
-                               
-                                       <ul id="control_items_list" 
class="check_items expand_list">
-                                               <xsl:for-each 
select="control_items_not_registered">
-                                                       <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">
-                                                                       
<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="check_list_id" type="hidden">
-                                                                     
<xsl:attribute name="value">
-                                                                       
<xsl:value-of select="//check_list/id"/>
-                                                                     
</xsl:attribute>
-                                                                   </input>
-                                                                   <input 
name="status" type="hidden" value="0" />
-                                                                     
-                                                               <xsl:choose>
-                                                                       
<xsl:when test="type = 'control_item_type_1'">
-                                                                               
<input name="type" type="hidden" value="control_item_type_1" />
-                                                                           
-                                                                               
<div class="check_item">
-                                                                              
<div>
-                                                                               
         <label class="comment">Kommentar</label>
-                                                                               
         <textarea name="comment">
-                                                                               
                        <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="{$lang_save}" 
class="not_active" title="{$lang_save}" />
-                                                                               
        </div>
-                                                                               
</div>
-                                                                       
</xsl:when>
-                                                                       
<xsl:when test="type = 'control_item_type_2'">
-                                                                               
<input name="type" type="hidden" value="control_item_type_2" />
-                                                                               
<div class="check_item">
-                                                                               
 <div>
-                                                                               
 <label class="comment">Registrer målingsverdi</label>
-                                                                               
   <input>
-                                                                               
              <xsl:attribute name="name">measurement</xsl:attribute>
-                                                                               
              <xsl:attribute name="type">text</xsl:attribute>
-                                                                               
              <xsl:attribute name="value">
-                                                                               
                <xsl:value-of select="measurement"/>
-                                                                               
              </xsl:attribute>
-                                                                               
            </input>
-                                                                              
</div>
-                                                                              
<div>
-                                                                               
         <label class="comment">Kommentar</label>
-                                                                               
         <textarea name="comment">
-                                                                               
                        <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}" />
-                                                                               
        </div>
-                                                                               
</div>
-                                                                       
</xsl:when>
-                                                               </xsl:choose>   
                                                                                
                        
-                                                                       
-                                                               </form>
-                                                   </li>
-                                               </xsl:for-each>
-                                       </ul>                   
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                               Alle sjekkpunkter for kontroll 
er registert som åpent/håndtert avvik eller måling 
-                                       </xsl:otherwise>
-                       </xsl:choose>
-               </div>
-               </div>
-               
-               <div id="view_errors">
-               
-               <div class="tab_menu">
-                       <a class="active" href="#view_open_errors">Vis åpne 
saker</a>
-                       <a href="#view_handled_errors">Vis lukkede saker</a>
-                       <a href="#view_measurements">Vis målinger</a>
-               </div>  
-               
-               <div id="view_open_errors" class="tab_item active">
-                       <xsl:choose>
-                               <xsl:when test="open_check_items/child::node()">
-                                       
-                               <div class="expand_menu"><div 
class="expand_all">Vis alle</div><div class="collapse_all focus">Skjul 
alle</div></div>
-                       
-                                       <ul id="check_list_not_fixed_list" 
class="check_items expand_list">
-                                               <xsl:for-each 
select="open_check_items">
-                                                               <li>
-                                                               <xsl:if 
test="status = 0">
-                                                                       
<h4><img src="controller/images/arrow_right.png" 
width="14"/><span><xsl:value-of select="control_item/title"/></span></h4>       
                                       
-                                                                       <form 
class="frm_save_check_item" 
action="index.php?menuaction=controller.uicheck_list.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}" /> 
-                                                                               
<div class="check_item">
-                                                                               
  <div>
-                                                                               
       <label>Status</label>
-                                                                               
       <select name="status">
-                                                                               
                <xsl:choose>
-                                                                               
                        <xsl:when test="status = 0">
-                                                                               
                                <option value="0" SELECTED="SELECTED">Avvik er 
åpent</option>
-                                                                               
                                <option value="1">Avvik er håndtert</option>
-                                                                               
                        </xsl:when>
-                                                                               
                        <xsl:when test="status = 1">
-                                                                               
                                <option value="0">Avvik er åpent</option>
-                                                                               
                                <option value="1" SELECTED="SELECTED">Avvik er 
håndtert</option>
-                                                                               
                        </xsl:when>
-                                                                               
                </xsl:choose>
-                                                                               
           </select>
-                                                                              
</div>
-                                                                              
<div>
-                                                                               
 <label class="comment">Kommentar</label>
-                                                                               
 <textarea name="comment">
-                                                                               
                <xsl:value-of select="comment"/>
-                                                                               
         </textarea>
-                                                                              
</div>
-                                                                              
<div class="form-buttons">
-                                                                               
                <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save_check_item')" /></xsl:variable>
-                                                                               
                <input style="width: 200px;" type="submit" name="save_control" 
value="Oppdater registrert avvik" class="not_active" title="{$lang_save}" />
-                                                                               
        </div>
-                                                                               
</div>
-                                                                       </form>
-                                                               </xsl:if>
-                                                   </li>
-                                               </xsl:for-each>
-                                       </ul>                   
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                               Ingen registrerte åpne avvik
-                                       </xsl:otherwise>
-                       </xsl:choose>
-               </div>
-               
-               <div id="view_handled_errors" class="tab_item"> 
-                       <xsl:choose>
-                               <xsl:when 
test="handled_check_items/child::node()">
-                                       
-                               <div class="expand_menu"><div 
class="expand_all">Vis alle</div><div class="collapse_all focus">Skjul 
alle</div></div>
-                                       
-                                       <ul id="check_list_fixed_list" 
class="check_items expand_list">
-                                               <xsl:for-each 
select="handled_check_items">
-                                                               <xsl:if 
test="status = 1">
-                                                               <li>
-                                                               <h4><img 
src="controller/images/arrow_right.png" width="14"/><span><xsl:value-of 
select="control_item/title"/></span></h4>                                       
       
-                                                                       <form 
class="frm_save_check_item" 
action="index.php?menuaction=controller.uicheck_list.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}" /> 
-                                                                               
<div class="check_item">
-                                                                               
  <div>
-                                                                               
       <label>Status</label>
-                                                                               
       <select name="status">
-                                                                               
                <xsl:choose>
-                                                                               
                        <xsl:when test="status = 0">
-                                                                               
                                <option value="0" SELECTED="SELECTED">Avvik er 
åpent</option>
-                                                                               
                                <option value="1">Avvik er håndtert</option>
-                                                                               
                        </xsl:when>
-                                                                               
                        <xsl:when test="status = 1">
-                                                                               
                                <option value="0">Avvik er åpent</option>
-                                                                               
                                <option value="1" SELECTED="SELECTED">Avvik er 
lukket</option>
-                                                                               
                        </xsl:when>
-                                                                               
                </xsl:choose>
-                                                                               
           </select>
-                                                                              
</div>
-                                                                              
<div>
-                                                                               
 <label class="comment">Kommentar</label>
-                                                                               
 <textarea name="comment">
-                                                                               
                <xsl:value-of select="comment"/>
-                                                                               
         </textarea>
-                                                                              
</div>
-                                                                              
<div class="form-buttons">
-                                                                               
                <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save_check_item')" /></xsl:variable>
-                                                                               
                <input type="submit" name="save_control" value="Oppdater 
håndtert avvik" class="not_active" title="{$lang_save}" />
-                                                                               
        </div>
-                                                                               
</div>
-                                                                       </form>
-                                                           </li>
-                                                       </xsl:if>
-                                               </xsl:for-each>
-                                       </ul>                   
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                               Ingen registrerte håndterte 
avvik
-                                       </xsl:otherwise>
-                       </xsl:choose>
-               </div>
-               
-               <div id="view_measurements" class="tab_item">
-                       <xsl:choose>
-                               <xsl:when 
test="measurement_check_items/child::node()">
-                                       
-                               <div class="expand_menu"><div 
class="expand_all">Vis alle</div><div class="collapse_all focus">Skjul 
alle</div></div>
-                       
-                                       <ul id="check_list_not_fixed_list" 
class="check_items expand_list">
-                                               <xsl:for-each 
select="measurement_check_items">
-                                                               <li>
-                                                               <xsl:if 
test="status = 0">
-                                                                       
<h4><img src="controller/images/arrow_right.png" 
width="14"/><span><xsl:value-of select="control_item/title"/></span></h4>       
                                       
-                                                                       <form 
class="frm_save_check_item" 
action="index.php?menuaction=controller.uicheck_list.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="measurement" />
-                                                                               
 
-                                                                               
<div class="check_item">
-                                                                               
  <div>
-                                                                               
       <label>Målingsverdi</label>
-                                                                               
       <input>
-                                                                               
              <xsl:attribute name="name">measurement</xsl:attribute>
-                                                                               
              <xsl:attribute name="type">text</xsl:attribute>
-                                                                               
              <xsl:attribute name="value">
-                                                                               
                <xsl:value-of select="measurement"/>
-                                                                               
              </xsl:attribute>
-                                                                               
            </input>
-                                                                              
</div>
-                                                                              
-                                                                              
<div>
-                                                                               
 <label class="comment">Kommentar</label>
-                                                                               
 <textarea name="comment">
-                                                                               
                <xsl:value-of select="comment"/>
-                                                                               
         </textarea>
-                                                                              
</div>
-                                                                              
<div class="form-buttons">
-                                                                               
                <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save_check_item')" /></xsl:variable>
-                                                                               
                <input type="submit" name="save_control" value="Oppdatert 
registert måling" class="not_active" title="{$lang_save}" />
-                                                                               
        </div>
-                                                                               
</div>
-                                                                       </form>
-                                                               </xsl:if>
-                                                   </li>
-                                               </xsl:for-each>
-                                       </ul>                   
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                               Ingen registrerte målinger
-                                       </xsl:otherwise>
-                       </xsl:choose>
-               </div>
-               
-       </div>
+               <a style="display:none;" id="view_open_errors">
+                       <xsl:attribute name="href">
+                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_open_errors</xsl:text>
+                               <xsl:text>&amp;check_list_id=</xsl:text>
+                               <xsl:value-of select="check_list/id"/>
+                       </xsl:attribute>
+               </a>
+       
+               <div id="load_view_content"></div>              
 </div>
 </xsl:template>

Added: trunk/controller/templates/base/check_list/register_errors.xsl
===================================================================
--- trunk/controller/templates/base/check_list/register_errors.xsl              
                (rev 0)
+++ trunk/controller/templates/base/check_list/register_errors.xsl      
2012-01-06 13:30:08 UTC (rev 8508)
@@ -0,0 +1,101 @@
+<!-- $Id: choose_control_items.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
+
+<xsl:template match="register_errors" xmlns:php="http://php.net/xsl";>
+
+<div id="error_message_menu">
+       <a class="btn" id="view_open_errors">                                   
+               <xsl:attribute name="href">
+                       
<xsl:text>index.php?menuaction=controller.uicheck_list.view_open_errors</xsl:text>
+                       <xsl:text>&amp;check_list_id=</xsl:text>
+                       <xsl:value-of select="check_list/id"/>
+               </xsl:attribute>
+               Vis avvik/måling
+       </a>
+       <a class="btn">
+               <xsl:attribute name="href">
+                       
<xsl:text>index.php?menuaction=controller.uierror_report_message.create_error_report_message</xsl:text>
+                       <xsl:text>&amp;check_list_id=</xsl:text>
+                       <xsl:value-of select="check_list/id"/>
+               </xsl:attribute>
+               Registrer avviksmelding
+       </a>
+</div>
+
+<div id="register_errors_content">
+                       <div class="tab_menu"><a class="active">Registrer 
sak/måling</a></div>
+                                       
+                       <div class="tab_item active">
+                       
+                       <xsl:choose>
+                               <xsl:when 
test="control_items_not_registered/child::node()">
+                               
+                                       <ul id="control_items_list" 
class="check_items expand_list">
+                                               <xsl:for-each 
select="control_items_not_registered">
+                                                       <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">
+                                                                       
<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="check_list_id" type="hidden">
+                                                                     
<xsl:attribute name="value">
+                                                                       
<xsl:value-of select="//check_list/id"/>
+                                                                     
</xsl:attribute>
+                                                                   </input>
+                                                                   <input 
name="status" type="hidden" value="0" />
+                                                                     
+                                                               <xsl:choose>
+                                                                       
<xsl:when test="type = 'control_item_type_1'">
+                                                                               
<input name="type" type="hidden" value="control_item_type_1" />
+                                                                           
+                                                                               
<div class="check_item">
+                                                                              
<div>
+                                                                               
         <label class="comment">Kommentar</label>
+                                                                               
         <textarea name="comment">
+                                                                               
                        <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="{$lang_save}" 
class="not_active" title="{$lang_save}" />
+                                                                               
        </div>
+                                                                               
</div>
+                                                                       
</xsl:when>
+                                                                       
<xsl:when test="type = 'control_item_type_2'">
+                                                                               
<input name="type" type="hidden" value="control_item_type_2" />
+                                                                               
<div class="check_item">
+                                                                               
 <div>
+                                                                               
 <label class="comment">Registrer målingsverdi</label>
+                                                                               
   <input>
+                                                                               
              <xsl:attribute name="name">measurement</xsl:attribute>
+                                                                               
              <xsl:attribute name="type">text</xsl:attribute>
+                                                                               
              <xsl:attribute name="value">
+                                                                               
                <xsl:value-of select="measurement"/>
+                                                                               
              </xsl:attribute>
+                                                                               
            </input>
+                                                                              
</div>
+                                                                              
<div>
+                                                                               
         <label class="comment">Kommentar</label>
+                                                                               
         <textarea name="comment">
+                                                                               
                        <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}" />
+                                                                               
        </div>
+                                                                               
</div>
+                                                                       
</xsl:when>
+                                                               </xsl:choose>   
                                                                                
                        
+                                                                       
+                                                               </form>
+                                                   </li>
+                                               </xsl:for-each>
+                                       </ul>                   
+                                       </xsl:when>
+                                       <xsl:otherwise>
+                                               Alle sjekkpunkter for kontroll 
er registert som åpent/håndtert avvik eller måling 
+                                       </xsl:otherwise>
+                       </xsl:choose>
+               </div>
+               </div>
+</xsl:template>


Property changes on: 
trunk/controller/templates/base/check_list/register_errors.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/controller/templates/base/check_list/view_closed_errors.xsl
===================================================================
--- trunk/controller/templates/base/check_list/view_closed_errors.xsl           
                (rev 0)
+++ trunk/controller/templates/base/check_list/view_closed_errors.xsl   
2012-01-06 13:30:08 UTC (rev 8508)
@@ -0,0 +1,106 @@
+<!-- $Id: choose_control_items.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
+
+<xsl:template match="view_closed_errors">
+
+<div id="error_message_menu">
+       <a class="btn" id="register_errors">                                    
+               <xsl:attribute name="href">
+                       
<xsl:text>index.php?menuaction=controller.uicheck_list.register_errors</xsl:text>
+                       <xsl:text>&amp;check_list_id=</xsl:text>
+                       <xsl:value-of select="check_list/id"/>
+               </xsl:attribute>
+               Registrer sak/måling
+       </a>
+       <a class="btn">
+               <xsl:attribute name="href">
+                       
<xsl:text>index.php?menuaction=controller.uierror_report_message.create_error_report_message</xsl:text>
+                       <xsl:text>&amp;check_list_id=</xsl:text>
+                       <xsl:value-of select="check_list/id"/>
+               </xsl:attribute>
+               Registrer avviksmelding
+       </a>
+</div>
+       
+<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_errors</xsl:text>
+                               <xsl:text>&amp;check_list_id=</xsl:text>
+                               <xsl:value-of select="check_list/id"/>
+                       </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_errors</xsl:text>
+                               <xsl:text>&amp;check_list_id=</xsl:text>
+                               <xsl:value-of select="check_list/id"/>
+                       </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>&amp;check_list_id=</xsl:text>
+                               <xsl:value-of select="check_list/id"/>
+                       </xsl:attribute>
+                       Vis målinger
+               </a>
+       </div>  
+       
+       <div id="view_handled_errors" class="tab_item"> 
+               <xsl:choose>
+                       <xsl:when test="handled_check_items/child::node()">
+                               
+                       <div class="expand_menu"><div class="expand_all">Vis 
alle</div><div class="collapse_all focus">Skjul alle</div></div>
+                               
+                               <ul id="check_list_fixed_list" 
class="check_items expand_list">
+                                       <xsl:for-each 
select="handled_check_items">
+                                                       <xsl:if test="status = 
1">
+                                                       <li>
+                                                       <h4><img 
src="controller/images/arrow_right.png" width="14"/><span><xsl:value-of 
select="control_item/title"/></span></h4>                                       
       
+                                                               <form 
class="frm_save_check_item" 
action="index.php?menuaction=controller.uicheck_list.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}" /> 
+                                                                       <div 
class="check_item">
+                                                                         <div>
+                                                                              
<label>Status</label>
+                                                                              
<select name="status">
+                                                                               
        <xsl:choose>
+                                                                               
                <xsl:when test="status = 0">
+                                                                               
                        <option value="0" SELECTED="SELECTED">Avvik er 
åpent</option>
+                                                                               
                        <option value="1">Avvik er håndtert</option>
+                                                                               
                </xsl:when>
+                                                                               
                <xsl:when test="status = 1">
+                                                                               
                        <option value="0">Avvik er åpent</option>
+                                                                               
                        <option value="1" SELECTED="SELECTED">Avvik er 
lukket</option>
+                                                                               
                </xsl:when>
+                                                                               
        </xsl:choose>
+                                                                               
   </select>
+                                                                      </div>
+                                                                      <div>
+                                                                        <label 
class="comment">Kommentar</label>
+                                                                        
<textarea name="comment">
+                                                                               
        <xsl:value-of select="comment"/>
+                                                                               
 </textarea>
+                                                                      </div>
+                                                                      <div 
class="form-buttons">
+                                                                               
        <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save_check_item')" /></xsl:variable>
+                                                                               
        <input type="submit" name="save_control" value="Oppdater håndtert 
avvik" class="not_active" title="{$lang_save}" />
+                                                                               
</div>
+                                                                       </div>
+                                                               </form>
+                                                   </li>
+                                               </xsl:if>
+                                       </xsl:for-each>
+                               </ul>                   
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       Ingen registrerte håndterte avvik
+                               </xsl:otherwise>
+               </xsl:choose>
+       </div>
+</div>
+</xsl:template>
\ No newline at end of file


Property changes on: 
trunk/controller/templates/base/check_list/view_closed_errors.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/controller/templates/base/check_list/view_measurements.xsl
===================================================================
--- trunk/controller/templates/base/check_list/view_measurements.xsl            
                (rev 0)
+++ trunk/controller/templates/base/check_list/view_measurements.xsl    
2012-01-06 13:30:08 UTC (rev 8508)
@@ -0,0 +1,104 @@
+<!-- $Id: choose_control_items.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
+
+<xsl:template match="view_measurements">
+
+<div id="error_message_menu">
+       <a class="btn" id="register_errors">                                    
+               <xsl:attribute name="href">
+                       
<xsl:text>index.php?menuaction=controller.uicheck_list.register_errors</xsl:text>
+                       <xsl:text>&amp;check_list_id=</xsl:text>
+                       <xsl:value-of select="check_list/id"/>
+               </xsl:attribute>
+               Registrer sak/måling
+       </a>
+       <a class="btn">
+               <xsl:attribute name="href">
+                       
<xsl:text>index.php?menuaction=controller.uierror_report_message.create_error_report_message</xsl:text>
+                       <xsl:text>&amp;check_list_id=</xsl:text>
+                       <xsl:value-of select="check_list/id"/>
+               </xsl:attribute>
+               Registrer avviksmelding
+       </a>
+</div>
+       
+<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_errors</xsl:text>
+                               <xsl:text>&amp;check_list_id=</xsl:text>
+                               <xsl:value-of select="check_list/id"/>
+                       </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_errors</xsl:text>
+                               <xsl:text>&amp;check_list_id=</xsl:text>
+                               <xsl:value-of select="check_list/id"/>
+                       </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>&amp;check_list_id=</xsl:text>
+                               <xsl:value-of select="check_list/id"/>
+                       </xsl:attribute>
+                       Vis målinger
+               </a>
+       </div>  
+       
+       <div id="view_measurements" class="tab_item">
+               <xsl:choose>
+                       <xsl:when test="measurement_check_items/child::node()">
+                               
+                       <div class="expand_menu"><div class="expand_all">Vis 
alle</div><div class="collapse_all focus">Skjul alle</div></div>
+               
+                               <ul id="check_list_not_fixed_list" 
class="check_items expand_list">
+                                       <xsl:for-each 
select="measurement_check_items">
+                                                       <li>
+                                                       <xsl:if test="status = 
0">
+                                                               <h4><img 
src="controller/images/arrow_right.png" width="14"/><span><xsl:value-of 
select="control_item/title"/></span></h4>                                       
       
+                                                               <form 
class="frm_save_check_item" 
action="index.php?menuaction=controller.uicheck_list.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="measurement" />
+                                                                        
+                                                                       <div 
class="check_item">
+                                                                         <div>
+                                                                              
<label>Målingsverdi</label>
+                                                                              
<input>
+                                                                               
      <xsl:attribute name="name">measurement</xsl:attribute>
+                                                                               
      <xsl:attribute name="type">text</xsl:attribute>
+                                                                               
      <xsl:attribute name="value">
+                                                                               
        <xsl:value-of select="measurement"/>
+                                                                               
      </xsl:attribute>
+                                                                               
    </input>
+                                                                      </div>
+                                                                      
+                                                                      <div>
+                                                                        <label 
class="comment">Kommentar</label>
+                                                                        
<textarea name="comment">
+                                                                               
        <xsl:value-of select="comment"/>
+                                                                               
 </textarea>
+                                                                      </div>
+                                                                      <div 
class="form-buttons">
+                                                                               
        <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save_check_item')" /></xsl:variable>
+                                                                               
        <input type="submit" name="save_control" value="Oppdatert registert 
måling" class="not_active" title="{$lang_save}" />
+                                                                               
</div>
+                                                                       </div>
+                                                               </form>
+                                                       </xsl:if>
+                                           </li>
+                                       </xsl:for-each>
+                               </ul>                   
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       Ingen registrerte målinger
+                               </xsl:otherwise>
+               </xsl:choose>
+       </div>
+</div>
+</xsl:template>


Property changes on: 
trunk/controller/templates/base/check_list/view_measurements.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/controller/templates/base/check_list/view_open_errors.xsl
===================================================================
--- trunk/controller/templates/base/check_list/view_open_errors.xsl             
                (rev 0)
+++ trunk/controller/templates/base/check_list/view_open_errors.xsl     
2012-01-06 13:30:08 UTC (rev 8508)
@@ -0,0 +1,106 @@
+<!-- $Id: choose_control_items.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
+
+<xsl:template match="view_open_errors" xmlns:php="http://php.net/xsl";>
+
+<div id="error_message_menu">
+       <a class="btn" id="register_errors">                                    
+               <xsl:attribute name="href">
+                       
<xsl:text>index.php?menuaction=controller.uicheck_list.register_errors</xsl:text>
+                       <xsl:text>&amp;check_list_id=</xsl:text>
+                       <xsl:value-of select="check_list/id"/>
+               </xsl:attribute>
+               Registrer sak/måling
+       </a>
+       <a class="btn">
+               <xsl:attribute name="href">
+                       
<xsl:text>index.php?menuaction=controller.uierror_report_message.create_error_report_message</xsl:text>
+                       <xsl:text>&amp;check_list_id=</xsl:text>
+                       <xsl:value-of select="check_list/id"/>
+               </xsl:attribute>
+               Registrer avviksmelding
+       </a>
+</div>
+       
+<div id="view_errors">
+       
+       <div class="tab_menu">
+               <a class="active" id="view_open_errors">                        
                
+                       <xsl:attribute name="href">
+                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_open_errors</xsl:text>
+                               <xsl:text>&amp;check_list_id=</xsl:text>
+                               <xsl:value-of select="check_list/id"/>
+                       </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_errors</xsl:text>
+                               <xsl:text>&amp;check_list_id=</xsl:text>
+                               <xsl:value-of select="check_list/id"/>
+                       </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>&amp;check_list_id=</xsl:text>
+                               <xsl:value-of select="check_list/id"/>
+                       </xsl:attribute>
+                       Vis målinger
+               </a>
+       </div>  
+       
+       <div id="view_open_errors" class="tab_item active">
+               <xsl:choose>
+                       <xsl:when test="open_check_items/child::node()">
+                               
+                       <div class="expand_menu"><div class="expand_all">Vis 
alle</div><div class="collapse_all focus">Skjul alle</div></div>
+               
+                               <ul id="check_list_not_fixed_list" 
class="check_items expand_list">
+                                       <xsl:for-each select="open_check_items">
+                                                       <li>
+                                                       <xsl:if test="status = 
0">
+                                                               <h4><img 
src="controller/images/arrow_right.png" width="14"/><span><xsl:value-of 
select="control_item/title"/></span></h4>                                       
       
+                                                               <form 
class="frm_save_check_item" 
action="index.php?menuaction=controller.uicheck_list.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}" /> 
+                                                                       <div 
class="check_item">
+                                                                         <div>
+                                                                              
<label>Status</label>
+                                                                              
<select name="status">
+                                                                               
        <xsl:choose>
+                                                                               
                <xsl:when test="status = 0">
+                                                                               
                        <option value="0" SELECTED="SELECTED">Avvik er 
åpent</option>
+                                                                               
                        <option value="1">Avvik er håndtert</option>
+                                                                               
                </xsl:when>
+                                                                               
                <xsl:when test="status = 1">
+                                                                               
                        <option value="0">Avvik er åpent</option>
+                                                                               
                        <option value="1" SELECTED="SELECTED">Avvik er 
håndtert</option>
+                                                                               
                </xsl:when>
+                                                                               
        </xsl:choose>
+                                                                               
   </select>
+                                                                      </div>
+                                                                      <div>
+                                                                        <label 
class="comment">Kommentar</label>
+                                                                        
<textarea name="comment">
+                                                                               
        <xsl:value-of select="comment"/>
+                                                                               
 </textarea>
+                                                                      </div>
+                                                                      <div 
class="form-buttons">
+                                                                               
        <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save_check_item')" /></xsl:variable>
+                                                                               
        <input style="width: 200px;" type="submit" name="save_control" 
value="Oppdater registrert avvik" class="not_active" title="{$lang_save}" />
+                                                                               
</div>
+                                                                       </div>
+                                                               </form>
+                                                       </xsl:if>
+                                           </li>
+                                       </xsl:for-each>
+                               </ul>                   
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       Ingen registrerte åpne avvik
+                               </xsl:otherwise>
+               </xsl:choose>
+       </div>
+</div>
+</xsl:template>


Property changes on: 
trunk/controller/templates/base/check_list/view_open_errors.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Modified: trunk/controller/templates/base/css/base.css
===================================================================
--- trunk/controller/templates/base/css/base.css        2012-01-06 10:49:07 UTC 
(rev 8507)
+++ trunk/controller/templates/base/css/base.css        2012-01-06 13:30:08 UTC 
(rev 8508)
@@ -1060,7 +1060,6 @@
 .tab_item {
     background: none repeat scroll 0 0 #EDF5FF;
     border: 1px solid #A3A3A3;
-    display: none;
     margin: 0 318px 0 0;
     padding: 15px;
     width: 628px;
@@ -1164,15 +1163,11 @@
        float:left;
     margin: 20px 0 0 10px;   
 }
-#register_errors {
-       display:none;
+#register_errors_content {
     float: right;
     margin-top: 20px;   
 }
 
-a#view_errors_measurements{
-       display:none;
-}
 #edit_check_list_menu a{
                float:left;
                width: 150px;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]