fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10265]


From: Torstein
Subject: [Fmsystem-commits] [10265]
Date: Fri, 19 Oct 2012 07:36:47 +0000

Revision: 10265
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10265
Author:   vator
Date:     2012-10-19 07:36:45 +0000 (Fri, 19 Oct 2012)
Log Message:
-----------


Modified Paths:
--------------
    trunk/logistic/inc/class.uirequirement.inc.php
    trunk/logistic/templates/base/requirement/requirement_item.xsl

Modified: trunk/logistic/inc/class.uirequirement.inc.php
===================================================================
--- trunk/logistic/inc/class.uirequirement.inc.php      2012-10-19 06:25:05 UTC 
(rev 10264)
+++ trunk/logistic/inc/class.uirequirement.inc.php      2012-10-19 07:36:45 UTC 
(rev 10265)
@@ -269,30 +269,36 @@
                        $requirement_id = phpgw::get_var('id');
                        $activity_id = phpgw::get_var('activity_id');
 
-                       echo $requirement_id;
-                       
                        if ($requirement_id && is_numeric($requirement_id))
                        {
                                $requirement = 
$this->so->get_single($requirement_id);
+                               
+                               $activity = $this->so_activity->get_single( 
$requirement->get_activity_id() );
+                               $project = $this->so_project->get_single( 
$activity->get_project_id() );
                        }
                        else
                        {
                                $requirement = new logistic_requirement();
+                               
+                               if ($activity_id && is_numeric($activity_id))
+                               {
+                                       $activity = 
$this->so_activity->get_single( $activity_id );
+                                       $project = 
$this->so_project->get_single( $activity->get_project_id() );
+                               }
                        }
                        
-                       if ($activity_id && is_numeric($activity_id))
-                       {
-                               $activity = $this->so_activity->get_single( 
$activity_id );
-                               $project = $this->so_project->get_single( 
$activity->get_project_id() );
-                       }
-                       
                        if (isset($_POST['save_requirement']))
                        {
                                $requirement->set_id( phpgw::get_var('id') );
-                               $requirement->set_activity_id( 
phpgw::get_var('activity_id') );
+                               
                                $requirement->set_no_of_items( 
phpgw::get_var('no_of_items') );
                                $requirement->set_location_id( 
phpgw::get_var('location_id') );
-                       
+                               
+                               if($requirement->get_activity_id() == "" | 
$requirement->get_activity_id() == 0)
+                               {
+                                       $requirement->set_activity_id( 
phpgw::get_var('activity_id') ); 
+                               }
+                               
                                if(phpgw::get_var('start_date','string') != '')
                                {
                                        $start_date_ts = 
phpgwapi_datetime::date_to_timestamp( phpgw::get_var('start_date','string') );

Modified: trunk/logistic/templates/base/requirement/requirement_item.xsl
===================================================================
--- trunk/logistic/templates/base/requirement/requirement_item.xsl      
2012-10-19 06:25:05 UTC (rev 10264)
+++ trunk/logistic/templates/base/requirement/requirement_item.xsl      
2012-10-19 07:36:45 UTC (rev 10265)
@@ -53,7 +53,7 @@
                                <dd>
                                        <xsl:choose>
                                                <xsl:when test="editable">
-                                                       <input style="width: 
20px;" id="no_of_items" name="no_of_items" type="text" />
+                                                       <input style="width: 
20px;" id="no_of_items" name="no_of_items" type="text" 
value="{requirement/no_of_items}" />
                                                </xsl:when>
                                                <xsl:otherwise>
                                                <span><xsl:value-of 
select="requirement/no_of_items"/></span>
@@ -70,9 +70,18 @@
                                                        <select 
name="location_id" id="location_id">
                                                                <option 
value="">Velg kategori</option>
                                                                <xsl:for-each 
select="distict_locations">
-                                                                       <option 
value="{location_id}">
-                                                                               
<xsl:value-of select="descr"/>
-                                                                       
</option>
+                                                                       
<xsl:choose>
+                                                                               
<xsl:when test="//requirement/location_id = location_id">
+                                                                               
        <option selected="selected" value="{location_id}">
+                                                                               
                <xsl:value-of select="descr"/>
+                                                                               
        </option>
+                                                                               
</xsl:when>
+                                                                               
<xsl:otherwise>
+                                                                               
        <option value="{location_id}">
+                                                                               
                <xsl:value-of select="descr"/>
+                                                                               
        </option>
+                                                                               
</xsl:otherwise>
+                                                                               
</xsl:choose>
                                                                </xsl:for-each>
                                                        </select>
                                                        <div 
id="attributes"></div>




reply via email to

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