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 d538b84 Improved: VIEW permissions Payment Attributes (OFBIZ-12439) (#396) d538b84 is described below commit d538b841649d5a9112a1c4dab8b6ec8388af05dc Author: Pierre Smits <pierre.sm...@orrtiz.com> AuthorDate: Thu Dec 9 10:28:18 2021 +0100 Improved: VIEW permissions Payment Attributes (OFBIZ-12439) (#396) Though there is an entity PaymentAttribute this cannot be accessed by user with VIEW permissions when accessing a Payment. See: for entity data: https://demo-trunk.ofbiz.apache.org/webtools/control/entity/find/PaymentAttribute test payment: https://demo-trunk.ofbiz.apache.org/accounting/control/paymentOverview?paymentId=8003 Modified: AccountingMenus.xml added menu-item for payment attributes to InvoiceTabBar menu controller.xml added request-map and view-map for request paymentAttributes PaymentScreens.xml added screen for payment attributes PaymentForms.xml added grid to display payment attributes AccountingUiLabels.xml - added label PageTitlePaymentAttributes, used in screen PaymentAttributes --- .../accounting/config/AccountingUiLabels.xml | 4 +++ .../webapp/accounting/WEB-INF/controller.xml | 5 ++++ applications/accounting/widget/AccountingMenus.xml | 8 ++++++ applications/accounting/widget/PaymentForms.xml | 6 ++-- applications/accounting/widget/PaymentScreens.xml | 33 ++++++++++++++++++++-- 5 files changed, 51 insertions(+), 5 deletions(-) diff --git a/applications/accounting/config/AccountingUiLabels.xml b/applications/accounting/config/AccountingUiLabels.xml index c13a0f8..d513aae 100644 --- a/applications/accounting/config/AccountingUiLabels.xml +++ b/applications/accounting/config/AccountingUiLabels.xml @@ -24528,6 +24528,10 @@ <value xml:lang="zh">支付总览</value> <value xml:lang="zh-TW">支付總覽</value> </property> + <property key="PageTitlePaymentAttributes"> + <value xml:lang="en">Payment Attributes</value> + <value xml:lang="nl">Betalingsattributen</value> + </property> <property key="PageTitleSalesInvoiceByProductCategorySummary"> <value xml:lang="ar">ملخص فواتير المبيعات بفئة السلعة</value> <value xml:lang="cs">Souhrn prodejních faktur podle kategorií produktů</value> diff --git a/applications/accounting/webapp/accounting/WEB-INF/controller.xml b/applications/accounting/webapp/accounting/WEB-INF/controller.xml index 05ebcb9..a5c1301 100644 --- a/applications/accounting/webapp/accounting/WEB-INF/controller.xml +++ b/applications/accounting/webapp/accounting/WEB-INF/controller.xml @@ -366,6 +366,10 @@ under the License. <security https="true" auth="true"/> <response name="success" type="view" value="paymentOverview"/> </request-map> + <request-map uri="paymentAttributes"> + <security https="true" auth="true"/> + <response name="success" type="view" value="paymentAttributes"/> + </request-map> <request-map uri="editPaymentApplications"> <security https="true" auth="true"/> <response name="success" type="view" value="editPaymentApplications"/> @@ -2656,6 +2660,7 @@ under the License. <!-- Payment --> <view-map name="findPayments" type="screen" page="component://accounting/widget/PaymentScreens.xml#FindPayments"/> <view-map name="paymentOverview" type="screen" page="component://accounting/widget/PaymentScreens.xml#PaymentOverview"/> + <view-map name="paymentAttributes" type="screen" page="component://accounting/widget/PaymentScreens.xml#PaymentAttributes"/> <view-map name="newPayment" type="screen" page="component://accounting/widget/PaymentScreens.xml#NewPayment"/> <view-map name="editPayment" type="screen" page="component://accounting/widget/PaymentScreens.xml#EditPayment"/> <view-map name="editPaymentApplications" type="screen" page="component://accounting/widget/PaymentScreens.xml#EditPaymentApplications"/> diff --git a/applications/accounting/widget/AccountingMenus.xml b/applications/accounting/widget/AccountingMenus.xml index 12c9984..4597f54 100644 --- a/applications/accounting/widget/AccountingMenus.xml +++ b/applications/accounting/widget/AccountingMenus.xml @@ -523,6 +523,14 @@ under the License. <parameter param-name="paymentId" from-field="payment.paymentId"/> </link> </menu-item> + <menu-item name="paymentAttributes" title="${uiLabelMap.CommonAttributes}"> + <condition> + <not><if-empty field="payment.paymentId"/></not> + </condition> + <link target="paymentAttributes"> + <parameter param-name="paymentId" from-field="payment.paymentId"/> + </link> + </menu-item> </menu> <menu name="PaymentSubTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml" diff --git a/applications/accounting/widget/PaymentForms.xml b/applications/accounting/widget/PaymentForms.xml index cfcc40f..476eac6 100644 --- a/applications/accounting/widget/PaymentForms.xml +++ b/applications/accounting/widget/PaymentForms.xml @@ -401,7 +401,6 @@ under the License. </hyperlink> </field> </form> - <grid name="PaymentApplications" list-name="paymentApplications" odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> <actions> @@ -444,7 +443,10 @@ under the License. <field name="taxAuthGeoId"><display-entity entity-name="Geo" key-field-name="geoId" description="${geoName}"></display-entity></field> <field name="amountApplied"><display type="currency" currency="${payment.currencyUomId}"/></field> </grid> - + <grid name="PaymentAttributes" list-name="paymentAttributes" paginate-target="paymentAttributes" + odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> + <auto-fields-entity entity-name="PaymentAttribute" default-field-type="display"/> + </grid> <form name="AcctgTransAndEntries" type="list" list-name="AcctgTransAndEntries" extends="AcctgTransAndEntries" extends-resource="component://accounting/widget/InvoiceForms.xml"> <field name="paymentId"><hidden/></field> <field name="invoiceId"><hyperlink description="${invoiceId}" target="invoiceOverview?invoiceId=${invoiceId}"/></field> diff --git a/applications/accounting/widget/PaymentScreens.xml b/applications/accounting/widget/PaymentScreens.xml index 7aa759d..0030e8c 100644 --- a/applications/accounting/widget/PaymentScreens.xml +++ b/applications/accounting/widget/PaymentScreens.xml @@ -31,6 +31,9 @@ under the License. <decorator-section name="pre-body"> <section> <widgets> + <container style="leftclear"> + <label style="h1" text="${uiLabelMap.CommonPayment}: ${paymentId}"/> + </container> <include-menu name="PaymentTabBar" location="component://accounting/widget/AccountingMenus.xml"/> <include-menu name="PaymentSubTabBar" location="component://accounting/widget/AccountingMenus.xml"/> </widgets> @@ -43,9 +46,6 @@ under the License. <if-service-permission service-name="acctgBasePermissionCheck" main-action="VIEW"/> </condition> <widgets> - <container style="leftclear"> - <label style="h1" text="${uiLabelMap[labelTitleProperty]} ${uiLabelMap.CommonId}:[${paymentId}] ${${extraFunctionName}}"/> - </container> <decorator-section-include name="body"/> </widgets> <fail-widgets> @@ -445,6 +445,33 @@ under the License. </widgets> </section> </screen> + <screen name="PaymentAttributes"> + <section> + <actions> + <set field="titleProperty" value="PageTitlePaymentAttributes"/> + <set field="tabButtonItem" value="paymentAttributes"/> + <set field="paymentId" from-field="parameters.paymentId"/> + <entity-one entity-name="Payment" value-field="payment"/> + <entity-and entity-name="PaymentAttribute" list="paymentAttributes"> + <field-map field-name="paymentId" from-field="paymentId"/> + <order-by field-name="attrName"/> + </entity-and> + </actions> + <widgets> + <decorator-screen name="CommonPaymentDecorator" location="${parameters.paymentDecoratorLocation}"> + <decorator-section name="body"> + <section> + <widgets> + <screenlet title="${uiLabelMap.CommonAttributes}"> + <include-grid name="PaymentAttributes" location="component://accounting/widget/PaymentForms.xml"/> + </screenlet> + </widgets> + </section> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> <screen name="ManualTransaction"> <section> <actions>