Anil,

Thank you for making that change. I was going to suggest it earlier, but I decided not to because... well... I'm tired of explaining why this is a better way of doing it.

-Adrian

[email protected] wrote:
Author: apatel
Date: Thu Oct 15 21:15:38 2009
New Revision: 825663

URL: http://svn.apache.org/viewvc?rev=825663&view=rev
Log:
Moved CommonBillingAccountDecorator back to BillingAccountScreens.xml. Add 
billingAccountDecoratorLocation parameter for location. This pattern to 
reference screen decorator is much more flexible and is already in place in 
Invoice and Payment screens.

Modified:
    ofbiz/trunk/applications/accounting/widget/BillingAccountScreens.xml
    ofbiz/trunk/applications/accounting/widget/CommonScreens.xml

Modified: ofbiz/trunk/applications/accounting/widget/BillingAccountScreens.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/BillingAccountScreens.xml?rev=825663&r1=825662&r2=825663&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/BillingAccountScreens.xml 
(original)
+++ ofbiz/trunk/applications/accounting/widget/BillingAccountScreens.xml Thu 
Oct 15 21:15:38 2009
@@ -20,6 +20,38 @@
<screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
         
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd";>
+ +
+    <screen name="CommonBillingAccountDecorator">
+        <section>
+            <widgets>
+                <decorator-screen name="main-decorator" 
location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <section>
+                            <!-- do check for ACCOUNTING, _VIEW permission -->
+                            <condition>
+                                <if-has-permission permission="ACCOUNTING" 
action="_VIEW"/>
+                            </condition>
+                            <widgets>
+                                <section>
+                                    <condition>
+                                        <not><if-empty 
field="billingAccount"/></not>
+                                    </condition>
+                                    <widgets>
+                                        <include-menu name="BillingAccountTabBar" 
location="component://accounting/widget/Menus.xml"/>
+                                    </widgets>
+                                </section>
+                                <decorator-section-include name="body"/>
+                            </widgets>
+                            <fail-widgets>
+                                <label 
style="h3">${uiLabelMap.AccountingViewPermissionError}</label>
+                            </fail-widgets>
+                        </section>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
     <screen name="FindBillingAccount">
         <section>
             <actions>
@@ -82,7 +114,7 @@
                 <set field="roleTypeId" from-field="parameters.roleTypeId"/>
             </actions>
             <widgets>
-                <decorator-screen name="CommonBillingAccountDecorator" 
location="${parameters.mainDecoratorLocation}">
+                <decorator-screen name="CommonBillingAccountDecorator" 
location="${parameters.billingAccountDecoratorLocation}">
                     <decorator-section name="body">
                         <screenlet 
title="${uiLabelMap.PageTitleEditBillingAccount}">
                             <include-form name="EditBillingAccount" 
location="component://accounting/widget/BillingAccountForms.xml"/>
@@ -103,7 +135,7 @@
                 <entity-one entity-name="BillingAccount" 
value-field="billingAccount"/>
             </actions>
             <widgets>
-                <decorator-screen name="CommonBillingAccountDecorator" 
location="${parameters.mainDecoratorLocation}">
+                <decorator-screen name="CommonBillingAccountDecorator" 
location="${parameters.billingAccountDecoratorLocation}">
                     <decorator-section name="body">
                         <screenlet id="BllingAccountRolePanel" 
title="${uiLabelMap.PageTitleAddBillingAccountRoles}" collapsible="true">
                             <include-form name="AddBillingAccountRole" 
location="component://accounting/widget/BillingAccountForms.xml"/>
@@ -126,7 +158,7 @@
                 <entity-one entity-name="BillingAccount" 
value-field="billingAccount"/>
             </actions>
             <widgets>
-                <decorator-screen name="CommonBillingAccountDecorator" 
location="${parameters.mainDecoratorLocation}">
+                <decorator-screen name="CommonBillingAccountDecorator" 
location="${parameters.billingAccountDecoratorLocation}">
                     <decorator-section name="body">
                         <container style="screenlet">
                             <container style="screenlet-title-bar">
@@ -199,7 +231,7 @@
                 <entity-one entity-name="BillingAccount" 
value-field="billingAccount"/>
             </actions>
             <widgets>
-                <decorator-screen name="CommonBillingAccountDecorator" 
location="${parameters.mainDecoratorLocation}">
+                <decorator-screen name="CommonBillingAccountDecorator" 
location="${parameters.billingAccountDecoratorLocation}">
                     <decorator-section name="body">
                         <screenlet id="BillingAccountInvoicePanel" 
title="${uiLabelMap.AccountingFindInvoices}" collapsible="true">
                             <include-form name="lookupInvoicesStatus" 
location="component://accounting/webapp/accounting/invoice/InvoiceForms.xml"/>
@@ -222,7 +254,7 @@
                 <script 
location="component://accounting/webapp/accounting/WEB-INF/actions/order/BillingAccountOrders.groovy"/>
             </actions>
             <widgets>
-                <decorator-screen name="CommonBillingAccountDecorator" 
location="${parameters.mainDecoratorLocation}">
+                <decorator-screen name="CommonBillingAccountDecorator" 
location="${parameters.billingAccountDecoratorLocation}">
                     <decorator-section name="body">
                         <container style="screenlet">
                             <container style="screenlet-title-bar">
@@ -261,7 +293,7 @@
                 <set field="billToCustomer" from-field="billToCustomers[0]"/>
             </actions>
             <widgets>
-                <decorator-screen name="CommonBillingAccountDecorator" 
location="${parameters.mainDecoratorLocation}">
+                <decorator-screen name="CommonBillingAccountDecorator" 
location="${parameters.billingAccountDecoratorLocation}">
                     <decorator-section name="body">
                         <screenlet id="BillingAccountPaymentPanel" 
title="${uiLabelMap.AccountingCreatePayment}" collapsible="true">
                             <include-form name="CreateIncomingBillingAccountPayment" 
location="component://accounting/widget/BillingAccountForms.xml"/>

Modified: ofbiz/trunk/applications/accounting/widget/CommonScreens.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/CommonScreens.xml?rev=825663&r1=825662&r2=825663&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/CommonScreens.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/CommonScreens.xml Thu Oct 15 
21:15:38 2009
@@ -308,35 +308,4 @@
         </section>
     </screen>
- <screen name="CommonBillingAccountDecorator">
-        <section>
-            <widgets>
-                <decorator-screen name="main-decorator" 
location="${parameters.mainDecoratorLocation}">
-                    <decorator-section name="body">
-                        <section>
-                            <!-- do check for ACCOUNTING, _VIEW permission -->
-                            <condition>
-                                <if-has-permission permission="ACCOUNTING" 
action="_VIEW"/>
-                            </condition>
-                            <widgets>
-                                <section>
-                                    <condition>
-                                        <not><if-empty 
field="billingAccount"/></not>
-                                    </condition>
-                                    <widgets>
-                                        <include-menu name="BillingAccountTabBar" 
location="component://accounting/widget/Menus.xml"/>
-                                    </widgets>
-                                </section>
-                                <decorator-section-include name="body"/>
-                            </widgets>
-                            <fail-widgets>
-                                <label 
style="h3">${uiLabelMap.AccountingViewPermissionError}</label>
-                            </fail-widgets>
-                        </section>
-                    </decorator-section>
-                </decorator-screen>
-            </widgets>
-        </section>
-    </screen>
-
 </screens>



Reply via email to