svn commit: r655499 - /ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml

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

svn commit: r655499 - /ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml

mor-2
Author: mor
Date: Mon May 12 06:41:20 2008
New Revision: 655499

URL: http://svn.apache.org/viewvc?rev=655499&view=rev
Log:
Patch from Jyotsna Rathore for Screens to manage Leads in SFA webapp from Jira Issue OFBIZ-1643 (https://issues.apache.org/jira/browse/OFBIZ-1643)

Modified:
    ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml

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=655499&r1=655498&r2=655499&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 Mon May 12 06:41:20 2008
@@ -25,25 +25,36 @@
     
         <set field="parameters.roleTypeId" value="LEAD"/>
         <call-simple-method method-name="createPersonRoleAndContactMechs" xml-resource="org/ofbiz/party/party/PartySimpleMethods.xml"/>
-        <if-not-empty field-name="parameters.partyIdFrom">
-            <set field="partyRelationshipContext.partyIdFrom" from-field="parameters.partyIdFrom"/>
+        <if-not-empty field-name="userLogin.partyId">
+            <set field="partyRelationshipContext.partyIdFrom" from-field="userLogin.partyId"/>
             <set field="partyRelationshipContext.partyIdTo" from-field="partyId"/>
-            <set field="partyRelationshipContext.roleTypeIdFrom" value="LEAD"/>
-            <set field="partyRelationshipContext.roleTypeIdTo" value="OWNER"/>
+            <set field="partyRelationshipContext.roleTypeIdFrom" value="OWNER"/>
+            <set field="partyRelationshipContext.roleTypeIdTo" value="LEAD"/>
             <set field="partyRelationshipContext.partyRelationshipTypeId" value="LEAD_OWNER"/>
             <call-service service-name="createPartyRelationship" in-map-name="partyRelationshipContext"/>
         </if-not-empty>
         <!-- Now create PartyGroup corresponding to the companyName, if its not null and then set up relationship of Person and PartyGroup as Employee and title -->
         <if-not-empty field-name="parameters.groupName">
-        <set field="parameters.partyTypeId" value="PARTY_GROUP"/>    
-        <call-map-processor processor-name="partyGroup" in-map-name="parameters" out-map-name="partyGroupContext"
-            xml-resource="org/ofbiz/party/party/PartyMapProcs.xml"/>
-        <call-service service-name="createPartyGroup" in-map-name="partyGroupContext">
-            <result-to-field result-name="partyId" field-name="partyGroupPartyId"/>        
-        </call-service>
-        <set field="createPartyRoleCtx.partyId" from-field="partyId"/>
-        <set field="createPartyRoleCtx.roleTypeId" value="EMPLOYEE"/>
-        <call-service service-name="createPartyRole" in-map-name="createPartyRoleCtx"/>
+            <set field="parameters.partyTypeId" value="PARTY_GROUP"/>    
+            <call-map-processor processor-name="partyGroup" in-map-name="parameters" out-map-name="partyGroupContext"
+                xml-resource="org/ofbiz/party/party/PartyMapProcs.xml"/>
+            <call-service service-name="createPartyGroup" in-map-name="partyGroupContext">
+                <result-to-field result-name="partyId" field-name="partyGroupPartyId"/>        
+            </call-service>
+            <set field="createPartyRoleCtx.partyId" from-field="partyGroupPartyId"/>
+            <set field="createPartyRoleCtx.roleTypeId" value="LEAD"/>
+            <call-service service-name="createPartyRole" in-map-name="createPartyRoleCtx"/>
+
+            <set field="createPartyRoleCtx.partyId" from-field="partyId"/>
+            <set field="createPartyRoleCtx.roleTypeId" value="EMPLOYEE"/>
+            <call-service service-name="createPartyRole" in-map-name="createPartyRoleCtx"/>
+          
+            <set field="partyRelationshipContext.partyIdFrom" from-field="partyGroupPartyId"/>
+            <set field="partyRelationshipContext.partyIdTo" from-field="partyId"/>
+            <set field="partyRelationshipContext.roleTypeIdFrom" value="LEAD"/>
+            <set field="partyRelationshipContext.roleTypeIdTo" value="EMPLOYEE"/>
+            <set field="partyRelationshipContext.partyRelationshipTypeId" value="EMPLOYMENT"/>
+            <call-service service-name="createPartyRelationship" in-map-name="partyRelationshipContext"/>
         </if-not-empty>
         
         <log level="verbose" message=" ${partyGroupPartyId}"></log>