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
This commit is contained in:
Marco Risaliti
2008-05-27 19:24:32 +00:00
parent 2b57ecc8ca
commit d4e2d7da1f
3 changed files with 6 additions and 13 deletions
@@ -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;
@@ -48,7 +48,7 @@ function clickAll(e) {
<#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">
@@ -621,7 +621,7 @@ under the License.
<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}">