svn commit: r690150 - in /ofbiz/trunk/applications: ecommerce/webapp/ecommerce/customer/profile/ party/script/org/ofbiz/party/contact/ party/servicedef/

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r690150 - in /ofbiz/trunk/applications: ecommerce/webapp/ecommerce/customer/profile/ party/script/org/ofbiz/party/contact/ party/servicedef/

mor-2
Author: mor
Date: Fri Aug 29 01:35:50 2008
New Revision: 690150

URL: http://svn.apache.org/viewvc?rev=690150&view=rev
Log:
More improvements to new profile and customer pages ..
1) Display client side error message for email in EditProfile.ftl from uilabel.
2) Remove unused code from ViewProfile.ftl.
3) Formated PartyContactMechServices.xml  file.
4) Proper comment for service definition  updatePostalAddressAndPurposes  and updateContactMechAndPurposes.

Thanks to Sumit Pandit, Brajesh Patel and Rishi Solanki for this contribution.


Modified:
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditProfile.ftl
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ViewProfile.ftl
    ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml
    ofbiz/trunk/applications/party/servicedef/services.xml

Modified: 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=690150&r1=690149&r2=690150&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditProfile.ftl (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditProfile.ftl Fri Aug 29 01:35:50 2008
@@ -42,7 +42,7 @@
               <label for="emailAddress">
                 ${uiLabelMap.CommonEmail}*
                 <span id="advice-required-emailAddress" style="display: none" class="errorMessage">(required)</span>
-                <span id="advice-validate-email-emailAddress" class="errorMessage" style="display:none">Please enter a valid email address. For example [hidden email] .</span>
+                <span id="advice-validate-email-emailAddress" class="errorMessage" style="display:none">${uiLabelMap.PartyEmailAddressNotFormattedCorrectly}</span>
               </label>
             </div>
             <div class="form-field"><input type="text" class="required validate-email" name="emailAddress" id="emailAddress" value="${parameters.emailAddress?if_exists}" size="30" maxlength="255"/></div>

Modified: 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=690150&r1=690149&r2=690150&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ViewProfile.ftl (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ViewProfile.ftl Fri Aug 29 01:35:50 2008
@@ -29,9 +29,6 @@
         <div class="form-field">${parameters.firstName?if_exists} ${parameters.lastName?if_exists}</div>
       </div>
 
-      <#assign emailContactMech = delegator.findOne("ContactMech", Static["org.ofbiz.base.util.UtilMisc"].toMap("contactMechId", parameters.emailContactMechId), true)>
-      <#assign emailContactMechType = emailContactMech.getRelatedOneCache("ContactMechType")>
-
       <div class="form-row">
         <input type="hidden" id="updatedEmailContactMechId" name="emailContactMechId" value="${parameters.emailContactMechId}">
         <input type="hidden" id="updatedEmailAddress" name="updatedEmailAddress" value="${parameters.emailAddress}">

Modified: ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml?rev=690150&r1=690149&r2=690150&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml (original)
+++ ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml Fri Aug 29 01:35:50 2008
@@ -430,23 +430,23 @@
                     </entity-and>
                     <!-- If purpose is not exists then create -->
                     <if-empty field="pcmpShipList">
-                    <set-service-fields service-name="createPartyContactMechPurpose" map-name="parameters" to-map-name="serviceContext"/>
-                    <set field="serviceContext.partyId" from-field="userLogin.partyId"/>
+                        <set-service-fields service-name="createPartyContactMechPurpose" map-name="parameters" to-map-name="serviceContext"/>
+                        <set field="serviceContext.partyId" from-field="userLogin.partyId"/>
 
-                    <entity-and entity-name="PartyContactMechPurpose" list-name="pcmpList" filter-by-date="true">
-                        <field-map field-name="partyId" env-name="userLogin.partyId"/>
-                        <field-map field-name="contactMechPurposeTypeId" value="SHIPPING_LOCATION"/>
-                    </entity-and>
-                    <if-not-empty field="pcmpList">
-                        <first-from-list list-name="pcmpList" entry-name="pcmp"/>
-                        <set-service-fields service-name="deletePartyContactMechPurposeIfExists" map-name="pcmp" to-map-name="serviceInMap"/>
-                        <call-service service-name="deletePartyContactMechPurposeIfExists" in-map-name="serviceInMap"/>
-                        <clear-field field-name="serviceInMap"/>
-                    </if-not-empty>
-                    <set field="serviceContext.contactMechPurposeTypeId" value="SHIPPING_LOCATION"/>
-                    <call-service service-name="createPartyContactMechPurpose" in-map-name="serviceContext"/>
-                    <clear-field field-name="pcmpList"/>
-                    <clear-field field-name="serviceContext"/>
+                        <entity-and entity-name="PartyContactMechPurpose" list-name="pcmpList" filter-by-date="true">
+                            <field-map field-name="partyId" env-name="userLogin.partyId"/>
+                            <field-map field-name="contactMechPurposeTypeId" value="SHIPPING_LOCATION"/>
+                        </entity-and>
+                        <if-not-empty field="pcmpList">
+                            <first-from-list list-name="pcmpList" entry-name="pcmp"/>
+                            <set-service-fields service-name="deletePartyContactMechPurposeIfExists" map-name="pcmp" to-map-name="serviceInMap"/>
+                            <call-service service-name="deletePartyContactMechPurposeIfExists" in-map-name="serviceInMap"/>
+                            <clear-field field-name="serviceInMap"/>
+                        </if-not-empty>
+                        <set field="serviceContext.contactMechPurposeTypeId" value="SHIPPING_LOCATION"/>
+                        <call-service service-name="createPartyContactMechPurpose" in-map-name="serviceContext"/>
+                        <clear-field field-name="pcmpList"/>
+                        <clear-field field-name="serviceContext"/>
                     </if-empty>
 
                     <set-service-fields service-name="setPartyProfileDefaults" map-name="parameters" to-map-name="partyProfileDefaultsCtx"/>
@@ -462,20 +462,20 @@
                     </entity-and>
                     <!-- If purpose is not exists then create -->
                     <if-empty field="pcmpBillList">
-                    <set-service-fields service-name="createPartyContactMechPurpose" map-name="parameters" to-map-name="serviceContext"/>
-                    <set field="serviceContext.partyId" from-field="userLogin.partyId"/>
+                        <set-service-fields service-name="createPartyContactMechPurpose" map-name="parameters" to-map-name="serviceContext"/>
+                        <set field="serviceContext.partyId" from-field="userLogin.partyId"/>
 
-                    <entity-and entity-name="PartyContactMechPurpose" list-name="pcmpList" filter-by-date="true">
-                        <field-map field-name="partyId" env-name="userLogin.partyId"/>
-                        <field-map field-name="contactMechPurposeTypeId" value="BILLING_LOCATION"/>
-                    </entity-and>
-                    <if-not-empty field="pcmpList">
-                        <first-from-list list-name="pcmpList" entry-name="pcmp"/>
-                        <set-service-fields service-name="deletePartyContactMechPurposeIfExists" map-name="pcmp" to-map-name="serviceInMap"/>
-                        <call-service service-name="deletePartyContactMechPurposeIfExists" in-map-name="serviceInMap"/>
-                    </if-not-empty>
-                    <set field="serviceContext.contactMechPurposeTypeId" value="BILLING_LOCATION"/>
-                    <call-service service-name="createPartyContactMechPurpose" in-map-name="serviceContext"/>
+                        <entity-and entity-name="PartyContactMechPurpose" list-name="pcmpList" filter-by-date="true">
+                            <field-map field-name="partyId" env-name="userLogin.partyId"/>
+                            <field-map field-name="contactMechPurposeTypeId" value="BILLING_LOCATION"/>
+                        </entity-and>
+                        <if-not-empty field="pcmpList">
+                            <first-from-list list-name="pcmpList" entry-name="pcmp"/>
+                            <set-service-fields service-name="deletePartyContactMechPurposeIfExists" map-name="pcmp" to-map-name="serviceInMap"/>
+                            <call-service service-name="deletePartyContactMechPurposeIfExists" in-map-name="serviceInMap"/>
+                        </if-not-empty>
+                        <set field="serviceContext.contactMechPurposeTypeId" value="BILLING_LOCATION"/>
+                        <call-service service-name="createPartyContactMechPurpose" in-map-name="serviceContext"/>
                     </if-empty>
 
                     <set-service-fields service-name="setPartyProfileDefaults" map-name="parameters" to-map-name="partyProfileDefaultsCtx"/>
@@ -540,23 +540,23 @@
                 </entity-and>
                 <!-- If purpose is not exists then create -->
                 <if-empty field="pcmpShipList">
-                <set-service-fields service-name="createPartyContactMechPurpose" map-name="parameters" to-map-name="serviceContext"/>
-                <set field="serviceContext.partyId" from-field="userLogin.partyId"/>
+                    <set-service-fields service-name="createPartyContactMechPurpose" map-name="parameters" to-map-name="serviceContext"/>
+                    <set field="serviceContext.partyId" from-field="userLogin.partyId"/>
 
-                <entity-and entity-name="PartyContactMechPurpose" list-name="pcmpList" filter-by-date="true">
-                    <field-map field-name="partyId" env-name="userLogin.partyId"/>
-                    <field-map field-name="contactMechPurposeTypeId" value="PHONE_SHIPPING"/>
-                </entity-and>
-                <if-not-empty field="pcmpList">
-                    <first-from-list list-name="pcmpList" entry-name="pcmp"/>
-                    <set-service-fields service-name="deletePartyContactMechPurposeIfExists" map-name="pcmp" to-map-name="serviceInMap"/>
-                    <call-service service-name="deletePartyContactMechPurposeIfExists" in-map-name="serviceInMap"/>
-                    <clear-field field-name="serviceInMap"/>
-                </if-not-empty>
-                <set field="serviceContext.contactMechPurposeTypeId" value="PHONE_SHIPPING"/>
-                <call-service service-name="createPartyContactMechPurpose" in-map-name="serviceContext"/>
-                <clear-field field-name="pcmpList"/>
-                <clear-field field-name="serviceContext"/>
+                    <entity-and entity-name="PartyContactMechPurpose" list-name="pcmpList" filter-by-date="true">
+                        <field-map field-name="partyId" env-name="userLogin.partyId"/>
+                        <field-map field-name="contactMechPurposeTypeId" value="PHONE_SHIPPING"/>
+                    </entity-and>
+                    <if-not-empty field="pcmpList">
+                        <first-from-list list-name="pcmpList" entry-name="pcmp"/>
+                        <set-service-fields service-name="deletePartyContactMechPurposeIfExists" map-name="pcmp" to-map-name="serviceInMap"/>
+                        <call-service service-name="deletePartyContactMechPurposeIfExists" in-map-name="serviceInMap"/>
+                        <clear-field field-name="serviceInMap"/>
+                    </if-not-empty>
+                    <set field="serviceContext.contactMechPurposeTypeId" value="PHONE_SHIPPING"/>
+                    <call-service service-name="createPartyContactMechPurpose" in-map-name="serviceContext"/>
+                    <clear-field field-name="pcmpList"/>
+                    <clear-field field-name="serviceContext"/>
                 </if-empty>
             </if-compare>
 
@@ -568,21 +568,21 @@
                 </entity-and>
                 <!-- If purpose is not exists then create -->
                 <if-empty field="pcmpBillList">
-                <set-service-fields service-name="createPartyContactMechPurpose" map-name="parameters" to-map-name="serviceContext"/>
-                <set field="serviceContext.partyId" from-field="userLogin.partyId"/>
+                    <set-service-fields service-name="createPartyContactMechPurpose" map-name="parameters" to-map-name="serviceContext"/>
+                    <set field="serviceContext.partyId" from-field="userLogin.partyId"/>
 
-                <entity-and entity-name="PartyContactMechPurpose" list-name="pcmpList" filter-by-date="true">
-                    <field-map field-name="partyId" env-name="userLogin.partyId"/>
-                    <field-map field-name="contactMechPurposeTypeId" value="PHONE_BILLING"/>
-                </entity-and>
-                <if-not-empty field="pcmpList">
-                    <first-from-list list-name="pcmpList" entry-name="pcmp"/>
-                    <set-service-fields service-name="deletePartyContactMechPurposeIfExists" map-name="pcmp" to-map-name="serviceInMap"/>
-                    <call-service service-name="deletePartyContactMechPurposeIfExists" in-map-name="serviceInMap"/>
-                    <clear-field field-name="serviceInMap"/>
-                </if-not-empty>
-                <set field="serviceContext.contactMechPurposeTypeId" value="PHONE_BILLING"/>
-                <call-service service-name="createPartyContactMechPurpose" in-map-name="serviceContext"/>
+                    <entity-and entity-name="PartyContactMechPurpose" list-name="pcmpList" filter-by-date="true">
+                        <field-map field-name="partyId" env-name="userLogin.partyId"/>
+                        <field-map field-name="contactMechPurposeTypeId" value="PHONE_BILLING"/>
+                    </entity-and>
+                    <if-not-empty field="pcmpList">
+                        <first-from-list list-name="pcmpList" entry-name="pcmp"/>
+                        <set-service-fields service-name="deletePartyContactMechPurposeIfExists" map-name="pcmp" to-map-name="serviceInMap"/>
+                        <call-service service-name="deletePartyContactMechPurposeIfExists" in-map-name="serviceInMap"/>
+                        <clear-field field-name="serviceInMap"/>
+                    </if-not-empty>
+                    <set field="serviceContext.contactMechPurposeTypeId" value="PHONE_BILLING"/>
+                    <call-service service-name="createPartyContactMechPurpose" in-map-name="serviceContext"/>
                 </if-empty>
             </if-compare>
         </if-not-empty>

Modified: ofbiz/trunk/applications/party/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/servicedef/services.xml?rev=690150&r1=690149&r2=690150&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/party/servicedef/services.xml Fri Aug 29 01:35:50 2008
@@ -1056,14 +1056,14 @@
         <attribute name="productStoreId" type="String" mode="IN" optional="true"/>        
     </service>
     <service name="updatePostalAddressAndPurposes" engine="simple" location="org/ofbiz/party/contact/PartyContactMechServices.xml" invoke="updatePostalAddressAndPurposes">
-        <description>Update postal address, purposes and set them defaults</description>
+        <description>Update postal address, purposes and set them defaults. The setShippingPurpose and setBillingPurpose enable the service to create purposes for PostalAddress and make them default addresses of party</description>
         <implements service="updatePartyPostalAddress"/>
         <attribute name="setShippingPurpose" type="String" mode="IN" optional="true"/>
         <attribute name="setBillingPurpose" type="String" mode="IN" optional="true"/>
         <attribute name="productStoreId" type="String" mode="IN" optional="true"/>        
     </service>
     <service name="updateContactMechAndPurposes" engine="simple" location="org/ofbiz/party/contact/PartyContactMechServices.xml" invoke="updateContactMechAndPurposes">
-        <description>Update postal address, telecom number and purposes</description>
+        <description>Update postal address, telecom number and purposes. The setShippingPurpose and setBillingPurpose enable the service to create purposes for TelecomNumber</description>
         <implements service="updatePostalAddressAndPurposes"/>
         <auto-attributes entity-name="TelecomNumber" include="nonpk" mode="IN" optional="true"/>
         <attribute name="phoneContactMechId" type="String" mode="IN" optional="true"/>