You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2006/08/21 15:31:05 UTC
svn commit: r433243 - in /incubator/ofbiz/trunk/applications/order: config/
src/org/ofbiz/order/shoppingcart/ webapp/ordermgr/WEB-INF/
webapp/ordermgr/WEB-INF/actions/entry/ webapp/ordermgr/entry/
widget/ordermgr/
Author: jacopoc
Date: Mon Aug 21 06:31:03 2006
New Revision: 433243
URL: http://svn.apache.org/viewvc?rev=433243&view=rev
Log:
Completed the implementation of user interface for ship groups management during order entry checkout: there is now a new screen to assign shopping cart items to the ship groups in the cart.
Empty ship groups are automatically removed from the cart during the checkout process.
Added:
incubator/ofbiz/trunk/applications/order/webapp/ordermgr/entry/SetItemShipGroups.ftl (with props)
Modified:
incubator/ofbiz/trunk/applications/order/config/OrderUiLabels.properties
incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java
incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/SetCheckOutTabBar.bsh
incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml
incubator/ofbiz/trunk/applications/order/webapp/ordermgr/entry/optionsettings.ftl
incubator/ofbiz/trunk/applications/order/webapp/ordermgr/entry/shipsettings.ftl
incubator/ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryOrderScreens.xml
Modified: incubator/ofbiz/trunk/applications/order/config/OrderUiLabels.properties
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/config/OrderUiLabels.properties?rev=433243&r1=433242&r2=433243&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/order/config/OrderUiLabels.properties (original)
+++ incubator/ofbiz/trunk/applications/order/config/OrderUiLabels.properties Mon Aug 21 06:31:03 2006
@@ -408,6 +408,7 @@
OrderShipBeforeDate = Ship Before Date
OrderShipBeforeDateDefault = Default Ship Before Date
OrderShipGroup = Ship Group
+OrderShipGroups = Ship Groups
OrderShipRequest = Ship Request
OrderShipmentInformation = Shipment Information
OrderShipToAnotherParty=Ship to Another Party
Modified: incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java?rev=433243&r1=433242&r2=433243&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java (original)
+++ incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java Mon Aug 21 06:31:03 2006
@@ -669,6 +669,11 @@
cart.setDefaultCheckoutOptions(dispatcher);
}
+ // remove the empty ship groups
+ if (mode != null && mode.equals("removeEmptyShipGroups")) {
+ cart.cleanUpShipGroups();
+ }
+
// set the customer info
if (mode != null && mode.equals("cust")) {
String partyId = (String) request.getAttribute("partyId");
@@ -847,6 +852,7 @@
boolean requireCustomer = true;
boolean requireShipping = true;
boolean requireOptions = true;
+ boolean requireShipGroups = false;
boolean requirePayment = !cart.getOrderType().equals("PURCHASE_ORDER");
boolean requireTerm = cart.getOrderType().equals("PURCHASE_ORDER");
boolean requireAdditionalParty = isAnonymousCheckout;
@@ -859,9 +865,11 @@
String requirePaymentStr = request.getParameter("finalizeReqPayInfo");
String requireTermStr = request.getParameter("finalizeReqTermInfo");
String requireAdditionalPartyStr = request.getParameter("finalizeReqAdditionalParty");
+ String requireShipGroupsStr = request.getParameter("finalizeReqShipGroups");
requireCustomer = requireCustomerStr == null || requireCustomerStr.equalsIgnoreCase("true");
requireShipping = requireShippingStr == null || requireShippingStr.equalsIgnoreCase("true");
requireOptions = requireOptionsStr == null || requireOptionsStr.equalsIgnoreCase("true");
+ requireShipGroups = requireShipGroupsStr != null && requireShipGroupsStr.equalsIgnoreCase("true");
if (requirePayment) {
requirePayment = requirePaymentStr == null || requirePaymentStr.equalsIgnoreCase("true");
}
@@ -894,6 +902,10 @@
if (requireShipping && !shippingAddressSet) {
return "shipping";
+ }
+
+ if (requireShipGroups) {
+ return "shipGroups";
}
if (requireOptions && !shippingOptionsSet) {
Modified: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/SetCheckOutTabBar.bsh
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/SetCheckOutTabBar.bsh?rev=433243&r1=433242&r2=433243&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/SetCheckOutTabBar.bsh (original)
+++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/SetCheckOutTabBar.bsh Mon Aug 21 06:31:03 2006
@@ -55,11 +55,9 @@
addStep("OrderOrderTerms", "/setOrderTerm");
}
addStep("FacilityShipping", "/setShipping");
-/*
if (shoppingCart.getShipGroupSize() > 1) {
- addStep("ItemShipGroups", "/setItemShipGroups");
+ addStep("OrderShipGroups", "/SetItemShipGroups");
}
- */
addStep("CommonOptions", "/setOptions");
if ("SALES_ORDER".equals(shoppingCart.getOrderType())) {
addStep("AccountingPayment", "/setBilling");
Modified: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml?rev=433243&r1=433242&r2=433243&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml (original)
+++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml Mon Aug 21 06:31:03 2006
@@ -549,6 +549,7 @@
<response name="options" type="view" value="optionsetting"/>
<response name="payment" type="view" value="billsetting"/>
<response name="term" type="view" value="orderTerm"/>
+ <response name="shipGroups" type="view" value="SetItemShipGroups"/>
<response name="sales" type="request" value="calcShipping"/>
<response name="po" type="view" value="confirm"/>
<response name="error" type="request" value="orderentry"/>
@@ -688,6 +689,17 @@
<response name="success" type="request" value="finalizeOrder"/>
<response name="error" type="view" value="shipsetting"/>
</request-map>
+ <request-map uri="SetItemShipGroups">
+ <security https="true" auth="true"/>
+ <response name="success" type="view" value="SetItemShipGroups"/>
+ </request-map>
+ <request-map uri="assignItemToShipGroups">
+ <security https="true" auth="true"/>
+ <event type="service-multi" invoke="assignItemShipGroup"/>
+ <response name="success" type="view" value="SetItemShipGroups"/>
+ <response name="error" type="view" value="SetItemShipGroups"/>
+ </request-map>
+
<request-map uri="setOptions">
<security https="true" auth="true"/>
<response name="success" type="view" value="optionsetting"/>
@@ -1343,6 +1355,7 @@
<view-map name="shipsetting" type="screen" page="component://order/widget/ordermgr/OrderEntryOrderScreens.xml#ShipSettings"/>
<view-map name="EditShipAddress" type="screen" page="component://order/widget/ordermgr/OrderEntryOrderScreens.xml#EditShipAddress"/>
<view-map name="addrsetting" type="screen" page="component://order/widget/ordermgr/OrderEntryOrderScreens.xml#AddrSettings"/>
+ <view-map name="SetItemShipGroups" type="screen" page="component://order/widget/ordermgr/OrderEntryOrderScreens.xml#SetItemShipGroups"/>
<view-map name="optionsetting" type="screen" page="component://order/widget/ordermgr/OrderEntryOrderScreens.xml#OptionSettings"/>
<view-map name="billsetting" type="screen" page="component://order/widget/ordermgr/OrderEntryOrderScreens.xml#BillSettings"/>
<view-map name="confirm" type="screen" page="component://order/widget/ordermgr/OrderEntryOrderScreens.xml#ConfirmOrder"/>
Added: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/entry/SetItemShipGroups.ftl
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/entry/SetItemShipGroups.ftl?rev=433243&view=auto
==============================================================================
--- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/entry/SetItemShipGroups.ftl (added)
+++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/entry/SetItemShipGroups.ftl Mon Aug 21 06:31:03 2006
@@ -0,0 +1,108 @@
+<#--
+
+Copyright 2001-2006 The Apache Software Foundation
+
+Licensed under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations
+under the License.
+-->
+
+<#if security.hasEntityPermission("ORDERMGR", "_CREATE", session) || security.hasEntityPermission("ORDERMGR", "_PURCHASE_CREATE", session)>
+<form method="post" action="<@o...@ofbizUrl>" name="checkoutsetupform">
+ <input type="hidden" name="finalizeMode" value="removeEmptyShipGroups"/>
+</form>
+
+<table border="0" width='100%' cellspacing='0' cellpadding='0' class='boxoutside'>
+<tr>
+ <td width='100%'>
+ <table width='100%' border='0' cellspacing='0' cellpadding='0' class='boxbottom'>
+ <tr>
+ <td>
+ <#list 1..shoppingCart.getShipGroupSize() as currIndex>
+ <#assign shipGroupIndex = currIndex - 1>
+ <table width="100%" cellpadding="1" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td colspan="2">
+ <div class="head1">${uiLabelMap.OrderShipGroup} # ${currIndex}</div>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <div class="tableheadtext">${uiLabelMap.ProductProduct}</div>
+ </td>
+ <td>
+ <div class="tableheadtext">${uiLabelMap.CommonQuantity}</div>
+ </td>
+ <td>
+ <div class="tableheadtext"> </div>
+ </td>
+ <td>
+ <div class="tableheadtext">${uiLabelMap.CommonTo}</div>
+ </td>
+ </tr>
+
+ <#assign shipGroupItems = shoppingCart.getShipGroupItems(shipGroupIndex)>
+ <#assign shoppingCartItems = shipGroupItems.keySet().iterator()>
+ <form method="post" action="<@o...@ofbizUrl>" name="assignitemtoshipgroup${shipGroupIndex}">
+ <input type="hidden" name="_useRowSubmit" value="N">
+ <#assign rowCount = 0>
+ <#list shoppingCartItems as shoppingCartItem>
+ <#assign cartLineIndex = shoppingCart.getItemIndex(shoppingCartItem)>
+ <#assign shipGroupItemQuantity = shipGroupItems.get(shoppingCartItem)>
+ <input type="hidden" name="itemIndex_o_${rowCount}" value="${cartLineIndex}"/>
+ <input type="hidden" name="clearEmptyGroups_o_${rowCount}" value="false"/>
+ <input type="hidden" name="fromGroupIndex_o_${rowCount}" value="${shipGroupIndex}"/>
+ <tr>
+ <td>
+ <div class="tabletext">[${shoppingCartItem.getProductId()}] ${shoppingCartItem.getName()?if_exists}: ${shoppingCartItem.getDescription()?if_exists}</div>
+ </td>
+ <td>
+ <div class="tabletext">${shipGroupItemQuantity}</div>
+ </td>
+ <td>
+ <div class="tabletext"><input type="text" name="quantity_o_${rowCount}" value="${shipGroupItemQuantity}" class="inputBox"/></div>
+ </td>
+ <td>
+ <div class="tabletext">
+ <select name="toGroupIndex_o_${rowCount}" class="selectBox">
+ <option value="${shipGroupIndex}">---</option>
+ <#list 0..(shoppingCart.getShipGroupSize() - 1) as groupIdx>
+ <#assign groupNumber = groupIdx + 1>
+ <option value="${groupIdx}">${uiLabelMap.CommonGroup} # ${groupNumber}</option>
+ </#list>
+ </select>
+ </div>
+ </td>
+ </tr>
+ <#assign rowCount = rowCount + 1>
+ </#list>
+ <#if (rowCount > 0)>
+ <tr>
+ <td>
+ <input type="submit" class="smallSubmit" value="${uiLabelMap.CommonSubmit}"/>
+ </td>
+ </tr>
+ </#if>
+ </table>
+ <input type="hidden" name="_rowCount" value="${rowCount}">
+ </form>
+ </#list>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+
+<br/>
+<#else>
+ <h3>${uiLabelMap.OrderViewPermissionError}</h3>
+</#if>
Propchange: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/entry/SetItemShipGroups.ftl
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/entry/SetItemShipGroups.ftl
------------------------------------------------------------------------------
svn:keywords = "Date Rev Author URL Id"
Propchange: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/entry/SetItemShipGroups.ftl
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/entry/optionsettings.ftl
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/entry/optionsettings.ftl?rev=433243&r1=433242&r2=433243&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/entry/optionsettings.ftl (original)
+++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/entry/optionsettings.ftl Mon Aug 21 06:31:03 2006
@@ -35,7 +35,7 @@
<table width="100%" cellpadding="1" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2">
- <div class="head1"><b>Ship Group # ${currIndex}</b></div>
+ <div class="head1"><b>${uiLabelMap.OrderShipGroup} # ${currIndex}</b></div>
</td>
</tr>
Modified: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/entry/shipsettings.ftl
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/entry/shipsettings.ftl?rev=433243&r1=433242&r2=433243&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/entry/shipsettings.ftl (original)
+++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/entry/shipsettings.ftl Mon Aug 21 06:31:03 2006
@@ -32,7 +32,7 @@
<table width="100%" border="0" cellpadding="1" cellspacing="0">
<tr>
<td colspan="4">
- <div class="head1">Ship Group # ${currIndex}</div>
+ <div class="head1">${uiLabelMap.OrderShipGroup} # ${currIndex}</div>
</td>
</tr>
<#assign i = 0>
@@ -102,11 +102,13 @@
<form method="post" action="<@o...@ofbizUrl>" name="checkoutsetupform">
<input type="hidden" name="finalizeMode" value="ship"/>
- <input type="hidden" name="shipGroupIndex" value="${shipGroupIndex?if_exists}"/>
+ <#if (cart.getShipGroupSize() > 1)>
+ <input type="hidden" name="finalizeReqShipGroups" value="true"/>
+ </#if>
<table width='100%' border='0' cellspacing='0' cellpadding='0' class="boxoutside">
<tr>
<td>
-<a href="<@o...@ofbizUrl>" class="buttontext">Create New Ship Group</a>
+<a href="<@o...@ofbizUrl>" class="buttontext">${uiLabelMap.CommonCreateNew} ${uiLabelMap.OrderShipGroup}</a>
<a href="<@o...@ofbizUrl>" class="buttontext">${uiLabelMap.CommonCreateNew}</a>
<#list 1..cart.getShipGroupSize() as currIndex>
<#assign shipGroupIndex = currIndex - 1>
@@ -117,7 +119,7 @@
<table width="100%" border="0" cellpadding="1" cellspacing="0">
<tr>
<td colspan="3">
- <div class="head1">Ship Group # ${currIndex}</div>
+ <div class="head1">${uiLabelMap.OrderShipGroup} # ${currIndex}</div>
</td>
</tr>
<#if shippingContactMechList?has_content>
Modified: incubator/ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryOrderScreens.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryOrderScreens.xml?rev=433243&r1=433242&r2=433243&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryOrderScreens.xml (original)
+++ incubator/ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryOrderScreens.xml Mon Aug 21 06:31:03 2006
@@ -142,6 +142,24 @@
</widgets>
</section>
</screen>
+ <screen name="SetItemShipGroups">
+ <section>
+ <actions>
+ <set field="stepTitleId" value="SetItemShipGroups"/>
+ <set field="stepLabelId" value="OrderShipGroups"/>
+ <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/SetShoppingCart.bsh"/>
+ </actions>
+ <widgets>
+ <decorator-screen name="CommonOrderCheckoutDecorator">
+ <decorator-section name="body">
+ <platform-specific>
+ <html><html-template location="component://order/webapp/ordermgr/entry/SetItemShipGroups.ftl"/></html>
+ </platform-specific>
+ </decorator-section>
+ </decorator-screen>
+ </widgets>
+ </section>
+ </screen>
<screen name="OptionSettings">
<section>
<actions>