svn commit: r950864 - /ofbiz/trunk/applications/product/webapp/catalog/category/EditCategory.ftl

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r950864 - /ofbiz/trunk/applications/product/webapp/catalog/category/EditCategory.ftl

jleroux@apache.org
Author: jleroux
Date: Thu Jun  3 03:46:36 2010
New Revision: 950864

URL: http://svn.apache.org/viewvc?rev=950864&view=rev
Log:
A patch from Sascha Rodekamp "Edit Category FTL ProductCategory Type Select " (https://issues.apache.org/jira/browse/OFBIZ-3794) - OFBIZ-3794

In the Drop Down field is always the Key Catalog_Category selected. This Patch change the behavior and select a default product Category Type Id

Modified:
    ofbiz/trunk/applications/product/webapp/catalog/category/EditCategory.ftl

Modified: ofbiz/trunk/applications/product/webapp/catalog/category/EditCategory.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/category/EditCategory.ftl?rev=950864&r1=950863&r2=950864&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/category/EditCategory.ftl (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/category/EditCategory.ftl Thu Jun  3 03:46:36 2010
@@ -94,9 +94,15 @@ function insertImageName(type,nameValue)
                     <td>&nbsp;</td>
                     <td width="74%">
                         <select name="productCategoryTypeId" size="1">
-                        <#list productCategoryTypes as productCategoryTypeData>
-                        <option <#if ((productCategory?has_content) && (productCategory.productCategoryTypeId==productCategoryTypeData.productCategoryTypeId)) || (productCategoryTypeData.productCategoryTypeId=="CATALOG_CATEGORY")>selected="selected"</#if> value="${productCategoryTypeData.productCategoryTypeId}">${productCategoryTypeData.get("description",locale)}</option>
-                        </#list>
+                         <#assign selectedKey = "">
+                     <#list productCategoryTypes as productCategoryTypeData>
+                         <#if requestParameters.productCategoryTypeId?has_content>
+                         <#assign selectedKey = requestParameters.productCategoryTypeId>
+                         <#elseif (productCategory?has_content && productCategory.productCategoryTypeId?if_exists == productCategoryTypeData.productCategoryTypeId)>
+                         <#assign selectedKey = productCategory.productCategoryTypeId>
+                         </#if>
+                         <option <#if selectedKey == productCategoryTypeData.productCategoryTypeId?if_exists>selected="selected"</#if> value="${productCategoryTypeData.productCategoryTypeId}">${productCategoryTypeData.get("description",locale)}</option>
+                         </#list>
                         </select>
                     </td>
                 </tr>