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 2021/12/02 06:34:19 UTC

[ofbiz-framework] branch trunk updated: Improved: VIEW permissions and invoice content (OFBIZ-12418) (#365)

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 10288be  Improved: VIEW permissions and invoice content (OFBIZ-12418) (#365)
10288be is described below

commit 10288beed328e5977553cb512934e8899eaf30f0
Author: Pierre Smits <pi...@orrtiz.com>
AuthorDate: Thu Dec 2 07:34:12 2021 +0100

    Improved: VIEW permissions and invoice content (OFBIZ-12418) (#365)
    
    Though there is an entity InvoiceContent, this cannot be accessed by user with VIEW permissions when accessing an invoice.
    
    Modified:
    - AccountingUiLabels.xml - added page title translation for
    
    Modified:
    InvoiceScreens.xml
    - added screen InvoiceContent to be available for users with VIEW permissions
    InvoiceForms.xml
    - added grid InvoiceContent to be used by screen InvoiceContent
    AccountingMenus.xml
    - added menu-item invoiceContent to InvoiceTabBar
    controller.xml
    - added request-map and view-map to access screen InvoiceContent
    AccountingUiLabels.xml
    - added label definition for PageTitleInvoiceContent
---
 .../accounting/config/AccountingUiLabels.xml       |  4 ++++
 .../webapp/accounting/WEB-INF/controller.xml       |  5 ++++
 applications/accounting/widget/AccountingMenus.xml | 10 ++++++++
 applications/accounting/widget/InvoiceForms.xml    |  4 ++++
 applications/accounting/widget/InvoiceScreens.xml  | 27 ++++++++++++++++++++++
 5 files changed, 50 insertions(+)

diff --git a/applications/accounting/config/AccountingUiLabels.xml b/applications/accounting/config/AccountingUiLabels.xml
index b368a40..682d572 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="PageTitleInvoiceContent">
+        <value xml:lang="en">Invoice Content</value>
+        <value xml:lang="nl">Factuurcontent</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 7854589..4f149f9 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="invoiceContent">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="invoiceContent"/>
+    </request-map>
     
     <!-- re Invoice Roles -->
     <request-map uri="invoiceRoles">
@@ -2633,6 +2637,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="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"/>
     <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 7dd2e98..1b3d004 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="invoiceContent" title="${uiLabelMap.CommonContent}">
+            <condition>
+                <and>
+                    <not><if-empty field="invoice.invoiceId"/></not>
+                </and>
+            </condition>
+            <link target="invoiceContent">
+                <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 3773f1c..3c703f4 100644
--- a/applications/accounting/widget/InvoiceForms.xml
+++ b/applications/accounting/widget/InvoiceForms.xml
@@ -140,6 +140,10 @@ 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="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"/>
+    </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>
diff --git a/applications/accounting/widget/InvoiceScreens.xml b/applications/accounting/widget/InvoiceScreens.xml
index dce5ac0..2f9ea64 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="InvoiceContent">
+        <section>
+            <actions>
+                <set field="titleProperty" value="PageTitleInvoiceContent"/>
+                <set field="tabButtonItem" value="invoiceContent"/>
+                <set field="invoiceId" from-field="parameters.invoiceId"/>
+                <entity-one entity-name="Invoice" value-field="invoice"/>
+                <entity-and entity-name="InvoiceContent" list="invoiceContentList">
+                    <field-map field-name="invoiceId" from-field="invoiceId"/>
+                    <order-by field-name="contentId"/>
+                </entity-and>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonInvoiceDecorator" location="${parameters.invoiceDecoratorLocation}">
+                    <decorator-section name="body">
+                    <section>
+                        <widgets>
+                            <screenlet title="${uiLabelMap.CommonContent}">
+                                <include-grid name="InvoiceContent" location="component://accounting/widget/InvoiceForms.xml"/>
+                            </screenlet>
+                        </widgets>
+                    </section>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
     <screen name="InvoiceRoles">
         <section>
             <actions>