Author: hansbak
Date: Tue Jun 3 06:37:06 2008 New Revision: 662794 URL: http://svn.apache.org/viewvc?rev=662794&view=rev Log: improved groofy file, updated lead demo data and made createlead compatible and working now Modified: ofbiz/trunk/applications/marketing/data/sfaDemoData.xml ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml ofbiz/trunk/applications/marketing/widget/sfa/forms/LeadForms.xml ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/setRoleVars.groovy Modified: ofbiz/trunk/applications/marketing/data/sfaDemoData.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/data/sfaDemoData.xml?rev=662794&r1=662793&r2=662794&view=diff ============================================================================== --- ofbiz/trunk/applications/marketing/data/sfaDemoData.xml (original) +++ ofbiz/trunk/applications/marketing/data/sfaDemoData.xml Tue Jun 3 06:37:06 2008 @@ -1,5 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <entity-engine-xml> + <!-- demo owner --> + <Party partyId="admin"/> + <PartyRole partyId="admin" roleTypeId="OWNER"/> + <!-- demo accounts --> <Party partyId="sfa100" partyTypeId="PARTY_GROUP" statusId="PARTY_ENABLED"/> <PartyGroup partyId="sfa100" groupName="A profitable Account"/> @@ -26,13 +30,13 @@ <!-- demo contacts --> <Party partyId="DemoCustomer1"/> <PartyRole partyId="DemoCustomer1" roleTypeId="CONTACT"/> - <PartyRelationship partyIdFrom="sfa100" roleTypeIdFrom="ACCOUNT" partyIdTo="DemoCustomer1" roleTypeIdTo="CONTACT" fromDate="2000-01-01 00:00:00.000" partyRelationshipTypeId="CONTACT_REL"/> + <PartyRelationship partyIdFrom="sfa100" roleTypeIdFrom="ACCOUNT" partyIdTo="DemoCustomer1" roleTypeIdTo="CONTACT" fromDate="2000-01-01 00:00:00.000" partyRelationshipTypeId="EMPLOYMENT"/> <Party partyId="DemoCustomer2"/> <PartyRole partyId="DemoCustomer2" roleTypeId="CONTACT"/> - <PartyRelationship partyIdFrom="DemoCustCompany" roleTypeIdFrom="ACCOUNT" partyIdTo="DemoCustomer2" roleTypeIdTo="CONTACT" fromDate="2000-01-01 00:00:00.000" partyRelationshipTypeId="CONTACT_REL"/> + <PartyRelationship partyIdFrom="DemoCustCompany" roleTypeIdFrom="ACCOUNT" partyIdTo="DemoCustomer2" roleTypeIdTo="CONTACT" fromDate="2000-01-01 00:00:00.000" partyRelationshipTypeId="EMPLOYMENT"/> <Party partyId="DemoCustomer3"/> <PartyRole partyId="DemoCustomer3" roleTypeId="CONTACT"/> - <PartyRelationship partyIdFrom="DemoCustCompany" roleTypeIdFrom="ACCOUNT" partyIdTo="DemoCustomer3" roleTypeIdTo="CONTACT" fromDate="2000-01-01 00:00:00.000" partyRelationshipTypeId="CONTACT_REL"/> + <PartyRelationship partyIdFrom="DemoCustCompany" roleTypeIdFrom="ACCOUNT" partyIdTo="DemoCustomer3" roleTypeIdTo="CONTACT" fromDate="2000-01-01 00:00:00.000" partyRelationshipTypeId="EMPLOYMENT"/> <!-- demo lead --> <Party partyId="sfa102" partyTypeId="PARTY_GROUP" statusId="PARTY_ENABLED"/> @@ -42,7 +46,10 @@ <Person partyId="sfa101" firstName="John" lastName="Lead"/> <PartyRole partyId="sfa101" roleTypeId="_NA_"/> <PartyRole partyId="sfa101" roleTypeId="LEAD"/> - <PartyRelationship partyIdFrom="sfa102" roleTypeIdFrom="ACCOUNT_LEAD" partyIdTo="sfa101" roleTypeIdTo="LEAD" fromDate="2000-01-01 00:00:00.000" partyRelationshipTypeId="LEAD_REL"/> + <!-- company to lead relationship --> + <PartyRelationship partyIdFrom="sfa102" roleTypeIdFrom="ACCOUNT_LEAD" partyIdTo="sfa101" roleTypeIdTo="LEAD" fromDate="2000-01-01 00:00:00.000" partyRelationshipTypeId="EMPLOYMENT"/> + <!-- owner to lead relationship --> + <PartyRelationship partyIdFrom="admin" roleTypeIdFrom="OWNER" partyIdTo="sfa101" roleTypeIdTo="LEAD" fromDate="2000-01-01 00:00:00.000" partyRelationshipTypeId="LEAD_OWNER"/> <ContactMech contactMechId="sfa103" contactMechTypeId="EMAIL_ADDRESS" infoString="[hidden email]"/> <PartyContactMech partyId="sfa101" contactMechId="sfa103" fromDate="2000-01-01 00:00:00.000"/> <PartyContactMechPurpose partyId="sfa101" contactMechId="sfa103" contactMechPurposeTypeId="PRIMARY_EMAIL" fromDate="2000-01-01 00:00:00.000"/> 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=662794&r1=662793&r2=662794&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 Tue Jun 3 06:37:06 2008 @@ -81,17 +81,17 @@ <result-to-field result-name="partyId" field-name="partyGroupPartyId"/> </call-service> <set field="createPartyRoleCtx.partyId" from-field="partyGroupPartyId"/> - <set field="createPartyRoleCtx.roleTypeId" value="LEAD"/> + <set field="createPartyRoleCtx.roleTypeId" value="ACCOUNT_LEAD"/> <call-service service-name="createPartyRole" in-map-name="createPartyRoleCtx"/> <set field="createPartyRoleCtx.partyId" from-field="partyId"/> - <set field="createPartyRoleCtx.roleTypeId" value="EMPLOYEE"/> + <set field="createPartyRoleCtx.roleTypeId" value="LEAD"/> <call-service service-name="createPartyRole" in-map-name="createPartyRoleCtx"/> <set field="partyRelationshipCtx.partyIdFrom" from-field="partyGroupPartyId"/> <set field="partyRelationshipCtx.partyIdTo" from-field="partyId"/> - <set field="partyRelationshipCtx.roleTypeIdFrom" value="LEAD"/> - <set field="partyRelationshipCtx.roleTypeIdTo" value="EMPLOYEE"/> + <set field="partyRelationshipCtx.roleTypeIdFrom" value="ACCOUNT_LEAD"/> + <set field="partyRelationshipCtx.roleTypeIdTo" value="LEAD"/> <set field="partyRelationshipCtx.positionTitle" from-field="parameters.title"/> <set field="partyRelationshipCtx.partyRelationshipTypeId" value="EMPLOYMENT"/> <call-service service-name="createPartyRelationship" in-map-name="partyRelationshipCtx"/> 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=662794&r1=662793&r2=662794&view=diff ============================================================================== --- ofbiz/trunk/applications/marketing/widget/sfa/forms/LeadForms.xml (original) +++ ofbiz/trunk/applications/marketing/widget/sfa/forms/LeadForms.xml Tue Jun 3 06:37:06 2008 @@ -33,7 +33,7 @@ <set field="statusId" from-field="partyRow.statusId"/> </row-actions> <field name="partyId" title="${uiLabelMap.PartyPartyId}"> - <hyperlink target="viewprofile?partyId=${partyRow.partyId}" description="${partyRow.partyId}" target-type="inter-app"/> + <hyperlink target="viewprofile?partyId=${partyRow.partyId}" description="${partyRow.partyId}"/> </field> <field name="partyName" title="${uiLabelMap.PartyName}"><display description="${person.lastName}, ${person.firstName}"/></field> <field name="statusId" title="${uiLabelMap.CommonStatus}"><display-entity entity-name="StatusItem" description="${description}" key-field-name="statusId"/></field> Modified: ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/setRoleVars.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/setRoleVars.groovy?rev=662794&r1=662793&r2=662794&view=diff ============================================================================== --- ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/setRoleVars.groovy (original) +++ ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/setRoleVars.groovy Tue Jun 3 06:37:06 2008 @@ -18,28 +18,31 @@ */ import org.ofbiz.entity.*; import org.ofbiz.entity.util.EntityUtil; - import org.ofbiz.base.util.*; roleTypeAndParty = delegator.findByAnd("RoleTypeAndParty", ['partyId': parameters.partyId, 'roleTypeId': 'ACCOUNT']); - if (UtilValidate.isNotEmpty(roleTypeAndParty)) { - context.put("accountDescription", roleTypeAndParty.get(0).getString("description")); + if (roleTypeAndParty) { + context.accountDescription = roleTypeAndParty[0].description; } + roleTypeAndParty = delegator.findByAnd("RoleTypeAndParty", ['partyId': parameters.partyId, 'roleTypeId': 'CONTACT']); - if (UtilValidate.isNotEmpty(roleTypeAndParty)) { - context.put("contactDescription", roleTypeAndParty.get(0).getString("description")); + if (roleTypeAndParty) { + context.contactDescription = roleTypeAndParty.get(0).description; } roleTypeAndParty = delegator.findByAnd("RoleTypeAndParty", ['partyId': parameters.partyId, 'roleTypeId': 'LEAD']); - if (UtilValidate.isNotEmpty(roleTypeAndParty)) { - context.put("leadDescription", roleTypeAndParty.get(0).getString("description")); - partyRelationships = EntityUtil.filterByDate(delegator.findByAnd("PartyRelationship", ["partyIdTo": parameters.partyId, "roleTypeIdFrom": "ACCOUNT_LEAD", "roleTypeIdTo": "LEAD", "partyRelationshipTypeId": "LEAD_REL"])); - context.put("partyGroupId", partyRelationships.get(0).partyIdFrom); - context.put("partyId", parameters.partyId); + if (roleTypeAndParty) { + context.leadDescription = roleTypeAndParty.get(0).description; + partyRelationships = EntityUtil.filterByDate(delegator.findByAnd("PartyRelationship", ["partyIdTo": parameters.partyId, "roleTypeIdFrom": "ACCOUNT_LEAD", "roleTypeIdTo": "LEAD", "partyRelationshipTypeId": "EMPLOYMENT"])); + if (partyRelationships) { + context.partyGroupId = partyRelationships.get(0).partyIdFrom; + context.partyId = parameters.partyId; + } } roleTypeAndParty = delegator.findByAnd("RoleTypeAndParty", ['partyId': parameters.partyId, 'roleTypeId': 'ACCOUNT_LEAD']); - if (UtilValidate.isNotEmpty(roleTypeAndParty)) { - context.put("leadDescription", roleTypeAndParty.get(0).getString("description")); - partyRelationships = EntityUtil.filterByDate(delegator.findByAnd("PartyRelationship", ["partyIdFrom": parameters.partyId, "roleTypeIdFrom": "ACCOUNT_LEAD", "roleTypeIdTo": "LEAD", "partyRelationshipTypeId": "LEAD_REL"])); - context.put("partyGroupId", parameters.partyId); - context.put("partyId", partyRelationships.get(0).partyIdTo); + if (roleTypeAndParty) { + context.leadDescription = ROleTypeAndParty.get(0).description; + partyRelationships = EntityUtil.filterByDate(delegator.findByAnd("PartyRelationship", ["partyIdFrom": parameters.partyId, "roleTypeIdFrom": "ACCOUNT_LEAD", "roleTypeIdTo": "LEAD", "partyRelationshipTypeId": "EMPLOYMENT"])); + if (partyRelationships) { + context.partyGroupId = parameters.partyId; + context.partyId = partyRelationships.get(0).partyIdTo; + } } - |
Free forum by Nabble | Edit this page |