svn commit: r661945 - in /ofbiz/trunk/applications/product: webapp/catalog/WEB-INF/actions/promo/EditProductPromoCode.bsh webapp/catalog/WEB-INF/actions/promo/EditProductPromoCode.groovy widget/catalog/PromoScreens.xml

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

svn commit: r661945 - in /ofbiz/trunk/applications/product: webapp/catalog/WEB-INF/actions/promo/EditProductPromoCode.bsh webapp/catalog/WEB-INF/actions/promo/EditProductPromoCode.groovy widget/catalog/PromoScreens.xml

mrisaliti
Author: mrisaliti
Date: Fri May 30 22:19:15 2008
New Revision: 661945

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

Added:
    ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/promo/EditProductPromoCode.groovy
      - copied, changed from r661942, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/promo/EditProductPromoCode.bsh
Removed:
    ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/promo/EditProductPromoCode.bsh
Modified:
    ofbiz/trunk/applications/product/widget/catalog/PromoScreens.xml

Copied: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/promo/EditProductPromoCode.groovy (from r661942, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/promo/EditProductPromoCode.bsh)
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/promo/EditProductPromoCode.groovy?p2=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/promo/EditProductPromoCode.groovy&p1=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/promo/EditProductPromoCode.bsh&r1=661942&r2=661945&rev=661945&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/promo/EditProductPromoCode.bsh (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/promo/EditProductPromoCode.groovy Fri May 30 22:19:15 2008
@@ -17,40 +17,37 @@
  * under the License.
  */
 
-import java.util.*;
-import java.io.*;
-import org.ofbiz.entity.*;
-import org.ofbiz.base.util.*;
-import org.ofbiz.widget.html.*;
+import org.ofbiz.entity.*
+import org.ofbiz.base.util.*
 
 productPromoCodeId = request.getParameter("productPromoCodeId");
 if (UtilValidate.isEmpty(productPromoCodeId)) {
     productPromoCodeId = request.getAttribute("productPromoCodeId");
 }
-productPromoCode = delegator.findByPrimaryKey("ProductPromoCode", UtilMisc.toMap("productPromoCodeId", productPromoCodeId));
+productPromoCode = delegator.findByPrimaryKey("ProductPromoCode", ['productPromoCodeId' : productPromoCodeId]);
 
 productPromoId = null;
-if (productPromoCode != null) {
-    productPromoId = productPromoCode.get("productPromoId");
+if (productPromoCode) {
+    productPromoId = productPromoCode.productPromoId;
 } else {
     productPromoId = request.getParameter("productPromoId");
 }
 
 productPromo = null;
-if (productPromoId != null) {
-    productPromo = delegator.findByPrimaryKey("ProductPromo", UtilMisc.toMap("productPromoId", productPromoId));
+if (productPromoId) {
+    productPromo = delegator.findByPrimaryKey("ProductPromo", ['productPromoId' : productPromoId]);
 }
 
 productPromoCodeEmails = null;
 productPromoCodeParties = null;
-if (productPromoCode != null) {
+if (productPromoCode) {
     productPromoCodeEmails = productPromoCode.getRelated("ProductPromoCodeEmail");
     productPromoCodeParties = productPromoCode.getRelated("ProductPromoCodeParty");
 }
 
-context.put("productPromoId", productPromoId);
-context.put("productPromo", productPromo);
-context.put("productPromoCodeId", productPromoCodeId);
-context.put("productPromoCode", productPromoCode);
-context.put("productPromoCodeEmails", productPromoCodeEmails);
-context.put("productPromoCodeParties", productPromoCodeParties);
+context.productPromoId = productPromoId;
+context.productPromo = productPromo;
+context.productPromoCodeId = productPromoCodeId;
+context.productPromoCode = productPromoCode;
+context.productPromoCodeEmails = productPromoCodeEmails;
+context.productPromoCodeParties = productPromoCodeParties;
\ No newline at end of file

Modified: ofbiz/trunk/applications/product/widget/catalog/PromoScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/PromoScreens.xml?rev=661945&r1=661944&r2=661945&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/catalog/PromoScreens.xml (original)
+++ ofbiz/trunk/applications/product/widget/catalog/PromoScreens.xml Fri May 30 22:19:15 2008
@@ -326,7 +326,7 @@
                 <set field="tabButtonItem" value="FindProductPromoCode"/>
                 <set field="labelTitleProperty" value="ProductPromotionCode"/>
 
-                <script location="component://product/webapp/catalog/WEB-INF/actions/promo/EditProductPromoCode.bsh"/>
+                <script location="component://product/webapp/catalog/WEB-INF/actions/promo/EditProductPromoCode.groovy"/>
             </actions>
             <widgets>
                 <decorator-screen name="CommonPromoDecorator">