svn commit: r660649 - in /ofbiz/trunk/applications/product: webapp/catalog/WEB-INF/actions/product/ webapp/catalog/product/ widget/catalog/

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

svn commit: r660649 - in /ofbiz/trunk/applications/product: webapp/catalog/WEB-INF/actions/product/ webapp/catalog/product/ widget/catalog/

mrisaliti
Author: mrisaliti
Date: Tue May 27 12:24:32 2008
New Revision: 660649

URL: http://svn.apache.org/viewvc?rev=660649&view=rev
Log:
Convert QuickAddVariants.bsh to groovy (Part of issue OFBIZ-1801)

Added:
    ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/QuickAddVariants.groovy
      - copied, changed from r659825, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/QuickAddVariants.bsh
Removed:
    ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/QuickAddVariants.bsh
Modified:
    ofbiz/trunk/applications/product/webapp/catalog/product/QuickAddVariants.ftl
    ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml

Copied: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/QuickAddVariants.groovy (from r659825, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/QuickAddVariants.bsh)
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/QuickAddVariants.groovy?p2=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/QuickAddVariants.groovy&p1=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/QuickAddVariants.bsh&r1=659825&r2=660649&rev=660649&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/QuickAddVariants.bsh (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/QuickAddVariants.groovy Tue May 27 12:24:32 2008
@@ -17,15 +17,8 @@
  * under the License.
  */
 
-import org.ofbiz.entity.util.*;
-import org.ofbiz.base.util.*;
-import org.ofbiz.service.GenericDispatcher;
+result = dispatcher.runSync("getProductFeaturesByType", ['productId' : productId, 'productFeatureApplTypeId' : 'SELECTABLE_FEATURE']);
+context.featureTypes = result.productFeatureTypes;
 
-result = dispatcher.runSync("getProductFeaturesByType", UtilMisc.toMap("productId", productId, "productFeatureApplTypeId", "SELECTABLE_FEATURE"));
-featureTypes = result.get("productFeatureTypes");
-
-result = dispatcher.runSync("getVariantCombinations", UtilMisc.toMap("productId", productId));
-featureCombinationInfos = result.get("featureCombinations");
-
-context.put("featureTypes", featureTypes);
-context.put("featureCombinationInfos", featureCombinationInfos);
+result = dispatcher.runSync("getVariantCombinations", ['productId' : productId]);
+context.featureCombinationInfos = result.featureCombinations;
\ No newline at end of file

Modified: ofbiz/trunk/applications/product/webapp/catalog/product/QuickAddVariants.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/product/QuickAddVariants.ftl?rev=660649&r1=660648&r2=660649&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/product/QuickAddVariants.ftl (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/product/QuickAddVariants.ftl Tue May 27 12:24:32 2008
@@ -48,7 +48,7 @@
 <#if (product.isVirtual)?if_exists != "Y">
     <h2>${uiLabelMap.ProductWarningProductNotVirtual}</h2>
 </#if>
-<#if (featureTypes.size() > 0)>
+<#if featureTypes?has_content && (featureTypes.size() > 0)>
     <table cellspacing="0" class="basic-table">
         <#assign rowCount = 0>
         <form method="post" action="<@ofbizUrl>QuickAddChosenVariants</@ofbizUrl>" name="selectAllForm">

Modified: ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml?rev=660649&r1=660648&r2=660649&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml (original)
+++ ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml Tue May 27 12:24:32 2008
@@ -621,7 +621,7 @@
                 <set field="productId" from-field="parameters.productId"/>
                 <entity-one entity-name="Product" value-name="product"/>
 
-                <script location="component://product/webapp/catalog/WEB-INF/actions/product/QuickAddVariants.bsh"/>
+                <script location="component://product/webapp/catalog/WEB-INF/actions/product/QuickAddVariants.groovy"/>
             </actions>
             <widgets>
                 <decorator-screen name="CommonProductDecorator"  location="${parameters.mainDecoratorLocation}">