This is an automated email from the ASF dual-hosted git repository.
jleroux pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/trunk by this push:
new 1f87fa9 Improved: VIEW permissions - invoice contact mechs
(OFBIZ-12428) (#378)
1f87fa9 is described below
commit 1f87fa92816e86a82f6bd62e83e68a4806005e61
Author: Pierre Smits <[email protected]>
AuthorDate: Fri Dec 3 14:25:04 2021 +0100
Improved: VIEW permissions - invoice contact mechs (OFBIZ-12428) (#378)
* Improved: VIEW permissions - invoice contact mechs (OFBIZ-12428)
Though there is an entity InvoiceContactMech, this cannot be accessed by
user with VIEW permissions when accessing an invoice.
See:
for entity data:
https://demo-trunk.ofbiz.apache.org/webtools/control/entity/find/InvoiceContactMech
test invoice:
https://demo-trunk.ofbiz.apache.org/accounting/control/invoiceOverview?invoiceId=demo11001
Modified:
AccountingMenus.xml
- added menu-item for contact mechs to InvoiceTabBar menu
controller.xml
- added request-map and view-map for request invoiceContactMech
InvoiceScreens.xml
- added screen for invoice contact mech(s)
InvoiceForms.xml
- added grid to display contact mech details
* Improved: VIEW permissions - invoice contact mechs (OFBIZ-12428)
Though there is an entity InvoiceContactMech, this cannot be accessed by
user with VIEW permissions when accessing an invoice.
modified:
AccountingUiLabels.xml - added label PageTitleInvoiceContactMech, used in
screen InvoiceContactMech
---
.../accounting/config/AccountingUiLabels.xml | 4 ++++
.../webapp/accounting/WEB-INF/controller.xml | 5 ++++
applications/accounting/widget/AccountingMenus.xml | 10 ++++++++
applications/accounting/widget/InvoiceForms.xml | 8 +++++++
applications/accounting/widget/InvoiceScreens.xml | 27 ++++++++++++++++++++++
5 files changed, 54 insertions(+)
diff --git a/applications/accounting/config/AccountingUiLabels.xml
b/applications/accounting/config/AccountingUiLabels.xml
index 682d572..f1927b7 100644
--- a/applications/accounting/config/AccountingUiLabels.xml
+++ b/applications/accounting/config/AccountingUiLabels.xml
@@ -24167,6 +24167,10 @@
<value xml:lang="en">Invoice Attributes</value>
<value xml:lang="nl">Factuurattributen</value>
</property>
+ <property key="PageTitleInvoiceContactMech">
+ <value xml:lang="en">Invoice Contact Info</value>
+ <value xml:lang="nl">Factuurcontactgegevens</value>
+ </property>
<property key="PageTitleInvoiceContent">
<value xml:lang="en">Invoice Content</value>
<value xml:lang="nl">Factuurcontent</value>
diff --git a/applications/accounting/webapp/accounting/WEB-INF/controller.xml
b/applications/accounting/webapp/accounting/WEB-INF/controller.xml
index 4f149f9..fe1ffde 100644
--- a/applications/accounting/webapp/accounting/WEB-INF/controller.xml
+++ b/applications/accounting/webapp/accounting/WEB-INF/controller.xml
@@ -237,6 +237,10 @@ under the License.
<security https="true" auth="true"/>
<response name="success" type="view" value="invoiceAttributes"/>
</request-map>
+ <request-map uri="invoiceContactMech">
+ <security https="true" auth="true"/>
+ <response name="success" type="view" value="invoiceContactMech"/>
+ </request-map>
<request-map uri="invoiceContent">
<security https="true" auth="true"/>
<response name="success" type="view" value="invoiceContent"/>
@@ -2637,6 +2641,7 @@ under the License.
<view-map name="invoiceStatus" type="screen"
page="component://accounting/widget/InvoiceScreens.xml#InvoiceStatus"/>
<view-map name="editInvoiceApplications" type="screen"
page="component://accounting/widget/InvoiceScreens.xml#EditInvoiceApplications"/>
<view-map name="invoiceAttributes" type="screen"
page="component://accounting/widget/InvoiceScreens.xml#InvoiceAttributes"/>
+ <view-map name="invoiceContactMech" type="screen"
page="component://accounting/widget/InvoiceScreens.xml#InvoiceContactMech"/>
<view-map name="invoiceContent" type="screen"
page="component://accounting/widget/InvoiceScreens.xml#InvoiceContent"/>
<view-map name="invoiceRoles" type="screen"
page="component://accounting/widget/InvoiceScreens.xml#InvoiceRoles"/>
<view-map name="invoiceTerms" type="screen"
page="component://accounting/widget/InvoiceScreens.xml#InvoiceTerms"/>
diff --git a/applications/accounting/widget/AccountingMenus.xml
b/applications/accounting/widget/AccountingMenus.xml
index 1b3d004..6e82f8f 100644
--- a/applications/accounting/widget/AccountingMenus.xml
+++ b/applications/accounting/widget/AccountingMenus.xml
@@ -125,6 +125,16 @@ under the License.
<parameter param-name="invoiceId"
from-field="invoice.invoiceId"/>
</link>
</menu-item>
+ <menu-item name="invoiceContactMech"
title="${uiLabelMap.PartyContactMechs}">
+ <condition>
+ <and>
+ <not><if-empty field="invoice.invoiceId"/></not>
+ </and>
+ </condition>
+ <link target="invoiceContactMech">
+ <parameter param-name="invoiceId"
from-field="invoice.invoiceId"/>
+ </link>
+ </menu-item>
<menu-item name="invoiceContent" title="${uiLabelMap.CommonContent}">
<condition>
<and>
diff --git a/applications/accounting/widget/InvoiceForms.xml
b/applications/accounting/widget/InvoiceForms.xml
index 3c703f4..6d9b1a2 100644
--- a/applications/accounting/widget/InvoiceForms.xml
+++ b/applications/accounting/widget/InvoiceForms.xml
@@ -140,6 +140,14 @@ under the License.
odd-row-style="alternate-row" default-table-style="basic-table
hover-bar">
<auto-fields-entity entity-name="InvoiceAttribute"
default-field-type="display"/>
</grid>
+ <grid name="InvoiceContactMech" list-name="invoiceContactMechList"
paginate-target="invoiceContactMech"
+ odd-row-style="alternate-row" default-table-style="basic-table
hover-bar">
+ <row-actions>
+ <entity-one entity-name="ContactMechDetail"
value-field="contactMechDetail"/>
+ </row-actions>
+ <auto-fields-entity entity-name="InvoiceContactMech"
default-field-type="display"/>
+ <field name="contactMechDetail"
title="${uiLabelMap.FormFieldTitle_cmDetail}"><display/></field>
+ </grid>
<grid name="InvoiceContent" list-name="invoiceContentList"
paginate-target="invoiceContent"
odd-row-style="alternate-row" default-table-style="basic-table
hover-bar">
<auto-fields-entity entity-name="InvoiceContent"
default-field-type="display"/>
diff --git a/applications/accounting/widget/InvoiceScreens.xml
b/applications/accounting/widget/InvoiceScreens.xml
index 2f9ea64..c65031f 100644
--- a/applications/accounting/widget/InvoiceScreens.xml
+++ b/applications/accounting/widget/InvoiceScreens.xml
@@ -584,6 +584,33 @@ under the License.
</widgets>
</section>
</screen>
+ <screen name="InvoiceContactMech">
+ <section>
+ <actions>
+ <set field="titleProperty"
value="PageTitleInvoiceContactMech"/>
+ <set field="tabButtonItem" value="invoiceContactMech"/>
+ <set field="invoiceId" from-field="parameters.invoiceId"/>
+ <entity-one entity-name="Invoice" value-field="invoice"/>
+ <entity-and entity-name="InvoiceContactMech"
list="invoiceContactMechList">
+ <field-map field-name="invoiceId" from-field="invoiceId"/>
+ <order-by field-name="contactMechId"/>
+ </entity-and>
+ </actions>
+ <widgets>
+ <decorator-screen name="CommonInvoiceDecorator"
location="${parameters.invoiceDecoratorLocation}">
+ <decorator-section name="body">
+ <section>
+ <widgets>
+ <screenlet title="${uiLabelMap.PartyContactMechs}">
+ <include-grid name="InvoiceContactMech"
location="component://accounting/widget/InvoiceForms.xml"/>
+ </screenlet>
+ </widgets>
+ </section>
+ </decorator-section>
+ </decorator-screen>
+ </widgets>
+ </section>
+ </screen>
<screen name="InvoiceContent">
<section>
<actions>