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 e529f2c Improved: VIEW permissions and invoice attributes
(OFBIZ-12417) (#363)
e529f2c is described below
commit e529f2c328bca21c3f285a6e674d87e17eb2939c
Author: Pierre Smits <[email protected]>
AuthorDate: Sun Nov 28 17:57:09 2021 +0100
Improved: VIEW permissions and invoice attributes (OFBIZ-12417) (#363)
* Improved: VIEW permissions and invoice attributes (OFBIZ-12417)
Though there is an entity InvoiceAttribute, this cannot be accessed by user
with VIEW permissions when accessing an invoice.
Modified:
InvoiceScreens.xml
- added screen InvoiceAttributes to be available for users with VIEW
permissions
InvoiceForms.xml
- added grid InvoiceAttributes to be used by screen InvoiceAttributes
AccountingMenus.xml
- added menu-item invoiceAttributes to InvoiceTabBar
controller.xml
- added request-map and view-map to access screen InvoiceAttributes
* Improved: VIEW permissions and invoice attributes (OFBIZ-12417)
Though there is an entity InvoiceAttribute, this cannot be accessed by user
with VIEW permissions when accessing an invoice.
I forgot to add the translation for the page title
modified: AccountingUiLabels.xml
added label definition for PageTitleInvoiceAttributes
---
.../accounting/config/AccountingUiLabels.xml | 4 ++++
.../webapp/accounting/WEB-INF/controller.xml | 5 ++++
applications/accounting/widget/AccountingMenus.xml | 10 ++++++++
applications/accounting/widget/InvoiceForms.xml | 7 ++++--
applications/accounting/widget/InvoiceScreens.xml | 28 +++++++++++++++++++++-
5 files changed, 51 insertions(+), 3 deletions(-)
diff --git a/applications/accounting/config/AccountingUiLabels.xml
b/applications/accounting/config/AccountingUiLabels.xml
index 33eb99e..4d34851 100644
--- a/applications/accounting/config/AccountingUiLabels.xml
+++ b/applications/accounting/config/AccountingUiLabels.xml
@@ -24163,6 +24163,10 @@
<value xml:lang="zh">发票总览</value>
<value xml:lang="zh-TW">發票總覽</value>
</property>
+ <property key="PageTitleInvoiceAttributes">
+ <value xml:lang="en">Invoice Attributes</value>
+ <value xml:lang="nl">Factuurattributen</value>
+ </property>
<property key="PageTitleListAccounts">
<value xml:lang="ar">قائمة الحسابات</value>
<value xml:lang="cs">Seznam účtů</value>
diff --git a/applications/accounting/webapp/accounting/WEB-INF/controller.xml
b/applications/accounting/webapp/accounting/WEB-INF/controller.xml
index 9e56720..7854589 100644
--- a/applications/accounting/webapp/accounting/WEB-INF/controller.xml
+++ b/applications/accounting/webapp/accounting/WEB-INF/controller.xml
@@ -233,6 +233,10 @@ under the License.
<security https="true" auth="true"/>
<response name="success" type="view" value="invoiceStatus"/>
</request-map>
+ <request-map uri="invoiceAttributes">
+ <security https="true" auth="true"/>
+ <response name="success" type="view" value="invoiceAttributes"/>
+ </request-map>
<!-- re Invoice Roles -->
<request-map uri="invoiceRoles">
@@ -2628,6 +2632,7 @@ under the License.
<view-map name="editInvoiceTimeEntries" type="screen"
page="component://accounting/widget/InvoiceScreens.xml#EditInvoiceTimeEntries"/>
<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="invoiceRoles" type="screen"
page="component://accounting/widget/InvoiceScreens.xml#InvoiceRoles"/>
<view-map name="invoiceTerms" type="screen"
page="component://accounting/widget/InvoiceScreens.xml#InvoiceTerms"/>
<view-map name="sendPerEmail" type="screen"
page="component://accounting/widget/InvoiceScreens.xml#SendPerEmail"/>
diff --git a/applications/accounting/widget/AccountingMenus.xml
b/applications/accounting/widget/AccountingMenus.xml
index c3f3d5d..1f74942 100644
--- a/applications/accounting/widget/AccountingMenus.xml
+++ b/applications/accounting/widget/AccountingMenus.xml
@@ -115,6 +115,16 @@ under the License.
<parameter param-name="invoiceId"
from-field="invoice.invoiceId"/>
</link>
</menu-item>
+ <menu-item name="invoiceAttributes"
title="${uiLabelMap.CommonAttributes}">
+ <condition>
+ <and>
+ <not><if-empty field="invoice.invoiceId"/></not>
+ </and>
+ </condition>
+ <link target="invoiceAttributes">
+ <parameter param-name="invoiceId"
from-field="invoice.invoiceId"/>
+ </link>
+ </menu-item>
<menu-item name="listInvoiceItems"
title="${uiLabelMap.AccountingInvoiceItems}">
<condition>
<and>
diff --git a/applications/accounting/widget/InvoiceForms.xml
b/applications/accounting/widget/InvoiceForms.xml
index d931c60..3773f1c 100644
--- a/applications/accounting/widget/InvoiceForms.xml
+++ b/applications/accounting/widget/InvoiceForms.xml
@@ -136,8 +136,11 @@ under the License.
<field position="1" name="referenceNumber"
title="${uiLabelMap.FormFieldTitle_referenceNum}"><display/></field>
<field name="currencyUomId"><hidden/></field>
</form>
-
-<form name="InvoiceItems" list-name="invItemAndOrdItems" target="" title=""
type="list" separate-columns="true" paginate-target="invoiceOverview"
+ <grid name="InvoiceAttributes" list-name="invoiceAttributes"
paginate-target="invoiceAttributes"
+ odd-row-style="alternate-row" default-table-style="basic-table
hover-bar">
+ <auto-fields-entity entity-name="InvoiceAttribute"
default-field-type="display"/>
+ </grid>
+ <form name="InvoiceItems" list-name="invItemAndOrdItems" target=""
title="" type="list" separate-columns="true" paginate-target="invoiceOverview"
odd-row-style="alternate-row" default-table-style="basic-table
hover-bar">
<row-actions>
<set field="quantity" value="${groovy: quantity ?: 1}"
type="BigDecimal"/>
diff --git a/applications/accounting/widget/InvoiceScreens.xml
b/applications/accounting/widget/InvoiceScreens.xml
index 9e245a6..dce5ac0 100644
--- a/applications/accounting/widget/InvoiceScreens.xml
+++ b/applications/accounting/widget/InvoiceScreens.xml
@@ -557,7 +557,33 @@ under the License.
</widgets>
</section>
</screen>
-
+ <screen name="InvoiceAttributes">
+ <section>
+ <actions>
+ <set field="titleProperty" value="PageTitleInvoiceAttributes"/>
+ <set field="tabButtonItem" value="invoiceAttributes"/>
+ <set field="invoiceId" from-field="parameters.invoiceId"/>
+ <entity-one entity-name="Invoice" value-field="invoice"/>
+ <entity-and entity-name="InvoiceAttribute"
list="invoiceAttributes">
+ <field-map field-name="invoiceId" from-field="invoiceId"/>
+ <order-by field-name="attrName"/>
+ </entity-and>
+ </actions>
+ <widgets>
+ <decorator-screen name="CommonInvoiceDecorator"
location="${parameters.invoiceDecoratorLocation}">
+ <decorator-section name="body">
+ <section>
+ <widgets>
+ <screenlet title="${uiLabelMap.CommonAttributes}">
+ <include-grid name="InvoiceAttributes"
location="component://accounting/widget/InvoiceForms.xml"/>
+ </screenlet>
+ </widgets>
+ </section>
+ </decorator-section>
+ </decorator-screen>
+ </widgets>
+ </section>
+ </screen>
<screen name="InvoiceRoles">
<section>
<actions>