You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2016/01/24 15:14:15 UTC

svn commit: r1726493 - in /ofbiz/trunk/applications: datamodel/entitydef/marketing-entitymodel.xml marketing/widget/sfa/forms/OpportunityForms.xml

Author: jleroux
Date: Sun Jan 24 14:14:15 2016
New Revision: 1726493

URL: http://svn.apache.org/viewvc?rev=1726493&view=rev
Log:
A completed patch from Hans Bakker for "Various fixes related with sales opportunity" https://issues.apache.org/jira/browse/OFBIZ-6791

jleroux:
This is related with r1725574 where I  reverted the change done with http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/secas.xml?r1=1723248&r2=1723247&pathrev=1723248 following this thread  http://markmail.org/message/mspie3qdjcac2tci
In few words r1725574 was wrong (broke opportunity creation) and it was better to "improve" the opportunities list

I added a sort to have all same (with different possible roleTypeIds) opportunities subsequent, added the roleTypeId near the salesOpportunityId to make it obvious, and added a RoleType column
I also replaced useless " by real quote in groovy expressions


Modified:
    ofbiz/trunk/applications/datamodel/entitydef/marketing-entitymodel.xml
    ofbiz/trunk/applications/marketing/widget/sfa/forms/OpportunityForms.xml

Modified: ofbiz/trunk/applications/datamodel/entitydef/marketing-entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/datamodel/entitydef/marketing-entitymodel.xml?rev=1726493&r1=1726492&r2=1726493&view=diff
==============================================================================
--- ofbiz/trunk/applications/datamodel/entitydef/marketing-entitymodel.xml (original)
+++ ofbiz/trunk/applications/datamodel/entitydef/marketing-entitymodel.xml Sun Jan 24 14:14:15 2016
@@ -743,7 +743,7 @@ under the License.
       <alias-all entity-alias="SO"/>
       <alias name="partyId" entity-alias="SR"/>
       <alias name="roleTypeId" entity-alias="SR"/>
-      <view-link entity-alias="SO" rel-entity-alias="SR">
+      <view-link entity-alias="SO" rel-entity-alias="SR" rel-optional="true">
         <key-map field-name="salesOpportunityId"/>
       </view-link>
     </view-entity>

Modified: ofbiz/trunk/applications/marketing/widget/sfa/forms/OpportunityForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/widget/sfa/forms/OpportunityForms.xml?rev=1726493&r1=1726492&r2=1726493&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/widget/sfa/forms/OpportunityForms.xml (original)
+++ ofbiz/trunk/applications/marketing/widget/sfa/forms/OpportunityForms.xml Sun Jan 24 14:14:15 2016
@@ -49,14 +49,14 @@ under the License.
         <actions>
             <set field="parameters.noConditionFind" value="Y"/>
             <set field="opportunityStageId" from-field="parameters.opportunityStageId"/>
-            <set field="parameters.opportunityStageId" value="${groovy:opportunityStageId==null?&quot;SOSTG_CLOSED&quot;:opportunityStageId}"/>
-            <set field="parameters.opportunityStageId_op" value="${groovy:opportunityStageId==null?&quot;notEqual&quot;:&quot;equals&quot;}"/>
-            <set field="parameters.roleTypeId" value="LEAD"/>
-            <set field="fieldList" value="${groovy:[&quot;partyId&quot;,&quot;salesOpportunityId&quot;,&quot;opportunityStageId&quot;,&quot;typeEnumId&quot;]}" type="List"/>
+            <set field="parameters.opportunityStageId" value="${groovy:opportunityStageId==null?'SOSTG_CLOSED':opportunityStageId}"/>
+            <set field="parameters.opportunityStageId_op" value="${groovy:opportunityStageId==null?'notEqual':'equals'}"/>
+            <set field="fieldList" value="${groovy:['partyId','salesOpportunityId','opportunityStageId','typeEnumId', 'roleTypeId']}" type="List"/>
+            <set field="sortField" from-field="parameters.sortField" default-value="salesOpportunityId"/>
             <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="SalesOpportunityAndRole"/>
-                <field-map field-name="orderBy" from-field="parameters.sortField"/>
+                <field-map field-name="orderBy" value="${sortField}"/>
                 <field-map field-name="fieldList" from-field="fieldList"/>
                 <field-map field-name="distinct" value="Y"/>
                 <field-map field-name="viewIndex" from-field="viewIndex"/>
@@ -68,18 +68,19 @@ under the License.
         </row-actions>
         <field name="salesOpportunityId"><hidden/></field>
         <field name="opportunityName" title="${uiLabelMap.SfaOpportunityName}">
-            <hyperlink target="ViewSalesOpportunity" description="${opportunityName}[${salesOpportunityId}]">
+            <hyperlink target="EditSalesOpportunity" description="${opportunityName}[${salesOpportunityId}] ${roleTypeId}">
                 <parameter param-name="salesOpportunityId"/>
             </hyperlink>
         </field>
         <field name="opportunityStageId" title="${uiLabelMap.SfaInitialStage}"><display-entity entity-name="SalesOpportunityStage"/></field>
-        <field name="partyId" title="${uiLabelMap.SfaLead}">
+        <field name="partyId" title="${uiLabelMap.SfaLead}/${uiLabelMap.Account}">
             <display-entity entity-name="PartyNameView" description="${firstName} ${lastName} ${middleName} ${groupName}" key-field-name="partyId">
                 <sub-hyperlink target="viewprofile" description=" [${partyId}]">
                     <parameter param-name="partyId" from-field="partyId"/>
                 </sub-hyperlink>
             </display-entity> 
         </field>
+        <field name="roleTypeId"><display-entity entity-name="RoleType"/></field>
         <field name="nextStep"><display/></field>
         <field name="estimatedAmount" title="${uiLabelMap.SfaEstimatedAmount}"><display/></field>
         <field name="nextStepDate" position="1" title="${uiLabelMap.SfaNextStepDate}" sort-field="true"><display/></field>