Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/src/org/ofbiz/webpos/WebPosEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/src/org/ofbiz/webpos/WebPosEvents.java?rev=1128865&r1=1128864&r2=1128865&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/src/org/ofbiz/webpos/WebPosEvents.java (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/src/org/ofbiz/webpos/WebPosEvents.java Sun May 29 11:02:09 2011 @@ -18,17 +18,32 @@ *******************************************************************************/ package org.ofbiz.webpos; +import java.util.List; +import java.util.Map; +import java.util.Set; + import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; +import javolution.util.FastList; +import javolution.util.FastMap; + +import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.GeneralException; +import org.ofbiz.base.util.UtilGenerics; +import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; +import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.order.shoppingcart.ShoppingCart; +import org.ofbiz.order.shoppingcart.ShoppingCartEvents; +import org.ofbiz.order.shoppinglist.ShoppingListEvents; +import org.ofbiz.product.product.ProductWorker; import org.ofbiz.product.store.ProductStoreWorker; import org.ofbiz.securityext.login.LoginEvents; +import org.ofbiz.service.GenericServiceException; import org.ofbiz.service.LocalDispatcher; import org.ofbiz.webpos.session.WebPosSession; @@ -37,16 +52,18 @@ public class WebPosEvents { public static String module = WebPosEvents.class.getName(); public static String posLogin(HttpServletRequest request, HttpServletResponse response) { + HttpSession session = request.getSession(true); + + // get the posTerminalId + String posTerminalId = (String) request.getParameter("posTerminalId"); + session.removeAttribute("shoppingCart"); + session.removeAttribute("webPosSession"); + WebPosSession webPosSession = WebPosEvents.getWebPosSession(request, posTerminalId); String responseString = LoginEvents.storeLogin(request, response); - - if ("success".equals(responseString)) { - HttpSession session = request.getSession(true); - - // get the posTerminalId - String posTerminalId = request.getParameter("posTerminalId"); - session.removeAttribute("shoppingCart"); - session.removeAttribute("webPosSession"); - WebPosEvents.getWebPosSession(request, posTerminalId); + GenericValue userLoginNew = (GenericValue)session.getAttribute("userLogin"); + + if (UtilValidate.isNotEmpty(userLoginNew) && UtilValidate.isNotEmpty(posTerminalId)) { + webPosSession.setUserLogin(userLoginNew); } return responseString; } @@ -61,6 +78,7 @@ public class WebPosEvents { } return responseString; } + public static WebPosSession getWebPosSession(HttpServletRequest request, String posTerminalId) { HttpSession session = request.getSession(true); GenericValue userLogin = (GenericValue) session.getAttribute("userLogin"); @@ -81,17 +99,22 @@ public class WebPosEvents { currencyUomId = productStore.getString("defaultCurrencyUomId"); } } + + if (UtilValidate.isNotEmpty(userLogin)) { + session.setAttribute("userLogin", userLogin); + } if (UtilValidate.isEmpty(cart)) { cart = new ShoppingCart(delegator, productStoreId, request.getLocale(), currencyUomId); session.setAttribute("shoppingCart", cart); - } if (UtilValidate.isNotEmpty(posTerminalId)) { webPosSession = new WebPosSession(posTerminalId, null, userLogin, request.getLocale(), productStoreId, facilityId, currencyUomId, delegator, dispatcher, cart); session.setAttribute("webPosSession", webPosSession); - } + } else { + Debug.logError("PosTerminalId is empty cannot create a webPosSession", module); + } } return webPosSession; } @@ -108,9 +131,104 @@ public class WebPosEvents { WebPosSession webPosSession = (WebPosSession) session.getAttribute("webPosSession"); if (UtilValidate.isNotEmpty(webPosSession)) { webPosSession.getCurrentTransaction().processSale(); + emptyCartAndClearAutoSaveList(request, response); String posTerminalId = webPosSession.getId(); removeWebPosSession(request, posTerminalId); } return "success"; } -} + + public static String emptyCartAndClearAutoSaveList(HttpServletRequest request, HttpServletResponse response) throws GeneralException { + HttpSession session = request.getSession(true); + WebPosSession webPosSession = (WebPosSession) session.getAttribute("webPosSession"); + ShoppingCartEvents.clearCart(request, response); + + if (UtilValidate.isNotEmpty(webPosSession)) { + String autoSaveListId = ShoppingListEvents.getAutoSaveListId(webPosSession.getDelegator(), webPosSession.getDispatcher(), null, webPosSession.getUserLogin(), webPosSession.getProductStoreId()); + ShoppingListEvents.clearListInfo(webPosSession.getDelegator(), autoSaveListId); + } + return "success"; + } + + public static String getProductType(HttpServletRequest request, HttpServletResponse response) { + Map<String, Object> featureMap = null; + Map<String, Object> variantTreeMap = null; + Map<String, Object> featureTypes = FastMap.newInstance(); + WebPosSession webPosSession = getWebPosSession(request, null); + if (webPosSession != null) { + Delegator delegator = webPosSession.getDelegator(); + LocalDispatcher dispatcher = webPosSession.getDispatcher(); + GenericValue product = null; + try { + String productId = request.getParameter("productId"); + product = delegator.findOne("Product", false, "productId", productId); + if (UtilValidate.isNotEmpty(product)) { + request.setAttribute("product", product); + if (UtilValidate.isNotEmpty(product.getString("isVirtual")) && "Y".equalsIgnoreCase(product.getString("isVirtual"))) { + String virtualVariantMethodEnum = product.getString("virtualVariantMethodEnum"); + if (UtilValidate.isEmpty(virtualVariantMethodEnum)) { + virtualVariantMethodEnum = "VV_VARIANTTREE"; + } + if ("VV_VARIANTTREE".equalsIgnoreCase(virtualVariantMethodEnum)) { + String productStoreId = webPosSession.getProductStoreId(); + try { + featureMap = dispatcher.runSync("getProductFeatureSet", UtilMisc.toMap("productId", productId)); + Set<String> featureSet = UtilGenerics.cast(featureMap.get("featureSet")); + if (UtilValidate.isNotEmpty(featureSet)) { + request.setAttribute("featureSet", featureSet); + try { + variantTreeMap = dispatcher.runSync("getProductVariantTree", + UtilMisc.toMap("productId", productId, "featureOrder", featureSet, "productStoreId", productStoreId)); + Map<String, Object> variantTree = UtilGenerics.cast(variantTreeMap.get("variantTree")); + if (UtilValidate.isNotEmpty(variantTree)) { + request.setAttribute("variantTree", variantTree); + request.setAttribute("variantTreeSize", variantTree.size()); + List<String> featureOrder = FastList.newInstance(); + featureOrder = UtilMisc.toList(featureSet); + for (int i=0; i < featureOrder.size(); i++) { + String featureKey = (String) featureOrder.get(i); + GenericValue featureValue = delegator.findOne("ProductFeatureType", UtilMisc.toMap("productFeatureTypeId", featureOrder.get(i)), true); + if (UtilValidate.isNotEmpty(featureValue) && + UtilValidate.isNotEmpty(featureValue.get("description"))) { + featureTypes.put(featureKey, featureValue.get("description")); + } else { + featureTypes.put(featureKey, featureValue.get("productFeatureTypeId")); + } + } + request.setAttribute("featureTypes", featureTypes); + request.setAttribute("featureOrder", featureOrder); + if (UtilValidate.isNotEmpty(featureOrder)) { + request.setAttribute("featureOrderFirst", featureOrder.get(0)); + } + } + Map<String, Object> imageMap = UtilGenerics.cast(variantTreeMap.get("variantSample")); + if (UtilValidate.isNotEmpty(imageMap)) { + List<String> variantSampleList = FastList.newInstance(); + variantSampleList = UtilMisc.toList(imageMap.keySet()); + request.setAttribute("variantSample", imageMap); + request.setAttribute("variantSampleList", variantSampleList); + request.setAttribute("variantSampleSize", imageMap.size()); + } + } catch (GenericServiceException e) { + Debug.logError(e, module); + return "error"; + } + } + } catch (GenericServiceException e) { + Debug.logError(e, module); + return "error"; + } + } + if ("VV_FEATURETREE".equalsIgnoreCase(virtualVariantMethodEnum)) { + request.setAttribute("featureLists", ProductWorker.getSelectableProductFeaturesByTypesAndSeq(product)); + } + } + } + } catch (GenericEntityException e) { + Debug.logError(e, module); + return "error"; + } + } + return "success"; + } +} \ No newline at end of file Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/src/org/ofbiz/webpos/session/WebPosSession.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/src/org/ofbiz/webpos/session/WebPosSession.java?rev=1128865&r1=1128864&r2=1128865&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/src/org/ofbiz/webpos/session/WebPosSession.java (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/src/org/ofbiz/webpos/session/WebPosSession.java Sun May 29 11:02:09 2011 @@ -66,8 +66,7 @@ public class WebPosSession { this.facilityId = facilityId; this.currencyUomId = currencyUomId; - if (UtilValidate.isNotEmpty(delegator)) - { + if (UtilValidate.isNotEmpty(delegator)) { this.delegator = delegator; this.delegatorName = delegator.getDelegatorName(); } else { @@ -83,6 +82,10 @@ public class WebPosSession { public GenericValue getUserLogin() { return this.userLogin; } + + public void setUserLogin(GenericValue userLogin) { + this.userLogin = userLogin; + } public void setAttribute(String name, Object value) { this.attributes.put(name, value); Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/src/org/ofbiz/webpos/transaction/WebPosTransaction.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/src/org/ofbiz/webpos/transaction/WebPosTransaction.java?rev=1128865&r1=1128864&r2=1128865&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/src/org/ofbiz/webpos/transaction/WebPosTransaction.java (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/src/org/ofbiz/webpos/transaction/WebPosTransaction.java Sun May 29 11:02:09 2011 @@ -28,7 +28,9 @@ import javolution.util.FastMap; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.GeneralException; import org.ofbiz.base.util.UtilDateTime; +import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; @@ -37,8 +39,8 @@ import org.ofbiz.entity.condition.Entity import org.ofbiz.entity.util.EntityUtil; import org.ofbiz.order.shoppingcart.CheckOutHelper; import org.ofbiz.order.shoppingcart.ShoppingCart; -import org.ofbiz.order.shoppingcart.ShoppingCart.CartPaymentInfo; import org.ofbiz.order.shoppingcart.ShoppingCartItem; +import org.ofbiz.order.shoppingcart.ShoppingCart.CartPaymentInfo; import org.ofbiz.product.store.ProductStoreWorker; import org.ofbiz.service.GenericServiceException; import org.ofbiz.service.LocalDispatcher; @@ -121,11 +123,12 @@ public class WebPosTransaction { } public boolean isOpen() { + this.isOpen = false; GenericValue terminalState = this.getTerminalState(); if (terminalState != null) { - this.isOpen = true; - } else { - this.isOpen = false; + if ((terminalState.getDate("closedDate")) == null) { + this.isOpen = true; + } } return this.isOpen; } @@ -171,13 +174,13 @@ public class WebPosTransaction { } } - public void modifyPrice(String productId, BigDecimal price) { - Debug.logInfo("Modify item price " + productId + "/" + price, module); - ShoppingCartItem item = getCart().findCartItem(productId, null, null, null, BigDecimal.ZERO); + public void modifyPrice(int cartLineIdx, BigDecimal price) { + ShoppingCartItem item = getCart().findCartItem(cartLineIdx); if (UtilValidate.isNotEmpty(item)) { + Debug.logInfo("Modify item price " + item.getProductId() + "/" + price, module); item.setBasePrice(price); } else { - Debug.logInfo("Item not found " + productId, module); + Debug.logInfo("Item " + cartLineIdx + " not found", module); } } @@ -190,12 +193,11 @@ public class WebPosTransaction { } public BigDecimal processSale() throws GeneralException { - //TODO insert check if not enough funds - Debug.log("process sale", module); + Debug.log("Process sale", module); BigDecimal grandTotal = this.getGrandTotal(); BigDecimal paymentAmt = this.getPaymentTotal(); if (grandTotal.compareTo(paymentAmt) > 0) { - throw new IllegalStateException(); + throw new GeneralException(UtilProperties.getMessage(resource, "WebPosNotEnoughFunds", webPosSession.getLocale())); } // attach the party ID to the cart @@ -203,14 +205,14 @@ public class WebPosTransaction { // validate payment methods Debug.log("Validating payment methods", module); - Map<String, ? extends Object> valRes = ch.validatePaymentMethods(); + Map<String, ? extends Object> valRes = UtilGenerics.cast(ch.validatePaymentMethods()); if (valRes != null && ServiceUtil.isError(valRes)) { throw new GeneralException(ServiceUtil.getErrorMessage(valRes)); } - // store the "order" + // store the order Debug.log("Store order", module); - Map<String, ? extends Object> orderRes = ch.createOrder(webPosSession.getUserLogin()); + Map<String, ? extends Object> orderRes = UtilGenerics.cast(ch.createOrder(webPosSession.getUserLogin())); if (orderRes != null && ServiceUtil.isError(orderRes)) { throw new GeneralException(ServiceUtil.getErrorMessage(orderRes)); @@ -222,7 +224,7 @@ public class WebPosTransaction { Debug.log("Processing the payment(s)", module); Map<String, ? extends Object> payRes = null; try { - payRes = ch.processPayment(ProductStoreWorker.getProductStore(webPosSession.getProductStoreId(), webPosSession.getDelegator()), webPosSession.getUserLogin(), true); + payRes = UtilGenerics.cast(ch.processPayment(ProductStoreWorker.getProductStore(webPosSession.getProductStoreId(), webPosSession.getDelegator()), webPosSession.getUserLogin(), true)); } catch (GeneralException e) { Debug.logError(e, module); throw e; @@ -327,7 +329,7 @@ public class WebPosTransaction { boolean isExternal = true; Iterator<GenericValue> i = values.iterator(); while (i.hasNext() && isExternal) { - GenericValue v = i.next(); + GenericValue v = (GenericValue) i.next(); //Debug.log("Testing [" + paymentMethodTypeId + "] - " + v, module); if (!externalCode.equals(v.getString("paymentServiceTypeEnumId"))) { isExternal = false; @@ -368,16 +370,8 @@ public class WebPosTransaction { return this.getTotalDue(); } - public BigDecimal processAmount(String amtStr) throws GeneralException { - BigDecimal amount; - if (UtilValidate.isNotEmpty(amtStr)) { - try { - amount = new BigDecimal(amtStr); - } catch (NumberFormatException e) { - Debug.logError("Invalid number for amount : " + amtStr, module); - throw new GeneralException(); - } - } else { + public BigDecimal processAmount(BigDecimal amount) throws GeneralException { + if (UtilValidate.isEmpty(amount)) { Debug.log("Amount is empty; assumption is full amount : " + this.getTotalDue(), module); amount = this.getTotalDue(); if (amount.compareTo(BigDecimal.ZERO) <= 0) { @@ -399,14 +393,14 @@ public class WebPosTransaction { } } - public synchronized void processExternalPayment(String paymentMethodTypeId, String amountStr, String refNum) { + public synchronized void processExternalPayment(String paymentMethodTypeId, BigDecimal amount, String refNum) { if (refNum == null) { //TODO handle error message return; } try { - BigDecimal amount = processAmount(amountStr); + amount = processAmount(amount); Debug.log("Processing [" + paymentMethodTypeId + "] Amount : " + amount, module); // add the payment @@ -498,6 +492,10 @@ public class WebPosTransaction { public BigDecimal getPaymentTotal() { return getCart().getPaymentTotal(); } + + public BigDecimal getTotalQuantity() { + return getCart().getTotalQuantity(); + } public BigDecimal getTotalDue() { BigDecimal grandTotal = this.getGrandTotal(); @@ -514,4 +512,4 @@ public class WebPosTransaction { public ShoppingCart getCart() { return webPosSession.getCart(); } -} +} \ No newline at end of file Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/Login.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/Login.ftl?rev=1128865&r1=1128864&r2=1128865&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/Login.ftl (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/Login.ftl Sun May 29 11:02:09 2011 @@ -65,6 +65,8 @@ under the License. </tr> </table> <input type="hidden" name="JavaScriptEnabled" value="N"/> + <br/> + <a href="<@ofbizUrl>forgotPassword</@ofbizUrl>">${uiLabelMap.CommonForgotYourPassword}?</a> </form> </div> </div> Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/RequirePasswordChange.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/RequirePasswordChange.ftl?rev=1128865&r1=1128864&r2=1128865&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/RequirePasswordChange.ftl (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/RequirePasswordChange.ftl Sun May 29 11:02:09 2011 @@ -16,48 +16,45 @@ KIND, either express or implied. See th specific language governing permissions and limitations under the License. --> - <#assign username = ""/> <#if requestParameters.USERNAME?has_content> <#assign username = requestParameters.USERNAME/> <#elseif autoUserLogin?has_content> <#assign username = autoUserLogin.userLoginId/> </#if> - <h1>${uiLabelMap.CommonLogin}</h1> <br /> - <div style="float: center; width: 49%; margin-right: 5px; text-align: center;" class="screenlet"> - <div class="screenlet-title-bar">${uiLabelMap.CommonPasswordChange}</div> - <div class="screenlet-body" style="text-align: center;"> - <form method="post" action="<@ofbizUrl>login${previousParams}</@ofbizUrl>" name="loginform"> - <input type="hidden" name="requirePasswordChange" value="Y"/> - <input type="hidden" name="USERNAME" value="${username}"/> - <div> - ${uiLabelMap.CommonUsername}: ${username} - </div> - <#if autoUserLogin?has_content> - <div> - (${uiLabelMap.CommonNot} ${autoUserLogin.userLoginId}? <a href="<@ofbizUrl>${autoLogoutUrl}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonClickHere}</a>) - </div> - </#if> - <div class="tabletext"> - ${uiLabelMap.CommonPassword}: - <input type="password" name="PASSWORD" value="" size="20"/> - </div> - <div class="tabletext"> - ${uiLabelMap.CommonNewPassword}: - <input type="password" name="newPassword" value="" size="20"/> - </div> - <div class="tabletext"> - ${uiLabelMap.CommonNewPasswordVerify}: - <input type="password" name="newPasswordVerify" value="" size="20"/> - </div> - <div class="tabletext"> - <input type="submit" class="smallSubmit" value="${uiLabelMap.CommonLogin}"/> - </div> - </form> - </div> + <div class="screenlet-title-bar">${uiLabelMap.CommonPasswordChange}</div> + <div class="screenlet-body" style="text-align: center;"> + <form method="post" action="<@ofbizUrl>login${previousParams}</@ofbizUrl>" name="loginform"> + <input type="hidden" name="requirePasswordChange" value="Y"/> + <input type="hidden" name="USERNAME" value="${username}"/> + <div> + ${uiLabelMap.CommonUsername}: ${username} + </div> + <#if autoUserLogin?has_content> + <div> + (${uiLabelMap.CommonNot} ${autoUserLogin.userLoginId}? <a href="<@ofbizUrl>${autoLogoutUrl}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonClickHere}</a>) + </div> + </#if> + <div class="tabletext"> + ${uiLabelMap.CommonPassword}: + <input type="password" name="PASSWORD" value="" size="20"/> + </div> + <div class="tabletext"> + ${uiLabelMap.CommonNewPassword}: + <input type="password" name="newPassword" value="" size="20"/> + </div> + <div class="tabletext"> + ${uiLabelMap.CommonNewPasswordVerify}: + <input type="password" name="newPasswordVerify" value="" size="20"/> + </div> + <div class="tabletext"> + <input type="submit" class="smallSubmit" value="${uiLabelMap.CommonLogin}"/> + </div> + </form> + </div> </div> <script language="JavaScript" type="text/javascript"> Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/WEB-INF/actions/buttons/Main.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/WEB-INF/actions/buttons/Main.groovy?rev=1128865&r1=1128864&r2=1128865&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/WEB-INF/actions/buttons/Main.groovy (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/WEB-INF/actions/buttons/Main.groovy Sun May 29 11:02:09 2011 @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ - -import org.ofbiz.webpos.WebPosEvents; -import org.ofbiz.webpos.session.WebPosSession; -import org.ofbiz.webpos.transaction.WebPosTransaction; - -webPosSession = WebPosEvents.getWebPosSession(request, null); -if (webPosSession) { - context.shoppingCartSize = webPosSession.getCart().size(); - context.isManagerLoggedIn = webPosSession.isManagerLoggedIn(); - webPosTransaction = webPosSession.getCurrentTransaction(); - - if (webPosTransaction) { - context.isOpen = webPosTransaction.isOpen(); - } -} else { - context.shoppingCartSize = 0; -} Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/WEB-INF/actions/buttons/Payment.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/WEB-INF/actions/buttons/Payment.groovy?rev=1128865&r1=1128864&r2=1128865&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/WEB-INF/actions/buttons/Payment.groovy (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/WEB-INF/actions/buttons/Payment.groovy Sun May 29 11:02:09 2011 @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ - -import org.ofbiz.webpos.WebPosEvents; -import org.ofbiz.webpos.session.WebPosSession; - -webPosSession = WebPosEvents.getWebPosSession(request, null); -if (webPosSession) { - context.cart = webPosSession.getCart(); - - if (context.cart) { - context.shoppingCartSize = context.cart.size(); - } - - context.totalDue = webPosSession.getCurrentTransaction().getTotalDue(); - context.totalPayments = webPosSession.getCurrentTransaction().getPaymentTotal(); -} Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/WEB-INF/actions/cart/MicroCart.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/WEB-INF/actions/cart/MicroCart.groovy?rev=1128865&r1=1128864&r2=1128865&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/WEB-INF/actions/cart/MicroCart.groovy (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/WEB-INF/actions/cart/MicroCart.groovy Sun May 29 11:02:09 2011 @@ -1,80 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ - -import org.ofbiz.base.util.UtilProperties; -import org.ofbiz.webpos.WebPosEvents; -import org.ofbiz.webpos.session.WebPosSession; -import org.ofbiz.webpos.transaction.WebPosTransaction; -import java.text.SimpleDateFormat; - -webPosSession = WebPosEvents.getWebPosSession(request, null); -if (webPosSession) { - shoppingCart = webPosSession.getCart(); - context.transactionId = webPosSession.getCurrentTransaction().getTransactionId(); - context.userLoginId = webPosSession.getUserLoginId(); - context.drawerNumber = webPosSession.getCurrentTransaction().getDrawerNumber(); - sdf = new SimpleDateFormat(UtilProperties.getMessage(WebPosTransaction.resource, "WebPosTransactionDateFormat", Locale.getDefault())); - context.transactionDate = sdf.format(new Date()); - context.totalDue = webPosSession.getCurrentTransaction().getTotalDue(); -} else { - shoppingCart = null; -} - -context.cashAmount = BigDecimal.ZERO; -context.checkAmount = BigDecimal.ZERO; -context.giftAmount = BigDecimal.ZERO; -context.creditAmount = BigDecimal.ZERO; - -// Get the Cart and Prepare Size -if (shoppingCart) { - context.shoppingCartSize = shoppingCart.size(); - payments = shoppingCart.selectedPayments(); - for (i = 0; i < payments; i++) { - paymentInfo = shoppingCart.getPaymentInfo(i); - if (paymentInfo.amount != null) { - amount = paymentInfo.amount; - if (paymentInfo.paymentMethodTypeId != null) { - if ("CASH".equals(paymentInfo.paymentMethodTypeId)) { - context.cashAmount = new BigDecimal((context.cashAmount).add(amount)); - } - else if ("PERSONAL_CHECK".equals(paymentInfo.paymentMethodTypeId)) { - context.checkAmount = new BigDecimal((context.checkAmount).add(amount)); - requestParameters.refNumCheck = paymentInfo.refNum[0]; - } - else if ("GIFT_CARD".equals(paymentInfo.paymentMethodTypeId)) { - context.giftAmount = new BigDecimal((context.giftAmount).add(amount)); - requestParameters.refNumGift = paymentInfo.refNum[0]; - } - else if ("CREDIT_CARD".equals(paymentInfo.paymentMethodTypeId)) { - context.creditAmount = new BigDecimal((context.creditAmount).add(amount)); - requestParameters.refNumCredit = paymentInfo.refNum[0]; - print("paymentInfo "+paymentInfo); - } - } - } - } - context.shoppingCart = shoppingCart; -} else { - context.shoppingCartSize = 0; -} - -context.paymentCash = delegator.findOne("PaymentMethodType", ["paymentMethodTypeId" : "CASH"], true); -context.paymentCheck = delegator.findOne("PaymentMethodType", ["paymentMethodTypeId" : "PERSONAL_CHECK"], true); -context.paymentGift = delegator.findOne("PaymentMethodType", ["paymentMethodTypeId" : "GIFT_CARD"], true); -context.paymentCredit = delegator.findOne("PaymentMethodType", ["paymentMethodTypeId" : "CREDIT_CARD"], true); Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/WEB-INF/actions/cart/ShowCart.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/WEB-INF/actions/cart/ShowCart.groovy?rev=1128865&r1=1128864&r2=1128865&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/WEB-INF/actions/cart/ShowCart.groovy (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/WEB-INF/actions/cart/ShowCart.groovy Sun May 29 11:02:09 2011 @@ -16,28 +16,70 @@ * specific language governing permissions and limitations * under the License. */ - +import org.ofbiz.base.util.UtilProperties; +import org.ofbiz.base.util.UtilValidate; import org.ofbiz.webpos.WebPosEvents; import org.ofbiz.webpos.session.WebPosSession; +import org.ofbiz.webpos.transaction.WebPosTransaction; webPosSession = WebPosEvents.getWebPosSession(request, null); if (webPosSession) { shoppingCart = webPosSession.getCart(); + context.isManager = webPosSession.isManagerLoggedIn(); + context.transactionId = webPosSession.getCurrentTransaction().getTransactionId(); + context.userLoginId = webPosSession.getUserLoginId(); + context.drawerNumber = webPosSession.getCurrentTransaction().getDrawerNumber(); + context.totalDue = webPosSession.getCurrentTransaction().getTotalDue(); + context.totalQuantity = webPosSession.getCurrentTransaction().getTotalQuantity(); + context.isOpen = webPosSession.getCurrentTransaction().isOpen(); + + context.person = null; + if (UtilValidate.isNotEmpty(shoppingCart)) { + placingCustomerParty = delegator.findOne("PartyAndPerson", [partyId : shoppingCart.getPlacingCustomerPartyId()], false); + if (UtilValidate.isNotEmpty(placingCustomerParty)) { + context.person = placingCustomerParty.lastName + " " + placingCustomerParty.firstName; + } + } } else { shoppingCart = null; } -// Get the Cart and Prepare Size +context.cashAmount = BigDecimal.ZERO; +context.checkAmount = BigDecimal.ZERO; +context.giftAmount = BigDecimal.ZERO; +context.creditAmount = BigDecimal.ZERO; +context.totalPay = BigDecimal.ZERO; + if (shoppingCart) { context.shoppingCartSize = shoppingCart.size(); + payments = shoppingCart.selectedPayments(); + for (i = 0; i < payments; i++) { + paymentInfo = shoppingCart.getPaymentInfo(i); + if (paymentInfo.amount != null) { + amount = paymentInfo.amount; + if (paymentInfo.paymentMethodTypeId != null) { + if ("CASH".equals(paymentInfo.paymentMethodTypeId)) { + context.cashAmount = new BigDecimal((context.cashAmount).add(amount)); + } + else if ("PERSONAL_CHECK".equals(paymentInfo.paymentMethodTypeId)) { + context.checkAmount = new BigDecimal((context.checkAmount).add(amount)); + } + else if ("GIFT_CARD".equals(paymentInfo.paymentMethodTypeId)) { + context.giftAmount = new BigDecimal((context.giftAmount).add(amount)); + } + else if ("CREDIT_CARD".equals(paymentInfo.paymentMethodTypeId)) { + context.creditAmount = new BigDecimal((context.creditAmount).add(amount)); + } + context.totalPay = new BigDecimal((context.totalPay).add(amount)); + } + } + } + context.shoppingCart = shoppingCart; } else { context.shoppingCartSize = 0; } -context.shoppingCart = shoppingCart; -//check if a parameter is passed -if (request.getAttribute("add_product_id") != "") { - add_product_id = request.getParameter("add_product_id"); - product = delegator.findOne("Product", [productId : add_product_id], true); - context.product = product; -} +context.paymentCash = delegator.findOne("PaymentMethodType", ["paymentMethodTypeId" : "CASH"], true); +context.paymentCheck = delegator.findOne("PaymentMethodType", ["paymentMethodTypeId" : "PERSONAL_CHECK"], true); +context.paymentGift = delegator.findOne("PaymentMethodType", ["paymentMethodTypeId" : "GIFT_CARD"], true); +context.paymentCredit = delegator.findOne("PaymentMethodType", ["paymentMethodTypeId" : "CREDIT_CARD"], true); \ No newline at end of file Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/WEB-INF/controller.xml?rev=1128865&r1=1128864&r2=1128865&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/WEB-INF/controller.xml (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/WEB-INF/controller.xml Sun May 29 11:02:09 2011 @@ -21,39 +21,32 @@ xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/site-conf.xsd"> <description>Web Pos Component Site Configuration File</description> <errorpage>/error/error.jsp</errorpage> - + <handler name="java" type="request" class="org.ofbiz.webapp.event.JavaEventHandler"/> - <handler name="bsf" type="request" class="org.ofbiz.webapp.event.BsfEventHandler"/> - <handler name="soap" type="request" class="org.ofbiz.webapp.event.SOAPEventHandler"/> <handler name="service" type="request" class="org.ofbiz.webapp.event.ServiceEventHandler"/> <handler name="service-multi" type="request" class="org.ofbiz.webapp.event.ServiceMultiEventHandler"/> <handler name="simple" type="request" class="org.ofbiz.webapp.event.SimpleEventHandler"/> - <handler name="rome" type="request" class="org.ofbiz.webapp.event.RomeEventHandler"/> - + <handler name="groovy" type="request" class="org.ofbiz.webapp.event.GroovyEventHandler"/> <handler name="jsp" type="view" class="org.ofbiz.webapp.view.JspViewHandler"/> <handler name="screen" type="view" class="org.ofbiz.widget.screen.MacroScreenViewHandler"/> - <!-- These event handlers have been deprecated, if you need to send json responses then chain - the json request from this controller after calling your event - <handler name="jsonservice" type="request" class="org.ofbiz.webapp.event.JSONServiceEventHandler"/> - --> - + <!-- Events run from here for the first hit in a visit --> <firstvisit> <event name="autoLoginCheck" type="java" path="org.ofbiz.webapp.control.LoginWorker" invoke="autoLoginCheck"/> <event name="checkTrackingCodeCookies" type="java" path="org.ofbiz.marketing.tracking.TrackingCodeEvents" invoke="checkTrackingCodeCookies"/> <event name="setDefaultStoreSettings" type="java" path="org.ofbiz.product.product.ProductEvents" invoke="setDefaultStoreSettings"/> </firstvisit> - + <!-- Events to run on every request before security (chains exempt) --> <preprocessor> <!-- This event allows affilate/distributor entry on any page --> + <event name="checkExternalLoginKey" type="java" path="org.ofbiz.webapp.control.LoginWorker" invoke="checkExternalLoginKey"/> <event name="setAssociationId" type="java" path="org.ofbiz.ecommerce.misc.ThirdPartyEvents" invoke="setAssociationId"/> <event name="checkTrackingCodeUrlParam" type="java" path="org.ofbiz.marketing.tracking.TrackingCodeEvents" invoke="checkTrackingCodeUrlParam"/> <event name="checkPartnerTrackingCodeUrlParam" type="java" path="org.ofbiz.marketing.tracking.TrackingCodeEvents" invoke="checkPartnerTrackingCodeUrlParam"/> <event name="keepCartUpdated" type="java" path="org.ofbiz.order.shoppingcart.ShoppingCartEvents" invoke="keepCartUpdated"/> - <event name="restoreAutoSaveList" type="java" path="org.ofbiz.order.shoppinglist.ShoppingListEvents" invoke="restoreAutoSaveList"/> </preprocessor> - + <after-login> <event name="updateAssociatedDistributor" type="java" path="org.ofbiz.ecommerce.misc.ThirdPartyEvents" invoke="updateAssociatedDistributor"/> <event name="keepCartUpdated" type="java" path="org.ofbiz.order.shoppingcart.ShoppingCartEvents" invoke="keepCartUpdated"/> @@ -62,39 +55,45 @@ <!-- after login and restoring from the auto-save list, save everything to the auto-save list to handle anything that may have already been in the cart before login --> <event name="saveCartToAutoSaveList" type="java" path="org.ofbiz.order.shoppinglist.ShoppingListEvents" invoke="saveCartToAutoSaveList"/> </after-login> - + <!-- Security Mappings --> <request-map uri="checkLogin" edit="false"> <description>Verify a user is logged in.</description> <security https="true" auth="false"/> <event type="java" path="org.ofbiz.securityext.login.LoginEvents" invoke="storeCheckLogin"/> <response name="success" type="view" value="main"/> + <response name="requirePasswordChange" type="view" value="requirePasswordChange"/> <response name="error" type="view" value="login"/> </request-map> - + <request-map uri="login"> <security https="true" auth="false"/> <event type="java" path="org.ofbiz.webpos.WebPosEvents" invoke="posLogin"/> - <response name="success" type="view" value="main"/> + <response name="success" type="request" value="main"/> <response name="requirePasswordChange" type="view" value="RequirePasswordChange"/> - <response name="error" type="view" value="login"/> + <response name="error" type="view" value="Login"/> </request-map> - + <request-map uri="logout"> <security https="true" auth="true"/> <event type="java" path="org.ofbiz.webapp.control.LoginWorker" invoke="logout"/> - <response name="success" type="request-redirect" value="main"/> - <response name="error" type="view" value="main"/> + <response name="success" type="request-redirect-noparam" value="main"/> + <response name="error" type="request-redirect-noparam" value="main"/> </request-map> - + <request-map uri="autoLogout"> <security https="true" auth="false"/> <event type="java" path="org.ofbiz.webapp.control.LoginWorker" invoke="autoLoginRemove"/> - <response name="success" type="request-redirect" value="main"/> - <response name="error" type="view" value="main"/> + <response name="success" type="request-redirect-noparam" value="main"/> + <response name="error" type="request-redirect-noparam" value="main"/> + </request-map> + + <request-map uri="requirePasswordChange"> + <security https="true" auth="false"/> + <response name="success" type="view" value="RequirePasswordChange"/> </request-map> <!-- End of Security Mappings --> - + <!-- Common json reponse events, chain these after events to send json reponses --> <!-- Standard json response, uses all compatible request attributes --> <request-map uri="json"> @@ -102,314 +101,389 @@ <event type="java" path="org.ofbiz.common.CommonEvents" invoke="jsonResponseFromRequestAttributes"/> <response name="success" type="none"/> </request-map> - + + <request-map uri="getJSONuiLabelArray"> + <security https="false" auth="false"/> + <event type="java" path="org.ofbiz.common.CommonEvents" invoke="getJSONuiLabelArray"/> + <response name="success" type="none" /> + <response name="error" type="none" /> + </request-map> + <!-- Request Mappings --> <request-map uri="view"> - <security https="true" auth="false"/> + <security https="false" auth="false"/> <response name="success" type="view" value="main"/> </request-map> - + <request-map uri="authview"> - <security https="true" auth="true"/> + <security https="false" auth="true"/> <response name="success" type="view" value="main"/> </request-map> - + <request-map uri="main"> - <security https="true" auth="true"/> + <security https="false" auth="true"/> <event type="java" path="org.ofbiz.webpos.WebPosEvents" invoke="existsWebPosSession"/> <response name="success" type="view" value="main"/> - <response name="error" type="view" value="login"/> + <response name="error" type="view" value="Login"/> </request-map> - + <request-map uri="Login"> - <security https="true" auth="false"/> + <security https="false" auth="false"/> <event type="java" path="org.ofbiz.webpos.WebPosEvents" invoke="posLogin"/> - <response name="success" type="view" value="main"/> + <response name="success" type="request" value="main"/> <response name="requirePasswordChange" type="view" value="RequirePasswordChange"/> <response name="error" type="view" value="Login"/> </request-map> - + <request-map uri="Logout"> - <security https="true" auth="true"/> + <security https="false" auth="true"/> <event type="java" path="org.ofbiz.webapp.control.LoginWorker" invoke="logout"/> - <response name="success" type="request-redirect" value="main"/> - <response name="error" type="view" value="main"/> + <response name="success" type="request-redirect-noparam" value="main"/> + <response name="error" type="request-redirect-noparam" value="main"/> </request-map> - - <request-map uri="SetSessionLocale"> + + <request-map uri="ListLocales"> + <security https="true" auth="false"/> + <response name="success" type="view" value="ListLocales" save-last-view="true"/> + </request-map> + + <request-map uri="setSessionLocale"> <security https="false" auth="false"/> <event type="java" path="org.ofbiz.common.CommonEvents" invoke="setSessionLocale"/> <response name="success" type="view" value="main"/> <response name="error" type="view" value="main"/> </request-map> - - <request-map uri="Manager"> - <security https="true" auth="true"/> - <response name="success" type="view" value="Manager"/> + + <request-map uri="ListTimezones"> + <security https="true" auth="false"/> + <response name="success" type="view" value="ListTimezones" save-last-view="true"/> </request-map> - - <request-map uri="Payment"> + + <request-map uri="setSessionTimeZone"> + <security https="true" auth="false"/> + <event type="java" path="org.ofbiz.common.CommonEvents" invoke="setSessionTimeZone"/> + <response name="success" type="view-last" value="main"/> + <response name="error" type="request" value="main"/> + </request-map> + + <request-map uri="showHelp"> <security https="true" auth="true"/> - <response name="success" type="view" value="Payment"/> + <response name="success" type="view" value="showHelp"/> </request-map> - - <request-map uri="Promo"> + + <request-map uri="help"> <security https="true" auth="true"/> - <response name="success" type="view" value="Promo"/> + <response name="success" type="view" value="help"/> </request-map> - - <request-map uri="SearchProducts"> + + <!-- User preference mapping --> + <request-map uri="setUserPreference"> <security https="true" auth="true"/> - <response name="success" type="view" value="SearchProducts"/> + <event type="service" invoke="setUserPreference"/> + <response name="success" type="view-last" value="main"/> + <response name="error" type="request" value="main"/> </request-map> - <request-map uri="FindProducts"> + <request-map uri="ajaxSetUserPreference"> <security https="true" auth="true"/> - <event type="service" invoke="FindProducts"/> - <response name="success" type="request" value="json"/> - <response name="error" type="request" value="json"/> + <event type="service" invoke="setUserPreference"/> + <response name="success" type="none"/> </request-map> - - <request-map uri="FindProductsByIdentification"> + + <request-map uri="help"> <security https="true" auth="true"/> - <event type="service" invoke="FindProductsByIdentification"/> - <response name="success" type="request" value="json"/> - <response name="error" type="request" value="json"/> + <response name="success" type="view" value="help"/> </request-map> + <request-map uri="ListVisualThemes"> + <security https="false" auth="true"/> + <response name="success" type="view" value="ListVisualThemes"/> + </request-map> + + <request-map uri="Category"> + <security https="false" auth="false"/> + <response name="success" type="view" value="Category"/> + </request-map> + + <request-map uri="Manager"> + <security https="false" auth="true"/> + <response name="success" type="view" value="Manager"/> + </request-map> + + <request-map uri="Payment"> + <security https="false" auth="true"/> + <response name="success" type="view" value="Payment"/> + </request-map> + + <request-map uri="CustomerAddress"> + <security https="false" auth="true"/> + <response name="success" type="view" value="CustomerAddress"/> + </request-map> + <request-map uri="ShowCart"> - <security https="true" auth="true"/> + <security https="false" auth="true"/> <response name="success" type="view" value="ShowCart"/> </request-map> - - <request-map uri="ModifyCart"> + + <request-map uri="ShowCartItemSelected"> + <security https="false" auth="true"/> + <response name="success" type="view" value="ShowCartItemSelected"/> + </request-map> + + <request-map uri="SearchSalesRepsList"> + <security https="false" auth="true"/> + <response name="success" type="view" value="SearchSalesRepsList"/> + </request-map> + + <request-map uri="SideDeepCategory"> + <security https="false" auth="true"/> + <response name="success" type="view" value="SideDeepCategory"/> + </request-map> + + <request-map uri="CategoryDetail"> + <security https="false" auth="true"/> + <response name="success" type="view" value="CategoryDetail"/> + </request-map> + + <request-map uri="Shutdown"> + <security https="false" auth="true"/> + <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/ManagerEvents.xml" invoke="shutdown"/> + <response name="success" type="request" value="Login"/> + <response name="error" type="request" value="main"/> + </request-map> + + <!-- Ajax requests --> + <request-map uri="Error"> <security https="false" auth="false"/> - <event type="java" path="org.ofbiz.order.shoppingcart.ShoppingCartEvents" invoke="modifyCart"/> - <response name="success" type="view" value="main"/> - <response name="error" type="view" value="main"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> </request-map> - + <request-map uri="EmptyCart"> <security https="false" auth="false"/> - <event type="java" path="org.ofbiz.order.shoppingcart.ShoppingCartEvents" invoke="clearCart"/> - <response name="success" type="view" value="main"/> - <response name="error" type="view" value="main"/> + <event type="java" path="org.ofbiz.webpos.WebPosEvents" invoke="emptyCartAndClearAutoSaveList"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> </request-map> - - <request-map uri="AddItem"> - <security https="true" auth="true"/> - <event type="java" path="org.ofbiz.order.shoppingcart.ShoppingCartEvents" invoke="addToCart"/> - <response name="success" type="view" value="main"/> - <response name="survey" type="view" value="main"/> - <response name="product" type="view" value="main"/> - <response name="viewcart" type="request-redirect" value="main"/> - <response name="error" type="view" value="main"/> + + <request-map uri="GetProductType"> + <security https="false" auth="true"/> + <event type="java" path="org.ofbiz.webpos.WebPosEvents" invoke="getProductType"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> </request-map> - - <request-map uri="ManagerOpenTerminal"> - <security https="true" auth="true"/> - <response name="success" type="view" value="ManagerOpenTerminal"/> - <response name="error" type="view" value="ManagerOpenTerminal"/> + + <request-map uri="GetProductAndPrice"> + <security https="false" auth="false"/> + <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/CartEvents.xml" invoke="getProductAndPrice"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> </request-map> - - <request-map uri="OpenTerminal"> - <security https="true" auth="true"/> - <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/ManagerEvents.xml" invoke="openTerminal"/> - <response name="success" type="view" value="Manager"/> - <response name="error" type="view" value="ManagerOpenTerminal"/> + + <request-map uri="GetFormattedAmount"> + <security https="false" auth="false"/> + <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/CartEvents.xml" invoke="getFormattedAmount"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> </request-map> - - <request-map uri="ManagerCloseTerminal"> - <security https="true" auth="true"/> - <response name="success" type="view" value="ManagerCloseTerminal"/> - <response name="error" type="view" value="ManagerCloseTerminal"/> + + <request-map uri="GetFormattedProductFeaturePrice"> + <security https="false" auth="false"/> + <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/CartEvents.xml" invoke="getFormattedProductFeaturePrice"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> </request-map> - - <request-map uri="CloseTerminal"> - <security https="true" auth="true"/> - <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/ManagerEvents.xml" invoke="closeTerminal"/> - <response name="success" type="view" value="Manager"/> - <response name="error" type="view" value="ManagerCloseTerminal"/> + + <request-map uri="AddToCart"> + <security https="false" auth="false"/> + <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/CartEvents.xml" invoke="addCartItem"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> </request-map> - - <request-map uri="ManagerVoidOrder"> - <security https="true" auth="true"/> - <response name="success" type="view" value="ManagerVoidOrder"/> - <response name="error" type="view" value="ManagerVoidOrder"/> + + <request-map uri="SetPartyToCart"> + <security https="false" auth="false"/> + <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/CartEvents.xml" invoke="setPartyToCart"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> </request-map> - - <request-map uri="VoidOrder"> - <security https="true" auth="true"/> - <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/ManagerEvents.xml" invoke="voidOrder"/> - <response name="success" type="view" value="Manager"/> - <response name="error" type="view" value="ManagerVoidOrder"/> + + <request-map uri="GetShipMethods"> + <security https="false" auth="false"/> + <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/CartEvents.xml" invoke="getShipMethods"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> </request-map> - - <request-map uri="Shutdown"> - <security https="true" auth="true"/> - <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/ManagerEvents.xml" invoke="shutdown"/> - <response name="success" type="request" value="Logout"/> - <response name="error" type="view" value="Login"/> + + <request-map uri="SetShipMethod"> + <security https="false" auth="false"/> + <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/CartEvents.xml" invoke="setShipMethod"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> </request-map> - - <request-map uri="ManagerPaidOutAndIn"> - <security https="true" auth="true"/> - <response name="success" type="view" value="ManagerPaidOutAndIn"/> - <response name="error" type="view" value="ManagerPaidOutAndIn"/> + + <request-map uri="UpdateCartItem"> + <security https="false" auth="false"/> + <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/CartEvents.xml" invoke="updateCartItem"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> </request-map> - - <request-map uri="PaidOutAndIn"> - <security https="true" auth="true"/> - <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/ManagerEvents.xml" invoke="paidOutAndIn"/> - <response name="success" type="view" value="Manager"/> - <response name="error" type="view" value="ManagerPaidOutAndIn"/> + + <request-map uri="DeleteCartItem"> + <security https="false" auth="false"/> + <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/CartEvents.xml" invoke="deleteCartItem"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> </request-map> - - <request-map uri="ManagerModifyPrice"> - <security https="true" auth="true"/> - <response name="success" type="view" value="ManagerModifyPrice"/> - <response name="error" type="view" value="ManagerModifyPrice"/> + + <request-map uri="FindProducts"> + <security https="false" auth="true"/> + <event type="service" invoke="findProducts"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> </request-map> - - <request-map uri="ModifyPrice"> - <security https="true" auth="true"/> - <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/ManagerEvents.xml" invoke="modifyPrice"/> - <response name="success" type="view" value="Manager"/> - <response name="error" type="view" value="ManagerModifyPrice"/> + + <request-map uri="FindParties"> + <security https="false" auth="true"/> + <event type="service" invoke="findParties"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> </request-map> - - <request-map uri="AddPayCash"> - <security https="true" auth="true"/> - <response name="success" type="view" value="AddPayCash"/> - <response name="error" type="view" value="AddPayCash"/> + + <request-map uri="RemoveSalesRep"> + <security https="false" auth="true"/> + <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/CartEvents.xml" invoke="removeSalesRep"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> </request-map> - + + <request-map uri="AddSalesRep"> + <security https="false" auth="true"/> + <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/CartEvents.xml" invoke="addSalesRep"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> + </request-map> + <request-map uri="PayCash"> - <security https="true" auth="true"/> + <security https="false" auth="true"/> <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/PaymentEvents.xml" invoke="payCash"/> - <response name="success" type="view" value="Payment"/> - <response name="error" type="view" value="AddPayCash"/> - </request-map> - - <request-map uri="AddPayCheck"> - <security https="true" auth="true"/> - <response name="success" type="view" value="AddPayCheck"/> - <response name="error" type="view" value="AddPayCheck"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> </request-map> - + <request-map uri="PayCheck"> - <security https="true" auth="true"/> - <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/PaymentEvents.xml" invoke="payCheck"/> - <response name="success" type="view" value="Payment"/> - <response name="error" type="view" value="AddPayCheck"/> - </request-map> - - <request-map uri="AddPayGiftCard"> <security https="false" auth="true"/> - <response name="success" type="view" value="AddPayGiftCard"/> - <response name="error" type="view" value="AddPayGiftCard"/> + <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/PaymentEvents.xml" invoke="payCheck"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> </request-map> - + <request-map uri="PayGiftCard"> - <security https="true" auth="true"/> + <security https="false" auth="true"/> <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/PaymentEvents.xml" invoke="payGiftCard"/> - <response name="success" type="view" value="Payment"/> - <response name="error" type="view" value="AddPayGiftCard"/> - </request-map> - - <request-map uri="AddPayCreditCard"> - <security https="true" auth="true"/> - <response name="success" type="view" value="AddPayCreditCard"/> - <response name="error" type="view" value="AddPayCreditCard"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> </request-map> - + <request-map uri="PayCreditCard"> - <security https="true" auth="true"/> - <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/PaymentEvents.xml" invoke="payCredit"/> - <response name="success" type="view" value="Payment"/> - <response name="error" type="view" value="AddPayCreditCard"/> + <security https="false" auth="true"/> + <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/PaymentEvents.xml" invoke="payCreditCard"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> </request-map> - - <request-map uri="PayFinish"> - <security https="true" auth="true"/> - <event type="java" path="org.ofbiz.webpos.WebPosEvents" invoke="completeSale"/> - <response name="success" type="view" value="main"/> + + <request-map uri="OpenTerminal"> + <security https="false" auth="true"/> + <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/ManagerEvents.xml" invoke="openTerminal"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> </request-map> - - <request-map uri="AddPaySetRef"> - <security https="true" auth="true"/> - <response name="success" type="view" value="AddPaySetRef"/> - <response name="error" type="view" value="AddPaySetRef"/> + + <request-map uri="CloseTerminal"> + <security https="false" auth="true"/> + <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/ManagerEvents.xml" invoke="closeTerminal"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> </request-map> - - <request-map uri="PaySetRef"> - <security https="true" auth="true"/> - <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/PaymentEvents.xml" invoke="setRefNum"/> - <response name="success" type="view" value="Payment"/> - <response name="error" type="view" value="AddPaySetRef"/> + + <request-map uri="PromoCode"> + <security https="false" auth="true"/> + <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/PromoEvents.xml" invoke="addPromoCode"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> </request-map> - - <request-map uri="AddClearPayment"> - <security https="true" auth="true"/> - <response name="success" type="view" value="ClearPayment"/> - <response name="error" type="view" value="ClearPayment"/> + + <request-map uri="VoidOrder"> + <security https="false" auth="true"/> + <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/ManagerEvents.xml" invoke="voidOrder"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> </request-map> - + + <request-map uri="ModifyPrice"> + <security https="false" auth="true"/> + <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/ManagerEvents.xml" invoke="modifyPrice"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> + </request-map> + + <request-map uri="PaidOutAndIn"> + <security https="false" auth="true"/> + <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/ManagerEvents.xml" invoke="paidOutAndIn"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> + </request-map> + + <request-map uri="PayFinish"> + <security https="false" auth="true"/> + <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/PaymentEvents.xml" invoke="payFinish"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> + </request-map> + <request-map uri="ClearPayment"> - <security https="true" auth="true"/> + <security https="false" auth="true"/> <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/PaymentEvents.xml" invoke="clearPayment"/> - <response name="success" type="view" value="Payment"/> - <response name="error" type="view" value="ClearPayment"/> - </request-map> - - <request-map uri="PayClearAll"> - <security https="true" auth="true"/> - <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/PaymentEvents.xml" invoke="clearAllPayments"/> - <response name="success" type="view" value="Payment"/> - <response name="error" type="view" value="Payment"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> </request-map> - - <request-map uri="AddPromoCode"> - <security https="true" auth="true"/> - <response name="success" type="view" value="AddPromoCode"/> - <response name="error" type="view" value="AddPromoCode"/> + + <request-map uri="CreateUpdateAddress"> + <security https="false" auth="true"/> + <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/CustomerEvents.xml" invoke="createUpdateAddress"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> </request-map> - - <request-map uri="PromoCode"> - <security https="true" auth="true"/> - <event type="simple" path="component://webpos/script/org/ofbiz/webpos/event/PromoEvents.xml" invoke="addPromoCode"/> - <response name="success" type="view" value="Promo"/> - <response name="error" type="view" value="AddPromoCode"/> + + <request-map uri="EditAddress"> + <security https="false" auth="true"/> + <event type="groovy" path="component://webpos/webapp/webpos/WEB-INF/actions/customer/" invoke="EditAddress.groovy"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> </request-map> - + <!-- end of Ajax requests --> + <!-- View Mappings --> <view-map name="error" page="/error/error.jsp"/> + <view-map name="Error" type="screen" page="component://webpos/widget/WebPosScreens.xml#Main"/> <view-map name="main" type="screen" page="component://webpos/widget/WebPosScreens.xml#Main"/> <view-map name="login" type="screen" page="component://webpos/widget/CommonScreens.xml#Login"/> <view-map name="Login" type="screen" page="component://webpos/widget/CommonScreens.xml#Login"/> <view-map name="RequirePasswordChange" type="screen" page="component://webpos/widget/CommonScreens.xml#RequirePasswordChange"/> + <view-map name="ListLocales" type="screen" page="component://common/widget/LookupScreens.xml#ListLocales"/> + <view-map name="ListTimezones" type="screen" page="component://common/widget/LookupScreens.xml#ListTimezones"/> + <view-map name="ListVisualThemes" type="screen" page="component://common/widget/LookupScreens.xml#ListVisualThemes"/> + <view-map name="help" type="screen" page="component://common/widget/CommonScreens.xml#help"/> + <view-map name="showHelp" type="screen" page="component://common/widget/HelpScreens.xml#ShowHelp"/> + <view-map name="Manager" type="screen" page="component://webpos/widget/WebPosScreens.xml#Manager"/> <view-map name="Payment" type="screen" page="component://webpos/widget/WebPosScreens.xml#Payment"/> - <view-map name="Promo" type="screen" page="component://webpos/widget/WebPosScreens.xml#Promo"/> - <view-map name="SearchProducts" type="screen" page="component://webpos/widget/WebPosScreens.xml#SearchProducts"/> - <view-map name="ShowCart" type="screen" page="component://webpos/widget/WebPosScreens.xml#ShowCart"/> - - <!-- Manager view mappings --> - <view-map name="ManagerOpenTerminal" type="screen" page="component://webpos/widget/ManagerScreens.xml#OpenTerminal"/> - <view-map name="ManagerCloseTerminal" type="screen" page="component://webpos/widget/ManagerScreens.xml#CloseTerminal"/> - <view-map name="ManagerVoidOrder" type="screen" page="component://webpos/widget/ManagerScreens.xml#VoidOrder"/> - <view-map name="ManagerPaidOutAndIn" type="screen" page="component://webpos/widget/ManagerScreens.xml#PaidOutAndIn"/> - <view-map name="ManagerModifyPrice" type="screen" page="component://webpos/widget/ManagerScreens.xml#ModifyPrice"/> - - <!-- Payment view mappings --> - <view-map name="AddPayCash" type="screen" page="component://webpos/widget/PaymentScreens.xml#PayCash"/> - <view-map name="AddPayCheck" type="screen" page="component://webpos/widget/PaymentScreens.xml#PayCheck"/> - <view-map name="AddPayGiftCard" type="screen" page="component://webpos/widget/PaymentScreens.xml#PayGiftCard"/> - <view-map name="AddPayCreditCard" type="screen" page="component://webpos/widget/PaymentScreens.xml#PayCreditCard"/> - <view-map name="AddPaySetRef" type="screen" page="component://webpos/widget/PaymentScreens.xml#PaySetRef"/> - <view-map name="ClearPayment" type="screen" page="component://webpos/widget/PaymentScreens.xml#ClearPayment"/> - - <!-- Promo view mappings --> - <view-map name="AddPromoCode" type="screen" page="component://webpos/widget/PromoScreens.xml#PromoCode"/> + <view-map name="ShowCart" type="screen" page="component://webpos/widget/CartScreens.xml#ShowCart"/> + <view-map name="ShowCartItemSelected" type="screen" page="component://webpos/widget/CartScreens.xml#ShowCartItemSelected"/> + <view-map name="CustomerAddress" type="screen" page="component://webpos/widget/SearchScreens.xml#CustomerAddress"/> + <view-map name="EditAddress" type="screen" page="component://webpos/widget/CustomerScreens.xml#EditAddress"/> + <view-map name="SearchSalesRepsList" type="screen" page="component://webpos/widget/SearchScreens.xml#SearchSalesRepsList"/> + <view-map name="SideDeepCategory" type="screen" page="component://webpos/widget/CatalogScreens.xml#SideDeepCategory"/> + <view-map name="CategoryDetail" type="screen" page="component://webpos/widget/CatalogScreens.xml#CategoryDetail"/> <!-- End of View Mappings --> </site-conf> \ No newline at end of file Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/WEB-INF/web.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/WEB-INF/web.xml?rev=1128865&r1=1128864&r2=1128865&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/WEB-INF/web.xml (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/WEB-INF/web.xml Sun May 29 11:02:09 2011 @@ -59,7 +59,7 @@ </init-param> <init-param> <param-name>allowedPaths</param-name> - <param-value>/error:/control:/select:/index.html:/index.jsp:/default.html:/default.jsp:/images</param-value> + <param-value>/control:/products:/select:/index.html:/index.jsp:/default.html:/default.jsp:/images</param-value> </init-param> <init-param> <param-name>errorCode</param-name> @@ -78,7 +78,7 @@ <listener><listener-class>org.ofbiz.webapp.control.ControlEventListener</listener-class></listener> <!-- NOTE: not all app servers support mounting implementations of the HttpSessionActivationListener interface --> <!-- <listener><listener-class>org.ofbiz.webapp.control.ControlActivationEventListener</listener-class></listener> --> - + <!-- this listener will save any abandoned cart info --> <listener><listener-class>org.ofbiz.order.shoppingcart.CartEventListener</listener-class></listener> <!-- this listener will clean up info --> @@ -91,10 +91,21 @@ <servlet-class>org.ofbiz.webapp.control.ControlServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> + <servlet> + <servlet-name>CatalogUrlServlet</servlet-name> + <display-name>CatalogUrlServlet</display-name> + <description>Catalog (Category/Product) URL Servlet</description> + <servlet-class>org.ofbiz.product.category.CatalogUrlServlet</servlet-class> + <load-on-startup>1</load-on-startup> + </servlet> <servlet-mapping> <servlet-name>ControlServlet</servlet-name> <url-pattern>/control/*</url-pattern> </servlet-mapping> + <servlet-mapping> + <servlet-name>CatalogUrlServlet</servlet-name> + <url-pattern>/products/*</url-pattern> + </servlet-mapping> <session-config> <session-timeout>60</session-timeout> </session-config> Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/buttons/Main.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/buttons/Main.ftl?rev=1128865&r1=1128864&r2=1128865&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/buttons/Main.ftl (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/buttons/Main.ftl Sun May 29 11:02:09 2011 @@ -1,122 +0,0 @@ -<#-- -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you 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. ---> - -<table class="tableButtons" cellspacing="5"> - <tr> - <td> - <a href="<@ofbizUrl>main</@ofbizUrl>" class="posButton">${uiLabelMap.WebPosButtonMain}</a> - </td> - <td> - - </td> - <td> - <#if isManagerLoggedIn?default(false) == true> - <a href="<@ofbizUrl>Manager</@ofbizUrl>" class="posButton">${uiLabelMap.WebPosButtonManager}</a> - <#else> - <span class="disabled">${uiLabelMap.WebPosButtonManager}</span> - </#if> - </td> - </tr> - <tr> - <td> - <a href="<@ofbizUrl>Promo</@ofbizUrl>" class="posButton">${uiLabelMap.WebPosButtonPromo}</a> - </td> - <td> - - </td> - <td> - <#if (shoppingCartSize > 0)> - <a href="<@ofbizUrl>Payment</@ofbizUrl>" class="posButton">${uiLabelMap.WebPosButtonPayment}</a> - <#else> - <span class="disabled">${uiLabelMap.WebPosButtonPayment}</span> - </#if> - </td> - </tr> - <tr> - <td> - <#if (shoppingCartSize > 0)> - <a href="javascript:document.cartform.submit();" class="posButton">${uiLabelMap.WebPosRecalculateCart}</a> - <#else> - <span class="disabled">${uiLabelMap.WebPosRecalculateCart}</span> - </#if> - </td> - <td> - <#if (shoppingCartSize > 0)> - <a href="<@ofbizUrl>EmptyCart</@ofbizUrl>" class="posButton">${uiLabelMap.WebPosEmptyCart}</a> - <#else> - <span class="disabled">${uiLabelMap.WebPosEmptyCart}</span> - </#if> - </td> - <td> - <#if (shoppingCartSize > 0)> - <a href="javascript:removeSelected();" class="posButton">${uiLabelMap.WebPosRemoveSelected}</a> - <#else> - <span class="disabled">${uiLabelMap.WebPosRemoveSelected}</span> - </#if> - </td> - </tr> - <tr> - <td> - <a href="<@ofbizUrl>AddItem?add_product_id=GZ-1001&quantity=1</@ofbizUrl>" class="posButton">NAN GIZMO</a> - </td> - <td> - <a href="<@ofbizUrl>AddItem?add_product_id=GZ-5005&quantity=1</@ofbizUrl>" class="posButton">PURPLE GIZMO</a> - </td> - <td> - <a href="<@ofbizUrl>AddItem?add_product_id=GZ-2644&quantity=1</@ofbizUrl>" class="posButton">ROUND GIZMO</a> - </td> - </tr> - <tr> - <td> - <a href="<@ofbizUrl>AddItem?add_product_id=GZ-2002&quantity=1</@ofbizUrl>" class="posButton">SQUARE GIZMO</a> - </td> - <td> - <a href="<@ofbizUrl>AddItem?add_product_id=GZ-7000&quantity=1</@ofbizUrl>" class="posButton">MASSIVE GIZMO</a> - </td> - <td> - <a href="<@ofbizUrl>AddItem?add_product_id=WG-5569&quantity=1</@ofbizUrl>" class="posButton">TINY WIDGET</a> - </td> - </tr> - <tr> - <td> - <a href="<@ofbizUrl>AddItem?add_product_id=GZ-1004&quantity=1</@ofbizUrl>" class="posButton">RAINBOW GIZMO</a> - </td> - <td> - <a href="<@ofbizUrl>AddItem?add_product_id=GZ-1005&quantity=1</@ofbizUrl>" class="posButton">NIT GIZMO</a> - </td> - <td> - <a href="<@ofbizUrl>AddItem?add_product_id=GZ-8544&quantity=1</@ofbizUrl>" class="posButton">BIG GIZMO</a> - </td> - </tr> - <tr> - <td> - <a href="<@ofbizUrl>AddItem?add_product_id=WG-1111&quantity=1</@ofbizUrl>" class="posButton">MICRO WIDGET</a> - </td> - <td> - - </td> - <td> - <#if userLogin?has_content && userLogin.userLoginId != "anonymous"> - <a href="<@ofbizUrl>Logout</@ofbizUrl>" class="posButton">${uiLabelMap.WebPosButtonLogout}</a> - <#else/> - <a href="<@ofbizUrl>${checkLoginUrl}</@ofbizUrl>" class="posButton">${uiLabelMap.WebPosButtonLogin}</a> - </#if> - </td> - </tr> -</table> \ No newline at end of file Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/buttons/Manager.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/buttons/Manager.ftl?rev=1128865&r1=1128864&r2=1128865&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/buttons/Manager.ftl (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/webapp/webpos/buttons/Manager.ftl Sun May 29 11:02:09 2011 @@ -1,78 +0,0 @@ -<#-- -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you 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. ---> - -<table class="tableButtons" cellspacing="5"> - <tr> - <td> - <#if isManagerLoggedIn?default(false) == true && isOpen?default(false) == false> - <a href="<@ofbizUrl>ManagerOpenTerminal</@ofbizUrl>" class="posButton">${uiLabelMap.WebPosButtonOpenTerminal}</a> - <#else> - <span class="disabled">${uiLabelMap.WebPosButtonOpenTerminal}</span> - </#if> - </td> - <td> - <#if isManagerLoggedIn?default(false) == true && isOpen?default(false) == true> - <a href="<@ofbizUrl>ManagerCloseTerminal</@ofbizUrl>" class="posButton">${uiLabelMap.WebPosButtonCloseTerminal}</a> - <#else> - <span class="disabled">${uiLabelMap.WebPosButtonCloseTerminal}</span> - </#if> - </td> - <td> - <#if isManagerLoggedIn?default(false) == true && isOpen?default(false) == true> - <a href="<@ofbizUrl>ManagerVoidOrder</@ofbizUrl>" class="posButton">${uiLabelMap.WebPosButtonVoidOrder}</a> - <#else> - <span class="disabled">${uiLabelMap.WebPosButtonVoidOrder}</span> - </#if> - </td> - </tr> - <tr> - <td> - <#if isManagerLoggedIn?default(false) == true> - <a href="<@ofbizUrl>Shutdown</@ofbizUrl>" class="posButton">${uiLabelMap.WebPosButtonShutdown}</a> - <#else> - <span class="disabled">${uiLabelMap.WebPosButtonShutdown}</span> - </#if> - </td> - <td> - <#if isManagerLoggedIn?default(false) == true && isOpen?default(false) == true> - <a href="<@ofbizUrl>ManagerPaidOutAndIn?type=IN</@ofbizUrl>" class="posButton">${uiLabelMap.WebPosButtonPaidIn}</a> - <#else> - <span class="disabled">${uiLabelMap.WebPosButtonPaidIn}</span> - </#if> - </td> - <td> - <#if isManagerLoggedIn?default(false) == true && isOpen?default(false) == true> - <a href="<@ofbizUrl>ManagerPaidOutAndIn?type=OUT</@ofbizUrl>" class="posButton">${uiLabelMap.WebPosButtonPaidOut}</a> - <#else> - <span class="disabled">${uiLabelMap.WebPosButtonPaidOut}</span> - </#if> - </td> - </tr> - <tr> - <td> - <a href="<@ofbizUrl>ManagerModifyPrice</@ofbizUrl>" class="posButton">${uiLabelMap.WebPosButtonModifyPrice}</a> - </td> - <td> - <a href="<@ofbizUrl>main</@ofbizUrl>" class="posButton">${uiLabelMap.WebPosButtonMain}</a> - </td> - <td> - - </td> - </tr> -</table> \ No newline at end of file |
Free forum by Nabble | Edit this page |