Author: mrisaliti
Date: Fri May 30 22:13:04 2008 New Revision: 661944 URL: http://svn.apache.org/viewvc?rev=661944&view=rev Log: Converted EditProductPriceRules.bsh/FindProductPriceRule.bsh to groovy (Part of issue OFBIZ-1801) Added: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/price/EditProductPriceRules.groovy - copied, changed from r661940, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/price/EditProductPriceRules.bsh ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/price/FindProductPriceRule.groovy - copied, changed from r661940, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/price/FindProductPriceRule.bsh Removed: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/price/EditProductPriceRules.bsh ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/price/FindProductPriceRule.bsh Modified: ofbiz/trunk/applications/product/widget/catalog/PriceScreens.xml Copied: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/price/EditProductPriceRules.groovy (from r661940, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/price/EditProductPriceRules.bsh) URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/price/EditProductPriceRules.groovy?p2=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/price/EditProductPriceRules.groovy&p1=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/price/EditProductPriceRules.bsh&r1=661940&r2=661944&rev=661944&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/price/EditProductPriceRules.bsh (original) +++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/price/EditProductPriceRules.groovy Fri May 30 22:13:04 2008 @@ -17,22 +17,17 @@ * under the License. */ -import org.ofbiz.entity.*; -import org.ofbiz.entity.util.*; -import org.ofbiz.base.util.*; +import org.ofbiz.entity.* +import org.ofbiz.entity.util.* +import org.ofbiz.base.util.* String priceRuleId = request.getParameter("productPriceRuleId"); -GenericValue productPriceRule = null; -if (priceRuleId != null) { - productPriceRule = delegator.findByPrimaryKey("ProductPriceRule", UtilMisc.toMap("productPriceRuleId", priceRuleId)); - context.put("productPriceRule", productPriceRule); +if (priceRuleId) { + context.productPriceRule = delegator.findByPrimaryKey("ProductPriceRule", ['productPriceRuleId' : priceRuleId]); } -List inputParamEnums = delegator.findByAndCache("Enumeration", UtilMisc.toMap("enumTypeId", "PROD_PRICE_IN_PARAM"), UtilMisc.toList("sequenceId")); -context.put("inputParamEnums", inputParamEnums); +context.inputParamEnums = delegator.findByAndCache("Enumeration", ['enumTypeId' : 'PROD_PRICE_IN_PARAM'], ['sequenceId']); -List condOperEnums = delegator.findByAndCache("Enumeration", UtilMisc.toMap("enumTypeId", "PROD_PRICE_COND"), UtilMisc.toList("sequenceId")); -context.put("condOperEnums", condOperEnums); +context.condOperEnums = delegator.findByAndCache("Enumeration", ['enumTypeId' : 'PROD_PRICE_COND'], ['sequenceId']); -List productPriceActionTypes = delegator.findList("ProductPriceActionType", null, null, UtilMisc.toList("description"), null, true); -context.put("productPriceActionTypes", productPriceActionTypes); +context.productPriceActionTypes = delegator.findList("ProductPriceActionType", null, null, ['description'], null, true); \ No newline at end of file Copied: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/price/FindProductPriceRule.groovy (from r661940, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/price/FindProductPriceRule.bsh) URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/price/FindProductPriceRule.groovy?p2=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/price/FindProductPriceRule.groovy&p1=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/price/FindProductPriceRule.bsh&r1=661940&r2=661944&rev=661944&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/price/FindProductPriceRule.bsh (original) +++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/price/FindProductPriceRule.groovy Fri May 30 22:13:04 2008 @@ -17,15 +17,19 @@ * under the License. */ -import org.ofbiz.entity.*; -import org.ofbiz.entity.util.*; -import org.ofbiz.base.util.*; -import org.ofbiz.widget.html.*; +import org.ofbiz.entity.* +import org.ofbiz.entity.util.* boolean activeOnly = true; -if ("false".equals(request.getParameter("activeOnly"))) activeOnly = false; -context.put("activeOnly", activeOnly); +if ("false".equals(request.getParameter("activeOnly"))) { + activeOnly = false; +} +context.activeOnly = activeOnly; List productPriceRules = delegator.findList("ProductPriceRule", null, null, null, null, false); -if (activeOnly) productPriceRules = EntityUtil.filterByDate(productPriceRules, true); -if (productPriceRules != null && productPriceRules.size() > 0) context.put("productPriceRules", productPriceRules); +if (activeOnly) { + productPriceRules = EntityUtil.filterByDate(productPriceRules, true); +} +if (productPriceRules && productPriceRules.size() > 0) { + context.productPriceRules = productPriceRules; +} \ No newline at end of file Modified: ofbiz/trunk/applications/product/widget/catalog/PriceScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/PriceScreens.xml?rev=661944&r1=661943&r2=661944&view=diff ============================================================================== --- ofbiz/trunk/applications/product/widget/catalog/PriceScreens.xml (original) +++ ofbiz/trunk/applications/product/widget/catalog/PriceScreens.xml Fri May 30 22:13:04 2008 @@ -53,7 +53,7 @@ <set field="titleProperty" value="PageTitleFindProductPriceRule"/> <set field="headerItem" value="pricerules"/> - <script location="component://product/webapp/catalog/WEB-INF/actions/price/FindProductPriceRule.bsh"/> + <script location="component://product/webapp/catalog/WEB-INF/actions/price/FindProductPriceRule.groovy"/> </actions> <widgets> <decorator-screen name="CommonPriceDecorator"> @@ -72,7 +72,7 @@ <set field="titleProperty" value="PageTitleEditProductPriceRules"/> <set field="headerItem" value="pricerules"/> - <script location="component://product/webapp/catalog/WEB-INF/actions/price/EditProductPriceRules.bsh"/> + <script location="component://product/webapp/catalog/WEB-INF/actions/price/EditProductPriceRules.groovy"/> </actions> <widgets> <decorator-screen name="CommonPriceDecorator"> |
Free forum by Nabble | Edit this page |