From d4e2d7da1feafa5a8d7bd5128e3e42ce1a4a0c0c Mon Sep 17 00:00:00 2001 From: Marco Risaliti Date: Tue, 27 May 2008 19:24:32 +0000 Subject: [PATCH] Convert QuickAddVariants.bsh to groovy (Part of issue OFBIZ-1801) git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@660649 13f79535-47bb-0310-9956-ffa450edef68 --- ...ickAddVariants.bsh => QuickAddVariants.groovy} | 15 ++++----------- .../webapp/catalog/product/QuickAddVariants.ftl | 2 +- .../product/widget/catalog/ProductScreens.xml | 2 +- 3 files changed, 6 insertions(+), 13 deletions(-) rename applications/product/webapp/catalog/WEB-INF/actions/product/{QuickAddVariants.bsh => QuickAddVariants.groovy} (58%) diff --git a/applications/product/webapp/catalog/WEB-INF/actions/product/QuickAddVariants.bsh b/applications/product/webapp/catalog/WEB-INF/actions/product/QuickAddVariants.groovy similarity index 58% rename from applications/product/webapp/catalog/WEB-INF/actions/product/QuickAddVariants.bsh rename to applications/product/webapp/catalog/WEB-INF/actions/product/QuickAddVariants.groovy index f0cac41d32..2dafaa4a44 100644 --- a/applications/product/webapp/catalog/WEB-INF/actions/product/QuickAddVariants.bsh +++ b/applications/product/webapp/catalog/WEB-INF/actions/product/QuickAddVariants.groovy @@ -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 diff --git a/applications/product/webapp/catalog/product/QuickAddVariants.ftl b/applications/product/webapp/catalog/product/QuickAddVariants.ftl index 8b3341602c..cccc2ac659 100644 --- a/applications/product/webapp/catalog/product/QuickAddVariants.ftl +++ b/applications/product/webapp/catalog/product/QuickAddVariants.ftl @@ -48,7 +48,7 @@ function clickAll(e) { <#if (product.isVirtual)?if_exists != "Y">

${uiLabelMap.ProductWarningProductNotVirtual}

-<#if (featureTypes.size() > 0)> +<#if featureTypes?has_content && (featureTypes.size() > 0)> <#assign rowCount = 0> diff --git a/applications/product/widget/catalog/ProductScreens.xml b/applications/product/widget/catalog/ProductScreens.xml index 28e577b57a..e8d14caf9d 100644 --- a/applications/product/widget/catalog/ProductScreens.xml +++ b/applications/product/widget/catalog/ProductScreens.xml @@ -621,7 +621,7 @@ under the License. -