You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ha...@apache.org on 2009/11/09 11:37:53 UTC

svn commit: r834010 - in /ofbiz/trunk/applications: marketing/config/ marketing/webapp/sfa/WEB-INF/ marketing/widget/sfa/ marketing/widget/sfa/forms/ party/config/ party/widget/partymgr/

Author: hansbak
Date: Mon Nov  9 10:37:52 2009
New Revision: 834010

URL: http://svn.apache.org/viewvc?rev=834010&view=rev
Log:

1. combine opportunity's id and name to single field.
2. add 'headerItem' as communicationevent list item link's parameter for height light menu bar
3. fix 'assign to me' buttom shifts to the left.
4. add related company button and form for create new related company in lead and contact.
5. add email buttons in sfa's communication event
6. add lookup screen and form for account lead.
7. fix telecomNumber display format. look ListWorkEffortContactMechs as example
8. rename button 'assign existing account lead' in leads to 'add related company
9. remove assigning existing account in contact
10. on all screens add a 'find' button to go back to the find screen
11. When click on comvert lead, show the message: 'Please first add related company' when company is empty

Modified:
    ofbiz/trunk/applications/marketing/config/MarketingUiLabels.xml
    ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/controller.xml
    ofbiz/trunk/applications/marketing/widget/sfa/AccountScreens.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/LookupScreens.xml
    ofbiz/trunk/applications/marketing/widget/sfa/SfaMenus.xml
    ofbiz/trunk/applications/marketing/widget/sfa/forms/AccountForms.xml
    ofbiz/trunk/applications/marketing/widget/sfa/forms/ContactForms.xml
    ofbiz/trunk/applications/marketing/widget/sfa/forms/LeadForms.xml
    ofbiz/trunk/applications/marketing/widget/sfa/forms/LookupForms.xml
    ofbiz/trunk/applications/party/config/PartyUiLabels.xml
    ofbiz/trunk/applications/party/widget/partymgr/CommunicationEventForms.xml
    ofbiz/trunk/applications/party/widget/partymgr/PartyForms.xml
    ofbiz/trunk/applications/party/widget/partymgr/PartyScreens.xml

Modified: ofbiz/trunk/applications/marketing/config/MarketingUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/config/MarketingUiLabels.xml?rev=834010&r1=834009&r2=834010&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/config/MarketingUiLabels.xml (original)
+++ ofbiz/trunk/applications/marketing/config/MarketingUiLabels.xml Mon Nov  9 10:37:52 2009
@@ -1259,9 +1259,11 @@
     </property>
     <property key="PageTitleAssignLeadFromExisting">
         <value xml:lang="en">Assign Existing Lead</value>
+        <value xml:lang="th">กำหนด Lead ที่มีอยู่</value>
     </property>
     <property key="PageTitleAssignAccountFromExisting">
         <value xml:lang="en">Assign Existing Account</value>
+        <value xml:lang="th">กำหนด Account ที่มีอยู่</value>
     </property>
     <property key="PageTitleCreateAccount">
         <value xml:lang="en">Create New Account</value>
@@ -1897,6 +1899,14 @@
         <value xml:lang="it">Ricerca leads</value>
         <value xml:lang="zh">查找线索</value>
     </property>
+    <property key="SfaFindAccounts">
+        <value xml:lang="en">Find Accounts</value>
+        <value xml:lang="th">ค้นหา Accounts</value>
+    </property>
+    <property key="SfaFindAccountLeads">
+        <value xml:lang="en">Find Account Leads</value>
+        <value xml:lang="th">ค้นหา Account Leads</value>
+    </property>
     <property key="SfaFindOpportunities">
         <value xml:lang="en">Find Opportunities</value>
         <value xml:lang="es">Buscar oportunidades</value>

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=834010&r1=834009&r2=834010&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/controller.xml Mon Nov  9 10:37:52 2009
@@ -137,6 +137,10 @@
         <event type="service" invoke="createPartyDataSource"/>
         <response name="success" type="request" value="viewprofile"/>
     </request-map>
+    <request-map uri="AddRelatedCompany">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="AddRelatedCompany"/>
+    </request-map>
     <!-- Contact Requests -->
     <request-map uri="FindContacts">
         <security https="true" auth="true"/>
@@ -235,6 +239,7 @@
     <request-map uri="LookupProductCategory"><security auth="true" https="true"/><response name="success" type="view" value="LookupProductCategory"/></request-map>
     <request-map uri="LookupLeads"><security auth="true" https="true"/><response name="success" type="view" value="LookupLeads"/></request-map>
     <request-map uri="LookupAccounts"><security auth="true" https="true"/><response name="success" type="view" value="LookupAccounts"/></request-map>
+    <request-map uri="LookupAccountLeads"><security auth="true" https="true"/><response name="success" type="view" value="LookupAccountLeads"/></request-map>
     <!-- end of request mappings -->
 
     <!-- View Mappings -->
@@ -255,6 +260,7 @@
     <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="NewLeadFromVCard" type="screen" page="component://marketing/widget/sfa/LeadScreens.xml#NewLeadFromVCard"/>
+    <view-map name="AddRelatedCompany" type="screen" page="component://marketing/widget/sfa/LeadScreens.xml#AddRelatedCompany"/>
 
     <view-map name="FindContacts" type="screen" page="component://marketing/widget/sfa/ContactScreens.xml#FindContacts"/>
     <view-map name="NewContact" type="screen" page="component://marketing/widget/sfa/ContactScreens.xml#NewContact"/>
@@ -270,6 +276,7 @@
     <view-map name="LookupProductCategory" type="screen" page="component://product/widget/catalog/LookupScreens.xml#LookupProductCategory"/>
     <view-map name="LookupLeads" type="screen" page="component://marketing/widget/sfa/LookupScreens.xml#LookupLeads"/>
     <view-map name="LookupAccounts" type="screen" page="component://marketing/widget/sfa/LookupScreens.xml#LookupAccounts"/>
+    <view-map name="LookupAccountLeads" type="screen" page="component://marketing/widget/sfa/LookupScreens.xml#LookupAccountLeads"/>
 
     <!-- end of view mappings -->
 </site-conf>
\ No newline at end of file

Modified: ofbiz/trunk/applications/marketing/widget/sfa/AccountScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/widget/sfa/AccountScreens.xml?rev=834010&r1=834009&r2=834010&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/widget/sfa/AccountScreens.xml (original)
+++ ofbiz/trunk/applications/marketing/widget/sfa/AccountScreens.xml Mon Nov  9 10:37:52 2009
@@ -26,6 +26,9 @@
                 <set field="titleProperty" value="MarketingFindAccounts"/>
                 <set field="currentUrl" value="FindAccounts"/>
                 <set field="headerItem" value="Accounts"/>
+                <set field="setAccountDescription" value="${groovy:session.setAttribute(&quot;accountDescription&quot;,headerItem)}"/>
+                <set field="removeContactDescription" value="${groovy:session.removeAttribute(&quot;contactDescription&quot;)}"/>
+                <set field="removeLeadDescription" value="${groovy:session.removeAttribute(&quot;removeDescription&quot;)}"/>
             </actions>
             <widgets>
                 <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
@@ -81,7 +84,7 @@
                 <property-to-field field="defaultCountryGeoId" resource="general" property="country.geo.id.default" default="USA"/>
             </actions>
             <widgets>
-                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
+                <decorator-screen name="CommonAccountDecorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
                         <container style="no-clear">
                             <screenlet title="${uiLabelMap.PageTitleCreateAccount}">

Modified: ofbiz/trunk/applications/marketing/widget/sfa/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/widget/sfa/CommonScreens.xml?rev=834010&r1=834009&r2=834010&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/widget/sfa/CommonScreens.xml (original)
+++ ofbiz/trunk/applications/marketing/widget/sfa/CommonScreens.xml Mon Nov  9 10:37:52 2009
@@ -117,9 +117,45 @@
                 <entity-one entity-name="Party" value-field="party"/>
                 <entity-one entity-name="Person" value-field="lookupPerson"/>
                 <entity-one entity-name="PartyGroup" value-field="lookupGroup"/>
+                <set field="accountDescription" value="${groovy:session.getAttribute(&quot;accountDescription&quot;)}"/>
+                <set field="contactDescription" value="${groovy:session.getAttribute(&quot;contactDescription&quot;)}"/>
+                <set field="leadDescription" value="${groovy:session.getAttribute(&quot;leadDescription&quot;)}"/>
             </actions>
             <widgets>
-                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
+                <section>
+                    <condition>
+                        <or>
+                            <not><if-empty field="leadDescription"/></not>
+                            <not><if-empty field="accountLeadDescription"/></not>
+                        </or>
+                    </condition>
+                    <actions>
+                        <set field="headerItem" value="Leads"/>
+                        <set field="currentCommonDecorator" value="CommonLeadDecorator"/>
+                    </actions>
+                    <widgets/>
+                </section>
+                <section>
+                    <condition>
+                        <not><if-empty field="contactDescription"/></not>
+                    </condition>
+                    <actions>
+                        <set field="headerItem" value="Contacts"/>
+                        <set field="currentCommonDecorator" value="CommonContactDecorator"/>
+                    </actions>
+                    <widgets/>
+                </section>
+                <section>
+                    <condition>
+                        <not><if-empty field="accountDescription"/></not>
+                    </condition>
+                    <actions>
+                        <set field="headerItem" value="Accounts"/>
+                        <set field="currentCommonDecorator" value="CommonAccountDecorator"/>
+                    </actions>
+                    <widgets/>
+                </section>
+                <decorator-screen name="${currentCommonDecorator}" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
                         <section>
                             <!-- do check for PARTYMGR, _VIEW permission -->
@@ -129,61 +165,6 @@
                             <widgets>
                                 <section>
                                     <condition>
-                                        <not><if-empty field="party"/></not>
-                                    </condition>
-                                    <widgets>
-                                        <section>
-                                            <condition>
-                                                <if-compare field="headerItem" operator="equals" value="Accounts"/>
-                                            </condition>
-                                            <widgets>
-                                                <include-menu name="AccountTabBar" location="component://marketing/widget/sfa/SfaMenus.xml"/>
-                                            </widgets>
-                                        </section>
-                                        <section>
-                                            <condition>
-                                                <if-compare field="headerItem" operator="equals" value="Leads"/>
-                                            </condition>
-                                            <widgets>
-                                                <include-menu name="LeadTabBar" location="component://marketing/widget/sfa/SfaMenus.xml"/>
-                                            </widgets>
-                                        </section>
-                                        <section>
-                                            <condition>
-                                                <if-compare field="headerItem" operator="equals" value="Contacts"/>
-                                            </condition>
-                                            <widgets>
-                                                <include-menu name="ContactTabBar" location="component://marketing/widget/sfa/SfaMenus.xml"/>
-                                            </widgets>
-                                        </section>
-                                    </widgets>
-                                </section>
-                                <section>
-                                    <condition>
-                                        <if-compare field="headerItem" operator="equals" value="Contacts"/>
-                                    </condition>
-                                    <widgets>
-                                        <include-menu name="ContactSubTabBar" location="component://marketing/widget/sfa/SfaMenus.xml"/>
-                                    </widgets>
-                                </section>
-                                <section>
-                                    <condition>
-                                        <if-compare field="headerItem" operator="equals" value="Accounts"/>
-                                    </condition>
-                                    <widgets>
-                                        <include-menu name="AccountSubTabBar" location="component://marketing/widget/sfa/SfaMenus.xml"/>
-                                    </widgets>
-                                </section>
-                                <section>
-                                    <condition>
-                                        <if-compare field="headerItem" operator="equals" value="Leads"/>
-                                    </condition>
-                                    <widgets>
-                                        <include-menu name="LeadSubTabBar" location="component://marketing/widget/sfa/SfaMenus.xml"/>
-                                    </widgets>
-                                </section>
-                                <section>
-                                    <condition>
                                         <and>
                                             <not><if-empty field="party"/></not>
                                             <or>
@@ -227,36 +208,6 @@
                 <set field="parameters.partyGroupId" from-field="partyGroupId"/>
             </actions>
             <widgets>
-                <section>
-                    <condition>
-                        <or>
-                            <not><if-empty field="leadDescription"/></not>
-                            <not><if-empty field="accountLeadDescription"/></not>
-                        </or>
-                    </condition>
-                    <actions>
-                        <set field="headerItem" value="Leads"/>
-                    </actions>
-                    <widgets/>
-                </section>
-                <section>
-                    <condition>
-                        <not><if-empty field="contactDescription"/></not>
-                    </condition>
-                    <actions>
-                        <set field="headerItem" value="Contacts"/>
-                    </actions>
-                    <widgets/>
-                </section>
-                <section>
-                    <condition>
-                        <not><if-empty field="accountDescription"/></not>
-                    </condition>
-                    <actions>
-                        <set field="headerItem" value="Accounts"/>
-                    </actions>
-                    <widgets/>
-                </section>
                 <decorator-screen name="CommonPartyDecorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
                         <section>
@@ -308,11 +259,10 @@
                                 <section>
                                     <condition>
                                         <and>
-                                        <or>
-                                            <not><if-empty field="leadDescription"/></not>
-                                            <not><if-empty field="accountLeadDescription"/></not>
-                                        </or>
-                                            <if-compare field="headerItem" operator="equals" value="Leads"/>
+                                            <or>
+                                                <not><if-empty field="leadDescription"/></not>
+                                                <not><if-empty field="accountLeadDescription"/></not>
+                                            </or>
                                         </and>
                                     </condition>
                                     <widgets>
@@ -395,35 +345,29 @@
     </screen>
     <screen name="CommonCommunicationEventDecorator">
         <section>
-            <condition>
-                <if-empty field="parameters.partyId"/>
-            </condition>
+            <actions>
+                <set field="headerItem" from-field="parameters.headerItem"/>
+                <entity-one entity-name="CommunicationEvent" value-field="communicationEvent"/>
+            </actions>
             <widgets>
-                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
-                    <decorator-section name="body">
-                        <section>
-                            <widgets>
-                                <section>
-                                    <widgets>
-                                        <include-menu name="OpportunityTabBar" location="component://marketing/widget/sfa/SfaMenus.xml"/>
-                                        <include-menu name="OpportunitySubTabBar" location="component://marketing/widget/sfa/SfaMenus.xml"/>
-                                    </widgets>
-                                </section>
-                                <decorator-section-include name="body"/>
-                            </widgets>
-                        </section>
-                    </decorator-section>
-                </decorator-screen>
-            </widgets>
-            <fail-widgets>
                 <section>
+                    <condition>
+                        <if-empty field="parameters.partyId"/>
+                    </condition>
                     <actions>
-                        <set field="headerItem" from-field="parameters.headerItem"/>
+                        <set field="parameters.partyId" from-field="parameters.partyIdFrom"/>
                     </actions>
+                    <widgets/>
+                </section>
+                <section>
+                    <condition>
+                        <not><if-empty field="parameters.partyId"/></not>
+                    </condition>
                     <widgets>
                         <decorator-screen name="CommonPartyDecorator" location="${parameters.mainDecoratorLocation}">
                             <decorator-section name="body">
-                                <container style="screenlet-body">          
+                                <include-menu name="OpportunitySubTabBar" location="component://marketing/widget/sfa/SfaMenus.xml"/>
+                                <container style="screenlet-body">
                                     <container style="no-clear">
                                         <screenlet title="${uiLabelMap.PageTitleListCommunications}">
                                             <decorator-section-include name="body"/>
@@ -431,10 +375,72 @@
                                     </container>
                                 </container>
                             </decorator-section>
-                        </decorator-screen>                        
+                        </decorator-screen>
                     </widgets>
+                    <fail-widgets>
+                        <decorator-screen name="main-decorator">
+                            <decorator-section name="body">
+                                <include-menu name="OpportunityTabBar" location="component://marketing/widget/sfa/SfaMenus.xml"/>
+                                <include-menu name="OpportunitySubTabBar" location="component://marketing/widget/sfa/SfaMenus.xml"/>
+                                <decorator-section-include name="body"/>
+                            </decorator-section>
+                        </decorator-screen>
+                    </fail-widgets>
                 </section>
-            </fail-widgets>
+            </widgets>
+        </section>
+    </screen>
+    <screen name="CommonAccountDecorator">
+        <section>
+            <widgets>
+                <decorator-screen name="main-decorator">
+                    <decorator-section name="body">
+                        <include-menu name="AccountTabBar" location="component://marketing/widget/sfa/SfaMenus.xml"/>
+                        <include-menu name="AccountSubTabBar" location="component://marketing/widget/sfa/SfaMenus.xml"/>
+                        <container style="no-clear">
+                            <decorator-section-include name="body"/>
+                        </container>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+    <screen name="CommonContactDecorator">
+        <section>
+            <widgets>
+                <decorator-screen name="main-decorator">
+                    <decorator-section name="body">
+                        <include-menu name="ContactTabBar" location="component://marketing/widget/sfa/SfaMenus.xml"/>
+                        <include-menu name="ContactSubTabBar" location="component://marketing/widget/sfa/SfaMenus.xml"/>
+                        <container style="no-clear">
+                            <decorator-section-include name="body"/>
+                        </container>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+    <screen name="CommonLeadDecorator">
+        <section>
+            <actions>
+                 <entity-and entity-name="PartyRelationship" list="relatedCompanies" filter-by-date="true">
+                     <field-map field-name="partyIdTo" from-field="partyId"/>
+                     <field-map field-name="roleTypeIdFrom" value="ACCOUNT_LEAD"/>
+                     <field-map field-name="roleTypeIdTo" value="LEAD"/>
+                     <field-map field-name="partyRelationshipTypeId" value="EMPLOYMENT"/>
+                 </entity-and>
+            </actions>
+            <widgets>
+                <decorator-screen name="main-decorator">
+                    <decorator-section name="body">
+                        <include-menu name="LeadTabBar" location="component://marketing/widget/sfa/SfaMenus.xml"/>
+                        <include-menu name="LeadSubTabBar" location="component://marketing/widget/sfa/SfaMenus.xml"/>
+                        <container style="no-clear">
+                            <decorator-section-include name="body"/>
+                        </container>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
         </section>
     </screen>
 </screens>

Modified: ofbiz/trunk/applications/marketing/widget/sfa/ContactScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/widget/sfa/ContactScreens.xml?rev=834010&r1=834009&r2=834010&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/widget/sfa/ContactScreens.xml (original)
+++ ofbiz/trunk/applications/marketing/widget/sfa/ContactScreens.xml Mon Nov  9 10:37:52 2009
@@ -26,6 +26,9 @@
                 <set field="titleProperty" value="MarketingFindContacts"/>
                 <set field="currentUrl" value="FindContacts"/>
                 <set field="headerItem" value="Contacts"/>
+                <set field="setContactDescription" value="${groovy:session.setAttribute(&quot;contactDescription&quot;,headerItem)}"/>
+                <set field="removeAccountDescription" value="${groovy:session.removeAttribute(&quot;accountDescription&quot;)}"/>
+                <set field="removeLeadDescription" value="${groovy:session.removeAttribute(&quot;leadDescription&quot;)}"/>
             </actions>
             <widgets>
                 <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
@@ -76,7 +79,7 @@
                 <property-to-field field="defaultCountryGeoId" resource="general" property="country.geo.id.default" default="USA"/>
             </actions>
             <widgets>
-                <decorator-screen name="CommonPartyDecorator" location="${parameters.mainDecoratorLocation}">
+                <decorator-screen name="CommonContactDecorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
                         <screenlet title="${uiLabelMap.CommonCreate} ${uiLabelMap.SfaContact}">
                             <include-form name="NewContact" location="component://marketing/widget/sfa/forms/ContactForms.xml"/>
@@ -95,7 +98,7 @@
                 <script location="component://marketing/webapp/sfa/WEB-INF/action/MergeContacts.groovy"/>
             </actions>
             <widgets>
-                <decorator-screen name="CommonPartyDecorator" location="${parameters.mainDecoratorLocation}">
+                <decorator-screen name="CommonContactDecorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
                         <screenlet title="${uiLabelMap.SfaMergeContacts}">
                             <include-form name="MergeContacts" location="component://marketing/widget/sfa/forms/ContactForms.xml"/>
@@ -128,7 +131,7 @@
                 <set field="headerItem" value="Contacts"/>
             </actions>
             <widgets>
-                <decorator-screen name="CommonPartyDecorator" location="${parameters.mainDecoratorLocation}">
+                <decorator-screen name="CommonContactDecorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
                         <screenlet title="${uiLabelMap.PageTitleCreateContactFromVCard}">
                             <container><label style="h3" text="${uiLabelMap.SfaAutoCreateContactByImportingVCard}"/></container>

Modified: ofbiz/trunk/applications/marketing/widget/sfa/LeadScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/widget/sfa/LeadScreens.xml?rev=834010&r1=834009&r2=834010&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/widget/sfa/LeadScreens.xml (original)
+++ ofbiz/trunk/applications/marketing/widget/sfa/LeadScreens.xml Mon Nov  9 10:37:52 2009
@@ -26,6 +26,9 @@
                 <set field="titleProperty" value="MarketingFindLeads"/>
                 <set field="currentUrl" value="FindLeads"/>
                 <set field="headerItem" value="Leads"/>
+                <set field="setLeadtDescription" value="${groovy:session.setAttribute(&quot;leadDescription&quot;,headerItem)}"/>
+                <set field="removeAccountDescription" value="${groovy:session.removeAttribute(&quot;accountDescription&quot;)}"/>
+                <set field="removeContactDescription" value="${groovy:session.removeAttribute(&quot;contactDescription&quot;)}"/>
             </actions>
             <widgets>
                 <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
@@ -77,7 +80,7 @@
                 <property-to-field field="defaultCountryGeoId" resource="general" property="country.geo.id.default" default="USA"/>
             </actions>
             <widgets>
-                <decorator-screen name="CommonPartyDecorator" location="${parameters.mainDecoratorLocation}">
+                <decorator-screen name="CommonLeadDecorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
                         <screenlet title="${uiLabelMap.CommonCreate} ${uiLabelMap.SfaLead}">
                             <include-form name="createLead" location="component://marketing/widget/sfa/forms/LeadForms.xml"/>
@@ -95,11 +98,24 @@
                 <set field="tabButtonItem" value="ConvertLead"/>
             </actions>
             <widgets>
-                <decorator-screen name="CommonPartyDecorator" location="${parameters.mainDecoratorLocation}">
+                <decorator-screen name="CommonLeadDecorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
-                        <screenlet title="${uiLabelMap.SfaConvertLead}">
-                            <include-form name="ConvertLead" location="component://marketing/widget/sfa/forms/LeadForms.xml"/>
-                        </screenlet>
+                        <section>
+                            <condition>
+                                <not><if-empty field="parameters.partyGroupId"/></not>
+                            </condition>
+                            <widgets>
+                                <screenlet title="${uiLabelMap.SfaConvertLead}">
+                                    <include-form name="ConvertLead" location="component://marketing/widget/sfa/forms/LeadForms.xml"/>
+                                </screenlet>
+                            </widgets>
+                            <fail-widgets>
+                                <label text="Please first add related company." style="h2"/>
+                                <screenlet title="${uiLabelMap.PageTitleAddRelatedCompany}" >
+                                    <include-form name="AddRelatedCompany" location="component://marketing/widget/sfa/forms/LeadForms.xml"/>
+                                </screenlet>
+                            </fail-widgets>
+                        </section>
                     </decorator-section>
                 </decorator-screen>
             </widgets>
@@ -114,7 +130,7 @@
                 <script location="component://marketing/webapp/sfa/WEB-INF/action/CloneLead.groovy"/>
             </actions>
             <widgets>
-                <decorator-screen name="CommonPartyDecorator" location="${parameters.mainDecoratorLocation}">
+                <decorator-screen name="CommonLeadDecorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
                         <screenlet title="${uiLabelMap.SfaCloneLead}">
                             <include-form name="createLead" location="component://marketing/widget/sfa/forms/LeadForms.xml"/>
@@ -129,10 +145,11 @@
         <section>
             <actions>
                 <set field="headerItem" value="Leads"/>
+                <set field="tabButtonItem" value="MergeLeads"/>
                 <script location="component://marketing/webapp/sfa/WEB-INF/action/MergeContacts.groovy"/>
             </actions>
             <widgets>
-                <decorator-screen name="CommonPartyDecorator" location="${parameters.mainDecoratorLocation}">
+                <decorator-screen name="CommonLeadDecorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
                         <screenlet title="${uiLabelMap.SfaMergeLeads}">
                             <include-form name="MergeLeads" location="component://marketing/widget/sfa/forms/LeadForms.xml"/>
@@ -163,7 +180,7 @@
                 <set field="headerItem" value="Leads"/>
             </actions>
             <widgets>
-                <decorator-screen name="CommonPartyDecorator" location="${parameters.mainDecoratorLocation}">
+                <decorator-screen name="CommonLeadDecorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
                         <screenlet title="${uiLabelMap.PageTitleCreateLeadFromVCard}">
                             <container><label style="h3" text="${uiLabelMap.SfaAutoCreateLeadByImportingVCard}"/></container>
@@ -191,4 +208,21 @@
             </widgets>
         </section>
     </screen>
+    
+    <screen name="AddRelatedCompany">
+        <section>
+            <actions>
+                <set field="headerItem" value="Leads"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonLeadDecorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <screenlet title="${uiLabelMap.PageTitleAddRelatedCompany}" >
+                            <include-form name="AddRelatedCompany" location="component://marketing/widget/sfa/forms/LeadForms.xml"/>
+                        </screenlet>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 </screens>
\ No newline at end of file

Modified: ofbiz/trunk/applications/marketing/widget/sfa/LookupScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/widget/sfa/LookupScreens.xml?rev=834010&r1=834009&r2=834010&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/widget/sfa/LookupScreens.xml (original)
+++ ofbiz/trunk/applications/marketing/widget/sfa/LookupScreens.xml Mon Nov  9 10:37:52 2009
@@ -71,5 +71,30 @@
             </widgets>
         </section>
     </screen>
+    <screen name="LookupAccountLeads">
+        <section>
+            <actions>
+                <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
+                <property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/>
+                <property-map resource="MarketingUiLabels" map-name="uiLabelMap" global="true"/>
+                <property-map resource="OrderUiLabels" map-name="uiLabelMap" global="true"/>
+                <set field="partyRelationshipTypeId" value="ACCOUNT"/>
+                <set field="title" value="${uiLabelMap.SfaFindAccountLeads}"/>
+                <set field="partyTypeId" value="PARTY_GROUP"/>
+                <set field="currentUrl" value="LookupAccountLeads"/>
+                <service service-name="findParty" auto-field-map="true"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="LookupDecorator" location="component://common/widget/CommonScreens.xml">
+                    <decorator-section name="search-options">
+                        <include-form name="FindAccounts" location="component://marketing/widget/sfa/forms/AccountForms.xml"/>
+                    </decorator-section>
+                    <decorator-section name="search-results">
+                        <include-form name="listLookupAccountLead" location="component://marketing/widget/sfa/forms/LookupForms.xml"/>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 
 </screens>
\ No newline at end of file

Modified: ofbiz/trunk/applications/marketing/widget/sfa/SfaMenus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/widget/sfa/SfaMenus.xml?rev=834010&r1=834009&r2=834010&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/widget/sfa/SfaMenus.xml (original)
+++ ofbiz/trunk/applications/marketing/widget/sfa/SfaMenus.xml Mon Nov  9 10:37:52 2009
@@ -52,13 +52,18 @@
         <menu-item name="NewCommEvent" title="${uiLabelMap.PartyNewEmail}">
             <link target="/partymgr/control/NewDraftCommunicationEvent" url-mode="inter-app" link-type="hidden-form">
                 <parameter param-name="communicationEventTypeId" value="EMAIL_COMMUNICATION"/>
-                <parameter param-name="partyIdTo" from-field="leadPartyResult.partyId"/>
                 <parameter param-name="partyIdFrom" from-field="userLogin.partyId"/>
                 <parameter param-name="my" value="My"/>
                 <parameter param-name="statusId" value="COM_PENDING"/>
             </link>
         </menu-item>
         <menu-item name="reply" title="${uiLabelMap.PartyReply}">
+            <condition>
+                <and>
+                    <not><if-empty field="communicationEvent"/></not>
+                    <not><if-empty field="communicationEvent.partyIdFrom"/></not>
+                </and>
+            </condition>
             <link target="/partymgr/control/NewDraftCommunicationEvent" url-mode="inter-app" link-type="hidden-form">
                 <parameter param-name="parentCommEventId" from-field="parameters.communicationEventId"/>
                 <parameter param-name="my" value="My"/>
@@ -68,6 +73,12 @@
             </link>
         </menu-item>
         <menu-item name="replyAll" title="${uiLabelMap.PartyReplyAll}">
+            <condition>
+                <and>
+                    <not><if-empty field="communicationEvent"/></not>
+                    <not><if-empty field="communicationEvent.partyIdFrom"/></not>
+                </and>
+            </condition>
             <link target="/partymgr/control/NewDraftCommunicationEvent" url-mode="inter-app" link-type="hidden-form">
                 <parameter param-name="parentCommEventId" from-field="parameters.communicationEventId"/>
                 <parameter param-name="my" value="My"/>
@@ -76,10 +87,41 @@
                 <parameter param-name="action" value="REPLYALL"/>
             </link>
         </menu-item>
+        <menu-item name="forward" title="${uiLabelMap.PartyForward}">
+            <condition>
+                <not><if-empty field="communicationEvent"/></not>
+            </condition>
+            <link target="/partymgr/control/NewDraftCommunicationEvent" url-mode="inter-app" link-type="hidden-form">
+                <parameter param-name="communicationEventTypeId" from-field="communicationEvent.communicationEventTypeId"/>
+                <parameter param-name="origCommEventId" from-field="parameters.communicationEventId"/>
+                <parameter param-name="partyIdFrom" from-field="parameters.partyId"/>
+                <parameter param-name="my" value="My"/>
+                <parameter param-name="statusId" value="COM_PENDING"/>
+                <parameter param-name="action" value="FORWARD"/>
+            </link>
+        </menu-item>
+        <menu-item name="newInternalNote" title="${uiLabelMap.PartyNewInternalNote}">
+            <condition>
+                <and>
+                    <if-has-permission permission="PARTYMGR_CME-NOTE_CREATE"/>
+                    <if-empty field="communicationEvent"/>
+                </and>
+            </condition>
+            <link target="/partymgr/control/NewDraftCommunicationEvent" url-mode="inter-app" link-type="hidden-form">
+                <parameter param-name="communicationEventTypeId" value="COMMENT_NOTE"/>
+                <parameter param-name="partyIdFrom" from-field="parameters.userLogin.partyId"/>
+                <parameter param-name="my" value="My"/>
+                <parameter param-name="statusId" value="COM_PENDING"/>
+            </link>
+        </menu-item>
     </menu>
 
     <menu name="AccountTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml">
+        <menu-item name="find" title="${uiLabelMap.CommonFind}"><link target="FindAccounts"/></menu-item>
         <menu-item name="profile" title="${uiLabelMap.PartyProfile}">
+            <condition>
+                <not><if-empty field="parameters.partyId"/></not>
+            </condition>
             <link target="viewprofile">
                 <parameter param-name="partyId" from-field="parameters.partyId"/>
             </link>
@@ -123,28 +165,41 @@
     </menu>
 
     <menu name="LeadTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml">
+        <menu-item name="find" title="${uiLabelMap.CommonFind}"><link target="FindLeads"/></menu-item>
         <menu-item name="profile" title="${uiLabelMap.PartyProfile}">
+            <condition>
+                <not><if-empty field="parameters.partyId"/></not>
+            </condition>
             <link target="viewprofile">
                 <parameter param-name="partyId" from-field="parameters.partyId"/>
-                <parameter param-name="partyGroupId" from-field="parameters.partyGroupId"/>
+                <parameter param-name="partyGroupId" value="${parameters.partyGroupId}"/>
             </link>
         </menu-item>
         <menu-item name="ConvertLead" title="${uiLabelMap.SfaConvertLead}">
+            <condition>
+                <not><if-empty field="parameters.partyId"/></not>
+            </condition>
             <link target="ConvertLead">
                 <parameter param-name="partyId" from-field="parameters.partyId"/>
-                <parameter param-name="partyGroupId" from-field="parameters.partyGroupId"/>
+                <parameter param-name="partyGroupId" value="${parameters.partyGroupId}"/>
             </link>
         </menu-item>
         <menu-item name="CloneLead" title="${uiLabelMap.SfaCloneLead}">
+            <condition>
+                <not><if-empty field="parameters.partyId"/></not>
+            </condition>
             <link target="CloneLead">
                 <parameter param-name="partyId" from-field="parameters.partyId"/>
-                <parameter param-name="partyGroupId" from-field="parameters.partyGroupId"/>
+                <parameter param-name="partyGroupId" value="${parameters.partyGroupId}"/>
             </link>
         </menu-item>
         <menu-item name="MergeLeads" title="${uiLabelMap.SfaMergeLeads}">
+            <condition>
+                <not><if-empty field="parameters.partyId"/></not>
+            </condition>
             <link target="MergeLeads">
                 <parameter param-name="partyId" from-field="parameters.partyId"/>
-                <parameter param-name="partyGroupId" from-field="parameters.partyGroupId"/>
+                <parameter param-name="partyGroupId" value="${parameters.partyGroupId}"/>
             </link>
         </menu-item>
     </menu>
@@ -166,6 +221,18 @@
                 <parameter param-name="headerItem" value="Leads"/>
             </link>
         </menu-item>
+        <menu-item name="AddRelatedCompany" title="${uiLabelMap.PageTitleAddRelatedCompany}">
+            <condition>
+                <and>
+                    <not><if-empty field="partyId"/></not>
+                    <if-empty field="relatedCompanies"/>
+                </and>
+            </condition>
+            <link target="AddRelatedCompany">
+                <parameter param-name="partyId" from-field="partyId"/>
+                <parameter param-name="headerItem" value="Leads"/>
+            </link>
+        </menu-item>
     </menu>
     
     <menu name="LeadFindTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml">
@@ -191,13 +258,22 @@
     </menu>
 
     <menu name="ContactTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml">
+        <menu-item name="find" title="${uiLabelMap.CommonFind}"><link target="FindContacts"/></menu-item>
         <menu-item name="profile" title="${uiLabelMap.PartyProfile}">
+            <condition>
+                <not><if-empty field="parameters.partyId"/></not>
+            </condition>
             <link target="viewprofile">
                 <parameter param-name="partyId" from-field="parameters.partyId"/>
             </link>
         </menu-item>
         <menu-item name="MergeContacts" title="${uiLabelMap.SfaMergeContacts}">
-            <link target="MergeContacts"/>
+            <condition>
+                <not><if-empty field="parameters.partyId"/></not>
+            </condition>
+            <link target="MergeContacts">
+                <parameter param-name="partyId" from-field="parameters.partyId"/>
+            </link>
         </menu-item>
     </menu>
     <menu name="ContactSubTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml"

Modified: ofbiz/trunk/applications/marketing/widget/sfa/forms/AccountForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/widget/sfa/forms/AccountForms.xml?rev=834010&r1=834009&r2=834010&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/widget/sfa/forms/AccountForms.xml (original)
+++ ofbiz/trunk/applications/marketing/widget/sfa/forms/AccountForms.xml Mon Nov  9 10:37:52 2009
@@ -89,6 +89,8 @@
         <actions>
             <set field="roleTypeIdFrom" value="OWNER"/>
             <set field="roleTypeIdTo" value="ACCOUNT"/>
+            <set field="relatedCompanyRoleTypeIdTo" value="ACCOUNT"/>
+            <set field="relatedCompanyRoleTypeIdFrom" value="ACCOUNT"/>
             <set field="parameters.statusId" value="PARTY_DISABLED"/>
             <set field="parameters.statusId_op" value="notEqual"/>
             <set field="partyRelationshipTypeId" value="ACCOUNT"/>
@@ -132,8 +134,9 @@
             <set field="countryGeoId" from-field="postalAddress.paCountryGeoId"/>
             <entity-and entity-name="PartyRelationship" list="relatedCompanies" filter-by-date="true">
                 <field-map field-name="partyIdTo" from-field="partyId"/>
-                <field-map field-name="roleTypeIdFrom" value="ACCOUNT"/>
-                <field-map field-name="roleTypeIdTo" value="CONTACT"/>
+                <field-map field-name="roleTypeIdFrom" from-field="relatedCompanyRoleTypeIdFrom"/>
+                <field-map field-name="roleTypeIdTo" from-field="relatedCompanyRoleTypeIdTo"/>
+                <field-map field-name="partyRelationshipTypeId" from-field="relatedCompanyRelationshipTypeId"/>
             </entity-and>
             <set field="relatedCompanyPartyId" from-field="relatedCompanies[0].partyIdFrom" type="Object"/>
             <set field="existRelationship" from-field="existRelationships[0]"/>
@@ -145,7 +148,7 @@
         </field>
         <field name="emailAddress" title="${uiLabelMap.FormFieldTitle_emailAddress}"><display description="${emailAddresses[0].infoString}"/></field>
         <field name="telecomNumber">
-            <display description="${telecomNumber.tnCountryCode}-${telecomNumber.tnAreaCode}-${telecomNumber.tnContactNumber} ${uiLabelMap.PartyContactExt} ${telecomNumber.tnExtension}"/>
+            <display description="${telecomNumber.tnContryCode} ${telecomNumber.tnAreaCode} ${telecomNumber.tnContactNumber} ${telecomNumber.tnAskForName}"/>
         </field>
         <field name="city" title="${uiLabelMap.FormFieldTitle_city}"><display description="${postalAddress.paCity}"/></field>
         <field name="countryGeoId" title="${uiLabelMap.FormFieldTitle_country}">
@@ -156,6 +159,7 @@
                 <parameter param-name="partyId" from-field="relatedCompanyPartyId"/>
             </hyperlink>
         </field>
+        <field name="relatedCompany" use-when="relatedCompanyPartyId==null"><display/></field>
     </form>
     <form name="ListAccounts" extends="listAccounts">
         <field name="assignToMe" use-when="existRelationship==null&amp;&amp;!&quot;false&quot;.equals(parameters.get(&quot;all&quot;))"
@@ -170,6 +174,15 @@
             </hyperlink>
         </field>
         <field name="relatedCompany"><hidden/></field>
+        <sort-order>
+            <sort-field name="partyId"/>
+            <sort-field name="emailAddress"/>
+            <sort-field name="telecomNumber"/>
+            <sort-field name="city"/>
+            <sort-field name="countryGeoId"/>
+            <sort-field name="assignToMe"/>
+            <sort-field name="relatedCompany"/>
+        </sort-order>
     </form>
     <form name="ListMyAccounts" extends="ListAccounts">
         <actions>
@@ -225,4 +238,24 @@
         </actions>
         <field name="infoString" title="${contactMechType.description}"><text-find/></field>
     </form>
+    
+    <form name="listAccountLeads" extends="listAccounts">
+        <actions>
+            <set field="roleTypeIdTo" value="ACCOUNT_LEAD"/>
+            <set field="parameters.statusId" value="PARTY_DISABLED"/>
+            <set field="parameters.statusId_op" value="notEqual"/>
+            <set field="partyRelationshipTypeId" value="ACCOUNT"/>
+            <set field="parameters.roleTypeId" from-field="roleTypeIdTo"/>
+            <set field="fieldList" value="${groovy:[&quot;partyId&quot;,&quot;roleTypeId&quot;]}" type="List"/>
+            <service service-name="performFind" result-map="result" result-map-list="listIt">
+                <field-map field-name="inputFields" from-field="parameters"/>
+                <field-map field-name="entityName" value="PartyRoleAndContactMechDetail"/>
+                <field-map field-name="orderBy" value="partyId"/>
+                <field-map field-name="distinct" value="Y"/>
+                <field-map field-name="fieldList" from-field="fieldList"/>
+                <field-map field-name="viewIndex" from-field="viewIndex"/>
+                <field-map field-name="viewSize" from-field="viewSize"/>
+            </service>
+        </actions>
+    </form>
 </forms>
\ No newline at end of file

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=834010&r1=834009&r2=834010&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/widget/sfa/forms/ContactForms.xml (original)
+++ ofbiz/trunk/applications/marketing/widget/sfa/forms/ContactForms.xml Mon Nov  9 10:37:52 2009
@@ -40,6 +40,9 @@
             <set field="roleTypeIdFrom" value="ACCOUNT"/>
             <set field="roleTypeIdTo" value="CONTACT"/>
             <set field="partyRelationshipTypeId" value="EMPLOYMENT"/>
+            <set field="relatedCompanyRoleTypeIdTo" value="CONTACT"/>
+            <set field="relatedCompanyRoleTypeIdFrom" value="ACCOUNT"/>
+            <set field="relatedCompanyRelationshipTypeId" value="EMPLOYMENT"/>
             <set field="parameters.roleTypeId" from-field="roleTypeIdTo"/>
             <set field="parameters.statusId" value="PARTY_DISABLED"/>
             <set field="parameters.statusId_op" value="notEqual"/>
@@ -59,6 +62,17 @@
                 <parameter param-name="partyId"/>
             </hyperlink>
         </field>
+        <field name="assignToMe" use-when="existRelationship==null&amp;&amp;!&quot;false&quot;.equals(parameters.get(&quot;all&quot;))"
+                title="${uiLabelMap.SfaAssignToMe}" widget-style="buttontext">
+            <hyperlink target="createPartyRelationshipAndRole" description="${uiLabelMap.SfaAssignToMe}">
+                <parameter param-name="partyId" from-field="userLogin.partyId"/>
+                <parameter param-name="roleTypeId" from-field="roleTypeIdFrom"/>
+                <parameter param-name="roleTypeIdFrom"/>
+                <parameter param-name="roleTypeIdTo"/>
+                <parameter param-name="partyRelationshipTypeId"/>
+                <parameter param-name="partyIdTo" from-field="partyId"/>
+            </hyperlink>
+        </field>
         <sort-order>
             <sort-field name="partyId"/>
             <sort-field name="emailAddress"/>
@@ -72,6 +86,9 @@
     </form>
     <form name="ListMyContacts" extends="ListContacts">
         <actions>
+            <set field="relatedCompanyRoleTypeIdTo" value="CONTACT"/>
+            <set field="relatedCompanyRoleTypeIdFrom" value="ACCOUNT"/>
+            <set field="relatedCompanyRelationshipTypeId" value="EMPLOYMENT"/>
             <set field="parameters.partyIdFrom" from-field="userLogin.partyId"/>
             <set field="parameters.roleTypeIdTo" value="CONTACT"/>
             <set field="parameters.partyStatusId" value="PARTY_DISABLED"/>

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=834010&r1=834009&r2=834010&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/widget/sfa/forms/LeadForms.xml (original)
+++ ofbiz/trunk/applications/marketing/widget/sfa/forms/LeadForms.xml Mon Nov  9 10:37:52 2009
@@ -173,6 +173,9 @@
         <actions>
             <set field="roleTypeIdFrom" value="OWNER"/>
             <set field="roleTypeIdTo" value="LEAD"/>
+            <set field="relatedCompanyRoleTypeIdTo" value="LEAD"/>
+            <set field="relatedCompanyRoleTypeIdFrom" value="ACCOUNT_LEAD"/>
+            <set field="relatedCompanyRelationshipTypeId" value="EMPLOYMENT"/>
             <set field="parameters.statusId" value="PARTY_DISABLED"/>
             <set field="parameters.statusId_op" value="notEqual"/>
             <set field="partyRelationshipTypeId" value="LEAD_OWNER"/>
@@ -213,6 +216,9 @@
     </form>
     <form name="ListMyLeads" extends="ListLeads">
         <actions>
+            <set field="relatedCompanyRoleTypeIdTo" value="LEAD"/>
+            <set field="relatedCompanyRoleTypeIdFrom" value="ACCOUNT_LEAD"/>
+            <set field="relatedCompanyRelationshipTypeId" value="EMPLOYMENT"/>
             <set field="parameters.partyIdFrom" from-field="userLogin.partyId"/>
             <set field="parameters.roleTypeIdTo" value="LEAD"/>
             <set field="parameters.partyStatusId" value="PARTY_DISABLED"/>
@@ -231,4 +237,12 @@
         </actions>
         <field name="assignToMe"><hidden/></field>
     </form>
+    <form name="AddRelatedCompany" type="single" target="createPartyRelationship">
+        <field name="roleTypeIdTo"><hidden value="LEAD"/></field>
+        <field name="roleTypeIdFrom"><hidden value="ACCOUNT_LEAD"/></field>
+        <field name="partyRelationshipTypeId"><hidden value="EMPLOYMENT"/></field>
+        <field name="partyIdTo"><hidden value="${parameters.partyId}"/></field>
+        <field name="partyIdFrom" title="${uiLabelMap.PartyRelatedCompany}"><lookup target-form-name="LookupAccountLeads"/></field>
+        <field name="submitButton" title="${uiLabelMap.CommonAdd}"><submit button-type="button"/></field>
+    </form>
 </forms>

Modified: ofbiz/trunk/applications/marketing/widget/sfa/forms/LookupForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/widget/sfa/forms/LookupForms.xml?rev=834010&r1=834009&r2=834010&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/widget/sfa/forms/LookupForms.xml (original)
+++ ofbiz/trunk/applications/marketing/widget/sfa/forms/LookupForms.xml Mon Nov  9 10:37:52 2009
@@ -33,4 +33,10 @@
         </field>
         <field name="relatedCompany"><hidden/></field>
     </form>
+    <form name="listLookupAccountLead" extends="listAccountLeads" extends-resource="component://marketing/widget/sfa/forms/AccountForms.xml">
+        <field name="partyId">
+            <hyperlink also-hidden="false" target-type="plain" description="${partyName} [${partyId}]" target="javascript:set_value('${partyId}')"/>
+        </field>
+        <field name="relatedCompany"><hidden/></field>
+    </form>
 </forms>
\ No newline at end of file

Modified: ofbiz/trunk/applications/party/config/PartyUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/config/PartyUiLabels.xml?rev=834010&r1=834009&r2=834010&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/config/PartyUiLabels.xml (original)
+++ ofbiz/trunk/applications/party/config/PartyUiLabels.xml Mon Nov  9 10:37:52 2009
@@ -1647,6 +1647,10 @@
         <value xml:lang="th">ที่อยู่ที่เหมือนกัน</value>
         <value xml:lang="zh">地址匹配</value>
     </property>
+    <property key="PageTitleAddRelatedCompany">
+        <value xml:lang="en">Add Related Company</value>
+        <value xml:lang="th">เพิ่มบริษัทที่เกี่ยวข้อง</value>
+    </property>
     <property key="PageTitleCommEvents">
         <value xml:lang="de">Kommunikationsereignis</value>
         <value xml:lang="en">Communication Events</value>

Modified: ofbiz/trunk/applications/party/widget/partymgr/CommunicationEventForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/widget/partymgr/CommunicationEventForms.xml?rev=834010&r1=834009&r2=834010&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/widget/partymgr/CommunicationEventForms.xml (original)
+++ ofbiz/trunk/applications/party/widget/partymgr/CommunicationEventForms.xml Mon Nov  9 10:37:52 2009
@@ -401,6 +401,7 @@
                 <parameter param-name="communicationEventId"/>
                 <parameter param-name="partyIdFrom" from-field="partyId"/>
                 <parameter param-name="roleTypeId"/>
+                <parameter param-name="headerItem" from-field="parameters.headerItem"/>
             </hyperlink>
         </field>
         <field name="communicationEventTypeId" title="${uiLabelMap.CommonType}"><display-entity description="${description}" entity-name="CommunicationEventType" key-field-name="communicationEventTypeId"/></field>

Modified: ofbiz/trunk/applications/party/widget/partymgr/PartyForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/widget/partymgr/PartyForms.xml?rev=834010&r1=834009&r2=834010&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/widget/partymgr/PartyForms.xml (original)
+++ ofbiz/trunk/applications/party/widget/partymgr/PartyForms.xml Mon Nov  9 10:37:52 2009
@@ -1025,12 +1025,11 @@
         <field name="toPartyId"><display/></field>
     </form>
     <form name="PartySalesOpportunities" type="list" list-name="salesOpportunities" default-table-style="basic-table hover-bar">
-        <field name="salesOpportunityId">
-            <hyperlink target="ViewSalesOpportunity" description="${salesOpportunityId}">
+        <field name="opportunityName">
+            <hyperlink target="ViewSalesOpportunity" description="${opportunityName} [${salesOpportunityId}]">
                 <parameter param-name="salesOpportunityId"/>
             </hyperlink>
         </field>
-        <field name="opportunityName"><display/></field>
         <field name="estimatedAmount"><display/></field>
         <field name="partyId"><display/></field>
     </form>

Modified: ofbiz/trunk/applications/party/widget/partymgr/PartyScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/widget/partymgr/PartyScreens.xml?rev=834010&r1=834009&r2=834010&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/widget/partymgr/PartyScreens.xml (original)
+++ ofbiz/trunk/applications/party/widget/partymgr/PartyScreens.xml Mon Nov  9 10:37:52 2009
@@ -412,7 +412,7 @@
                 <script location="component://party/webapp/partymgr/WEB-INF/actions/party/EditContactMech.groovy"/>
             </actions>
             <widgets>
-                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
+                <decorator-screen name="CommonPartyDecorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
                         <section>
                             <condition>