fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [8612]


From: Torstein
Subject: [Fmsystem-commits] [8612]
Date: Thu, 19 Jan 2012 09:05:17 +0000

Revision: 8612
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8612
Author:   vator
Date:     2012-01-19 09:05:17 +0000 (Thu, 19 Jan 2012)
Log Message:
-----------


Modified Paths:
--------------
    trunk/controller/inc/class.socase.inc.php
    trunk/controller/inc/class.uicalendar.inc.php
    trunk/controller/inc/class.uicase.inc.php
    trunk/controller/inc/class.uicheck_list.inc.php
    trunk/controller/inc/class.uicheck_list_for_location.inc.php
    trunk/controller/inc/class.uiprocedure.inc.php
    trunk/controller/js/controller/ajax.js
    trunk/controller/templates/base/calendar/view_calendar_month.xsl
    trunk/controller/templates/base/calendar/view_calendar_year.xsl
    trunk/controller/templates/base/case/create_case_message.xsl
    trunk/controller/templates/base/case/view_case_message.xsl
    trunk/controller/templates/base/check_list/view_closed_cases.xsl
    trunk/controller/templates/base/check_list/view_open_cases.xsl
    trunk/controller/templates/base/css/base.css
    trunk/controller/templates/base/procedure/print_procedure.xsl

Modified: trunk/controller/inc/class.socase.inc.php
===================================================================
--- trunk/controller/inc/class.socase.inc.php   2012-01-18 20:12:58 UTC (rev 
8611)
+++ trunk/controller/inc/class.socase.inc.php   2012-01-19 09:05:17 UTC (rev 
8612)
@@ -168,5 +168,19 @@
                        }
                }
                
+               function delete($case_id)
+               {
+                       $status = $this->db->query("DELETE FROM 
controller_check_item_case WHERE id = $case_id");
+                                       
+                       if( isset($status) )
+                       {
+                               return true;
+                       }
+                       else
+                       {
+                               return false;
+                       }
+               }
+               
                function get_id_field_name(){}
        }

Modified: trunk/controller/inc/class.uicalendar.inc.php
===================================================================
--- trunk/controller/inc/class.uicalendar.inc.php       2012-01-18 20:12:58 UTC 
(rev 8611)
+++ trunk/controller/inc/class.uicalendar.inc.php       2012-01-19 09:05:17 UTC 
(rev 8612)
@@ -139,6 +139,7 @@
                                'controls_calendar_array' => 
$controls_calendar_array,
                                'date_format'                     => 
$date_format,
                                'period'                                  => 
$month_array[ $month - 1],
+                               'month_nr'                                => 
$month,
                                'year'                                    => 
$year
                        );
                        

Modified: trunk/controller/inc/class.uicase.inc.php
===================================================================
--- trunk/controller/inc/class.uicase.inc.php   2012-01-18 20:12:58 UTC (rev 
8611)
+++ trunk/controller/inc/class.uicase.inc.php   2012-01-19 09:05:17 UTC (rev 
8612)
@@ -49,7 +49,8 @@
                                                                        
'create_case_message'   => true,
                                                                        
'view_case_message'     => true,
                                                                        
'register_case_message' => true,
-                                                                       
'updateStatusForCases' => true
+                                                                       
'updateStatusForCases'  => true,
+                                                                       
'delete_case'                           => true
                                                                );
 
                function __construct()
@@ -74,6 +75,16 @@
                        
                        $check_item = 
$this->so_check_item->get_check_item_by_check_list_and_control_item($check_list_id,
 $control_item_id);
                        
+                       /*
+                       
+                       $db_check_item = $this->so_check_item->get_db();
+                       $db_check_item->transaction_begin();
+
+                       $db_check_item->transaction_commit();
+                       $db_check_item->transaction_abort();
+                       
+                       */
+                       
                        if($check_item == null){
                                $new_check_item = new controller_check_item();
                                $new_check_item->set_check_list_id( 
$check_list_id );
@@ -331,5 +342,22 @@
                        }
                }
                
+               public function delete_case()
+               {
+                       $case_id = phpgw::get_var('case_id');
+                       $check_list_id = phpgw::get_var('check_list_id');
+                               
+                       $status = $this->so->delete($case_id);
+               
+                       if($status){
+                               $status_checker = new status_checker();
+                               $status_checker->update_check_list_status( 
$check_list_id );
+                                               
+                               return json_encode( array( "status" => 
"deleted" ) );
+                       }
+                       else
+                               return json_encode( array( "status" => 
"not_deleted" ) );
+               }
+               
                public function query(){}
        }

Modified: trunk/controller/inc/class.uicheck_list.inc.php
===================================================================
--- trunk/controller/inc/class.uicheck_list.inc.php     2012-01-18 20:12:58 UTC 
(rev 8611)
+++ trunk/controller/inc/class.uicheck_list.inc.php     2012-01-19 09:05:17 UTC 
(rev 8612)
@@ -230,7 +230,7 @@
                
                public function update_check_list(){
                        $check_list_id = phpgw::get_var('check_list_id');
-                       $status = phpgw::get_var('status');
+                       $status = (int)phpgw::get_var('status');
                        $comment = phpgw::get_var('comment');
                        $deadline_date = phpgw::get_var('deadline_date');
                        $completed_date = phpgw::get_var('completed_date');
@@ -517,7 +517,7 @@
                public function save_check_item(){
                        $check_item_id = phpgw::get_var('check_item_id');
                        $comment = phpgw::get_var('comment');
-                       $status = phpgw::get_var('status');
+                       $status = (int)phpgw::get_var('status');
                                                                        
                        $check_item = 
$this->so_check_item->get_single($check_item_id);
                        $control_item_id = $check_item->get_control_item_id();
@@ -549,7 +549,7 @@
                        $control_item_id = phpgw::get_var('control_item_id');
                        $check_list_id = phpgw::get_var('check_list_id');
                        $comment = phpgw::get_var('comment');
-                       $status = phpgw::get_var('status');
+                       $status = (int)phpgw::get_var('status');
                        $type = phpgw::get_var('type');
 
                        $check_item_obj = new controller_check_item();

Modified: trunk/controller/inc/class.uicheck_list_for_location.inc.php
===================================================================
--- trunk/controller/inc/class.uicheck_list_for_location.inc.php        
2012-01-18 20:12:58 UTC (rev 8611)
+++ trunk/controller/inc/class.uicheck_list_for_location.inc.php        
2012-01-19 09:05:17 UTC (rev 8612)
@@ -424,7 +424,7 @@
                function save_check_list(){
                        $location_code = phpgw::get_var('location_code');
                        $control_id = phpgw::get_var('control_id');
-                       $status = phpgw::get_var('status');
+                       $status = (int)phpgw::get_var('status');
 
                        $deadline_date = phpgw::get_var('deadline_date', 
'string');
                        $planned_date = phpgw::get_var('planned_date', 
'string');

Modified: trunk/controller/inc/class.uiprocedure.inc.php
===================================================================
--- trunk/controller/inc/class.uiprocedure.inc.php      2012-01-18 20:12:58 UTC 
(rev 8611)
+++ trunk/controller/inc/class.uiprocedure.inc.php      2012-01-19 09:05:17 UTC 
(rev 8612)
@@ -515,9 +515,11 @@
                        
                        $data = array
                        (
-                               'procedure'                     => 
$procedure->toArray()
+                               'procedure'     => $procedure->toArray()
                        );
                        
+                       
$GLOBALS['phpgw']->css->add_external_file('controller/templates/base/css/base.css');
+                       
                        self::render_template_xsl('procedure/print_procedure', 
$data);
                }
                

Modified: trunk/controller/js/controller/ajax.js
===================================================================
--- trunk/controller/js/controller/ajax.js      2012-01-18 20:12:58 UTC (rev 
8611)
+++ trunk/controller/js/controller/ajax.js      2012-01-19 09:05:17 UTC (rev 
8612)
@@ -1,5 +1,22 @@
 $(document).ready(function(){
        
+       // file: uicalendar.xsl
+       $("#choose_my_location option").click(function () {
+                var location_code = $(this).val();
+                var thisForm = $(this).parents("form");
+                
+                var period_type = 
$(thisForm).find("input[name='period_type']").val();
+                var year = $(thisForm).find("input[name='year']").val();
+                var month = $(thisForm).find("input[name='month']").val();
+                
+                if(period_type == 'view_month')
+                var requestUrl = 
"index.php?menuaction=controller.uicalendar.view_calendar_for_month&location_code="
 + location_code + "&year=" + year + "&month=" + month;
+                else
+                        var requestUrl = 
"index.php?menuaction=controller.uicalendar.view_calendar_for_year&location_code="
 + location_code + "&year=" + year;
+               
+                window.location.href = requestUrl;
+    });
+       
        // file: uicheck_list_for_location.xsl
        // When control area is selected, controls are fetched from db and 
control select list is populated
        $("#control_area_list option").click(function () {
@@ -308,6 +325,50 @@
                });
        });
        
+       
+       
+       
+       // Delete a case item from list
+       $(".delete_case").live("click", function(){
+               var clickElem = $(this);
+               var clickRow = $(this).closest("li");
+               var clickItem = $(this).closest("ul");
+               var checkItemRow = $(this).parents("li.check_item_case");
+               
+               var url = $(clickElem).attr("href");
+       
+               // Sending request for deleting a control item list
+               $.ajax({
+                       type: 'POST',
+                       url: url,
+                       success: function(data) {
+                               var obj = jQuery.parseJSON(data);
+                               
+                               if(obj.status == "deleted"){
+                                       if( $(clickItem).children("li").length 
> 1){
+                                               $(clickRow).fadeOut(300, 
function(){
+                                                       $(clickRow).remove();
+                                               });
+                                               
+                                               var next_row = 
$(clickRow).next();
+                                               
+                                               // Updating order numbers for 
rows below deleted row  
+                                               while( $(next_row).length > 0){
+                                                       
update_order_nr(next_row, "-");
+                                                       next_row = 
$(next_row).next();
+                                               }
+                                       }else{
+                                               $(checkItemRow).fadeOut(300, 
function(){
+                                                       
$(checkItemRow).remove();
+                                               });
+                                       }
+                               }
+                       }
+               });
+
+               return false;
+       });
+       
        $("#frm_update_check_list").live("click", function(e){
                var thisForm = $(this);
                var submitBnt = $(thisForm).find("input[type='submit']");
@@ -331,4 +392,19 @@
                var submitBnt = $(thisForm).find("input[type='submit']");
                $(submitBnt).removeClass("not_active");
        });
-});
\ No newline at end of file
+});
+
+//Updates order number for hidden field and number in front of row
+function update_order_nr(element, sign){
+       
+       var span_order_nr = $(element).find("span.order_nr");
+       var order_nr = $(span_order_nr).text();
+       
+       if(sign == "+")
+               var updated_order_nr = parseInt(order_nr) + 1;
+       else
+               var updated_order_nr = parseInt(order_nr) - 1;
+       
+       // Updating order number in front of row
+       $(span_order_nr).text(updated_order_nr);
+}
\ No newline at end of file

Modified: trunk/controller/templates/base/calendar/view_calendar_month.xsl
===================================================================
--- trunk/controller/templates/base/calendar/view_calendar_month.xsl    
2012-01-18 20:12:58 UTC (rev 8611)
+++ trunk/controller/templates/base/calendar/view_calendar_month.xsl    
2012-01-19 09:05:17 UTC (rev 8612)
@@ -9,15 +9,30 @@
                        <h1><xsl:value-of 
select="location_array/loc1_name"/></h1>
                        <h3 style="margin:0;font-size:19px;">Kalenderoversikt 
for <xsl:value-of select="period"/></h3>
                </div>
-                                               
+               
                <div style="float:right;width:300px;margin-top:40px;">
-                       <select id="my_location_id">
-                               <xsl:for-each select="my_locations">
-                                       <option value="{location_code}" 
selected="selected">
-                                               <xsl:value-of 
disable-output-escaping="yes" select="loc1_name"/>
-                                       </option>
-                               </xsl:for-each>
-                       </select>               
+                       <form action="#">
+                               <input type="hidden" name="period_type" 
value="view_month" />
+                               <input type="hidden" name="year">
+                             <xsl:attribute name="value">
+                               <xsl:value-of select="year"/>
+                             </xsl:attribute>
+                               </input>
+                               <input type="hidden" name="month">
+                             <xsl:attribute name="value">
+                               <xsl:value-of select="month_nr"/>
+                             </xsl:attribute>
+                               </input>
+                               
+                               <select id="choose_my_location">
+                                       <xsl:for-each select="my_locations">
+                                               <option value="{location_code}" 
selected="selected">
+                                                       <xsl:value-of 
disable-output-escaping="yes" select="loc1_name"/>
+                                               </option>
+                                       </xsl:for-each>
+                               </select>
+                       </form>
+                                       
                        <ul id="icon_color_map">
                                <li><img height="15" 
src="controller/images/status_icon_yellow_ring.png" /><span>Kontroll satt 
opp</span></li>
                                <li><img height="15" 
src="controller/images/status_icon_yellow.png" /><span>Kontroll har planlagt 
dato</span></li>

Modified: trunk/controller/templates/base/calendar/view_calendar_year.xsl
===================================================================
--- trunk/controller/templates/base/calendar/view_calendar_year.xsl     
2012-01-18 20:12:58 UTC (rev 8611)
+++ trunk/controller/templates/base/calendar/view_calendar_year.xsl     
2012-01-19 09:05:17 UTC (rev 8612)
@@ -12,13 +12,23 @@
                </div>
 
                <div style="float:right;width:300px;margin-top:40px;">
-                       <select id="my_location_id">
-                               <xsl:for-each select="my_locations">
-                                       <option value="{location_code}" 
selected="selected">
-                                               <xsl:value-of 
disable-output-escaping="yes" select="loc1_name"/>
-                                       </option>
-                               </xsl:for-each>
-                       </select>               
+                       <form action="#">
+                               <input type="hidden" name="period_type" 
value="view_year" />
+                               <input type="hidden" name="year">
+                             <xsl:attribute name="value">
+                               <xsl:value-of select="year"/>
+                             </xsl:attribute>
+                               </input>
+                               
+                               <select id="choose_my_location">
+                                       <xsl:for-each select="my_locations">
+                                               <option value="{location_code}" 
selected="selected">
+                                                       <xsl:value-of 
disable-output-escaping="yes" select="loc1_name"/>
+                                               </option>
+                                       </xsl:for-each>
+                               </select>
+                       </form>
+                                       
                        <ul id="icon_color_map">
                                <li><img height="15" 
src="controller/images/status_icon_yellow_ring.png" /><span>Kontroll satt 
opp</span></li>
                                <li><img height="15" 
src="controller/images/status_icon_yellow.png" /><span>Kontroll har planlagt 
dato</span></li>

Modified: trunk/controller/templates/base/case/create_case_message.xsl
===================================================================
--- trunk/controller/templates/base/case/create_case_message.xsl        
2012-01-18 20:12:58 UTC (rev 8611)
+++ trunk/controller/templates/base/case/create_case_message.xsl        
2012-01-19 09:05:17 UTC (rev 8612)
@@ -79,7 +79,7 @@
                                                <xsl:for-each 
select="check_items_and_cases">
                                                        <xsl:choose>
                                                                <xsl:when 
test="cases_array/child::node()">
-                                                                       <li 
class="check_item_cases">
+                                                                       <li 
class="check_item_case">
                                                                                
<h4><span><xsl:value-of select="control_item/title"/></span></h4>
                                                                                
<ul>            
                                                                                
        <xsl:for-each select="cases_array">

Modified: trunk/controller/templates/base/case/view_case_message.xsl
===================================================================
--- trunk/controller/templates/base/case/view_case_message.xsl  2012-01-18 
20:12:58 UTC (rev 8611)
+++ trunk/controller/templates/base/case/view_case_message.xsl  2012-01-19 
09:05:17 UTC (rev 8612)
@@ -40,7 +40,7 @@
                                <xsl:for-each select="check_items_and_cases">
                                        <xsl:choose>
                                                <xsl:when 
test="cases_array/child::node()">
-                                                       <li 
class="check_item_cases">
+                                                       <li 
class="check_item_case">
                                                                
<h4><span><xsl:value-of select="control_item/title"/></span></h4>
                                                                <ul>            
                                                                        
<xsl:for-each select="cases_array">

Modified: trunk/controller/templates/base/check_list/view_closed_cases.xsl
===================================================================
--- trunk/controller/templates/base/check_list/view_closed_cases.xsl    
2012-01-18 20:12:58 UTC (rev 8611)
+++ trunk/controller/templates/base/check_list/view_closed_cases.xsl    
2012-01-19 09:05:17 UTC (rev 8612)
@@ -16,7 +16,7 @@
                                <xsl:for-each 
select="closed_check_items_and_cases">
                                        <xsl:choose>
                                                <xsl:when 
test="cases_array/child::node()">
-                                                       <li 
class="check_item_cases">
+                                                       <li 
class="check_item_case">
                                                                
<h4><span><xsl:value-of select="control_item/title"/></span></h4>
                                                                <ul>            
                                                                        
<xsl:for-each select="cases_array">

Modified: trunk/controller/templates/base/check_list/view_open_cases.xsl
===================================================================
--- trunk/controller/templates/base/check_list/view_open_cases.xsl      
2012-01-18 20:12:58 UTC (rev 8611)
+++ trunk/controller/templates/base/check_list/view_open_cases.xsl      
2012-01-19 09:05:17 UTC (rev 8612)
@@ -16,12 +16,12 @@
                                <xsl:for-each 
select="open_check_items_and_cases">
                                        <xsl:choose>
                                                <xsl:when 
test="cases_array/child::node()">
-                                                       <li 
class="check_item_cases">
+                                                       <li 
class="check_item_case">
                                                                
<h4><span><xsl:value-of select="control_item/title"/></span></h4>
                                                                <ul>            
                                                                        
<xsl:for-each select="cases_array">
                                                                                
<xsl:variable name="cases_id"><xsl:value-of select="id"/></xsl:variable>
-                                                                               
<li><xsl:number />. <xsl:value-of select="descr"/>
+                                                                               
<li><span class="order_nr"><xsl:number /></span>. <xsl:value-of select="descr"/>
                                                                                
        <xsl:choose>
                                                                                
                <xsl:when test="location_item_id > 0">
                                                                                
                        <div style="float:right;">
@@ -39,7 +39,34 @@
                                                                                
                        <div style="float:right;"><span style="color:red">Ingen 
melding registrert</span></div>
                                                                                
                </xsl:otherwise>
                                                                                
        </xsl:choose>
-                                                                               
        <div class="quick_menu"><a href="">endre</a><a href="">slette</a></div>
+                                                                               
        <div class="quick_menu">
+                                                                               
                <a>
+                                                                               
                        <xsl:attribute name="href">
+                                                                               
                                
<xsl:text>index.php?menuaction=controller.uicase.edit_case</xsl:text>
+                                                                               
                                <xsl:text>&amp;case_id=</xsl:text>
+                                                                               
                                <xsl:value-of select="id"/>
+                                                                               
                                <xsl:text>&amp;check_list_id=</xsl:text>
+                                                                               
                                <xsl:value-of select="//check_list/id"/>
+                                                                               
                                <xsl:text>&amp;phpgw_return_as=json</xsl:text>
+                                                                               
                        </xsl:attribute>
+                                                                               
                        endre
+                                                                               
                </a>
+                                                                               
                <xsl:choose>
+                                                                               
                        <xsl:when test="location_item_id = 0">
+                                                                               
                                <a class="delete_case">
+                                                                               
                                        <xsl:attribute name="href">
+                                                                               
                                                
<xsl:text>index.php?menuaction=controller.uicase.delete_case</xsl:text>
+                                                                               
                                                
<xsl:text>&amp;case_id=</xsl:text>
+                                                                               
                                                <xsl:value-of select="id"/>
+                                                                               
                                                
<xsl:text>&amp;check_list_id=</xsl:text>
+                                                                               
                                                <xsl:value-of 
select="//check_list/id"/>
+                                                                               
                                                
<xsl:text>&amp;phpgw_return_as=json</xsl:text>
+                                                                               
                                        </xsl:attribute>
+                                                                               
                                        slett
+                                                                               
                                </a>
+                                                                               
                        </xsl:when>
+                                                                               
                </xsl:choose>
+                                                                               
        </div>
                                                                                
</li>
                                                                        
</xsl:for-each>
                                                                </ul>
@@ -51,7 +78,7 @@
                        
                        <a style="font-size: 11px;margin-top: 20px;padding: 3px 
20px;" class="btn focus">
                                <xsl:attribute name="href">
-                                       
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.register_error</xsl:text>
+                                       
<xsl:text>index.php?menuaction=controller.uicheck_list.register_case</xsl:text>
                                        <xsl:text>&amp;check_list_id=</xsl:text>
                                        <xsl:value-of select="check_list/id"/>
                                </xsl:attribute>

Modified: trunk/controller/templates/base/css/base.css
===================================================================
--- trunk/controller/templates/base/css/base.css        2012-01-18 20:12:58 UTC 
(rev 8611)
+++ trunk/controller/templates/base/css/base.css        2012-01-19 09:05:17 UTC 
(rev 8612)
@@ -1223,13 +1223,13 @@
     text-align: left;
     width: 815px;
 }
-li.check_item_cases h4{
+li.check_item_case h4{
        margin:5px 0;           
 }
-li.check_item_cases ul{
+li.check_item_case ul{
        margin:10px;            
 }
-li.check_item_cases ul li {
+li.check_item_case ul li {
     margin: 5px 0 0 0;
 }
 a.view_check_list{

Modified: trunk/controller/templates/base/procedure/print_procedure.xsl
===================================================================
--- trunk/controller/templates/base/procedure/print_procedure.xsl       
2012-01-18 20:12:58 UTC (rev 8611)
+++ trunk/controller/templates/base/procedure/print_procedure.xsl       
2012-01-19 09:05:17 UTC (rev 8612)
@@ -4,188 +4,112 @@
 <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;">
-               <dl class="proplist-col">
-                       <dt>
-                               <label for="title"><xsl:value-of 
select="php:function('lang','Procedure title')" /></label>
-                       </dt>
-                       <dd>
-                       <xsl:choose>
-                               <xsl:when test="editable">
-                                       <input type="text" name="title" 
id="title" value="{procedure/title}" size="100"/>
-                               </xsl:when>
-                               <xsl:otherwise>
-                                       <xsl:value-of select="procedure/title" 
/>
-                               </xsl:otherwise>
-                       </xsl:choose>
-                       </dd>
-                       <dt>
-                               <label for="revision_no"><xsl:value-of 
select="php:function('lang','Procedure revision')" /></label>
-                       </dt>
-                       <dd>
-                               <xsl:value-of select="procedure/revision_no" />
-                       </dd>
-                       <dt>
-                               <label for="control_area"><xsl:value-of 
select="php:function('lang','Control area')" /></label>
-                       </dt>
-                       <dd>
-                       <xsl:choose>
-                               <xsl:when test="editable">
-                                       <select id="control_area" 
name="control_area">
-                                               <xsl:apply-templates 
select="control_area/options"/>
-                                       </select>
-                               </xsl:when>
-                               <xsl:otherwise>
-                                       <xsl:value-of 
select="procedure/control_area_name" />
-                               </xsl:otherwise>
-                       </xsl:choose>
-                       </dd>
-                       <dt>
-                               <label for="start_date"><xsl:value-of 
select="php:function('lang','Procedure start date')" /></label>
-                       </dt>
-                       <dd>
-                       <xsl:choose>
-                               <xsl:when test="editable">
-                                       <xsl:value-of 
disable-output-escaping="yes" select="start_date"/>
-                               </xsl:when>
-                               <xsl:otherwise>
-                                       <xsl:variable 
name="startdate"><xsl:value-of select="procedure/start_date" /></xsl:variable>
-                                       <xsl:value-of 
select="php:function('date', $dateformat, $startdate)" />
-                               </xsl:otherwise>
-                       </xsl:choose>
-                       </dd>
-                       <dt>
-                               <label for="revision_date"><xsl:value-of 
select="php:function('lang','Procedure revision date')" /></label>
-                       </dt>
-                       <dd>
-                       <xsl:choose>
-                               <xsl:when test="editable">
-                                       <xsl:value-of 
disable-output-escaping="yes" select="revision_date"/>
-                               </xsl:when>
-                               <xsl:otherwise>
-                                       <xsl:if test="procedure/revision_date 
!= 0">
-                                               <xsl:variable 
name="revisiondate"><xsl:value-of select="procedure/revision_date" 
/></xsl:variable>
-                                               <xsl:value-of 
select="php:function('date', $dateformat, $revisiondate)" />
-                                       </xsl:if>
-                               </xsl:otherwise>
-                       </xsl:choose>
-                       </dd>
+<div id="control_info" style="margin:40px 0 0 40px;">
+
+</div>
+
+<div id="procedure" style="margin:40px 0 0 40px;">
+               <div>
+                       <label for="title"><xsl:value-of 
select="php:function('lang','Procedure title')" /></label>
+                       <xsl:value-of select="procedure/title" />
+               </div>
+               <div>
+                       <label for="revision_no"><xsl:value-of 
select="php:function('lang','Procedure revision')" /></label>
+                       <xsl:value-of select="procedure/revision_no" />
+               </div>
+               <div>
+                       <label for="control_area"><xsl:value-of 
select="php:function('lang','Control area')" /></label>
+                       <xsl:value-of select="procedure/control_area_name" />
+               </div>
+               <div>
+                       <label for="start_date"><xsl:value-of 
select="php:function('lang','Procedure start date')" /></label>
+                       <xsl:variable name="startdate"><xsl:value-of 
select="procedure/start_date" /></xsl:variable>
+                       <xsl:value-of select="php:function('date', $dateformat, 
$startdate)" />
+               </div>
+               <div>
+                       <label for="revision_date"><xsl:value-of 
select="php:function('lang','Procedure revision date')" /></label>
+                       <xsl:if test="procedure/revision_date != 0">
+                               <xsl:variable name="revisiondate"><xsl:value-of 
select="procedure/revision_date" /></xsl:variable>
+                               <xsl:value-of select="php:function('date', 
$dateformat, $revisiondate)" />
+                       </xsl:if>
+               </div>
+               <div>
                        <xsl:if test="procedure/end_date != 0">
-                       <dt>
                                <label for="end_date"><xsl:value-of 
select="php:function('lang','Procedure end date')" /></label>
-                       </dt>
-                       <dd>
-                       <xsl:choose>
-                               <xsl:when test="editable">
-                                       <xsl:value-of 
disable-output-escaping="yes" select="end_date"/>
-                               </xsl:when>
-                               <xsl:otherwise>
-                                       <xsl:variable 
name="enddate"><xsl:value-of select="procedure/end_date" /></xsl:variable>
-                                       <xsl:value-of 
select="php:function('date', $dateformat, $enddate)" />
-                               </xsl:otherwise>
-                       </xsl:choose>
-                       </dd>
+                       
+                               <xsl:variable name="enddate"><xsl:value-of 
select="procedure/end_date" /></xsl:variable>
+                               <xsl:value-of select="php:function('date', 
$dateformat, $enddate)" />
                        </xsl:if>
-                       <dt>
-                               <label for="purpose"><xsl:value-of 
select="php:function('lang','Procedure purpose')" /></label>
-                       </dt>
-                       <dd>
-                       <xsl:choose>
-                               <xsl:when test="editable">
-                                       <textarea id="purpose" name="purpose" 
rows="5" cols="60"><xsl:value-of select="procedure/purpose" 
disable-output-escaping="yes"/></textarea>
-                               </xsl:when>
-                               <xsl:otherwise>
-                                       <xsl:value-of 
select="procedure/purpose" disable-output-escaping="yes"/>
-                               </xsl:otherwise>
-                       </xsl:choose>
-                       </dd>
-                       <dt>
-                               <label for="responsibility"><xsl:value-of 
select="php:function('lang','Procedure responsibility')" /></label>
-                       </dt>
-                       <dd>
-                       <xsl:choose>
-                               <xsl:when test="editable">
-                                       <textarea id="responsibility" 
name="responsibility" rows="5" cols="60"><xsl:value-of 
select="procedure/responsibility" /></textarea>
-                               </xsl:when>
-                               <xsl:otherwise>
-                                       <xsl:value-of 
select="procedure/responsibility" />
-                               </xsl:otherwise>
-                       </xsl:choose>
-                       </dd>
-                       <dt>
-                               <label for="description"><xsl:value-of 
select="php:function('lang','Procedure description')" /></label>
-                       </dt>
-                       <dd>
-                       <xsl:choose>
-                               <xsl:when test="editable">
-                                       <textarea id="description" 
name="description" rows="5" cols="60"><xsl:value-of 
select="procedure/description" disable-output-escaping="yes"/></textarea>
-                               </xsl:when>
-                               <xsl:otherwise>
-                                       <xsl:value-of 
select="procedure/description" disable-output-escaping="yes"/>
-                               </xsl:otherwise>
-                       </xsl:choose>
-                       </dd>
-                       <dt>
-                               <label for="reference"><xsl:value-of 
select="php:function('lang','Procedure Reference')" /></label>
-                       </dt>
-                       <dd>
-                       <xsl:choose>
-                               <xsl:when test="editable">
-                                       <input type="text" name="reference" 
id="reference" value="{procedure/reference}"  />
-                               </xsl:when>
-                               <xsl:otherwise>
-                                       <xsl:value-of 
select="procedure/reference" />
-                               </xsl:otherwise>
-                       </xsl:choose>
-                       </dd>   
-                       <dt>
+               </div>
+               <div>
+                       <label for="purpose"><xsl:value-of 
select="php:function('lang','Procedure purpose')" /></label>
+                       <xsl:value-of select="procedure/purpose" 
disable-output-escaping="yes"/>
+               </div>
+               <div>
+                       <label for="responsibility"><xsl:value-of 
select="php:function('lang','Procedure responsibility')" /></label>
+                       <xsl:value-of select="procedure/responsibility" />
+               </div>
+               <div>
+                       <label for="description"><xsl:value-of 
select="php:function('lang','Procedure description')" /></label>
+                       <xsl:value-of select="procedure/description" 
disable-output-escaping="yes"/>
+               </div>
+               <div>
+                       <label for="reference"><xsl:value-of 
select="php:function('lang','Procedure Reference')" /></label>
+                       <xsl:value-of select="procedure/reference" />
+               </div>
+               <div>
                        <label for="attachment"><xsl:value-of 
select="php:function('lang','Procedure Attachment')" /></label>
-                       </dt>
-                       <dd>
-                       <xsl:choose>
-                               <xsl:when test="editable">
-                                       <input type="text" name="attachment" 
id="attachment" value="{procedure/attachment}"  />
-                               </xsl:when>
-                               <xsl:otherwise>
-                                       <xsl:value-of 
select="procedure/attachment" />
-                               </xsl:otherwise>
-                       </xsl:choose>
-                       </dd>                   
-               </dl>           
+                       <xsl:value-of select="procedure/attachment" />
+               </div>          
 </div>
 <style>
-               .btn{
-                       background: none repeat scroll 0 0 #2647A0;
-                   color: #FFFFFF;
-                   display: inline-block;
-                   margin-right: 5px;
-                   padding: 5px 10px;
-                   text-decoration: none;
-                   border: 1px solid #173073;
-                   cursor: pointer;
-               }
+
+       #procedure{
+               font-family: arial;
+               font-size:16px;
+       }
+       #procedure div{
+               margin:10px 0;
+        }
+       label{ 
+               font-weight: bold;
+               display: inline-block;
+               width: 200px;
+       }
+
+       .btn {
+           background: none repeat scroll 0 0 #2647A0;
+           border: 1px solid #173073;
+           color: #FFFFFF;
+           cursor: pointer;
+           display: inline-block;
+           font-family: arial;
+           margin-right: 5px;
+           padding: 5px 20px;
+           text-decoration: none;
+       }
+       
+       ul{
+               list-style: none outside none;
+       }
+       
+       li{
+               list-style: none outside none;
+       }
+       
+       ul.groups li {
+           padding: 3px 0;
+       }
+       
+       ul.groups li.odd{
+           background: none repeat scroll 0 0 #DBE7F5;
+       }
+       
+       ul.groups h3 {
+           font-size: 18px;
+           margin: 0 0 5px;
+       }
                
-               ul{
-                       list-style: none outside none;
-               }
-               
-               li{
-                       list-style: none outside none;
-               }
-               
-               ul.groups li {
-                   padding: 3px 0;
-               }
-               
-               ul.groups li.odd{
-                   background: none repeat scroll 0 0 #DBE7F5;
-               }
-               
-               ul.groups h3 {
-                   font-size: 18px;
-                   margin: 0 0 5px;
-               }
-               
-               </style>
-               <a style="margin:20px 0 0 40px;" href="#print" class="btn" 
onClick="window.print()">Skriv ut</a>
+</style>
+<a style="margin:20px 0 0 40px;" href="#print" class="btn" 
onClick="window.print()">Skriv ut</a>
 </xsl:template>
\ No newline at end of file




reply via email to

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