Author: mrisaliti
Date: Tue May 27 14:37:31 2008 New Revision: 660723 URL: http://svn.apache.org/viewvc?rev=660723&view=rev Log: Converted EditProductQuickAdmin.bsh to groovy (Part of issue OFBIZ-1801) Added: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductQuickAdmin.groovy - copied, changed from r660696, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductQuickAdmin.bsh Removed: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductQuickAdmin.bsh Modified: ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml Copied: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductQuickAdmin.groovy (from r660696, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductQuickAdmin.bsh) URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductQuickAdmin.groovy?p2=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductQuickAdmin.groovy&p1=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductQuickAdmin.bsh&r1=660696&r2=660723&rev=660723&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductQuickAdmin.bsh (original) +++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductQuickAdmin.groovy Tue May 27 14:37:31 2008 @@ -17,37 +17,29 @@ * under the License. */ -import java.util.*; -import java.util.Collection.*; -import java.sql.*; -import java.io.*; -import org.ofbiz.entity.*; -import org.ofbiz.entity.util.*; -import org.ofbiz.base.util.*; -import org.ofbiz.widget.html.*; -import org.ofbiz.product.product.*; -import org.ofbiz.entity.condition.*; +import org.ofbiz.base.util.* +import org.ofbiz.entity.* +import org.ofbiz.entity.condition.* +import org.ofbiz.entity.util.* +import org.ofbiz.product.product.* -nowDate = UtilDateTime.nowDate(); -context.put("nowDate", nowDate); - -String nowTimestampString = UtilDateTime.nowTimestamp().toString(); -context.put("nowTimestampString", nowTimestampString); +nowTimestampString = UtilDateTime.nowTimestamp().toString(); +context.nowTimestampString = nowTimestampString; Collection assocTypes = delegator.findList("ProductAssocType", null, null, null, null, false); -context.put("assocTypes", assocTypes); +context.assocTypes = assocTypes; Collection featureTypes = delegator.findList("ProductFeatureType", null, null, null, null, false); -context.put("featureTypes", featureTypes); +context.featureTypes = featureTypes; // add/remove feature types -HashMap addedFeatureTypes = (HashMap) session.getAttribute("addedFeatureTypes"); +addedFeatureTypes = (HashMap) session.getAttribute("addedFeatureTypes"); if (addedFeatureTypes == null) { addedFeatureTypes = new HashMap(); session.setAttribute("addedFeatureTypes", addedFeatureTypes); } -HashMap featuresByType = new HashMap(); +featuresByType = new HashMap(); String[] addFeatureTypeId = request.getParameterValues("addFeatureTypeId"); List addFeatureTypeIdList = new ArrayList(); if (addFeatureTypeId != null) { @@ -57,7 +49,7 @@ addFeatureTypeIdIter = addFeatureTypeIdList.iterator(); while (addFeatureTypeIdIter.hasNext()) { String curFeatureTypeId = addFeatureTypeIdIter.next(); - GenericValue featureType = delegator.findByPrimaryKey("ProductFeatureType", UtilMisc.toMap("productFeatureTypeId", curFeatureTypeId)); + GenericValue featureType = delegator.findByPrimaryKey("ProductFeatureType", ['productFeatureTypeId' : curFeatureTypeId]); if ((featureType != null) && !addedFeatureTypes.containsKey(curFeatureTypeId)) { addedFeatureTypes.put(curFeatureTypeId, featureType); } @@ -66,7 +58,7 @@ String[] removeFeatureTypeId = request.getParameterValues("removeFeatureTypeId"); if (removeFeatureTypeId != null) { for (int i = 0; i < removeFeatureTypeId.length; i++) { - GenericValue featureType = delegator.findByPrimaryKey("ProductFeatureType", UtilMisc.toMap("productFeatureTypeId", addFeatureTypeId[i])); + GenericValue featureType = delegator.findByPrimaryKey("ProductFeatureType", ['productFeatureTypeId' : addFeatureTypeId[i]]); if ((featureType != null) && addedFeatureTypes.containsKey(removeFeatureTypeId[i])) { addedFeatureTypes.remove(removeFeatureTypeId[i]); featuresByType.remove(removeFeatureTypeId[i]); @@ -76,28 +68,34 @@ Iterator iter = addedFeatureTypes.values().iterator(); while (iter.hasNext()) { GenericValue featureType = (GenericValue)iter.next(); - featuresByType.put(featureType.getString("productFeatureTypeId"), featureType.getRelated("ProductFeature", UtilMisc.toList("description"))); + featuresByType.put(featureType.productFeatureTypeId, featureType.getRelated("ProductFeature", ['description'])); } -context.put("addedFeatureTypeIds", addedFeatureTypes.keySet()); -context.put("addedFeatureTypes", addedFeatureTypes); -context.put("featuresByType", featuresByType); +context.addedFeatureTypeIds = addedFeatureTypes.keySet(); +context.addedFeatureTypes = addedFeatureTypes; +context.featuresByType = featuresByType; productId = request.getParameter("productId"); -if (productId == null) productId = request.getParameter("PRODUCT_ID"); -if (productId == null) productId = request.getAttribute("productId"); -if (productId != null) context.put("productId", productId); +if (productId == null) { + productId = request.getParameter("PRODUCT_ID"); +} +if (productId == null) { + productId = request.getAttribute("productId"); +} +if (productId != null) { + context.productId = productId; +} -product = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", productId)); +product = delegator.findByPrimaryKey("Product", ['productId' : productId]); List assocProducts = new ArrayList(); -HashMap featureFloz = new HashMap(); -HashMap featureMl = new HashMap(); -HashMap featureNtwt = new HashMap(); -HashMap featureGrams = new HashMap(); -HashMap featureHazmat = new HashMap(); -HashMap featureSalesThru = new HashMap(); -HashMap featureThruDate = new HashMap(); -HashMap selFeatureDesc = new HashMap(); +featureFloz = new HashMap(); +featureMl = new HashMap(); +featureNtwt = new HashMap(); +featureGrams = new HashMap(); +featureHazmat = new HashMap(); +featureSalesThru = new HashMap(); +featureThruDate = new HashMap(); +selFeatureDesc = new HashMap(); Double floz = null; Double ml = null; Double ntwt = null; @@ -106,27 +104,27 @@ String salesthru = null; String thrudate = null; String productFeatureTypeId = request.getParameter("productFeatureTypeId"); -context.put("productFeatureTypeId", productFeatureTypeId); +context.productFeatureTypeId = productFeatureTypeId; if (product != null) { - context.put("product", product); + context.product = product; // get categories List allCategories = delegator.findList("ProductCategory", new EntityExpr(new EntityExpr("showInSelect", EntityOperator.EQUALS, null), EntityOperator.OR, new EntityExpr("showInSelect", EntityOperator.NOT_EQUAL, "N")), - null, UtilMisc.toList("description"), null, false); + null, ['description'], null, false); List categoryMembers = product.getRelated("ProductCategoryMember"); categoryMembers = EntityUtil.filterByDate(categoryMembers); - context.put("allCategories", allCategories); - context.put("productCategoryMembers", categoryMembers); + context.allCategories = allCategories; + context.productCategoryMembers = categoryMembers; List productFeatureAndAppls = product.getRelated("ProductFeatureAndAppl"); // get standard features for this product - List standardFeatureAppls = EntityUtil.filterByAnd(productFeatureAndAppls, UtilMisc.toMap("productFeatureApplTypeId", "STANDARD_FEATURE")); - HashMap productFeatureTypeLookup = new HashMap(); - HashMap standardFeatureLookup = new HashMap(); + List standardFeatureAppls = EntityUtil.filterByAnd(productFeatureAndAppls, ['productFeatureApplTypeId' : "STANDARD_FEATURE"]); + productFeatureTypeLookup = new HashMap(); + standardFeatureLookup = new HashMap(); Iterator standardFeatureApplIter = standardFeatureAppls.iterator(); while (standardFeatureApplIter.hasNext()) { GenericValue standardFeatureAndAppl = (GenericValue) standardFeatureApplIter.next(); @@ -134,12 +132,12 @@ productFeatureTypeLookup.put(standardFeatureAndAppl.getString("productFeatureId"), featureType); standardFeatureLookup.put(standardFeatureAndAppl.getString("productFeatureId"), standardFeatureAndAppl); } - context.put("standardFeatureLookup", standardFeatureLookup); - context.put("standardFeatureAppls", standardFeatureAppls); + context.standardFeatureLookup = standardFeatureLookup; + context.standardFeatureAppls = standardFeatureAppls; // get selectable features for this product - List selectableFeatureAppls = EntityUtil.filterByAnd(productFeatureAndAppls, UtilMisc.toMap("productFeatureApplTypeId", "SELECTABLE_FEATURE")); - HashMap selectableFeatureLookup = new HashMap(); + List selectableFeatureAppls = EntityUtil.filterByAnd(productFeatureAndAppls, ['productFeatureApplTypeId' : 'SELECTABLE_FEATURE']); + selectableFeatureLookup = new HashMap(); // get feature types that are deleteable from selectable features section Set selectableFeatureTypes = new HashSet(); @@ -147,69 +145,68 @@ while (selectableFeatureAndApplIter.hasNext()) { GenericValue selectableFeatureAndAppl = (GenericValue) selectableFeatureAndApplIter.next(); GenericValue featureType = selectableFeatureAndAppl.getRelatedOneCache("ProductFeatureType"); - productFeatureTypeLookup.put(selectableFeatureAndAppl.getString("productFeatureId"), featureType); - selectableFeatureLookup.put(selectableFeatureAndAppl.getString("productFeatureId"), selectableFeatureAndAppl); + productFeatureTypeLookup.put(selectableFeatureAndAppl.productFeatureId, featureType); + selectableFeatureLookup.put(selectableFeatureAndAppl.productFeatureId, selectableFeatureAndAppl); selectableFeatureTypes.add(featureType); } - context.put("selectableFeatureLookup", selectableFeatureLookup); - context.put("selectableFeatureAppls", selectableFeatureAppls); - context.put("selectableFeatureTypes", selectableFeatureTypes); + context.selectableFeatureLookup = selectableFeatureLookup; + context.selectableFeatureAppls = selectableFeatureAppls; + context.selectableFeatureTypes = selectableFeatureTypes; - if ("Y".equalsIgnoreCase(product.getString("isVariant"))) { + if ("Y".equalsIgnoreCase(product.isVariant)) { Set distinguishingFeatures = ProductWorker.getVariantDistinguishingFeatures(product); - context.put("distinguishingFeatures", distinguishingFeatures); + context.distinguishingFeatures = distinguishingFeatures; Iterator distinguishingFeatureIter = distinguishingFeatures.iterator(); while (distinguishingFeatureIter.hasNext()) { - GenericValue distFeature = (GenericValue) distinguishingFeatureIter.next(); - GenericValue featureType = distFeature.getRelatedOneCache("ProductFeatureType"); - if (!productFeatureTypeLookup.containsKey(distFeature.getString("productFeatureId"))) { - productFeatureTypeLookup.put(distFeature.getString("productFeatureId"), featureType); + distFeature = (GenericValue) distinguishingFeatureIter.next(); + featureType = distFeature.getRelatedOneCache("ProductFeatureType"); + if (!productFeatureTypeLookup.containsKey(distFeature.productFeatureId)) { + productFeatureTypeLookup.put(distFeature.productFeatureId, featureType); } } } - context.put("productFeatureTypeLookup", productFeatureTypeLookup); + context.productFeatureTypeLookup = productFeatureTypeLookup; // get shipping dimensions and weights for single product List prodFeaturesFiltered = null; - prodFeaturesFiltered = EntityUtil.filterByAnd(productFeatureAndAppls, UtilMisc.toMap("productFeatureTypeId", "AMOUNT", "uomId", "VLIQ_ozUS")); + prodFeaturesFiltered = EntityUtil.filterByAnd(productFeatureAndAppls, ['productFeatureTypeId' : 'AMOUNT', 'uomId' : 'VLIQ_ozUS']); if (prodFeaturesFiltered.size() > 0) { try { floz = ((GenericValue)prodFeaturesFiltered.get(0)).getDouble("numberSpecified"); } catch (Exception e) { floz = null; } - context.put("floz", floz); + context.floz = floz; } - prodFeaturesFiltered = EntityUtil.filterByAnd(productFeatureAndAppls, UtilMisc.toMap("productFeatureTypeId", "AMOUNT", "uomId", "VLIQ_ml")); + prodFeaturesFiltered = EntityUtil.filterByAnd(productFeatureAndAppls, ['productFeatureTypeId' : 'AMOUNT', 'uomId' : 'VLIQ_ml']); if (prodFeaturesFiltered.size() > 0) { try { ml = ((GenericValue)prodFeaturesFiltered.get(0)).getDouble("numberSpecified"); } catch (Exception e) { ml = null; } - context.put("ml", ml); - + context.ml = ml; } - prodFeaturesFiltered = EntityUtil.filterByAnd(productFeatureAndAppls, UtilMisc.toMap("productFeatureTypeId", "AMOUNT", "uomId", "WT_g")); + prodFeaturesFiltered = EntityUtil.filterByAnd(productFeatureAndAppls, ['productFeatureTypeId' : 'AMOUNT', 'uomId' : 'WT_g']); if (prodFeaturesFiltered.size() > 0) { try { grams = ((GenericValue)prodFeaturesFiltered.get(0)).getDouble("numberSpecified"); } catch (Exception e) { grams = null; } - context.put("grams", grams); + context.grams = grams; } - prodFeaturesFiltered = EntityUtil.filterByAnd(productFeatureAndAppls, UtilMisc.toMap("productFeatureTypeId", "AMOUNT", "uomId", "WT_oz")); + prodFeaturesFiltered = EntityUtil.filterByAnd(productFeatureAndAppls, ['productFeatureTypeId' : 'AMOUNT', 'uomId' : 'WT_oz']); if (prodFeaturesFiltered.size() > 0) { try { ntwt = ((GenericValue)prodFeaturesFiltered.get(0)).getDouble("numberSpecified"); } catch (Exception e) { ntwt = null; } - context.put("ntwt", ntwt); + context.ntwt = ntwt; } - prodFeaturesFiltered = EntityUtil.filterByAnd(productFeatureAndAppls, UtilMisc.toMap("productFeatureTypeId", "HAZMAT")); + prodFeaturesFiltered = EntityUtil.filterByAnd(productFeatureAndAppls, ['productFeatureTypeId' : 'HAZMAT']); if (prodFeaturesFiltered.size() > 0) { try { hazmat = ((GenericValue)prodFeaturesFiltered.get(0)).getString("description"); @@ -219,7 +216,7 @@ if (hazmat == null) { hazmat = "nbsp;"; } - context.put("hazmat", hazmat); + context.hazmat = hazmat; } java.sql.Timestamp salesThru = product.getTimestamp("salesDiscontinuationDate"); if (salesThru == null) { @@ -229,97 +226,96 @@ } else { salesthru = "<div style='color: red'>[x]</div>"; } - context.put("salesthru", salesthru); + context.salesthru = salesthru; thrudate = ""; - context.put("thrudate", thrudate); + context.thrudate = thrudate; // get all variants - associations first - Collection productAssocs = product.getRelatedByAnd("MainProductAssoc", UtilMisc.toMap("productAssocTypeId", "PRODUCT_VARIANT")); + Collection productAssocs = product.getRelatedByAnd("MainProductAssoc", ['productAssocTypeId' : 'PRODUCT_VARIANT']); Iterator productAssocIter = productAssocs.iterator(); // get shipping dimensions and weights for all the variants while (productAssocIter.hasNext()) { // now get the variant product - GenericValue productAssoc = (GenericValue)productAssocIter.next(); - GenericValue assocProduct = productAssoc.getRelatedOne("AssocProduct"); + productAssoc = (GenericValue)productAssocIter.next(); + assocProduct = productAssoc.getRelatedOne("AssocProduct"); if (assocProduct != null) { assocProducts.add(assocProduct); - List assocProductFeatureAndAppls = assocProduct.getRelated("ProductFeatureAndAppl"); - List prodFeaturesFiltered = EntityUtil.filterByAnd(assocProductFeatureAndAppls, UtilMisc.toMap("productFeatureTypeId", "AMOUNT", "uomId", "VLIQ_ozUS")); + assocProductFeatureAndAppls = assocProduct.getRelated("ProductFeatureAndAppl"); + prodFeaturesFiltered = EntityUtil.filterByAnd(assocProductFeatureAndAppls, ['productFeatureTypeId' : 'AMOUNT', 'uomId' : 'VLIQ_ozUS']); if (prodFeaturesFiltered.size() > 0) { - featureFloz.put(assocProduct.getString("productId"), ((GenericValue)prodFeaturesFiltered.get(0)).getDouble("numberSpecified")); + featureFloz.put(assocProduct.productId, ((GenericValue)prodFeaturesFiltered.get(0)).getDouble("numberSpecified")); } - prodFeaturesFiltered = EntityUtil.filterByAnd(assocProductFeatureAndAppls, UtilMisc.toMap("productFeatureTypeId", "AMOUNT", "uomId", "VLIQ_ml")); + prodFeaturesFiltered = EntityUtil.filterByAnd(assocProductFeatureAndAppls, ['productFeatureTypeId' : 'AMOUNT', 'uomId' : 'VLIQ_ml']); if (prodFeaturesFiltered.size() > 0) { - featureMl.put(assocProduct.getString("productId"), ((GenericValue)prodFeaturesFiltered.get(0)).getDouble("numberSpecified")); + featureMl.put(assocProduct.productId, ((GenericValue)prodFeaturesFiltered.get(0)).getDouble("numberSpecified")); } - prodFeaturesFiltered = EntityUtil.filterByAnd(assocProductFeatureAndAppls, UtilMisc.toMap("productFeatureTypeId", "AMOUNT", "uomId", "WT_g")); + prodFeaturesFiltered = EntityUtil.filterByAnd(assocProductFeatureAndAppls, ['productFeatureTypeId' : 'AMOUNT', 'uomId' : 'WT_g']); if (prodFeaturesFiltered.size() > 0) { - featureGrams.put(assocProduct.getString("productId"), ((GenericValue)prodFeaturesFiltered.get(0)).getDouble("numberSpecified")); + featureGrams.put(assocProduct.productId, ((GenericValue)prodFeaturesFiltered.get(0)).getDouble("numberSpecified")); } - prodFeaturesFiltered = EntityUtil.filterByAnd(assocProductFeatureAndAppls, UtilMisc.toMap("productFeatureTypeId", "AMOUNT", "uomId", "WT_oz")); + prodFeaturesFiltered = EntityUtil.filterByAnd(assocProductFeatureAndAppls, ['productFeatureTypeId' : 'AMOUNT', 'uomId' : 'WT_oz']); if (prodFeaturesFiltered.size() > 0) { - featureNtwt.put(assocProduct.getString("productId"), ((GenericValue)prodFeaturesFiltered.get(0)).getDouble("numberSpecified")); + featureNtwt.put(assocProduct.productId, ((GenericValue)prodFeaturesFiltered.get(0)).getDouble("numberSpecified")); } - prodFeaturesFiltered = EntityUtil.filterByAnd(assocProductFeatureAndAppls, UtilMisc.toMap("productFeatureTypeId", "HAZMAT")); + prodFeaturesFiltered = EntityUtil.filterByAnd(assocProductFeatureAndAppls, ['productFeatureTypeId' : 'HAZMAT']); if (prodFeaturesFiltered.size() > 0) { - featureHazmat.put(assocProduct.getString("productId"), + featureHazmat.put(assocProduct.productId, ((GenericValue)prodFeaturesFiltered.get(0)).getString("description")); } else { - featureHazmat.put(assocProduct.getString("productId"), " "); + featureHazmat.put(assocProduct.productId, " "); } - java.sql.Timestamp salesThru = assocProduct.getTimestamp("salesDiscontinuationDate"); + salesThru = assocProduct.getTimestamp("salesDiscontinuationDate"); if (salesThru == null) { - featureSalesThru.put(assocProduct.getString("productId"), "<div style='color: blue'>[ ]</div>"); + featureSalesThru.put(assocProduct.productId, "<div style='color: blue'>[ ]</div>"); } else if (salesThru.after(new java.util.Date())) { - featureSalesThru.put(assocProduct.getString("productId"), "<div style='color: blue'>[x]</div>"); + featureSalesThru.put(assocProduct.productId, "<div style='color: blue'>[x]</div>"); } else { - featureSalesThru.put(assocProduct.getString("productId"), "<div style='color: red'>[x]</div>"); + featureSalesThru.put(assocProduct.productId, "<div style='color: red'>[x]</div>"); } java.sql.Timestamp thruDate = productAssoc.getTimestamp("thruDate"); if (thruDate == null) { - featureThruDate.put(assocProduct.getString("productId"), "<div style='color: blue'>[ ]</div>"); + featureThruDate.put(assocProduct.productId, "<div style='color: blue'>[ ]</div>"); } else if (thruDate.after(new java.util.Date())) { - featureThruDate.put(assocProduct.getString("productId"), "<div style='color: blue'>[x]</div>"); + featureThruDate.put(assocProduct.productId, "<div style='color: blue'>[x]</div>"); } else { - featureThruDate.put(assocProduct.getString("productId"), "<div style='color: red'>[x]</div>"); + featureThruDate.put(assocProduct.productId, "<div style='color: red'>[x]</div>"); } - prodFeaturesFiltered = EntityUtil.filterByAnd(assocProductFeatureAndAppls, UtilMisc.toMap("productFeatureTypeId", productFeatureTypeId)); + prodFeaturesFiltered = EntityUtil.filterByAnd(assocProductFeatureAndAppls, ['productFeatureTypeId' : productFeatureTypeId]); if (prodFeaturesFiltered.size() > 0) { // this is used for the selectable feature descriptions section; only include here iff the description is also associated with the virtual product as a selectable feature, ie if this is a distinguishing feature String curSelDescription = ((GenericValue) prodFeaturesFiltered.get(0)).getString("description"); - testProductFeatureAndAppls = EntityUtil.filterByAnd(productFeatureAndAppls, UtilMisc.toMap("productFeatureTypeId", productFeatureTypeId, "description", curSelDescription, "productFeatureApplTypeId", "SELECTABLE_FEATURE")); + testProductFeatureAndAppls = EntityUtil.filterByAnd(productFeatureAndAppls, ['productFeatureTypeId' : productFeatureTypeId, 'description' : curSelDescription, 'productFeatureApplTypeId' : 'SELECTABLE_FEATURE']); if (testProductFeatureAndAppls.size() > 0) { - selFeatureDesc.put(assocProduct.getString("productId"), curSelDescription); + selFeatureDesc.put(assocProduct.productId, curSelDescription); } } } } - assocProducts = EntityUtil.orderBy(assocProducts, UtilMisc.toList("internalName")); - context.put("assocProducts", assocProducts); - context.put("productAssocs", productAssocs); + assocProducts = EntityUtil.orderBy(assocProducts, ['internalName']); + context.assocProducts = assocProducts; + context.productAssocs = productAssocs; } -context.put("featureFloz", featureFloz); -context.put("featureMl", featureMl); -context.put("featureNtwt", featureNtwt); -context.put("featureGrams", featureGrams); -context.put("featureHazmat", featureHazmat); -context.put("featureSalesThru", featureSalesThru); -context.put("featureThruDate", featureThruDate); -context.put("selFeatureDesc", selFeatureDesc); +context.featureFloz = featureFloz; +context.featureMl = featureMl; +context.featureNtwt = featureNtwt; +context.featureGrams = featureGrams; +context.featureHazmat = featureHazmat; +context.featureSalesThru = featureSalesThru; +context.featureThruDate = featureThruDate; +context.selFeatureDesc = selFeatureDesc; // get "all" category id String allCategoryId = UtilProperties.getPropertyValue("catalog", "all.product.category"); -context.put("allCategoryId", allCategoryId); +context.allCategoryId = allCategoryId; // show the publish or unpublish section -List prodCatMembs = delegator.findByAnd("ProductCategoryMember", - UtilMisc.toMap("productCategoryId", allCategoryId, "productId", productId)); +List prodCatMembs = delegator.findByAnd("ProductCategoryMember", ['productCategoryId' : allCategoryId, 'productId' : productId]); //don't filter by date, show all categories: prodCatMembs = EntityUtil.filterByDate(prodCatMembs); String showPublish = "false"; if (prodCatMembs.size() == 0) { showPublish = "true"; } -context.put("showPublish", showPublish); +context.showPublish = showPublish; \ No newline at end of file Modified: ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml?rev=660723&r1=660722&r2=660723&view=diff ============================================================================== --- ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml (original) +++ ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml Tue May 27 14:37:31 2008 @@ -657,7 +657,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/EditProductQuickAdmin.bsh"/> + <script location="component://product/webapp/catalog/WEB-INF/actions/product/EditProductQuickAdmin.groovy"/> </actions> <widgets> <decorator-screen name="CommonProductDecorator" location="${parameters.mainDecoratorLocation}"> |
Free forum by Nabble | Edit this page |