svn commit: r654800 - in /ofbiz/trunk/applications/marketing: script/org/ofbiz/sfa/contact/ContactServices.xml servicedef/services.xml webapp/sfa/WEB-INF/action/mergeContacts.bsh webapp/sfa/contact/mergeContacts.ftl widget/sfa/forms/ContactForms.xml

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

svn commit: r654800 - in /ofbiz/trunk/applications/marketing: script/org/ofbiz/sfa/contact/ContactServices.xml servicedef/services.xml webapp/sfa/WEB-INF/action/mergeContacts.bsh webapp/sfa/contact/mergeContacts.ftl widget/sfa/forms/ContactForms.xml

mor-2
Author: mor
Date: Fri May  9 06:26:36 2008
New Revision: 654800

URL: http://svn.apache.org/viewvc?rev=654800&view=rev
Log:
Patch from Jyotsna Rathore for misc. improvements in merge contact tool OFBIZ-1650

Modified:
    ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/contact/ContactServices.xml
    ofbiz/trunk/applications/marketing/servicedef/services.xml
    ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/mergeContacts.bsh
    ofbiz/trunk/applications/marketing/webapp/sfa/contact/mergeContacts.ftl
    ofbiz/trunk/applications/marketing/widget/sfa/forms/ContactForms.xml

Modified: ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/contact/ContactServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/contact/ContactServices.xml?rev=654800&r1=654799&r2=654800&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/contact/ContactServices.xml (original)
+++ ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/contact/ContactServices.xml Fri May  9 06:26:36 2008
@@ -33,149 +33,73 @@
         <field-to-result field-name="partyId"/>
     </simple-method>
 
-    <simple-method short-description="Merge two Contacts" method-name="mergeContacts">
-        <set field="partyIdTo" from-field="parameters.partyId_1"/>
-        <set field="contactMechIdGenLoc_1" from-field="parameters.contactMechIdGenLoc_1"/>
-        <set field="contactMechIdPrimPhone_1" from-field="parameters.contactMechIdPrimPhone_1"/>
-        <set field="contactMechIdEmail_1" from-field="parameters.contactMechIdEmail_1"/>
-        <set field="partyId" from-field="parameters.partyId_2"/>
-        <set field="contactMechIdGenLoc_2" from-field="parameters.contactMechIdGenLoc_2"/>
-        <set field="contactMechIdPrimPhone_2" from-field="parameters.contactMechIdPrimPhone_2"/>
-        <set field="contactMechIdEmail_2" from-field="parameters.contactMechIdEmail_2"/>
+    <simple-method method-name="mergeContacts" short-description="Merge two Contacts">
+        <set field="partyIdTo" from-field="parameters.partyIdTo"/>
+        <set field="addrContactMechIdTo" from-field="parameters.addrContactMechIdTo"/>
+        <set field="phoneContactMechIdTo" from-field="parameters.phoneContactMechIdTo"/>
+        <set field="emailContactMechIdTo" from-field="parameters.emailContactMechIdTo"/>
+        <set field="partyId" from-field="parameters.partyId"/>
+        <set field="addrContactMechId" from-field="parameters.addrContactMechId"/>
+        <set field="phoneContactMechId" from-field="parameters.phoneContactMechId"/>
+        <set field="emailContactMechId" from-field="parameters.emailContactMechId"/>
+        <set field="infoString" from-field="parameters.infoString"/>
         <if-compare-field field-name="partyIdTo" operator="not-equals" to-field-name="partyId">
             <if-compare field-name="parameters.useAddress2" operator="equals"  value="Y" >
-                <if-not-empty field-name="contactMechIdGenLoc_2">
-                    <if-not-empty field-name="contactMechIdGenLoc_1">
-                        <set field="deletePartyContactMechPurposeCtx.partyId" from-field="partyIdTo"/>
-                        <set field="deletePartyContactMechPurposeCtx.contactMechId" from-field="contactMechIdGenLoc_1"/>
-                        <set field="deletePartyContactMechPurposeCtx.contactMechPurposeTypeId" value="GENERAL_LOCATION"/>
-                        <set field="deletePartyContactMechPurposeCtx.fromDate" from-field="parameters.fromDateGenLoc_1"/>
-                        <call-service service-name="deletePartyContactMechPurpose" in-map-name="deletePartyContactMechPurposeCtx"/>
-
-                        <set field="deletePartyContactMechCtx.partyId" from-field="partyIdTo"/>
-                        <set field="deletePartyContactMechCtx.contactMechId" from-field="contactMechIdGenLoc_1"/>
-                        <call-service service-name="deletePartyContactMech" in-map-name="deletePartyContactMechCtx"/>
-
-                        <clear-field field-name="deletePartyContactMechPurposeCtx"/>
-                        <clear-field field-name="deletePartyContactMechCtx"/>
+                <if-not-empty field-name="addrContactMechId">
+                    <if-not-empty field-name="addrContactMechIdTo">
+                        <set field="updatePartyContactMechCtx.partyId" from-field="partyIdTo"/>
+                        <set field="updatePartyContactMechCtx.contactMechTypeId" value="POSTAL_ADDRESS"/>
+                        <set field="updatePartyContactMechCtx.contactMechId" from-field="addrContactMechIdTo"/>
+                        <set field="updatePartyContactMechCtx.newContactMechId" from-field="addrContactMechId"/>
+                        <set field="updatePartyContactMechCtx.contactMechPurposeTypeId" value="GENERAL_LOCATION"/>
+                        <call-service service-name="updatePartyContactMech" in-map-name="updatePartyContactMechCtx"/>
                     </if-not-empty>
-
-                    <set field="deletePartyContactMechPurposeCtx.partyId" from-field="partyId"/>
-                    <set field="deletePartyContactMechPurposeCtx.contactMechId" from-field="contactMechIdGenLoc_2"/>
-                    <set field="deletePartyContactMechPurposeCtx.contactMechPurposeTypeId" value="GENERAL_LOCATION"/>
-                    <set field="deletePartyContactMechPurposeCtx.fromDate" from-field="parameters.fromDateGenLoc_2"/>
-                    <call-service service-name="deletePartyContactMechPurpose" in-map-name="deletePartyContactMechPurposeCtx"/>
-
-                    <set field="deletePartyContactMechCtx.partyId" from-field="partyId"/>
-                    <set field="deletePartyContactMechCtx.contactMechId" from-field="contactMechIdGenLoc_2"/>
-                    <call-service service-name="deletePartyContactMech" in-map-name="deletePartyContactMechCtx_2"/>
-
-                    <clear-field field-name="deletePartyContactMechPurposeCtx"/>
-                    <clear-field field-name="deletePartyContactMechCtx"/>
-                    
-                    <set field="createPartyContactMechCtx.partyId" from-field="partyIdTo"/>
-                    <set field="createPartyContactMechCtx.contactMechId" from-field="contactMechIdGenLoc_2"/>
-                    <call-service service-name="createPartyContactMech" in-map-name="createPartyContactMechCtx">
-                        <result-to-field result-name="contactMechId" field-name="contactMechIdGenLoc"/>
-                    </call-service>
-                    
-                    <set field="createPartyContactMechPurposeCtx.partyId" from-field="partyIdTo"/>
-                    <set field="createPartyContactMechPurposeCtx.contactMechId" from-field="contactMechIdGenLoc_2"/>
-                    <set field="createPartyContactMechPurposeCtx.contactMechPurposeTypeId" value="GENERAL_LOCATION"/>
-                    <call-service service-name="createPartyContactMechPurpose" in-map-name="createPartyContactMechPurposeCtx"/>
-                    
-                    <clear-field field-name="createPartyContactMechCtx"/>
-                    <clear-field field-name="createPartyContactMechPurposeCtx"/>
+                    <clear-field field-name="updatePartyContactMechCtx"/>
                 </if-not-empty>
             </if-compare>
             <if-compare field-name="parameters.useContactNum2" operator="equals"  value="Y" >
-                <if-not-empty field-name="contactMechIdPrimPhone_2">
-                    <if-not-empty field-name="contactMechIdPrimPhone_1">
-                        <set field="deletePartyContactMechPurposeCtx.partyId" from-field="partyIdTo"/>
-                        <set field="deletePartyContactMechPurposeCtx.contactMechId" from-field="contactMechIdPrimPhone_1"/>
-                        <set field="deletePartyContactMechPurposeCtx.contactMechPurposeTypeId" value="PRIMARY_PHONE"/>
-                        <set field="deletePartyContactMechPurposeCtx.fromDate" from-field="parameters.fromDateTelecom_1"/>
-                        <call-service service-name="deletePartyContactMechPurpose" in-map-name="deletePartyContactMechPurposeCtx"/>
-
-                        <set field="deletePartyContactMechCtx.partyId" from-field="partyIdTo"/>
-                        <set field="deletePartyContactMechCtx.contactMechId" from-field="contactMechIdPrimPhone_1"/>
-                        <call-service service-name="deletePartyContactMech" in-map-name="deletePartyContactMechCtx"/>
-
-                        <clear-field field-name="deletePartyContactMechPurposeCtx"/>
-                        <clear-field field-name="deletePartyContactMechCtx"/>                
+                <if-not-empty field-name="phoneContactMechId">
+                    <if-not-empty field-name="addrContactMechIdTo">
+                        <set field="updatePartyContactMechCtx.partyId" from-field="partyIdTo"/>
+                        <set field="updatePartyContactMechCtx.contactMechId" from-field="phoneContactMechIdTo"/>
+                        <set field="updatePartyContactMechCtx.contactMechTypeId" value="TELECOM_NUMBER"/>
+                        <set field="updatePartyContactMechCtx.newContactMechId" from-field="phoneContactMechId"/>
+                        <set field="updatePartyContactMechCtx.contactMechPurposeTypeId" value="PRIMARY_PHONE"/>
+                        <call-service service-name="updatePartyContactMech" in-map-name="updatePartyContactMechCtx"/>
                     </if-not-empty>
-                    
-                    <set field="deletePartyContactMechPurposeCtx.partyId" from-field="partyId"/>
-                    <set field="deletePartyContactMechPurposeCtx.contactMechId" from-field="contactMechIdPrimPhone_2"/>
-                    <set field="deletePartyContactMechPurposeCtx.contactMechPurposeTypeId" value="PRIMARY_PHONE"/>
-                    <set field="deletePartyContactMechPurposeCtx.fromDate" from-field="parameters.fromDateTelecom_2"/>
-                    <call-service service-name="deletePartyContactMechPurpose" in-map-name="deletePartyContactMechPurposeCtx"/>
-
-                    <set field="deletePartyContactMechCtx.partyId" from-field="partyId"/>
-                    <set field="deletePartyContactMechCtx.contactMechId" from-field="contactMechIdPrimPhone_2"/>
-                    <call-service service-name="deletePartyContactMech" in-map-name="deletePartyContactMechCtx"/>
-
-                    <clear-field field-name="deletePartyContactMechPurposeCtx"/>
-                    <clear-field field-name="deletePartyContactMechCtx"/>
-
-                    <set field="createPartyContactMechCtx.partyId" from-field="partyIdTo"/>
-                    <set field="createPartyContactMechCtx.contactMechId" from-field="contactMechIdPrimPhone_2"/>
-                    <call-service service-name="createPartyContactMech" in-map-name="createPartyContactMechCtx">
-                        <result-to-field result-name="contactMechId" field-name="contactMechIdPhone"/>
-                    </call-service>
-                    <set field="createPartyContactMechPurposeCtx.partyId" from-field="partyIdTo"/>
-                    <set field="createPartyContactMechPurposeCtx.contactMechId" from-field="contactMechIdPrimPhone_2"/>
-                    <set field="createPartyContactMechPurposeCtx.contactMechPurposeTypeId" value="PRIMARY_PHONE"/>
-                    <call-service service-name="createPartyContactMechPurpose" in-map-name="createPartyContactMechPurposeCtx"/>
-
-                    <clear-field field-name="createPartyContactMechCtx"/>
-                    <clear-field field-name="createPartyContactMechPurposeCtx"/>
+                    <clear-field field-name="updatePartyContactMechCtx"/>
                 </if-not-empty>
             </if-compare>
             <if-compare field-name="parameters.useEmail2" operator="equals"  value="Y" >
-                <if-not-empty field-name="contactMechIdEmail_2">
-                    <if-not-empty field-name="contactMechIdEmail_1">
-                      
-                        <set field="deletePartyContactMechPurposeCtx.partyId" from-field="partyIdTo"/>
-                        <set field="deletePartyContactMechPurposeCtx.contactMechId" from-field="contactMechIdEmail_1"/>
-                        <set field="deletePartyContactMechPurposeCtx.contactMechPurposeTypeId" value="PRIMARY_EMAIL"/>
-                        <set field="deletePartyContactMechPurposeCtx.fromDate" from-field="parameters.fromDateEmail_1"/>
-                        <call-service service-name="deletePartyContactMechPurpose" in-map-name="deletePartyContactMechPurposeCtx"/>
-                        
-                        <set field="deletePartyContactMechCtx.partyId" from-field="partyIdTo"/>
-                        <set field="deletePartyContactMechCtx.contactMechId" from-field="contactMechIdEmail_1"/>
-                        <call-service service-name="deletePartyContactMech" in-map-name="deletePartyContactMechCtx"/>
-
-                        <clear-field field-name="deletePartyContactMechPurposeCtx"/>
-                        <clear-field field-name="deletePartyContactMechCtx"/>
+                <if-not-empty field-name="emailContactMechId">
+                    <if-not-empty field-name="emailContactMechIdTo">
+                        <set field="updatePartyContactMechCtx.partyId" from-field="partyIdTo"/>
+                        <set field="updatePartyContactMechCtx.contactMechId" from-field="emailContactMechIdTo"/>
+                        <set field="updatePartyContactMechCtx.contactMechTypeId" value="EMAIL_ADDRESS"/>
+                        <set field="updatePartyContactMechCtx.contactMechPurposeTypeId" value="PRIMARY_EMAIL"/>
+                        <set field="updatePartyContactMechCtx.newContactMechId" from-field="emailContactMechId"/>
+                        <call-service service-name="updatePartyContactMech" in-map-name="updatePartyContactMechCtx"/>
                     </if-not-empty>
-
-                    <set field="deletePartyContactMechPurposeCtx.partyId" from-field="partyId"/>
-                    <set field="deletePartyContactMechPurposeCtx.contactMechId" from-field="contactMechIdEmail_2"/>
-                    <set field="deletePartyContactMechPurposeCtx.contactMechPurposeTypeId" value="PRIMARY_EMAIL"/>
-                    <set field="deletePartyContactMechPurposeCtx.fromDate" from-field="parameters.fromDateEmail_2"/>
-                    <call-service service-name="deletePartyContactMechPurpose" in-map-name="deletePartyContactMechPurposeCtx"/>
-
-                    <set field="deletePartyContactMechCtx.partyId" from-field="partyId"/>
-                    <set field="deletePartyContactMechCtx.contactMechId" from-field="contactMechIdEmail_2"/>
-                    <call-service service-name="deletePartyContactMech" in-map-name="deletePartyContactMechCtx"/>
-
-                    <set field="createPartyContactMechCtx.partyId" from-field="partyIdTo"/>
-                    <set field="createPartyContactMechCtx.contactMechId" from-field="contactMechIdEmail_2"/>
-                    <call-service service-name="createPartyContactMech" in-map-name="createPartyContactMechCtx_3">
-                        <result-to-field result-name="contactMechId" field-name="contactMechIdEmail"/>
-                    </call-service>
-
-                    <set field="createPartyContactMechPurposeCtx.partyId" from-field="partyIdTo"/>
-                    <set field="createPartyContactMechPurposeCtx.contactMechId" from-field="contactMechIdEmail_2"/>
-                    <set field="createPartyContactMechPurposeCtx.contactMechPurposeTypeId" value="PRIMARY_EMAIL"/>
-                    <call-service service-name="createPartyContactMechPurpose" in-map-name="createPartyContactMechPurposeCtx"/>
                 </if-not-empty>
             </if-compare>
-
+            <set field="deletePartyContactMechCtx.partyId" from-field="partyId"/>
+            <set field="deletePartyContactMechCtx.contactMechId" from-field="addrContactMechId"/>
+            <call-service service-name="deletePartyContactMech" in-map-name="deletePartyContactMechCtx"/>
+            <clear-field field-name="deletePartyContactMechCtx"/>
+
+            <set field="deletePartyContactMechCtx.partyId" from-field="partyId"/>
+            <set field="deletePartyContactMechCtx.contactMechId" from-field="phoneContactMechId"/>
+            <call-service service-name="deletePartyContactMech" in-map-name="deletePartyContactMechCtx"/>            
+            <clear-field field-name="deletePartyContactMechCtx"/>
+            
+            <set field="deletePartyContactMechCtx.partyId" from-field="partyId"/>
+            <set field="deletePartyContactMechCtx.contactMechId" from-field="emailContactMechId"/>
+            <call-service service-name="deletePartyContactMech" in-map-name="deletePartyContactMechCtx"/>
+          
             <set field="updatePartyCtx.partyId" from-field="partyId"/>
             <set field="updatePartyCtx.statusId" value="PARTY_DISABLED"/>
             <call-service service-name="setPartyStatus" in-map-name="updatePartyCtx"/>
+          
             <field-to-result field-name="partyIdTo" result-name="partyId"/>
             <field-to-request field-name="partyIdTo" request-name="partyId"/>
        </if-compare-field>

Modified: ofbiz/trunk/applications/marketing/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/servicedef/services.xml?rev=654800&r1=654799&r2=654800&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/marketing/servicedef/services.xml Fri May  9 06:26:36 2008
@@ -424,25 +424,18 @@
     </service>
     <service name="mergeContacts" engine="simple"
         location="org/ofbiz/sfa/contact/ContactServices.xml" invoke="mergeContacts">
-        <description>This service merges the contact details of two parties</description>
-        <attribute name="contactMechIdGenLoc_1" type="String" mode="IN" optional="true"/>
-        <attribute name="contactMechIdPrimPhone_1" type="String" mode="IN" optional="true"/>
-        <attribute name="contactMechIdEmail_1" type="String" mode="IN" optional="true"/>
-        <attribute name="fromDateGenLoc_1" type="Timestamp" mode="IN" optional="true"/>
-        <attribute name="fromDateTelecom_1" type="Timestamp" mode="IN" optional="true"/>
-        <attribute name="fromDateEmail_1" type="Timestamp" mode="IN" optional="true"/>
-        <attribute name="contactMechIdGenLoc_2" type="String" mode="IN" optional="true"/>
-        <attribute name="contactMechIdPrimPhone_2" type="String" mode="IN" optional="true"/>
-        <attribute name="contactMechIdEmail_2" type="String" mode="IN" optional="true"/>
-        <attribute name="fromDateGenLoc_2" type="Timestamp" mode="IN" optional="true"/>
-        <attribute name="fromDateTelecom_2" type="Timestamp" mode="IN" optional="true"/>
-        <attribute name="fromDateEmail_2" type="Timestamp" mode="IN" optional="true"/>
-        <attribute name="partyId_1" type="String" mode="IN" optional="false"/>
-        <attribute name="partyId_2" type="String" mode="IN" optional="false"/>
+        <description>This service merges the contact details of two parties, partyId merges into partyIdTo</description>
+        <attribute name="addrContactMechIdTo" type="String" mode="IN" optional="true"/>
+        <attribute name="phoneContactMechIdTo" type="String" mode="IN" optional="true"/>
+        <attribute name="emailContactMechIdTo" type="String" mode="IN" optional="true"/>
+        <attribute name="addrContactMechId" type="String" mode="IN" optional="true"/>
+        <attribute name="phoneContactMechId" type="String" mode="IN" optional="true"/>
+        <attribute name="emailContactMechId" type="String" mode="IN" optional="true"/>
+        <attribute name="partyIdTo" type="String" mode="IN" optional="false"/>
+        <attribute name="partyId" type="String" mode="INOUT" optional="false"/>        
         <attribute name="useAddress2" type="String" mode="IN" optional="true"/>
         <attribute name="useContactNum2" type="String" mode="IN" optional="true"/>
         <attribute name="useEmail2" type="String" mode="IN" optional="true"/>
-        <attribute name="partyId" type="String" mode="OUT" optional="false"/>
     </service>
     <!-- Account services  -->
     <service name="createAccount" engine="simple"

Modified: ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/mergeContacts.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/mergeContacts.bsh?rev=654800&r1=654799&r2=654800&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/mergeContacts.bsh (original)
+++ ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/mergeContacts.bsh Fri May  9 06:26:36 2008
@@ -3,6 +3,7 @@
 import org.ofbiz.base.util.UtilMisc;
 import org.ofbiz.entity.util.EntityUtil;
 import javolution.util.FastList;
+import org.ofbiz.party.contact.ContactHelper;
 
 FastList contactInfoList=FastList.newInstance();
 partyIdFrom = parameters.get("partyIdFrom");
@@ -12,49 +13,51 @@
     partyListItr = partyList.iterator();
     while (partyListItr.hasNext()) {
         partyId = partyListItr.next();
-        party = delegator.findOne("Person", false, "partyId",partyId);
-        person =  delegator.findOne("Person", false, "partyId",partyId));
+        party = delegator.findOne("Person", UtilMisc.toMap("partyId", partyId), false);
+        person =  delegator.findOne("Person", UtilMisc.toMap("partyId", partyId), false);
         contactDetailMap = UtilMisc.toMap("partyId", partyId, "firstName", person.get("firstName"), "lastName", person.get("lastName"));
 
-        cntctMechGenLoc = EntityUtil.getFirst(ContactHelper.getContactMech(party, "GENERAL_LOCATION", "POSTAL_ADDRESS", false));
-        contactDetailMap.put("contactMechIdGenLoc", cntctMechGenLoc.get("contactMechId"));
-        contactDetailMap.put("fromDateGenLoc", cntctMechGenLoc.get("fromDate"));
-        postalAddress = cntctMechGenLoc.getRelatedOne("PostalAddress");
-        if(UtilValidate.isNotEmpty(postalAddress)) {
-            contactDetailMap.put("address1", postalAddress.get("address1"));
-            contactDetailMap.put("city", postalAddress.get("city"));
-            address2 = postalAddress.get("address2");
-            if(UtilValidate.isNotEmpty(address2)) {
-                contactDetailMap.put("address2", address2);
+        contactMechGenLoc = EntityUtil.getFirst(ContactHelper.getContactMech(party, "GENERAL_LOCATION", "POSTAL_ADDRESS", false));
+        if(UtilValidate.isNotEmpty(contactMechGenLoc)) {
+            contactDetailMap.put("addrContactMechId", contactMechGenLoc.get("contactMechId"));
+            postalAddress = contactMechGenLoc.getRelatedOne("PostalAddress");
+            if(UtilValidate.isNotEmpty(postalAddress)) {
+                contactDetailMap.put("address1", postalAddress.get("address1"));
+                contactDetailMap.put("city", postalAddress.get("city"));
+                address2 = postalAddress.get("address2");
+                if(UtilValidate.isNotEmpty(address2)) {
+                    contactDetailMap.put("address2", address2);
+                }
+                geo = delegator.findOne("Geo", UtilMisc.toMap("geoId", postalAddress.get("stateProvinceGeoId")), false);
+                contactDetailMap.put("state", geo.get("geoName"));
+                
+                geo = delegator.findOne("Geo", UtilMisc.toMap("geoId", postalAddress.get("countryGeoId")), false);
+                contactDetailMap.put("country", geo.get("geoName"));
             }
-            geo = delegator.findOne("Geo", "geoId", postalAddress.get("stateProvinceGeoId"));
-            contactDetailMap.put("state", geo.get("geoName"));
-            
-            geo = delegator.findOne("Geo", false, "geoId", postalAddress.get("countryGeoId"));
-            contactDetailMap.put("country", geo.get("geoName"));
         }
-        cntctMechPrimEmail = EntityUtil.getFirst(ContactHelper.getContactMech(party, "PRIMARY_EMAIL", "EMAIL_ADDRESS", false));
-        contactMech= cntctMechPrimEmail.getRelatedOne("ContactMech");
-        if(UtilValidate.isNotEmpty(contactMech)) {
-            contactDetailMap.put("primaryEmail", contactMech.get("infoString"));                    
+        contactMechPrimEmail = EntityUtil.getFirst(ContactHelper.getContactMech(party, "PRIMARY_EMAIL", "EMAIL_ADDRESS", false));
+        if(UtilValidate.isNotEmpty(contactMechPrimEmail)) {
+            contactDetailMap.put("primaryEmail", contactMechPrimEmail.get("infoString"));
+            contactDetailMap.put("emailContactMechId", contactMechPrimEmail.get("contactMechId"));
         }
-        cntctMechPrimEmail = EntityUtil.getFirst(ContactHelper.getContactMech(party, "PRIMARY_PHONE", "TELECOM_NUMBER", false));        
-        contactDetailMap.put("contactMechIdPrimPhone", cntctMechPrimPhone.get("contactMechId"));
-        contactDetailMap.put("fromDateTelecom", cntctMechPrimPhone.get("fromDate"));
-        telecomNumber = cntctMechPrimPhone.getRelatedOne("TelecomNumber");
-        if(UtilValidate.isNotEmpty(telecomNumber)) {
-            countryCode = telecomNumber.get("countryCode");
-            if(UtilValidate.isNotEmpty(countryCode)) {
-                contactDetailMap.put("countryCode", countryCode);
+        contactMechPrimPhone = EntityUtil.getFirst(ContactHelper.getContactMech(party, "PRIMARY_PHONE", "TELECOM_NUMBER", false));
+        if(UtilValidate.isNotEmpty(contactMechPrimPhone)) {
+            contactDetailMap.put("phoneContactMechId", contactMechPrimPhone.get("contactMechId"));
+            telecomNumber = contactMechPrimPhone.getRelatedOne("TelecomNumber");
+            if(UtilValidate.isNotEmpty(telecomNumber)) {
+                countryCode = telecomNumber.get("countryCode");
+                if(UtilValidate.isNotEmpty(countryCode)) {
+                    contactDetailMap.put("countryCode", countryCode);
+                }
+                areaCode = telecomNumber.get("areaCode");
+                if(UtilValidate.isNotEmpty(areaCode)) {
+                    contactDetailMap.put("areaCode", areaCode);
+                }
+                contactNumber = telecomNumber.get("contactNumber");
+                if(UtilValidate.isNotEmpty(contactNumber)) {
+                    contactDetailMap.put("contactNumber", contactNumber);
+                }                
             }
-            areaCode = telecomNumber.get("areaCode");
-            if(UtilValidate.isNotEmpty(areaCode)) {
-                contactDetailMap.put("areaCode", areaCode);
-            }
-            contactNumber = telecomNumber.get("contactNumber");
-            if(UtilValidate.isNotEmpty(contactNumber)) {
-                contactDetailMap.put("contactNumber", contactNumber);
-            }                
         }
         contactInfoList.add(contactDetailMap);
     }

Modified: ofbiz/trunk/applications/marketing/webapp/sfa/contact/mergeContacts.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/webapp/sfa/contact/mergeContacts.ftl?rev=654800&r1=654799&r2=654800&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/webapp/sfa/contact/mergeContacts.ftl (original)
+++ ofbiz/trunk/applications/marketing/webapp/sfa/contact/mergeContacts.ftl Fri May  9 06:26:36 2008
@@ -23,22 +23,16 @@
         <#if contactInfoList?has_content >
           <#assign contactInfo1 = contactInfoList[0]/>
           <#assign contactInfo2 = contactInfoList[1]/>
-          <input type="hidden" name="partyId_1" value="${contactInfo1.partyId?if_exists}">
-          <input type="hidden" name="partyId_2" value="${contactInfo2.partyId?if_exists}">
+          <input type="hidden" name="partyIdTo" value="${contactInfo1.partyId?if_exists}">
+          <input type="hidden" name="partyId" value="${contactInfo2.partyId?if_exists}">
           
-          <input type="hidden" name="contactMechIdGenLoc_1" value="${contactInfo1.contactMechIdGenLoc?if_exists}">
-          <input type="hidden" name="contactMechIdPrimPhone_1" value="${contactInfo1.contactMechIdPrimPhone?if_exists}">
-          <input type="hidden" name="contactMechIdEmail_1" value="${contactInfo1.contactMechIdEmail?if_exists}">
-          <input type="hidden" name="fromDateGenLoc_1" value="${contactInfo1.fromDateGenLoc?if_exists}">
-          <input type="hidden" name="fromDateEmail_1" value="${contactInfo1.fromDateEmail?if_exists}">
-          <input type="hidden" name="fromDateTelecom_1" value="${contactInfo1.fromDateTelecom?if_exists}">
+          <input type="hidden" name="addrContactMechIdTo" value="${contactInfo1.addrContactMechId?if_exists}">
+          <input type="hidden" name="phoneContactMechIdTo" value="${contactInfo1.phoneContactMechId?if_exists}">
+          <input type="hidden" name="emailContactMechIdTo" value="${contactInfo1.emailContactMechId?if_exists}">
           
-          <input type="hidden" name="contactMechIdGenLoc_2" value="${contactInfo2.contactMechIdGenLoc?if_exists}">
-          <input type="hidden" name="contactMechIdPrimPhone_2" value="${contactInfo2.contactMechIdPrimPhone?if_exists}">
-          <input type="hidden" name="contactMechIdEmail_2" value="${contactInfo2.contactMechIdEmail?if_exists}">
-          <input type="hidden" name="fromDateGenLoc_2" value="${contactInfo2.fromDateGenLoc?if_exists}">
-          <input type="hidden" name="fromDateEmail_2" value="${contactInfo2.fromDateEmail?if_exists}">
-          <input type="hidden" name="fromDateTelecom_2" value="${contactInfo2.fromDateTelecom?if_exists}">
+          <input type="hidden" name="addrContactMechId" value="${contactInfo2.addrContactMechId?if_exists}">
+          <input type="hidden" name="phoneContactMechId" value="${contactInfo2.phoneContactMechId?if_exists}">
+          <input type="hidden" name="emailContactMechId" value="${contactInfo2.emailContactMechId?if_exists}">
           
           <table  align="left" >
             <tr width="100%">

Modified: ofbiz/trunk/applications/marketing/widget/sfa/forms/ContactForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/widget/sfa/forms/ContactForms.xml?rev=654800&r1=654799&r2=654800&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/widget/sfa/forms/ContactForms.xml (original)
+++ ofbiz/trunk/applications/marketing/widget/sfa/forms/ContactForms.xml Fri May  9 06:26:36 2008
@@ -73,12 +73,12 @@
     <form name="MergeContacts" type="single"  target="MergeContacts">
         <field name="partyIdFrom" title="${uiLabelMap.SfaMergeParty}" position="1">
             <drop-down allow-empty="false">
-               <list-options list-name="partyList" key-name="contact.partyId"  list-entry-name="contact" description="${contact.partyId}"/>
+               <list-options list-name="partyList" key-name="contact.partyId"  list-entry-name="contact" description="${bsh:org.ofbiz.party.party.PartyHelper.getPartyName(delegator, &quot;${contact.partyId}&quot;, false)} [${contact.partyId}]"/>
             </drop-down>
         </field>
         <field name="partyIdTo" title="${uiLabelMap.AccountingToParty}" position="2">
             <drop-down allow-empty="false">
-                <list-options list-name="partyList" key-name="contact.partyId"  list-entry-name="contact" description="${contact.partyId}"/>
+                <list-options list-name="partyList" key-name="contact.partyId"  list-entry-name="contact" description="${bsh:org.ofbiz.party.party.PartyHelper.getPartyName(delegator, &quot;${contact.partyId}&quot;, false)} : [${contact.partyId}]"/>
             </drop-down>
         </field>
         <field name="submitButton" position="3" title="${uiLabelMap.SfaMergeContacts}" widget-style="buttontext" tooltip-style="button-text"><submit button-type="text-link"/></field>