Author: mor
Date: Fri Aug 22 06:40:31 2008 New Revision: 688081 URL: http://svn.apache.org/viewvc?rev=688081&view=rev Log: Adding completely new screens for customer and profile pages which are more compliant to industry standards. To use these screens comment existing newcustomer and viewprofile screen and uncomment the new ones which has same names. Entity Change: A new field is added to check default billing address in PartyProfileDefaults. As this new stuff becomes matured and community accept this as default then we can remove older stuff. Thanks to Sumit Pandit, Rishi Solanki, Brajesh Patel and Santosh Malviya for there valuable contribution. Added: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditPostalAddress.ftl (with props) ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditProfile.ftl (with props) ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ManageAddress.ftl (with props) ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/NewCustomer.ftl (with props) ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ViewProfile.ftl (with props) ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/profile.js (with props) Modified: ofbiz/trunk/applications/ecommerce/config/EcommerceUiLabels.xml ofbiz/trunk/applications/ecommerce/script/org/ofbiz/ecommerce/customer/CheckoutMapProcs.xml ofbiz/trunk/applications/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml ofbiz/trunk/applications/ecommerce/widget/CommonScreens.xml ofbiz/trunk/applications/ecommerce/widget/CustomerScreens.xml ofbiz/trunk/applications/party/entitydef/entitymodel.xml ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml ofbiz/trunk/applications/party/servicedef/services.xml Modified: ofbiz/trunk/applications/ecommerce/config/EcommerceUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/config/EcommerceUiLabels.xml?rev=688081&r1=688080&r2=688081&view=diff ============================================================================== --- ofbiz/trunk/applications/ecommerce/config/EcommerceUiLabels.xml (original) +++ ofbiz/trunk/applications/ecommerce/config/EcommerceUiLabels.xml Fri Aug 22 06:40:31 2008 @@ -1124,6 +1124,12 @@ <value xml:lang="th">à¹à¸à¸´à¹à¸¡à¸à¸µà¹à¹à¸¥à¸·à¸à¸à¸¥à¸à¸ªà¸¹à¹à¸£à¸²à¸¢à¸à¸²à¸£</value> <value xml:lang="zh">æéä¸çæ·»å å°å表ä¸</value> </property> + <property key="EcommerceAdditional"> + <value xml:lang="en">Additional</value> + </property> + <property key="EcommerceAddressBook"> + <value xml:lang="en">Address Book</value> + </property> <property key="EcommerceAdjustment"> <value xml:lang="cs">Ãprava</value> <value xml:lang="de">Anpassung</value> @@ -1359,6 +1365,9 @@ <value xml:lang="th">หมายà¹à¸¥à¸à¹à¸«à¸¥à¹à¸à¸à¸µà¹à¸¡à¸²</value> <value xml:lang="zh">æ°æ®èµæºæ è¯</value> </property> + <property key="EcommerceDefault"> + <value xml:lang="en">Default</value> + </property> <property key="EcommerceDigitalAddFromMyFiles"> <value xml:lang="en">Digital Add From My Files</value> <value xml:lang="fr">Ajout numérique depuis mes fichiers</value> @@ -2119,6 +2128,9 @@ <value xml:lang="th">à¹à¸«à¹à¸à¸à¹à¸§à¸¢</value> <value xml:lang="zh">å¿ è¯åº¦ç¹æ°</value> </property> + <property key="EcommerceManage"> + <value xml:lang="en">Manage</value> + </property> <property key="EcommerceMessage1"> <value xml:lang="en">Sorry, it appears that the specified product ID</value> <value xml:lang="fr">Désolé, il semble que l'article spécifié</value> @@ -2186,6 +2198,15 @@ <value xml:lang="th">à¹à¸à¸·à¸à¸</value> <value xml:lang="zh">æ</value> </property> + <property key="EcommerceMyAccount"> + <value xml:lang="en">My Account</value> + </property> + <property key="EcommerceMyDefaultBillingAddress"> + <value xml:lang="en">Make this my default billing address</value> + </property> + <property key="EcommerceMyDefaultShippingAddress"> + <value xml:lang="en">Make this my default shipping address</value> + </property> <property key="EcommerceNbrOfDays"> <value xml:lang="en">Nbr Of Days</value> <value xml:lang="es">Número de dÃas</value> @@ -2395,6 +2416,9 @@ <value xml:lang="th">à¹à¸¡à¹à¹à¸ªà¸£à¹à¸à¸ªà¸¡à¸à¸¹à¸£à¸à¹</value> <value xml:lang="zh">æªå®æ</value> </property> + <property key="EcommerceNotExists"> + <value xml:lang="en">Not Exists</value> + </property> <property key="EcommerceNotYetKnown"> <value xml:lang="en">Not Yet Known</value> <value xml:lang="fr">Pas encore connu</value> @@ -2525,6 +2549,9 @@ <value xml:lang="th">ราà¸à¸²</value> <value xml:lang="zh">ä»·æ ¼</value> </property> + <property key="EcommercePrimary"> + <value xml:lang="en">Primary</value> + </property> <property key="EcommerceProductNumber"> <value xml:lang="en">Product Number</value> <value xml:lang="es">Producto</value> Modified: ofbiz/trunk/applications/ecommerce/script/org/ofbiz/ecommerce/customer/CheckoutMapProcs.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/script/org/ofbiz/ecommerce/customer/CheckoutMapProcs.xml?rev=688081&r1=688080&r2=688081&view=diff ============================================================================== --- ofbiz/trunk/applications/ecommerce/script/org/ofbiz/ecommerce/customer/CheckoutMapProcs.xml (original) +++ ofbiz/trunk/applications/ecommerce/script/org/ofbiz/ecommerce/customer/CheckoutMapProcs.xml Fri Aug 22 06:40:31 2008 @@ -168,4 +168,36 @@ </process> </simple-map-processor> + <simple-map-processor name="shipToPhone"> + <process field="shipToCountryCode"> + <copy to-field="countryCode"/> + <not-empty><fail-property resource="EcommerceUiLabels" property="PartyCountryCodeMissing"/></not-empty> + </process> + <process field="shipToAreaCode"> + <copy to-field="areaCode"/> + <not-empty><fail-property resource="EcommerceUiLabels" property="PartyAreaCodeMissingError"/></not-empty> + </process> + <process field="shipToContactNumber"> + <copy to-field="contactNumber"/> + <not-empty><fail-property resource="EcommerceUiLabels" property="PartyContactTelephoneMissingError"/></not-empty> + </process> + <process field="shipToExtension"><copy to-field="extension"/></process> + </simple-map-processor> + + <simple-map-processor name="billToPhone"> + <process field="billToCountryCode"> + <copy to-field="countryCode"/> + <not-empty><fail-property resource="EcommerceUiLabels" property="PartyCountryCodeMissing"/></not-empty> + </process> + <process field="billToAreaCode"> + <copy to-field="areaCode"/> + <not-empty><fail-property resource="EcommerceUiLabels" property="PartyAreaCodeMissingError"/></not-empty> + </process> + <process field="billToContactNumber"> + <copy to-field="contactNumber"/> + <not-empty><fail-property resource="EcommerceUiLabels" property="PartyContactTelephoneMissingError"/></not-empty> + </process> + <process field="billToExtension"><copy to-field="extension"/></process> + </simple-map-processor> + </simple-map-processors> Modified: ofbiz/trunk/applications/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml?rev=688081&r1=688080&r2=688081&view=diff ============================================================================== --- ofbiz/trunk/applications/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml (original) +++ ofbiz/trunk/applications/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml Fri Aug 22 06:40:31 2008 @@ -955,21 +955,31 @@ <entity-one entity-name="UserLogin" value-name="userLogin"> <field-map field-name="userLoginId" env-name="userLoginMap.userLoginId"/> </entity-one> + + <!-- now finished, log in the user and set the cart's partyId --> + <call-bsh> + <![CDATA[ + org.ofbiz.webapp.control.LoginWorker.doBasicLogin(userLogin, request); + org.ofbiz.webapp.control.LoginWorker.autoLoginSet(request, response); + ]]> + </call-bsh> <set field="parameters.userLogin" from-field="userLogin"/> <else> - <call-map-processor xml-resource="org/ofbiz/securityext/login/LoginMapProcs.xml" - processor-name="updatePassword" in-map-name="parameters" out-map-name="passwordMap"/> - <check-errors/> - <set-service-fields service-name="updatePassword" map-name="passwordMap" to-map-name="passwordCtx"/> - <call-service service-name="updatePassword" in-map-name="passwordCtx"> - <result-to-field result-name="updatedUserLogin"/> - </call-service> - <set-current-user-login value-name="updatedUserLogin"/> - <session-to-field field-name="userLogin"/> - <if-compare field="userLogin.userLoginId" operator="equals" value="${updatedUserLogin.userLoginId}"> - <field-to-session field-name="updatedUserLogin" session-name="userLogin"/> - </if-compare> - <session-to-field field-name="userLogin"/> + <if-not-empty field="parameters.currentPassword"> + <call-map-processor xml-resource="org/ofbiz/securityext/login/LoginMapProcs.xml" + processor-name="updatePassword" in-map-name="parameters" out-map-name="passwordMap"/> + <check-errors/> + <set-service-fields service-name="updatePassword" map-name="passwordMap" to-map-name="passwordCtx"/> + <call-service service-name="updatePassword" in-map-name="passwordCtx"> + <result-to-field result-name="updatedUserLogin"/> + </call-service> + <set-current-user-login value-name="updatedUserLogin"/> + <session-to-field field-name="userLogin"/> + <if-compare field="userLogin.userLoginId" operator="equals" value="${updatedUserLogin.userLoginId}"> + <field-to-session field-name="updatedUserLogin" session-name="userLogin"/> + </if-compare> + <session-to-field field-name="userLogin"/> + </if-not-empty> </else> </if-empty> </simple-method> @@ -1017,7 +1027,7 @@ <field-to-request field-name="parameters.phoneContactMechId" request-name="phoneContactMechId"/> </simple-method> - <simple-method method-name="createUpdateEmailAddress" short-description="Create and update phone number" login-required="false"> + <simple-method method-name="createUpdateEmailAddress" short-description="Create and update email address" login-required="false"> <call-map-processor xml-resource="org/ofbiz/ecommerce/customer/CheckoutMapProcs.xml" processor-name="emailAddress" in-map-name="parameters" out-map-name="emailAddressContext"/> <check-errors/> @@ -1039,7 +1049,11 @@ <log level="info" message="Email Contact updated emailContactMechId is ${parameters.emailContactMechId}"></log> </else> </if-empty> + <entity-one entity-name="ContactMech" value-name="emailContactMech"> + <field-map field-name="contactMechId" env-name="parameters.emailContactMechId"/> + </entity-one> <field-to-request field-name="parameters.emailContactMechId" request-name="emailContactMechId"/> + <field-to-request field-name="emailContactMech" request-name="emailContactMech"/> </simple-method> <simple-method method-name="createUpdateShippingAddress" short-description="create and update shipping address" login-required="false"> @@ -1376,4 +1390,102 @@ <set field="paymentMethodId" from-field="parameters.paymentMethodId"/> <field-to-request field-name="parameters.paymentMethodId" request-name="paymentMethodId"/> </simple-method> + + <simple-method method-name="createCustomerProfile" short-description="create a customer profile" login-required="false"> + <!-- Process all map --> + <call-map-processor xml-resource="org/ofbiz/ecommerce/customer/CheckoutMapProcs.xml" + processor-name="person" in-map-name="parameters" out-map-name="personCtx"/> + <call-map-processor xml-resource="org/ofbiz/ecommerce/customer/CheckoutMapProcs.xml" + processor-name="emailAddress" in-map-name="parameters" out-map-name="emailAddressCtx"/> + <call-map-processor xml-resource="org/ofbiz/ecommerce/customer/CheckoutMapProcs.xml" + processor-name="shipToAddress" in-map-name="parameters" out-map-name="shipToAddressCtx"/> + <call-map-processor xml-resource="org/ofbiz/ecommerce/customer/CheckoutMapProcs.xml" + processor-name="shipToPhone" in-map-name="parameters" out-map-name="shipToTelecomNumberCtx"/> + <call-map-processor xml-resource="org/ofbiz/ecommerce/customer/CheckoutMapProcs.xml" + processor-name="billToAddress" in-map-name="parameters" out-map-name="billToAddressCtx"/> + <call-map-processor xml-resource="org/ofbiz/ecommerce/customer/CheckoutMapProcs.xml" + processor-name="billToPhone" in-map-name="parameters" out-map-name="billToTelecomNumberCtx"/> + <check-errors/> + + <!-- create person --> + <set-service-fields service-name="createPerson" map-name="personCtx" to-map-name="createPersonCtx"/> + <call-service service-name="createPerson" in-map-name="createPersonCtx"> + <result-to-field result-name="partyId" field-name="partyId"/> + </call-service> + <set field="parameters.partyId" from-field="partyId"/> + + <!-- create userLogin --> + <call-simple-method method-name="createUpdateUserLogin"/> + + <!-- Create party role--> + <set field="partyRoleContext.partyId" from-field="parameters.partyId"/> + <set field="partyRoleContext.roleTypeId" from-field="parameters.roleTypeId"/> + <set field="partyRoleContext.userLogin" from-field="parameters.userLogin"/> + <call-service service-name="createPartyRole" in-map-name="partyRoleContext"/> + + <!-- Create email address --> + <set field="emailAddressCtx.partyId" from-field="parameters.partyId"/> + <set field="emailAddressCtx.userLogin" from-field="parameters.userLogin"/> + <set field="emailAddressCtx.contactMechPurposeTypeId" from-field="parameters.emailContactMechPurposeTypeId"/> + <call-service service-name="createPartyEmailAddress" in-map-name="emailAddressCtx"> + <result-to-field result-name="contactMechId" field-name="emailContactMechId"/> + </call-service> + <log level="info" message="Email Contact Created emailContactMechId is ${emailContactMechId}"/> + + <!-- Create shipping address --> + <set field="shipToAddressCtx.partyId" from-field="parameters.partyId"/> + <set field="shipToAddressCtx.userLogin" from-field="parameters.userLogin"/> + <set field="shipToAddressCtx.setShippingPurpose" value="Y"/> + <set field="shipToAddressCtx.productStoreId" from-field="parameters.productStoreId"/> + <if-compare field="parameters.useShippingAddressForBilling" operator="equals" value="Y"> + <set field="shipToAddressCtx.setBillingPurpose" value="Y"/> + </if-compare> + <call-service service-name="createPostalAddressAndPurposes" in-map-name="shipToAddressCtx"> + <result-to-field result-name="contactMechId" field-name="shipToContactMechId"/> + </call-service> + <log level="info" message="Shipping address created with contactMechId ${shipToContactMechId}"/> + + <!-- create shipping telecom number --> + <set field="shipToTelecomNumberCtx.partyId" from-field="parameters.partyId"/> + <set field="shipToTelecomNumberCtx.userLogin" from-field="parameters.userLogin"/> + <set field="shipToTelecomNumberCtx.contactMechPurposeTypeId" value="PHONE_SHIPPING"/> + <!-- call create telecom service --> + <call-service service-name="createPartyTelecomNumber" in-map-name="shipToTelecomNumberCtx"> + <result-to-field result-name="contactMechId" field-name="shipToTelecomContactMechId"/> + </call-service> + <log level="info" message="Shipping telecom number is created with contactMechId ${shipToTelecomContactMechId}"/> + + <!-- Create billing address --> + <if-compare field="parameters.useShippingAddressForBilling" operator="not-equals" value="Y"> + <set field="billToAddressCtx.partyId" from-field="parameters.partyId"/> + <set field="billToAddressCtx.userLogin" from-field="parameters.userLogin"/> + <set field="billToAddressCtx.setBillingPurpose" value="Y"/> + <set field="billToAddressCtx.productStoreId" from-field="parameters.productStoreId"/> + <call-service service-name="createPostalAddressAndPurposes" in-map-name="billToAddressCtx"> + <result-to-field result-name="contactMechId" field-name="billToContactMechId"/> + </call-service> + <log level="info" message="Billing address created with contactMechId ${billToContactMechId}"/> + <else> + <log level="info" message="Billing address created same as Shipping address with contactMechId ${shipToContactMechId}"/> + </else> + </if-compare> + + <!-- create billing telecom number --> + <set field="billToTelecomNumberCtx.partyId" from-field="parameters.partyId"/> + <set field="billToTelecomNumberCtx.userLogin" from-field="parameters.userLogin"/> + <set field="billToTelecomNumberCtx.contactMechPurposeTypeId" value="PHONE_BILLING"/> + <!-- call create telecom service --> + <call-service service-name="createPartyTelecomNumber" in-map-name="billToTelecomNumberCtx"> + <result-to-field result-name="contactMechId" field-name="billToTelecomContactMechId"/> + </call-service> + <log level="info" message="Billing telecom number is created with contactMechId ${billToTelecomContactMechId}"/> + </simple-method> + + <simple-method method-name="updateCustomerProfile" short-description="Update a customer profile"> + <set field="partyId" from-field="userLogin.partyId"/> + <call-simple-method method-name="createUpdatePerson"/> + <call-simple-method method-name="createUpdateUserLogin"/> + <call-simple-method method-name="createUpdateEmailAddress"/> + </simple-method> + </simple-methods> \ No newline at end of file Modified: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml?rev=688081&r1=688080&r2=688081&view=diff ============================================================================== --- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml (original) +++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml Fri Aug 22 06:40:31 2008 @@ -1698,6 +1698,61 @@ <response name="cod" type="request" value="emailorder"/> --> <response name="error" type="view" value="OnePageCheckout"/> </request-map> + + <request-map uri="editProfile"> + <security https="true" auth="true"/> + <response name="success" type="view" value="EditProfile"/> + <response name="error" type="view" value="EditProfile"/> + </request-map> + + <request-map uri="manageAddress"> + <security https="true" auth="true"/> + <response name="success" type="view" value="ManageAddress"/> + <response name="error" type="view" value="ManageAddress"/> + </request-map> + + <request-map uri="createCustomerProfile"> + <security https="true" auth="false"/> + <event type="simple" path="org/ofbiz/ecommerce/customer/CustomerEvents.xml" invoke="createCustomerProfile"/> + <response name="success" type="view" value="main"/> + <response name="error" type="view" value="newcustomer"/> + </request-map> + + <request-map uri="updateCustomerProfile"> + <security https="true" auth="true"/> + <event type="simple" path="org/ofbiz/ecommerce/customer/CustomerEvents.xml" invoke="updateCustomerProfile"/> + <response name="success" type="view" value="viewprofile"/> + <response name="error" type="view" value="EditProfile"/> + </request-map> + + <request-map uri="createPartyPostalAddress"> + <security https="true" auth="true"/> + <event type="jsonservice" invoke="createPostalAddressAndPurposes"/> + <response name="success" type="none"/> + <response name="error" type="none"/> + </request-map> + + <request-map uri="updatePartyPostalAddress"> + <security https="true" auth="true"/> + <event type="jsonservice" invoke="updateContactMechAndPurposes"/> + <response name="success" type="none"/> + <response name="error" type="none"/> + </request-map> + + <request-map uri="deletePostalAddress"> + <security https="true" auth="true"/> + <event type="service" invoke="deletePartyContactMech"/> + <response name="success" type="view" value="ManageAddress"/> + <response name="error" type="view" value="ManageAddress"/> + </request-map> + + <request-map uri="updatePartyEmailAddress"> + <security https="true" auth="true"/> + <event type="jsonsimple" path="org/ofbiz/ecommerce/customer/CustomerEvents.xml" invoke="createUpdateEmailAddress"/> + <response name="success" type="none"/> + <response name="error" type="none"/> + </request-map> + <!-- End of Request Mappings --> <!-- View Mappings --> @@ -1779,6 +1834,8 @@ <view-map name="messagelist" type="screen" page="component://ecommerce/widget/CustomerScreens.xml#messagelist"/> <view-map name="messagedetail" type="screen" page="component://ecommerce/widget/CustomerScreens.xml#messagedetail"/> <view-map name="messagecreate" type="screen" page="component://ecommerce/widget/CustomerScreens.xml#messagecreate"/> + <view-map name="ManageAddress" type="screen" page="component://ecommerce/widget/CustomerScreens.xml#ManageAddress"/> + <view-map name="EditProfile" type="screen" page="component://ecommerce/widget/CustomerScreens.xml#EditProfile"/> <!-- Content Views --> <view-map name="defaultcontent" type="screen" page="component://ecommerce/widget/ContentScreens.xml#defaultcontent"/> Added: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditPostalAddress.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditPostalAddress.ftl?rev=688081&view=auto ============================================================================== --- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditPostalAddress.ftl (added) +++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditPostalAddress.ftl Fri Aug 22 06:40:31 2008 @@ -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. +--> + +<div id="serverError_${contactMech.contactMechId}" class="errorMessage"></div> +<#assign postalAddress = delegator.findOne("PostalAddress", Static["org.ofbiz.base.util.UtilMisc"].toMap("contactMechId", contactMech.contactMechId), true)> + +<form id="editPostalAddress_${contactMech.contactMechId}" name="editPostalAddress_${contactMech.contactMechId}" method="post" action="<@ofbizUrl></@ofbizUrl>"> + <input type="hidden" name="contactMechId" value="${postalAddress.contactMechId?if_exists}"/> + <#assign productStoreId = Static["org.ofbiz.product.store.ProductStoreWorker"].getProductStoreId(request)/> + <input type="hidden" name="productStoreId" value="${productStoreId?if_exists}"/> + <#assign showSetShippingPurpose = "Y"> + <#assign showSetBillingPurpose = "Y"> + <#assign telecomNumber = ""> + <#list partyContactMechValueMap.partyContactMechPurposes?if_exists as partyContactMechPurpose> + <#assign contactMechPurposeType = partyContactMechPurpose.getRelatedOneCache("ContactMechPurposeType")> + <#if contactMechPurposeType.contactMechPurposeTypeId == "SHIPPING_LOCATION"> + <#assign showSetShippingPurpose = "N"> + <#assign pcmps = Static["org.ofbiz.entity.util.EntityUtil"].filterByDate(party.getRelatedByAnd("PartyContactMechPurpose", Static["org.ofbiz.base.util.UtilMisc"].toMap("contactMechPurposeTypeId", "PHONE_SHIPPING")))> + <#if pcmps?has_content> + <#assign pcmp = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(pcmps)/> + <#assign telecomNumber = pcmp.getRelatedOne("TelecomNumber")/> + </#if> + </#if> + <#if contactMechPurposeType.contactMechPurposeTypeId == "BILLING_LOCATION"> + <#assign showSetBillingPurpose = "N"> + <#assign pcmps = Static["org.ofbiz.entity.util.EntityUtil"].filterByDate(party.getRelatedByAnd("PartyContactMechPurpose", Static["org.ofbiz.base.util.UtilMisc"].toMap("contactMechPurposeTypeId", "PHONE_BILLING")))> + <#if pcmps?has_content> + <#assign pcmp = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(pcmps)/> + <#assign telecomNumber = pcmp.getRelatedOne("TelecomNumber")/> + </#if> + </#if> + </#list> + <div class="screenlet-body"> + <div class="form-row"> + <span>${uiLabelMap.PartyAddressLine1}*</span> + <span> + <input type="text" class="left inputBox required" name="address1" id="address1_${contactMech.contactMechId}" value="${postalAddress.address1?if_exists}" style="width: 50%" size="30" maxlength="30"> + <span id="advice-required-address1_${contactMech.contactMechId}" style="display: none" class="errorMessage">(required)</span> + </span> + </div> + <div class="form-row"> + <span>${uiLabelMap.PartyAddressLine2}</span> + <span> + <input type="text" class="left inputBox" name="address2" value="${postalAddress.address2?if_exists}" style="width: 50%" size="30" maxlength="30"> + </span> + </div> + <div class="form-row"> + <span>${uiLabelMap.PartyCity}*</span> + <span> + <input type="text" class="left inputBox required" name="city" id="city_${contactMech.contactMechId}" value="${postalAddress.city?if_exists}" size="30" maxlength="30"> + <span id="advice-required-city_${contactMech.contactMechId}" style="display: none" class="errorMessage">(required)</span> + </span> + </div> + <div class="form-row"> + <span>${uiLabelMap.PartyZipCode}*</span> + <span> + <input type="text" class="left inputBox required" name="postalCode" id="postalCode_${contactMech.contactMechId}" value="${postalAddress.postalCode?if_exists}" size="12" maxlength="10"> + <span id="advice-required-postalCode_${contactMech.contactMechId}" style="display: none" class="errorMessage">(required)</span> + </span> + </div> + <div class="form-row"> + <span>${uiLabelMap.PartyCountry}*</span> + <span> + <select name="countryGeoId" id="countryGeoId_${contactMech.contactMechId}" class="left selectBox required" style="width: 70%"> + <#if postalAddress.countryGeoId?exists> + <option value='${postalAddress.countryGeoId}'>${selectedCountryName?default(postalAddress.countryGeoId)}</option> + </#if> + ${screens.render("component://common/widget/CommonScreens.xml#countries")} + </select> + <span id="advice-required-countryGeoId_${contactMech.contactMechId}" style="display: none" class="errorMessage">(required)</span> + </span> + </div> + <div class="form-row"> + <span>${uiLabelMap.PartyState}*</span> + <span> + <select name="stateProvinceGeoId" id="stateProvinceGeoId_${contactMech.contactMechId}" class="left selectBox required" style="width: 70%"> + <#if postalAddress.stateProvinceGeoId?exists> + <option value='${postalAddress.stateProvinceGeoId}'>${selectedStateName?default(postalAddress.stateProvinceGeoId)}</option> + </#if> + <option value="">${uiLabelMap.PartyNoState}</option> + ${screens.render("component://common/widget/CommonScreens.xml#states")} + </select> + <span id="advice-required-stateProvinceGeoId_${contactMech.contactMechId}" style="display: none" class="errorMessage">(required)</span> + </span> + </div> + + <#if telecomNumber?has_content> + <#assign pcm = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(telecomNumber.getRelated("PartyContactMech"))/> + <div class="form-row"> + <h3>${uiLabelMap.PartyPhoneNumber}</h3> + <div class="field-label"> + <label for="countryCode_${telecomNumber.contactMechId}">${uiLabelMap.PartyCountry}<span>*</span> + <span id="advice-required-countryCode_${telecomNumber.contactMechId}" style="display:none" class="errorMessage">(required)</span> + </label> + <label for="areaCode_${telecomNumber.contactMechId}">${uiLabelMap.PartyAreaCode}<span>*</span><span id="advice-required-areaCode_${telecomNumber.contactMechId}" style="display:none" class="errorMessage">(required)</span></label> + <label for="contactNumber_${telecomNumber.contactMechId}">${uiLabelMap.PartyContactNumber}<span>*</span><span id="advice-required-contactNumber_${telecomNumber.contactMechId}" style="display:none" class="errorMessage">(required)</span></label> + <label for="extension_${telecomNumber.contactMechId}">${uiLabelMap.PartyExtension}</label> + </div> + <div class="field-widget"> + <input type="hidden" name="phoneContactMechId" value="${telecomNumber.contactMechId?if_exists}"/> + <input type="text" name="countryCode" id="countryCode_${telecomNumber.contactMechId}" class="inputBox required" value="${telecomNumber.countryCode?if_exists}" size="3" maxlength="3"/> + - <input type="text" name="areaCode" id="areaCode_${telecomNumber.contactMechId}" class="inputBox required" value="${telecomNumber.areaCode?if_exists}" size="3" maxlength="3"/> + - <input type="text" name="contactNumber" id="contactNumber_${telecomNumber.contactMechId}" class="inputBox required" value="${contactNumber?default("${telecomNumber.contactNumber?if_exists}")}" size="6" maxlength="7"/> + - <input type="text" name="extension" id="extension_${telecomNumber.contactMechId}" class="inputBox" value="${extension?default("${pcm.extension?if_exists}")}" size="3" maxlength="3"/> + </div> + </div> + </#if> + <#if showSetShippingPurpose == "Y"> + <div class="form-row"> + <b>${uiLabelMap.EcommerceMyDefaultShippingAddress}</b> + <input type="checkbox" name="setShippingPurpose" value="Y" <#if setShippingPurpose?exists>checked</#if>/> + </div> + <#else> + <input type="hidden" name="setShippingPurpose" value="Y"/> + </#if> + <#if showSetBillingPurpose == "Y"> + <div class="form-row"> + <b>${uiLabelMap.EcommerceMyDefaultBillingAddress}</b> + <input type="checkbox" name="setBillingPurpose" value="Y" <#if setBillingPurpose?exists>checked</#if>/> + </div> + <#else> + <input type="hidden" name="setBillingPurpose" value="Y"/> + </#if> + + <div class="form-row"> + <a name="submitEditPostalAddress_${contactMech.contactMechId}" id="submitEditPostalAddress_${contactMech.contactMechId}" class="buttontext" onclick="updatePartyPostalAddress('submitEditPostalAddress_${contactMech.contactMechId}')">${uiLabelMap.CommonSave}</a> + <form action=""> + <input class="popup_closebox buttontext" type="button" value="${uiLabelMap.CommonClose}"/> + </form> + </div> + </div> +</form> \ No newline at end of file Propchange: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditPostalAddress.ftl ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditPostalAddress.ftl ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditPostalAddress.ftl ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditProfile.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditProfile.ftl?rev=688081&view=auto ============================================================================== --- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditProfile.ftl (added) +++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditProfile.ftl Fri Aug 22 06:40:31 2008 @@ -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. +--> + +<div id="form-container" class="screenlet"> + <div class="screenlet-header"> + <div class='boxhead'> ${uiLabelMap.CommonEdit} ${uiLabelMap.CommonProfile}</div> + </div> + <div class="screenlet-body"> + <form id="editUserForm" name="editUserForm" method="post" action="<@ofbizUrl>updateCustomerProfile</@ofbizUrl>"> + <input type="hidden" name="emailContactMechPurposeTypeId" value="PRIMARY_EMAIL"/> + <input type="hidden" name="emailContactMechId" value="${parameters.emailContactMechId?if_exists}"/> + + <div class="left center"> + <div class="screenlet-header"><div class='boxhead'> ${uiLabelMap.PartyContactInformation}</div></div> + <div class="screenlet-body"> + <div class="form-row"> + <div class="field-label"><label for="firstName">${uiLabelMap.PartyFirstName}*<span id="advice-required-firstName" style="display: none" class="errorMessage">(required)</span></label></div> + <div class="field-widget"><input type="text" name="firstName" id="firstName" class="inputBox required" value="${parameters.firstName?if_exists}" size="30" maxlength="30"></div> + </div> + <div class="form-row"> + <div class="field-label"><label for="lastName">${uiLabelMap.PartyLastName}*<span id="advice-required-lastName" style="display: none" class="errorMessage">(required)</span></label></div> + <div class="field-widget"><input type="text" name="lastName" id="lastName" class="inputBox required" value="${parameters.lastName?if_exists}" size="30" maxlength="30"></div> + </div> + <div class="form-row"> + <div class="field-label"><label for="emailAddress">${uiLabelMap.PartyEmailAddress}*<span id="advice-required-emailAddress" style="display: none" class="errorMessage">(required)</span></label></div> + <div class="field-widget"><input type="text" class="inputBox required" name="emailAddress" id="emailAddress" value="${parameters.emailAddress?if_exists}" size="30" maxlength="255"/></div> + </div> + </div> + </div> + + <div class="center right"> + <div class="screenlet-header"><div class='boxhead'> ${uiLabelMap.AccountInformation}</div></div> + <div class="screenlet-body"> + <div class="form-row"> + <div class="field-label"><label for="userName">${uiLabelMap.CommonUsername}*</label></div> + <div class="field-widget"><input type="text" name="userLoginId" id="userLoginId" class="inputBox" value="${userLogin.userLoginId?if_exists}" size="30" maxlength="255" <#if userLogin.userLoginId?exists>disabled</#if>></div> + </div> + <div class="form-row"> + <div class="field-label"><label for="currentPassword">${uiLabelMap.CommonCurrentPassword}*</label></div> + <div class="field-widget"><input type="password" name="currentPassword" id="currentPassword" class="inputBox" value="${parameters.currentPassword?if_exists}" size="30" maxlength="16"></div> + </div> + <div class="form-row"> + <div class="field-label"><label for="newPassword">${uiLabelMap.CommonNewPassword}*</label></div> + <div class="field-widget"><input type="password" name="newPassword" id="newPassword" class="inputBox" value="${parameters.newPassword?if_exists}" size="30" maxlength="16"></div> + </div> + <div class="form-row"> + <div class="field-label"><label for="newPasswordVerify">${uiLabelMap.CommonNewPasswordVerify}*</label></div> + <div class="field-widget"><input type="password" name="newPasswordVerify" id="newPasswordVerify" class="inputBox" value="${parameters.passwordVerify?if_exists}" size="30" maxlength="16"></div> + </div> + </div> + </div> + <div class="form-row"> <a id="submitEditUserForm" href="javascript:void(0);" class="buttontext">${uiLabelMap.CommonSave}</a></div> + </form> + </div> +</div> \ No newline at end of file Propchange: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditProfile.ftl ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditProfile.ftl ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditProfile.ftl ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ManageAddress.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ManageAddress.ftl?rev=688081&view=auto ============================================================================== --- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ManageAddress.ftl (added) +++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ManageAddress.ftl Fri Aug 22 06:40:31 2008 @@ -0,0 +1,284 @@ +<#-- +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)/> +<div class="screenlet"> + <form id="refreshRequestForm" name="refreshRequestForm" method="post" action="<@ofbizUrl>manageAddress</@ofbizUrl>"> + </form> + + <#-- Add address --> + <div class="screenlet-header"><div class="boxhead"> ${uiLabelMap.CommonAdd} ${uiLabelMap.CommonNew} ${uiLabelMap.CommonAddresses}</div> + </div> + <div class="screenlet-body"> + <a class="buttontext" id="addAddress" href="javascript:void(0)">${uiLabelMap.CommonAdd} ${uiLabelMap.OrderAddress}</a> + <div id="displayCreateAddressForm" class="popup" style="display: none;"> + <div id="serverError" class="errorMessage"></div> + <form id="createPostalAddressForm" name="createPostalAddressForm" method="post" action="<@ofbizUrl></@ofbizUrl>"> + <input type="hidden" name="roleTypeId" value="CUSTOMER"> + <input type="hidden" name="productStoreId" value="${productStoreId?if_exists}"/> + <div class="form-row"> + ${uiLabelMap.PartyAddressLine1}* + <div class="form-field"> + <input type="text" class="inputBox required" name="address1" id="address1" value="" size="30" maxlength="30"><span id="advice-required-address1" style="display: none" class="errorMessage">(required)</span> + </div> + </div> + <div class="form-row"> + ${uiLabelMap.PartyAddressLine2}<div class="form-field"><input type="text" class="inputBox" name="address2" value="" size="30" maxlength="30"></div> + </div> + <div class="form-row"> + ${uiLabelMap.PartyCity}* + <div class="form-field"> + <input type="text" class="inputBox required" name="city" id="city" value="" size="30" maxlength="30"><span id="advice-required-city" style="display: none" class="errorMessage">(required)</span> + </div> + </div> + <div class="form-row"> + ${uiLabelMap.PartyZipCode}* + <div class="form-field"> + <input type="text" class="inputBox required" name="postalCode" id="postalCode" value="" size="12" maxlength="10"><span id="advice-required-postalCode" style="display: none" class="errorMessage">(required)</span> + </div> + </div> + <div class="form-row"> + ${uiLabelMap.PartyCountry}* + <div class="form-field"> + <select name="countryGeoId" id="countryGeoId" class="selectBox required" style="width: 70%"> + ${screens.render("component://common/widget/CommonScreens.xml#countries")} + </select> + <span id="advice-required-countryGeoId" style="display: none" class="errorMessage">(required)</span> + </div> + </div> + <div class="form-row"> + ${uiLabelMap.PartyState}* + <div class="form-field"> + <select name="stateProvinceGeoId" id="stateProvinceGeoId" class="selectBox required" style="width: 70%"> + <option value="">${uiLabelMap.PartyNoState}</option> + ${screens.render("component://common/widget/CommonScreens.xml#states")} + </select> + <span id="advice-required-stateProvinceGeoId" style="display: none" class="errorMessage">(required)</span> + </div> + </div> + <div class="form-row"> + <b>${uiLabelMap.EcommerceMyDefaultShippingAddress}</b> + <input type="checkbox" name="setShippingPurpose" id="setShippingPurpose" value="Y" <#if setShippingPurpose?exists>checked</#if>/> + </div> + <div class="form-row"> + <b>${uiLabelMap.EcommerceMyDefaultBillingAddress}</b> + <input type="checkbox" name="setBillingPurpose" id="setBillingPurpose" value="Y" <#if setBillingPurpose?exists>checked</#if>/> + </div> + <div class="form-row"> + <a href="javascript:void(0);" id="submitPostalAddressForm" class="buttontext" onclick="createPartyPostalAddress('submitPostalAddressForm')">${uiLabelMap.CommonSave}</a> + <form action=""> + <input class="popup_closebox buttontext" type="button" value="${uiLabelMap.CommonClose}"/> + </form> + </div> + </form> + </div> + <script type="text/javascript"> + new Popup('displayCreateAddressForm','addAddress', {modal: true, position: 'center', trigger: 'click'}) + </script> + </div> + <br/> + <div class="screenlet-header"><div class="boxhead"> ${uiLabelMap.EcommerceAddressBook}</div></div> + <div class="screenlet-body"></div> + + <#-- Manage Addresses --> + <div class="left center"> + <div class="screenlet-header"><div class="boxhead"> ${uiLabelMap.EcommerceDefault} ${uiLabelMap.CommonAddresses}</div></div> + <div class="screenlet-body"> + <#assign postalAddressFlag = "N"> + <#list partyContactMechValueMaps as partyContactMechValueMap> + <#assign contactMech = partyContactMechValueMap.contactMech?if_exists> + <#if contactMech.contactMechTypeId?if_exists = "POSTAL_ADDRESS"> + <#assign partyContactMech = partyContactMechValueMap.partyContactMech?if_exists> + <#if partyContactMechValueMap.partyContactMechPurposes?has_content> + <#assign postalAddressFlag = "Y"> + <div id="displayEditAddressForm_${contactMech.contactMechId}" class="popup" style="display: none;"> + <#include "EditPostalAddress.ftl"/> + </div> + <div class="form-row"> + <div class="form-field"> + <#if showSetShippingPurpose == "N"> + <h3>${uiLabelMap.EcommercePrimary} ${uiLabelMap.OrderShippingAddress}</h3> + <span class="buttontextdisabled">${uiLabelMap.EcommerceIsDefault}</span> + <#else> + <h3>${uiLabelMap.EcommercePrimary} ${uiLabelMap.PartyBillingAddress}</h3> + <span class="buttontextdisabled">${uiLabelMap.EcommerceIsDefault}</span> + </#if> + </div> + </div> + + <#assign postalAddress = partyContactMechValueMap.postalAddress?if_exists> + <#if postalAddress?exists> + <div class="form-row"> + <div class="form-label"></div> + <div class="form-field"> + <div> + ${postalAddress.address1}<br/> + <#if postalAddress.address2?has_content>${postalAddress.address2}<br/></#if> + ${postalAddress.city} + <#if postalAddress.stateProvinceGeoId?has_content>, ${postalAddress.stateProvinceGeoId}</#if> + ${postalAddress.postalCode?if_exists} + <#if postalAddress.countryGeoId?has_content><br/>${postalAddress.countryGeoId}</#if> + <#if (!postalAddress.countryGeoId?has_content || postalAddress.countryGeoId?if_exists = "USA")> + <#assign addr1 = postalAddress.address1?if_exists> + <#if (addr1.indexOf(" ") gt 0)> + <#assign addressNum = addr1.substring(0, addr1.indexOf(" "))> + <#assign addressOther = addr1.substring(addr1.indexOf(" ")+1)> + <a target="_blank" href="${uiLabelMap.EcommerceLookupWhitepagesLink}" class="linktext">(${uiLabelMap.EcommerceLookupWhitepages})</a> + </#if> + </#if> + </div> + </div> + </div> + <div class="form-row"></div> + <span> + <#if showSetShippingPurpose == "N"> + <div class="form-row"> + <#assign pcmps = Static["org.ofbiz.entity.util.EntityUtil"].filterByDate(party.getRelatedByAnd("PartyContactMechPurpose", Static["org.ofbiz.base.util.UtilMisc"].toMap("contactMechPurposeTypeId", "PHONE_SHIPPING")))> + <#if pcmps?has_content> + <#assign pcmp = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(pcmps)/> + <#assign telecomNumber = pcmp.getRelatedOne("TelecomNumber")/> + </#if> + + <#if telecomNumber?has_content> + <#assign pcm = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(telecomNumber.getRelated("PartyContactMech"))/> + <h3>${uiLabelMap.PartyPhoneNumber}</h3> + ${telecomNumber.countryCode?if_exists}- + ${telecomNumber.areaCode?if_exists}- + ${telecomNumber.contactNumber?if_exists}- + ${pcm.extension?if_exists} + </#if> + </div><br/> + <a id="update_${contactMech.contactMechId}" href="javascript:void(0)" class="buttontext popup_link">${uiLabelMap.CommonEdit} ${uiLabelMap.OrderShippingAddress}</a> + <#else> + <div class="form-row"> + <#assign pcmps = Static["org.ofbiz.entity.util.EntityUtil"].filterByDate(party.getRelatedByAnd("PartyContactMechPurpose", Static["org.ofbiz.base.util.UtilMisc"].toMap("contactMechPurposeTypeId", "PHONE_BILLING")))> + <#if pcmps?has_content> + <#assign pcmp = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(pcmps)/> + <#assign telecomNumber = pcmp.getRelatedOne("TelecomNumber")/> + </#if> + + <#if telecomNumber?has_content> + <#assign pcm = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(telecomNumber.getRelated("PartyContactMech"))/> + <h3>${uiLabelMap.PartyPhoneNumber}</h3> + ${telecomNumber.countryCode?if_exists}- + ${telecomNumber.areaCode?if_exists}- + ${telecomNumber.contactNumber?if_exists}- + ${pcm.extension?if_exists} + </#if> + </div><br/> + <a id="update_${contactMech.contactMechId}" href="javascript:void(0)" class="buttontext popup_link">${uiLabelMap.CommonEdit} ${uiLabelMap.PartyBillingAddress}</a> + </#if> + + <div class="form-row"></div> + <a href="<@ofbizUrl>deletePostalAddress?contactMechId=${contactMech.contactMechId}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonDelete}</a> + </span> + <script type="text/javascript"> + new Popup('displayEditAddressForm_${contactMech.contactMechId}','update_${contactMech.contactMechId}', {modal: true, position: 'center', trigger: 'click'}) + </script> + <#else> + <div class="form-row"> + <div class="form-label"> + <h5>${uiLabelMap.PartyPostalInformationNotFound}.</h5> + </div> + </div> + </#if> + <div class="form-row"><hr class="sepbar"/></div> + </#if> + </#if> + </#list> + <#if postalAddressFlag == "N"> + <div class="form-row"> + <div class="form-label"> + <h5>${uiLabelMap.PartyPostalInformationNotFound}.</h5> + </div> + </div> + </#if> + </div> + </div> + + <div class="center right"> + <div class="screenlet-header"> + <div class="boxhead"> ${uiLabelMap.EcommerceAdditional} ${uiLabelMap.CommonAddresses}</div> + </div> + + <div class="screenlet-body"> + <#assign postalAddressFlag = "N"> + <#list partyContactMechValueMaps as partyContactMechValueMap> + <#assign contactMech = partyContactMechValueMap.contactMech?if_exists> + <#if contactMech.contactMechTypeId?if_exists = "POSTAL_ADDRESS"> + <#assign partyContactMech = partyContactMechValueMap.partyContactMech?if_exists> + <#if !(partyContactMechValueMap.partyContactMechPurposes?has_content)> + <#assign postalAddressFlag = "Y"> + <div id="displayEditAddressForm_${contactMech.contactMechId}" class="popup" style="display: none;"> + <#include "EditPostalAddress.ftl"/> + </div> + <#assign postalAddress = partyContactMechValueMap.postalAddress?if_exists> + <#if postalAddress?exists> + <div class="form-row"> + <div class="form-label"></div> + <div class="form-field"> + <div> + ${postalAddress.address1}<br/> + <#if postalAddress.address2?has_content>${postalAddress.address2}<br/></#if> + ${postalAddress.city} + <#if postalAddress.stateProvinceGeoId?has_content>, ${postalAddress.stateProvinceGeoId}</#if> + ${postalAddress.postalCode?if_exists} + <#if postalAddress.countryGeoId?has_content><br/>${postalAddress.countryGeoId}</#if> + <#if (!postalAddress.countryGeoId?has_content || postalAddress.countryGeoId?if_exists = "USA")> + <#assign addr1 = postalAddress.address1?if_exists> + <#if (addr1.indexOf(" ") gt 0)> + <#assign addressNum = addr1.substring(0, addr1.indexOf(" "))> + <#assign addressOther = addr1.substring(addr1.indexOf(" ")+1)> + <a target="_blank" href="#" class="linktext">(${uiLabelMap.EcommerceLookupWhitepages})</a> + </#if> + </#if> + </div> + </div> + </div> + <div class="form-row"> + <span> + <a id="update_${contactMech.contactMechId}" href="javascript:void(0)" class="buttontext popup_link">${uiLabelMap.CommonEdit}</a> + <a href="<@ofbizUrl>deletePostalAddress?contactMechId=${contactMech.contactMechId}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonDelete}</a> + </span> + </div> + <script type="text/javascript"> + new Popup('displayEditAddressForm_${contactMech.contactMechId}','update_${contactMech.contactMechId}', {modal: true, position: 'center', trigger: 'click'}) + </script> + <#else> + <div class="form-row"> + <div class="form-label"> + <h5>${uiLabelMap.PartyPostalInformationNotFound}.</h5> + </div> + </div> + </#if> + <div class="form-row"><hr class="sepbar"/></div> + </#if> + </#if> + </#list> + <#if postalAddressFlag == "N"> + <div class="form-row"> + <div class="form-label"> + <h5>${uiLabelMap.PartyPostalInformationNotFound}.</h5> + </div> + </div> + </#if> + </div> + </div> + <div class="form-row"></div> +</div> \ No newline at end of file Propchange: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ManageAddress.ftl ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ManageAddress.ftl ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ManageAddress.ftl ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/NewCustomer.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/NewCustomer.ftl?rev=688081&view=auto ============================================================================== --- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/NewCustomer.ftl (added) +++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/NewCustomer.ftl Fri Aug 22 06:40:31 2008 @@ -0,0 +1,182 @@ +<#-- +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. +--> + +<div id="form-container"> + <form id="newUserForm" name="newUserForm" method="post" action="<@ofbizUrl>createCustomerProfile</@ofbizUrl>"> + <input type="hidden" name="roleTypeId" value="CUSTOMER"/> + <input type="hidden" name="emailContactMechPurposeTypeId" value="PRIMARY_EMAIL"/> + <#assign productStoreId = Static["org.ofbiz.product.store.ProductStoreWorker"].getProductStoreId(request)/> + <input type="hidden" name="productStoreId" value="${productStoreId?if_exists}"/> + + <div><h1>${uiLabelMap.PartyRequestNewAccount}</h1></div> + + <div class="left center"> + <div class="screenlet-header"><div class='boxhead'> ${uiLabelMap.PartyContactInformation}</div></div> + <div class="form-row"> + <div class="field-label"><label for="firstName">${uiLabelMap.PartyFirstName}*<span id="advice-required-firstName" style="display: none" class="errorMessage">(required)</span></label></div> + <div class="field-widget"><input type="text" name="firstName" id="firstName" class="inputBox required" value="${parameters.firstName?if_exists}" size="30" maxlength="30"></div> + </div> + <div class="form-row"> + <div class="field-label"><label for="lastName">${uiLabelMap.PartyLastName}*<span id="advice-required-lastName" style="display: none" class="errorMessage">(required)</span></label></div> + <div class="field-widget"><input type="text" name="lastName" id="lastName" class="inputBox required" value="${parameters.lastName?if_exists}" size="30" maxlength="30"></div> + </div> + <div class="form-row"> + <div class="field-label"><label for="emailAddress">${uiLabelMap.PartyEmailAddress}*<span id="advice-required-emailAddress" style="display: none" class="errorMessage">(required)</span></label></div> + <div class="field-widget"><input type="text" class="inputBox required" name="emailAddress" id="emailAddress" value="${parameters.emailAddress?if_exists}" size="30" maxlength="255"/></div> + </div> + </div> + + <div class="center right"> + <div class="screenlet-header"><div class='boxhead'> ${uiLabelMap.AccountInformation}</div></div> + <div id="userNameAndPasswordPanel"> + <div class="form-row"> + <div class="field-label"><label for="userName">${uiLabelMap.CommonUsername}*<span id="advice-required-username" style="display: none" class="errorMessage">(required)</span></label></div> + <div class="field-widget"><input type="text" name="username" id="username" class="inputBox required" value="${parameters.username?if_exists}" size="30" maxlength="255"></div> + </div> + <div class="form-row"> + <div class="field-label"><label for="password">${uiLabelMap.CommonPassword}*<span id="advice-required-password" style="display: none" class="errorMessage">(required)</span></label></div> + <div class="field-widget"><input type="password" name="password" id="password" class="inputBox required" value="${parameters.password?if_exists}" maxlength="16"></div> + </div> + <div class="form-row"> + <div class="field-label"><label for="passwordVerify">${uiLabelMap.CommonConfirm} ${uiLabelMap.CommonPassword}*<span id="advice-required-passwordVerify" style="display: none" class="errorMessage">(required)</span></label></div> + <div class="field-widget"><input type="password" name="passwordVerify" id="passwordVerify" class="inputBox required" value="${parameters.passwordVerify?if_exists}" maxlength="16"></div> + </div> + <div class="form-row"> + <div class="field-label"><label for="currentPassword">${uiLabelMap.FormFieldTitle_passwordHint}</label></div> + <div class="field-widget"><input type="text" name="passwordHint" id="passwordHintId" class="inputBox" value="${parameters.passwordHint?if_exists}" maxlength="16"></div> + </div> + </div> + </div> + + <div class="form-row"><hr class="sepbar"/></div> + <div class="bothclear"></div> + + <div class="left center"> + <div class="screenlet-header"><div class='boxhead'> ${uiLabelMap.OrderShippingInformation}</div></div> + <div class="form-row"> + <div class="field-label"><label for="shipToAddress1">${uiLabelMap.PartyAddressLine1}*<span id="advice-required-shipToAddress1" style="display: none" class="errorMessage">(required)</span></label></div> + <div class="field-widget"><input type="text" name="shipToAddress1" id="shipToAddress1" class="inputBox required" value="${parameters.shipToAddress1?if_exists}"/></div> + </div> + <div class="form-row"> + <div class="field-label"><label for="shipToAddress2">${uiLabelMap.PartyAddressLine2}</label></div> + <div class="field-widget"><input type="text" name="shipToAddress2" id="shipToAddress2" class="inputBox" value="${parameters.shipToAddress2?if_exists}"/></div> + </div> + <div class="form-row"> + <div class="field-label"><label for="shipToCity">${uiLabelMap.CommonCity}*<span id="advice-required-shipToCity" style="display: none" class="errorMessage">(required)</span></label></div> + <div class="field-widget"><input type="text" name="shipToCity" id="shipToCity" class="inputBox required" value="${parameters.shipToCity?if_exists}"/></div> + </div> + <div class="form-row"> + <div class="field-label"><label for="shipToStateProvinceGeoId">${uiLabelMap.CommonState}*<span id="advice-required-shipToStateProvinceGeoId" style="display: none" class="errorMessage">(required)</span></label></div> + <div class="field-widget"> + <select name="shipToStateProvinceGeoId" id="shipToStateProvinceGeoId" class='selectBox'> + <#if parameters.shipToStateProvinceGeoId?exists><option>${parameters.shipToStateProvinceGeoId?if_exists}</option></#if> + ${screens.render("component://common/widget/CommonScreens.xml#states")} + </select> + </div> + </div> + <div class="form-row"> + <div class="field-label"><label for="shipToPostalCode">${uiLabelMap.PartyZipCode}*<span id="advice-required-shipToPostalCode" style="display: none" class="errorMessage">(required)</span></label></div> + <div class="field-widget"><input type="text" name="shipToPostalCode" id="shipToPostalCode" class="inputBox required" value="${parameters.shipToPostalCode?if_exists}"/></div> + </div> + <div class="form-row"> + <div class="field-label"><label for="shipToCountryGeoId">${uiLabelMap.PartyCountry}*<span id="advice-required-shipToCountryGeoId" style="display: none" class="errorMessage">(required)</span></label></div> + <div class="field-widget"> + <select name="shipToCountryGeoId" id="shipToCountryGeoId" class='selectBox'> + <#if parameters.shipToCountryGeoId?exists><option>${parameters.shipToCountryGeoId?if_exists}</option></#if> + ${screens.render("component://common/widget/CommonScreens.xml#countries")} + </select> + </div> + </div> + <div class="form-row"> + <div class="field-label"> + <label for="shipToCountryCode">${uiLabelMap.PartyCountry}<span>*</span><span id="advice-required-shipToCountryCode" style="display:none" class="errorMessage">(required)</span></label> + <label for="shipToAreaCode">${uiLabelMap.PartyAreaCode}<span>*</span><span id="advice-required-shipToAreaCode" style="display:none" class="errorMessage">(required)</span></label> + <label for="shipToContactNumber">${uiLabelMap.PartyContactNumber}<span>*</span><span id="advice-required-shipToContactNumber" style="display:none" class="errorMessage">(required)</span></label> + <label for="shipToExtension">${uiLabelMap.PartyExtension}</label> + </div> + <div class="field-widget"> + <input type="text" name="shipToCountryCode" id="shipToCountryCode" class="inputBox required" value="${parameters.countryCode?if_exists}" size="3" maxlength="3"/> + - <input type="text" name="shipToAreaCode" id="shipToAreaCode" class="inputBox required" value="${parameters.areaCode?if_exists}" size="3" maxlength="3"/> + - <input type="text" name="shipToContactNumber" id="shipToContactNumber" class="inputBox required" value="${contactNumber?default("${parameters.contactNumber?if_exists}")}" size="6" maxlength="7"/> + - <input type="text" name="shipToExtension" id="shipToExtension" class="inputBox" value="${extension?default("${parameters.extension?if_exists}")}" size="3" maxlength="3"/> + </div> + </div> + <div class="form-row"> + <div class="field-widget"><input type="checkbox" class="checkbox" name="useShippingAddressForBilling" id="useShippingAddressForBilling" value="Y" <#if parameters.useShippingAddressForBilling?has_content && parameters.useShippingAddressForBilling?default("")=="Y">checked</#if>/> ${uiLabelMap.FacilityBillingAddressSameShipping}</div> + </div> + </div> + + <div class="center right"> + <div class="screenlet-header"><div class='boxhead'> ${uiLabelMap.PageTitleBillingInformation}</div></div> + <div id="billingAddress"> + <div class="form-row"> + <div class="field-label"><label for="billToAddress1">${uiLabelMap.PartyAddressLine1}*<span id="advice-required-billToAddress1" style="display: none" class="errorMessage">(required)</span></label></div> + <div class="field-widget"><input type="text" name="billToAddress1" id="billToAddress1" class="inputBox required" value="${parameters.billToAddress1?if_exists}"/></div> + </div> + <div class="form-row"> + <div class="field-label"><label for="billToAddress2">${uiLabelMap.PartyAddressLine2}</label></div> + <div class="field-widget"><input type="text" name="billToAddress2" id="billToAddress2" class="inputBox" value="${parameters.billToAddress2?if_exists}"/></div> + </div> + <div class="form-row"> + <div class="field-label"><label for="billToCity">${uiLabelMap.CommonCity}*<span id="advice-required-billToCity" style="display: none" class="errorMessage">(required)</span></label></div> + <div class="field-widget"><input type="text" name="billToCity" id="billToCity" class="inputBox required" value="${parameters.billToCity?if_exists}"/></div> + </div> + <div class="form-row"> + <div class="field-label"><label for="billToStateProvinceGeoId">${uiLabelMap.CommonState}*<span id="advice-required-billToStateProvinceGeoId" style="display: none" class="errorMessage">(required)</span></label></div> + <div class="field-widget"> + <select name="billToStateProvinceGeoId" id="billToStateProvinceGeoId" class="selectBox required"> + <#if parameters.billToStateProvinceGeoId?exists><option>${parameters.billToStateProvinceGeoId?if_exists}</option></#if> + ${screens.render("component://common/widget/CommonScreens.xml#states")} + </select> + </div> + </div> + <div class="form-row"> + <div class="field-label"><label for="billToPostalCode">${uiLabelMap.PartyZipCode}*<span id="advice-required-billToPostalCode" style="display: none" class="errorMessage">(required)</span></label></div> + <div class="field-widget"><input type="text" name="billToPostalCode" id="billToPostalCode" class="inputBox required" value="${parameters.billToPostalCode?if_exists}"/></div> + </div> + <div class="form-row"> + <div class="field-label"><label for="billToCountryGeoId">${uiLabelMap.PartyCountry}*<span id="advice-required-billToCountryGeoId" style="display: none" class="errorMessage">(required)</span></label></div> + <div class="field-widget"> + <select name="billToCountryGeoId" id="billToCountryGeoId" class="selectBox required"> + <#if parameters.billToCountryGeoId?exists><option>${parameters.billToCountryGeoId?if_exists}</option></#if> + ${screens.render("component://common/widget/CommonScreens.xml#countries")} + </select> + </div> + </div> + <div class="form-row"> + <div class="field-label"> + <label for="billToCountryCode">${uiLabelMap.PartyCountry}<span>*</span><span id="advice-required-billToCountryCode" style="display:none" class="errorMessage">(required)</span></label> + <label for="billToAreaCode">${uiLabelMap.PartyAreaCode}<span>*</span><span id="advice-required-billToAreaCode" style="display:none" class="errorMessage">(required)</span></label> + <label for="billToContactNumber">${uiLabelMap.PartyContactNumber}<span>*</span><span id="advice-required-billToContactNumber" style="display:none" class="errorMessage">(required)</span></label> + <label for="billToExtension">${uiLabelMap.PartyExtension}</label> + </div> + <div class="field-widget"> + <input type="text" name="billToCountryCode" id="billToCountryCode" class="inputBox required" value="${parameters.countryCode?if_exists}" size="3" maxlength="3"/> + - <input type="text" name="billToAreaCode" id="billToAreaCode" class="inputBox required" value="${parameters.areaCode?if_exists}" size="3" maxlength="3"/> + - <input type="text" name="billToContactNumber" id="billToContactNumber" class="inputBox required" value="${contactNumber?default("${parameters.contactNumber?if_exists}")}" size="6" maxlength="7"/> + - <input type="text" name="billToExtension" id="billToExtension" class="inputBox" value="${extension?default("${parameters.extension?if_exists}")}" size="3" maxlength="3"/> + </div> + </div> + </div> + </div> + + <div class="bothclear"></div> + <div class="form-row"> <a id="submitNewUserForm" href="javascript:void(0);" class="buttontext">${uiLabelMap.CommonSave}</a></div> + </form> +</div> \ No newline at end of file Propchange: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/NewCustomer.ftl ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/NewCustomer.ftl ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/NewCustomer.ftl ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ViewProfile.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ViewProfile.ftl?rev=688081&view=auto ============================================================================== --- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ViewProfile.ftl (added) +++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ViewProfile.ftl Fri Aug 22 06:40:31 2008 @@ -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. +--> + +<div class="screenlet"> + <div class="screenlet-header"> + <div class="boxhead"> ${uiLabelMap.EcommerceMyAccount}</div> + </div> + <div class="screenlet-body"> + <div align="right"><a class="buttontext" href="<@ofbizUrl>editProfile</@ofbizUrl>">${uiLabelMap.CommonEdit} ${uiLabelMap.CommonProfile}</a> </div><br/> + <div class="screenlet-header"><div class="boxhead"> ${uiLabelMap.PartyContactInformation}</div></div> + <div class="screenlet-body"> + <div class="tabletext"><h3>${uiLabelMap.PartyName}</h3></div> + <div class="form-row">${parameters.firstName?if_exists} ${parameters.lastName?if_exists}</div> + + <#assign emailContactMech = delegator.findOne("ContactMech", Static["org.ofbiz.base.util.UtilMisc"].toMap("contactMechId", parameters.emailContactMechId), true)> + <#assign emailContactMechType = emailContactMech.getRelatedOneCache("ContactMechType")> + + <div class="tabletext"><h3>${emailContactMechType.description?if_exists}</h3></div> + <div class="form-row"> + <input type="hidden" id="updatedEmailContactMechId" name="emailContactMechId" value="${parameters.emailContactMechId}"> + <input type="hidden" id="updatedEmailAddress" name="updatedEmailAddress" value="${parameters.emailAddress}"> + <div class="form-field" id="emailAddress">${parameters.emailAddress}</div> + <a href="mailto:${parameters.emailAddress}" class="linktext">(${uiLabelMap.PartySendEmail})</a> + </div> + <div class="form-row"><div id="serverError_${parameters.emailContactMechId}" class="errorMessage"></div></div> + </div> + + <#-- Manage Addresses --> + <div class="screenlet-header"><div class='boxhead'> ${uiLabelMap.EcommerceAddressBook}</div></div> + <div class="screenlet-body"> + <div align="right"><a class="buttontext" href="<@ofbizUrl>manageAddress</@ofbizUrl>">${uiLabelMap.EcommerceManage} ${uiLabelMap.CommonAddresses}</a> </div> + <div class="left center"> + <div class="screenlet-body"> + <h3>${uiLabelMap.OrderShippingAddress}</h3> + <#if parameters.shipToContactMechId?exists> + ${parameters.shipToAddress1?if_exists}<br/> + ${parameters.shipToAddress2?if_exists}<br/> + ${parameters.shipToCity?if_exists}, + ${parameters.shipToStateProvinceGeoId?if_exists} + ${parameters.shipToPostalCode?if_exists}<br/> + ${parameters.shipToCountryGeoId?if_exists}<br/> + <#assign pcmps = Static["org.ofbiz.entity.util.EntityUtil"].filterByDate(party.getRelatedByAnd("PartyContactMechPurpose", Static["org.ofbiz.base.util.UtilMisc"].toMap("contactMechPurposeTypeId", "PHONE_SHIPPING")))> + <#if pcmps?has_content> + <#assign pcmp = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(pcmps)/> + <#assign telecomNumber = pcmp.getRelatedOne("TelecomNumber")/> + </#if> + <#if telecomNumber?has_content> + <#assign pcm = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(telecomNumber.getRelated("PartyContactMech"))/> + <h3>${uiLabelMap.PartyPhoneNumber}</h3> + ${telecomNumber.countryCode?if_exists}- + ${telecomNumber.areaCode?if_exists}- + ${telecomNumber.contactNumber?if_exists}- + ${pcm.extension?if_exists} + </#if> + <#else> + ${uiLabelMap.OrderShippingAddress} ${uiLabelMap.EcommerceNotExists} + </#if> + </div> + </div> + + <div class="center right"> + <div class="screenlet-body"> + <h3>${uiLabelMap.PartyBillingAddress}</h3> + <#if parameters.billToContactMechId?exists> + ${parameters.billToAddress1?if_exists}<br/> + ${parameters.billToAddress2?if_exists}<br/> + ${parameters.billToCity?if_exists}, + ${parameters.billToStateProvinceGeoId?if_exists} + ${parameters.billToPostalCode?if_exists}<br/> + ${parameters.billToCountryGeoId?if_exists}<br/> + <#assign pcmps = Static["org.ofbiz.entity.util.EntityUtil"].filterByDate(party.getRelatedByAnd("PartyContactMechPurpose", Static["org.ofbiz.base.util.UtilMisc"].toMap("contactMechPurposeTypeId", "PHONE_BILLING")))> + <#if pcmps?has_content> + <#assign pcmp = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(pcmps)/> + <#assign telecomNumber = pcmp.getRelatedOne("TelecomNumber")/> + </#if> + <#if telecomNumber?has_content> + <#assign pcm = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(telecomNumber.getRelated("PartyContactMech"))/> + <h3>${uiLabelMap.PartyPhoneNumber}</h3> + ${telecomNumber.countryCode?if_exists}- + ${telecomNumber.areaCode?if_exists}- + ${telecomNumber.contactNumber?if_exists}- + ${pcm.extension?if_exists} + </#if> + <#else> + ${uiLabelMap.PartyBillingAddress} ${uiLabelMap.EcommerceNotExists} + </#if> + </div> + </div> + </div> + <div class="form-row"></div> + </div> +</div> \ No newline at end of file Propchange: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ViewProfile.ftl ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ViewProfile.ftl ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ViewProfile.ftl ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/profile.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/profile.js?rev=688081&view=auto ============================================================================== --- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/profile.js (added) +++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/profile.js Fri Aug 22 06:40:31 2008 @@ -0,0 +1,169 @@ +var validateNewUser = null; +var validateEditUser = null; +var validatePostalAddress = null; +Event.observe(window, 'load', function() { + if ($('newUserForm')) { + validateNewUser = new Validation('newUserForm', {immediate: true, onSubmit: false}); + Event.observe($('emailAddress'), 'blur', setUserNameFromEmail); + Event.observe('useShippingAddressForBilling', 'click', useShippingAddressAsBillingToggle); + Event.observe($('submitNewUserForm'), 'click', submitValidNewUser); + } + if ($('editUserForm')) { + validateEditUser = new Validation('editUserForm', {immediate: true, onSubmit: false}); + Event.observe($('submitEditUserForm'), 'click', submitValidEditUser); + } + if ($('emailAddress')) { + inPlaceEditEmail('emailAddress'); + } + if ($('addAddress')) { + validatePostalAddress = new Validation('createPostalAddressForm', {immediate: true, onSubmit: false}); + } + if ($('submitPostalAddressForm')) { + Event.observe($('submitPostalAddressForm'), 'click', submitValidPostalAddress); + } +}); + +function submitValidNewUser() { + if (validateNewUser.validate()) { + $('newUserForm').submit(); + } +} + +function submitValidEditUser() { + if (validateEditUser.validate()) { + $('editUserForm').submit(); + } +} + +function submitValidPostalAddress() { + if (validatePostalAddress.validate()) { + $('createPostalAddressForm').submit(); + } +} + +function setUserNameFromEmail() { + if ($('username').value == "") { + $('username').value = $F('emailAddress'); + } +} + +function useShippingAddressAsBillingToggle() { + if ($('useShippingAddressForBilling').checked) { + $('billToAddress1').value = $F('shipToAddress1'); + $('billToAddress2').value = $F('shipToAddress2'); + $('billToCity').value = $F('shipToCity'); + $('billToCountryGeoId').value = $F('shipToCountryGeoId'); + $('billToStateProvinceGeoId').value = $F('shipToStateProvinceGeoId'); + $('billToPostalCode').value = $F('shipToPostalCode'); + $('billToCountryCode').value = $F('shipToCountryCode'); + $('billToAreaCode').value = $F('shipToAreaCode'); + $('billToContactNumber').value = $F('shipToContactNumber'); + $('billToExtension').value = $F('shipToExtension'); + Effect.BlindUp($('billingAddress'), {duration: 0.3}); + } else { + Effect.BlindDown($('billingAddress'), {duration: 0.3}); + } +} + +function getServerError(data) { + var serverErrorHash = []; + var serverError = ""; + if (data._ERROR_MESSAGE_LIST_ != undefined) { + serverErrorHash = data._ERROR_MESSAGE_LIST_; + + serverErrorHash.each(function(error) { + if (error.message != undefined) { + serverError += error.message; + } + }); + if (serverError == "") { + serverError = serverErrorHash; + } + } + if (data._ERROR_MESSAGE_ != undefined) { + serverError += data._ERROR_MESSAGE_; + } + return serverError; +} + +function inPlaceEditEmail(e) { + if ($('updatedEmailContactMechId')) { + var url = 'updatePartyEmailAddress?emailContactMechId='+ $('updatedEmailContactMechId').value; + var errorId = 'serverError_' + $('updatedEmailContactMechId').value; + var oldEmailAddress = $('updatedEmailAddress').value; + var editor = new Ajax.InPlaceEditor(e, url, {clickToEditText: 'click here to change your email', paramName: 'emailAddress', htmlResponse: false, updateAfterRequestCall: true, + onComplete: function (transport) { + if (transport != undefined) { + var data = transport.responseText.evalJSON(true); + var serverError = getServerError(data); + if (serverError != "") { + Effect.Appear(errorId); + $(errorId).update(serverError); + $('emailAddress').update(oldEmailAddress); + } else { + Effect.Fade(errorId); + if (data.emailContactMechId != undefined) { + $('updatedEmailContactMechId').value = data.emailContactMechId; + $('updatedEmailAddress').value = data.emailContactMech.infoString; + } else { + $('emailAddress').update(oldEmailAddress); + } + inPlaceEditEmail('emailAddress'); + editor.dispose(); + } + } + } + }); + } +} + +function createPartyPostalAddress(e) { + formId = 'createPostalAddressForm'; + var validateEditPostalAddress = new Validation(formId, {immediate: true, onSubmit: false}); + errorId = 'serverError'; + popupId = 'displayCreateAddressForm'; + if (validateEditPostalAddress.validate()) { + new Ajax.Request('createPartyPostalAddress', { + asynchronous: false, + onSuccess: function(transport) { + var data = transport.responseText.evalJSON(true); + var serverError = getServerError(data); + if (serverError != "") { + Effect.Appear(errorId); + Effect.Appear(popupId); + $(errorId).update(serverError); + } else { + Effect.Fade(popupId); + Effect.Fade(errorId); + $('refreshRequestForm').submit(); + } + }, parameters: $(formId).serialize(), requestHeaders: {Accept: 'application/json'} + }); + } +} + +function updatePartyPostalAddress(e) { + contactMechId = e.split('_')[1]; + formId = 'editPostalAddress_' + contactMechId; + var validateEditPostalAddress = new Validation(formId, {immediate: true, onSubmit: false}); + errorId = 'serverError_' + contactMechId; + popupId = 'displayEditAddressForm_' + contactMechId; + if (validateEditPostalAddress.validate()) { + new Ajax.Request('updatePartyPostalAddress', { + asynchronous: false, + onSuccess: function(transport) { + var data = transport.responseText.evalJSON(true); + var serverError = getServerError(data); + if (serverError != "") { + Effect.Appear(errorId); + Effect.Appear(popupId); + $(errorId).update(serverError); + } else { + Effect.Fade(popupId); + Effect.Fade(errorId); + $('refreshRequestForm').submit(); + } + }, parameters: $(formId).serialize(), requestHeaders: {Accept: 'application/json'} + }); + } +} \ No newline at end of file Propchange: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/profile.js ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/profile.js ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/profile.js ------------------------------------------------------------------------------ svn:mime-type = text/plain |
Free forum by Nabble | Edit this page |