fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [7533] property: tweak request


From: Sigurd Nes
Subject: [Fmsystem-commits] [7533] property: tweak request
Date: Fri, 26 Aug 2011 08:42:53 +0000

Revision: 7533
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7533
Author:   sigurdne
Date:     2011-08-26 08:42:53 +0000 (Fri, 26 Aug 2011)
Log Message:
-----------
property: tweak request

Modified Paths:
--------------
    trunk/property/inc/class.sorequest.inc.php
    trunk/property/inc/class.uirequest.inc.php
    trunk/property/templates/base/request.xsl

Modified: trunk/property/inc/class.sorequest.inc.php
===================================================================
--- trunk/property/inc/class.sorequest.inc.php  2011-08-25 13:15:48 UTC (rev 
7532)
+++ trunk/property/inc/class.sorequest.inc.php  2011-08-26 08:42:53 UTC (rev 
7533)
@@ -673,13 +673,13 @@
                                        $_condition_type = 
isset($value_type['condition_type']) && $value_type['condition_type'] ? 
$value_type['condition_type'] : $condition_type;
                                        $this->db->query("INSERT INTO 
fm_request_condition 
(request_id,condition_type,reference,degree,probability,consequence,user_id,entry_date)
 "
                                                . "VALUES ('"
-                                               . $request['id']. "','"
-                                               . $_condition_type . "',"
-                                               . $value_type['reference']. ","
-                                               . $value_type['degree']. ","
-                                               . $value_type['probability']. 
","
-                                               . $value_type['consequence']. 
","
-                                               . $this->account . ","
+                                               . (int) $request['id']. "','"
+                                               . (int) $_condition_type . "',"
+                                               . (int) 
$value_type['reference']. ","
+                                               . (int) $value_type['degree']. 
","
+                                               . (int) 
$value_type['probability']. ","
+                                               . (int) 
$value_type['consequence']. ","
+                                               . (int) $this->account . ","
                                                . time() . 
")",__LINE__,__FILE__);
                                }
                        }
@@ -863,13 +863,13 @@
                                        $_condition_type = 
isset($value_type['condition_type']) && $value_type['condition_type'] ? 
$value_type['condition_type'] : $condition_type;
                                        $this->db->query("INSERT INTO 
fm_request_condition 
(request_id,condition_type,reference,degree,probability,consequence,user_id,entry_date)
 "
                                                . "VALUES ('"
-                                               . $request['id']. "','"
-                                               . $_condition_type . "',"
-                                               . $value_type['reference']. ","
-                                               . $value_type['degree']. ","
-                                               . $value_type['probability']. 
","
-                                               . $value_type['consequence']. 
","
-                                               . $this->account . ","
+                                               . (int)$request['id']. "','"
+                                               . (int)$_condition_type . "',"
+                                               . 
(int)$value_type['reference']. ","
+                                               . (int)$value_type['degree']. 
","
+                                               . 
(int)$value_type['probability']. ","
+                                               . 
(int)$value_type['consequence']. ","
+                                               . (int)$this->account . ","
                                                . time() . 
")",__LINE__,__FILE__);
                                }
                        }

Modified: trunk/property/inc/class.uirequest.inc.php
===================================================================
--- trunk/property/inc/class.uirequest.inc.php  2011-08-25 13:15:48 UTC (rev 
7532)
+++ trunk/property/inc/class.uirequest.inc.php  2011-08-26 08:42:53 UTC (rev 
7533)
@@ -876,11 +876,14 @@
                                $location_code  = 
phpgw::get_var('location_code');
                                $tenant_id              = 
phpgw::get_var('tenant_id', 'int');
 
-                               $p_entity_id    = phpgw::get_var('p_entity_id', 
'int');
-                               $p_cat_id               = 
phpgw::get_var('p_cat_id', 'int');
-                               $values['p'][$p_entity_id]['p_entity_id']       
= $p_entity_id;
-                               $values['p'][$p_entity_id]['p_cat_id']          
= $p_cat_id;
-                               $values['p'][$p_entity_id]['p_num']             
= phpgw::get_var('p_num');
+                               if(phpgw::get_var('p_num'))
+                               {
+                                       $p_entity_id    = 
phpgw::get_var('p_entity_id', 'int');
+                                       $p_cat_id               = 
phpgw::get_var('p_cat_id', 'int');
+                                       
$values['p'][$p_entity_id]['p_entity_id']       = $p_entity_id;
+                                       $values['p'][$p_entity_id]['p_cat_id']  
        = $p_cat_id;
+                                       $values['p'][$p_entity_id]['p_num']     
        = phpgw::get_var('p_num');
+                               }
 
                                $origin         = phpgw::get_var('origin');
                                $origin_id      = phpgw::get_var('origin_id', 
'int');

Modified: trunk/property/templates/base/request.xsl
===================================================================
--- trunk/property/templates/base/request.xsl   2011-08-25 13:15:48 UTC (rev 
7532)
+++ trunk/property/templates/base/request.xsl   2011-08-26 08:42:53 UTC (rev 
7533)
@@ -754,25 +754,23 @@
 
        <xsl:template match="condition_list">
                <tr>
-                       <td class="small_text" align="left">
-                               <xsl:choose>
-                                       <xsl:when test="condition_type_list != 
''">
-                                               <select 
name="values[condition][{condition_type}][condition_type]" class="forms">
-                                                       <xsl:apply-templates 
select="condition_type_list/options"/>
-                                               </select>
-                                       </xsl:when>
-                                       <xsl:otherwise>
+                       <xsl:choose>
+                               <xsl:when test="condition_type_list != ''">
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       <td class="small_text" align="left">
                                                <xsl:value-of 
select="condition_type_name"/>
-                                       </xsl:otherwise>
-                               </xsl:choose>
-                       </td>
-
+                                       </td>
+                               </xsl:otherwise>
+                       </xsl:choose>
+               <!--
                        <td class="small_text" align="center">
                                <xsl:variable 
name="lang_reference_statustext"><xsl:value-of 
select="//lang_reference_statustext"/></xsl:variable>
                                <select 
name="values[condition][{condition_type}][reference]" class="forms" 
title="{$lang_reference_statustext}">
                                        <xsl:apply-templates 
select="reference/options"/>
                                </select>
                        </td>
+               -->
                        <td class="small_text" align="center">
                                <xsl:variable 
name="lang_degree_statustext"><xsl:value-of 
select="//lang_degree_statustext"/></xsl:variable>
                                <select 
name="values[condition][{condition_type}][degree]" class="forms" 
title="{$lang_degree_statustext}">
@@ -785,15 +783,27 @@
                                        <xsl:apply-templates 
select="probability/options"/>
                                </select>
                        </td>
+                       <xsl:choose>
+                               <xsl:when test="condition_type_list != ''">
+                                       <td class="small_text" align="left">
+                                               <select 
name="values[condition][{condition_type}][condition_type]" class="forms">
+                                                       <xsl:apply-templates 
select="condition_type_list/options"/>
+                                               </select>
+                                       </td>
+                               </xsl:when>
+                       </xsl:choose>
+
                        <td class="small_text" align="center">
                                <xsl:variable 
name="lang_consequence_statustext"><xsl:value-of 
select="//lang_consequence_statustext"/></xsl:variable>
                                <select 
name="values[condition][{condition_type}][consequence]" class="forms" 
title="{$lang_consequence_statustext}">
                                        <xsl:apply-templates 
select="consequence/options"/>
                                </select>
                        </td>
+               <!--
                        <td class="small_text" align="center">
                                <xsl:value-of select="failure"/>
                        </td>
+               -->
                        <td class="small_text" align="right">
                                <xsl:value-of select="weight"/>
                        </td>
@@ -905,24 +915,42 @@
 
        <xsl:template name="table_header_importance" 
xmlns:php="http://php.net/xsl";>
                <tr>
+                       <xsl:choose>
+                               <xsl:when test="//condition_type_list != ''">
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       <th width="20%" align="left">
+                                               <xsl:value-of 
select="php:function('lang', 'consequence type')" />
+                                       </th>
+                               </xsl:otherwise>
+                       </xsl:choose>
+                       <!--
                        <th width="20%" align="left">
-                               <xsl:value-of select="php:function('lang', 
'consequence type')" />
-                       </th>
-                       <th width="20%" align="left">
                                <xsl:value-of select="php:function('lang', 
'reference level')" />
                        </th>
+                       -->
                        <th width="20%" align="center">
                                <xsl:value-of select="php:function('lang', 
'condition degree')" />
                        </th>
                        <th width="20%" align="center">
                                <xsl:value-of select="php:function('lang', 
'Probability')" />
                        </th>
+                       <xsl:choose>
+                               <xsl:when test="//condition_type_list != ''">
+                                       <th width="20%" align="left">
+                                               <xsl:value-of 
select="php:function('lang', 'consequence type')" />
+                                       </th>
+                               </xsl:when>
+                       </xsl:choose>
+
                        <th width="20%" align="center">
                                <xsl:value-of select="php:function('lang', 
'Consequence')" />
                        </th>
+               <!--
                        <th width="5%" align="center">
                                <xsl:value-of select="php:function('lang', 
'failure')" />
                        </th>
+               -->
                        <th width="5%" align="center">
                                <xsl:value-of select="php:function('lang', 
'weight')" />
                        </th>




reply via email to

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