You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by mo...@apache.org on 2008/08/22 15:40:32 UTC

svn commit: r688081 [2/2] - in /ofbiz/trunk/applications: ecommerce/config/ ecommerce/script/org/ofbiz/ecommerce/customer/ ecommerce/webapp/ecommerce/WEB-INF/ ecommerce/webapp/ecommerce/customer/profile/ ecommerce/webapp/ecommerce/images/ ecommerce/wid...

Modified: ofbiz/trunk/applications/ecommerce/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/widget/CommonScreens.xml?rev=688081&r1=688080&r2=688081&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/widget/CommonScreens.xml (original)
+++ ofbiz/trunk/applications/ecommerce/widget/CommonScreens.xml Fri Aug 22 06:40:31 2008
@@ -42,9 +42,9 @@
                 <set field="layoutSettings.javaScripts[]" value="/images/fieldlookup.js" global="true"/>
                 <set field="layoutSettings.javaScripts[]" value="/images/selectall.js" global="true"/>
                 <set field="layoutSettings.javaScripts[]" value="/images/calendar_date_select.js" global="true"/>
+                <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/effects.js" global="true"/>
                 <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/validation.js" global="true"/>
                 <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/prototype.js" global="true"/> 
-                <set field="layoutSettings.javaScripts[]" value="/images/prototypejs/effects.js" global="true"/>
                 <set field="layoutSettings.javaScripts[]" value="/images/prototypejs/popup.js" global="true"/> 
 
                 <set field="layoutSettings.extraHead" value="&lt;link rel=&quot;stylesheet&quot; href=&quot;/content/images/contentForum.css&quot; type=&quot;text/css&quot;/&gt;" global="true"/>

Modified: ofbiz/trunk/applications/ecommerce/widget/CustomerScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/widget/CustomerScreens.xml?rev=688081&r1=688080&r2=688081&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/widget/CustomerScreens.xml (original)
+++ ofbiz/trunk/applications/ecommerce/widget/CustomerScreens.xml Fri Aug 22 06:40:31 2008
@@ -517,4 +517,88 @@
         </section>
     </screen>
 
+    <!--screen name="newcustomer">
+        <section>
+            <actions>
+                <property-map resource="MarketingUiLabels" map-name="uiLabelMap" global="true"/>
+                <set field="titleProperty" value="PageTitleNewCustomer"/>
+                <set field="layoutSettings.javaScripts[]" value="/ecommerce/images/profile.js" global="true"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <platform-specific><html><html-template location="component://ecommerce/webapp/ecommerce/customer/profile/NewCustomer.ftl"/></html></platform-specific>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+
+    <screen name="viewprofile">
+        <section>
+            <actions>
+                <set field="titleProperty" value="PageTitleViewProfile"/>
+                <set field="partyId" from-field="userLogin.partyId"/>
+                <entity-one entity-name="Party" value-name="party"/>
+                <entity-one entity-name="Person" value-name="person"/>
+                <entity-one entity-name="PartyGroup" value-name="partyGroup"/>
+    
+                <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/controls.js" global="true"/>
+                <set field="layoutSettings.javaScripts[]" value="/ecommerce/images/profile.js" global="true"/>
+                <script location="component://ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditShippingAddress.groovy"/>
+                <script location="component://ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditBillingAddress.groovy"/>
+                <script location="component://ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditEmailAndTelecomNumber.groovy"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <platform-specific><html><html-template location="component://ecommerce/webapp/ecommerce/customer/profile/ViewProfile.ftl"/></html></platform-specific>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen-->
+
+    <screen name="EditProfile">
+        <section>
+            <actions>
+                <property-map resource="MarketingUiLabels" map-name="uiLabelMap" global="true"/>
+                <set field="titleProperty" value="PageTitleNewCustomer"/>
+                <set field="layoutSettings.javaScripts[]" value="/ecommerce/images/profile.js" global="true"/>
+                <script location="component://ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditShippingAddress.groovy"/>
+                <script location="component://ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditEmailAndTelecomNumber.groovy"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <platform-specific><html><html-template location="component://ecommerce/webapp/ecommerce/customer/profile/EditProfile.ftl"/></html></platform-specific>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+
+    <screen name="ManageAddress">
+        <section>
+            <actions>
+                <set field="titleProperty" value="PageTitleViewProfile"/>
+                <set field="partyId" from-field="userLogin.partyId"/>
+                <entity-one entity-name="Party" value-name="party"/>
+                <entity-one entity-name="Person" value-name="person"/>
+                <entity-one entity-name="PartyGroup" value-name="partyGroup"/>
+
+                <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/controls.js" global="true"/>
+                <set field="layoutSettings.javaScripts[]" value="/ecommerce/images/profile.js" global="true"/>
+                <script location="component://ecommerce/webapp/ecommerce/WEB-INF/actions/customer/ViewProfile.groovy"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <platform-specific><html><html-template location="component://ecommerce/webapp/ecommerce/customer/profile/ManageAddress.ftl"/></html></platform-specific>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+
 </screens>

Modified: ofbiz/trunk/applications/party/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/entitydef/entitymodel.xml?rev=688081&r1=688080&r2=688081&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/applications/party/entitydef/entitymodel.xml Fri Aug 22 06:40:31 2008
@@ -2081,6 +2081,7 @@
       <field name="partyId" type="id-ne"></field>
       <field name="productStoreId" type="id-ne"></field>
       <field name="defaultShipAddr" type="id"></field>
+      <field name="defaultBillAddr" type="id"></field>
       <field name="defaultPayMeth" type="id"></field>
       <field name="defaultShipMeth" type="id"></field>
       <prim-key field="partyId"/>

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=688081&r1=688080&r2=688081&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 22 06:40:31 2008
@@ -311,4 +311,160 @@
         </if-not-empty>
         
     </simple-method>
-</simple-methods>
+    
+    <simple-method method-name="createPostalAddressAndPurposes" short-description="Create postal address, purposes and set them defaults" login-required="false">
+        <call-service service-name="createPartyPostalAddress" in-map-name="parameters">
+            <result-to-field result-name="contactMechId" field-name="parameters.contactMechId"/>
+            <result-to-result result-name="contactMechId"/>
+        </call-service>
+        <if>
+            <condition>
+                <or>
+                    <not><if-empty field="parameters.setShippingPurpose"/></not>
+                    <not><if-empty field="parameters.setBillingPurpose"/></not>
+                </or>
+            </condition>
+            <then>
+                <set-service-fields service-name="createPartyContactMechPurpose" map-name="parameters" to-map-name="serviceContext"/>
+                <set field="serviceContext.partyId" from-field="userLogin.partyId"/>
+                <if-compare field="parameters.setShippingPurpose" operator="equals" value="Y">
+                    <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 entry-name="pcmp" list-name="pcmpList"/>
+                        <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"/>
+                    
+                    <set-service-fields service-name="setPartyProfileDefaults" map-name="parameters" to-map-name="partyProfileDefaultsCtx"/>
+                    <set field="partyProfileDefaultsCtx.defaultShipAddr" from-field="parameters.contactMechId"/>
+                    <set field="partyProfileDefaultsCtx.partyId" from-field="userLogin.partyId"/>
+                    <call-service service-name="setPartyProfileDefaults" in-map-name="partyProfileDefaultsCtx"/>
+                </if-compare>
+                <if-compare field="parameters.setBillingPurpose" operator="equals" value="Y">
+                    <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 entry-name="pcmp" list-name="pcmpList"/>
+                        <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"/>
+                    
+                    <set-service-fields service-name="setPartyProfileDefaults" map-name="parameters" to-map-name="partyProfileDefaultsCtx"/>
+                    <set field="partyProfileDefaultsCtx.defaultBillAddr" from-field="parameters.contactMechId"/>
+                    <set field="partyProfileDefaultsCtx.partyId" from-field="userLogin.partyId"/>
+                    <call-service service-name="setPartyProfileDefaults" in-map-name="partyProfileDefaultsCtx"/>
+                </if-compare>
+            </then>
+        </if>
+    </simple-method>
+
+    <simple-method method-name="updatePostalAddressAndPurposes" short-description="Update postal address, purposes and set them defaults" login-required="false">
+        <call-service service-name="updatePartyPostalAddress" in-map-name="parameters">
+            <result-to-field result-name="contactMechId" field-name="parameters.contactMechId"/>
+            <result-to-result result-name="contactMechId"/>
+        </call-service>
+        <if>
+            <condition>
+                <or>
+                    <not><if-empty field="parameters.setShippingPurpose"/></not>
+                    <not><if-empty field="parameters.setBillingPurpose"/></not>
+                </or>
+            </condition>
+            <then>
+                <set-service-fields service-name="createPartyContactMechPurpose" map-name="parameters" to-map-name="serviceContext"/>
+                <set field="serviceContext.partyId" from-field="userLogin.partyId"/>
+                <if-compare field="parameters.setShippingPurpose" operator="equals" value="Y">
+                    <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 entry-name="pcmp" list-name="pcmpList"/>
+                        <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"/>
+
+                    <set-service-fields service-name="setPartyProfileDefaults" map-name="parameters" to-map-name="partyProfileDefaultsCtx"/>
+                    <set field="partyProfileDefaultsCtx.defaultShipAddr" from-field="parameters.contactMechId"/>
+                    <set field="partyProfileDefaultsCtx.partyId" from-field="userLogin.partyId"/>
+                    <call-service service-name="setPartyProfileDefaults" in-map-name="partyProfileDefaultsCtx"/>
+                </if-compare>
+                <if-compare field="parameters.setBillingPurpose" operator="equals" value="Y">
+                    <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 entry-name="pcmp" list-name="pcmpList"/>
+                        <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"/>
+
+                    <set-service-fields service-name="setPartyProfileDefaults" map-name="parameters" to-map-name="partyProfileDefaultsCtx"/>
+                    <set field="partyProfileDefaultsCtx.defaultBillAddr" from-field="parameters.contactMechId"/>
+                    <set field="partyProfileDefaultsCtx.partyId" from-field="userLogin.partyId"/>
+                    <call-service service-name="setPartyProfileDefaults" in-map-name="partyProfileDefaultsCtx"/>
+                </if-compare>
+            </then>
+        </if>
+    </simple-method>
+
+    <simple-method method-name="updateContactMechAndPurposes" short-description="Update postal address, telecom number and purposes">
+        <set-service-fields service-name="updatePostalAddressAndPurposes" map-name="parameters" to-map-name="updatePostalAddressAndPurposesCtx"/>
+        <call-service service-name="updatePostalAddressAndPurposes" in-map-name="updatePostalAddressAndPurposesCtx"/>
+
+        <if-not-empty field="parameters.phoneContactMechId">
+            <set field="parameters.contactMechId" from-field="parameters.phoneContactMechId"/>
+            <set-service-fields service-name="updatePartyTelecomNumber" map-name="parameters" to-map-name="updatePartyTelecomNumberCtx"/>
+            <call-service service-name="updatePartyTelecomNumber" in-map-name="updatePartyTelecomNumberCtx">
+                <result-to-field result-name="contactMechId" field-name="parameters.contactMechId"/>
+            </call-service>
+            <set-service-fields service-name="createPartyContactMechPurpose" map-name="parameters" to-map-name="serviceContext"/>
+            <set field="serviceContext.partyId" from-field="userLogin.partyId"/>
+            <if-compare field="parameters.setShippingPurpose" operator="equals" value="Y">
+                <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 entry-name="pcmp" list-name="pcmpList"/>
+                    <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"/>
+            </if-compare>
+
+            <if-compare field="parameters.setBillingPurpose" operator="equals" value="Y">
+                <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 entry-name="pcmp" list-name="pcmpList"/>
+                    <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-compare>
+        </if-not-empty>
+    </simple-method>
+</simple-methods>
\ No newline at end of file

Modified: ofbiz/trunk/applications/party/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/servicedef/services.xml?rev=688081&r1=688080&r2=688081&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/party/servicedef/services.xml Fri Aug 22 06:40:31 2008
@@ -194,6 +194,7 @@
         <attribute name="productStoreId" type="String" mode="IN" optional="false"/>
         <attribute name="partyId" type="String" mode="IN" optional="true"/>
         <attribute name="defaultShipAddr" type="String" mode="IN" optional="true"/>
+        <attribute name="defaultBillAddr" type="String" mode="IN" optional="true"/>
         <attribute name="defaultPayMeth" type="String" mode="IN" optional="true"/>
         <attribute name="defaultShipMeth" type="String" mode="IN" optional="true"/>
     </service>
@@ -1047,4 +1048,24 @@
         <attribute name="partyIdFrom" type="String" mode="IN" optional="true"/>
         <attribute name="partyIdTo" type="String" mode="IN" optional="true"/>
     </service>
+    <service name="createPostalAddressAndPurposes" engine="simple" location="org/ofbiz/party/contact/PartyContactMechServices.xml" invoke="createPostalAddressAndPurposes">
+        <description>Create postal address, purposes and set them defaults</description>
+        <implements service="createPartyPostalAddress"/>
+        <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="updatePostalAddressAndPurposes" engine="simple" location="org/ofbiz/party/contact/PartyContactMechServices.xml" invoke="updatePostalAddressAndPurposes">
+        <description>Update postal address, purposes and set them defaults</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>
+        <implements service="updatePostalAddressAndPurposes"/>
+        <auto-attributes entity-name="TelecomNumber" include="nonpk" mode="IN" optional="true"/>
+        <attribute name="phoneContactMechId" type="String" mode="IN" optional="true"/>
+    </service>
 </services>