fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [9810]


From: Torstein
Subject: [Fmsystem-commits] [9810]
Date: Fri, 20 Jul 2012 08:47:52 +0000

Revision: 9810
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9810
Author:   vator
Date:     2012-07-20 08:47:51 +0000 (Fri, 20 Jul 2012)
Log Message:
-----------


Modified Paths:
--------------
    trunk/controller/inc/class.socontrol.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/model/class.check_list.inc.php
    trunk/controller/templates/base/check_list/check_list_tab_menu.xsl

Added Paths:
-----------
    trunk/controller/templates/base/check_list/add_case.xsl

Removed Paths:
-------------
    trunk/controller/templates/base/check_list/register_case.xsl

Modified: trunk/controller/inc/class.socontrol.inc.php
===================================================================
--- trunk/controller/inc/class.socontrol.inc.php        2012-07-19 06:30:51 UTC 
(rev 9809)
+++ trunk/controller/inc/class.socontrol.inc.php        2012-07-20 08:47:51 UTC 
(rev 9810)
@@ -242,7 +242,7 @@
                 * @param $role_id responsible role for carrying out the 
control  
                 * @return array of components as objects or arrays
                 */
-               public function get_controls_by_component($location_code, 
$from_date, $to_date, $repeat_type = '', $return_type = "return_object", 
$role_id = '')
+               public function get_controls_by_component($location_code, 
$from_date, $to_date, $repeat_type = '', $return_type = "return_object", 
$role_id = '', $filter = null)
                {
                        $controls_array = array();
                        
@@ -255,7 +255,7 @@
                        $sql  .= "JOIN controller_control c on cl.control_id = 
c.id ";
                        $sql  .= "JOIN fm_responsibility_role ON 
fm_responsibility_role.id = c.responsibility_id ";
                        $sql  .= "AND bim_item.type = bim_type.id ";
-                       $sql  .= "AND bim_item.location_code LIKE 
'$location_code%' ";
+                       $sql  .= "AND bim_item.type = bim_type.id ";
                        
                        if( is_numeric($repeat_type))
                        {
@@ -269,6 +269,11 @@
                        $sql .= "AND (c.start_date <= $from_date AND c.end_date 
IS NULL ";
                        $sql .= "OR c.start_date > $from_date AND c.start_date 
< $to_date) ";
                        
+                       if($filter != null)
+                       {
+                               $sql  .= "AND " . $filter;      
+                       }
+                       
                        $sql  .= "ORDER BY bim_item.id ";
                         
                        $this->db->query($sql);

Modified: trunk/controller/inc/class.uicalendar.inc.php
===================================================================
--- trunk/controller/inc/class.uicalendar.inc.php       2012-07-19 06:30:51 UTC 
(rev 9809)
+++ trunk/controller/inc/class.uicalendar.inc.php       2012-07-20 08:47:51 UTC 
(rev 9810)
@@ -120,8 +120,16 @@
                        // Fetches controls for location within specified time 
period
                        $controls_for_location_array = 
$this->so_control->get_controls_by_location($location_code, $from_date_ts, 
$to_date_ts, $repeat_type, "return_object", $role );
 
-                       // Fetches all controls for the components for a 
location within time period
-                       $components_with_controls_array = 
$this->so_control->get_controls_by_component($location_code, $from_date_ts, 
$to_date_ts, $repeat_type, "return_object", $role);
+                       if($level == 1){
+                               // Fetches all controls for the components for 
a location within time period
+                               $filter = "bim_item.location_code = 
'$location_code' ";
+                               $components_with_controls_array = 
$this->so_control->get_controls_by_component($location_code, $from_date_ts, 
$to_date_ts, $repeat_type, "return_object", $role, $filter);      
+                       }else
+                       {
+                               // Fetches all controls for the components for 
a location within time period
+                               $filter = "bim_item.location_code LIKE 
'$location_code%' ";
+                               $components_with_controls_array = 
$this->so_control->get_controls_by_component($location_code, $from_date_ts, 
$to_date_ts, $repeat_type, "return_object", $role, $filter);      
+                       }
                        
                        // Fetches all control ids with check lists for 
specified time period
                        $control_id_with_check_list_array = 
$this->so->get_check_lists_for_location($location_code, $from_date_ts, 
$to_date_ts);
@@ -253,8 +261,17 @@
                        // Fetches all controls for the location within time 
period
                        $controls_for_location_array = 
$this->so_control->get_controls_by_location($location_code, $from_date_ts, 
$to_date_ts, $repeat_type, "return_object", $role);
                        
-                       // Fetches all controls for the components for a 
location within time period
-                       $components_with_controls_array = 
$this->so_control->get_controls_by_component($location_code, $from_date_ts, 
$to_date_ts, $repeat_type, "return_object", $role);
+                       if($level == 1){
+                               // Fetches all controls for the components for 
a location within time period
+                               $filter = "bim_item.location_code = 
'$location_code' ";
+                               $components_with_controls_array = 
$this->so_control->get_controls_by_component($location_code, $from_date_ts, 
$to_date_ts, $repeat_type, "return_object", $role, $filter);      
+                       }else
+                       {
+                               // Fetches all controls for the components for 
a location within time period
+                               $filter = "bim_item.location_code LIKE 
'$location_code%' ";
+                               $components_with_controls_array = 
$this->so_control->get_controls_by_component($location_code, $from_date_ts, 
$to_date_ts, $repeat_type, "return_object", $role, $filter);      
+                       }
+                       
                  
                        // Loops through controls with repeat type day or week
                        // and populates array that contains aggregated open 
cases pr month.
@@ -431,8 +448,8 @@
                                        // Loops through controls in 
controls_for_location_array and populates aggregate open cases pr month array.
                                        $agg_open_cases_pr_month_array = 
$this->build_agg_open_cases_pr_month_array($cl_criteria, $year, $from_month, 
$to_month);
                                        
-                                       $year_calendar = new 
year_calendar($control, $year, null, $curr_location_code, "location");
-                                       $calendar_array = 
$year_calendar->build_agg_month_calendar($agg_open_cases_pr_month_array);
+                                       $year_calendar_agg = new 
year_calendar_agg($control, $year, $curr_location_code);
+                                       $calendar_array = 
$year_calendar->build_calendar($agg_open_cases_pr_month_array);
                                        $locations_with_calendar_array[] = 
array( "location" => $location, "calendar_array" => $calendar_array );
                                }
                                
@@ -455,8 +472,8 @@
                                        // Loops through controls in 
controls_for_location_array and populates aggregate open cases pr month array.
                                        $agg_open_cases_pr_month_array = 
$this->build_agg_open_cases_pr_month_array($cl_criteria, $year, $from_month, 
$to_month);
                                        
-                                       $year_calendar = new year_calendar( 
$control, $year, $component, null, "component" );
-                                       $calendar_array = 
$year_calendar->build_agg_calendar($agg_open_cases_pr_month_array);
+                                       $year_calendar_agg = new 
year_calendar_agg( $control, $year, $location_code );
+                                       $calendar_array = 
$year_calendar_agg->build_calendar($agg_open_cases_pr_month_array);
                                        $components_with_calendar_array[] = 
array("component" => $component->toArray(), "calendar_array" => 
$calendar_array);
                                }
                        }

Modified: trunk/controller/inc/class.uicase.inc.php
===================================================================
--- trunk/controller/inc/class.uicase.inc.php   2012-07-19 06:30:51 UTC (rev 
9809)
+++ trunk/controller/inc/class.uicase.inc.php   2012-07-20 08:47:51 UTC (rev 
9810)
@@ -48,7 +48,7 @@
                private $so_check_item;
                
                var $public_functions = array(
-                                                                       
'register_case'                                 => true,
+                                                                       
'add_case'                                                      => true,
                                                                        
'save_case'                                             => true,
                                                                        
'create_case_message'   => true,
                                                                        
'view_case_message'             => true,
@@ -70,7 +70,7 @@
                        $this->so_control_item = 
CreateObject('controller.socontrol_item');
                }       
                
-               function register_case(){
+               function add_case(){
                        $check_list_id = phpgw::get_var('check_list_id');
                        $control_item_id = phpgw::get_var('control_item_id');
                        $case_descr = phpgw::get_var('case_descr');

Modified: trunk/controller/inc/class.uicheck_list.inc.php
===================================================================
--- trunk/controller/inc/class.uicheck_list.inc.php     2012-07-19 06:30:51 UTC 
(rev 9809)
+++ trunk/controller/inc/class.uicheck_list.inc.php     2012-07-20 08:47:51 UTC 
(rev 9810)
@@ -57,7 +57,7 @@
                                                                                
'view_control_info'                             => true,
                                                                                
'view_cases_for_check_list'     => true,
                                                                                
'print_check_list'                                      => true,
-                                                                               
'register_case'                                                 => true,
+                                                                               
'add_case'                                                      => true,
                                                                                
'view_open_cases'                                               => true,
                                                                                
'view_closed_cases'                                     => true,
                                                                                
'view_control_details'                  => true,
@@ -277,6 +277,7 @@
                        
                        if($completed_date != ''){
                                $completed_date_ts = 
date_helper::get_timestamp_from_date( $completed_date, "d/m-Y" );
+                               $status = controller_check_list::STATUS_DONE;
                        }else{
                                $completed_date_ts = 0;
                        }               
@@ -552,7 +553,7 @@
                }
                                                
                // Displays control groups and control items for a check list
-               function register_case()
+               function add_case()
                {
                        $check_list_id = phpgw::get_var('check_list_id');
                        
@@ -563,7 +564,7 @@
                
                        $control_groups_with_items_array = array();
                        
-               $component_id = $check_list->get_component_id();
+                       $component_id = $check_list->get_component_id();
 
                        if($component_id > 0)
                        {
@@ -663,7 +664,7 @@
                        self::add_javascript('controller', 'controller', 
'custom_ui.js');
                        self::add_javascript('controller', 'controller', 
'ajax.js');
                        
-                       
self::render_template_xsl(array('check_list/check_list_tab_menu', 
'check_list/register_case'), $data);
+                       
self::render_template_xsl(array('check_list/check_list_tab_menu', 
'check_list/add_case'), $data);
                }
                
                function view_open_cases()

Modified: trunk/controller/inc/model/class.check_list.inc.php
===================================================================
--- trunk/controller/inc/model/class.check_list.inc.php 2012-07-19 06:30:51 UTC 
(rev 9809)
+++ trunk/controller/inc/model/class.check_list.inc.php 2012-07-20 08:47:51 UTC 
(rev 9810)
@@ -183,8 +183,45 @@
                        );
                }
                
-               public function validate(){
-                       
-               
+               public function validate()
+               {
+                       $status = true;
+       
+                       // Validate CONTROL ID
+                       if( empty( $this->control_id ) )
+                 {
+                       $status = false;
+                       $this->error_msg_array['control_id'] = "error_msg_2";
+                 }
+                 
+                 // Validate STATUS                              
+                       if( empty( $this->status ) )
+                 {
+                       $status = false;
+                       $this->error_msg_array['status'] = "error_msg_2";
+                 }
+                                 
+                 // Validate STATUS                              
+                       if( ($this->status == Check_list::STATUS_DONE) && 
empty($this->completed_date) )
+                 {
+                       $status = false;
+                       $this->error_msg_array['completed_date'] = 
"error_msg_2";
+                 }
+                 
+                 // Validate DEADLINE                    
+                       if( empty( $this->deadline ) )
+                 {
+                       $status = false;
+                       $this->error_msg_array['deadline'] = "error_msg_2";
+                 }
+                 
+                       // Validate DEADLINE                      
+                       if( empty( $this->location_code ) && empty( 
$this->component_id ))
+                 {
+                       $status = false;
+                       $this->error_msg_array['deadline'] = "error_msg_2";
+                 }
+                 
+                 return $status;
                }
        }

Copied: trunk/controller/templates/base/check_list/add_case.xsl (from rev 9723, 
trunk/controller/templates/base/check_list/register_case.xsl)
===================================================================
--- trunk/controller/templates/base/check_list/add_case.xsl                     
        (rev 0)
+++ trunk/controller/templates/base/check_list/add_case.xsl     2012-07-20 
08:47:51 UTC (rev 9810)
@@ -0,0 +1,232 @@
+<!-- $Id: choose_control_items.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
+
+<xsl:template match="data" xmlns:php="http://php.net/xsl";>
+
+<div id="main_content" class="medium">
+       
+       <div id="check-list-heading">
+               <div class="box-1">
+                       <h1>Kontroll: <xsl:value-of 
select="control/title"/></h1>
+                       <xsl:choose>
+                               <xsl:when test="type = 'component'">
+                                       <h2><xsl:value-of 
select="component_array/xml_short_desc"/></h2>
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       <xsl:choose>
+                                               <xsl:when test="location_level 
= 1">
+                                                       <h2>Eiendom: 
<xsl:value-of select="location_array/loc1_name"/></h2>
+                                               </xsl:when>
+                                               <xsl:otherwise>
+                                                               <h2>Bygg: 
<xsl:value-of select="location_array/loc2_name"/></h2>
+                                               </xsl:otherwise>
+                                       </xsl:choose>
+                               </xsl:otherwise>
+                       </xsl:choose>
+               </div>
+               <div class="box-2 select-box">
+                       <a>
+                               <xsl:attribute name="href">
+                                       
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_year</xsl:text>
+                                       <xsl:text>&amp;year=</xsl:text>
+                                       <xsl:value-of select="current_year"/>
+                                       <xsl:text>&amp;location_code=</xsl:text>
+                                       <xsl:choose>
+                                         <xsl:when test="type = 'component'">
+                                                 <xsl:value-of 
select="building_location_code"/>
+                                               </xsl:when>
+                                               <xsl:otherwise>
+                                                 <xsl:value-of 
select="location_array/location_code"/>
+                                               </xsl:otherwise>
+                                       </xsl:choose>
+                               </xsl:attribute>
+                               Kontrolplan for bygg/eiendom (år)
+                       </a>
+                       <a class="last">
+                               <xsl:attribute name="href">
+                                       
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
+                                       <xsl:text>&amp;year=</xsl:text>
+                                       <xsl:value-of select="current_year"/>
+                                       <xsl:text>&amp;month=</xsl:text>
+                                       <xsl:value-of 
select="current_month_nr"/>
+                                       <xsl:text>&amp;location_code=</xsl:text>
+                                       <xsl:choose>
+                                         <xsl:when test="type = 'component'">
+                                                 <xsl:value-of 
select="building_location_code"/>
+                                               </xsl:when>
+                                               <xsl:otherwise>
+                                                 <xsl:value-of 
select="location_array/location_code"/>
+                                               </xsl:otherwise>
+                                       </xsl:choose>
+                               </xsl:attribute>
+                               Kontrolplan for bygg/eiendom (måned)
+                       </a>
+               </div>
+               
+               <!-- ==================  CHECKLIST TAB MENU  
===================== -->
+               <xsl:call-template name="check_list_tab_menu" />
+       </div>
+               
+       
+
+       <div id="view_cases">
+
+               <h3 class="box_header ext">Registrer sak/måling</h3>
+               <div class="tab_item active ext">
+               
+               <div class="expand_menu"><div class="expand_all">Vis 
alle</div><div class="collapse_all focus">Skjul alle</div></div>
+               
+               <ul class="control_groups">
+                       <xsl:for-each select="control_groups_with_items_array">
+                       <xsl:choose>
+                               <xsl:when test="control_items/child::node()">
+                                       <li>
+                                               <h3><xsl:value-of 
select="control_group/group_name"/></h3>                              
+                                               <ul class="expand_list">
+                                                       <xsl:for-each 
select="control_items">
+                                                               <li>
+                                                                       
<h4><img src="controller/images/arrow_right.png" /><span><xsl:value-of 
select="title"/></span></h4>     
+                                                                               
<xsl:choose>
+                                                                               
        <xsl:when test="type = 'control_item_type_1'">
+                                                                               
                <form class="frm_register_case expand_item" 
action="index.php?menuaction=controller.uicase.add_case&amp;phpgw_return_as=json"
 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" />
+                                                                               
                        <input name="type" type="hidden" 
value="control_item_type_1" />
+                                                                               
                            
+                                                                               
                <div>
+                                                                               
                        <label class="comment">Beskrivelse av sak</label>
+                                                                               
                            <textarea name="case_descr">
+                                                                               
                                        <xsl:value-of select="comment"/>
+                                                                               
                                </textarea>
+                                                                               
                        </div>
+                                                                               
                        <input type="submit" class="btn not_active" 
name="save_control" value="Lagre sak" />
+                                                                               
                </form>
+                                                                               
        </xsl:when>
+                                                                               
        <xsl:when test="type = 'control_item_type_2'">
+                                                                               
        <form class="frm_register_case expand_item" 
action="index.php?menuaction=controller.uicase.add_case&amp;phpgw_return_as=json"
 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="type" type="hidden" 
value="control_item_type_2" />
+                                                                               
                
+                                                                               
                        <div class="row">
+                                                                               
                                <label>Status</label>
+                                                                               
                                <select name="status">
+                                                                               
                                        <option value="0" 
SELECTED="SELECTED">Åpen</option>
+                                                                               
                                        <option value="1" >Lukket</option>
+                                                                               
                                        <option value="2" >Venter på 
tilbakemelding</option>
+                                                                               
                                </select>
+                                                                               
                   </div>
+                                                                               
               <div class="row">
+                                                                               
                 <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 class="row">
+                                                                               
                         <label class="comment">Beskrivelse av sak</label>
+                                                                               
                         <textarea name="case_descr">
+                                                                               
                                        <xsl:value-of select="comment"/>
+                                                                               
                                 </textarea>
+                                                                               
                   </div>
+                                                                               
               <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'register_error')" /></xsl:variable>
+                                                                               
                   <input type="submit" name="save_control" value="Lagre 
måling" class="not_active" title="{$lang_save}" />
+                                                                               
                </form>
+                                                                               
        </xsl:when>
+                                                                               
        <xsl:when test="type = 'control_item_type_3'">
+                                                                               
                <form class="frm_register_case expand_item" 
action="index.php?menuaction=controller.uicase.add_case&amp;phpgw_return_as=json"
 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="type" type="hidden" 
value="control_item_type_3" />
+                                                                               
                
+                                                                               
                        <div class="row">
+                                                                               
                                <label>Status</label>
+                                                                               
                                <select name="status">
+                                                                               
                                        <option value="0" 
SELECTED="SELECTED">Åpen</option>
+                                                                               
                                        <option value="1" >Lukket</option>
+                                                                               
                                        <option value="2" >Venter på 
tilbakemelding</option>
+                                                                               
                                </select>
+                                                                               
                   </div>
+                                                                               
               <div class="row">
+                                                                               
                 <label class="comment">Velg verdi fra liste</label>
+                                                                               
                        <select name="option_value">
+                                                                               
                                <xsl:for-each select="options_array"> 
+                                                                               
                                                <option>
+                                                                               
                                                        <xsl:attribute 
name="value"><xsl:value-of select="option_value"/></xsl:attribute>
+                                                                               
                                                        <xsl:value-of 
select="option_value"/>
+                                                                               
                                                 </option>      
+                                                                               
                                        </xsl:for-each>
+                                                                               
                                </select>
+                                                                               
               </div>
+                                                                               
               <div class="row">
+                                                                               
                         <label class="comment">Beskrivelse av sak</label>
+                                                                               
                         <textarea name="case_descr">
+                                                                               
                                        <xsl:value-of select="comment"/>
+                                                                               
                                 </textarea>
+                                                                               
                   </div>
+                                                                               
               <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'register_error')" /></xsl:variable>
+                                                                               
                   <input type="submit" name="save_control" value="Lagre 
sak/måling" class="not_active" title="{$lang_save}" />
+                                                                               
                </form>
+                                                                               
        </xsl:when>
+                                                                               
        <xsl:when test="type = 'control_item_type_4'">
+                                                                               
                <form class="frm_register_case expand_item" 
action="index.php?menuaction=controller.uicase.add_case&amp;phpgw_return_as=json"
 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="type" type="hidden" 
value="control_item_type_4" />
+                                                                               
                
+                                                                               
                        <div class="row">
+                                                                               
                                <label>Status</label>
+                                                                               
                                <select name="status">
+                                                                               
                                        <option value="0" 
SELECTED="SELECTED">Åpen</option>
+                                                                               
                                        <option value="1" >Lukket</option>
+                                                                               
                                        <option value="2" >Venter på 
tilbakemelding</option>
+                                                                               
                                </select>
+                                                                               
                   </div>
+                                                                               
               <div class="row">
+                                                                               
                 <label class="comment">Velg verdi fra liste</label>
+                                                                               
                        <select name="option_value">
+                                                                               
                                <xsl:for-each select="options_array"> 
+                                                                               
                                                <option>
+                                                                               
                                                        <xsl:attribute 
name="value"><xsl:value-of select="option_value"/></xsl:attribute>
+                                                                               
                                                        <xsl:value-of 
select="option_value"/>
+                                                                               
                                                 </option>      
+                                                                               
                                        </xsl:for-each>
+                                                                               
                                </select>
+                                                                               
               </div>
+                                                                               
               <div class="row">
+                                                                               
                         <label class="comment">Beskrivelse av sak</label>
+                                                                               
                         <textarea name="case_descr">
+                                                                               
                                        <xsl:value-of select="comment"/>
+                                                                               
                                 </textarea>
+                                                                               
                   </div>
+                                                                               
               <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'register_error')" /></xsl:variable>
+                                                                               
                   <input type="submit" name="save_control" value="Lagre 
sak/måling" class="not_active" title="{$lang_save}" />
+                                                                               
                </form>
+                                                                               
        </xsl:when>
+                                                                               
</xsl:choose>   
+                                                                       
+                                                               </li>
+                                                       </xsl:for-each>
+                                               </ul>
+                                       </li>
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       <li class="list_item">
+                                               <h3><xsl:value-of 
select="control_group/group_name"/></h3>
+                                               <div>Ingen kontrollpunkt for 
denne gruppen</div>
+                                       </li>
+                               </xsl:otherwise>
+                       </xsl:choose>
+                       </xsl:for-each>
+               </ul>
+       </div>
+</div>
+</div>
+</xsl:template>


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

Modified: trunk/controller/templates/base/check_list/check_list_tab_menu.xsl
===================================================================
--- trunk/controller/templates/base/check_list/check_list_tab_menu.xsl  
2012-07-19 06:30:51 UTC (rev 9809)
+++ trunk/controller/templates/base/check_list/check_list_tab_menu.xsl  
2012-07-20 08:47:51 UTC (rev 9810)
@@ -46,7 +46,7 @@
                        <!-- ==================  REGISTER NEW CASE  
===================== -->
                        <a class="btn focus first">
                                <xsl:attribute name="href">
-                                       
<xsl:text>index.php?menuaction=controller.uicheck_list.register_case</xsl:text>
+                                       
<xsl:text>index.php?menuaction=controller.uicheck_list.add_case</xsl:text>
                                        <xsl:text>&amp;check_list_id=</xsl:text>
                                        <xsl:value-of select="check_list/id"/>
                                </xsl:attribute>

Deleted: trunk/controller/templates/base/check_list/register_case.xsl
===================================================================
--- trunk/controller/templates/base/check_list/register_case.xsl        
2012-07-19 06:30:51 UTC (rev 9809)
+++ trunk/controller/templates/base/check_list/register_case.xsl        
2012-07-20 08:47:51 UTC (rev 9810)
@@ -1,232 +0,0 @@
-<!-- $Id: choose_control_items.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
-
-<xsl:template match="data" xmlns:php="http://php.net/xsl";>
-
-<div id="main_content" class="medium">
-       
-       <div id="check-list-heading">
-               <div class="box-1">
-                       <h1>Kontroll: <xsl:value-of 
select="control/title"/></h1>
-                       <xsl:choose>
-                               <xsl:when test="type = 'component'">
-                                       <h2><xsl:value-of 
select="component_array/xml_short_desc"/></h2>
-                               </xsl:when>
-                               <xsl:otherwise>
-                                       <xsl:choose>
-                                               <xsl:when test="location_level 
= 1">
-                                                       <h2>Eiendom: 
<xsl:value-of select="location_array/loc1_name"/></h2>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                               <h2>Bygg: 
<xsl:value-of select="location_array/loc2_name"/></h2>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                               </xsl:otherwise>
-                       </xsl:choose>
-               </div>
-               <div class="box-2 select-box">
-                       <a>
-                               <xsl:attribute name="href">
-                                       
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_year</xsl:text>
-                                       <xsl:text>&amp;year=</xsl:text>
-                                       <xsl:value-of select="current_year"/>
-                                       <xsl:text>&amp;location_code=</xsl:text>
-                                       <xsl:choose>
-                                         <xsl:when test="type = 'component'">
-                                                 <xsl:value-of 
select="building_location_code"/>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                 <xsl:value-of 
select="location_array/location_code"/>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                               </xsl:attribute>
-                               Kontrolplan for bygg/eiendom (år)
-                       </a>
-                       <a class="last">
-                               <xsl:attribute name="href">
-                                       
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
-                                       <xsl:text>&amp;year=</xsl:text>
-                                       <xsl:value-of select="current_year"/>
-                                       <xsl:text>&amp;month=</xsl:text>
-                                       <xsl:value-of 
select="current_month_nr"/>
-                                       <xsl:text>&amp;location_code=</xsl:text>
-                                       <xsl:choose>
-                                         <xsl:when test="type = 'component'">
-                                                 <xsl:value-of 
select="building_location_code"/>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                 <xsl:value-of 
select="location_array/location_code"/>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                               </xsl:attribute>
-                               Kontrolplan for bygg/eiendom (måned)
-                       </a>
-               </div>
-               
-               <!-- ==================  CHECKLIST TAB MENU  
===================== -->
-               <xsl:call-template name="check_list_tab_menu" />
-       </div>
-               
-       
-
-       <div id="view_cases">
-
-               <h3 class="box_header ext">Registrer sak/måling</h3>
-               <div class="tab_item active ext">
-               
-               <div class="expand_menu"><div class="expand_all">Vis 
alle</div><div class="collapse_all focus">Skjul alle</div></div>
-               
-               <ul class="control_groups">
-                       <xsl:for-each select="control_groups_with_items_array">
-                       <xsl:choose>
-                               <xsl:when test="control_items/child::node()">
-                                       <li>
-                                               <h3><xsl:value-of 
select="control_group/group_name"/></h3>                              
-                                               <ul class="expand_list">
-                                                       <xsl:for-each 
select="control_items">
-                                                               <li>
-                                                                       
<h4><img src="controller/images/arrow_right.png" /><span><xsl:value-of 
select="title"/></span></h4>     
-                                                                               
<xsl:choose>
-                                                                               
        <xsl:when test="type = 'control_item_type_1'">
-                                                                               
                <form class="frm_register_case expand_item" 
action="index.php?menuaction=controller.uicase.register_case&amp;phpgw_return_as=json"
 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" />
-                                                                               
                        <input name="type" type="hidden" 
value="control_item_type_1" />
-                                                                               
                            
-                                                                               
                <div>
-                                                                               
                        <label class="comment">Beskrivelse av sak</label>
-                                                                               
                            <textarea name="case_descr">
-                                                                               
                                        <xsl:value-of select="comment"/>
-                                                                               
                                </textarea>
-                                                                               
                        </div>
-                                                                               
                        <input type="submit" class="btn not_active" 
name="save_control" value="Lagre sak" />
-                                                                               
                </form>
-                                                                               
        </xsl:when>
-                                                                               
        <xsl:when test="type = 'control_item_type_2'">
-                                                                               
        <form class="frm_register_case expand_item" 
action="index.php?menuaction=controller.uicase.register_case&amp;phpgw_return_as=json"
 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="type" type="hidden" 
value="control_item_type_2" />
-                                                                               
                
-                                                                               
                        <div class="row">
-                                                                               
                                <label>Status</label>
-                                                                               
                                <select name="status">
-                                                                               
                                        <option value="0" 
SELECTED="SELECTED">Åpen</option>
-                                                                               
                                        <option value="1" >Lukket</option>
-                                                                               
                                        <option value="2" >Venter på 
tilbakemelding</option>
-                                                                               
                                </select>
-                                                                               
                   </div>
-                                                                               
               <div class="row">
-                                                                               
                 <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 class="row">
-                                                                               
                         <label class="comment">Beskrivelse av sak</label>
-                                                                               
                         <textarea name="case_descr">
-                                                                               
                                        <xsl:value-of select="comment"/>
-                                                                               
                                 </textarea>
-                                                                               
                   </div>
-                                                                               
               <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'register_error')" /></xsl:variable>
-                                                                               
                   <input type="submit" name="save_control" value="Lagre 
måling" class="not_active" title="{$lang_save}" />
-                                                                               
                </form>
-                                                                               
        </xsl:when>
-                                                                               
        <xsl:when test="type = 'control_item_type_3'">
-                                                                               
                <form class="frm_register_case expand_item" 
action="index.php?menuaction=controller.uicase.register_case&amp;phpgw_return_as=json"
 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="type" type="hidden" 
value="control_item_type_3" />
-                                                                               
                
-                                                                               
                        <div class="row">
-                                                                               
                                <label>Status</label>
-                                                                               
                                <select name="status">
-                                                                               
                                        <option value="0" 
SELECTED="SELECTED">Åpen</option>
-                                                                               
                                        <option value="1" >Lukket</option>
-                                                                               
                                        <option value="2" >Venter på 
tilbakemelding</option>
-                                                                               
                                </select>
-                                                                               
                   </div>
-                                                                               
               <div class="row">
-                                                                               
                 <label class="comment">Velg verdi fra liste</label>
-                                                                               
                        <select name="option_value">
-                                                                               
                                <xsl:for-each select="options_array"> 
-                                                                               
                                                <option>
-                                                                               
                                                        <xsl:attribute 
name="value"><xsl:value-of select="option_value"/></xsl:attribute>
-                                                                               
                                                        <xsl:value-of 
select="option_value"/>
-                                                                               
                                                 </option>      
-                                                                               
                                        </xsl:for-each>
-                                                                               
                                </select>
-                                                                               
               </div>
-                                                                               
               <div class="row">
-                                                                               
                         <label class="comment">Beskrivelse av sak</label>
-                                                                               
                         <textarea name="case_descr">
-                                                                               
                                        <xsl:value-of select="comment"/>
-                                                                               
                                 </textarea>
-                                                                               
                   </div>
-                                                                               
               <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'register_error')" /></xsl:variable>
-                                                                               
                   <input type="submit" name="save_control" value="Lagre 
sak/måling" class="not_active" title="{$lang_save}" />
-                                                                               
                </form>
-                                                                               
        </xsl:when>
-                                                                               
        <xsl:when test="type = 'control_item_type_4'">
-                                                                               
                <form class="frm_register_case expand_item" 
action="index.php?menuaction=controller.uicase.register_case&amp;phpgw_return_as=json"
 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="type" type="hidden" 
value="control_item_type_4" />
-                                                                               
                
-                                                                               
                        <div class="row">
-                                                                               
                                <label>Status</label>
-                                                                               
                                <select name="status">
-                                                                               
                                        <option value="0" 
SELECTED="SELECTED">Åpen</option>
-                                                                               
                                        <option value="1" >Lukket</option>
-                                                                               
                                        <option value="2" >Venter på 
tilbakemelding</option>
-                                                                               
                                </select>
-                                                                               
                   </div>
-                                                                               
               <div class="row">
-                                                                               
                 <label class="comment">Velg verdi fra liste</label>
-                                                                               
                        <select name="option_value">
-                                                                               
                                <xsl:for-each select="options_array"> 
-                                                                               
                                                <option>
-                                                                               
                                                        <xsl:attribute 
name="value"><xsl:value-of select="option_value"/></xsl:attribute>
-                                                                               
                                                        <xsl:value-of 
select="option_value"/>
-                                                                               
                                                 </option>      
-                                                                               
                                        </xsl:for-each>
-                                                                               
                                </select>
-                                                                               
               </div>
-                                                                               
               <div class="row">
-                                                                               
                         <label class="comment">Beskrivelse av sak</label>
-                                                                               
                         <textarea name="case_descr">
-                                                                               
                                        <xsl:value-of select="comment"/>
-                                                                               
                                 </textarea>
-                                                                               
                   </div>
-                                                                               
               <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'register_error')" /></xsl:variable>
-                                                                               
                   <input type="submit" name="save_control" value="Lagre 
sak/måling" class="not_active" title="{$lang_save}" />
-                                                                               
                </form>
-                                                                               
        </xsl:when>
-                                                                               
</xsl:choose>   
-                                                                       
-                                                               </li>
-                                                       </xsl:for-each>
-                                               </ul>
-                                       </li>
-                               </xsl:when>
-                               <xsl:otherwise>
-                                       <li class="list_item">
-                                               <h3><xsl:value-of 
select="control_group/group_name"/></h3>
-                                               <div>Ingen kontrollpunkt for 
denne gruppen</div>
-                                       </li>
-                               </xsl:otherwise>
-                       </xsl:choose>
-                       </xsl:for-each>
-               </ul>
-       </div>
-</div>
-</div>
-</xsl:template>




reply via email to

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