Author: lektran
Date: Sun Jul 27 03:13:23 2008 New Revision: 680085 URL: http://svn.apache.org/viewvc?rev=680085&view=rev Log: A few more bsh -> groovy conversions Added: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/Login.groovy - copied, changed from r680051, ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/login.bsh ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/Main.groovy - copied, changed from r680051, ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/main.bsh ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OptionSettings.groovy - copied, changed from r680051, ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/optionsettings.bsh ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderHistory.groovy - copied, changed from r680051, ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderhistory.bsh ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderStatus.groovy - copied, changed from r680051, ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/PaymentInformation.groovy - copied, changed from r680051, ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/paymentinformation.bsh ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/PaymentOptions.groovy - copied, changed from r680051, ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/paymentoptions.bsh ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/QuickAnonCheckoutLinks.groovy - copied, changed from r680051, ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/quickAnonCheckoutLinks.bsh ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/QuickAnonCustSettings.groovy - copied, changed from r680051, ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/quickAnonCustSettings.bsh ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/QuickAnonOptionSettings.groovy - copied, changed from r680051, ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/quickAnonOptionSettings.bsh ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/QuickAnonPaymentInformation.groovy - copied, changed from r680051, ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/quickAnonPaymentInformation.bsh ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/RequestReturn.groovy - copied, changed from r680051, ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/requestreturn.bsh ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/ShipSettings.groovy - copied, changed from r680051, ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/shipsettings.bsh ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/ShipmentStatus.groovy - copied, changed from r680051, ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/shipmentstatus.bsh ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/SplitShip.groovy - copied, changed from r680051, ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/splitship.bsh ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/shoppinglist/EditShoppingList.groovy - copied, changed from r680051, ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/shoppinglist/editShoppingList.bsh Removed: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/login.bsh ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/main.bsh ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/optionsettings.bsh ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderhistory.bsh ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/paymentinformation.bsh ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/paymentoptions.bsh ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/quickAnonCheckoutLinks.bsh ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/quickAnonCustSettings.bsh ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/quickAnonOptionSettings.bsh ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/quickAnonPaymentInformation.bsh ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/requestreturn.bsh ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/shipmentstatus.bsh ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/shipsettings.bsh ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/splitship.bsh ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/shoppinglist/editShoppingList.bsh Modified: ofbiz/trunk/applications/ecommerce/widget/CommonScreens.xml ofbiz/trunk/applications/ecommerce/widget/ContentScreens.xml ofbiz/trunk/applications/ecommerce/widget/EmailOrderScreens.xml ofbiz/trunk/applications/ecommerce/widget/EmailReturnScreens.xml ofbiz/trunk/applications/ecommerce/widget/OrderScreens.xml ofbiz/trunk/applications/ecommerce/widget/ShoppingListScreens.xml ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Category.groovy Copied: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/Login.groovy (from r680051, ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/login.bsh) URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/Login.groovy?p2=ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/Login.groovy&p1=ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/login.bsh&r1=680051&r2=680085&rev=680085&view=diff ============================================================================== --- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/login.bsh (original) +++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/Login.groovy Sun Jul 27 03:13:23 2008 @@ -21,14 +21,14 @@ import org.ofbiz.common.CommonWorkers; import org.ofbiz.webapp.control.*; -context.put("autoUserLogin", session.getAttribute("autoUserLogin")); -context.put("autoLogoutUrl", LoginWorker.makeLoginUrl(request, "autoLogout")); +context.autoUserLogin = session.getAttribute("autoUserLogin"); +context.autoLogoutUrl = LoginWorker.makeLoginUrl(request, "autoLogout"); previousParams = session.getAttribute("_PREVIOUS_PARAMS_"); -if (previousParams != null && previousParams.length() > 0) { - previousParams = UtilHttp.stripNamedParamsFromQueryString(previousParams, UtilMisc.toList("USERNAME", "PASSWORD")); +if (previousParams) { + previousParams = UtilHttp.stripNamedParamsFromQueryString(previousParams, ["USERNAME", "PASSWORD"]); previousParams = "?" + previousParams; } else { previousParams = ""; } -context.put("previousParams", previousParams); +context.previousParams = previousParams; Copied: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/Main.groovy (from r680051, ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/main.bsh) URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/Main.groovy?p2=ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/Main.groovy&p1=ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/main.bsh&r1=680051&r2=680085&rev=680085&view=diff ============================================================================== --- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/main.bsh (original) +++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/Main.groovy Sun Jul 27 03:13:23 2008 @@ -34,7 +34,7 @@ * NOTE JLR 20070221 this should be done using the same method than in add to cart. I will do it like that and remove all this after. * productCategoryId = session.getAttribute("productCategoryId"); -if (productCategoryId == null) { +if (!productCategoryId) { request.setAttribute("productCategoryId", promoCat); } else { request.setAttribute("productCategoryId", productCategoryId); Copied: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OptionSettings.groovy (from r680051, ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/optionsettings.bsh) URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OptionSettings.groovy?p2=ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OptionSettings.groovy&p1=ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/optionsettings.bsh&r1=680051&r2=680085&rev=680085&view=diff ============================================================================== --- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/optionsettings.bsh (original) +++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OptionSettings.groovy Sun Jul 27 03:13:23 2008 @@ -25,19 +25,13 @@ import org.ofbiz.product.store.*; shoppingCart = session.getAttribute("shoppingCart"); -context.put("shoppingCart", shoppingCart); +context.shoppingCart = shoppingCart; productStore = ProductStoreWorker.getProductStore(request); -itemSizes = new LinkedList(); -featureIdSet = new HashSet(); -shipAddress = null; -shipWeight = 0.00; -shipTotal = 0.00; - -if (shoppingCart != null) { +if (shoppingCart) { shippingEstWpr = new ShippingEstimateWrapper(dispatcher, shoppingCart, 0); - context.put("shippingEstWpr", shippingEstWpr); - context.put("carrierShipmentMethodList", shippingEstWpr.getShippingMethods()); + context.shippingEstWpr = shippingEstWpr; + context.carrierShipmentMethodList = shippingEstWpr.getShippingMethods(); } // nuke the event messages @@ -45,18 +39,18 @@ party = null; partyId = session.getAttribute("orderPartyId"); -if (partyId != null) { - party = delegator.findByPrimaryKey("Party", UtilMisc.toMap("partyId", partyId)); - context.put("party", party); +if (partyId) { + party = delegator.findByPrimaryKey("Party", [partyId : partyId]); + context.party = party; } -context.put("emailList", ContactHelper.getContactMechByType(party, "EMAIL_ADDRESS", false)); +context.emailList = ContactHelper.getContactMechByType(party, "EMAIL_ADDRESS", false); -if (shoppingCart != null && shoppingCart.getShipmentMethodTypeId() != null && shoppingCart.getCarrierPartyId() != null) { - context.put("chosenShippingMethod", shoppingCart.getShipmentMethodTypeId() + '@' + shoppingCart.getCarrierPartyId()); - context.put("callSubmitForm",true); +if (shoppingCart && shoppingCart.getShipmentMethodTypeId() && shoppingCart.getCarrierPartyId()) { + context.chosenShippingMethod = shoppingCart.getShipmentMethodTypeId() + '@' + shoppingCart.getCarrierPartyId(); + context.callSubmitForm = true; } -context.put("productStoreId", productStore.get("productStoreId")); -context.put("productStore", productStore); +context.productStoreId = productStore.productStoreId; +context.productStore = productStore; Copied: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderHistory.groovy (from r680051, ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderhistory.bsh) URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderHistory.groovy?p2=ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderHistory.groovy&p1=ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderhistory.bsh&r1=680051&r2=680085&rev=680085&view=diff ============================================================================== --- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderhistory.bsh (original) +++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderHistory.groovy Sun Jul 27 03:13:23 2008 @@ -21,18 +21,18 @@ import org.ofbiz.entity.*; import org.ofbiz.entity.util.*; import org.ofbiz.entity.condition.*; -GenericValue partyRole = delegator.findByPrimaryKey("PartyRole",UtilMisc.toMap("partyId", userLogin.get("partyId"),"roleTypeId","SUPPLIER")); -if((partyRole != null) && (partyRole.get("roleTypeId").equals("SUPPLIER"))){ + +partyRole = delegator.findByPrimaryKey("PartyRole", [partyId : userLogin.partyId, roleTypeId : "SUPPLIER"]); +if("SUPPLIER".equals(partyRole.roleTypeId)){ /** drop shipper or supplier **/ - porderRoleCollection = delegator.findByAnd("OrderRole", UtilMisc.toMap("partyId", userLogin.get("partyId"), "roleTypeId", "SUPPLIER_AGENT")); - porderHeaderList = EntityUtil.orderBy(EntityUtil.filterByAnd(EntityUtil.getRelated("OrderHeader", porderRoleCollection), UtilMisc.toList(EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "ORDER_REJECTED"),EntityCondition.makeCondition("orderTypeId", EntityOperator.EQUALS, "PURCHASE_ORDER"))), UtilMisc.toList("orderDate DESC")); - context.put("porderHeaderList", porderHeaderList); + porderRoleCollection = delegator.findByAnd("OrderRole", [partyId : userLogin.partyId, roleTypeId : "SUPPLIER_AGENT"]); + porderHeaderList = EntityUtil.orderBy(EntityUtil.filterByAnd(EntityUtil.getRelated("OrderHeader", porderRoleCollection), [EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "ORDER_REJECTED"), EntityCondition.makeCondition("orderTypeId", EntityOperator.EQUALS, "PURCHASE_ORDER")]), ["orderDate DESC"]); + context.porderHeaderList = porderHeaderList; } -orderRoleCollection = delegator.findByAnd("OrderRole", UtilMisc.toMap("partyId", userLogin.get("partyId"), "roleTypeId", "PLACING_CUSTOMER")); -orderHeaderList = EntityUtil.orderBy(EntityUtil.filterByAnd(EntityUtil.getRelated("OrderHeader", orderRoleCollection), UtilMisc.toList(EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "ORDER_REJECTED"))), UtilMisc.toList("orderDate DESC")); -context.put("orderHeaderList", orderHeaderList); +orderRoleCollection = delegator.findByAnd("OrderRole", [partyId : userLogin.partyId, roleTypeId : "PLACING_CUSTOMER"]); +orderHeaderList = EntityUtil.orderBy(EntityUtil.filterByAnd(EntityUtil.getRelated("OrderHeader", orderRoleCollection), [EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "ORDER_REJECTED")]), ["orderDate DESC"]); +context.orderHeaderList = orderHeaderList; downloadOrderRoleAndProductContentInfoList = delegator.findByAnd("OrderRoleAndProductContentInfo", - UtilMisc.toMap("partyId", userLogin.get("partyId"), "roleTypeId", "PLACING_CUSTOMER", "productContentTypeId", "DIGITAL_DOWNLOAD", "statusId", "ITEM_COMPLETED")); -context.put("downloadOrderRoleAndProductContentInfoList", downloadOrderRoleAndProductContentInfoList); - + [partyId : userLogin.partyId, roleTypeId : "PLACING_CUSTOMER", productContentTypeId : "DIGITAL_DOWNLOAD", statusId : "ITEM_COMPLETED"]); +context.downloadOrderRoleAndProductContentInfoList = downloadOrderRoleAndProductContentInfoList; Copied: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderStatus.groovy (from r680051, ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh) URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderStatus.groovy?p2=ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderStatus.groovy&p1=ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh&r1=680051&r2=680085&rev=680085&view=diff ============================================================================== --- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/orderstatus.bsh (original) +++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderStatus.groovy Sun Jul 27 03:13:23 2008 @@ -28,56 +28,56 @@ import org.ofbiz.product.catalog.*; import org.ofbiz.product.store.*; -orderId = parameters.get("orderId"); +orderId = parameters.orderId; // we have a special case here where for an anonymous order the user will already be logged out, but the userLogin will be in the request so we can still do a security check here -if (userLogin == null) { - userLogin = parameters.get("temporaryAnonymousUserLogin"); - context.put("userLogin", userLogin); +if (!userLogin) { + userLogin = parameters.temporaryAnonymousUserLogin; + context.userLogin = userLogin; } /* partyId = null; -if (userLogin != null) partyId = userLogin.getString("partyId"); */ +if (userLogin) partyId = userLogin.partyId; */ -partyId = context.get("partyId"); -if (userLogin != null) { - if(partyId == null) { - partyId = userLogin.get("partyId"); +partyId = context.partyId; +if (userLogin) { + if(!partyId) { + partyId = userLogin.partyId; } -} +} // can anybody view an anonymous order? this is set in the screen widget and should only be turned on by an email confirmation screen -allowAnonymousView = context.get("allowAnonymousView"); +allowAnonymousView = context.allowAnonymousView; orderHeader = null; -boolean isDemoStore = true; -if (orderId != null && orderId.length() > 0) { - orderHeader = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", orderId)); - if((orderHeader != null) && (orderHeader.get("orderTypeId").equals("PURCHASE_ORDER"))){ +isDemoStore = true; +if (orderId) { + orderHeader = delegator.findByPrimaryKey("OrderHeader", [orderId : orderId]); + if ("PURCHASE_ORDER".equals(orderHeader?.orderTypeId)){ //drop shipper or supplier roleTypeId = "SUPPLIER_AGENT"; - }else{ + } else { //customer roleTypeId = "PLACING_CUSTOMER"; } - context.put("roleTypeId",roleTypeId); + context.roleTypeId = roleTypeId; // check OrderRole to make sure the user can view this order. This check must be done for any order which is not anonymously placed and // any anonymous order when the allowAnonymousView security flag (see above) is not set to Y, to prevent peeking - if ((orderHeader != null) && (!("anonymous".equals(orderHeader.getString("createdBy"))) || ("anonymous".equals(orderHeader.getString("createdBy")) && !"Y".equals(allowAnonymousView)))) { - orderRole = EntityUtil.getFirst(delegator.findByAnd("OrderRole", UtilMisc.toMap("orderId", orderId, "partyId", partyId, "roleTypeId", roleTypeId))); - - if (userLogin == null || orderRole == null) { + if (orderHeader && (!"anonymous".equals(orderHeader.createdBy) || ("anonymous".equals(orderHeader.createdBy) && !"Y".equals(allowAnonymousView)))) { + orderRole = EntityUtil.getFirst(delegator.findByAnd("OrderRole", [orderId : orderId, partyId : partyId, roleTypeId : roleTypeId])); + + if (!userLogin || !orderRole) { context.remove("orderHeader"); orderHeader = null; - Debug.logWarning("Warning: in orderstatus.bsh before getting order detail info: role not found or user not logged in; partyId=[" + partyId + "], userLoginId=[" + (userLogin == null ? "null" : userLogin.get("userLoginId")) + "]", "orderstatus"); + Debug.logWarning("Warning: in OrderStatus.groovy before getting order detail info: role not found or user not logged in; partyId=[" + partyId + "], userLoginId=[" + (userLogin == null ? "null" : userLogin.get("userLoginId")) + "]", "orderstatus"); } } } -if (orderHeader != null) { +if (orderHeader) { productStore = orderHeader.getRelatedOneCache("ProductStore"); - if (productStore != null) isDemoStore = !"N".equals(productStore.getString("isDemoStore")); + if (productStore) isDemoStore = !"N".equals(productStore.isDemoStore); orderReadHelper = new OrderReadHelper(orderHeader); orderItems = orderReadHelper.getOrderItems(); @@ -92,109 +92,95 @@ orderTaxTotal = OrderReadHelper.getAllOrderItemsAdjustmentsTotal(orderItems, orderAdjustments, false, true, false); orderTaxTotal = orderTaxTotal.add(OrderReadHelper.calcOrderAdjustments(orderHeaderAdjustments, orderSubTotal, false, true, false)); - - placingCustomerOrderRoles = delegator.findByAnd("OrderRole",UtilMisc.toMap("orderId", orderId, "roleTypeId", roleTypeId)); - placingCustomerOrderRole = EntityUtil.getFirst(placingCustomerOrderRoles); - placingCustomerPerson = placingCustomerOrderRole == null ? null : delegator.findByPrimaryKey("Person",UtilMisc.toMap("partyId", placingCustomerOrderRole.getString("partyId"))); + + placingCustomerOrderRoles = delegator.findByAnd("OrderRole", [orderId : orderId, roleTypeId : roleTypeId]); + placingCustomerOrderRole = EntityUtil.getFirst(placingCustomerOrderRoles); + placingCustomerPerson = placingCustomerOrderRole == null ? null : delegator.findByPrimaryKey("Person", [partyId : placingCustomerOrderRole.partyId]); billingAccount = orderHeader.getRelatedOne("BillingAccount"); - - orderPaymentPreferences = UtilMisc.toIterator(EntityUtil.filterByAnd(orderHeader.getRelated("OrderPaymentPreference"), - UtilMisc.toList(EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "PAYMENT_CANCELLED")))); - paymentMethods = new ArrayList(); - if (orderPaymentPreferences != null) { - while (orderPaymentPreferences.hasNext()) { - opp = orderPaymentPreferences.next(); - paymentMethod = opp.getRelatedOne("PaymentMethod"); - if (paymentMethod != null) { - paymentMethods.add(paymentMethod); - } else { - paymentMethodType = opp.getRelatedOne("PaymentMethodType"); - if (paymentMethodType != null) { - context.put("paymentMethodType", paymentMethodType); - } + + orderPaymentPreferences = EntityUtil.filterByAnd(orderHeader.getRelated("OrderPaymentPreference"), [EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "PAYMENT_CANCELLED")]); + paymentMethods = []; + orderPaymentPreferences.each { opp -> + paymentMethod = opp.getRelatedOne("PaymentMethod"); + if (paymentMethod) { + paymentMethods.add(paymentMethod); + } else { + paymentMethodType = opp.getRelatedOne("PaymentMethodType"); + if (paymentMethodType) { + context.paymentMethodType = paymentMethodType; } } } - webSiteId = orderHeader.getString("webSiteId"); - if (webSiteId == null) { - webSiteId = CatalogWorker.getWebSiteId(request); - } + webSiteId = orderHeader.webSiteId ?: CatalogWorker.getWebSiteId(request); - payToPartyId = productStore.getString("payToPartyId"); + payToPartyId = productStore.payToPartyId; paymentAddress = PaymentWorker.getPaymentAddress(delegator, payToPartyId); - if (paymentAddress != null) context.put("paymentAddress", paymentAddress); - + if (paymentAddress) context.paymentAddress = paymentAddress; + // get Shipment tracking info - osisCond = EntityCondition.makeCondition(UtilMisc.toMap("orderId", orderId), EntityOperator.AND); - osisOrder = UtilMisc.toList("shipmentId", "shipmentRouteSegmentId", "shipmentPackageSeqId"); - osisFields = UtilMisc.toSet("shipmentId", "shipmentRouteSegmentId", "carrierPartyId", "shipmentMethodTypeId"); + osisCond = EntityCondition.makeCondition([orderId : orderId], EntityOperator.AND); + osisOrder = ["shipmentId", "shipmentRouteSegmentId", "shipmentPackageSeqId"]; + osisFields = ["shipmentId", "shipmentRouteSegmentId", "carrierPartyId", "shipmentMethodTypeId"] as Set; osisFields.add("shipmentPackageSeqId"); osisFields.add("trackingCode"); osisFields.add("boxNumber"); - osisFindOptions = new EntityFindOptions(); osisFindOptions.setDistinct(true); + osisFindOptions = new EntityFindOptions(); + osisFindOptions.setDistinct(true); orderShipmentInfoSummaryList = delegator.findList("OrderShipmentInfoSummary", osisCond, osisFields, osisOrder, osisFindOptions, false); customerPoNumberSet = new TreeSet(); - orderItemPoIter = UtilMisc.toIterator(orderItems); - while (orderItemPoIter != null && orderItemPoIter.hasNext()) { - orderItemPo = orderItemPoIter.next(); - String correspondingPoId = orderItemPo.getString("correspondingPoId"); - if (UtilValidate.isNotEmpty(correspondingPoId) && !"(none)".equals(correspondingPoId)) { + orderItems.each { orderItemPo -> + correspondingPoId = orderItemPo.correspondingPoId; + if (correspondingPoId && !"(none)".equals(correspondingPoId)) { customerPoNumberSet.add(correspondingPoId); } } - + // check if there are returnable items returned = 0.00; - totalItems = 0.00; - oii = orderItems.iterator(); - while (oii.hasNext()) { - oitem = oii.next(); - totalItems += oitem.getDouble("quantity").doubleValue(); + totalItems = 0.00; + orderItems.each { oitem -> + totalItems += oitem.quantity; ritems = oitem.getRelated("ReturnItem"); - if (ritems != null) { - rii = ritems.iterator(); - while (rii.hasNext()) { - ritem = rii.next(); - rh = ritem.getRelatedOne("ReturnHeader"); - if (!rh.getString("statusId").equals("RETURN_CANCELLED")) { - returned += ritem.getDouble("returnQuantity").doubleValue(); - } - } + ritems.each { ritem -> + rh = ritem.getRelatedOne("ReturnHeader"); + if (!rh.statusId.equals("RETURN_CANCELLED")) { + returned += ritem.returnQuantity; + } } } if (totalItems > returned) { - context.put("returnLink", "Y"); + context.returnLink = "Y"; } - context.put("orderId", orderId); - context.put("orderHeader", orderHeader); - context.put("localOrderReadHelper", orderReadHelper); - context.put("orderItems", orderItems); - context.put("orderAdjustments", orderAdjustments); - context.put("orderHeaderAdjustments", orderHeaderAdjustments); - context.put("orderSubTotal", orderSubTotal); - context.put("orderItemShipGroups", orderItemShipGroups); - context.put("headerAdjustmentsToShow", headerAdjustmentsToShow); - context.put("currencyUomId", orderReadHelper.getCurrency()); - - context.put("orderShippingTotal", orderShippingTotal); - context.put("orderTaxTotal", orderTaxTotal); - context.put("orderGrandTotal", OrderReadHelper.getOrderGrandTotal(orderItems, orderAdjustments)); - context.put("placingCustomerPerson", placingCustomerPerson); - - context.put("billingAccount", billingAccount); - context.put("paymentMethods", paymentMethods); - - context.put("productStore", productStore); - context.put("isDemoStore", isDemoStore); - - context.put("orderShipmentInfoSummaryList", orderShipmentInfoSummaryList); - context.put("customerPoNumberSet", customerPoNumberSet); - - orderItemChangeReasons = delegator.findByAnd("Enumeration", UtilMisc.toMap("enumTypeId", "ODR_ITM_CH_REASON"), UtilMisc.toList("sequenceId")); - context.put("orderItemChangeReasons", orderItemChangeReasons); + context.orderId = orderId; + context.orderHeader = orderHeader; + context.localOrderReadHelper = orderReadHelper; + context.orderItems = orderItems; + context.orderAdjustments = orderAdjustments; + context.orderHeaderAdjustments = orderHeaderAdjustments; + context.orderSubTotal = orderSubTotal; + context.orderItemShipGroups = orderItemShipGroups; + context.headerAdjustmentsToShow = headerAdjustmentsToShow; + context.currencyUomId = orderReadHelper.getCurrency(); + + context.orderShippingTotal = orderShippingTotal; + context.orderTaxTotal = orderTaxTotal; + context.orderGrandTotal = OrderReadHelper.getOrderGrandTotal(orderItems, orderAdjustments); + context.placingCustomerPerson = placingCustomerPerson; + + context.billingAccount = billingAccount; + context.paymentMethods = paymentMethods; + + context.productStore = productStore; + context.isDemoStore = isDemoStore; + + context.orderShipmentInfoSummaryList = orderShipmentInfoSummaryList; + context.customerPoNumberSet = customerPoNumberSet; + + orderItemChangeReasons = delegator.findByAnd("Enumeration", [enumTypeId : "ODR_ITM_CH_REASON"], ["sequenceId"]); + context.orderItemChangeReasons = orderItemChangeReasons; } Copied: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/PaymentInformation.groovy (from r680051, ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/paymentinformation.bsh) URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/PaymentInformation.groovy?p2=ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/PaymentInformation.groovy&p1=ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/paymentinformation.bsh&r1=680051&r2=680085&rev=680085&view=diff ============================================================================== --- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/paymentinformation.bsh (original) +++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/PaymentInformation.groovy Sun Jul 27 03:13:23 2008 @@ -25,98 +25,95 @@ import org.ofbiz.party.contact.*; cart = ShoppingCartEvents.getCartObject(request); -context.put("cart", cart); +context.cart = cart; partyId = cart.getPartyId(); currencyUomId = cart.getCurrency(); -if (partyId == null) { - userLogin = session.getAttribute("userLogin"); - partyId = userLogin.getString("partyId"); +if (!partyId) { + partyId = userLogin.partyId; } -context.put("partyId", partyId); +context.partyId = partyId; -if (partyId != null && !partyId.equals("_NA_")) { - party = delegator.findByPrimaryKey("Party", UtilMisc.toMap("partyId", partyId)); +if (partyId && !partyId.equals("_NA_")) { + party = delegator.findByPrimaryKey("Party", [partyId : partyId]); person = party.getRelatedOne("Person"); - context.put("party", party); - context.put("person", person); + context.party = party; + context.person = person; } // nuke the event messages request.removeAttribute("_EVENT_MESSAGE_"); -if (parameters.get("useShipAddr") != null && cart.getShippingContactMechId() != null) { +if (parameters.useShipAddr && cart.getShippingContactMechId()) { shippingContactMech = cart.getShippingContactMechId(); - postalAddress = delegator.findByPrimaryKey("PostalAddress", UtilMisc.toMap("contactMechId", shippingContactMech)); - context.put("useEntityFields", "Y"); - context.put("postalAddress", postalAddress); + postalAddress = delegator.findByPrimaryKey("PostalAddress", [contactMechId : shippingContactMech]); + context.useEntityFields = "Y"; + context.postalAddress = postalAddress; - if (postalAddress != null && partyId != null) { - partyContactMechs = delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId, "contactMechId", postalAddress.get("contactMechId")), UtilMisc.toList("-fromDate")); + if (postalAddress && partyId) { + partyContactMechs = delegator.findByAnd("PartyContactMech", [partyId : partyId, contactMechId : postalAddress.contactMechId], ["-fromDate"]); partyContactMechs = EntityUtil.filterByDate(partyContactMechs); partyContactMech = EntityUtil.getFirst(partyContactMechs); - context.put("partyContactMech", partyContactMech); + context.partyContactMech = partyContactMech; } } else { - context.put("postalAddress", UtilHttp.getParameterMap(request)); + context.postalAddress = UtilHttp.getParameterMap(request); } -if (cart != null) { - if (cart.getPaymentMethodIds() != null && cart.getPaymentMethodIds().size() > 0) { +if (cart) { + if (cart.getPaymentMethodIds()) { paymentMethods = cart.getPaymentMethods(); - paymentMethodIter = paymentMethods.iterator(); - while (paymentMethodIter.hasNext()) { - paymentMethod = (GenericValue)paymentMethodIter.next(); + paymentMethods.each { paymentMethod -> account = null; - if (paymentMethod != null && paymentMethod.getString("paymentMethodTypeId").equals("CREDIT_CARD")) { + if ("CREDIT_CARD".equals(paymentMethod?.paymentMethodTypeId)) { account = paymentMethod.getRelatedOne("CreditCard"); - context.put("creditCard", account); - context.put("paymentMethodTypeId", "CREDIT_CARD"); - } else if (paymentMethod != null && paymentMethod.getString("paymentMethodTypeId").equals("EFT_ACCOUNT")) { + context.creditCard = account; + context.paymentMethodTypeId = "CREDIT_CARD"; + } else if ("EFT_ACCOUNT".equals(paymentMethod?.paymentMethodTypeId)) { account = paymentMethod.getRelatedOne("EftAccount"); - context.put("eftAccount", account); - context.put("paymentMethodTypeId", "EFT_ACCOUNT"); - } else if (paymentMethod != null && paymentMethod.getString("paymentMethodTypeId").equals("GIFT_CARD")) { + context.eftAccount = account; + context.paymentMethodTypeId = "EFT_ACCOUNT"; + } else if ("GIFT_CARD".equals(paymentMethod?.paymentMethodTypeId)) { account = paymentMethod.getRelatedOne("GiftCard"); - context.put("giftCard", account); - context.put("paymentMethodTypeId", "GIFT_CARD"); - context.put("addGiftCard","Y"); + context.giftCard = account; + context.paymentMethodTypeId = "GIFT_CARD"; + context.addGiftCard = "Y"; } else { - context.put("paymentMethodTypeId", "EXT_OFFLINE"); + context.paymentMethodTypeId = "EXT_OFFLINE"; } - if (account != null && parameters.get("useShipAddr") == null) { + if (account && !parameters.useShipAddr) { address = account.getRelatedOne("PostalAddress"); - context.put("postalAddress", address); + context.postalAddress = address; } - } - } + } + } } -if(parameters.get("useShipAddr") == null){ - if (cart != null && postalAddress !=null){ - postalAddress = context.get("postalAddress"); +if(!parameters.useShipAddr){ + if (cart && postalAddress) { + postalAddress = context.postalAddress; shippingContactMechId = cart.getShippingContactMechId(); - contactMechId = postalAddress.get("contactMechId"); - if(shippingContactMechId != null && shippingContactMechId.equals(contactMechId)){ - context.put("useShipAddr","Y"); - } + contactMechId = postalAddress.contactMechId; + if(shippingContactMechId?.equals(contactMechId)){ + context.useShipAddr = "Y"; + } } -}else{ - context.put("useShipAddr",parameters.get("useShipAddr")); +} else { + context.useShipAddr = parameters.useShipAddr; } -// Added here to satisfy genericaddress.ftl -if(context.get("postalAddress") != null){ - postalAddress = context.get("postalAddress"); - parameters.put("address1",postalAddress.get("address1")); - parameters.put("address2",postalAddress.get("address2")); - parameters.put("city",postalAddress.get("city")); - parameters.put("stateProvinceGeoId",postalAddress.get("stateProvinceGeoId")); - parameters.put("postalCode",postalAddress.get("postalCode")); - parameters.put("countryGeoId",postalAddress.get("countryGeoId")); - parameters.put("contactMechId",postalAddress.get("contactMechId")); - if(context.get("creditCard") != null){ - context.put("callSubmitForm",true); +// Added here to satisfy genericaddress.ftl +if (context.postalAddress){ + postalAddress = context.postalAddress; + parameters.address1 = postalAddress.address1; + parameters.address2 = postalAddress.address2; + parameters.city = postalAddress.city; + parameters.stateProvinceGeoId = postalAddress.stateProvinceGeoId; + parameters.postalCode = postalAddress.postalCode; + parameters.countryGeoId = postalAddress.countryGeoId; + parameters.contactMechId = postalAddress.contactMechId; + if (context.creditCard) { + context.callSubmitForm = true; } } Copied: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/PaymentOptions.groovy (from r680051, ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/paymentoptions.bsh) URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/PaymentOptions.groovy?p2=ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/PaymentOptions.groovy&p1=ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/paymentoptions.bsh&r1=680051&r2=680085&rev=680085&view=diff ============================================================================== --- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/paymentoptions.bsh (original) +++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/PaymentOptions.groovy Sun Jul 27 03:13:23 2008 @@ -22,13 +22,11 @@ //Get the Cart cart = ShoppingCartEvents.getCartObject(request); paymentMethodTypeIds = cart.getPaymentMethodTypeIds(); -paymentMethodTypeIdIter = paymentMethodTypeIds.iterator(); -while (paymentMethodTypeIdIter.hasNext()) { - String paymentMethodTypeId = (String) paymentMethodTypeIdIter.next(); - context.put("callSubmitForm",true); +paymentMethodTypeIds.each { paymentMethodTypeId -> + context.callSubmitForm = true; if ("GIFT_CARD".equals(paymentMethodTypeId)) { - context.put("addGiftCard","Y"); + context.addGiftCard = "Y"; } else { - context.put("paymentMethodTypeId",paymentMethodTypeId); + context.paymentMethodTypeId = paymentMethodTypeId; } } Copied: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/QuickAnonCheckoutLinks.groovy (from r680051, ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/quickAnonCheckoutLinks.bsh) URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/QuickAnonCheckoutLinks.groovy?p2=ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/QuickAnonCheckoutLinks.groovy&p1=ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/quickAnonCheckoutLinks.bsh&r1=680051&r2=680085&rev=680085&view=diff ============================================================================== --- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/quickAnonCheckoutLinks.bsh (original) +++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/QuickAnonCheckoutLinks.groovy Sun Jul 27 03:13:23 2008 @@ -20,12 +20,12 @@ shoppingCart = ShoppingCartEvents.getCartObject(request); -userLogin = context.get("userLogin"); -if (userLogin != null) { - context.put("enableShippingAddress",true); +userLogin = context.userLogin; +if (userLogin) { + context.enableShippingAddress = true; } shippingContactMechId = shoppingCart.getShippingContactMechId(); -if (shippingContactMechId !=null && !shippingContactMechId.equals("")) { - context.put("enableShipmentMethod",true); +if (shippingContactMechId) { + context.enableShipmentMethod = true; } Copied: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/QuickAnonCustSettings.groovy (from r680051, ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/quickAnonCustSettings.bsh) URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/QuickAnonCustSettings.groovy?p2=ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/QuickAnonCustSettings.groovy&p1=ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/quickAnonCustSettings.bsh&r1=680051&r2=680085&rev=680085&view=diff ============================================================================== --- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/quickAnonCustSettings.bsh (original) +++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/QuickAnonCustSettings.groovy Sun Jul 27 03:13:23 2008 @@ -28,116 +28,116 @@ partyId = null; -userLogin = context.get("userLogin"); -if (userLogin != null) { - partyId = userLogin.get("partyId"); +userLogin = context.userLogin; +if (userLogin) { + partyId = userLogin.partyId; } -if (partyId == null && parameters.get("partyId") != null) { - partyId = parameters.get("partyId"); +if (!partyId && parameters.partyId) { + partyId = parameters.partyId; } -if (partyId != null) { - parameters.put("partyId", partyId); +if (partyId) { + parameters.partyId = partyId; // NOTE: if there was an error, then don't look up and fill in all of this data, just use the values from the previous request (which will be in the parameters Map automagically) - if (request.getAttribute("_ERROR_MESSAGE_") == null && request.getAttribute("_ERROR_MESSAGE_LIST_") == null) { - person = delegator.findByPrimaryKey("Person", UtilMisc.toMap("partyId", partyId)); - if (person != null) { - context.put("callSubmitForm",true); + if (!request.getAttribute("_ERROR_MESSAGE_") && !request.getAttribute("_ERROR_MESSAGE_LIST_")) { + person = delegator.findByPrimaryKey("Person", [partyId : partyId]); + if (person) { + context.callSubmitForm = true; // should never be null for the anonymous checkout, but just in case - parameters.put("firstName", person.get("firstName")); - parameters.put("middleName", person.get("middleName")); - parameters.put("lastName", person.get("lastName")); + parameters.firstName = person.firstName; + parameters.middleName = person.middleName; + parameters.lastName = person.lastName; } - + // get the Email Address emailPartyContactDetail = EntityUtil.getFirst(EntityUtil.filterByDate(delegator.findByAnd("PartyContactDetailByPurpose", - UtilMisc.toMap("partyId", partyId, "contactMechPurposeTypeId", "PRIMARY_EMAIL")), true)); - if (emailPartyContactDetail != null) { - parameters.put("emailContactMechId", emailPartyContactDetail.get("contactMechId")); - parameters.put("emailAddress", emailPartyContactDetail.get("infoString")); - parameters.put("emailSol", emailPartyContactDetail.get("allowSolicitation")); + [partyId : partyId, contactMechPurposeTypeId : "PRIMARY_EMAIL"]))); + if (emailPartyContactDetail) { + parameters.emailContactMechId = emailPartyContactDetail.contactMechId; + parameters.emailAddress = emailPartyContactDetail.infoString; + parameters.emailSol = emailPartyContactDetail.allowSolicitation; } // get the Phone Numbers homePhonePartyContactDetail = EntityUtil.getFirst(EntityUtil.filterByDate(delegator.findByAnd("PartyContactDetailByPurpose", - UtilMisc.toMap("partyId", partyId, "contactMechPurposeTypeId", "PHONE_HOME")), true)); - if (homePhonePartyContactDetail != null) { - parameters.put("homePhoneContactMechId", homePhonePartyContactDetail.get("contactMechId")); - parameters.put("homeCountryCode", homePhonePartyContactDetail.get("countryCode")); - parameters.put("homeAreaCode", homePhonePartyContactDetail.get("areaCode")); - parameters.put("homeContactNumber", homePhonePartyContactDetail.get("contactNumber")); - parameters.put("homeExt", homePhonePartyContactDetail.get("extension")); - parameters.put("homeSol", homePhonePartyContactDetail.get("allowSolicitation")); + [partyId : partyId, contactMechPurposeTypeId : "PHONE_HOME"]))); + if (homePhonePartyContactDetail) { + parameters.homePhoneContactMechId = homePhonePartyContactDetail.contactMechId; + parameters.homeCountryCode = homePhonePartyContactDetail.countryCode; + parameters.homeAreaCode = homePhonePartyContactDetail.areaCode; + parameters.homeContactNumber = homePhonePartyContactDetail.contactNumber; + parameters.homeExt = homePhonePartyContactDetail.extension; + parameters.homeSol = homePhonePartyContactDetail.allowSolicitation; } workPhonePartyContactDetail = EntityUtil.getFirst(EntityUtil.filterByDate(delegator.findByAnd("PartyContactDetailByPurpose", - UtilMisc.toMap("partyId", partyId, "contactMechPurposeTypeId", "PHONE_WORK")), true)); - if (workPhonePartyContactDetail != null) { - parameters.put("workPhoneContactMechId", workPhonePartyContactDetail.get("contactMechId")); - parameters.put("workCountryCode", workPhonePartyContactDetail.get("countryCode")); - parameters.put("workAreaCode", workPhonePartyContactDetail.get("areaCode")); - parameters.put("workContactNumber", workPhonePartyContactDetail.get("contactNumber")); - parameters.put("workExt", workPhonePartyContactDetail.get("extension")); - parameters.put("workSol", workPhonePartyContactDetail.get("allowSolicitation")); + [partyId : partyId, contactMechPurposeTypeId : "PHONE_WORK"]))); + if (workPhonePartyContactDetail) { + parameters.workPhoneContactMechId = workPhonePartyContactDetail.contactMechId; + parameters.workCountryCode = workPhonePartyContactDetail.countryCode; + parameters.workAreaCode = workPhonePartyContactDetail.areaCode; + parameters.workContactNumber = workPhonePartyContactDetail.contactNumber; + parameters.workExt = workPhonePartyContactDetail.extension; + parameters.workSol = workPhonePartyContactDetail.allowSolicitation; } } } cart = session.getAttribute("shoppingCart"); cartPartyId = cart.getPartyId(); -context.put("cart", cart); +context.cart = cart; // nuke the event messages request.removeAttribute("_EVENT_MESSAGE_"); -if (cartPartyId != null && !cartPartyId.equals("_NA_")) { - cartParty = delegator.findByPrimaryKey("Party", UtilMisc.toMap("partyId", cartPartyId)); - if(cartParty != null){ - cartPerson = cartParty.getRelatedOne("Person"); - context.put("party", cartParty); - context.put("person", cartPerson); +if (cartPartyId && !cartPartyId.equals("_NA_")) { + cartParty = delegator.findByPrimaryKey("Party", [partyId : cartPartyId]); + if (cartParty) { + cartPerson = cartParty.getRelatedOne("Person"); + context.party = cartParty; + context.person = cartPerson; } } -if (cart != null && cart.getShippingContactMechId() != null) { +if (cart && cart.getShippingContactMechId()) { shippingContactMechId = cart.getShippingContactMechId(); shippingPartyContactDetail = EntityUtil.getFirst(EntityUtil.filterByDate(delegator.findByAnd("PartyContactDetailByPurpose", - UtilMisc.toMap("partyId", cartPartyId, "contactMechId", shippingContactMechId)), true)); - parameters.put("shippingContactMechId", shippingPartyContactDetail.get("contactMechId")); - context.put("callSubmitForm",true); - parameters.put("shipToName", shippingPartyContactDetail.get("toName")); - parameters.put("shipToAttnName", shippingPartyContactDetail.get("attnName")); - parameters.put("shipToAddress1", shippingPartyContactDetail.get("address1")); - parameters.put("shipToAddress2", shippingPartyContactDetail.get("address2")); - parameters.put("shipToCity", shippingPartyContactDetail.get("city")); - parameters.put("shipToPostalCode", shippingPartyContactDetail.get("postalCode")); - parameters.put("shipToStateProvinceGeoId", shippingPartyContactDetail.get("stateProvinceGeoId")); - parameters.put("shipToCountryGeoId", shippingPartyContactDetail.get("countryGeoId")); + [partyId : cartPartyId, contactMechId : shippingContactMechId]))); + parameters.shippingContactMechId = shippingPartyContactDetail.contactMechId; + context.callSubmitForm = true; + parameters.shipToName = shippingPartyContactDetail.toName; + parameters.shipToAttnName = shippingPartyContactDetail.attnName; + parameters.shipToAddress1 = shippingPartyContactDetail.address1; + parameters.shipToAddress2 = shippingPartyContactDetail.address2; + parameters.shipToCity = shippingPartyContactDetail.city; + parameters.shipToPostalCode = shippingPartyContactDetail.postalCode; + parameters.shipToStateProvinceGeoId = shippingPartyContactDetail.stateProvinceGeoId; + parameters.shipToCountryGeoId = shippingPartyContactDetail.countryGeoId; } else { - context.put("postalFields", UtilHttp.getParameterMap(request)); + context.postalFields = UtilHttp.getParameterMap(request); } billingContactMechId = session.getAttribute("billingContactMechId"); -if(billingContactMechId != null){ - billPostalAddress = delegator.findByPrimaryKey("PostalAddress",UtilMisc.toMap("contactMechId",billingContactMechId)); - parameters.put("billingContactMechId", billPostalAddress.get("contactMechId")); - parameters.put("billToName", billPostalAddress.get("toName")); - parameters.put("billToAttnName", billPostalAddress.get("attnName")); - parameters.put("billToAddress1", billPostalAddress.get("address1")); - parameters.put("billToAddress2", billPostalAddress.get("address2")); - parameters.put("billToCity", billPostalAddress.get("city")); - parameters.put("billToPostalCode", billPostalAddress.get("postalCode")); - parameters.put("billToStateProvinceGeoId", billPostalAddress.get("stateProvinceGeoId")); - parameters.put("billToCountryGeoId", billPostalAddress.get("countryGeoId")); -} - -if(cart != null && cart.getShippingContactMechId() != null && shippingPartyContactDetail != null){ - shippingContactMechId = shippingPartyContactDetail.get("contactMechId"); - if(billingContactMechId != null && billingContactMechId.equals(shippingContactMechId)){ - context.put("useShippingPostalAddressForBilling","Y"); +if (billingContactMechId) { + billPostalAddress = delegator.findByPrimaryKey("PostalAddress", [contactMechId : billingContactMechId]); + parameters.billingContactMechId = billPostalAddress.contactMechId; + parameters.billToName = billPostalAddress.toName; + parameters.billToAttnName = billPostalAddress.attnName; + parameters.billToAddress1 = billPostalAddress.address1; + parameters.billToAddress2 = billPostalAddress.address2; + parameters.billToCity = billPostalAddress.city; + parameters.billToPostalCode = billPostalAddress.postalCode; + parameters.billToStateProvinceGeoId = billPostalAddress.stateProvinceGeoId; + parameters.billToCountryGeoId = billPostalAddress.countryGeoId; +} + +if(cart?.getShippingContactMechId() && shippingPartyContactDetail) { + shippingContactMechId = shippingPartyContactDetail.contactMechId; + if(billingContactMechId?.equals(shippingContactMechId)){ + context.useShippingPostalAddressForBilling = "Y"; } } -parameters.put("shippingContactMechPurposeTypeId", "SHIPPING_LOCATION"); -parameters.put("billingContactMechPurposeTypeId", "BILLING_LOCATION"); \ No newline at end of file +parameters.shippingContactMechPurposeTypeId = "SHIPPING_LOCATION"; +parameters.billingContactMechPurposeTypeId = "BILLING_LOCATION"; Copied: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/QuickAnonOptionSettings.groovy (from r680051, ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/quickAnonOptionSettings.bsh) URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/QuickAnonOptionSettings.groovy?p2=ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/QuickAnonOptionSettings.groovy&p1=ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/quickAnonOptionSettings.bsh&r1=680051&r2=680085&rev=680085&view=diff ============================================================================== --- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/quickAnonOptionSettings.bsh (original) +++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/QuickAnonOptionSettings.groovy Sun Jul 27 03:13:23 2008 @@ -25,19 +25,13 @@ import org.ofbiz.product.store.*; shoppingCart = session.getAttribute("shoppingCart"); -context.put("shoppingCart", shoppingCart); +context.shoppingCart = shoppingCart; productStore = ProductStoreWorker.getProductStore(request); -itemSizes = new LinkedList(); -featureIdSet = new HashSet(); -shipAddress = null; -shipWeight = 0.00; -shipTotal = 0.00; - -if (shoppingCart != null) { +if (shoppingCart) { shippingEstWpr = new ShippingEstimateWrapper(dispatcher, shoppingCart, 0); - context.put("shippingEstWpr", shippingEstWpr); - context.put("carrierShipmentMethodList", shippingEstWpr.getShippingMethods()); + context.shippingEstWpr = shippingEstWpr; + context.carrierShipmentMethodList = shippingEstWpr.getShippingMethods(); } // nuke the event messages @@ -45,18 +39,18 @@ party = null; partyId = session.getAttribute("orderPartyId"); -if (partyId != null) { - party = delegator.findByPrimaryKey("Party", UtilMisc.toMap("partyId", partyId)); - context.put("party", party); +if (partyId) { + party = delegator.findByPrimaryKey("Party", [partyId : partyId]); + context.party = party; } -context.put("emailList", ContactHelper.getContactMechByType(party, "EMAIL_ADDRESS", false)); +context.emailList = ContactHelper.getContactMechByType(party, "EMAIL_ADDRESS", false); -if (shoppingCart != null && shoppingCart.getShipmentMethodTypeId() != null && shoppingCart.getCarrierPartyId() != null) { - context.put("chosenShippingMethod", shoppingCart.getShipmentMethodTypeId() + '@' + shoppingCart.getCarrierPartyId()); - context.put("callSubmitForm",true); +if (shoppingCart?.getShipmentMethodTypeId() && shoppingCart.getCarrierPartyId()) { + context.chosenShippingMethod = shoppingCart.getShipmentMethodTypeId() + '@' + shoppingCart.getCarrierPartyId(); + context.callSubmitForm = true; } -context.put("productStoreId", productStore.get("productStoreId")); -context.put("productStore", productStore); +context.productStoreId = productStore.productStoreId; +context.productStore = productStore; Copied: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/QuickAnonPaymentInformation.groovy (from r680051, ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/quickAnonPaymentInformation.bsh) URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/QuickAnonPaymentInformation.groovy?p2=ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/QuickAnonPaymentInformation.groovy&p1=ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/quickAnonPaymentInformation.bsh&r1=680051&r2=680085&rev=680085&view=diff ============================================================================== --- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/quickAnonPaymentInformation.bsh (original) +++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/QuickAnonPaymentInformation.groovy Sun Jul 27 03:13:23 2008 @@ -25,27 +25,20 @@ import org.ofbiz.party.contact.*; cart = ShoppingCartEvents.getCartObject(request); -context.put("cart", cart); +context.cart = cart; -paymentMethodTypeId = parameters.get("paymentMethodTypeId"); -if(paymentMethodTypeId == null) { - parameters.put("paymentMethodTypeId","CREDIT_CARD"); -} +paymentMethodTypeId = parameters.paymentMethodTypeId ?: "CREDIT_CARD"; // nuke the event messages request.removeAttribute("_EVENT_MESSAGE_"); -if (cart != null) { - if (cart.getPaymentMethodIds() != null && cart.getPaymentMethodIds().size() > 0) { - paymentMethods = cart.getPaymentMethods(); - paymentMethodIter = paymentMethods.iterator(); - while (paymentMethodIter.hasNext()) { - paymentMethod = (GenericValue)paymentMethodIter.next(); - if (paymentMethod != null && paymentMethod.getString("paymentMethodTypeId").equals("CREDIT_CARD")) { - paymentMethodId = paymentMethod.get("paymentMethodId"); - parameters.put("paymentMethodId",paymentMethodId); - } - } - } -} +if (cart?.getPaymentMethodIds()) { + paymentMethods = cart.getPaymentMethods(); + paymentMethods.each {paymentMethod -> + if ("CREDIT_CARD".equals(paymentMethod?.paymentMethodTypeId)) { + paymentMethodId = paymentMethod.paymentMethodId; + parameters.paymentMethodId = paymentMethodId; + } + } +} Copied: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/RequestReturn.groovy (from r680051, ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/requestreturn.bsh) URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/RequestReturn.groovy?p2=ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/RequestReturn.groovy&p1=ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/requestreturn.bsh&r1=680051&r2=680085&rev=680085&view=diff ============================================================================== --- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/requestreturn.bsh (original) +++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/RequestReturn.groovy Sun Jul 27 03:13:23 2008 @@ -21,44 +21,37 @@ import org.ofbiz.entity.*; import org.ofbiz.party.contact.*; -dispatcher = request.getAttribute("dispatcher"); -delegator = request.getAttribute("delegator"); -orderId = request.getParameter("orderId"); -context.put("orderId", orderId); +orderId = parameters.orderId; +context.orderId = orderId; -userLogin = session.getAttribute("userLogin"); party = userLogin.getRelatedOne("Party"); -context.put("party", party); +context.party = party; -returnTypes = delegator.findList("ReturnType", null, null, UtilMisc.toList("sequenceId"), null, false); -context.put("returnTypes", returnTypes); +returnTypes = delegator.findList("ReturnType", null, null, ["sequenceId"], null, false); +context.returnTypes = returnTypes; -returnReasons = delegator.findList("ReturnReason", null, null, UtilMisc.toList("sequenceId"), null, false); -context.put("returnReasons", returnReasons); +returnReasons = delegator.findList("ReturnReason", null, null, ["sequenceId"], null, false); +context.returnReasons = returnReasons; -if (orderId != null) { - Map returnRes = dispatcher.runSync("getReturnableItems", UtilMisc.toMap("orderId", orderId)); - context.put("returnableItems", returnRes.get("returnableItems")); - orderHeader = delegator.findByPrimaryKeyCache("OrderHeader", UtilMisc.toMap("orderId", orderId)); - context.put("orderHeader", orderHeader); +if (orderId) { + returnRes = dispatcher.runSync("getReturnableItems", [orderId : orderId]); + context.returnableItems = returnRes.returnableItems; + orderHeader = delegator.findByPrimaryKeyCache("OrderHeader", [orderId : orderId]); + context.orderHeader = orderHeader; } -returnItemTypeMap = delegator.findByAnd("ReturnItemTypeMap", UtilMisc.toMap("returnHeaderTypeId", "CUSTOMER_RETURN")); -iter = returnItemTypeMap.iterator(); +returnItemTypeMap = delegator.findByAnd("ReturnItemTypeMap", [returnHeaderTypeId : "CUSTOMER_RETURN"]); typeMap = new HashMap(); -while (iter.hasNext()) { - value = iter.next(); - typeMap.put(value.getString("returnItemMapKey"), value.getString("returnItemTypeId")); +returnItemTypeMap.each { value -> + typeMap[value.returnItemMapKey = value.returnItemTypeId; } -context.put("returnItemTypeMap", typeMap); +context.returnItemTypeMap = typeMap; //put in the return to party information from the order header -if (orderId != null) { - order = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", orderId)); +if (orderId) { + order = delegator.findByPrimaryKey("OrderHeader", [orderId : orderId]); productStore = order.getRelatedOne("ProductStore"); - context.put("toPartyId", productStore.getString("payToPartyId")); + context.toPartyId = productStore.payToPartyId; } -context.put("shippingContactMechList", ContactHelper.getContactMech(party, "SHIPPING_LOCATION", "POSTAL_ADDRESS", false)); - - +context.shippingContactMechList = ContactHelper.getContactMech(party, "SHIPPING_LOCATION", "POSTAL_ADDRESS", false); Copied: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/ShipSettings.groovy (from r680051, ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/shipsettings.bsh) URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/ShipSettings.groovy?p2=ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/ShipSettings.groovy&p1=ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/shipsettings.bsh&r1=680051&r2=680085&rev=680085&view=diff ============================================================================== --- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/shipsettings.bsh (original) +++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/ShipSettings.groovy Sun Jul 27 03:13:23 2008 @@ -26,53 +26,51 @@ cart = session.getAttribute("shoppingCart"); partyId = cart.getPartyId(); -context.put("cart", cart); +context.cart = cart; // nuke the event messages request.removeAttribute("_EVENT_MESSAGE_"); -if (partyId != null && !partyId.equals("_NA_")) { - party = delegator.findByPrimaryKey("Party", UtilMisc.toMap("partyId", partyId)); +if (partyId && !partyId.equals("_NA_")) { + party = delegator.findByPrimaryKey("Party", [partyId : partyId]); person = party.getRelatedOne("Person"); - context.put("party", party); - context.put("person", person); + context.party = party; + context.person = person; } -if (cart != null && cart.getShippingContactMechId() != null) { +if (cart?.getShippingContactMechId()) { shippingContactMechId = cart.getShippingContactMechId(); shippingPartyContactDetail = EntityUtil.getFirst(EntityUtil.filterByDate(delegator.findByAnd("PartyContactDetailByPurpose", - UtilMisc.toMap("partyId", partyId, "contactMechId", shippingContactMechId)), true)); - parameters.put("shippingContactMechId", shippingPartyContactDetail.get("contactMechId")); - context.put("callSubmitForm",true); + [partyId : partyId, contactMechId : shippingContactMechId]))); + parameters.shippingContactMechId = shippingPartyContactDetail.contactMechId; + context.callSubmitForm = true; fullAddressBuf = new StringBuffer(); - fullAddressBuf.append(shippingPartyContactDetail.get("address1")); - if (shippingPartyContactDetail.get("address2") != null) { + fullAddressBuf.append(shippingPartyContactDetail.address1); + if (shippingPartyContactDetail.address2) { fullAddressBuf.append(", "); - fullAddressBuf.append(shippingPartyContactDetail.get("address2")); + fullAddressBuf.append(shippingPartyContactDetail.address2); } fullAddressBuf.append(", "); - fullAddressBuf.append(shippingPartyContactDetail.get("city")); + fullAddressBuf.append(shippingPartyContactDetail.city); fullAddressBuf.append(", "); - fullAddressBuf.append(shippingPartyContactDetail.get("postalCode")); - parameters.put("fullAddress", fullAddressBuf.toString()); + fullAddressBuf.append(shippingPartyContactDetail.postalCode); + parameters.fullAddress = fullAddressBuf.toString(); // NOTE: these parameters are a special case because they might be filled in by the address lookup service, so if they are there we won't fill in over them... - if (parameters.get("postalCode") == null) { - parameters.put("attnName", shippingPartyContactDetail.get("attnName")); - parameters.put("address1", shippingPartyContactDetail.get("address1")); - parameters.put("address2", shippingPartyContactDetail.get("address2")); - parameters.put("city", shippingPartyContactDetail.get("city")); - parameters.put("postalCode", shippingPartyContactDetail.get("postalCode")); - parameters.put("stateProvinceGeoId", shippingPartyContactDetail.get("stateProvinceGeoId")); - parameters.put("countryGeoId", shippingPartyContactDetail.get("countryGeoId")); - parameters.put("allowSolicitation", shippingPartyContactDetail.get("allowSolicitation")); + if (!parameters.postalCode) { + parameters.attnName = shippingPartyContactDetail.attnName; + parameters.address1 = shippingPartyContactDetail.address1; + parameters.address2 = shippingPartyContactDetail.address2; + parameters.city = shippingPartyContactDetail.city; + parameters.postalCode = shippingPartyContactDetail.postalCode; + parameters.stateProvinceGeoId = shippingPartyContactDetail.stateProvinceGeoId; + parameters.countryGeoId = shippingPartyContactDetail.countryGeoId; + parameters.allowSolicitation = shippingPartyContactDetail.allowSolicitation; } - parameters.put("yearsAtAddress", shippingPartyContactDetail.get("yearsWithContactMech")); - parameters.put("monthsAtAddress", shippingPartyContactDetail.get("monthsWithContactMech")); + parameters.yearsAtAddress = shippingPartyContactDetail.yearsWithContactMech; + parameters.monthsAtAddress = shippingPartyContactDetail.monthsWithContactMech; } else { - context.put("postalFields", UtilHttp.getParameterMap(request)); + context.postalFields = UtilHttp.getParameterMap(request); } - - Copied: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/ShipmentStatus.groovy (from r680051, ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/shipmentstatus.bsh) URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/ShipmentStatus.groovy?p2=ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/ShipmentStatus.groovy&p1=ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/shipmentstatus.bsh&r1=680051&r2=680085&rev=680085&view=diff ============================================================================== --- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/shipmentstatus.bsh (original) +++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/ShipmentStatus.groovy Sun Jul 27 03:13:23 2008 @@ -23,20 +23,20 @@ import org.ofbiz.entity.condition.*; import org.ofbiz.entity.util.*; -shipmentId = parameters.get("shipmentId"); -if (shipmentId != null) { - shipment = delegator.findByPrimaryKey("Shipment", UtilMisc.toMap("shipmentId", shipmentId)); - shipmentItems = delegator.findByAnd("ShipmentItem", UtilMisc.toMap("shipmentId", shipmentId)); +shipmentId = parameters.shipmentId; +if (shipmentId) { + shipment = delegator.findByPrimaryKey("Shipment", [shipmentId : shipmentId]); + shipmentItems = delegator.findByAnd("ShipmentItem", [shipmentId : shipmentId]); // get Shipment tracking info - osisCond = EntityCondition.makeCondition(UtilMisc.toMap("shipmentId", shipmentId), EntityOperator.AND); - osisOrder = UtilMisc.toList("shipmentId", "shipmentRouteSegmentId", "shipmentPackageSeqId"); - osisFields = UtilMisc.toSet("shipmentId", "shipmentRouteSegmentId", "shipmentPackageSeqId", "carrierPartyId", "trackingCode"); - osisFindOptions = new EntityFindOptions(); + osisCond = EntityCondition.makeCondition([shipmentId : shipmentId], EntityOperator.AND); + osisOrder = ["shipmentId", "shipmentRouteSegmentId", "shipmentPackageSeqId"]; + osisFields = ["shipmentId", "shipmentRouteSegmentId", "shipmentPackageSeqId", "carrierPartyId", "trackingCode"] as Set; + osisFindOptions = new EntityFindOptions(); osisFindOptions.setDistinct(true); orderShipmentInfoSummaryList = delegator.findList("OrderShipmentInfoSummary", osisCond, osisFields, osisOrder, osisFindOptions, false); - context.put("shipment", shipment); - context.put("shipmentItems", shipmentItems); - context.put("orderShipmentInfoSummaryList", orderShipmentInfoSummaryList); + context.shipment = shipment; + context.shipmentItems = shipmentItems; + context.orderShipmentInfoSummaryList = orderShipmentInfoSummaryList; } Copied: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/SplitShip.groovy (from r680051, ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/splitship.bsh) URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/SplitShip.groovy?p2=ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/SplitShip.groovy&p1=ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/splitship.bsh&r1=680051&r2=680085&rev=680085&view=diff ============================================================================== --- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/splitship.bsh (original) +++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/SplitShip.groovy Sun Jul 27 03:13:23 2008 @@ -24,18 +24,15 @@ import org.ofbiz.product.store.*; import org.ofbiz.order.shoppingcart.*; -dispatcher = request.getAttribute("dispatcher"); -delegator = request.getAttribute("delegator"); -userLogin = session.getAttribute("userLogin"); party = userLogin.getRelatedOne("Party"); productStoreId = ProductStoreWorker.getProductStoreId(request); cart = session.getAttribute("shoppingCart"); -context.put("dispatcher", dispatcher); -context.put("delegator", delegator); -context.put("cart", cart); +context.dispatcher = dispatcher; +context.delegator = delegator; +context.cart = cart; -context.put("shippingContactMechList", ContactHelper.getContactMech(party, "SHIPPING_LOCATION", "POSTAL_ADDRESS", false)); +context.shippingContactMechList = ContactHelper.getContactMech(party, "SHIPPING_LOCATION", "POSTAL_ADDRESS", false); -profiledefs = delegator.findByPrimaryKey("PartyProfileDefault", UtilMisc.toMap("partyId", userLogin.getString("partyId"), "productStoreId", productStoreId)); -context.put("profileDefs", profiledefs); +profiledefs = delegator.findByPrimaryKey("PartyProfileDefault", [partyId : userLogin.partyId, productStoreId : productStoreId]); +context.profileDefs = profiledefs; |
Free forum by Nabble | Edit this page |