svn commit: r657104 - in /ofbiz/trunk/applications/marketing: config/ script/org/ofbiz/sfa/contact/ script/org/ofbiz/sfa/lead/ servicedef/ webapp/sfa/WEB-INF/ webapp/sfa/WEB-INF/action/ widget/sfa/ widget/sfa/forms/

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

svn commit: r657104 - in /ofbiz/trunk/applications/marketing: config/ script/org/ofbiz/sfa/contact/ script/org/ofbiz/sfa/lead/ servicedef/ webapp/sfa/WEB-INF/ webapp/sfa/WEB-INF/action/ widget/sfa/ widget/sfa/forms/

mor-2
Author: mor
Date: Fri May 16 08:24:05 2008
New Revision: 657104

URL: http://svn.apache.org/viewvc?rev=657104&view=rev
Log:
applied patch (SfaCloneLead.patch) for clone lead functionality in sfa from Jira Issue OFBIZ-1643 (https://issues.apache.org/jira/browse/OFBIZ-1643), Thanks to Jyotsna Rathore for this patch and special thanks to Mridul Pathak for reviewing this work

Added:
    ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/cloneLead.bsh   (with props)
Modified:
    ofbiz/trunk/applications/marketing/config/MarketingUiLabels.xml
    ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/contact/ContactServices.xml
    ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.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/WEB-INF/controller.xml
    ofbiz/trunk/applications/marketing/widget/sfa/CommonScreens.xml
    ofbiz/trunk/applications/marketing/widget/sfa/ContactScreens.xml
    ofbiz/trunk/applications/marketing/widget/sfa/LeadScreens.xml
    ofbiz/trunk/applications/marketing/widget/sfa/SfaMenus.xml
    ofbiz/trunk/applications/marketing/widget/sfa/forms/LeadForms.xml

Modified: ofbiz/trunk/applications/marketing/config/MarketingUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/config/MarketingUiLabels.xml?rev=657104&r1=657103&r2=657104&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/config/MarketingUiLabels.xml (original)
+++ ofbiz/trunk/applications/marketing/config/MarketingUiLabels.xml Fri May 16 08:24:05 2008
@@ -1131,6 +1131,9 @@
     <property key="SfaCampaigns">
         <value xml:lang="en">Campaigns</value>
     </property>
+    <property key="SfaCloneLead">
+        <value xml:lang="en">Clone Lead</value>
+    </property>
     <property key="SfaCloseDate">
         <value xml:lang="en">Close Date</value>
     </property>

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=657104&r1=657103&r2=657104&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 16 08:24:05 2008
@@ -55,11 +55,15 @@
                         <call-service service-name="updatePartyContactMech" in-map-name="updatePartyContactMechCtx"/>
                     </if-not-empty>
                     <clear-field field-name="updatePartyContactMechCtx"/>
+                    <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"/>
                 </if-not-empty>
             </if-compare>
             <if-compare field-name="parameters.useContactNum2" operator="equals"  value="Y" >
                 <if-not-empty field-name="phoneContactMechId">
-                    <if-not-empty field-name="addrContactMechIdTo">
+                    <if-not-empty field-name="phoneContactMechIdTo">
                         <set field="updatePartyContactMechCtx.partyId" from-field="partyIdTo"/>
                         <set field="updatePartyContactMechCtx.contactMechId" from-field="phoneContactMechIdTo"/>
                         <set field="updatePartyContactMechCtx.contactMechTypeId" value="TELECOM_NUMBER"/>
@@ -68,6 +72,10 @@
                         <call-service service-name="updatePartyContactMech" in-map-name="updatePartyContactMechCtx"/>
                     </if-not-empty>
                     <clear-field field-name="updatePartyContactMechCtx"/>
+                    <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"/>
                 </if-not-empty>
             </if-compare>
             <if-compare field-name="parameters.useEmail2" operator="equals"  value="Y" >
@@ -80,22 +88,12 @@
                         <set field="updatePartyContactMechCtx.newContactMechId" from-field="emailContactMechId"/>
                         <call-service service-name="updatePartyContactMech" in-map-name="updatePartyContactMechCtx"/>
                     </if-not-empty>
+                    <set field="deletePartyContactMechCtx.partyId" from-field="partyId"/>
+                    <set field="deletePartyContactMechCtx.contactMechId" from-field="emailContactMechId"/>
+                    <call-service service-name="deletePartyContactMech" in-map-name="deletePartyContactMechCtx"/>
                 </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"/>

Modified: ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml?rev=657104&r1=657103&r2=657104&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml (original)
+++ ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml Fri May 16 08:24:05 2008
@@ -58,6 +58,7 @@
             <set field="partyRelationshipContext.partyIdTo" from-field="partyId"/>
             <set field="partyRelationshipContext.roleTypeIdFrom" value="LEAD"/>
             <set field="partyRelationshipContext.roleTypeIdTo" value="EMPLOYEE"/>
+            <set field="partyRelationshipContext.positionTitle" from-field="parameters.title"/>
             <set field="partyRelationshipContext.partyRelationshipTypeId" value="EMPLOYMENT"/>
             <call-service service-name="createPartyRelationship" in-map-name="partyRelationshipContext"/>
         </if-not-empty>
@@ -80,6 +81,7 @@
             <create-value value-name="partyDataSource"/>
         </if-not-empty>
         <field-to-result field-name="partyId"/>
+        <field-to-result field-name="parameters.roleTypeId" result-name="roleTypeId"/>
     </simple-method>
   
     <simple-method method-name="convertLeadToContact" short-description="Convert a lead person into a contact and associated lead group to an account">
@@ -98,7 +100,7 @@
         <filter-list-by-date list-name="partyRelationships" to-list-name="partyRelationships"/>
         <first-from-list list-name="partyRelationships" entry-name="partyRelationship"/>
         
-        <set field="accountId" from-field="parameters.partyId"/>
+        <set field="accountId" from-field="partyRelationship.partyIdFrom"/>
         <if-not-empty field-name="partyRelationship">
             <if-empty field-name="accountId">
                 <set field="accountId" from-field="partyRelationship.partyIdFrom"/>
@@ -117,11 +119,13 @@
             </if-empty>
         </if-not-empty>
         <clear-field field-name="partyRelationshipCtx"/>
-        <set field="partyRelationshipCtx.partyIdFrom" from-field="accountId"/>
-        <set field="partyRelationshipCtx.partyIdTo" from-field="leadPartyId"/>
-        <set field="partyRelationshipCtx.roleTypeIdFrom" value="ACCOUNT"/>
-        <set field="partyRelationshipCtx.roleTypeIdTo" value="CONTACT"/>
-        <set field="partyRelationshipCtx.partyRelationshipTypeId" value="CONTACT_REL"/>
-        <call-service service-name="createPartyRelationship" in-map-name="partyRelationshipCtx"/>
+        <if-empty field-name="accountId">
+            <set field="partyRelationshipCtx.partyIdFrom" from-field="accountId"/>
+            <set field="partyRelationshipCtx.partyIdTo" from-field="leadPartyId"/>
+            <set field="partyRelationshipCtx.roleTypeIdFrom" value="ACCOUNT"/>
+            <set field="partyRelationshipCtx.roleTypeIdTo" value="CONTACT"/>
+            <set field="partyRelationshipCtx.partyRelationshipTypeId" value="CONTACT_REL"/>
+            <call-service service-name="createPartyRelationship" in-map-name="partyRelationshipCtx"/>
+        </if-empty>              
     </simple-method>
 </simple-methods>

Modified: ofbiz/trunk/applications/marketing/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/servicedef/services.xml?rev=657104&r1=657103&r2=657104&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/marketing/servicedef/services.xml Fri May 16 08:24:05 2008
@@ -403,8 +403,10 @@
         <attribute name="groupName" type="String" mode="IN" optional="true"/>
         <attribute name="title" type="String" mode="IN" optional="true"/>
         <attribute name="numEmployees" type="String" mode="IN" optional="true"/>
+        <attribute name="officeSiteName" type="String" mode="IN" optional="true"/>
         <attribute name="partyIdFrom" type="String" mode="IN" optional="true"/>
         <attribute name="leadSource" type="String" mode="IN" optional="true"/>
+        <attribute name="roleTypeId" type="String" mode="OUT"/>
     </service>
     <service name="createContact" engine="simple"
         location="org/ofbiz/sfa/contact/ContactServices.xml" invoke="createContact">

Added: ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/cloneLead.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/cloneLead.bsh?rev=657104&view=auto
==============================================================================
--- ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/cloneLead.bsh (added)
+++ ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/cloneLead.bsh Fri May 16 08:24:05 2008
@@ -0,0 +1,74 @@
+import org.ofbiz.base.util.UtilValidate;
+import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.entity.util.EntityUtil;
+import org.ofbiz.party.contact.ContactHelper;
+
+partyId = parameters.get("leadPartyId");
+if(UtilValidate.isNotEmpty(partyId)) {
+    party =  delegator.findOne("Party", UtilMisc.toMap("partyId", partyId), false);
+    person = party.getRelatedOne("Person");
+    contactDetailMap = UtilMisc.toMap("partyId", partyId, "firstName", person.get("firstName"), "lastName", person.get("lastName"), "suffix", person.get("suffix"));
+    partyRelationship = EntityUtil.getFirst(EntityUtil.filterByDate(delegator.findByAnd("PartyRelationship", UtilMisc.toMap("partyIdTo", partyId,
+                                 "roleTypeIdTo", "EMPLOYEE", "roleTypeIdFrom", "LEAD", "partyRelationshipTypeId", "EMPLOYMENT"), UtilMisc.toList("-fromDate"))));
+    if(UtilValidate.isNotEmpty(partyRelationship)) {
+        contactDetailMap.put("title", partyRelationship.get("positionTitle"));
+        partyGroup = delegator.findOne("PartyGroup", UtilMisc.toMap("partyId", partyRelationship.get("partyIdFrom")), false);
+        if(UtilValidate.isNotEmpty(partyGroup)) {
+            if(UtilValidate.isNotEmpty(partyGroup.get("groupName"))) {
+                contactDetailMap.put("groupName", partyGroup.get("groupName"));
+            }
+            if(UtilValidate.isNotEmpty(partyGroup.get("officeSiteName"))) {
+                contactDetailMap.put("officeSiteName", partyGroup.get("officeSiteName"));
+            }
+            if(UtilValidate.isNotEmpty(partyGroup.get("numEmployees"))) {
+                contactDetailMap.put("numEmployees", partyGroup.get("numEmployees"));
+            }
+        }
+    }
+    generalContactMech = EntityUtil.getFirst(ContactHelper.getContactMech(person, "GENERAL_LOCATION", "POSTAL_ADDRESS", false));
+    if(UtilValidate.isNotEmpty(generalContactMech)) {
+        contactDetailMap.put("addrContactMechId", generalContactMech.get("contactMechId"));
+        postalAddress = genLocContactMech.getRelatedOne("PostalAddress");
+        if(UtilValidate.isNotEmpty(postalAddress)) {
+            contactDetailMap.put("address1", postalAddress.get("address1"));
+            contactDetailMap.put("city", postalAddress.get("city"));
+            contactDetailMap.put("stateProvinceGeoId", postalAddress.get("stateProvinceGeoId"));
+            contactDetailMap.put("countryGeoId", postalAddress.get("countryGeoId"));
+            contactDetailMap.put("postalCode", postalAddress.get("postalCode"));
+            address2 = postalAddress.get("address2");
+            if(UtilValidate.isNotEmpty(address2)) {
+                contactDetailMap.put("address2", address2);
+            }
+        }
+    }
+    emailContactMech = EntityUtil.getFirst(ContactHelper.getContactMech(person, "PRIMARY_EMAIL", "EMAIL_ADDRESS", false));
+    if(UtilValidate.isNotEmpty(emailContactMech)) {
+        contactDetailMap.put("emailAddress", emailContactMech.get("infoString"));
+        contactDetailMap.put("emailContactMechId", emailContactMech.get("contactMechId"));
+    }
+    phoneContactMech = EntityUtil.getFirst(ContactHelper.getContactMech(person, "PRIMARY_PHONE", "TELECOM_NUMBER", false));
+    if(UtilValidate.isNotEmpty(phoneContactMech)) {
+        contactDetailMap.put("phoneContactMechId", phoneContactMech.get("contactMechId"));
+        telecomNumber = phoneContactMech.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);
+            }
+        }
+    }
+    partyDataSource = EntityUtil.getFirst(party.getRelated("PartyDataSource"));
+    if(UtilValidate.isNotEmpty(partyDataSource)) {
+        dataSource = partyDataSource.getRelatedOne("DataSource");
+        contactDetailMap.put("leadSource", dataSource.get("description"));
+    }
+}
+context.put("contactDetailMap", contactDetailMap);
\ No newline at end of file

Propchange: ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/cloneLead.bsh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/cloneLead.bsh
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/cloneLead.bsh
------------------------------------------------------------------------------
    svn:mime-type = text/plain

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=657104&r1=657103&r2=657104&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 16 08:24:05 2008
@@ -1,5 +1,4 @@
 import org.ofbiz.base.util.UtilValidate;
-import org.ofbiz.base.util.UtilHttp;
 import org.ofbiz.base.util.UtilMisc;
 import org.ofbiz.entity.util.EntityUtil;
 import javolution.util.FastList;
@@ -13,14 +12,14 @@
     partyListItr = partyList.iterator();
     while (partyListItr.hasNext()) {
         partyId = partyListItr.next();
-        party = delegator.findOne("Person", UtilMisc.toMap("partyId", partyId), false);
-        person =  delegator.findOne("Person", UtilMisc.toMap("partyId", partyId), false);
+        party = delegator.findOne("Party", UtilMisc.toMap("partyId", partyId), false);
+        person =  party.getRelatedOne("Person");
         contactDetailMap = UtilMisc.toMap("partyId", partyId, "firstName", person.get("firstName"), "lastName", person.get("lastName"));
 
-        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");
+        generalContactMech = EntityUtil.getFirst(ContactHelper.getContactMech(party, "GENERAL_LOCATION", "POSTAL_ADDRESS", false));
+        if(UtilValidate.isNotEmpty(generalContactMech)) {
+            contactDetailMap.put("addrContactMechId", generalContactMech.get("contactMechId"));
+            postalAddress = genLocContactMech.getRelatedOne("PostalAddress");
             if(UtilValidate.isNotEmpty(postalAddress)) {
                 contactDetailMap.put("address1", postalAddress.get("address1"));
                 contactDetailMap.put("city", postalAddress.get("city"));
@@ -35,15 +34,15 @@
                 contactDetailMap.put("country", geo.get("geoName"));
             }
         }
-        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"));
-        }
-        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");
+        emailContactMech = EntityUtil.getFirst(ContactHelper.getContactMech(party, "PRIMARY_EMAIL", "EMAIL_ADDRESS", false));
+        if(UtilValidate.isNotEmpty(emailContactMech)) {
+            contactDetailMap.put("primaryEmail", emailContactMech.get("infoString"));
+            contactDetailMap.put("emailContactMechId", emailContactMech.get("contactMechId"));
+        }            
+        phoneContactMech = EntityUtil.getFirst(ContactHelper.getContactMech(party, "PRIMARY_PHONE", "TELECOM_NUMBER", false));
+        if(UtilValidate.isNotEmpty(phoneContactMech)) {
+            contactDetailMap.put("phoneContactMechId", phoneContactMech.get("contactMechId"));
+            telecomNumber = phoneContactMech.getRelatedOne("TelecomNumber");
             if(UtilValidate.isNotEmpty(telecomNumber)) {
                 countryCode = telecomNumber.get("countryCode");
                 if(UtilValidate.isNotEmpty(countryCode)) {

Modified: ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/controller.xml?rev=657104&r1=657103&r2=657104&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/controller.xml Fri May 16 08:24:05 2008
@@ -98,12 +98,16 @@
         <security https="true" auth="true"/>
         <response name="success" type="view" value="ConvertLead"/>
     </request-map>
-        <request-map uri="convertLead">
+    <request-map uri="convertLead">
         <security https="true" auth="true"/>
         <event type="service" invoke="convertLeadToContact"/>
         <response name="success" type="view" value="viewprofile"/>
         <response name="error" type="view" value="ConvertLead"/>  
     </request-map>
+    <request-map uri="CloneLead">
+        <security https="true" auth="true" external-view="false"/>
+        <response type="view" name="success" value="CloneLead"/>
+    </request-map>
     <request-map uri="viewLead">
         <security https="true" auth="true"/>
         <response name="success" type="view" value="viewLead"/>
@@ -145,6 +149,7 @@
     <view-map name="NewAccounts" type="screen" page="component://marketing/widget/sfa/AccountScreens.xml#NewAccounts"/>
     <view-map name="FindLeads" type="screen" page="component://marketing/widget/sfa/LeadScreens.xml#FindLeads"/>
     <view-map name="CreateLead" type="screen" page="component://marketing/widget/sfa/LeadScreens.xml#CreateLead"/>
+    <view-map name="CloneLead" type="screen" page="component://marketing/widget/sfa/LeadScreens.xml#CloneLead"/>
     <view-map name="FindContacts" type="screen" page="component://marketing/widget/sfa/ContactScreens.xml#FindContacts"/>
     <view-map name="CreateContact" type="screen" page="component://marketing/widget/sfa/ContactScreens.xml#CreateContact"/>
     <view-map name="MergeContacts" type="screen" page="component://marketing/widget/sfa/ContactScreens.xml#MergeContacts"/>

Modified: ofbiz/trunk/applications/marketing/widget/sfa/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/widget/sfa/CommonScreens.xml?rev=657104&r1=657103&r2=657104&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/widget/sfa/CommonScreens.xml (original)
+++ ofbiz/trunk/applications/marketing/widget/sfa/CommonScreens.xml Fri May 16 08:24:05 2008
@@ -134,10 +134,7 @@
                     <decorator-section name="body">
                         <section>
                             <condition>
-                              <and>
-                                  <if-compare field-name="partyTypeId" operator="equals" value="PERSON"/>
-                                  <if-compare field-name="parameters.roleTypeId" operator="equals" value="LEAD"/>
-                              </and>
+                                <if-compare field-name="parameters.roleTypeId" operator="equals" value="LEAD"/>
                             </condition>
                             <widgets>
                                 <include-menu name="LeadTabBar" location="component://marketing/widget/sfa/SfaMenus.xml"/>

Modified: ofbiz/trunk/applications/marketing/widget/sfa/ContactScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/widget/sfa/ContactScreens.xml?rev=657104&r1=657103&r2=657104&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/widget/sfa/ContactScreens.xml (original)
+++ ofbiz/trunk/applications/marketing/widget/sfa/ContactScreens.xml Fri May 16 08:24:05 2008
@@ -116,7 +116,6 @@
             <actions>
                 <set field="titleProperty" value="PageTitleCreateContact"/>
                 <set field="tabButtonItem" value="Contacts"/>
-                <set field="contactmechId1" ></set>
                 <script location="component://marketing/webapp/sfa/WEB-INF/action/mergeContacts.bsh"/>
             </actions>
             <widgets>

Modified: ofbiz/trunk/applications/marketing/widget/sfa/LeadScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/widget/sfa/LeadScreens.xml?rev=657104&r1=657103&r2=657104&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/widget/sfa/LeadScreens.xml (original)
+++ ofbiz/trunk/applications/marketing/widget/sfa/LeadScreens.xml Fri May 16 08:24:05 2008
@@ -128,4 +128,33 @@
             </widgets>
         </section>
     </screen>
+    <screen name="CloneLead">
+        <section>
+            <actions>
+                <script location="component://marketing/webapp/sfa/WEB-INF/action/cloneLead.bsh"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <container style="screenlet">
+                            <container style="screenlet-title-bar boxhead">
+                                <section>
+                                    <widgets>
+                                        <label text="${uiLabelMap.SfaCloneLead}"/>
+                                    </widgets>
+                                </section>
+                            </container>
+                            <container style="screenlet-body">
+                                <section>
+                                    <widgets>
+                                        <include-form name="createLead" location="component://marketing/widget/sfa/forms/LeadForms.xml"/>
+                                    </widgets>
+                                </section>
+                            </container>
+                        </container>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 </screens>

Modified: ofbiz/trunk/applications/marketing/widget/sfa/SfaMenus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/widget/sfa/SfaMenus.xml?rev=657104&r1=657103&r2=657104&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/widget/sfa/SfaMenus.xml (original)
+++ ofbiz/trunk/applications/marketing/widget/sfa/SfaMenus.xml Fri May 16 08:24:05 2008
@@ -50,5 +50,8 @@
         <menu-item name="convertLead" title="${uiLabelMap.SfaConvertLead}">
             <link target="ConvertLead?leadPartyId=${parameters.partyId}"/>
         </menu-item>
+        <menu-item name="CloneLead" title="${uiLabelMap.SfaCloneLead}">
+            <link target="CloneLead?leadPartyId=${parameters.partyId}"/>
+        </menu-item>
     </menu>
 </menus>

Modified: ofbiz/trunk/applications/marketing/widget/sfa/forms/LeadForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/widget/sfa/forms/LeadForms.xml?rev=657104&r1=657103&r2=657104&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/widget/sfa/forms/LeadForms.xml (original)
+++ ofbiz/trunk/applications/marketing/widget/sfa/forms/LeadForms.xml Fri May 16 08:24:05 2008
@@ -34,21 +34,21 @@
             </entity-one>
         </row-actions>
         <field name="partyId" title="${uiLabelMap.PartyPartyId}">
-            <hyperlink target="viewprofile?partyId=${partyRow.partyId}&amp;partyTypeId=${partyRow.partyTypeId}&amp;roleTypeId=LEAD" description="${partyRow.partyId}" target-type="inter-app"/>
+            <hyperlink target="viewprofile?partyId=${partyRow.partyId}&amp;roleTypeId=LEAD" description="${partyRow.partyId}" target-type="inter-app"/>
         </field>
         <field name="partyName" title="${uiLabelMap.PartyName}" use-when="partyGroup != null"><display description="${partyGroup.groupName}"/></field>
         <field name="partyName" title="${uiLabelMap.PartyName}" use-when="person != null"><display description="${person.lastName}, ${person.firstName}"/></field>
         <field name="partyTypeId" title="${uiLabelMap.PartyType}"><display description="${partyType.description}"/> </field>
     </form>
 
-    <form name="createLead" type="single" target="createLead" header-row-style="header-row" default-table-style="basic-table">
+    <form name="createLead" type="single" target="createLead" header-row-style="header-row" default-table-style="basic-table" default-map-name="contactDetailMap">
         <field name="firstName" tooltip="${uiLabelMap.CommonRequired}" widget-style="required"><text/></field>
         <field name="lastName" tooltip="${uiLabelMap.CommonRequired}" widget-style="required"><text/></field>
         <field name="suffix"><text/></field>
         <field name="groupName"><text/></field>
         <field name="title"><text/></field>
         <field name="numEmployees" title="${uiLabelMap.MarketingNoOfEmployees}"><text size="30"/></field>
-        <field name="siteName" title="${uiLabelMap.FormFieldTitle_officeSiteName}"><text size="30" maxlength="60"/></field>
+        <field name="officeSiteName" title="${uiLabelMap.FormFieldTitle_officeSiteName}"><text size="30" maxlength="60"/></field>
         <field name="postalAddressTitle" title="${uiLabelMap.PartyGeneralCorrespondenceAddress}" title-area-style="group-label"><display description=" " also-hidden="false"/></field>
         <field name="address1" title="${uiLabelMap.CommonAddress1}" tooltip="${uiLabelMap.CommonRequired}" widget-style="required"><text size="50" maxlength="60"/></field>
         <field name="address2" title="${uiLabelMap.CommonAddress2}"><text size="50" maxlength="60"/></field>