From d098eeec6ead05eb558ae655f9923ed87bfc671a Mon Sep 17 00:00:00 2001 From: Pierre Smits Date: Sat, 6 Aug 2016 17:03:59 +0200 Subject: [PATCH] adding internal origin --- LICENSE | 201 ++ README.md | 4 + build.xml | 143 ++ config/oshopUiLabels.xml | 39 + data/helpdata/HELP_oshop.xml | 26 + data/oshopDemoData.xml | 98 + data/oshopSecurityGroupDemoData.xml | 26 + data/oshopSecurityPermissionSeedData.xml | 27 + data/oshopSeedData.xml | 20 + documents/oshop.xml | 32 + dtd/readme | 1 + entitydef/entitymodel.xml | 28 + lib/readme | 1 + ofbiz-component.xml | 61 + patches/production/readme | 1 + patches/qa/readme | 1 + patches/test/readme | 1 + script/readme | 1 + servicedef/services.xml | 30 + src/org/apache/ofbiz/ecommerce/Login.groovy | 34 + src/org/apache/ofbiz/ecommerce/Main.groovy | 42 + .../ofbiz/ecommerce/cart/ShowCart.groovy | 78 + .../ofbiz/ecommerce/cart/ShowPromoText.groovy | 58 + .../catalog/BestSellingCategory.groovy | 42 + .../catalog/LayeredNavigation.groovy | 138 ++ .../catalog/MiniProductSummary.groovy | 91 + .../ecommerce/catalog/MiniReorderProds.groovy | 24 + .../ecommerce/catalog/PopularTags.groovy | 82 + .../catalog/ProductCategories.groovy | 94 + .../ecommerce/catalog/ajaxbreadcrumbs.groovy | 49 + .../content/AdvancedSearchPrep.groovy | 40 + .../ecommerce/content/ContentPrep.groovy | 20 + .../apache/ofbiz/ecommerce/content/Mrv.groovy | 71 + .../ofbiz/ecommerce/content/Search.groovy | 115 + .../ecommerce/customer/ChangePassword.groovy | 37 + .../ecommerce/customer/ContactList.groovy | 60 + .../ecommerce/customer/CustomerReviews.groovy | 28 + .../ecommerce/customer/CustomerSurvey.groovy | 46 + .../customer/EditBillingAddress.groovy | 83 + .../ecommerce/customer/EditContactMech.groovy | 103 + .../customer/EditEmailAndTelecomNumber.groovy | 44 + .../customer/EditPaymentMethod.groovy | 64 + .../ecommerce/customer/EditPerson.groovy | 32 + .../customer/EditShippingAddress.groovy | 76 + .../ecommerce/customer/GiftCardBalance.groovy | 21 + .../ecommerce/customer/GiftCardLink.groovy | 33 + .../ecommerce/customer/NewCustomer.groovy | 58 + .../customer/OnePageCheckoutOptions.groovy | 27 + .../ecommerce/customer/ViewProfile.groovy | 89 + .../ecommerce/forum/ContentAddPrep.groovy | 94 + .../ofbiz/ecommerce/forum/ContentPrep.groovy | 131 + .../ecommerce/forum/CurrentValPrep.groovy | 148 ++ .../ofbiz/ecommerce/forum/EditAddPrep.groovy | 89 + .../ofbiz/ecommerce/forum/FormPrep.groovy | 62 + .../ofbiz/ecommerce/forum/HtmlAreaPrep.groovy | 42 + .../ecommerce/forum/NodeTrailPrep.groovy | 81 + .../ecommerce/forum/OwnerContentPrep.groovy | 79 + .../ofbiz/ecommerce/forum/PermPrep.groovy | 166 ++ .../ofbiz/ecommerce/forum/PubInit.groovy | 57 + .../ecommerce/forum/RespondPermAndPrep.groovy | 156 ++ .../ofbiz/ecommerce/forum/ResponsePrep.groovy | 76 + .../ofbiz/ecommerce/forum/ViewPrep.groovy | 72 + .../ofbiz/ecommerce/includes/MruAdd.groovy | 72 + .../ecommerce/janrain/JanrainHelper.java | 247 ++ .../ecommerce/misc/ThirdPartyEvents.java | 264 ++ .../order/AnonymousCheckoutLinks.groovy | 46 + .../ecommerce/order/AnonymousTrail.groovy | 42 + .../ofbiz/ecommerce/order/BillSettings.groovy | 108 + .../ecommerce/order/CheckoutReview.groovy | 110 + .../order/CheckoutShippingOptions.groovy | 45 + .../ofbiz/ecommerce/order/CustSettings.groovy | 99 + .../ecommerce/order/OptionSettings.groovy | 56 + .../ofbiz/ecommerce/order/OrderHistory.groovy | 43 + .../ofbiz/ecommerce/order/OrderStatus.groovy | 216 ++ .../ecommerce/order/PaymentInformation.groovy | 117 + .../ecommerce/order/PaymentOptions.groovy | 32 + .../order/ProcessPaymentSettings.groovy | 84 + .../order/QuickAnonCheckoutLinks.groovy | 31 + .../order/QuickAnonCustSettings.groovy | 139 ++ .../order/QuickAnonOptionSettings.groovy | 56 + .../order/QuickAnonPaymentInformation.groovy | 44 + .../ecommerce/order/RequestReturn.groovy | 55 + .../ofbiz/ecommerce/order/ShipSettings.groovy | 75 + .../ecommerce/order/ShipmentStatus.groovy | 42 + .../ofbiz/ecommerce/product/Product.groovy | 145 ++ .../ecommerce/product/ProductDetail.groovy | 681 ++++++ .../ecommerce/setup/EcommerceSetup.groovy | 41 + .../shoppinglist/EditShoppingList.groovy | 230 ++ .../ecommerce/webapp/view/JspViewHandler.java | 103 + template/LoginForgot.ftl | 49 + template/LoginJanrain.ftl | 82 + template/LoginMain.ftl | 76 + template/blog/TextImage.ftl | 123 + template/blog/blogContentAltLink.ftl | 21 + template/blog/blogs.ftl | 31 + template/blog/main.ftl | 86 + template/blog/menubar.ftl | 27 + template/cart/CartAddPromo.ftl | 41 + template/cart/CartAssocProducts.ftl | 31 + template/cart/CartItemAdjustments.ftl | 84 + template/cart/CartItems.ftl | 204 ++ template/cart/CartQuickAddProduct.ftl | 23 + template/cart/CartShowPromo.ftl | 17 + template/cart/PopOverCart.ftl | 78 + template/cart/UpdateCart.ftl | 184 ++ template/cart/microcart.ftl | 60 + template/cart/minicart.ftl | 97 + template/cart/minipromotext.ftl | 46 + template/cart/promoUseDetailsInline.ftl | 79 + template/cart/showcart.ftl | 154 ++ template/catalog/LayeredCategoryDetail.ftl | 107 + template/catalog/LayeredNavBar.ftl | 75 + template/catalog/MainNav.ftl | 3 + template/catalog/ProductCategories.ftl | 207 ++ template/catalog/ProductCategoryLink.ftl | 54 + template/catalog/ShowBestSellingCategory.ftl | 110 + template/catalog/SimpleSearch.ftl | 12 + template/catalog/advancedsearch.ftl | 125 + template/catalog/ajaxbreadcrumbs.ftl | 76 + template/catalog/breadcrumbs.ftl | 68 + template/catalog/categorydetail.ftl | 189 ++ template/catalog/choosecatalog.ftl | 45 + template/catalog/compareproductslist.ftl | 53 + template/catalog/configproductdetail.ftl | 734 ++++++ template/catalog/detailImage.ftl | 32 + template/catalog/keywordsearch.ftl | 95 + template/catalog/keywordsearchbox.ftl | 74 + template/catalog/lastviewedproducts.ftl | 51 + template/catalog/miniassocprods.ftl | 38 + template/catalog/minilastproductsearches.ftl | 51 + template/catalog/minilastviewedcategories.ftl | 48 + template/catalog/minilastviewedproducts.ftl | 48 + template/catalog/miniproductsummary.ftl | 58 + template/catalog/minireorderprods.ftl | 37 + template/catalog/populartags.ftl | 29 + template/catalog/productdetail.ftl | 923 +++++++ template/catalog/productreview.ftl | 79 + template/catalog/productsummary.ftl | 240 ++ template/catalog/sidedeepcategory.ftl | 86 + template/catalog/tagsearch.ftl | 86 + template/catalog/tellafriend.ftl | 66 + template/content/bloglib.ftl | 55 + template/content/content_categories.ftl | 48 + template/content/content_topic.ftl | 51 + template/content/defaultcontent.ftl | 20 + template/content/factoids.ftl | 48 + template/content/minipoll.ftl | 39 + template/content/recentlyviewed.ftl | 36 + template/content/searchContent.ftl | 115 + template/content/showcontenttree.ftl | 111 + template/content/tpl_mb_content.ftl | 67 + template/content/viewcontent.ftl | 136 ++ template/customer/AccountCMPostalAddress.ftl | 19 + template/customer/AccountCMTelecom.ftl | 10 + template/customer/AccountCMWebAddress.ftl | 6 + template/customer/AccountCards.ftl | 119 + template/customer/AccountContactList.ftl | 96 + template/customer/AccountContactMechs.ftl | 91 + .../customer/AccountDefaultShipMethod.ftl | 29 + template/customer/AccountFileMgt.ftl | 61 + template/customer/AccountLoyalityPoints.ftl | 12 + template/customer/AccountMessages.ftl | 9 + template/customer/AccountName.ftl | 72 + template/customer/AccountSurveys.ftl | 33 + template/customer/AccountTax.ftl | 12 + template/customer/AccountTelco.ftl | 0 template/customer/AccountUserName.ftl | 15 + template/customer/AnonContactus.ftl | 80 + template/customer/FinAccountDetail.ftl | 106 + template/customer/MyAccountMenu.ftl | 10 + template/customer/NewCustomerAccount.ftl | 58 + template/customer/NewCustomerAddress.ftl | 79 + template/customer/NewCustomerEmail.ftl | 27 + template/customer/NewCustomerName.ftl | 41 + template/customer/NewCustomerTelco.ftl | 51 + .../customer/SerializedInventorySummary.ftl | 62 + template/customer/SubscriptionSummary.ftl | 61 + template/customer/changepassword.ftl | 49 + template/customer/customersurvey.ftl | 34 + template/customer/digitalproductedit.ftl | 104 + template/customer/digitalproductlist.ftl | 69 + template/customer/editcontactmech.ftl | 249 ++ template/customer/editcreditcard.ftl | 142 ++ template/customer/editeftaccount.ftl | 183 ++ template/customer/editgiftcard.ftl | 113 + template/customer/editperson.ftl | 178 ++ template/customer/giftcardbalance.ftl | 65 + template/customer/giftcardlink.ftl | 68 + template/customer/messagedetail.ftl | 66 + template/customer/messagelist.ftl | 85 + .../customer/miniSignUpForContactList.ftl | 107 + template/customer/newcustomer.ftl | 171 ++ template/customer/newmsg.ftl | 110 + .../customer/profile/EditBillToAddress.ftl | 91 + .../customer/profile/EditPostalAddress.ftl | 85 + template/customer/profile/EditProfile.ftl | 68 + .../customer/profile/EditShipToAddress.ftl | 91 + template/customer/profile/ManageAddress.ftl | 301 +++ template/customer/profile/NewCustomer.ftl | 176 ++ template/customer/profile/ViewProfile.ftl | 103 + template/customer/viewprofile.ftl | 108 + template/customer/viewreviews.ftl | 46 + template/data/content.ftl | 42 + template/data/topic.ftl | 42 + template/data/tree.ftl | 46 + template/email/ContactListEmailTemplate.ftl | 38 + template/email/ContactListSubscribeEmail.ftl | 31 + .../email/ContactListUnsubscribeEmail.ftl | 33 + .../ContactListUnsubscribeVerifyEmail.ftl | 43 + template/email/ContactListVerifyEmail.ftl | 44 + template/email/ContactUsEmail.ftl | 28 + template/email/OrderNoticeEmail.ftl | 145 ++ template/email/ShipmentNotificationEmail.ftl | 63 + template/email/emailpayretry.ftl | 29 + template/email/giftcardpurchase.ftl | 42 + template/email/giftcardreload.ftl | 52 + template/email/registration.ftl | 35 + template/email/returnaccept.ftl | 34 + template/email/returncancel.ftl | 24 + template/email/returncomplete.ftl | 24 + template/email/tellafriend.ftl | 30 + template/error/404.jsp | 53 + template/error/error.jsp | 53 + template/forum/ViewComboResponse.ftl | 53 + template/forum/bloglib.ftl | 195 ++ template/forum/createforumarticle.ftl | 22 + template/forum/createforumresponse.ftl | 28 + template/forum/editaddforumdata.ftl | 20 + template/forum/editaddimage.ftl | 20 + template/forum/editforumarticle.ftl | 94 + template/forum/editforuminfo.ftl | 22 + template/forum/forumPaging.ftl | 48 + template/forum/forums.ftl | 33 + template/forum/messageDisplay.ftl | 53 + template/forum/mostrecent.ftl | 74 + template/forum/showblog.ftl | 162 ++ template/forum/showforum.ftl | 22 + template/forum/showforumarticle.ftl | 21 + template/forum/showforumresponse.ftl | 160 ++ template/images/blog.css | 241 ++ template/images/checkoutProcess.js | 637 +++++ template/images/productAdditionalView.js | 56 + template/images/profile.js | 328 +++ template/images/quickAnonCustSettings.js | 57 + template/images/remove.png | Bin 0 -> 937 bytes template/includes/container-end.ftl | 17 + template/includes/container-start.ftl | 17 + template/includes/ecom-header-bar.ftl | 56 + template/includes/ecom-header.ftl | 75 + template/includes/footer.ftl | 96 + template/includes/header.ftl | 18 + template/includes/headerHead.ftl | 106 + template/includes/language.ftl | 37 + template/includes/row-end.ftl | 17 + template/includes/row-start.ftl | 17 + template/login.ftl | 61 + template/main.ftl | 23 + template/order/CheckOutAddress.ftl | 101 + template/order/CheckOutPayOptions.ftl | 176 ++ template/order/CheckOutPlaceOrder.ftl | 84 + template/order/CheckOutShipOptions.ftl | 123 + template/order/CheckoutPayCreditCard.ftl | 3 + template/order/CheckoutPayEftAccount.ftl | 3 + template/order/CheckoutPayExtBilling.ftl | 19 + template/order/CheckoutPayExtCod.ftl | 6 + template/order/CheckoutPayExtOffline.ftl | 6 + template/order/CheckoutPayExtPayPal.ftl | 6 + template/order/CheckoutPayExtWorldPay.ftl | 6 + .../order/CheckoutPayMethodCreditCard.ftl | 12 + .../order/CheckoutPayMethodEftAccount.ftl | 11 + template/order/CheckoutPayMethodGiftCard.ftl | 27 + template/order/OnePageCheckoutProcess.ftl | 500 ++++ template/order/Order.ftl | 53 + template/order/OrderHistoryDownloads.ftl | 39 + template/order/OrderHistoryShipped.ftl | 36 + template/order/OrderHistorySubmitted.ftl | 48 + template/order/ReviewAddress.ftl | 112 + template/order/ReviewItems.ftl | 350 +++ template/order/ReviewPayment.ftl | 120 + template/order/ReviewStatus.ftl | 12 + template/order/ShippingOptionAddEmail.ftl | 25 + template/order/ShippingOptionAllAtOnce.ftl | 25 + template/order/ShippingOptionGift.ftl | 32 + template/order/ShippingOptionPONumber.ftl | 18 + .../order/ShippingOptionSpecInstruction.ftl | 14 + template/order/anonymousCheckoutLinks.ftl | 51 + template/order/anonymoustrail.ftl | 20 + template/order/billsettings.ftl | 293 +++ template/order/ccinfo.ftl | 26 + template/order/checkoutpayment.ftl | 268 ++ template/order/checkoutreview.ftl | 65 + template/order/checkoutshippingaddress.ftl | 149 ++ template/order/checkoutshippingoptions.ftl | 203 ++ template/order/custsettings.ftl | 127 + template/order/eftinfo.ftl | 60 + template/order/gcinfo.ftl | 62 + template/order/genericaddress.ftl | 113 + template/order/optionsettings.ftl | 85 + template/order/ordercomplete.ftl | 27 + template/order/orderheader.ftl | 57 + template/order/orderhistory.ftl | 22 + template/order/orderitems.ftl | 301 +++ template/order/orderstatus.ftl | 29 + template/order/paymentinformation.ftl | 247 ++ template/order/paymentoptions.ftl | 59 + template/order/quickAnonCheckoutLinks.ftl | 31 + template/order/quickAnonCheckoutReview.ftl | 74 + template/order/quickAnonCustSettings.ftl | 333 +++ template/order/quickAnonOptionSettings.ftl | 168 ++ template/order/quickAnonOrderHeader.ftl | 160 ++ .../order/quickAnonPaymentInformation.ftl | 162 ++ template/order/requestreturn.ftl | 157 ++ template/order/shipsettings.ftl | 71 + template/order/splitship.ftl | 263 ++ template/order/startanoncheckout.ftl | 39 + template/product/ConfigProductDetail.ftl | 224 ++ template/product/ProductAddToOrder.ftl | 180 ++ template/product/ProductAddToShopList.ftl | 53 + template/product/ProductConfigurator.ftl | 175 ++ template/product/ProductCrossSell.ftl | 94 + template/product/ProductDaysToShip.ftl | 20 + template/product/ProductDetail.ftl | 399 +++ template/product/ProductDigitalDownload.ftl | 25 + template/product/ProductDimensions.ftl | 41 + template/product/ProductFeatureList.ftl | 27 + template/product/ProductImage.ftl | 94 + template/product/ProductLongDescription.ftl | 21 + template/product/ProductMetaData.ftl | 36 + template/product/ProductPieces.ftl | 28 + template/product/ProductPrice.ftl | 95 + template/product/ProductRelated.ftl | 16 + template/product/ProductReviews.ftl | 66 + template/product/ProductSummary.ftl | 229 ++ template/product/ProductSwatches.ftl | 44 + template/product/ProductTags.ftl | 55 + template/product/ProductTellaFriend.ftl | 21 + template/quote/CreateOrderQuote.ftl | 27 + template/quote/QuoteList.ftl | 84 + template/request/RequestList.ftl | 93 + template/request/requestInfo.ftl | 123 + template/request/requestRoles.ftl | 43 + template/requirePasswordChange.ftl | 66 + template/shoppinglist/editShoppingList.ftl | 573 +++++ template/survey/genericresult.ftl | 126 + template/survey/miniresult.ftl | 79 + template/survey/minisurvey.ftl | 121 + testdef/oshopTests.xml | 7 + webapp/ecommerce/WEB-INF/controller.xml | 2169 +++++++++++++++++ webapp/ecommerce/WEB-INF/web.xml | 165 ++ webapp/ecommerce/index.jsp | 20 + webapp/ecommerce/makebogodata.jsp | 69 + webapp/ecommerce/robots.txt | 2 + webapp/oshop/README | 3 + webapp/oshop/WEB-INF/controller.xml | 28 + webapp/oshop/WEB-INF/web.xml | 167 ++ webapp/oshop/error/error.jsp | 53 + webapp/oshop/index.jsp | 20 + widget/BlogMenus.xml | 34 + widget/BlogScreens.xml | 702 ++++++ widget/BlogTemplates.xml | 53 + widget/BlogTrees.xml | 51 + widget/CartScreens.xml | 141 ++ widget/CatalogScreens.xml | 525 ++++ widget/CommonScreens.xml | 978 ++++++++ widget/ContentScreens.xml | 159 ++ widget/CustRequestScreens.xml | 116 + widget/CustomerScreens.xml | 684 ++++++ widget/EmailContactListScreens.xml | 118 + widget/EmailGiftCardScreens.xml | 45 + widget/EmailOrderScreens.xml | 174 ++ widget/EmailProductScreens.xml | 32 + widget/EmailReturnScreens.xml | 57 + widget/ForumScreens.xml | 575 +++++ widget/ForumTrees.xml | 63 + widget/OrderScreens.xml | 626 +++++ widget/ProductScreens.xml | 114 + widget/QuoteScreens.xml | 90 + widget/ShoppingListScreens.xml | 65 + widget/forms/BlogForms.xml | 208 ++ widget/forms/ContentForms.xml | 42 + widget/forms/ForumForms.xml | 738 ++++++ widget/forms/oshopForms.xml | 22 + widget/oshopMenus.xml | 22 + widget/oshopScreens.xml | 35 + 384 files changed, 39191 insertions(+) create mode 100644 LICENSE create mode 100644 README.md create mode 100644 build.xml create mode 100644 config/oshopUiLabels.xml create mode 100644 data/helpdata/HELP_oshop.xml create mode 100644 data/oshopDemoData.xml create mode 100644 data/oshopSecurityGroupDemoData.xml create mode 100644 data/oshopSecurityPermissionSeedData.xml create mode 100644 data/oshopSeedData.xml create mode 100644 documents/oshop.xml create mode 100644 dtd/readme create mode 100644 entitydef/entitymodel.xml create mode 100644 lib/readme create mode 100644 ofbiz-component.xml create mode 100644 patches/production/readme create mode 100644 patches/qa/readme create mode 100644 patches/test/readme create mode 100644 script/readme create mode 100644 servicedef/services.xml create mode 100644 src/org/apache/ofbiz/ecommerce/Login.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/Main.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/cart/ShowCart.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/cart/ShowPromoText.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/catalog/BestSellingCategory.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/catalog/LayeredNavigation.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/catalog/MiniProductSummary.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/catalog/MiniReorderProds.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/catalog/PopularTags.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/catalog/ProductCategories.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/catalog/ajaxbreadcrumbs.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/content/AdvancedSearchPrep.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/content/ContentPrep.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/content/Mrv.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/content/Search.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/customer/ChangePassword.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/customer/ContactList.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/customer/CustomerReviews.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/customer/CustomerSurvey.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/customer/EditBillingAddress.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/customer/EditContactMech.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/customer/EditEmailAndTelecomNumber.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/customer/EditPaymentMethod.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/customer/EditPerson.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/customer/EditShippingAddress.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/customer/GiftCardBalance.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/customer/GiftCardLink.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/customer/NewCustomer.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/customer/OnePageCheckoutOptions.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/customer/ViewProfile.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/forum/ContentAddPrep.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/forum/ContentPrep.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/forum/CurrentValPrep.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/forum/EditAddPrep.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/forum/FormPrep.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/forum/HtmlAreaPrep.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/forum/NodeTrailPrep.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/forum/OwnerContentPrep.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/forum/PermPrep.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/forum/PubInit.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/forum/RespondPermAndPrep.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/forum/ResponsePrep.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/forum/ViewPrep.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/includes/MruAdd.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/janrain/JanrainHelper.java create mode 100644 src/org/apache/ofbiz/ecommerce/misc/ThirdPartyEvents.java create mode 100644 src/org/apache/ofbiz/ecommerce/order/AnonymousCheckoutLinks.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/order/AnonymousTrail.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/order/BillSettings.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/order/CheckoutReview.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/order/CheckoutShippingOptions.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/order/CustSettings.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/order/OptionSettings.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/order/OrderHistory.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/order/OrderStatus.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/order/PaymentInformation.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/order/PaymentOptions.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/order/ProcessPaymentSettings.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/order/QuickAnonCheckoutLinks.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/order/QuickAnonCustSettings.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/order/QuickAnonOptionSettings.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/order/QuickAnonPaymentInformation.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/order/RequestReturn.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/order/ShipSettings.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/order/ShipmentStatus.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/product/Product.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/product/ProductDetail.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/setup/EcommerceSetup.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/shoppinglist/EditShoppingList.groovy create mode 100644 src/org/apache/ofbiz/ecommerce/webapp/view/JspViewHandler.java create mode 100644 template/LoginForgot.ftl create mode 100644 template/LoginJanrain.ftl create mode 100644 template/LoginMain.ftl create mode 100644 template/blog/TextImage.ftl create mode 100644 template/blog/blogContentAltLink.ftl create mode 100644 template/blog/blogs.ftl create mode 100644 template/blog/main.ftl create mode 100644 template/blog/menubar.ftl create mode 100644 template/cart/CartAddPromo.ftl create mode 100644 template/cart/CartAssocProducts.ftl create mode 100644 template/cart/CartItemAdjustments.ftl create mode 100644 template/cart/CartItems.ftl create mode 100644 template/cart/CartQuickAddProduct.ftl create mode 100644 template/cart/CartShowPromo.ftl create mode 100644 template/cart/PopOverCart.ftl create mode 100644 template/cart/UpdateCart.ftl create mode 100644 template/cart/microcart.ftl create mode 100644 template/cart/minicart.ftl create mode 100644 template/cart/minipromotext.ftl create mode 100644 template/cart/promoUseDetailsInline.ftl create mode 100644 template/cart/showcart.ftl create mode 100644 template/catalog/LayeredCategoryDetail.ftl create mode 100644 template/catalog/LayeredNavBar.ftl create mode 100644 template/catalog/MainNav.ftl create mode 100644 template/catalog/ProductCategories.ftl create mode 100644 template/catalog/ProductCategoryLink.ftl create mode 100644 template/catalog/ShowBestSellingCategory.ftl create mode 100644 template/catalog/SimpleSearch.ftl create mode 100644 template/catalog/advancedsearch.ftl create mode 100644 template/catalog/ajaxbreadcrumbs.ftl create mode 100644 template/catalog/breadcrumbs.ftl create mode 100644 template/catalog/categorydetail.ftl create mode 100644 template/catalog/choosecatalog.ftl create mode 100644 template/catalog/compareproductslist.ftl create mode 100644 template/catalog/configproductdetail.ftl create mode 100644 template/catalog/detailImage.ftl create mode 100644 template/catalog/keywordsearch.ftl create mode 100644 template/catalog/keywordsearchbox.ftl create mode 100644 template/catalog/lastviewedproducts.ftl create mode 100644 template/catalog/miniassocprods.ftl create mode 100644 template/catalog/minilastproductsearches.ftl create mode 100644 template/catalog/minilastviewedcategories.ftl create mode 100644 template/catalog/minilastviewedproducts.ftl create mode 100644 template/catalog/miniproductsummary.ftl create mode 100644 template/catalog/minireorderprods.ftl create mode 100644 template/catalog/populartags.ftl create mode 100644 template/catalog/productdetail.ftl create mode 100644 template/catalog/productreview.ftl create mode 100644 template/catalog/productsummary.ftl create mode 100644 template/catalog/sidedeepcategory.ftl create mode 100644 template/catalog/tagsearch.ftl create mode 100644 template/catalog/tellafriend.ftl create mode 100644 template/content/bloglib.ftl create mode 100644 template/content/content_categories.ftl create mode 100644 template/content/content_topic.ftl create mode 100644 template/content/defaultcontent.ftl create mode 100644 template/content/factoids.ftl create mode 100644 template/content/minipoll.ftl create mode 100644 template/content/recentlyviewed.ftl create mode 100644 template/content/searchContent.ftl create mode 100644 template/content/showcontenttree.ftl create mode 100644 template/content/tpl_mb_content.ftl create mode 100644 template/content/viewcontent.ftl create mode 100644 template/customer/AccountCMPostalAddress.ftl create mode 100644 template/customer/AccountCMTelecom.ftl create mode 100644 template/customer/AccountCMWebAddress.ftl create mode 100644 template/customer/AccountCards.ftl create mode 100644 template/customer/AccountContactList.ftl create mode 100644 template/customer/AccountContactMechs.ftl create mode 100644 template/customer/AccountDefaultShipMethod.ftl create mode 100644 template/customer/AccountFileMgt.ftl create mode 100644 template/customer/AccountLoyalityPoints.ftl create mode 100644 template/customer/AccountMessages.ftl create mode 100644 template/customer/AccountName.ftl create mode 100644 template/customer/AccountSurveys.ftl create mode 100644 template/customer/AccountTax.ftl create mode 100644 template/customer/AccountTelco.ftl create mode 100644 template/customer/AccountUserName.ftl create mode 100644 template/customer/AnonContactus.ftl create mode 100644 template/customer/FinAccountDetail.ftl create mode 100644 template/customer/MyAccountMenu.ftl create mode 100644 template/customer/NewCustomerAccount.ftl create mode 100644 template/customer/NewCustomerAddress.ftl create mode 100644 template/customer/NewCustomerEmail.ftl create mode 100644 template/customer/NewCustomerName.ftl create mode 100644 template/customer/NewCustomerTelco.ftl create mode 100644 template/customer/SerializedInventorySummary.ftl create mode 100644 template/customer/SubscriptionSummary.ftl create mode 100644 template/customer/changepassword.ftl create mode 100644 template/customer/customersurvey.ftl create mode 100644 template/customer/digitalproductedit.ftl create mode 100644 template/customer/digitalproductlist.ftl create mode 100644 template/customer/editcontactmech.ftl create mode 100644 template/customer/editcreditcard.ftl create mode 100644 template/customer/editeftaccount.ftl create mode 100644 template/customer/editgiftcard.ftl create mode 100644 template/customer/editperson.ftl create mode 100644 template/customer/giftcardbalance.ftl create mode 100644 template/customer/giftcardlink.ftl create mode 100644 template/customer/messagedetail.ftl create mode 100644 template/customer/messagelist.ftl create mode 100644 template/customer/miniSignUpForContactList.ftl create mode 100644 template/customer/newcustomer.ftl create mode 100644 template/customer/newmsg.ftl create mode 100644 template/customer/profile/EditBillToAddress.ftl create mode 100644 template/customer/profile/EditPostalAddress.ftl create mode 100644 template/customer/profile/EditProfile.ftl create mode 100644 template/customer/profile/EditShipToAddress.ftl create mode 100644 template/customer/profile/ManageAddress.ftl create mode 100644 template/customer/profile/NewCustomer.ftl create mode 100644 template/customer/profile/ViewProfile.ftl create mode 100644 template/customer/viewprofile.ftl create mode 100644 template/customer/viewreviews.ftl create mode 100644 template/data/content.ftl create mode 100644 template/data/topic.ftl create mode 100644 template/data/tree.ftl create mode 100644 template/email/ContactListEmailTemplate.ftl create mode 100644 template/email/ContactListSubscribeEmail.ftl create mode 100644 template/email/ContactListUnsubscribeEmail.ftl create mode 100644 template/email/ContactListUnsubscribeVerifyEmail.ftl create mode 100644 template/email/ContactListVerifyEmail.ftl create mode 100644 template/email/ContactUsEmail.ftl create mode 100644 template/email/OrderNoticeEmail.ftl create mode 100644 template/email/ShipmentNotificationEmail.ftl create mode 100644 template/email/emailpayretry.ftl create mode 100644 template/email/giftcardpurchase.ftl create mode 100644 template/email/giftcardreload.ftl create mode 100644 template/email/registration.ftl create mode 100644 template/email/returnaccept.ftl create mode 100644 template/email/returncancel.ftl create mode 100644 template/email/returncomplete.ftl create mode 100644 template/email/tellafriend.ftl create mode 100644 template/error/404.jsp create mode 100644 template/error/error.jsp create mode 100644 template/forum/ViewComboResponse.ftl create mode 100644 template/forum/bloglib.ftl create mode 100644 template/forum/createforumarticle.ftl create mode 100644 template/forum/createforumresponse.ftl create mode 100644 template/forum/editaddforumdata.ftl create mode 100644 template/forum/editaddimage.ftl create mode 100644 template/forum/editforumarticle.ftl create mode 100644 template/forum/editforuminfo.ftl create mode 100644 template/forum/forumPaging.ftl create mode 100644 template/forum/forums.ftl create mode 100644 template/forum/messageDisplay.ftl create mode 100644 template/forum/mostrecent.ftl create mode 100644 template/forum/showblog.ftl create mode 100644 template/forum/showforum.ftl create mode 100644 template/forum/showforumarticle.ftl create mode 100644 template/forum/showforumresponse.ftl create mode 100644 template/images/blog.css create mode 100644 template/images/checkoutProcess.js create mode 100644 template/images/productAdditionalView.js create mode 100644 template/images/profile.js create mode 100644 template/images/quickAnonCustSettings.js create mode 100644 template/images/remove.png create mode 100644 template/includes/container-end.ftl create mode 100644 template/includes/container-start.ftl create mode 100644 template/includes/ecom-header-bar.ftl create mode 100644 template/includes/ecom-header.ftl create mode 100644 template/includes/footer.ftl create mode 100644 template/includes/header.ftl create mode 100644 template/includes/headerHead.ftl create mode 100644 template/includes/language.ftl create mode 100644 template/includes/row-end.ftl create mode 100644 template/includes/row-start.ftl create mode 100644 template/login.ftl create mode 100644 template/main.ftl create mode 100644 template/order/CheckOutAddress.ftl create mode 100644 template/order/CheckOutPayOptions.ftl create mode 100644 template/order/CheckOutPlaceOrder.ftl create mode 100644 template/order/CheckOutShipOptions.ftl create mode 100644 template/order/CheckoutPayCreditCard.ftl create mode 100644 template/order/CheckoutPayEftAccount.ftl create mode 100644 template/order/CheckoutPayExtBilling.ftl create mode 100644 template/order/CheckoutPayExtCod.ftl create mode 100644 template/order/CheckoutPayExtOffline.ftl create mode 100644 template/order/CheckoutPayExtPayPal.ftl create mode 100644 template/order/CheckoutPayExtWorldPay.ftl create mode 100644 template/order/CheckoutPayMethodCreditCard.ftl create mode 100644 template/order/CheckoutPayMethodEftAccount.ftl create mode 100644 template/order/CheckoutPayMethodGiftCard.ftl create mode 100644 template/order/OnePageCheckoutProcess.ftl create mode 100644 template/order/Order.ftl create mode 100644 template/order/OrderHistoryDownloads.ftl create mode 100644 template/order/OrderHistoryShipped.ftl create mode 100644 template/order/OrderHistorySubmitted.ftl create mode 100644 template/order/ReviewAddress.ftl create mode 100644 template/order/ReviewItems.ftl create mode 100644 template/order/ReviewPayment.ftl create mode 100644 template/order/ReviewStatus.ftl create mode 100644 template/order/ShippingOptionAddEmail.ftl create mode 100644 template/order/ShippingOptionAllAtOnce.ftl create mode 100644 template/order/ShippingOptionGift.ftl create mode 100644 template/order/ShippingOptionPONumber.ftl create mode 100644 template/order/ShippingOptionSpecInstruction.ftl create mode 100644 template/order/anonymousCheckoutLinks.ftl create mode 100644 template/order/anonymoustrail.ftl create mode 100644 template/order/billsettings.ftl create mode 100644 template/order/ccinfo.ftl create mode 100644 template/order/checkoutpayment.ftl create mode 100644 template/order/checkoutreview.ftl create mode 100644 template/order/checkoutshippingaddress.ftl create mode 100644 template/order/checkoutshippingoptions.ftl create mode 100644 template/order/custsettings.ftl create mode 100644 template/order/eftinfo.ftl create mode 100644 template/order/gcinfo.ftl create mode 100644 template/order/genericaddress.ftl create mode 100644 template/order/optionsettings.ftl create mode 100644 template/order/ordercomplete.ftl create mode 100644 template/order/orderheader.ftl create mode 100644 template/order/orderhistory.ftl create mode 100644 template/order/orderitems.ftl create mode 100644 template/order/orderstatus.ftl create mode 100644 template/order/paymentinformation.ftl create mode 100644 template/order/paymentoptions.ftl create mode 100644 template/order/quickAnonCheckoutLinks.ftl create mode 100644 template/order/quickAnonCheckoutReview.ftl create mode 100644 template/order/quickAnonCustSettings.ftl create mode 100644 template/order/quickAnonOptionSettings.ftl create mode 100644 template/order/quickAnonOrderHeader.ftl create mode 100644 template/order/quickAnonPaymentInformation.ftl create mode 100644 template/order/requestreturn.ftl create mode 100644 template/order/shipsettings.ftl create mode 100644 template/order/splitship.ftl create mode 100644 template/order/startanoncheckout.ftl create mode 100644 template/product/ConfigProductDetail.ftl create mode 100644 template/product/ProductAddToOrder.ftl create mode 100644 template/product/ProductAddToShopList.ftl create mode 100644 template/product/ProductConfigurator.ftl create mode 100644 template/product/ProductCrossSell.ftl create mode 100644 template/product/ProductDaysToShip.ftl create mode 100644 template/product/ProductDetail.ftl create mode 100644 template/product/ProductDigitalDownload.ftl create mode 100644 template/product/ProductDimensions.ftl create mode 100644 template/product/ProductFeatureList.ftl create mode 100644 template/product/ProductImage.ftl create mode 100644 template/product/ProductLongDescription.ftl create mode 100644 template/product/ProductMetaData.ftl create mode 100644 template/product/ProductPieces.ftl create mode 100644 template/product/ProductPrice.ftl create mode 100644 template/product/ProductRelated.ftl create mode 100644 template/product/ProductReviews.ftl create mode 100644 template/product/ProductSummary.ftl create mode 100644 template/product/ProductSwatches.ftl create mode 100644 template/product/ProductTags.ftl create mode 100644 template/product/ProductTellaFriend.ftl create mode 100644 template/quote/CreateOrderQuote.ftl create mode 100644 template/quote/QuoteList.ftl create mode 100644 template/request/RequestList.ftl create mode 100644 template/request/requestInfo.ftl create mode 100644 template/request/requestRoles.ftl create mode 100644 template/requirePasswordChange.ftl create mode 100644 template/shoppinglist/editShoppingList.ftl create mode 100644 template/survey/genericresult.ftl create mode 100644 template/survey/miniresult.ftl create mode 100644 template/survey/minisurvey.ftl create mode 100644 testdef/oshopTests.xml create mode 100644 webapp/ecommerce/WEB-INF/controller.xml create mode 100644 webapp/ecommerce/WEB-INF/web.xml create mode 100644 webapp/ecommerce/index.jsp create mode 100644 webapp/ecommerce/makebogodata.jsp create mode 100644 webapp/ecommerce/robots.txt create mode 100644 webapp/oshop/README create mode 100644 webapp/oshop/WEB-INF/controller.xml create mode 100644 webapp/oshop/WEB-INF/web.xml create mode 100644 webapp/oshop/error/error.jsp create mode 100644 webapp/oshop/index.jsp create mode 100644 widget/BlogMenus.xml create mode 100644 widget/BlogScreens.xml create mode 100644 widget/BlogTemplates.xml create mode 100644 widget/BlogTrees.xml create mode 100644 widget/CartScreens.xml create mode 100644 widget/CatalogScreens.xml create mode 100644 widget/CommonScreens.xml create mode 100644 widget/ContentScreens.xml create mode 100644 widget/CustRequestScreens.xml create mode 100644 widget/CustomerScreens.xml create mode 100644 widget/EmailContactListScreens.xml create mode 100644 widget/EmailGiftCardScreens.xml create mode 100644 widget/EmailOrderScreens.xml create mode 100644 widget/EmailProductScreens.xml create mode 100644 widget/EmailReturnScreens.xml create mode 100644 widget/ForumScreens.xml create mode 100644 widget/ForumTrees.xml create mode 100644 widget/OrderScreens.xml create mode 100644 widget/ProductScreens.xml create mode 100644 widget/QuoteScreens.xml create mode 100644 widget/ShoppingListScreens.xml create mode 100644 widget/forms/BlogForms.xml create mode 100644 widget/forms/ContentForms.xml create mode 100644 widget/forms/ForumForms.xml create mode 100644 widget/forms/oshopForms.xml create mode 100644 widget/oshopMenus.xml create mode 100644 widget/oshopScreens.xml diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8dada3e --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + 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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..aeb4774 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ + + +# oshop +A bootstrap based ecommerce component for OFBiz diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..787fcbe --- /dev/null +++ b/build.xml @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/oshopUiLabels.xml b/config/oshopUiLabels.xml new file mode 100644 index 0000000..6593dd2 --- /dev/null +++ b/config/oshopUiLabels.xml @@ -0,0 +1,39 @@ + + + + + oshop Application + oshop应用程序 + oshop應用程式 + + + OFBiz: oshop + OFBiz: oshop + + + Part of the Apache OFBiz Family of Open Source Software + Un modulo della famiglia di software open source Apache OFBiz + 开源软件OFBiz的组成部分 + 開源軟體OFBiz的組成部分 + + + You are not allowed to view this page. + 不允许你浏览这个页面。 + 不允許您檢視這個頁面. + + diff --git a/data/helpdata/HELP_oshop.xml b/data/helpdata/HELP_oshop.xml new file mode 100644 index 0000000..8879179 --- /dev/null +++ b/data/helpdata/HELP_oshop.xml @@ -0,0 +1,26 @@ + + +
+ oshop Overview + The oshop Help file template. +
+ diff --git a/data/oshopDemoData.xml b/data/oshopDemoData.xml new file mode 100644 index 0000000..55a7a2a --- /dev/null +++ b/data/oshopDemoData.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data/oshopSecurityGroupDemoData.xml b/data/oshopSecurityGroupDemoData.xml new file mode 100644 index 0000000..be83074 --- /dev/null +++ b/data/oshopSecurityGroupDemoData.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + diff --git a/data/oshopSecurityPermissionSeedData.xml b/data/oshopSecurityPermissionSeedData.xml new file mode 100644 index 0000000..9bf0fb2 --- /dev/null +++ b/data/oshopSecurityPermissionSeedData.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + diff --git a/data/oshopSeedData.xml b/data/oshopSeedData.xml new file mode 100644 index 0000000..356ec5b --- /dev/null +++ b/data/oshopSeedData.xml @@ -0,0 +1,20 @@ + + + + + \ No newline at end of file diff --git a/documents/oshop.xml b/documents/oshop.xml new file mode 100644 index 0000000..ecc6fe7 --- /dev/null +++ b/documents/oshop.xml @@ -0,0 +1,32 @@ + + + + + <anchor xml:id="oshop"/>The oshop Component +
+ Introduction + + +
+ + +
diff --git a/dtd/readme b/dtd/readme new file mode 100644 index 0000000..2c8f06d --- /dev/null +++ b/dtd/readme @@ -0,0 +1 @@ +Put your component specific xsd files here. \ No newline at end of file diff --git a/entitydef/entitymodel.xml b/entitydef/entitymodel.xml new file mode 100644 index 0000000..aa5b17c --- /dev/null +++ b/entitydef/entitymodel.xml @@ -0,0 +1,28 @@ + + + + + + + Entity of oshop Component + None + + + + \ No newline at end of file diff --git a/lib/readme b/lib/readme new file mode 100644 index 0000000..b6e144a --- /dev/null +++ b/lib/readme @@ -0,0 +1 @@ +Put your component specific external libraries here. \ No newline at end of file diff --git a/ofbiz-component.xml b/ofbiz-component.xml new file mode 100644 index 0000000..853f644 --- /dev/null +++ b/ofbiz-component.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/patches/production/readme b/patches/production/readme new file mode 100644 index 0000000..76d03a1 --- /dev/null +++ b/patches/production/readme @@ -0,0 +1 @@ +Put your component specific patch references here. \ No newline at end of file diff --git a/patches/qa/readme b/patches/qa/readme new file mode 100644 index 0000000..76d03a1 --- /dev/null +++ b/patches/qa/readme @@ -0,0 +1 @@ +Put your component specific patch references here. \ No newline at end of file diff --git a/patches/test/readme b/patches/test/readme new file mode 100644 index 0000000..76d03a1 --- /dev/null +++ b/patches/test/readme @@ -0,0 +1 @@ +Put your component specific patch references here. \ No newline at end of file diff --git a/script/readme b/script/readme new file mode 100644 index 0000000..4aecab0 --- /dev/null +++ b/script/readme @@ -0,0 +1 @@ +Put your component specific scripts here. \ No newline at end of file diff --git a/servicedef/services.xml b/servicedef/services.xml new file mode 100644 index 0000000..7f6102a --- /dev/null +++ b/servicedef/services.xml @@ -0,0 +1,30 @@ + + + + oshop Services + + 1.0 + + + + Dummy service to prevent empty files and syntax error - Remove when the 1st real service will be added here + + + + \ No newline at end of file diff --git a/src/org/apache/ofbiz/ecommerce/Login.groovy b/src/org/apache/ofbiz/ecommerce/Login.groovy new file mode 100644 index 0000000..05681da --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/Login.groovy @@ -0,0 +1,34 @@ +/* + * 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.*; +import org.ofbiz.common.CommonWorkers; +import org.ofbiz.webapp.control.*; + +context.autoUserLogin = session.getAttribute("autoUserLogin"); +context.autoLogoutUrl = LoginWorker.makeLoginUrl(request, "autoLogout"); + +previousParams = session.getAttribute("_PREVIOUS_PARAMS_"); +if (previousParams) { + previousParams = UtilHttp.stripNamedParamsFromQueryString(previousParams, ["USERNAME", "PASSWORD"]); + previousParams = "?" + previousParams; +} else { + previousParams = ""; +} +context.previousParams = previousParams; diff --git a/src/org/apache/ofbiz/ecommerce/Main.groovy b/src/org/apache/ofbiz/ecommerce/Main.groovy new file mode 100644 index 0000000..54c4663 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/Main.groovy @@ -0,0 +1,42 @@ +/* + * 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.product.catalog.*; + +catalogId = CatalogWorker.getCurrentCatalogId(request); +promoCat = CatalogWorker.getCatalogPromotionsCategoryId(request, catalogId); +request.setAttribute("productCategoryId", promoCat); + +/* NOTE DEJ20070220 woah, this is doing weird stuff like always showing the last viewed category when going to the main page; + * It appears this was done for to make it go back to the desired category after logging in, but this is NOT the place to do that, + * and IMO this is an unacceptable side-effect. + * + * The whole thing should be re-thought, and should preferably NOT use a custom session variable or try to go through the main page. + * + * NOTE: see section commented out in Category.groovy for the other part of this. + * + * NOTE JLR 20070221 this should be done using the same method than in add to cart. I will do it like that and remove all this after. + * +productCategoryId = session.getAttribute("productCategoryId"); +if (!productCategoryId) { + request.setAttribute("productCategoryId", promoCat); +} else { + request.setAttribute("productCategoryId", productCategoryId); +} +*/ diff --git a/src/org/apache/ofbiz/ecommerce/cart/ShowCart.groovy b/src/org/apache/ofbiz/ecommerce/cart/ShowCart.groovy new file mode 100644 index 0000000..ac25b74 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/cart/ShowCart.groovy @@ -0,0 +1,78 @@ +/* + * 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.UtilMisc; +import org.ofbiz.product.catalog.CatalogWorker; +import org.ofbiz.order.shoppingcart.product.ProductDisplayWorker; +import org.ofbiz.order.shoppingcart.ShoppingCartEvents; +import org.ofbiz.product.store.ProductStoreWorker; +import org.ofbiz.entity.condition.*; +import org.ofbiz.entity.util.EntityUtil; + +// Get the Cart and Prepare Size +shoppingCart = ShoppingCartEvents.getCartObject(request); +context.shoppingCartSize = shoppingCart?.size() ?: 0; +context.shoppingCart = shoppingCart; + +context.productStore = ProductStoreWorker.getProductStore(request); + +if (parameters.add_product_id) { // check if a parameter is passed + add_product_id = parameters.add_product_id; + product = from("Product").where("productId", add_product_id).cache(true).queryOne(); + context.product = product; +} + +// get all the possible gift wrap options +allgiftWraps = from("ProductFeature").where("productFeatureTypeId", "GIFT_WRAP").orderBy("defaultSequenceNum").queryList(); +context.allgiftWraps = allgiftWraps; + +// get the shopping lists for the logged in user +if (userLogin) { + allShoppingLists = from("ShoppingList").where(EntityCondition.makeCondition("partyId", EntityOperator.EQUALS, userLogin.partyId), + EntityCondition.makeCondition("listName", EntityOperator.NOT_EQUAL, "auto-save")).orderBy("listName").queryList(); + context.shoppingLists = allShoppingLists; +} + +// Get Cart Associated Products Data +associatedProducts = ProductDisplayWorker.getRandomCartProductAssoc(request, true); +context.associatedProducts = associatedProducts; + +context.contentPathPrefix = CatalogWorker.getContentPathPrefix(request); + +//Get Cart Items +shoppingCartItems = shoppingCart.items(); + +if(shoppingCartItems) { + shoppingCartItems.each { shoppingCartItem -> + if (shoppingCartItem.getProductId()) { + if (shoppingCartItem.getParentProductId()) { + parentProductId = shoppingCartItem.getParentProductId(); + } else { + parentProductId = shoppingCartItem.getProductId(); + } + context.parentProductId = parentProductId; + } + productCategoryMembers = from("ProductCategoryMember").where("productId", parentProductId).queryList(); + if (productCategoryMembers) { + productCategoryMember = EntityUtil.getFirst(productCategoryMembers); + productCategory = productCategoryMember.getRelatedOne("ProductCategory", false); + context.productCategory = productCategory; + } + } +} diff --git a/src/org/apache/ofbiz/ecommerce/cart/ShowPromoText.groovy b/src/org/apache/ofbiz/ecommerce/cart/ShowPromoText.groovy new file mode 100644 index 0000000..c601a1b --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/cart/ShowPromoText.groovy @@ -0,0 +1,58 @@ +/* + * 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.UtilMisc; +import org.ofbiz.order.shoppingcart.product.ProductPromoWorker; + +promoShowLimit = 3; + +//Get Promo Text Data +productPromosAll = ProductPromoWorker.getStoreProductPromos(delegator, dispatcher, request); +//Make sure that at least one promo has non-empty promoText +showPromoText = false; +promoToShow = 0; +productPromosAllShowable = new ArrayList(productPromosAll.size()); +productPromosAll.each { productPromo -> + promoText = productPromo.promoText; + + if (promoText && !"N".equals(productPromo.showToCustomer)) { + showPromoText = true; + promoToShow++; + productPromosAllShowable.add(productPromo); + } +} + +// now slim it down to promoShowLimit +productPromosRandomTemp = new ArrayList(productPromosAllShowable); +productPromos = null; +if (productPromosRandomTemp.size() > promoShowLimit) { + productPromos = new ArrayList(promoShowLimit); + for (i = 0; i < promoShowLimit; i++) { + randomIndex = Math.round(java.lang.Math.random() * (productPromosRandomTemp.size() - 1)) as int; + productPromos.add(productPromosRandomTemp.remove(randomIndex)); + } +} else { + productPromos = productPromosRandomTemp; +} + +context.promoShowLimit = promoShowLimit; +context.productPromosAllShowable = productPromosAllShowable; +context.productPromos = productPromos; +context.showPromoText = showPromoText; +context.promoToShow = promoToShow; diff --git a/src/org/apache/ofbiz/ecommerce/catalog/BestSellingCategory.groovy b/src/org/apache/ofbiz/ecommerce/catalog/BestSellingCategory.groovy new file mode 100644 index 0000000..461b5b7 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/catalog/BestSellingCategory.groovy @@ -0,0 +1,42 @@ +/* + * 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.UtilValidate; +import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.product.catalog.*; +import org.ofbiz.product.category.*; + +catalogId = CatalogWorker.getCurrentCatalogId(request); +bestSellerCates = []; + +if (UtilValidate.isNotEmpty(catalogId)) { + prodCatalogCategoryList = CatalogWorker.getProdCatalogCategories(request, catalogId, "PCCT_BEST_SELL"); + if (prodCatalogCategoryList.size() > 0) { + for (int i = 0; i < prodCatalogCategoryList.size(); i++) { + prodCatalogCategory = prodCatalogCategoryList[i]; + productCategoryId = prodCatalogCategory.getString("productCategoryId"); + childCategoryList = CategoryWorker.getRelatedCategoriesRet(request, "childCategoryList", productCategoryId, true); + if (childCategoryList.size() > 0) { + bestSellerCates.add(childCategoryList); + } + } + } +} + +context.productCategoryList = bestSellerCates; diff --git a/src/org/apache/ofbiz/ecommerce/catalog/LayeredNavigation.groovy b/src/org/apache/ofbiz/ecommerce/catalog/LayeredNavigation.groovy new file mode 100644 index 0000000..5b00fe8 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/catalog/LayeredNavigation.groovy @@ -0,0 +1,138 @@ +/* + * 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.UtilHttp; +import org.ofbiz.entity.util.EntityUtil; +import org.ofbiz.product.catalog.CatalogWorker; +import org.ofbiz.product.category.CategoryContentWrapper; +import org.ofbiz.product.category.CategoryWorker; +import org.ofbiz.product.product.ProductSearch; +import org.ofbiz.product.product.ProductSearchSession; + +searchCategoryId = parameters.searchCategoryId; +if (!searchCategoryId) { + searchCategoryId = context.productCategoryId; +} +if (searchCategoryId) { + currentSearchCategory = from("ProductCategory").where("productCategoryId", searchCategoryId).queryOne(); + CategoryWorker.getRelatedCategories(request, "subCategoryList", searchCategoryId, false); + subCategoryList = request.getAttribute("subCategoryList"); + CategoryContentWrapper categoryContentWrapper = new CategoryContentWrapper(currentSearchCategory, request); + context.currentSearchCategory = currentSearchCategory; + context.categoryContentWrapper = categoryContentWrapper; +} +productCategoryId = context.productCategoryId; +if (productCategoryId) { + context.productCategory = from("ProductCategory").where("productCategoryId", productCategoryId).queryOne(); + parameters.SEARCH_CATEGORY_ID = productCategoryId; +} + +if (!parameters.clearSearch || !"N".equals(parameters.clearSearch)) { + ProductSearchSession.searchClear(session); +} + +ProductSearchSession.processSearchParameters(parameters, request); +prodCatalogId = CatalogWorker.getCurrentCatalogId(request); +result = ProductSearchSession.getProductSearchResult(request, delegator, prodCatalogId); + +context.index = ProductSearchSession.getCategoryCostraintIndex(session); + +searchConstraintList = ProductSearchSession.getProductSearchOptions(session).getConstraintList(); + +if (searchCategoryId) { + productCategoryRollups = from("ProductCategoryRollup").where("productCategoryId", searchCategoryId).filterByDate().queryList(); + previousCategoryId = null; + if (productCategoryRollups) { + for (categoryRollup in productCategoryRollups) { + categoryConstraint = new ProductSearch.CategoryConstraint(categoryRollup.parentProductCategoryId, true, false); + if (searchConstraintList.contains(categoryConstraint)) { + previousCategoryId = categoryRollup.parentProductCategoryId; + context.previousCategoryId = previousCategoryId; + } + } + } +} + +context.showSubCats = true; +if (subCategoryList) { + thisSubCategoryList = []; + subCategoryList.each { subCategory -> + categoryCount = ProductSearchSession.getCountForProductCategory(subCategory.productCategoryId, session, delegator); + if (categoryCount > 0) { + subCategoryContentWrapper = new CategoryContentWrapper(subCategory, request); + thisSubCategoryList.add([productCategoryId: subCategory.productCategoryId, categoryName: subCategory.categoryName, count: categoryCount, categoryContentWrapper: subCategoryContentWrapper]); + } + } + if (thisSubCategoryList) { + context.subCategoryList = thisSubCategoryList; + } else { + context.showSubCats = false; + } +} else { + context.showSubCats = false; +} + +context.showColors = true; +colors = ProductSearchSession.listCountByFeatureForType("COLOR", session, delegator); +colorFeatureType = from("ProductFeatureType").where("productFeatureTypeId", "COLOR").queryOne(); +if (colors) { + colors.each { color -> + featureConstraint = new ProductSearch.FeatureConstraint(color.productFeatureId, false); + if (searchConstraintList.contains(featureConstraint)) { + context.showColors=false; + } + } +} else { + context.showColors = false; +} +if (context.showColors) { + context.colors = colors; + context.colorFeatureType = colorFeatureType; +} + +availablePriceRangeList = [[low: "0", high: "10"], [low: "10", high: "20"], [low: "20", high: "30"], [low: "30", high: "40"], [low: "40", high: "50"], [low: "50", high: "60"], [low: "60", high: "70"], [low: "70", high: "80"], [low: "80", high: "90"], [low: "90", high: "100"]]; +priceRangeList = []; +context.showPriceRange = true; +availablePriceRangeList.each { priceRange -> + priceRangeConstraint = new ProductSearch.ListPriceRangeConstraint(new BigDecimal(priceRange.low), new BigDecimal(priceRange.high), UtilHttp.getCurrencyUom(request)); + if (searchConstraintList.contains(priceRangeConstraint)) { + context.showPriceRange = false; + } else { + priceRangeCount = ProductSearchSession.getCountForListPriceRange(new BigDecimal(priceRange.low), new BigDecimal(priceRange.high), session, delegator); + if (priceRangeCount != 0) { + priceRangeList.add([low: priceRange.low, high: priceRange.high, count: priceRangeCount]); + } + } +} +if (!priceRangeList) { + context.showPriceRange = false; +} +if (context.showPriceRange) { + context.priceRangeList = priceRangeList; +} + +context.productIds = result.productIds; +context.viewIndex = result.viewIndex; +context.viewSize = result.viewSize; +context.listSize = result.listSize; +context.lowIndex = result.lowIndex; +context.highIndex = result.highIndex; +context.paging = result.paging; +context.previousViewSize = result.previousViewSize; +context.searchConstraintStrings = result.searchConstraintStrings; diff --git a/src/org/apache/ofbiz/ecommerce/catalog/MiniProductSummary.groovy b/src/org/apache/ofbiz/ecommerce/catalog/MiniProductSummary.groovy new file mode 100644 index 0000000..758aae5 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/catalog/MiniProductSummary.groovy @@ -0,0 +1,91 @@ +/* + * 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 java.math.BigDecimal; +import java.util.Map; + +import org.ofbiz.base.util.*; +import org.ofbiz.entity.*; +import org.ofbiz.service.*; +import org.ofbiz.product.product.ProductContentWrapper; +import org.ofbiz.product.config.ProductConfigWorker; +import org.ofbiz.product.catalog.*; +import org.ofbiz.product.store.*; +import org.ofbiz.order.shoppingcart.*; +import org.ofbiz.webapp.website.WebSiteWorker; + +miniProduct = request.getAttribute("miniProduct"); +optProductId = request.getAttribute("optProductId"); +webSiteId = WebSiteWorker.getWebSiteId(request); +prodCatalogId = CatalogWorker.getCurrentCatalogId(request); +productStoreId = ProductStoreWorker.getProductStoreId(request); +cart = ShoppingCartEvents.getCartObject(request); +context.remove("totalPrice"); + +if (optProductId) { + miniProduct = from("Product").where("productId", optProductId).queryOne(); +} + +if (miniProduct && productStoreId && prodCatalogId ) { + // calculate the "your" price + priceParams = [product : miniProduct, + prodCatalogId : prodCatalogId, + webSiteId : webSiteId, + currencyUomId : cart.getCurrency(), + autoUserLogin : autoUserLogin, + productStoreId : productStoreId]; + if (userLogin) priceParams.partyId = userLogin.partyId; + priceResult = runService('calculateProductPrice', priceParams); + // returns: isSale, price, orderItemPriceInfos + context.priceResult = priceResult; + // Check if Price has to be displayed with tax + if (productStore.get("showPricesWithVatTax").equals("Y")) { + Map priceMap = runServic('calcTaxForDisplay', ["basePrice": priceResult.get("price"), "locale": locale, "productId": optProductId, "productStoreId": productStoreId]); + context.price = priceMap.get("priceWithTax"); + } else { + context.price = priceResult.get("price"); + } + + // get aggregated product totalPrice + if ("AGGREGATED".equals(miniProduct.productTypeId) || "AGGREGATED_SERVICE".equals(miniProduct.productTypeId)) { + configWrapper = ProductConfigWorker.getProductConfigWrapper(optProductId, cart.getCurrency(), request); + if (configWrapper) { + configWrapper.setDefaultConfig(); + // Check if Config Price has to be displayed with tax + if (productStore.get("showPricesWithVatTax").equals("Y")) { + BigDecimal totalPriceNoTax = configWrapper.getTotalPrice(); + Map totalPriceMap = runService('calcTaxForDisplay', ["basePrice": totalPriceNoTax, "locale": locale, "productId": optProductId, "productStoreId": productStoreId]); + context.totalPrice = totalPriceMap.get("priceWithTax"); + } else { + context.totalPrice = configWrapper.getTotalPrice(); + } + } + } + + context.miniProduct = miniProduct; + context.nowTimeLong = nowTimestamp.getTime(); + + context.miniProdFormName = request.getAttribute("miniProdFormName"); + context.miniProdQuantity = request.getAttribute("miniProdQuantity"); + + // make the miniProductContentWrapper + ProductContentWrapper miniProductContentWrapper = new ProductContentWrapper(miniProduct, request); + context.miniProductContentWrapper = miniProductContentWrapper; + +} diff --git a/src/org/apache/ofbiz/ecommerce/catalog/MiniReorderProds.groovy b/src/org/apache/ofbiz/ecommerce/catalog/MiniReorderProds.groovy new file mode 100644 index 0000000..353fd3b --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/catalog/MiniReorderProds.groovy @@ -0,0 +1,24 @@ +/* + * 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.order.shoppingcart.product.ProductDisplayWorker; + +reorderProductResults = ProductDisplayWorker.getQuickReorderProducts(request); +context.reorderProducts = reorderProductResults.products; +context.reorderQuantities = reorderProductResults.quantities; diff --git a/src/org/apache/ofbiz/ecommerce/catalog/PopularTags.groovy b/src/org/apache/ofbiz/ecommerce/catalog/PopularTags.groovy new file mode 100644 index 0000000..47143e3 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/catalog/PopularTags.groovy @@ -0,0 +1,82 @@ +/* + * 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 java.util.List; +import org.ofbiz.entity.*; +import org.ofbiz.entity.condition.*; +import org.ofbiz.entity.util.*; +import org.ofbiz.entity.util.EntityUtil; +import org.ofbiz.entity.transaction.* +import org.ofbiz.base.util.*; +import org.ofbiz.base.util.string.*; +import org.ofbiz.content.content.*; +import org.apache.commons.lang.StringEscapeUtils; +import org.ofbiz.entity.util.EntityUtilProperties; + +int minFontSize = Integer.parseInt(EntityUtilProperties.getPropertyValue("ecommerce", "tagcloud.min.fontsize", delegator)); +int maxFontSize = Integer.parseInt(EntityUtilProperties.getPropertyValue("ecommerce", "tagcloud.max.fontsize", delegator)); +int limitTagCloud = Integer.parseInt(EntityUtilProperties.getPropertyValue("ecommerce", "tagcloud.limit", delegator)); + +tagCloudList = [] as LinkedList; +tagList = [] as LinkedList; + +productKeywords = select("keyword", "keywordTypeId", "statusId") + .from("ProductKeyword") + .where(keywordTypeId : "KWT_TAG", statusId : "KW_APPROVED") + .orderBy("keyword") + .distinct(true) + .queryList(); + +if (UtilValidate.isNotEmpty(productKeywords)) { + productKeywords.each { productKeyword -> + productTags = from("ProductKeyword").where("keyword", productKeyword.keyword, "keywordTypeId", "KWT_TAG", "statusId", "KW_APPROVED").queryList(); + searchResult = [:]; + searchResult.tag = productKeyword.keyword; + searchResult.countTag = productTags.size(); + tagList.add(searchResult); + } +} + +if (tagList) { + int tag = 0; + tagList.sort{ a,b -> b.countTag <=> a.countTag }; + if (tagList.size() < limitTagCloud) { + limitTagCloud = tagList.size(); + } + int maxResult = tagList[0].countTag; + int minResult = tagList[limitTagCloud - 1].countTag; + tagList.each { tagCloud -> + if (tag < limitTagCloud) { + tagCloudOfbizInfo = [:]; + double weight = 0; + if ((maxResult - minResult) > 0) { + weight = (tagCloud.countTag - minResult) / (maxResult - minResult); + } + double fontSize = minFontSize + ((maxFontSize - minFontSize) * weight); + tagCloudOfbizInfo.tag = tagCloud.tag; + tagCloudOfbizInfo.fontSize = fontSize; + tagCloudList.add(tagCloudOfbizInfo); + tag++; + } + } +} + +tagCloudList = tagCloudList.sort{it.tag} + +context.tagCloudList = tagCloudList; diff --git a/src/org/apache/ofbiz/ecommerce/catalog/ProductCategories.groovy b/src/org/apache/ofbiz/ecommerce/catalog/ProductCategories.groovy new file mode 100644 index 0000000..596df18 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/catalog/ProductCategories.groovy @@ -0,0 +1,94 @@ +/* + * 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. + */ + +/* + * This script is also referenced by the ecommerce's screens and + * should not contain order component's specific code. + */ +import org.ofbiz.entity.util.EntityUtil; + +import org.ofbiz.base.util.*; +import org.ofbiz.product.catalog.*; +import org.ofbiz.product.category.*; +import org.ofbiz.entity.*; + +List fillTree(rootCat ,CatLvl, parentCategoryId) { + if(rootCat) { + rootCat.sort{ it.productCategoryId } + def listTree = []; + for(root in rootCat) { + preCatChilds = from("ProductCategoryRollup").where("parentProductCategoryId", root.productCategoryId).queryList(); + catChilds = EntityUtil.getRelated("CurrentProductCategory",null,preCatChilds,false); + def childList = []; + + // CatLvl uses for identify the Category level for display different css class + if(catChilds) { + if(CatLvl==2) + childList = fillTree(catChilds,CatLvl+1, parentCategoryId.replaceAll("/", "")+'/'+root.productCategoryId); + // replaceAll and '/' uses for fix bug in the breadcrum for href of category + else if(CatLvl==1) + childList = fillTree(catChilds,CatLvl+1, parentCategoryId.replaceAll("/", "")+root.productCategoryId); + else + childList = fillTree(catChilds,CatLvl+1, parentCategoryId+'/'+root.productCategoryId); + } + + productsInCat = from("ProductCategoryAndMember").where("productCategoryId", root.productCategoryId).queryList(); + + // Display the category if this category containing products or contain the category that's containing products + if(productsInCat || childList) { + def rootMap = [:]; + category = from("ProductCategory").where("productCategoryId", root.productCategoryId).queryOne(); + categoryContentWrapper = new CategoryContentWrapper(category, request); + context.title = categoryContentWrapper.get("CATEGORY_NAME", "html"); + categoryDescription = categoryContentWrapper.get("DESCRIPTION", "html"); + + if(categoryContentWrapper.get("CATEGORY_NAME", "html").toString()) + rootMap["categoryName"] = categoryContentWrapper.get("CATEGORY_NAME", "html"); + else + rootMap["categoryName"] = root.categoryName; + + if(categoryContentWrapper.get("CATEGORY_NAME", "html").toString()) + rootMap["categoryDescription"] = categoryContentWrapper.get("DESCRIPTION", "html"); + else + rootMap["categoryDescription"] = root.description; + + rootMap["productCategoryId"] = root.productCategoryId; + rootMap["parentCategoryId"] = parentCategoryId; + rootMap["child"] = childList; + + listTree.add(rootMap); + } + } + return listTree; + } +} + +CategoryWorker.getRelatedCategories(request, "topLevelList", CatalogWorker.getCatalogTopCategoryId(request, CatalogWorker.getCurrentCatalogId(request)), true); +curCategoryId = parameters.category_id ?: parameters.CATEGORY_ID ?: ""; +request.setAttribute("curCategoryId", curCategoryId); +CategoryWorker.setTrail(request, curCategoryId); + +categoryList = request.getAttribute("topLevelList"); +if (categoryList) { + catContentWrappers = [:]; + CategoryWorker.getCategoryContentWrappers(catContentWrappers, categoryList, request); + context.catContentWrappers = catContentWrappers; + completedTree = fillTree(categoryList, 1, ""); + context.completedTree = completedTree; +} diff --git a/src/org/apache/ofbiz/ecommerce/catalog/ajaxbreadcrumbs.groovy b/src/org/apache/ofbiz/ecommerce/catalog/ajaxbreadcrumbs.groovy new file mode 100644 index 0000000..34a4cb5 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/catalog/ajaxbreadcrumbs.groovy @@ -0,0 +1,49 @@ +/* + * 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.product.product.ProductContentWrapper; +import org.ofbiz.product.category.*; +import org.ofbiz.base.util.UtilValidate; + +parentCategoryStr = parameters.parentCategoryStr; +if(!UtilValidate.isEmpty(parentCategoryStr)) { + pathList = parentCategoryStr.split('/'); + cateList = []; + pathTemp = ''; + for(path in pathList) { + cateMap = [:]; + category = from("ProductCategory").where("productCategoryId", path).queryOne(); + categoryContentWrapper = new CategoryContentWrapper(category, request); + + pathTemp = pathTemp + path; + cateMap.title = categoryContentWrapper.get("DESCRIPTION", "html"); + cateMap.productCategoryId = category.productCategoryId; + cateMap.parentCategory = pathTemp; + + cateList.add(cateMap); + + pathTemp = pathTemp + '/'; + } + + context.productCategoryTrail = cateList; +} +currentCategory = from("ProductCategory").where("productCategoryId", productCategoryId).queryOne(); +currentCategoryContentWrapper = new CategoryContentWrapper(currentCategory, request); +context.currentCategoryName = currentCategoryContentWrapper.get("CATEGORY_NAME", "html"); +context.currentCategoryDescription = currentCategoryContentWrapper.get("DESCRIPTION", "html"); +context.currentCategoryId = productCategoryId; diff --git a/src/org/apache/ofbiz/ecommerce/content/AdvancedSearchPrep.groovy b/src/org/apache/ofbiz/ecommerce/content/AdvancedSearchPrep.groovy new file mode 100644 index 0000000..deff982 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/content/AdvancedSearchPrep.groovy @@ -0,0 +1,40 @@ +/* + * 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.*; +import org.ofbiz.product.catalog.*; +import org.ofbiz.product.feature.*; +import org.ofbiz.product.product.*; + +productFeaturesByTypeMap = ParametricSearch.getAllFeaturesByType(delegator, 2000); +productFeatureTypeIdsOrdered = new ArrayList(new TreeSet(productFeaturesByTypeMap.keySet())); + +searchOperator = parameters.SEARCH_OPERATOR; +if (!"AND".equals(searchOperator) && !"OR".equals(searchOperator)) { + searchOperator = "OR"; +} + +searchConstraintStrings = ProductSearchSession.searchGetConstraintStrings(false, session, delegator); +searchSortOrderString = ProductSearchSession.searchGetSortOrderString(false, request); + +context.productFeaturesByTypeMap = productFeaturesByTypeMap; +context.productFeatureTypeIdsOrdered = productFeatureTypeIdsOrdered; +context.searchOperator = searchOperator; +context.searchConstraintStrings = searchConstraintStrings; +context.searchSortOrderString = searchSortOrderString; diff --git a/src/org/apache/ofbiz/ecommerce/content/ContentPrep.groovy b/src/org/apache/ofbiz/ecommerce/content/ContentPrep.groovy new file mode 100644 index 0000000..76d74fe --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/content/ContentPrep.groovy @@ -0,0 +1,20 @@ +/* + * 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. + */ + +context.contentId = parameters.cid ?: parameters.contentId; diff --git a/src/org/apache/ofbiz/ecommerce/content/Mrv.groovy b/src/org/apache/ofbiz/ecommerce/content/Mrv.groovy new file mode 100644 index 0000000..26d40d1 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/content/Mrv.groovy @@ -0,0 +1,71 @@ +/* + * 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 java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; + +import org.ofbiz.base.util.*; +import org.ofbiz.entity.*; +import org.ofbiz.security.*; +import org.ofbiz.service.*; +import org.ofbiz.entity.model.*; +import org.ofbiz.widget.renderer.html.HtmlFormWrapper; +import org.ofbiz.base.util.collections.LifoSet; + +import javax.servlet.*; +import javax.servlet.http.*; + +entityName = "ContentDataResourceView"; +lookupCaches = session.getAttribute("lookupCaches"); + +if (!lookupCaches) { + lookupCaches = [:]; + session.setAttribute("lookupCaches", lookupCaches); +} +lifoSet = lookupCaches[entityName]; + +if (!lifoSet) { + lifoSet = new LifoSet(10); + lookupCaches.ContentAssocDataResourceViewFrom = lifoSet; +} + +sz = lifoSet.size(); +contentIdKey = null; +mrvList = []; + +lifoSet.each { pk0 -> + pk = pk0.getPrimaryKey(); + gv = from(pk.getEntityName()).where(pk).cache(true).queryOne(); + if (gv) { + arr = [gv.contentId, gv.contentName] as String[]; + mrvList.add(arr); + } else { + // should handle errors in some other way; this does not provide any tracing; impossible to locat + // where the error actually occurred + //Debug.logError("findOne on " + pk + " returned null"); + } +} +context.put("mrvList", mrvList); diff --git a/src/org/apache/ofbiz/ecommerce/content/Search.groovy b/src/org/apache/ofbiz/ecommerce/content/Search.groovy new file mode 100644 index 0000000..9f97520 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/content/Search.groovy @@ -0,0 +1,115 @@ +/* + * 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.apache.lucene.analysis.Analyzer +import org.apache.lucene.analysis.standard.StandardAnalyzer +import org.apache.lucene.document.Document +import org.apache.lucene.index.Term +import org.apache.lucene.queryparser.classic.QueryParser +import org.apache.lucene.store.FSDirectory +import org.ofbiz.base.util.Debug +import org.ofbiz.base.util.UtilHttp +import org.ofbiz.content.search.SearchWorker +import org.ofbiz.product.feature.ParametricSearch +import org.ofbiz.widget.renderer.html.HtmlFormWrapper +import org.apache.lucene.search.* +import org.apache.lucene.index.DirectoryReader +import org.apache.lucene.store.Directory + +paramMap = UtilHttp.getParameterMap(request); +queryLine = paramMap.queryLine.toString(); +//Debug.logInfo("in search, queryLine:" + queryLine, ""); + +formDefFile = page.formDefFile; +queryFormName = page.queryFormName; +//Debug.logInfo("in search, queryFormName:" + queryFormName, ""); +queryWrapper = new HtmlFormWrapper(formDefFile, queryFormName, request, response); +context.queryWrapper = queryWrapper; + +listFormName = page.listFormName; +//Debug.logInfo("in search, listFormName:" + listFormName, ""); +listWrapper = new HtmlFormWrapper(formDefFile, listFormName, request, response); +context.listWrapper = listWrapper; +siteId = paramMap.siteId ?: "WebStoreCONTENT"; +//Debug.logInfo("in search, siteId:" + siteId, ""); +featureIdByType = ParametricSearch.makeFeatureIdByTypeMap(paramMap); +//Debug.logInfo("in search, featureIdByType:" + featureIdByType, ""); + +combQuery = new BooleanQuery(); +Directory directory = FSDirectory.open(new File(SearchWorker.getIndexPath("content"))); +DirectoryReader reader = DirectoryReader.open(directory); +IndexSearcher searcher = null; +Analyzer analyzer = null; + +try { + searcher = new IndexSearcher(reader); + analyzer = new StandardAnalyzer(SearchWorker.LUCENE_VERSION); +} catch (java.io.FileNotFoundException e) { + Debug.logError(e, "Search.groovy"); + request.setAttribute("errorMsgReq", "No index file exists."); +} +termQuery = new TermQuery(new Term("site", siteId.toString())); +combQuery.add(termQuery, BooleanClause.Occur.MUST); +//Debug.logInfo("in search, termQuery:" + termQuery.toString(), ""); + +//Debug.logInfo("in search, combQuery(1):" + combQuery, ""); +if (queryLine && analyzer) { + Query query = null; + QueryParser parser = new QueryParser(SearchWorker.LUCENE_VERSION, "content", analyzer); + query = parser.parse(queryLine); + combQuery.add(query, BooleanClause.Occur.MUST); +} + +if (featureIdByType) { + featureQuery = new BooleanQuery(); + featuresRequired = BooleanClause.Occur.MUST; + if ("any".equals(paramMap.anyOrAll)) { + featuresRequired = BooleanClause.Occur.SHOULD; + } + + if (featureIdByType) { + featureIdByType.each { key, value -> + termQuery = new TermQuery(new Term("feature", value)); + featureQuery.add(termQuery, featuresRequired); + //Debug.logInfo("in search searchFeature3, termQuery:" + termQuery.toString(), ""); + } + } + combQuery.add(featureQuery, featuresRequired); +} + +if (searcher) { + Debug.logInfo("in search searchFeature3, combQuery:" + combQuery.toString(), ""); + TopScoreDocCollector collector = TopScoreDocCollector.create(100, false); //defaulting to 100 results + searcher.search(combQuery, collector); + ScoreDoc[] hits = collector.topDocs().scoreDocs; + Debug.logInfo("in search, hits:" + collector.getTotalHits(), ""); + + contentList = [] as ArrayList; + hitSet = [:] as HashSet; + for (int start = 0; start < collector.getTotalHits(); start++) { + Document doc = searcher.doc(hits[start].doc) + contentId = doc.get("contentId"); + content = from("Content").where("contentId", contentId).cache(true).queryOne(); + if (!hitSet.contains(contentId)) { + contentList.add(content); + hitSet.add(contentId); + } + } + listWrapper.putInContext("queryResults", contentList); +} diff --git a/src/org/apache/ofbiz/ecommerce/customer/ChangePassword.groovy b/src/org/apache/ofbiz/ecommerce/customer/ChangePassword.groovy new file mode 100644 index 0000000..ef363a4 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/customer/ChangePassword.groovy @@ -0,0 +1,37 @@ +/* + * 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 java.util.HashMap; +import org.ofbiz.base.util.UtilHttp; + +tryEntity = true; +errorMessage = parameters._ERROR_MESSAGE_; +if (errorMessage) { + tryEntity = false; +} + +donePage = parameters.DONE_PAGE ?: "viewprofile"; + +userLoginData = userLogin; +if (!tryEntity) userLoginData = UtilHttp.getParameterMap(request); +if (!userLoginData) userLoginData = [:]; + +context.donePage = donePage; +context.userLoginData = userLoginData; + diff --git a/src/org/apache/ofbiz/ecommerce/customer/ContactList.groovy b/src/org/apache/ofbiz/ecommerce/customer/ContactList.groovy new file mode 100644 index 0000000..0513df0 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/customer/ContactList.groovy @@ -0,0 +1,60 @@ +/* + * 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 java.lang.*; +import java.util.*; +import org.ofbiz.base.util.*; +import org.ofbiz.entity.*; +import org.ofbiz.entity.util.*; +import org.ofbiz.entity.condition.*; +import org.ofbiz.party.contact.ContactMechWorker; +import org.ofbiz.product.store.ProductStoreWorker; +import org.ofbiz.webapp.website.WebSiteWorker; +import org.ofbiz.accounting.payment.PaymentWorker; + +/*publicEmailContactLists = delegator.findByAnd("ContactList", [isPublic : "Y", contactMechTypeId : "EMAIL_ADDRESS"], ["contactListName"], false); +context.publicEmailContactLists = publicEmailContactLists;*/ + +webSiteId = WebSiteWorker.getWebSiteId(request); +exprList = []; +exprListThruDate = []; +exprList.add(EntityCondition.makeCondition("webSiteId", EntityOperator.EQUALS, webSiteId)); +exprListThruDate.add(EntityCondition.makeCondition("thruDate", EntityOperator.EQUALS, null)); +exprListThruDate.add(EntityCondition.makeCondition("thruDate", EntityOperator.GREATER_THAN_EQUAL_TO, UtilDateTime.nowTimestamp())); +orCond = EntityCondition.makeCondition(exprListThruDate, EntityOperator.OR); +exprList.add(orCond); +webSiteContactList = from("WebSiteContactList").where(exprList).queryList(); + +publicEmailContactLists = []; +webSiteContactList.each { webSiteContactList -> + contactList = webSiteContactList.getRelatedOne("ContactList", false); + contactListType = contactList.getRelatedOne("ContactListType", false); + temp = [:]; + temp.contactList = contactList; + temp.contactListType = contactListType; + publicEmailContactLists.add(temp); +} +context.publicEmailContactLists = publicEmailContactLists; + +if (userLogin) { + partyAndContactMechList = from("PartyAndContactMech").where("partyId", partyId, "contactMechTypeId", "EMAIL_ADDRESS").orderBy("-fromDate").filterByDate().queryList(); + context.partyAndContactMechList = partyAndContactMechList; +} + + diff --git a/src/org/apache/ofbiz/ecommerce/customer/CustomerReviews.groovy b/src/org/apache/ofbiz/ecommerce/customer/CustomerReviews.groovy new file mode 100644 index 0000000..58fdfd9 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/customer/CustomerReviews.groovy @@ -0,0 +1,28 @@ +/* +* 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.entity.condition.EntityOperator +import org.ofbiz.entity.condition.EntityCondition + +// get the product review(s) for the given user +if (userLogin) { + reviews = from("ProductReview").where("userLoginId", userLogin.userLoginId).cache(true).queryList(); + + context.reviews = reviews; +} diff --git a/src/org/apache/ofbiz/ecommerce/customer/CustomerSurvey.groovy b/src/org/apache/ofbiz/ecommerce/customer/CustomerSurvey.groovy new file mode 100644 index 0000000..e7fd30f --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/customer/CustomerSurvey.groovy @@ -0,0 +1,46 @@ +/* + * 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.*; +import org.ofbiz.entity.Delegator; +import org.ofbiz.entity.GenericValue; +import org.ofbiz.product.store.ProductStoreSurveyWrapper; + +partyId = userLogin.partyId; +paramMap = UtilHttp.getParameterMap(request); + +productStoreSurveyId = parameters.productStoreSurveyId; + +surveyAppl = from("ProductStoreSurveyAppl").where("productStoreSurveyId", productStoreSurveyId).queryOne(); +if (surveyAppl) { + survey = surveyAppl.getRelatedOne("Survey", false); + context.survey = survey; + + if (!parameters._ERROR_MESSAGE_) { + paramMap = [productStoreSurveyId : productStoreSurveyId]; + } + wrapper = new ProductStoreSurveyWrapper(surveyAppl, partyId, paramMap); + context.surveyWrapper = wrapper; + + surveyResp = parameters.surveyResponseId; + if (surveyResp) { + wrapper.setThisResponseId(surveyResp); + wrapper.callResult(true); + } +} diff --git a/src/org/apache/ofbiz/ecommerce/customer/EditBillingAddress.groovy b/src/org/apache/ofbiz/ecommerce/customer/EditBillingAddress.groovy new file mode 100644 index 0000000..dff9cce --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/customer/EditBillingAddress.groovy @@ -0,0 +1,83 @@ +/* + * 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.entity.util.EntityUtil; +import org.ofbiz.party.contact.ContactHelper; +import org.ofbiz.entity.condition.EntityCondition; + +if (userLogin) { + party = userLogin.getRelatedOne("Party", false); + contactMech = EntityUtil.getFirst(ContactHelper.getContactMech(party, "BILLING_LOCATION", "POSTAL_ADDRESS", false)); + if (contactMech) { + postalAddress = contactMech.getRelatedOne("PostalAddress", false); + billToContactMechId = postalAddress.contactMechId; + context.billToContactMechId = billToContactMechId; + context.billToName = postalAddress.toName; + context.billToAttnName = postalAddress.attnName; + context.billToAddress1 = postalAddress.address1; + context.billToAddress2 = postalAddress.address2; + context.billToCity = postalAddress.city; + context.billToPostalCode = postalAddress.postalCode; + context.billToStateProvinceGeoId = postalAddress.stateProvinceGeoId; + context.billToCountryGeoId = postalAddress.countryGeoId; + billToStateProvinceGeo = from("Geo").where("geoId", postalAddress.stateProvinceGeoId).queryOne(); + if (billToStateProvinceGeo) { + context.billToStateProvinceGeo = billToStateProvinceGeo.geoName; + } + billToCountryProvinceGeo = from("Geo").where("geoId", postalAddress.countryGeoId).queryOne(); + if (billToCountryProvinceGeo) { + context.billToCountryProvinceGeo = billToCountryProvinceGeo.geoName; + } + + creditCards = []; + paymentMethod = from("PaymentMethod").where("partyId", party.partyId, "paymentMethodTypeId", "CREDIT_CARD").orderBy("fromDate").filterByDate().queryFirst(); + if (paymentMethod) { + creditCard = paymentMethod.getRelatedOne("CreditCard", false); + context.paymentMethodTypeId = "CREDIT_CARD"; + context.cardNumber = creditCard.cardNumber; + context.cardType = creditCard.cardType; + context.paymentMethodId = creditCard.paymentMethodId; + context.firstNameOnCard = creditCard.firstNameOnCard; + context.lastNameOnCard = creditCard.lastNameOnCard; + context.expMonth = (creditCard.expireDate).substring(0, 2); + context.expYear = (creditCard.expireDate).substring(3); + } + if (shipToContactMechId) { + if (billToContactMechId && billToContactMechId.equals(shipToContactMechId)) { + context.useShippingAddressForBilling = "Y"; + } + } + } + + billToContactMechList = ContactHelper.getContactMech(party, "PHONE_BILLING", "TELECOM_NUMBER", false) + if (billToContactMechList) { + billToTelecomNumber = (EntityUtil.getFirst(billToContactMechList)).getRelatedOne("TelecomNumber", false); + pcm = EntityUtil.getFirst(billToTelecomNumber.getRelated("PartyContactMech", null, null, false)); + context.billToTelecomNumber = billToTelecomNumber; + context.billToExtension = pcm.extension; + } + + billToFaxNumberList = ContactHelper.getContactMech(party, "FAX_BILLING", "TELECOM_NUMBER", false) + if (billToFaxNumberList) { + billToFaxNumber = (EntityUtil.getFirst(billToFaxNumberList)).getRelatedOne("TelecomNumber", false); + faxPartyContactMech = EntityUtil.getFirst(billToFaxNumber.getRelated("PartyContactMech", null, null, false)); + context.billToFaxNumber = billToFaxNumber; + context.billToFaxExtension = faxPartyContactMech.extension; + } +} diff --git a/src/org/apache/ofbiz/ecommerce/customer/EditContactMech.groovy b/src/org/apache/ofbiz/ecommerce/customer/EditContactMech.groovy new file mode 100644 index 0000000..51384b0 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/customer/EditContactMech.groovy @@ -0,0 +1,103 @@ +/* + * 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 java.util.HashMap; +import org.ofbiz.party.contact.ContactMechWorker; +import org.ofbiz.base.util.UtilHttp; +import org.ofbiz.base.util.UtilMisc; + +/* puts the following in the context: "contactMech", "contactMechId", + "partyContactMech", "partyContactMechPurposes", "contactMechTypeId", + "contactMechType", "purposeTypes", "postalAddress", "telecomNumber", + "requestName", "donePage", "tryEntity", "contactMechTypes" + */ +target = [:]; +ContactMechWorker.getContactMechAndRelated(request, userLogin.partyId, target); +context.putAll(target); + + +if (!security.hasEntityPermission("PARTYMGR", "_VIEW", session) && !context.partyContactMech && context.contactMech) { + context.canNotView = true; +} else { + context.canNotView = false; +} + +preContactMechTypeId = parameters.preContactMechTypeId; +if (preContactMechTypeId) context.preContactMechTypeId = preContactMechTypeId; + +paymentMethodId = parameters.paymentMethodId; +if (paymentMethodId) context.paymentMethodId = paymentMethodId; + +cmNewPurposeTypeId = parameters.contactMechPurposeTypeId; +if (cmNewPurposeTypeId) { + contactMechPurposeType = from("ContactMechPurposeType").where("contactMechPurposeTypeId", cmNewPurposeTypeId).queryOne(); + if (contactMechPurposeType) { + context.contactMechPurposeType = contactMechPurposeType; + } else { + cmNewPurposeTypeId = null; + } + context.cmNewPurposeTypeId = cmNewPurposeTypeId; +} + +tryEntity = context.tryEntity; + +contactMechData = context.contactMech; +if (!tryEntity) contactMechData = parameters; +if (!contactMechData) contactMechData = [:]; +if (contactMechData) context.contactMechData = contactMechData; + +partyContactMechData = context.partyContactMech; +if (!tryEntity) partyContactMechData = parameters; +if (!partyContactMechData) partyContactMechData = [:]; +if (partyContactMechData) context.partyContactMechData = partyContactMechData; + +postalAddressData = context.postalAddress; +if (!tryEntity) postalAddressData = parameters; +if (!postalAddressData) postalAddressData = [:]; +if (postalAddressData) context.postalAddressData = postalAddressData; + +telecomNumberData = context.telecomNumber; +if (!tryEntity) telecomNumberData = parameters; +if (!telecomNumberData) telecomNumberData = [:]; +if (telecomNumberData) context.telecomNumberData = telecomNumberData; + +// load the geo names for selected countries and states/regions +if (parameters.countryGeoId) { + geoValue = from("Geo").where("geoId", parameters.countryGeoId).cache(true).queryOne(); + if (geoValue) { + context.selectedCountryName = geoValue.geoName; + } +} else if (postalAddressData?.countryGeoId) { + geoValue = from("Geo").where("geoId", postalAddressData.countryGeoId).cache(true).queryOne(); + if (geoValue) { + context.selectedCountryName = geoValue.geoName; + } +} + +if (parameters.stateProvinceGeoId) { + geoValue = from("Geo").where("geoId", parameters.stateProvinceGeoId).cache(true).queryOne(); + if (geoValue) { + context.selectedStateName = geoValue.geoId; + } +} else if (postalAddressData?.stateProvinceGeoId) { + geoValue = from("Geo").where("geoId", postalAddressData.stateProvinceGeoId).cache(true).queryOne(); + if (geoValue) { + context.selectedStateName = geoValue.geoId; + } +} diff --git a/src/org/apache/ofbiz/ecommerce/customer/EditEmailAndTelecomNumber.groovy b/src/org/apache/ofbiz/ecommerce/customer/EditEmailAndTelecomNumber.groovy new file mode 100644 index 0000000..53c00ea --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/customer/EditEmailAndTelecomNumber.groovy @@ -0,0 +1,44 @@ +/* + * 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.entity.util.EntityUtil; +import org.ofbiz.party.contact.ContactHelper; + +if (userLogin) { + party = userLogin.getRelatedOne("Party", false); + + contactMech = EntityUtil.getFirst(ContactHelper.getContactMech(party, "PRIMARY_EMAIL", "EMAIL_ADDRESS", false)); + if (contactMech) { + context.emailContactMechId = contactMech.contactMechId; + context.emailAddress = contactMech.infoString; + } + + contactMech = EntityUtil.getFirst(ContactHelper.getContactMech(party, "PRIMARY_PHONE", "TELECOM_NUMBER", false)); + if (contactMech) { + partyContactMech = from("PartyContactMech").where("partyId", party.partyId, "contactMechId", contactMech.contactMechId).filterByDate().queryFirst(); + if (partyContactMech) { + telecomNumber = partyContactMech.getRelatedOne("TelecomNumber", false); + context.phoneContactMechId = telecomNumber.contactMechId; + context.countryCode = telecomNumber.countryCode; + context.areaCode = telecomNumber.areaCode; + context.contactNumber = telecomNumber.contactNumber; + context.extension = partyContactMech.extension; + } + } +} diff --git a/src/org/apache/ofbiz/ecommerce/customer/EditPaymentMethod.groovy b/src/org/apache/ofbiz/ecommerce/customer/EditPaymentMethod.groovy new file mode 100644 index 0000000..ff4f39a --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/customer/EditPaymentMethod.groovy @@ -0,0 +1,64 @@ +/* + * 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 java.util.HashMap; +import org.ofbiz.base.util.UtilHttp; +import org.ofbiz.accounting.payment.PaymentWorker; +import org.ofbiz.party.contact.ContactMechWorker; + +paymentResults = PaymentWorker.getPaymentMethodAndRelated(request, userLogin.partyId); +//returns the following: "paymentMethod", "creditCard", "giftCard", "eftAccount", "paymentMethodId", "curContactMechId", "donePage", "tryEntity" +context.putAll(paymentResults); + +curPostalAddressResults = ContactMechWorker.getCurrentPostalAddress(request, userLogin.partyId, paymentResults.curContactMechId); +//returns the following: "curPartyContactMech", "curContactMech", "curPostalAddress", "curPartyContactMechPurposes" +context.putAll(curPostalAddressResults); + +postalAddressInfos = ContactMechWorker.getPartyPostalAddresses(request, userLogin.partyId, paymentResults.curContactMechId); +context.put("postalAddressInfos", postalAddressInfos); + +//prepare "Data" maps for filling form input boxes +tryEntity = paymentResults.tryEntity; + +creditCardData = paymentResults.creditCard; +if (!tryEntity) creditCardData = parameters; +if (!creditCardData) creditCardData = [:]; +if (creditCardData) context.creditCardData = creditCardData; + +giftCardData = paymentResults.giftCard; +if (!tryEntity) giftCardData = parameters; +if (!giftCardData) giftCardData = [:]; +if (giftCardData) context.giftCardData = giftCardData; + +eftAccountData = paymentResults.eftAccount; +if (!tryEntity) eftAccountData = parameters; +if (!eftAccountData) eftAccountData = [:]; +if (eftAccountData) context.eftAccountData = eftAccountData; + +paymentMethodData = paymentResults.paymentMethod; +if (!tryEntity) paymentMethodData = parameters; +if (!paymentMethodData) paymentMethodData = [:]; +if (paymentMethodData) context.paymentMethodData = paymentMethodData; + +//prepare security flag +if (!security.hasEntityPermission("PARTYMGR", "_VIEW", session) && (context.creditCard || context.giftCard || context.eftAccount) && context.paymentMethod && !userLogin.partyId.equals(context.paymentMethod.partyId)) { + context.canNotView = true; +} else { + context.canNotView = false; +} diff --git a/src/org/apache/ofbiz/ecommerce/customer/EditPerson.groovy b/src/org/apache/ofbiz/ecommerce/customer/EditPerson.groovy new file mode 100644 index 0000000..e5273fe --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/customer/EditPerson.groovy @@ -0,0 +1,32 @@ +/* + * 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 java.util.HashMap; +import org.ofbiz.base.util.UtilHttp; + +tryEntity = true; +errorMessage = parameters._ERROR_MESSAGE_; +if (errorMessage) { + tryEntity = false; +} +personData = person; +if (!tryEntity) personData = UtilHttp.getParameterMap(request); +if (!personData) personData = [:]; + +context.personData = personData; diff --git a/src/org/apache/ofbiz/ecommerce/customer/EditShippingAddress.groovy b/src/org/apache/ofbiz/ecommerce/customer/EditShippingAddress.groovy new file mode 100644 index 0000000..ffba69d --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/customer/EditShippingAddress.groovy @@ -0,0 +1,76 @@ +/* + * 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.entity.util.EntityUtil; +import org.ofbiz.party.contact.ContactHelper; + +if (userLogin) { + party = userLogin.getRelatedOne("Party", false); + context.partyId = party.partyId + if ("PERSON".equals(party.partyTypeId)) { + person = from("Person").where("partyId", party.partyId).queryOne(); + context.firstName = person.firstName; + context.lastName = person.lastName; + } else { + group = from("PartyGroup").where("partyId", party.partyId).queryOne(); + context.firstName = group.groupName; + context.lastName = ""; + } + + contactMech = EntityUtil.getFirst(ContactHelper.getContactMech(party, "SHIPPING_LOCATION", "POSTAL_ADDRESS", false)); + if (contactMech) { + postalAddress = contactMech.getRelatedOne("PostalAddress", false); + context.shipToContactMechId = postalAddress.contactMechId; + + context.shipToName = postalAddress.toName; + context.shipToAttnName = postalAddress.attnName; + context.shipToAddress1 = postalAddress.address1; + context.shipToAddress2 = postalAddress.address2; + context.shipToCity = postalAddress.city; + context.shipToPostalCode = postalAddress.postalCode; + context.shipToStateProvinceGeoId = postalAddress.stateProvinceGeoId; + context.shipToCountryGeoId = postalAddress.countryGeoId; + shipToStateProvinceGeo = from("Geo").where("geoId", postalAddress.stateProvinceGeoId).queryOne(); + if (shipToStateProvinceGeo) { + context.shipToStateProvinceGeo = shipToStateProvinceGeo.geoName; + } + shipToCountryProvinceGeo = from("Geo").where("geoId", postalAddress.countryGeoId).queryOne(); + if (shipToCountryProvinceGeo) { + context.shipToCountryProvinceGeo = shipToCountryProvinceGeo.geoName; + } + } else { + context.shipToContactMechId = null; + } + + shipToContactMechList = ContactHelper.getContactMech(party, "PHONE_SHIPPING", "TELECOM_NUMBER", false) + if (shipToContactMechList) { + shipToTelecomNumber = (EntityUtil.getFirst(shipToContactMechList)).getRelatedOne("TelecomNumber", false); + pcm = EntityUtil.getFirst(shipToTelecomNumber.getRelated("PartyContactMech", null, null, false)); + context.shipToTelecomNumber = shipToTelecomNumber; + context.shipToExtension = pcm.extension; + } + + shipToFaxNumberList = ContactHelper.getContactMech(party, "FAX_SHIPPING", "TELECOM_NUMBER", false) + if (shipToFaxNumberList) { + shipToFaxNumber = (EntityUtil.getFirst(shipToFaxNumberList)).getRelatedOne("TelecomNumber", false); + faxPartyContactMech = EntityUtil.getFirst(shipToFaxNumber.getRelated("PartyContactMech", null, null, false)); + context.shipToFaxNumber = shipToFaxNumber; + context.shipToFaxExtension = faxPartyContactMech.extension; + } +} diff --git a/src/org/apache/ofbiz/ecommerce/customer/GiftCardBalance.groovy b/src/org/apache/ofbiz/ecommerce/customer/GiftCardBalance.groovy new file mode 100644 index 0000000..9f512c5 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/customer/GiftCardBalance.groovy @@ -0,0 +1,21 @@ +/* + * 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.product.store.*; + context.paymentProperties = ProductStoreWorker.getProductStorePaymentProperties(request, "GIFT_CARD", null, true); diff --git a/src/org/apache/ofbiz/ecommerce/customer/GiftCardLink.groovy b/src/org/apache/ofbiz/ecommerce/customer/GiftCardLink.groovy new file mode 100644 index 0000000..a5e3fcc --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/customer/GiftCardLink.groovy @@ -0,0 +1,33 @@ +/* + * 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.product.store.*; + +processResult = parameters.processResult; +if (processResult != null) { + if (!processResult) { + request.setAttribute("_ERROR_MESSAGE_", "
  • There was a problem linking your cards. Please check the numbers and try again.
  • "); + request.removeAttribute("_EVENT_MESSAGE_"); + } else { + request.setAttribute("_EVENT_MESSAGE_", "
  • Thank-you. Your gift card account is now linked.
  • "); + } +} + +context.userLogin = userLogin; +context.paymentProperties = ProductStoreWorker.getProductStorePaymentProperties(request, "GIFT_CARD", null, true); diff --git a/src/org/apache/ofbiz/ecommerce/customer/NewCustomer.groovy b/src/org/apache/ofbiz/ecommerce/customer/NewCustomer.groovy new file mode 100644 index 0000000..a1d5578 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/customer/NewCustomer.groovy @@ -0,0 +1,58 @@ +/* + * 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.base.util.UtilMisc; +import org.ofbiz.product.store.ProductStoreWorker; + +productStore = ProductStoreWorker.getProductStore(request); +context.productStoreId = productStore.productStoreId; +context.productStore = productStore; + +context.createAllowPassword = "Y".equals(productStore.allowPassword); +context.getUsername = !"Y".equals(productStore.usePrimaryEmailUsername); + +previousParams = parameters._PREVIOUS_PARAMS_; +if (previousParams) { + previousParams = "?" + previousParams; +} else { + previousParams = ""; +} +context.previousParams = previousParams; + +//the parameters from janrain +userInfoMap = request?.getAttribute("userInfoMap"); +if (!userInfoMap) { + userInfoMap = request?.getSession().getAttribute("userInfoMap"); +} +if (userInfoMap) { + if (userInfoMap.givenName && userInfoMap.familyName) { + requestParameters.USER_FIRST_NAME = userInfoMap.givenName; + requestParameters.USER_LAST_NAME = userInfoMap.familyName; + } else if (userInfoMap.formatted) { + requestParameters.USER_FIRST_NAME = userInfoMap.formatted; + } + requestParameters.CUSTOMER_EMAIL = userInfoMap.email; + requestParameters.preferredUsername = userInfoMap.preferredUsername; + requestParameters.USERNAME = userInfoMap.preferredUsername; + request?.getSession().setAttribute("userInfoMap", userInfoMap); +} + +donePage = "main;" + parameters +context.donePage = donePage; diff --git a/src/org/apache/ofbiz/ecommerce/customer/OnePageCheckoutOptions.groovy b/src/org/apache/ofbiz/ecommerce/customer/OnePageCheckoutOptions.groovy new file mode 100644 index 0000000..b1b662d --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/customer/OnePageCheckoutOptions.groovy @@ -0,0 +1,27 @@ +/* + * 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.order.shoppingcart.shipping.*; + +shoppingCart = session.getAttribute("shoppingCart"); + +// Reassign items requiring drop-shipping to new or existing drop-ship groups +if (shoppingCart) { + shoppingCart.createDropShipGroups(dispatcher); +} diff --git a/src/org/apache/ofbiz/ecommerce/customer/ViewProfile.groovy b/src/org/apache/ofbiz/ecommerce/customer/ViewProfile.groovy new file mode 100644 index 0000000..9e0c395 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/customer/ViewProfile.groovy @@ -0,0 +1,89 @@ +/* + * 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 java.lang.*; +import java.util.*; +import org.ofbiz.base.util.*; +import org.ofbiz.entity.*; +import org.ofbiz.entity.util.*; +import org.ofbiz.entity.condition.*; +import org.ofbiz.party.contact.ContactMechWorker; +import org.ofbiz.product.store.ProductStoreWorker; +import org.ofbiz.accounting.payment.PaymentWorker; + +productStoreId = ProductStoreWorker.getProductStoreId(request); +context.productStoreId = productStoreId; + +if (userLogin) { + profiledefs = from("PartyProfileDefault").where("partyId", partyId, "productStoreId", productStoreId).queryOne(); + + showOld = "true".equals(parameters.SHOW_OLD); + + partyContactMechValueMaps = ContactMechWorker.getPartyContactMechValueMaps(delegator, userLogin.partyId, showOld); + paymentMethodValueMaps = PaymentWorker.getPartyPaymentMethodValueMaps(delegator, userLogin.partyId, showOld); + + context.profiledefs = profiledefs; + context.showOld = showOld; + context.partyContactMechValueMaps = partyContactMechValueMaps; + context.paymentMethodValueMaps = paymentMethodValueMaps; + + // shipping methods - for default selection + if (profiledefs?.defaultShipAddr) { + shipAddress = from("PostalAddress").where("contactMechId", profiledefs.defaultShipAddr).queryOne(); + if (shipAddress) { + carrierShipMeths = ProductStoreWorker.getAvailableStoreShippingMethods(delegator, productStoreId, shipAddress, [1], null, 0, 1); + context.carrierShipMethods = carrierShipMeths; + } + } + + profileSurveys = ProductStoreWorker.getProductSurveys(delegator, productStoreId, null, "CUSTOMER_PROFILE"); + context.surveys = profileSurveys; + + exprs = [EntityCondition.makeCondition("partyId", EntityOperator.EQUALS, partyId)]; + exprs.add(EntityCondition.makeCondition("roleStatusId", EntityOperator.NOT_EQUAL, "COM_ROLE_READ")); + messages = from("CommunicationEventAndRole").where(exprs).orderBy("-entryDate").maxRows(5).queryList(); + context.messages = messages; + context.profileMessages = true; + + partyContent = from("ContentRole").where("partyId", partyId, "roleTypeId", "OWNER").filterByDate().queryList(); + context.partyContent = partyContent; + + mimeTypes = from("MimeType").orderBy("description", "mimeTypeId").queryList(); + context.mimeTypes = mimeTypes; + + partyContentTypes = from("PartyContentType").orderBy("description").queryList(); + context.partyContentTypes = partyContentTypes; + + // call the getOrderedSummaryInformation service to get the sub-total of valid orders in last X months + monthsToInclude = 12; + result = runService('getOrderedSummaryInformation', [partyId : partyId, roleTypeId : "PLACING_CUSTOMER", orderTypeId : "SALES_ORDER", statusId : "ORDER_COMPLETED", monthsToInclude : monthsToInclude, userLogin : userLogin]); + context.monthsToInclude = monthsToInclude; + context.totalSubRemainingAmount = result.totalSubRemainingAmount; + context.totalOrders = result.totalOrders; + + contactListPartyList = from("ContactListParty").where("partyId", partyId).orderBy("-fromDate").queryList(); + // show all, including history, ie don't filter: contactListPartyList = EntityUtil.filterByDate(contactListPartyList, true); + context.contactListPartyList = contactListPartyList; + + publicContactLists = from("ContactList").where("isPublic", "Y").orderBy("contactListName").queryList(); + context.publicContactLists = publicContactLists; + + partyAndContactMechList = from("PartyAndContactMech").where("partyId", partyId).orderBy("-fromDate").filterByDate().queryList(); + context.partyAndContactMechList = partyAndContactMechList; +} diff --git a/src/org/apache/ofbiz/ecommerce/forum/ContentAddPrep.groovy b/src/org/apache/ofbiz/ecommerce/forum/ContentAddPrep.groovy new file mode 100644 index 0000000..872d335 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/forum/ContentAddPrep.groovy @@ -0,0 +1,94 @@ +/* + * 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 java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; +import org.ofbiz.base.util.*; +import org.ofbiz.entity.*; +import org.ofbiz.security.*; +import org.ofbiz.service.*; +import org.ofbiz.entity.model.*; +import org.ofbiz.widget.renderer.html.HtmlFormWrapper; +import org.ofbiz.securityext.login.*; +import org.ofbiz.common.*; +import org.ofbiz.entity.model.*; +import org.ofbiz.content.ContentManagementWorker; +import org.ofbiz.content.content.ContentWorker; + +import freemarker.template.SimpleHash; +import freemarker.template.SimpleSequence; + +import javax.servlet.*; +import javax.servlet.http.*; + +singleWrapper = context.singleWrapper; +singleWrapper.putInContext("contentPurposeTypeId", page.contentPurposeTypeId); +singleWrapper.putInContext("contentAssocTypeId", page.contentAssocTypeId); +rootPubPt = parameters.webSiteId; +paramMap = UtilHttp.getParameterMap(request); +contentIdTo = ContentManagementWorker.getFromSomewhere("forumId", paramMap, request, context); +context.contentIdTo = contentIdTo; +//Debug.logInfo("in contentaddprep, contentIdTo:" + contentIdTo,""); +//Debug.logInfo("in contentaddprep, paramMap:" + paramMap,""); +attrList = from("ContentAttribute").where("contentId", contentIdTo, "attrName", "publishOperation").cache(true).queryList(); +publishOperation = null; +if (attrList) { + contentAttribute = attrList.get(0); + publishOperation = contentAttribute.attrValue; + //Debug.logInfo("in contentaddprep, publishOperation:" + publishOperation,""); +} + +singleWrapper.putInContext("publishOperation", publishOperation); +singleWrapper.putInContext("contentIdTo", contentIdTo); +//singleWrapper.putInContext("ownerContentId", contentIdTo); +summaryDataResourceTypeId = page.summaryDataResourceTypeId; +singleWrapper.putInContext("summaryDataResourceTypeId", summaryDataResourceTypeId); +targetOperation = page.targetOperation ?: "CONTENT_CREATE"; + +singleWrapper.putInContext("targetOperation", targetOperation); +singleWrapper.putInContext("contentTypeId", "DOCUMENT"); +contentPurpose = page.contentPurpose ?: "ARTICLE"; + +singleWrapper.putInContext("contentPurpose", contentPurpose); +singleWrapper.putInContext("forumId", contentIdTo); + +forumContent = from("Content").where("contentId", contentIdTo).cache(true).queryOne(); +statusId = "CTNT_PUBLISHED"; +if (forumContent) { + statusId = forumContent.statusId; + if (!statusId) { + statusId = page.statusId; + } + if (!statusId) { + statusId = "CTNT_PUBLISHED"; + } +} +singleWrapper.putInContext("statusId", statusId); + +siteAncestorList = []; +siteAncestorList.add(contentIdTo); +context.siteAncestorList = siteAncestorList; +//Debug.logInfo("in viewprep, siteAncestorList:" + siteAncestorList,""); diff --git a/src/org/apache/ofbiz/ecommerce/forum/ContentPrep.groovy b/src/org/apache/ofbiz/ecommerce/forum/ContentPrep.groovy new file mode 100644 index 0000000..87dcbcc --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/forum/ContentPrep.groovy @@ -0,0 +1,131 @@ +/* + * 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.*; +import org.ofbiz.base.util.template.FreeMarkerWorker; +import org.ofbiz.entity.*; +import org.ofbiz.security.*; +import org.ofbiz.service.*; +import org.ofbiz.entity.model.*; +import org.ofbiz.widget.renderer.html.HtmlFormWrapper; +import org.ofbiz.content.data.DataResourceWorker; +import org.ofbiz.webapp.ftl.FreeMarkerViewHandler; +import org.ofbiz.content.content.ContentWorker; +import org.ofbiz.content.ContentManagementWorker; + +import java.io.StringWriter; +import freemarker.template.SimpleHash; +import freemarker.template.WrappingTemplateModel; + + +import javax.servlet.*; +import javax.servlet.http.*; + +// load edit or create Content form + +rootPubPt = parameters.webSiteId; +//Debug.logInfo("in contentprep, security:" + security, ""); + +singleWrapper = context.singleWrapper; + +paramMap = UtilHttp.getParameterMap(request); +contentId = ""; +contentId = ContentManagementWorker.getFromSomewhere("masterContentId", paramMap, request, context); +if (!contentId) + contentId = ContentManagementWorker.getFromSomewhere("contentIdTo", paramMap, request, context); +if (!contentId) + contentId = ContentManagementWorker.getFromSomewhere("contentId", paramMap, request, context); + +//Debug.logInfo("in contentprep, contentId(1):" + contentId, ""); +currentValue = parameters.currentValue; +//Debug.logInfo("in contentprep, currentValue(0):" + currentValue, ""); + +if (!contentId && currentValue) { + contentId = currentValue.contentId; +} +if (contentId && !currentValue) { + currentValue = from("Content").where("contentId", contentId).cache(true).queryOne(); +} +//Debug.logInfo("in contentprep, currentValue(1):" + currentValue, ""); +//Debug.logInfo("in contentprep, contentId(4):" + contentId, ""); + +if (currentValue) { + dataResourceId = currentValue.dataResourceId; + context.contentId = contentId; + context.contentName = currentValue.contentName; + context.description = currentValue.description; + context.statusId = currentValue.statusId; + + mimeTypeId = currentValue.mimeTypeId; + rootDir = request.getSession().getServletContext().getRealPath("/"); + wrapper = FreeMarkerWorker.getDefaultOfbizWrapper(); + WrappingTemplateModel.setDefaultObjectWrapper(wrapper); + //templateRoot = new SimpleHash(wrapper); + templateRoot = [:]; + FreeMarkerViewHandler.prepOfbizRoot(templateRoot, request, response); + + ctx = [:]; + ctx.rootDir = rootDir; + // webSiteId and https need to go here, too + templateRoot.context = ctx; + fromDate = nowTimestamp; + assocTypes = null; + //assocTypes = ["SUB_CONTENT"]; + subContentDataResourceView = ContentWorker.getSubContent(delegator, contentId, "ARTICLE", null, userLogin, assocTypes, fromDate); + if (subContentDataResourceView) { + out = new StringWriter(); + ContentWorker.renderContentAsText(dispatcher, delegator, null, out, templateRoot, subContentDataResourceView, locale, mimeTypeId, true); + textData = out.toString(); + context.txtContentId = subContentDataResourceView.contentId; + context.txtDataResourceId = subContentDataResourceView.dataResourceId; + context.textData = textData; + //Debug.logInfo("textId:" + txtContentId, ""); + //Debug.logInfo("textData:" + textData, ""); + if (singleWrapper) { + //Debug.logInfo("textData:" + textData, ""); + singleWrapper.putInContext("textData", textData); + } + } + + subContentDataResourceView = ContentWorker.getSubContent(dispatcher, delegator, contentId, "SUMMARY", null, userLogin, assocTypes, fromDate, true); + if (subContentDataResourceView) { + out = new StringWriter(); + ContentWorker.renderContentAsText(delegator, null, out, templateRoot, subContentDataResourceView, locale, mimeTypeId); + summaryData = out.toString(); + context.sumContentId = subContentDataResourceView.contentId; + context.sumDataResourceId = subContentDataResourceView.dataResourceId; + context.summaryData = summaryData; + //Debug.logInfo("sumId:" + sumContentId, ""); + //Debug.logInfo("summaryData:" + summaryData, ""); + if (singleWrapper) { + //Debug.logInfo("summaryData:" + summaryData, ""); + singleWrapper.putInContext("summaryData", summaryData); + } + } + + subContentDataResourceView = ContentWorker.getSubContent(dispatcher, delegator, contentId, "IMAGE", null, userLogin, assocTypes, fromDate, true); + if (subContentDataResourceView) { + out = new StringWriter(); + ContentWorker.renderContentAsText(delegator, null, out, templateRoot, subContentDataResourceView, locale, mimeTypeId); + imageData = out.toString(); + context.imgContentId = subContentDataResourceView.contentId; + context.imgDataResourceId = subContentDataResourceView.dataResourceId; + context.imageData = imageData; + } +} diff --git a/src/org/apache/ofbiz/ecommerce/forum/CurrentValPrep.groovy b/src/org/apache/ofbiz/ecommerce/forum/CurrentValPrep.groovy new file mode 100644 index 0000000..c3b6598 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/forum/CurrentValPrep.groovy @@ -0,0 +1,148 @@ +/* + * 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 java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; +import org.ofbiz.base.util.*; +import org.ofbiz.entity.*; +import org.ofbiz.security.*; +import org.ofbiz.service.*; +import org.ofbiz.entity.model.*; +import org.ofbiz.widget.renderer.html.HtmlFormWrapper; +import org.ofbiz.content.ContentManagementWorker; + +import javax.servlet.*; +import javax.servlet.http.*; + +currentEntityMap = session.getAttribute("currentEntityMap"); +if (!currentEntityMap) { + currentEntityMap = [:]; + session.setAttribute("currentEntityMap", currentEntityMap); +} + +entityName = context.entityName; +currentEntityPropertyName = parameters.currentEntityPropertyName; +if (!currentEntityPropertyName) { + currentEntityName = entityName; +} else { + currentEntityName = parameters[currentEntityPropertyName]; +} + +//Debug.logInfo("in currentvalprep, currentEntityName:" + currentEntityName,""); +cachedPK = currentEntityMap[currentEntityName]; +//Debug.logInfo("in currentvalprep, cachedPK:" + cachedPK,""); + +// Build a key from param or attribute values. +paramMap = UtilHttp.getParameterMap(request); +//Debug.logInfo("paramMap:" + paramMap, null); +v = delegator.makeValue(currentEntityName); +passedPK = v.getPrimaryKey(); +keyColl = passedPK.getAllKeys(); +keyIt = keyColl.iterator(); +while (keyIt.hasNext()) { + attrName = keyIt.next(); + attrVal = parameters[attrName]; + //Debug.logInfo("in currentvalprep, attrName:" + attrName,""); + //Debug.logInfo("in currentvalprep, attrVal:" + attrVal,""); + if (attrVal) { + passedPK[attrName] = attrVal; + } +} + +//Debug.logInfo("in currentvalprep, passedPK:" + passedPK,""); +// messed up code to determine whether or not the cached or passed keys have missing fields, +// in which case, the valid one is used to retrieve the current value +pksEqual = true; +if (cachedPK) { + keyColl = cachedPK.getPrimaryKey().getAllKeys(); + keyIt = keyColl.iterator(); + while (keyIt.hasNext()) { + sCached = null; + sPassed = null; + oCached = null; + oCached = null; + ky = keyIt.next(); + oPassed = passedPK[ky]; + if (oPassed) { + sPassed = oPassed; + if (!sPassed) { + pksEqual = false; + } else { + oCached = cachedPK[ky]; + if (oCached) { + sCached = oCached; + if (!sPassed) { + pksEqual = false; + } else { + if (!sPassed.equals(sCached)) { + //pksEqual = true; + } + } + } + } + } else { + pksEqual = false; + } + } +} + +currentPK = passedPK; +if (!pksEqual) { + currentPK = cachedPK; + // all other condition result in currentPK = passedPK +} +//Debug.logInfo("in currentvalprep, currentPK:" + currentPK,""); + +currentEntityMap[currentEntityName] = currentPK; +request.setAttribute("currentPK", currentPK); +context.currentPK = currentPK; +currentValue = from(currentPK.getPrimaryKey().getEntityName()).where(currentPK.getPrimaryKey()).queryOne(); +context.currentValue = currentValue; +request.setAttribute("currentValue", currentValue); + +// Debug.logInfo("===========in currentvalprep, currentValue:" + request.getAttribute("currentValue"),""); +if (currentValue) { + if (currentEntityName.indexOf("DataResource") >= 0) { + suffix = ""; + s = currentValue.dataResourceTypeId ?: currentValue.drDataResourceTypeId; + if (s) suffix = "_" + s; + + if ("_ELECTRONIC_TEXT".equals(suffix)) { + s = currentValue.mimeTypeId ?: currentValue.drMimeTypeId; + if (s) suffix += "_" + s; + } + + //Debug.logInfo("in currentvalprep, suffix:" + suffix,""); +// if (suffix) { +// ContentManagementWorker.mruAdd(session, currentPK, suffix); +// } else { + ContentManagementWorker.mruAdd(session, currentPK); +// } + } else { + ContentManagementWorker.mruAdd(session, currentPK); + } +} +//Debug.logInfo("in currentvalprep, contentId:" + request.getAttribute("contentId"),""); diff --git a/src/org/apache/ofbiz/ecommerce/forum/EditAddPrep.groovy b/src/org/apache/ofbiz/ecommerce/forum/EditAddPrep.groovy new file mode 100644 index 0000000..6c742fa --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/forum/EditAddPrep.groovy @@ -0,0 +1,89 @@ +/* + * 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 java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; +import org.ofbiz.base.util.*; +import org.ofbiz.entity.*; +import org.ofbiz.security.*; +import org.ofbiz.service.*; +import org.ofbiz.entity.model.*; +import org.ofbiz.widget.renderer.html.HtmlFormWrapper; +import org.ofbiz.securityext.login.*; +import org.ofbiz.common.*; +import org.ofbiz.entity.model.*; +import org.ofbiz.content.ContentManagementWorker; +import org.ofbiz.content.content.ContentWorker; + +import freemarker.template.SimpleHash; +import freemarker.template.SimpleSequence; + +import javax.servlet.*; +import javax.servlet.http.*; + +singleWrapper = context.singleWrapper; +contentIdTo = parameters.contentIdTo; +singleWrapper.putInContext("contentIdTo", contentIdTo); +mapKey = parameters.mapKey; +singleWrapper.putInContext("mapKey", mapKey); + +if ("SUMMARY".equals(mapKey)) { + singleWrapper.putInContext("textSource", "summaryData"); +} else { + singleWrapper.putInContext("textSource", "textData"); +} + +singleWrapper.putInContext("dataResourceTypeId", "ELECTRONIC_TEXT"); +singleWrapper.putInContext("contentAssocTypeId", "SUB_CONTENT"); +//Debug.logInfo("in editaddprep, contentIdTo:" + contentIdTo,""); +//Debug.logInfo("in editaddprep, mapKey:" + mapKey,""); +//currentValue = request.getAttribute("currentValue"); +//currentValue = request.getAttribute("currentValue"); + +currentValue = ContentWorker.getSubContentCache(delegator, contentIdTo, mapKey, null, userLogin, null, null, false, null); +//Debug.logInfo("in editaddprep, currentValue:" + currentValue,""); + +if (!currentValue) { + parentValue = from("Content").where("contentId", contentIdTo).cache(true).queryOne(); + currentValue = delegator.makeValue("Content"); + subject = parentValue.contentName; + if ("SUMMARY".equals(mapKey)) { + subject = "Short " + subject; + } + currentValue.contentName = subject; + currentValue.description = subject; + singleWrapper.putInContext("contentTypeId", "DOCUMENT"); +} else { + singleWrapper.putInContext("contentTypeId", null); + //Debug.logInfo("in editaddprep, currentValue:" + currentValue,""); +} +singleWrapper.putInContext("currentValue", currentValue); +context.currentValue = currentValue; +request.setAttribute("currentValue", currentValue); +persistAction = parameters.persistAction ?: "persistContent"; + +singleWrapper.putInContext("persistAction", persistAction); +//Debug.logInfo("in editaddprep, currentValue:" + currentValue,""); diff --git a/src/org/apache/ofbiz/ecommerce/forum/FormPrep.groovy b/src/org/apache/ofbiz/ecommerce/forum/FormPrep.groovy new file mode 100644 index 0000000..a4199db --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/forum/FormPrep.groovy @@ -0,0 +1,62 @@ +/* + * 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 java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; + +import org.ofbiz.base.util.*; +import org.ofbiz.entity.*; +import org.ofbiz.security.*; +import org.ofbiz.service.*; +import org.ofbiz.entity.model.*; +import org.ofbiz.widget.renderer.html.HtmlFormWrapper; +import org.ofbiz.widget.model.*; +import org.ofbiz.content.data.DataResourceWorker; + + +import javax.servlet.*; +import javax.servlet.http.*; + +formDefFile = page.formDefFile; +singleFormName = page.singleFormName; +//org.ofbiz.base.util.Debug.logInfo("in formprep, singleFormName:" + singleFormName, null); +entityName = page.entityName; +//defaultMapName = page.defaultMapName; +//if (!defaultMapName) defaultMapName = "currentValue"; +defaultMapName = "currentValue"; + +singleWrapper = new HtmlFormWrapper(formDefFile, singleFormName, request, response); + +// The idea here is that by setting the map name here, dependency on the +// widget-form config file could be eliminated. +modelForm = singleWrapper.getModelForm(); +//modelForm.setDefaultMapName(defaultMapName); +currentValue = request.getAttribute("currentValue"); +//org.ofbiz.base.util.Debug.logInfo("in formprep, currentValue:" + currentValue, null); +singleWrapper.putInContext(defaultMapName, currentValue); +context.singleWrapper = singleWrapper; +request.setAttribute("singleWrapper", singleWrapper); diff --git a/src/org/apache/ofbiz/ecommerce/forum/HtmlAreaPrep.groovy b/src/org/apache/ofbiz/ecommerce/forum/HtmlAreaPrep.groovy new file mode 100644 index 0000000..08b9d76 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/forum/HtmlAreaPrep.groovy @@ -0,0 +1,42 @@ +/* + * 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.*; +import org.ofbiz.entity.*; +import org.ofbiz.security.*; +import org.ofbiz.service.*; +import org.ofbiz.entity.model.*; +import org.ofbiz.widget.renderer.html.HtmlFormWrapper; +import org.ofbiz.content.data.DataResourceWorker; +import org.ofbiz.webapp.ftl.FreeMarkerViewHandler; + +import java.io.StringWriter; +import freemarker.ext.beans.BeansWrapper; +import freemarker.template.SimpleHash; +import freemarker.template.WrappingTemplateModel; + + +import javax.servlet.*; +import javax.servlet.http.*; + +contentIdTo = parameters.contentIdTo; + +if (!contentIdTo || !contentIdTo.equals("TEMPLATE_MASTER")) { + context.dynamicPrimaryHTMLField = "textData"; +} diff --git a/src/org/apache/ofbiz/ecommerce/forum/NodeTrailPrep.groovy b/src/org/apache/ofbiz/ecommerce/forum/NodeTrailPrep.groovy new file mode 100644 index 0000000..0083497 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/forum/NodeTrailPrep.groovy @@ -0,0 +1,81 @@ +/* + * 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 java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; + +import org.ofbiz.base.util.*; +import org.ofbiz.entity.*; +import org.ofbiz.security.*; +import org.ofbiz.service.*; +import org.ofbiz.entity.model.*; +import org.ofbiz.widget.renderer.html.HtmlFormWrapper; +import org.ofbiz.securityext.login.*; +import org.ofbiz.common.*; +import org.ofbiz.entity.model.*; +import org.ofbiz.content.content.ContentWorker; +import org.ofbiz.content.ContentManagementWorker; + +import javax.servlet.*; +import javax.servlet.http.*; + +nodeTrailCsv = ContentManagementWorker.getFromSomewhere("nodeTrailCsv", parameters, request, context); +passedParams = null; + +if (!nodeTrailCsv) { + // this only happens in UploadContentAndImage + passedParams = request.getAttribute("passedParams"); + if (passedParams) { + nodeTrailCsv = passedParams.nodeTrailCsv; + } +} + +if (nodeTrailCsv) { + nodeTrail = ContentWorker.csvToTrail(nodeTrailCsv, delegator); + context.globalNodeTrail = nodeTrail; + singleWrapper = context.singleWrapper; + if (singleWrapper) { + singleWrapper.putInContext("nodeTrailCsv",nodeTrailCsv); + // there might be another way to do this, but if the widget form def already has a default-map + // (such as "currentValue"), then I don't know how to reference another map (defined in the + // field def via "map-name", except to do this. + // What I want to do is specify 'map-name=""' and have it use the context main + Map dummy = singleWrapper.getFromContext("dummy"); + if (!dummy) { + dummy = [:]; + } + dummy.nodeTrailCsv = nodeTrailCsv; + //Debug.logInfo("in nodetrailprep, dummy:" + dummy,""); + singleWrapper.putInContext("dummy",dummy); + } + context.nodeTrailCsv = nodeTrailCsv; + + //Debug.logInfo("in nodetrailprep, nodeTrailCsv:" + nodeTrailCsv,""); + trailContentList = ContentWorker.csvToContentList(nodeTrailCsv, delegator); + //Debug.logInfo("in nodetrailprep, trailContentList:" + trailContentList,""); + context.ancestorList = trailContentList; + //Debug.logInfo("in vewprep, siteAncestorList:" + siteAncestorList,""); +} diff --git a/src/org/apache/ofbiz/ecommerce/forum/OwnerContentPrep.groovy b/src/org/apache/ofbiz/ecommerce/forum/OwnerContentPrep.groovy new file mode 100644 index 0000000..03cdb9e --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/forum/OwnerContentPrep.groovy @@ -0,0 +1,79 @@ +/* + * 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.*; +import org.ofbiz.entity.*; +import org.ofbiz.security.*; +import org.ofbiz.service.*; +import org.ofbiz.entity.model.*; +import org.ofbiz.widget.renderer.html.HtmlFormWrapper; +import org.ofbiz.content.data.DataResourceWorker; +import org.ofbiz.webapp.ftl.FreeMarkerViewHandler; +import org.ofbiz.content.content.ContentWorker; +import org.ofbiz.content.ContentManagementWorker; + +import java.io.StringWriter; +import freemarker.ext.beans.BeansWrapper; +import freemarker.template.SimpleHash; +import freemarker.template.WrappingTemplateModel; + +import javax.servlet.*; +import javax.servlet.http.*; + +// load edit or create Content form + +//Debug.logInfo("in ownerprep, security:" + security, ""); + +rootPubPt = parameters.webSiteId; +//Debug.logInfo("in ownerprep, rootPubPt:" + rootPubPt, ""); +entityAction = page.entityOperation; +permittedOperations = page.permittedOperations; + +allDepartmentContentList = ContentManagementWorker.getAllDepartmentContent(delegator, rootPubPt); +//Debug.logInfo("in ownercontentprep, allDepartmentContentList:" + allDepartmentContentList, ""); +departmentPointList = ContentManagementWorker.getPermittedDepartmentPoints( delegator, allDepartmentContentList, userLogin, security, entityAction, "CONTENT_CREATE", null ); +//Debug.logInfo("in ownercontentprep, departmentPointList:" + departmentPointList, ""); +departmentPointMap = [:]; +departmentPointMapAll = [:]; +ownerContentList = []; +departmentPointList.each { arr -> + contentId = arr[0]; + description = arr[1]; + subPointList = []; + lineMap = [:]; + lineMap.contentId = contentId; + lineMap.description = description.toUpperCase(); + ownerContentList.add(lineMap); + subDepartmentContentList = ContentManagementWorker.getAllDepartmentContent(delegator, contentId); + subDepartmentContentList.each { departmentPoint2 -> + contentId2 = departmentPoint2.contentId; + description2 = departmentPoint2.templateTitle; + lineMap2 = [:]; + lineMap2.contentId = contentId2; + lineMap2.description = "   -" + description2; + ownerContentList.add(lineMap2); + } +} +//Debug.logInfo("in ownercontentprep, ownerContentList:" + ownerContentList, ""); + +pubPt = context.pubPt; +//Debug.logInfo("in ownercontentprep, pubPt:" + pubPt, ""); +singleWrapper = context.singleWrapper; +singleWrapper.putInContext("ownerContentList", ownerContentList); +singleWrapper.putInContext("pubPt", pubPt); diff --git a/src/org/apache/ofbiz/ecommerce/forum/PermPrep.groovy b/src/org/apache/ofbiz/ecommerce/forum/PermPrep.groovy new file mode 100644 index 0000000..1b239a2 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/forum/PermPrep.groovy @@ -0,0 +1,166 @@ +/* + * 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 java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; + +import org.ofbiz.base.util.*; +import org.ofbiz.entity.*; +import org.ofbiz.security.*; +import org.ofbiz.service.*; +import org.ofbiz.entity.model.*; +import org.ofbiz.widget.renderer.html.HtmlFormWrapper; +import org.ofbiz.content.content.PermissionRecorder; +import org.ofbiz.content.ContentManagementWorker; + +import javax.servlet.*; +import javax.servlet.http.*; + +paramMap = UtilHttp.getParameterMap(request); +//Debug.logInfo("in permprep, userLogin(0):" + userLogin, null); + +// Get permission from pagedef config file +permission = context.permission; +permissionType = context.permissionType ?: "simple"; + +entityName = context.entityName; +entityOperation = context.entityOperation; +targetOperation = context.targetOperation; +//Debug.logInfo("in permprep, targetOperation(0):" + targetOperation, null); + +mode = paramMap.mode; +//Debug.logInfo("in permprep, contentId(0):" + request.getAttribute("contentId"),""); +currentValue = request.getAttribute("currentValue"); +//Debug.logInfo("in permprep, paramMap(1):" + paramMap, null); +//Debug.logInfo("in permprep, currentValue(1):" + currentValue, null); + +if ("add".equals(mode)) { + entityOperation = context.addEntityOperation ?: context.entityOperation ?: "_CREATE"; + targetOperation = context.addTargetOperation ?: context.get("targetOperation") ?: "CONTENT_CREATE"; + //org.ofbiz.base.util.Debug.logInfo("in permprep, targetOperation:" + targetOperation, null); +} else { + if (!entityOperation) { + entityOperation = "_UPDATE"; + } + if (!targetOperation) { + targetOperation = "CONTENT_UPDATE"; + } +} + +if (permissionType.equals("complex")) { + mapIn = [:]; + mapIn.userLogin = userLogin; + targetOperationList = StringUtil.split(targetOperation, "|"); + mapIn.targetOperationList = targetOperationList; + thisContentId = null; + + //Debug.logInfo("in permprep, userLogin(1):" + userLogin, null); + //if (userLogin != null) { + //Debug.logInfo("in permprep, userLoginId(1):" + userLogin.get("userLoginId"), null); + //} + if (!currentValue || !"Content".equals(entityName)) { + permissionIdName = context.permissionIdName; + //org.ofbiz.base.util.Debug.logInfo("in permprep, permissionIdName(1):" + permissionIdName, null); + if (!permissionIdName) { + thisContentId = ContentManagementWorker.getFromSomewhere(permissionIdName, paramMap, request, context); + } else if (!thisContentId) { + thisContentId = ContentManagementWorker.getFromSomewhere("subContentId", paramMap, request, context); + } else if (!thisContentId) { + thisContentId = ContentManagementWorker.getFromSomewhere("contentIdTo", paramMap, request, context); + } else if (!thisContentId) { + thisContentId = ContentManagementWorker.getFromSomewhere("contentId", paramMap, request, context); + } + //org.ofbiz.base.util.Debug.logInfo("in permprep, thisContentId(2):" + thisContentId, null); + } else { + thisContentId = currentValue.contentId; + } + //org.ofbiz.base.util.Debug.logInfo("in permprep, thisContentId(3):" + thisContentId, null); + + if (!currentValue || !"Content".equals(entityName)) { + if (thisContentId) { + currentValue = from("Content").where("contentId", thisContentId).queryOne(); + } + } + if ("add".equals(mode)) { + addEntityOperation = context.addEntityOperation; + if (addEntityOperation) { + entityOperation = addEntityOperation; + } + } else { + editEntityOperation = context.editEntityOperation; + if (editEntityOperation) { + entityOperation = editEntityOperation; + } + } + //org.ofbiz.base.util.Debug.logInfo("in permprep, currentValue(2):" + currentValue, null); + if ("Content".equals(currentValue?.getEntityName())) { + mapIn.currentContent = currentValue; + } + mapIn.entityOperation = entityOperation; + + contentPurposeTypeId = context.contentPurposeTypeId; + if (contentPurposeTypeId) { + mapIncontentPurposeList = StringUtil.split(contentPurposeTypeId, "|"); + } + + //org.ofbiz.base.util.Debug.logInfo("in permprep, mapIn:" + mapIn, null); + result = runService('checkContentPermission', mapIn); + permissionStatus = result.permissionStatus; + //org.ofbiz.base.util.Debug.logInfo("in permprep, permissionStatus:" + permissionStatus, null); + if ("granted".equals(permissionStatus)) { + context.hasPermission = true; + request.setAttribute("hasPermission", true); + request.setAttribute("permissionStatus", "granted"); + } else { + context.hasPermission = false; + request.setAttribute("hasPermission", false); + request.setAttribute("permissionStatus", ""); + errorMessage = "Permission to display:" + page.getPageName() + " is denied."; + recorder = result.permissionRecorder; + //Debug.logInfo("recorder(0):" + recorder, ""); + if (recorder) { + permissionMessage = recorder.toHtml(); + //Debug.logInfo("permissionMessage(0):" + permissionMessage, ""); + errorMessage += " \n " + permissionMessage; + } + request.setAttribute("errorMsgReq", errorMessage); + } + //Debug.logInfo("in permprep, contentId(1):" + request.getAttribute("contentId"),""); +} else { + //org.ofbiz.base.util.Debug.logInfo("permission:" + permission , null); + //org.ofbiz.base.util.Debug.logInfo("entityOperation:" + entityOperation , null); + if (security.hasEntityPermission(permission, entityOperation, session)) { + //org.ofbiz.base.util.Debug.logInfo("hasEntityPermission is true:" , null); + context.hasPermission = true; + request.setAttribute("hasPermission", true); + request.setAttribute("permissionStatus", "granted"); + } else { + //org.ofbiz.base.util.Debug.logInfo("hasEntityPermission is false:" , null); + context.hasPermission = false; + request.setAttribute("hasPermission", false); + request.setAttribute("permissionStatus", ""); + } +} diff --git a/src/org/apache/ofbiz/ecommerce/forum/PubInit.groovy b/src/org/apache/ofbiz/ecommerce/forum/PubInit.groovy new file mode 100644 index 0000000..a2fc188 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/forum/PubInit.groovy @@ -0,0 +1,57 @@ +/* + * 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 java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; +import org.ofbiz.base.util.*; +import org.ofbiz.entity.*; +import org.ofbiz.security.*; +import org.ofbiz.service.*; +import org.ofbiz.entity.model.*; +import org.ofbiz.webapp.website.WebSiteWorker; +import org.ofbiz.widget.renderer.html.HtmlFormWrapper; +import org.ofbiz.securityext.login.*; +import org.ofbiz.common.*; +import org.ofbiz.entity.model.*; +import org.ofbiz.content.ContentManagementWorker; + +import javax.servlet.*; +import javax.servlet.http.*; + +paramMap = UtilHttp.getParameterMap(request); +forumId = null; +servletContext = session.getServletContext(); +rootForumId = WebSiteWorker.getWebSiteId(request); +context.rootPubId = rootForumId; +session.setAttribute("rootPubId", rootForumId); +request.setAttribute("rootPubId", rootForumId); +forumId = ContentManagementWorker.getFromSomewhere("forumId", paramMap, request, context); +if (forumId) { + forumId = rootForumId; +} +context.forumId = forumId; +session.setAttribute("forumId", forumId); +request.setAttribute("forumId", forumId); diff --git a/src/org/apache/ofbiz/ecommerce/forum/RespondPermAndPrep.groovy b/src/org/apache/ofbiz/ecommerce/forum/RespondPermAndPrep.groovy new file mode 100644 index 0000000..c1c8225 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/forum/RespondPermAndPrep.groovy @@ -0,0 +1,156 @@ +/* + * 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 java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; + +import org.ofbiz.base.util.*; +import org.ofbiz.entity.*; +import org.ofbiz.security.*; +import org.ofbiz.service.*; +import org.ofbiz.entity.model.*; +import org.ofbiz.widget.renderer.html.HtmlFormWrapper; +import org.ofbiz.content.content.PermissionRecorder; + +import javax.servlet.*; +import javax.servlet.http.*; + +paramMap = UtilHttp.getParameterMap(request); + +contentIdTo = paramMap.contentIdTo; +if (!contentIdTo) { + request.setAttribute("errorMsgReq", "contentIdTo is empty"); + return; +} + +/* +pubPt = paramMap.pubPt ?: context.pubPt; +if (!pubPt) { + request.setAttribute("errorMsgReq", "pubPt is empty"); + return; +} +*/ + +contentToValue = from("Content").where("contentId", contentIdTo).queryOne(); +contentToPurposeList = contentToValue.getRelated("ContentPurpose", null, null, true); +currentValue = delegator.makeValue("Content", [contentTypeId : "DOCUMENT", statusId : "CTNT_PUBLISHED", privilegeEnumId : "_00_"]); + +if (contentToPurposeList.contains("RESPONSE")) { + ownerContentId = contentToValue.ownerContentId; + currentValue.ownerContentId = ownerContentId; +} else { + contentId = contentToValue.contentId; + currentValueownerContentId = contentId; +} + +mapIn = [:]; +mapIn.userLogin = userLogin; +targetOperationList = StringUtil.split(context.targetOperation, "|"); +mapIn.targetOperationList = targetOperationList; + +if (currentValue) { + mapIn.currentContent = currentValue; +} +mapIn.entityOperation = "_CREATE"; +mapIn.contentPurposeList = ["RESPONSE"]; + +//org.ofbiz.base.util.Debug.logInfo("in permprep, mapIn:" + mapIn, null); +result = runService('checkContentPermission', mapIn); +permissionStatus = result.permissionStatus; +//org.ofbiz.base.util.Debug.logInfo("permissionStatus:" + permissionStatus, null); +if (!"granted".equals(permissionStatus)) { + request.setAttribute("errorMsgReq", "Permission to add response is denied (1)"); + errorMessage = "Permission to add response is denied (2)"; + recorder = result.permissionRecorder; + //Debug.logInfo("recorder(0):" + recorder, ""); + if (recorder) { + permissionMessage = recorder.toHtml(); + //Debug.logInfo("permissionMessage(0):" + permissionMessage, ""); + errorMessage += " \n " + permissionMessage; + } + request.setAttribute("permissionErrorMsg", errorMessage); + context.permissionErrorMsg = errorMessage; + context.hasPermission = false; + request.setAttribute("hasPermission", false); + request.setAttribute("permissionStatus", ""); + return; +} else { + context.hasPermission = true; + request.setAttribute("hasPermission", true); + request.setAttribute("permissionStatus", "granted"); +} + +/* +pubContentValue = delegator.findOne("Content", [contentId : pubPt], false); +if (pubContentValue) { + mapIn.currentContent = pubContentValue; + mapIn.statusId = "CTNT_PUBLISHED"; +} +//org.ofbiz.base.util.Debug.logInfo("in permprep(2), mapIn:" + mapIn, null); +result = dispatcher.runSync("checkContentPermission", mapIn); +permissionStatus = result.permissionStatus; +//org.ofbiz.base.util.Debug.logInfo("permissionStatus(2):" + permissionStatus, null); +if (!"granted".equals(permissionStatus)) { + + request.setAttribute("errorMsgReq", "Permission to add response is denied (2)"); + errorMessage = "Permission to add response is denied (2)"; + recorder = result.permissionRecorder; + //Debug.logInfo("recorder(0):" + recorder, ""); + if (recorder) { + permissionMessage = recorder.toHtml(); + //Debug.logInfo("permissionMessage(0):" + permissionMessage, ""); + errorMessage += " \n " + permissionMessage; + } + request.setAttribute("permissionErrorMsg", errorMessage); + context.permissionErrorMsg = errorMessage; + context.hasPermission = false; + request.setAttribute("hasPermission", false); + request.setAttribute("permissionStatus", ""); + return; +} else { + context.hasPermission = true; + request.setAttribute("hasPermission", true); + request.setAttribute("permissionStatus", "granted"); +} +*/ + +request.setAttribute("currentValue", currentValue); +singleWrapper = context.singleWrapper; +singleWrapper.putInContext("contentPurposeTypeId", context.contentPurposeTypeId); +singleWrapper.putInContext("targetOperation", context.targetOperation); +singleWrapper.putInContext("targetOperationString", context.targetOperation); +singleWrapper.putInContext("currentValue", currentValue); + +trailList = context.trailList; +replyName = null; +if (trailList) { + idNamePair = trailList[trailList.size() -1]; + replyName = idNamePair[1]; + if (!replyName.contains("RE:")) { + replyName = "RE:" + replyName; + } +} +singleWrapper.putInContext("replyName", [contentName : replyName, description : replyName]); diff --git a/src/org/apache/ofbiz/ecommerce/forum/ResponsePrep.groovy b/src/org/apache/ofbiz/ecommerce/forum/ResponsePrep.groovy new file mode 100644 index 0000000..b43bf1e --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/forum/ResponsePrep.groovy @@ -0,0 +1,76 @@ +/* + * 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 java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; + +import org.ofbiz.base.util.*; +import org.ofbiz.entity.*; +import org.ofbiz.security.*; +import org.ofbiz.service.*; +import org.ofbiz.entity.model.*; +import org.ofbiz.widget.renderer.html.HtmlFormWrapper; +import org.ofbiz.securityext.login.*; +import org.ofbiz.common.*; +import org.ofbiz.content.content.ContentWorker; + +import javax.servlet.*; +import javax.servlet.http.*; + +paramMap = UtilHttp.getParameterMap(request); + + +contentIdTo = paramMap.contentIdTo; +nodeTrailCsv = paramMap.nodeTrailCsv; +//Debug.logInfo("in viewprep, nodeTrailCsv:" + nodeTrailCsv,""); +context.nodeTrailCsv = nodeTrailCsv; +contentId = paramMap.contentIdTo; +context.subContentId = contentId; +context.contentIdTo = contentId; + +trail = StringUtil.split(nodeTrailCsv, ","); +siteAncestorList = []; +idList = []; +if (trail) { + pubPt = trail[0]; + ContentWorker.getContentAncestry(delegator, pubPt, "SUBSITE", "To", idList); + idList.add(pubPt); +} + +// start at 1 to skip webSiteId +idList.each { id -> + webSitePublishPoint = from("WebSitePublishPoint").where("contentId", id).cache(true).queryOne(); + siteAncestorList.add(webSitePublishPoint); +} +context.siteAncestorList = siteAncestorList; +//Debug.logInfo("in viewprep, siteAncestorList:" + siteAncestorList,""); + +singleWrapper = context.singleWrapper; +// singleWrapper.putInContext("pageName", page.getPageName()); +singleWrapper.putInContext("contentIdTo", contentIdTo); +singleWrapper.putInContext("summaryDataResourceTypeId", null); +singleWrapper.putInContext("mapKey", null); +singleWrapper.putInContext("nodeTrailCsv", nodeTrailCsv); diff --git a/src/org/apache/ofbiz/ecommerce/forum/ViewPrep.groovy b/src/org/apache/ofbiz/ecommerce/forum/ViewPrep.groovy new file mode 100644 index 0000000..49214ce --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/forum/ViewPrep.groovy @@ -0,0 +1,72 @@ +/* + * 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 java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; + +import org.ofbiz.base.util.*; +import org.ofbiz.entity.*; +import org.ofbiz.security.*; +import org.ofbiz.service.*; +import org.ofbiz.entity.model.*; +import org.ofbiz.widget.renderer.html.HtmlFormWrapper; +import org.ofbiz.securityext.login.*; +import org.ofbiz.common.*; +import org.ofbiz.content.content.ContentWorker; +import org.ofbiz.content.ContentManagementWorker; + +import javax.servlet.*; +import javax.servlet.http.*; + +paramMap = UtilHttp.getParameterMap(request); + +// Strip old VIEW_INDEX from query string if present +//since we are adding them again. +temp = request.getQueryString(); +queryString = UtilHttp.stripViewParamsFromQueryString(temp); +//Debug.logInfo("in viewprep, queryString(1):" + queryString,""); +context.queryString = queryString; +//Debug.logInfo("in viewprep, queryString(2):" + queryString,""); + +requestURL = request.getRequestURL(); +//Debug.logInfo("in viewprep, requestURL(3):" + requestURL,""); +context.requestURL = requestURL; +viewSize = paramMap.VIEW_SIZE; +context.viewSize = viewSize; +//Debug.logInfo("in viewprep, viewSize(3):" + viewSize,""); +viewIndex = paramMap.VIEW_INDEX; +context.viewIndex = viewIndex; +//Debug.logInfo("in viewprep, viewIndex(3):" + viewIndex,""); + +nodeTrailCsv = ContentManagementWorker.getFromSomewhere("nodeTrailCsv", paramMap, request, context); +context.nodeTrailCsv = nodeTrailCsv; +contentId = ContentManagementWorker.getFromSomewhere("contentId", paramMap, request, context); +//Debug.logInfo("in viewprep, contentId(3):" + contentId,""); +context.subContentId = contentId; +context.contentIdTo = contentId; +forumId = ContentManagementWorker.getFromSomewhere("forumId", paramMap, request, context); +//forumContent = delegator.findOne("Content", [contentId : forumId], true); +//context.forumContent = forumContent; diff --git a/src/org/apache/ofbiz/ecommerce/includes/MruAdd.groovy b/src/org/apache/ofbiz/ecommerce/includes/MruAdd.groovy new file mode 100644 index 0000000..bf30075 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/includes/MruAdd.groovy @@ -0,0 +1,72 @@ +/* + * 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 java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; + +import org.ofbiz.base.util.*; +import org.ofbiz.entity.*; +import org.ofbiz.security.*; +import org.ofbiz.service.*; +import org.ofbiz.entity.model.*; +import org.ofbiz.widget.renderer.html.HtmlFormWrapper; +import org.ofbiz.content.ContentManagementWorker; +import org.ofbiz.content.content.ContentWorker; +import org.ofbiz.base.util.collections.LifoSet; + +import javax.servlet.*; +import javax.servlet.http.*; + +lookupCaches = session.getAttribute("lookupCaches"); +//org.ofbiz.base.util.Debug.logInfo("entityName:" + entityName, ""); +//org.ofbiz.base.util.Debug.logInfo("in MruAdd.groovy, lookupCaches:" + lookupCaches, ""); + +if (!lookupCaches) { + lookupCaches = [:]; + session.setAttribute("lookupCaches", lookupCaches); +} + +cacheEntityName = entityName; +//Debug.logInfo("cacheEntityName:" + cacheEntityName, ""); +lifoSet = lookupCaches[cacheEntityName]; +//org.ofbiz.base.util.Debug.logInfo("lifoSet:" + lifoSet, ""); +if (!lifoSet) { + lifoSet = new LifoSet(10); + lookupCaches[cacheEntityName] = lifoSet; +} + +paramMap = UtilHttp.getParameterMap(request); +contentId = paramMap.contentId; +contentAssocDataResourceViewFrom = ContentWorker.getSubContentCache(delegator, null, null, contentId, null, null, null, null, null); +//Debug.logInfo("in mruadd, contentAssocDataResourceViewFrom :" + contentAssocDataResourceViewFrom , ""); +if (contentAssocDataResourceViewFrom) { + lookupCaches = session.getAttribute("lookupCaches"); + viewPK = contentAssocDataResourceViewFrom.getPrimaryKey(); + //Debug.logInfo("in mruadd, viewPK :" + viewPK , ""); + if (viewPK) { + ContentManagementWorker.mruAdd(session, viewPK); + } +} diff --git a/src/org/apache/ofbiz/ecommerce/janrain/JanrainHelper.java b/src/org/apache/ofbiz/ecommerce/janrain/JanrainHelper.java new file mode 100644 index 0000000..53717b4 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/janrain/JanrainHelper.java @@ -0,0 +1,247 @@ +/******************************************************************************* + * 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. + *******************************************************************************/ +package org.ofbiz.ecommerce.janrain; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.io.UnsupportedEncodingException; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLEncoder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathExpressionException; +import javax.xml.xpath.XPathFactory; + +import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilHttp; +import org.ofbiz.base.util.UtilProperties; +import org.ofbiz.base.util.UtilValidate; +import org.ofbiz.base.util.UtilXml; +import org.ofbiz.entity.Delegator; +import org.ofbiz.entity.GenericEntityException; +import org.ofbiz.entity.GenericValue; +import org.ofbiz.entity.util.EntityQuery; +import org.ofbiz.webapp.control.LoginWorker; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; + +/** + * Java Helper Class for Janrain Engage + */ +public class JanrainHelper { + + public static final String module = JanrainHelper.class.getName(); + private static String apiKey = UtilProperties.getPropertyValue("ecommerce", "janrain.apiKey"); + private static String baseUrl = UtilProperties.getPropertyValue("ecommerce", "janrain.baseUrl"); + public JanrainHelper(String apiKey, String baseUrl) { + while (baseUrl.endsWith("/")) + baseUrl = baseUrl.substring(0, baseUrl.length() - 1); + this.apiKey = apiKey; + this.baseUrl = baseUrl; + } + public String getApiKey() { return apiKey; } + public String getBaseUrl() { return baseUrl; } + public static Element authInfo(String token) { + Map query = new HashMap(); + query.put("token", token); + return apiCall("auth_info", query); + } + public HashMap> allMappings() { + Element rsp = apiCall("all_mappings", null); + Element mappings_node = (Element)rsp.getFirstChild(); + HashMap> result = new HashMap>(); + NodeList mappings = getNodeList("/rsp/mappings/mapping", rsp); + for (int i = 0; i < mappings.getLength(); i++) { + Element mapping = (Element)mappings.item(i); + List identifiers = new ArrayList(); + NodeList rk_list = getNodeList("primaryKey", mapping); + NodeList id_list = getNodeList("identifiers/identifier", mapping); + String remote_key = ((Element)rk_list.item(0)).getTextContent(); + for (int j = 0; j < id_list.getLength(); j++) { + Element ident = (Element) id_list.item(j); + identifiers.add(ident.getTextContent()); + } + result.put(remote_key, identifiers); + } + return result; + } + private NodeList getNodeList(String xpath_expr, Element root) { + XPathFactory factory = XPathFactory.newInstance(); + XPath xpath = factory.newXPath(); + try { + return (NodeList) xpath.evaluate(xpath_expr, root, XPathConstants.NODESET); + } catch (XPathExpressionException e) { + return null; + } + } + public List mappings(Object primaryKey) { + Map query = new HashMap(); + query.put("primaryKey", primaryKey); + Element rsp = apiCall("mappings", query); + Element oids = (Element)rsp.getFirstChild(); + List result = new ArrayList(); + NodeList nl = oids.getChildNodes(); + for (int i = 0; i < nl.getLength(); i++) { + Element e = (Element)nl.item(i); + result.add(e.getTextContent()); + } + return result; + } + public void map(String identifier, Object primaryKey) { + Map query = new HashMap(); + query.put("identifier", identifier); + query.put("primaryKey", primaryKey); + apiCall("map", query); + } + public void unmap(String identifier, Object primaryKey) { + Map query = new HashMap(); + query.put("identifier", identifier); + query.put("primaryKey", primaryKey); + apiCall("unmap", query); + } + private static Element apiCall(String methodName, Map partialQuery) { + Map query = null; + if (partialQuery == null) { + query = new HashMap(); + } else { + query = new HashMap(partialQuery); + } + query.put("format", "xml"); + query.put("apiKey", apiKey); + StringBuffer sb = new StringBuffer(); + for (Iterator> it = query.entrySet().iterator(); it.hasNext();) { + if (sb.length() > 0) + sb.append('&'); + try { + Map.Entry e = it.next(); + sb.append(URLEncoder.encode(e.getKey().toString(), "UTF-8")); + sb.append('='); + sb.append(URLEncoder.encode(e.getValue().toString(), "UTF-8")); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException("Unexpected encoding error", e); + } + } + String data = sb.toString(); + try { + URL url = new URL(baseUrl + "/api/v2/" + methodName); + HttpURLConnection conn = (HttpURLConnection)url.openConnection(); + conn.setRequestMethod("POST"); + conn.setDoOutput(true); + conn.connect(); + OutputStreamWriter osw = new OutputStreamWriter( + conn.getOutputStream(), "UTF-8"); + osw.write(data); + osw.close(); + + BufferedReader post = new BufferedReader(new InputStreamReader(conn.getInputStream())); + String line = ""; + StringBuilder buf = new StringBuilder(); + while ((line = post.readLine()) != null) { + buf.append(line); + } + post.close(); + Document tagXml = UtilXml.readXmlDocument(buf.toString()); + Element response = tagXml.getDocumentElement(); + if (!response.getAttribute("stat").equals("ok")) { + throw new RuntimeException("Unexpected API error"); + } + return response; + } catch (MalformedURLException e) { + throw new RuntimeException("Unexpected URL error", e); + } catch (IOException e) { + throw new RuntimeException("Unexpected IO error", e); + } catch (ParserConfigurationException e) { + throw new RuntimeException("Unexpected XML error", e); + } catch (SAXException e) { + throw new RuntimeException("Unexpected XML error", e); + } + } + + public static String janrainCheckLogin(HttpServletRequest request, HttpServletResponse response){ + Delegator delegator = (Delegator) request.getAttribute("delegator"); + String token = request.getParameter("token"); + String errMsg = ""; + if (UtilValidate.isNotEmpty(token)) { + JanrainHelper janrainHelper = new JanrainHelper(apiKey, baseUrl); + Element authInfo = janrainHelper.authInfo(token); + Element profileElement = UtilXml.firstChildElement(authInfo, "profile"); + Element nameElement = UtilXml.firstChildElement(profileElement, "name"); + + // profile element + String displayName = UtilXml.elementValue(UtilXml.firstChildElement(profileElement, "displayName")); + String email = UtilXml.elementValue(UtilXml.firstChildElement(profileElement, "email")); + String identifier = UtilXml.elementValue(UtilXml.firstChildElement(profileElement, "identifier")); + String preferredUsername = UtilXml.elementValue(UtilXml.firstChildElement(profileElement, "preferredUsername")); + String providerName = UtilXml.elementValue(UtilXml.firstChildElement(profileElement, "providerName")); + String url = UtilXml.elementValue(UtilXml.firstChildElement(profileElement, "url")); + + // name element + String givenName = UtilXml.elementValue(UtilXml.firstChildElement(nameElement, "givenName")); + String familyName = UtilXml.elementValue(UtilXml.firstChildElement(nameElement, "familyName")); + String formatted = UtilXml.elementValue(UtilXml.firstChildElement(nameElement, "formatted")); + + if (UtilValidate.isEmpty("preferredUsername")) { + errMsg = UtilProperties.getMessage("SecurityextUiLabels", "loginevents.username_not_found_reenter", UtilHttp.getLocale(request)); + request.setAttribute("_ERROR_MESSAGE_", errMsg); + return "error"; + } + + Map result = new HashMap(); + result.put("displayName", displayName); + result.put("email", email); + result.put("identifier", identifier); + result.put("preferredUsername", preferredUsername); + result.put("providerName", providerName); + result.put("url", url); + result.put("givenName", givenName); + result.put("familyName", familyName); + result.put("formatted", formatted); + request.setAttribute("userInfoMap", result); + + try { + GenericValue userLogin = EntityQuery.use(delegator).from("UserLogin").where("userLoginId", preferredUsername).cache().queryOne(); + if (UtilValidate.isNotEmpty(userLogin)) { + LoginWorker.doBasicLogin(userLogin, request); + LoginWorker.autoLoginSet(request, response); + return "success"; + } else { + return "userLoginMissing"; + } + } catch (GenericEntityException e) { + Debug.logError(e, "Error finding the userLogin for distributed cache clear", module); + } + } + return "success"; + } +} diff --git a/src/org/apache/ofbiz/ecommerce/misc/ThirdPartyEvents.java b/src/org/apache/ofbiz/ecommerce/misc/ThirdPartyEvents.java new file mode 100644 index 0000000..88702d2 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/misc/ThirdPartyEvents.java @@ -0,0 +1,264 @@ +/******************************************************************************* + * 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. + *******************************************************************************/ +package org.ofbiz.ecommerce.misc; + +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilDateTime; +import org.ofbiz.base.util.UtilHttp; +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; +import org.ofbiz.entity.GenericValue; +import org.ofbiz.entity.util.EntityUtil; + + +public class ThirdPartyEvents { + + public static final String module = ThirdPartyEvents.class.getName(); + + public final static String DISTRIBUTOR_ID = "_DISTRIBUTOR_ID_"; + public final static String AFFILIATE_ID = "_AFFILIATE_ID_"; + + /** Save the association id(s) specified in the request object into the session. + *@param request The HTTPRequest object for the current request + *@param response The HTTPResponse object for the current request + *@return String specifying the exit status of this event + */ + public static String setAssociationId(HttpServletRequest request, HttpServletResponse response) { + Map requestParams = UtilHttp.getParameterMap(request); + + // check distributor + String distriParam[] = { "distributor_id", "distributorid", "distributor" }; + String distributorId = null; + + for (int i = 0; i < distriParam.length; i++) { + String param = distriParam[i]; + + if (requestParams.containsKey(param)) { + distributorId = (String) requestParams.get(param); + break; + } else if (requestParams.containsKey(param.toUpperCase())) { + distributorId = (String) requestParams.get(param.toUpperCase()); + break; + } + } + + // check affiliate + String affiliParam[] = { "affiliate_id", "affiliateid", "affiliate", "affil" }; + String affiliateId = null; + + for (int i = 0; i < affiliParam.length; i++) { + String param = affiliParam[i]; + + if (requestParams.containsKey(param)) { + affiliateId = (String) requestParams.get(param); + break; + } else if (requestParams.containsKey(param.toUpperCase())) { + affiliateId = (String) requestParams.get(param.toUpperCase()); + break; + } + } + + if (UtilValidate.isNotEmpty(distributorId)) { + request.getSession().setAttribute(DISTRIBUTOR_ID, distributorId); + updateAssociatedDistributor(request, response); + } + if (UtilValidate.isNotEmpty(affiliateId)) { + request.getSession().setAttribute(AFFILIATE_ID, affiliateId); + updateAssociatedAffiliate(request, response); + } + + return "success"; + } + + /** Update the distributor association for the logged in user, if possible. + *@param request The HTTPRequest object for the current request + *@param response The HTTPResponse object for the current request + *@return String specifying the exit status of this event + */ + public static String updateAssociatedDistributor(HttpServletRequest request, HttpServletResponse response) { + Delegator delegator = (Delegator) request.getAttribute("delegator"); + GenericValue userLogin = (GenericValue) request.getSession().getAttribute("userLogin"); + GenericValue party = null; + + java.net.URL ecommercePropertiesUrl = null; + + try { + ecommercePropertiesUrl = ((ServletContext) request.getAttribute("servletContext")).getResource("/WEB-INF/ecommerce.properties"); + } catch (java.net.MalformedURLException e) { + Debug.logWarning(e, module); + } + + String store = UtilProperties.getPropertyValue(ecommercePropertiesUrl, "distributor.store.customer"); + + if (store == null || store.toUpperCase().startsWith("N")) { + return "success"; + } + + String storeOnClick = UtilProperties.getPropertyValue(ecommercePropertiesUrl, "distributor.store.onclick"); + + if (storeOnClick == null || storeOnClick.toUpperCase().startsWith("N")) { + return "success"; + } + + try { + party = userLogin == null ? null : userLogin.getRelatedOne("Party", false); + } catch (GenericEntityException gee) { + Debug.logWarning(gee, module); + } + + if (party != null) { + // if a distributorId is already associated, it will be used instead + String currentDistributorId = getId(party, "DISTRIBUTOR"); + + if (UtilValidate.isEmpty(currentDistributorId)) { + String distributorId = (String) request.getSession().getAttribute(DISTRIBUTOR_ID); + + if (UtilValidate.isNotEmpty(distributorId)) { + List toBeStored = new LinkedList(); + + // create distributor Party ?? why? + // create distributor PartyRole ?? why? + // create PartyRelationship + GenericValue partyRelationship = delegator.makeValue("PartyRelationship", UtilMisc.toMap("partyIdFrom", party.getString("partyId"), "partyIdTo", distributorId, "roleTypeIdFrom", "CUSTOMER", "roleTypeIdTo", "DISTRIBUTOR")); + + partyRelationship.set("fromDate", UtilDateTime.nowTimestamp()); + partyRelationship.set("partyRelationshipTypeId", "DISTRIBUTION_CHANNEL"); + toBeStored.add(partyRelationship); + + toBeStored.add(delegator.makeValue("Party", UtilMisc.toMap("partyId", distributorId))); + toBeStored.add(delegator.makeValue("PartyRole", UtilMisc.toMap("partyId", distributorId, "roleTypeId", "DISTRIBUTOR"))); + try { + delegator.storeAll(toBeStored); + if (Debug.infoOn()) Debug.logInfo("Distributor for user " + party.getString("partyId") + " set to " + distributorId, module); + } catch (GenericEntityException gee) { + Debug.logWarning(gee, module); + } + } else { + // no distributorId is available + Debug.logInfo("No distributor in session or already associated with user " + userLogin.getString("partyId"), module); + return "success"; + } + } else { + request.getSession().setAttribute(DISTRIBUTOR_ID, currentDistributorId); + } + + return "success"; + } else { + // not logged in + Debug.logWarning("Cannot associate distributor since not logged in yet", module); + return "success"; + } + } + + /** Update the affiliate association for the logged in user, if possible. + *@param request The HTTPRequest object for the current request + *@param response The HTTPResponse object for the current request + *@return String specifying the exit status of this event + */ + public static String updateAssociatedAffiliate(HttpServletRequest request, HttpServletResponse response) { + Delegator delegator = (Delegator) request.getAttribute("delegator"); + GenericValue userLogin = (GenericValue) request.getSession().getAttribute("userLogin"); + GenericValue party = null; + + java.net.URL ecommercePropertiesUrl = null; + + try { + ecommercePropertiesUrl = ((ServletContext) request.getAttribute("servletContext")).getResource("/WEB-INF/ecommerce.properties"); + } catch (java.net.MalformedURLException e) { + Debug.logWarning(e, module); + } + + String store = UtilProperties.getPropertyValue(ecommercePropertiesUrl, "affiliate.store.customer"); + + if (store == null || store.toUpperCase().startsWith("N")) + return "success"; + String storeOnClick = UtilProperties.getPropertyValue(ecommercePropertiesUrl, "affiliate.store.onclick"); + + if (storeOnClick == null || storeOnClick.toUpperCase().startsWith("N")) + return "success"; + + try { + party = userLogin == null ? null : userLogin.getRelatedOne("Party", false); + } catch (GenericEntityException gee) { + Debug.logWarning(gee, module); + } + + if (party != null) { + // if a distributorId is already associated, it will be used instead + String currentAffiliateId = getId(party, "AFFILIATE"); + + if (UtilValidate.isEmpty(currentAffiliateId)) { + String affiliateId = (String) request.getSession().getAttribute(AFFILIATE_ID); + + if (UtilValidate.isNotEmpty(affiliateId)) { + // create PartyRelationship + GenericValue partyRelationship = delegator.makeValue("PartyRelationship", UtilMisc.toMap("partyIdFrom", party.getString("partyId"), "partyIdTo", affiliateId, "roleTypeIdFrom", "CUSTOMER", "roleTypeIdTo", "AFFILIATE")); + + partyRelationship.set("fromDate", UtilDateTime.nowTimestamp()); + partyRelationship.set("partyRelationshipTypeId", "SALES_AFFILIATE"); + try { + delegator.create(partyRelationship); + if (Debug.infoOn()) Debug.logInfo("Affiliate for user " + party.getString("partyId") + " set to " + affiliateId, module); + } catch (GenericEntityException gee) { + Debug.logWarning(gee, module); + } + } else { + // no distributorId is available + Debug.logInfo("No affiliate in session or already associated with user " + userLogin.getString("partyId"), module); + return "success"; + } + } else { + request.getSession().setAttribute(AFFILIATE_ID, currentAffiliateId); + } + + return "success"; + } else { + // not logged in + Debug.logWarning("Cannot associate affiliate since not logged in yet", module); + return "success"; + } + } + + private static GenericValue getPartyRelationship(GenericValue party, String roleTypeTo) { + try { + return EntityUtil.getFirst(EntityUtil.filterByDate(party.getRelated("FromPartyRelationship", UtilMisc.toMap("roleTypeIdTo", roleTypeTo), null, false), true)); + } catch (GenericEntityException gee) { + Debug.logWarning(gee, module); + } + return null; + } + + private static String getId(GenericValue party, String roleTypeTo) { + GenericValue partyRelationship = getPartyRelationship(party, roleTypeTo); + + return partyRelationship == null ? null : partyRelationship.getString("partyIdTo"); + } + +} diff --git a/src/org/apache/ofbiz/ecommerce/order/AnonymousCheckoutLinks.groovy b/src/org/apache/ofbiz/ecommerce/order/AnonymousCheckoutLinks.groovy new file mode 100644 index 0000000..4d6c61c --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/order/AnonymousCheckoutLinks.groovy @@ -0,0 +1,46 @@ +/* + * 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.order.shoppingcart.ShoppingCartEvents; + +shoppingCart = ShoppingCartEvents.getCartObject(request); + +if (userLogin) { + context.enableShippingAddress = true; +} + +shippingContactMechId = shoppingCart.getShippingContactMechId(); +if (shippingContactMechId) { + context.enableShipmentMethod = true; +} + +shipmentMethodTypeId = shoppingCart.getShipmentMethodTypeId(); +if (shipmentMethodTypeId) { + context.enablePaymentOptions = true; +} + +paymentMethodIds = shoppingCart.getPaymentMethodIds(); +paymentMethodTypeId = parameters.paymentMethodTypeId; +if (paymentMethodIds || paymentMethodTypeId) { + context.enablePaymentInformation = true; +} + +if (paymentMethodIds) { + context.enableReviewOrder = true; +} diff --git a/src/org/apache/ofbiz/ecommerce/order/AnonymousTrail.groovy b/src/org/apache/ofbiz/ecommerce/order/AnonymousTrail.groovy new file mode 100644 index 0000000..ab366c4 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/order/AnonymousTrail.groovy @@ -0,0 +1,42 @@ +/* + * 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.order.shoppingcart.*; + +cart = session.getAttribute("shoppingCart"); + +trailClassMap = [:]; + +if (cart.getShippingContactMechId()) { + context.shipAddr = "Y"; + trailClassMap.shipAddr = "submenutextright"; +} + +if (cart.getShipmentMethodTypeId()) { + context.shipOptions = "Y"; + trailClassMap.shipAddr = "submenutext"; + trailClassMap.shipOptions = "submenutextright"; +} + +if (parameters.paymentMethodType || cart.getPaymentMethodIds() || cart.getPaymentMethodTypeIds()) { + context.billing = "Y"; + trailClassMap.shipOptions = "submenutext"; + trailClassMap.paymentType = "submenutextright"; +} +context.trailClass = trailClassMap; diff --git a/src/org/apache/ofbiz/ecommerce/order/BillSettings.groovy b/src/org/apache/ofbiz/ecommerce/order/BillSettings.groovy new file mode 100644 index 0000000..933c388 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/order/BillSettings.groovy @@ -0,0 +1,108 @@ +/* + * 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.entity.*; +import org.ofbiz.entity.util.*; +import org.ofbiz.base.util.*; +import org.ofbiz.accounting.payment.*; +import org.ofbiz.order.shoppingcart.*; +import org.ofbiz.party.contact.*; + +cart = session.getAttribute("shoppingCart"); +currencyUomId = cart.getCurrency(); +payType = parameters.paymentMethodType; +if (!payType && parameters.useGc) { + payType = "GC"; +} +context.cart = cart; +context.paymentMethodType = payType; + +partyId = cart.getPartyId() ?: userLogin.partyId; +context.partyId = partyId; + +// nuke the event messages +request.removeAttribute("_EVENT_MESSAGE_"); + +if (partyId && !partyId.equals("_NA_")) { + party = from("Party").where("partyId", partyId).queryOne(); + person = party.getRelatedOne("Person", false); + context.party = party; + context.person = person; + if (party) { + context.paymentMethodList = EntityUtil.filterByDate(party.getRelated("PaymentMethod", null, null, false)); + + billingAccountList = BillingAccountWorker.makePartyBillingAccountList(userLogin, currencyUomId, partyId, delegator, dispatcher); + if (billingAccountList) { + context.selectedBillingAccountId = cart.getBillingAccountId(); + context.billingAccountList = billingAccountList; + } + } +} + +if (parameters.useShipAddr && cart.getShippingContactMechId()) { + shippingContactMech = cart.getShippingContactMechId(); + postalAddress = from("PostalAddress").where("contactMechId", shippingContactMech).queryOne(); + context.useEntityFields = "Y"; + context.postalFields = postalAddress; + + if (postalAddress && partyId) { + partyContactMech = from("PartyContactMech").where("partyId", partyId, "contactMechId", postalAddress.contactMechId).orderBy("-fromDate").filterByDate().queryFirst(); + context.partyContactMech = partyContactMech; + } +} else { + context.postalFields = UtilHttp.getParameterMap(request); +} + +if (cart && !parameters.singleUsePayment) { + if (cart.getPaymentMethodIds() ) { + checkOutPaymentId = cart.getPaymentMethodIds()[0]; + context.checkOutPaymentId = checkOutPaymentId; + paymentMethod = from("PaymentMethod").where("paymentMethodId", checkOutPaymentId).queryOne(); + account = null; + + if ("CREDIT_CARD".equals(paymentMethod.paymentMethodTypeId)) { + account = paymentMethod.getRelatedOne("CreditCard", false); + context.creditCard = account; + context.paymentMethodType = "CC"; + } else if ("EFT_ACCOUNT".equals(paymentMethod.paymentMethodTypeId)) { + account = paymentMethod.getRelatedOne("EftAccount", false); + context.eftAccount = account; + context.paymentMethodType = "EFT"; + } else if ("GIFT_CARD".equals(paymentMethod.paymentMethodTypeId)) { + account = paymentMethod.getRelatedOne("GiftCard", false); + context.giftCard = account; + context.paymentMethodType = "GC"; + } else { + context.paymentMethodType = "offline"; + } + if (account && parameters.useShipAddr) { + address = account.getRelatedOne("PostalAddress", false); + context.postalAddress = address; + context.postalFields = address; + } + } else if (cart.getPaymentMethodTypeIds()) { + checkOutPaymentId = cart.getPaymentMethodTypeIds()[0]; + context.checkOutPaymentId = checkOutPaymentId; + } +} + +requestPaymentMethodType = parameters.paymentMethodType; +if (requestPaymentMethodType) { + context.paymentMethodType = requestPaymentMethodType; +} diff --git a/src/org/apache/ofbiz/ecommerce/order/CheckoutReview.groovy b/src/org/apache/ofbiz/ecommerce/order/CheckoutReview.groovy new file mode 100644 index 0000000..7ee31da --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/order/CheckoutReview.groovy @@ -0,0 +1,110 @@ +/* + * 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 java.lang.*; +import org.ofbiz.base.util.*; +import org.ofbiz.entity.*; +import org.ofbiz.accounting.payment.*; +import org.ofbiz.order.order.*; +import org.ofbiz.party.contact.*; +import org.ofbiz.product.catalog.*; +import org.ofbiz.product.store.*; +import org.ofbiz.webapp.website.WebSiteWorker; + +cart = session.getAttribute("shoppingCart"); +context.cart = cart; + +orderItems = cart.makeOrderItems(); +context.orderItems = orderItems; + +orderAdjustments = cart.makeAllAdjustments(); + +orderItemShipGroupInfo = cart.makeAllShipGroupInfos(); +if (orderItemShipGroupInfo) { + orderItemShipGroupInfo.each { valueObj -> + if ("OrderAdjustment".equals(valueObj.getEntityName())) { + // shipping / tax adjustment(s) + orderAdjustments.add(valueObj); + } + } +} +context.orderAdjustments = orderAdjustments; + +workEfforts = cart.makeWorkEfforts(); // if required make workefforts for rental fixed assets too. +context.workEfforts = workEfforts; + +orderHeaderAdjustments = OrderReadHelper.getOrderHeaderAdjustments(orderAdjustments, null); +context.orderHeaderAdjustments = orderHeaderAdjustments; +context.orderItemShipGroups = cart.getShipGroups(); +context.headerAdjustmentsToShow = OrderReadHelper.filterOrderAdjustments(orderHeaderAdjustments, true, false, false, false, false); + +orderSubTotal = OrderReadHelper.getOrderItemsSubTotal(orderItems, orderAdjustments, workEfforts); +context.orderSubTotal = orderSubTotal; +context.placingCustomerPerson = userLogin?.getRelatedOne("Person", false); +context.paymentMethods = cart.getPaymentMethods(); + +paymentMethodTypeIds = cart.getPaymentMethodTypeIds(); +paymentMethodType = null; +paymentMethodTypeId = null; +if (paymentMethodTypeIds) { + paymentMethodTypeId = paymentMethodTypeIds[0]; + paymentMethodType = from("PaymentMethodType").where("paymentMethodTypeId", paymentMethodTypeId).queryOne(); + context.paymentMethodType = paymentMethodType; +} + +webSiteId = WebSiteWorker.getWebSiteId(request); + +productStore = ProductStoreWorker.getProductStore(request); +context.productStore = productStore; + +isDemoStore = !"N".equals(productStore.isDemoStore); +context.isDemoStore = isDemoStore; + +payToPartyId = productStore.payToPartyId; +paymentAddress = PaymentWorker.getPaymentAddress(delegator, payToPartyId); +if (paymentAddress) context.paymentAddress = paymentAddress; + + +// TODO: FIXME! +/* +billingAccount = cart.getBillingAccountId() ? delegator.findOne("BillingAccount", [billingAccountId : cart.getBillingAccountId()], false) : null; +if (billingAccount) + context.billingAccount = billingAccount; +*/ + +context.customerPoNumber = cart.getPoNumber(); +context.carrierPartyId = cart.getCarrierPartyId(); +context.shipmentMethodTypeId = cart.getShipmentMethodTypeId(); +context.shippingInstructions = cart.getShippingInstructions(); +context.maySplit = cart.getMaySplit(); +context.giftMessage = cart.getGiftMessage(); +context.isGift = cart.getIsGift(); +context.currencyUomId = cart.getCurrency(); + +shipmentMethodType = from("ShipmentMethodType").where("shipmentMethodTypeId", cart.getShipmentMethodTypeId()).queryOne(); +if (shipmentMethodType) context.shipMethDescription = shipmentMethodType.description; + +orh = new OrderReadHelper(orderAdjustments, orderItems); +context.localOrderReadHelper = orh; +context.orderShippingTotal = cart.getTotalShipping(); +context.orderTaxTotal = cart.getTotalSalesTax(); +context.orderGrandTotal = cart.getGrandTotal(); + +// nuke the event messages +request.removeAttribute("_EVENT_MESSAGE_"); diff --git a/src/org/apache/ofbiz/ecommerce/order/CheckoutShippingOptions.groovy b/src/org/apache/ofbiz/ecommerce/order/CheckoutShippingOptions.groovy new file mode 100644 index 0000000..dbebb0c --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/order/CheckoutShippingOptions.groovy @@ -0,0 +1,45 @@ +/* + * 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.*; +import org.ofbiz.entity.*; +import org.ofbiz.entity.util.*; +import org.ofbiz.party.contact.*; +import org.ofbiz.product.store.*; +import org.ofbiz.order.shoppingcart.shipping.*; + +cart = session.getAttribute("shoppingCart"); +party = userLogin.getRelatedOne("Party", false); +productStore = ProductStoreWorker.getProductStore(request); + +if (cart) { + shippingEstWpr = new ShippingEstimateWrapper(dispatcher, cart, 0); + context.shippingEstWpr = shippingEstWpr; + context.carrierShipmentMethodList = shippingEstWpr.getShippingMethods(); +} + +context.shoppingCart = cart; +context.userLogin = userLogin; +context.productStoreId = productStore.productStoreId; +context.productStore = productStore; +context.emailList = ContactHelper.getContactMechByType(party, "EMAIL_ADDRESS", false); + +if (cart.getShipmentMethodTypeId() && cart.getCarrierPartyId()) { + context.chosenShippingMethod = cart.getShipmentMethodTypeId() + '@' + cart.getCarrierPartyId(); +} diff --git a/src/org/apache/ofbiz/ecommerce/order/CustSettings.groovy b/src/org/apache/ofbiz/ecommerce/order/CustSettings.groovy new file mode 100644 index 0000000..6320674 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/order/CustSettings.groovy @@ -0,0 +1,99 @@ +/* + * 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.*; +import org.ofbiz.entity.util.EntityUtil; + +partyId = null; + +if (userLogin) { + partyId = userLogin.partyId; +} + +if (!partyId && parameters.partyId) { + partyId = parameters.partyId; +} + +if (partyId) { + parameters.partyId = partyId; + + // NOTE: if there was an error, then don't look up and fill in all of this data, just use the values from the previous request (which will be in the parameters Map automagically) + if (!request.getAttribute("_ERROR_MESSAGE_") && !request.getAttribute("_ERROR_MESSAGE_LIST_")) { + person = from("Person").where("partyId", partyId).queryOne(); + if (person) { + context.callSubmitForm = true; + // should never be null for the anonymous checkout, but just in case + parameters.personalTitle = person.personalTitle; + parameters.firstName = person.firstName; + parameters.middleName = person.middleName; + parameters.lastName = person.lastName; + parameters.suffix = person.suffix; + + //Parameters not in use, Do we really need these here or should be removed. + parameters.residenceStatusEnumId = person.residenceStatusEnumId; + parameters.maritalStatus = person.maritalStatus; + parameters.employmentStatusEnumId = person.employmentStatusEnumId; + parameters.occupation = person.occupation; + parameters.yearsWithEmployer = person.yearsWithEmployer; + parameters.monthsWithEmployer = person.monthsWithEmployer; + parameters.existingCustomer = person.existingCustomer; + + // birthDate -> birthDateDay, birthDateMonth, birthDateYear + birthDate = person.birthDate; + if (birthDate) { + // will be in the format "yyyy-mm-dd", like "2006-10-21" + birthDateString = birthDate.toString(); + parameters.birthDateDay = birthDateString.substring(8); + parameters.birthDateMonth = birthDateString.substring(5, 7); + parameters.birthDateYear = birthDateString.substring(0, 4); + // and finally, the whole thing, just in case we want it that way + parameters.birthDate = birthDateString; + } + } + + // get the Email Address + emailPartyContactDetail = from("PartyContactDetailByPurpose").where("partyId", partyId, "contactMechPurposeTypeId", "PRIMARY_EMAIL").filterByDate().queryFirst(); + if (emailPartyContactDetail) { + parameters.emailContactMechId = emailPartyContactDetail.contactMechId; + parameters.emailAddress = emailPartyContactDetail.infoString; + parameters.emailSol = emailPartyContactDetail.allowSolicitation; + } + + // get the Phone Numbers + homePhonePartyContactDetail = from("PartyContactDetailByPurpose").where("partyId", partyId, "contactMechPurposeTypeId", "PHONE_HOME").filterByDate().queryFirst(); + if (homePhonePartyContactDetail) { + parameters.homePhoneContactMechId = homePhonePartyContactDetail.contactMechId; + parameters.homeCountryCode = homePhonePartyContactDetail.countryCode; + parameters.homeAreaCode = homePhonePartyContactDetail.areaCode; + parameters.homeContactNumber = homePhonePartyContactDetail.contactNumber; + parameters.homeExt = homePhonePartyContactDetail.extension; + parameters.homeSol = homePhonePartyContactDetail.allowSolicitation; + } + + workPhonePartyContactDetail = from("PartyContactDetailByPurpose").where("partyId", partyId, "contactMechPurposeTypeId", "PHONE_WORK").filterByDate().queryFirst(); + if (workPhonePartyContactDetail) { + parameters.workPhoneContactMechId = workPhonePartyContactDetail.contactMechId; + parameters.workCountryCode = workPhonePartyContactDetail.countryCode; + parameters.workAreaCode = workPhonePartyContactDetail.areaCode; + parameters.workContactNumber = workPhonePartyContactDetail.contactNumber; + parameters.workExt = workPhonePartyContactDetail.extension; + parameters.workSol = workPhonePartyContactDetail.allowSolicitation; + } + } +} diff --git a/src/org/apache/ofbiz/ecommerce/order/OptionSettings.groovy b/src/org/apache/ofbiz/ecommerce/order/OptionSettings.groovy new file mode 100644 index 0000000..c62fd49 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/order/OptionSettings.groovy @@ -0,0 +1,56 @@ +/* + * 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.entity.*; +import org.ofbiz.base.util.*; +import org.ofbiz.order.shoppingcart.*; +import org.ofbiz.order.shoppingcart.shipping.*; +import org.ofbiz.party.contact.*; +import org.ofbiz.product.store.*; + +shoppingCart = session.getAttribute("shoppingCart"); +context.shoppingCart = shoppingCart; +productStore = ProductStoreWorker.getProductStore(request); + +if (shoppingCart) { + shippingEstWpr = new ShippingEstimateWrapper(dispatcher, shoppingCart, 0); + context.shippingEstWpr = shippingEstWpr; + context.carrierShipmentMethodList = shippingEstWpr.getShippingMethods(); +} + +// nuke the event messages +request.removeAttribute("_EVENT_MESSAGE_"); + +party = null; +partyId = session.getAttribute("orderPartyId"); +if (partyId) { + party = from("Party").where("partyId", partyId).queryOne(); + context.party = party; +} + + +context.emailList = ContactHelper.getContactMechByType(party, "EMAIL_ADDRESS", false); + +if (shoppingCart && shoppingCart.getShipmentMethodTypeId() && shoppingCart.getCarrierPartyId()) { + context.chosenShippingMethod = shoppingCart.getShipmentMethodTypeId() + '@' + shoppingCart.getCarrierPartyId(); + context.callSubmitForm = true; +} + +context.productStoreId = productStore.productStoreId; +context.productStore = productStore; diff --git a/src/org/apache/ofbiz/ecommerce/order/OrderHistory.groovy b/src/org/apache/ofbiz/ecommerce/order/OrderHistory.groovy new file mode 100644 index 0000000..e7b645f --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/order/OrderHistory.groovy @@ -0,0 +1,43 @@ +/* + * 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.*; +import org.ofbiz.entity.*; +import org.ofbiz.entity.util.*; +import org.ofbiz.entity.condition.*; + +partyRole = from("PartyRole").where("partyId", userLogin.partyId, "roleTypeId", "SUPPLIER").queryOne(); +if (partyRole) { + if ("SUPPLIER".equals(partyRole.roleTypeId)) { + /** drop shipper or supplier **/ + porderRoleCollection = from("OrderRole").where("partyId", userLogin.partyId, "roleTypeId", "SUPPLIER_AGENT").queryList(); + porderHeaderList = EntityUtil.orderBy(EntityUtil.filterByAnd(EntityUtil.getRelated("OrderHeader", null, porderRoleCollection, false), + [EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "ORDER_REJECTED"), + EntityCondition.makeCondition("orderTypeId", EntityOperator.EQUALS, "PURCHASE_ORDER")]), + ["orderDate DESC"]); + context.porderHeaderList = porderHeaderList; + } +} +orderRoleCollection = from("OrderRole").where("partyId", userLogin.partyId, "roleTypeId", "PLACING_CUSTOMER").queryList(); +orderHeaderList = EntityUtil.orderBy(EntityUtil.filterByAnd(EntityUtil.getRelated("OrderHeader", null, orderRoleCollection, false), + [EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "ORDER_REJECTED")]), ["orderDate DESC"]); +context.orderHeaderList = orderHeaderList; + +downloadOrderRoleAndProductContentInfoList = from("OrderRoleAndProductContentInfo").where("partyId", userLogin.partyId, "roleTypeId", "PLACING_CUSTOMER", "productContentTypeId", "DIGITAL_DOWNLOAD", "statusId", "ITEM_COMPLETED").queryList(); +context.downloadOrderRoleAndProductContentInfoList = downloadOrderRoleAndProductContentInfoList; diff --git a/src/org/apache/ofbiz/ecommerce/order/OrderStatus.groovy b/src/org/apache/ofbiz/ecommerce/order/OrderStatus.groovy new file mode 100644 index 0000000..f14fd82 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/order/OrderStatus.groovy @@ -0,0 +1,216 @@ +/* + * 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 java.math.BigDecimal; +import org.ofbiz.base.util.*; +import org.ofbiz.entity.*; +import org.ofbiz.entity.condition.*; +import org.ofbiz.entity.util.*; +import org.ofbiz.accounting.payment.*; +import org.ofbiz.order.order.*; +import org.ofbiz.party.contact.*; +import org.ofbiz.product.catalog.*; +import org.ofbiz.product.store.*; + + +orderId = parameters.orderId; +orderHeader = null; +// we have a special case here where for an anonymous order the user will already be logged out, but the userLogin will be in the request so we can still do a security check here +if (!userLogin) { + userLogin = parameters.temporaryAnonymousUserLogin; + // This is another special case, when Order is placed by anonymous user from ecommerce and then Order is completed by admin(or any user) from Order Manager + // then userLogin is not found when Order Complete Mail is send to user. + if (!userLogin) { + if (orderId) { + orderHeader = from("OrderHeader").where("orderId", orderId).queryOne(); + orderStatuses = orderHeader.getRelated("OrderStatus", null, null, false); + filteredOrderStatusList = []; + extOfflineModeExists = false; + + // Handled the case of OFFLINE payment method. In case of OFFLINE payment "ORDER_CREATED" status must be checked. + orderPaymentPreferences = orderHeader.getRelated("OrderPaymentPreference", null, UtilMisc.toList("orderPaymentPreferenceId"), false); + filteredOrderPaymentPreferences = EntityUtil.filterByCondition(orderPaymentPreferences, EntityCondition.makeCondition("paymentMethodTypeId", EntityOperator.IN, ["EXT_OFFLINE"])); + if (filteredOrderPaymentPreferences) { + extOfflineModeExists = true; + } + if (extOfflineModeExists) { + filteredOrderStatusList = EntityUtil.filterByCondition(orderStatuses, EntityCondition.makeCondition("statusId", EntityOperator.IN, ["ORDER_COMPLETED", "ORDER_APPROVED", "ORDER_CREATED"])); + } else { + filteredOrderStatusList = EntityUtil.filterByCondition(orderStatuses, EntityCondition.makeCondition("statusId", EntityOperator.IN, ["ORDER_COMPLETED", "ORDER_APPROVED"])); + } + if (UtilValidate.isNotEmpty(filteredOrderStatusList)) { + if (filteredOrderStatusList.size() < 2) { + statusUserLogin = EntityUtil.getFirst(filteredOrderStatusList).statusUserLogin; + userLogin = from("UserLogin").where("userLoginId", statusUserLogin).queryOne(); + } else { + filteredOrderStatusList.each { orderStatus -> + if ("ORDER_COMPLETED".equals(orderStatus.statusId)) { + statusUserLogin = orderStatus.statusUserLogin; + userLogin = from("UserLogin").where("userLoginId", statusUserLogin).queryOne(); + } + } + } + } + } + } + context.userLogin = userLogin; +} + +/* partyId = null; +if (userLogin) partyId = userLogin.partyId; */ + +partyId = context.partyId; +if (userLogin) { + if (!partyId) { + partyId = userLogin.partyId; + } +} + + +// can anybody view an anonymous order? this is set in the screen widget and should only be turned on by an email confirmation screen +allowAnonymousView = context.allowAnonymousView; + +isDemoStore = true; +if (orderId) { + orderHeader = from("OrderHeader").where("orderId", orderId).queryOne(); + if ("PURCHASE_ORDER".equals(orderHeader?.orderTypeId)) { + //drop shipper or supplier + roleTypeId = "SUPPLIER_AGENT"; + } else { + //customer + roleTypeId = "PLACING_CUSTOMER"; + } + context.roleTypeId = roleTypeId; + // check OrderRole to make sure the user can view this order. This check must be done for any order which is not anonymously placed and + // any anonymous order when the allowAnonymousView security flag (see above) is not set to Y, to prevent peeking + if (orderHeader && (!"anonymous".equals(orderHeader.createdBy) || ("anonymous".equals(orderHeader.createdBy) && !"Y".equals(allowAnonymousView)))) { + orderRole = from("OrderRole").where("orderId", orderId, "partyId", partyId, "roleTypeId", roleTypeId).queryFirst(); + + if (!userLogin || !orderRole) { + context.remove("orderHeader"); + orderHeader = null; + Debug.logWarning("Warning: in OrderStatus.groovy before getting order detail info: role not found or user not logged in; partyId=[" + partyId + "], userLoginId=[" + (userLogin == null ? "null" : userLogin.get("userLoginId")) + "]", "orderstatus"); + } + } +} + +if (orderHeader) { + productStore = orderHeader.getRelatedOne("ProductStore", true); + if (productStore) isDemoStore = !"N".equals(productStore.isDemoStore); + + orderReadHelper = new OrderReadHelper(orderHeader); + orderItems = orderReadHelper.getOrderItems(); + orderAdjustments = orderReadHelper.getAdjustments(); + orderHeaderAdjustments = orderReadHelper.getOrderHeaderAdjustments(); + orderSubTotal = orderReadHelper.getOrderItemsSubTotal(); + orderItemShipGroups = orderReadHelper.getOrderItemShipGroups(); + headerAdjustmentsToShow = orderReadHelper.getOrderHeaderAdjustmentsToShow(); + + orderShippingTotal = OrderReadHelper.getAllOrderItemsAdjustmentsTotal(orderItems, orderAdjustments, false, false, true); + orderShippingTotal = orderShippingTotal.add(OrderReadHelper.calcOrderAdjustments(orderHeaderAdjustments, orderSubTotal, false, false, true)); + + orderTaxTotal = OrderReadHelper.getAllOrderItemsAdjustmentsTotal(orderItems, orderAdjustments, false, true, false); + orderTaxTotal = orderTaxTotal.add(OrderReadHelper.calcOrderAdjustments(orderHeaderAdjustments, orderSubTotal, false, true, false)); + + placingCustomerOrderRole = from("OrderRole").where("orderId", orderId, "roleTypeId", roleTypeId).queryFirst(); + placingCustomerPerson = placingCustomerOrderRole == null ? null : from("Person").where("partyId", placingCustomerOrderRole.partyId).queryOne(); + + billingAccount = orderHeader.getRelatedOne("BillingAccount", false); + + orderPaymentPreferences = EntityUtil.filterByAnd(orderHeader.getRelated("OrderPaymentPreference", null, null, false), [EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "PAYMENT_CANCELLED")]); + paymentMethods = []; + orderPaymentPreferences.each { opp -> + paymentMethod = opp.getRelatedOne("PaymentMethod", false); + if (paymentMethod) { + paymentMethods.add(paymentMethod); + } else { + paymentMethodType = opp.getRelatedOne("PaymentMethodType", false); + if (paymentMethodType) { + context.paymentMethodType = paymentMethodType; + } + } + } + + + payToPartyId = productStore.payToPartyId; + paymentAddress = PaymentWorker.getPaymentAddress(delegator, payToPartyId); + if (paymentAddress) context.paymentAddress = paymentAddress; + + // get Shipment tracking info + orderShipmentInfoSummaryList = select("shipmentId", "shipmentRouteSegmentId", "carrierPartyId", "shipmentMethodTypeId","shipmentPackageSeqId","trackingCode","boxNumber") + .from("OrderShipmentInfoSummary") + .where("orderId", orderId) + .orderBy("shipmentId", "shipmentRouteSegmentId", "shipmentPackageSeqId") + .distinct(true) + .queryList(); + + customerPoNumberSet = new TreeSet(); + orderItems.each { orderItemPo -> + correspondingPoId = orderItemPo.correspondingPoId; + if (correspondingPoId && !"(none)".equals(correspondingPoId)) { + customerPoNumberSet.add(correspondingPoId); + } + } + + // check if there are returnable items + returned = 0.00; + totalItems = 0.00; + orderItems.each { oitem -> + totalItems += oitem.quantity; + ritems = oitem.getRelated("ReturnItem", null, null, false); + ritems.each { ritem -> + rh = ritem.getRelatedOne("ReturnHeader", false); + if (!rh.statusId.equals("RETURN_CANCELLED")) { + returned += ritem.returnQuantity; + } + } + } + + if (totalItems > returned) { + context.returnLink = "Y"; + } + + context.orderId = orderId; + context.orderHeader = orderHeader; + context.localOrderReadHelper = orderReadHelper; + context.orderItems = orderItems; + context.orderAdjustments = orderAdjustments; + context.orderHeaderAdjustments = orderHeaderAdjustments; + context.orderSubTotal = orderSubTotal; + context.orderItemShipGroups = orderItemShipGroups; + context.headerAdjustmentsToShow = headerAdjustmentsToShow; + context.currencyUomId = orderReadHelper.getCurrency(); + + context.orderShippingTotal = orderShippingTotal; + context.orderTaxTotal = orderTaxTotal; + context.orderGrandTotal = OrderReadHelper.getOrderGrandTotal(orderItems, orderAdjustments); + context.placingCustomerPerson = placingCustomerPerson; + + context.billingAccount = billingAccount; + context.paymentMethods = paymentMethods; + + context.productStore = productStore; + context.isDemoStore = isDemoStore; + + context.orderShipmentInfoSummaryList = orderShipmentInfoSummaryList; + context.customerPoNumberSet = customerPoNumberSet; + + orderItemChangeReasons = from("Enumeration").where("enumTypeId", "ODR_ITM_CH_REASON").queryList(); + context.orderItemChangeReasons = orderItemChangeReasons; +} diff --git a/src/org/apache/ofbiz/ecommerce/order/PaymentInformation.groovy b/src/org/apache/ofbiz/ecommerce/order/PaymentInformation.groovy new file mode 100644 index 0000000..9f5fbbd --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/order/PaymentInformation.groovy @@ -0,0 +1,117 @@ +/* + * 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.entity.*; +import org.ofbiz.entity.util.*; +import org.ofbiz.base.util.*; +import org.ofbiz.accounting.payment.*; +import org.ofbiz.order.shoppingcart.*; +import org.ofbiz.party.contact.*; + +cart = ShoppingCartEvents.getCartObject(request); +context.cart = cart; + +partyId = cart.getPartyId(); +currencyUomId = cart.getCurrency(); + +if (!partyId) { + partyId = userLogin.partyId; +} +context.partyId = partyId; + +if (partyId && !partyId.equals("_NA_")) { + party = from("Party").where("partyId", partyId).queryOne(); + person = party.getRelatedOne("Person", false); + context.party = party; + context.person = person; +} + +// nuke the event messages +request.removeAttribute("_EVENT_MESSAGE_"); + +if (parameters.useShipAddr && cart.getShippingContactMechId()) { + shippingContactMech = cart.getShippingContactMechId(); + postalAddress = from("PostalAddress").where("contactMechId", shippingContactMech).queryOne(); + context.useEntityFields = "Y"; + context.postalAddress = postalAddress; + + if (postalAddress && partyId) { + partyContactMech = from("PartyContactMech").where("partyId", partyId, "contactMechId", postalAddress.contactMechId).orderBy("-fromDate").filterByDate().queryFirst(); + context.partyContactMech = partyContactMech; + } +} else { + context.postalAddress = UtilHttp.getParameterMap(request); +} + +if (cart) { + if (cart.getPaymentMethodIds()) { + paymentMethods = cart.getPaymentMethods(); + paymentMethods.each { paymentMethod -> + account = null; + if ("CREDIT_CARD".equals(paymentMethod?.paymentMethodTypeId)) { + account = paymentMethod.getRelatedOne("CreditCard", false); + context.creditCard = account; + context.paymentMethodTypeId = "CREDIT_CARD"; + } else if ("EFT_ACCOUNT".equals(paymentMethod?.paymentMethodTypeId)) { + account = paymentMethod.getRelatedOne("EftAccount", false); + context.eftAccount = account; + context.paymentMethodTypeId = "EFT_ACCOUNT"; + } else if ("GIFT_CARD".equals(paymentMethod?.paymentMethodTypeId)) { + account = paymentMethod.getRelatedOne("GiftCard", false); + context.giftCard = account; + context.paymentMethodTypeId = "GIFT_CARD"; + context.addGiftCard = "Y"; + } else { + context.paymentMethodTypeId = "EXT_OFFLINE"; + } + if (account && !parameters.useShipAddr) { + address = account.getRelatedOne("PostalAddress", false); + context.postalAddress = address; + } + } + } +} + +if (!parameters.useShipAddr) { + if (cart && context.postalAddress) { + postalAddress = context.postalAddress; + shippingContactMechId = cart.getShippingContactMechId(); + contactMechId = postalAddress.contactMechId; + if (shippingContactMechId?.equals(contactMechId)) { + context.useShipAddr = "Y"; + } + } +} else { + context.useShipAddr = parameters.useShipAddr; +} + +// Added here to satisfy genericaddress.ftl +if (context.postalAddress) { + postalAddress = context.postalAddress; + parameters.address1 = postalAddress.address1; + parameters.address2 = postalAddress.address2; + parameters.city = postalAddress.city; + parameters.stateProvinceGeoId = postalAddress.stateProvinceGeoId; + parameters.postalCode = postalAddress.postalCode; + parameters.countryGeoId = postalAddress.countryGeoId; + parameters.contactMechId = postalAddress.contactMechId; + if (context.creditCard) { + context.callSubmitForm = true; + } +} diff --git a/src/org/apache/ofbiz/ecommerce/order/PaymentOptions.groovy b/src/org/apache/ofbiz/ecommerce/order/PaymentOptions.groovy new file mode 100644 index 0000000..1ef1896 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/order/PaymentOptions.groovy @@ -0,0 +1,32 @@ +/* + * 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.order.shoppingcart.*; + +//Get the Cart +cart = ShoppingCartEvents.getCartObject(request); +paymentMethodTypeIds = cart.getPaymentMethodTypeIds(); +paymentMethodTypeIds.each { paymentMethodTypeId -> + context.callSubmitForm = true; + if ("GIFT_CARD".equals(paymentMethodTypeId)) { + context.addGiftCard = "Y"; + } else { + context.paymentMethodTypeId = paymentMethodTypeId; + } +} diff --git a/src/org/apache/ofbiz/ecommerce/order/ProcessPaymentSettings.groovy b/src/org/apache/ofbiz/ecommerce/order/ProcessPaymentSettings.groovy new file mode 100644 index 0000000..ce5cae8 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/order/ProcessPaymentSettings.groovy @@ -0,0 +1,84 @@ +/* + * 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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.ofbiz.base.util.UtilHttp; +import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.entity.Delegator; +import org.ofbiz.entity.GenericValue; +import org.ofbiz.order.shoppingcart.CheckOutHelper; +import org.ofbiz.order.shoppingcart.ShoppingCart; +import org.ofbiz.order.shoppingcart.ShoppingCartEvents; +import org.ofbiz.service.LocalDispatcher; +import org.ofbiz.service.ModelService; +import org.ofbiz.service.ServiceUtil; + +cart = ShoppingCartEvents.getCartObject(request); +dispatcher = request.getAttribute("dispatcher"); +delegator = request.getAttribute("delegator"); +checkOutHelper = new CheckOutHelper(dispatcher, delegator, cart); +paramMap = UtilHttp.getParameterMap(request); + +paymentMethodTypeId = paramMap.paymentMethodTypeId; +errorMessages = []; +errorMaps = [:]; + +if (paymentMethodTypeId) { + paymentMethodId = request.getAttribute("paymentMethodId"); + if ("EXT_OFFLINE".equals(paymentMethodTypeId)) { + paymentMethodId = "EXT_OFFLINE"; + } + singleUsePayment = paramMap.singleUsePayment; + appendPayment = paramMap.appendPayment; + isSingleUsePayment = "Y".equalsIgnoreCase(singleUsePayment) ?: false; + doAppendPayment = "Y".equalsIgnoreCase(appendPayment) ?: false; + callResult = checkOutHelper.finalizeOrderEntryPayment(paymentMethodId, null, isSingleUsePayment, doAppendPayment); + cpi = cart.getPaymentInfo(paymentMethodId, null, null, null, true); + cpi.securityCode = paramMap.cardSecurityCode; + ServiceUtil.addErrors(errorMessages, errorMaps, callResult); +} + +if (!errorMessages && !errorMaps) { + selPaymentMethods = null; + addGiftCard = paramMap.addGiftCard; + if ("Y".equalsIgnoreCase(addGiftCard)) { + selPaymentMethods = [paymentMethodTypeId : null]; + callResult = checkOutHelper.checkGiftCard(paramMap, selPaymentMethods); + ServiceUtil.addErrors(errorMessages, errorMaps, callResult); + if (!errorMessages && !errorMaps) { + gcPaymentMethodId = callResult.paymentMethodId; + giftCardAmount = callResult.amount; + gcCallRes = checkOutHelper.finalizeOrderEntryPayment(gcPaymentMethodId, giftCardAmount, true, true); + ServiceUtil.addErrors(errorMessages, errorMaps, gcCallRes); + } + } +} + +//See whether we need to return an error or not +callResult = ServiceUtil.returnSuccess(); +if (errorMessages || errorMaps) { + request.setAttribute(ModelService.ERROR_MESSAGE_LIST, errorMessages); + request.setAttribute(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_ERROR); + return "error"; +} +return "success"; diff --git a/src/org/apache/ofbiz/ecommerce/order/QuickAnonCheckoutLinks.groovy b/src/org/apache/ofbiz/ecommerce/order/QuickAnonCheckoutLinks.groovy new file mode 100644 index 0000000..5a8e0fe --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/order/QuickAnonCheckoutLinks.groovy @@ -0,0 +1,31 @@ +/* + * 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.order.shoppingcart.ShoppingCartEvents; + +shoppingCart = ShoppingCartEvents.getCartObject(request); + +userLogin = context.userLogin; +if (userLogin) { + context.enableShippingAddress = true; +} + +shippingContactMechId = shoppingCart.getShippingContactMechId(); +if (shippingContactMechId) { + context.enableShipmentMethod = true; +} diff --git a/src/org/apache/ofbiz/ecommerce/order/QuickAnonCustSettings.groovy b/src/org/apache/ofbiz/ecommerce/order/QuickAnonCustSettings.groovy new file mode 100644 index 0000000..3c490bd --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/order/QuickAnonCustSettings.groovy @@ -0,0 +1,139 @@ +/* + * 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.*; +import org.ofbiz.entity.util.EntityUtil; +import org.ofbiz.entity.*; +import org.ofbiz.entity.util.*; +import org.ofbiz.order.shoppingcart.*; +import org.ofbiz.party.contact.*; +import org.ofbiz.product.catalog.*; + + +partyId = null; + +userLogin = context.userLogin; +if (userLogin) { + partyId = userLogin.partyId; +} + +if (!partyId && parameters.partyId) { + partyId = parameters.partyId; +} + +if (partyId) { + parameters.partyId = partyId; + + // NOTE: if there was an error, then don't look up and fill in all of this data, just use the values from the previous request (which will be in the parameters Map automagically) + if (!request.getAttribute("_ERROR_MESSAGE_") && !request.getAttribute("_ERROR_MESSAGE_LIST_")) { + person = from("Person").where("partyId", partyId).queryOne(); + if (person) { + context.callSubmitForm = true; + // should never be null for the anonymous checkout, but just in case + parameters.firstName = person.firstName; + parameters.middleName = person.middleName; + parameters.lastName = person.lastName; + } + + // get the Email Address + emailPartyContactDetail = from("PartyContactDetailByPurpose").where("partyId", partyId, "contactMechPurposeTypeId", "PRIMARY_EMAIL").filterByDate().queryFirst(); + if (emailPartyContactDetail) { + parameters.emailContactMechId = emailPartyContactDetail.contactMechId; + parameters.emailAddress = emailPartyContactDetail.infoString; + parameters.emailSol = emailPartyContactDetail.allowSolicitation; + } + + // get the Phone Numbers + homePhonePartyContactDetail = from("PartyContactDetailByPurpose").where("partyId", partyId, "contactMechPurposeTypeId", "PHONE_HOME").filterByDate().queryFirst(); + if (homePhonePartyContactDetail) { + parameters.homePhoneContactMechId = homePhonePartyContactDetail.contactMechId; + parameters.homeCountryCode = homePhonePartyContactDetail.countryCode; + parameters.homeAreaCode = homePhonePartyContactDetail.areaCode; + parameters.homeContactNumber = homePhonePartyContactDetail.contactNumber; + parameters.homeExt = homePhonePartyContactDetail.extension; + parameters.homeSol = homePhonePartyContactDetail.allowSolicitation; + } + + workPhonePartyContactDetail = from("PartyContactDetailByPurpose").where(partyId : partyId, contactMechPurposeTypeId : "PHONE_WORK").filterByDate().queryFirst(); + if (workPhonePartyContactDetail) { + parameters.workPhoneContactMechId = workPhonePartyContactDetail.contactMechId; + parameters.workCountryCode = workPhonePartyContactDetail.countryCode; + parameters.workAreaCode = workPhonePartyContactDetail.areaCode; + parameters.workContactNumber = workPhonePartyContactDetail.contactNumber; + parameters.workExt = workPhonePartyContactDetail.extension; + parameters.workSol = workPhonePartyContactDetail.allowSolicitation; + } + } +} + +cart = session.getAttribute("shoppingCart"); +cartPartyId = cart.getPartyId(); +context.cart = cart; + +// nuke the event messages +request.removeAttribute("_EVENT_MESSAGE_"); + +if (cartPartyId && !cartPartyId.equals("_NA_")) { + cartParty = from("Party").where("partyId", cartPartyId).queryOne(); + if (cartParty) { + cartPerson = cartParty.getRelatedOne("Person", false); + context.party = cartParty; + context.person = cartPerson; + } +} + +if (cart && cart.getShippingContactMechId()) { + shippingContactMechId = cart.getShippingContactMechId(); + shippingPartyContactDetail = from("PartyContactDetailByPurpose").where("partyId", cartPartyId, "contactMechId", shippingContactMechId).filterByDate().queryFirst(); + parameters.shippingContactMechId = shippingPartyContactDetail.contactMechId; + context.callSubmitForm = true; + parameters.shipToName = shippingPartyContactDetail.toName; + parameters.shipToAttnName = shippingPartyContactDetail.attnName; + parameters.shipToAddress1 = shippingPartyContactDetail.address1; + parameters.shipToAddress2 = shippingPartyContactDetail.address2; + parameters.shipToCity = shippingPartyContactDetail.city; + parameters.shipToPostalCode = shippingPartyContactDetail.postalCode; + parameters.shipToStateProvinceGeoId = shippingPartyContactDetail.stateProvinceGeoId; + parameters.shipToCountryGeoId = shippingPartyContactDetail.countryGeoId; +} else { + context.postalFields = UtilHttp.getParameterMap(request); +} + +billingContactMechId = session.getAttribute("billingContactMechId"); +if (billingContactMechId) { + billPostalAddress = from("PostalAddress").where("contactMechId", billingContactMechId).queryOne(); + parameters.billingContactMechId = billPostalAddress.contactMechId; + parameters.billToName = billPostalAddress.toName; + parameters.billToAttnName = billPostalAddress.attnName; + parameters.billToAddress1 = billPostalAddress.address1; + parameters.billToAddress2 = billPostalAddress.address2; + parameters.billToCity = billPostalAddress.city; + parameters.billToPostalCode = billPostalAddress.postalCode; + parameters.billToStateProvinceGeoId = billPostalAddress.stateProvinceGeoId; + parameters.billToCountryGeoId = billPostalAddress.countryGeoId; +} + +if (cart?.getShippingContactMechId() && shippingPartyContactDetail) { + shippingContactMechId = shippingPartyContactDetail.contactMechId; + if (billingContactMechId?.equals(shippingContactMechId)) { + context.useShippingPostalAddressForBilling = "Y"; + } +} +parameters.shippingContactMechPurposeTypeId = "SHIPPING_LOCATION"; +parameters.billingContactMechPurposeTypeId = "BILLING_LOCATION"; diff --git a/src/org/apache/ofbiz/ecommerce/order/QuickAnonOptionSettings.groovy b/src/org/apache/ofbiz/ecommerce/order/QuickAnonOptionSettings.groovy new file mode 100644 index 0000000..96917d1 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/order/QuickAnonOptionSettings.groovy @@ -0,0 +1,56 @@ +/* + * 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.entity.*; +import org.ofbiz.base.util.*; +import org.ofbiz.order.shoppingcart.*; +import org.ofbiz.order.shoppingcart.shipping.*; +import org.ofbiz.party.contact.*; +import org.ofbiz.product.store.*; + +shoppingCart = session.getAttribute("shoppingCart"); +context.shoppingCart = shoppingCart; +productStore = ProductStoreWorker.getProductStore(request); + +if (shoppingCart) { + shippingEstWpr = new ShippingEstimateWrapper(dispatcher, shoppingCart, 0); + context.shippingEstWpr = shippingEstWpr; + context.carrierShipmentMethodList = shippingEstWpr.getShippingMethods(); +} + +// nuke the event messages +request.removeAttribute("_EVENT_MESSAGE_"); + +party = null; +partyId = session.getAttribute("orderPartyId"); +if (partyId) { + party = from("Party").where("partyId", partyId).queryOne(); + context.party = party; +} + + +context.emailList = ContactHelper.getContactMechByType(party, "EMAIL_ADDRESS", false); + +if (shoppingCart?.getShipmentMethodTypeId() && shoppingCart.getCarrierPartyId()) { + context.chosenShippingMethod = shoppingCart.getShipmentMethodTypeId() + '@' + shoppingCart.getCarrierPartyId(); + context.callSubmitForm = true; +} + +context.productStoreId = productStore.productStoreId; +context.productStore = productStore; diff --git a/src/org/apache/ofbiz/ecommerce/order/QuickAnonPaymentInformation.groovy b/src/org/apache/ofbiz/ecommerce/order/QuickAnonPaymentInformation.groovy new file mode 100644 index 0000000..047df9c --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/order/QuickAnonPaymentInformation.groovy @@ -0,0 +1,44 @@ +/* + * 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.entity.*; +import org.ofbiz.entity.util.*; +import org.ofbiz.base.util.*; +import org.ofbiz.accounting.payment.*; +import org.ofbiz.order.shoppingcart.*; +import org.ofbiz.party.contact.*; + +cart = ShoppingCartEvents.getCartObject(request); +context.cart = cart; + +paymentMethodTypeId = parameters.paymentMethodTypeId ?: "CREDIT_CARD"; + +// nuke the event messages +request.removeAttribute("_EVENT_MESSAGE_"); + +if (cart?.getPaymentMethodIds()) { + paymentMethods = cart.getPaymentMethods(); + paymentMethods.each {paymentMethod -> + if ("CREDIT_CARD".equals(paymentMethod?.paymentMethodTypeId)) { + paymentMethodId = paymentMethod.paymentMethodId; + parameters.paymentMethodId = paymentMethodId; + } + } +} + diff --git a/src/org/apache/ofbiz/ecommerce/order/RequestReturn.groovy b/src/org/apache/ofbiz/ecommerce/order/RequestReturn.groovy new file mode 100644 index 0000000..aaab1b0 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/order/RequestReturn.groovy @@ -0,0 +1,55 @@ +/* + * 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.*; +import org.ofbiz.entity.*; +import org.ofbiz.party.contact.*; + +orderId = parameters.orderId; +context.orderId = orderId; + +party = userLogin.getRelatedOne("Party", false); +context.party = party; + +returnTypes = from("ReturnType").orderBy("sequenceId").queryList(); +context.returnTypes = returnTypes; + +returnReasons = from("ReturnReason").orderBy("sequenceId").queryList(); +context.returnReasons = returnReasons; + +if (orderId) { + returnRes = runService('getReturnableItems', [orderId : orderId]); + context.returnableItems = returnRes.returnableItems; + orderHeader = from("OrderHeader").where("orderId", orderId).queryOne(); + context.orderHeader = orderHeader; +} + +returnItemTypeMap = from("ReturnItemTypeMap").where("returnHeaderTypeId", "CUSTOMER_RETURN").queryList(); +typeMap = new HashMap(); +returnItemTypeMap.each { value -> typeMap[value.returnItemMapKey] = value.returnItemTypeId } +context.returnItemTypeMap = typeMap; + +//put in the return to party information from the order header +if (orderId) { + order = from("OrderHeader").where("orderId", orderId).queryOne(); + productStore = order.getRelatedOne("ProductStore", false); + context.toPartyId = productStore.payToPartyId; +} + +context.shippingContactMechList = ContactHelper.getContactMech(party, "SHIPPING_LOCATION", "POSTAL_ADDRESS", false); diff --git a/src/org/apache/ofbiz/ecommerce/order/ShipSettings.groovy b/src/org/apache/ofbiz/ecommerce/order/ShipSettings.groovy new file mode 100644 index 0000000..a01d050 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/order/ShipSettings.groovy @@ -0,0 +1,75 @@ +/* + * 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.entity.*; +import org.ofbiz.entity.util.*; +import org.ofbiz.base.util.*; +import org.ofbiz.order.shoppingcart.*; +import org.ofbiz.party.contact.*; +import org.ofbiz.product.catalog.*; + +cart = session.getAttribute("shoppingCart"); +partyId = cart.getPartyId(); +context.cart = cart; + +// nuke the event messages +request.removeAttribute("_EVENT_MESSAGE_"); + +if (partyId && !partyId.equals("_NA_")) { + party = from("Party").where("partyId", partyId).queryOne(); + person = party.getRelatedOne("Person", false); + context.party = party; + context.person = person; +} + +if (cart?.getShippingContactMechId()) { + shippingContactMechId = cart.getShippingContactMechId(); + shippingPartyContactDetail = from("PartyContactDetailByPurpose").where("partyId", partyId, "contactMechId", shippingContactMechId).filterByDate().queryFirst(); + parameters.shippingContactMechId = shippingPartyContactDetail.contactMechId; + context.callSubmitForm = true; + + fullAddressBuf = new StringBuffer(); + fullAddressBuf.append(shippingPartyContactDetail.address1); + if (shippingPartyContactDetail.address2) { + fullAddressBuf.append(", "); + fullAddressBuf.append(shippingPartyContactDetail.address2); + } + fullAddressBuf.append(", "); + fullAddressBuf.append(shippingPartyContactDetail.city); + fullAddressBuf.append(", "); + fullAddressBuf.append(shippingPartyContactDetail.postalCode); + parameters.fullAddress = fullAddressBuf.toString(); + + // NOTE: these parameters are a special case because they might be filled in by the address lookup service, so if they are there we won't fill in over them... + if (!parameters.postalCode) { + parameters.attnName = shippingPartyContactDetail.attnName; + parameters.address1 = shippingPartyContactDetail.address1; + parameters.address2 = shippingPartyContactDetail.address2; + parameters.city = shippingPartyContactDetail.city; + parameters.postalCode = shippingPartyContactDetail.postalCode; + parameters.stateProvinceGeoId = shippingPartyContactDetail.stateProvinceGeoId; + parameters.countryGeoId = shippingPartyContactDetail.countryGeoId; + parameters.allowSolicitation = shippingPartyContactDetail.allowSolicitation; + } + + parameters.yearsAtAddress = shippingPartyContactDetail.yearsWithContactMech; + parameters.monthsAtAddress = shippingPartyContactDetail.monthsWithContactMech; +} else { + context.postalFields = UtilHttp.getParameterMap(request); +} diff --git a/src/org/apache/ofbiz/ecommerce/order/ShipmentStatus.groovy b/src/org/apache/ofbiz/ecommerce/order/ShipmentStatus.groovy new file mode 100644 index 0000000..55757e9 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/order/ShipmentStatus.groovy @@ -0,0 +1,42 @@ +/* + * 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.UtilMisc; +import org.ofbiz.entity.Delegator; +import org.ofbiz.entity.*; +import org.ofbiz.entity.condition.*; +import org.ofbiz.entity.util.*; + +shipmentId = parameters.shipmentId; +if (shipmentId) { + shipment = from("Shipment").where("shipmentId", shipmentId).queryOne(); + shipmentItems = from("ShipmentItem").where("shipmentId", shipmentId).queryList(); + + // get Shipment tracking info + orderShipmentInfoSummaryList = select("shipmentId", "shipmentRouteSegmentId", "shipmentPackageSeqId", "carrierPartyId", "trackingCode") + .from("OrderShipmentInfoSummary") + .where("shipmentId", shipmentId) + .orderBy("shipmentId", "shipmentRouteSegmentId", "shipmentPackageSeqId") + .distinct() + .queryList(); + + context.shipment = shipment; + context.shipmentItems = shipmentItems; + context.orderShipmentInfoSummaryList = orderShipmentInfoSummaryList; +} diff --git a/src/org/apache/ofbiz/ecommerce/product/Product.groovy b/src/org/apache/ofbiz/ecommerce/product/Product.groovy new file mode 100644 index 0000000..759cab5 --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/product/Product.groovy @@ -0,0 +1,145 @@ +/* + * 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 java.lang.*; +import java.util.*; +import org.ofbiz.base.util.*; +import org.ofbiz.entity.*; +import org.ofbiz.service.*; +import org.ofbiz.product.catalog.*; +import org.ofbiz.product.category.*; +import org.ofbiz.product.product.ProductWorker; +import org.ofbiz.product.product.ProductContentWrapper; +import org.ofbiz.entity.util.EntityUtil; + +contentPathPrefix = CatalogWorker.getContentPathPrefix(request); +catalogName = CatalogWorker.getCatalogName(request); +currentCatalogId = CatalogWorker.getCurrentCatalogId(request); +requestParams = UtilHttp.getParameterMap(request); + +detailScreen = "productdetail"; +productId = requestParams.product_id ?: request.getAttribute("product_id"); + +pageTitle = null; +metaDescription = null; +metaKeywords = null; + +// get the product entity +if (productId) { + product = from("Product").where("productId", productId).cache(true).queryOne(); + if (product) { + // first make sure this isn't a virtual-variant that has an associated virtual product, if it does show that instead of the variant + if("Y".equals(product.isVirtual) && "Y".equals(product.isVariant)){ + virtualVariantProductAssocs = from("ProductAssoc").where("productId", productId, "productAssocTypeId", "ALTERNATIVE_PACKAGE").orderBy("-fromDate").filterByDate().cache(true).queryList(); + if (virtualVariantProductAssocs) { + productAssoc = EntityUtil.getFirst(virtualVariantProductAssocs); + product = productAssoc.getRelatedOne("AssocProduct", true); + } + } + } + + // first make sure this isn't a variant that has an associated virtual product, if it does show that instead of the variant + virtualProductId = ProductWorker.getVariantVirtualId(product); + if (virtualProductId) { + productId = virtualProductId; + product = from("Product").where("productId", productId).cache(true).queryOne(); + } + + productPageTitle = from("ProductContentAndInfo").where("productId", productId, "productContentTypeId", "PAGE_TITLE").cache(true).queryList(); + if (productPageTitle) { + pageTitle = from("ElectronicText").where("dataResourceId", productPageTitle.get(0).dataResourceId).cache(true).queryOne(); + } + productMetaDescription = from("ProductContentAndInfo").where("productId", productId, "productContentTypeId", "META_DESCRIPTION").cache(true).queryList(); + if (productMetaDescription) { + metaDescription = from("ElectronicText").where("dataResourceId", productMetaDescription.get(0).dataResourceId).cache(true).queryOne(); + } + productMetaKeywords = from("ProductContentAndInfo").where("productId", productId, "productContentTypeId", "META_KEYWORD").cache(true).queryList(); + if (productMetaKeywords) { + metaKeywords = from("ElectronicText").where("dataResourceId", productMetaKeywords.get(0).dataResourceId).cache(true).queryOne(); + } + + context.productId = productId; + + // now check to see if there is a view allow category and if this product is in it... + if (product) { + viewProductCategoryId = CatalogWorker.getCatalogViewAllowCategoryId(delegator, currentCatalogId); + if (viewProductCategoryId) { + if (!CategoryWorker.isProductInCategory(delegator, productId, viewProductCategoryId)) { + // a view allow productCategoryId was found, but the product is not in the category, axe it... + product = null; + } + } + } + + if (product) { + context.product = product; + contentWrapper = new ProductContentWrapper(product, request); + + if (pageTitle) { + context.title = pageTitle.textData; + } else { + context.put("title", contentWrapper.get("PRODUCT_NAME", "html")); + } + + if (metaDescription) { + context.metaDescription = metaDescription.textData; + } else { + context.put("metaDescription", contentWrapper.get("DESCRIPTION", "html")); + } + + if (metaKeywords) { + context.metaKeywords = metaKeywords.textData; + } else { + keywords = []; + keywords.add(contentWrapper.get("PRODUCT_NAME", "html")); + keywords.add(catalogName); + members = from("ProductCategoryMember").where("productId", productId).cache(true).queryList(); + members.each { member -> + category = member.getRelatedOne("ProductCategory", true); + if (category.description) { + categoryContentWrapper = new CategoryContentWrapper(category, request); + categoryDescription = categoryContentWrapper.get("DESCRIPTION", "html"); + if (categoryDescription) { + keywords.add(categoryDescription); + } + } + } + context.metaKeywords = StringUtil.join(keywords, ", "); + } + + // Set the default template for aggregated product (product component configurator ui) + if (product.productTypeId && ("AGGREGATED".equals(product.productTypeId) || "AGGREGATED_SERVICE".equals(product.productTypeId)) && context.configproductdetailScreen) { + detailScreen = context.configproductdetailScreen; + } + + productTemplate = product.detailScreen; + if (productTemplate) { + detailScreen = productTemplate; + } + } +} + +// check the catalog's template path and update +templatePathPrefix = CatalogWorker.getTemplatePathPrefix(request); +if (templatePathPrefix) { + detailScreen = templatePathPrefix + detailScreen; +} + +// set the template for the view +context.detailScreen = detailScreen; diff --git a/src/org/apache/ofbiz/ecommerce/product/ProductDetail.groovy b/src/org/apache/ofbiz/ecommerce/product/ProductDetail.groovy new file mode 100644 index 0000000..47f603e --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/product/ProductDetail.groovy @@ -0,0 +1,681 @@ +/* + * 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. + */ + +/* + * This script is also referenced by the ecommerce's screens and + * should not contain order component's specific code. + */ + +import java.text.NumberFormat; + +import org.ofbiz.base.util.*; +import org.ofbiz.entity.*; +import org.ofbiz.entity.condition.*; +import org.ofbiz.entity.util.*; +import org.ofbiz.service.*; +import org.ofbiz.webapp.taglib.ContentUrlTag; +import org.ofbiz.product.product.ProductContentWrapper; +import org.ofbiz.product.product.ProductSearch; +import org.ofbiz.product.product.ProductSearchSession; +import org.ofbiz.product.product.ProductWorker; +import org.ofbiz.product.catalog.*; +import org.ofbiz.product.store.*; +import org.ofbiz.webapp.stats.VisitHandler; +import org.ofbiz.webapp.website.WebSiteWorker +import org.ofbiz.order.shoppingcart.ShoppingCartEvents; +import org.ofbiz.order.shoppingcart.ShoppingCart; + +String buildNext(Map map, List order, String current, String prefix, Map featureTypes) { + def ct = 0; + def buf = new StringBuffer(); + buf.append("function listFT" + current + prefix + "() { "); + buf.append("document.forms[\"addform\"].elements[\"FT" + current + "\"].options.length = 1;"); + buf.append("document.forms[\"addform\"].elements[\"FT" + current + "\"].options[0] = new Option(\"" + featureTypes[current] + "\",\"\",true,true);"); + map.each { key, value -> + def optValue = null; + + if (order.indexOf(current) == (order.size()-1)) { + optValue = value.iterator().next(); + } else { + optValue = prefix + "_" + ct; + } + + buf.append("document.forms[\"addform\"].elements[\"FT" + current + "\"].options[" + (ct + 1) + "] = new Option(\"" + key + "\",\"" + optValue + "\");"); + ct++; + } + buf.append(" }"); + if (order.indexOf(current) < (order.size()-1)) { + ct = 0; + map.each { key, value -> + def nextOrder = order.get(order.indexOf(current)+1); + def newPrefix = prefix + "_" + ct; + buf.append(buildNext(value, order, nextOrder, newPrefix, featureTypes)); + ct++; + } + } + return buf.toString(); +} + +cart = ShoppingCartEvents.getCartObject(request); + +// set currency format +currencyUomId = null; +if (cart) currencyUomId = cart.getCurrency(); +if (!currencyUomId) currencyUomId = EntityUtilProperties.getPropertyValue("general", "currency.uom.id.default", "USD", delegator); + +// get the shopping lists for the user (if logged in) +if (userLogin) { + exprList = [EntityCondition.makeCondition("partyId", EntityOperator.EQUALS, userLogin.partyId), + EntityCondition.makeCondition("listName", EntityOperator.NOT_EQUAL, "auto-save")]; + allShoppingLists = from("ShoppingList").where(exprList).orderBy("listName").queryList(); + context.shoppingLists = allShoppingLists; +} + +// set the content path prefix +contentPathPrefix = CatalogWorker.getContentPathPrefix(request); +context.contentPathPrefix = contentPathPrefix; + +// get the product detail information +if (product) { + productId = product.productId; + context.product_id = productId; + productTypeId = product.productTypeId; + + boolean isMarketingPackage = EntityTypeUtil.hasParentType(delegator, "ProductType", "productTypeId", product.productTypeId, "parentTypeId", "MARKETING_PKG"); + context.isMarketingPackage = (isMarketingPackage? "true": "false"); + + featureTypes = [:]; + featureOrder = []; + + // set this as a last viewed + LAST_VIEWED_TO_KEEP = 10; // modify this to change the number of last viewed to keep + lastViewedProducts = session.getAttribute("lastViewedProducts"); + if (!lastViewedProducts) { + lastViewedProducts = []; + session.setAttribute("lastViewedProducts", lastViewedProducts); + } + lastViewedProducts.remove(productId); + lastViewedProducts.add(0, productId); + while (lastViewedProducts.size() > LAST_VIEWED_TO_KEEP) { + lastViewedProducts.remove(lastViewedProducts.size() - 1); + } + + // make the productContentWrapper + productContentWrapper = new ProductContentWrapper(product, request); + context.productContentWrapper = productContentWrapper; + + // get the main detail image (virtual or single product) + mainDetailImage = productContentWrapper.get("DETAIL_IMAGE_URL", "url"); + if (mainDetailImage) { + mainDetailImageUrl = ContentUrlTag.getContentPrefix(request) + mainDetailImage; + context.mainDetailImageUrl = mainDetailImageUrl.toString(); + } + + // get next/previous information for category + categoryId = parameters.category_id ?: product.primaryProductCategoryId; + if (categoryId) context.categoryId = categoryId; + + catNextPreviousResult = null; + if (categoryId) { + prevNextMap = [categoryId : categoryId, productId : productId]; + prevNextMap.orderByFields = context.orderByFields ?: ["sequenceNum", "productId"]; + catNextPreviousResult = runService('getPreviousNextProducts', prevNextMap); + if (ServiceUtil.isError(catNextPreviousResult)) { + request.setAttribute("errorMessageList", [ServiceUtil.getErrorMessage(catNextPreviousResult)]); + return; + } + if (catNextPreviousResult && catNextPreviousResult.category) { + context.category = catNextPreviousResult.category; + context.previousProductId = catNextPreviousResult.previousProductId; + context.nextProductId = catNextPreviousResult.nextProductId; + } + } + + // get the product store for only Sales Order not for Purchase Order. + productStore = null; + productStoreId = null; + cart = ShoppingCartEvents.getCartObject(request); + if (cart.isSalesOrder()) { + productStore = ProductStoreWorker.getProductStore(request); + productStoreId = productStore.productStoreId; + context.productStoreId = productStoreId; + } + // get a defined survey + productSurvey = ProductStoreWorker.getProductSurveys(delegator, productStoreId, productId, "CART_ADD"); + if (productSurvey) { + survey = EntityUtil.getFirst(productSurvey); + origParamMapId = UtilHttp.stashParameterMap(request); + surveyContext = ["_ORIG_PARAM_MAP_ID_" : origParamMapId]; + surveyPartyId = userLogin?.partyId; + wrapper = new ProductStoreSurveyWrapper(survey, surveyPartyId, surveyContext); + context.surveyWrapper = wrapper; + } + + // get the product price + catalogId = CatalogWorker.getCurrentCatalogId(request); + currentCatalogId = catalogId; + webSiteId = WebSiteWorker.getWebSiteId(request); + autoUserLogin = request.getSession().getAttribute("autoUserLogin"); + if (cart.isSalesOrder()) { + // sales order: run the "calculateProductPrice" service + priceContext = [product : product, prodCatalogId : catalogId, + currencyUomId : cart.getCurrency(), autoUserLogin : autoUserLogin]; + priceContext.webSiteId = webSiteId; + priceContext.productStoreId = productStoreId; + priceContext.checkIncludeVat = "Y"; + priceContext.agreementId = cart.getAgreementId(); + priceContext.partyId = cart.getPartyId(); // IMPORTANT: must put this in, or price will be calculated for the CSR instead of the customer + priceMap = runService('calculateProductPrice', priceContext); + context.priceMap = priceMap; + } else { + // purchase order: run the "calculatePurchasePrice" service + priceContext = [product : product, currencyUomId : cart.getCurrency(), + partyId : cart.getPartyId(), userLogin : userLogin]; + priceMap = runService('calculatePurchasePrice', priceContext); + context.priceMap = priceMap; + } + + // get the product review(s) + // get all product review in case of Purchase Order. + reviewByAnd = [:]; + reviewByAnd.statusId = "PRR_APPROVED"; + if (cart.isSalesOrder()) { + reviewByAnd.productStoreId = productStoreId; + } + reviews = product.getRelated("ProductReview", reviewByAnd, ["-postedDateTime"], true); + context.productReviews = reviews; + // get the average rating + if (reviews) { + ratingReviews = EntityUtil.filterByAnd(reviews, [EntityCondition.makeCondition("productRating", EntityOperator.NOT_EQUAL, null)]); + if (ratingReviews) { + context.averageRating = ProductWorker.getAverageProductRating(product, reviews, productStoreId); + context.numRatings = ratingReviews.size(); + } + } + + // get the days to ship + // if order is purchase then don't calculate available inventory for product. + if (cart.isSalesOrder()) { + facilityId = productStore.inventoryFacilityId; + /* + productFacility = delegator.findOne("ProductFacility", [productId : productId, facilityId : facilityId, true); + context.daysToShip = productFacility?.daysToShip + */ + + resultOutput = runService('getInventoryAvailableByFacility', [productId : productId, facilityId : facilityId, useCache : false]); + totalAvailableToPromise = resultOutput.availableToPromiseTotal; + if (totalAvailableToPromise) { + productFacility = from("ProductFacility").where("productId", productId, "facilityId", facilityId).cache(true).queryOne(); + context.daysToShip = productFacility?.daysToShip + } + } else { + supplierProduct = from("SupplierProduct").where("productId", productId).orderBy("-availableFromDate").cache(true).queryFirst(); + if (supplierProduct?.standardLeadTimeDays) { + standardLeadTimeDays = supplierProduct.standardLeadTimeDays; + daysToShip = standardLeadTimeDays + 1; + context.daysToShip = daysToShip; + } + } + + // get the product distinguishing features + disFeatureMap = runService('getProductFeatures', [productId : productId, type : "DISTINGUISHING_FEAT"]); + disFeatureList = disFeatureMap.productFeatures; + context.disFeatureList = disFeatureList; + + // an example of getting features of a certain type to show + sizeProductFeatureAndAppls = from("ProductFeatureAndAppl").where("productId", productId, "productFeatureTypeId", "SIZE").orderBy("sequenceNum", "defaultSequenceNum").queryList(); + context.sizeProductFeatureAndAppls = sizeProductFeatureAndAppls; + + // get product variant for Box/Case/Each + productVariants = []; + boolean isAlternativePacking = ProductWorker.isAlternativePacking(delegator, product.productId, null); + mainProducts = []; + if(isAlternativePacking){ + productVirtualVariants = from("ProductAssoc").where("productIdTo", product.productId , "productAssocTypeId", "ALTERNATIVE_PACKAGE").cache(true).queryList(); + if(productVirtualVariants){ + productVirtualVariants.each { virtualVariantKey -> + mainProductMap = [:]; + mainProduct = virtualVariantKey.getRelatedOne("MainProduct", true); + quantityUom = mainProduct.getRelatedOne("QuantityUom", true); + mainProductMap.productId = mainProduct.productId; + mainProductMap.piecesIncluded = mainProduct.piecesIncluded; + mainProductMap.uomDesc = quantityUom.description; + mainProducts.add(mainProductMap); + } + } + } + context.mainProducts = mainProducts; + + // Special Variant Code + if ("Y".equals(product.isVirtual)) { + if ("VV_FEATURETREE".equals(ProductWorker.getProductVirtualVariantMethod(delegator, productId))) { + context.featureLists = ProductWorker.getSelectableProductFeaturesByTypesAndSeq(product); + } else { + featureMap = runService('getProductFeatureSet', [productId : productId]); + featureSet = featureMap.featureSet; + if (featureSet) { + //if order is purchase then don't calculate available inventory for product. + if (cart.isPurchaseOrder()) { + variantTreeMap = runService('getProductVariantTree', [productId : productId, featureOrder : featureSet, checkInventory: false]); + } else { + variantTreeMap = runService('getProductVariantTree', [productId : productId, featureOrder : featureSet, productStoreId : productStoreId]); + } + variantTree = variantTreeMap.variantTree; + imageMap = variantTreeMap.variantSample; + virtualVariant = variantTreeMap.virtualVariant; + context.virtualVariant = virtualVariant; + if (variantTree) { + context.variantTree = variantTree; + context.variantTreeSize = variantTree.size(); + } + unavailableVariants = variantTreeMap.unavailableVariants; + if (unavailableVariants) { + context.unavailableVariants = unavailableVariants; + } + if (imageMap) { + context.variantSample = imageMap; + context.variantSampleKeys = imageMap.keySet(); + context.variantSampleSize = imageMap.size(); + } + context.featureSet = featureSet; + + if (variantTree) { + featureOrder = new LinkedList(featureSet); + featureOrder.each { featureKey -> + featureValue = from("ProductFeatureType").where("productFeatureTypeId", featureKey).cache(true).queryOne(); + fValue = featureValue.get("description") ?: featureValue.productFeatureTypeId; + featureTypes[featureKey] = fValue; + } + } + context.featureTypes = featureTypes; + context.featureOrder = featureOrder; + if (featureOrder) { + context.featureOrderFirst = featureOrder[0]; + } + + if (variantTree && imageMap) { + jsBuf = new StringBuffer(); + jsBuf.append(""); + + context.virtualJavaScript = jsBuf; + } + } + } + } else { + context.minimumQuantity= ShoppingCart.getMinimumOrderQuantity(delegator, priceMap.price, productId); + if(isAlternativePacking){ + // get alternative product price when product doesn't have any feature + jsBuf = new StringBuffer(); + jsBuf.append(""); + context.virtualVariantJavaScript = jsBuf; + } + } + } + + availableInventory = 0.0; + + // if the product is a MARKETING_PKG_AUTO/PICK, then also get the quantity which can be produced from components + if (isMarketingPackage) { + resultOutput = runService('getMktgPackagesAvailable', [productId : productId]); + availableInventory = resultOutput.availableToPromiseTotal; + } else { + //get last inventory count from product facility for the product + facilities = from("ProductFacility").where("productId", product.productId).queryList(); + if(facilities) { + facilities.each { facility -> + lastInventoryCount = facility.lastInventoryCount; + if (lastInventoryCount != null) { + availableInventory += lastInventoryCount; + } + } + } + } + context.availableInventory = availableInventory; + + // get product associations + alsoBoughtProducts = runService('getAssociatedProducts', [productId : productId, type : "ALSO_BOUGHT", checkViewAllow : true, prodCatalogId : currentCatalogId, bidirectional : false, sortDescending : true]); + context.alsoBoughtProducts = alsoBoughtProducts.assocProducts; + + obsoleteProducts = runService('getAssociatedProducts', [productId : productId, type : "PRODUCT_OBSOLESCENCE", checkViewAllow : true, prodCatalogId : currentCatalogId]); + context.obsoleteProducts = obsoleteProducts.assocProducts; + + crossSellProducts = runService('getAssociatedProducts', [productId : productId, type : "PRODUCT_COMPLEMENT", checkViewAllow : true, prodCatalogId : currentCatalogId]); + context.crossSellProducts = crossSellProducts.assocProducts; + + upSellProducts = runService('getAssociatedProducts', [productId : productId, type : "PRODUCT_UPGRADE", checkViewAllow : true, prodCatalogId : currentCatalogId]); + context.upSellProducts = upSellProducts.assocProducts; + + obsolenscenseProducts = runService('getAssociatedProducts', [productIdTo : productId, type : "PRODUCT_OBSOLESCENCE", checkViewAllow : true, prodCatalogId : currentCatalogId]); + context.obsolenscenseProducts = obsolenscenseProducts.assocProducts; + + accessoryProducts = runService('getAssociatedProducts', [productId : productId, type : "PRODUCT_ACCESSORY", checkViewAllow : true, prodCatalogId : currentCatalogId]); + context.accessoryProducts = accessoryProducts.assocProducts; + + /* + The following code is commented out because it is just an example of the business logic to retrieve products with a similar feature. + + // get other cross-sell information: product with a common feature + commonProductFeatureId = "SYMPTOM"; + // does this product have that feature? + commonProductFeatureAndAppls = delegator.findByAnd("ProductFeatureAndAppl", [productId : productId, productFeatureTypeId : commonProductFeatureId], ["sequenceNum", "defaultSequenceNum"], false); + if (commonProductFeatureAndAppls) { + commonProductFeatureIds = EntityUtil.getFieldListFromEntityList(commonProductFeatureAndAppls, "productFeatureId", true); + + // now search for other products that have this feature + visitId = VisitHandler.getVisitId(session); + + productSearchConstraintList = []; + productSearchConstraintList.add(new ProductSearch.FeatureSetConstraint(commonProductFeatureIds)); + // make sure the view allow category is included + productSearchConstraintList = ProductSearchSession.ensureViewAllowConstraint(productSearchConstraintList, currentCatalogId, delegator); + + // don't care about the sort on this one + resultSortOrder = null; + + commonFeatureResultIdsOrig = ProductSearch.searchProducts(productSearchConstraintList, resultSortOrder, delegator, visitId); + commonFeatureResultIds = []; + commonFeatureResultIdIter = commonFeatureResultIdsOrig.iterator(); + while (commonFeatureResultIdIter.hasNext()) { + commonFeatureResultId = commonFeatureResultIdIter.next(); + // filter out the current product + if (commonFeatureResultId.equals(productId)) { + continue; + } + // filter out all variants + commonProduct = delegator.findOne("Product", [productId : commonFeatureResultId], true); + if ("Y".equals(commonProduct?.isVariant)) { + continue; + } + commonFeatureResultIds.add(commonFeatureResultId); + } + if (commonFeatureResultIds) { + context.commonFeatureResultIds = commonFeatureResultIds; + } + } + */ + + // get the DIGITAL_DOWNLOAD related Content records to show the contentName/description + downloadProductContentAndInfoList = from("ProductContentAndInfo").where("productId", productId, "productContentTypeId", "DIGITAL_DOWNLOAD").cache(true).queryList(); + context.downloadProductContentAndInfoList = downloadProductContentAndInfoList; + + // not the best to save info in an action, but this is probably the best place to count a view; it is done async + dispatcher.runAsync("countProductView", [productId : productId, weight : new Long(1)], false); + + //get product image from image management + productImageList = []; + productContentAndInfoImageManamentList = from("ProductContentAndInfo").where("productId", productId, "productContentTypeId", "IMAGE", "statusId", "IM_APPROVED", "drIsPublic", "Y").orderBy("sequenceNum").queryList(); + if(productContentAndInfoImageManamentList) { + productContentAndInfoImageManamentList.each { productContentAndInfoImageManament -> + contentAssocThumb = from("ContentAssoc").where("contentId", productContentAndInfoImageManament.contentId, "contentAssocTypeId", "IMAGE_THUMBNAIL").queryFirst(); + if(contentAssocThumb) { + imageContentThumb = from("Content").where("contentId", contentAssocThumb.contentIdTo).queryOne(); + if(imageContentThumb) { + productImageThumb = from("ContentDataResourceView").where("contentId", imageContentThumb.contentId, "drDataResourceId", imageContentThumb.dataResourceId).queryOne(); + productImageMap = [:]; + productImageMap.productImageThumb = productImageThumb.drObjectInfo; + productImageMap.productImage = productContentAndInfoImageManament.drObjectInfo; + productImageList.add(productImageMap); + } + } + } + context.productImageList = productImageList; + } + + // get reservation start date for rental product + if("ASSET_USAGE".equals(productTypeId) || "ASSET_USAGE_OUT_IN".equals(productTypeId)){ + context.startDate = UtilDateTime.addDaysToTimestamp(UtilDateTime.nowTimestamp(), 1).toString().substring(0,10); // should be tomorrow. + } + + // get product tags + productKeywords = from("ProductKeyword").where("productId": productId, "keywordTypeId" : "KWT_TAG", "statusId" : "KW_APPROVED").queryList(); + keywordMap = [:]; + if (productKeywords) { + for (productKeyword in productKeywords) { + productKeyWordCount = from("ProductKeyword").where("keyword", productKeyword.keyword, "keywordTypeId", "KWT_TAG", "statusId", "KW_APPROVED").queryCount(); + keywordMap.put(productKeyword.keyword,productKeyWordCount); + } + context.productTags = keywordMap; + } +} diff --git a/src/org/apache/ofbiz/ecommerce/setup/EcommerceSetup.groovy b/src/org/apache/ofbiz/ecommerce/setup/EcommerceSetup.groovy new file mode 100644 index 0000000..5adb8cf --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/setup/EcommerceSetup.groovy @@ -0,0 +1,41 @@ +/* + * 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 java.util.*; +import org.ofbiz.base.util.*; +import org.ofbiz.entity.*; +import org.ofbiz.product.catalog.CatalogWorker; +import org.ofbiz.product.store.ProductStoreWorker; +import org.ofbiz.common.CommonWorkers; +import org.ofbiz.order.shoppingcart.*; +import org.ofbiz.webapp.control.*; + +productStore = ProductStoreWorker.getProductStore(request); + +prodCatalog = CatalogWorker.getProdCatalog(request); +if (prodCatalog) { + catalogStyleSheet = prodCatalog.styleSheet; + if (catalogStyleSheet) globalContext.catalogStyleSheet = catalogStyleSheet; + catalogHeaderLogo = prodCatalog.headerLogo; + if (catalogHeaderLogo) globalContext.catalogHeaderLogo = catalogHeaderLogo; +} + +globalContext.productStore = productStore; +globalContext.checkLoginUrl = LoginWorker.makeLoginUrl(request, "checkLogin"); +globalContext.catalogQuickaddUse = CatalogWorker.getCatalogQuickaddUse(request); diff --git a/src/org/apache/ofbiz/ecommerce/shoppinglist/EditShoppingList.groovy b/src/org/apache/ofbiz/ecommerce/shoppinglist/EditShoppingList.groovy new file mode 100644 index 0000000..fe3168d --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/shoppinglist/EditShoppingList.groovy @@ -0,0 +1,230 @@ +/* + * 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 java.util.*; +import org.ofbiz.base.util.*; +import org.ofbiz.entity.*; +import org.ofbiz.entity.util.*; +import org.ofbiz.entity.condition.*; +import org.ofbiz.order.shoppingcart.ShoppingCartEvents; +import org.ofbiz.order.shoppingcart.shipping.*; +import org.ofbiz.order.shoppinglist.*; +import org.ofbiz.party.contact.*; +import org.ofbiz.product.catalog.*; +import org.ofbiz.product.store.*; +import org.ofbiz.service.calendar.*; +import org.ofbiz.webapp.website.WebSiteWorker; + +if (userLogin) +{ + party = userLogin.getRelatedOne("Party", false); +} else { + return; // session ended, prevents a NPE +} + + +cart = ShoppingCartEvents.getCartObject(request); +currencyUomId = cart.getCurrency(); + +productStoreId = ProductStoreWorker.getProductStoreId(request); +prodCatalogId = CatalogWorker.getCurrentCatalogId(request); +webSiteId = WebSiteWorker.getWebSiteId(request); + +context.productStoreId = productStoreId; +context.currencyUomId = currencyUomId; + +// get the top level shopping lists for the logged in user +exprList = [EntityCondition.makeCondition("partyId", EntityOperator.EQUALS, userLogin.partyId), + EntityCondition.makeCondition("listName", EntityOperator.NOT_EQUAL, "auto-save")]; +condition = EntityCondition.makeCondition(exprList, EntityOperator.AND); +allShoppingLists = from("ShoppingList").where(exprList).orderBy("listName").queryList(); +shoppingLists = EntityUtil.filterByAnd(allShoppingLists, [parentShoppingListId : null]); +context.allShoppingLists = allShoppingLists; +context.shoppingLists = shoppingLists; + +// get all shoppingListTypes +shoppingListTypes = from("ShoppingListType").orderBy("description").cache(true).queryList(); +context.shoppingListTypes = shoppingListTypes; + +// get the shoppingListId for this reqest +parameterMap = UtilHttp.getParameterMap(request); +shoppingListId = parameterMap.shoppingListId ?: request.getAttribute("shoppingListId") ?: session.getAttribute("currentShoppingListId"); +context.shoppingListId = shoppingListId; + +// no passed shopping list id default to first list +if (!shoppingListId) { + firstList = EntityUtil.getFirst(shoppingLists); + if (firstList) { + shoppingListId = firstList.shoppingListId; + } +} +session.setAttribute("currentShoppingListId", shoppingListId); + +// if we passed a shoppingListId get the shopping list info +if (shoppingListId) { + shoppingList = from("ShoppingList").where("shoppingListId", shoppingListId).queryOne(); + context.shoppingList = shoppingList; + + if (shoppingList) { + shoppingListItemTotal = 0.0; + shoppingListChildTotal = 0.0; + + shoppingListItems = shoppingList.getRelated("ShoppingListItem", null, null, true); + if (shoppingListItems) { + shoppingListItemDatas = new ArrayList(shoppingListItems.size()); + shoppingListItems.each { shoppingListItem -> + shoppingListItemData = [:]; + + product = shoppingListItem.getRelatedOne("Product", true); + + calcPriceOutMap = runService('calculateProductPrice', [product : product, quantity : shoppingListItem.quantity, currencyUomId : currencyUomId, userLogin : userLogin, + webSiteId: webSiteId, prodCatalogId: prodCatalogId, productStoreId: productStoreId]); + price = calcPriceOutMap.price; + totalPrice = price * shoppingListItem.quantity; + // similar code at ShoppingCartItem.java getRentalAdjustment + if ("ASSET_USAGE".equals(product.productTypeId) || "ASSET_USAGE_OUT_IN".equals(product.productTypeId)) { + persons = shoppingListItem.reservPersons ?: 0; + reservNthPPPerc = product.reservNthPPPerc ?: 0; + reserv2ndPPPerc = product.reserv2ndPPPerc ?: 0; + rentalValue = 0; + if (persons) { + if (persons > 2) { + persons -= 2; + if (reservNthPPPerc) { + rentalValue = persons * reservNthPPPerc; + } else if (reserv2ndPPPerc) { + rentalValue = persons * reserv2ndPPPerc; + } + persons = 2; + } + if (persons == 2) { + if (reserv2ndPPPerc) { + rentalValue += reserv2ndPPPerc; + } else if (reservNthPPPerc) { + rentalValue = persons * reservNthPPPerc; + } + } + } + rentalValue += 100; // add final 100 percent for first person + reservLength = shoppingListItem.reservLength ?: 0; + totalPrice *= (rentalValue/100 * reservLength); + } + shoppingListItemTotal += totalPrice; + + productVariantAssocs = null; + if ("Y".equals(product.isVirtual)) { + productVariantAssocs = product.getRelated("MainProductAssoc", [productAssocTypeId : "PRODUCT_VARIANT"], ["sequenceNum"], true); + productVariantAssocs = EntityUtil.filterByDate(productVariantAssocs); + } + shoppingListItemData.shoppingListItem = shoppingListItem; + shoppingListItemData.product = product; + shoppingListItemData.unitPrice = price; + shoppingListItemData.totalPrice = totalPrice; + shoppingListItemData.productVariantAssocs = productVariantAssocs; + shoppingListItemDatas.add(shoppingListItemData); + } + context.shoppingListItemDatas = shoppingListItemDatas; + // pagination for the shopping list + viewIndex = Integer.valueOf(parameters.VIEW_INDEX ?: 1); + viewSize = Integer.valueOf(parameters.VIEW_SIZE ?: EntityUtilProperties.getPropertyValue("widget", "widget.form.defaultViewSize", "20", delegator)); + listSize = shoppingListItemDatas ? shoppingListItemDatas.size() : 0; + + lowIndex = ((viewIndex - 1) * viewSize) + 1; + highIndex = viewIndex * viewSize; + highIndex = highIndex > listSize ? listSize : highIndex; + lowIndex = lowIndex > highIndex ? highIndex : lowIndex; + + context.viewIndex = viewIndex; + context.viewSize = viewSize; + context.listSize = listSize; + context.lowIndex = lowIndex; + context.highIndex = highIndex; + } + + shoppingListType = shoppingList.getRelatedOne("ShoppingListType", false); + context.shoppingListType = shoppingListType; + + // get the child shopping lists of the current list for the logged in user + childShoppingLists = from("ShoppingList").where("partyId", userLogin.partyId, "parentShoppingListId", shoppingListId).orderBy("listName").cache(true).queryList(); + // now get prices for each child shopping list... + if (childShoppingLists) { + childShoppingListDatas = new ArrayList(childShoppingLists.size()); + childShoppingLists.each { childShoppingList -> + childShoppingListData = [:]; + + childShoppingListPriceMap = runService('calculateShoppingListDeepTotalPrice', [shoppingListId : childShoppingList.shoppingListId, prodCatalogId : prodCatalogId, webSiteId : webSiteId, userLogin : userLogin, currencyUomId : currencyUomId]); + totalPrice = childShoppingListPriceMap.totalPrice; + shoppingListChildTotal += totalPrice; + + childShoppingListData.childShoppingList = childShoppingList; + childShoppingListData.totalPrice = totalPrice; + childShoppingListDatas.add(childShoppingListData); + } + context.childShoppingListDatas = childShoppingListDatas; + } + context.shoppingListTotalPrice = shoppingListItemTotal + shoppingListChildTotal; + context.shoppingListItemTotal = shoppingListItemTotal; + context.shoppingListChildTotal = shoppingListChildTotal; + + // get the parent shopping list if there is one + parentShoppingList = shoppingList.getRelatedOne("ParentShoppingList", false); + context.parentShoppingList = parentShoppingList; + + context.canView = userLogin.partyId.equals(shoppingList.partyId); + + // auto-reorder info + if ("SLT_AUTO_REODR".equals(shoppingListType?.shoppingListTypeId)) { + recurrenceVo = shoppingList.getRelatedOne("RecurrenceInfo", false); + context.recurrenceInfo = recurrenceVo; + + if (userLogin.partyId.equals(shoppingList.partyId)) { + listCart = ShoppingListServices.makeShoppingListCart(dispatcher, shoppingListId, locale); + + // get customer's shipping & payment info + context.chosenShippingMethod = shoppingList.shipmentMethodTypeId + "@" + shoppingList.carrierPartyId; + context.shippingContactMechList = ContactHelper.getContactMech(party, "SHIPPING_LOCATION", "POSTAL_ADDRESS", false); + context.paymentMethodList = EntityUtil.filterByDate(party.getRelated("PaymentMethod", null, ["paymentMethodTypeId"], false)); + + shipAddress = from("PostalAddress").where("contactMechId", shoppingList.contactMechId).queryOne(); + Debug.log("SL - address : " + shipAddress); + if (shipAddress) { + listCart = ShoppingListServices.makeShoppingListCart(dispatcher, shoppingListId, locale); + if (listCart) { + shippingEstWpr = new ShippingEstimateWrapper(dispatcher, listCart, 0); + carrierShipMeths = shippingEstWpr.getShippingMethods(); + context.listCart = listCart; + context.shippingEstWpr = shippingEstWpr; + context.carrierShipMethods = carrierShipMeths; + } + } + + if (recurrenceVo) { + recInfo = new RecurrenceInfo(recurrenceVo); + context.recInfo = recInfo; + lastSlOrderDate = shoppingList.lastOrderedDate; + context.lastSlOrderDate = lastSlOrderDate; + if (!lastSlOrderDate) { + lastSlOrderDate = recurrenceVo.startDateTime; + } + context.lastSlOrderTime = lastSlOrderDate.getTime(); + } + } + } + } +} diff --git a/src/org/apache/ofbiz/ecommerce/webapp/view/JspViewHandler.java b/src/org/apache/ofbiz/ecommerce/webapp/view/JspViewHandler.java new file mode 100644 index 0000000..316cf8e --- /dev/null +++ b/src/org/apache/ofbiz/ecommerce/webapp/view/JspViewHandler.java @@ -0,0 +1,103 @@ +/******************************************************************************* + * 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. + *******************************************************************************/ +package org.ofbiz.ecommerce.webapp.view; + +import java.io.IOException; +import java.net.URLEncoder; + +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletContext; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.jsp.JspException; + +import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilValidate; +import org.ofbiz.webapp.control.ContextFilter; +import org.ofbiz.webapp.view.AbstractViewHandler; +import org.ofbiz.webapp.view.ViewHandlerException; + +/** + * JspViewHandler - Java Server Pages View Handler + */ +public class JspViewHandler extends AbstractViewHandler { + + public static final String module = JspViewHandler.class.getName(); + + protected ServletContext context; + + public void init(ServletContext context) throws ViewHandlerException { + this.context = context; + } + + public void render(String name, String page, String contentType, String encoding, String info, HttpServletRequest request, HttpServletResponse response) throws ViewHandlerException { + // some containers call filters on EVERY request, even forwarded ones, + // so let it know that it came from the control servlet + + if (request == null) { + throw new ViewHandlerException("Null HttpServletRequest object"); + } + if (UtilValidate.isEmpty(page)) { + throw new ViewHandlerException("Null or empty source"); + } + + // Debug.logInfo("Requested Page : " + page, module); + // Debug.logInfo("Physical Path : " + context.getRealPath(page)); + + // tell the ContextFilter we are forwarding + request.setAttribute(ContextFilter.FORWARDED_FROM_SERVLET, Boolean.TRUE); + RequestDispatcher rd = request.getRequestDispatcher(page); + + if (rd == null) { + Debug.logInfo("HttpServletRequest.getRequestDispatcher() failed; trying ServletContext", module); + rd = context.getRequestDispatcher(page); + if (rd == null) { + Debug.logInfo("ServletContext.getRequestDispatcher() failed; trying ServletContext.getNamedDispatcher(\"jsp\")", module); + rd = context.getNamedDispatcher("jsp"); + if (rd == null) { + throw new ViewHandlerException("Source returned a null dispatcher (" + page + ")"); + } + } + } + + try { + if (UtilValidate.isEmpty(request.getServletPath())) { + // no context or filter to service this page, so we have to forward it directly and let SeoControlServlet to resolve it + String uri = URLEncoder.encode(request.getContextPath() + page, "UTF-8"); + request.setAttribute("_jsp_" + uri, Boolean.TRUE); + rd.forward(request, response); + } else { + rd.include(request, response); + } + } catch (IOException ie) { + throw new ViewHandlerException("IO Error in view", ie); + } catch (ServletException e) { + Throwable throwable = e.getRootCause() != null ? e.getRootCause() : e; + + if (throwable instanceof JspException) { + JspException jspe = (JspException) throwable; + + throwable = jspe.getCause() != null ? jspe.getCause() : jspe; + } + Debug.logError(throwable, "ServletException rendering JSP view", module); + throw new ViewHandlerException(e.getMessage(), throwable); + } + } +} diff --git a/template/LoginForgot.ftl b/template/LoginForgot.ftl new file mode 100644 index 0000000..67cfc3b --- /dev/null +++ b/template/LoginForgot.ftl @@ -0,0 +1,49 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> +
    + +

    ${uiLabelMap.CommonForgotYourPassword}

    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +   +
    +
    + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    + \ No newline at end of file diff --git a/template/LoginJanrain.ftl b/template/LoginJanrain.ftl new file mode 100644 index 0000000..411a701 --- /dev/null +++ b/template/LoginJanrain.ftl @@ -0,0 +1,82 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> + + +

    ${uiLabelMap.CommonLogin}

    +
    +
    +

    ${uiLabelMap.CommonRegistered}

    +
    +
    + + + + + +
    +
    +
    +
    + + +
    + <#if autoUserLogin?has_content> +

    (${uiLabelMap.CommonNot} ${autoUserLogin.userLoginId}? ${uiLabelMap.CommonClickHere})

    + +
    + + +
    +
    + +
    +
    + + ${uiLabelMap.CommonMayCreate} +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/template/LoginMain.ftl b/template/LoginMain.ftl new file mode 100644 index 0000000..f76bba1 --- /dev/null +++ b/template/LoginMain.ftl @@ -0,0 +1,76 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> + +
    + +

    ${uiLabelMap.CommonRegistered}

    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + <#if autoUserLogin?has_content> +

    (${uiLabelMap.CommonNot} ${autoUserLogin.userLoginId}? ${uiLabelMap.CommonClickHere})

    + +
    +
    + +
    +
    + +
    +
    +
    +
    +   +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +   +
    +
    + +
    +
    +
    +
    + +
    + +
    +
    +
    \ No newline at end of file diff --git a/template/blog/TextImage.ftl b/template/blog/TextImage.ftl new file mode 100644 index 0000000..c827971 --- /dev/null +++ b/template/blog/TextImage.ftl @@ -0,0 +1,123 @@ +<#-- + 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. + --> + +<#-- +# This page displays both the textarea for text and the file upload control. +# It was awkward to do it with screen widgets because need to show checkboxes +# by each control. +--> + +<#-- This code sets the checkboxes based on existing data --> +<#assign text_check=""/> +<#assign img_check=""/> +<#if (imageContent?has_content && (drDataTemplateTypeId?default("") == "SCREEN_COMBINED") || drMimeTypeId?default("")?starts_with("image"))> + <#assign img_check="checked='checked'"/> + +<#if (textContent?has_content && drMimeTypeId?default("")?starts_with("text")) + || (textContent?has_content && (drDataTemplateTypeId?default("") == "SCREEN_COMBINED")) + || !img_check?has_content> + <#assign text_check="checked='checked'"/> + + +<#-- Sets one of the two templates --> +<#assign topleft_check=""/> +<#assign topcenter_check=""/> +<#if view.drDataResourceId?has_content && view.drDataResourceId == "BLOG_TPL_TOPLEFT"> + <#assign topleft_check="checked='checked'"/> +<#else> + <#assign topcenter_check="checked='checked'"/> + + +<#-- Fills in existing text --> +<#assign textData=""/> +<#if electronicText?has_content > + <#if electronicText.textData?has_content > + <#assign textData=electronicText.textData/> + + + +<#-- Stores the ids for existing data --> +<#assign textContentId=""/> +<#assign textDataResourceId=""/> + +<#if textContent?has_content > + <#assign textContentId=textContent.contentId!/> + <#assign textDataResourceId=textContent.drDataResourceId!/> + + +<#if textElectronicText?has_content && textElectronicText.textData?has_content > + <#assign textData=textElectronicText.textData/> + + +<#assign imageContentId=""/> +<#assign imageDataResourceId=""/> + +<#if imageContent?has_content > + <#assign imageContentId=imageContent.contentId!/> + <#assign imageDataResourceId=imageContent.drDataResourceId!/> + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +   +
    Text
    +
      + + + +
    + +   +
    Image
    +
      +
    Existing file name: <#if imageContent?has_content && imageContent.drObjectInfo?has_content>${imageContent.drObjectInfo}
    +
    + + <#-- + Force: + --> +
    + Top-left: +  Top-center: +
    +   +
    diff --git a/template/blog/blogContentAltLink.ftl b/template/blog/blogContentAltLink.ftl new file mode 100644 index 0000000..7d9b5d4 --- /dev/null +++ b/template/blog/blogContentAltLink.ftl @@ -0,0 +1,21 @@ +<#-- +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. +--> + +${blog.contentName} [${blog.contentId}] + diff --git a/template/blog/blogs.ftl b/template/blog/blogs.ftl new file mode 100644 index 0000000..36981e4 --- /dev/null +++ b/template/blog/blogs.ftl @@ -0,0 +1,31 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + +--> + +
    +
    +

    ${uiLabelMap.ProductBrowseBlogs}

    +
    +
    + +
    +
    diff --git a/template/blog/main.ftl b/template/blog/main.ftl new file mode 100644 index 0000000..7bfac65 --- /dev/null +++ b/template/blog/main.ftl @@ -0,0 +1,86 @@ +<#-- +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. +--> + +<#assign initialLocale = locale.toString()> + + + Main + + + + + + <#if layoutSettings.styleSheets?has_content> + <#--layoutSettings.styleSheets is a list of style sheets. So, you can have a user-specified "main" style sheet, AND a component style sheet.--> + <#list layoutSettings.styleSheets as styleSheet> + + + <#else> + + + + + + + + + +
    + + + <#if layoutSettings.headerImageUrl??> + + + + +
    ${layoutSettings.companyName}background="${layoutSettings.headerRightBackgroundUrl}"> +
    + <#if userLogin?has_content> + Logged in as ${userLogin.userLoginId} | Logout | Help Center + <#else> + Sign up Now! | Help Center + +
    +
    +
    + + +
    +
    +
    +
    + ${sections.render("header")} +
    + +
    + + ${sections.render("leftbar")} +
    + ${sections.render("messages")} + ${sections.render("body")} +
    + ${sections.render("rightbar")} +
    +
    + + diff --git a/template/blog/menubar.ftl b/template/blog/menubar.ftl new file mode 100644 index 0000000..7d96adb --- /dev/null +++ b/template/blog/menubar.ftl @@ -0,0 +1,27 @@ +<#-- +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. +--> + + diff --git a/template/cart/CartAddPromo.ftl b/template/cart/CartAddPromo.ftl new file mode 100644 index 0000000..d4273f2 --- /dev/null +++ b/template/cart/CartAddPromo.ftl @@ -0,0 +1,41 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> +
    +
    +

    ${uiLabelMap.ProductPromoCodes}

    +
    +
    +
    +
    + + + <#assign productPromoCodeIds = (shoppingCart.getProductPromoCodesEntered())! /> + <#if productPromoCodeIds?has_content> + ${uiLabelMap.ProductPromoCodesEntered} +
      + <#list productPromoCodeIds as productPromoCodeId> +
    • ${productPromoCodeId}
    • + +
    + + <#if (shoppingCartSize?default(0) > 0)> + ${screens.render("component://oshop/widget/CartScreens.xml#promoUseDetailsInline")} + +
    +
    +
    +
    \ No newline at end of file diff --git a/template/cart/CartAssocProducts.ftl b/template/cart/CartAssocProducts.ftl new file mode 100644 index 0000000..27834b3 --- /dev/null +++ b/template/cart/CartAssocProducts.ftl @@ -0,0 +1,31 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> +
    +
    +

    ${uiLabelMap.EcommerceYouMightAlsoIntrested}:

    +
    +
    + <#-- random complementary products --> + <#list associatedProducts as assocProduct> +
    + ${setRequestAttribute("optProduct", assocProduct)} + ${setRequestAttribute("listIndex", assocProduct_index)} + ${screens.render("component://oshop/widget/ProductScreens.xml#productsummary")} +
    + +
    +
    diff --git a/template/cart/CartItemAdjustments.ftl b/template/cart/CartItemAdjustments.ftl new file mode 100644 index 0000000..0bbbcc9 --- /dev/null +++ b/template/cart/CartItemAdjustments.ftl @@ -0,0 +1,84 @@ + + <#if shoppingCart.getAdjustments()?has_content> + + + + + + <#if (shoppingCart.getDisplayTaxIncluded() > 0.0)> + + + + + + + <#list shoppingCart.getAdjustments() as cartAdjustment> + <#assign adjustmentType = cartAdjustment.getRelatedOne("OrderAdjustmentType", true) /> + + + + + + + + + + + + <#if itemsFromList> + + + + + <#if promoItems> + + + + + <#if !itemsFromList && !promoItems> + + + + + + + + + + + + + +
    ${uiLabelMap.CommonSubTotal}:<@ofbizCurrency amount=shoppingCart.getDisplaySubTotal() isoCode=shoppingCart.getCurrency()/> 
    ${uiLabelMap.OrderSalesTaxIncluded}:<@ofbizCurrency amount=shoppingCart.getDisplayTaxIncluded() isoCode=shoppingCart.getCurrency()/> 
    + ${uiLabelMap.EcommerceAdjustment} - ${adjustmentType.get("description",locale)!} + <#if cartAdjustment.productPromoId?has_content>${uiLabelMap.CommonDetails}: + <@ofbizCurrency amount=Static["org.ofbiz.order.order.OrderReadHelper"].calcOrderAdjustment(cartAdjustment, shoppingCart.getSubTotal()) isoCode=shoppingCart.getCurrency()/> 
    ${uiLabelMap.EcommerceCartTotal}:<@ofbizCurrency amount=shoppingCart.getDisplayGrandTotal() isoCode=shoppingCart.getCurrency()/>
    L - ${uiLabelMap.EcommerceItemsfromShopingList}.
    P - ${uiLabelMap.EcommercePromotionalItems}.
     
    + <#if sessionAttributes.userLogin?has_content && sessionAttributes.userLogin.userLoginId != "anonymous"> + +    + ${uiLabelMap.EcommerceAddSelectedtoList}   + <#else> + ${uiLabelMap.OrderYouMust} ${uiLabelMap.CommonBeLogged} + ${uiLabelMap.OrderToAddSelectedItemsToShoppingList}.  + +
    + <#if sessionAttributes.userLogin?has_content && sessionAttributes.userLogin.userLoginId != "anonymous"> +    + ${uiLabelMap.OrderCreateCustRequestFromCart}   +    + ${uiLabelMap.OrderCreateQuoteFromCart}   + <#else> + ${uiLabelMap.OrderYouMust} ${uiLabelMap.CommonBeLogged} + ${uiLabelMap.EcommerceToOrderCreateCustRequestFromCart}.  + +
    + checked="checked"/>${uiLabelMap.EcommerceAlwaysViewCartAfterAddingAnItem}. +
    \ No newline at end of file diff --git a/template/cart/CartItems.ftl b/template/cart/CartItems.ftl new file mode 100644 index 0000000..b614fba --- /dev/null +++ b/template/cart/CartItems.ftl @@ -0,0 +1,204 @@ +
    +
    +

    ${uiLabelMap.ProductPromoCodes}

    +
    +
    + + + + + + <#if asslGiftWraps?has_content && productStore.showCheckoutGiftOptions! != "N">> + + + <#if fixedAssetExist == true> + + <#else> + + + + + + + + + + <#assign itemsFromList = false /> + <#assign promoItems = false /> + <#list shoppingCart.items() as cartLine> + <#assign cartLineIndex = shoppingCart.getItemIndex(cartLine) /> + <#assign lineOptionalFeatures = cartLine.getOptionalProductFeatures() /> + <#-- show adjustment info --> + <#list cartLine.getAdjustments() as cartLineAdjustment> + + + + + + <#-- gift wrap option --> + <#assign showNoGiftWrapOptions = false /> + + <#-- end gift wrap option --> + + + + + + + + + +
    +
    + +
    ${uiLabelMap.CommonMessages}
    +
    +
    +
    ${uiLabelMap.OrderProduct} + + <#else> +   + + + + + + + + + +
    - ${uiLabelMap.EcommerceStartDate} -- ${uiLabelMap.EcommerceNbrOfDays} -
    - ${uiLabelMap.EcommerceNbrOfPersons} -- ${uiLabelMap.CommonQuantity} -
    +
    ${uiLabelMap.CommonQuantity}${uiLabelMap.EcommerceUnitPrice}${uiLabelMap.EcommerceAdjustments}${uiLabelMap.EcommerceItemTotal}
    + <#assign itemsFromList = true /> + L   + <#elseif cartLine.getIsPromo()> + <#assign promoItems = true /> + P   + <#else> +   + + + <#if cartLine.getProductId()??> + <#-- product item --> + <#-- start code to display a small image of the product --> + <#if cartLine.getParentProductId()??> + <#assign parentProductId = cartLine.getParentProductId() /> + <#else> + <#assign parentProductId = cartLine.getProductId() /> + + <#assign smallImageUrl = Static["org.ofbiz.product.product.ProductContentWrapper"].getProductContentAsText(cartLine.getProduct(), "SMALL_IMAGE_URL", locale, dispatcher, "url")! /> + <#if !smallImageUrl?string?has_content><#assign smallImageUrl = "/images/defaultImage.jpg" /> + <#if smallImageUrl?string?has_content> + + Product Image + + + <#-- end code to display a small image of the product --> + <#-- ${cartLineIndex} - --> + ${cartLine.getProductId()} - + ${cartLine.getName()!} : ${cartLine.getDescription()!} + <#-- For configurable products, the selected options are shown --> + <#if cartLine.getConfigWrapper()??> + <#assign selectedOptions = cartLine.getConfigWrapper().getSelectedOptions()! /> + <#if selectedOptions??> +
     
    + <#list selectedOptions as option> +
    ${option.getDescription()}
    + + + + <#-- if inventory is not required check to see if it is out of stock and needs to have a message shown about that... --> + <#assign itemProduct = cartLine.getProduct() /> + <#assign isStoreInventoryNotRequiredAndNotAvailable = Static["org.ofbiz.product.store.ProductStoreWorker"].isStoreInventoryRequiredAndAvailable(request, itemProduct, cartLine.getQuantity(), false, false) /> + <#if isStoreInventoryNotRequiredAndNotAvailable && itemProduct.inventoryMessage?has_content> + (${itemProduct.inventoryMessage}) + + <#else> + <#-- this is a non-product item --> + ${cartLine.getItemTypeDescription()!}: ${cartLine.getName()!} + + <#assign attrs = cartLine.getOrderItemAttributes()/> + <#if attrs?has_content> + <#assign attrEntries = attrs.entrySet()/> +
      + <#list attrEntries as attrEntry> +
    • ${attrEntry.getKey()} : ${attrEntry.getValue()}
    • + +
    + + <#if (cartLine.getIsPromo() && cartLine.getAlternativeOptionProductIds()?has_content)> + <#-- Show alternate gifts if there are any... --> +
    ${uiLabelMap.OrderChooseFollowingForGift}:
    + + <#-- this is the old way, it lists out the options and is not as nice as the drop-down + + --> + +
    + <#assign giftWrapOption = lineOptionalFeatures.GIFT_WRAP! /> + <#assign selectedOption = cartLine.getAdditionalProductFeatureAndAppl("GIFT_WRAP")! /> + <#if giftWrapOption?has_content> + + <#elseif showNoGiftWrapOptions> + + <#else> +   + + + <#if cartLine.getIsPromo() || cartLine.getShoppingListId()??> + <#if fixedAssetExist == true> + <#if cartLine.getReservStart()??> + + + + + + + + + + + + + <#list assocProducts as productAssoc> + + ${setRequestAttribute("optProductId", productAssoc.productIdTo)} + ${setRequestAttribute("listIndex", listIndex)} + ${setRequestAttribute("formNamePrefix", formNamePrefix)} + <#if targetRequestName?has_content> + ${setRequestAttribute("targetRequestName", targetRequestName)} + + + + + <#local listIndex = listIndex + 1> + + + ${setRequestAttribute("optProductId", "")} + ${setRequestAttribute("formNamePrefix", "")} + ${setRequestAttribute("targetRequestName", "")} + + +<#assign productValue = product> +<#assign listIndex = 1> +${setRequestAttribute("productValue", productValue)} + +
     ${cartLine.getReservStart()?string("yyyy-mm-dd")}${cartLine.getReservLength()?string.number}
     ${cartLine.getReservPersons()?string.number} + <#else> + + + + + + + +
    ----
    -- + + ${cartLine.getQuantity()?string.number}
    + <#else><#-- fixedAssetExist --> + ${cartLine.getQuantity()?string.number} + + <#else><#-- Is Promo or Shoppinglist --> + <#if fixedAssetExist == true><#if cartLine.getReservStart()??> + + + + + + + + +
     
     <#else> +
    ----
    -- +
    + <#else><#-- fixedAssetExist --> + + + +
    <@ofbizCurrency amount=cartLine.getDisplayPrice() isoCode=shoppingCart.getCurrency()/><@ofbizCurrency amount=cartLine.getOtherAdjustments() isoCode=shoppingCart.getCurrency()/><@ofbizCurrency amount=cartLine.getDisplayItemSubTotal() isoCode=shoppingCart.getCurrency()/><#if !cartLine.getIsPromo()><#else> 
    + + \ No newline at end of file diff --git a/template/cart/CartQuickAddProduct.ftl b/template/cart/CartQuickAddProduct.ftl new file mode 100644 index 0000000..445d090 --- /dev/null +++ b/template/cart/CartQuickAddProduct.ftl @@ -0,0 +1,23 @@ +
    +
    +

    ${uiLabelMap.CommonQuickAdd}

    +
    +
    +
    +
    + ${uiLabelMap.CommonProduct} + <#-- check if rental data present insert extra fields in Quick Add--> + <#if (product?? && product.getString("productTypeId") == "ASSET_USAGE") || (product?? && product.getString("productTypeId") == "ASSET_USAGE_OUT_IN")> + ${uiLabelMap.EcommerceStartDate}: + ${uiLabelMap.EcommerceLength}: +
    +
    +   ${uiLabelMap.OrderNbrPersons}: + + ${uiLabelMap.CommonQuantity}: + + <#-- [${uiLabelMap.OrderAddToCart}] --> + + +
    +
    \ No newline at end of file diff --git a/template/cart/CartShowPromo.ftl b/template/cart/CartShowPromo.ftl new file mode 100644 index 0000000..c0fbf62 --- /dev/null +++ b/template/cart/CartShowPromo.ftl @@ -0,0 +1,17 @@ +<#if showPromoText?? && showPromoText> +
    +
    +

    ${uiLabelMap.OrderSpecialOffers}

    +
    +
    + <#-- show promotions text --> + + + +
    +
    + diff --git a/template/cart/PopOverCart.ftl b/template/cart/PopOverCart.ftl new file mode 100644 index 0000000..cb0c54e --- /dev/null +++ b/template/cart/PopOverCart.ftl @@ -0,0 +1,78 @@ +<#-- +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. +--> + +<#assign shoppingCart = sessionAttributes.shoppingCart!> +<#if shoppingCart?has_content> + <#assign shoppingCartSize = shoppingCart.size()> +<#else> + <#assign shoppingCartSize = 0> + +
    + <#if (shoppingCartSize > 0)> + + + + + + + + + + + + + + + + + + + + + <#list shoppingCart.items() as cartLine> + + + + + + <#if cartLine.getReservStart()??> + + + + +
    ${uiLabelMap.OrderQty}${uiLabelMap.OrderItem}${uiLabelMap.CommonSubtotal}

    ${uiLabelMap.OrderTotal}:  + <@ofbizCurrency amount=shoppingCart.getDisplayGrandTotal() isoCode=shoppingCart.getCurrency()/> +
    ${cartLine.getQuantity()?string.number} + <#if cartLine.getProductId()??> + <#if cartLine.getParentProductId()??> + ${cartLine.getName()} + <#else> + ${cartLine.getName()} + + <#else> + ${cartLine.getItemTypeDescription()!} + + <@ofbizCurrency amount=cartLine.getDisplayItemSubTotal() isoCode=shoppingCart.getCurrency()/>
     (${cartLine.getReservStart()?string("yyyy-MM-dd")}, ${cartLine.getReservLength()} <#if cartLine.getReservLength() == 1>${uiLabelMap.CommonDay}<#else>${uiLabelMap.CommonDays})
    + <#if hidebottomlinks?default("N") != "Y"> + ${uiLabelMap.OrderCheckout} + + <#else> +

    ${uiLabelMap.OrderShoppingCartEmpty}

    + +
    \ No newline at end of file diff --git a/template/cart/UpdateCart.ftl b/template/cart/UpdateCart.ftl new file mode 100644 index 0000000..62ccca4 --- /dev/null +++ b/template/cart/UpdateCart.ftl @@ -0,0 +1,184 @@ +<#-- +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. +--> + +<#if shoppingCart?has_content && shoppingCart.size() > 0> +

    ${uiLabelMap.EcommerceStep} 1: ${uiLabelMap.PageTitleShoppingCart}

    + +
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <#list shoppingCart.items() as cartLine> + + + + + + <#if !cartLine.getIsPromo()> + + <#else> + + + + <#if !cartLine.getIsPromo()> + + + + + +
    ${uiLabelMap.OrderItem}${uiLabelMap.CommonDescription}${uiLabelMap.EcommerceUnitPrice}${uiLabelMap.OrderQuantity}${uiLabelMap.EcommerceAdjustments}${uiLabelMap.EcommerceItemTotal}${uiLabelMap.FormFieldTitle_removeButton}
    ${uiLabelMap.CommonSubtotal}<@ofbizCurrency amount=shoppingCart.getSubTotal() isoCode=shoppingCart.getCurrency() />
    ${uiLabelMap.ProductDiscount} + <#assign orderAdjustmentsTotal = 0 /> + <#list shoppingCart.getAdjustments() as cartAdjustment> + <#assign orderAdjustmentsTotal = orderAdjustmentsTotal + Static["org.ofbiz.order.order.OrderReadHelper"].calcOrderAdjustment(cartAdjustment, shoppingCart.getSubTotal()) /> + + <@ofbizCurrency amount=orderAdjustmentsTotal isoCode=shoppingCart.getCurrency() /> +
    ${uiLabelMap.OrderShippingAndHandling}<@ofbizCurrency amount=shoppingCart.getTotalShipping() isoCode=shoppingCart.getCurrency() />
    ${uiLabelMap.OrderSalesTax}<@ofbizCurrency amount=shoppingCart.getTotalSalesTax() isoCode=shoppingCart.getCurrency() />
    ${uiLabelMap.OrderGrandTotal}<@ofbizCurrency amount=shoppingCart.getDisplayGrandTotal() isoCode=shoppingCart.getCurrency() />
    + <#if cartLine.getProductId()??> + <#if cartLine.getParentProductId()??> + <#assign parentProductId = cartLine.getParentProductId() /> + <#else> + <#assign parentProductId = cartLine.getProductId() /> + + <#assign smallImageUrl = Static["org.ofbiz.product.product.ProductContentWrapper"].getProductContentAsText(cartLine.getProduct(), "SMALL_IMAGE_URL", locale, dispatcher, "url")! /> + <#if !smallImageUrl?string?has_content><#assign smallImageUrl = "" /> + <#if smallImageUrl?string?has_content> + Product Image + + + ${cartLine.getName()!}<@ofbizCurrency amount=cartLine.getDisplayPrice() isoCode=shoppingCart.getCurrency() /> + <#if cartLine.getIsPromo()> + ${cartLine.getQuantity()?string.number} + <#else> + + + + + + <@ofbizCurrency amount=cartLine.getOtherAdjustments() isoCode=shoppingCart.getCurrency() /><@ofbizCurrency amount=cartLine.getOtherAdjustments() isoCode=shoppingCart.getCurrency() /><@ofbizCurrency amount=cartLine.getDisplayItemSubTotal() isoCode=shoppingCart.getCurrency() />Remove Item Image
    +
    +
    +
    + + +
    +
    +
    + ${uiLabelMap.EcommerceContinueToStep} 2 + +
    +
    +
    + \ No newline at end of file diff --git a/template/cart/microcart.ftl b/template/cart/microcart.ftl new file mode 100644 index 0000000..e674473 --- /dev/null +++ b/template/cart/microcart.ftl @@ -0,0 +1,60 @@ +<#-- +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. +--> +<#assign shoppingCart = sessionAttributes.shoppingCart!> +<#if shoppingCart?has_content> + <#assign shoppingCartSize = shoppingCart.size()> +<#else> + <#assign shoppingCartSize = 0> + +
    + <#if (shoppingCartSize > 0)> +

    + ${uiLabelMap.EcommerceCartHas} ${shoppingCart.getTotalQuantity()} + <#if shoppingCart.getTotalQuantity() == 1>${uiLabelMap.OrderItem}<#else/>${uiLabelMap.OrderItems}, + <@ofbizCurrency amount=shoppingCart.getDisplayGrandTotal() isoCode=shoppingCart.getCurrency()/> +

    + + <#else> +

    ${uiLabelMap.OrderShoppingCartEmpty}

    + +
      +
    • [${uiLabelMap.OrderViewCart}]
    • + <#if (shoppingCartSize > 0)> + <#if !initialLocaleComplete?? || initialLocaleComplete?length == 2 > + <#if initialLocaleComplete?? && initialLocaleComplete?length == 2 && initialLocaleComplete == "fr"> + <#assign initialLocaleComplete = "fr_FR"><#-- same idea can be used with other default locale --> + <#else> + <#assign initialLocaleComplete = "en_US"> + + +
    • [${uiLabelMap.OrderCheckoutQuick}]
    • + +
    • [${uiLabelMap.EcommerceOnePageCheckout}]
    • + +
    • [${uiLabelMap.EcommerceCartToGoogleCheckout}]
    • + + <#if shoppingCart?has_content && (shoppingCart.getGrandTotal() > 0)> +
    • [PayPal Express Checkout]
    • + + <#else> +
    • [${uiLabelMap.OrderCheckoutQuick}]
    • +
    • [${uiLabelMap.EcommerceOnePageCheckout}]
    • + +
    +
    diff --git a/template/cart/minicart.ftl b/template/cart/minicart.ftl new file mode 100644 index 0000000..eb0fe5c --- /dev/null +++ b/template/cart/minicart.ftl @@ -0,0 +1,97 @@ +<#-- +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. +--> + +<#assign shoppingCart = sessionAttributes.shoppingCart!> +<#if shoppingCart?has_content> + <#assign shoppingCartSize = shoppingCart.size()> +<#else> + <#assign shoppingCartSize = 0> + + +
    +
    +

    ${uiLabelMap.OrderCartSummary}

    +
    +
    + <#if (shoppingCartSize > 0)> + <#if hidetoplinks?default("N") != "Y"> + + + + + + + + + + + + + + + + + + + + + + <#list shoppingCart.items() as cartLine> + + + + + + <#if cartLine.getReservStart()??> + + + + +
    ${uiLabelMap.OrderQty}${uiLabelMap.OrderItem}${uiLabelMap.CommonSubtotal}

    ${uiLabelMap.OrderTotal}:  + <@ofbizCurrency amount=shoppingCart.getDisplayGrandTotal() isoCode=shoppingCart.getCurrency()/> +
    ${cartLine.getQuantity()?string.number} + <#if cartLine.getProductId()??> + <#if cartLine.getParentProductId()??> + ${cartLine.getName()} + <#else> + ${cartLine.getName()} + + <#else> + ${cartLine.getItemTypeDescription()!} + + <@ofbizCurrency amount=cartLine.getDisplayItemSubTotal() isoCode=shoppingCart.getCurrency()/>
     (${cartLine.getReservStart()?string("yyyy-MM-dd")}, ${cartLine.getReservLength()} <#if cartLine.getReservLength() == 1>${uiLabelMap.CommonDay}<#else>${uiLabelMap.CommonDays})
    + <#if hidebottomlinks?default("N") != "Y"> + + + <#else> +

    ${uiLabelMap.OrderShoppingCartEmpty}

    + +
    +
    diff --git a/template/cart/minipromotext.ftl b/template/cart/minipromotext.ftl new file mode 100644 index 0000000..0b1588e --- /dev/null +++ b/template/cart/minipromotext.ftl @@ -0,0 +1,46 @@ +<#-- +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. +--> + +<#if showPromoText> +
    +
    +
      +
    • ${uiLabelMap.OrderSpecialOffers}
    • +
    +
    +
    + +
    + <#-- show promotions text --> + +
    +
    + diff --git a/template/cart/promoUseDetailsInline.ftl b/template/cart/promoUseDetailsInline.ftl new file mode 100644 index 0000000..88b01b9 --- /dev/null +++ b/template/cart/promoUseDetailsInline.ftl @@ -0,0 +1,79 @@ +<#-- +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. +--> + +
    + <#assign promoInUseIter = shoppingCart.getProductPromoUseInfoIter() > + <#if promoInUseIter?has_content > + ${uiLabelMap.OrderPromotionsApplied}: + + +
      + <#list shoppingCart.getProductPromoUseInfoIter() as productPromoUseInfo> +
    • + <#-- TODO: when promo pretty print is done show promo short description here --> + ${uiLabelMap.OrderPromotion} ${uiLabelMap.CommonDetails} + <#if productPromoUseInfo.productPromoCodeId?has_content> - ${uiLabelMap.OrderWithPromoCode} [${productPromoUseInfo.productPromoCodeId}] + <#if (productPromoUseInfo.totalDiscountAmount != 0)> - ${uiLabelMap.CommonTotalValue} <@ofbizCurrency amount=(-1*productPromoUseInfo.totalDiscountAmount) isoCode=shoppingCart.getCurrency()/> + <#if productPromoUseInfo.productPromoCodeId?has_content> + ${uiLabelMap.OrderRemovePromotion} + +
    • + <#if (productPromoUseInfo.quantityLeftInActions > 0)> +
    • - Could be used for ${productPromoUseInfo.quantityLeftInActions} more discounted item<#if (productPromoUseInfo.quantityLeftInActions > 1)>s if added to your cart.
    • + + +
    + ${uiLabelMap.OrderCartItemUseinPromotions}: +
      + <#list shoppingCart.items() as cartLine> + <#assign cartLineIndex = shoppingCart.getItemIndex(cartLine)> + <#if cartLine.getIsPromo()> +
    • ${uiLabelMap.OrderItemN} ${cartLineIndex+1} [${cartLine.getProductId()!}] - ${uiLabelMap.OrderIsAPromotionalItem}
    • + <#else> +
    • ${uiLabelMap.OrderItemN} ${cartLineIndex+1} [${cartLine.getProductId()!}] - ${cartLine.getPromoQuantityUsed()?string.number}/${cartLine.getQuantity()?string.number} ${uiLabelMap.CommonUsed} - ${cartLine.getPromoQuantityAvailable()?string.number} ${uiLabelMap.CommonAvailable} +
        + <#list cartLine.getQuantityUsedPerPromoActualIter() as quantityUsedPerPromoActualEntry> + <#assign productPromoActualPK = quantityUsedPerPromoActualEntry.getKey()> + <#assign actualQuantityUsed = quantityUsedPerPromoActualEntry.getValue()> + <#assign isQualifier = "ProductPromoCond" == productPromoActualPK.getEntityName()> +
      •   - ${actualQuantityUsed} ${uiLabelMap.CommonUsedAs} <#if isQualifier>${uiLabelMap.CommonQualifier}<#else>${uiLabelMap.CommonBenefit} ${uiLabelMap.OrderOfPromotion} ${uiLabelMap.CommonDetails}
      • + + +
      +
        + <#list cartLine.getQuantityUsedPerPromoFailedIter() as quantityUsedPerPromoFailedEntry> + <#assign productPromoFailedPK = quantityUsedPerPromoFailedEntry.getKey()> + <#assign failedQuantityUsed = quantityUsedPerPromoFailedEntry.getValue()> + <#assign isQualifier = "ProductPromoCond" == productPromoFailedPK.getEntityName()> +
      •   - ${uiLabelMap.CommonCouldBeUsedAs} <#if isQualifier>${uiLabelMap.CommonQualifier}<#else>${uiLabelMap.CommonBenefit} ${uiLabelMap.OrderOfPromotion} ${uiLabelMap.CommonDetails}
      • + + +
      + <#list cartLine.getQuantityUsedPerPromoCandidateIter() as quantityUsedPerPromoCandidateEntry> + <#assign productPromoCandidatePK = quantityUsedPerPromoCandidateEntry.getKey()> + <#assign candidateQuantityUsed = quantityUsedPerPromoCandidateEntry.getValue()> + <#assign isQualifier = "ProductPromoCond" == productPromoCandidatePK.getEntityName()> + + + +
    • + + +
    +
    diff --git a/template/cart/showcart.ftl b/template/cart/showcart.ftl new file mode 100644 index 0000000..e52dc4d --- /dev/null +++ b/template/cart/showcart.ftl @@ -0,0 +1,154 @@ +<#-- +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. +--> + + + +<#assign fixedAssetExist = shoppingCart.containAnyWorkEffortCartItems() /> <#-- change display format when rental items exist in the shoppingcart --> +
    +
    +

    ${uiLabelMap.OrderShoppingCart}

    +
    +
    + <#include "CartQuickAddProduct.ftl" /> + <#if ((sessionAttributes.lastViewedProducts)?has_content && sessionAttributes.lastViewedProducts?size > 0)> + <#assign continueLink = "/product?product_id=" + sessionAttributes.lastViewedProducts.get(0) /> + <#else> + <#assign continueLink = "/main" /> + + ${uiLabelMap.EcommerceContinueShopping} + + <#--[${uiLabelMap.EcommerceContinueShopping}]--> + <#if (shoppingCartSize > 0)> + ${uiLabelMap.EcommerceRecalculateCart} + ${uiLabelMap.EcommerceEmptyCart} + ${uiLabelMap.EcommerceRemoveSelected} + + <#if (shoppingCartSize > 0)> +
    +
    + + <#include "CartItems.ftl" /> + <#include "CartItemAdjustments.ftl" /> + <#include "CartAddPromo.ftl" /> + <#include "CartShowPromo.ftl" /> +
    +
    + <#if (shoppingCartSize > 0)> + + <#else> + ${uiLabelMap.OrderCheckout} + + <#else> +

    ${uiLabelMap.EcommerceYourShoppingCartEmpty}.

    + +
    +
    + + +<#if associatedProducts?has_content> + <#include "CartAssocProducts.ftl" /> + + + diff --git a/template/catalog/LayeredCategoryDetail.ftl b/template/catalog/LayeredCategoryDetail.ftl new file mode 100644 index 0000000..b8f57df --- /dev/null +++ b/template/catalog/LayeredCategoryDetail.ftl @@ -0,0 +1,107 @@ +<#-- +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. +--> + +<#macro paginationControls> + <#assign viewIndexMax = Static["java.lang.Math"].ceil((listSize - 1)?double / viewSize?double)> + <#if (viewIndexMax?int > 0)> +
    + <#-- Start Page Select Drop-Down --> + + <#-- End Page Select Drop-Down --> + <#if (0 < viewIndex?int)> + ${uiLabelMap.CommonPrevious} | + + <#if ((listSize?int - viewSize?int) > 0)> + ${lowIndex + 1} - ${highIndex} ${uiLabelMap.CommonOf} ${listSize} + + <#if highIndex?int < listSize?int> + | ${uiLabelMap.CommonNext} + +
    + + + + +<#if productCategory??> + <#assign categoryName = categoryContentWrapper.get("CATEGORY_NAME", "html")!/> + <#assign categoryDescription = categoryContentWrapper.get("DESCRIPTION", "html")!/> + <#if categoryName?has_content> +

    ${categoryName}

    + + <#if categoryDescription?has_content> +

    ${categoryDescription}

    + + <#assign longDescription = categoryContentWrapper.get("LONG_DESCRIPTION", "html")!/> + <#assign categoryImageUrl = categoryContentWrapper.get("CATEGORY_IMAGE_URL", "url")!/> + <#if categoryImageUrl?string?has_content || longDescription?has_content> +
    + <#if categoryImageUrl?string?has_content> + <#assign height=100/> + + + <#if longDescription?has_content> + ${longDescription} + +
    + + + +<#if productIds?has_content> + <@paginationControls/> + <#assign numCol = numCol?default(1)> + <#assign numCol = numCol?number> + <#assign tabCol = 1> +
    + style="position: relative; margin-top: ${height}px;" + + class="productsummary-container<#if (numCol?int > 1)> matrix"> + <#if (numCol?int > 1)> + + + <#list productIds as productId> + <#if (numCol?int == 1)> + ${setRequestAttribute("optProductId", productId)} + ${setRequestAttribute("listIndex", productId_index)} + ${screens.render(productsummaryScreen)} + <#else> + <#if (tabCol?int = 1)> + + <#if (tabCol?int = numCol)> + <#assign tabCol = tabCol+1><#if (tabCol?int > numCol)><#assign tabCol = 1> + + + <#if (numCol?int > 1)> +
    + ${setRequestAttribute("optProductId", productId)} + ${setRequestAttribute("listIndex", productId_index)} + ${screens.render(productsummaryScreen)} +
    + +
    + <@paginationControls/> +<#else> +
    +
    ${uiLabelMap.ProductNoProductsInThisCategory}
    + diff --git a/template/catalog/LayeredNavBar.ftl b/template/catalog/LayeredNavBar.ftl new file mode 100644 index 0000000..8cee879 --- /dev/null +++ b/template/catalog/LayeredNavBar.ftl @@ -0,0 +1,75 @@ +<#-- +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. +--> + +<#if currentSearchCategory??> +
    +
    +
      +
    • ${uiLabelMap.EcommerceLayeredNavigation}
    • +
    +
    + <#escape x as x?xml> + <#if productCategory.productCategoryId != currentSearchCategory.productCategoryId> + <#assign currentSearchCategoryName = categoryContentWrapper.get("CATEGORY_NAME", "html")?string /> + <#list searchConstraintStrings as searchConstraintString> + <#if searchConstraintString.indexOf(currentSearchCategoryName) != -1> +
     X<#noescape> ${searchConstraintString}
    + + + + + <#list searchConstraintStrings as searchConstraintString> + <#if searchConstraintString.indexOf("Category: ") = -1 && searchConstraintString != "Exclude Variants"> +
     X ${searchConstraintString}
    + + + <#if showSubCats> +
    + ${uiLabelMap.ProductCategories} +
      + <#list subCategoryList as category> + <#assign subCategoryContentWrapper = category.categoryContentWrapper /> + <#assign categoryName = subCategoryContentWrapper.get("CATEGORY_NAME", "html")!?string /> +
    • ${categoryName!} (${category.count})
    • + +
    +
    + + <#if showColors> +
    + ${colorFeatureType.description} + +
    + + <#if showPriceRange> +
    + ${uiLabelMap.EcommercePriceRange} + +
    + +
    + diff --git a/template/catalog/MainNav.ftl b/template/catalog/MainNav.ftl new file mode 100644 index 0000000..3b6184e --- /dev/null +++ b/template/catalog/MainNav.ftl @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/template/catalog/ProductCategories.ftl b/template/catalog/ProductCategories.ftl new file mode 100644 index 0000000..6193aa1 --- /dev/null +++ b/template/catalog/ProductCategories.ftl @@ -0,0 +1,207 @@ +<#-- + 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. + --> + + + + + + + + +
    +
    +

    ${uiLabelMap.ProductCategories}

    +
    +
    +
    +
    diff --git a/template/catalog/ProductCategoryLink.ftl b/template/catalog/ProductCategoryLink.ftl new file mode 100644 index 0000000..095ca74 --- /dev/null +++ b/template/catalog/ProductCategoryLink.ftl @@ -0,0 +1,54 @@ +<#-- +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. +--> + +<#assign productCategoryLink = requestAttributes.productCategoryLink!/> +<#if productCategoryLink?has_content> +<#if productCategoryLink.detailSubScreen?has_content> + ${screens.render(productCategoryLink.detailSubScreen)} +<#else> + <#assign titleText = productCategoryLink.titleText!/> + <#assign imageUrl = productCategoryLink.imageUrl!/> + <#assign detailText = productCategoryLink.detailText!/> + + <#if productCategoryLink.linkTypeEnumId == "PCLT_SEARCH_PARAM"> + <#assign linkUrl = requestAttributes._REQUEST_HANDLER_.makeLink(request, response, "keywordsearch?" + productCategoryLink.linkInfo)/> + <#elseif productCategoryLink.linkTypeEnumId == "PCLT_ABS_URL"> + <#assign linkUrl = productCategoryLink.linkInfo!/> + <#elseif productCategoryLink.linkTypeEnumId == "PCLT_CAT_ID"> + <#assign linkUrl = requestAttributes._REQUEST_HANDLER_.makeLink(request, response, "category/~category_id=" + productCategoryLink.linkInfo) + "/~pcategory=" + productCategoryId/> + <#assign linkProductCategory = delegator.findOne("ProductCategory", Static["org.ofbiz.base.util.UtilMisc"].toMap("productCategoryId", productCategoryLink.linkInfo), true)/> + <#assign linkCategoryContentWrapper = Static["org.ofbiz.product.category.CategoryContentWrapper"].makeCategoryContentWrapper(linkProductCategory, request)/> + <#assign titleText = productCategoryLink.titleText?default(linkCategoryContentWrapper.get("CATEGORY_NAME", "html"))!/> + <#assign imageUrl = productCategoryLink.imageUrl?default(linkCategoryContentWrapper.get("CATEGORY_IMAGE_URL", "url"))!/> + <#assign detailText = productCategoryLink.detailText?default(linkCategoryContentWrapper.get("DESCRIPTION", "html"))!/> + + + + + diff --git a/template/catalog/ShowBestSellingCategory.ftl b/template/catalog/ShowBestSellingCategory.ftl new file mode 100644 index 0000000..1f63dd7 --- /dev/null +++ b/template/catalog/ShowBestSellingCategory.ftl @@ -0,0 +1,110 @@ +<#-- +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. +--> + +<#if productCategoryList?has_content> +
    +
    +

    Popular Categories

    +
    +
    +
    + + + <#list productCategoryList as childCategoryList> +
    + <#assign cateCount = 0/> + <#list childCategoryList as productCategory> + <#if (cateCount > 2)> +
    + <#assign cateCount = 0/> + + <#assign productCategoryId = productCategory.productCategoryId/> + <#assign categoryImageUrl = "/images/defaultImage.jpg"> + <#assign productCategoryMembers = delegator.findByAnd("ProductCategoryAndMember", Static["org.ofbiz.base.util.UtilMisc"].toMap("productCategoryId", productCategoryId), Static["org.ofbiz.base.util.UtilMisc"].toList("-quantity"), false)> + + <#if productCategory.categoryImageUrl?has_content> + <#assign categoryImageUrl = productCategory.categoryImageUrl/> + <#elseif productCategoryMembers?has_content> + <#assign productCategoryMember = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(productCategoryMembers)/> + <#assign product = delegator.findOne("Product", Static["org.ofbiz.base.util.UtilMisc"].toMap("productId", productCategoryMember.productId), false)/> + <#if product.smallImageUrl?has_content> + <#assign categoryImageUrl = product.smallImageUrl/> + + + +
    + <#assign cateCount = cateCount + 1/> + + + + +
    +
    + +
    + + + <#if productCategoryMembers??> + <#assign i = 0/> + <#list productCategoryMembers as productCategoryMember> + <#if (i > 2)> + <#if productCategoryMembers[i]?has_content> + + + + + <#break> + + <#if productCategoryMember?has_content> + <#assign product = delegator.findOne("Product", Static["org.ofbiz.base.util.UtilMisc"].toMap("productId", productCategoryMember.productId), false)> + + + + + <#assign i = i+1/> + + + +
    + + More... + +
    +
  • + "> + ${product.productName!product.productId} + +
  • +
    +
    +
    +
    +
    +
    +
    + diff --git a/template/catalog/SimpleSearch.ftl b/template/catalog/SimpleSearch.ftl new file mode 100644 index 0000000..f99cd78 --- /dev/null +++ b/template/catalog/SimpleSearch.ftl @@ -0,0 +1,12 @@ +
    +
    +
    + + + + +
    +
    +
    \ No newline at end of file diff --git a/template/catalog/advancedsearch.ftl b/template/catalog/advancedsearch.ftl new file mode 100644 index 0000000..b7282e7 --- /dev/null +++ b/template/catalog/advancedsearch.ftl @@ -0,0 +1,125 @@ +<#-- +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. +--> +<#assign searchOptionsHistoryList = Static["org.ofbiz.product.product.ProductSearchSession"].getSearchOptionsHistoryList(session)/> +<#assign currentCatalogId = Static["org.ofbiz.product.catalog.CatalogWorker"].getCurrentCatalogId(request)/> + + +
    +
    +

    ${uiLabelMap.ProductAdvancedSearchInCategory}

    + +
    +
    + +
    +
    + + + + <#if searchCategory?has_content> + + +

    ${(searchCategory.description)?if_exists}

    +
    + + + +
    + +
    + + + checked="checked" /> + checked="checked" /> +
    + <#list productFeatureTypeIdsOrdered as productFeatureTypeId> + <#assign findPftMap = Static["org.ofbiz.base.util.UtilMisc"].toMap("productFeatureTypeId", productFeatureTypeId)> + <#assign productFeatureType = delegator.findOne("ProductFeatureType", findPftMap, true)> + <#assign productFeatures = productFeaturesByTypeMap[productFeatureTypeId]> +
    + + +
    + +
    + + + + +
    + <#if searchConstraintStrings?has_content> +
    + + <#list searchConstraintStrings as searchConstraintString> +

    ${searchConstraintString}

    + +

    ${uiLabelMap.ProductSortedBy}: ${searchSortOrderString}

    +
    + + +
    +
    + +
    + +
    + <#if searchOptionsHistoryList?has_content> +

    ${uiLabelMap.OrderLastSearches}...

    +
    + ${uiLabelMap.OrderClearSearchHistory} +

    ${uiLabelMap.OrderClearSearchHistoryNote}

    +
    + <#list searchOptionsHistoryList as searchOptions> + <#-- searchOptions type is ProductSearchSession.ProductSearchOptions --> +
    +

    ${uiLabelMap.EcommerceSearchNumber}${searchOptions_index + 1}

    + ${uiLabelMap.CommonSearch} + ${uiLabelMap.CommonRefine} +
    + <#assign constraintStrings = searchOptions.searchGetConstraintStrings(false, delegator, locale)> + <#list constraintStrings as constraintString> +

    - ${constraintString}

    + + <#if searchOptions_has_next> + + + + +
    +
    +
    +
    diff --git a/template/catalog/ajaxbreadcrumbs.ftl b/template/catalog/ajaxbreadcrumbs.ftl new file mode 100644 index 0000000..8d3cc79 --- /dev/null +++ b/template/catalog/ajaxbreadcrumbs.ftl @@ -0,0 +1,76 @@ +<#-- +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. +--> + + +
    + diff --git a/template/catalog/breadcrumbs.ftl b/template/catalog/breadcrumbs.ftl new file mode 100644 index 0000000..b8e66a5 --- /dev/null +++ b/template/catalog/breadcrumbs.ftl @@ -0,0 +1,68 @@ +<#-- +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. +--> + diff --git a/template/catalog/categorydetail.ftl b/template/catalog/categorydetail.ftl new file mode 100644 index 0000000..2756db5 --- /dev/null +++ b/template/catalog/categorydetail.ftl @@ -0,0 +1,189 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + +--> + + +<#macro paginationControls> + <#assign viewIndexMax = Static["java.lang.Math"].ceil((listSize)?double / viewSize?double)> + <#if (viewIndexMax?int > 0)> +
    + + <#-- End Page Select Drop-Down --> + <#if (viewIndex?int > 0)> + ${uiLabelMap.CommonPrevious} | + + <#if ((listSize?int - viewSize?int) > 0)> + ${lowIndex} - ${highIndex} ${uiLabelMap.CommonOf} ${listSize} + + <#if highIndex?int < listSize?int> + | ${uiLabelMap.CommonNext} + +
    + + + +
    +
    + <#if productCategory??> + <#assign categoryName = categoryContentWrapper.get("CATEGORY_NAME", "html")!/> + <#assign categoryDescription = categoryContentWrapper.get("DESCRIPTION", "html")!/> + <#if categoryName??> +

    ${categoryName}

    + + <#if categoryDescription??> + ${categoryDescription} + + <#if hasQuantities??> +
    + + <#if requestParameters.product_id??> + <#if requestParameters.category_id??> + <#if requestParameters.VIEW_INDEX??> + <#if requestParameters.SEARCH_STRING??> + <#if requestParameters.SEARCH_CATEGORY_ID??> + ${uiLabelMap.ProductAddProductsUsingDefaultQuantities} +
    + + <#if searchInCategory?default("Y") == "Y"> +
    ${uiLabelMap.ProductSearchInCategory} + + <#assign longDescription = categoryContentWrapper.get("LONG_DESCRIPTION", "html")!/> + <#assign categoryImageUrl = categoryContentWrapper.get("CATEGORY_IMAGE_URL", "url")!/> + <#if categoryImageUrl?? || longDescription??> +
    + <#if categoryImageUrl?string?has_content> + <#assign height=100/> + + + <#if longDescription??> + ${longDescription} + +
    + + +
    +
    + <#if productCategoryLinkScreen?? && productCategoryLinks??> + + + <#if productCategoryMembers??> + <#-- Pagination --> + <#if paginateEcommerceStyle??> + <@paginationControls/> + <#else> + <#include "component://common/webcommon/includes/htmlTemplate.ftl"/> + <#assign commonUrl = "category?category_id="+ (parameters.category_id!) + "&"/> + <#--assign viewIndex = viewIndex - 1/--> + <#assign viewIndexFirst = 0/> + <#assign viewIndexPrevious = viewIndex - 1/> + <#assign viewIndexNext = viewIndex + 1/> + <#assign viewIndexLast = Static["org.ofbiz.base.util.UtilMisc"].getViewLastIndex(listSize, viewSize) /> + <#assign messageMap = Static["org.ofbiz.base.util.UtilMisc"].toMap("lowCount", lowIndex, "highCount", highIndex, "total", listSize)/> + <#assign commonDisplaying = Static["org.ofbiz.base.util.UtilProperties"].getMessage("CommonUiLabels", "CommonDisplaying", messageMap, locale)/> + <@nextPrev commonUrl=commonUrl ajaxEnabled=false javaScriptEnabled=false paginateStyle="nav-pager" paginateFirstStyle="nav-first" viewIndex=viewIndex highIndex=highIndex listSize=listSize viewSize=viewSize ajaxFirstUrl="" firstUrl="" paginateFirstLabel="" paginatePreviousStyle="nav-previous" ajaxPreviousUrl="" previousUrl="" paginatePreviousLabel="" pageLabel="" ajaxSelectUrl="" selectUrl="" ajaxSelectSizeUrl="" selectSizeUrl="" commonDisplaying=commonDisplaying paginateNextStyle="nav-next" ajaxNextUrl="" nextUrl="" paginateNextLabel="" paginateLastStyle="nav-last" ajaxLastUrl="" lastUrl="" paginateLastLabel="" paginateViewSizeLabel="" /> + + <#assign numCol = numCol?default(1)> + <#assign numCol = numCol?number> + <#assign tabCol = 1> +
    + style="position: relative; <#if height!>margin-top: ${height}px;" + + class="productsummary-container<#if (numCol?int > 1)> matrix"> + <#-- + <#if (numCol?int > 1)> +
    + + --> + <#list productCategoryMembers as productCategoryMember> + <#if (numCol?int == 1)> + ${setRequestAttribute("optProductId", productCategoryMember.productId)} + ${setRequestAttribute("productCategoryMember", productCategoryMember)} + ${setRequestAttribute("listIndex", productCategoryMember_index)} + ${screens.render(productsummaryScreen)} + <#else> + <#if (tabCol?int = 1)>
    + <#if (numCol?int == 1)> +
    + + <#if (numCol?int == 2)> +
    + + <#if (numCol?int == 3)> +
    + + <#if (numCol?int == 4)> +
    + + ${setRequestAttribute("optProductId", productCategoryMember.productId)} + ${setRequestAttribute("productCategoryMember", productCategoryMember)} + ${setRequestAttribute("listIndex", productCategoryMember_index)} + ${screens.render(productsummaryScreen)} +
    + <#if (tabCol?int = numCol)>
    + <#assign tabCol = tabCol+1> + <#if (tabCol?int > numCol)><#assign tabCol = 1> + + + <#-- + <#if (numCol?int > 1)> +
    + + --> + <#if paginateEcommerceStyle??> + <@paginationControls/> + + <#else> +
    +
    ${uiLabelMap.ProductNoProductsInThisCategory}
    + +
    +
    +
    \ No newline at end of file diff --git a/template/catalog/choosecatalog.ftl b/template/catalog/choosecatalog.ftl new file mode 100644 index 0000000..6a14b7e --- /dev/null +++ b/template/catalog/choosecatalog.ftl @@ -0,0 +1,45 @@ +<#-- +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. +--> +<#assign catalogCol = Static["org.ofbiz.product.catalog.CatalogWorker"].getCatalogIdsAvailable(request)!> +<#assign currentCatalogId = Static["org.ofbiz.product.catalog.CatalogWorker"].getCurrentCatalogId(request)!> +<#assign currentCatalogName = Static["org.ofbiz.product.catalog.CatalogWorker"].getCatalogName(request, currentCatalogId)!> + +<#-- Only show if there is more than 1 (one) catalog, no sense selecting when there is only one option... --> +<#if (catalogCol?size > 1)> +
    +
    +
      +
    • ${uiLabelMap.ProductChooseCatalog}
    • +
    +
    +
    +
    +
    + +
    +
    +
    + diff --git a/template/catalog/compareproductslist.ftl b/template/catalog/compareproductslist.ftl new file mode 100644 index 0000000..de1c509 --- /dev/null +++ b/template/catalog/compareproductslist.ftl @@ -0,0 +1,53 @@ +<#-- +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. +--> +
    +
    +

    ${uiLabelMap.ProductCompareProducts}

    +
    +
    + <#assign productCompareList = Static["org.ofbiz.product.product.ProductEvents"].getProductCompareList(request)/> + <#if productCompareList?has_content> + + <#list productCompareList as product> + + + + + +
    + ${Static["org.ofbiz.product.product.ProductContentWrapper"].getProductContentAsText(product, "PRODUCT_NAME", request, "html")} + +
    + +
    + ${uiLabelMap.CommonRemove} +
    + + +<#else/> +
    + ${uiLabelMap.ProductNoProductsToCompare} +
    + +
    +
    \ No newline at end of file diff --git a/template/catalog/configproductdetail.ftl b/template/catalog/configproductdetail.ftl new file mode 100644 index 0000000..e95c04f --- /dev/null +++ b/template/catalog/configproductdetail.ftl @@ -0,0 +1,734 @@ +<#-- +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. +--> +<#-- variable setup --> +<#assign productContentWrapper = productContentWrapper!> +<#assign price = priceMap!> +<#-- end variable setup --> + +<#-- virtual product javascript --> +${virtualJavaScript!} + + + + +
    + + + + <#-- Category next/previous --> + <#if category??> + + + + + + + + <#-- Product image/name/price --> + + + + + + + + <#-- Long description of product --> + + + + + + + <#-- Any attributes/etc may go here --> + <#-- Product Configurator --> + + + + + + <#-- Product Reviews --> + + + + + <#if productReviews?has_content> + <#list productReviews as productReview> + <#assign postedUserLogin = productReview.getRelatedOne("UserLogin", false)> + <#assign postedPerson = postedUserLogin.getRelatedOne("Person", false)!> + + + + + + + + <#else> + + + + + + +
    + <#if previousProductId??> + ${uiLabelMap.CommonPrevious} |  + + ${(category.categoryName)?default(category.description)!} + <#if nextProductId??> +  | ${uiLabelMap.CommonNext} + +
    + <#assign productLargeImageUrl = productContentWrapper.get("LARGE_IMAGE_URL", "url")!> + <#-- remove the next two lines to always display the virtual image first (virtual images must exist) --> + <#if firstLargeImage?has_content> + <#assign productLargeImageUrl = firstLargeImage> + + <#if productLargeImageUrl?string?has_content> + + + +

    ${productContentWrapper.get("PRODUCT_NAME", "html")!}

    +
    ${productContentWrapper.get("DESCRIPTION", "html")!}
    +
    ${product.productId!}
    + <#-- example of showing a certain type of feature with the product --> + <#if sizeProductFeatureAndAppls?has_content> +
    + <#if (sizeProductFeatureAndAppls?size == 1)> + <#-- TODO : i18n --> + Size: + <#else> + Sizes Available: + + <#list sizeProductFeatureAndAppls as sizeProductFeatureAndAppl> + ${sizeProductFeatureAndAppl.description?default(sizeProductFeatureAndAppl.abbrev?default(sizeProductFeatureAndAppl.productFeatureId))}<#if sizeProductFeatureAndAppl_has_next>, + +
    + + + <#-- for prices: + - if totalPrice is present, use it (totalPrice is the price calculated from the parts) + - if price < competitivePrice, show competitive or "Compare At" price + - if price < listPrice, show list price + - if price < defaultPrice and defaultPrice < listPrice, show default + - if isSale show price with salePrice style and print "On Sale!" + --> + <#if totalPrice??> +
    ${uiLabelMap.ProductAggregatedPrice}: <@ofbizCurrency amount=totalPrice isoCode=totalPrice.currencyUsed/>
    + <#else> + <#if price.competitivePrice?? && price.price?? && price.price < price.competitivePrice> +
    ${uiLabelMap.ProductCompareAtPrice}: <@ofbizCurrency amount=price.competitivePrice isoCode=price.currencyUsed/>
    + + <#if price.listPrice?? && price.price?? && price.price < price.listPrice> +
    ${uiLabelMap.ProductListPrice}: <@ofbizCurrency amount=price.listPrice isoCode=price.currencyUsed/>
    + + <#if price.listPrice?? && price.defaultPrice?? && price.price?? && price.price < price.defaultPrice && price.defaultPrice < price.listPrice> +
    ${uiLabelMap.ProductRegularPrice}: <@ofbizCurrency amount=price.defaultPrice isoCode=price.currencyUsed/>
    + +
    + + <#if price.isSale?? && price.isSale> + ${uiLabelMap.OrderOnSale}! + <#assign priceStyle = "salePrice"> + <#else> + <#assign priceStyle = "regularPrice"> + + ${uiLabelMap.OrderYourPrice}: <#if "Y" = product.isVirtual!> from <@ofbizCurrency amount=price.price isoCode=price.currencyUsed/> + +
    + <#if price.listPrice?? && price.price?? && price.price < price.listPrice> + <#assign priceSaved = price.listPrice - price.price> + <#assign percentSaved = (priceSaved / price.listPrice) * 100> +
    ${uiLabelMap.OrderSave}: <@ofbizCurrency amount=priceSaved isoCode=price.currencyUsed/> (${percentSaved?int}%)
    + + + + <#-- Included quantities/pieces --> + <#if product.quantityIncluded?? && product.quantityIncluded != 0> +
    ${uiLabelMap.OrderIncludes}: + ${product.quantityIncluded!} + ${product.quantityUomId!} +
    + + <#if product.piecesIncluded?? && product.piecesIncluded?long != 0> +
    ${uiLabelMap.OrderPieces}: + ${product.piecesIncluded} +
    + + <#if daysToShip??> +
    ${uiLabelMap.ProductUsuallyShipsIn} ${daysToShip} ${uiLabelMap.CommonDays}
    + + + <#-- show tell a friend details only in ecommerce application --> +
     
    + + + <#if disFeatureList?? && 0 < disFeatureList.size()> +

     

    + <#list disFeatureList as currentFeature> +
    + ${currentFeature.productFeatureTypeId}: ${currentFeature.description} +
    + +
     
    + + +
    + <#assign inStock = true> + <#-- Variant Selection --> + <#if product.isVirtual?? && product.isVirtual?upper_case == "Y"> + <#if variantTree?? && 0 < variantTree.size()> + <#list featureSet as currentType> +
    + +
    + + + + <#else> + + +
    ${uiLabelMap.ProductItemOutOfStock}.
    + <#assign inStock = false> + + <#else> + + + <#if productNotAvailable??> + <#assign isStoreInventoryRequired = Static["org.ofbiz.product.store.ProductStoreWorker"].isStoreInventoryRequired(request, product)> + <#if isStoreInventoryRequired> +
    ${uiLabelMap.ProductItemOutOfStock}.
    + <#assign inStock = false> + <#else> +
    ${product.inventoryMessage!}
    + + + + +
    + + <#-- check to see if introductionDate hasn't passed yet --> + <#if product.introductionDate?? && nowTimestamp.before(product.introductionDate)> +

     

    +
    ${uiLabelMap.ProductProductNotYetMadeAvailable}.
    + <#-- check to see if salesDiscontinuationDate has passed --> + <#elseif product.salesDiscontinuationDate?? && nowTimestamp.after(product.salesDiscontinuationDate)> +
    ${uiLabelMap.ProductProductNoLongerAvailable}.
    + <#-- check to see if the product requires inventory check and has inventory --> + <#else> + <#if inStock> + <#if product.requireAmount?default("N") == "Y"> + <#assign hiddenStyle = "visible"> + <#else> + <#assign hiddenStyle = "hidden"> + +
    + Amount:  + +
    + <#if !configwrapper.isCompleted()> +
    [${uiLabelMap.EcommerceProductNotConfigured}]  +
    + <#else> + ${uiLabelMap.OrderAddToCart}  + + <#if minimumQuantity?? && minimumQuantity > 0> + Minimum order quantity is ${minimumQuantity}. + + + + <#if requestParameters.category_id??> + + + + +
    + <#if sessionAttributes.userLogin?has_content && sessionAttributes.userLogin.userLoginId != "anonymous"> + +
    + + + + +    + + [${uiLabelMap.OrderAddToShoppingList}] +
    + <#else>
    + ${uiLabelMap.OrderYouMust} ${uiLabelMap.CommonBeLogged} + ${uiLabelMap.OrderToAddSelectedItemsToShoppingList}.  + +
    + <#-- Prefill first select box (virtual products only) --> + <#if variantTree?? && 0 < variantTree.size()> + + + + <#-- Swatches (virtual products only) --> + <#if variantSample?? && 0 < variantSample.size()> + <#assign imageKeys = variantSample.keySet()> + <#assign imageMap = variantSample> +

     

    + + + <#assign maxIndex = 7> + <#assign indexer = 0> + <#list imageKeys as key> + <#assign swatchProduct = imageMap.get(key)> + <#if swatchProduct?has_content && indexer < maxIndex> + <#assign imageUrl = Static["org.ofbiz.product.product.ProductContentWrapper"].getProductContentAsText(swatchProduct, "SMALL_IMAGE_URL", request, "url")!> + <#if !imageUrl?string?has_content> + <#assign imageUrl = productContentWrapper.get("SMALL_IMAGE_URL", "url")!> + + <#if !imageUrl?string?has_content> + <#assign imageUrl = "/images/defaultImage.jpg"> + + + + <#assign indexer = indexer + 1> + + <#if (indexer > maxIndex)> +
    ${uiLabelMap.OrderMoreOptionsAvailable}.
    + + +
    + +
    + ${key} +
    + +
    +
    ${productContentWrapper.get("LONG_DESCRIPTION", "html")!}
    +

    +
    + + + + + + + + + + + <#assign counter = 0> + <#assign questions = configwrapper.questions> + <#list questions as question> + + + + + + + + <#assign counter = counter + 1> + +
    + +
    +
    ${question.question}
    + <#if question.isFirst()> + +
    ${StringUtil.wrapString(question.description!)}
    + <#assign instructions = question.content.get("INSTRUCTIONS", "html")!> + <#if instructions?has_content> + Instructions + + <#assign image = question.content.get("IMAGE_URL", "url")!> + <#if image?string?has_content> + + + <#else> + + +
    + <#if question.isStandard()> + <#-- Standard item: all the options are always included --> + <#assign options = question.options> + <#list options as option> +
    ${option.description} <#if !option.isAvailable()> (*)
    + + <#else> + <#if question.isSingleChoice()> + <#-- Single choice question --> + <#assign options = question.options> + <#assign selectedOption = question.getSelected()!> + <#assign selectedPrice = 0.0> + <#if selectedOption?has_content> + <#assign selectedPrice = selectedOption.getPrice()> + + <#-- The single choice input can be implemented with radio buttons or a select field --> + <#if renderSingleChoiceWithRadioButtons?? && "Y" == renderSingleChoiceWithRadioButtons> + <#-- This is the radio button implementation --> + <#if !question.isMandatory()> +
    No option
    + + <#assign optionCounter = 0> + <#list options as option> + <#assign componentCounter = 0> + <#if showOffsetPrice?? && "Y" == showOffsetPrice> + <#assign shownPrice = option.price - selectedPrice> + <#else> + <#assign shownPrice = option.price> + + <#-- Render virtual compoennts --> + <#if option.hasVirtualComponent()> +
    + + ${option.description} <#if !option.isAvailable()> (*) + <#assign components = option.getComponents()> + <#list components as component> + <#if (option.isVirtualComponent(component))> + ${setRequestAttribute("inlineProductId", component.productId)} + ${setRequestAttribute("inlineCounter", counter+ "_" +optionCounter + "_"+componentCounter)} + ${setRequestAttribute("addJavaScript", componentCounter)} + ${screens.render(inlineProductDetailScreen)} + <#assign componentCounter = componentCounter + 1> + + +
    + <#else> +
    + checked="checked" /> + ${option.description}  + <#if (shownPrice > 0)>+<@ofbizCurrency amount=shownPrice isoCode=price.currencyUsed/>  + <#if (shownPrice < 0)>-<@ofbizCurrency amount=(-1*shownPrice) isoCode=price.currencyUsed/>  + <#if !option.isAvailable()>(*) +
    + + <#assign optionCounter = optionCounter + 1> + + <#else> + <#-- And this is the select box implementation --> + + + <#else> + <#-- Multi choice question --> + <#assign options = question.options> + <#assign optionCounter = 0> + <#list options as option> + <#assign componentCounter = 0> + <#-- Render virtual compoennts --> + <#if option.hasVirtualComponent()> +
    + + ${option.description} <#if !option.isAvailable()> (*) + <#assign components = option.getComponents()> + <#list components as component> + <#if (option.isVirtualComponent(component))> + ${setRequestAttribute("inlineProductId", component.productId)} + ${setRequestAttribute("inlineCounter", counter+ "_" +optionCounter + "_"+componentCounter)} + ${setRequestAttribute("addJavaScript", componentCounter)} + ${screens.render(inlineProductDetailScreen)} + <#assign componentCounter = componentCounter + 1> + + +
    + <#else> +
    + checked="checked" /> + ${option.description} +<@ofbizCurrency amount=option.price isoCode=price.currencyUsed/><#if !option.isAvailable()> (*) +
    + + <#assign optionCounter = optionCounter + 1> + + + +
    +
    +
    +
    ${uiLabelMap.OrderCustomerReviews}:
    + <#if averageRating?? && (averageRating > 0) && numRatings?? && (numRatings > 1)> +
    ${uiLabelMap.OrderAverageRating}: ${averageRating} <#if numRatings??>(${uiLabelMap.CommonFrom} ${numRatings} ${uiLabelMap.OrderRatings})
    + +

    + + + + + + + + + + + + + +
    +
    ${uiLabelMap.CommonBy}: <#if productReview.postedAnonymous?default("N") == "Y">${uiLabelMap.OrderAnonymous}<#else>${postedPerson.firstName} ${postedPerson.lastName}
    +
    +
    ${uiLabelMap.CommonOn}: ${productReview.postedDateTime!}
    +
    +
    ${uiLabelMap.OrderRanking}: ${productReview.productRating!?string}
    +
    +
     
    +
    +
    ${productReview.productReview!}
    +
    +
    + ${uiLabelMap.ProductReviewThisProduct}! +
    +
    ${uiLabelMap.ProductProductNotReviewedYet}.
    +
    + ${uiLabelMap.ProductBeTheFirstToReviewThisProduct} +
    + + +<#-- Upgrades/Up-Sell/Cross-Sell --> + <#macro associated assocProducts beforeName showName afterName formNamePrefix targetRequestName> + <#assign targetRequest = "product"> + <#if targetRequestName?has_content> + <#assign targetRequest = targetRequestName> + + <#if assocProducts?has_content> +
     

    ${beforeName!}<#if showName == "Y">${productContentWrapper.get("PRODUCT_NAME", "html")!}${afterName!}

    +
    + + ${productAssoc.productIdTo!} + + - ${productAssoc.reason!} +
    +
    + ${screens.render(productsummaryScreen)} +
    + <#-- obsolete --> + <@associated assocProducts=obsoleteProducts beforeName="" showName="Y" afterName=" is made obsolete by these products:" formNamePrefix="obs" targetRequestName=""/> + <#-- cross sell --> + <@associated assocProducts=crossSellProducts beforeName="" showName="N" afterName="You might be interested in these as well:" formNamePrefix="cssl" targetRequestName="crosssell"/> + <#-- up sell --> + <@associated assocProducts=upSellProducts beforeName="Try these instead of " showName="Y" afterName=":" formNamePrefix="upsl" targetRequestName="upsell"/> + <#-- obsolescence --> + <@associated assocProducts=obsolenscenseProducts beforeName="" showName="Y" afterName=" makes these products obsolete:" formNamePrefix="obce" targetRequestName=""/> +
    + +<#-- special cross/up-sell area using commonFeatureResultIds (from common feature product search) --> +<#if commonFeatureResultIds?has_content> +

    Similar Products That Might Interest You...

    + + + <#list commonFeatureResultIds as commonFeatureResultId> +
    + ${setRequestAttribute("optProductId", commonFeatureResultId)} + ${setRequestAttribute("listIndex", commonFeatureResultId_index)} + ${setRequestAttribute("formNamePrefix", "cfeatcssl")} + <#-- ${setRequestAttribute("targetRequestName", targetRequestName)} --> + ${screens.render(productsummaryScreen)} +
    + <#if commonFeatureResultId_has_next> +
    + + + + diff --git a/template/catalog/detailImage.ftl b/template/catalog/detailImage.ftl new file mode 100644 index 0000000..d0c5776 --- /dev/null +++ b/template/catalog/detailImage.ftl @@ -0,0 +1,32 @@ +<#-- +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. +--> + + + <#if requestParameters.detail?has_content> + <#--assign detailImage = Static["org.ofbiz.base.util.Base64"].base64Decode(requestParameters.detail)--> + + <#else> + + + + diff --git a/template/catalog/keywordsearch.ftl b/template/catalog/keywordsearch.ftl new file mode 100644 index 0000000..c24de3e --- /dev/null +++ b/template/catalog/keywordsearch.ftl @@ -0,0 +1,95 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> +
    +
    +

    ${uiLabelMap.ProductProductSearch}

    +
    +
    + ${uiLabelMap.ProductYouSearchedFor}: +
      +<#list searchConstraintStrings as searchConstraintString> +
    • X ${searchConstraintString}
    • + +
    +
    ${uiLabelMap.CommonSortedBy}: ${searchSortOrderString}
    +
    + + +<#if !productIds?has_content> +

     ${uiLabelMap.ProductNoResultsFound}.

    + + +<#if productIds?has_content> +
    + <#-- Start Page Select Drop-Down --> + <#assign viewIndexMax = Static["java.lang.Math"].ceil((listSize - 1)?double / viewSize?double)> + + <#-- End Page Select Drop-Down --> + + <#if (viewIndex?int > 0)> + ${uiLabelMap.CommonPrevious} | + + <#if (listSize?int > 0)> + ${lowIndex+1} - ${highIndex} ${uiLabelMap.CommonOf} ${listSize} + + <#if highIndex?int < listSize?int> + | ${uiLabelMap.CommonNext} + + +
    + + +<#if productIds?has_content> +
    + <#list productIds as productId> <#-- note that there is no boundary range because that is being done before the list is put in the content --> + ${setRequestAttribute("optProductId", productId)} + ${setRequestAttribute("listIndex", productId_index)} + ${screens.render(productsummaryScreen)} + +
    + + +<#if productIds?has_content> +
    + <#-- Start Page Select Drop-Down --> + <#assign viewIndexMax = Static["java.lang.Math"].ceil((listSize - 1)?double / viewSize?double)> + + <#-- End Page Select Drop-Down --> + + <#if (viewIndex?int > 0)> + ${uiLabelMap.CommonPrevious} | + + <#if (listSize?int > 0)> + ${lowIndex+1} - ${highIndex} ${uiLabelMap.CommonOf} ${listSize} + + <#if highIndex?int < listSize?int> + | ${uiLabelMap.CommonNext} + + +
    + +
    diff --git a/template/catalog/keywordsearchbox.ftl b/template/catalog/keywordsearchbox.ftl new file mode 100644 index 0000000..8544a34 --- /dev/null +++ b/template/catalog/keywordsearchbox.ftl @@ -0,0 +1,74 @@ +<#-- +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. +--> + +
    +
    +

    ${uiLabelMap.ProductSearchCatalog}

    +
    +
    +
    +
    + + +
    + +
    + <#if 0 < otherSearchProdCatalogCategories?size> +
    + +
    + <#else> + + +
    + checked="checked" /> + checked="checked" /> + +
    +
    +
    +
    +
    + <#if 0 < otherSearchProdCatalogCategories?size> + + + <#else> + + + +
    +
    +
    +
    \ No newline at end of file diff --git a/template/catalog/lastviewedproducts.ftl b/template/catalog/lastviewedproducts.ftl new file mode 100644 index 0000000..4285a58 --- /dev/null +++ b/template/catalog/lastviewedproducts.ftl @@ -0,0 +1,51 @@ +<#-- +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. +--> + + + + +
    +

    + ${uiLabelMap.ProductProductsLastViewed} +

    +
    + +<#if sessionAttributes.lastViewedProducts?? && sessionAttributes.lastViewedProducts?has_content> + + + <#list sessionAttributes.lastViewedProducts as productId> + + + + +
    + ${setRequestAttribute("optProductId", productId)} + ${setRequestAttribute("listIndex", productId_index)} + ${screens.render("component://${activeApp}/widget/CatalogScreens.xml#productsummary")} +
    + +<#else> + + + + +
    +
    ${uiLabelMap.ProductNotViewedAnyProducts}.
    +
    + diff --git a/template/catalog/miniassocprods.ftl b/template/catalog/miniassocprods.ftl new file mode 100644 index 0000000..f9f0af4 --- /dev/null +++ b/template/catalog/miniassocprods.ftl @@ -0,0 +1,38 @@ +<#-- +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. +--> + +<#assign associatedProducts = Static["org.ofbiz.order.shoppingcart.product.ProductDisplayWorker"].getRandomCartProductAssoc(request, true)!> +<#if associatedProducts?has_content> +
    +
    +

    ${uiLabelMap.EcommerceYouMightLike}...

    +
    +
    + <#-- random complementary products --> +
    + <#list associatedProducts as miniProduct> + ${setRequestAttribute("miniProdQuantity", 1)} + ${setRequestAttribute("miniProdFormName", "theminiassocprod" + miniProduct_index + "form")} + ${setRequestAttribute("optProductId", miniProduct.productId)} + ${screens.render("component://${activeApp}/widget/CatalogScreens.xml#miniproductsummary")} + +
    +
    +
    + diff --git a/template/catalog/minilastproductsearches.ftl b/template/catalog/minilastproductsearches.ftl new file mode 100644 index 0000000..7b0091d --- /dev/null +++ b/template/catalog/minilastproductsearches.ftl @@ -0,0 +1,51 @@ +<#-- +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. +--> + +<#assign maxToShow = 4/> +<#assign searchOptionsHistoryList = Static["org.ofbiz.product.product.ProductSearchSession"].getSearchOptionsHistoryList(session)!/> +<#if searchOptionsHistoryList?has_content> + <#if (searchOptionsHistoryList?size > maxToShow)><#assign limit=maxToShow/><#else><#assign limit=(searchOptionsHistoryList?size-1)/> +
    + +

    ${uiLabelMap.OrderLastSearches}...

    +
      + <#list searchOptionsHistoryList[0..limit] as searchOptions> + <#-- searchOptions type is ProductSearchSession.ProductSearchOptions --> +
    • + ${uiLabelMap.EcommerceSearchNumber} ${searchOptions_index + 1} + +
    • + +
    +
    + diff --git a/template/catalog/minilastviewedcategories.ftl b/template/catalog/minilastviewedcategories.ftl new file mode 100644 index 0000000..e3b8e49 --- /dev/null +++ b/template/catalog/minilastviewedcategories.ftl @@ -0,0 +1,48 @@ +<#-- +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. +--> + +<#assign maxToShow = 8/> +<#assign lastViewedCategories = sessionAttributes.lastViewedCategories!/> +<#if lastViewedCategories?has_content> + <#if (lastViewedCategories?size > maxToShow)><#assign limit=maxToShow/><#else><#assign limit=(lastViewedCategories?size-1)/> +
    +
    +

    ${uiLabelMap.EcommerceLastCategories}

    +
    +
    + + clearLastViewed">[${uiLabelMap.CommonClear}] +
    +
    + diff --git a/template/catalog/minilastviewedproducts.ftl b/template/catalog/minilastviewedproducts.ftl new file mode 100644 index 0000000..dbe1404 --- /dev/null +++ b/template/catalog/minilastviewedproducts.ftl @@ -0,0 +1,48 @@ +<#-- +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. +--> + +<#assign maxToShow = 4/> +<#assign lastViewedProducts = sessionAttributes.lastViewedProducts!/> +<#if lastViewedProducts?has_content> + <#if (lastViewedProducts?size > maxToShow)><#assign limit=maxToShow/><#else><#assign limit=(lastViewedProducts?size-1)/> +
    +
    + +
    +
    +
    +
      + <#list lastViewedProducts[0..limit] as productId> +
    • + ${setRequestAttribute("miniProdQuantity", "1")} + ${setRequestAttribute("optProductId", productId)} + ${setRequestAttribute("miniProdFormName", "lastviewed" + productId_index + "form")} + ${screens.render("component://${activeApp}/widget/CatalogScreens.xml#miniproductsummary")} +
    • + +
    +
    +
    + diff --git a/template/catalog/miniproductsummary.ftl b/template/catalog/miniproductsummary.ftl new file mode 100644 index 0000000..7138bbb --- /dev/null +++ b/template/catalog/miniproductsummary.ftl @@ -0,0 +1,58 @@ +<#-- +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. +--> +<#if miniProduct??> + ${miniProductContentWrapper.get("PRODUCT_NAME", "html")?default("No Name Available")} + + ${miniProduct.productId} + <#if (priceResult.price?default(0) > 0 && miniProduct.requireAmount?default("N") == "N")> + <#if "Y" = miniProduct.isVirtual!> ${uiLabelMap.CommonFrom} + <#if totalPrice??> + ${uiLabelMap.ProductAggregatedPrice}: <@ofbizCurrency amount=totalPrice isoCode=priceResult.currencyUsed/> + <#else> + + <@ofbizCurrency amount=priceResult.price isoCode=priceResult.currencyUsed/> + + + <#if (miniProduct.introductionDate??) && (nowTimeLong < miniProduct.introductionDate.getTime())> + <#-- check to see if introductionDate hasn't passed yet --> + ${uiLabelMap.ProductNotYetAvailable} + <#elseif (miniProduct.salesDiscontinuationDate??) && (nowTimeLong > miniProduct.salesDiscontinuationDate.getTime())> + <#-- check to see if salesDiscontinuationDate has passed --> + ${uiLabelMap.ProductNoLongerAvailable} + <#elseif miniProduct.isVirtual?default("N") == "Y"> + ${uiLabelMap.OrderChooseVariations}... + <#elseif miniProduct.requireAmount?default("N") == "Y"> + ${uiLabelMap.OrderChooseAmount}... + <#else> +
    +
    + + + <#if requestParameters.orderId?has_content> + <#if requestParameters.product_id?has_content> + <#if requestParameters.category_id?has_content> + <#if requestParameters.VIEW_INDEX?has_content> + <#if requestParameters.VIEW_SIZE?has_content> + + ${uiLabelMap.CommonAdd} ${miniProdQuantity} ${uiLabelMap.OrderToCart} +
    +
    + + + diff --git a/template/catalog/minireorderprods.ftl b/template/catalog/minireorderprods.ftl new file mode 100644 index 0000000..db48c13 --- /dev/null +++ b/template/catalog/minireorderprods.ftl @@ -0,0 +1,37 @@ +<#-- +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. +--> +<#if reorderProducts?has_content> +
    +
    +

    ${uiLabelMap.ProductQuickReorder}

    +
    +
    + <#list reorderProducts as miniProduct> +
    + ${setRequestAttribute("miniProdQuantity", reorderQuantities.get(miniProduct.productId))} + ${setRequestAttribute("miniProdFormName", "theminireorderprod" + miniProduct_index + "form")} + ${setRequestAttribute("optProductId", miniProduct.productId)} + ${screens.render("component://${activeApp}/widget/CatalogScreens.xml#miniproductsummary")} +
    + <#if miniProduct_has_next> + + +
    +
    + diff --git a/template/catalog/populartags.ftl b/template/catalog/populartags.ftl new file mode 100644 index 0000000..2e447e2 --- /dev/null +++ b/template/catalog/populartags.ftl @@ -0,0 +1,29 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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 tagCloudList?has_content> +
    +
    +

    ${uiLabelMap.EcommerceTags}

    +
    +
    + <#list tagCloudList as tagCloud> + ${tagCloud.tag} + +
    +
    + diff --git a/template/catalog/productdetail.ftl b/template/catalog/productdetail.ftl new file mode 100644 index 0000000..9739a1a --- /dev/null +++ b/template/catalog/productdetail.ftl @@ -0,0 +1,923 @@ +<#-- +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. +--> +<#-- variable setup --> +<#assign price = priceMap! /> +<#assign productImageList = productImageList! /> +<#-- end variable setup --> + +<#-- virtual product javascript --> +${virtualJavaScript!} +${virtualVariantJavaScript!} + + +<#macro showUnavailableVarients> + <#if unavailableVariants??> +
      + <#list unavailableVariants as prod> + <#assign features = prod.getRelated("ProductFeatureAppl", null, null, false)/> +
    • + <#list features as feature> + ${feature.getRelatedOne("ProductFeature", false).description}<#if feature_has_next>, + + ${uiLabelMap.ProductItemOutOfStock} +
    • + +
    + + + +
    + <#assign productAdditionalImage1 = productContentWrapper.get("ADDITIONAL_IMAGE_1", "url")! /> + <#assign productAdditionalImage2 = productContentWrapper.get("ADDITIONAL_IMAGE_2", "url")! /> + <#assign productAdditionalImage3 = productContentWrapper.get("ADDITIONAL_IMAGE_3", "url")! /> + <#assign productAdditionalImage4 = productContentWrapper.get("ADDITIONAL_IMAGE_4", "url")! /> + + <#-- Category next/previous --> + <#if category??> +
    + <#if previousProductId??> + ${uiLabelMap.CommonPrevious} |  + + ${(category.categoryName)?default(category.description)!} + <#if nextProductId??> +  | ${uiLabelMap.CommonNext} + +
    + +
    +
    +
    +
    +
    + <#if productImageList?has_content> + <#-- Product image/name/price --> +
    + <#assign productLargeImageUrl = productContentWrapper.get("LARGE_IMAGE_URL", "url")! /> + <#-- remove the next two lines to always display the virtual image first (virtual images must exist) --> + <#if firstLargeImage?has_content> + <#assign productLargeImageUrl = firstLargeImage /> + + <#if productLargeImageUrl?string?has_content> + + + + <#if !productLargeImageUrl?string?has_content> + + +
    + <#-- Show Image Approved --> +
    + + <#if productImageList?has_content> + <#list productImageList as productImage> +
    + +
    + + +
    + <#else> + <#-- Product image/name/price --> +
    + <#assign productLargeImageUrl = productContentWrapper.get("LARGE_IMAGE_URL", "url")! /> + <#-- remove the next two lines to always display the virtual image first (virtual images must exist) --> + <#if firstLargeImage?has_content> + <#assign productLargeImageUrl = firstLargeImage /> + + <#if productLargeImageUrl?string?has_content> + + + + <#if !productLargeImageUrl?string?has_content> + + +
    +
    + <#if productAdditionalImage1?string?has_content> +
    + +
    + + <#if productAdditionalImage2?string?has_content> +
    + +
    + + <#if productAdditionalImage3?string?has_content> +
    + +
    + + <#if productAdditionalImage4?string?has_content> +
    + +
    + +
    + + +
    +

    ${productContentWrapper.get("PRODUCT_NAME", "html")!}

    +
    ${productContentWrapper.get("DESCRIPTION", "html")!}
    +
    ${product.productId!}
    + <#-- example of showing a certain type of feature with the product --> + <#if sizeProductFeatureAndAppls?has_content> +
    + <#if (sizeProductFeatureAndAppls?size == 1)> + ${uiLabelMap.OrderSizeAvailableSingle}: + <#else> + ${uiLabelMap.OrderSizeAvailableMultiple}: + + <#list sizeProductFeatureAndAppls as sizeProductFeatureAndAppl> + ${sizeProductFeatureAndAppl.description?default(sizeProductFeatureAndAppl.abbrev?default(sizeProductFeatureAndAppl.productFeatureId))}<#if sizeProductFeatureAndAppl_has_next>, + +
    + + + <#-- for prices: + - if price < competitivePrice, show competitive or "Compare At" price + - if price < listPrice, show list price + - if price < defaultPrice and defaultPrice < listPrice, show default + - if isSale show price with salePrice style and print "On Sale!" + --> + <#if price.competitivePrice?? && price.price?? && price.price < price.competitivePrice> +
    ${uiLabelMap.ProductCompareAtPrice}: <@ofbizCurrency amount=price.competitivePrice isoCode=price.currencyUsed />
    + + <#if price.listPrice?? && price.price?? && price.price < price.listPrice> +
    ${uiLabelMap.ProductListPrice}: <@ofbizCurrency amount=price.listPrice isoCode=price.currencyUsed />
    + + <#if price.listPrice?? && price.defaultPrice?? && price.price?? && price.price < price.defaultPrice && price.defaultPrice < price.listPrice> +
    ${uiLabelMap.ProductRegularPrice}: <@ofbizCurrency amount=price.defaultPrice isoCode=price.currencyUsed />
    + + <#if price.specialPromoPrice??> +
    ${uiLabelMap.ProductSpecialPromoPrice}: <@ofbizCurrency amount=price.specialPromoPrice isoCode=price.currencyUsed />
    + +
    + + <#if price.isSale?? && price.isSale> + ${uiLabelMap.OrderOnSale}! + <#assign priceStyle = "salePrice" /> + <#else> + <#assign priceStyle = "regularPrice" /> + + ${uiLabelMap.OrderYourPrice}: <#if "Y" = product.isVirtual!> ${uiLabelMap.CommonFrom} <@ofbizCurrency amount=price.price isoCode=price.currencyUsed /> + <#if product.productTypeId! == "ASSET_USAGE" || product.productTypeId! == "ASSET_USAGE_OUT_IN"> + <#if product.reserv2ndPPPerc?? && product.reserv2ndPPPerc != 0>
    ${uiLabelMap.ProductReserv2ndPPPerc}<#if !product.reservNthPPPerc?? || product.reservNthPPPerc == 0>${uiLabelMap.CommonUntil} ${product.reservMaxPersons!1} <@ofbizCurrency amount=product.reserv2ndPPPerc*price.price/100 isoCode=price.currencyUsed /> + <#if product.reservNthPPPerc?? &&product.reservNthPPPerc != 0>
    ${uiLabelMap.ProductReservNthPPPerc} <#if !product.reserv2ndPPPerc?? || product.reserv2ndPPPerc == 0>${uiLabelMap.ProductReservSecond} <#else> ${uiLabelMap.ProductReservThird} ${uiLabelMap.CommonUntil} ${product.reservMaxPersons!1}, ${uiLabelMap.ProductEach}: <@ofbizCurrency amount=product.reservNthPPPerc*price.price/100 isoCode=price.currencyUsed /> + <#if (!product.reserv2ndPPPerc?? || product.reserv2ndPPPerc == 0) && (!product.reservNthPPPerc?? || product.reservNthPPPerc == 0)>
    ${uiLabelMap.ProductMaximum} ${product.reservMaxPersons!1} ${uiLabelMap.ProductPersons}. + +
    +
    + <#if price.listPrice?? && price.price?? && price.price < price.listPrice> + <#assign priceSaved = price.listPrice - price.price /> + <#assign percentSaved = (priceSaved / price.listPrice) * 100 /> +
    ${uiLabelMap.OrderSave}: <@ofbizCurrency amount=priceSaved isoCode=price.currencyUsed /> (${percentSaved?int}%)
    + + <#-- show price details ("showPriceDetails" field can be set in the screen definition) --> + <#if (showPriceDetails?? && showPriceDetails?default("N") == "Y")> + <#if price.orderItemPriceInfos??> + <#list price.orderItemPriceInfos as orderItemPriceInfo> +
    ${orderItemPriceInfo.description!}
    + + + + + <#-- Included quantities/pieces --> + <#if product.piecesIncluded?? && product.piecesIncluded?long != 0> +
    + ${uiLabelMap.OrderPieces}: ${product.piecesIncluded} +
    + + <#if (product.quantityIncluded?? && product.quantityIncluded != 0) || product.quantityUomId?has_content> + <#assign quantityUom = product.getRelatedOne("QuantityUom", true)! /> +
    + ${uiLabelMap.CommonQuantity}: ${product.quantityIncluded!} ${((quantityUom.abbreviation)?default(product.quantityUomId))!} +
    + + + <#if (product.productWeight?? && product.productWeight != 0) || product.weightUomId?has_content> + <#assign weightUom = product.getRelatedOne("WeightUom", true)! /> +
    + ${uiLabelMap.CommonWeight}: ${product.productWeight!} ${((weightUom.abbreviation)?default(product.weightUomId))!} +
    + + <#if (product.productHeight?? && product.productHeight != 0) || product.heightUomId?has_content> + <#assign heightUom = product.getRelatedOne("HeightUom", true)! /> +
    + ${uiLabelMap.CommonHeight}: ${product.productHeight!} ${((heightUom.abbreviation)?default(product.heightUomId))!} +
    + + <#if (product.productWidth?? && product.productWidth != 0) || product.widthUomId?has_content> + <#assign widthUom = product.getRelatedOne("WidthUom", true)! /> +
    + ${uiLabelMap.CommonWidth}: ${product.productWidth!} ${((widthUom.abbreviation)?default(product.widthUomId))!} +
    + + <#if (product.productDepth?? && product.productDepth != 0) || product.depthUomId?has_content> + <#assign depthUom = product.getRelatedOne("DepthUom", true)! /> +
    + ${uiLabelMap.CommonDepth}: ${product.productDepth!} ${((depthUom.abbreviation)?default(product.depthUomId))!} +
    + + + <#if daysToShip??> +
    ${uiLabelMap.ProductUsuallyShipsIn} ${daysToShip} ${uiLabelMap.CommonDays}!
    + + + <#-- show tell a friend details only in ecommerce application --> +
     
    + + + <#if disFeatureList?? && 0 < disFeatureList.size()> +

     

    + <#list disFeatureList as currentFeature> + <#assign disFeatureType = currentFeature.getRelatedOne("ProductFeatureType", true) /> +
    + <#if disFeatureType.description??>${disFeatureType.get("description", locale)}<#else>${currentFeature.productFeatureTypeId}: ${currentFeature.description} +
    + +
     
    + +
    + +
    +
    +
    + <#assign inStock = true /> + <#assign commentEnable = Static["org.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("order", "order.item.comment.enable", delegator)> + <#if commentEnable.equals("Y")> + <#assign orderItemAttr = Static["org.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("order", "order.item.attr.prefix", delegator)> + ${uiLabelMap.CommonComment}  + + <#-- Variant Selection --> + <#if product.isVirtual!?upper_case == "Y"> + <#if product.virtualVariantMethodEnum! == "VV_FEATURETREE" && featureLists?has_content> + <#list featureLists as featureList> + <#list featureList as feature> + <#if feature_index == 0> +
    ${feature.description}: +
    + + + +
    + ${uiLabelMap.CommonQuantity}:  + + ${uiLabelMap.OrderAddToCart} +   +
    + + <#if !product.virtualVariantMethodEnum?? || product.virtualVariantMethodEnum == "VV_VARIANTTREE"> + <#if variantTree?? && (variantTree.size() > 0)> + <#list featureSet as currentType> +
    + +
    + + + + +
    + +
    +
    + <#else> + + <#assign inStock = false /> + + + <#else> + + <#if mainProducts?has_content> + +
    +
    + +
    +
    + + <#if (availableInventory??) && (availableInventory <= 0) && product.requireAmount?default("N") == "N"> + <#assign inStock = false /> + + + <#-- check to see if introductionDate hasnt passed yet --> + <#if product.introductionDate?? && nowTimestamp.before(product.introductionDate)> +

     

    +
    ${uiLabelMap.ProductProductNotYetMadeAvailable}.
    + <#-- check to see if salesDiscontinuationDate has passed --> + <#elseif product.salesDiscontinuationDate?? && nowTimestamp.after(product.salesDiscontinuationDate)> +
    ${uiLabelMap.ProductProductNoLongerAvailable}.
    + <#-- check to see if the product requires inventory check and has inventory --> + <#elseif product.virtualVariantMethodEnum! != "VV_FEATURETREE"> + <#if inStock> + <#if product.requireAmount?default("N") == "Y"> + <#assign hiddenStyle = "visible" /> + <#else> + <#assign hiddenStyle = "hidden"/> + +
    + ${uiLabelMap.CommonAmount}:  + +
    + <#if product.productTypeId! == "ASSET_USAGE" || product.productTypeId! == "ASSET_USAGE_OUT_IN"> +
    + <@htmlTemplate.renderDateTimeField event="" action="" name="reservStart" className="" alert="" title="Format: yyyy-MM-dd HH:mm:ss.SSS" value="${startDate}" size="25" maxlength="30" id="reservStart1" dateType="date" shortDateInput=true timeDropdownParamName="" defaultDateTimeString="" localizedIconTitle="" timeDropdown="" timeHourName="" classString="" hour1="" hour2="" timeMinutesName="" minutes="" isTwelveHour="" ampmName="" amSelected="" pmSelected="" compositeType="" formName=""/> +
    +
    + <#--td nowrap="nowrap" align="right">Number
    of days
       + Number of days + Number of persons + Number of rooms + + ${uiLabelMap.OrderAddToCart} + <#else> + disabled="disabled" />${uiLabelMap.OrderAddToCart} + <@showUnavailableVarients/> + + <#else> + <#if productStore??> + <#if productStore.requireInventory?? && productStore.requireInventory == "N"> + disabled="disabled" />${uiLabelMap.OrderAddToCart} + <@showUnavailableVarients/> + <#else> + ${uiLabelMap.OrderAddToCart}
    + ${uiLabelMap.ProductItemOutOfStock}<#if product.inventoryMessage??>— ${product.inventoryMessage} + + + + + <#if variantPriceList??> + <#list variantPriceList as vpricing> + <#assign variantName = vpricing.get("variantName")!> + <#assign secondVariantName = vpricing.get("secondVariantName")!> + <#assign minimumQuantity = vpricing.get("minimumQuantity")> + <#if minimumQuantity > 0> +
    minimum order quantity for ${secondVariantName!} ${variantName!} is ${minimumQuantity!}
    + + + <#elseif minimumQuantity?? && minimumQuantity?has_content && minimumQuantity > 0> +
    minimum order quantity for ${productContentWrapper.get("PRODUCT_NAME", "html")!} is ${minimumQuantity!}
    + + + + +
    + <#if sessionAttributes.userLogin?has_content && sessionAttributes.userLogin.userLoginId != "anonymous"> +
    +
    +
    + + + + + +    + <#--assign nowDate = Static["org.ofbiz.base.util.UtilDateTime"].nowDateString("yyyy-MM-dd")--> + <#if product.productTypeId! == "ASSET_USAGE"> +  ${uiLabelMap.CommonStartDate} (yyyy-mm-dd)<@htmlTemplate.renderDateTimeField name="reservStartStr" event="" action="" value="${startDate}" className="" alert="" title="Format: yyyy-MM-dd HH:mm:ss.SSS" size="15" maxlength="30" id="reservStartStr" dateType="date" shortDateInput=false timeDropdownParamName="" defaultDateTimeString="" localizedIconTitle="" timeDropdown="" timeHourName="" classString="" hour1="" hour2="" timeMinutesName="" minutes="" isTwelveHour="" ampmName="" amSelected="" pmSelected="" compositeType="" formName=""/> Number of days   
    Number of persons    Qty   + <#elseif product.productTypeId! == "ASSET_USAGE_OUT_IN"> +  ${uiLabelMap.CommonStartDate} (yyyy-mm-dd)   <@htmlTemplate.renderDateTimeField name="reservStartStr" event="" action="" value="${startDate}" className="" alert="" title="Format: yyyy-MM-dd HH:mm:ss.SSS" size="15" maxlength="30" id="reservStartStr" dateType="date" shortDateInput=false timeDropdownParamName="" defaultDateTimeString="" localizedIconTitle="" timeDropdown="" timeHourName="" classString="" hour1="" hour2="" timeMinutesName="" minutes="" isTwelveHour="" ampmName="" amSelected="" pmSelected="" compositeType="" formName=""/>  Number of days  
    + Qty  + <#else> + + + + ${uiLabelMap.OrderAddToShoppingList} +
    +
    + <#else>
    + ${uiLabelMap.OrderYouMust} ${uiLabelMap.CommonBeLogged} + ${uiLabelMap.OrderToAddSelectedItemsToShoppingList}.  + +
    + <#-- Prefill first select box (virtual products only) --> + <#if variantTree?? && 0 < variantTree.size()> + + + + <#-- Swatches (virtual products only) --> + <#if variantSample?? && 0 < variantSample.size()> + <#assign imageKeys = variantSample.keySet() /> + <#assign imageMap = variantSample /> +

     

    + <#assign maxIndex = 7 /> + <#assign indexer = 0 /> + <#list imageKeys as key> + <#assign swatchProduct = imageMap.get(key) /> + <#if swatchProduct?has_content && indexer < maxIndex> + <#assign imageUrl = Static["org.ofbiz.product.product.ProductContentWrapper"].getProductContentAsText(swatchProduct, "SMALL_IMAGE_URL", request, "url")! /> + <#if !imageUrl?string?has_content> + <#assign imageUrl = productContentWrapper.get("SMALL_IMAGE_URL", "url")! /> + + <#if !imageUrl?string?has_content> + <#assign imageUrl = "/images/defaultImage.jpg" /> + + ${key} + +
    + + <#assign indexer = indexer + 1 /> + + <#if (indexer > maxIndex)> +
    ${uiLabelMap.ProductMoreOptions}
    + + + + <#-- Digital Download Files Associated with this Product --> + <#if downloadProductContentAndInfoList?has_content> +
    +
    ${uiLabelMap.OrderDownloadFilesTitle}:
    + <#list downloadProductContentAndInfoList as downloadProductContentAndInfo> +
    ${downloadProductContentAndInfo.contentName!}<#if downloadProductContentAndInfo.description?has_content> - ${downloadProductContentAndInfo.description}
    + +
    + + + <#-- Long description of product --> +
    +
    ${productContentWrapper.get("LONG_DESCRIPTION", "html")!}
    +
    ${productContentWrapper.get("WARNINGS", "html")!}
    +
    + + <#-- Any attributes/etc may go here --> + + <#-- Product Reviews --> +
    +
    ${uiLabelMap.OrderCustomerReviews}:
    + <#if averageRating?? && (averageRating > 0) && numRatings?? && (numRatings > 1)> +
    ${uiLabelMap.OrderAverageRating}: ${averageRating} <#if numRatings??>(${uiLabelMap.CommonFrom} ${numRatings} ${uiLabelMap.OrderRatings})
    + +
    + <#if productReviews?has_content> + <#list productReviews as productReview> + <#assign postedUserLogin = productReview.getRelatedOne("UserLogin", false) /> + <#assign postedPerson = postedUserLogin.getRelatedOne("Person", false)! /> +
    ${uiLabelMap.CommonBy}: <#if productReview.postedAnonymous?default("N") == "Y"> ${uiLabelMap.OrderAnonymous}<#else> ${postedPerson.firstName} ${postedPerson.lastName} 
    +
    ${uiLabelMap.CommonAt}: ${productReview.postedDateTime!} 
    +
    ${uiLabelMap.OrderRanking}: ${productReview.productRating!?string}
    +
     
    +
    ${productReview.productReview!}
    +
    + + + <#else> +
    ${uiLabelMap.ProductProductNotReviewedYet}.
    + +
    + + + <#-- Upgrades/Up-Sell/Cross-Sell --> + <#macro associated assocProducts beforeName showName afterName formNamePrefix targetRequestName> + <#assign pageProduct = product /> + <#assign targetRequest = "product" /> + <#if targetRequestName?has_content> + <#assign targetRequest = targetRequestName /> + + <#if assocProducts?has_content> +

    ${beforeName!}<#if showName == "Y">${productContentWrapper.get("PRODUCT_NAME", "html")!}${afterName!}

    + +
    + <#list assocProducts as productAssoc> + <#if productAssoc.productId == product.productId> + <#assign assocProductId = productAssoc.productIdTo /> + <#else> + <#assign assocProductId = productAssoc.productId /> + +
    + + ${assocProductId} + + <#if productAssoc.reason?has_content> + - ${productAssoc.reason} + +
    + ${setRequestAttribute("optProductId", assocProductId)} + ${setRequestAttribute("listIndex", listIndex)} + ${setRequestAttribute("formNamePrefix", formNamePrefix)} + <#if targetRequestName?has_content> + ${setRequestAttribute("targetRequestName", targetRequestName)} + + ${screens.render(productsummaryScreen)} + <#assign product = pageProduct /> + <#local listIndex = listIndex + 1 /> + +
    + + ${setRequestAttribute("optProductId", "")} + ${setRequestAttribute("formNamePrefix", "")} + ${setRequestAttribute("targetRequestName", "")} + + + + <#assign productValue = product /> + <#assign listIndex = 1 /> + ${setRequestAttribute("productValue", productValue)} +
    + <#-- also bought --> + <@associated assocProducts=alsoBoughtProducts beforeName="" showName="N" afterName="${uiLabelMap.ProductAlsoBought}" formNamePrefix="albt" targetRequestName="" /> + <#-- obsolete --> + <@associated assocProducts=obsoleteProducts beforeName="" showName="Y" afterName=" ${uiLabelMap.ProductObsolete}" formNamePrefix="obs" targetRequestName="" /> + <#-- cross sell --> + <@associated assocProducts=crossSellProducts beforeName="" showName="N" afterName="${uiLabelMap.ProductCrossSell}" formNamePrefix="cssl" targetRequestName="crosssell" /> + <#-- up sell --> + <@associated assocProducts=upSellProducts beforeName="${uiLabelMap.ProductUpSell} " showName="Y" afterName=":" formNamePrefix="upsl" targetRequestName="upsell" /> + <#-- obsolescence --> + <@associated assocProducts=obsolenscenseProducts beforeName="" showName="Y" afterName=" ${uiLabelMap.ProductObsolescense}" formNamePrefix="obce" targetRequestName="" /> +
    + + <#-- special cross/up-sell area using commonFeatureResultIds (from common feature product search) --> + <#if commonFeatureResultIds?has_content> +

    ${uiLabelMap.ProductSimilarProducts}

    + +
    + <#list commonFeatureResultIds as commonFeatureResultId> + ${setRequestAttribute("optProductId", commonFeatureResultId)} + ${setRequestAttribute("listIndex", commonFeatureResultId_index)} + ${setRequestAttribute("formNamePrefix", "cfeatcssl")} + <#-- ${setRequestAttribute("targetRequestName", targetRequestName)} --> + ${screens.render(productsummaryScreen)} + +
    + + +
    +

    ${uiLabelMap.EcommerceProductTags}

    + <#if productTags??> +

    ${uiLabelMap.EcommerceProductTagsDetail}:

    +

    +

      +
    • + <#assign no = 0 /> + <#list productTags?keys?sort as productTag> + <#assign tagValue = productTags.get(productTag)!/> + <#if tagValue?has_content> + ${productTag} (${tagValue}) <#if no < (productTags.size() - 1)> | + <#assign no = no + 1 /> + + +
    • +
    +

    + + +

    ${uiLabelMap.EcommerceAddYourTags}:

    +

    +

    + + + +
    + ${uiLabelMap.EcommerceAddTagsDetail} +

    +
    +
    +
    + + + + + + +
    + + diff --git a/template/catalog/productreview.ftl b/template/catalog/productreview.ftl new file mode 100644 index 0000000..47e4210 --- /dev/null +++ b/template/catalog/productreview.ftl @@ -0,0 +1,79 @@ +<#-- +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. +--> +<#assign productUrl><@ofbizCatalogAltUrl productId=requestParameters.product_id productCategoryId=requestParameters.category_id/> +<#if requestParameters.product_id??> +
    +
    +
    + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + + + + +
    +
    + + +
    +
    + +
    + +<#else> +

    ${uiLabelMap.ProductCannotReviewUnKnownProduct}.

    + \ No newline at end of file diff --git a/template/catalog/productsummary.ftl b/template/catalog/productsummary.ftl new file mode 100644 index 0000000..6230f1d --- /dev/null +++ b/template/catalog/productsummary.ftl @@ -0,0 +1,240 @@ +<#-- +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. +--> +${virtualJavaScript!} + +<#if product??> + <#-- variable setup --> + <#if backendPath?default("N") == "Y"> + <#assign productUrl><@ofbizCatalogUrl productId=product.productId productCategoryId=categoryId/> + <#else> + <#assign productUrl><@ofbizCatalogAltUrl productId=product.productId productCategoryId=categoryId/> + + + <#if requestAttributes.productCategoryMember??> + <#assign prodCatMem = requestAttributes.productCategoryMember> + + <#assign smallImageUrl = productContentWrapper.get("SMALL_IMAGE_URL", "url")!> + <#if !smallImageUrl?string?has_content><#assign smallImageUrl = "/images/defaultImage.jpg"> + <#-- end variable setup --> + <#assign productInfoLinkId = "productInfoLink"> + <#assign productInfoLinkId = productInfoLinkId + product.productId/> + <#assign productDetailId = "productDetailId"/> + <#assign productDetailId = productDetailId + product.productId/> +
    +
    +
    + + Small Image + +
    + + + + +
    + +
    ${productContentWrapper.get("DESCRIPTION", "html")!}<#if daysToShip??> - ${uiLabelMap.ProductUsuallyShipsIn} ${daysToShip} ${uiLabelMap.CommonDays}!
    + + <#-- Display category-specific product comments --> + <#if prodCatMem?? && prodCatMem.comments?has_content> +
    ${prodCatMem.comments}
    + + + <#-- example of showing a certain type of feature with the product --> + <#if sizeProductFeatureAndAppls?has_content> +
    + <#if (sizeProductFeatureAndAppls?size == 1)> + ${uiLabelMap.SizeAvailableSingle}: + <#else> + ${uiLabelMap.SizeAvailableMultiple}: + + <#list sizeProductFeatureAndAppls as sizeProductFeatureAndAppl> + ${sizeProductFeatureAndAppl.abbrev?default(sizeProductFeatureAndAppl.description?default(sizeProductFeatureAndAppl.productFeatureId))}<#if sizeProductFeatureAndAppl_has_next>, + +
    + +
    + ${product.productId!} + <#if totalPrice??> +
    ${uiLabelMap.ProductAggregatedPrice}: <@ofbizCurrency amount=totalPrice isoCode=totalPrice.currencyUsed/>
    + <#else> + <#if price.competitivePrice?? && price.price?? && price.price?double < price.competitivePrice?double> + ${uiLabelMap.ProductCompareAtPrice}: <@ofbizCurrency amount=price.competitivePrice isoCode=price.currencyUsed/> + + <#if price.listPrice?? && price.price?? && price.price?double < price.listPrice?double> + ${uiLabelMap.ProductListPrice}: <@ofbizCurrency amount=price.listPrice isoCode=price.currencyUsed/> + + + <#if price.isSale?? && price.isSale> + ${uiLabelMap.OrderOnSale}! + <#assign priceStyle = "salePrice"> + <#else> + <#assign priceStyle = "regularPrice"> + + + <#if (price.price?default(0) > 0 && product.requireAmount?default("N") == "N")> + ${uiLabelMap.OrderYourPrice}: <#if "Y" = product.isVirtual!> ${uiLabelMap.CommonFrom} <@ofbizCurrency amount=price.price isoCode=price.currencyUsed/> + + + <#if price.listPrice?? && price.price?? && price.price?double < price.listPrice?double> + <#assign priceSaved = price.listPrice?double - price.price?double> + <#assign percentSaved = (priceSaved?double / price.listPrice?double) * 100> + ${uiLabelMap.OrderSave}: <@ofbizCurrency amount=priceSaved isoCode=price.currencyUsed/> (${percentSaved?int}%) + + + <#-- show price details ("showPriceDetails" field can be set in the screen definition) --> + <#if (showPriceDetails?? && showPriceDetails?default("N") == "Y")> + <#if price.orderItemPriceInfos??> + <#list price.orderItemPriceInfos as orderItemPriceInfo> +
    ${orderItemPriceInfo.description!}
    + + + +
    + +
    + <#-- check to see if introductionDate hasn't passed yet --> + <#if product.introductionDate?? && nowTimestamp.before(product.introductionDate)> +
    ${uiLabelMap.ProductNotYetAvailable}
    + <#-- check to see if salesDiscontinuationDate has passed --> + <#elseif product.salesDiscontinuationDate?? && nowTimestamp.after(product.salesDiscontinuationDate)> +
    ${uiLabelMap.ProductNoLongerAvailable}
    + <#-- check to see if it is a rental item; will enter parameters on the detail screen--> + <#elseif product.productTypeId! == "ASSET_USAGE"> + ${uiLabelMap.OrderMakeBooking}... + <#-- check to see if it is an aggregated or configurable product; will enter parameters on the detail screen--> + <#elseif product.productTypeId! == "AGGREGATED" || product.productTypeId! == "AGGREGATED_SERVICE"> + ${uiLabelMap.OrderConfigure}... + <#-- check to see if the product is a virtual product --> + <#elseif product.isVirtual?? && product.isVirtual == "Y"> + ${uiLabelMap.OrderChooseVariations}... + <#-- check to see if the product requires an amount --> + <#elseif product.requireAmount?? && product.requireAmount == "Y"> + ${uiLabelMap.OrderChooseAmount}... + <#elseif product.productTypeId! == "ASSET_USAGE_OUT_IN"> + ${uiLabelMap.OrderRent}... + <#else> +
    + + + + + ${uiLabelMap.OrderAddToCart} + <#if mainProducts?has_content> + + +
    + + +
    + +
    + + <#if prodCatMem?? && prodCatMem.quantity?? && 0.00 < prodCatMem.quantity?double> +
    + + + + + ${uiLabelMap.CommonAddDefault}(${prodCatMem.quantity?string.number}) ${uiLabelMap.OrderToCart} +
    + <#assign productCategory = delegator.findOne("ProductCategory", Static["org.ofbiz.base.util.UtilMisc"].toMap("productCategoryId", prodCatMem.productCategoryId), false)/> + <#if productCategory.productCategoryTypeId != "BEST_SELL_CATEGORY"> +
    + + + + + ${uiLabelMap.CommonAddDefault}(${prodCatMem.quantity?string.number}) ${uiLabelMap.OrderToCart} +
    + + + +
    + <#if averageRating?? && (averageRating?double > 0) && numRatings?? && (numRatings?long > 2)> +
    ${uiLabelMap.OrderAverageRating}: ${averageRating} (${uiLabelMap.CommonFrom} ${numRatings} ${uiLabelMap.OrderRatings})
    + +
    addToCompare" name="addToCompare${requestAttributes.listIndex!}form"> + + +
    + ${uiLabelMap.ProductAddToCompare} +
    +
    +
    +<#else> + ${uiLabelMap.ProductErrorProductNotFound}.
    + diff --git a/template/catalog/sidedeepcategory.ftl b/template/catalog/sidedeepcategory.ftl new file mode 100644 index 0000000..ac938e9 --- /dev/null +++ b/template/catalog/sidedeepcategory.ftl @@ -0,0 +1,86 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + +--> +<#-- variable setup and worker calls --> +<#if (requestAttributes.topLevelList)??><#assign topLevelList = requestAttributes.topLevelList> +<#if (requestAttributes.curCategoryId)??><#assign curCategoryId = requestAttributes.curCategoryId> + +<#-- looping macro --> +<#macro categoryList parentCategory category wrapInBox> + <#if catContentWrappers?? && catContentWrappers[category.productCategoryId]?? && catContentWrappers[category.productCategoryId].get("CATEGORY_NAME", "html")??> + <#assign categoryName = catContentWrappers[category.productCategoryId].get("CATEGORY_NAME", "html")> + <#else> + <#assign categoryName = category.categoryName!> + + <#if catContentWrappers?? && catContentWrappers[category.productCategoryId]?? && catContentWrappers[category.productCategoryId].get("DESCRIPTION", "html")??> + <#assign categoryDescription = catContentWrappers[category.productCategoryId].get("DESCRIPTION", "html")> + <#else> + <#assign categoryDescription = category.description!> + + <#if curCategoryId?? && curCategoryId == category.productCategoryId> + <#assign browseCategoryButtonClass = "browsecategorybuttondisabled"> + <#else> + <#assign browseCategoryButtonClass = "browsecategorybutton"> + + <#if wrapInBox == "Y"> +
    +
    +

    <#if categoryDescription?has_content>${categoryDescription}<#else>${categoryName?default("")}

    +
    +
    +
    +
    + +
  • + <#if parentCategory?has_content> + <#assign parentCategoryId = parentCategory.productCategoryId/> + <#else> + <#assign parentCategoryId = ""/> + + <#if categoryName?has_content>${categoryName}<#else>${categoryDescription?default("")} + + <#if (Static["org.ofbiz.product.category.CategoryWorker"].checkTrailItem(request, category.getString("productCategoryId"))) || (curCategoryId?? && curCategoryId == category.productCategoryId)> + <#local subCatList = Static["org.ofbiz.product.category.CategoryWorker"].getRelatedCategoriesRet(request, "subCatList", category.getString("productCategoryId"), true)> + <#if subCatList??> + <#list subCatList as subCat> +
      + <@categoryList parentCategory=category category=subCat wrapInBox="N"/> +
    + + + +
  • + <#if wrapInBox == "Y"> +
    +
    +
    + + + +<#if topLevelList?has_content> +
    +
    +

    ${uiLabelMap.ProductBrowseCategories}

    +
    +
    +
      + <#list topLevelList as category> + <@categoryList parentCategory="" category=category wrapInBox="N"/> + +
    +
    +
    + diff --git a/template/catalog/tagsearch.ftl b/template/catalog/tagsearch.ftl new file mode 100644 index 0000000..18075c9 --- /dev/null +++ b/template/catalog/tagsearch.ftl @@ -0,0 +1,86 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> +
    +
    +

    ${uiLabelMap.ProductProductTaggedWith} "${parameters.SEARCH_STRING}"

    +
    +
    + <#if !productIds?has_content> +

     ${uiLabelMap.ProductNoResultsFound}.

    + + +<#if productIds?has_content> +
    + <#-- Start Page Select Drop-Down --> + <#assign viewIndexMax = Static["java.lang.Math"].ceil((listSize - 1)?double / viewSize?double)> + + <#-- End Page Select Drop-Down --> + + <#if (viewIndex?int > 0)> + ${uiLabelMap.CommonPrevious} | + + <#if (listSize?int > 0)> + ${lowIndex+1} - ${highIndex} ${uiLabelMap.CommonOf} ${listSize} + + <#if highIndex?int < listSize?int> + | ${uiLabelMap.CommonNext} + + +
    + + +<#if productIds?has_content> +
    + <#list productIds as productId> <#-- note that there is no boundary range because that is being done before the list is put in the content --> + ${setRequestAttribute("optProductId", productId)} + ${setRequestAttribute("listIndex", productId_index)} + ${screens.render(productsummaryScreen)} + +
    + + +<#if productIds?has_content> +
    + <#-- Start Page Select Drop-Down --> + <#assign viewIndexMax = Static["java.lang.Math"].ceil((listSize - 1)?double / viewSize?double)> + + <#-- End Page Select Drop-Down --> + + <#if (viewIndex?int > 0)> + ${uiLabelMap.CommonPrevious} | + + <#if (listSize?int > 0)> + ${lowIndex+1} - ${highIndex} ${uiLabelMap.CommonOf} ${listSize} + + <#if highIndex?int < listSize?int> + | ${uiLabelMap.CommonNext} + + +
    + +
    +
    diff --git a/template/catalog/tellafriend.ftl b/template/catalog/tellafriend.ftl new file mode 100644 index 0000000..702f060 --- /dev/null +++ b/template/catalog/tellafriend.ftl @@ -0,0 +1,66 @@ +<#-- +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. +--> + + + + ${uiLabelMap.EcommerceTellAFriend} + + +
    + <#if (requestParameters.productId)?? || (requestParameters.productId)??> + " /> + <#else> + <#assign cancel = "Y"> + + + <#if !cancel??> + + + + + + + + + + + + + + + + + + +
    ${uiLabelMap.CommonYouremail}:
    ${uiLabelMap.CommonEmailTo}:
    ${uiLabelMap.CommonMessage}
    + +
    + +
    + <#else> + +
    ${uiLabelMap.EcommerceTellAFriendSorry}
    + +
    + + diff --git a/template/content/bloglib.ftl b/template/content/bloglib.ftl new file mode 100644 index 0000000..624e038 --- /dev/null +++ b/template/content/bloglib.ftl @@ -0,0 +1,55 @@ +<#-- +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. +--> + +<#macro renderAncestryPath trail siteId startIndex=0 endIndexOffset=0 buttonTitle="Back to" searchOn="" > + <#local indent = ""> + <#local csv = ""> + <#local counter = 0> + <#local len = trail?size> + + <#list trail as content> + <#if counter < (len - endIndexOffset) && startIndex <= counter > + <#if 0 < counter > + <#local csv = csv + ","/> + + <#local csv = csv + content.contentId/> + <#if counter < len && startIndex <= counter > + + + + + <#local counter = counter + 1> + <#if 20 < counter > <#break/> + +
    + ${indent} + <#if content.contentTypeId == "WEB_SITE_PUB_PT" > + ${uiLabelMap.CommonBackTo}  ${content.contentName!} + <#else> + ${uiLabelMap.CommonBackTo}  ${content.contentName!} + + <#local indent = indent + "    "> + [${content.contentId!}] + <#if searchOn?has_content && searchOn?lower_case == "true"> +   + ${uiLabelMap.CommonSearch} + + +
    + diff --git a/template/content/content_categories.ftl b/template/content/content_categories.ftl new file mode 100644 index 0000000..be7f4ad --- /dev/null +++ b/template/content/content_categories.ftl @@ -0,0 +1,48 @@ +<#-- +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. +--> +<#assign contentRootId = "WebStoreCONTENT"/> + +<#-- variable setup and worker calls --> +<#assign curCategoryId = requestAttributes.curCategoryId!> +<#assign forumTrailCsv=requestParameters.forumTrailCsv!/> +<#assign forumTrail=[]/> +<#assign firstContentId=""/> +<#if forumTrailCsv?has_content> + <#assign forumTrail=Static["org.ofbiz.base.util.StringUtil"].split(forumTrailCsv, ",") /> + <#if 0 < forumTrail?size> + <#assign firstContentId=forumTrail[0]?string/> + + + +
    +
    +

    ${uiLabelMap.ProductBrowseContent}

    +
    +
    +
      + <#assign count_1=0/> + <@loopSubContent contentId=contentRootId viewIndex=0 viewSize=9999 orderBy="contentName"> +
    • + ${content.contentName} +
    • + <#assign count_1=(count_1 + 1)/> + +
    +
    +
    \ No newline at end of file diff --git a/template/content/content_topic.ftl b/template/content/content_topic.ftl new file mode 100644 index 0000000..a84966b --- /dev/null +++ b/template/content/content_topic.ftl @@ -0,0 +1,51 @@ +<#-- +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. +--> +<#assign contentRootId = "WebStoreCONTENT"/> + +<#-- variable setup and worker calls --> +<#assign curCategoryId = requestAttributes.curCategoryId!> +<#assign forumTrailCsv=requestParameters.forumTrailCsv!/> +<#assign forumTrail=[]/> +<#assign firstContentId=""/> +<#if forumTrailCsv?has_content> + <#assign forumTrail=Static["org.ofbiz.base.util.StringUtil"].split(forumTrailCsv, ",") /> + <#if 0 < forumTrail?size> + <#assign firstContentId=forumTrail[0]?string/> + + + +
    +
    +
      +
    • Content Information
    • +
    +
    +
    +
    +
      + <#assign count_1=0/> + <@loopSubContent contentId=contentRootId viewIndex=0 viewSize=9999 orderBy="contentName"> +
    • + ${content.contentName} +
    • + <#assign count_1=(count_1 + 1)/> + +
    +
    +
    diff --git a/template/content/defaultcontent.ftl b/template/content/defaultcontent.ftl new file mode 100644 index 0000000..6df2571 --- /dev/null +++ b/template/content/defaultcontent.ftl @@ -0,0 +1,20 @@ +<#-- +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. +--> + +<@renderSubContent subContentId=contentId/> diff --git a/template/content/factoids.ftl b/template/content/factoids.ftl new file mode 100644 index 0000000..9bbfa1c --- /dev/null +++ b/template/content/factoids.ftl @@ -0,0 +1,48 @@ +<#-- +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. +--> +<#assign factoidRootId = "WebStoreFACTOID"/> + +<#-- variable setup and worker calls --> +<#assign curCategoryId = requestAttributes.curCategoryId!> +<#assign factoidTrailCsv = requestParameters.factoidTrailCsv!/> +<#assign factoidTrail=[]/> +<#assign firstContentId=""/> +<#if factoidTrailCsv?has_content> + <#assign factoidTrail=Static["org.ofbiz.base.util.StringUtil"].split(factoidTrailCsv, ",") /> + <#if 0 < factoidTrail?size> + <#assign firstContentId=factoidTrail[0]?string/> + + + +
    +
    +

    ${uiLabelMap.EcommerceFactoids}

    +
    +
    +
      + <#assign count_1=0/> + <@limitedSubContent contentId=factoidRootId viewIndex=0 viewSize=9999 orderBy="contentName" limitSize="2"> +
    • + <@renderSubContentCache subContentId=subContentId/> +
    • + <#assign count_1=(count_1 + 1)/> + +
    +
    +
    \ No newline at end of file diff --git a/template/content/minipoll.ftl b/template/content/minipoll.ftl new file mode 100644 index 0000000..c667f1f --- /dev/null +++ b/template/content/minipoll.ftl @@ -0,0 +1,39 @@ +<#-- +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. +--> + +<#assign groupName = page.randomSurveyGroup!> +<#if groupName?has_content> + <#assign randomSurvey = Static["org.ofbiz.product.store.ProductStoreWorker"].getRandomSurveyWrapper(request, "testSurveyGroup")!> + + +<#if randomSurvey?has_content> +
    +
    +
      +
    • ${randomSurvey.getSurveyName()!}
    • +
    +
    +
    +
    +
    + ${randomSurvey.render()} +
    +
    +
    + diff --git a/template/content/recentlyviewed.ftl b/template/content/recentlyviewed.ftl new file mode 100644 index 0000000..a9c5be6 --- /dev/null +++ b/template/content/recentlyviewed.ftl @@ -0,0 +1,36 @@ +<#-- +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. +--> + +<#if mrvList?has_content> +
    +
    +
      +
    • ${uiLabelMap.EcommerceLastContent}
    • +
    +
    +
    +
    + <#list mrvList as mrvArr> + + +
    +
    + \ No newline at end of file diff --git a/template/content/searchContent.ftl b/template/content/searchContent.ftl new file mode 100644 index 0000000..dd574a3 --- /dev/null +++ b/template/content/searchContent.ftl @@ -0,0 +1,115 @@ +<#-- +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. +--> + + +
    + + + + + + + + + + + + +
    +${uiLabelMap.EcommerceEnterQueryParameters} +  + +
    + + + + + <#list productFeatureTypeIdsOrdered as productFeatureTypeId> + <#assign findPftMap = Static["org.ofbiz.base.util.UtilMisc"].toMap("productFeatureTypeId", productFeatureTypeId)> + <#assign productFeatureType = delegator.findOne("ProductFeatureType", findPftMap, true)> + <#assign productFeatures = productFeaturesByTypeMap[productFeatureTypeId]> + + + + + + <#if searchConstraintStrings?has_content> + + + + + + + + + + +
    +
    ${uiLabelMap.ProductFeatures}:
    +
    +
    + ${uiLabelMap.CommonAll} + ${uiLabelMap.CommonAny} +
    +
    +
    ${(productFeatureType.get("description",locale))!}:
    +
    +
    + +
    +
    +
    ${uiLabelMap.ProductLastSearch}:
    +
    + <#list searchConstraintStrings as searchConstraintString> +
     - ${searchConstraintString}
    + +
    ${uiLabelMap.ProductSortedBy}: ${searchSortOrderString}
    +
    + ${uiLabelMap.ProductNewSearch} + ${uiLabelMap.CommonRefineSearch} +
    +
      + +
    +
    + + + + ${listWrapper.renderFormString()} + +<#macro listSiteIds contentId indentIndex=0> + <#assign dummy=Static["org.ofbiz.base.util.Debug"].logInfo("in listSiteIds, contentId:" + contentId,"")/> + <#assign dummy=Static["org.ofbiz.base.util.Debug"].logInfo("in listSiteIds, indentIndex:" + indentIndex,"")/> + <#local indent = ""/> + <#if 0 < indentIndex > + <#list 0..(indentIndex - 1) as idx> + <#local indent = indent + "  "/> + + +<@loopSubContent contentId=contentId viewIndex=0 viewSize=9999 returnAfterPickWhen="1==1";> + + <@listSiteIds contentId=content.contentId indentIndex=indentIndex + 1 /> + + diff --git a/template/content/showcontenttree.ftl b/template/content/showcontenttree.ftl new file mode 100644 index 0000000..ff910c9 --- /dev/null +++ b/template/content/showcontenttree.ftl @@ -0,0 +1,111 @@ +<#-- +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. +--> + +<#include "bloglib.ftl" /> +<#assign siteId = requestParameters.contentId! /> + +<@renderAncestryPath trail=ancestorList?default([]) endIndexOffset=1 siteId=siteId searchOn="true"/> + +<#if ancestorList?has_content && (0 < ancestorList?size) > + <#assign lastContent=ancestorList?last /> +

    [${lastContent.contentId}] ${lastContent.description} + ${uiLabelMap.CommonSearch} +

    + + +<#assign viewIdx = "" /> +<#if requestParameters.viewIndex?has_content> +<#assign viewIdx = requestParameters.viewIndex! /> + +<#assign viewSz = "" /> +<#if requestParameters.viewSize?has_content> +<#assign viewSz = requestParameters.viewSize! /> + +<#assign nodeTrailCsv=requestParameters.nodeTrailCsv!/> +<#assign dummy=Static["org.ofbiz.base.util.Debug"].logInfo("in showcontenttree, nodeTrailCsv(0):" + nodeTrailCsv, "")/> +<#assign nodeTrail=[]/> +<#assign firstContentId=""/> +<#if nodeTrailCsv?has_content> + <#assign nodeTrail=Static["org.ofbiz.base.util.StringUtil"].split(nodeTrailCsv, ",") /> + <#if 0 < nodeTrail?size> + <#assign firstContentId=nodeTrail[0]?string/> + + + +<#-- +<#assign dummy=Static["org.ofbiz.base.util.Debug"].logInfo("in showcontenttree, siteId:" + siteId, "")/> +<#assign dummy=Static["org.ofbiz.base.util.Debug"].logInfo("in showcontenttree, nodeTrail:" + nodeTrail, "")/> +--> + +
    + <@renderCategoryBrowse contentId=siteId indentIndex=1 nodeTrail=nodeTrail /> +
    + +<#macro renderCategoryBrowse contentId="" indentIndex=0 nodeTrail=[] viewSz=9999 viewIdx=0> + + + <#local contentIdx = contentId! /> + <#if (!contentIdx?? || contentIdx?length == 0)> + <#local contentIdx = page.contentIdx! /> + <#if (!contentIdx?? || contentIdx?length == 0)> + + + + <#local thisContentId=nodeTrail[indentIndex]!/> + + <#local thisNodeTrailCsv = "" /> + <#local listUpper = (indentIndex - 1) /> + <#if nodeTrail?size < listUpper > + <#local listUpper = (nodeTrail?size - 1)> + + <#list 0..listUpper as idx> + <#if thisNodeTrailCsv?has_content> + <#local thisNodeTrailCsv = thisNodeTrailCsv + ","/> + + <#if nodeTrail[idx]??> + <#local thisNodeTrailCsv = thisNodeTrailCsv + nodeTrail[idx]> + + + + + + + <@loopSubContent contentId=contentIdx viewIndex=viewIdx viewSize=viewSz contentAssocTypeId="PUBLISH_LINK" returnAfterPickWhen="1==1"> + <#assign dummy=Static["org.ofbiz.base.util.Debug"].logInfo("in showcontenttree, nodeTrailCsv(1):" + nodeTrailCsv, "")/> + <#local thisCsv=thisNodeTrailCsv + "," + subContentId /> + ${uiLabelMap.CommonView} ${content.description!}
    + + + + + <@loopSubContent contentId=contentIdx viewIndex=viewIdx viewSize=viewSz returnAfterPickWhen="1==1" orderBy="contentName"> + <#local plusMinus="+"/> + <#if thisContentId == subContentId> + <#local plusMinus="-"/> + + <#local thisCsv=thisNodeTrailCsv /> + <#local thisCsv=thisNodeTrailCsv + "," + subContentId /> + ${plusMinus}  ${content.description!} + ${uiLabelMap.CommonSearch}
    + <#if thisContentId == subContentId> + <#assign catTrail = nodeTrail + [subContentId]/> +
    <@renderCategoryBrowse contentId=subContentId indentIndex=(indentIndex + 1) nodeTrail=catTrail viewSz=viewSz viewIdx=viewIdx />
    + + + diff --git a/template/content/tpl_mb_content.ftl b/template/content/tpl_mb_content.ftl new file mode 100644 index 0000000..258e4aa --- /dev/null +++ b/template/content/tpl_mb_content.ftl @@ -0,0 +1,67 @@ +<#ftl ns_prefixes={"ask":"http://www.automationgroups.com/dtd/ask/"}> +<#-- +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. +--> + +<#recurse doc> + + +<#macro "ask:document"> + <#recurse .node> + + +<#macro "ask:title"> +

    ${.node}

    +

    + + +<#macro "ask:body"> + <#recurse .node> + + +<#macro "ask:section"> + <#list .node?children as kid> + <#if kid?node_name == "sectionTitle"> +

    <#recurse kid>

    + <#else> + ${kid.@@markup} + + + + +<#macro "ask:sectionTitle"> + + +<#macro @text> +${.node?html} + +<#-- +<#macro content> + <#assign contentId="ECMC" + .node.@id[0]/> + + + + + + +--> + +<#macro @element> + diff --git a/template/content/viewcontent.ftl b/template/content/viewcontent.ftl new file mode 100644 index 0000000..1c36e45 --- /dev/null +++ b/template/content/viewcontent.ftl @@ -0,0 +1,136 @@ +<#-- +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. +--> + +
    +
    + <#-- Do this so that we don't have to find the content twice (again in renderSubContent) --> + <#assign subContentId=requestParameters.contentId!/> + <#assign nodeTrailCsv=requestParameters.nodeTrailCsv!/> + <#-- <#assign dummy=Static["org.ofbiz.base.util.Debug"].logInfo("in viewcontent, nodeTrailCsv:" + nodeTrailCsv, "")/> --> + <#if ancestorList?has_content && (0 < ancestorList?size) > + <#assign lastContent=ancestorList?last /> + <#assign firstContent=ancestorList[0] /> + + <#if firstContent?has_content> + <#assign siteId = firstContent.contentId/> + + <#if siteId?has_content> + <@renderAncestryPath trail=ancestorList?default([]) endIndexOffset=1 siteId=siteId/> + + + <#if lastContent?has_content> +

    [${lastContent.contentId}] ${lastContent.description!}

    + + <#-- + <#assign globalNodeTrail=[]/> + <#assign firstContentId=""/> + <#if nodeTrailCsv?has_content> + <#assign globalNodeTrail=Static["org.ofbiz.base.util.StringUtil"].split(nodeTrailCsv, ",") /> + <#if 0 < globalNodeTrail?size> + <#assign firstContentId=globalNodeTrail[0]?string/> + + + <#assign globalNodeTrail=requestParameters.globalNodeTrail?default([])/> + --> + <#if globalNodeTrail?has_content && (0 < globalNodeTrail?size) > + <#assign lastNode = globalNodeTrail?last/> + <#if lastNode?has_content> + <#assign subContent=lastNode.value/> + + <#else> + <#assign subContent = delegator.findOne("Content", Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId", subContentId), true)/> + + <#assign dummy=Static["org.ofbiz.base.util.Debug"].logInfo("in viewcontent, subContent:" + subContent, "")/> +

    ${subContent.contentName!}

    +
    +
    + + + + + + + <#assign thisContentId = subContentId/> + <@loopSubContent contentId=thisContentId viewIndex=0 viewSize=9999 contentAssocTypeId="RELATED_CONTENT"> + <#assign thisNodeTrailCsv = nodeTrailCsv /> + + + + +
      + <@renderSubContentCache subContentId=subContentId /> + + <#-- + <@wrapSubContentCache subContentId=subContentId wrapTemplateId="WRAP_VIEW" > + + <@checkPermission mode="equals" entityOperation="_CREATE" targetOperation="HAS_USER_ROLE" > + Respond + + --> +
    +
    + ${content.contentName!} +
    +
    +
    +
    +<#-- +<@checkPermission mode="not-equals" subContentId=subContentId targetOperation="CONTENT_CREATE|CONTENT_RESPOND" contentPurposeList="RESPONSE" > + ${permissionErrorMsg!} + +--> + + + +<#macro renderAncestryPath trail siteId startIndex=0 endIndexOffset=0 buttonTitle="Back to" searchOn="" > + <#local indent = ""> + <#local csv = ""> + <#local counter = 0> + <#local len = trail?size> + + <#list trail as content> + <#if counter < (len - endIndexOffset) && startIndex <= counter > + <#if 0 < counter > + <#local csv = csv + ","/> + + <#local csv = csv + content.contentId/> + <#if counter < len && startIndex <= counter > + + + + + <#local counter = counter + 1> + <#if 20 < counter > <#break/> + +
    + ${indent} + <#if content.contentTypeId == "WEB_SITE_PUB_PT" > + ${uiLabelMap.CommonBackTo}  ${content.contentName!} + <#else> + ${uiLabelMap.CommonBackTo}  ${content.contentName!} + + <#local indent = indent + "    "> + [${content.contentId!}] + <#if searchOn?has_content && searchOn?lower_case == "true"> +   + ${uiLabelMap.CommonSearch} + + +
    + diff --git a/template/customer/AccountCMPostalAddress.ftl b/template/customer/AccountCMPostalAddress.ftl new file mode 100644 index 0000000..e4b4a15 --- /dev/null +++ b/template/customer/AccountCMPostalAddress.ftl @@ -0,0 +1,19 @@ +<#assign postalAddress = partyContactMechValueMap.postalAddress! /> + <#if postalAddress??> + <#if postalAddress.toName?has_content>${uiLabelMap.CommonTo}: ${postalAddress.toName}
    + <#if postalAddress.attnName?has_content>${uiLabelMap.PartyAddrAttnName}: ${postalAddress.attnName}
    + ${postalAddress.address1}
    + <#if postalAddress.address2?has_content>${postalAddress.address2}
    + ${postalAddress.city}<#if postalAddress.stateProvinceGeoId?has_content>, ${postalAddress.stateProvinceGeoId} ${postalAddress.postalCode!} + <#if postalAddress.countryGeoId?has_content>
    ${postalAddress.countryGeoId} + <#if (!postalAddress.countryGeoId?has_content || postalAddress.countryGeoId! = "USA")> + <#assign addr1 = postalAddress.address1! /> + <#if (addr1.indexOf(" ") > 0)> + <#assign addressNum = addr1.substring(0, addr1.indexOf(" ")) /> + <#assign addressOther = addr1.substring(addr1.indexOf(" ")+1) /> + (${uiLabelMap.CommonLookupWhitepages}) + + + <#else> + ${uiLabelMap.PartyPostalInformationNotFound}. + \ No newline at end of file diff --git a/template/customer/AccountCMTelecom.ftl b/template/customer/AccountCMTelecom.ftl new file mode 100644 index 0000000..c67ec0c --- /dev/null +++ b/template/customer/AccountCMTelecom.ftl @@ -0,0 +1,10 @@ +<#assign telecomNumber = partyContactMechValueMap.telecomNumber!> +
    + <#if telecomNumber??> + ${telecomNumber.countryCode!} + <#if telecomNumber.areaCode?has_content>${telecomNumber.areaCode}-${telecomNumber.contactNumber!} + <#if partyContactMech.extension?has_content>ext ${partyContactMech.extension} + <#else> + ${uiLabelMap.PartyPhoneNumberInfoNotFound}. + +
    \ No newline at end of file diff --git a/template/customer/AccountCMWebAddress.ftl b/template/customer/AccountCMWebAddress.ftl new file mode 100644 index 0000000..a0385a5 --- /dev/null +++ b/template/customer/AccountCMWebAddress.ftl @@ -0,0 +1,6 @@ +
    + ${contactMech.infoString} + <#assign openAddress = contactMech.infoString! /> + <#if !openAddress.startsWith("http") && !openAddress.startsWith("HTTP")><#assign openAddress = "http://" + openAddress /> + (${uiLabelMap.CommonOpenNewWindow}) +
    \ No newline at end of file diff --git a/template/customer/AccountCards.ftl b/template/customer/AccountCards.ftl new file mode 100644 index 0000000..9309f13 --- /dev/null +++ b/template/customer/AccountCards.ftl @@ -0,0 +1,119 @@ + +
    + +
    + + + + +
    + <#if paymentMethodValueMaps?has_content> + + <#list paymentMethodValueMaps as paymentMethodValueMap> + <#assign paymentMethod = paymentMethodValueMap.paymentMethod! /> + <#assign creditCard = paymentMethodValueMap.creditCard! /> + <#assign giftCard = paymentMethodValueMap.giftCard! /> + <#assign eftAccount = paymentMethodValueMap.eftAccount! /> + + <#if paymentMethod.paymentMethodTypeId! == "CREDIT_CARD"> + + + + <#elseif paymentMethod.paymentMethodTypeId! == "GIFT_CARD"> + <#if giftCard?has_content && giftCard.cardNumber?has_content> + <#assign giftCardNumber = "" /> + <#assign pcardNumber = giftCard.cardNumber /> + <#if pcardNumber?has_content> + <#assign psize = pcardNumber?length - 4 /> + <#if (0 < psize)> + <#list 0 .. psize-1 as foo> + <#assign giftCardNumber = giftCardNumber + "*" /> + + <#assign giftCardNumber = giftCardNumber + pcardNumber[psize .. psize + 3] /> + <#else> + <#assign giftCardNumber = pcardNumber /> + + + + + + + + <#elseif paymentMethod.paymentMethodTypeId! == "EFT_ACCOUNT"> + + + + + + + + +
    +
    + ${uiLabelMap.AccountingCreditCard}: + <#if creditCard.companyNameOnCard?has_content>${creditCard.companyNameOnCard}  + <#if creditCard.titleOnCard?has_content>${creditCard.titleOnCard}  + ${creditCard.firstNameOnCard}  + <#if creditCard.middleNameOnCard?has_content>${creditCard.middleNameOnCard}  + ${creditCard.lastNameOnCard} + <#if creditCard.suffixOnCard?has_content> ${creditCard.suffixOnCard} +  ${Static["org.ofbiz.party.contact.ContactHelper"].formatCreditCard(creditCard)} + <#if paymentMethod.description?has_content>(${paymentMethod.description}) + <#if paymentMethod.fromDate?has_content>(${uiLabelMap.CommonUpdated}: ${paymentMethod.fromDate.toString()}) + <#if paymentMethod.thruDate??>(${uiLabelMap.CommonDelete}: ${paymentMethod.thruDate.toString()}) +
    +
      + + ${uiLabelMap.CommonUpdate} + + +
    + ${uiLabelMap.AccountingGiftCard}: ${giftCardNumber} + <#if paymentMethod.description?has_content>(${paymentMethod.description}) + <#if paymentMethod.fromDate?has_content>(${uiLabelMap.CommonUpdated}: ${paymentMethod.fromDate.toString()}) + <#if paymentMethod.thruDate??>(${uiLabelMap.CommonDelete}: ${paymentMethod.thruDate.toString()}) +
    +
      + + ${uiLabelMap.CommonUpdate} + +
    + ${uiLabelMap.AccountingEFTAccount}: <#if eftAccount.accountNumber?has_content>${eftAccount.accountNumber} +
    ${eftAccount.nameOnAccount!} + <#if eftAccount.bankName?has_content>
    ${uiLabelMap.AccountingBank}: ${eftAccount.bankName} + <#if paymentMethod.description?has_content>(${paymentMethod.description}) + <#if paymentMethod.fromDate?has_content>
    ${uiLabelMap.CommonUpdated}: ${paymentMethod.fromDate.toString()} + <#if paymentMethod.thruDate??>
    ${uiLabelMap.CommonDelete}: ${paymentMethod.thruDate.toString()} +
    +
      + + ${uiLabelMap.CommonUpdate} + + + ${uiLabelMap.CommonExpire} + + <#if (profiledefs.defaultPayMeth)?default("") == paymentMethod.paymentMethodId> + ${uiLabelMap.EcommerceIsDefault} + <#else> +
    + + + + +
    + +
    + <#else> + ${uiLabelMap.AccountingNoPaymentMethodInformation}. + +
    +
    +
    + \ No newline at end of file diff --git a/template/customer/AccountContactList.ftl b/template/customer/AccountContactList.ftl new file mode 100644 index 0000000..a081da3 --- /dev/null +++ b/template/customer/AccountContactList.ftl @@ -0,0 +1,96 @@ +
    +

    ${uiLabelMap.PartyContactLists}

    +
    + + + + <#-- --> + + + + + + + + <#list contactListPartyList as contactListParty> + <#assign contactList = contactListParty.getRelatedOne("ContactList", false)! /> + <#assign statusItem = contactListParty.getRelatedOne("StatusItem", true)! /> + <#assign emailAddress = contactListParty.getRelatedOne("PreferredContactMech", true)! /> + <#-- <#assign contactListType = contactList.getRelatedOne("ContactListType", true)/> --> + + + + <#-- --> + + + + + + + + +
    ${uiLabelMap.EcommerceListName}${uiLabelMap.OrderListType}${uiLabelMap.CommonFromDate}${uiLabelMap.CommonThruDate}${uiLabelMap.CommonStatus}${uiLabelMap.CommonEmail}  
    ${contactList.contactListName!}<#if contactList.description?has_content> - ${contactList.description}
    ${contactListType.get("description",locale)!}
    ${contactListParty.fromDate!}${contactListParty.thruDate!}${(statusItem.get("description",locale))!}${emailAddress.infoString!}  + <#if (contactListParty.statusId! == "CLPT_ACCEPTED")> +
    +
    + <#assign productStoreId = Static["org.ofbiz.product.store.ProductStoreWorker"].getProductStoreId(request) /> + + + + + + + +
    +
    + <#elseif (contactListParty.statusId! == "CLPT_PENDING")> +
    +
    + + + + + + + +
    +
    + <#elseif (contactListParty.statusId! == "CLPT_REJECTED")> +
    +
    + + + + + + +
    +
    + +
    +
    +
    +
    + + + ${uiLabelMap.EcommerceNewListSubscription}: + + + +
    +
    +
    + +
    +
    \ No newline at end of file diff --git a/template/customer/AccountContactMechs.ftl b/template/customer/AccountContactMechs.ftl new file mode 100644 index 0000000..debbe5a --- /dev/null +++ b/template/customer/AccountContactMechs.ftl @@ -0,0 +1,91 @@ +
    +
    +

    ${uiLabelMap.PartyContactInformation}

    + +
    +
    + <#if partyContactMechValueMaps?has_content> + + + + + + + + + + + <#list partyContactMechValueMaps as partyContactMechValueMap> + <#assign contactMech = partyContactMechValueMap.contactMech! /> + <#assign contactMechType = partyContactMechValueMap.contactMechType! /> + <#assign partyContactMech = partyContactMechValueMap.partyContactMech! /> + + + + + + + + + + + + + + + +
    ${uiLabelMap.PartyContactType}${uiLabelMap.CommonInformation}${uiLabelMap.CommonInformation}${uiLabelMap.PartySolicitingOk}?
    + ${contactMechType.get("description",locale)} +   + <#if contactMech.contactMechTypeId! = "POSTAL_ADDRESS"> + <#include "AccountCMPostalAddress.ftl" /> + <#elseif contactMech.contactMechTypeId! = "TELECOM_NUMBER"> + <#include "AccountCMTelecom.ftl" /> + <#elseif contactMech.contactMechTypeId! = "EMAIL_ADDRESS"> + ${contactMech.infoString} + <#elseif contactMech.contactMechTypeId! = "WEB_ADDRESS"> + <#include "AccountCMWebAddress.ftl" /> + <#else> + ${contactMech.infoString!} + +
    (${uiLabelMap.CommonUpdated}: ${partyContactMech.fromDate.toString()})
    + <#if partyContactMech.thruDate??>
    ${uiLabelMap.CommonDelete}: ${partyContactMech.thruDate.toString()}
    +
    + <#list partyContactMechValueMap.partyContactMechPurposes! as partyContactMechPurpose> + <#assign contactMechPurposeType = partyContactMechPurpose.getRelatedOne("ContactMechPurposeType", true) /> +
    + <#if contactMechPurposeType??> + ${contactMechPurposeType.get("description",locale)} + <#if contactMechPurposeType.contactMechPurposeTypeId == "SHIPPING_LOCATION" && (profiledefs.defaultShipAddr)?default("") == contactMech.contactMechId> + ${uiLabelMap.EcommerceIsDefault} + <#elseif contactMechPurposeType.contactMechPurposeTypeId == "SHIPPING_LOCATION"> +
    + + + + +
    + + <#else> + ${uiLabelMap.PartyPurposeTypeNotFound}: "${partyContactMechPurpose.contactMechPurposeTypeId}" + + <#if partyContactMechPurpose.thruDate??>(${uiLabelMap.CommonExpire}:${partyContactMechPurpose.thruDate.toString()}) +
    + +
    (${partyContactMech.allowSolicitation!})
      + ${uiLabelMap.CommonUpdate} + +
    + +
    +
     
    + <#else> +
    + +
    +
    \ No newline at end of file diff --git a/template/customer/AccountDefaultShipMethod.ftl b/template/customer/AccountDefaultShipMethod.ftl new file mode 100644 index 0000000..c5bf4af --- /dev/null +++ b/template/customer/AccountDefaultShipMethod.ftl @@ -0,0 +1,29 @@ +
    +
    + +
    + +

    ${uiLabelMap.EcommerceDefaultShipmentMethod}

    +
    + + <#if profiledefs?has_content && profiledefs.defaultShipAddr?has_content && carrierShipMethods?has_content> + <#list carrierShipMethods as shipMeth> + <#assign shippingMethod = shipMeth.shipmentMethodTypeId + "@" + shipMeth.partyId /> + + + + + + + <#else> + + +
      +
    <#if shipMeth.partyId != "_NA_">${shipMeth.partyId!} ${shipMeth.get("description",locale)!}
    +
    checked="checked" />
    ${uiLabelMap.EcommerceDefaultShipmentMethodMsg}
    +
    +
    +
    +
    \ No newline at end of file diff --git a/template/customer/AccountFileMgt.ftl b/template/customer/AccountFileMgt.ftl new file mode 100644 index 0000000..6835baa --- /dev/null +++ b/template/customer/AccountFileMgt.ftl @@ -0,0 +1,61 @@ +
    +

    ${uiLabelMap.EcommerceFileManager}

    +
    + + <#if partyContent?has_content> + <#list partyContent as contentRole> + <#assign content = contentRole.getRelatedOne("Content", false) /> + <#assign contentType = content.getRelatedOne("ContentType", true) /> + <#assign mimeType = content.getRelatedOne("MimeType", true)! /> + <#assign status = content.getRelatedOne("StatusItem", true) /> + + + + + + + + + + + <#else> + + +
    ${content.contentId}${content.contentName!}${(contentType.get("description",locale))!}${(mimeType.description)!}${(status.get("description",locale))!}${contentRole.fromDate!} +
    + + + +
    + ${uiLabelMap.CommonView} + ${uiLabelMap.CommonRemove} +
    ${uiLabelMap.EcommerceNoFiles}
    +
     
    + +
    +
    +
    + + + + + + + + + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/template/customer/AccountLoyalityPoints.ftl b/template/customer/AccountLoyalityPoints.ftl new file mode 100644 index 0000000..044f993 --- /dev/null +++ b/template/customer/AccountLoyalityPoints.ftl @@ -0,0 +1,12 @@ + +
    +
    +

    ${uiLabelMap.EcommerceLoyaltyPoints}

    +
    +
    + <#if monthsToInclude?? && totalSubRemainingAmount?? && totalOrders??> + + +
    +
    + diff --git a/template/customer/AccountMessages.ftl b/template/customer/AccountMessages.ftl new file mode 100644 index 0000000..f19ac87 --- /dev/null +++ b/template/customer/AccountMessages.ftl @@ -0,0 +1,9 @@ + +
    +
    +

    ${uiLabelMap.CommonMessages}

    +
    +
    + ${screens.render("component://${activeApp}/widget/CustomerScreens.xml#messagelist-include")} +
    +
    diff --git a/template/customer/AccountName.ftl b/template/customer/AccountName.ftl new file mode 100644 index 0000000..6a4505d --- /dev/null +++ b/template/customer/AccountName.ftl @@ -0,0 +1,72 @@ + +
    + +
    + <#if person??> + + + + + + + + + + + + + + + + <#if person.nickname?has_content> + + + <#if person.gender?has_content> + + + <#if person.birthDate??> + + + <#if person.height??> + + + <#if person.weight??> + + + <#if person.mothersMaidenName?has_content> + + + <#if person.maritalStatus?has_content> + + + <#if person.socialSecurityNumber?has_content> + + + <#if person.passportNumber?has_content> + + + <#if person.passportExpireDate??> + + + <#if person.totalYearsWorkExperience??> + + + <#if person.comments?has_content> + + +
    ${uiLabelMap.CommonId}${partyId!}
    ${uiLabelMap.PartyFirstName}${person.firstName!}
    ${uiLabelMap.PartyMiddleName}${person.middleName!}
    ${uiLabelMap.PartyLastName}${person.lastName!} + ${person.personalTitle!} + ${person.suffix!} +
    ${uiLabelMap.PartyNickName}${person.nickname}
    ${uiLabelMap.PartyGender}${person.gender}
    ${uiLabelMap.PartyBirthDate}${person.birthDate.toString()}
    ${uiLabelMap.PartyHeight}${person.height}
    ${uiLabelMap.PartyWeight}${person.weight}
    ${uiLabelMap.PartyMaidenName}${person.mothersMaidenName}
    ${uiLabelMap.PartyMaritalStatus}${person.maritalStatus}
    ${uiLabelMap.PartySocialSecurityNumber}${person.socialSecurityNumber}
    ${uiLabelMap.PartyPassportNumber}${person.passportNumber}
    ${uiLabelMap.PartyPassportExpireDate}${person.passportExpireDate.toString()}
    ${uiLabelMap.PartyYearsWork}${person.totalYearsWorkExperience}
    ${uiLabelMap.CommonComments}${person.comments}
    + <#else> + + +
    +
    diff --git a/template/customer/AccountSurveys.ftl b/template/customer/AccountSurveys.ftl new file mode 100644 index 0000000..5a42cba --- /dev/null +++ b/template/customer/AccountSurveys.ftl @@ -0,0 +1,33 @@ + +
    +
    +

    ${uiLabelMap.CommonSurveys}

    +
    +
    + <#if surveys?has_content> + + <#list surveys as surveyAppl> + <#assign survey = surveyAppl.getRelatedOne("Survey", false) /> + + + + + + <#if (responses == 0 || survey.allowMultiple?default("N") == "Y")> + <#assign surveyLabel = uiLabelMap.EcommerceTakeSurvey /> + <#if (responses > 0 && survey.allowUpdate?default("N") == "Y")> + <#assign surveyLabel = uiLabelMap.EcommerceUpdateSurvey /> + + + <#else> +   + + + +
     
    ${survey.surveyName!} - ${survey.description!}
      + <#assign responses = Static["org.ofbiz.product.store.ProductStoreWorker"].checkSurveyResponse(request, survey.surveyId)?default(0)> + <#if (responses < 1)>${uiLabelMap.EcommerceNotCompleted}<#else>${uiLabelMap.EcommerceCompleted} + ${surveyLabel}
    + +
    +
    \ No newline at end of file diff --git a/template/customer/AccountTax.ftl b/template/customer/AccountTax.ftl new file mode 100644 index 0000000..ed73c37 --- /dev/null +++ b/template/customer/AccountTax.ftl @@ -0,0 +1,12 @@ +
    +

    ${uiLabelMap.PartyTaxIdentification}

    +
    +
    +
    + + ${screens.render("component://order/widget/ordermgr/OrderEntryOrderScreens.xml#customertaxinfo")} + +
    +
    +
    +
    diff --git a/template/customer/AccountTelco.ftl b/template/customer/AccountTelco.ftl new file mode 100644 index 0000000..e69de29 diff --git a/template/customer/AccountUserName.ftl b/template/customer/AccountUserName.ftl new file mode 100644 index 0000000..6196065 --- /dev/null +++ b/template/customer/AccountUserName.ftl @@ -0,0 +1,15 @@ +
    + +

    ${uiLabelMap.CommonUsername} & ${uiLabelMap.CommonPassword}

    +
    + + + + + + +
    ${uiLabelMap.CommonUsername} ${userLogin.userLoginId}
    +
    +
    diff --git a/template/customer/AnonContactus.ftl b/template/customer/AnonContactus.ftl new file mode 100644 index 0000000..fa30cbe --- /dev/null +++ b/template/customer/AnonContactus.ftl @@ -0,0 +1,80 @@ +<#-- +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. +--> + +
    +
    +

    ${uiLabelMap.CommonContactUs}

    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ${uiLabelMap.EcommerceSubject}*
    ${uiLabelMap.CommonMessage}*
    ${uiLabelMap.FormFieldTitle_emailAddress}*
    ${uiLabelMap.PartyFirstName}
    ${uiLabelMap.PartyLastName}
    ${uiLabelMap.CommonCaptchaCode}
    ${uiLabelMap.CommonReloadCaptchaCode}
    ${uiLabelMap.CommonVerifyCaptchaCode}*
    +
    +
    +
    diff --git a/template/customer/FinAccountDetail.ftl b/template/customer/FinAccountDetail.ftl new file mode 100644 index 0000000..73a1b5f --- /dev/null +++ b/template/customer/FinAccountDetail.ftl @@ -0,0 +1,106 @@ +<#-- +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. +--> + + + + + + + + + + + + + + + + + + + <#if ownedFinAccount.replenishLevel??> + + + + + +
    Account Number:
    ${ownedFinAccount.finAccountId}
    Currency:
    ${(accountCurrencyUom.description)!} [${ownedFinAccount.currencyUomId!}]
    Date Opened:
    ${ownedFinAccount.fromDate!}
    Status:
    ${(finAccountStatusItem.description)?default("Active")}
    Replenish Level:
    ${ownedFinAccount.replenishLevel}
    + + + + + + + + + + + <#list ownedFinAccountTransList as ownedFinAccountTrans> + <#assign finAccountTransType = ownedFinAccountTrans.getRelatedOne("FinAccountTransType", false)/> + <#assign displayAmount = ownedFinAccountTrans.amount/> + <#if ownedFinAccountTrans.finAccountTransTypeId == "WITHDRAWAL"> + <#assign displayAmount = -displayAmount/> + + + + + + + + + + + + + + + + +
    Transaction ${uiLabelMap.CommonDate}IDOrder ItemPaymentTypeAmount
    ${ownedFinAccountTrans.transactionDate!}${ownedFinAccountTrans.finAccountTransId}<#if ownedFinAccountTrans.orderId?has_content>${ownedFinAccountTrans.orderId!}:${ownedFinAccountTrans.orderItemSeqId!}<#else> <#if ownedFinAccountTrans.paymentId?has_content>${ownedFinAccountTrans.paymentId!}<#else> ${finAccountTransType.description?default(ownedFinAccountTrans.finAccountTransTypeId)!}<@ofbizCurrency amount=displayAmount isoCode=ownedFinAccount.currencyUomId/>
    Actual Balance  <@ofbizCurrency amount=ownedFinAccount.actualBalance isoCode=ownedFinAccount.currencyUomId/>
    + +<#if ownedFinAccountAuthList?has_content> + + + + + + + + + + + + + + <#list ownedFinAccountAuthList as ownedFinAccountAuth> + + + + + + + + + + + + + +
    Authorization ${uiLabelMap.CommonDate}IDExpiresAmount
    Actual Balance  <@ofbizCurrency amount=ownedFinAccount.actualBalance isoCode=ownedFinAccount.currencyUomId/>
    ${ownedFinAccountAuth.authorizationDate!}${ownedFinAccountAuth.finAccountAuthId}${ownedFinAccountAuth.thruDate!}<@ofbizCurrency amount=-ownedFinAccountAuth.amount isoCode=ownedFinAccount.currencyUomId/>
    Available Balance  <@ofbizCurrency amount=ownedFinAccount.availableBalance isoCode=ownedFinAccount.currencyUomId/>
    + diff --git a/template/customer/MyAccountMenu.ftl b/template/customer/MyAccountMenu.ftl new file mode 100644 index 0000000..3c5c69b --- /dev/null +++ b/template/customer/MyAccountMenu.ftl @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/template/customer/NewCustomerAccount.ftl b/template/customer/NewCustomerAccount.ftl new file mode 100644 index 0000000..297adfc --- /dev/null +++ b/template/customer/NewCustomerAccount.ftl @@ -0,0 +1,58 @@ + +
    + <#if getUsername>${uiLabelMap.CommonUsername} + <#if getUsername> + <@fieldErrors fieldName="USERNAME"/> +
    +
    + +
    +
    + <#if requestParameters.preferredUsername?has_content> + + + <#else> + + +
    + +
    + +
    + ${uiLabelMap.CommonPassword} + <#if createAllowPassword> +
    +
    + +
    +
    + <@fieldErrors fieldName="PASSWORD"/> + +
    +
    +
    +
    + +
    +
    + <@fieldErrors fieldName="CONFIRM_PASSWORD"/> + +
    +
    +
    +
    + +
    +
    + <@fieldErrors fieldName="PASSWORD_HINT"/> + +
    +
    + <#else/> +
    +
    +
    +
    + + +
    \ No newline at end of file diff --git a/template/customer/NewCustomerAddress.ftl b/template/customer/NewCustomerAddress.ftl new file mode 100644 index 0000000..aabc87d --- /dev/null +++ b/template/customer/NewCustomerAddress.ftl @@ -0,0 +1,79 @@ +
    + ${uiLabelMap.PartyShippingAddress} +
    +
    + +
    +
    + <@fieldErrors fieldName="CUSTOMER_ADDRESS1"/> + +
    +
    +
    +
    + +
    +
    + <@fieldErrors fieldName="CUSTOMER_ADDRESS2"/> + +
    +
    +
    +
    + +
    +
    + <@fieldErrors fieldName="CUSTOMER_CITY"/> + +
    +
    +
    +
    + +
    +
    + <@fieldErrors fieldName="CUSTOMER_POSTAL_CODE"/> + +
    +
    +
    +
    + +
    +
    + <@fieldErrors fieldName="CUSTOMER_COUNTRY"/> + +
    +
    +
    +
    + +
    +
    + <@fieldErrors fieldName="CUSTOMER_STATE"/> + +
    +
    +
    +
    + +
    +
    + <@fieldErrors fieldName="CUSTOMER_ADDRESS_ALLOW_SOL"/> + +
    +
    +
    \ No newline at end of file diff --git a/template/customer/NewCustomerEmail.ftl b/template/customer/NewCustomerEmail.ftl new file mode 100644 index 0000000..bd5358e --- /dev/null +++ b/template/customer/NewCustomerEmail.ftl @@ -0,0 +1,27 @@ + +
    + ${uiLabelMap.PartyEmailAddress} +
    +
    + +
    +
    + <@fieldErrors fieldName="CUSTOMER_EMAIL"/> + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    \ No newline at end of file diff --git a/template/customer/NewCustomerName.ftl b/template/customer/NewCustomerName.ftl new file mode 100644 index 0000000..f2edb27 --- /dev/null +++ b/template/customer/NewCustomerName.ftl @@ -0,0 +1,41 @@ +
    + ${uiLabelMap.PartyFullName} +
    +
    + +
    +
    + <@fieldErrors fieldName="USER_TITLE"/> + +
    +
    +
    +
    + +
    +
    + <@fieldErrors fieldName="USER_FIRST_NAME"/> + +
    +
    +
    +
    + +
    +
    + <@fieldErrors fieldName="USER_LAST_NAME"/> + +
    +
    +
    \ No newline at end of file diff --git a/template/customer/NewCustomerTelco.ftl b/template/customer/NewCustomerTelco.ftl new file mode 100644 index 0000000..f1aa985 --- /dev/null +++ b/template/customer/NewCustomerTelco.ftl @@ -0,0 +1,51 @@ +
    + ${uiLabelMap.PartyPhoneNumbers} +
    +
    + +
    +
    + <@fieldErrors fieldName="CUSTOMER_HOME_CONTACT"/> + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + <@fieldErrors fieldName="CUSTOMER_MOBILE_CONTACT"/> + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    diff --git a/template/customer/SerializedInventorySummary.ftl b/template/customer/SerializedInventorySummary.ftl new file mode 100644 index 0000000..faf59d1 --- /dev/null +++ b/template/customer/SerializedInventorySummary.ftl @@ -0,0 +1,62 @@ +<#-- +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. +--> + +
    +
    + ${uiLabelMap.ProductSerializedInventorySummary} +
    +
    + + + + + + + + + + + + + <#list inventoryItemList as inventoryItem> + <#assign product = inventoryItem.getRelatedOne('Product', false)!> + + + + + + + + + + +
    ${uiLabelMap.ProductInventoryItemId}
    ${uiLabelMap.ProductProductName}
    ${uiLabelMap.ProductSerialNumber}
    ${uiLabelMap.ProductSoftIdentifier}
    ${uiLabelMap.ProductActivationNumber}
    ${uiLabelMap.ProductActivationNumber} ${uiLabelMap.CommonValidThruDate}
    ${inventoryItem.inventoryItemId} + <#if product?has_content> + <#if product.isVariant?default('N') == 'Y'> + <#assign product = Static['org.ofbiz.product.product.ProductWorker'].getParentProduct(product.productId, delegator)!> + + <#if product?has_content> + <#assign productName = Static['org.ofbiz.product.product.ProductContentWrapper'].getProductContentAsText(product, 'PRODUCT_NAME', request, "html")!> + ${productName?default(product.productId)} + + + ${inventoryItem.serialNumber!}${inventoryItem.softIdentifier!}${inventoryItem.activationNumber!}${inventoryItem.activationValidThru!}
    +
    +
    + diff --git a/template/customer/SubscriptionSummary.ftl b/template/customer/SubscriptionSummary.ftl new file mode 100644 index 0000000..37828cd --- /dev/null +++ b/template/customer/SubscriptionSummary.ftl @@ -0,0 +1,61 @@ +<#-- +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. +--> + +
    +
    + ${uiLabelMap.ProductSubscriptions} +
    +
    + + + + + + + + + + + + + + <#list subscriptionList as subscription> + + + + + + + + + + +
    ${uiLabelMap.ProductSubscription} ${uiLabelMap.CommonId}
    ${uiLabelMap.ProductSubscription} ${uiLabelMap.CommonType}
    ${uiLabelMap.CommonDescription}
    ${uiLabelMap.ProductProductName}
    ${uiLabelMap.CommonFromDate}
    ${uiLabelMap.CommonThruDate}

    ${subscription.subscriptionId} + <#assign subscriptionType = subscription.getRelatedOne('SubscriptionType', false)!> + ${(subscriptionType.description)?default(subscription.subscriptionTypeId?default('N/A'))} + ${subscription.description!} + <#assign product = subscription.getRelatedOne('Product', false)!> + <#if product?has_content> + <#assign productName = Static['org.ofbiz.product.product.ProductContentWrapper'].getProductContentAsText(product, 'PRODUCT_NAME', request, "html")!> + ${productName?default(product.productId)} + + ${subscription.fromDate!}${subscription.thruDate!}
    +
    +
    + diff --git a/template/customer/changepassword.ftl b/template/customer/changepassword.ftl new file mode 100644 index 0000000..7e4bac9 --- /dev/null +++ b/template/customer/changepassword.ftl @@ -0,0 +1,49 @@ +<#-- +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. +--> +
    +

    ${uiLabelMap.PartyChangePassword}

    +  ${uiLabelMap.CommonGoBack} +  ${uiLabelMap.CommonSave} +

    +

    +
    +
    +
    + + * +
    +
    + + * +
    +
    + + * +
    +
    + + +
    + +
    +
    + [${uiLabelMap.CommonGoBack}] + [${uiLabelMap.CommonSave}] +
    +
    \ No newline at end of file diff --git a/template/customer/customersurvey.ftl b/template/customer/customersurvey.ftl new file mode 100644 index 0000000..9669541 --- /dev/null +++ b/template/customer/customersurvey.ftl @@ -0,0 +1,34 @@ +<#-- +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. +--> + +
    +
    +
    ${survey.surveyName}
    +
    +
    + <#-- Render the survey --> + <#if surveyWrapper?has_content> +
    + ${surveyWrapper.render()} +
    + <#else> +

    ${uiLabelMap.OrderNothingToDoHere}

    + +
    +
    diff --git a/template/customer/digitalproductedit.ftl b/template/customer/digitalproductedit.ftl new file mode 100644 index 0000000..ba4b261 --- /dev/null +++ b/template/customer/digitalproductedit.ftl @@ -0,0 +1,104 @@ +<#-- +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. +--> + +<#assign productPrice = productPriceList[0]!/> + +
    +
    +
    ${uiLabelMap.PageTitleDigitalProductEdit}
    +
    +
    +<#if !supplierProduct?has_content && parameters.productId?has_content> +

    ${uiLabelMap.EcommerceMessage1} [${parameters.productId}] ${uiLabelMap.EcommerceMessage2}

    +<#else> + + <#if !supplierProduct??> +

    ${uiLabelMap.EcommerceAddNewDigitalProduct}

    +
    + + <#else> +

    ${uiLabelMap.EcommerceUpdateDigitalProduct}

    + + + + + + +  ${uiLabelMap.CommonBackToList} + + + + + + + + + + + + + + + + + + + + + + +
    ${uiLabelMap.ProductProductName}
     *
    ${uiLabelMap.ProductProductDescription}
     
    ${uiLabelMap.ProductPrice}
     *
     
     ${uiLabelMap.CommonSave}
    +
    + +
    +
    + +<#if supplierProduct?has_content> +
    +
    +
    ${uiLabelMap.OrderDigitalProductFiles}
    +
    +
    + <#list productContentAndInfoList as productContentAndInfo> +
    + ${productContentAndInfo.contentName} (${uiLabelMap.CommonSince}: ${productContentAndInfo.fromDate}) + ${uiLabelMap.CommonRemove} +
    + + +

    +
    ${uiLabelMap.EcommerceDigitalAddFromMyFiles}
    +
    +
    + + + + + + ${uiLabelMap.CommonAdd} +
    +
    +  ${uiLabelMap.CommonBackToList} +
    +
    + diff --git a/template/customer/digitalproductlist.ftl b/template/customer/digitalproductlist.ftl new file mode 100644 index 0000000..b958c1f --- /dev/null +++ b/template/customer/digitalproductlist.ftl @@ -0,0 +1,69 @@ +<#-- +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. +--> + +
    +
    +
    ${uiLabelMap.PageTitleDigitalProductList}
    +
    +
    + + + + + + + + + + <#list supplierProductList as supplierProduct> + <#assign product = supplierProduct.getRelatedOne("Product", true)/> + + + + + + + + + + <#if !supplierProductList?has_content> + + +
    +
    ${uiLabelMap.ProductProductName}
    +
      +
    ${uiLabelMap.CommonDescription}
    +
      

    +
    ${(product.productName)!}
    +
      +
    ${(product.description)!}
    +
      + Edit +

    ${uiLabelMap.EcommerceNoDigitalProductsFound}

    +
    +
    + +
    +
    +
    ${uiLabelMap.EcommerceDigitalProductPurchaseHistoryCommission}
    +
    + +
    diff --git a/template/customer/editcontactmech.ftl b/template/customer/editcontactmech.ftl new file mode 100644 index 0000000..fa89967 --- /dev/null +++ b/template/customer/editcontactmech.ftl @@ -0,0 +1,249 @@ +<#-- +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. +--> +<#if canNotView> +

    ${uiLabelMap.PartyContactInfoNotBelongToYou}.

    + ${uiLabelMap.CommonBack} +<#else> + <#if !contactMech??> + <#-- When creating a new contact mech, first select the type, then actually create --> + <#if !requestParameters.preContactMechTypeId?? && !preContactMechTypeId??> +

    ${uiLabelMap.PartyCreateNewContactInfo}

    +
    +
    + + + + + +
    ${uiLabelMap.PartySelectContactType}: +  ${uiLabelMap.CommonCreate} +
    +
    +
    + <#--

    ERROR: Contact information with ID "${contactMechId}" not found!

    --> + + + + <#if contactMechTypeId??> + <#if !contactMech??> +

    ${uiLabelMap.PartyCreateNewContactInfo}

    + ${uiLabelMap.CommonGoBack} + ${uiLabelMap.CommonSave} + + +
    + + <#if contactMechPurposeType??> +
    (${uiLabelMap.PartyNewContactHavePurpose} "${contactMechPurposeType.get("description",locale)!}")
    + + <#if cmNewPurposeTypeId?has_content> + <#if preContactMechTypeId?has_content> + <#if paymentMethodId?has_content> + <#else> +

    ${uiLabelMap.PartyEditContactInfo}

    + ${uiLabelMap.CommonGoBack} + ${uiLabelMap.CommonSave} +
    + + + + + + +
    + + + + + <#if contactMechTypeId = "POSTAL_ADDRESS"> +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <#elseif contactMechTypeId = "TELECOM_NUMBER"> + + + + + + + + + + + <#elseif contactMechTypeId = "EMAIL_ADDRESS"> + + + + + + <#else> + + + + + + + + + + + + + +
    ${uiLabelMap.PartyContactPurposes}  + + <#list partyContactMechPurposes! as partyContactMechPurpose> + <#assign contactMechPurposeType = partyContactMechPurpose.getRelatedOne("ContactMechPurposeType", true) /> + + + + + + <#if purposeTypes?has_content> + + + + + +
    + <#if contactMechPurposeType??> + ${contactMechPurposeType.get("description",locale)} + <#else> + ${uiLabelMap.PartyPurposeTypeNotFound}: "${partyContactMechPurpose.contactMechPurposeTypeId}" + + (${uiLabelMap.CommonSince}:${partyContactMechPurpose.fromDate.toString()}) + <#if partyContactMechPurpose.thruDate??>(${uiLabelMap.CommonExpires}:${partyContactMechPurpose.thruDate.toString()}) + + + + +
    +
    +
    + + + +
    +
    +
    ${uiLabelMap.PartyAddPurpose}
    +
    ${uiLabelMap.PartyToName}  + +
    ${uiLabelMap.PartyAttentionName}  + +
    ${uiLabelMap.PartyAddressLine1}  + + *
    ${uiLabelMap.PartyAddressLine2}  + +
    ${uiLabelMap.PartyCity}  + + *
    ${uiLabelMap.PartyState} +   + +
    ${uiLabelMap.PartyZipCode}  + + *
    ${uiLabelMap.CommonCountry}  + +
    ${uiLabelMap.PartyPhoneNumber}  + + -  + -  +  ${uiLabelMap.PartyExtension}  +
     [${uiLabelMap.CommonCountryCode}] [${uiLabelMap.PartyAreaCode}] [${uiLabelMap.PartyContactNumber}] [${uiLabelMap.PartyExtension}]
    ${uiLabelMap.PartyEmailAddress}  + + *
    ${contactMechType.get("description",locale)!}  + + *
    ${uiLabelMap.PartyAllowSolicitation}?  + +
    + + ${uiLabelMap.CommonGoBack} + ${uiLabelMap.CommonSave} + <#else> + ${uiLabelMap.CommonGoBack} + + diff --git a/template/customer/editcreditcard.ftl b/template/customer/editcreditcard.ftl new file mode 100644 index 0000000..1265eef --- /dev/null +++ b/template/customer/editcreditcard.ftl @@ -0,0 +1,142 @@ +<#-- +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. +--> + +<#if canNotView> +

    ${uiLabelMap.AccountingCardInfoNotBelongToYou}.

    +${uiLabelMap.CommonGoBack} +<#else> + <#if !creditCard??> +

    ${uiLabelMap.AccountingAddNewCreditCard}

    +
    +
    + <#else> +

    ${uiLabelMap.AccountingEditCreditCard}

    + +
    + + +  ${uiLabelMap.CommonGoBack} +  ${uiLabelMap.CommonSave} +

    + + ${screens.render("component://accounting/widget/CommonScreens.xml#creditCardFields")} + + + + + +
    ${uiLabelMap.PartyBillingAddress}  + <#-- Removed because is confusing, can add but would have to come back here with all data populated as before... + + [Create New Address]   + --> + + <#assign hasCurrent = false /> + <#if curPostalAddress?has_content> + <#assign hasCurrent = true /> + + + + + <#else> + <#-- + + --> + + <#-- is confusing + + + + --> + <#list postalAddressInfos as postalAddressInfo> + <#assign contactMech = postalAddressInfo.contactMech /> + <#assign partyContactMechPurposes = postalAddressInfo.partyContactMechPurposes /> + <#assign postalAddress = postalAddressInfo.postalAddress /> + <#assign partyContactMech = postalAddressInfo.partyContactMech /> + + + + + + <#if !postalAddressInfos?has_content && !curContactMech??> + + + + + + +
    + + + ${uiLabelMap.PartyUseCurrentAddress}: + <#list curPartyContactMechPurposes as curPartyContactMechPurpose> + <#assign curContactMechPurposeType = curPartyContactMechPurpose.getRelatedOne("ContactMechPurposeType", true) /> +
    + ${curContactMechPurposeType.get("description",locale)!} + <#if curPartyContactMechPurpose.thruDate??> + ((${uiLabelMap.CommonExpire}:${curPartyContactMechPurpose.thruDate.toString()}) + +
    + +
    + <#if curPostalAddress.toName??>${uiLabelMap.CommonTo}: ${curPostalAddress.toName}
    + <#if curPostalAddress.attnName??>${uiLabelMap.PartyAddrAttnName}: ${curPostalAddress.attnName}
    + ${curPostalAddress.address1!}
    + <#if curPostalAddress.address2??>${curPostalAddress.address2}
    + ${curPostalAddress.city}<#if curPostalAddress.stateProvinceGeoId?has_content>, ${curPostalAddress.stateProvinceGeoId} ${curPostalAddress.postalCode} + <#if curPostalAddress.countryGeoId??>
    ${curPostalAddress.countryGeoId} +
    (${uiLabelMap.CommonUpdated}: ${(curPartyContactMech.fromDate.toString())!})
    + <#if curPartyContactMech.thruDate??>
    ${uiLabelMap.CommonDelete}: ${curPartyContactMech.thruDate.toString()} +
    +
    +
    ${uiLabelMap.PartyBillingAddressNotSelected}
    +
    +
    ${uiLabelMap.EcommerceMessage3}
    +
    + + + <#list partyContactMechPurposes as partyContactMechPurpose> + <#assign contactMechPurposeType = partyContactMechPurpose.getRelatedOne("ContactMechPurposeType", true) /> +
    + ${contactMechPurposeType.get("description",locale)!} + <#if partyContactMechPurpose.thruDate??>(${uiLabelMap.CommonExpire}:${partyContactMechPurpose.thruDate}) +
    + +
    + <#if postalAddress.toName??>${uiLabelMap.CommonTo}: ${postalAddress.toName}
    + <#if postalAddress.attnName??>${uiLabelMap.PartyAddrAttnName}: ${postalAddress.attnName}
    + ${postalAddress.address1!}
    + <#if postalAddress.address2??>${postalAddress.address2}
    + ${postalAddress.city}<#if postalAddress.stateProvinceGeoId?has_content>, ${postalAddress.stateProvinceGeoId} ${postalAddress.postalCode} + <#if postalAddress.countryGeoId??>
    ${postalAddress.countryGeoId} +
    +
    (${uiLabelMap.CommonUpdated}: ${(partyContactMech.fromDate.toString())!})
    + <#if partyContactMech.thruDate??>
    ${uiLabelMap.CommonDelete}: ${partyContactMech.thruDate.toString()}
    +
    ${uiLabelMap.PartyNoContactInformation}.
    + checked="checked" /> + + ${uiLabelMap.PartyCreateNewBillingAddress}. +
    +
    +

    + +  ${uiLabelMap.CommonGoBack} +  ${uiLabelMap.CommonSave} + + diff --git a/template/customer/editeftaccount.ftl b/template/customer/editeftaccount.ftl new file mode 100644 index 0000000..0b61bb5 --- /dev/null +++ b/template/customer/editeftaccount.ftl @@ -0,0 +1,183 @@ +<#-- +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. +--> + +<#if canNotView> +

    ${uiLabelMap.AccountingEFTNotBelongToYou}.

    ${uiLabelMap.CommonGoBack} +<#else> + <#if !eftAccount??> +

    ${uiLabelMap.AccountingAddNewEftAccount}

    +
    + <#else> +

    ${uiLabelMap.PageTitleEditEFTAccount}

    + + + +  ${uiLabelMap.CommonGoBack} +  ${uiLabelMap.CommonSave} +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ${uiLabelMap.AccountingNameOnAccount}
      + + *
    ${uiLabelMap.AccountingCompanyNameOnAccount}
      + +
    ${uiLabelMap.AccountingBankName}
      + + *
    ${uiLabelMap.AccountingRoutingNumber}
      + + *
    ${uiLabelMap.AccountingAccountType}
      + + *
    ${uiLabelMap.AccountingAccountNumber}
      + + *
    ${uiLabelMap.CommonDescription}
      + +
    ${uiLabelMap.PartyBillingAddress}
      + <#-- Removed because is confusing, can add but would have to come back here with all data populated as before... + + [Create New Address]   + --> + + <#if curPostalAddress??> + + + + + <#else> + <#-- + + --> + + <#-- is confusing + + + + --> + <#list postalAddressInfos as postalAddressInfo> + <#assign contactMech = postalAddressInfo.contactMech> + <#assign partyContactMechPurposes = postalAddressInfo.partyContactMechPurposes> + <#assign postalAddress = postalAddressInfo.postalAddress> + <#assign partyContactMech = postalAddressInfo.partyContactMech> + + + + + + <#if !postalAddressInfos?has_content && !curContactMech??> + + +
    + + +
    ${uiLabelMap.PartyUseCurrentAddress}:
    + <#list curPartyContactMechPurposes as curPartyContactMechPurpose> + <#assign curContactMechPurposeType = curPartyContactMechPurpose.getRelatedOne("ContactMechPurposeType", true)> +
    + ${curContactMechPurposeType.get("description",locale)!} + <#if curPartyContactMechPurpose.thruDate??> + (${uiLabelMap.CommonExpire}:${curPartyContactMechPurpose.thruDate.toString()}) + +
    + +
    + <#if curPostalAddress.toName??>${uiLabelMap.CommonTo}: ${curPostalAddress.toName}
    + <#if curPostalAddress.attnName??>${uiLabelMap.PartyAddrAttnName}: ${curPostalAddress.attnName}
    + ${curPostalAddress.address1!}
    + <#if curPostalAddress.address2??>${curPostalAddress.address2}
    + ${curPostalAddress.city}<#if curPostalAddress.stateProvinceGeoId?has_content>, ${curPostalAddress.stateProvinceGeoId} ${curPostalAddress.postalCode} + <#if curPostalAddress.countryGeoId??>
    ${curPostalAddress.countryGeoId} +
    +
    (${uiLabelMap.CommonUpdated}: ${(curPartyContactMech.fromDate.toString())!})
    + <#if curPartyContactMech.thruDate??>
    ${uiLabelMap.CommonDelete}: ${curPartyContactMech.thruDate.toString()}
    +
    +
    ${uiLabelMap.PartyNoBillingAddress}
    +
    +
    ${uiLabelMap.EcommerceMessage3}
    +
    + + + <#list partyContactMechPurposes as partyContactMechPurpose> + <#assign contactMechPurposeType = partyContactMechPurpose.getRelatedOne("ContactMechPurposeType", true)> +
    + ${contactMechPurposeType.get("description",locale)!} + <#if partyContactMechPurpose.thruDate??>(${uiLabelMap.CommonExpire}:${partyContactMechPurpose.thruDate}) +
    + +
    + <#if postalAddress.toName??>${uiLabelMap.CommonTo}: ${postalAddress.toName}
    + <#if postalAddress.attnName??>${uiLabelMap.PartyAddrAttnName}: ${postalAddress.attnName}
    + ${postalAddress.address1!}
    + <#if postalAddress.address2??>${postalAddress.address2}
    + ${postalAddress.city}<#if postalAddress.stateProvinceGeoId?has_content>, ${postalAddress.stateProvinceGeoId} ${postalAddress.postalCode} + <#if postalAddress.countryGeoId??>
    ${postalAddress.countryGeoId} +
    +
    (${uiLabelMap.CommonUpdated}: ${(partyContactMech.fromDate.toString())!})
    + <#if partyContactMech.thruDate??>
    ${uiLabelMap.CommonDelete}: ${partyContactMech.thruDate.toString()}
    +
    ${uiLabelMap.PartyNoContactInformation}.
    +
    +

    +  ${uiLabelMap.CommonGoBack} +  ${uiLabelMap.CommonSave} + + diff --git a/template/customer/editgiftcard.ftl b/template/customer/editgiftcard.ftl new file mode 100644 index 0000000..a9d4cac --- /dev/null +++ b/template/customer/editgiftcard.ftl @@ -0,0 +1,113 @@ +<#-- +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. +--> + +<#if canNotView> +

    ${uiLabelMap.AccountingCardInfoNotBelongToYou}.

    [${uiLabelMap.CommonGoBack}] +<#else> + <#if !giftCard??> +

    ${uiLabelMap.AccountingAddNewGiftCard}

    +
    + <#else> +

    ${uiLabelMap.AccountingEditGiftCard}

    + + + +  ${uiLabelMap.CommonGoBack} +  ${uiLabelMap.CommonSave} +

    + + + + + + + + + + + + + + + + + + + + + +
    ${uiLabelMap.AccountingCardNumber}
      + <#if giftCardData?has_content && giftCardData.cardNumber?has_content> + <#assign pcardNumberDisplay = ""> + <#assign pcardNumber = giftCardData.cardNumber!> + <#if pcardNumber?has_content> + <#assign psize = pcardNumber?length - 4> + <#if 0 < psize> + <#list 0 .. psize-1 as foo> + <#assign pcardNumberDisplay = pcardNumberDisplay + "*"> + + <#assign pcardNumberDisplay = pcardNumberDisplay + pcardNumber[psize .. psize + 3]> + <#else> + <#assign pcardNumberDisplay = pcardNumber> + + + + +
    ${uiLabelMap.AccountingPINNumber}
      + +
    ${uiLabelMap.AccountingExpirationDate}
      + <#assign expMonth = ""> + <#assign expYear = ""> + <#if giftCardData?? && giftCardData.expireDate??> + <#assign expDate = giftCard.expireDate> + <#if (expDate?? && expDate.indexOf("/") > 0)> + <#assign expMonth = expDate.substring(0,expDate.indexOf("/"))> + <#assign expYear = expDate.substring(expDate.indexOf("/")+1)> + + + + +
    ${uiLabelMap.CommonDescription}
      + +
    +

    +  ${uiLabelMap.CommonGoBack} +  ${uiLabelMap.CommonSave} + diff --git a/template/customer/editperson.ftl b/template/customer/editperson.ftl new file mode 100644 index 0000000..68f8540 --- /dev/null +++ b/template/customer/editperson.ftl @@ -0,0 +1,178 @@ +<#-- +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. +--> +<#if person??> +

    ${uiLabelMap.PartyEditPersonalInformation}

    +  
    +<#else> +

    ${uiLabelMap.PartyAddNewPersonalInformation}

    +   + +
    +  ${uiLabelMap.CommonGoBack} +  ${uiLabelMap.CommonSave} +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ${uiLabelMap.CommonTitle} + +
    ${uiLabelMap.PartyFirstName} + + *
    ${uiLabelMap.PartyMiddleInitial} + +
    ${uiLabelMap.PartyLastName} + + *
    ${uiLabelMap.PartySuffix} + +
    ${uiLabelMap.PartyNickName} + +
    ${uiLabelMap.PartyGender} + +
    ${uiLabelMap.PartyBirthDate} + +
    ${uiLabelMap.CommonFormatDate}
    +
    ${uiLabelMap.PartyHeight} + +
    ${uiLabelMap.PartyWeight} + +
    ${uiLabelMap.PartyMaidenName} + +
    ${uiLabelMap.PartyMaritalStatus} + +
    ${uiLabelMap.PartySocialSecurityNumber} + +
    ${uiLabelMap.PartyPassportNumber} + +
    ${uiLabelMap.PartyPassportExpireDate} + +
    ${uiLabelMap.CommonFormatDate}
    +
    ${uiLabelMap.PartyTotalYearsWorkExperience} + +
    ${uiLabelMap.CommonComment} + +
    +

    +
    ${uiLabelMap.CommonGoBack}${uiLabelMap.CommonSave} \ No newline at end of file diff --git a/template/customer/giftcardbalance.ftl b/template/customer/giftcardbalance.ftl new file mode 100644 index 0000000..c1cf6ae --- /dev/null +++ b/template/customer/giftcardbalance.ftl @@ -0,0 +1,65 @@ +<#-- +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. +--> + +

    ${uiLabelMap.AccountingGiftCardBalance}

    +
    +
    ${uiLabelMap.AccountingEnterGiftCardNumber}
    +
    + +
    + + <#if requestAttributes.processResult??> + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + ${uiLabelMap.AccountingCurrentBalance} +
    +
    +
    + <#if (requestAttributes.balance?default(0) > 0)> + ${requestAttributes.balance} + <#else> + ${uiLabelMap.AccountingCurrentBalanceProblem} + +
    +
     
    ${uiLabelMap.AccountingCardNumber}
    ${uiLabelMap.AccountingPINNumber}
     
    +
    diff --git a/template/customer/giftcardlink.ftl b/template/customer/giftcardlink.ftl new file mode 100644 index 0000000..85b895c --- /dev/null +++ b/template/customer/giftcardlink.ftl @@ -0,0 +1,68 @@ +<#-- +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. +--> + +

    ${uiLabelMap.AccountingGiftCardLink}

    +
    +
    ${uiLabelMap.AccountingEnterGiftCardLink}.
    +
    + +
    + + <#if userLogin?has_content> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    ${uiLabelMap.AccountingPhysicalCard}
    +
    ${uiLabelMap.AccountingCardNumber}
    ${uiLabelMap.AccountingPINNumber}
     
    +
    ${uiLabelMap.AccountingVirtualCard}
    +
    ${uiLabelMap.AccountingCardNumber}
    ${uiLabelMap.AccountingPINNumber}
     
    +
    +
    diff --git a/template/customer/messagedetail.ftl b/template/customer/messagedetail.ftl new file mode 100644 index 0000000..14a57d9 --- /dev/null +++ b/template/customer/messagedetail.ftl @@ -0,0 +1,66 @@ +<#-- +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. +--> + +<#assign delegator = requestAttributes.delegator> +<#if communicationEvent.partyIdFrom??> + <#assign fromName = Static["org.ofbiz.party.party.PartyHelper"].getPartyName(delegator, communicationEvent.partyIdFrom, true)> + +<#if communicationEvent.partyIdTo??> + <#assign toName = Static["org.ofbiz.party.party.PartyHelper"].getPartyName(delegator, communicationEvent.partyIdTo, true)> + + +
    +
    + +
    ${uiLabelMap.EcommerceReadMessage}
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + +
     
    ${uiLabelMap.CommonFrom}:
    ${fromName!}
    ${uiLabelMap.CommonTo}:
    ${toName!}
    ${uiLabelMap.CommonDate}:
    ${communicationEvent.entryDate}
    ${uiLabelMap.EcommerceSubject}:
     ${(communicationEvent.subject)?default("[${uiLabelMap.EcommerceNoSubject}]")}
     
      +
    ${StringUtil.wrapString(communicationEvent.content)?default("[${uiLabelMap.EcommerceEmptyBody}]")}
    +
    +
    +
    diff --git a/template/customer/messagelist.ftl b/template/customer/messagelist.ftl new file mode 100644 index 0000000..0e38e76 --- /dev/null +++ b/template/customer/messagelist.ftl @@ -0,0 +1,85 @@ +<#-- +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. +--> + +<#macro showMessage communicationEvent isSentMessage index> + <#if communicationEvent.partyIdFrom?has_content> + <#assign partyNameFrom = Static["org.ofbiz.party.party.PartyHelper"].getPartyName(delegator, communicationEvent.partyIdFrom, true)> + <#else/> + <#assign partyNameFrom = "${uiLabelMap.CommonNA}"> + + <#if communicationEvent.partyIdTo?has_content> + <#assign partyNameTo = Static["org.ofbiz.party.party.PartyHelper"].getPartyName(delegator, communicationEvent.partyIdTo, true)> + <#else/> + <#assign partyNameTo = "${uiLabelMap.CommonNA}"> + +
    ${partyNameFrom}
    ${partyNameTo}
    ${communicationEvent.subject?default("")}
    ${communicationEvent.entryDate}
    +
    + +
    + ${uiLabelMap.EcommerceRead} + + <#if isSentMessage> +
    + +
    + ${uiLabelMap.PartyReply} + +
    + <#if (!receivedCommunicationEvents?has_content && !sentCommunicationEvents?has_content)> + + <#else/> + + + + + + + + + <#list receivedCommunicationEvents! as receivedCommunicationEvent> + <@showMessage communicationEvent=receivedCommunicationEvent isSentMessage=false index=receivedCommunicationEvent_index/> + + <#list sentCommunicationEvents! as sentCommunicationEvent> + <@showMessage communicationEvent=sentCommunicationEvent isSentMessage=true index=sentCommunicationEvent_index/> + + +
    ${uiLabelMap.EcommerceNoMessages}.
    ${uiLabelMap.CommonFrom}
    ${uiLabelMap.CommonTo}
    ${uiLabelMap.EcommerceSubject}
    ${uiLabelMap.EcommerceSentDate}
     

    +
    +
    diff --git a/template/customer/miniSignUpForContactList.ftl b/template/customer/miniSignUpForContactList.ftl new file mode 100644 index 0000000..3b322e8 --- /dev/null +++ b/template/customer/miniSignUpForContactList.ftl @@ -0,0 +1,107 @@ +<#-- +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. +--> + +<#-- A simple macro that builds the contact list --> +<#macro contactList publicEmailContactLists> + + + + + +
    +
    +

    ${uiLabelMap.EcommerceSignUpForContactList}

    +
    +
    + <#if sessionAttributes.autoName?has_content> + <#-- The visitor potentially has an account and party id --> + <#if userLogin?has_content && userLogin.userLoginId != "anonymous"> + <#-- They are logged in so lets present the form to sign up with their email address --> +
    +
    + <#assign contextPath = request.getContextPath()> + + + +

    ${uiLabelMap.EcommerceSignUpForContactListComments}

    +
    + <@contactList publicEmailContactLists=publicEmailContactLists/> +
    +
    + + +
    +
    + + +
    +
    +
    + <#else> + <#-- Not logged in so ask them to log in and then sign up or clear the user association --> +

    ${uiLabelMap.EcommerceSignUpForContactListLogIn}

    +

    ${uiLabelMap.CommonLogin} ${sessionAttributes.autoName}

    +

    (${uiLabelMap.CommonNotYou}? ${uiLabelMap.CommonClickHere})

    + + <#else> + <#-- There is no party info so just offer an anonymous (non-partyId) related newsletter sign up --> +
    +
    + <#assign contextPath = request.getContextPath()> + + +
    + + <@contactList publicEmailContactLists=publicEmailContactLists/> +
    +
    + + +
    +
    + + +
    +
    +
    + +
    +
    diff --git a/template/customer/newcustomer.ftl b/template/customer/newcustomer.ftl new file mode 100644 index 0000000..b0c79e1 --- /dev/null +++ b/template/customer/newcustomer.ftl @@ -0,0 +1,171 @@ +<#-- +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. +--> + +<#if getUsername> + + + +<#------------------------------------------------------------------------------ +NOTE: all page headings should start with an h2 tag, not an H1 tag, as +there should generally always only be one h1 tag on the page and that +will generally always be reserved for the logo at the top of the page. +-------------------------------------------------------------------------------> +
    +
    +

    ${uiLabelMap.PartyRequestNewAccount}

    + ${uiLabelMap.PartyAlreadyHaveAccount}, ${uiLabelMap.CommonLoginHere} + +<#macro fieldErrors fieldName> + <#if errorMessageList?has_content> + <#assign fieldMessages = Static["org.ofbiz.base.util.MessageString"].getMessagesForField(fieldName, true, errorMessageList)> +
      + <#list fieldMessages as errorMsg> +
    • ${errorMsg}
    • + +
    + + +<#macro fieldErrorsMulti fieldName1 fieldName2 fieldName3 fieldName4> + <#if errorMessageList?has_content> + <#assign fieldMessages = Static["org.ofbiz.base.util.MessageString"].getMessagesForField(fieldName1, fieldName2, fieldName3, fieldName4, true, errorMessageList)> +
      + <#list fieldMessages as errorMsg> +
    • ${errorMsg}
    • + +
    + + +
    +

    ${uiLabelMap.CommonFieldsMarkedAreRequired}

    +
    +
    +
    + + + <#---------------------------------------------------------------------- + If you need to include a brief explanation of the form, or certain + elements in the form (such as explaining asterisks denote REQUIRED), + then you should use a

    tag with a class name of "desc" + -----------------------------------------------------------------------> + + <#---------------------------------------------------------------------- + There are two types of fieldsets, regular (full width) fielsets, and + column (half width) fieldsets. If you want to group two sets of inputs + side by side in two columns, give each fieldset a class name of "col" + -----------------------------------------------------------------------> + + + + <#---------------------------------------------------------------------- + Each input row should be enclosed in a
    . + This will ensure than each input field clears the one + above it. Alternately, if you want several inputs to float next to + each other, you can enclose them in a table as illustrated below for + the phone numbers, or you can enclose each label/input pair in a span + + Example: +
    + + + + + + + + +
    + -----------------------------------------------------------------------> +
    +
    + <#include "NewCustomerName.ftl" /> + <#include "NewCustomerEmail.ftl" /> +
    +
    + <#include "NewCustomerAccount.ftl" /> +
    +
    +
    +
    + <#include "NewCustomerAddress.ftl" /> +
    +
    + <#include "NewCustomerTelco.ftl" /> +
    +
    +
    + +<#------------------------------------------------------------------------------ +To create a consistent look and feel for all buttons, input[type=submit], +and a tags acting as submit buttons, all button actions should have a +class name of "button". No other class names should be used to style +button actions. +-------------------------------------------------------------------------------> + +
    +
    + diff --git a/template/customer/newmsg.ftl b/template/customer/newmsg.ftl new file mode 100644 index 0000000..30f80cb --- /dev/null +++ b/template/customer/newmsg.ftl @@ -0,0 +1,110 @@ +<#-- +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. +--> + +
    +
    + +
    ${pageHeader}
    +
    +
    +
    + + + + <#if productStore?has_content> + + + + <#if message?has_content> + + <#if (communicationEvent.origCommEventId?? && communicationEvent.origCommEventId?length > 0)> + <#assign orgComm = communicationEvent.origCommEventId> + <#else> + <#assign orgComm = communicationEvent.communicationEventId> + + + + + + + + + + + + + <#if partyIdTo?has_content> + <#assign partyToName = Static["org.ofbiz.party.party.PartyHelper"].getPartyName(delegator, partyIdTo, true)> + + + + + + + + + + + + + + <#assign defaultSubject = (communicationEvent.subject)?default("")> + <#if (defaultSubject?length == 0)> + <#assign replyPrefix = "RE: "> + <#if parentEvent?has_content> + <#if !parentEvent.subject?default("")?upper_case?starts_with(replyPrefix)> + <#assign defaultSubject = replyPrefix> + + <#assign defaultSubject = defaultSubject + parentEvent.subject?default("")> + + + + + + + + + + + + + + + + + + + + + + + + + +
     
     
    ${uiLabelMap.CommonFrom}:
     ${sessionAttributes.autoName!} [${userLogin.partyId}] (${uiLabelMap.CommonNotYou}? ${uiLabelMap.CommonClickHere})
     
     
    ${uiLabelMap.CommonTo}:
     ${partyToName}
     
     
    ${uiLabelMap.EcommerceSubject}:
    +
     
     
    ${uiLabelMap.CommonMessage}:
     
      + +
     
     
    +
    +
    +
    diff --git a/template/customer/profile/EditBillToAddress.ftl b/template/customer/profile/EditBillToAddress.ftl new file mode 100644 index 0000000..345c6e9 --- /dev/null +++ b/template/customer/profile/EditBillToAddress.ftl @@ -0,0 +1,91 @@ +<#-- +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. +--> + +
    +
    +
    + + + <#assign productStoreId = Static["org.ofbiz.product.store.ProductStoreWorker"].getProductStoreId(request) /> + +
    + + + +
    +
    + + +
    +
    + + + +
    +
    + + + +
    +
    + + + +
    +
    + + +
    + <#if billToTelecomNumber?has_content> +
    + + + + + + + + - + - + - +
    + +
    + + checked="checked" /> +
    + <#-- + + --> +
    +
    \ No newline at end of file diff --git a/template/customer/profile/EditPostalAddress.ftl b/template/customer/profile/EditPostalAddress.ftl new file mode 100644 index 0000000..e8ef4e6 --- /dev/null +++ b/template/customer/profile/EditPostalAddress.ftl @@ -0,0 +1,85 @@ +<#-- +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. +--> + +
    +<#assign postalAddress = delegator.findOne("PostalAddress", Static["org.ofbiz.base.util.UtilMisc"].toMap("contactMechId", contactMech.contactMechId), true) /> + +
    +
    + + <#assign productStoreId = Static["org.ofbiz.product.store.ProductStoreWorker"].getProductStoreId(request) /> + +
    + + + +
    +
    + + +
    +
    + + + +
    +
    + + + +
    +
    + + + +
    +
    + + + +
    +
    + + checked="checked" /> +
    +
    + + checked="checked" /> +
    + <#-- + + --> +
    +
    \ No newline at end of file diff --git a/template/customer/profile/EditProfile.ftl b/template/customer/profile/EditProfile.ftl new file mode 100644 index 0000000..5509309 --- /dev/null +++ b/template/customer/profile/EditProfile.ftl @@ -0,0 +1,68 @@ +<#-- +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. +--> + +
    +

    ${uiLabelMap.EcommerceMyAccount}

    +
    +
    + + +

    ${uiLabelMap.PartyContactInformation}

    +
    + + +
    +
    + + +
    +
    + + +
    +
    + +
    +

    ${uiLabelMap.EcommerceAccountInformation}

    +
    + + disabled="disabled" /> +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + +
    +
    \ No newline at end of file diff --git a/template/customer/profile/EditShipToAddress.ftl b/template/customer/profile/EditShipToAddress.ftl new file mode 100644 index 0000000..4bea77c --- /dev/null +++ b/template/customer/profile/EditShipToAddress.ftl @@ -0,0 +1,91 @@ +<#-- +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. +--> + +
    +
    +
    + + + <#assign productStoreId = Static["org.ofbiz.product.store.ProductStoreWorker"].getProductStoreId(request) /> + +
    + + + +
    +
    + + +
    +
    + + + +
    +
    + + + +
    +
    + + + +
    +
    + + +
    + <#if shipToTelecomNumber?has_content> +
    + + + + + + + + - + - + - +
    + +
    + + checked="checked" /> +
    + <#-- + + --> +
    +
    \ No newline at end of file diff --git a/template/customer/profile/ManageAddress.ftl b/template/customer/profile/ManageAddress.ftl new file mode 100644 index 0000000..deac713 --- /dev/null +++ b/template/customer/profile/ManageAddress.ftl @@ -0,0 +1,301 @@ +<#-- +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. +--> + +<#assign productStoreId = Static["org.ofbiz.product.store.ProductStoreWorker"].getProductStoreId(request) /> +
    +
    +
    + +

    ${uiLabelMap.EcommerceAddressBook}

    +
    + <#-- Add address --> + ${uiLabelMap.EcommerceAddNewAddress} + + +
    + + <#-- Default Addresses --> +
    +

    ${uiLabelMap.EcommerceDefaultAddresses}

    +
    + <#--===================================== Billing Address and Telecom number ===========================================--> +

    ${uiLabelMap.EcommercePrimaryBillingAddress}

    +
      + <#if billToContactMechId??> +
    • ${billToAddress1!}
    • + <#if billToAddress2?has_content>
    • ${billToAddress2!}
    • +
    • + <#if billToStateProvinceGeoId?has_content && billToStateProvinceGeoId != "_NA_"> + ${billToStateProvinceGeoId} + + ${billToCity!}, + ${billToPostalCode!} +
    • +
    • ${billToCountryGeoId!}
    • + <#if billToTelecomNumber?has_content> +
    • + ${billToTelecomNumber.countryCode!}- + ${billToTelecomNumber.areaCode!}- + ${billToTelecomNumber.contactNumber!} + <#if billToExtension??>-${billToExtension!} +
    • + +
    • ${uiLabelMap.CommonEdit}
    • + <#else> +
    • ${uiLabelMap.PartyPostalInformationNotFound}
    • + +
    + + + + <#--===================================== Shipping Address and Telecom number ===========================================--> +

    ${uiLabelMap.EcommercePrimaryShippingAddress}

    +
      + <#if shipToContactMechId??> +
    • ${shipToAddress1!}
    • + <#if shipToAddress2?has_content>
    • ${shipToAddress2!}
    • +
    • + <#if shipToStateProvinceGeoId?has_content && shipToStateProvinceGeoId != "_NA_"> + ${shipToStateProvinceGeoId} + + ${shipToCity!}, + ${shipToPostalCode!} +
    • +
    • ${shipToCountryGeoId!}
    • + <#if shipToTelecomNumber?has_content> +
    • + ${shipToTelecomNumber.countryCode!}- + ${shipToTelecomNumber.areaCode!}- + ${shipToTelecomNumber.contactNumber!} + <#if shipToExtension??>-${shipToExtension!} +
    • + +
    • ${uiLabelMap.CommonEdit}
    • + <#else> +
    • ${uiLabelMap.PartyPostalInformationNotFound}
    • + +
    + + +
    +
    + + <#-- Additional Addresses --> +
    +

    ${uiLabelMap.EcommerceAdditionalAddresses}

    + +
    + <#assign postalAddressFlag = "N" /> + <#list partyContactMechValueMaps as partyContactMechValueMap> + <#assign contactMech = partyContactMechValueMap.contactMech! /> + <#if contactMech.contactMechTypeId! = "POSTAL_ADDRESS"> + <#assign partyContactMech = partyContactMechValueMap.partyContactMech! /> + <#if !(partyContactMechValueMap.partyContactMechPurposes?has_content)> + <#assign postalAddressFlag = "Y" /> + <#assign postalAddress = partyContactMechValueMap.postalAddress! /> + + <#if postalAddress??> +
    +
      +
    • ${postalAddress.address1}
    • + <#if postalAddress.address2?has_content>
    • ${postalAddress.address2}
    • +
    • ${postalAddress.city}
    • +
    • + <#if postalAddress.stateProvinceGeoId?has_content && postalAddress.stateProvinceGeoId != "_NA_"> + ${postalAddress.stateProvinceGeoId} + + ${postalAddress.postalCode!} +
    • + <#if postalAddress.countryGeoId?has_content>
    • ${postalAddress.countryGeoId}
    • +
    + <#if (!postalAddress.countryGeoId?has_content || postalAddress.countryGeoId! = "USA")> + <#assign addr1 = postalAddress.address1! /> + <#if (addr1.indexOf(" ") > 0)> + <#assign addressNum = addr1.substring(0, addr1.indexOf(" ")) /> + <#assign addressOther = addr1.substring(addr1.indexOf(" ")+1) /> + (${uiLabelMap.CommonLookupWhitepages}) + + +
    +
    + + ${uiLabelMap.CommonEdit} +
    +
    + +
    +
    +
    + + <#else> +
    + +
    + + + + + <#if postalAddressFlag == "N"> +
    + +
    + +
    +
    +
    \ No newline at end of file diff --git a/template/customer/profile/NewCustomer.ftl b/template/customer/profile/NewCustomer.ftl new file mode 100644 index 0000000..7c7feb4 --- /dev/null +++ b/template/customer/profile/NewCustomer.ftl @@ -0,0 +1,176 @@ +<#-- +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. +--> + +
    +
    +

    ${uiLabelMap.EcommerceMyAccount}

    +
    +
    +
    +
    + ${uiLabelMap.PartyContactInformation} + + + <#assign productStoreId = Static["org.ofbiz.product.store.ProductStoreWorker"].getProductStoreId(request) /> + +
    + + +
    +
    + + +
    +
    + + +
    + +
    +
    + ${uiLabelMap.EcommerceAccountInformation} +
    + + +
    +
    + + + +
    +
    + + + +
    +
    +
    + ${uiLabelMap.OrderShippingInformation} +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + + + + + + + - + - + - +
    +
    + checked="checked" /> + +
    +
    +
    + ${uiLabelMap.PageTitleBillingInformation} +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + +
    + +
    +
    +
    + + + + + + + - + - + - +
    +
    + +
    +
    +
    \ No newline at end of file diff --git a/template/customer/profile/ViewProfile.ftl b/template/customer/profile/ViewProfile.ftl new file mode 100644 index 0000000..bc3195f --- /dev/null +++ b/template/customer/profile/ViewProfile.ftl @@ -0,0 +1,103 @@ +<#-- +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. +--> + +
    +

    ${uiLabelMap.EcommerceMyAccount}

    +
    +
    + ${uiLabelMap.EcommerceEditProfile} +

    ${uiLabelMap.PartyContactInformation}

    + + + + <#if emailAddress??> + + (${uiLabelMap.PartySendEmail}) + +
    +
    + <#-- Manage Addresses --> +
    + ${uiLabelMap.EcommerceManageAddresses} +

    ${uiLabelMap.EcommerceAddressBook}

    +
    +

    ${uiLabelMap.EcommercePrimaryShippingAddress}

    +
      + <#if shipToContactMechId??> +
    • ${shipToAddress1!}
    • + <#if shipToAddress2?has_content>
    • ${shipToAddress2!}
    • +
    • +
        +
      • + <#if shipToStateProvinceGeoId?has_content && shipToStateProvinceGeoId != "_NA_"> + ${shipToStateProvinceGeoId} + + ${shipToCity!}, + ${shipToPostalCode!} +
      • +
      • ${shipToCountryGeoId!}
      • +
      +
    • + <#if shipToTelecomNumber?has_content> +
    • + ${shipToTelecomNumber.countryCode!}- + ${shipToTelecomNumber.areaCode!}- + ${shipToTelecomNumber.contactNumber!} + <#if shipToExtension??>-${shipToExtension!} +
    • + + <#else> +
    • ${uiLabelMap.PartyPostalInformationNotFound}
    • + +
    +
    +
    +

    ${uiLabelMap.EcommercePrimaryBillingAddress}

    +
      + <#if billToContactMechId??> +
    • ${billToAddress1!}
    • + <#if billToAddress2?has_content>
    • ${billToAddress2!}
    • +
    • +
        +
      • + <#if billToStateProvinceGeoId?has_content && billToStateProvinceGeoId != "_NA_"> + ${billToStateProvinceGeoId} + + ${billToCity!}, + ${billToPostalCode!} +
      • +
      • ${billToCountryGeoId!}
      • +
      +
    • + <#if billToTelecomNumber?has_content> +
    • + ${billToTelecomNumber.countryCode!}- + ${billToTelecomNumber.areaCode!}- + ${billToTelecomNumber.contactNumber!} + <#if billToExtension??>-${billToExtension!} +
    • + + <#else> +
    • ${uiLabelMap.PartyPostalInformationNotFound}
    • + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/template/customer/viewprofile.ftl b/template/customer/viewprofile.ftl new file mode 100644 index 0000000..62ae293 --- /dev/null +++ b/template/customer/viewprofile.ftl @@ -0,0 +1,108 @@ +<#-- +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. +--> + +<#if party??> +<#-- Main Heading --> +
    +
    + + + + + +
    +

    ${uiLabelMap.PartyTheProfileOf} + <#if person??> + ${person.personalTitle!} + ${person.firstName!} + ${person.middleName!} + ${person.lastName!} + ${person.suffix!} + <#else> + "${uiLabelMap.PartyNewUser}" + +

    +
    + <#if showOld> + ${uiLabelMap.PartyHideOld} + <#else> + ${uiLabelMap.PartyShowOld} + + <#if (productStore.enableDigProdUpload)! == "Y"> + ${uiLabelMap.EcommerceDigitalProductUpload} + +
    +
    +
    +
    + +
    +
    +
    + <#include "AccountName.ftl" /> +
    +
    + <#include "AccountLoyalityPoints.ftl" /> +
    +
    + ${screens.render("component://oshop/widget/OrderScreens.xml#orderhistory")} +
    +
    + <#include "AccountMessages.ftl" /> +
    +
    + <#include "AccountSurveys.ftl" /> +
    +
    + <#include "AccountContactMechs.ftl" /> +
    +
    + <#include "AccountCards.ftl" /> +
    +
    +
    +
    +
    +
    +<#-- ============================================================= --> +<#-- only 5 messages will show; edit the ViewProfile.groovy to change this number --> +${screens.render("component://${activeApp}/widget/CustomerScreens.xml#FinAccountList-include")} + +<#-- Serialized Inventory Summary --> +${screens.render('component://${activeApp}/widget/CustomerScreens.xml#SerializedInventorySummary')} + +<#-- Subscription Summary --> +${screens.render('component://${activeApp}/widget/CustomerScreens.xml#SubscriptionSummary')} + +<#-- Reviews --> +${screens.render('component://${activeApp}/widget/CustomerScreens.xml#showProductReviews')} + +<#else> +

    ${uiLabelMap.PartyNoPartyForCurrentUserName}: ${userLogin.userLoginId}

    + diff --git a/template/customer/viewreviews.ftl b/template/customer/viewreviews.ftl new file mode 100644 index 0000000..990c36c --- /dev/null +++ b/template/customer/viewreviews.ftl @@ -0,0 +1,46 @@ +<#-- +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. +--> + +<#if reviews?has_content> +
    +

    ${uiLabelMap.ProductReviews}

    +
    + + + + + + + + + + <#list reviews as review> + + + + + + + + + +
    ${uiLabelMap.EcommerceSentDate}${uiLabelMap.ProductProductId}${uiLabelMap.ProductReviews}${uiLabelMap.ProductRating}${uiLabelMap.CommonIsAnonymous}${uiLabelMap.CommonStatus}
    ${review.postedDateTime!}${review.productId}${review.productReview!}${review.productRating}${review.postedAnonymous!}${review.getRelatedOne("StatusItem", false).get("description", locale)}
    +
    +
    + diff --git a/template/data/content.ftl b/template/data/content.ftl new file mode 100644 index 0000000..7625418 --- /dev/null +++ b/template/data/content.ftl @@ -0,0 +1,42 @@ + +<#-- +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. +--> + + + +<#recurse doc> + + +<#macro contents> +<#recurse .node> + + +<#macro content> + <#assign contentId="ECMC" + .node.@id[0]/> + + + + + + + +<#macro @element> + diff --git a/template/data/topic.ftl b/template/data/topic.ftl new file mode 100644 index 0000000..333b94a --- /dev/null +++ b/template/data/topic.ftl @@ -0,0 +1,42 @@ + +<#-- +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. +--> + + +<#recurse doc> + + +<#macro topics> +<#recurse .node> + + +<#macro topic> + <#assign contentId="ECMT" + .node.@id[0]/> + + <#assign internalName=.node.@name[0]/> + <#assign internalNameParts=internalName?split(".")/> + <#assign firstPart=internalNameParts[0] /> + <#assign nowStamp=Static["org.ofbiz.base.util.UtilDateTime"].nowTimestamp()/> + <#if firstPart == "WIDGETS"> + + + + +<#macro @element> + diff --git a/template/data/tree.ftl b/template/data/tree.ftl new file mode 100644 index 0000000..d34c376 --- /dev/null +++ b/template/data/tree.ftl @@ -0,0 +1,46 @@ + +<#-- +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. +--> + + +<#recurse doc> + + +<#macro topic_tree> +<#recurse .node> + + +<#macro topic> + <#assign contentId="ECMT" + .node.@id[0]/> + <#recurse .node> + + +<#macro child> + <#assign contentIdTo="ECMT" + .node.@id[0]/> + <#assign assocType="SUB_CONTENT"/> + <#if .node.@type = "content"> + <#assign contentIdTo="ECMC" + .node.@id[0]/> + <#assign assocType="PUBLISH_LINK"/> + + <#assign nowStamp=Static["org.ofbiz.base.util.UtilDateTime"].nowTimestamp()/> + + + +<#macro @element> + diff --git a/template/email/ContactListEmailTemplate.ftl b/template/email/ContactListEmailTemplate.ftl new file mode 100644 index 0000000..6ad214c --- /dev/null +++ b/template/email/ContactListEmailTemplate.ftl @@ -0,0 +1,38 @@ +<#-- +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. +--> + + +
    + ${content} +
    + <#assign verifyUrl = baseEcommerceSecureUrl + "updateContactListPartyNoUserLogin" /> +
    +
    + + + + + + + + +
    +
    + + diff --git a/template/email/ContactListSubscribeEmail.ftl b/template/email/ContactListSubscribeEmail.ftl new file mode 100644 index 0000000..480be51 --- /dev/null +++ b/template/email/ContactListSubscribeEmail.ftl @@ -0,0 +1,31 @@ +<#-- +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. +--> + + +

    Hello ${partyName.firstName!} ${partyName.lastName!} ${partyName.groupName!}!

    +

    Successfully subscribed from ${contactList.contactListName} contact list.

    + + <#assign verifyUrl = baseEcommerceSecureUrl +'updateContactListPartyNoUserLogin?contactListId='+contactListParty.contactListId+'&partyId='+contactListParty.partyId+'&fromDate='+contactListParty.fromDate+'&statusId=CLPT_UNSUBS_PENDING&optInVerifyCode='+contactListPartyStatus.optInVerifyCode+'&baseLocation='+baseLocation!> + <#if (contactListParty.preferredContactMechId)??> + <#assign verifyUrl= verifyUrl+"&preferredContactMechId="+contactListParty.preferredContactMechId> + + If this was by mistake, click here to unsubscribe your subscription again. + + + diff --git a/template/email/ContactListUnsubscribeEmail.ftl b/template/email/ContactListUnsubscribeEmail.ftl new file mode 100644 index 0000000..bf1e1c4 --- /dev/null +++ b/template/email/ContactListUnsubscribeEmail.ftl @@ -0,0 +1,33 @@ +<#-- +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. +--> + + +

    Hello ${partyName.firstName!} ${partyName.lastName!} ${partyName.groupName!}!

    +

    Successfully unsubscribed from ${contactList.contactListName} contact list.

    + + <#--assign verifyUrl = baseEcommerceSecureUrl +'updateContactListPartyNoUserLogin?contactListId='+contactListParty.contactListId+'&partyId='+contactListParty.partyId+'&fromDate='+contactListParty.fromDate+'&statusId=CLPT_SUBS_PENDING&optInVerifyCode='+contactListPartyStatus.optInVerifyCode+'&baseLocation='+baseLocation!> + <#if (contactListParty.preferredContactMechId)??> + <#assign verifyUrl= verifyUrl+"&preferredContactMechId="+contactListParty.preferredContactMechId> + + If this was by mistake, click here subscribe again. + + + + + diff --git a/template/email/ContactListUnsubscribeVerifyEmail.ftl b/template/email/ContactListUnsubscribeVerifyEmail.ftl new file mode 100644 index 0000000..4f81514 --- /dev/null +++ b/template/email/ContactListUnsubscribeVerifyEmail.ftl @@ -0,0 +1,43 @@ +<#-- +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. +--> + + + + + ${title!} + <#-- this needs to be fully qualified to appear in email; the server must also be available --> + + + + + <#-- custom logo or text can be inserted here --> +

    ${title!}

    + <#if note??>

    ${note}

    + +

    Hello ${partyName.firstName!} ${partyName.lastName!} ${partyName.groupName!}!

    +

    We have received a request for unsubscription to the ${contactList.contactListName} contact list.

    +

    To complete your unsubscription click the on the following link:

    + + <#assign verifyUrl = baseEcommerceSecureUrl+'contactListOptOut?contactListId='+contactListParty.contactListId+'&communicationEventId='+communicationEventId!+'&partyId='+contactListParty.partyId+'&fromDate='+contactListParty.fromDate+'&statusId=CLPT_UNSUBSCRIBED&optInVerifyCode='+contactListPartyStatus.optInVerifyCode> + <#if (contactListParty.preferredContactMechId)??> + <#assign verifyUrl= verifyUrl+"&preferredContactMechId="+contactListParty.preferredContactMechId> + +
    Please click here to verify your unsubscription. + + diff --git a/template/email/ContactListVerifyEmail.ftl b/template/email/ContactListVerifyEmail.ftl new file mode 100644 index 0000000..1fa9a78 --- /dev/null +++ b/template/email/ContactListVerifyEmail.ftl @@ -0,0 +1,44 @@ +<#-- +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. +--> + + + + + ${title!} + <#-- this needs to be fully qualified to appear in email; the server must also be available --> + + + + +<#-- custom logo or text can be inserted here --> +

    ${title!}

    +<#if note??>

    ${note}

    + +

    Hello ${partyName.firstName!} ${partyName.lastName!} ${partyName.groupName!}!

    +

    We have received a request for subscription to the ${contactList.contactListName} contact list.

    +

    To complete your subscription click the on the following link:

    + +<#assign verifyUrl = baseEcommerceSecureUrl+'/'+'updateContactListPartyNoUserLogin?contactListId='+contactListParty.contactListId+'&partyId='+contactListParty.partyId+'&fromDate='+contactListParty.fromDate+'&statusId=CLPT_ACCEPTED&optInVerifyCode='+contactListPartyStatus.optInVerifyCode+'&baseLocation='+baseLocation!> +<#if (contactListParty.preferredContactMechId)??> + <#assign verifyUrl= verifyUrl+"&preferredContactMechId="+contactListParty.preferredContactMechId> + +Please click here to verify your subscription. + + + diff --git a/template/email/ContactUsEmail.ftl b/template/email/ContactUsEmail.ftl new file mode 100644 index 0000000..2ce0d7c --- /dev/null +++ b/template/email/ContactUsEmail.ftl @@ -0,0 +1,28 @@ +<#-- +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. +--> + + + + +

    The information filled by the person on contact us page is as follows:

    +

    ${uiLabelMap.CommonName}: ${parameters.firstName!} ${parameters.lastName!}

    +

    ${uiLabelMap.CommonEmail}: ${parameters.email!}

    +

    ${uiLabelMap.CommonMessage}: ${parameters.message!}

    + + \ No newline at end of file diff --git a/template/email/OrderNoticeEmail.ftl b/template/email/OrderNoticeEmail.ftl new file mode 100644 index 0000000..75c626d --- /dev/null +++ b/template/email/OrderNoticeEmail.ftl @@ -0,0 +1,145 @@ +<#-- +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. +--> + + + + + + ${title!} + <#-- this needs to be fully qualified to appear in email; the server must also be available --> + + + + + +<#-- custom logo or text can be inserted here --> + +

    ${title!}

    +<#if !isDemoStore?? || isDemoStore>

    ${uiLabelMap.OrderDemoFrontNote}.

    +<#if note??>

    ${note}

    +<#if orderHeader??> +${screens.render("component://${activeApp}/widget/OrderScreens.xml#orderheader")} +
    +${screens.render("component://${activeApp}/widget/OrderScreens.xml#orderitems")} +<#else> +

    Order not found with ID [${orderId!}], or not allowed to view.

    + + + + diff --git a/template/email/ShipmentNotificationEmail.ftl b/template/email/ShipmentNotificationEmail.ftl new file mode 100644 index 0000000..8fd66b3 --- /dev/null +++ b/template/email/ShipmentNotificationEmail.ftl @@ -0,0 +1,63 @@ +<#-- +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. +--> + +<#if baseEcommerceSecureUrl??><#assign urlPrefix = baseEcommerceSecureUrl/> +<#if shipment?has_content> +
    +
    +
    ${title!}

    +
    + + + + + + <#list orderShipmentInfoSummaryList as orderShipmentInfoSummary> + + + + + +
    ${uiLabelMap.OrderTrackingNumber}
    + Code: ${orderShipmentInfoSummary.trackingCode?default("[Not Yet Known]")} + <#if orderShipmentInfoSummary.carrierPartyId?has_content>(${uiLabelMap.ProductCarrier}: ${orderShipmentInfoSummary.carrierPartyId}) +
    +
    +
    +
    ${uiLabelMap.EcommerceShipmentItems}
    +
    +
    + + + + + + + <#list shipmentItems as shipmentItem> + <#assign productId = shipmentItem.productId> + <#assign product = shipmentItem.getRelatedOne("Product", false)> + + + + + + +
    ${uiLabelMap.OrderProduct}${uiLabelMap.OrderQuantity}

    ${productId!} - ${product.internalName!} ${shipmentItem.quantity!}

    +
    + diff --git a/template/email/emailpayretry.ftl b/template/email/emailpayretry.ftl new file mode 100644 index 0000000..067759b --- /dev/null +++ b/template/email/emailpayretry.ftl @@ -0,0 +1,29 @@ +<#-- +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. +--> + +
    +<#if orderHeader.statusId == "ORDER_REJECTED"> + ${uiLabelMap.OrderEmailProblemWithYourPaymentMethod} ${orderHeader.orderId}.
    + ${uiLabelMap.OrderEmailProblemCancelledNotProcessed}
    +<#elseif orderHeader.statusId == "ORDER_APPROVED"> + ${uiLabelMap.OrderEmailPaymentOK} ${orderHeader.orderId} ${uiLabelMap.OrderEmailAccepted} +<#else> + ${uiLabelMap.OrderEmailSorry} ${orderHeader.orderId}.
    + +
    ${uiLabelMap.OrderEmailCustomerService} (email@email.com)
    <#-- Customer service email (not a variable why?) must be adapted - JLR 1/6/5 --> diff --git a/template/email/giftcardpurchase.ftl b/template/email/giftcardpurchase.ftl new file mode 100644 index 0000000..97ce3df --- /dev/null +++ b/template/email/giftcardpurchase.ftl @@ -0,0 +1,42 @@ +<#-- +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. +--> + +<#-- Three standard fields cardNumber, pinNumber and amount are available from the activation + All other fields in this tempalte are designed to work with the values (responses) + from surveyId 1000 - The gift card purchase survey. + --> + +<#if recipientName??>${recipientName}, +
    + +<#-- MyCompany.com (not a variable why?) must be adapted - JLR 1/6/5 --> +${uiLabelMap.EcommerceYouHaveBeenSent} MyCompany.com <#if senderName??> ${uiLabelMap.EcommerceGiftCardFrom} ${senderName}! +

    +<#if giftMessage?has_content> + ${uiLabelMap.OrderGiftMessage} +

    + ${giftMessage} +

    + + +
    +  ${uiLabelMap.EcommerceYourCardNumber} ${cardNumber!}
    +  ${uiLabelMap.EcommerceYourPinNumber} ${pinNumber!}
    +  ${uiLabelMap.EcommerceGiftAmount} ${amount!}
    +
    diff --git a/template/email/giftcardreload.ftl b/template/email/giftcardreload.ftl new file mode 100644 index 0000000..8fb1996 --- /dev/null +++ b/template/email/giftcardreload.ftl @@ -0,0 +1,52 @@ +<#-- +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. +--> + +<#-- + Standard fields for this template are: cardNumber, pinNumber, amount, previousAmount, processResult, responseCode + All other fields in this template are designed to work with the values (responses) from surveyId 1001 +--> + +<#if giftCardNumber?has_content> + <#assign displayNumber = ""> + <#assign numSize = giftCardNumber?length - 4> + <#if 0 < numSize> + <#list 0 .. numSize-1 as foo> + <#assign displayNumber = displayNumber + "*"> + + <#assign displayNumber = displayNumber + giftCardNumber[numSize .. numSize + 3]> + <#else> + <#assign displayNumber = giftCardNumber> + + + +<#if processResult> + <#-- success --> +
    + ${uiLabelMap.EcommerceYourGiftCard} ${displayNumber} ${uiLabelMap.EcommerceYourGiftCardReloaded} +
    + ${uiLabelMap.EcommerceGiftCardNewBalance} ${amount} ${uiLabelMap.CommonFrom} ${previousAmount} +
    +<#else> + <#-- fail --> +
    + ${uiLabelMap.EcommerceGiftCardReloadFailed} ${responseCode} +
    + ${uiLabelMap.EcommerceGiftCardRefunded} +
    + diff --git a/template/email/registration.ftl b/template/email/registration.ftl new file mode 100644 index 0000000..450c904 --- /dev/null +++ b/template/email/registration.ftl @@ -0,0 +1,35 @@ +<#-- +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. +--> + +<#-- All fields from Person and UserLogin are available to this template --> + +${person.firstName}, +

    +${uiLabelMap.EcommerceThankForRegistering} MyStore.com. <#-- MyStore.com (not a variable why?) must be adapted - JLR 1/6/5 --> +


    + +${uiLabelMap.EcommerceAccountLogin} ${userLogin.userLoginId}
    +${uiLabelMap.EcommercePassword}

    + +${uiLabelMap.EcommerceLosePassword}

    + +${uiLabelMap.EcommerceThankYou},
    +MyStore.com <#-- MyStore.com (not a variable why?) must be adapted - JLR 1/6/5 --> +

    + diff --git a/template/email/returnaccept.ftl b/template/email/returnaccept.ftl new file mode 100644 index 0000000..c0ab2f7 --- /dev/null +++ b/template/email/returnaccept.ftl @@ -0,0 +1,34 @@ +<#-- +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. +--> + +<#-- ReturnHeader and a List of ReturnItem records is available to this template --> +
    +${uiLabelMap.EcommerceReturnRequest} +

    +
    +<#list returnItems as item>
    +  <#assign returnReason = item.getRelatedOne("ReturnReason", false)!>
    +  <#assign returnType = item.getRelatedOne("ReturnType", false)!>
    +  ${item.description?default("N/A")} - ${item.returnQuantity?string.number} @ ${item.returnPrice}
    +
    +
    +

    + +${uiLabelMap.EcommerceReturnRequestAccepted} ${returnHeader.returnId} +

    diff --git a/template/email/returncancel.ftl b/template/email/returncancel.ftl new file mode 100644 index 0000000..5a9eae9 --- /dev/null +++ b/template/email/returncancel.ftl @@ -0,0 +1,24 @@ +<#-- +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. +--> + +<#-- ReturnHeader and a List of ReturnItem records is available to this template --> + +
    +${uiLabelMap.EcommerceReturnRequestNb} ${returnHeader.returnId} ${uiLabelMap.EcommerceReturnRequestCancelled} +
    diff --git a/template/email/returncomplete.ftl b/template/email/returncomplete.ftl new file mode 100644 index 0000000..3a61e50 --- /dev/null +++ b/template/email/returncomplete.ftl @@ -0,0 +1,24 @@ +<#-- +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. +--> + +<#-- ReturnHeader and a List of ReturnItem records is available to this template --> + +
    +${uiLabelMap.EcommerceReturnRequestNb} ${returnHeader.returnId} ${uiLabelMap.EcommerceReturnRequestCompleted} +
    diff --git a/template/email/tellafriend.ftl b/template/email/tellafriend.ftl new file mode 100644 index 0000000..ce0f352 --- /dev/null +++ b/template/email/tellafriend.ftl @@ -0,0 +1,30 @@ +<#-- +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. +--> + + + +${sendTo}, +
    +${sendFrom} ${uiLabelMap.EcommerceFollowingMessage} +

    +${message} +

    +${pageUrl} + + diff --git a/template/error/404.jsp b/template/error/404.jsp new file mode 100644 index 0000000..c693609 --- /dev/null +++ b/template/error/404.jsp @@ -0,0 +1,53 @@ +<%-- +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. +--%> +<%@ page import="java.util.*" %> +<%@ page import="org.ofbiz.base.util.*" %> +<%@ page import="org.ofbiz.entity.*" %> +<%@ page import="org.ofbiz.entity.util.*" %> +<%@ page import="org.ofbiz.webapp.website.WebSiteWorker" %> + +<% +ServletContext context = pageContext.getServletContext(); +String webSiteId = WebSiteWorker.getWebSiteId(request); +List webAnalytics = delegator.findByAnd("WebAnalyticsConfig", UtilMisc.toMap("webSiteId", webSiteId), null, false); +%> + + +Error 404 +<%if (webAnalytics != null) {%> + +<%}%> + + +

    +404. +That's an error. +

    +

    +The requested URL +<%=request.getAttribute("filterRequestUriError")%> +was not found on this server. +That's all we know. +

    + + diff --git a/template/error/error.jsp b/template/error/error.jsp new file mode 100644 index 0000000..3aef501 --- /dev/null +++ b/template/error/error.jsp @@ -0,0 +1,53 @@ +<%-- +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. +--%> + +<%@ page import="org.ofbiz.base.util.*" %> + + +OFBiz Message + + + +<% String errorMsg = (String) request.getAttribute("_ERROR_MESSAGE_"); %> + + +
    +
    + + + + +
    + + + + + + + +
    +
    :ERROR MESSAGE:
    +
    +
    <%=UtilFormatOut.replaceString(errorMsg, "\n", "
    ")%>
    +
    +
    +
    +
    + + diff --git a/template/forum/ViewComboResponse.ftl b/template/forum/ViewComboResponse.ftl new file mode 100644 index 0000000..bc81b12 --- /dev/null +++ b/template/forum/ViewComboResponse.ftl @@ -0,0 +1,53 @@ +<#-- +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. +--> + +<#if requestAttributes._ERROR_MESSAGE_??> +
    ${requestAttributes._ERROR_MESSAGE_}

    +<#else> + <#if trailList??> + <#assign indent = ""> + <#assign csv = ""> + <#assign counter = 1> + <#assign len = trailList?size> + <#list trailList as pair> + <#if 0 < csv?length > + <#assign csv = csv + ","/> + + <#assign csv = csv + pair[0]!/> + <#if counter < len> + ${indent} + ${pair[0]!} - ${pair[1]!} + ${uiLabelMap.CommonView}
    + <#assign indent = indent + "    "> + <#else> + + ${uiLabelMap.EcommerceAddResponseFor}${pair[0]!} - ${pair[1]!}:
    + + <#assign counter = counter + 1> + + + <#if dataResourceId??> +
    + + +
    + + ${singleWrapper.renderFormString()} +
    + diff --git a/template/forum/bloglib.ftl b/template/forum/bloglib.ftl new file mode 100644 index 0000000..a7fa50d --- /dev/null +++ b/template/forum/bloglib.ftl @@ -0,0 +1,195 @@ +<#-- +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. +--> + +<#macro renderBlog contentId="" targetPurpose="" stdWrapId=""> +<#if contentId?has_content> + <#assign contentIdx = contentId/> + +<#assign viewIdx = "" /> +<#if requestParameters.viewIndex?has_content> +<#assign viewIdx = requestParameters.viewIndex! /> + +<#assign viewSz = "" /> +<#if requestParameters.viewSize?has_content> +<#assign viewSz = requestParameters.viewSize! /> + + +<#assign sz=0/> + +<@loopSubContent contentId=contentIdx viewIndex=viewIdx viewSize=viewSz contentAssocTypeId="PUBLISH_LINK" + pickWhen="purposes.contains(\"ARTICLE\") && \"CTNT_PUBLISHED\".equals(content.get(\"statusId\"))" + returnAfterPickWhen="purposes.contains(\"ARTICLE\")" + followWhen="contentAssocTypeId != null && contentAssocTypeId.equals(\"never follow\")"> + <#assign thisNodeTrailCsv=nodeTrailCsv!/> + <#assign thisSubContentId=subContentId!/> + <#assign thisNode=globalNodeTrail?last/> + <#if thisNode?has_content> + <#assign thisOwnerContentId=thisNode.value.ownerContentId!/> + + + <#assign userLoginId=""/> + <#if content?has_content && content.createdByUserLogin?has_content> + <#assign userLoginId=content.createdByUserLogin/> + + <#assign authorName=Static["org.ofbiz.content.ContentManagementWorker"].getUserName(request,userLoginId!)/> + + + + + + +<@checkPermission mode="equals" entityOperation="_UPDATE" subContentId=content.contentId targetOperation="CONTENT_UPDATE" contentPurposeList="ARTICLE"> + + + +<#assign sz=listSize/> + + + + +<#if sz == 0 > + + +<@wrapSubContentCache subContentId=contentIdx wrapTemplateId=stdWrapId contentPurposeList="ARTICLE"> + +
      +
    + by:<#if authorName?has_content>${authorName!} + <#else> + <#if content?has_content>${content.createdByUserLogin!} + +   + <#if thisNode?? && thisNode.fromDate??> + <#assign nowTime = thisNode.fromDate?string /> + <#assign shortTime = ""/> + <#if nowTime?has_content> + <#assign lastColon=nowTime?last_index_of(":") - 1/> + <#assign shortTime=nowTime[0..lastColon]/> + + ${shortTime!} + +
    +
    + <#if content?has_content>${content.contentName!} + -- + <#if content?has_content>${content.description!} + +${uiLabelMap.CommonView} + +${uiLabelMap.CommonEdit} +
    ${uiLabelMap.CommonNoRecordFound}
    + +<#assign targOp="HAS_USER_ROLE"/> +<#assign pageTargOp=targetOperation!/> +<#if pageTargOp?has_content> + <#assign targOp=pageTargOp/> + +<@checkPermission mode="equals" entityOperation="_CREATE" subContentId=contentDept statusId="CTNT_PUBLISHED" targetOperation=targOp contentPurposeList="ARTICLE" quickCheckContentId=contentIdx> + + +<@checkPermission mode="not-equals" entityOperation="_CREATE" subContentId=contentDept statusId="CTNT_PUBLISHED" targetOperation=targOp contentPurposeList="ARTICLE" quickCheckContentId=contentIdx> + + +
    +${uiLabelMap.ProductNewArticle} +
    +${uiLabelMap.EcommerceLoggedToPost} +
    +<#-- +<@checkPermission mode="not-equals" entityOperation="_CREATE" subContentId=contentIdx statusId="CTNT_PUBLISHED" targetOperation="HAS_USER_ROLE" contentPurposeList="ARTICLE"> + ${permissionErrorMsg!} + +--> + + + +<#macro renderAncestryPath trail startIndex=0 endIndexOffset=0 buttonTitle="${uiLabelMap.CommonBackTo}"> + <#local indent = ""> + <#local csv = ""> + <#local counter = 0> + <#local len = trail?size> + + <#list trail as content> + <#if counter < (len - endIndexOffset) && startIndex <= counter > + <#if 0 < counter > + <#local csv = csv + ","/> + + <#local csv = csv + content.contentId/> + <#if counter < len && startIndex <= counter > + + + + + + <#local counter = counter + 1> + <#if 20 < counter > <#break/> + +
    + ${indent} + <#if content.contentTypeId == "WEB_SITE_PUB_PT" > + ${uiLabelMap.CommonBackTo}  ${content.contentName!} + <#else> + ${uiLabelMap.CommonBackTo}to  ${content.contentName!} + + <#local indent = indent + "    "> + [${content.contentId!}]
    + + +<#macro nextPrev listSize requestURL queryString lowIndex=0 highIndex=10 viewSize=10 viewIndex=0 > + +<#assign lowIdx=lowIndex/> +<#assign highIdx=highIndex/> +<#assign viewSz=viewSize/> +<#assign viewIdx=viewIndex/> +<#assign listSz=listSize/> + +<#if !lowIdx?has_content><#assign lowIdx=0/> +<#if !highIdx?has_content><#assign highIdx=0/> +<#if !viewSz?has_content><#assign viewSz=10/> +<#if !viewIdx?has_content><#assign viewIdx=10/> +<#if !listSz?has_content><#assign listSz=0/> + +<#if queryString?has_content> + <#assign queryString = Static["org.ofbiz.base.util.UtilHttp"].stripViewParamsFromQueryString(queryString)/> + + +<#assign lowIdxShow = lowIdx + 1 /> +<#if highIdx < lowIdxShow > + <#assign lowIdxShow = highIdx/> + + + +
    + <#if 0 < listSz?number> + <#if 0 < viewIdx?number> + ${uiLabelMap.CommonPrevious} + <#else> + ${uiLabelMap.CommonPrevious} + + <#if 0 < listSz> + ${lowIdxShow} - ${highIdx!} ${uiLabelMap.CommonOf} ${listSz!} + + <#if highIdx!?number < listSz!?number> + ${uiLabelMap.CommonNext} + <#else> + ${uiLabelMap.CommonNext} + + +
    + diff --git a/template/forum/createforumarticle.ftl b/template/forum/createforumarticle.ftl new file mode 100644 index 0000000..1546a08 --- /dev/null +++ b/template/forum/createforumarticle.ftl @@ -0,0 +1,22 @@ +<#-- +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 "bloglib.ftl" as blog/> +<@blog.renderAncestryPath trail=ancestorList?default([])/> + ${singleWrapper.renderFormString()} diff --git a/template/forum/createforumresponse.ftl b/template/forum/createforumresponse.ftl new file mode 100644 index 0000000..1319f01 --- /dev/null +++ b/template/forum/createforumresponse.ftl @@ -0,0 +1,28 @@ +<#-- +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 "bloglib.ftl" as blog/> +
    +<#-- +<@blog.renderSiteAncestryPath trail=siteAncestorList?default([])/> +<@blog.renderAncestryPath trail=trailList startIndex=1/> +--> + + ${singleWrapper.renderFormString()} +
    diff --git a/template/forum/editaddforumdata.ftl b/template/forum/editaddforumdata.ftl new file mode 100644 index 0000000..0f26da2 --- /dev/null +++ b/template/forum/editaddforumdata.ftl @@ -0,0 +1,20 @@ +<#-- +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. +--> + +${singleWrapper.renderFormString()} diff --git a/template/forum/editaddimage.ftl b/template/forum/editaddimage.ftl new file mode 100644 index 0000000..9a308a1 --- /dev/null +++ b/template/forum/editaddimage.ftl @@ -0,0 +1,20 @@ +<#-- +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. +--> + + ${singleWrapper.renderFormString()} diff --git a/template/forum/editforumarticle.ftl b/template/forum/editforumarticle.ftl new file mode 100644 index 0000000..2a010bf --- /dev/null +++ b/template/forum/editforumarticle.ftl @@ -0,0 +1,94 @@ +<#-- +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 "bloglib.ftl" as blog/> +<@blog.renderAncestryPath trail=ancestorList?default([]) endIndexOffset=1/> +<#-- Main Heading --> +<#-- + + + + + +
    +

    ${contentIdTo!} +

    +
    +
    +
    +--> + +
    + + +

    ${uiLabelMap.EcommerceContentInformation}

    + +
    + + + + +
    ${uiLabelMap.ProductContentId}
     
    ${contentId!}
    ${uiLabelMap.EcommerceContentName}
     
    ${contentName!}
    ${uiLabelMap.CommonDescription}
     
    ${description!}
    +
    +
    + +
    + + +

    ${uiLabelMap.EcommerceImageInformation}

    + +
    + + +
    ${uiLabelMap.EcommerceImage}
     
    + +
    +
    +
    + +
    + +

    ${uiLabelMap.EcommerceSummaryInformation}

    +
    + + +
    ${uiLabelMap.ContentSummary}
     
    +${summaryData!} +
    +
    +
    + +
    + +

     ${uiLabelMap.EcommerceArticleInformation}

    +
    + + +
    Article
     
    +${textData!} +
    +
    +
    diff --git a/template/forum/editforuminfo.ftl b/template/forum/editforuminfo.ftl new file mode 100644 index 0000000..7ffb7f0 --- /dev/null +++ b/template/forum/editforuminfo.ftl @@ -0,0 +1,22 @@ +<#-- +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 "bloglib.ftl" as blog/> +<@blog.renderAncestryPath trail=ancestorList?default([]) endIndexOffset=1/> +${singleWrapper.renderFormString()} diff --git a/template/forum/forumPaging.ftl b/template/forum/forumPaging.ftl new file mode 100644 index 0000000..8879695 --- /dev/null +++ b/template/forum/forumPaging.ftl @@ -0,0 +1,48 @@ +<#-- +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. +--> + +<#assign viewIndex = viewIndex?default(0)> +<#assign lowIndex = viewIndex?int * viewSize?int + 1> +<#assign highIndex = viewIndex?int * viewSize?int + viewSize> +<#--
    == viewIndex: ${viewIndex} ==viewSize: ${viewSize} ==lowIndex: ${lowIndex}== highIndex: ${highIndex} == ListSize: ${listSize}--> +<#if forumMessages?has_content && forumMessages?size gt 0> + <#assign listSize = forumMessages?size/> + <#if highIndex gt listSize><#assign highIndex = listSize> +
    + <#assign r = listSize / viewSize /> + <#assign viewIndexMax = Static["java.lang.Math"].ceil(r)> + + + <#if (viewIndex?int >0)> + ${uiLabelMap.CommonPrevious} | + + <#if (listSize?int > 0)> + ${lowIndex} - ${highIndex} ${uiLabelMap.CommonOf} ${listSize} + + <#if highIndex?int < listSize?int> + | ${uiLabelMap.CommonNext} + + +
    + diff --git a/template/forum/forums.ftl b/template/forum/forums.ftl new file mode 100644 index 0000000..cf849a3 --- /dev/null +++ b/template/forum/forums.ftl @@ -0,0 +1,33 @@ +<#-- +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. +--> + +
    +
    +

    ${uiLabelMap.ProductBrowseForums}

    +
    +
    + +
    +
    \ No newline at end of file diff --git a/template/forum/messageDisplay.ftl b/template/forum/messageDisplay.ftl new file mode 100644 index 0000000..3536d16 --- /dev/null +++ b/template/forum/messageDisplay.ftl @@ -0,0 +1,53 @@ +<#-- +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. +--> + <#-- Thread content id equals contentId if contentAssocTypeId equals PUBLISH_LINK, else threadContentId = ownerContentId --> + <#assign threadContentId = forumMessage.contentId/> + <#if forumMessage.caContentAssocTypeId == "RESPONSE"> + <#assign threadContentId = forumMessage.ownerContentId!/> + + <#if rsp??> + <#assign contentId = rsp.contentId> + <#else> + <#assign contentId = forumMessage.contentId> + +
    + ${uiLabelMap.CommonTitle}: ${forumMessage.contentName!} ${uiLabelMap.CommonBy}:${forumMessage.createdByUserLogin!} ${uiLabelMap.CommonAt}: ${(forumMessage.createdDate.toString().substring(0,16))!} + ${uiLabelMap.CommonView} +
    +
    + ${forumMessage.description!} +
    + + <#-- + <#assign result = dispatcher.runSync("getPublicForumMessage", Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId", contentId, "userLogin", userLogin))/> + <#if (result.resultData)??> +
    + ${uiLabelMap.CommonTitle}: ${result.resultData.content.description!} ${uiLabelMap.CommonBy}:${result.resultData.content.createdByUserLogin} ${uiLabelMap.CommonAt}: ${result.resultData.content.createdDate.toString().substring(0,16)} + ${uiLabelMap.PartyReply} +
    +
    + <#if result.resultData.electronicText??> + ${result.resultData.electronicText.textData} + +
    +
    + <#else> +
    ${result.errorMessage!}
    + + --> diff --git a/template/forum/mostrecent.ftl b/template/forum/mostrecent.ftl new file mode 100644 index 0000000..ad6c569 --- /dev/null +++ b/template/forum/mostrecent.ftl @@ -0,0 +1,74 @@ +<#-- +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. +--> + + + + + + + <#assign row=0/> + <#list entityList as content> + <@checkPermission entityOperation="_ADMIN" targetOperation="CONTENT_PUBLISH" subContentId=forumId > + + + + <@injectNodeTrailCsv subContentId=content.contentId redo="true" contentAssocTypeId="PUBLISH_LINK"> + + + + + + + + + + <#assign row = row + 1/> + + + + <#if 0 < entityList?size > + + + + + + +
    ${uiLabelMap.CommonId}:${content.contentId} ${uiLabelMap.CommonName}:${content.contentName} + ${uiLabelMap.CommonView} + + ${uiLabelMap.CommonSubmitted}: + + + ${uiLabelMap.CommonPublish}: + +
    + ${uiLabelMap.CommonContent}:
    + <@renderSubContentCache subContentId=content.contentId/> +
    + +
    diff --git a/template/forum/showblog.ftl b/template/forum/showblog.ftl new file mode 100644 index 0000000..8650901 --- /dev/null +++ b/template/forum/showblog.ftl @@ -0,0 +1,162 @@ +<#-- +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 "/includes/bloglib.ftl" as blog/> + +
    +

    ${uiLabelMap.EcommerceFromSite}:


    +
    +<@renderSiteAncestryPath trail=siteAncestorList?default([])/> +<#if trailList?? && 1 < trailList?size > +

    ${uiLabelMap.EcommerceFromParentArticle}:


    + +<#if trailList?has_content> + <@blog.renderAncestryPath trail=trailList startIndex=1 endIndexOffset=1 /> + <#if 0 < trailList?size > + <#assign pair=trailList[trailList?size - 1]/> + <#assign pair0 = pair[0]!> + <#assign pair1 = pair[1]!> +
    +

    ${uiLabelMap.EcommerceContentFor} ${pair1!}[${pair0!}]:


    + +<#else> + + +<#assign thisContentId=subContentId!> +<#if !thisContentId?has_content> + <#assign thisContentId=contentId!> + + + + + + + +
      + <@renderSubContentCache subContentId=thisContentId /> + +<@checkPermission subContentId=subContentId targetOperation="CONTENT_CREATE|CONTENT_RESPOND" contentPurposeList="RESPONSE" > +${uiLabelMap.EcommerceRespond} + +
    + +
    + +<#-- +<@checkPermission mode="not-equals" subContentId=subContentId targetOperation="CONTENT_CREATE|CONTENT_RESPOND" contentPurposeList="RESPONSE" > + ${permissionErrorMsg!} + +--> + + + +

    ${uiLabelMap.EcommerceResponses}


    +<@loopSubContent contentAssocTypeId="RESPONSE" contentId=subContentId mapKey="" + pickWhen="contentAssocTypeId != null && contentAssocTypeId.equals(\"RESPONSE\") && mapKey == null" + followWhen="contentAssocTypeId != null && contentAssocTypeId.equals(\"RESPONSE\")"> + <@traverseSubContentCache contentAssocTypeId="RESPONSE" + pickWhen="contentAssocTypeId != null && contentAssocTypeId.equals(\"RESPONSE\")" + followWhen="contentAssocTypeId != null && contentAssocTypeId.equals(\"RESPONSE\")" + wrapTemplateId="" + > + <#assign indentStr=indent?default("0")/> + <#assign indent=indentStr?number/> + <#if 1 < indent > + <#assign fillRange=1..indent/> + <#assign indentFill=""/> + <#list fillRange as i> + <#assign indentFill = indentFill + "    " /> + + <#assign thisContentId = ""/> + <#if nodeTrailCsv??> + <#assign idList = nodeTrailCsv?split(",")/> + <#if 0 < idList?size > + <#assign thisContentId = idList?last> + + + <#if content??> + + + + + + + +<@wrapSubContentCache subContentId=subContentId wrapTemplateId="WRAP_NEXT_PREV" > + +
    + ${indentFill} + ${uiLabelMap.CommonView} + ${content.contentId!}-${content.description!}
    +
    +
    +
    + + +<#-- not used, will be deleted --> +<#macro getCurrentContent > + <#assign globalNodeTrail=globalNodeTrail/> + <#if globalNodeTrail??> + <#assign currentNode=globalNodeTrail?last/> + <#if currentNode??> + <#assign currentValue=currentNode.value/> + <#if currentValue??> + <@wrapSubContentCache subContentId=currentValue.contentId wrapTemplateId="WRAP_ARTICLE" > + <@traverseSubContentCache contentAssocTypeId="SUB_CONTENT" + pickWhen="mapKey != null && mapKey.equals(\"ARTICLE\")" + returnAfterPickWhen="mapKey != null && mapKey.equals(\"ARTICLE\")" + followWhen="contentAssocTypeId != null && contentAssocTypeId.equals(\"_never_\")" + wrapTemplateId="" + > + <#assign description=currentValue.description?default("No description")/> +${uiLabelMap.CommonDescription}[${currentValue.contentId!}]:${description} +${uiLabelMap.CommonView} + + + + + + + +<#macro renderSiteAncestryPath trail startIndex=0 > + <#assign indent = ""> + <#assign csv = ""> + <#assign counter = 0> + <#assign len = trail?size> + + <#list trail as webSitePublishPoint> + <#if counter < len && startIndex <= counter > + + + + + <#assign counter = counter + 1> + <#if 20 < counter > <#break/> + +
    + ${indent} + ${uiLabelMap.CommonBackTo}  ${webSitePublishPoint.templateTitle!} + <#assign indent = indent + "    "> + [${webSitePublishPoint.contentId!}]
    + diff --git a/template/forum/showforum.ftl b/template/forum/showforum.ftl new file mode 100644 index 0000000..e4de3fe --- /dev/null +++ b/template/forum/showforum.ftl @@ -0,0 +1,22 @@ +<#-- +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. +--> + +<#list forumMessages! as forumMessage> + <#include "messageDisplay.ftl"> + diff --git a/template/forum/showforumarticle.ftl b/template/forum/showforumarticle.ftl new file mode 100644 index 0000000..bf8a93d --- /dev/null +++ b/template/forum/showforumarticle.ftl @@ -0,0 +1,21 @@ +<#-- +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. +--> +
    +${contentText} +
    \ No newline at end of file diff --git a/template/forum/showforumresponse.ftl b/template/forum/showforumresponse.ftl new file mode 100644 index 0000000..956d70b --- /dev/null +++ b/template/forum/showforumresponse.ftl @@ -0,0 +1,160 @@ +<#-- +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 "bloglib.ftl" as blog/> +
    +

    {${uiLabelMap.EcommerceFromSite}


    +
    +<@blog.renderAncestryPath trail=ancestorList?default([]) endIndexOffset=1 /> +<#-- Do this so that we don't have to find the content twice (again in renderSubContent) --> +<#assign lastNode = globalNodeTrail!?last/> +<#if lastNode?has_content> + <#assign subContent=lastNode.value/> +<#else> +<#assign subContent = delegator.findOne("Content", Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId", subContentId), true)/> +<#assign dummy = globalNodeTrail.add(lastNode)/> + +
    +

    ${uiLabelMap.EcommerceContentFor} [${subContentId}] ${subContent.contentName!} - ${subContent.description!}:


    + +<#assign thisContentId=subContentId!> +<#if !thisContentId?has_content> + <#assign thisContentId=contentId!> + + + + + + + +
      + <@renderSubContentCache subContentId=thisContentId /> + +<@checkPermission subContentId=subContentId targetOperation="HAS_USER_ROLE" contentPurposeList="RESPONSE" > +${uiLabelMap.EcommerceRespond} + +
    + +
    +
    +<#-- +<@checkPermission mode="not-equals" subContentId=subContentId targetOperation="CONTENT_CREATE|CONTENT_RESPOND" contentPurposeList="RESPONSE" > + ${permissionErrorMsg!} + +--> + + + +

    ${uiLabelMap.EcommerceResponses}


    +<@loopSubContent contentAssocTypeId="RESPONSE" contentId=subContentId mapKey="" + pickWhen="contentAssocTypeId != null && contentAssocTypeId.equals(\"RESPONSE\") && mapKey == null" + followWhen="contentAssocTypeId != null && contentAssocTypeId.equals(\"RESPONSE\")"> + <@traverseSubContentCache contentAssocTypeId="RESPONSE" + pickWhen="contentAssocTypeId != null && contentAssocTypeId.equals(\"RESPONSE\")" + followWhen="contentAssocTypeId != null && contentAssocTypeId.equals(\"RESPONSE\")" + wrapTemplateId=""> + <#assign indentStr=indent?default("0")/> + <#assign indent=indentStr?number/> + <#if 1 < indent > + <#assign fillRange=1..indent/> + <#assign indentFill=""/> + <#list fillRange as i> + <#assign indentFill = indentFill + "    " /> + + <#assign thisContentId = ""/> + <#if nodeTrailCsv??> + <#assign idList = nodeTrailCsv?split(",")/> + <#if 0 < idList?size > + <#assign thisContentId = idList?last> + + + <#if content??> + + + + + + + + +<#-- +<@wrapSubContentCache subContentId=subContentId wrapTemplateId="WRAP_NEXT_PREV" > + +--> + +
    + ${indentFill} + ${uiLabelMap.CommonView} + ${content.contentId!}-${content.description!}
    +
    +
    +
    + + +<#-- not used, will be deleted --> +<#macro getCurrentContent > + <#assign globalNodeTrail=globalNodeTrail/> + <#if globalNodeTrail??> + <#assign currentNode=globalNodeTrail?last/> + <#if currentNode??> + <#assign currentValue=currentNode.value/> + <#if currentValue??> + <@wrapSubContentCache subContentId=currentValue.contentId wrapTemplateId="WRAP_ARTICLE" > + <@traverseSubContentCache contentAssocTypeId="SUB_CONTENT" + pickWhen="mapKey != null && mapKey.equals(\"ARTICLE\")" + returnAfterPickWhen="mapKey != null && mapKey.equals(\"ARTICLE\")" + followWhen="contentAssocTypeId != null && contentAssocTypeId.equals(\"_never_\")" + wrapTemplateId="" + > + <#assign description=currentValue.description?default("No description")/> +${uiLabelMap.CommonDescription}[${currentValue.contentId!}]:${description} +${uiLabelMap.CommonView} + + + + + + + +<#macro renderSiteAncestryPath trail startIndex=0 > + <#assign indent = ""> + <#assign csv = ""> + <#assign counter = 0> + <#assign len = trail?size> + + <#list trail as webSitePublishPoint> + <#if counter < len && startIndex <= counter > + + + + + <#assign counter = counter + 1> + <#if 20 < counter > <#break/> + +
    + ${indent} + ${uiLabelMap.CommonBackTo}  ${webSitePublishPoint.templateTitle!} + <#assign indent = indent + "    "> + [${webSitePublishPoint.contentId!}]
    + diff --git a/template/images/blog.css b/template/images/blog.css new file mode 100644 index 0000000..5524b8d --- /dev/null +++ b/template/images/blog.css @@ -0,0 +1,241 @@ +/* + * 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. + */ + +.blogs { +position: inherit; +width: inherit; +font-size: 100%; +text-decoration: none; +font-family: Verdana, Arial, Helvetica, sans-serif; +} + +.treeHeader, .treeHeaderCurrent { +color: black; +font-weight: bold; +text-decoration: none; +} + +.treeHeaderCurrent { +color: black; +font-weight: bold; +} + +.treeHeaderOutline { +color: black; +font-weight: normal; +} + +.treeHeaderPage { +color: blue; +font-weight: bold; +text-decoration: none; +} + +.treeHeaderSubPage { +color: blue; +font-weight: normal; +text-decoration: none; +text-align: right; +width: 100%; +} + +.tocItem { +color: blue; +text-decoration: none; +} + +.tocItemCurrent { +color: black; +font-weight: bold; +} + +.editwrapper { +color: black; +background: #ffffff; +text-decoration: none; +margin-left: 12px; +margin-top: 2px; +border-top: 1px solid black; +border-left: 1px solid black; +} + +.contentwrapper { +color: black; +background: #ffffff; +text-decoration: none; +margin-left: 12px; +margin-top: 2px; +} + +.floatleft { +display: inline; +position: relative; +vertical-align: text-top; +/*float: left;*/ +} + +.topcentered { +display: block; +text-align: center; +} + +/* +.rightjustify { +float: right; +padding-left: 5px; +display: inline; +vertical-align: top; +text-align: right; +width: 100%; +height: 100%; +} +*/ +.rightjustify { +display: inline; +vertical-align: text-top; +float: right; +} + +.leftjustify { +display: inline; +vertical-align: text-top; +float: left; +} + +.blogheader { +color: black; +font-weight: bold; +text-align: left; +margin-top: 10px; +margin-left: 10px; +} + +.blogtext { +color: #222222; +font-weight: normal; +text-align: left; +margin-left: 20px; +font-size: 1.0em; +} + +.blogtext:hover { +background: #fffeee; +} + +.blogtitle, A.blogtitle { +color: white; +font-weight: bold; +text-align: left; +text-decoration: none; +display: inline; +} + +A.blogtitle:hover { +text-decoration: underline; +} + +.blogtitleboxed { +font-size: 1.1em; +color: black; +background: #D4D0C8; +text-decoration: none; +border: 1px solid black; +padding: 4px; +display: inline; +} + +.bloghr { +border: 0.1em solid #999999; +color: white; +background: #1C334D; +padding: 4px; +height: 13px; +} + +.blogwrapper { +background: #eeeeee; +padding: 4px; +margin-top: 6px; +font-weight: normal; +text-align: left; +} + +.blogwrapper:hover { +background: #fffeee; +} + +.blogcontentwrapper { +background: #f8f8f8; +font-size: 1.1em; +border: 1px solid #000000; +padding: 15px 5px 15px 5px; +margin-top: 6px; +margin-bottom: 16px; +color: black; +font-weight: normal; +text-align: left; +} + +.blogcontentwrapper:hover { +background: #fffeee; +} + +.responseheader, A.responseheader { +color: #000099; +font-size: 0.9em; +font-weight: bold; +text-align: left; +text-decoration: none; +margin-left: 10px; +} + +A.responseheader:hover { +color: #ff0000; +text-decoration: underline; +} + +.responsetext { +color: #222222; +font-size: 0.75em; +font-weight: normal; +text-align: left; +margin-left: 20px; +} + +.responseTreeWrapper:hover { +background: #fffeee; +} + +.responseTreeWrapper { +color: black; +background: #ffffff; +font-weight: normal; +text-align: left; +text-decoration: none; +margin-left: 12px; +margin-top: 2px; +border-top: 1px solid black; +border-left: 1px solid black; +} + +.responseSelected { +background: #BBBBBB; +border: 1px dashed black; +} + diff --git a/template/images/checkoutProcess.js b/template/images/checkoutProcess.js new file mode 100644 index 0000000..27afaf9 --- /dev/null +++ b/template/images/checkoutProcess.js @@ -0,0 +1,637 @@ +/* + * 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. + */ +var isCartStepValidate = false; +var isShipStepValidate = false; +var isShipOptionStepValidate = false; +var isBillStepValidate = false; + +jQuery(document).ready(function(){ + // Cart + var validateCart = jQuery("#cartForm"); + validateCart.validate(); + + var validateShip = jQuery("#shippingForm"); + validateShip.validate(); + + var validateShipOption = jQuery("#shippingOptionForm"); + validateShipOption.validate(); + + var validateBill = jQuery("#billingForm"); + validateBill.validate(); + + // Goto Edit Cart Panel + jQuery('#openCartPanel').click(function() { + showEditCartPanel(); + updateShippingSummary(); + }); + + // Update Shipping Address + jQuery('#savePartyAndShippingContact').click(function() { + if (validateShip.valid()) { + jQuery('#savePartyAndShippingContact').fadeOut('fast'); + jQuery('#processingShippingOptions').fadeIn('fast'); + if (createUpdateCustomerAndShippingAddress()){ + showEditShippingOptionPanel(); + } + jQuery('#processingShippingOptions').fadeOut('fast'); + jQuery('#savePartyAndShippingContact').fadeIn('fast'); + } + }); + + // Goto Edit Shipping panel + jQuery('#updateShoppingCart').click(function() { + if (validateCart.valid()) { + showEditShippingPanel(); + } + }); + // Goto Edit Shipping Panel + jQuery('#openShippingPanel').click(function() { + showEditShippingPanel(); + setShippingOption(); + }); + + // Set Shipping Method to card and goto Billing step + jQuery('#saveShippingMethod').click(function() { + jQuery('#saveShippingMethod').fadeOut('fast'); + jQuery('#processingBilling').fadeIn('fast'); + if (setShippingOption()){ + showEditBillingPanel(); + } + jQuery('#processingBilling').fadeOut('fast'); + jQuery('#saveShippingMethod').fadeIn('fast'); + }); + + jQuery('#openShippingOptionPanel').click(function() { + showEditShippingOptionPanel(); + updateBillingSummary(); + }); + + // Billing + jQuery('#openBillingPanel').click(function() { + showEditBillingPanel(); + }); + + jQuery('#savePaymentAndBillingContact').click(function() { + if (validateBill.valid()) { + jQuery('#savePaymentAndBillingContact').fadeOut('fast'); + jQuery('#processingOrderSubmitPanel').fadeIn('fast'); + if (processBillingAndPayment()) { + showOrderSubmitPanel(); + } + jQuery('#processingOrderSubmitPanel').fadeOut('fast'); + jQuery('#savePaymentAndBillingContact').fadeIn('fast'); + } + }); + + // For Billing Address Same As Shipping + jQuery('#useShippingAddressForBilling').click(function() { + useShippingAddressForBillingToggle(); + validateBill.valid(); + }); + + // Initiate Observing Edit Cart Events + initCartProcessObservers(); + + jQuery('#processOrderButton').click(function(){ + processOrder(); + }); + + if (jQuery('#shippingForm').length) { + // Get associate states for Shipping Information + jQuery('#shipToCountryGeoId').change(function(){ + getAssociatedStateList('shipToCountryGeoId', 'shipToStateProvinceGeoId', 'advice-required-shipToStateProvinceGeoId', 'shipToStates'); + }); + if (jQuery('#userLoginId').length) { + var stateValue = jQuery('#shipToStateProvinceGeoId').val(); + getAssociatedStateList('shipToCountryGeoId', 'shipToStateProvinceGeoId', 'advice-required-shipToStateProvinceGeoId', 'shipToStates'); + jQuery('#shipToStateProvinceGeoId').val(stateValue); + stateValue = jQuery('#billToStateProvinceGeoId').val(); + getAssociatedStateList('billToCountryGeoId', 'billToStateProvinceGeoId', 'advice-required-billToStateProvinceGeoId', 'billToStates'); + jQuery('#billToStateProvinceGeoId').val(stateValue); + } else { + getAssociatedStateList('shipToCountryGeoId', 'shipToStateProvinceGeoId', 'advice-required-shipToStateProvinceGeoId', 'shipToStates'); + getAssociatedStateList('billToCountryGeoId', 'billToStateProvinceGeoId', 'advice-required-billToStateProvinceGeoId', 'billToStates'); + } + } + if (jQuery('#billingForm').length) { + // Get associate states for Billing Information + jQuery('#billToCountryGeoId').change(function() { + getAssociatedStateList('billToCountryGeoId', 'billToStateProvinceGeoId', 'advice-required-billToStateProvinceGeoId', 'billToStates'); + }); + } +}); + +// Check server side error +function getServerError(data) { + var serverErrorHash = []; + var serverError = ""; + if (data._ERROR_MESSAGE_LIST_ != undefined) { + serverErrorHash = data._ERROR_MESSAGE_LIST_; + jQuery.each(serverErrorHash, function(i, error) { + var encodedErrorMessage = jQuery('
    ').text(error.message).html(); + serverError += encodedErrorMessage + '
    '; + }); + } + if (data._ERROR_MESSAGE_ != undefined) { + serverError = jQuery('
    ').text(data._ERROR_MESSAGE_).html(); + } + return serverError; +} + +// Begin Show/Hide Step panels + +function hideEditCartPanel() { + if (jQuery('#editCartPanel').is(':visible')) { + jQuery('#editCartPanel').slideUp(); + jQuery('#cartSummaryPanel').slideDown(); + } +} +function hideEditShippingPanel() { + if (jQuery('#editShippingPanel').is(':visible')) { + jQuery('#editShippingPanel').slideUp(); + jQuery('#shippingSummaryPanel').slideDown(); + } +} +function hideEditShippingOptionPanel() { + if (jQuery('#editShippingOptionPanel').is(':visible')) { + jQuery('#editShippingOptionPanel').slideUp(); + jQuery('#shippingOptionSummaryPanel').slideDown(); + } +} +function hideEditBillingPanel() { + if (jQuery('#editBillingPanel').is(':visible')) { + jQuery('#editBillingPanel').slideUp(); + jQuery('#billingSummaryPanel').slideDown(); + } +} +function hideOrderSubmitPanel() { + if (jQuery('#orderSubmitPanel').is(':visible')) { + jQuery('#orderSubmitPanel').slideUp(); + jQuery('#processingOrderButton').slideDown(); + + } +} + +function showEditCartPanel() { + if (!jQuery('#editCartPanel').is(':visible') ) { + jQuery('#cartSummaryPanel').slideUp(); + hideEditShippingPanel(); + hideEditShippingOptionPanel(); + hideEditBillingPanel(); + hideOrderSubmitPanel(); + jQuery('#editCartPanel').slideDown(); + } +} + +function showEditShippingPanel() { + if (!jQuery('#editShippingPanel').is(':visible') ) { + jQuery('#shippingSummaryPanel').slideUp(); + hideEditCartPanel(); + hideEditShippingOptionPanel(); + hideEditBillingPanel(); + hideOrderSubmitPanel(); + jQuery('#editShippingPanel').slideDown(); + + } +} + +function showEditShippingOptionPanel() { + if (!jQuery('#editShippingOptionPanel').is(':visible') ) { + jQuery('#shippingOptionSummaryPanel').slideUp(); + hideEditCartPanel(); + hideEditShippingPanel(); + hideEditBillingPanel(); + hideOrderSubmitPanel(); + jQuery('#editShippingOptionPanel').slideDown(); + } +} + +function showEditBillingPanel() { + if (!jQuery('#editBillingPanel').is(':visible') ) { + jQuery('#billingSummaryPanel').slideUp(); + hideEditCartPanel(); + hideEditShippingPanel(); + hideEditShippingOptionPanel(); + hideOrderSubmitPanel(); + jQuery('#editBillingPanel').slideDown(); + } + if (jQuery('#shipToContactMechId').val() != jQuery('#billToContactMechId').val()) { + jQuery('#useShippingAddressForBilling').val('false'); + jQuery('#billingAddress').slideDown(); + jQuery('#useShippingAddressForBilling').val('N'); + } +} + +function showOrderSubmitPanel() { + if (!jQuery('#orderSubmitPanel').is(':visible')) { + hideEditCartPanel(); + hideEditShippingPanel(); + hideEditShippingOptionPanel(); + hideEditBillingPanel(); + jQuery('#orderSubmitPanel').slideDown(); + } +} + +// End Show/Hide Step panels + +function createUpdateCustomerAndShippingAddress() { + var result = false; + jQuery.ajax({ + url: 'createUpdateShippingAddress', + type: 'POST', + async: false, + data: jQuery('#shippingForm').serialize(), + success: function(json) { + var serverError = getServerError(json); + if (!serverError) { + jQuery('#shippingFormServerError').fadeOut('fast'); + // Process Shipping data response. + jQuery('#shipToPartyId').val(json.partyId); + jQuery('#billToPartyId').val(json.partyId); + jQuery('#shipToContactMechId').val(json.contactMechId); + jQuery('#shipToPhoneContactMechId').val(json.shipToPhoneContactMechId); + jQuery('#emailContactMechId').val(json.emailContactMechId); + //jQuery('#completedShippingMethod').html(json.shippingDescription); + updateShippingSummary(); + getShipOptions(); + result = true; + } else { + jQuery('#shippingFormServerError').html(serverError); + result = false; + } + }, + error: function(error) { + if (error != "") { + jQuery('#shippingFormServerError').html(error); + } + result = false; + } + }); + return result; +} + +function getShipOptions() { + var shipOptions = null; + var optionList = []; + var result = false; + if (jQuery('#shipMethod').val() == "" || jQuery('#shipMethod').val() == null) { + jQuery.ajax({ + url: 'getShipOptions', + type: 'POST', + async: false, + success: function(json) { + var serverError = getServerError(json); + if (!serverError) { + jQuery('#shippingFormServerError').fadeOut('fast'); + isShipStepValidate = true; + shipOptions = json.shippingOptions; + var shipMethod = jQuery('#shipMethod'); + shipMethod.find("option").remove(); + jQuery.each(shipOptions, function(shipOption) { + if (this.productStoreShipMethId){ + shipMethod.append(jQuery("")); + } else { + shipMethod.append(jQuery("")); + } + }); + result = true; + } else { + jQuery('#shippingFormServerError').html(serverError); + result = false; + } + }, + error: function(error) { + if (error != "") { + jQuery('#shippingFormServerError').fadeIn('fast'); + jQuery('#shippingFormServerError').html(error); + isShipStepValidate = false; + } + result = false; + } + }); + } + return result; +} + +// Shipping option +function setShippingOption() { + var shipTotal = null; + var shipMethod = null; + var result = false; + jQuery('#shippingOptionFormServerError').fadeOut('fast'); + jQuery.ajax({ + url: 'setShippingOption', + type: 'POST', + async: false, + data: jQuery('#shippingOptionForm').serialize(), + success: function(json) { + var serverError = getServerError(json); + if (!serverError) { + shipTotal = json.shippingTotal; + isShipOptionStepValidate = true; + jQuery('#selectedShipmentOption').html(json.shippingDescription); + //jQuery('#shippingDescription').value = json.shippingDescription; + //jQuery('#shippingTotal').val(json.shippingTotal); + //jQuery('#cartGrandTotal').val(json.cartGrandTotal); + //jQuery('#totalSalesTax').val(json.totalSalesTax); + result = true; + } else { + jQuery('#shippingFormServerError').html(serverError); + result = false; + } + }, + error: function(error) { + if(error != "") { + jQuery('#shippingOptionFormServerError').fadeIn('fast'); + jQuery('#shippingOptionFormServerError').html(error); + isShipOptionStepValidate = false; + } + result = false; + } + }); + updateCartData(); + return result; +} +// Billing +function useShippingAddressForBillingToggle() { + if (jQuery('#useShippingAddressForBilling').is(':checked') ) { + jQuery('#billToAddress1').val(jQuery('#shipToAddress1').val()); + jQuery('#billToAddress2').val(jQuery('#shipToAddress2').val()); + jQuery('#billToCity').val(jQuery('#shipToCity').val()); + jQuery('#billToPostalCode').val(jQuery('#shipToPostalCode').val()); + jQuery('#billToCountryGeoId').val(jQuery('#shipToCountryGeoId').val()); + getAssociatedStateList('billToCountryGeoId', 'billToStateProvinceGeoId','advice-required-billToStateProvinceGeoId','billToStates'); + jQuery('#useShippingAddressForBilling').val("Y"); + jQuery('#billToStateProvinceGeoId').val(jQuery('#shipToStateProvinceGeoId').val()); + jQuery('#billingAddress').slideUp(); + } else { + jQuery('#billingAddress').slideDown(); + jQuery('#useShippingAddressForBilling').val("N"); + } +} +function processBillingAndPayment() { + var result = false; + jQuery.ajax({ + url: 'createUpdateBillingAndPayment', + type: 'POST', + data: jQuery('#billingForm').serialize(), + async: false, + success: function(json) { + var serverError = getServerError(json); + if (!serverError) { + jQuery('#billingFormServerError').fadeOut('fast'); + isBillStepValidate = true; + jQuery('#billToContactMechId').val(json.contactMechId); + jQuery('#paymentMethodId').val(json.paymentMethodId); + jQuery('#billToPhoneContactMechId').val(json.billToPhoneContactMechId); + updateBillingSummary(); + result = true; + } else { + jQuery('#billingFormServerError').html(serverError); + result = false; + } + }, + error: function(error) { + if(error != "") { + jQuery('#billingFormServerError').fadeIn('fast'); + jQuery('#billingFormServerError').html(error); + isBillStepValidate = false; + } + result = false; + } + }); + return result; + +} +function initCartProcessObservers() { + var cartForm = jQuery('#cartForm'); + jQuery('#productPromoCode').change(function() { + addPromoCode(); + }); + jQuery('#updateShoppingCart').click(function() { + showEditShippingPanel(); + }); + jQuery('#openCartPanel').click(function() { + showEditCartPanel(); + updateShippingSummary(); + }); + var inputs = cartForm.find('input[type=text]'); + inputs.each(function(e) { + if(this.id != 'productPromoCode' && this.id != undefined) { + jQuery(this).change(function() { + cartItemQtyChanged(this); + }); + } + }); + var links = jQuery("#cartForm a[id^='removeItemLink_']"); + jQuery.each(links, function() { + jQuery(this).bind('click', function(){ + removeItem(this); + }); + }); + if (jQuery('#initializedCompletedCartDiscount').length && jQuery('#initializedCompletedCartDiscount').val() == 0) { + jQuery('#completedCartDiscountRow').hide(); + } +} +function addPromoCode() { + jQuery.ajax({ + url: 'silentAddPromoCode', + type: 'POST', + data: {"productPromoCodeId" : jQuery('#productPromoCode').val()}, + success: function(json) { + var serverError = getServerError(json); + if (!serverError) { + jQuery('#cartFormServerError').fadeOut('fast'); + updateCartData(); + } else { + jQuery('#shippingFormServerError').html(serverError); + result = false; + } + }, + error: function(error) { + if(error != "") { + jQuery('#cartFormServerError').fadeIn('fast'); + jQuery('#cartFormServerError').html(error); + } + } + }); +} + +function getProductLineItemIndex(event, productId) { + var itemIndex = null; + var productIdParam = "productId=" + productId; + var formValues = jQuery('#cartForm').serialize() + "&" + productIdParam; + jQuery.ajax({ + url: 'getShoppingCartItemIndex', + type: 'POST', + async: false, + data: formValues, + success: function(json) { + var serverError = getServerError(json); + if (!serverError) { + itemIndex = json.itemIndex; + } else { + jQuery('#shippingFormServerError').html(serverError); + } + } + }); + return itemIndex; +} + +function removeItem(elmt) { + var removeElement = elmt; + var elementId = removeElement.id; + var qtyId = elementId.replace('removeItemLink_', 'qty_'); + var productIdElementId = elementId.replace('removeItemLink_', 'cartLineProductId_'); + var productId = jQuery("#" + productIdElementId).val(); + var itemIndex = getProductLineItemIndex(elmt, productId); + var formValues = "update_" + itemIndex + "= 0"; + if (jQuery(qtyId).val() == '' || isNaN(jQuery(qtyId).val())) { + jQuery(qtyId).val("0"); + } + updateCartData(qtyId, formValues, 0, itemIndex); +} + +function cartItemQtyChanged(elmt) { + var qtyElement = elmt; + var elementId = qtyElement.id; + var productIdElementId = elementId.replace('qty_', 'cartLineProductId_'); + var productId = jQuery("#" + productIdElementId).val(); + if (jQuery(qtyElement).val() && jQuery(qtyElement).val() >= 0 && !isNaN(jQuery(qtyElement).val())) { + var itemIndex = getProductLineItemIndex(elmt, productId); + qtyParam = "update_" + itemIndex +"="+jQuery(qtyElement).val(); + var formValues = jQuery('#cartForm').serialize() + '&' + qtyParam; + updateCartData(elementId, formValues, qtyElement.value, itemIndex); + } +} + +function updateCartData(elementId, formValues, itemQty, itemIndex) { + jQuery.ajax({ + url: 'cartItemQtyUpdate', + type: 'POST', + data: formValues, + success: function(json) { + var serverError = getServerError(json); + if (!serverError) { + if (json.totalQuantity == 0) { + jQuery('#emptyCartCheckoutPanel').show(); + jQuery('#checkoutPanel').hide(); + jQuery('#microCartNotEmpty').hide(); + jQuery('#microCartEmpty').show(); + jQuery('#quickCheckoutEnabled').hide(); + jQuery('#quickCheckoutDisabled').show(); + jQuery('#onePageCheckoutEnabled').hide(); + jQuery('#onePageCheckoutDisabled').show(); + jQuery('#googleCheckoutEnabled').hide(); + jQuery('#googleCheckoutDisabled').show(); + jQuery('#microCartPayPalCheckout').hide(); + } else { + // Replace whole cart panel with updated cart values for updating line item in case of gift item is added or remove in cart after applying coupon code + // No need to calculate individual value for shopping cart when whole cart is updating + jQuery.ajax({ + url: 'UpdateCart', + type: 'POST', + cache: false, + success: function(data) { + jQuery('#cartPanel').html(data); + initCartProcessObservers(); + } + }); + } + } else { + jQuery('#shippingFormServerError').html(serverError); + result = false; + } + } + }); +} +function processOrder() { + jQuery('#processOrderButton').disabled = true ; + jQuery('#processOrderButton').fadeOut('fast'); + jQuery('#processingOrderButton').fadeIn('fast'); + jQuery('#orderSubmitForm').submit(); +} +function getAssociatedBillingStateList(formName, divId) { + var optionList = []; + jQuery.ajax({ + url: "getAssociatedStateList", + data: jQuery(formName).serialize(), + async: false, + success: function(transport) { + stateList = data.stateList; + var billingStates = jQuery("#" + divId); + billingStates.find("option").remove(); + jQuery.each(stateList, function(state) { + geoVolues = this.split(': '); + billingStates.append(jQuery("")); + }); + } + }); +} + +function updateShippingSummary() { + var fullName = jQuery('#firstName').val() + " " +jQuery('#lastName').val(); + var extension = ""; + if (jQuery('#shipToExtension').val()) { + extension = "-" + jQuery('#shipToExtension').val(); + } + var shippingContactPhoneNumber = jQuery('#shipToCountryCode').val()+ "-" + jQuery('#shipToAreaCode').val() + + "-" + jQuery('#shipToContactNumber').val() + extension; + jQuery('#completedShipToAttn').html("Attn: " + fullName); + jQuery('#completedShippingContactNumber').html(shippingContactPhoneNumber); + jQuery('#completedEmailAddress').html(jQuery('#emailAddress').val()); + jQuery('#completedShipToAddress1').html(jQuery('#shipToAddress1').val()); + jQuery('#completedShipToAddress2').html(jQuery('#shipToAddress2').val()); + if (jQuery('#shipToStateProvinceGeoId').val() == "_NA_") { + var shipToGeo = jQuery('#shipToCity').val()+", "+jQuery('#shipToCountryGeoId').val()+" "+jQuery('#shipToPostalCode').val(); + } + else { + var shipToGeo = jQuery('#shipToCity').val()+","+jQuery('#shipToStateProvinceGeoId').val() +" "+jQuery('#shipToCountryGeoId').val()+" "+jQuery('#shipToPostalCode').val(); + } + jQuery('#completedShipToGeo').html(shipToGeo); + // set shipToContactMechId in Billing form. + jQuery('#shipToContactMechIdInBillingForm').val(jQuery('#shipToContactMechId').val()); +} + +function updateBillingSummary() { + var fullName = jQuery('#firstNameOnCard').val() + " " +jQuery('#lastNameOnCard').val(); + jQuery('#completedBillToAttn').html("Attn: " + fullName); + var extension = ""; + if (jQuery('#billToExtension').val()) { + extension = "-" + jQuery('#billToExtension').val(); + } + var billToPhoneNumber = jQuery('#billToCountryCode').val() + "-" + jQuery('#billToAreaCode').val() + "-" + jQuery('#billToContactNumber').val() + extension; + jQuery('#completedBillToPhoneNumber').html(billToPhoneNumber); + var cardNumber = "CC#:XXXXXXXXXXXX"+jQuery('#cardNumber').val().replace('-','').slice(12,16); + jQuery('#completedCCNumber').html(cardNumber); + var expiryDate = "Expires:"+jQuery('#expMonth').val()+"/"+jQuery('#expYear').val(); + jQuery('#completedExpiryDate').html(expiryDate); + jQuery('#completedBillToAddress1').html(jQuery('#billToAddress1').val()); + jQuery('#completedBillToAddress2').html(jQuery('#billToAddress2').val()); + if (jQuery('#billToStateProvinceGeoId').val() == "_NA_") { + var billToGeo = jQuery('#billToCity').val()+", "+jQuery('#billToCountryGeoId').val()+" "+jQuery('#billToPostalCode').val(); + } + else { + var billToGeo = jQuery('#billToCity').val()+", "+jQuery('#billToStateProvinceGeoId').val() +" "+jQuery('#billToCountryGeoId')+" "+jQuery('#billToPostalCode').val(); + } + jQuery('#completedBillToGeo').html(billToGeo); + jQuery('#paymentMethod').html(jQuery('#paymentMethodTypeId').val()); + jQuery('#billToContactMechIdInShipingForm').val(jQuery('#billToContactMechId')); +} + diff --git a/template/images/productAdditionalView.js b/template/images/productAdditionalView.js new file mode 100644 index 0000000..a028a43 --- /dev/null +++ b/template/images/productAdditionalView.js @@ -0,0 +1,56 @@ +/* +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. +*/ + +imgView = { + init: function() { + if (document.getElementById) { + allAnchors = document.getElementsByTagName('a'); + if (allAnchors.length) { + for (var i = 0; i < allAnchors.length; i++) { + if (allAnchors[i].getAttributeNode('swapDetail') && allAnchors[i].getAttributeNode('swapDetail').value != '') { + allAnchors[i].onmouseover = imgView.showImage; + allAnchors[i].onmouseout = imgView.showDetailImage; + } + } + } + } + }, + showDetailImage: function() { + var mainImage = document.getElementById('detailImage'); + mainImage.src = document.getElementById('originalImage').value; + return false; + }, + showImage: function() { + var mainImage = document.getElementById('detailImage'); + mainImage.src = this.getAttributeNode('swapDetail').value; + return false; + }, + addEvent: function(element, eventType, doFunction, useCapture) { + if (element.addEventListener) { + element.addEventListener(eventType, doFunction, useCapture); + return true; + }else if (element.attachEvent) { + var r = element.attachEvent('on' + eventType, doFunction); + return r; + }else { + element['on' + eventType] = doFunction; + } + } +} +jQuery(document).ready(imgView.init); diff --git a/template/images/profile.js b/template/images/profile.js new file mode 100644 index 0000000..0c34862 --- /dev/null +++ b/template/images/profile.js @@ -0,0 +1,328 @@ +/* +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. +*/ + +jQuery(document).ready( function() { + + // register a new user/customer + if (document.getElementById('newUserForm')) { + jQuery("#newUserForm").validate(); + + jQuery("#emailAddress").change(setUserNameFromEmail); + useShippingAddressAsBillingToggle(); + + jQuery("#useShippingAddressForBilling").click(useShippingAddressAsBillingToggle); + jQuery("#submitNewUserForm").click(submitValidNewUser); + // Get associate states for Shipping Information + jQuery("#shipToCountryGeoId").change( function(){ + getAssociatedStateList('shipToCountryGeoId', 'shipToStateProvinceGeoId', 'advice-required-shipToStateProvinceGeoId', 'shipToStates'); + }); + // Get associate states for Billing Information + jQuery("#billToCountryGeoId").change( function(){ + getAssociatedStateList('billToCountryGeoId', 'billToStateProvinceGeoId', 'advice-required-billToStateProvinceGeoId', 'billToStates'); + }); + getAssociatedStateList('shipToCountryGeoId', 'shipToStateProvinceGeoId', 'advice-required-shipToStateProvinceGeoId', 'shipToStates'); + getAssociatedStateList('billToCountryGeoId', 'billToStateProvinceGeoId', 'advice-required-billToStateProvinceGeoId', 'billToStates'); + } + + // edit user information form validation + if (document.getElementById('editUserForm')) { + jQuery("#editUserForm").validate(); + } + + // add Address validation + if (document.getElementById('addAddress')) { + jQuery("#createPostalAddressForm").validate(); + } + + // special validation on blur for phone number fields + if (document.getElementById('shipToPhoneRequired')) { + jQuery("#shipToCountryCode").blur( function() { + validatePhoneNumber('shipToPhoneRequired', 'shipToCountryCode', 'shipToAreaCode', 'shipToContactNumber'); + }); + jQuery("#shipToAreaCode").blur( function() { + validatePhoneNumber('shipToPhoneRequired', 'shipToAreaCode', 'shipToCountryCode', 'shipToContactNumber'); + }); + jQuery("#shipToContactNumber").blur( function() { + validatePhoneNumber('shipToPhoneRequired', 'shipToContactNumber', 'shipToCountryCode', 'shipToAreaCode'); + }); + } + if (document.getElementById('billToPhoneRequired')) { + jQuery("#billToCountryCode").blur( function() { + validatePhoneNumber('billToPhoneRequired', 'billToCountryCode', 'billToAreaCode', 'billToContactNumber'); + }); + jQuery("#billToAreaCode").blur( function() { + validatePhoneNumber('billToPhoneRequired', 'billToAreaCode', 'billToCountryCode', 'billToContactNumber'); + }); + jQuery("#billToContactNumber").blur( function() { + validatePhoneNumber('billToPhoneRequired', 'billToContactNumber', 'billToCountryCode', 'billToAreaCode'); + }); + } + + // postal address validation and geo autocomplete + if (document.getElementById('createPostalAddressForm')) { + jQuery("#createPostalAddressForm").validate(); + + // Get associate states for Postal Address Information + jQuery("#countryGeoId").change( function() { + getAssociatedStateList('countryGeoId', 'stateProvinceGeoId', 'advice-required-stateProvinceGeoId', 'states'); + }); + getAssociatedStateList('countryGeoId', 'stateProvinceGeoId', 'advice-required-stateProvinceGeoId', 'states'); + } + if (document.getElementById('editBillToPostalAddress')) { + // Get associate states for Billing Information + jQuery("#billToCountryGeoId").change( function() { + getAssociatedStateList('billToCountryGeoId', 'billToStateProvinceGeoId', 'advice-required-billToStateProvinceGeoId', 'billToStates'); + }); + if(document.getElementById('billToStateProvinceGeoId').value == "_NA_"){ + getAssociatedStateList('billToCountryGeoId', 'billToStateProvinceGeoId', 'advice-required-billToStateProvinceGeoId', 'billToStates'); + } else { + stateValue = document.getElementById('billToStateProvinceGeoId').value; + getAssociatedStateList('billToCountryGeoId', 'billToStateProvinceGeoId', 'advice-required-billToStateProvinceGeoId', 'billToStates'); + document.getElementById('billToStateProvinceGeoId').value = stateValue; + } + } + if (document.getElementById ('editShipToPostalAddress')) { + // Get associate states for Shipping Information + jQuery("#shipToCountryGeoId").change( function() { + getAssociatedStateList('shipToCountryGeoId', 'shipToStateProvinceGeoId', 'advice-required-shipToStateProvinceGeoId', 'shipToStates'); + }); + if(document.getElementById('shipToStateProvinceGeoId').value == "_NA_"){ + getAssociatedStateList('shipToCountryGeoId', 'shipToStateProvinceGeoId', 'advice-required-shipToStateProvinceGeoId', 'shipToStates'); + } else { + var stateValue = document.getElementById('shipToStateProvinceGeoId').value; + getAssociatedStateList('shipToCountryGeoId', 'shipToStateProvinceGeoId', 'advice-required-shipToStateProvinceGeoId', 'shipToStates'); + document.getElementById('shipToStateProvinceGeoId').value = stateValue; + } + } +}); + +/* + * This function is used for validation of Phone number with only 1 error message instead of multiple (for eg: required) on label. + * It takes following parameters :- + * 1) errorDivId : div to display error, + * 2) focusedTextId : Text box, last focused, + * 3) textToCheck1, textToCheck2 : Other text boxes to be check. + */ +function validatePhoneNumber(errorDivId, focusedTextId, textToCheck1, textToCheck2) { + if ((document.getElementById(focusedTextId).value == "")) { + jQuery("#" + errorDivId).fadeIn("fast"); + } else if ((document.getElementById(textToCheck1).value != "") && (document.getElementById(textToCheck2).value != "" )) { + jQuery("#" + errorDivId).fadeOut("fast"); + } +} + +function submitValidNewUser() { + + validatePhoneNumber('shipToPhoneRequired', 'shipToContactNumber', 'shipToCountryCode', 'shipToAreaCode'); + validatePhoneNumber('billToPhoneRequired', 'billToContactNumber', 'billToCountryCode', 'billToAreaCode'); + if (jQuery("#newUserForm").valid()) { + document.getElementById('newUserForm').submit(); + } +} + +function submitValidEditUser() { + document.getElementById('editUserForm').submit(); +} + +function submitValidPostalAddress() { + document.getElementById('createPostalAddressForm').submit(); +} + +function setUserNameFromEmail() { + if (document.getElementById('username').value == "") { + document.getElementById('username').value = document.getElementById('emailAddress').value; + } +} + +function useShippingAddressAsBillingToggle() { + if (document.getElementById('useShippingAddressForBilling').checked) { + document.getElementById('billToAddress1').value = document.getElementById('shipToAddress1').value; + document.getElementById('billToAddress2').value = document.getElementById('shipToAddress2').value; + document.getElementById('billToCity').value = document.getElementById('shipToCity').value; + document.getElementById('billToCountryGeoId').value = document.getElementById('shipToCountryGeoId').value; + getAssociatedStateList('billToCountryGeoId', 'billToStateProvinceGeoId', 'advice-required-billToStateProvinceGeoId', 'billToStates'); + document.getElementById('billToStateProvinceGeoId').value = document.getElementById('shipToStateProvinceGeoId').value; + document.getElementById('billToPostalCode').value = document.getElementById('shipToPostalCode').value; + + document.getElementById('billToAddress1').disabled = true ; + document.getElementById('billToAddress2').disabled = true ; + document.getElementById('billToCity').disabled = true ; + document.getElementById('billToCountryGeoId').disabled = true ; + document.getElementById('billToStateProvinceGeoId').disabled = true ; + document.getElementById('billToPostalCode').disabled = true; + copyShipToBillAddress(); + hideErrorMessage(); + } else { + stopObservingShipToBillAddress(); + document.getElementById('billToAddress1').disabled = false ; + document.getElementById('billToAddress2').disabled = false ; + document.getElementById('billToCity').disabled = false ; + document.getElementById('billToCountryGeoId').disabled = false ; + document.getElementById('billToStateProvinceGeoId').disabled = false ; + document.getElementById('billToPostalCode').disabled = false; + } +} + +function getServerError(data) { + var serverErrorHash = []; + var serverError = ""; + if (data._ERROR_MESSAGE_LIST_ != undefined) { + serverErrorHash = data._ERROR_MESSAGE_LIST_; + + var CommonErrorMessage2 = getJSONuiLabel("CommonUiLabels", "CommonErrorMessage2"); + showErrorAlert(CommonErrorMessage2, serverErrorHash); + jQuery.each(serverErrorHash, function(error, message){ + if (error != undefined) { + serverError += message; + } + }); + + if (serverError == "") { + serverError = serverErrorHash; + } + } + if (data._ERROR_MESSAGE_ != undefined) { + serverError += data._ERROR_MESSAGE_; + } + return serverError; +} + +function doAjaxRequest(formId, errorId, popupId, requestUrl) { + if (jQuery("#" + formId).valid()) { + jQuery.ajax({ + url: requestUrl, + type: 'POST', + async: false, + data: jQuery("#" + formId).serialize(), + success: function(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery("#" + errorId).fadeIn("fast"); + jQuery("#" + popupId).fadeIn("fast"); + jQuery("#" + errorId).html(serverError); + } else { + jQuery("#" + errorId).fadeIn("slow"); + jQuery("#" + popupId).fadeIn("slow"); + document.getElementById('refreshRequestForm').submit(); + } + } + + }); + + } +} + +function createPartyPostalAddress(e) { + formId = 'createPostalAddressForm'; + errorId = 'serverError'; + popupId = 'displayCreateAddressForm'; + requestUrl = 'createPartyPostalAddress'; + + doAjaxRequest(formId, errorId, popupId, requestUrl); + + +} + +function updatePartyPostalAddress(e) { + contactMechId = e.split('_')[1]; + formId = 'editPostalAddress_' + contactMechId; + errorId = 'serverError_' + contactMechId; + popupId = 'displayEditAddressForm_' + contactMechId; + requestUrl = 'updatePartyPostalAddress'; + + doAjaxRequest(formId, errorId, popupId, requestUrl); +} + +function updatePartyShipToPostalAddress(e) { + formId = 'editShipToPostalAddress'; + errorId = 'shipToServerError'; + popupId = 'displayEditShipToPostalAddress'; + requestUrl = 'updatePartyPostalAddress'; + + doAjaxRequest(formId, errorId, popupId, requestUrl); +} + +function updatePartyBillToPostalAddress(e) { + formId = 'editBillToPostalAddress'; + errorId = 'billToServerError'; + popupId = 'displayEditBillToPostalAddress'; + requestUrl = 'updatePartyPostalAddress'; + + doAjaxRequest(formId, errorId, popupId, requestUrl); +} + +function hideErrorMessage() { + jQuery('#advice-required-billToAddress1').fadeOut("fast"); + jQuery('#advice-required-billToStateProvinceGeoId').fadeOut("fast"); + jQuery('#advice-required-billToCity').fadeOut("fast"); + jQuery('#advice-required-billToPostalCode').fadeOut("fast");; + jQuery('#advice-required-billToCountryGeoId').fadeOut("fast"); + jQuery('#billToPhoneRequired').fadeOut("fast"); +} + +function copyShipToBillAddress() { + jQuery("#shipToAddress1").change( function() { + document.getElementById('billToAddress1').value = document.getElementById('shipToAddress1').value; + }); + jQuery("#shipToAddress2").change( function() { + document.getElementById('billToAddress2').value = document.getElementById('shipToAddress2').value; + }); + jQuery("#shipToCity").change( function() { + document.getElementById('billToCity').value = document.getElementById('shipToCity').value; + }); + jQuery("#shipToStateProvinceGeoId").change( function() { + document.getElementById('billToStateProvinceGeoId').value = document.getElementById('shipToStateProvinceGeoId').value; + }); + + jQuery("#shipToCountryGeoId").change(copyShipToCountryToBillToCountry); + jQuery("#shipToPostalCode").change( function() { + document.getElementById('billToPostalCode').value = document.getElementById('shipToPostalCode').value; + }); +} + +function stopObservingShipToBillAddress() { + jQuery('#shipToAddress1').unbind('change'); + jQuery('shipToAddress2').unbind('change'); + jQuery('shipToCity').unbind('change'); + jQuery('shipToStateProvinceGeoId').unbind('change'); + jQuery('shipToCountryGeoId').unbind('change', copyShipToCountryToBillToCountry); + jQuery('shipToPostalCode').unbind('change'); +} + +function showState(id) { + if (document.getElementById('editPostalAddress_' + id)) { + // Get associate states for Postal Address Information + jQuery("#countryGeoId_" + id).change( function() { + getAssociatedStateList('countryGeoId_'+id, 'stateProvinceGeoId_'+id, 'advice-required-stateProvinceGeoId_'+id, 'states_'+id); + }); + + if (document.getElementById('stateProvinceGeoId_'+id).value == "_NA_") { + getAssociatedStateList('countryGeoId_'+id, 'stateProvinceGeoId_'+id, 'advice-required-stateProvinceGeoId_'+id, 'states_'+id); + } else { + var stateValue = document.getElementById('stateProvinceGeoId_'+id).value; + getAssociatedStateList('countryGeoId_'+id, 'stateProvinceGeoId_'+id, 'advice-required-stateProvinceGeoId_'+id, 'states_'+id); + document.getElementById('stateProvinceGeoId_'+id).value = stateValue; + } + } +} + +function copyShipToCountryToBillToCountry(){ + document.getElementById('billToCountryGeoId').value = document.getElementById('shipToCountryGeoId').value; + getAssociatedStateList('billToCountryGeoId', 'billToStateProvinceGeoId', 'advice-required-billToStateProvinceGeoId', 'billToStates'); +} \ No newline at end of file diff --git a/template/images/quickAnonCustSettings.js b/template/images/quickAnonCustSettings.js new file mode 100644 index 0000000..3f13619 --- /dev/null +++ b/template/images/quickAnonCustSettings.js @@ -0,0 +1,57 @@ +/* +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. +*/ + +jQuery(document).ready(isValidElement); + +function isValidElement(element){ + jQuery('#quickAnonProcessCustomer').validate(); + } + +jQuery(document).ready(function() { + jQuery('#useShippingPostalAddressForBilling').click(changeText2); +}); +function changeText2(){ + if(document.getElementById('useShippingPostalAddressForBilling').checked) { + document.getElementById('billToName').value = document.getElementById('shipToName').value; + document.getElementById('billToAttnName').value = document.getElementById('shipToAttnName').value; + document.getElementById('billToAddress1').value = document.getElementById('shipToAddress1').value; + document.getElementById('billToAddress2').value = document.getElementById('shipToAddress2').value; + document.getElementById('billToCity').value = document.getElementById('shipToCity').value; + document.getElementById('billToStateProvinceGeoId').value = document.getElementById('shipToStateProvinceGeoId').value; + document.getElementById('billToPostalCode').value = document.getElementById('shipToPostalCode').value; + document.getElementById('billToCountryGeoId').value = document.getElementById('shipToCountryGeoId').value; + document.getElementById('billToName').disabled = true; + document.getElementById('billToAttnName').disabled = true; + document.getElementById('billToAddress1').disabled = true; + document.getElementById('billToAddress2').disabled = true; + document.getElementById('billToCity').disabled = true; + document.getElementById('billToStateProvinceGeoId').disabled = true; + document.getElementById('billToPostalCode').disabled = true; + document.getElementById('billToCountryGeoId').disabled = true; + } else { + document.getElementById('billToName').disabled = false; + document.getElementById('billToAttnName').disabled = false; + document.getElementById('billToAddress1').disabled = false; + document.getElementById('billToAddress2').disabled = false; + document.getElementById('billToCity').disabled = false; + document.getElementById('billToStateProvinceGeoId').disabled = false; + document.getElementById('billToPostalCode').disabled = false; + document.getElementById('billToCountryGeoId').disabled = false; + } +} \ No newline at end of file diff --git a/template/images/remove.png b/template/images/remove.png new file mode 100644 index 0000000000000000000000000000000000000000..43e9363786eb4230997d2cb84d8629468e8e67b3 GIT binary patch literal 937 zcmex=9!4F}Qi@@mZBu90w!V10U4>38-Gv zaP~}9e@ybUwuz!C)tjFeK5FxveEH!OJ)i3NrN;x8dRwndwkp4R;^gtWK7YCE%BNlq6>ui@^F?2NV3m4)jMO&%5$MllBKy+v&tSWtlOKbTlsC;EzJXein94VoT3Go z`zI|A^O~~wse4iVTZ4q~;7K=g3Z|0!YxqwPtq+jKZ(pQfqtmw&T+SN?3XR`ulf zytkf7oUNY{TVQZ*!sGpKigzy8X6;;UB-Yly)!pK`={$cQ*P>5)9vDxe4Z+{YtyfU^OeQ3e2y*F&3BFp2<5%7rKMp)gHu5W-=^Y?Y`c2B7+mHS z?YaFlhX2#KJy&-<0 zfy0$e4dU(g>lQ9qYQ1K{nm6Xle@$UL7yn9biP&+qlUgmeg`}EQ6Sq{0Oj!5%rIuHN zXIM* +
    \ No newline at end of file diff --git a/template/includes/container-start.ftl b/template/includes/container-start.ftl new file mode 100644 index 0000000..c87c107 --- /dev/null +++ b/template/includes/container-start.ftl @@ -0,0 +1,17 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> +
    \ No newline at end of file diff --git a/template/includes/ecom-header-bar.ftl b/template/includes/ecom-header-bar.ftl new file mode 100644 index 0000000..06bc02b --- /dev/null +++ b/template/includes/ecom-header-bar.ftl @@ -0,0 +1,56 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> +
    + <#include "../catalog/MainNav.ftl" /> +
    + \ No newline at end of file diff --git a/template/includes/ecom-header.ftl b/template/includes/ecom-header.ftl new file mode 100644 index 0000000..5a7f212 --- /dev/null +++ b/template/includes/ecom-header.ftl @@ -0,0 +1,75 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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 sessionAttributes.overrideLogo??> + Logo + <#elseif catalogHeaderLogo??> + Logo + <#elseif layoutSettings.VT_HDR_IMAGE_URL?has_content> + Logo + +
    +
    + <#if !productStore??> +

    ${uiLabelMap.EcommerceNoProductStore}

    + + <#if (productStore.title)??>
    ${productStore.title}
    + <#if (productStore.subtitle)??>
    ${productStore.subtitle}
    +
    + <#if sessionAttributes.autoName?has_content> + ${uiLabelMap.CommonWelcome} ${sessionAttributes.autoName?html}! + (${uiLabelMap.CommonNotYou}? ${uiLabelMap.CommonClickHere}) + <#else/> + ${uiLabelMap.CommonWelcome}! + +
    +
    + \ No newline at end of file diff --git a/template/includes/footer.ftl b/template/includes/footer.ftl new file mode 100644 index 0000000..8e27284 --- /dev/null +++ b/template/includes/footer.ftl @@ -0,0 +1,96 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> + +<#assign nowTimestamp = Static["org.ofbiz.base.util.UtilDateTime"].nowTimestamp()> +
    + +
    + + \ No newline at end of file diff --git a/template/includes/header.ftl b/template/includes/header.ftl new file mode 100644 index 0000000..1be1824 --- /dev/null +++ b/template/includes/header.ftl @@ -0,0 +1,18 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> +<#include "ecom-header.ftl" /> +<#include "ecom-header-bar.ftl" /> \ No newline at end of file diff --git a/template/includes/headerHead.ftl b/template/includes/headerHead.ftl new file mode 100644 index 0000000..0b387fc --- /dev/null +++ b/template/includes/headerHead.ftl @@ -0,0 +1,106 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> +<#assign docLangAttr = locale.toString()?replace("_", "-")> +<#assign langDir = "ltr"> +<#if "ar.iw"?contains(docLangAttr?substring(0, 2))> + <#assign langDir = "rtl"> + + + + + + + <#if title?has_content>${title}<#elseif titleProperty?has_content>${uiLabelMap.get(titleProperty)}</#if>: ${(productStore.storeName)!} + <#if layoutSettings.VT_SHORTCUT_ICON?has_content> + <#assign shortcutIcon = layoutSettings.VT_SHORTCUT_ICON.get(0)/> + <#elseif layoutSettings.shortcutIcon?has_content> + <#assign shortcutIcon = layoutSettings.shortcutIcon/> + + <#if shortcutIcon?has_content> + + + <#if layoutSettings.styleSheets?has_content> + <#--layoutSettings.styleSheets is a list of style sheets. So, you can have a user-specified "main" style sheet, AND a component style sheet.--> + <#list layoutSettings.styleSheets as styleSheet> + + + + <#if layoutSettings.VT_STYLESHEET?has_content> + <#list layoutSettings.VT_STYLESHEET as styleSheet> + + + + <#if layoutSettings.rtlStyleSheets?has_content && langDir == "rtl"> + <#--layoutSettings.rtlStyleSheets is a list of rtl style sheets.--> + <#list layoutSettings.rtlStyleSheets as styleSheet> + + + + <#if layoutSettings.VT_RTL_STYLESHEET?has_content && langDir == "rtl"> + <#list layoutSettings.VT_RTL_STYLESHEET as styleSheet> + + + + <#-- Append CSS for catalog --> + <#if catalogStyleSheet??> + + + <#-- Append CSS for tracking codes --> + <#if sessionAttributes.overrideCss??> + + + <#if layoutSettings.VT_HDR_JAVASCRIPT?has_content> + <#list layoutSettings.VT_HDR_JAVASCRIPT as javaScript> + + + + <#if layoutSettings.javaScripts?has_content> + <#--layoutSettings.javaScripts is a list of java scripts. --> + <#-- use a Set to make sure each javascript is declared only once, but iterate the list to maintain the correct order --> + <#assign javaScriptsSet = Static["org.ofbiz.base.util.UtilMisc"].toSet(layoutSettings.javaScripts)/> + <#list layoutSettings.javaScripts as javaScript> + <#if javaScriptsSet.contains(javaScript)> + <#assign nothing = javaScriptsSet.remove(javaScript)/> + + + + + ${layoutSettings.extraHead!} + <#if layoutSettings.VT_EXTRA_HEAD?has_content> + <#list layoutSettings.VT_EXTRA_HEAD as extraHead> + ${extraHead} + + + + <#-- Meta tags if defined by the page action --> + + <#if metaDescription??> + + + <#if metaKeywords??> + + + <#if webAnalyticsConfigs?has_content> + + + diff --git a/template/includes/language.ftl b/template/includes/language.ftl new file mode 100644 index 0000000..47e4d9c --- /dev/null +++ b/template/includes/language.ftl @@ -0,0 +1,37 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> + +
    +
    +

    ${uiLabelMap.CommonLanguageTitle}

    +
    +
    +
    + +
    +
    +
    \ No newline at end of file diff --git a/template/includes/row-end.ftl b/template/includes/row-end.ftl new file mode 100644 index 0000000..75daf8e --- /dev/null +++ b/template/includes/row-end.ftl @@ -0,0 +1,17 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> +
    \ No newline at end of file diff --git a/template/includes/row-start.ftl b/template/includes/row-start.ftl new file mode 100644 index 0000000..13aa05a --- /dev/null +++ b/template/includes/row-start.ftl @@ -0,0 +1,17 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> +
    \ No newline at end of file diff --git a/template/login.ftl b/template/login.ftl new file mode 100644 index 0000000..03cf17b --- /dev/null +++ b/template/login.ftl @@ -0,0 +1,61 @@ +<#-- +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. +--> +<#assign janrainEnabled = Static["org.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("ecommerce", "janrain.enabled", delegator)> +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> +<#assign appName = Static["org.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("ecommerce", "janrain.appName", delegator)> + +<#if janrainEnabled == "Y"> + <#include "LoginJanrain.ft"/> +<#else> +
    +
    +

    ${uiLabelMap.CommonLogin}

    +
    +
    +
    +
    + <#include "LoginMain.ftl"/> +
    +
    + <#include "LoginForgot.ftl"/> +
    +
    +
    +
    + +
     
    + diff --git a/template/main.ftl b/template/main.ftl new file mode 100644 index 0000000..a471bcd --- /dev/null +++ b/template/main.ftl @@ -0,0 +1,23 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> +<#-- Render the category page --> +<#if requestAttributes.productCategoryId?has_content> + ${screens.render("component://oshop/widget/CatalogScreens.xml#category-include")} + ${screens.render("component://oshop/widget/CatalogScreens.xml#bestSellingCategory")} +<#else> +

    ${uiLabelMap.EcommerceNoPROMOTIONCategory}

    + diff --git a/template/order/CheckOutAddress.ftl b/template/order/CheckOutAddress.ftl new file mode 100644 index 0000000..dd007f6 --- /dev/null +++ b/template/order/CheckOutAddress.ftl @@ -0,0 +1,101 @@ + + +<#assign cart = shoppingCart!/> +
    +
    + 1) ${uiLabelMap.OrderWhereShallWeShipIt} +
    +
    +
    +
    + + + + + + <#if shippingContactMechList?has_content> + + <#list shippingContactMechList as shippingContactMech> + <#assign shippingAddress = shippingContactMech.getRelatedOne("PostalAddress", false)> + <#assign checkThisAddress = (shippingContactMech_index == 0 && !cart.getShippingContactMechId()?has_content) || (cart.getShippingContactMechId()?default("") == shippingAddress.contactMechId)/> + + + + + + + +
    + ${uiLabelMap.OrderSplitShipment} + ${uiLabelMap.PartyAddNewAddress} + <#if (cart.getShipGroupSize() > 1)> +
    ${uiLabelMap.OrderNOTEMultipleShipmentsExist}
    + +

    + checked="checked" />   + +
    + <#if shippingAddress.toName?has_content>${uiLabelMap.CommonTo}: ${shippingAddress.toName}
    + <#if shippingAddress.attnName?has_content>${uiLabelMap.PartyAddrAttnName}: ${shippingAddress.attnName}
    + <#if shippingAddress.address1?has_content>${shippingAddress.address1}
    + <#if shippingAddress.address2?has_content>${shippingAddress.address2}
    + <#if shippingAddress.city?has_content>${shippingAddress.city} + + <#if shippingAddress.postalCode?has_content>
    ${shippingAddress.postalCode} + <#if shippingAddress.countryGeoId?has_content>
    ${shippingAddress.countryGeoId} +
    + ${uiLabelMap.CommonUpdate} + ${uiLabelMap.OrderSplitShipment} + ${uiLabelMap.PartyAddNewAddress} + <#if (cart.getShipGroupSize() > 1)> +
    ${uiLabelMap.OrderNOTEMultipleShipmentsExist}
    + +
    +

    + + + +
    +
    \ No newline at end of file diff --git a/template/order/CheckOutPayOptions.ftl b/template/order/CheckOutPayOptions.ftl new file mode 100644 index 0000000..2937114 --- /dev/null +++ b/template/order/CheckOutPayOptions.ftl @@ -0,0 +1,176 @@ +<#-- +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. +--> + + + + + + +<#assign cart = shoppingCart! /> +
    +
    +

    3) ${uiLabelMap.OrderHowShallYouPay}?

    +
    +
    +
    +
    + + + + + <#-- Payment Method Selection --> +
    + + <#include "CheckoutPayCreditCard.ftl" /> + <#include "CheckoutPayEftAccount.ftl" /> + <#include "CheckoutPayExtOffline.ftl" /> + <#include "CheckoutPayExtCod.ftl" /> + <#include "CheckoutPayExtWorldPay.ftl" /> + <#include "CheckoutPayExtPayPal.ftl" /> + <#if !paymentMethodList?has_content> +
    + ${uiLabelMap.AccountingNoPaymentMethods}. +
    + <#else> + <#list paymentMethodList as paymentMethod> + <#include "CheckoutPayMethodGiftCard.ftl" /> + <#include "CheckoutPayMethodCreditCard.ftl" /> + <#include "CheckoutPayMethodEftAccount.ftl" /> + + + <#-- special billing account functionality to allow use w/ a payment method --> + <#if productStorePaymentMethodTypeIdMap.EXT_BILLACT??> + <#if billingAccountList?has_content> +
    + + +
    +
    + + +
    + + + <#-- end of special billing account functionality --> + <#if productStorePaymentMethodTypeIdMap.GIFT_CARD??> +
    + + + +
    +
    + + +
    + <#if cart.isPinRequiredForGC(delegator)> +
    + + +
    + +
    + + +
    + +
    + <#if productStorePaymentMethodTypeIdMap.CREDIT_CARD??>${uiLabelMap.AccountingSingleUseCreditCard} + <#if productStorePaymentMethodTypeIdMap.GIFT_CARD??>${uiLabelMap.AccountingSingleUseGiftCard} + <#if productStorePaymentMethodTypeIdMap.EFT_ACCOUNT??>${uiLabelMap.AccountingSingleUseEFTAccount} +
    + <#-- End Payment Method Selection --> +
    +
    + + +
    +
    \ No newline at end of file diff --git a/template/order/CheckOutPlaceOrder.ftl b/template/order/CheckOutPlaceOrder.ftl new file mode 100644 index 0000000..c047825 --- /dev/null +++ b/template/order/CheckOutPlaceOrder.ftl @@ -0,0 +1,84 @@ +<#-- +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. +--> + + +
    +
    +

    + <#if maySelectItems?default("N") == "Y" && returnLink?default("N") == "Y" && (orderHeader.statusId)! == "ORDER_COMPLETED" && roleTypeId! == "PLACING_CUSTOMER"> + makeReturn?orderId=${orderHeader.orderId}" class="submenutextright">${uiLabelMap.OrderRequestReturn} + + ${uiLabelMap.OrderOrder} + <#if orderHeader?has_content> + ${uiLabelMap.CommonNbr} + order?orderId=${orderHeader.orderId}">${orderHeader.orderId} + order.pdf?orderId=${(orderHeader.orderId)!}" target="_BLANK" class="btn btn-default btn-xs">PDF + <#-- ordered date --> + ${uiLabelMap.CommonDate}: + ${orderHeader.orderDate.toString()} + + <#if (orderHeader.orderId)??> + ${uiLabelMap.CommonInformation} ${externalOrder!} + + +

    +

    ${uiLabelMap.OrderFinalCheckoutReview}

    + <#if !isDemoStore?? && isDemoStore>

    ${uiLabelMap.OrderDemoFrontNote}.

    + +
    + <#if cart?? && 0 < cart.size()> + ${screens.render("component://${activeApp}/widget/OrderScreens.xml#orderheader")} + ${screens.render("component://${activeApp}/widget/OrderScreens.xml#orderitems")} + <#else> +

    ${uiLabelMap.OrderErrorShoppingCartEmpty}.

    + + + +
    +
    + <#if (requestParameters.checkoutpage)?has_content> + + + <#if (requestAttributes.issuerId)?has_content> + + + +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/template/order/CheckOutShipOptions.ftl b/template/order/CheckOutShipOptions.ftl new file mode 100644 index 0000000..118284c --- /dev/null +++ b/template/order/CheckOutShipOptions.ftl @@ -0,0 +1,123 @@ +<#-- +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. +--> + + + +
    +
    +

    2) ${uiLabelMap.OrderHowShallWeShipIt}

    +
    +
    +
    + +
    +
    +
    + + <#list carrierShipmentMethodList as carrierShipmentMethod> + <#assign shippingMethod = carrierShipmentMethod.shipmentMethodTypeId + "@" + carrierShipmentMethod.partyId> + + + + + + <#if !carrierShipmentMethodList?? || carrierShipmentMethodList?size == 0> + + + + + +
    + checked="checked" />  + +
      + <#if shoppingCart.getShippingContactMechId()??> + <#assign shippingEst = shippingEstWpr.getShippingEstimate(carrierShipmentMethod)?default(-1)> + + <#if carrierShipmentMethod.partyId != "_NA_">${carrierShipmentMethod.partyId!} ${carrierShipmentMethod.description!} + <#if shippingEst?has_content> - <#if (shippingEst > -1)><@ofbizCurrency amount=shippingEst isoCode=shoppingCart.getCurrency()/><#else>${uiLabelMap.OrderCalculatedOffline} +
    +
    + + +
    ${uiLabelMap.OrderUseDefault}.
    +
    +
    +
    + <#include "ShippingOptionAllAtOnce.ftl" /> + <#include "ShippingOptionSpecInstruction.ftl"/> +
    + <#include "ShippingOptionPONumber.ftl"/> + <#if productStore.showCheckoutGiftOptions! != "N"> + <#include "ShippingOptionGift.ftl"/> + <#else/> + + + <#include "ShippingOptionAddEmail.ftl"/> +
    +
    +
    +
    + + +
    +
    \ No newline at end of file diff --git a/template/order/CheckoutPayCreditCard.ftl b/template/order/CheckoutPayCreditCard.ftl new file mode 100644 index 0000000..28b3b8d --- /dev/null +++ b/template/order/CheckoutPayCreditCard.ftl @@ -0,0 +1,3 @@ +<#if productStorePaymentMethodTypeIdMap.CREDIT_CARD??> + ${uiLabelMap.AccountingCreditCard} + \ No newline at end of file diff --git a/template/order/CheckoutPayEftAccount.ftl b/template/order/CheckoutPayEftAccount.ftl new file mode 100644 index 0000000..4f918b0 --- /dev/null +++ b/template/order/CheckoutPayEftAccount.ftl @@ -0,0 +1,3 @@ +<#if productStorePaymentMethodTypeIdMap.EFT_ACCOUNT??> + ${uiLabelMap.AccountingEFTAccount} + \ No newline at end of file diff --git a/template/order/CheckoutPayExtBilling.ftl b/template/order/CheckoutPayExtBilling.ftl new file mode 100644 index 0000000..0e67fb8 --- /dev/null +++ b/template/order/CheckoutPayExtBilling.ftl @@ -0,0 +1,19 @@ +<#if productStorePaymentMethodTypeIdMap.EXT_BILLACT??> + <#if billingAccountList?has_content> +
    + + +
    +
    + + +
    + + \ No newline at end of file diff --git a/template/order/CheckoutPayExtCod.ftl b/template/order/CheckoutPayExtCod.ftl new file mode 100644 index 0000000..e8accaf --- /dev/null +++ b/template/order/CheckoutPayExtCod.ftl @@ -0,0 +1,6 @@ +<#if productStorePaymentMethodTypeIdMap.EXT_COD??> +
    + checked="checked" /> + +
    + \ No newline at end of file diff --git a/template/order/CheckoutPayExtOffline.ftl b/template/order/CheckoutPayExtOffline.ftl new file mode 100644 index 0000000..ec92e66 --- /dev/null +++ b/template/order/CheckoutPayExtOffline.ftl @@ -0,0 +1,6 @@ +<#if productStorePaymentMethodTypeIdMap.EXT_OFFLINE??> +
    + checked="checked" /> + +
    + \ No newline at end of file diff --git a/template/order/CheckoutPayExtPayPal.ftl b/template/order/CheckoutPayExtPayPal.ftl new file mode 100644 index 0000000..d7cd7b8 --- /dev/null +++ b/template/order/CheckoutPayExtPayPal.ftl @@ -0,0 +1,6 @@ +<#if productStorePaymentMethodTypeIdMap.EXT_PAYPAL??> +
    + checked="checked" /> + +
    + diff --git a/template/order/CheckoutPayExtWorldPay.ftl b/template/order/CheckoutPayExtWorldPay.ftl new file mode 100644 index 0000000..4944816 --- /dev/null +++ b/template/order/CheckoutPayExtWorldPay.ftl @@ -0,0 +1,6 @@ +<#if productStorePaymentMethodTypeIdMap.EXT_WORLDPAY??> +
    + checked="checked" /> + +
    + \ No newline at end of file diff --git a/template/order/CheckoutPayMethodCreditCard.ftl b/template/order/CheckoutPayMethodCreditCard.ftl new file mode 100644 index 0000000..9f354be --- /dev/null +++ b/template/order/CheckoutPayMethodCreditCard.ftl @@ -0,0 +1,12 @@ +<#if paymentMethod.paymentMethodTypeId == "CREDIT_CARD"> + <#if productStorePaymentMethodTypeIdMap.CREDIT_CARD??> + <#assign creditCard = paymentMethod.getRelatedOne("CreditCard", false) /> +
    + checked="checked" /> + + <#if paymentMethod.description?has_content>(${paymentMethod.description}) + ${uiLabelMap.CommonUpdate} + " /> +
    + + \ No newline at end of file diff --git a/template/order/CheckoutPayMethodEftAccount.ftl b/template/order/CheckoutPayMethodEftAccount.ftl new file mode 100644 index 0000000..d7dd710 --- /dev/null +++ b/template/order/CheckoutPayMethodEftAccount.ftl @@ -0,0 +1,11 @@ +<#if paymentMethod.paymentMethodTypeId == "EFT_ACCOUNT"> + <#if productStorePaymentMethodTypeIdMap.EFT_ACCOUNT??> + <#assign eftAccount = paymentMethod.getRelatedOne("EftAccount", false) /> +
    + checked="checked" /> + + <#if paymentMethod.description?has_content>

    (${paymentMethod.description})

    + ${uiLabelMap.CommonUpdate} +
    + + \ No newline at end of file diff --git a/template/order/CheckoutPayMethodGiftCard.ftl b/template/order/CheckoutPayMethodGiftCard.ftl new file mode 100644 index 0000000..1ebec94 --- /dev/null +++ b/template/order/CheckoutPayMethodGiftCard.ftl @@ -0,0 +1,27 @@ +<#if paymentMethod.paymentMethodTypeId == "GIFT_CARD"> + <#if productStorePaymentMethodTypeIdMap.GIFT_CARD??> + <#assign giftCard = paymentMethod.getRelatedOne("GiftCard", false) /> + <#if giftCard?has_content && giftCard.cardNumber?has_content> + <#assign giftCardNumber = "" /> + <#assign pcardNumber = giftCard.cardNumber /> + <#if pcardNumber?has_content> + <#assign psize = pcardNumber?length - 4 /> + <#if 0 < psize> + <#list 0 .. psize-1 as foo> + <#assign giftCardNumber = giftCardNumber + "*" /> + + <#assign giftCardNumber = giftCardNumber + pcardNumber[psize .. psize + 3] /> + <#else> + <#assign giftCardNumber = pcardNumber /> + + + +
    + checked="checked" /> + + <#if paymentMethod.description?has_content>(${paymentMethod.description}) + ${uiLabelMap.CommonUpdate} + ${uiLabelMap.OrderBillUpTo}: " /> +
    + + \ No newline at end of file diff --git a/template/order/OnePageCheckoutProcess.ftl b/template/order/OnePageCheckoutProcess.ftl new file mode 100644 index 0000000..c86ca01 --- /dev/null +++ b/template/order/OnePageCheckoutProcess.ftl @@ -0,0 +1,500 @@ +<#-- +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. +--> + +
    + <#assign shoppingCart = sessionAttributes.shoppingCart! /> +

    ${uiLabelMap.OrderCheckout}

    + <#if shoppingCart?has_content && shoppingCart.size() > 0> +
    + +<#-- ========================================================================================================================== --> +
    + ${screens.render("component://${activeApp}/widget/CartScreens.xml#UpdateCart")} +
    + +<#-- ========================================================================================================================== --> +
    +

    ${uiLabelMap.EcommerceStep} 2: ${uiLabelMap.FacilityShipping}

    + + +<#-- ============================================================= --> + +
    + +<#-- ========================================================================================================================== --> +
    +

    ${uiLabelMap.EcommerceStep} 3: ${uiLabelMap.PageTitleShippingOptions}

    + + +<#-- ============================================================= --> + +
    + +<#-- ========================================================================================================================== --> +
    +

    ${uiLabelMap.EcommerceStep} 4: ${uiLabelMap.AccountingBilling}

    + + +<#-- ============================================================= --> + + +
    + +<#-- ========================================================================================================================== --> +
    +

    ${uiLabelMap.EcommerceStep} 5: ${uiLabelMap.OrderSubmitOrder}

    + +
    +
    + + +<#-- ========================================================================================================================== --> +
    style="display: none;"> +

    ${uiLabelMap.EcommerceStep} 1: ${uiLabelMap.PageTitleShoppingCart}

    + You currently have no items in your cart. Click here to view our products. +

    ${uiLabelMap.EcommerceStep} 2: ${uiLabelMap.FacilityShipping}

    +

    ${uiLabelMap.EcommerceStep} 3: ${uiLabelMap.PageTitleShippingOptions}

    +

    ${uiLabelMap.EcommerceStep} 4: ${uiLabelMap.AccountingBilling}

    +

    ${uiLabelMap.EcommerceStep} 5: ${uiLabelMap.OrderSubmitOrder}

    +
    +
    diff --git a/template/order/Order.ftl b/template/order/Order.ftl new file mode 100644 index 0000000..e907b4e --- /dev/null +++ b/template/order/Order.ftl @@ -0,0 +1,53 @@ +<#-- +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. +--> +<#if orderHeader?has_content> +
    + + +
    +
    +

    + <#if maySelectItems?default("N") == "Y" && returnLink?default("N") == "Y" && (orderHeader.statusId)! == "ORDER_COMPLETED" && roleTypeId! == "PLACING_CUSTOMER"> + makeReturn?orderId=${orderHeader.orderId}" class="submenutextright">${uiLabelMap.OrderRequestReturn} + + ${uiLabelMap.OrderOrder} + <#if orderHeader?has_content> + ${uiLabelMap.CommonNbr} + order?orderId=${orderHeader.orderId}">${orderHeader.orderId} + order.pdf?orderId=${(orderHeader.orderId)!}" target="_BLANK" class="btn btn-default btn-xs">PDF + <#-- ordered date --> + ${uiLabelMap.CommonDate}: + ${orderHeader.orderDate.toString()} + + <#if (orderHeader.orderId)??> + ${uiLabelMap.CommonInformation} ${externalOrder!} + + +

    +
    +
    + ${screens.render("component://${activeApp}/widget/OrderScreens.xml#orderheader")} + ${screens.render("component://${activeApp}/widget/OrderScreens.xml#orderitems")} +
    +
    +
    + +<#else> +

    ${uiLabelMap.OrderSpecifiedNotFound}.

    + diff --git a/template/order/OrderHistoryDownloads.ftl b/template/order/OrderHistoryDownloads.ftl new file mode 100644 index 0000000..d6d4624 --- /dev/null +++ b/template/order/OrderHistoryDownloads.ftl @@ -0,0 +1,39 @@ + +<#if downloadOrderRoleAndProductContentInfoList?has_content> +
    +
    +

    ${uiLabelMap.EcommerceDownloadsAvailableTitle}

    +
    +
    +
    + + + ${uiLabelMap.OrderOrder} ${uiLabelMap.CommonNbr} + ${uiLabelMap.ProductProductName} + ${uiLabelMap.CommonName} + ${uiLabelMap.CommonDescription} + + + + + <#if downloadOrderRoleAndProductContentInfoList?has_content> + <#list downloadOrderRoleAndProductContentInfoList as downloadOrderRoleAndProductContentInfo> + + ${downloadOrderRoleAndProductContentInfo.orderId} + ${downloadOrderRoleAndProductContentInfo.productName} + ${downloadOrderRoleAndProductContentInfo.contentName!} + ${downloadOrderRoleAndProductContentInfo.description!} + + Download + + + + <#else> +
    ${uiLabelMap.EcommerceDownloadNotFound} + + + +
    +
    + \ No newline at end of file diff --git a/template/order/OrderHistoryShipped.ftl b/template/order/OrderHistoryShipped.ftl new file mode 100644 index 0000000..5634c90 --- /dev/null +++ b/template/order/OrderHistoryShipped.ftl @@ -0,0 +1,36 @@ +<#if porderHeaderList?has_content> +
    +
    +

    ${uiLabelMap.OrderPurchaseHistory}

    +
    +
    + + + ${uiLabelMap.CommonDate} + ${uiLabelMap.OrderOrder} ${uiLabelMap.CommonNbr} + ${uiLabelMap.CommonAmount} + ${uiLabelMap.CommonStatus} + + + + + <#if porderHeaderList?has_content> + <#list porderHeaderList as porderHeader> + <#assign pstatus = porderHeader.getRelatedOne("StatusItem", true) /> + + ${porderHeader.orderDate.toString()} + ${porderHeader.orderId} + <@ofbizCurrency amount=porderHeader.grandTotal isoCode=porderHeader.currencyUom /> + ${pstatus.get("description",locale)} + ${uiLabelMap.CommonView} + + + <#else> + ${uiLabelMap.OrderNoOrderFound} + + + +
    +
    + \ No newline at end of file diff --git a/template/order/OrderHistorySubmitted.ftl b/template/order/OrderHistorySubmitted.ftl new file mode 100644 index 0000000..08540cc --- /dev/null +++ b/template/order/OrderHistorySubmitted.ftl @@ -0,0 +1,48 @@ +
    +
    +

    ${uiLabelMap.OrderSalesHistory}

    +
    +
    + + + + + + + + + + + + + <#if orderHeaderList?has_content> + <#list orderHeaderList as orderHeader> + <#assign status = orderHeader.getRelatedOne("StatusItem", true) /> + <#assign orderDate = orderHeader.orderDate /> + <#assign orderTime = orderHeader.orderDate /> + + + + + + + <#-- invoices --> + <#assign invoices = delegator.findByAnd("OrderItemBilling", Static["org.ofbiz.base.util.UtilMisc"].toMap("orderId", "${orderHeader.orderId}"), Static["org.ofbiz.base.util.UtilMisc"].toList("invoiceId"), false) /> + <#assign distinctInvoiceIds = Static["org.ofbiz.entity.util.EntityUtil"].getFieldListFromEntityList(invoices, "invoiceId", true)> + <#if distinctInvoiceIds?has_content> + + <#else> + + + + <#else> + + + +
    ${uiLabelMap.OrderOrder} ${uiLabelMap.CommonNbr}${uiLabelMap.CommonDate}${uiLabelMap.CommonTime}${uiLabelMap.CommonStatus}${uiLabelMap.CommonAmount}${uiLabelMap.OrderInvoices}
    ${orderHeader.orderId}${orderDate?date}${orderDate?time}${status.get("description",locale)}<@ofbizCurrency amount=orderHeader.grandTotal isoCode=orderHeader.currencyUom /> + <#list distinctInvoiceIds as invoiceId> + ${invoiceId} PDF + +
    ${uiLabelMap.OrderNoOrderFound}
    +
    +
    \ No newline at end of file diff --git a/template/order/ReviewAddress.ftl b/template/order/ReviewAddress.ftl new file mode 100644 index 0000000..22a284c --- /dev/null +++ b/template/order/ReviewAddress.ftl @@ -0,0 +1,112 @@ +<#if orderItemShipGroups?has_content> +
    +
    +

    ${uiLabelMap.OrderShippingInformation}

    +
    +
    + <#-- shipping address --> + <#assign groupIdx = 0> + <#list orderItemShipGroups as shipGroup> + <#if orderHeader?has_content> + <#assign shippingAddress = shipGroup.getRelatedOne("PostalAddress", false)!> + <#assign groupNumber = shipGroup.shipGroupSeqId!> + <#else> + <#assign shippingAddress = cart.getShippingAddress(groupIdx)!> + <#assign groupNumber = groupIdx + 1> + + <#if shippingAddress?has_content> + ${uiLabelMap.OrderDestination} [${groupNumber}]
    + <#if shippingAddress.toName?has_content>${uiLabelMap.CommonTo}: ${shippingAddress.toName}
    + <#if shippingAddress.attnName?has_content>${uiLabelMap.PartyAddrAttnName}: ${shippingAddress.attnName}
    + ${shippingAddress.address1}
    + <#if shippingAddress.address2?has_content>${shippingAddress.address2} + <#assign shippingStateGeo = (delegator.findOne("Geo", {"geoId", shippingAddress.stateProvinceGeoId!}, false))! /> + ${shippingAddress.city}
    + ${shippingAddress.postalCode!}
    + <#if shippingStateGeo?has_content>${shippingStateGeo.geoName!}
    + <#assign shippingCountryGeo = (delegator.findOne("Geo", {"geoId", shippingAddress.countryGeoId!}, false))! /> + <#if shippingCountryGeo?has_content>${shippingCountryGeo.geoName!} + +

    + ${uiLabelMap.OrderMethod}: + <#if orderHeader?has_content> + <#assign shipmentMethodType = shipGroup.getRelatedOne("ShipmentMethodType", false)!> + <#assign carrierPartyId = shipGroup.carrierPartyId!> + <#else> + <#assign shipmentMethodType = cart.getShipmentMethodType(groupIdx)!> + <#assign carrierPartyId = cart.getCarrierPartyId(groupIdx)!> + + <#if carrierPartyId?? && carrierPartyId != "_NA_">${carrierPartyId!} + ${(shipmentMethodType.description)?default("N/A")} + <#if shippingAccount??>${uiLabelMap.AccountingUseAccount}: ${shippingAccount} +
      + <#-- tracking number --> + <#if trackingNumber?has_content || orderShipmentInfoSummaryList?has_content> +
    • + ${uiLabelMap.OrderTrackingNumber} + <#-- TODO: add links to UPS/FEDEX/etc based on carrier partyId --> + <#if shipGroup.trackingNumber?has_content> + ${shipGroup.trackingNumber} + + <#if orderShipmentInfoSummaryList?has_content> + <#list orderShipmentInfoSummaryList as orderShipmentInfoSummary> + <#if (orderShipmentInfoSummaryList?size > 1)>${orderShipmentInfoSummary.shipmentPackageSeqId}: + Code: ${orderShipmentInfoSummary.trackingCode?default("[Not Yet Known]")} + <#if orderShipmentInfoSummary.boxNumber?has_content>${uiLabelMap.OrderBoxNumber}${orderShipmentInfoSummary.boxNumber} + <#if orderShipmentInfoSummary.carrierPartyId?has_content>(${uiLabelMap.ProductCarrier}: ${orderShipmentInfoSummary.carrierPartyId}) + + +
    • + + <#-- splitting preference --> + <#if orderHeader?has_content> + <#assign maySplit = shipGroup.maySplit?default("N")> + <#else> + <#assign maySplit = cart.getMaySplit(groupIdx)?default("N")> + +
    • + ${uiLabelMap.OrderSplittingPreference}: + <#if maySplit?default("N") == "N">${uiLabelMap.OrderPleaseWaitUntilBeforeShipping}. + <#if maySplit?default("N") == "Y">${uiLabelMap.OrderPleaseShipItemsBecomeAvailable}. +
    • + <#-- shipping instructions --> + <#if orderHeader?has_content> + <#assign shippingInstructions = shipGroup.shippingInstructions!> + <#else> + <#assign shippingInstructions = cart.getShippingInstructions(groupIdx)!> + + <#if shippingInstructions?has_content> +
    • + ${uiLabelMap.OrderInstructions} + ${shippingInstructions} +
    • + + <#-- gift settings --> + <#if orderHeader?has_content> + <#assign isGift = shipGroup.isGift?default("N")> + <#assign giftMessage = shipGroup.giftMessage!> + <#else> + <#assign isGift = cart.getIsGift(groupIdx)?default("N")> + <#assign giftMessage = cart.getGiftMessage(groupIdx)!> + + <#if productStore.showCheckoutGiftOptions! != "N"> +
    • + ${uiLabelMap.OrderGift}? + <#if isGift?default("N") == "N">${uiLabelMap.OrderThisIsNotGift}. + <#if isGift?default("N") == "Y">${uiLabelMap.OrderThisIsGift}. +
    • + <#if giftMessage?has_content> +
    • + ${uiLabelMap.OrderGiftMessage} + ${giftMessage} +
    • + + + <#if shipGroup_has_next> + +
    + <#assign groupIdx = groupIdx + 1> + <#-- end list of orderItemShipGroups --> +
    +
    + \ No newline at end of file diff --git a/template/order/ReviewItems.ftl b/template/order/ReviewItems.ftl new file mode 100644 index 0000000..afb73d9 --- /dev/null +++ b/template/order/ReviewItems.ftl @@ -0,0 +1,350 @@ +<#-- +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. +--> + +<#-- NOTE: this template is used for the orderstatus screen in ecommerce AND for order notification emails through the OrderNoticeEmail.ftl file --> +<#-- the "urlPrefix" value will be prepended to URLs by the ofbizUrl transform if/when there is no "request" object in the context --> +<#if baseEcommerceSecureUrl??><#assign urlPrefix = baseEcommerceSecureUrl/> + <#assign numColumns = 8> + <#if maySelectItems?default("N") == "Y" && roleTypeId! == "PLACING_CUSTOMER"> + <#assign numColumns = 11> + ${uiLabelMap.OrderAddAllToCart} + ${uiLabelMap.OrderAddCheckedToCart} + createShoppingListFromOrder?orderId=${orderHeader.orderId}&frequency=6&intervalNumber=1&shoppingListTypeId=SLT_AUTO_REODR" class="btn btn-default">${uiLabelMap.OrderSendMeThisEveryMonth} + +
    +
    +

    + ${uiLabelMap.OrderOrderItems} +

    +
    +
    + + + + + <#if maySelectItems?default("N") == "Y"> + + + + + <#else> + + + + + + + + + + + + <#if maySelectItems?default("N") == "Y" && roleTypeId! == "PLACING_CUSTOMER"> + + + + + + + + + + + + + + + + + <#if maySelectItems?default("N") == "Y"> + + + + + + + <#list headerAdjustmentsToShow as orderHeaderAdjustment> + + + + + <#if maySelectItems?default("N") == "Y"> + + + + + + + + + <#if maySelectItems?default("N") == "Y"> + + + + + + + + <#if maySelectItems?default("N") == "Y"> + + + + <#if maySelectItems?default("N") == "Y"> + + + <#else> + + + + + + + + + + + + + + + + + + + <#list orderItems as orderItem> + <#-- get info from workeffort and calculate rental quantity, if it was a rental item --> + <#assign rentalQuantity = 1> <#-- no change if no rental item --> + <#if orderItem.orderItemTypeId == "RENTAL_ORDER_ITEM" && workEfforts??> + <#list workEfforts as workEffort> + <#if workEffort.workEffortId == orderItem.orderItemSeqId> + <#assign rentalQuantity = localOrderReadHelper.getWorkEffortRentalQuantity(workEffort)> + <#assign workEffortSave = workEffort> + <#break> + + + <#else> + <#assign WorkOrderItemFulfillments = orderItem.getRelated("WorkOrderItemFulfillment", null, null, false)!> + <#if WorkOrderItemFulfillments?has_content> + <#list WorkOrderItemFulfillments as WorkOrderItemFulfillment> + <#assign workEffortSave = WorkOrderItemFulfillment.getRelatedOne("WorkEffort", true)!> + <#break> + + + + + + + + <#if !orderItem.productId?? || orderItem.productId == "_?_"> + + <#else> + <#assign product = orderItem.getRelatedOne("Product", true)!/> <#-- should always exist because of FK constraint, but just in case --> + + + <#if !(maySelectItems?default("N") == "Y")> + + + + + + <#if maySelectItems?default("N") == "Y"> + + + + + + + + + + + <#if maySelectItems?default("N") == "Y" && roleTypeId! == "PLACING_CUSTOMER"> + + + + + + + + <#-- now cancel reason and comment field --> + <#if maySelectItems?default("N") == "Y" && (orderHeader.statusId != "ORDER_SENT" && orderItem.statusId != "ITEM_COMPLETED" && orderItem.statusId != "ITEM_CANCELLED" && pickedQty == 0)> + + + + + + + <#-- show info from workeffort if it was a rental item --> + <#if orderItem.orderItemTypeId == "RENTAL_ORDER_ITEM"> + <#if workEffortSave??> + + + + + <#-- now show adjustment details per line item --> + <#assign itemAdjustments = localOrderReadHelper.getOrderItemAdjustments(orderItem)> + <#list itemAdjustments as orderItemAdjustment> + + + + + + <#if maySelectItems?default("N") == "Y"> + + + + <#-- show the order item ship group info --> + <#assign orderItemShipGroupAssocs = orderItem.getRelated("OrderItemShipGroupAssoc", null, null, false)!> + <#if orderItemShipGroupAssocs?has_content> + <#list orderItemShipGroupAssocs as shipGroupAssoc> + <#assign shipGroup = shipGroupAssoc.getRelatedOne("OrderItemShipGroup", false)!> + <#assign shipGroupAddress = (shipGroup.getRelatedOne("PostalAddress", false))!> + + + + + + + + + <#if orderItems?size == 0 || !orderItems?has_content> + + + + +
    ${uiLabelMap.OrderProduct}${uiLabelMap.OrderQuantity}${uiLabelMap.OrderQtyPicked}${uiLabelMap.OrderQuantityShipped}${uiLabelMap.CommonCancelled}${uiLabelMap.OrderQtyOrdered} ${uiLabelMap.EcommerceUnitPrice} ${uiLabelMap.OrderAdjustments} ${uiLabelMap.CommonSubtotal}
       
       ${uiLabelMap.CommonSubtotal} + <@ofbizCurrency amount=orderSubTotal isoCode=currencyUomId/>
       
    ${localOrderReadHelper.getAdjustmentType(orderHeaderAdjustment)} <@ofbizCurrency amount=localOrderReadHelper.getOrderAdjustmentTotal(orderHeaderAdjustment) isoCode=currencyUomId/>
       ${uiLabelMap.OrderShippingAndHandling}<@ofbizCurrency amount=orderShippingTotal isoCode=currencyUomId/>
       ${uiLabelMap.OrderSalesTax}<@ofbizCurrency amount=orderTaxTotal isoCode=currencyUomId/>
       
       ${uiLabelMap.OrderGrandTotal} + <@ofbizCurrency amount=orderGrandTotal isoCode=currencyUomId/> + + <#if maySelectItems?default("N") == "Y">
    + ${orderItem.itemDescription?default("")} + + " class="linktext">${orderItem.productId} - ${orderItem.itemDescription?default("")} + <#assign orderItemAttributes = orderItem.getRelated("OrderItemAttribute", null, null, false)/> + <#if orderItemAttributes?has_content> +
      + <#list orderItemAttributes as orderItemAttribute> +
    • + ${orderItemAttribute.attrName} : ${orderItemAttribute.attrValue} +
    • + +
    + +
    + <#if product?has_content> + <#if product.piecesIncluded?? && product.piecesIncluded?long != 0> + [${uiLabelMap.OrderPieces}: ${product.piecesIncluded}] + + <#if (product.quantityIncluded?? && product.quantityIncluded != 0) || product.quantityUomId?has_content> + <#assign quantityUom = product.getRelatedOne("QuantityUom", true)!/> + [${uiLabelMap.CommonQuantity}: ${product.quantityIncluded!} ${((quantityUom.abbreviation)?default(product.quantityUomId))!}] + + <#if (product.productWeight?? && product.productWeight != 0) || product.weightUomId?has_content> + <#assign weightUom = product.getRelatedOne("WeightUom", true)!/> + [${uiLabelMap.CommonWeight}: ${product.productWeight!} ${((weightUom.abbreviation)?default(product.weightUomId))!}] + + <#if (product.productHeight?? && product.productHeight != 0) || product.heightUomId?has_content> + <#assign heightUom = product.getRelatedOne("HeightUom", true)!/> + [${uiLabelMap.CommonHeight}: ${product.productHeight!} ${((heightUom.abbreviation)?default(product.heightUomId))!}] + + <#if (product.productWidth?? && product.productWidth != 0) || product.widthUomId?has_content> + <#assign widthUom = product.getRelatedOne("WidthUom", true)!/> + [${uiLabelMap.CommonWidth}: ${product.productWidth!} ${((widthUom.abbreviation)?default(product.widthUomId))!}] + + <#if (product.productDepth?? && product.productDepth != 0) || product.depthUomId?has_content> + <#assign depthUom = product.getRelatedOne("DepthUom", true)!/> + [${uiLabelMap.CommonDepth}: ${product.productDepth!} ${((depthUom.abbreviation)?default(product.depthUomId))!}] + + + <#if maySelectItems?default("N") == "Y"> + <#assign returns = orderItem.getRelated("ReturnItem", null, null, false)!> + <#if returns?has_content> + <#list returns as return> + <#assign returnHeader = return.getRelatedOne("ReturnHeader", false)> + <#if returnHeader.statusId != "RETURN_CANCELLED"> + <#if returnHeader.statusId == "RETURN_REQUESTED" || returnHeader.statusId == "RETURN_APPROVED"> + <#assign displayState = "Return Pending"> + <#else> + <#assign displayState = "Returned"> + + ${displayState} (#${return.returnId}) + + + + +
    + ${orderItem.quantity?string.number} + + <#assign pickedQty = localOrderReadHelper.getItemPickedQuantityBd(orderItem)> + <#if pickedQty gt 0 && orderHeader.statusId == "ORDER_APPROVED">${pickedQty?default(0)?string.number}<#else>${pickedQty?default(0)?string.number} + + <#assign shippedQty = localOrderReadHelper.getItemShippedQuantity(orderItem)> + ${shippedQty?default(0)?string.number} + + <#assign canceledQty = localOrderReadHelper.getItemCanceledQuantity(orderItem)> + ${canceledQty?default(0)?string.number} +   + <@ofbizCurrency amount=orderItem.unitPrice isoCode=currencyUomId/> +   + <@ofbizCurrency amount=localOrderReadHelper.getOrderItemAdjustmentsTotal(orderItem) isoCode=currencyUomId/> +   + <#if workEfforts??> + <@ofbizCurrency amount=localOrderReadHelper.getOrderItemTotal(orderItem)*rentalQuantity isoCode=currencyUomId/> + <#else> + <@ofbizCurrency amount=localOrderReadHelper.getOrderItemTotal(orderItem) isoCode=currencyUomId/> + + + +
    ${uiLabelMap.OrderReturnReason} + + ${uiLabelMap.CommonComments} + + ${uiLabelMap.CommonCancel} + +
    ${uiLabelMap.CommonFrom}: ${workEffortSave.estimatedStartDate?string("yyyy-MM-dd")} ${uiLabelMap.CommonUntil} ${workEffortSave.estimatedCompletionDate?string("yyyy-MM-dd")} ${uiLabelMap.CommonFor} ${workEffortSave.reservPersons} ${uiLabelMap.CommonPerson}(s)
    + ${uiLabelMap.EcommerceAdjustment}: ${StringUtil.wrapString(localOrderReadHelper.getAdjustmentType(orderItemAdjustment))} + <#if orderItemAdjustment.description?has_content>: ${StringUtil.wrapString(orderItemAdjustment.description)} + <#if orderItemAdjustment.orderAdjustmentTypeId == "SALES_TAX"> + <#if orderItemAdjustment.primaryGeoId?has_content> + <#assign primaryGeo = orderItemAdjustment.getRelatedOne("PrimaryGeo", true)/> + <#if primaryGeo.geoName?has_content> + ${uiLabelMap.OrderJurisdiction}: ${primaryGeo.geoName} [${primaryGeo.abbreviation!}] + + <#if orderItemAdjustment.secondaryGeoId?has_content> + <#assign secondaryGeo = orderItemAdjustment.getRelatedOne("SecondaryGeo", true)/> + (${uiLabelMap.CommonIn}: ${secondaryGeo.geoName} [${secondaryGeo.abbreviation!}]) + + + <#if orderItemAdjustment.sourcePercentage??>${uiLabelMap.EcommerceRate}: ${orderItemAdjustment.sourcePercentage} + <#if orderItemAdjustment.customerReferenceId?has_content>${uiLabelMap.OrderCustomerTaxId}: ${orderItemAdjustment.customerReferenceId} + <#if orderItemAdjustment.exemptAmount??>${uiLabelMap.EcommerceExemptAmount}: ${orderItemAdjustment.exemptAmount} + + + <@ofbizCurrency amount=localOrderReadHelper.getOrderItemAdjustmentTotal(orderItem, orderItemAdjustment) isoCode=currencyUomId/> +
    + ${uiLabelMap.OrderShipGroup}: [${shipGroup.shipGroupSeqId}] ${shipGroupAddress.address1?default("N/A")} + + ${shipGroupAssoc.quantity?string.number} +
    ${uiLabelMap.OrderSalesOrderLookupFailed}
    +
    diff --git a/template/order/ReviewPayment.ftl b/template/order/ReviewPayment.ftl new file mode 100644 index 0000000..59421b8 --- /dev/null +++ b/template/order/ReviewPayment.ftl @@ -0,0 +1,120 @@ +
    +
    +

    ${uiLabelMap.AccountingPaymentInformation}

    +
    +
    + <#if paymentMethods?has_content || paymentMethodType?has_content || billingAccount?has_content> + <#-- order payment info --> + <#-- offline payment address infomation :: change this to use Company's address --> + <#if !paymentMethod?has_content && paymentMethodType?has_content> + <#if paymentMethodType.paymentMethodTypeId == "EXT_OFFLINE"> + ${uiLabelMap.AccountingOfflinePayment} + <#if orderHeader?has_content && paymentAddress?has_content> + ${uiLabelMap.OrderSendPaymentTo}: + <#if paymentAddress.toName?has_content>${paymentAddress.toName} + <#if paymentAddress.attnName?has_content>${uiLabelMap.PartyAddrAttnName}: ${paymentAddress.attnName} + ${paymentAddress.address1} + <#if paymentAddress.address2?has_content>${paymentAddress.address2} + <#assign paymentStateGeo = (delegator.findOne("Geo", {"geoId", paymentAddress.stateProvinceGeoId!}, false))! /> + ${paymentAddress.city}<#if paymentStateGeo?has_content>, ${paymentStateGeo.geoName!} ${paymentAddress.postalCode!} + <#assign paymentCountryGeo = (delegator.findOne("Geo", {"geoId", paymentAddress.countryGeoId!}, false))! /> + <#if paymentCountryGeo?has_content>${paymentCountryGeo.geoName!} + ${uiLabelMap.EcommerceBeSureToIncludeYourOrderNb} + + <#else> + <#assign outputted = true> + ${uiLabelMap.AccountingPaymentVia} ${paymentMethodType.get("description",locale)} + + + + <#if paymentMethods?has_content> + <#list paymentMethods as paymentMethod> + <#if "CREDIT_CARD" == paymentMethod.paymentMethodTypeId> + <#assign creditCard = paymentMethod.getRelatedOne("CreditCard", false)> + <#assign formattedCardNumber = Static["org.ofbiz.party.contact.ContactHelper"].formatCreditCard(creditCard)> + <#elseif "GIFT_CARD" == paymentMethod.paymentMethodTypeId> + <#assign giftCard = paymentMethod.getRelatedOne("GiftCard", false)> + <#elseif "EFT_ACCOUNT" == paymentMethod.paymentMethodTypeId> + <#assign eftAccount = paymentMethod.getRelatedOne("EftAccount", false)> + + <#-- credit card info --> + <#if "CREDIT_CARD" == paymentMethod.paymentMethodTypeId && creditCard?has_content> + <#if outputted?default(false)> + + <#assign pmBillingAddress = creditCard.getRelatedOne("PostalAddress", false)!> +
  • +
      +
    • + ${uiLabelMap.AccountingCreditCard} + <#if creditCard.companyNameOnCard?has_content>${creditCard.companyNameOnCard} + <#if creditCard.titleOnCard?has_content>${creditCard.titleOnCard} + ${creditCard.firstNameOnCard} + <#if creditCard.middleNameOnCard?has_content>${creditCard.middleNameOnCard} + ${creditCard.lastNameOnCard} + <#if creditCard.suffixOnCard?has_content>${creditCard.suffixOnCard} +
    • +
    • ${formattedCardNumber}
    • +
    +
  • + <#-- Gift Card info --> + <#elseif "GIFT_CARD" == paymentMethod.paymentMethodTypeId && giftCard?has_content> + <#if outputted?default(false)> + + <#if giftCard?has_content && giftCard.cardNumber?has_content> + <#assign pmBillingAddress = giftCard.getRelatedOne("PostalAddress", false)!> + <#assign giftCardNumber = ""> + <#assign pcardNumber = giftCard.cardNumber> + <#if pcardNumber?has_content> + <#assign psize = pcardNumber?length - 4> + <#if 0 < psize> + <#list 0 .. psize-1 as foo> + <#assign giftCardNumber = giftCardNumber + "*"> + + <#assign giftCardNumber = giftCardNumber + pcardNumber[psize .. psize + 3]> + <#else> + <#assign giftCardNumber = pcardNumber> + + + + ${uiLabelMap.AccountingGiftCard} + ${giftCardNumber} + <#-- EFT account info --> + <#elseif "EFT_ACCOUNT" == paymentMethod.paymentMethodTypeId && eftAccount?has_content> + <#if outputted?default(false)> + + <#assign pmBillingAddress = eftAccount.getRelatedOne("PostalAddress", false)!> + ${uiLabelMap.AccountingEFTAccount} + ${eftAccount.nameOnAccount!} + <#if eftAccount.companyNameOnAccount?has_content>${eftAccount.companyNameOnAccount} + ${uiLabelMap.AccountingBank}: ${eftAccount.bankName}, ${eftAccount.routingNumber} + ${uiLabelMap.AccountingAccount} #: ${eftAccount.accountNumber} + + <#if pmBillingAddress?has_content> + <#if pmBillingAddress.toName?has_content>${uiLabelMap.CommonTo}: ${pmBillingAddress.toName} + <#if pmBillingAddress.attnName?has_content>${uiLabelMap.CommonAttn}: ${pmBillingAddress.attnName} + <#if pmBillingAddress.address2?has_content>${pmBillingAddress.address2} + <#assign pmBillingStateGeo = (delegator.findOne("Geo", {"geoId", pmBillingAddress.stateProvinceGeoId!}, false))! /> + ${pmBillingAddress.city}<#if pmBillingStateGeo?has_content>, ${ pmBillingStateGeo.geoName!} ${pmBillingAddress.postalCode!} + <#assign pmBillingCountryGeo = (delegator.findOne("Geo", {"geoId", pmBillingAddress.countryGeoId!}, false))! /> + <#if pmBillingCountryGeo?has_content>${pmBillingCountryGeo.geoName!} + + <#assign outputted = true> + + + <#-- billing account info --> + <#if billingAccount?has_content> + <#if outputted?default(false)> + + <#assign outputted = true> + ${uiLabelMap.AccountingBillingAccount} + #${billingAccount.billingAccountId!} - ${billingAccount.description!} + + <#if (customerPoNumberSet?has_content)> + ${uiLabelMap.OrderPurchaseOrderNumber} + <#list customerPoNumberSet as customerPoNumber> + ${customerPoNumber!} + + + +
    +
    \ No newline at end of file diff --git a/template/order/ReviewStatus.ftl b/template/order/ReviewStatus.ftl new file mode 100644 index 0000000..0ceabc7 --- /dev/null +++ b/template/order/ReviewStatus.ftl @@ -0,0 +1,12 @@ +
    +
    +

    ${uiLabelMap.CommonStatus}

    +
    +
    + <#if orderHeader?has_content> + ${localOrderReadHelper.getStatusString(locale)} + <#else> + ${uiLabelMap.OrderNotYetOrdered} + +
    +
    \ No newline at end of file diff --git a/template/order/ShippingOptionAddEmail.ftl b/template/order/ShippingOptionAddEmail.ftl new file mode 100644 index 0000000..c027592 --- /dev/null +++ b/template/order/ShippingOptionAddEmail.ftl @@ -0,0 +1,25 @@ +
    +
    +

    ${uiLabelMap.PartyEmailAddresses}

    +
    +
    + + + + +
    +
    ${uiLabelMap.OrderEmailSentToFollowingAddresses}:
    +
    + + <#list emailList as email> + ${email.infoString!}<#if email_has_next>, + + +
    +
    ${uiLabelMap.OrderUpdateEmailAddress} ${uiLabelMap.PartyProfile}.
    +
    +
    ${uiLabelMap.OrderCommaSeperatedEmailAddresses}:
    +   +
    +
    +
    \ No newline at end of file diff --git a/template/order/ShippingOptionAllAtOnce.ftl b/template/order/ShippingOptionAllAtOnce.ftl new file mode 100644 index 0000000..80eba50 --- /dev/null +++ b/template/order/ShippingOptionAllAtOnce.ftl @@ -0,0 +1,25 @@ +
    +
    +

    ${uiLabelMap.OrderShipAllAtOnce}?

    +
    +
    + + + + + + + + + +
    + checked="checked" name="may_split" value="false" />  + +
    ${uiLabelMap.OrderPleaseWaitUntilBeforeShipping}.
    +
    + checked="checked" type="radio" name="may_split" value="true" />  + +
    ${uiLabelMap.OrderPleaseShipItemsBecomeAvailable}.
    +
    +
    +
    \ No newline at end of file diff --git a/template/order/ShippingOptionGift.ftl b/template/order/ShippingOptionGift.ftl new file mode 100644 index 0000000..f734b84 --- /dev/null +++ b/template/order/ShippingOptionGift.ftl @@ -0,0 +1,32 @@ +
    +
    +

    ${uiLabelMap.OrderIsThisGift}?

    +
    +
    + + + + +
    +
    + checked="checked" name="is_gift" value="true" /> ${uiLabelMap.CommonYes} +   + checked="checked" name="is_gift" value="false" /> ${uiLabelMap.CommonNo} +
    +
    +
    +
    +
    +
    +

    ${uiLabelMap.OrderGiftMessage}

    +
    +
    + + + + +
    + +
    +
    +
    \ No newline at end of file diff --git a/template/order/ShippingOptionPONumber.ftl b/template/order/ShippingOptionPONumber.ftl new file mode 100644 index 0000000..a6d6bc4 --- /dev/null +++ b/template/order/ShippingOptionPONumber.ftl @@ -0,0 +1,18 @@ +
    +
    +

    ${uiLabelMap.OrderPoNumber}?

    +
    +
    + + + + +
    + <#if shoppingCart.getPoNumber()?? && shoppingCart.getPoNumber() != "(none)"> + <#assign currentPoNumber = shoppingCart.getPoNumber()> + + +
    +
    +
    + \ No newline at end of file diff --git a/template/order/ShippingOptionSpecInstruction.ftl b/template/order/ShippingOptionSpecInstruction.ftl new file mode 100644 index 0000000..978c640 --- /dev/null +++ b/template/order/ShippingOptionSpecInstruction.ftl @@ -0,0 +1,14 @@ +
    +
    +

    ${uiLabelMap.OrderSpecialInstructions}?

    +
    +
    + + + + +
    + +
    +
    +
    \ No newline at end of file diff --git a/template/order/anonymousCheckoutLinks.ftl b/template/order/anonymousCheckoutLinks.ftl new file mode 100644 index 0000000..8f7772d --- /dev/null +++ b/template/order/anonymousCheckoutLinks.ftl @@ -0,0 +1,51 @@ +<#-- +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. +--> + +
    + onclick="javascript:submitForm(document.${parameters.formNameValue!});">Personal Info + <#if (enableShippingAddress)??> + onclick="javascript:submitForm(document.${parameters.formNameValue!});">Shipping Address + <#else> + Shipping Address + + <#if (enableShipmentMethod)??> + onclick="javascript:submitForm(document.${parameters.formNameValue!});">Shipping Options + <#else> + Shipping Options + + <#if (enablePaymentOptions)??> + onclick="javascript:submitForm(document.${parameters.formNameValue!});">Payment Options + <#else> + Payment Options + + <#if (enablePaymentInformation)??> + onclick="javascript:submitForm(document.${parameters.formNameValue!});">Payment Information + <#else> + Payment Information + + <#if (enableReviewOrder)??> + onclick="javascript:submitForm(document.${parameters.formNameValue!});">Review Order + <#else> + Review Order + +
    diff --git a/template/order/anonymoustrail.ftl b/template/order/anonymoustrail.ftl new file mode 100644 index 0000000..42d3179 --- /dev/null +++ b/template/order/anonymoustrail.ftl @@ -0,0 +1,20 @@ +<#-- +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. +--> + +<#if shipAddr??>${uiLabelMap.EcommerceChangeShippingAddress}<#if shipOptions??>${uiLabelMap.EcommerceChangeShippingOptions}<#if billing??>${uiLabelMap.EcommerceChangePaymentInfo} diff --git a/template/order/billsettings.ftl b/template/order/billsettings.ftl new file mode 100644 index 0000000..63720ad --- /dev/null +++ b/template/order/billsettings.ftl @@ -0,0 +1,293 @@ +<#-- +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. +--> + + + +
    +
    + +
    ${uiLabelMap.AccountingPaymentInformation}
    +
    +
    + <#if (paymentMethodType?? && !requestParameters.resetType?has_content) || finalizeMode?default("") == "payment"> + <#-- after initial screen; show detailed screens for selected type --> + <#if paymentMethodType == "CC"> + <#if creditCard?has_content && postalAddress?has_content> +
    + + + <#elseif requestParameters.useShipAddr??> + + <#else> + + + + <#if paymentMethodType == "EFT"> + <#if eftAccount?has_content && postalAddress?has_content> + + + + <#elseif requestParameters.useShipAddr??> + + <#else> + + + + <#if paymentMethodType == "GC"> + + + + <#if requestParameters.singleUsePayment?default("N") == "Y"> + + + + + + + + + + <#if requestParameters.useShipAddr??> + + + + + <#if cart.getShippingContactMechId()?? && paymentMethodType != "GC"> + + + + + + + + + + <#if (paymentMethodType == "CC" || paymentMethodType == "EFT")> + + + + + + ${screens.render("component://${activeApp}/widget/OrderScreens.xml#genericaddress")} + + + <#-- credit card fields --> + <#if paymentMethodType == "CC"> + <#if !creditCard?has_content> + <#assign creditCard = requestParameters> + + + + + + + + + + + ${screens.render("component://accounting/widget/CommonScreens.xml#creditCardFields")} + + + <#-- eft fields --> + <#if paymentMethodType =="EFT"> + <#if !eftAccount?has_content> + <#assign eftAccount = requestParameters> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <#-- gift card fields --> + <#if requestParameters.useGc?default("") == "GC" || paymentMethodType == "GC"> + <#assign giftCard = requestParameters> + + <#if paymentMethodType != "GC"> + + + + + + + + + + + + + + + + + + + + + + + + + <#if paymentMethodType != "GC"> + + + + + + + + + + + +
    + checked="checked" /> + +
    ${uiLabelMap.FacilityBillingAddressSameShipping}
    +

    ${uiLabelMap.PartyBillingAddress}
      

    ${uiLabelMap.AccountingCreditCardInformation}
      

    ${uiLabelMap.AccountingEFTAccountInformation}
      
    ${uiLabelMap.AccountingNameOnAccount}
      + + *
    ${uiLabelMap.AccountingCompanyNameOnAccount}
      + +
    ${uiLabelMap.AccountingBankName}
      + + *
    ${uiLabelMap.AccountingRoutingNumber}
      + + *
    ${uiLabelMap.AccountingAccountType}
      + + *
    ${uiLabelMap.AccountingAccountNumber}
      + + *
    ${uiLabelMap.CommonDescription}
      + +

    ${uiLabelMap.AccountingGiftCardInformation}
      
    ${uiLabelMap.AccountingGiftCardNumber}
      + + *
    ${uiLabelMap.AccountingPINNumber}
      + + *
    ${uiLabelMap.CommonDescription}
      + +
    ${uiLabelMap.AccountingAmountToUse}
      + + *
    + +
    + <#else> + <#-- initial screen show a list of options --> + + + + + <#if productStorePaymentMethodTypeIdMap.GIFT_CARD??> + + + + + + + <#if productStorePaymentMethodTypeIdMap.EXT_OFFLINE??> + + + + + + + <#if productStorePaymentMethodTypeIdMap.CREDIT_CARD??> + + + + + + + <#if productStorePaymentMethodTypeIdMap.EFT_ACCOUNT??> + + + + + + + + +
    checked="checked" />
    ${uiLabelMap.AccountingCheckGiftCard}

    checked="checked" />
    ${uiLabelMap.OrderPaymentOfflineCheckMoney}

    checked="checked" />
    ${uiLabelMap.AccountingVisaMastercardAmexDiscover}

    checked="checked" />
    ${uiLabelMap.AccountingAHCElectronicCheck}
    + +
    +
    + +
    +
    diff --git a/template/order/ccinfo.ftl b/template/order/ccinfo.ftl new file mode 100644 index 0000000..c01ce3d --- /dev/null +++ b/template/order/ccinfo.ftl @@ -0,0 +1,26 @@ +<#-- +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. +--> + +<#if !creditCard?has_content> + <#assign creditCard = requestParameters> + +
    + +${screens.render("component://accounting/widget/CommonScreens.xml#creditCardFields")} + diff --git a/template/order/checkoutpayment.ftl b/template/order/checkoutpayment.ftl new file mode 100644 index 0000000..1564ce6 --- /dev/null +++ b/template/order/checkoutpayment.ftl @@ -0,0 +1,268 @@ +<#-- +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. +--> + + + + + + +<#assign cart = shoppingCart! /> + +
    +
    + + + + +
    +
    +

    3)${uiLabelMap.OrderHowShallYouPay}?

    +
    +
    + <#-- Payment Method Selection --> +
    + + <#if productStorePaymentMethodTypeIdMap.CREDIT_CARD??> + ${uiLabelMap.AccountingCreditCard} + + <#if productStorePaymentMethodTypeIdMap.EFT_ACCOUNT??> + ${uiLabelMap.AccountingEFTAccount} + + <#if productStorePaymentMethodTypeIdMap.EXT_OFFLINE??> +
    +
    + checked="checked" /> + +
    + + <#if productStorePaymentMethodTypeIdMap.EXT_COD??> +
    + checked="checked" /> + +
    + + <#if productStorePaymentMethodTypeIdMap.EXT_WORLDPAY??> +
    + checked="checked" /> + +
    + + <#if productStorePaymentMethodTypeIdMap.EXT_PAYPAL??> +
    + checked="checked" /> + +
    + + <#if productStorePaymentMethodTypeIdMap.EXT_IDEAL??> +
    + checked="checked" /> + +
    + +
    +
    + +
    + + <#if !paymentMethodList?has_content> +
    + ${uiLabelMap.AccountingNoPaymentMethods}. +
    + <#else> + <#list paymentMethodList as paymentMethod> + <#if paymentMethod.paymentMethodTypeId == "GIFT_CARD"> + <#if productStorePaymentMethodTypeIdMap.GIFT_CARD??> + <#assign giftCard = paymentMethod.getRelatedOne("GiftCard", false) /> + + <#if giftCard?has_content && giftCard.cardNumber?has_content> + <#assign giftCardNumber = "" /> + <#assign pcardNumber = giftCard.cardNumber /> + <#if pcardNumber?has_content> + <#assign psize = pcardNumber?length - 4 /> + <#if 0 < psize> + <#list 0 .. psize-1 as foo> + <#assign giftCardNumber = giftCardNumber + "*" /> + + <#assign giftCardNumber = giftCardNumber + pcardNumber[psize .. psize + 3] /> + <#else> + <#assign giftCardNumber = pcardNumber /> + + + + +
    + checked="checked" /> + + <#if paymentMethod.description?has_content>(${paymentMethod.description}) + ${uiLabelMap.CommonUpdate} + ${uiLabelMap.OrderBillUpTo}: " /> +
    + + <#elseif paymentMethod.paymentMethodTypeId == "CREDIT_CARD"> + <#if productStorePaymentMethodTypeIdMap.CREDIT_CARD??> + <#assign creditCard = paymentMethod.getRelatedOne("CreditCard", false) /> +
    + checked="checked" /> + + <#if paymentMethod.description?has_content>(${paymentMethod.description}) + ${uiLabelMap.CommonUpdate} + " /> +
    + + <#elseif paymentMethod.paymentMethodTypeId == "EFT_ACCOUNT"> + <#if productStorePaymentMethodTypeIdMap.EFT_ACCOUNT??> + <#assign eftAccount = paymentMethod.getRelatedOne("EftAccount", false) /> +
    + checked="checked" /> + + <#if paymentMethod.description?has_content>

    (${paymentMethod.description})

    + ${uiLabelMap.CommonUpdate} +
    + + + + + + <#-- special billing account functionality to allow use w/ a payment method --> + <#if productStorePaymentMethodTypeIdMap.EXT_BILLACT??> + <#if billingAccountList?has_content> +
    + + +
    +
    + + +
    + + + <#-- end of special billing account functionality --> + + <#if productStorePaymentMethodTypeIdMap.GIFT_CARD??> +
    + + + +
    +
    + + +
    + <#if cart.isPinRequiredForGC(delegator)> +
    + + +
    + +
    + + +
    + + +
    + <#if productStorePaymentMethodTypeIdMap.CREDIT_CARD??>${uiLabelMap.AccountingSingleUseCreditCard} + <#if productStorePaymentMethodTypeIdMap.GIFT_CARD??>${uiLabelMap.AccountingSingleUseGiftCard} + <#if productStorePaymentMethodTypeIdMap.EFT_ACCOUNT??>${uiLabelMap.AccountingSingleUseEFTAccount} +
    + <#-- End Payment Method Selection --> +
    +
    +
    +
    + + diff --git a/template/order/checkoutreview.ftl b/template/order/checkoutreview.ftl new file mode 100644 index 0000000..7538494 --- /dev/null +++ b/template/order/checkoutreview.ftl @@ -0,0 +1,65 @@ +<#-- +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. +--> + + + +

    ${uiLabelMap.OrderFinalCheckoutReview}

    +<#if !isDemoStore?? && isDemoStore>

    ${uiLabelMap.OrderDemoFrontNote}.

    + +<#if cart?? && 0 < cart.size()> + ${screens.render("component://${activeApp}/widget/OrderScreens.xml#orderheader")} +
    + ${screens.render("component://${activeApp}/widget/OrderScreens.xml#orderitems")} + + + + + +
    +   + +
    + <#if (requestParameters.checkoutpage)?has_content> + + + <#if (requestAttributes.issuerId)?has_content> + + + +
    + <#-- doesn't work with Safari, seems to work with IE, Mozilla [${uiLabelMap.OrderSubmitOrder}]  --> +
    +<#else> +

    ${uiLabelMap.OrderErrorShoppingCartEmpty}.

    + diff --git a/template/order/checkoutshippingaddress.ftl b/template/order/checkoutshippingaddress.ftl new file mode 100644 index 0000000..ba324f6 --- /dev/null +++ b/template/order/checkoutshippingaddress.ftl @@ -0,0 +1,149 @@ +<#-- +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. +--> + + +<#assign cart = shoppingCart!/> +
    +
    + +
    +
    +
    1) ${uiLabelMap.OrderWhereShallWeShipIt}?
    +
    +
    + + + + + <#if shippingContactMechList?has_content> + + <#list shippingContactMechList as shippingContactMech> + <#assign shippingAddress = shippingContactMech.getRelatedOne("PostalAddress", false)> + <#assign checkThisAddress = (shippingContactMech_index == 0 && !cart.getShippingContactMechId()?has_content) || (cart.getShippingContactMechId()?default("") == shippingAddress.contactMechId)/> + + + + + + + +
    + ${uiLabelMap.OrderSplitShipment} + ${uiLabelMap.PartyAddNewAddress} + <#if (cart.getShipGroupSize() > 1)> +
    ${uiLabelMap.OrderNOTEMultipleShipmentsExist}
    + +

    + checked="checked" /> + +
    + <#if shippingAddress.toName?has_content>${uiLabelMap.CommonTo}: ${shippingAddress.toName}
    + <#if shippingAddress.attnName?has_content>${uiLabelMap.PartyAddrAttnName}: ${shippingAddress.attnName}
    + <#if shippingAddress.address1?has_content>${shippingAddress.address1}
    + <#if shippingAddress.address2?has_content>${shippingAddress.address2}
    + <#if shippingAddress.city?has_content>${shippingAddress.city} + <#if shippingAddress.stateProvinceGeoId?has_content>
    ${shippingAddress.stateProvinceGeoId} + <#if shippingAddress.postalCode?has_content>
    ${shippingAddress.postalCode} + <#if shippingAddress.countryGeoId?has_content>
    ${shippingAddress.countryGeoId} + ${uiLabelMap.CommonUpdate} +
    +

    +
     ${uiLabelMap.AccountingAgreementInformation}
    + + <#if agreements??> + <#if agreements.size()!=1> + + + + + + + <#else> + <#list agreements as agreement> + checked="checked" />${agreement.description!} will be used for this order. + + + +
      +
    + ${uiLabelMap.OrderSelectAgreement} +
    +
      +
    + +
    +
    +
    + <#-- Party Tax Info --> +
     ${uiLabelMap.PartyTaxIdentification}
    + ${screens.render("component://order/widget/ordermgr/OrderEntryOrderScreens.xml#customertaxinfo")} +
    +
    +
    +
    + + + + + + +
    +  ${uiLabelMap.OrderBacktoShoppingCart} + + ${uiLabelMap.CommonNext} +
    diff --git a/template/order/checkoutshippingoptions.ftl b/template/order/checkoutshippingoptions.ftl new file mode 100644 index 0000000..2aca856 --- /dev/null +++ b/template/order/checkoutshippingoptions.ftl @@ -0,0 +1,203 @@ +<#-- +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. +--> + + + +
    +
    + + +
    +
    +
    2) ${uiLabelMap.OrderHowShallWeShipIt}
    +
    +
    + + <#list carrierShipmentMethodList as carrierShipmentMethod> + <#assign shippingMethod = carrierShipmentMethod.shipmentMethodTypeId + "@" + carrierShipmentMethod.partyId> + + + + + + <#if !carrierShipmentMethodList?? || carrierShipmentMethodList?size == 0> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <#if productStore.showCheckoutGiftOptions! != "N"> + + + + + + + + + + + + <#else/> + + + + + + + + + +
    + checked="checked" /> + +
    + <#if shoppingCart.getShippingContactMechId()??> + <#assign shippingEst = shippingEstWpr.getShippingEstimate(carrierShipmentMethod)?default(-1)> + + <#if carrierShipmentMethod.partyId != "_NA_">${carrierShipmentMethod.partyId!} ${carrierShipmentMethod.description!} + <#if shippingEst?has_content> - <#if (shippingEst > -1)><@ofbizCurrency amount=shippingEst isoCode=shoppingCart.getCurrency()/><#else>${uiLabelMap.OrderCalculatedOffline} +
    +
    + + +
    ${uiLabelMap.OrderUseDefault}.
    +

    +

    ${uiLabelMap.OrderShipAllAtOnce}?

    +
    + checked="checked" name="may_split" value="false" /> + +
    ${uiLabelMap.OrderPleaseWaitUntilBeforeShipping}.
    +
    + checked="checked" type="radio" name="may_split" value="true" /> + +
    ${uiLabelMap.OrderPleaseShipItemsBecomeAvailable}.
    +

    +

    ${uiLabelMap.OrderSpecialInstructions}

    +
    + +

    +

    ${uiLabelMap.OrderPoNumber}

      + <#if shoppingCart.getPoNumber()?? && shoppingCart.getPoNumber() != "(none)"> + <#assign currentPoNumber = shoppingCart.getPoNumber()> + + +

    +
    +

    ${uiLabelMap.OrderIsThisGift}

    + checked="checked" name="is_gift" value="true" />${uiLabelMap.CommonYes} + checked="checked" name="is_gift" value="false" />${uiLabelMap.CommonNo} +
    +

    +

    ${uiLabelMap.OrderGiftMessage}

    +
    + +

    +

    ${uiLabelMap.PartyEmailAddresses}

    +
    +
    ${uiLabelMap.OrderEmailSentToFollowingAddresses}:
    +
    + + <#list emailList as email> + ${email.infoString!}<#if email_has_next>, + + +
    +
    ${uiLabelMap.OrderUpdateEmailAddress} ${uiLabelMap.PartyProfile}.
    +
    +
    ${uiLabelMap.OrderCommaSeperatedEmailAddresses}:
    + +
    +
    +
    +
    +
    + + + + + + +
    +  ${uiLabelMap.OrderBacktoShoppingCart} + + ${uiLabelMap.CommonNext} +
    diff --git a/template/order/custsettings.ftl b/template/order/custsettings.ftl new file mode 100644 index 0000000..a135576 --- /dev/null +++ b/template/order/custsettings.ftl @@ -0,0 +1,127 @@ +<#-- +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. +--> + +

    +

    ${uiLabelMap.EcommerceYourNamePhoneAndEmail}

    +
    + +
    +
    + + + + + + + * + + + + + + + + * + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ${uiLabelMap.PartyPhoneNumbers}
    ${uiLabelMap.CommonCountry}${uiLabelMap.PartyAreaCode}${uiLabelMap.PartyContactNumber}${uiLabelMap.PartyExtension}${uiLabelMap.PartyAllowSolicitation}
    ${uiLabelMap.PartyHomePhone} + +
    ${uiLabelMap.PartyBusinessPhone} + +
    +
    +
    + + + + * + + + + + +
    +
    + +
    +
    +
    diff --git a/template/order/eftinfo.ftl b/template/order/eftinfo.ftl new file mode 100644 index 0000000..8af1ebd --- /dev/null +++ b/template/order/eftinfo.ftl @@ -0,0 +1,60 @@ +<#-- +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. +--> + +<#-- eft fields --> +<#if !eftAccount?has_content><#assign eftAccount = requestParameters> +
    + +
    ${uiLabelMap.AccountingEFTAccountInformation}
       + +
    ${uiLabelMap.AccountingNameOnAccount}
    +   + * + + +
    ${uiLabelMap.AccountingCompanyNameOnAccount}
      + + + +
    ${uiLabelMap.AccountingBankName}
    +  * + + +
    ${uiLabelMap.AccountingRoutingNumber}
    +  * + + +
    ${uiLabelMap.AccountingAccountType}
      + + * + + + +
    ${uiLabelMap.AccountingAccountNumber}
    +  * + + +
    ${uiLabelMap.CommonDescription}
    +   + diff --git a/template/order/gcinfo.ftl b/template/order/gcinfo.ftl new file mode 100644 index 0000000..5995eff --- /dev/null +++ b/template/order/gcinfo.ftl @@ -0,0 +1,62 @@ +<#-- +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. +--> + +<#-- gift card fields --> + + <#assign giftCard = giftCard!> + <#if paymentMethodTypeId! != "GIFT_CARD"> + +
    + + + +
    ${uiLabelMap.AccountingGiftCardInformation}
    +   +   + + +
    ${uiLabelMap.AccountingGiftCardNumber}
    +   + + + * + + +
    ${uiLabelMap.AccountingPINNumber}
    +   + + + * + + +
    ${uiLabelMap.CommonDescription}
    +   + + + + + <#if paymentMethodTypeId! != "GIFT_CARD"> + +
    ${uiLabelMap.AccountingAmountToUse}
    +   + + + * + + diff --git a/template/order/genericaddress.ftl b/template/order/genericaddress.ftl new file mode 100644 index 0000000..5b57077 --- /dev/null +++ b/template/order/genericaddress.ftl @@ -0,0 +1,113 @@ +<#-- +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. +--> + +<#-- generic address information --> +<#assign toName = (parameters.toName)!> +<#if !toName?has_content && person?? && person?has_content> + <#assign toName = ""> + <#if person.personalTitle?has_content><#assign toName = person.personalTitle + " "> + <#assign toName = toName + person.firstName + " "> + <#if person.middleName?has_content><#assign toName = toName + person.middleName + " "> + <#assign toName = toName + person.lastName> + <#if person.suffix?has_content><#assign toName = toName + " " + person.suffix> + + + +
    ${uiLabelMap.PartyToName}
    +   + + disabled/> + + + +
    ${uiLabelMap.PartyAttentionName}
    +   + + disabled/> + + + +
    ${uiLabelMap.PartyAddressLine1}
    +   + + disabled/> + * + + +
    ${uiLabelMap.PartyAddressLine2}
    +   + + disabled/> + + + +
    ${uiLabelMap.PartyCity}
    +   + + disabled/> + * + + +
    ${uiLabelMap.PartyState}
    +   + + + * + + +
    ${uiLabelMap.PartyZipCode}
    +   + + disabled/> + * + + +
    ${uiLabelMap.CommonCountry}
    +   + + + * + + +
    ${uiLabelMap.PartyAllowSolicitation}?
    +   + + + + diff --git a/template/order/optionsettings.ftl b/template/order/optionsettings.ftl new file mode 100644 index 0000000..430585e --- /dev/null +++ b/template/order/optionsettings.ftl @@ -0,0 +1,85 @@ +<#-- +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. +--> + +

    ${uiLabelMap.OrderShippingInformation}

    +
    +
    ${uiLabelMap.OrderShippingInformation} + +
      + <#list carrierShipmentMethodList as carrierShipmentMethod> +
    • + <#assign shippingMethod = carrierShipmentMethod.shipmentMethodTypeId + "@" + carrierShipmentMethod.partyId> + checked="checked"/> + +
    • + + <#if !carrierShipmentMethodList?? || carrierShipmentMethodList?size == 0> +
      + + +
      + +
    +
    ${uiLabelMap.OrderShipAllAtOnce}? +
    + checked="checked" name="may_split" value="false"/> + +
    +
    + checked="checked" name="may_split" value="true"/> + +
    +
    +
    +
    + + +
    +
    + + +
    +
    + <#if productStore.showCheckoutGiftOptions! != "N"> +
    ${uiLabelMap.OrderIsThisGift} +
    + checked="checked" name="is_gift" value="true"/> + +
    +
    + checked="checked" name="is_gift" value="false"/> + +
    +
    + + +
    +
    + +
    + +
    +
    diff --git a/template/order/ordercomplete.ftl b/template/order/ordercomplete.ftl new file mode 100644 index 0000000..83f1da7 --- /dev/null +++ b/template/order/ordercomplete.ftl @@ -0,0 +1,27 @@ +<#-- +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. +--> +

    ${uiLabelMap.EcommerceOrderConfirmation}

    +<#if !isDemoStore?? || isDemoStore>

    ${uiLabelMap.OrderDemoFrontNote}.

    +<#if orderHeader?has_content> + ${screens.render("component://${activeApp}/widget/OrderScreens.xml#orderheader")} + ${screens.render("component://${activeApp}/widget/OrderScreens.xml#orderitems")} + ${uiLabelMap.EcommerceContinueShopping} +<#else> +

    ${uiLabelMap.OrderSpecifiedNotFound}.

    + diff --git a/template/order/orderheader.ftl b/template/order/orderheader.ftl new file mode 100644 index 0000000..03a8166 --- /dev/null +++ b/template/order/orderheader.ftl @@ -0,0 +1,57 @@ +<#-- +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. +--> + +<#-- NOTE: this template is used for the orderstatus screen in ecommerce AND for order notification emails through the OrderNoticeEmail.ftl file --> +<#-- the "urlPrefix" value will be prepended to URLs by the ofbizUrl transform if/when there is no "request" object in the context --> +<#if baseEcommerceSecureUrl??><#assign urlPrefix = baseEcommerceSecureUrl/> +<#if (orderHeader.externalId)?? && (orderHeader.externalId)?has_content > + <#assign externalOrder = "(" + orderHeader.externalId + ")"/> + + +
    + <#-- left side --> +
    +
    +
    + +
    + <#-- placing customer information --> + <#if localOrderReadHelper?? && orderHeader?has_content> + <#assign displayParty = localOrderReadHelper.getPlacingParty()!/> + <#if displayParty?has_content> + <#assign displayPartyNameResult = dispatcher.runSync("getPartyNameForDate", Static["org.ofbiz.base.util.UtilMisc"].toMap("partyId", displayParty.partyId, "compareDate", orderHeader.orderDate, "userLogin", userLogin))/> + + ${uiLabelMap.PartyName}: + ${(displayPartyNameResult.fullName)?default("[Name Not Found]")} + + <#if distributorId??> + ${uiLabelMap.OrderDistributor}: ${distributorId} + +
    +
    + <#include "ReviewStatus.ftl"/> + <#include "ReviewPayment.ftl"/> +
    + + <#-- right side --> +
    + <#include "ReviewAddress.ftl"/> +
    +
    +
    diff --git a/template/order/orderhistory.ftl b/template/order/orderhistory.ftl new file mode 100644 index 0000000..5ae52d1 --- /dev/null +++ b/template/order/orderhistory.ftl @@ -0,0 +1,22 @@ +<#-- +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. +--> + +<#include "OrderHistorySubmitted.ftl"/> +<#include "OrderHistoryShipped.ftl"/> +<#include "OrderHistoryDownloads.ftl"/> diff --git a/template/order/orderitems.ftl b/template/order/orderitems.ftl new file mode 100644 index 0000000..4bff3c7 --- /dev/null +++ b/template/order/orderitems.ftl @@ -0,0 +1,301 @@ +<#-- +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. +--> + +<#-- NOTE: this template is used for the orderstatus screen in ecommerce AND for order notification emails through the OrderNoticeEmail.ftl file --> +<#-- the "urlPrefix" value will be prepended to URLs by the ofbizUrl transform if/when there is no "request" object in the context --> +<#if baseEcommerceSecureUrl??><#assign urlPrefix = baseEcommerceSecureUrl/> +
    +

    + <#assign numColumns = 8> + <#if maySelectItems?default("N") == "Y" && roleTypeId! == "PLACING_CUSTOMER"> + <#assign numColumns = 11> + ${uiLabelMap.OrderAddAllToCart}${uiLabelMap.OrderAddCheckedToCart}createShoppingListFromOrder?orderId=${orderHeader.orderId}&frequency=6&intervalNumber=1&shoppingListTypeId=SLT_AUTO_REODR" class="submenutextright">${uiLabelMap.OrderSendMeThisEveryMonth} + + ${uiLabelMap.OrderOrderItems} +

    + + + + + <#if maySelectItems?default("N") == "Y"> + + + + + <#else> + + + + + + + + + <#if maySelectItems?default("N") == "Y" && roleTypeId! == "PLACING_CUSTOMER"> + + + + + + + + + <#if maySelectItems?default("N") == "Y"> + + <#list headerAdjustmentsToShow as orderHeaderAdjustment> + + + + <#if maySelectItems?default("N") == "Y"> + + + + + + <#if maySelectItems?default("N") == "Y"> + + + + + <#if maySelectItems?default("N") == "Y"> + + + + <#if maySelectItems?default("N") == "Y"> + + + <#else> + + + + + + + <#if maySelectItems?default("N") == "Y"> + + + + <#list orderItems as orderItem> + <#-- get info from workeffort and calculate rental quantity, if it was a rental item --> + <#assign rentalQuantity = 1> <#-- no change if no rental item --> + <#if orderItem.orderItemTypeId == "RENTAL_ORDER_ITEM" && workEfforts??> + <#list workEfforts as workEffort> + <#if workEffort.workEffortId == orderItem.orderItemSeqId> + <#assign rentalQuantity = localOrderReadHelper.getWorkEffortRentalQuantity(workEffort)> + <#assign workEffortSave = workEffort> + <#break> + + + <#else> + <#assign WorkOrderItemFulfillments = orderItem.getRelated("WorkOrderItemFulfillment", null, null, false)!> + <#if WorkOrderItemFulfillments?has_content> + <#list WorkOrderItemFulfillments as WorkOrderItemFulfillment> + <#assign workEffortSave = WorkOrderItemFulfillment.getRelatedOne("WorkEffort", true)!> + <#break> + + + + + + <#if !orderItem.productId?? || orderItem.productId == "_?_"> + + <#else> + <#assign product = orderItem.getRelatedOne("Product", true)!/> <#-- should always exist because of FK constraint, but just in case --> + + <#if !(maySelectItems?default("N") == "Y")> + + + + + + <#if maySelectItems?default("N") == "Y"> + + + + + + + + <#if maySelectItems?default("N") == "Y" && roleTypeId! == "PLACING_CUSTOMER"> + + + + + + + <#-- now cancel reason and comment field --> + <#if maySelectItems?default("N") == "Y" && (orderHeader.statusId != "ORDER_SENT" && orderItem.statusId != "ITEM_COMPLETED" && orderItem.statusId != "ITEM_CANCELLED" && pickedQty == 0)> + + + + + + <#-- show info from workeffort if it was a rental item --> + <#if orderItem.orderItemTypeId == "RENTAL_ORDER_ITEM"> + <#if workEffortSave??> + + + + <#-- now show adjustment details per line item --> + <#assign itemAdjustments = localOrderReadHelper.getOrderItemAdjustments(orderItem)> + <#list itemAdjustments as orderItemAdjustment> + + + + + + <#if maySelectItems?default("N") == "Y"> + + + <#-- show the order item ship group info --> + <#assign orderItemShipGroupAssocs = orderItem.getRelated("OrderItemShipGroupAssoc", null, null, false)!> + <#if orderItemShipGroupAssocs?has_content> + <#list orderItemShipGroupAssocs as shipGroupAssoc> + <#assign shipGroup = shipGroupAssoc.getRelatedOne("OrderItemShipGroup", false)!> + <#assign shipGroupAddress = (shipGroup.getRelatedOne("PostalAddress", false))!> + + + + + + + + + <#if orderItems?size == 0 || !orderItems?has_content> + + + + +
    ${uiLabelMap.OrderProduct}${uiLabelMap.OrderQtyOrdered}${uiLabelMap.OrderQtyPicked}${uiLabelMap.OrderQtyShipped}${uiLabelMap.OrderQtyCanceled}${uiLabelMap.OrderQtyOrdered}${uiLabelMap.EcommerceUnitPrice}${uiLabelMap.OrderAdjustments}${uiLabelMap.CommonSubtotal}
    ${uiLabelMap.CommonSubtotal}<@ofbizCurrency amount=orderSubTotal isoCode=currencyUomId/>
    ${localOrderReadHelper.getAdjustmentType(orderHeaderAdjustment)}<@ofbizCurrency amount=localOrderReadHelper.getOrderAdjustmentTotal(orderHeaderAdjustment) isoCode=currencyUomId/>
    ${uiLabelMap.OrderShippingAndHandling}<@ofbizCurrency amount=orderShippingTotal isoCode=currencyUomId/>
    ${uiLabelMap.OrderSalesTax}<@ofbizCurrency amount=orderTaxTotal isoCode=currencyUomId/>
    ${uiLabelMap.OrderGrandTotal} + <@ofbizCurrency amount=orderGrandTotal isoCode=currencyUomId/> +
    + ${orderItem.itemDescription?default("")} + + " class="linktext">${orderItem.productId} - ${orderItem.itemDescription?default("")} + <#assign orderItemAttributes = orderItem.getRelated("OrderItemAttribute", null, null, false)/> + <#if orderItemAttributes?has_content> +
      + <#list orderItemAttributes as orderItemAttribute> +
    • + ${orderItemAttribute.attrName} : ${orderItemAttribute.attrValue} +
    • + +
    + + <#if product?has_content> + <#if product.piecesIncluded?? && product.piecesIncluded?long != 0> + [${uiLabelMap.OrderPieces}: ${product.piecesIncluded}] + + <#if (product.quantityIncluded?? && product.quantityIncluded != 0) || product.quantityUomId?has_content> + <#assign quantityUom = product.getRelatedOne("QuantityUom", true)!/> + [${uiLabelMap.CommonQuantity}: ${product.quantityIncluded!} ${((quantityUom.abbreviation)?default(product.quantityUomId))!}] + + <#if (product.productWeight?? && product.productWeight != 0) || product.weightUomId?has_content> + <#assign weightUom = product.getRelatedOne("WeightUom", true)!/> + [${uiLabelMap.CommonWeight}: ${product.productWeight!} ${((weightUom.abbreviation)?default(product.weightUomId))!}] + + <#if (product.productHeight?? && product.productHeight != 0) || product.heightUomId?has_content> + <#assign heightUom = product.getRelatedOne("HeightUom", true)!/> + [${uiLabelMap.CommonHeight}: ${product.productHeight!} ${((heightUom.abbreviation)?default(product.heightUomId))!}] + + <#if (product.productWidth?? && product.productWidth != 0) || product.widthUomId?has_content> + <#assign widthUom = product.getRelatedOne("WidthUom", true)!/> + [${uiLabelMap.CommonWidth}: ${product.productWidth!} ${((widthUom.abbreviation)?default(product.widthUomId))!}] + + <#if (product.productDepth?? && product.productDepth != 0) || product.depthUomId?has_content> + <#assign depthUom = product.getRelatedOne("DepthUom", true)!/> + [${uiLabelMap.CommonDepth}: ${product.productDepth!} ${((depthUom.abbreviation)?default(product.depthUomId))!}] + + + <#if maySelectItems?default("N") == "Y"> + <#assign returns = orderItem.getRelated("ReturnItem", null, null, false)!> + <#if returns?has_content> + <#list returns as return> + <#assign returnHeader = return.getRelatedOne("ReturnHeader", false)> + <#if returnHeader.statusId != "RETURN_CANCELLED"> + <#if returnHeader.statusId == "RETURN_REQUESTED" || returnHeader.statusId == "RETURN_APPROVED"> + <#assign displayState = "Return Pending"> + <#else> + <#assign displayState = "Returned"> + + ${displayState} (#${return.returnId}) + + + + +
    + ${orderItem.quantity?string.number} + + <#assign pickedQty = localOrderReadHelper.getItemPickedQuantityBd(orderItem)> + <#if pickedQty gt 0 && orderHeader.statusId == "ORDER_APPROVED">${pickedQty?default(0)?string.number}<#else>${pickedQty?default(0)?string.number} + + <#assign shippedQty = localOrderReadHelper.getItemShippedQuantity(orderItem)> + ${shippedQty?default(0)?string.number} + + <#assign canceledQty = localOrderReadHelper.getItemCanceledQuantity(orderItem)> + ${canceledQty?default(0)?string.number} + + <@ofbizCurrency amount=orderItem.unitPrice isoCode=currencyUomId/> + + <@ofbizCurrency amount=localOrderReadHelper.getOrderItemAdjustmentsTotal(orderItem) isoCode=currencyUomId/> + + <#if workEfforts??> + <@ofbizCurrency amount=localOrderReadHelper.getOrderItemTotal(orderItem)*rentalQuantity isoCode=currencyUomId/> + <#else> + <@ofbizCurrency amount=localOrderReadHelper.getOrderItemTotal(orderItem) isoCode=currencyUomId/> + + + +
    ${uiLabelMap.OrderReturnReason} + + ${uiLabelMap.CommonComments} + + ${uiLabelMap.CommonCancel} + +
    ${uiLabelMap.CommonFrom}: ${workEffortSave.estimatedStartDate?string("yyyy-MM-dd")} ${uiLabelMap.CommonUntil} ${workEffortSave.estimatedCompletionDate?string("yyyy-MM-dd")} ${uiLabelMap.CommonFor} ${workEffortSave.reservPersons} ${uiLabelMap.CommonPerson}(s)
    + ${uiLabelMap.EcommerceAdjustment}: ${StringUtil.wrapString(localOrderReadHelper.getAdjustmentType(orderItemAdjustment))} + <#if orderItemAdjustment.description?has_content>: ${StringUtil.wrapString(orderItemAdjustment.description)} + <#if orderItemAdjustment.orderAdjustmentTypeId == "SALES_TAX"> + <#if orderItemAdjustment.primaryGeoId?has_content> + <#assign primaryGeo = orderItemAdjustment.getRelatedOne("PrimaryGeo", true)/> + <#if primaryGeo.geoName?has_content> + ${uiLabelMap.OrderJurisdiction}: ${primaryGeo.geoName} [${primaryGeo.abbreviation!}] + + <#if orderItemAdjustment.secondaryGeoId?has_content> + <#assign secondaryGeo = orderItemAdjustment.getRelatedOne("SecondaryGeo", true)/> + (${uiLabelMap.CommonIn}: ${secondaryGeo.geoName} [${secondaryGeo.abbreviation!}]) + + + <#if orderItemAdjustment.sourcePercentage??>${uiLabelMap.EcommerceRate}: ${orderItemAdjustment.sourcePercentage} + <#if orderItemAdjustment.customerReferenceId?has_content>${uiLabelMap.OrderCustomerTaxId}: ${orderItemAdjustment.customerReferenceId} + <#if orderItemAdjustment.exemptAmount??>${uiLabelMap.EcommerceExemptAmount}: ${orderItemAdjustment.exemptAmount} + + + <@ofbizCurrency amount=localOrderReadHelper.getOrderItemAdjustmentTotal(orderItem, orderItemAdjustment) isoCode=currencyUomId/> +
    + ${uiLabelMap.OrderShipGroup}: [${shipGroup.shipGroupSeqId}] ${shipGroupAddress.address1?default("N/A")} + + ${shipGroupAssoc.quantity?string.number} +
    ${uiLabelMap.OrderSalesOrderLookupFailed}
    +
    diff --git a/template/order/orderstatus.ftl b/template/order/orderstatus.ftl new file mode 100644 index 0000000..b05bfdc --- /dev/null +++ b/template/order/orderstatus.ftl @@ -0,0 +1,29 @@ +<#-- +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. +--> +<#if orderHeader?has_content> +
    + + + ${screens.render("component://${activeApp}/widget/OrderScreens.xml#orderheader")} + ${screens.render("component://${activeApp}/widget/OrderScreens.xml#orderitems")} +
    + +<#else> +

    ${uiLabelMap.OrderSpecifiedNotFound}.

    + diff --git a/template/order/paymentinformation.ftl b/template/order/paymentinformation.ftl new file mode 100644 index 0000000..a41e6f1 --- /dev/null +++ b/template/order/paymentinformation.ftl @@ -0,0 +1,247 @@ +<#-- +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. +--> +<#if requestParameters.paymentMethodTypeId?has_content> + <#assign paymentMethodTypeId = "${requestParameters.paymentMethodTypeId!}"> + + + +
    +
    +
    ${uiLabelMap.AccountingPaymentInformation}
    +
    +
    + <#-- after initial screen; show detailed screens for selected type --> + <#if paymentMethodTypeId! == "CREDIT_CARD"> + <#if creditCard?has_content && postalAddress?has_content && !requestParameters.useShipAddr??> +
    + + + <#elseif requestParameters.useShipAddr??> + + <#else> + + + <#elseif paymentMethodTypeId! == "EFT_ACCOUNT"> + <#if eftAccount?has_content && postalAddress?has_content> + + + + <#elseif requestParameters.useShipAddr??> + + <#else> + + + <#elseif paymentMethodTypeId! == "GIFT_CARD"> <#--Don't know much how this is handled --> + + <#elseif paymentMethodTypeId! == "EXT_OFFLINE"> + + <#else> +
    ${uiLabelMap.AccountingPaymentMethodTypeNotHandled} ${paymentMethodTypeId!}
    + + + <#if requestParameters.singleUsePayment?default("N") == "Y"> + + + + + + + + <#if requestParameters.useShipAddr??> + + + + + <#if cart.getShippingContactMechId()?? && paymentMethodTypeId! != "GIFT_CARD"> + + + + + + + + + + <#if (paymentMethodTypeId! == "CREDIT_CARD" || paymentMethodTypeId! == "EFT_ACCOUNT")> + + + + + + ${screens.render("component://${activeApp}/widget/OrderScreens.xml#genericaddress")} + + + <#-- credit card fields --> + <#if paymentMethodTypeId! == "CREDIT_CARD"> + <#if !creditCard?has_content> + <#assign creditCard = requestParameters> + + + + + + + + + + + ${screens.render("component://accounting/widget/CommonScreens.xml#creditCardFields")} + + + <#-- eft fields --> + <#if paymentMethodTypeId! =="EFT_ACCOUNT"> + <#if !eftAccount?has_content> + <#assign eftAccount = requestParameters> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <#-- gift card fields --> + <#if requestParameters.addGiftCard?default("") == "Y" || paymentMethodTypeId! == "GIFT_CARD"> + + <#assign giftCard = giftCard!> + <#if paymentMethodTypeId! != "GIFT_CARD"> + + + + + + + + + + + + + + + + + + + + + + + + + <#if paymentMethodTypeId! != "GIFT_CARD"> + + + + + + + + + + + +
    + checked="checked"/> + +
    ${uiLabelMap.FacilityBillingAddressSameShipping}
    +

    ${uiLabelMap.PartyBillingAddress}
      

    ${uiLabelMap.AccountingCreditCardInformation}
      

    ${uiLabelMap.AccountingEFTAccountInformation}
      
    ${uiLabelMap.AccountingNameOnAccount}
      + + *
    ${uiLabelMap.AccountingCompanyNameOnAccount}
      + +
    ${uiLabelMap.AccountingBankName}
      + + *
    ${uiLabelMap.AccountingRoutingNumber}
      + + *
    ${uiLabelMap.AccountingAccountType}
      + + *
    ${uiLabelMap.AccountingAccountNumber}
      + + *
    ${uiLabelMap.CommonDescription}
      + +

    ${uiLabelMap.AccountingGiftCardInformation}
      
    ${uiLabelMap.AccountingGiftCardNumber}
      + + *
    ${uiLabelMap.AccountingPINNumber}
      + + *
    ${uiLabelMap.CommonDescription}
      + +
    ${uiLabelMap.AccountingAmountToUse}
      + + *
    + +
    +
    +
    +
    diff --git a/template/order/paymentoptions.ftl b/template/order/paymentoptions.ftl new file mode 100644 index 0000000..409f90a --- /dev/null +++ b/template/order/paymentoptions.ftl @@ -0,0 +1,59 @@ +<#-- +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. +--> + + +

    ${uiLabelMap.AccountingPaymentInformation}

    + <#-- initial screen show a list of options --> +
    +
    + <#if productStorePaymentMethodTypeIdMap.GIFT_CARD??> +
    + checked="checked" /> + +
    + + <#if productStorePaymentMethodTypeIdMap.EXT_OFFLINE??> +
    + checked="checked" /> + +
    + + <#if productStorePaymentMethodTypeIdMap.CREDIT_CARD??> +
    + checked="checked" /> + +
    + + <#if productStorePaymentMethodTypeIdMap.EFT_ACCOUNT??> +
    + checked="checked" /> + +
    + + <#if productStorePaymentMethodTypeIdMap.EXT_PAYPAL??> +
    + checked="checked" /> + +
    + +
    + +
    +
    +
    diff --git a/template/order/quickAnonCheckoutLinks.ftl b/template/order/quickAnonCheckoutLinks.ftl new file mode 100644 index 0000000..51a6534 --- /dev/null +++ b/template/order/quickAnonCheckoutLinks.ftl @@ -0,0 +1,31 @@ +<#-- +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. +--> + + diff --git a/template/order/quickAnonCheckoutReview.ftl b/template/order/quickAnonCheckoutReview.ftl new file mode 100644 index 0000000..1380e27 --- /dev/null +++ b/template/order/quickAnonCheckoutReview.ftl @@ -0,0 +1,74 @@ +<#-- +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. +--> + + + +

    ${uiLabelMap.OrderFinalCheckoutReview}

    +<#if !isDemoStore?? || isDemoStore>

    ${uiLabelMap.OrderDemoFrontNote}.

    + +<#if cart?? && 0 < cart.size()> + ${screens.render("component://${activeApp}/widget/OrderScreens.xml#quickAnonOrderHeader")} +
    +
    ${screens.render("component://${activeApp}/widget/OrderScreens.xml#orderitems")}
    +
    + + + + + +
    +   + + <#if (requestParameters.checkoutpage)?has_content> + + + + <#-- doesn't work with Safari, seems to work with IE, Mozilla [${uiLabelMap.OrderSubmitOrder}]  --> +
    +
    +<#else> +

    ${uiLabelMap.OrderErrorShoppingCartEmpty}.

    + diff --git a/template/order/quickAnonCustSettings.ftl b/template/order/quickAnonCustSettings.ftl new file mode 100644 index 0000000..a6bdf92 --- /dev/null +++ b/template/order/quickAnonCustSettings.ftl @@ -0,0 +1,333 @@ +<#-- +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. +--> + + +<#macro fieldErrors fieldName> + <#if errorMessageList?has_content> + <#assign fieldMessages = Static["org.ofbiz.base.util.MessageString"].getMessagesForField(fieldName, true, errorMessageList)> +
      + <#list fieldMessages as errorMsg> +
    • ${errorMsg}
    • + +
    + + +<#macro fieldErrorsMulti fieldName1 fieldName2 fieldName3 fieldName4> + <#if errorMessageList?has_content> + <#assign fieldMessages = Static["org.ofbiz.base.util.MessageString"].getMessagesForField(fieldName1, fieldName2, fieldName3, fieldName4, true, errorMessageList)> +
      + <#list fieldMessages as errorMsg> +
    • ${errorMsg}
    • + +
    + + + +
    +
    +
    ${uiLabelMap.PartyBasicInformation}
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      
    ${uiLabelMap.PartyNameAndConactInfo}
      
    ${uiLabelMap.PartyFirstName}
      + <@fieldErrors fieldName="firstName"/> + * +
    ${uiLabelMap.PartyMiddleInitial}
      + +
    ${uiLabelMap.PartyLastName}
      + <@fieldErrors fieldName="lastName"/> + * +
     
    [${uiLabelMap.CommonCountryCode}] [${uiLabelMap.PartyAreaCode}] [${uiLabelMap.PartyContactNumber}] [${uiLabelMap.PartyExtension}]
    ${uiLabelMap.PartyHomePhone}
      + <@fieldErrorsMulti fieldName1="homeCountryCode" fieldName2="homeAreaCode" fieldName3="homeContactNumber" fieldName4="homeExt"/> +
    + + + -  + -  + -  * +
    +
    ${uiLabelMap.PartyBusinessPhone}
      + + + -  + -  + -  +
    ${uiLabelMap.PartyEmailAddress}
      + <@fieldErrors fieldName="emailAddress"/> + + * +
    +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      
    ${uiLabelMap.OrderShippingAddress}
      
    ${uiLabelMap.PartyToName}
      + <@fieldErrors fieldName="shipToName"/> + +
    ${uiLabelMap.PartyAttentionName}
      + <@fieldErrors fieldName="shipToAttnName"/> + +
    ${uiLabelMap.PartyAddressLine1}
      + <@fieldErrors fieldName="shipToAddress1"/> + + *
    ${uiLabelMap.PartyAddressLine2}
      + +
    ${uiLabelMap.PartyCity}
      + <@fieldErrors fieldName="shipToCity"/> + + *
    ${uiLabelMap.PartyState}
      + <@fieldErrors fieldName="shipToStateProvinceGeoId"/> + + *
    ${uiLabelMap.PartyZipCode}
      + <@fieldErrors fieldName="shipToPostalCode"/> + + *
    ${uiLabelMap.CommonCountry}
      + <@fieldErrors fieldName="shipToCountryGeoId"/> + + *
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + ${uiLabelMap.FacilityBillingAddressSameShipping} +
    +
    ${uiLabelMap.PartyBillingAddress}
      
    ${uiLabelMap.PartyToName}
      + <@fieldErrors fieldName="billToName"/> + +
    ${uiLabelMap.PartyAttentionName}
      + <@fieldErrors fieldName="billToAttnName"/> + +
    ${uiLabelMap.PartyAddressLine1}
      + <@fieldErrors fieldName="billToAddress1"/> + + *
    ${uiLabelMap.PartyAddressLine2}
      + +
    ${uiLabelMap.PartyCity}
      + <@fieldErrors fieldName="billToCity"/> + + *
    ${uiLabelMap.PartyState}
      + <@fieldErrors fieldName="billToStateProvinceGeoId"/> + + *
    ${uiLabelMap.PartyZipCode}
      + <@fieldErrors fieldName="billToPostalCode"/> + + *
    ${uiLabelMap.CommonCountry}
      + <@fieldErrors fieldName="billToCountryGeoId"/> + + *
    +
     
    +
    +
    +
    diff --git a/template/order/quickAnonOptionSettings.ftl b/template/order/quickAnonOptionSettings.ftl new file mode 100644 index 0000000..15cced5 --- /dev/null +++ b/template/order/quickAnonOptionSettings.ftl @@ -0,0 +1,168 @@ +<#-- +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. +--> + + +
    +
    + + + + + + + + + + + + + + + +
    + + + + + + <#list carrierShipmentMethodList as carrierShipmentMethod> + + + + + <#if !carrierShipmentMethodList?? || carrierShipmentMethodList?size == 0> + + + + +
    +

    ${uiLabelMap.OrderMethod}

    +
    +
    + <#assign shippingMethod = carrierShipmentMethod.shipmentMethodTypeId + "@" + carrierShipmentMethod.partyId> + checked="checked"/> + <#if shoppingCart.getShippingContactMechId()??> + <#assign shippingEst = shippingEstWpr.getShippingEstimate(carrierShipmentMethod)?default(-1)> + + <#if carrierShipmentMethod.partyId != "_NA_">${carrierShipmentMethod.partyId!} ${carrierShipmentMethod.description!} + <#if shippingEst?has_content> - <#if (shippingEst > -1)><@ofbizCurrency amount=shippingEst isoCode=shoppingCart.getCurrency()/><#else>${uiLabelMap.OrderCalculatedOffline} +
    +
    +
    ${uiLabelMap.OrderUseDefault}.
    +
    +
    +
    + + + + + + + + + + + + <#if productStore.showCheckoutGiftOptions! != "N"> + + + + + + + + + + + + +
    +

    ${uiLabelMap.OrderSpecialInstructions}

    +
    + +

    +

    ${uiLabelMap.OrderPoNumber}

      + +

    +
    +

    ${uiLabelMap.OrderIsThisGift}

    + checked="checked" name='is_gift' value='true'/>${uiLabelMap.CommonYes} + checked="checked" name='is_gift' value='false'/>${uiLabelMap.CommonNo} +
    +

    +

    ${uiLabelMap.OrderGiftMessage}

    +
    + +
    +

    ${uiLabelMap.OrderShipAllAtOnce}?

    +
    + checked="checked" name='may_split' value='false'/> + ${uiLabelMap.OrderPleaseWaitUntilBeforeShipping}. +
    +
    +
    + checked="checked" type='radio' name='may_split' value='true'/> + ${uiLabelMap.OrderPleaseShipItemsBecomeAvailable}. +
    +
    +
    +
    diff --git a/template/order/quickAnonOrderHeader.ftl b/template/order/quickAnonOrderHeader.ftl new file mode 100644 index 0000000..edfa96c --- /dev/null +++ b/template/order/quickAnonOrderHeader.ftl @@ -0,0 +1,160 @@ +<#-- +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. +--> + +<#-- NOTE: this template is used for the orderstatus screen in ecommerce AND for order notification emails through the OrderNoticeEmail.ftl file --> +<#-- the "urlPrefix" value will be prepended to URLs by the ofbizUrl transform if/when there is no "request" object in the context --> +<#if baseEcommerceSecureUrl??><#assign urlPrefix = baseEcommerceSecureUrl/> + + + + <#-- left side --> + + + + <#-- right side --> + + + +
    + +
    +
    + +
    ${uiLabelMap.OrderOrder} <#if orderHeader?has_content>${uiLabelMap.CommonNbr}${orderHeader.orderId} ${uiLabelMap.CommonInformation}
    +
    +
    + + <#-- placing customer information --> + <#if localOrderReadHelper?? && orderHeader?has_content> + <#assign displayParty = localOrderReadHelper.getPlacingParty()!/> + <#if displayParty?has_content> + <#assign displayPartyNameResult = dispatcher.runSync("getPartyNameForDate", Static["org.ofbiz.base.util.UtilMisc"].toMap("partyId", displayParty.partyId, "compareDate", orderHeader.orderDate, "userLogin", userLogin))/> + + + + + + + + + <#-- order status information --> + + + + + + <#-- ordered date --> + <#if orderHeader?has_content> + + + + + + + + <#if distributorId??> + + + + + + + +
    +
     ${uiLabelMap.PartyName}
    +
      +
    + ${(displayPartyNameResult.fullName)?default("[Name Not Found]")} +
    +

    +
     ${uiLabelMap.CommonStatus}
    +
      + <#if orderHeader?has_content> +
    ${localOrderReadHelper.getStatusString(locale)}
    + <#else> +
    ${uiLabelMap.OrderNotYetOrdered}
    + +

    +
     ${uiLabelMap.CommonDate}
    +
      +
    ${orderHeader.orderDate.toString()}
    +

    +
     ${uiLabelMap.OrderDistributor}
    +
      +
    ${distributorId}
    +
    +
    +
    + ${screens.render("component://${activeApp}/widget/OrderScreens.xml#quickAnonPaymentInformation")} +
       + <#if orderItemShipGroups?has_content> + +
    +
    +
    ${uiLabelMap.OrderShippingInformation}
    +
    +
    + <#-- shipping address --> + <#assign groupIdx = 0> + <#list orderItemShipGroups as shipGroup> + <#if orderHeader?has_content> + <#assign shippingAddress = shipGroup.getRelatedOne("PostalAddress", false)!> + <#assign groupNumber = shipGroup.shipGroupSeqId!> + <#else> + <#assign shippingAddress = cart.getShippingAddress(groupIdx)!> + <#assign groupNumber = groupIdx + 1> + + + + <#if shippingAddress?has_content> + + + + + + + + +
    +
     ${uiLabelMap.OrderDestination} [${groupNumber}]
    +
      +
    + <#if shippingAddress.toName?has_content>${uiLabelMap.CommonTo}: ${shippingAddress.toName}
    + <#if shippingAddress.attnName?has_content>${uiLabelMap.PartyAddrAttnName}: ${shippingAddress.attnName}
    + ${shippingAddress.address1}
    + <#if shippingAddress.address2?has_content>${shippingAddress.address2}
    + ${shippingAddress.city}<#if shippingAddress.stateProvinceGeoId?has_content>, ${shippingAddress.stateProvinceGeoId} + ${shippingAddress.postalCode!}
    + ${shippingAddress.countryGeoId!} +
    +

    + ${screens.render("component://${activeApp}/widget/OrderScreens.xml#quickAnonOptionSettings")} +
    + + <#assign groupIdx = groupIdx + 1> + <#-- end list of orderItemShipGroups --> +
    +
    + + +
    diff --git a/template/order/quickAnonPaymentInformation.ftl b/template/order/quickAnonPaymentInformation.ftl new file mode 100644 index 0000000..a398ec9 --- /dev/null +++ b/template/order/quickAnonPaymentInformation.ftl @@ -0,0 +1,162 @@ +<#-- +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. +--> +<#if requestParameters.paymentMethodTypeId?has_content> + <#assign paymentMethodTypeId = "${requestParameters.paymentMethodTypeId!}"> + + +
    +
    +
    +
    ${uiLabelMap.AccountingPaymentInformation}
    +
    +
    + <#if requestParameters.singleUsePayment?default("N") == "Y"> + + + + + + + + <#if session.getAttribute("billingContactMechId")??> + + + + + + + + + + + + <#-- gift card fields --> + <#if productStorePaymentMethodTypeIdMap.GIFT_CARD??> + + + + + + +
    ${uiLabelMap.OrderSelectPaymentMethod}
    + +

    + +
    ${uiLabelMap.AccountingCheckGiftCard}
    +
    +
    +
    diff --git a/template/order/requestreturn.ftl b/template/order/requestreturn.ftl new file mode 100644 index 0000000..66ea922 --- /dev/null +++ b/template/order/requestreturn.ftl @@ -0,0 +1,157 @@ +<#-- +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. +--> + +
    +
    + +
    ${uiLabelMap.OrderReturnItems}
    +
    +
    +
    + + + + + + + <#if (orderHeader.currencyUom)?has_content> + + + + + + + + + + + + + + + + + <#if returnableItems?has_content> + <#assign rowCount = 0> + <#list returnableItems.keySet() as orderItem> + <#if !orderItem.orderAdjustmentId?has_content> <#-- filter orderAdjustments --> + + + + <#-- --> + <#assign returnItemType = returnItemTypeMap.get(returnableItems.get(orderItem).get("itemTypeKey"))/> + + + + <#-- need some order item information --> + <#assign orderHeader = orderItem.getRelatedOne("OrderHeader", false)> + <#assign itemCount = orderItem.quantity> + <#assign itemPrice = orderItem.unitPrice> + <#-- end of order item information --> + + + + + + + + + + + <#assign rowCount = rowCount + 1> + + + + + + + + + + + + + + + <#else> + + +

    ${uiLabelMap.OrderReturnItemsFromOrder} ${uiLabelMap.CommonNbr}${orderId}

    + ${uiLabelMap.CommonSelectAll}  + +
    ${uiLabelMap.CommonDescription}
    ${uiLabelMap.CommonQuantity}
    ${uiLabelMap.EcommercePrice}
    ${uiLabelMap.OrderReason}
    ${uiLabelMap.OrderRequestedResponse}
     

    +
    + <#if orderItem.productId??> +  ${orderItem.productId} + + + ${orderItem.itemDescription} +
    +
    + + +
    <@ofbizCurrency amount=returnableItems.get(orderItem).get("returnablePrice") isoCode=orderHeader.currencyUom/>
    +
    + + + + + +

    ${uiLabelMap.OrderSelectShipFromAddress}:

    + + <#list shippingContactMechList as shippingContactMech> + <#assign shippingAddress = shippingContactMech.getRelatedOne("PostalAddress", false)> + + + + + +
    + + +
    + <#if shippingAddress.toName?has_content>${uiLabelMap.CommonTo}: ${shippingAddress.toName}
    + <#if shippingAddress.attnName?has_content>${uiLabelMap.PartyAddrAttnName}: ${shippingAddress.attnName}
    + <#if shippingAddress.address1?has_content>${shippingAddress.address1}
    + <#if shippingAddress.address2?has_content>${shippingAddress.address2}
    + <#if shippingAddress.city?has_content>${shippingAddress.city} + <#if shippingAddress.stateProvinceGeoId?has_content>
    ${shippingAddress.stateProvinceGeoId} + <#if shippingAddress.postalCode?has_content>
    ${shippingAddress.postalCode} + <#if shippingAddress.countryGeoId?has_content>
    ${shippingAddress.countryGeoId} + [${uiLabelMap.CommonUpdate}] +
    +
    +

    + ${uiLabelMap.OrderReturnSelectedItems} +
    ${uiLabelMap.OrderNoReturnableItems} ${uiLabelMap.CommonNbr}${orderId}
    +
    +
    +
    diff --git a/template/order/shipsettings.ftl b/template/order/shipsettings.ftl new file mode 100644 index 0000000..9898bff --- /dev/null +++ b/template/order/shipsettings.ftl @@ -0,0 +1,71 @@ +<#-- +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. +--> +<#assign cart = sessionAttributes.shoppingCart!> +

    ${uiLabelMap.OrderShippingInformation}

    +
    +
    +
    ${uiLabelMap.OrderShippingInformation} + + +
    + + + +
    +
    + + +
    +
    + + + +
    +
    + + + +
    +
    + + + +
    +
    + + + +
    +
    + +
    +
    +
    diff --git a/template/order/splitship.ftl b/template/order/splitship.ftl new file mode 100644 index 0000000..c031223 --- /dev/null +++ b/template/order/splitship.ftl @@ -0,0 +1,263 @@ +<#-- +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. +--> + + + +
    +
    +
    ${uiLabelMap.OrderItemGroups}
    +
    +
    + + <#assign shipGroups = cart.getShipGroups()> + <#if (shipGroups.size() > 0)> + <#assign groupIdx = 0> + <#list shipGroups as group> + <#assign shipEstimateWrapper = Static["org.ofbiz.order.shoppingcart.shipping.ShippingEstimateWrapper"].getWrapper(dispatcher, cart, groupIdx)> + <#assign carrierShipmentMethods = shipEstimateWrapper.getShippingMethods()> + <#assign groupNumber = groupIdx + 1> + + + + + + + + + <#assign groupIdx = groupIdx + 1> + <#if group_has_next> + + + + + + + <#else> +
    ${uiLabelMap.OrderNoShipGroupsDefined}.
    + +
    +
    ${uiLabelMap.CommonGroup} ${groupNumber}:
    + <#list group.getShipItems() as item> + <#assign groupItem = group.getShipItemInfo(item)> +
       ${item.getName()} - (${groupItem.getItemQuantity()})
    + +
    +
    + ${uiLabelMap.CommonAdd}: + ${uiLabelMap.PartyAddNewAddress} +
    +
    + <#assign selectedContactMechId = cart.getShippingContactMechId(groupIdx)?default("")> + +
    + <#if cart.getShipmentMethodTypeId(groupIdx)??> + <#assign selectedShippingMethod = cart.getShipmentMethodTypeId(groupIdx) + "@" + cart.getCarrierPartyId(groupIdx)> + <#else> + <#assign selectedShippingMethod = ""> + + + +

    ${uiLabelMap.OrderSpecialInstructions}

    + +
    +
    + +
    +
    + +
    + +

    ${uiLabelMap.OrderGiftMessage}

    + +

    +
    +
    + +
    +
    +
    ${uiLabelMap.EcommerceAssignItems}
    +
    +
    + + + + + + + + + + + <#list cart.items() as cartLine> + <#assign cartLineIndex = cart.getItemIndex(cartLine)> + + + + + + + + + + + + + + +
    ${uiLabelMap.OrderProduct}
    ${uiLabelMap.OrderTotalQty}
     
    ${uiLabelMap.OrderMoveQty}
      
    +
    + <#if cartLine.getProductId()??> + <#-- product item --> + <#-- start code to display a small image of the product --> + <#assign smallImageUrl = Static["org.ofbiz.product.product.ProductContentWrapper"].getProductContentAsText(cartLine.getProduct(), "SMALL_IMAGE_URL", locale, dispatcher, "url")!> + <#if !smallImageUrl?string?has_content><#assign smallImageUrl = "/images/defaultImage.jpg"> + <#if smallImageUrl?string?has_content> + + + + + <#-- end code to display a small image of the product --> + ${cartLine.getProductId()} - + ${cartLine.getName()!} : ${cartLine.getDescription()!} + + <#-- display the registered ship groups and quantity --> + <#assign itemShipGroups = cart.getShipGroups(cartLine)> + <#list itemShipGroups.entrySet() as group> +
    + <#assign groupNumber = group.getKey() + 1> + Group - ${groupNumber} / ${uiLabelMap.CommonQuantity} - ${group.getValue()} +
    + + + <#-- if inventory is not required check to see if it is out of stock and needs to have a message shown about that... --> + <#assign itemProduct = cartLine.getProduct()> + <#assign isStoreInventoryNotRequiredAndNotAvailable = Static["org.ofbiz.product.store.ProductStoreWorker"].isStoreInventoryRequiredAndAvailable(request, itemProduct, cartLine.getQuantity(), false, false)> + <#if isStoreInventoryNotRequiredAndNotAvailable && itemProduct.inventoryMessage?has_content> + (${itemProduct.inventoryMessage}) + + + <#else> + <#-- this is a non-product item --> + ${cartLine.getItemTypeDescription()!} : ${cartLine.getName()!} + +
    + +
    +
    ${cartLine.getQuantity()?string.number}   
    +
    +
     
    +
    + + +
     
    +
    +
    ${uiLabelMap.CommonFrom}: + +
    +
    +
    ${uiLabelMap.CommonTo}: + +
    +
    +
    +
    + + + + + + +
    +  ${uiLabelMap.OrderBacktoShoppingCart} + + ${uiLabelMap.CommonContinue} +
    diff --git a/template/order/startanoncheckout.ftl b/template/order/startanoncheckout.ftl new file mode 100644 index 0000000..bb9dd28 --- /dev/null +++ b/template/order/startanoncheckout.ftl @@ -0,0 +1,39 @@ +<#-- +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. +--> + +<#assign shoppingCart = sessionAttributes.shoppingCart!> +<#if shoppingCart?has_content> + <#assign shoppingCartSize = shoppingCart.size()> +<#else> + <#assign shoppingCartSize = 0> + + +<#if (shoppingCartSize > 0)> +
    +

    ${uiLabelMap.CommonCheckoutAnonymous}

    +

    ${uiLabelMap.CommonCheckoutAnonymousMsg}:

    + +
    + + diff --git a/template/product/ConfigProductDetail.ftl b/template/product/ConfigProductDetail.ftl new file mode 100644 index 0000000..5a2699d --- /dev/null +++ b/template/product/ConfigProductDetail.ftl @@ -0,0 +1,224 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> +<#-- variable setup --> +<#assign productContentWrapper = productContentWrapper!> +<#assign price = priceMap!> +<#-- end variable setup --> + +<#-- virtual product javascript --> +${virtualJavaScript!} + + + + +
    +
    + <#-- Category next/previous --> + <#if category??> +
    + <#if previousProductId??> + ${uiLabelMap.CommonPrevious} |  + + ${(category.categoryName)?default(category.description)!} + <#if nextProductId??> +  | ${uiLabelMap.CommonNext} + +
    + +
    +
    + +
    +
    + <#include "ProductImage.ftl" /> +
    +
    + <#include "ProductMetaData.ftl" /> + <#include "ProductConfigurator.ftl" /> + <#include "ProductPieces.ftl" /> + <#include "ProductSwatches.ftl"/> + <#include "ProductTellaFriend.ftl" /> + <#include "ProductAddToShopList.ftl" /> +
    +
    + +
    +
    + + +
    +
    + <#include "ProductLongDescription.ftl" /> + <#include "ProductDigitalDownload.ftl" /> +
    +
    + <#include "ProductDimensions.ftl" /> +
    +
    + <#include "ProductTags.ftl" /> +
    +
    + <#include "ProductReviews.ftl" /> +
    +
    +
    +
    + +
    +
    + <#include "ProductCrossSell.ftl" /> +
    +
    diff --git a/template/product/ProductAddToOrder.ftl b/template/product/ProductAddToOrder.ftl new file mode 100644 index 0000000..a1cbacb --- /dev/null +++ b/template/product/ProductAddToOrder.ftl @@ -0,0 +1,180 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> +
    +
    +
    + ${productStoreId} + <#assign inStock = true /> + <#-- + <#assign commentEnable = Static["org.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("order", "order.item.comment.enable", delegator)> + <#if commentEnable.equals("Y")> + <#assign orderItemAttr = Static["org.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("order", "order.item.attr.prefix", delegator)> + ${uiLabelMap.CommonComment}  + + --> + <#-- Variant Selection --> + <#if product.isVirtual!?upper_case == "Y"> + <#if product.virtualVariantMethodEnum! == "VV_FEATURETREE" && featureLists?has_content> + <#list featureLists as featureList> + <#list featureList as feature> + <#if feature_index == 0> +
    + ${feature.description}: + +
    + + + +
    + ${uiLabelMap.CommonQuantity}:  + + ${uiLabelMap.OrderAddToCart} +   +
    + + <#if !product.virtualVariantMethodEnum?? || product.virtualVariantMethodEnum == "VV_VARIANTTREE"> + <#if variantTree?? && (variantTree.size() > 0)> + <#list featureSet as currentType> +
    + +
    + + + + +
    + +
    +
    + <#else> + + <#assign inStock = false /> + + + <#else> + + <#if mainProducts?has_content> + +
    +
    + +
    +
    + + <#if (availableInventory??) && (availableInventory <= 0) && product.requireAmount?default("N") == "N"> + <#assign inStock = false /> + + + + <#-- check to see if introductionDate hasnt passed yet --> + <#if product.introductionDate?? && nowTimestamp.before(product.introductionDate)> +

     

    +
    ${uiLabelMap.ProductProductNotYetMadeAvailable}.
    + + <#-- check to see if salesDiscontinuationDate has passed --> + <#elseif product.salesDiscontinuationDate?? && nowTimestamp.after(product.salesDiscontinuationDate)> +
    ${uiLabelMap.ProductProductNoLongerAvailable}.
    + + <#-- check to see if the product requires inventory check and has inventory --> + <#elseif product.virtualVariantMethodEnum! != "VV_FEATURETREE"> + <#if inStock> + <#if product.requireAmount?default("N") == "Y"> + <#assign hiddenStyle = "visible" /> + <#else> + <#assign hiddenStyle = "hidden"/> + +
    + ${uiLabelMap.CommonAmount}:  + +
    + <#if product.productTypeId! == "ASSET_USAGE" || product.productTypeId! == "ASSET_USAGE_OUT_IN"> +
    + <@htmlTemplate.renderDateTimeField event="" action="" name="reservStart" className="" alert="" title="Format: yyyy-MM-dd HH:mm:ss.SSS" value="${startDate}" size="25" maxlength="30" id="reservStart1" dateType="date" shortDateInput=true timeDropdownParamName="" defaultDateTimeString="" localizedIconTitle="" timeDropdown="" timeHourName="" classString="" hour1="" hour2="" timeMinutesName="" minutes="" isTwelveHour="" ampmName="" amSelected="" pmSelected="" compositeType="" formName=""/> +
    +
    + <#--td nowrap="nowrap" align="right">Number
    of days   + Number of days + Number of persons + Number of rooms +
    +
    + + ${uiLabelMap.OrderAddToCart} + + <#else> + disabled="disabled" /> + ${uiLabelMap.OrderAddToCart} +

    + <@showUnavailableVarients/> + + <#else> + <#if productStore??> + <#if productStore.requireInventory?? && productStore.requireInventory == "N"> + + disabled="disabled" /> + + ${uiLabelMap.OrderAddToCart} + <@showUnavailableVarients/> + <#else> + + ${uiLabelMap.OrderAddToCart}
    + ${uiLabelMap.ProductItemOutOfStock}<#if product.inventoryMessage??>— ${product.inventoryMessage} + + + + + + <#if variantPriceList??> + <#list variantPriceList as vpricing> + <#assign variantName = vpricing.get("variantName")!> + <#assign secondVariantName = vpricing.get("secondVariantName")!> + <#assign minimumQuantity = vpricing.get("minimumQuantity")> + <#if minimumQuantity > 0> +
    minimum order quantity for ${secondVariantName!} ${variantName!} is ${minimumQuantity!}
    + + + <#elseif minimumQuantity?? && minimumQuantity?has_content && minimumQuantity > 0> +
    minimum order quantity for ${productContentWrapper.get("PRODUCT_NAME", "html")!} is ${minimumQuantity!}
    + +
    +
    +
    + + + +<#-- Prefill first select box (virtual products only) --> +<#if variantTree?? && 0 < variantTree.size()> + + diff --git a/template/product/ProductAddToShopList.ftl b/template/product/ProductAddToShopList.ftl new file mode 100644 index 0000000..897b0e7 --- /dev/null +++ b/template/product/ProductAddToShopList.ftl @@ -0,0 +1,53 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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 sessionAttributes.userLogin?has_content && sessionAttributes.userLogin.userLoginId != "anonymous"> +
    +
    +
    + + + + + +    + + <#--assign nowDate = Static["org.ofbiz.base.util.UtilDateTime"].nowDateString("yyyy-MM-dd")--> + <#if product.productTypeId! == "ASSET_USAGE"> +  ${uiLabelMap.CommonStartDate} (yyyy-mm-dd)<@htmlTemplate.renderDateTimeField name="reservStartStr" event="" action="" value="${startDate}" className="" alert="" title="Format: yyyy-MM-dd HH:mm:ss.SSS" size="15" maxlength="30" id="reservStartStr" dateType="date" shortDateInput=false timeDropdownParamName="" defaultDateTimeString="" localizedIconTitle="" timeDropdown="" timeHourName="" classString="" hour1="" hour2="" timeMinutesName="" minutes="" isTwelveHour="" ampmName="" amSelected="" pmSelected="" compositeType="" formName=""/> Number of days   
    Number of persons    Qty   + <#elseif product.productTypeId! == "ASSET_USAGE_OUT_IN"> +  ${uiLabelMap.CommonStartDate} (yyyy-mm-dd)   <@htmlTemplate.renderDateTimeField name="reservStartStr" event="" action="" value="${startDate}" className="" alert="" title="Format: yyyy-MM-dd HH:mm:ss.SSS" size="15" maxlength="30" id="reservStartStr" dateType="date" shortDateInput=false timeDropdownParamName="" defaultDateTimeString="" localizedIconTitle="" timeDropdown="" timeHourName="" classString="" hour1="" hour2="" timeMinutesName="" minutes="" isTwelveHour="" ampmName="" amSelected="" pmSelected="" compositeType="" formName=""/>  Number of days  
    + Qty  + <#else> + + + + ${uiLabelMap.OrderAddToShoppingList} +
    +
    +<#else> +
    + ${uiLabelMap.OrderYouMust} ${uiLabelMap.CommonBeLogged} + ${uiLabelMap.OrderToAddSelectedItemsToShoppingList}.  + \ No newline at end of file diff --git a/template/product/ProductConfigurator.ftl b/template/product/ProductConfigurator.ftl new file mode 100644 index 0000000..2b00bd7 --- /dev/null +++ b/template/product/ProductConfigurator.ftl @@ -0,0 +1,175 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> +
    + + + + + + + + + + <#assign counter = 0> + <#assign questions = configwrapper.questions> + <#list questions as question> + + + + + + + <#assign counter = counter + 1> + +
    + +
    +
    ${question.question}
    + <#if question.isFirst()> + +
    ${StringUtil.wrapString(question.description!)}
    + <#assign instructions = question.content.get("INSTRUCTIONS", "html")!> + <#if instructions?has_content> + Instructions + + <#assign image = question.content.get("IMAGE_URL", "url")!> + <#if image?string?has_content> + + + <#else> + + +
    + <#if question.isStandard()> + <#-- Standard item: all the options are always included --> + <#assign options = question.options> + <#list options as option> +
    ${option.description} <#if !option.isAvailable()> (*)
    + + <#else> + <#if question.isSingleChoice()> + <#-- Single choice question --> + <#assign options = question.options> + <#assign selectedOption = question.getSelected()!> + <#assign selectedPrice = 0.0> + <#if selectedOption?has_content> + <#assign selectedPrice = selectedOption.getPrice()> + + <#-- The single choice input can be implemented with radio buttons or a select field --> + <#if renderSingleChoiceWithRadioButtons?? && "Y" == renderSingleChoiceWithRadioButtons> + <#-- This is the radio button implementation --> + <#if !question.isMandatory()> +
    No option
    + + <#assign optionCounter = 0> + <#list options as option> + <#assign componentCounter = 0> + <#if showOffsetPrice?? && "Y" == showOffsetPrice> + <#assign shownPrice = option.price - selectedPrice> + <#else> + <#assign shownPrice = option.price> + + <#-- Render virtual componennts --> + <#if option.hasVirtualComponent()> +
    + + ${option.description} <#if !option.isAvailable()> (*) + <#assign components = option.getComponents()> + <#list components as component> + <#if (option.isVirtualComponent(component))> + ${setRequestAttribute("inlineProductId", component.productId)} + ${setRequestAttribute("inlineCounter", counter+ "_" +optionCounter + "_"+componentCounter)} + ${setRequestAttribute("addJavaScript", componentCounter)} + ${screens.render(inlineProductDetailScreen)} + <#assign componentCounter = componentCounter + 1> + + +
    + <#else> +
    + checked="checked" /> + ${option.description}  + <#if (shownPrice > 0)>+<@ofbizCurrency amount=shownPrice isoCode=price.currencyUsed/>  + <#if (shownPrice < 0)>-<@ofbizCurrency amount=(-1*shownPrice) isoCode=price.currencyUsed/>  + <#if !option.isAvailable()>(*) +
    + + <#assign optionCounter = optionCounter + 1> + + <#else> + <#-- And this is the select box implementation --> + + + <#else> + <#-- Multi choice question --> + <#assign options = question.options> + <#assign optionCounter = 0> + <#list options as option> + <#assign componentCounter = 0> + <#-- Render virtual components --> + <#if option.hasVirtualComponent()> +
    + + ${option.description} <#if !option.isAvailable()> (*) + <#assign components = option.getComponents()> + <#list components as component> + <#if (option.isVirtualComponent(component))> + ${setRequestAttribute("inlineProductId", component.productId)} + ${setRequestAttribute("inlineCounter", counter+ "_" +optionCounter + "_"+componentCounter)} + ${setRequestAttribute("addJavaScript", componentCounter)} + ${screens.render(inlineProductDetailScreen)} + <#assign componentCounter = componentCounter + 1> + + +
    + <#else> +
    + checked="checked" /> + ${option.description} +<@ofbizCurrency amount=option.price isoCode=price.currencyUsed/><#if !option.isAvailable()> (*) +
    + + <#assign optionCounter = optionCounter + 1> + + + +
    +
    \ No newline at end of file diff --git a/template/product/ProductCrossSell.ftl b/template/product/ProductCrossSell.ftl new file mode 100644 index 0000000..393781c --- /dev/null +++ b/template/product/ProductCrossSell.ftl @@ -0,0 +1,94 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> +<#-- Upgrades/Up-Sell/Cross-Sell --> +<#macro associated assocProducts beforeName showName afterName formNamePrefix targetRequestName> + <#assign pageProduct = product /> + <#assign targetRequest = "product" /> + <#if targetRequestName?has_content> + <#assign targetRequest = targetRequestName /> + + <#if assocProducts?has_content> +
    +
    +

    ${beforeName!}<#if showName == "Y">${productContentWrapper.get("PRODUCT_NAME", "html")!}${afterName!}

    +
    +
    +
    + <#list assocProducts as productAssoc> + <#if productAssoc.productId == product.productId> + <#assign assocProductId = productAssoc.productIdTo /> + <#else> + <#assign assocProductId = productAssoc.productId /> + +
    + + ${assocProductId} +
    + <#if productAssoc.reason?has_content> - ${productAssoc.reason} +
    + ${setRequestAttribute("optProductId", assocProductId)} + ${setRequestAttribute("listIndex", listIndex)} + ${setRequestAttribute("formNamePrefix", formNamePrefix)} + <#if targetRequestName?has_content> + ${setRequestAttribute("targetRequestName", targetRequestName)} + + ${screens.render(productsummaryScreen)} + <#assign product = pageProduct /> + <#local listIndex = listIndex + 1 /> + +
    +
    +
    + + ${setRequestAttribute("optProductId", "")} + ${setRequestAttribute("formNamePrefix", "")} + ${setRequestAttribute("targetRequestName", "")} + + + +<#assign productValue = product /> +<#assign listIndex = 1 /> +${setRequestAttribute("productValue", productValue)} +
    + <#-- also bought --> + <@associated assocProducts=alsoBoughtProducts beforeName="" showName="N" afterName="${uiLabelMap.ProductAlsoBought}" formNamePrefix="albt" targetRequestName="" /> + <#-- obsolete --> + <@associated assocProducts=obsoleteProducts beforeName="" showName="Y" afterName=" ${uiLabelMap.ProductObsolete}" formNamePrefix="obs" targetRequestName="" /> + + <#-- cross sell --> + <@associated assocProducts=crossSellProducts beforeName="" showName="N" afterName="${uiLabelMap.ProductCrossSell}" formNamePrefix="cssl" targetRequestName="crosssell" /> + + <#-- up sell --> + <@associated assocProducts=upSellProducts beforeName="${uiLabelMap.ProductUpSell} " showName="Y" afterName=":" formNamePrefix="upsl" targetRequestName="upsell" /> + + <#-- obsolescence --> + <@associated assocProducts=obsolenscenseProducts beforeName="" showName="Y" afterName=" ${uiLabelMap.ProductObsolescense}" formNamePrefix="obce" targetRequestName="" /> +
    + +<#-- special cross/up-sell area using commonFeatureResultIds (from common feature product search) --> +<#if commonFeatureResultIds?has_content> +

    ${uiLabelMap.ProductSimilarProducts}

    +
    + <#list commonFeatureResultIds as commonFeatureResultId> + ${setRequestAttribute("optProductId", commonFeatureResultId)} + ${setRequestAttribute("listIndex", commonFeatureResultId_index)} + ${setRequestAttribute("formNamePrefix", "cfeatcssl")} + <#-- ${setRequestAttribute("targetRequestName", targetRequestName)} --> + ${screens.render(productsummaryScreen)} + +
    + \ No newline at end of file diff --git a/template/product/ProductDaysToShip.ftl b/template/product/ProductDaysToShip.ftl new file mode 100644 index 0000000..235b1f5 --- /dev/null +++ b/template/product/ProductDaysToShip.ftl @@ -0,0 +1,20 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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 daysToShip??> +
    ${uiLabelMap.ProductUsuallyShipsIn} ${daysToShip} ${uiLabelMap.CommonDays}!
    + diff --git a/template/product/ProductDetail.ftl b/template/product/ProductDetail.ftl new file mode 100644 index 0000000..ade2e52 --- /dev/null +++ b/template/product/ProductDetail.ftl @@ -0,0 +1,399 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> +<#-- variable setup --> +<#assign price = priceMap! /> +<#assign productImageList = productImageList! /> +<#-- end variable setup --> + +<#-- virtual product javascript --> +${virtualJavaScript!} +${virtualVariantJavaScript!} + + +<#macro showUnavailableVarients> + <#if unavailableVariants??> +
      + <#list unavailableVariants as prod> + <#assign features = prod.getRelated("ProductFeatureAppl", null, null, false)/> +
    • + <#list features as feature> + ${feature.getRelatedOne("ProductFeature", false).description}<#if feature_has_next>, + + ${uiLabelMap.ProductItemOutOfStock} +
    • + +
    + + + +
    +
    + <#-- Category next/previous --> + <#if category??> + + +
    +
    + +
    +
    +

    + <#if product.brandName??>${product.brandName} - ${productContentWrapper.get("PRODUCT_NAME", "html")!} +

    +
    +
    +
    +
    + <#include "ProductImage.ftl" /> +
    +
    + <#include "ProductMetaData.ftl" /> + <#include "ProductPrice.ftl" /> + <#include "ProductAddToOrder.ftl" /> + <#include "ProductPieces.ftl" /> + <#include "ProductSwatches.ftl"/> + <#include "ProductTellaFriend.ftl" /> + <#include "ProductAddToShopList.ftl" /> +
    +
    +
    +
    + +
    +
    + <#include "ProductLongDescription.ftl" /> + <#include "ProductDigitalDownload.ftl" /> +
    +
    + <#include "ProductDimensions.ftl" /> +
    +
    + <#include "ProductTags.ftl" /> +
    +
    + <#include "ProductReviews.ftl" /> +
    +
    +
    +
    +
    +
    + + + +
    +
    + <#include "ProductCrossSell.ftl" /> +
    +
    +
    \ No newline at end of file diff --git a/template/product/ProductDigitalDownload.ftl b/template/product/ProductDigitalDownload.ftl new file mode 100644 index 0000000..937f090 --- /dev/null +++ b/template/product/ProductDigitalDownload.ftl @@ -0,0 +1,25 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> +<#-- Digital Download Files Associated with this Product --> + <#if downloadProductContentAndInfoList?has_content> +
    +
    ${uiLabelMap.OrderDownloadFilesTitle}:
    + <#list downloadProductContentAndInfoList as downloadProductContentAndInfo> +
    ${downloadProductContentAndInfo.contentName!}<#if downloadProductContentAndInfo.description?has_content> - ${downloadProductContentAndInfo.description}
    + +
    + diff --git a/template/product/ProductDimensions.ftl b/template/product/ProductDimensions.ftl new file mode 100644 index 0000000..5db54e7 --- /dev/null +++ b/template/product/ProductDimensions.ftl @@ -0,0 +1,41 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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 (product.productWeight?? && product.productWeight != 0) || product.weightUomId?has_content> + <#assign weightUom = product.getRelatedOne("WeightUom", true)! /> +
    + ${uiLabelMap.CommonWeight}: ${product.productWeight!} ${((weightUom.abbreviation)?default(product.weightUomId))!} +
    + +<#if (product.productHeight?? && product.productHeight != 0) || product.heightUomId?has_content> + <#assign heightUom = product.getRelatedOne("HeightUom", true)! /> +
    + ${uiLabelMap.CommonHeight}: ${product.productHeight!} ${((heightUom.abbreviation)?default(product.heightUomId))!} +
    + +<#if (product.productWidth?? && product.productWidth != 0) || product.widthUomId?has_content> + <#assign widthUom = product.getRelatedOne("WidthUom", true)! /> +
    + ${uiLabelMap.CommonWidth}: ${product.productWidth!} ${((widthUom.abbreviation)?default(product.widthUomId))!} +
    + +<#if (product.productDepth?? && product.productDepth != 0) || product.depthUomId?has_content> + <#assign depthUom = product.getRelatedOne("DepthUom", true)! /> +
    + ${uiLabelMap.CommonDepth}: ${product.productDepth!} ${((depthUom.abbreviation)?default(product.depthUomId))!} +
    + diff --git a/template/product/ProductFeatureList.ftl b/template/product/ProductFeatureList.ftl new file mode 100644 index 0000000..b83400f --- /dev/null +++ b/template/product/ProductFeatureList.ftl @@ -0,0 +1,27 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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 disFeatureList?? && 0 < disFeatureList.size()> +

     

    + <#list disFeatureList as currentFeature> + <#assign disFeatureType = currentFeature.getRelatedOne("ProductFeatureType", true) /> +
    + <#if disFeatureType.description??>${disFeatureType.get("description", locale)}<#else>${currentFeature.productFeatureTypeId}: ${currentFeature.description} +
    + +
     
    + diff --git a/template/product/ProductImage.ftl b/template/product/ProductImage.ftl new file mode 100644 index 0000000..eddfa3c --- /dev/null +++ b/template/product/ProductImage.ftl @@ -0,0 +1,94 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> +<#assign productAdditionalImage1 = productContentWrapper.get("ADDITIONAL_IMAGE_1", "url")! /> +<#assign productAdditionalImage2 = productContentWrapper.get("ADDITIONAL_IMAGE_2", "url")! /> +<#assign productAdditionalImage3 = productContentWrapper.get("ADDITIONAL_IMAGE_3", "url")! /> +<#assign productAdditionalImage4 = productContentWrapper.get("ADDITIONAL_IMAGE_4", "url")! /> +
    + <#if productImageList?has_content> +
    + <#-- Product image/name/price --> + <#assign productLargeImageUrl = productContentWrapper.get("LARGE_IMAGE_URL", "url")! /> + <#-- remove the next two lines to always display the virtual image first (virtual images must exist) --> + <#if firstLargeImage?has_content> + <#assign productLargeImageUrl = firstLargeImage /> + + <#if productLargeImageUrl?string?has_content> + + + + <#if !productLargeImageUrl?string?has_content> + + + + + <#if productImageList?has_content> +
      + <#list productImageList as productImage> +
    • + + + +
    • + +
    + +
    +
    + <#-- Show Image Approved --> +
    + + <#else> +
    + <#-- Product image/name/price --> + <#assign productLargeImageUrl = productContentWrapper.get("LARGE_IMAGE_URL", "url")! /> + <#-- remove the next two lines to always display the virtual image first (virtual images must exist) --> + <#if firstLargeImage?has_content> + <#assign productLargeImageUrl = firstLargeImage /> + + <#if productLargeImageUrl?string?has_content> + + + + <#if !productLargeImageUrl?string?has_content> + + +
    +
    + <#if productAdditionalImage1?string?has_content> +
    + +
    + + <#if productAdditionalImage2?string?has_content> +
    + +
    + + <#if productAdditionalImage3?string?has_content> +
    + +
    + + <#if productAdditionalImage4?string?has_content> +
    + +
    + +
    + +
    \ No newline at end of file diff --git a/template/product/ProductLongDescription.ftl b/template/product/ProductLongDescription.ftl new file mode 100644 index 0000000..4fa5dc7 --- /dev/null +++ b/template/product/ProductLongDescription.ftl @@ -0,0 +1,21 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> +<#-- Long description of product --> +
    +
    ${productContentWrapper.get("LONG_DESCRIPTION", "html")!}
    +
    ${productContentWrapper.get("WARNINGS", "html")!}
    +
    \ No newline at end of file diff --git a/template/product/ProductMetaData.ftl b/template/product/ProductMetaData.ftl new file mode 100644 index 0000000..cd79cd6 --- /dev/null +++ b/template/product/ProductMetaData.ftl @@ -0,0 +1,36 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> +
    +
    ${productContentWrapper.get("DESCRIPTION", "html")!}
    +
    +
    ${uiLabelMap.CommonId}: ${product.productId!}
    +
    + +<#-- example of showing a certain type of feature with the product --> +<#if sizeProductFeatureAndAppls?has_content> +
    + <#if (sizeProductFeatureAndAppls?size == 1)> + ${uiLabelMap.OrderSizeAvailableSingle}: + <#else> + ${uiLabelMap.OrderSizeAvailableMultiple}: + + <#list sizeProductFeatureAndAppls as sizeProductFeatureAndAppl> + ${sizeProductFeatureAndAppl.description?default(sizeProductFeatureAndAppl.abbrev?default(sizeProductFeatureAndAppl.productFeatureId))}<#if sizeProductFeatureAndAppl_has_next>, + +
    + +
    \ No newline at end of file diff --git a/template/product/ProductPieces.ftl b/template/product/ProductPieces.ftl new file mode 100644 index 0000000..13a7577 --- /dev/null +++ b/template/product/ProductPieces.ftl @@ -0,0 +1,28 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> +<#-- Included quantities/pieces --> +<#if product.piecesIncluded?? && product.piecesIncluded?long != 0> +
    + ${uiLabelMap.OrderPieces}: ${product.piecesIncluded} +
    + +<#if (product.quantityIncluded?? && product.quantityIncluded != 0) || product.quantityUomId?has_content> + <#assign quantityUom = product.getRelatedOne("QuantityUom", true)! /> +
    + ${uiLabelMap.CommonQuantity}: ${product.quantityIncluded!} ${((quantityUom.abbreviation)?default(product.quantityUomId))!} +
    + \ No newline at end of file diff --git a/template/product/ProductPrice.ftl b/template/product/ProductPrice.ftl new file mode 100644 index 0000000..46ebd70 --- /dev/null +++ b/template/product/ProductPrice.ftl @@ -0,0 +1,95 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> +<#-- for prices: +- if price < competitivePrice, show competitive or "Compare At" price +- if price < listPrice, show list price +- if price < defaultPrice and defaultPrice < listPrice, show default +- if isSale show price with salePrice style and print "On Sale!" +--> + + +<#if price.competitivePrice?? && price.price?? && price.price < price.competitivePrice> +
    + ${uiLabelMap.ProductCompareAtPrice}: <@ofbizCurrency amount=price.competitivePrice isoCode=price.currencyUsed /> +
    + + +<#if price.listPrice?? && price.price?? && price.price < price.listPrice> +
    + ${uiLabelMap.ProductListPrice}: <@ofbizCurrency amount=price.listPrice isoCode=price.currencyUsed /> +
    + +<#if price.listPrice?? && price.defaultPrice?? && price.price?? && price.price < price.defaultPrice && price.defaultPrice < price.listPrice> +
    + ${uiLabelMap.ProductRegularPrice}: <@ofbizCurrency amount=price.defaultPrice isoCode=price.currencyUsed /> +
    + + +<#if price.specialPromoPrice??> +
    + ${uiLabelMap.ProductSpecialPromoPrice}: <@ofbizCurrency amount=price.specialPromoPrice isoCode=price.currencyUsed /> +
    + + +
    + + <#if price.isSale?? && price.isSale> +
    + ${uiLabelMap.OrderOnSale}! + <#assign priceStyle = "salePrice" /> + <#else> + <#assign priceStyle = "regularPrice" /> + +
    + ${uiLabelMap.OrderYourPrice}: + + <#if "Y" = product.isVirtual!> ${uiLabelMap.CommonFrom} + <@ofbizCurrency amount=price.price isoCode=price.currencyUsed /> + <#if product.productTypeId! == "ASSET_USAGE" || product.productTypeId! == "ASSET_USAGE_OUT_IN"> + <#if product.reserv2ndPPPerc?? && product.reserv2ndPPPerc != 0>
    + ${uiLabelMap.ProductReserv2ndPPPerc}<#if !product.reservNthPPPerc?? || product.reservNthPPPerc == 0>${uiLabelMap.CommonUntil} ${product.reservMaxPersons!1} <@ofbizCurrency amount=product.reserv2ndPPPerc*price.price/100 isoCode=price.currencyUsed /> + + <#if product.reservNthPPPerc?? &&product.reservNthPPPerc != 0>
    + ${uiLabelMap.ProductReservNthPPPerc} <#if !product.reserv2ndPPPerc?? || product.reserv2ndPPPerc == 0>${uiLabelMap.ProductReservSecond} <#else> ${uiLabelMap.ProductReservThird} ${uiLabelMap.CommonUntil} ${product.reservMaxPersons!1}, ${uiLabelMap.ProductEach}: <@ofbizCurrency amount=product.reservNthPPPerc*price.price/100 isoCode=price.currencyUsed /> + + <#if (!product.reserv2ndPPPerc?? || product.reserv2ndPPPerc == 0) && (!product.reservNthPPPerc?? || product.reservNthPPPerc == 0)> +
    ${uiLabelMap.ProductMaximum} ${product.reservMaxPersons!1} ${uiLabelMap.ProductPersons}. + + +
    +
    + + +<#if price.listPrice?? && price.price?? && price.price < price.listPrice> +
    + <#assign priceSaved = price.listPrice - price.price /> + <#assign percentSaved = (priceSaved / price.listPrice) * 100 /> +
    + ${uiLabelMap.OrderYouSave}: <@ofbizCurrency amount=priceSaved isoCode=price.currencyUsed /> (${percentSaved?int}%) +
    + + +<#-- show price details ("showPriceDetails" field can be set in the screen definition) --> +<#if (showPriceDetails?? && showPriceDetails?default("N") == "Y")> + <#if price.orderItemPriceInfos??> + <#list price.orderItemPriceInfos as orderItemPriceInfo> +
    + ${orderItemPriceInfo.description!} +
    + + + \ No newline at end of file diff --git a/template/product/ProductRelated.ftl b/template/product/ProductRelated.ftl new file mode 100644 index 0000000..83c0fee --- /dev/null +++ b/template/product/ProductRelated.ftl @@ -0,0 +1,16 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> \ No newline at end of file diff --git a/template/product/ProductReviews.ftl b/template/product/ProductReviews.ftl new file mode 100644 index 0000000..26d5603 --- /dev/null +++ b/template/product/ProductReviews.ftl @@ -0,0 +1,66 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> +<#-- Product Reviews --> +
    +
    ${uiLabelMap.OrderCustomerReviews}:
    + <#if averageRating?? && (averageRating > 0) && numRatings?? && (numRatings > 1)> +
    ${uiLabelMap.OrderAverageRating}: ${averageRating} <#if numRatings??>(${uiLabelMap.CommonFrom} ${numRatings} ${uiLabelMap.OrderRatings})
    + +
    + <#if productReviews?has_content> + <#list productReviews as productReview> + <#assign postedUserLogin = productReview.getRelatedOne("UserLogin", false) /> + <#assign postedPerson = postedUserLogin.getRelatedOne("Person", false)! /> +
    ${uiLabelMap.CommonBy}: <#if productReview.postedAnonymous?default("N") == "Y"> ${uiLabelMap.OrderAnonymous}<#else> ${postedPerson.firstName} ${postedPerson.lastName} 
    +
    ${uiLabelMap.CommonAt}: ${productReview.postedDateTime!} 
    +
    ${uiLabelMap.OrderRanking}: ${productReview.productRating!?string}
    +
     
    +
    ${productReview.productReview!}
    +
    + + + <#else> +
    ${uiLabelMap.ProductProductNotReviewedYet}.
    + + +
    + + \ No newline at end of file diff --git a/template/product/ProductSummary.ftl b/template/product/ProductSummary.ftl new file mode 100644 index 0000000..acd860b --- /dev/null +++ b/template/product/ProductSummary.ftl @@ -0,0 +1,229 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> + +${virtualJavaScript!} + + +<#if product??> + <#-- variable setup --> + <#if backendPath?default("N") == "Y"> + <#assign productUrl><@ofbizCatalogUrl productId=product.productId productCategoryId=categoryId/> + <#else> + <#assign productUrl><@ofbizCatalogAltUrl productId=product.productId productCategoryId=categoryId/> + + + <#if requestAttributes.productCategoryMember??> + <#assign prodCatMem = requestAttributes.productCategoryMember> + + <#assign smallImageUrl = productContentWrapper.get("MEDIUM_IMAGE_URL", "url")!> + <#if !smallImageUrl?string?has_content><#assign smallImageUrl = "/images/defaultImage.jpg"> + <#-- end variable setup --> + <#assign productInfoLinkId = "productInfoLink"> + <#assign productInfoLinkId = productInfoLinkId + product.productId/> + <#assign productDetailId = "productDetailId"/> + <#assign productDetailId = productDetailId + product.productId/> +
    +
    +
    +

    <#if product.brandName??>${product.brandName} - ${productContentWrapper.get("PRODUCT_NAME", "html")!}

    +
    +
    +
    +
    + Small Image +
    +
    +
    + +
    ${productContentWrapper.get("DESCRIPTION", "html")!}<#if daysToShip??> - ${uiLabelMap.ProductUsuallyShipsIn} ${daysToShip} ${uiLabelMap.CommonDays}!
    + + <#-- Display category-specific product comments --> + <#if prodCatMem?? && prodCatMem.comments?has_content> +
    ${prodCatMem.comments}
    + + + <#-- example of showing a certain type of feature with the product --> + <#if sizeProductFeatureAndAppls?has_content> +
    + <#if (sizeProductFeatureAndAppls?size == 1)> + ${uiLabelMap.SizeAvailableSingle}: + <#else> + ${uiLabelMap.SizeAvailableMultiple}: + + <#list sizeProductFeatureAndAppls as sizeProductFeatureAndAppl> + ${sizeProductFeatureAndAppl.abbrev?default(sizeProductFeatureAndAppl.description?default(sizeProductFeatureAndAppl.productFeatureId))}<#if sizeProductFeatureAndAppl_has_next>, + +
    + +
    + <#if totalPrice??> +
    ${uiLabelMap.ProductAggregatedPrice}: <@ofbizCurrency amount=totalPrice isoCode=totalPrice.currencyUsed/>
    + <#else> + <#if price.competitivePrice?? && price.price?? && price.price?double < price.competitivePrice?double> + ${uiLabelMap.ProductCompareAtPrice}: <@ofbizCurrency amount=price.competitivePrice isoCode=price.currencyUsed/> + + <#if price.listPrice?? && price.price?? && price.price?double < price.listPrice?double> + ${uiLabelMap.ProductListPrice}: <@ofbizCurrency amount=price.listPrice isoCode=price.currencyUsed/> + + + <#if price.isSale?? && price.isSale> + ${uiLabelMap.OrderOnSale}! + <#assign priceStyle = "salePrice"> + <#else> + <#assign priceStyle = "regularPrice"> + + + <#if (price.price?default(0) > 0 && product.requireAmount?default("N") == "N")> + ${uiLabelMap.OrderYourPrice}: <#if "Y" = product.isVirtual!> ${uiLabelMap.CommonFrom} <@ofbizCurrency amount=price.price isoCode=price.currencyUsed/> + + + <#if price.listPrice?? && price.price?? && price.price?double < price.listPrice?double> + <#assign priceSaved = price.listPrice?double - price.price?double> + <#assign percentSaved = (priceSaved?double / price.listPrice?double) * 100> + ${uiLabelMap.OrderYouSave}: <@ofbizCurrency amount=priceSaved isoCode=price.currencyUsed/> (${percentSaved?int}%) + + + <#-- show price details ("showPriceDetails" field can be set in the screen definition) --> + <#if (showPriceDetails?? && showPriceDetails?default("N") == "Y")> + <#if price.orderItemPriceInfos??> + <#list price.orderItemPriceInfos as orderItemPriceInfo> +
    ${orderItemPriceInfo.description!}
    + + + +
    + +
    + <#-- check to see if introductionDate hasn't passed yet --> + <#if product.introductionDate?? && nowTimestamp.before(product.introductionDate)> +
    ${uiLabelMap.ProductNotYetAvailable}
    + <#-- check to see if salesDiscontinuationDate has passed --> + <#elseif product.salesDiscontinuationDate?? && nowTimestamp.after(product.salesDiscontinuationDate)> +
    ${uiLabelMap.ProductNoLongerAvailable}
    + <#-- check to see if it is a rental item; will enter parameters on the detail screen--> + <#elseif product.productTypeId! == "ASSET_USAGE"> + ${uiLabelMap.OrderMakeBooking}... + <#-- check to see if it is an aggregated or configurable product; will enter parameters on the detail screen--> + <#elseif product.productTypeId! == "AGGREGATED" || product.productTypeId! == "AGGREGATED_SERVICE"> + ${uiLabelMap.OrderConfigure}... + <#-- check to see if the product is a virtual product --> + <#elseif product.isVirtual?? && product.isVirtual == "Y"> + ${uiLabelMap.OrderChooseVariations}... + <#-- check to see if the product requires an amount --> + <#elseif product.requireAmount?? && product.requireAmount == "Y"> + ${uiLabelMap.OrderChooseAmount}... + <#elseif product.productTypeId! == "ASSET_USAGE_OUT_IN"> + ${uiLabelMap.OrderRent}... + <#else> +
    + + + ${uiLabelMap.OrderAddToCart} + + + <#if mainProducts?has_content> + + +
    + + +
    + +
    + + <#if prodCatMem?? && prodCatMem.quantity?? && 0.00 < prodCatMem.quantity?double> +
    + + + + + ${uiLabelMap.CommonAddDefault}(${prodCatMem.quantity?string.number}) ${uiLabelMap.OrderToCart} +
    + <#assign productCategory = delegator.findOne("ProductCategory", Static["org.ofbiz.base.util.UtilMisc"].toMap("productCategoryId", prodCatMem.productCategoryId), false)/> + <#if productCategory.productCategoryTypeId != "BEST_SELL_CATEGORY"> +
    + + + + + ${uiLabelMap.CommonAddDefault}(${prodCatMem.quantity?string.number}) ${uiLabelMap.OrderToCart} +
    + + + +
    + + +
    +
    +
    + + + + +
    +
    +
    +<#else> + ${uiLabelMap.ProductErrorProductNotFound}.
    + diff --git a/template/product/ProductSwatches.ftl b/template/product/ProductSwatches.ftl new file mode 100644 index 0000000..630fe85 --- /dev/null +++ b/template/product/ProductSwatches.ftl @@ -0,0 +1,44 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> +<#-- Swatches (virtual products only) --> +<#if variantSample?? && 0 < variantSample.size()> + <#assign imageKeys = variantSample.keySet() /> + <#assign imageMap = variantSample /> +

     

    + <#assign maxIndex = 7 /> + <#assign indexer = 0 /> + <#list imageKeys as key> + <#assign swatchProduct = imageMap.get(key) /> + <#if swatchProduct?has_content && indexer < maxIndex> + <#assign imageUrl = Static["org.ofbiz.product.product.ProductContentWrapper"].getProductContentAsText(swatchProduct, "MEDIUM_IMAGE_URL", request, "url")! /> + <#if !imageUrl?string?has_content> + <#assign imageUrl = productContentWrapper.get("MEDIUM_IMAGE_URL", "url")! /> + + <#if !imageUrl?string?has_content> + <#assign imageUrl = "/images/defaultImage.jpg" /> + + ${key} + +
    + + <#assign indexer = indexer + 1 /> + + <#if (indexer > maxIndex)> +
    ${uiLabelMap.ProductMoreOptions}
    + + + diff --git a/template/product/ProductTags.ftl b/template/product/ProductTags.ftl new file mode 100644 index 0000000..ef5d9f5 --- /dev/null +++ b/template/product/ProductTags.ftl @@ -0,0 +1,55 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> +
    +

    ${uiLabelMap.EcommerceProductTags}

    + <#if productTags??> +

    ${uiLabelMap.EcommerceProductTagsDetail}:

    +

    +

      +
    • + <#assign no = 0 /> + <#list productTags?keys?sort as productTag> + <#assign tagValue = productTags.get(productTag)!/> + <#if tagValue?has_content> + ${productTag} (${tagValue}) <#if no < (productTags.size() - 1)> | + <#assign no = no + 1 /> + + +
    • +
    +

    + + +

    ${uiLabelMap.EcommerceAddYourTags}:

    +

    +

    + + + +
    + ${uiLabelMap.EcommerceAddTagsDetail} +

    +
    +
    + + + + + + +
    +
    \ No newline at end of file diff --git a/template/product/ProductTellaFriend.ftl b/template/product/ProductTellaFriend.ftl new file mode 100644 index 0000000..7e8b02a --- /dev/null +++ b/template/product/ProductTellaFriend.ftl @@ -0,0 +1,21 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> +<#-- show tell a friend details only in ecommerce application --> +
     
    + diff --git a/template/quote/CreateOrderQuote.ftl b/template/quote/CreateOrderQuote.ftl new file mode 100644 index 0000000..69c34a5 --- /dev/null +++ b/template/quote/CreateOrderQuote.ftl @@ -0,0 +1,27 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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 quote??> + <#if quote.statusId == "QUO_APPROVED"> + ${uiLabelMap.OrderCreateOrder} + <#else/> + ${uiLabelMap.OrderCreateOrder} + + +
    +
    diff --git a/template/quote/QuoteList.ftl b/template/quote/QuoteList.ftl new file mode 100644 index 0000000..d96f86f --- /dev/null +++ b/template/quote/QuoteList.ftl @@ -0,0 +1,84 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> + +
    +

    ${uiLabelMap.EcommerceQuoteHistory}

    +
    + + + + + + + + + + + + + + + <#list quoteList as quote> + <#assign status = quote.getRelatedOne("StatusItem", true)> + + + + + + + + + + + + + + + + + <#if !quoteList?has_content> + + +
    +
    ${uiLabelMap.OrderQuote} ${uiLabelMap.CommonNbr}
    +
      +
    ${uiLabelMap.CommonName}
    +
      +
    ${uiLabelMap.CommonDescription}
    +
      +
    ${uiLabelMap.CommonStatus}
    +
      +
    ${uiLabelMap.OrderOrderQuoteIssueDate}
    +
    ${uiLabelMap.CommonValidFromDate}
    +
    ${uiLabelMap.CommonValidThruDate}
    +
      
    +
    ${quote.quoteId}
    +
      +
    ${quote.quoteName!}
    +
      +
    ${quote.description!}
    +
      +
    ${status.get("description",locale)}
    +
      +
    ${quote.issueDate!}
    +
    ${quote.validFromDate!}
    +
    ${quote.validThruDate!}
    +
      + ${uiLabelMap.CommonView} +  

    ${uiLabelMap.OrderNoQuoteFound}

    +
    +
    diff --git a/template/request/RequestList.ftl b/template/request/RequestList.ftl new file mode 100644 index 0000000..c4ad085 --- /dev/null +++ b/template/request/RequestList.ftl @@ -0,0 +1,93 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> + +
    +

    ${uiLabelMap.EcommerceRequestHistory}

    +
    + + + + + + + + + + + + + + + + + <#list requestList as custRequest> + <#assign status = custRequest.getRelatedOne("StatusItem", true)> + <#assign type = custRequest.getRelatedOne("CustRequestType", true)> + + + + + + + + + + + + + + + + + + + <#if !requestList?has_content> + + +
    +
    ${uiLabelMap.OrderRequest} ${uiLabelMap.CommonNbr}
    +
      +
    ${uiLabelMap.CommonType}
    +
      +
    ${uiLabelMap.CommonName}
    +
      +
    ${uiLabelMap.CommonDescription}
    +
      +
    ${uiLabelMap.CommonStatus}
    +
      +
    ${uiLabelMap.OrderRequestDate}
    +
    ${uiLabelMap.OrderRequestCreatedDate}
    +
    ${uiLabelMap.OrderRequestLastModifiedDate}
    +
      
    +
    ${custRequest.custRequestId}
    +
      +
    ${type.get("description",locale)!}
    +
      +
    ${custRequest.custRequestName!}
    +
      +
    ${custRequest.description!}
    +
      +
    ${status.get("description",locale)}
    +
      +
    ${custRequest.custRequestDate!}
    +
    ${custRequest.createdDate!}
    +
    ${custRequest.lastModifiedDate!}
    +
      + ${uiLabelMap.CommonView} +  

    ${uiLabelMap.OrderNoRequestFound}

    +
    +
    diff --git a/template/request/requestInfo.ftl b/template/request/requestInfo.ftl new file mode 100644 index 0000000..7b8096c --- /dev/null +++ b/template/request/requestInfo.ftl @@ -0,0 +1,123 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> +
    +
    +
    ${uiLabelMap.OrderRequest} ${custRequest.custRequestId} ${uiLabelMap.CommonInformation}
    +
    +
    + + <#-- request header information --> + + + + + + + <#-- request status information --> + + + + + + <#-- party --> + + + + + + + <#-- request name --> + + + + + + + <#-- request description --> + + + + + + + <#-- request currency --> + + + + + + + <#-- request currency --> + + + + + + + <#-- request comment --> + + + + + + + <#-- request reason --> + + + + + + +
    +  ${uiLabelMap.CommonType} +   + ${(custRequestType.get("description",locale))?default(custRequest.custRequestTypeId!)} +

    +  ${uiLabelMap.CommonStatus} +   + ${(statusItem.get("description", locale))?default(custRequest.statusId!)} +

    +  ${uiLabelMap.PartyPartyId} +   + ${custRequest.fromPartyId!} +

    +  ${uiLabelMap.CommonName} +   + ${custRequest.custRequestName!} +

    +  ${uiLabelMap.CommonDescription} +   + ${custRequest.description!} +

    +  ${uiLabelMap.CommonCurrency} +   + <#if currency??>${currency.get("description", locale)?default(custRequest.maximumAmountUomId!)} +

    +  ${uiLabelMap.ProductProductStore} +   + <#if store??>${store.storeName?default(custRequest.productStoreId!)} +

    +  ${uiLabelMap.CommonInternalComment} +   + ${custRequest.internalComment!} +

    +  ${uiLabelMap.CommonReason} +   + ${custRequest.reason!} +
    +
    +
    \ No newline at end of file diff --git a/template/request/requestRoles.ftl b/template/request/requestRoles.ftl new file mode 100644 index 0000000..9f1ba28 --- /dev/null +++ b/template/request/requestRoles.ftl @@ -0,0 +1,43 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> +
    +
    +
    ${uiLabelMap.OrderRequestRoles}
    +
    +
    + + <#assign row = 1> + <#list requestParties as requestParty> + <#assign roleType = requestParty.getRelatedOne("RoleType", false)> + <#assign party = requestParty.getRelatedOne("Party", false)> + + + + + + <#if requestParties.size() != row> + + + <#assign row = row + 1> + +
    +  ${roleType.get("description", locale)!} +   + ${Static["org.ofbiz.party.party.PartyHelper"].getPartyName(party)} +

    +
    +
    \ No newline at end of file diff --git a/template/requirePasswordChange.ftl b/template/requirePasswordChange.ftl new file mode 100644 index 0000000..b518b7b --- /dev/null +++ b/template/requirePasswordChange.ftl @@ -0,0 +1,66 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> + +<#assign username = ""/> +<#if requestParameters.USERNAME?has_content> + <#assign username = requestParameters.USERNAME/> +<#elseif autoUserLogin?has_content> + <#assign username = autoUserLogin.userLoginId/> + + +

    ${uiLabelMap.CommonLogin}

    +
    + +
    +
    +
    ${uiLabelMap.CommonPasswordChange}
    +
    +
    +
    + + +
    + ${uiLabelMap.CommonUsername}: ${username} +
    + <#if autoUserLogin?has_content> +
    + (${uiLabelMap.CommonNot} ${autoUserLogin.userLoginId}? ${uiLabelMap.CommonClickHere}) +
    + +
    + ${uiLabelMap.CommonPassword}:  + +
    +
    + ${uiLabelMap.CommonNewPassword}:  + +
    +
    + ${uiLabelMap.CommonNewPasswordVerify}:  + +
    +
    + +
    +
    +
    +
    + + diff --git a/template/shoppinglist/editShoppingList.ftl b/template/shoppinglist/editShoppingList.ftl new file mode 100644 index 0000000..f3343ee --- /dev/null +++ b/template/shoppinglist/editShoppingList.ftl @@ -0,0 +1,573 @@ +<#-- +(C) Copyright 2015 Somonar B.V. + + 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. + + --> + + +<#macro paginationControls> + <#assign viewIndexMax = Static["java.lang.Math"].ceil((listSize)?double / viewSize?double)> + <#if (viewIndexMax?int > 0)> +
    + <#-- Start Page Select Drop-Down --> + + <#-- End Page Select Drop-Down --> + + <#if (viewIndex?int > 1)> + ${uiLabelMap.CommonPrevious} | + + <#if ((listSize?int - viewSize?int) > 0)> + ${lowIndex} - ${highIndex} ${uiLabelMap.CommonOf} ${listSize} + + <#if highIndex?int < listSize?int> + | ${uiLabelMap.CommonNext} + +
    + + + +
    + +

    ${uiLabelMap.EcommerceShoppingLists}

    +
    + <#if shoppingLists?has_content> +
    +
    + + ${uiLabelMap.CommonEdit} +
    +
    + <#else> + + ${uiLabelMap.CommonCreateNew} + +
    +
    + +<#if shoppingList?has_content> + <#if canView> + +
    +
    + +

    ${uiLabelMap.EcommerceShoppingListDetail} - ${shoppingList.listName}

    +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    + + +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + + <#if parentShoppingList??> + ${uiLabelMap.CommonGotoParent} (${parentShoppingList.listName?default(parentShoppingList.shoppingListId)}) + +
    +
    + +
    +
    +
    +
    +
    + +<#if shoppingListType?? && shoppingListType.shoppingListTypeId == "SLT_AUTO_REODR"> + <#assign nowTimestamp = Static["org.ofbiz.base.util.UtilDateTime"].monthBegin()> +
    +
    + +

    + ${uiLabelMap.EcommerceShoppingListReorder} - ${shoppingList.listName} + <#if shoppingList.isActive?default("N") == "N"> + ${uiLabelMap.EcommerceOrderNotActive} + +

    +
    +
    +
    +
    + +
    + + + <#if recurrenceInfo?has_content> + <#assign recurrenceRule = recurrenceInfo.getRelatedOne("RecurrenceRule", false)!> + + + + + + + + Calendar + + + + + Calendar + +
    +
    + + + + + + + + + +
    + + <#if shoppingList.isActive?default("N") == "Y"> +
    + <#assign nextTime = recInfo.next(lastSlOrderTime)?if_exists /> + <#if nextTime?has_content> + <#assign nextTimeStamp = Static["org.ofbiz.base.util.UtilDateTime"].getTimestamp(nextTime)?if_exists /> + <#if nextTimeStamp?has_content> + <#assign nextTimeString = Static["org.ofbiz.base.util.UtilFormatOut"].formatDate(nextTimeStamp)?if_exists /> + + + <#if lastSlOrderDate?has_content> + <#assign lastOrderedString = Static["org.ofbiz.base.util.UtilFormatOut"].formatDate(lastSlOrderDate)!> + +
    + + + + + + + + + + + +
    ${uiLabelMap.OrderLastOrderedDate}:${lastOrderedString?default("${uiLabelMap.OrderNotYetOrdered}")}
    ${uiLabelMap.EcommerceEstimateNextOrderDate}:${nextTimeString?default("${uiLabelMap.EcommerceNotYetKnown}")}
    +
    + + + + + +
    +
    + + +<#if childShoppingListDatas?has_content> +
    +
    + +

     ${uiLabelMap.EcommerceChildShoppingList} - ${shoppingList.listName}

    +
    +
    + + + + + + + + + + + <#list childShoppingListDatas as childShoppingListData> + <#assign childShoppingList = childShoppingListData.childShoppingList/> + <#assign totalPrice = childShoppingListData.totalPrice/> + + + + + + + + + + + + + +
    ${uiLabelMap.EcommerceListName}${uiLabelMap.EcommerceListName}  
    + ${childShoppingList.listName?default(childShoppingList.shoppingListId)} + + <@ofbizCurrency amount=totalPrice isoCode=currencyUomId/> + + ${uiLabelMap.EcommerceGoToList} + ${uiLabelMap.EcommerceAddListToCart} +

      + <@ofbizCurrency amount=shoppingListChildTotal isoCode=currencyUomId/> +  
    +
    +
    + + +
    +
    + +

    ${uiLabelMap.EcommerceListItems} - ${shoppingList.listName}

    +
    +
    + <#if shoppingListItemDatas?has_content> + <#-- Pagination --> + <@paginationControls/> + + + + + + <#-- --> + + + + + + + <#list shoppingListItemDatas[lowIndex-1..highIndex-1] as shoppingListItemData> + <#assign shoppingListItem = shoppingListItemData.shoppingListItem/> + <#assign product = shoppingListItemData.product/> + <#assign productContentWrapper = Static["org.ofbiz.product.product.ProductContentWrapper"].makeProductContentWrapper(product, request)/> + <#assign unitPrice = shoppingListItemData.unitPrice/> + <#assign totalPrice = shoppingListItemData.totalPrice/> + <#assign productVariantAssocs = shoppingListItemData.productVariantAssocs!/> + <#assign isVirtual = product.isVirtual?? && product.isVirtual.equals("Y")/> + + +
    ${uiLabelMap.OrderProduct}
    - ${uiLabelMap.EcommerceStartdate} -- ${uiLabelMap.EcommerceNbrOfDays} -
    - ${uiLabelMap.EcommerceNbrOfPersons} -- ${uiLabelMap.CommonQuantity} -
    Purchased
    ${uiLabelMap.EcommercePrice}${uiLabelMap.OrderTotal} 
    + ${shoppingListItem.productId} - + ${productContentWrapper.get("PRODUCT_NAME", "html")?default("No Name")} : ${productContentWrapper.get("DESCRIPTION", "html")!} + +
    +
    + + + + <#if product.productTypeId == "ASSET_USAGE"> + + + + + + + + + + + <#-- + + --> + + + + + + + + + + <#----> + + + + + +
      + + + +
      + + + <#else> + + + + + + + +
    ----
    -- + + +
    + + +
    +
    ${shoppingListItem.quantityPurchased?default(0)?string.number}
    +
    + <@ofbizCurrency amount=unitPrice isoCode=currencyUomId/> + + <@ofbizCurrency amount=totalPrice isoCode=currencyUomId/> + + ${uiLabelMap.CommonUpdate} + ${uiLabelMap.CommonRemove} + <#if isVirtual && productVariantAssocs?has_content> + <#assign replaceItemAction = "/replaceShoppingListItem/" + requestAttributes._CURRENT_VIEW_?if_exists /> + <#assign addToCartAction = "/additem/" + requestAttributes._CURRENT_VIEW_?if_exists /> +
    +
    + + + + + + +
    +
    + <#else> + ${uiLabelMap.CommonAdd} ${shoppingListItem.quantity?string} ${uiLabelMap.OrderToCart} + +

      
     
      + <@ofbizCurrency amount=shoppingListItemTotal isoCode=currencyUomId/> +  
    + <#else> +

    ${uiLabelMap.EcommerceShoppingListEmpty}.

    + + + + +
    +

    ${uiLabelMap.EcommerceShoppingListPriceTotals} - ${shoppingList.listName}

    +
    +
    + + <@ofbizCurrency amount=shoppingListChildTotal isoCode=currencyUomId/> +
    +
    + + <@ofbizCurrency amount=shoppingListItemTotal isoCode=currencyUomId/> +
    +
    + + <@ofbizCurrency amount=shoppingListTotalPrice isoCode=currencyUomId/> +
    +
    +
    + +
    +

    ${uiLabelMap.CommonQuickAddList}

    +
    +
    +
    + + <#if reservStart?exists> + + +
    +
    +
    +
    + + <#else> + <#-- shoppingList was found, but belongs to a different party --> +

    ${uiLabelMap.EcommerceShoppingListError} ${uiLabelMap.CommonId} ${shoppingList.shoppingListId}) ${uiLabelMap.EcommerceListDoesNotBelong}.

    + + diff --git a/template/survey/genericresult.ftl b/template/survey/genericresult.ftl new file mode 100644 index 0000000..f546238 --- /dev/null +++ b/template/survey/genericresult.ftl @@ -0,0 +1,126 @@ +<#-- +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. +--> + +<#assign uiLabelMap = Static["org.ofbiz.base.util.UtilProperties"].getResourceBundleMap("CommonUiLabels", locale)> + +

    ${survey.description!}

    +
    + + + <#list surveyQuestionAndAppls as surveyQuestionAndAppl> + + <#-- special formatting for select boxes --> + <#assign align = "left"> + <#if (surveyQuestionAndAppl.surveyQuestionTypeId == "BOOLEAN" || surveyQuestionAndAppl.surveyQuestionTypeId == "OPTION")> + <#assign align = "right"> + + + <#-- get an answer from the answerMap --> + <#if surveyAnswers?has_content> + <#assign answer = surveyAnswers.get(surveyQuestionAndAppl.surveyQuestionId)!> + + + <#-- get the question results --> + <#if surveyResults?has_content> + <#assign results = surveyResults.get(surveyQuestionAndAppl.surveyQuestionId)!> + + + + + <#-- seperator options --> + <#if surveyQuestionAndAppl.surveyQuestionTypeId == "SEPERATOR_TEXT"> + + <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "SEPERATOR_LINE"> + + <#else> + + <#-- standard question options --> + + + + + + + + +
    ${surveyQuestionAndAppl.question!}

    + <#assign answerString = "answers"> + <#if (results._total?default(0) == 1)> + <#assign answerString = "answer"> + +
    ${surveyQuestionAndAppl.question!} (${results._total?default(0)?string.number} ${answerString})
    + <#if surveyQuestionAndAppl.hint?has_content> +
    ${surveyQuestionAndAppl.hint}
    + +
      + <#if surveyQuestionAndAppl.surveyQuestionTypeId == "BOOLEAN"> + <#assign selectedOption = (answer.booleanResponse)?default("Y")> +
    + <#if "Y" == selectedOption>==> ${uiLabelMap.CommonY}<#if "Y" == selectedOption> [${results._yes_total?default(0)?string("#")} / ${results._yes_percent?default(0)?string("#")}%] +
    +
    + <#if "N" == selectedOption>==> N<#if "N" == selectedOption> [${results._no_total?default(0)?string("#")} / ${results._no_percent?default(0)?string("#")}%] +
    + <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "TEXTAREA"> +
    ${(answer.textResponse)!}
    + <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "TEXT_SHORT"> +
    ${(answer.textResponse)!}
    + <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "TEXT_LONG"> +
    ${(answer.textResponse)!}
    + <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "EMAIL"> +
    ${(answer.textResponse)!}
    + <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "URL"> +
    ${(answer.textResponse)!}
    + <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "DATE"> +
    ${(answer.textResponse)!}
    + <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "CREDIT_CARD"> +
    ${(answer.textResponse)!}
    + <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "GIFT_CARD"> +
    ${(answer.textResponse)!}
    + <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "NUMBER_CURRENCY"> +
    ${answer.currencyResponse?number?default(0)}
    + <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "NUMBER_FLOAT"> +
    ${answer.floatResponse?number?default(0)?string("#")}
    + <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "NUMBER_LONG"> +
    ${answer.numericResponse?number?default(0)?string("#")} [${uiLabelMap.CommonTally}: ${results._tally?default(0)?string("#")} / ${uiLabelMap.CommonAverage}: ${results._average?default(0)?string("#")}]
    + <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "PASSWORD"> +
    [${uiLabelMap.CommonNotShown}]
    + <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "CONTENT"> + <#if answer.contentId?has_content> + <#assign content = answer.getRelatedOne("Content", false)> + ${answer.contentId} - ${content.contentName!} + + <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "OPTION"> + <#assign options = surveyQuestionAndAppl.getRelated("SurveyQuestionOption", null, sequenceSort, false)!> + <#assign selectedOption = (answer.surveyOptionSeqId)?default("_NA_")> + <#if options?has_content> + <#list options as option> + <#assign optionResults = results.get(option.surveyOptionSeqId)!> +
    + <#if option.surveyOptionSeqId == selectedOption>==>  + ${option.description!} + <#if option.surveyOptionSeqId == selectedOption> +  [${optionResults._total?default(0)?string("#")} / ${optionResults._percent?default(0?string("#"))}%] +
    + + + <#else> +
    ${uiLabelMap.EcommerceUnsupportedQuestionType}: ${surveyQuestionAndAppl.surveyQuestionTypeId}
    + +
     
    diff --git a/template/survey/miniresult.ftl b/template/survey/miniresult.ftl new file mode 100644 index 0000000..0e6ff77 --- /dev/null +++ b/template/survey/miniresult.ftl @@ -0,0 +1,79 @@ +<#-- +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. +--> + + + <#list surveyQuestionAndAppls as surveyQuestionAndAppl> + + <#-- get an answer from the answerMap --> + <#if surveyAnswers?has_content> + <#assign answer = surveyAnswers.get(surveyQuestionAndAppl.surveyQuestionId)!> + + + <#-- get the question results --> + <#if surveyResults?has_content> + <#assign results = surveyResults.get(surveyQuestionAndAppl.surveyQuestionId)!> + + + + <#-- standard question options --> + + + + + + + + + + + +
    + <#assign answerString = "answers"> + <#if (results._total?default(0) == 1)> + <#assign answerString = "answer"> + +
    ${surveyQuestionAndAppl.question!} (${results._total?default(0)?string.number} ${answerString})
    +

    + <#if surveyQuestionAndAppl.surveyQuestionTypeId == "BOOLEAN"> + <#assign selectedOption = (answer.booleanResponse)?default("Y")> +
    + <#if "Y" == selectedOption>==> ${uiLabelMap.CommonY}<#if "Y" == selectedOption> [${results._yes_total?default(0)?string("#")} / ${results._yes_percent?default(0)?string("#")}%] +
    +
    + <#if "N" == selectedOption>==> ${uiLabelMap.CommonN}<#if "N" == selectedOption> [${results._no_total?default(0)?string("#")} / ${results._no_percent?default(0)?string("#")}%] +
    + + <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "OPTION"> + <#assign options = surveyQuestionAndAppl.getRelated("SurveyQuestionOption", null, sequenceSort, false)!> + <#assign selectedOption = (answer.surveyOptionSeqId)?default("_NA_")> + <#if options?has_content> + <#list options as option> + <#assign optionResults = results.get(option.surveyOptionSeqId)!> +
    + <#if option.surveyOptionSeqId == selectedOption>==>  + ${option.description!} + <#if option.surveyOptionSeqId == selectedOption> +  [${optionResults._total?default(0)?string("#")} / ${optionResults._percent?default(0?string("#"))}%] +
    + + + <#else> +
    ${uiLabelMap.EcommerceUnsupportedQuestionType}${surveyQuestionAndAppl.surveyQuestionTypeId}
    + +
    diff --git a/template/survey/minisurvey.ftl b/template/survey/minisurvey.ftl new file mode 100644 index 0000000..89402ea --- /dev/null +++ b/template/survey/minisurvey.ftl @@ -0,0 +1,121 @@ +<#-- +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. +--> + +<#if additionalFields?has_content> + <#list additionalFields.keySet() as field> + + + + +<#-- update response --> +<#if surveyResponseId?has_content> + + + +<#-- party ID --> +<#if partyId?has_content> + + + +<#-- survey ID --> + + + + <#list surveyQuestionAndAppls as surveyQuestionAndAppl> + <#-- get an answer from the answerMap --> + <#if surveyAnswers?has_content> + <#assign answer = surveyAnswers.get(surveyQuestionAndAppl.surveyQuestionId)!> + + + + <#-- standard question options --> + + + + + + + + + + + +
    +
    ${surveyQuestionAndAppl.question!}
    + <#if surveyQuestionAndAppl.hint?has_content> +
    ${surveyQuestionAndAppl.hint}
    + +
    + <#if surveyQuestionAndAppl.surveyQuestionTypeId == "BOOLEAN"> + <#assign selectedOption = (answer.booleanResponse)?default("Y")> + + <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "TEXTAREA"> + + <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "TEXT_SHORT"> + + <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "TEXT_LONG"> + + <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "EMAIL"> + + <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "URL"> + + <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "DATE"> + + <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "CREDIT_CARD"> + + <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "GIFT_CARD"> + + <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "NUMBER_CURRENCY"> + + <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "NUMBER_FLOAT"> + + <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "NUMBER_LONG"> + + <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "PASSWORD"> + + <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "OPTION"> + <#assign options = surveyQuestionAndAppl.getRelated("SurveyQuestionOption", null, sequenceSort, false)!> + <#assign selectedOption = (answer.surveyOptionSeqId)?default("_NA_")> + + <#else> +
    Unsupported question type : ${surveyQuestionAndAppl.surveyQuestionTypeId}
    + + <#if surveyQuestionAndAppl.requiredField?default("N") == "Y"> + * + <#else> + [optional] + +
    diff --git a/testdef/oshopTests.xml b/testdef/oshopTests.xml new file mode 100644 index 0000000..dab61a2 --- /dev/null +++ b/testdef/oshopTests.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/webapp/ecommerce/WEB-INF/controller.xml b/webapp/ecommerce/WEB-INF/controller.xml new file mode 100644 index 0000000..a8b6125 --- /dev/null +++ b/webapp/ecommerce/WEB-INF/controller.xml @@ -0,0 +1,2169 @@ + + + + + OFBiz: eCommerce Controller Configuration File + /error/error.jsp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Verify a user is logged in. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Handles setting the currency, agreement and shipment dates of an order. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Handles callbacks from PayPal's Express Checkout Instant Update API + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/webapp/ecommerce/WEB-INF/web.xml b/webapp/ecommerce/WEB-INF/web.xml new file mode 100644 index 0000000..f4c3b35 --- /dev/null +++ b/webapp/ecommerce/WEB-INF/web.xml @@ -0,0 +1,165 @@ + + + + + + + Apache OFBiz - demostore + Demo Store for the Apache OFBiz Project + + + A unique ID used to look up the WebSite entity + webSiteId + WebStore + + + A unique name used to identify/recognize the local dispatcher for the Service Engine + localDispatcherName + ecommerce + + + The Name of the Entity Delegator to use, defined in entityengine.xml + entityDelegatorName + default + + + The location of the main-decorator screen to use for this webapp; referred to as a context variable in screen def XML files. + mainDecoratorLocation + component://ecommerce/widget/CommonScreens.xml + + + + Forces the JSESSIONID cookie to be sent via http rather https, helps prevent lost sessions in web apps that + frequently switch between http and https. + + forceHttpSession + true + + + + CatalogUrlFilter + CatalogUrlFilter + org.ofbiz.product.category.CatalogUrlFilter + defaultLocaleStringen_US + + + ContentUrlFilter + ContentUrlFilter + org.ofbiz.content.content.ContentUrlFilter + + defaultLocaleString + en_US + + viewRequestViewBlogArticle + + + ContextFilter + ContextFilter + org.ofbiz.webapp.control.ContextFilter + + disableContextSecurity + N + + + allowedPaths + /error:/control:/products:/select:/index.html:/index.jsp:/robots.txt:/default.html:/default.jsp:/images + + + + CatalogUrlFilter + /* + + + ContentUrlFilter + /* + + + ContextFilter + /* + + + org.ofbiz.webapp.control.ControlEventListener + + + + + org.ofbiz.order.shoppingcart.CartEventListener + + org.ofbiz.webapp.control.LoginEventListener + + + ControlServlet + ControlServlet + Main Control Servlet + org.ofbiz.webapp.control.ControlServlet + 1 + + + + Catalog (Category/Product) URL Servlet + CatalogUrlServlet + CatalogUrlServlet + org.ofbiz.product.category.CatalogUrlServlet + 1 + + + + ControlServlet + /control/* + + + + CatalogUrlServlet + /products/* + + + + 60 + + true + true + + COOKIE + + + + index.jsp + index.html + index.htm + + + + 404 + /error/404.jsp + + diff --git a/webapp/ecommerce/index.jsp b/webapp/ecommerce/index.jsp new file mode 100644 index 0000000..b8ade91 --- /dev/null +++ b/webapp/ecommerce/index.jsp @@ -0,0 +1,20 @@ +<%-- +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. +--%> + +<%pageContext.forward("control/main");%> diff --git a/webapp/ecommerce/makebogodata.jsp b/webapp/ecommerce/makebogodata.jsp new file mode 100644 index 0000000..a071b1b --- /dev/null +++ b/webapp/ecommerce/makebogodata.jsp @@ -0,0 +1,69 @@ +<%-- +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. +--%> + +<%@ page import="org.ofbiz.product.catalog.*" %> +<%@ page import="org.ofbiz.product.product.*" %> +<%@ page import="org.ofbiz.entity.*" %> +<%@ page import="org.ofbiz.base.util.*" %> +<%@ page import="java.util.*" %> +<%@ page import="java.math.BigDecimal" %> + + + +<% + List products = delegator.findList("Product", null, null, null, null, false); + for (GenericValue product : products) { + KeywordIndex.indexKeywords(product); + } + + if(request.getParameter("makeall") == null) { +%>Just added the keywords from all existing product info. +
    Create a LOT of products, categories, and keywords. +<% + } + else { + String[] wordBag = {"a", "product", "big", "ugly", "pretty", "small", "under", "over", "one", "two", "three", "four", "five", "six", "seven", "eight", "tree"}; + String[] longWordBag = {"b", "item", "little", "cute", "frightening", "massive", "top", "btoom", "bush", "shrub", "gadget"}; + + for(int cat=1; cat<=400; cat++) + { + String parentId = cat<=20?"CATALOG1":"" + (cat/20); + delegator.create("ProductCategory", UtilMisc.toMap("productCategoryId", "" + cat, "primaryParentCategoryId", parentId, "description", "Category " + cat)); + delegator.create("ProductCategoryRollup", UtilMisc.toMap("productCategoryId", "" + cat, "parentProductCategoryId", parentId)); + for(int prod=1; prod<=50; prod++) + { + String desc = "Cool Description"; + for(int i=0; i<10; i++) { + int wordNum = (int)(Math.random()*(wordBag.length-1)); + desc += (" " + wordBag[wordNum]); + } + String longDesc = "Cool LONG Description"; + for(int i=0; i<50; i++) { + int wordNum = (int)(Math.random()*(longWordBag.length-1)); + longDesc += (" " + longWordBag[wordNum]); + } + BigDecimal price = new BigDecimal("2.99").add(BigDecimal.valueOf(prod)); + GenericValue product = delegator.create("Product", UtilMisc.toMap("productId", "" + (cat*100 + prod), "primaryProductCategoryId", "" + (cat), "productName", "Product " + "" + (cat*100 + prod), "description", desc, "longDescription", longDesc, "defaultPrice", price)); + KeywordIndex.indexKeywords(product); + delegator.create("ProductCategoryMember", UtilMisc.toMap("productId", "" + (cat*100 + prod), "productCategoryId", "" + (cat))); + } + } +%>Created lots of products and categories and keywords.<% + } +%> diff --git a/webapp/ecommerce/robots.txt b/webapp/ecommerce/robots.txt new file mode 100644 index 0000000..a77ff4b --- /dev/null +++ b/webapp/ecommerce/robots.txt @@ -0,0 +1,2 @@ +User-agent:* +Disallow: diff --git a/webapp/oshop/README b/webapp/oshop/README new file mode 100644 index 0000000..45ff103 --- /dev/null +++ b/webapp/oshop/README @@ -0,0 +1,3 @@ +If you want to know more about this feature, please check +https://cwiki.apache.org/confluence/display/OFBIZ/Search+Engine+Optimisation%2C+SEO+in+ecommerce + diff --git a/webapp/oshop/WEB-INF/controller.xml b/webapp/oshop/WEB-INF/controller.xml new file mode 100644 index 0000000..975d011 --- /dev/null +++ b/webapp/oshop/WEB-INF/controller.xml @@ -0,0 +1,28 @@ + + + + + + + OFBiz: oshop SEO Controller Configuration File + + + diff --git a/webapp/oshop/WEB-INF/web.xml b/webapp/oshop/WEB-INF/web.xml new file mode 100644 index 0000000..6d33591 --- /dev/null +++ b/webapp/oshop/WEB-INF/web.xml @@ -0,0 +1,167 @@ + + + + + + Apache OFBiz - demostore + Demo Store for the Apache OFBiz Project + + + A unique ID used to look up the WebSite entity + webSiteId + oshop + + + A unique name used to identify/recognize the local dispatcher for the Service Engine + localDispatcherName + ecommerce + + + The Name of the Entity Delegator to use, defined in entityengine.xml + entityDelegatorName + default + + + The location of the main-decorator screen to use for this webapp; referred to as a context variable in screen def XML files. + mainDecoratorLocation + component://oshop/widget/CommonScreens.xml + + + + Forces the JSESSIONID cookie to be sent via http rather https, helps prevent lost sessions in web apps that + frequently switch between http and https. + + forceHttpSession + true + + + Default page uri. Important: please DO add or remove /control to match url-pattern of SeoControlServlet. + defaultPage + /main + + + + SeoCatalogUrlFilter + SeoCatalogUrlFilter + org.ofbiz.product.category.CatalogUrlSeoFilter + defaultLocaleStringen_US + + + SeoContentUrlFilter + SeoContentUrlFilter + org.ofbiz.product.category.SeoContentUrlFilter + + defaultLocaleString + en_US + + viewRequestViewBlogArticle + + + SeoContextFilter + SeoContextFilter + org.ofbiz.product.category.SeoContextFilter + + disableContextSecurity + N + + + allowedPaths + /error:/control:/products:/select:/index.html:/index.jsp:/robots.txt:/default.html:/default.jsp:/images + + + + SeoCatalogUrlFilter + /* + + + SeoContentUrlFilter + /* + + + SeoContextFilter + /* + + + org.ofbiz.webapp.control.ControlEventListener + + + + + org.ofbiz.order.shoppingcart.CartEventListener + + org.ofbiz.webapp.control.LoginEventListener + + + Main SEO Control Servlet + SeoControlServlet + SeoControlServlet + org.ofbiz.product.category.SeoControlServlet + 1 + + + + SEO Catalog (Category/Product) URL Servlet + SeoCatalogUrlServlet + SeoCatalogUrlServlet + org.ofbiz.product.category.SeoCatalogUrlServlet + 1 + + + + SeoControlServlet + /* + + + + SeoCatalogUrlServlet + /products/* + + + + 60 + + true + true + + COOKIE + + + + index.jsp + index.html + index.htm + + + + 404 + /error/404.jsp + + diff --git a/webapp/oshop/error/error.jsp b/webapp/oshop/error/error.jsp new file mode 100644 index 0000000..3aef501 --- /dev/null +++ b/webapp/oshop/error/error.jsp @@ -0,0 +1,53 @@ +<%-- +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. +--%> + +<%@ page import="org.ofbiz.base.util.*" %> + + +OFBiz Message + + + +<% String errorMsg = (String) request.getAttribute("_ERROR_MESSAGE_"); %> + + +
    +
    + + + + +
    + + + + + + + +
    +
    :ERROR MESSAGE:
    +
    +
    <%=UtilFormatOut.replaceString(errorMsg, "\n", "
    ")%>
    +
    +
    +
    +
    + + diff --git a/webapp/oshop/index.jsp b/webapp/oshop/index.jsp new file mode 100644 index 0000000..0ad9a3f --- /dev/null +++ b/webapp/oshop/index.jsp @@ -0,0 +1,20 @@ +<%-- +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. +--%> + +<%response.sendRedirect("control/main");%> diff --git a/widget/BlogMenus.xml b/widget/BlogMenus.xml new file mode 100644 index 0000000..70f8013 --- /dev/null +++ b/widget/BlogMenus.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + diff --git a/widget/BlogScreens.xml b/widget/BlogScreens.xml new file mode 100644 index 0000000..384a300 --- /dev/null +++ b/widget/BlogScreens.xml @@ -0,0 +1,702 @@ + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + +
    + + + + + + +
    +
    +
    + + +
    +
    + + +
    + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + +
    + + + +
    + + + + + + + + + + + + + + +
    +
    + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    + + +
    + + + + + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    + + + + + + + + +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    +
    + + + + + + + + + +
    +
    +
    +
    +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    + + +
    + + + + + + + + + + +
    +
    + + +
    + + + + + + + + + + +
    +
    + + +
    + + + + + + + + + + + + + + + + +
    + + + +
    +
    +
    +
    +
    + + +
    + + + + + + + + + + + + + + + + + +
    +
    + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    + + + + + + + + + + + + + + + + +
    +
    + + +
    + +
    + + + + + + + +
    +
    + + + + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + +
    +
    +
    +
    +
    +
    + + +
    + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + diff --git a/widget/BlogTemplates.xml b/widget/BlogTemplates.xml new file mode 100644 index 0000000..37d0b85 --- /dev/null +++ b/widget/BlogTemplates.xml @@ -0,0 +1,53 @@ + + + + + +
    + + + +
    +
    + + +
    + + + + + + + +
    +
    + + +
    + + + + + +
    +
    +
    diff --git a/widget/BlogTrees.xml b/widget/BlogTrees.xml new file mode 100644 index 0000000..dd77e2e --- /dev/null +++ b/widget/BlogTrees.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/widget/CartScreens.xml b/widget/CartScreens.xml new file mode 100644 index 0000000..e988fde --- /dev/null +++ b/widget/CartScreens.xml @@ -0,0 +1,141 @@ + + + + + + + +
    + + + + + + +
    +
    + +
    + + + + + + + +
    +
    + +
    + +