Skip to content

Commit

Permalink
Applied patch (importLead.patch) for importing vCard for Leads (in sf…
Browse files Browse the repository at this point in the history
…a) from Jira issue OFBIZ-1643(https://issues.apache.org/jira/browse/OFBIZ-1643). Thanks Jyotsna Rathore for this patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@659489 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Vikas Mayur committed May 23, 2008
1 parent 27bdcf6 commit 8e56b43
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 6 deletions.
9 changes: 9 additions & 0 deletions applications/marketing/config/MarketingUiLabels.xml
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,9 @@
<property key="PageTitleCreateLead">
<value xml:lang="en">Create New Lead</value>
</property>
<property key="PageTitleCreateLeadFromVCard">
<value xml:lang="en">Create Lead from vCard</value>
</property>
<property key="PageTitleEditAccount">
<value xml:lang="en">Edit Account</value>
</property>
Expand Down Expand Up @@ -1131,6 +1134,9 @@
<property key="SfaAutoCreateContactByImportingVCard">
<value xml:lang="en">Automatically create a new contact by importing a vCard</value>
</property>
<property key="SfaAutoCreateLeadByImportingVCard">
<value xml:lang="en">Automatically create a new lead by importing a vCard</value>
</property>
<property key="SfaAccountName">
<value xml:lang="en">Account Name</value>
</property>
Expand Down Expand Up @@ -1200,6 +1206,9 @@
<property key="SfaForecasts">
<value xml:lang="en">Forecast</value>
</property>
<property key="SfaImportLead">
<value xml:lang="en">Import Lead</value>
</property>
<property key="SfaInitialAccount">
<value xml:lang="en">Initial Account</value>
</property>
Expand Down
2 changes: 1 addition & 1 deletion applications/marketing/data/MarketingTypeData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@ under the License.
<StatusValidChange condition="" statusId="PARTY_ENABLED" statusIdTo="LEAD_ASSIGNED" transitionName="Assigned"/>
<StatusValidChange condition="" statusId="LEAD_ASSIGNED" statusIdTo="LEAD_CONVERTED" transitionName="Converted"/>
<StatusValidChange condition="" statusId="LEAD_ASSIGNED" statusIdTo="LEAD_QUALIFIED" transitionName="Qualified"/>

<StatusValidChange condition="" statusId="LEAD_ASSIGNED" statusIdTo="PARTY_DISABLED" transitionName="Disabled"/>
</entity-engine-xml>
1 change: 1 addition & 0 deletions applications/marketing/servicedef/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ under the License.
<service name="importVCard" engine="java" location="org.ofbiz.sfa.vcard.VCard" invoke="importVCard">
<attribute name="infile" type="java.nio.ByteBuffer" mode="IN" optional="false"/>
<attribute name="partyId" type="String" mode="OUT" optional="false"/>
<attribute name="serviceName" type="String" mode="IN" optional="false"/>
</service>
<service name="exportVCard" engine="java" location="org.ofbiz.sfa.vcard.VCard" invoke="exportVCard">
<attribute name="partyId" type="String" mode="IN" optional="false"/>
Expand Down
3 changes: 2 additions & 1 deletion applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ public static Map importVCard(DispatchContext dctx, Map context) {

GenericValue userLogin = (GenericValue) context.get("userLogin");
serviceCtx.put("userLogin", userLogin);
Map resp = dispatcher.runSync("createContact", serviceCtx);
String serviceName = (String) context.get("serviceName");
Map resp = dispatcher.runSync(serviceName, serviceCtx);
result.put("partyId", resp.get("partyId"));
}
} catch (GenericEntityException e) {
Expand Down
13 changes: 12 additions & 1 deletion applications/marketing/webapp/sfa/WEB-INF/controller.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,16 @@ under the License.
<response name="success" type="view" value="viewprofile"/>
<response name="error" type="view" value="MergeLeads"/>
</request-map>
<request-map uri="CreateLeadFromVCard">
<security https="true" auth="true"/>
<response name="success" type="view" value="CreateLeadFromVCard"/>
</request-map>
<request-map uri="createLeadFromVCard">
<security https="true" auth="true"/>
<event type="service" invoke="importVCard"/>
<response name="success" type="view" value="viewprofile"/><!-- What would be the view in case a vCard has more than one contact -->
<response name="error" type="view" value="CreateLeadFromVCard"/>
</request-map>
<!-- Contact Requests -->
<request-map uri="FindContacts">
<security https="true" auth="true"/>
Expand Down Expand Up @@ -181,7 +191,8 @@ under the License.
<view-map name="CloneLead" type="screen" page="component://marketing/widget/sfa/LeadScreens.xml#CloneLead"/>
<view-map name="ConvertLead" type="screen" page="component://marketing/widget/sfa/LeadScreens.xml#ConvertLead"/>
<view-map name="MergeLeads" type="screen" page="component://marketing/widget/sfa/LeadScreens.xml#MergeLeads"/>

<view-map name="CreateLeadFromVCard" type="screen" page="component://marketing/widget/sfa/LeadScreens.xml#CreateLeadFromVCard"/>

<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"/>
Expand Down
35 changes: 34 additions & 1 deletion applications/marketing/widget/sfa/LeadScreens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ under the License.
</widgets>
</section>
</screen>

<screen name="CreateLead">
<section>
<actions>
Expand Down Expand Up @@ -101,6 +102,7 @@ under the License.
</widgets>
</section>
</screen>

<screen name="ConvertLead">
<section>
<widgets>
Expand All @@ -127,6 +129,7 @@ under the License.
</widgets>
</section>
</screen>

<screen name="CloneLead">
<section>
<actions>
Expand Down Expand Up @@ -156,6 +159,7 @@ under the License.
</widgets>
</section>
</screen>

<screen name="MergeLeads">
<section>
<actions>
Expand Down Expand Up @@ -192,4 +196,33 @@ under the License.
</widgets>
</section>
</screen>
</screens>

<screen name="CreateLeadFromVCard">
<section>
<actions>
<set field="titleProperty" value="PageTitleCreateLeadFromVCard"/>
<set field="tabButtonItem" value="Leads"/>
</actions>
<widgets>
<decorator-screen name="CommonLeadDecorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<container style="screenlet">
<container style="screenlet-title-bar">
<container style="h3"><label text="${uiLabelMap.PageTitleCreateLeadFromVCard}"/></container>
</container>
<container><label style="h3" text="${uiLabelMap.SfaAutoCreateLeadByImportingVCard}"/></container>
<container style="screenlet-body">
<section>
<widgets>
<label>&lt;br/&gt;</label>
<include-form name="CreateLeadFromVCard" location="component://marketing/widget/sfa/forms/LeadForms.xml"/>
</widgets>
</section>
</container>
</container>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
</screens>
3 changes: 3 additions & 0 deletions applications/marketing/widget/sfa/SfaMenus.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ under the License.
<menu-item name="CreateLead" title="${uiLabelMap.CommonCreate} ${uiLabelMap.SfaLead}">
<link target="CreateLead"/>
</menu-item>
<menu-item name="createLeadFromVCard" title="${uiLabelMap.SfaImportLead}">
<link target="CreateLeadFromVCard"/>
</menu-item>
<menu-item name="convertLead" title="${uiLabelMap.SfaConvertLead}">
<condition><not><if-empty field-name="parameters.partyId"/></not></condition>
<link target="ConvertLead?leadPartyId=${parameters.partyId}"/>
Expand Down
1 change: 1 addition & 0 deletions applications/marketing/widget/sfa/forms/ContactForms.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ under the License.

<form name="CreateContactFromVCard" type="upload" target="createContactFromVCard" header-row-style="header-row" default-table-style="basic-table">
<field name="infile" title="${uiLabelMap.SfaUploadVCard}"><file/></field>
<field name="serviceName"><hidden value="createContact"/></field>
<field name="submitButton" title="${uiLabelMap.CommonUpload}" widget-style="smallSubmit"><submit button-type="button"/></field>
</form>
</forms>
12 changes: 10 additions & 2 deletions applications/marketing/widget/sfa/forms/LeadForms.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ under the License.

<forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd">

<form name="ListLeads" type="list" list-name="partyList" list-entry-name="partyRow" paginate-target="FindLead"
odd-row-style="alternate-row" default-table-style="basic-table hover-bar" separate-columns="true">
<row-actions>
Expand All @@ -34,8 +35,7 @@ under the License.
<hyperlink target="viewprofile?partyId=${partyRow.partyId}&amp;roleTypeId=LEAD" description="${partyRow.partyId}" target-type="inter-app"/>
</field>
<field name="partyName" title="${uiLabelMap.PartyName}"><display description="${person.lastName}, ${person.firstName}"/></field>
<field name="statusId" title="${uiLabelMap.CommonStatus}"><display description=""/></field>
<field name="partyTypeId" title="${uiLabelMap.PartyType}"><display description="${partyType.description}"/> </field>
<field name="statusId" title="${uiLabelMap.CommonStatus}"><display-entity entity-name="StatusItem" description="${description}" key-field-name="statusId"/></field>
</form>

<form name="createLead" type="single" target="createLead" header-row-style="header-row" default-table-style="basic-table" default-map-name="contactDetailMap">
Expand Down Expand Up @@ -78,6 +78,7 @@ under the License.
<field name="leadSource" title="${uiLabelMap.SfaLeadSource}"><text size="50" maxlength="60"/></field>
<field name="submitButton" title="${uiLabelMap.CommonSave}" widget-style="smallSubmit"><submit button-type="button"/></field>
</form>

<form name="ConvertLead" type="single" target="convertLead" id="ConvertLead" >
<actions>
<set field="leadPartyId" from-field="parameters.leadPartyId"></set>
Expand All @@ -92,6 +93,7 @@ under the License.
</field>
<field name="submitButton"><submit button-type="button"/></field>
</form>

<form name="MergeLeads" type="single" target="MergeLeads">
<actions>
<set field="roleTypeId" value="LEAD"/>
Expand All @@ -111,4 +113,10 @@ under the License.
</field>
<field name="submitButton" position="3" title="${uiLabelMap.SfaMergeleads}" widget-style="buttontext" tooltip-style="button-text"><submit button-type="text-link"/></field>
</form>

<form name="CreateLeadFromVCard" type="upload" target="createLeadFromVCard" header-row-style="header-row" default-table-style="basic-table">
<field name="infile" title="${uiLabelMap.SfaUploadVCard}"><file/></field>
<field name="serviceName"><hidden value="createLead"/></field>
<field name="submitButton" title="${uiLabelMap.CommonUpload}" widget-style="smallSubmit"><submit button-type="button"/></field>
</form>
</forms>

0 comments on commit 8e56b43

Please sign in to comment.