svn commit: r789555 - /ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml

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

svn commit: r789555 - /ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml

hansbak-2
Author: hansbak
Date: Tue Jun 30 04:23:53 2009
New Revision: 789555

URL: http://svn.apache.org/viewvc?rev=789555&view=rev
Log:
find primary email address before any other email address

Modified:
    ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml

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=789555&r1=789554&r2=789555&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 Tue Jun 30 04:23:53 2009
@@ -290,7 +290,6 @@
     </simple-method>
 
     <simple-method method-name="findPartyFromEmailAddress" short-description="Find partyId from email address">
-        <set field="input.entityName" value="PartyAndContactMech"/>
         <set field="input.filterByDate" value="Y"/>
         <set field="input.inputFields.infoString" from-field="parameters.address"/>
         <if-empty field="parameters.caseInsensitive">
@@ -303,16 +302,28 @@
         <log level="info" message="findPartyFromEmailAddress with case insensitive search: ${parameters.caseInsensitive}"/>
         
         <if-empty field="parameters.fromDate">
-            <now-timestamp field="input.filterByDateValue"/>
+            <set field="input.filterByDate" value="Y"/>
             <else>
                 <set field="input.filterByDateValue" from-field="parameters.fromDate"/>
             </else>
         </if-empty>
         
+        <!-- try primary email address -->
+        <set field="input.inputFields.contactMechPurposeTypeId" value="PRIMARY_EMAIL"/>
+        <set field="input.entityName" value="PartyContactDetailByPurpose"/>
         <call-service service-name="performFindItem" in-map-name="input">
             <results-to-map map-name="results"/>
         </call-service>
         
+        <!-- any other email address -->
+        <if-empty field="results.item">
+            <set field="input.entityName" value="PartyAndContactMech"/>
+            <clear-field field="input.inputFields.contactMechPurposeTypeId"/>
+            <call-service service-name="performFindItem" in-map-name="input">
+                <results-to-map map-name="results"/>
+            </call-service>
+        </if-empty>        
+        
         <if-not-empty field="results.item">
             <field-to-result field="results.item.partyId" result-name="partyId"/>
             <field-to-result field="results.item.contactMechId" result-name="contactMechId"/>