Applied fix from trunk for revision: 1825233

===

Fixed: Incorrect Party profile view redirection in SFA due to missing roleType.
(OFBIZ-10121)
Thanks Ankit Joshi for your contribution.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1825234 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Arun Patidar
2018-02-24 12:42:30 +00:00
parent ff3653ed11
commit cff199183c
8 changed files with 341 additions and 7 deletions
@@ -64,6 +64,14 @@ under the License.
</request-map>
<!-- Account Entry Requests -->
<request-map uri="ViewAccountProfile">
<security https="true" auth="true"/>
<response name="success" type="view" value="ViewAccountProfile" save-home-view="true"/>
</request-map>
<request-map uri="ViewAccountLeadProfile">
<security https="true" auth="true"/>
<response name="success" type="view" value="ViewAccountLeadProfile" save-home-view="true"/>
</request-map>
<request-map uri="FindAccounts">
<security https="true" auth="true"/>
<response name="success" type="view" value="FindAccounts" save-home-view="true"/>
@@ -84,6 +92,10 @@ under the License.
</request-map>
<!-- Lead Requests -->
<request-map uri="ViewLeadProfile">
<security https="true" auth="true"/>
<response name="success" type="view" value="ViewLeadProfile" save-home-view="true"/>
</request-map>
<request-map uri="FindLeads">
<security https="true" auth="true"/>
<response name="success" type="view" value="FindLeads" save-home-view="true"/>
@@ -159,6 +171,10 @@ under the License.
<response name="success" type="view" value="AddRelatedCompany"/>
</request-map>
<!-- Contact Requests -->
<request-map uri="ViewContactProfile">
<security https="true" auth="true"/>
<response name="success" type="view" value="ViewContactProfile" save-home-view="true"/>
</request-map>
<request-map uri="FindContacts">
<security https="true" auth="true"/>
<response name="success" type="view" value="FindContacts" save-home-view="true"/>
@@ -284,6 +300,10 @@ under the License.
<!-- end of request mappings -->
<!-- View Mappings -->
<view-map name="ViewLeadProfile" type="screen" page="component://marketing/widget/sfa/CommonScreens.xml#ViewLeadProfile"/>
<view-map name="ViewAccountProfile" type="screen" page="component://marketing/widget/sfa/CommonScreens.xml#ViewAccountProfile"/>
<view-map name="ViewContactProfile" type="screen" page="component://marketing/widget/sfa/CommonScreens.xml#ViewContactProfile"/>
<view-map name="ViewAccountLeadProfile" type="screen" page="component://marketing/widget/sfa/CommonScreens.xml#ViewAccountLeadProfile"/>
<view-map name="main" type="screen" page="component://marketing/widget/sfa/CommonScreens.xml#main"/>
<view-map name="viewprofile" type="screen" page="component://marketing/widget/sfa/CommonScreens.xml#ViewProfile"/>
<view-map name="ViewPartiesCreatedByVCard" type="screen" page="component://marketing/widget/sfa/CommonScreens.xml#ViewPartiesCreatedByVCard"/>
@@ -347,6 +347,304 @@ under the License.
</widgets>
</section>
</screen>
<screen name="ViewLeadProfile">
<section>
<actions>
<set field="titleProperty" value="PageTitleViewPartyProfile"/>
<set field="tabButtonItem" value="profile"/>
<set field="labelTitleProperty" value="PartyTaxAuthInfos"/>
<set field="parameters.roleTypeId" value="LEAD"/>
<set field="layoutSettings.javaScripts[]" value="/partymgr/static/PartyProfileContent.js" global="true"/>
<script location="component://party/groovyScripts/party/ViewProfile.groovy"/>
<script location="component://party/groovyScripts/party/SetRoleVars.groovy"/>
<set field="parameters.partyId" from-field="partyId"/>
<set field="parameters.partyGroupId" from-field="partyGroupId"/>
<set field="DONE_PAGE" value="ViewLeadProfile"/>
</actions>
<widgets>
<include-screen name="LeadProfile"/>
</widgets>
</section>
</screen>
<screen name="ViewContactProfile">
<section>
<actions>
<set field="titleProperty" value="PageTitleViewPartyProfile"/>
<set field="tabButtonItem" value="profile"/>
<set field="labelTitleProperty" value="PartyTaxAuthInfos"/>
<set field="parameters.roleTypeId" value="CONTACT"/>
<set field="layoutSettings.javaScripts[]" value="/partymgr/static/PartyProfileContent.js" global="true"/>
<script location="component://party/groovyScripts/party/ViewProfile.groovy"/>
<script location="component://party/groovyScripts/party/SetRoleVars.groovy"/>
<set field="parameters.partyId" from-field="partyId"/>
<set field="parameters.partyGroupId" from-field="partyGroupId"/>
<set field="DONE_PAGE" value="ViewContactProfile"/>
</actions>
<widgets>
<decorator-screen name="CommonPartyDecorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<section>
<condition>
<not><if-empty field="party"/></not>
</condition>
<widgets>
<section>
<condition>
<if-compare field="showOld" operator="equals" value="true" type="Boolean"/>
</condition>
<widgets>
<container style="button-bar button-style-2">
<link target="ViewContactProfile" text="${uiLabelMap.PartyHideOld}">
<parameter param-name="partyId" from-field="party.partyId"/>
</link>
</container>
</widgets>
<fail-widgets>
<container style="button-bar button-style-2">
<link target="ViewContactProfile" text="${uiLabelMap.PartyShowOld}">
<parameter param-name="partyId" from-field="party.partyId"/>
<parameter param-name="SHOW_OLD" value="true"/>
</link>
</container>
</fail-widgets>
</section>
<section>
<condition>
<not><if-empty field="contactDescription"/></not>
</condition>
<widgets>
<container style="profile-left">
<include-screen name="Party" location="component://party/widget/partymgr/ProfileScreens.xml"/>
<include-screen name="partyRelAccounts" location="component://party/widget/partymgr/ProfileScreens.xml"/>
<include-screen name="Contact" location="component://party/widget/partymgr/ProfileScreens.xml"/>
</container>
<container style="profile-right">
<section>
<actions>
<set field="parameters.partyId" from-field="partyId"/>
</actions>
</section>
<include-screen name="UserLogin" location="component://party/widget/partymgr/ProfileScreens.xml"/>
<include-screen name="Attributes" location="component://party/widget/partymgr/ProfileScreens.xml"/>
<include-screen name="Visits" location="component://party/widget/partymgr/ProfileScreens.xml"/>
<include-screen name="Subscriptions" location="component://party/widget/partymgr/ProfileScreens.xml"/>
<include-screen name="Content" location="component://party/widget/partymgr/ProfileScreens.xml"/>
<include-screen name="Notes" location="component://party/widget/partymgr/ProfileScreens.xml"/>
</container>
</widgets>
</section>
</widgets>
<fail-widgets>
<container>
<label style="h3">${uiLabelMap.PartyNoPartyFoundWithPartyId}: ${parameters.partyId}</label>
</container>
</fail-widgets>
</section>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
<screen name="ViewAccountProfile">
<section>
<actions>
<set field="titleProperty" value="PageTitleViewPartyProfile"/>
<set field="tabButtonItem" value="profile"/>
<set field="labelTitleProperty" value="PartyTaxAuthInfos"/>
<set field="parameters.roleTypeId" value="ACCOUNT"/>
<set field="layoutSettings.javaScripts[]" value="/partymgr/static/PartyProfileContent.js" global="true"/>
<script location="component://party/groovyScripts/party/ViewProfile.groovy"/>
<script location="component://party/groovyScripts/party/SetRoleVars.groovy"/>
<set field="parameters.partyId" from-field="partyId"/>
<set field="parameters.partyGroupId" from-field="partyGroupId"/>
<set field="DONE_PAGE" value="ViewAccountProfile"/>
</actions>
<widgets>
<decorator-screen name="CommonPartyDecorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<section>
<condition>
<not><if-empty field="party"/></not>
</condition>
<widgets>
<section>
<condition>
<if-compare field="showOld" operator="equals" value="true" type="Boolean"/>
</condition>
<widgets>
<container style="button-bar button-style-2">
<link target="ViewAccountProfile" text="${uiLabelMap.PartyHideOld}">
<parameter param-name="partyId" from-field="party.partyId"/>
</link>
</container>
</widgets>
<fail-widgets>
<container style="button-bar button-style-2">
<link target="ViewAccountProfile" text="${uiLabelMap.PartyShowOld}">
<parameter param-name="partyId" from-field="party.partyId"/>
<parameter param-name="SHOW_OLD" value="true"/>
</link>
</container>
</fail-widgets>
</section>
<section>
<condition>
<not><if-empty field="accountDescription"/></not>
</condition>
<widgets>
<container style="profile-left">
<include-screen name="Party" location="component://party/widget/partymgr/ProfileScreens.xml"/>
<include-screen name="partyRelContacts" location="component://party/widget/partymgr/ProfileScreens.xml"/>
<include-screen name="Contact" location="component://party/widget/partymgr/ProfileScreens.xml"/>
</container>
<container style="profile-right">
<include-screen name="FinAccounts" location="component://party/widget/partymgr/ProfileScreens.xml"/>
<include-screen name="Attributes" location="component://party/widget/partymgr/ProfileScreens.xml"/>
<include-screen name="PaymentMethods" location="component://party/widget/partymgr/ProfileScreens.xml"/>
<include-screen name="LeadPartyDataSource" location="component://marketing/widget/sfa/LeadScreens.xml"/>
</container>
<container style="profile-bottom">
<include-screen name="PartySalesOpportunities" location="component://party/widget/partymgr/ProfileScreens.xml"/>
<include-screen name="Notes" location="component://party/widget/partymgr/ProfileScreens.xml"/>
<include-screen name="Content" location="component://party/widget/partymgr/ProfileScreens.xml"/>
</container>
</widgets>
</section>
</widgets>
<fail-widgets>
<container>
<label style="h3">${uiLabelMap.PartyNoPartyFoundWithPartyId}: ${parameters.partyId}</label>
</container>
</fail-widgets>
</section>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
<screen name="ViewAccountLeadProfile">
<section>
<actions>
<set field="titleProperty" value="PageTitleViewPartyProfile"/>
<set field="tabButtonItem" value="profile"/>
<set field="labelTitleProperty" value="PartyTaxAuthInfos"/>
<set field="parameters.roleTypeId" value="ACCOUNT_LEAD"/>
<set field="layoutSettings.javaScripts[]" value="/partymgr/static/PartyProfileContent.js" global="true"/>
<script location="component://party/groovyScripts/party/ViewProfile.groovy"/>
<script location="component://party/groovyScripts/party/SetRoleVars.groovy"/>
<set field="parameters.partyId" from-field="partyId"/>
<set field="parameters.partyGroupId" from-field="partyGroupId"/>
<set field="DONE_PAGE" value="ViewAccountLeadProfile"/>
</actions>
<widgets>
<include-screen name="LeadProfile"/>
</widgets>
</section>
</screen>
<screen name="LeadProfile">
<section>
<widgets>
<decorator-screen name="CommonPartyDecorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<section>
<condition>
<not><if-empty field="party"/></not>
</condition>
<widgets>
<section>
<condition>
<if-compare field="showOld" operator="equals" value="true" type="Boolean"/>
</condition>
<widgets>
<container style="button-bar button-style-2">
<link target="ViewAccountLeadProfile" text="${uiLabelMap.PartyHideOld}">
<parameter param-name="partyId" from-field="party.partyId"/>
</link>
</container>
</widgets>
<fail-widgets>
<container style="button-bar button-style-2">
<link target="ViewAccountLeadProfile" text="${uiLabelMap.PartyShowOld}">
<parameter param-name="partyId" from-field="party.partyId"/>
<parameter param-name="SHOW_OLD" value="true"/>
</link>
</container>
</fail-widgets>
</section>
<section>
<condition>
<and>
<or>
<not><if-empty field="leadDescription"/></not>
<not><if-empty field="accountLeadDescription"/></not>
</or>
</and>
</condition>
<widgets>
<container style="profile-left">
<section>
<actions>
<set field="parameters.partyId" from-field="partyId"/>
</actions>
<widgets>
<include-screen name="Party" location="component://party/widget/partymgr/ProfileScreens.xml"/>
</widgets>
</section>
<section>
<condition>
<not><if-empty field="partyGroupId"/></not>
</condition>
<actions>
<set field="parameters.partyId" from-field="partyGroupId"/>
</actions>
<widgets>
<include-screen name="Party" location="component://party/widget/partymgr/ProfileScreens.xml"/>
<include-screen name="partyRelContacts" location="component://party/widget/partymgr/ProfileScreens.xml"/>
</widgets>
</section>
<section>
<actions>
<set field="parameters.partyId" from-field="partyId"/>
</actions>
<widgets>
<include-screen name="Contact" location="component://party/widget/partymgr/ProfileScreens.xml"/>
<include-screen name="LeadPartyDataSource" location="component://marketing/widget/sfa/LeadScreens.xml"/>
</widgets>
</section>
</container>
<container style="profile-right">
<section>
<actions>
<set field="parameters.partyId" from-field="partyId"/>
</actions>
<widgets>
<include-screen name="Content" location="component://party/widget/partymgr/ProfileScreens.xml"/>
<include-screen name="Notes" location="component://party/widget/partymgr/ProfileScreens.xml"/>
<include-screen name="PartySalesOpportunities" location="component://party/widget/partymgr/ProfileScreens.xml"/>
</widgets>
</section>
</container>
</widgets>
</section>
</widgets>
<fail-widgets>
<container>
<label style="h3">${uiLabelMap.PartyNoPartyFoundWithPartyId}: ${parameters.partyId}</label>
</container>
</fail-widgets>
</section>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
<screen name="ViewPartiesCreatedByVCard">
<section>
<widgets>
@@ -137,10 +137,24 @@ under the License.
<set field="relatedCompanyPartyId" from-field="relatedCompanies[0].partyIdFrom" type="Object"/>
<set field="existRelationship" from-field="existRelationships[0]"/>
</row-actions>
<field name="partyId" title="${uiLabelMap.PartyPartyId}">
<hyperlink description="${partyName} [${partyId}]" target="viewprofile" >
<field name="partyId" title="${uiLabelMap.PartyPartyId}" use-when="roleTypeId!=null&amp;${roleTypeId=='ACCOUNT'}">
<hyperlink description="${partyName} [${partyId}]" target="ViewAccountProfile">
<parameter param-name="partyId"/>
</hyperlink>
</field>
<field name="partyId" title="${uiLabelMap.PartyPartyId}" use-when="roleTypeId!=null&amp;${roleTypeId=='CONTACT'}">
<hyperlink description="${partyName} [${partyId}]" target="ViewContactProfile">
<parameter param-name="partyId"/>
</hyperlink>
</field>
<field name="partyId" title="${uiLabelMap.PartyPartyId}" use-when="roleTypeId!=null&amp;${roleTypeId=='LEAD'}">
<hyperlink description="${partyName} [${partyId}]" target="ViewLeadProfile">
<parameter param-name="partyId"/>
</hyperlink>
</field>
<field name="partyId" title="${uiLabelMap.PartyPartyId}" use-when="roleTypeId!=null&amp;${roleTypeId=='ACCOUNT_LEAD'}">
<hyperlink description="${partyName} [${partyId}]" target="ViewAccountLeadProfile">
<parameter param-name="partyId"/>
<parameter param-name="roleTypeId"/>
</hyperlink>
</field>
<field name="emailAddress"><display description="${emailAddresses[0].infoString}"/></field>
@@ -32,7 +32,7 @@ if (roleTypeAndParty) {
context.partyId = parameters.partyId
}
} else if ("ACCOUNT_LEAD".equals(roleTypeId)) {
context.leadDescription = roleTypeAndParty.description
context.accountLeadDescription = roleTypeAndParty.description
partyRelationships = from("PartyRelationship").where("partyIdFrom", parameters.partyId, "roleTypeIdFrom", "ACCOUNT_LEAD", "roleTypeIdTo", "LEAD", "partyRelationshipTypeId", "EMPLOYMENT").filterByDate().queryFirst()
if (partyRelationships) {
context.partyGroupId = parameters.partyId
@@ -22,7 +22,7 @@ under the License.
<ul>
<li class="h3">${uiLabelMap.PartyAttributes}</li>
<#if security.hasEntityPermission("PARTYMGR", "_CREATE", session)>
<li><a href="<@ofbizUrl>editPartyAttribute?partyId=${party.partyId!}</@ofbizUrl>">${uiLabelMap.CommonCreateNew}</a></li>
<li><a href="<@ofbizUrl>editPartyAttribute?partyId=${party.partyId!}&amp;CANCEL_PAGE=${DONE_PAGE!}</@ofbizUrl>">${uiLabelMap.CommonCreateNew}</a></li>
</#if>
</ul>
<br class="clear"/>
@@ -22,7 +22,7 @@ under the License.
<ul>
<li class="h3">${uiLabelMap.CommonNotes}</li>
<#if security.hasEntityPermission("PARTYMGR", "_NOTE", session)>
<li><a href="<@ofbizUrl>AddPartyNote?partyId=${partyId}</@ofbizUrl>">${uiLabelMap.CommonCreateNew}</a></li>
<li><a href="<@ofbizUrl>AddPartyNote?partyId=${partyId}&amp;DONE_PAGE=${DONE_PAGE!}</@ofbizUrl>">${uiLabelMap.CommonCreateNew}</a></li>
</#if>
</ul>
<br class="clear" />
@@ -22,7 +22,7 @@ under the License.
<ul>
<li class="h3">${uiLabelMap.PartyUserName}</li>
<#if security.hasEntityPermission("PARTYMGR", "_CREATE", session)>
<li><a href="<@ofbizUrl>ProfileCreateNewLogin?partyId=${party.partyId}</@ofbizUrl>">${uiLabelMap.CommonCreateNew}</a></li>
<li><a href="<@ofbizUrl>ProfileCreateNewLogin?partyId=${party.partyId}&amp;CANCEL_PAGE=${DONE_PAGE!}</@ofbizUrl>">${uiLabelMap.CommonCreateNew}</a></li>
</#if>
</ul>
<br class="clear" />
@@ -276,6 +276,7 @@
<menu-item name="update" title="${uiLabelMap.CommonUpdate}">
<link target="editperson">
<parameter param-name="partyId" from-field="parameters.partyId"/>
<parameter param-name="DONE_PAGE" from-field="DONE_PAGE"/>
</link>
</menu-item>
</menu>
@@ -320,6 +321,7 @@
<menu-item name="update" title="${uiLabelMap.CommonUpdate}">
<link target="editpartygroup">
<parameter param-name="partyId" from-field="party.partyId"/>
<parameter param-name="DONE_PAGE" from-field="DONE_PAGE"/>
</link>
</menu-item>
</menu>