svn commit: r600242 - in /ofbiz/trunk/applications/accounting: data/ script/org/ofbiz/accounting/agreement/ script/org/ofbiz/accounting/permissions/ servicedef/ src/org/ofbiz/accounting/agreement/ webapp/accounting/agreement/ widget/

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r600242 - in /ofbiz/trunk/applications/accounting: data/ script/org/ofbiz/accounting/agreement/ script/org/ofbiz/accounting/permissions/ servicedef/ src/org/ofbiz/accounting/agreement/ webapp/accounting/agreement/ widget/

adrianc
Author: adrianc
Date: Sat Dec  1 21:11:59 2007
New Revision: 600242

URL: http://svn.apache.org/viewvc?rev=600242&view=rev
Log:
Accounting agreement permissions and UI work.

Jacopo & Anil - see my ACCTG_ATX comments in AccountingSecurityData.xml.

Jacques - AgreementServices.java has changed, might affect POS.

Modified:
    ofbiz/trunk/applications/accounting/data/AccountingSecurityData.xml
    ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/agreement/AgreementServices.xml
    ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/permissions/PermissionServices.xml
    ofbiz/trunk/applications/accounting/servicedef/services_agreement.xml
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/agreement/AgreementServices.java
    ofbiz/trunk/applications/accounting/webapp/accounting/agreement/AgreementTabBar.ftl
    ofbiz/trunk/applications/accounting/webapp/accounting/agreement/CopyAgreement.ftl
    ofbiz/trunk/applications/accounting/widget/AgreementScreens.xml

Modified: ofbiz/trunk/applications/accounting/data/AccountingSecurityData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/data/AccountingSecurityData.xml?rev=600242&r1=600241&r2=600242&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/data/AccountingSecurityData.xml (original)
+++ ofbiz/trunk/applications/accounting/data/AccountingSecurityData.xml Sat Dec  1 21:11:59 2007
@@ -89,26 +89,24 @@
     <SecurityGroupPermission groupId="FULLADMIN" permissionId="ACCTG_FX_UPDATE"/>
     <SecurityGroupPermission groupId="BIZADMIN" permissionId="ACCTG_FX_UPDATE"/>
 
-    <!-- For general ledger cccounting transactions.  Note that anyone who is authorized for proesses that create accounting transaction entries,
-        such as quick shipping an order, approving an invoice, a return, or authorizing shipments, should have the _CREATE and _POST privileges, but
-        _UPDATE and _DELETE should be given to accountants only, as that involves changing the books. -->
-    <SecurityPermission description="Create general ledger accounting transaction and entries." permissionId="ACCOUNTING_ATX_CREATE"/>
-    <SecurityPermission description="Update general ledger accounting transaction and entries." permissionId="ACCOUNTING_ATX_UPDATE"/>
-    <SecurityPermission description="Delete general ledger accounting transaction and entries." permissionId="ACCOUNTING_ATX_DELETE"/>
-    <SecurityPermission description="Post general ledger accounting transactions." permissionId="ACCOUNTING_ATX_POST"/>
+    <!-- For general ledger accounting transactions. Note that any component that needs to post
+        accounting transactions should create a permission service SECA to grant
+        task-specific permissions to post transactions. The following permissions
+        should be given to accountants only, as that involves changing the books. -->
+    <SecurityPermission description="ALL operations involving general ledger accounting transactions and entries." permissionId="ACCOUNTING_ATX_ADMIN"/>
+    <SecurityPermission description="Create general ledger accounting transaction and entries." permissionId="ACCTG_ATX_CREATE"/>
+    <SecurityPermission description="Update general ledger accounting transaction and entries." permissionId="ACCTG_ATX_UPDATE"/>
+    <SecurityPermission description="Delete general ledger accounting transaction and entries." permissionId="ACCTG_ATX_DELETE"/>
+    <SecurityPermission description="View general ledger accounting transaction and entries." permissionId="ACCTG_ATX_VIEW"/>
 
-    <SecurityGroupPermission groupId="FULLADMIN" permissionId="ACCOUNTING_ATX_CREATE"/>
-    <SecurityGroupPermission groupId="FLEXADMIN" permissionId="ACCOUNTING_ATX_CREATE"/>
-    <SecurityGroupPermission groupId="BIZADMIN" permissionId="ACCOUNTING_ATX_CREATE"/>
-    <SecurityGroupPermission groupId="FULLADMIN" permissionId="ACCOUNTING_ATX_UPDATE"/>
-    <SecurityGroupPermission groupId="FLEXADMIN" permissionId="ACCOUNTING_ATX_UPDATE"/>
-    <SecurityGroupPermission groupId="BIZADMIN" permissionId="ACCOUNTING_ATX_UPDATE"/>
-    <SecurityGroupPermission groupId="FULLADMIN" permissionId="ACCOUNTING_ATX_DELETE"/>
-    <SecurityGroupPermission groupId="FLEXADMIN" permissionId="ACCOUNTING_ATX_DELETE"/>
-    <SecurityGroupPermission groupId="BIZADMIN" permissionId="ACCOUNTING_ATX_DELETE"/>
-    <SecurityGroupPermission groupId="FULLADMIN" permissionId="ACCOUNTING_ATX_POST"/>
-    <SecurityGroupPermission groupId="FLEXADMIN" permissionId="ACCOUNTING_ATX_POST"/>
-    <SecurityGroupPermission groupId="BIZADMIN" permissionId="ACCOUNTING_ATX_POST"/>
-    
+    <SecurityGroupPermission groupId="FULLADMIN" permissionId="ACCTG_ATX_ADMIN"/>
+    <SecurityGroupPermission groupId="FLEXADMIN" permissionId="ACCTG_ATX_VIEW"/>
+    <SecurityGroupPermission groupId="FLEXADMIN" permissionId="ACCTG_ATX_CREATE"/>
+    <SecurityGroupPermission groupId="FLEXADMIN" permissionId="ACCTG_ATX_UPDATE"/>
+    <SecurityGroupPermission groupId="FLEXADMIN" permissionId="ACCTG_ATX_DELETE"/>
+    <SecurityGroupPermission groupId="BIZADMIN" permissionId="ACCTG_ATX_VIEW"/>
+    <SecurityGroupPermission groupId="BIZADMIN" permissionId="ACCTG_ATX_CREATE"/>
+    <SecurityGroupPermission groupId="BIZADMIN" permissionId="ACCTG_ATX_UPDATE"/>
+    <SecurityGroupPermission groupId="BIZADMIN" permissionId="ACCTG_ATX_DELETE"/>
     
 </entity-engine-xml>

Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/agreement/AgreementServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/agreement/AgreementServices.xml?rev=600242&r1=600241&r2=600242&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/agreement/AgreementServices.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/agreement/AgreementServices.xml Sat Dec  1 21:11:59 2007
@@ -27,12 +27,6 @@
     
     <!-- create a new Agreement -->
     <simple-method method-name="createAgreement" short-description="Create an Agreement">
-        <check-permission permission="ACCOUNTING" action="_CREATE">
-            <alt-permission permission="ACCOUNTING_ROLE" action="_CREATE"/>
-            <fail-message message="Security Error: to run createAgreement you must have the ACCOUNTING_CREATE or ACCOUNTING_ADMIN permission, or the limited ACCOUNTING_ROLE_CREATE permission"/>
-        </check-permission>
-        <check-errors/>
-
         <!-- create new entity and create all the fields -->
         <make-value value-name="newEntity" entity-name="Agreement"/>
         <set-nonpk-fields map-name="parameters" value-name="newEntity"/>
@@ -54,11 +48,6 @@
 
     <!-- update an existing Agreement -->
     <simple-method method-name="updateAgreement" short-description="Update an existing Agreement">
-        <check-permission permission="ACCOUNTING" action="_UPDATE">
-            <alt-permission permission="ACCOUNTING_ROLE" action="_UPDATE"/>
-            <fail-message message="Security Error: to run updateAgreement you must have the ACCOUNTING_UPDATE or ACCOUNTING_ADMIN permission, or the limited ACCOUNTING_ROLE_UPDATE permission"/>
-        </check-permission>
-        <check-errors/>
         <entity-one entity-name="Agreement" value-name="agreement" auto-field-map="true"/>
         <check-errors/>
         <set-nonpk-fields map-name="parameters" value-name="agreement"/>
@@ -68,11 +57,6 @@
 
     <!-- cancel an existing Agreement -->
     <simple-method method-name="cancelAgreement" short-description="Cancel an existing Agreement">
-        <check-permission permission="ACCOUNTING" action="_UPDATE">
-            <alt-permission permission="ACCOUNTING_ROLE" action="_UPDATE"/>
-            <fail-message message="Security Error: to run cancelAgreement you must have the ACCOUNTING_UPDATE or ACCOUNTING_ADMIN permission, or the limited ACCOUNTING_ROLE_UPDATE permission"/>
-        </check-permission>
-        <check-errors/>
         <entity-one entity-name="Agreement" value-name="agreement" auto-field-map="true"/>
         <check-errors/>
         <now-timestamp-to-env env-name="nowTimestamp"/>
@@ -81,14 +65,54 @@
         <check-errors/>
     </simple-method>
 
-    <!-- create a new AgreementItem -->
-    <simple-method method-name="createAgreementItem" short-description="Create an AgreementItem">
-        <check-permission permission="ACCOUNTING" action="_CREATE">
-            <alt-permission permission="ACCOUNTING_ROLE" action="_CREATE"/>
-            <fail-message message="Security Error: to run createAgreementItem you must have the ACCOUNTING_CREATE or ACCOUNTING_ADMIN permission, or the limited ACCOUNTING_ROLE_CREATE permission"/>
-        </check-permission>
+    <!-- copy an existing Agreement -->
+    <simple-method method-name="copyAgreement" short-description="Copy an existing Agreement">
+        <entity-one entity-name="Agreement" value-name="agreement" auto-field-map="true"/>
         <check-errors/>
+        <set-service-fields service-name="createAgreement" to-map-name="createAgreementInMap" map-name="agreement"/>
+        <call-service service-name="createAgreement" in-map-name="createAgreementInMap">
+            <result-to-field result-name="agreementId" field-name="agreementIdTo"/>
+        </call-service>
 
+        <get-related value-name="agreement" relation-name="AgreementItem" list-name="agreementItems"/>
+        <iterate list-name="agreementItems" entry-name="agreementItem">
+            <clear-field field-name="createAgreementItemInMap"/>
+            <set-service-fields service-name="createAgreementItem" to-map-name="createAgreementItemInMap" map-name="agreementItem"/>
+            <set from-field="agreementIdTo" field="createAgreementItemInMap.agreementId"/>
+            <call-service service-name="createAgreementItem" in-map-name="createAgreementItemInMap"/>
+        </iterate>
+        <if-compare field-name="parameters.copyAgreementTerms" value="Y" operator="equals">
+            <get-related value-name="agreement" relation-name="AgreementTerm" list-name="agreementTerms"/>
+            <iterate list-name="agreementTerms" entry-name="agreementTerm">
+                <clear-field field-name="createAgreementTermInMap"/>
+                <set-service-fields service-name="createAgreementTerm" to-map-name="createAgreementTermInMap" map-name="agreementTerm"/>
+                <set from-field="agreementIdTo" field="createAgreementTermInMap.agreementId"/>
+                <call-service service-name="createAgreementTerm" in-map-name="createAgreementTermInMap"/>
+            </iterate>
+        </if-compare>
+        <if-compare field-name="parameters.copyAgreementProducts" value="Y" operator="equals">
+            <get-related value-name="agreement" relation-name="AgreementProductAppl" list-name="agreementProductAppls"/>
+            <iterate list-name="agreementProductAppls" entry-name="agreementProductAppl">
+                <clear-field field-name="createAgreementProductApplInMap"/>
+                <set-service-fields service-name="createAgreementProductAppl" to-map-name="createAgreementProductApplInMap" map-name="agreementProductAppl"/>
+                <set from-field="agreementIdTo" field="createAgreementProductApplInMap.agreementId"/>
+                <call-service service-name="createAgreementProductAppl" in-map-name="createAgreementProductApplInMap"/>
+            </iterate>
+        </if-compare>
+        <if-compare field-name="parameters.copyAgreementParties" value="Y" operator="equals">
+            <get-related value-name="agreement" relation-name="AgreementPartyApplic" list-name="agreementPartyApplic"/>
+            <iterate list-name="agreementPartyApplics" entry-name="agreementPartyApplic">
+                <clear-field field-name="createAgreementPartyApplicInMap"/>
+                <set-service-fields service-name="createAgreementPartyApplic" to-map-name="createAgreementPartyApplicInMap" map-name="agreementPartyApplic"/>
+                <set from-field="agreementIdTo" field="createAgreementPartyApplicInMap.agreementId"/>
+                <call-service service-name="createAgreementPartyApplic" in-map-name="createAgreementPartyApplicInMap"/>
+            </iterate>
+        </if-compare>
+        <field-to-result field-name="agreementIdTo" result-name="agreementId"/>
+    </simple-method>
+
+    <!-- create a new AgreementItem -->
+    <simple-method method-name="createAgreementItem" short-description="Create an AgreementItem">
         <!-- create new entity and create all the fields -->
         <make-value value-name="newEntity" entity-name="AgreementItem"/>
         <set-nonpk-fields map-name="parameters" value-name="newEntity"/>
@@ -112,11 +136,6 @@
 
     <!-- update an existing AgreementItem -->
     <simple-method method-name="updateAgreementItem" short-description="Update an existing AgreementItem">
-        <check-permission permission="ACCOUNTING" action="_UPDATE">
-            <alt-permission permission="ACCOUNTING_ROLE" action="_UPDATE"/>
-            <fail-message message="Security Error: to run updateAgreementItem you must have the ACCOUNTING_UPDATE or ACCOUNTING_ADMIN permission, or the limited ACCOUNTING_ROLE_UPDATE permission"/>
-        </check-permission>
-        <check-errors/>
         <entity-one entity-name="AgreementItem" value-name="agreementItem" auto-field-map="true"/>
         <check-errors/>
         <set-nonpk-fields map-name="parameters" value-name="agreementItem"/>
@@ -126,11 +145,6 @@
 
     <!-- remove an AgreementItem -->
     <simple-method method-name="removeAgreementItem" short-description="Remove an AgreementItem">
-        <check-permission permission="ACCOUNTING" action="_UPDATE">
-            <alt-permission permission="ACCOUNTING_ROLE" action="_UPDATE"/>
-            <fail-message message="Security Error: to run removeAgreementItem you must have the ACCOUNTING_UPDATE or ACCOUNTING_ADMIN permission, or the limited ACCOUNTING_ROLE_UPDATE permission"/>
-        </check-permission>
-        <check-errors/>
         <entity-one entity-name="AgreementItem" value-name="agreementItem" auto-field-map="true"/>
         <check-errors/>
         <remove-value value-name="agreementItem"/>
@@ -138,12 +152,6 @@
 
     <!-- create a new AgreementTerm -->
     <simple-method method-name="createAgreementTerm" short-description="Create an AgreementTerm">
-        <check-permission permission="ACCOUNTING" action="_CREATE">
-            <alt-permission permission="ACCOUNTING_ROLE" action="_CREATE"/>
-            <fail-message message="Security Error: to run createAgreementTerm you must have the ACCOUNTING_CREATE or ACCOUNTING_ADMIN permission, or the limited ACCOUNTING_ROLE_CREATE permission"/>
-        </check-permission>
-        <check-errors/>
-
         <!-- create new entity and create all the fields -->
         <make-value value-name="newEntity" entity-name="AgreementTerm"/>
         <set-nonpk-fields map-name="parameters" value-name="newEntity"/>
@@ -162,11 +170,6 @@
 
     <!-- update an existing AgreementTerm -->
     <simple-method method-name="updateAgreementTerm" short-description="Update an existing AgreementTerm">
-        <check-permission permission="ACCOUNTING" action="_UPDATE">
-            <alt-permission permission="ACCOUNTING_ROLE" action="_UPDATE"/>
-            <fail-message message="Security Error: to run updateAgreementTerm you must have the ACCOUNTING_UPDATE or ACCOUNTING_ADMIN permission, or the limited ACCOUNTING_ROLE_UPDATE permission"/>
-        </check-permission>
-        <check-errors/>
         <entity-one entity-name="AgreementTerm" value-name="agreementTerm" auto-field-map="true"/>
         <check-errors/>
         <set-nonpk-fields map-name="parameters" value-name="agreementTerm"/>
@@ -176,11 +179,6 @@
 
     <!-- delete an existing AgreementTerm -->
     <simple-method method-name="deleteAgreementTerm" short-description="Delete an existing AgreementTerm">
-        <check-permission permission="ACCOUNTING" action="_UPDATE">
-            <alt-permission permission="ACCOUNTING_ROLE" action="_UPDATE"/>
-            <fail-message message="Security Error: to run deleteAgreementTerm you must have the ACCOUNTING_UPDATE or ACCOUNTING_ADMIN permission, or the limited ACCOUNTING_ROLE_UPDATE permission"/>
-        </check-permission>
-        <check-errors/>
         <entity-one entity-name="AgreementTerm" value-name="agreementTerm" auto-field-map="true"/>
         <check-errors/>
         <remove-value value-name="agreementTerm"/>
@@ -189,11 +187,6 @@
     
     <!-- create a new AgreementPromoAppl -->
     <simple-method method-name="createAgreementPromoAppl" short-description="Create an AgreementPromoAppl">
-        <check-permission permission="ACCOUNTING" action="_CREATE">
-            <alt-permission permission="ACCOUNTING_ROLE" action="_CREATE"/>
-            <fail-message message="Security Error: to run createAgreementPromoAppl you must have the ACCOUNTING_CREATE or ACCOUNTING_ADMIN permission, or the limited ACCOUNTING_ROLE_CREATE permission"/>
-        </check-permission>
-        <check-errors/>
         <make-value value-name="newEntity" entity-name="AgreementPromoAppl"/>
         <set-pk-fields map-name="parameters" value-name="newEntity"/>
         <set-nonpk-fields map-name="parameters" value-name="newEntity"/>
@@ -203,11 +196,6 @@
 
     <!-- update an existing AgreementPromoAppl -->
     <simple-method method-name="updateAgreementPromoAppl" short-description="Update an existing AgreementPromoAppl">
-        <check-permission permission="ACCOUNTING" action="_UPDATE">
-            <alt-permission permission="ACCOUNTING_ROLE" action="_UPDATE"/>
-            <fail-message message="Security Error: to run updateAgreementPromoAppl you must have the ACCOUNTING_UPDATE or ACCOUNTING_ADMIN permission, or the limited ACCOUNTING_ROLE_UPDATE permission"/>
-        </check-permission>
-        <check-errors/>
         <entity-one entity-name="AgreementPromoAppl" value-name="agreementPromoAppl" auto-field-map="true"/>
         <check-errors/>
         <set-nonpk-fields map-name="parameters" value-name="agreementPromoAppl"/>
@@ -217,11 +205,6 @@
 
     <!-- remove an existing AgreementPromoAppl -->
     <simple-method method-name="removeAgreementPromoAppl" short-description="Remove an existing AgreementPromoAppl">
-        <check-permission permission="ACCOUNTING" action="_UPDATE">
-            <alt-permission permission="ACCOUNTING_ROLE" action="_UPDATE"/>
-            <fail-message message="Security Error: to run removeAgreementPromoAppl you must have the ACCOUNTING_UPDATE or ACCOUNTING_ADMIN permission, or the limited ACCOUNTING_ROLE_UPDATE permission"/>
-        </check-permission>
-        <check-errors/>
         <entity-one entity-name="AgreementPromoAppl" value-name="agreementPromoAppl" auto-field-map="true"/>
         <check-errors/>
         <remove-value value-name="agreementPromoAppl"/>
@@ -230,11 +213,6 @@
     
     <!-- create a new AgreementProductAppl -->
     <simple-method method-name="createAgreementProductAppl" short-description="Create an AgreementProductAppl">
-        <check-permission permission="ACCOUNTING" action="_CREATE">
-            <alt-permission permission="ACCOUNTING_ROLE" action="_CREATE"/>
-            <fail-message message="Security Error: to run createAgreementProductAppl you must have the ACCOUNTING_CREATE or ACCOUNTING_ADMIN permission, or the limited ACCOUNTING_ROLE_CREATE permission"/>
-        </check-permission>
-        <check-errors/>
         <make-value value-name="newEntity" entity-name="AgreementProductAppl"/>
         <set-pk-fields map-name="parameters" value-name="newEntity"/>
         <set-nonpk-fields map-name="parameters" value-name="newEntity"/>
@@ -244,11 +222,6 @@
 
     <!-- update an existing AgreementProductAppl -->
     <simple-method method-name="updateAgreementProductAppl" short-description="Update an existing AgreementProductAppl">
-        <check-permission permission="ACCOUNTING" action="_UPDATE">
-            <alt-permission permission="ACCOUNTING_ROLE" action="_UPDATE"/>
-            <fail-message message="Security Error: to run updateAgreementProductAppl you must have the ACCOUNTING_UPDATE or ACCOUNTING_ADMIN permission, or the limited ACCOUNTING_ROLE_UPDATE permission"/>
-        </check-permission>
-        <check-errors/>
         <entity-one entity-name="AgreementProductAppl" value-name="agreementProductAppl" auto-field-map="true"/>
         <check-errors/>
         <set-nonpk-fields map-name="parameters" value-name="agreementProductAppl"/>
@@ -258,11 +231,6 @@
 
     <!-- remove an existing AgreementProductAppl -->
     <simple-method method-name="removeAgreementProductAppl" short-description="Remove an existing AgreementProductAppl">
-        <check-permission permission="ACCOUNTING" action="_UPDATE">
-            <alt-permission permission="ACCOUNTING_ROLE" action="_UPDATE"/>
-            <fail-message message="Security Error: to run removeAgreementProductAppl you must have the ACCOUNTING_UPDATE or ACCOUNTING_ADMIN permission, or the limited ACCOUNTING_ROLE_UPDATE permission"/>
-        </check-permission>
-        <check-errors/>
         <entity-one entity-name="AgreementProductAppl" value-name="agreementProductAppl" auto-field-map="true"/>
         <check-errors/>
         <remove-value value-name="agreementProductAppl"/>
@@ -271,11 +239,6 @@
 
     <!-- create a new AgreementPartyApplic -->
     <simple-method method-name="createAgreementPartyApplic" short-description="Create an AgreementPartyApplic">
-        <check-permission permission="ACCOUNTING" action="_CREATE">
-            <alt-permission permission="ACCOUNTING_ROLE" action="_CREATE"/>
-            <fail-message message="Security Error: to run createAgreementPartyApplic you must have the ACCOUNTING_CREATE or ACCOUNTING_ADMIN permission, or the limited ACCOUNTING_ROLE_CREATE permission"/>
-        </check-permission>
-        <check-errors/>
         <make-value value-name="newEntity" entity-name="AgreementPartyApplic"/>
         <set-pk-fields map-name="parameters" value-name="newEntity"/>
         <set-nonpk-fields map-name="parameters" value-name="newEntity"/>
@@ -285,11 +248,6 @@
 
     <!-- update an existing AgreementPartyApplic -->
     <simple-method method-name="updateAgreementPartyApplic" short-description="Update an existing AgreementPartyApplic">
-        <check-permission permission="ACCOUNTING" action="_UPDATE">
-            <alt-permission permission="ACCOUNTING_ROLE" action="_UPDATE"/>
-            <fail-message message="Security Error: to run updateAgreementPartyApplic you must have the ACCOUNTING_UPDATE or ACCOUNTING_ADMIN permission, or the limited ACCOUNTING_ROLE_UPDATE permission"/>
-        </check-permission>
-        <check-errors/>
         <entity-one entity-name="AgreementPartyApplic" value-name="agreementPartyApplic" auto-field-map="true"/>
         <check-errors/>
         <set-nonpk-fields map-name="parameters" value-name="agreementPartyApplic"/>
@@ -299,11 +257,6 @@
 
     <!-- remove an existing AgreementPartyApplic -->
     <simple-method method-name="removeAgreementPartyApplic" short-description="Remove an existing AgreementPartyApplic">
-        <check-permission permission="ACCOUNTING" action="_UPDATE">
-            <alt-permission permission="ACCOUNTING_ROLE" action="_UPDATE"/>
-            <fail-message message="Security Error: to run removeAgreementPartyApplic you must have the ACCOUNTING_UPDATE or ACCOUNTING_ADMIN permission, or the limited ACCOUNTING_ROLE_UPDATE permission"/>
-        </check-permission>
-        <check-errors/>
         <entity-one entity-name="AgreementPartyApplic" value-name="agreementPartyApplic" auto-field-map="true"/>
         <check-errors/>
         <remove-value value-name="agreementPartyApplic"/>
@@ -312,11 +265,6 @@
 
     <!-- create a new AgreementGeographicalApplic -->
     <simple-method method-name="createAgreementGeographicalApplic" short-description="Create an AgreementGeographicalApplic">
-        <check-permission permission="ACCOUNTING" action="_CREATE">
-            <alt-permission permission="ACCOUNTING_ROLE" action="_CREATE"/>
-            <fail-message message="Security Error: to run createAgreementGeographicalApplic you must have the ACCOUNTING_CREATE or ACCOUNTING_ADMIN permission, or the limited ACCOUNTING_ROLE_CREATE permission"/>
-        </check-permission>
-        <check-errors/>
         <make-value value-name="newEntity" entity-name="AgreementGeographicalApplic"/>
         <set-pk-fields map-name="parameters" value-name="newEntity"/>
         <set-nonpk-fields map-name="parameters" value-name="newEntity"/>
@@ -326,11 +274,6 @@
 
     <!-- update an existing AgreementGeographicalApplic -->
     <simple-method method-name="updateAgreementGeographicalApplic" short-description="Update an existing AgreementGeographicalApplic">
-        <check-permission permission="ACCOUNTING" action="_UPDATE">
-            <alt-permission permission="ACCOUNTING_ROLE" action="_UPDATE"/>
-            <fail-message message="Security Error: to run updateAgreementGeographicalApplic you must have the ACCOUNTING_UPDATE or ACCOUNTING_ADMIN permission, or the limited ACCOUNTING_ROLE_UPDATE permission"/>
-        </check-permission>
-        <check-errors/>
         <entity-one entity-name="AgreementGeographicalApplic" value-name="agreementGeographicalApplic" auto-field-map="true"/>
         <check-errors/>
         <set-nonpk-fields map-name="parameters" value-name="agreementGeographicalApplic"/>
@@ -340,66 +283,10 @@
 
     <!-- remove an existing AgreementGeographicalApplic -->
     <simple-method method-name="removeAgreementGeographicalApplic" short-description="Remove an existing AgreementGeographicalApplic">
-        <check-permission permission="ACCOUNTING" action="_UPDATE">
-            <alt-permission permission="ACCOUNTING_ROLE" action="_UPDATE"/>
-            <fail-message message="Security Error: to run removeAgreementGeographicalApplic you must have the ACCOUNTING_UPDATE or ACCOUNTING_ADMIN permission, or the limited ACCOUNTING_ROLE_UPDATE permission"/>
-        </check-permission>
-        <check-errors/>
         <entity-one entity-name="AgreementGeographicalApplic" value-name="agreementGeographicalApplic" auto-field-map="true"/>
         <check-errors/>
         <remove-value value-name="agreementGeographicalApplic"/>
         <check-errors/>
-    </simple-method>
-
-    <!-- copy an existing Agreement -->
-    <simple-method method-name="copyAgreement" short-description="Copy an existing Agreement">
-        <check-permission permission="ACCOUNTING" action="_CREATE">
-            <alt-permission permission="ACCOUNTING_ROLE" action="_CREATE"/>
-            <fail-message message="Security Error: to run copyAgreement you must have the ACCOUNTING_UPDATE or ACCOUNTING_ADMIN permission, or the limited ACCOUNTING_ROLE_UPDATE permission"/>
-        </check-permission>
-        <check-errors/>
-        <entity-one entity-name="Agreement" value-name="agreement" auto-field-map="true"/>
-        <check-errors/>
-        <set-service-fields service-name="createAgreement" to-map-name="createAgreementInMap" map-name="agreement"/>
-        <call-service service-name="createAgreement" in-map-name="createAgreementInMap">
-            <result-to-field result-name="agreementId" field-name="agreementIdTo"/>
-        </call-service>
-
-        <get-related value-name="agreement" relation-name="AgreementItem" list-name="agreementItems"/>
-        <iterate list-name="agreementItems" entry-name="agreementItem">
-            <clear-field field-name="createAgreementItemInMap"/>
-            <set-service-fields service-name="createAgreementItem" to-map-name="createAgreementItemInMap" map-name="agreementItem"/>
-            <set from-field="agreementIdTo" field="createAgreementItemInMap.agreementId"/>
-            <call-service service-name="createAgreementItem" in-map-name="createAgreementItemInMap"/>
-        </iterate>
-        <if-compare field-name="parameters.copyAgreementTerms" value="Y" operator="equals">
-            <get-related value-name="agreement" relation-name="AgreementTerm" list-name="agreementTerms"/>
-            <iterate list-name="agreementTerms" entry-name="agreementTerm">
-                <clear-field field-name="createAgreementTermInMap"/>
-                <set-service-fields service-name="createAgreementTerm" to-map-name="createAgreementTermInMap" map-name="agreementTerm"/>
-                <set from-field="agreementIdTo" field="createAgreementTermInMap.agreementId"/>
-                <call-service service-name="createAgreementTerm" in-map-name="createAgreementTermInMap"/>
-            </iterate>
-        </if-compare>
-        <if-compare field-name="parameters.copyAgreementProducts" value="Y" operator="equals">
-            <get-related value-name="agreement" relation-name="AgreementProductAppl" list-name="agreementProductAppls"/>
-            <iterate list-name="agreementProductAppls" entry-name="agreementProductAppl">
-                <clear-field field-name="createAgreementProductApplInMap"/>
-                <set-service-fields service-name="createAgreementProductAppl" to-map-name="createAgreementProductApplInMap" map-name="agreementProductAppl"/>
-                <set from-field="agreementIdTo" field="createAgreementProductApplInMap.agreementId"/>
-                <call-service service-name="createAgreementProductAppl" in-map-name="createAgreementProductApplInMap"/>
-            </iterate>
-        </if-compare>
-        <if-compare field-name="parameters.copyAgreementParties" value="Y" operator="equals">
-            <get-related value-name="agreement" relation-name="AgreementPartyApplic" list-name="agreementPartyApplic"/>
-            <iterate list-name="agreementPartyApplics" entry-name="agreementPartyApplic">
-                <clear-field field-name="createAgreementPartyApplicInMap"/>
-                <set-service-fields service-name="createAgreementPartyApplic" to-map-name="createAgreementPartyApplicInMap" map-name="agreementPartyApplic"/>
-                <set from-field="agreementIdTo" field="createAgreementPartyApplicInMap.agreementId"/>
-                <call-service service-name="createAgreementPartyApplic" in-map-name="createAgreementPartyApplicInMap"/>
-            </iterate>
-        </if-compare>
-        <field-to-result field-name="agreementIdTo" result-name="agreementId"/>
     </simple-method>
 
 </simple-methods>

Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/permissions/PermissionServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/permissions/PermissionServices.xml?rev=600242&r1=600241&r2=600242&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/permissions/PermissionServices.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/permissions/PermissionServices.xml Sat Dec  1 21:11:59 2007
@@ -29,6 +29,16 @@
         <call-simple-method method-name="genericBasePermissionCheck" xml-resource="component://common/script/org/ofbiz/common/permission/CommonPermissionServices.xml"/>
     </simple-method>
 
+    <!-- Returns hasPermission=true if user has one of the base ACCOUNTING CRUD+ADMIN permissions
+        OR if user has one of the base ACCOUNTING_ROLE CRUD+ADMIN permissions -->
+    <simple-method method-name="basePlusRolePermissionCheck" short-description="Accounting component base permission logic">
+        <set field="primaryPermission" value="ACCOUNTING"/>
+        <set field="altPermission" value="ACCOUNTING_ROLE"/>
+        <call-simple-method method-name="genericBasePermissionCheck" xml-resource="component://common/script/org/ofbiz/common/permission/CommonPermissionServices.xml"/>
+    </simple-method>
+
+    <!-- ============== Task-specific Permission Checking ============= -->
+
     <!-- Returns hasPermission=true if user has one of the ACCTG_PREF CRUD+ADMIN permissions -->
     <simple-method method-name="preferencePermissionCheck" short-description="Accounting preferences permission logic">
         <set field="primaryPermission" value="ACCTG_PREF"/>
@@ -53,6 +63,21 @@
                 </else>
             </if-has-permission>
         </if-compare>
+    </simple-method>
+
+    <!-- Returns hasPermission=true if user has one of the base ACCOUNTING CRUD+ADMIN permissions
+        OR if user has one of the base ACCOUNTING_ROLE CRUD+ADMIN permissions -->
+    <!-- TODO: Make this more user-role-specific. Users working with suppliers should only access
+        supplier agreements, users working with customers should only access customer
+        agreements, etc. -->
+    <simple-method method-name="acctgAgreementPermissionCheck" short-description="Accounting agreement permission logic">
+        <call-simple-method method-name="basePlusRolePermissionCheck"/>
+    </simple-method>
+
+    <!-- Returns hasPermission=true if user has one of the ACCOUNTING_COMM CRUD+ADMIN permissions -->
+    <simple-method method-name="commissionPermissionCheck" short-description="Accounting commissions permission logic">
+        <set field="primaryPermission" value="ACCOUNTING_COMM"/>
+        <call-simple-method method-name="genericBasePermissionCheck" xml-resource="component://common/script/org/ofbiz/common/permission/CommonPermissionServices.xml"/>
     </simple-method>
 
 </simple-methods>

Modified: ofbiz/trunk/applications/accounting/servicedef/services_agreement.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_agreement.xml?rev=600242&r1=600241&r2=600242&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/servicedef/services_agreement.xml (original)
+++ ofbiz/trunk/applications/accounting/servicedef/services_agreement.xml Sat Dec  1 21:11:59 2007
@@ -27,24 +27,28 @@
     <service name="createAgreement" default-entity-name="Agreement" engine="simple"
                 location="org/ofbiz/accounting/agreement/AgreementServices.xml" invoke="createAgreement" auth="true">
         <description>Create an Agreement</description>
+        <permission-service service-name="acctgAgreementPermissionCheck" main-action="CREATE"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
         <auto-attributes include="pk" mode="OUT" optional="true"/>
     </service>
     <service name="updateAgreement" default-entity-name="Agreement" engine="simple"
                 location="org/ofbiz/accounting/agreement/AgreementServices.xml" invoke="updateAgreement" auth="true">
         <description>Update an Agreement</description>
+        <permission-service service-name="acctgAgreementPermissionCheck" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
     <service name="cancelAgreement" default-entity-name="Agreement" engine="simple"
                 location="org/ofbiz/accounting/agreement/AgreementServices.xml" invoke="cancelAgreement" auth="true">
         <description>Cancel an Agreement</description>
+        <permission-service service-name="acctgAgreementPermissionCheck" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
     <service name="copyAgreement" default-entity-name="Agreement" engine="simple"
                 location="org/ofbiz/accounting/agreement/AgreementServices.xml" invoke="copyAgreement" auth="true">
         <description>Copy an Agreement</description>
+        <permission-service service-name="acctgAgreementPermissionCheck" main-action="CREATE"/>
         <auto-attributes include="pk" mode="INOUT" optional="false"/>
         <attribute name="copyAgreementTerms" type="String" mode="IN" optional="true"/>
         <attribute name="copyAgreementProducts" type="String" mode="IN" optional="true"/>
@@ -55,133 +59,170 @@
     <service name="createAgreementItem" default-entity-name="AgreementItem" engine="simple"
                 location="org/ofbiz/accounting/agreement/AgreementServices.xml" invoke="createAgreementItem" auth="true">
         <description>Create an AgreementItem</description>
+        <permission-service service-name="acctgAgreementPermissionCheck" main-action="CREATE"/>
         <auto-attributes include="pk" mode="INOUT" optional="true"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
     <service name="updateAgreementItem" default-entity-name="AgreementItem" engine="simple"
                 location="org/ofbiz/accounting/agreement/AgreementServices.xml" invoke="updateAgreementItem" auth="true">
         <description>Update an AgreementItem</description>
+        <permission-service service-name="acctgAgreementPermissionCheck" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="true"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
     <service name="removeAgreementItem" default-entity-name="AgreementItem" engine="simple"
                 location="org/ofbiz/accounting/agreement/AgreementServices.xml" invoke="removeAgreementItem" auth="true">
         <description>Remove an AgreementItem</description>
+        <permission-service service-name="acctgAgreementPermissionCheck" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="INOUT" optional="true"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
+
     <!-- AgreementTerm  -->
     <service name="createAgreementTerm" default-entity-name="AgreementTerm" engine="simple"
                 location="org/ofbiz/accounting/agreement/AgreementServices.xml" invoke="createAgreementTerm" auth="true">
         <description>Create an AgreementTerm</description>
+        <permission-service service-name="acctgAgreementPermissionCheck" main-action="CREATE"/>
         <auto-attributes include="pk" mode="INOUT" optional="true"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
     <service name="updateAgreementTerm" default-entity-name="AgreementTerm" engine="simple"
                 location="org/ofbiz/accounting/agreement/AgreementServices.xml" invoke="updateAgreementTerm" auth="true">
         <description>Update an AgreementTerm</description>
+        <permission-service service-name="acctgAgreementPermissionCheck" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="true"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
     <service name="deleteAgreementTerm" default-entity-name="AgreementTerm" engine="simple"
                 location="org/ofbiz/accounting/agreement/AgreementServices.xml" invoke="deleteAgreementTerm" auth="true">
         <description>Delete an AgreementTerm</description>
+        <permission-service service-name="acctgAgreementPermissionCheck" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="true"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
+
     <!-- AgreementPromoAppl  -->
     <service name="createAgreementPromoAppl" default-entity-name="AgreementPromoAppl" engine="simple"
                 location="org/ofbiz/accounting/agreement/AgreementServices.xml" invoke="createAgreementPromoAppl" auth="true">
         <description>Create an AgreementPromoAppl</description>
+        <permission-service service-name="acctgAgreementPermissionCheck" main-action="CREATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
     <service name="updateAgreementPromoAppl" default-entity-name="AgreementPromoAppl" engine="simple"
                 location="org/ofbiz/accounting/agreement/AgreementServices.xml" invoke="updateAgreementPromoAppl" auth="true">
         <description>Update an AgreementPromoAppl</description>
+        <permission-service service-name="acctgAgreementPermissionCheck" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
     <service name="removeAgreementPromoAppl" default-entity-name="AgreementPromoAppl" engine="simple"
                 location="org/ofbiz/accounting/agreement/AgreementServices.xml" invoke="removeAgreementPromoAppl" auth="true">
         <description>Remove an AgreementPromoAppl</description>
+        <permission-service service-name="acctgAgreementPermissionCheck" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
-    <service name="getCommissionForProduct" engine="java"
-                location="org.ofbiz.accounting.agreement.AgreementServices" invoke="getCommissionForProduct" auth="true">
-        <description>Get commission receiving parties and amounts for a product. &lt;br/&gt;
-            amount input is for the entire quantity. &lt;br/&gt;&lt;br/&gt;
-            Returns a List of Maps each containing &lt;br/&gt;
-            partyIdFrom     String  commission paying party &lt;br/&gt;
-            partyIdTo       String  commission receiving party &lt;br/&gt;
-            commission      BigDecimal  Commission &lt;br/&gt;
-            days            Long    term days &lt;br/&gt;
-            currencyUomId   String  Currency &lt;br/&gt;
-            productId       String  Product Id &lt;br/&gt;
-            Will use the virtual product if no agreement is found for a variant product.  If no quantity is specified, defaults to one (1).
-        </description>
-        <attribute name="productId" type="String" mode="IN" optional="false"/>
-        <attribute name="invoiceItemTypeId" type="String" mode="IN" optional="false"/>
-        <attribute name="amount" type="BigDecimal" mode="IN" optional="false"/>
-        <attribute name="quantity" type="BigDecimal" mode="IN" optional="true"/>
-        <attribute name="commissions" type="List" mode="OUT" optional="false"/>
-    </service>
+
     <!-- AgreementProductAppl  -->
     <service name="createAgreementProductAppl" default-entity-name="AgreementProductAppl" engine="simple"
                 location="org/ofbiz/accounting/agreement/AgreementServices.xml" invoke="createAgreementProductAppl" auth="true">
         <description>Create an AgreementProductAppl</description>
+        <permission-service service-name="acctgAgreementPermissionCheck" main-action="CREATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
     <service name="updateAgreementProductAppl" default-entity-name="AgreementProductAppl" engine="simple"
                 location="org/ofbiz/accounting/agreement/AgreementServices.xml" invoke="updateAgreementProductAppl" auth="true">
         <description>Update an AgreementProductAppl</description>
+        <permission-service service-name="acctgAgreementPermissionCheck" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
     <service name="removeAgreementProductAppl" default-entity-name="AgreementProductAppl" engine="simple"
                 location="org/ofbiz/accounting/agreement/AgreementServices.xml" invoke="removeAgreementProductAppl" auth="true">
         <description>Remove an AgreementProductAppl</description>
+        <permission-service service-name="acctgAgreementPermissionCheck" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
+
     <!-- AgreementPartyApplic  -->
     <service name="createAgreementPartyApplic" default-entity-name="AgreementPartyApplic" engine="simple"
                 location="org/ofbiz/accounting/agreement/AgreementServices.xml" invoke="createAgreementPartyApplic" auth="true">
         <description>Create an AgreementPartyApplic</description>
+        <permission-service service-name="acctgAgreementPermissionCheck" main-action="CREATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
     <service name="updateAgreementPartyApplic" default-entity-name="AgreementPartyApplic" engine="simple"
                 location="org/ofbiz/accounting/agreement/AgreementServices.xml" invoke="updateAgreementPartyApplic" auth="true">
         <description>Update an AgreementPartyApplic</description>
+        <permission-service service-name="acctgAgreementPermissionCheck" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
     <service name="removeAgreementPartyApplic" default-entity-name="AgreementPartyApplic" engine="simple"
                 location="org/ofbiz/accounting/agreement/AgreementServices.xml" invoke="removeAgreementPartyApplic" auth="true">
         <description>Remove an AgreementPartyApplic</description>
+        <permission-service service-name="acctgAgreementPermissionCheck" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
+
     <!-- AgreementGeographicalApplic  -->
     <service name="createAgreementGeographicalApplic" default-entity-name="AgreementGeographicalApplic" engine="simple"
                 location="org/ofbiz/accounting/agreement/AgreementServices.xml" invoke="createAgreementGeographicalApplic" auth="true">
         <description>Create an AgreementGeographicalApplic</description>
+        <permission-service service-name="acctgAgreementPermissionCheck" main-action="CREATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
     <service name="updateAgreementGeographicalApplic" default-entity-name="AgreementGeographicalApplic" engine="simple"
                 location="org/ofbiz/accounting/agreement/AgreementServices.xml" invoke="updateAgreementGeographicalApplic" auth="true">
         <description>Update an AgreementGeographicalApplic</description>
+        <permission-service service-name="acctgAgreementPermissionCheck" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
     <service name="removeAgreementGeographicalApplic" default-entity-name="AgreementGeographicalApplic" engine="simple"
                 location="org/ofbiz/accounting/agreement/AgreementServices.xml" invoke="removeAgreementGeographicalApplic" auth="true">
         <description>Remove an AgreementGeographicalApplic</description>
+        <permission-service service-name="acctgAgreementPermissionCheck" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
+    </service>
+
+    <service name="getCommissionForProduct" engine="java"
+                location="org.ofbiz.accounting.agreement.AgreementServices" invoke="getCommissionForProduct" auth="true">
+        <description>Get commission receiving parties and amounts for a product. &lt;br/&gt;
+            amount input is for the entire quantity. &lt;br/&gt;&lt;br/&gt;
+            Returns a List of Maps each containing &lt;br/&gt;
+            partyIdFrom     String  commission paying party &lt;br/&gt;
+            partyIdTo       String  commission receiving party &lt;br/&gt;
+            commission      BigDecimal  Commission &lt;br/&gt;
+            days            Long    term days &lt;br/&gt;
+            currencyUomId   String  Currency &lt;br/&gt;
+            productId       String  Product Id &lt;br/&gt;
+            Will use the virtual product if no agreement is found for a variant product.  If no quantity is specified, defaults to one (1).
+        </description>
+        <permission-service service-name="acctgCommissionPermissionCheck" main-action="VIEW"/>
+        <attribute name="productId" type="String" mode="IN" optional="false"/>
+        <attribute name="invoiceItemTypeId" type="String" mode="IN" optional="false"/>
+        <attribute name="amount" type="BigDecimal" mode="IN" optional="false"/>
+        <attribute name="quantity" type="BigDecimal" mode="IN" optional="true"/>
+        <attribute name="commissions" type="List" mode="OUT" optional="false"/>
+    </service>
+
+    <!-- Permission services -->
+    <service name="acctgAgreementPermissionCheck" engine="simple"
+            location="component://accounting/script/org/ofbiz/accounting/permissions/PermissionServices.xml" invoke="acctgAgreementPermissionCheck">
+        <description>Accounting Agreement Permission Checking Logic</description>
+        <implements service="permissionInterface"/>
+    </service>
+    <service name="acctgCommissionPermissionCheck" engine="simple"
+            location="component://accounting/script/org/ofbiz/accounting/permissions/PermissionServices.xml" invoke="commissionPermissionCheck">
+        <description>Accounting Commission Permission Checking Logic</description>
+        <implements service="permissionInterface"/>
     </service>
 </services>

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/agreement/AgreementServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/agreement/AgreementServices.java?rev=600242&r1=600241&r2=600242&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/agreement/AgreementServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/agreement/AgreementServices.java Sat Dec  1 21:11:59 2007
@@ -25,7 +25,6 @@
 import java.util.Locale;
 import java.util.Map;
 import javolution.util.FastList;
-import javolution.util.FastMap;
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.UtilMisc;
 import org.ofbiz.base.util.UtilNumber;
@@ -35,7 +34,6 @@
 import org.ofbiz.entity.GenericEntityException;
 import org.ofbiz.entity.GenericValue;
 import org.ofbiz.entity.util.EntityUtil;
-import org.ofbiz.security.Security;
 import org.ofbiz.service.DispatchContext;
 import org.ofbiz.service.ModelService;
 import org.ofbiz.service.ServiceUtil;
@@ -78,21 +76,11 @@
      *              productId       String  Product Id
      */
     public static Map getCommissionForProduct(DispatchContext ctx, Map context) {
-        Map result = FastMap.newInstance();
         GenericDelegator delegator = ctx.getDelegator();
-        Security security = ctx.getSecurity();
-        GenericValue userLogin = (GenericValue) context.get("userLogin");
         Locale locale = (Locale) context.get("locale");
         String errMsg = null;
         List commissions = FastList.newInstance();
         
-        // either ACCOUNTING_COMM_VIEW or ACCOUNTING_MANAGER should be allowed to see commission amounts
-        if (!security.hasEntityPermission("ACCOUNTING", "_COMM_VIEW", userLogin)) {
-            result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_ERROR);
-            errMsg = UtilProperties.getMessage(ServiceUtil.resource, "serviceUtil.no_permission_to_operation", locale) + ".";
-            result.put(ModelService.ERROR_MESSAGE, errMsg);
-            return result;
-        }
         try {
             BigDecimal amount = ((BigDecimal)context.get("amount"));
             BigDecimal quantity = (BigDecimal)context.get("quantity");

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/agreement/AgreementTabBar.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/agreement/AgreementTabBar.ftl?rev=600242&r1=600241&r2=600242&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/agreement/AgreementTabBar.ftl (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/agreement/AgreementTabBar.ftl Sat Dec  1 21:11:59 2007
@@ -16,28 +16,28 @@
 specific language governing permissions and limitations
 under the License.
 -->
-<#assign selected = page.tabButtonItem?default("void")>
-
 <#if agreement?has_content>
-  <div class="button-bar button-style-1">
+  <#assign selected = tabButtonItem?default("void")>
+  <div class="button-bar tab-bar">
     <ul>
-      <li<#if selected == "EditAgreement"> class="selected"</#if>><a href="<@ofbizUrl>EditAgreement?agreementId=${agreement.agreementId}</@ofbizUrl>">${uiLabelMap.AccountingAgreement}</a></li>
-      <li<#if selected == "EditAgreementTerms"> class="selected"</#if>><a href="<@ofbizUrl>EditAgreementTerms?agreementId=${agreement.agreementId}</@ofbizUrl>">${uiLabelMap.AccountingAgreementTerms}</a></li>
-      <li<#if selected == "ListAgreementItems"> class="selected"</#if>><a href="<@ofbizUrl>ListAgreementItems?agreementId=${agreement.agreementId}</@ofbizUrl>">${uiLabelMap.AccountingAgreementItems}</a></li>
+      <li<#if selected == "AgreementMain"> class="selected"</#if>><a href="<@ofbizUrl>EditAgreement?agreementId=${agreement.agreementId}</@ofbizUrl>">${uiLabelMap.AccountingAgreement}</a></li>
+      <li<#if selected == "AgreementTerms"> class="selected"</#if>><a href="<@ofbizUrl>EditAgreementTerms?agreementId=${agreement.agreementId}</@ofbizUrl>">${uiLabelMap.AccountingAgreementTerms}</a></li>
+      <li<#if selected == "AgreementItems"> class="selected"</#if>><a href="<@ofbizUrl>ListAgreementItems?agreementId=${agreement.agreementId}</@ofbizUrl>">${uiLabelMap.AccountingAgreementItems}</a></li>
     </ul>
     <br class="clear"/>
   </div>
 </#if>
 <#if agreementItem?has_content>
-  <div class="button-bar button-style-1">
+  <#assign selected = buttonBarItem?default("void")>
+  <div class="button-bar tab-bar">
     <ul>
       <li<#if selected == "EditAgreementItem"> class="selected"</#if>><a href="<@ofbizUrl>EditAgreementItem?agreementId=${agreementItem.agreementId}&agreementItemSeqId=${agreementItem.agreementItemSeqId}</@ofbizUrl>">${uiLabelMap.AccountingAgreementItem}</a></li>
       <li<#if selected == "ListAgreementPromoAppls"> class="selected"</#if>><a href="<@ofbizUrl>ListAgreementPromoAppls?agreementId=${agreementItem.agreementId}&agreementItemSeqId=${agreementItem.agreementItemSeqId}</@ofbizUrl>">${uiLabelMap.AccountingAgreementPromoAppls}</a></li>
       <li<#if selected == "ListAgreementItemTerms"> class="selected"</#if>><a href="<@ofbizUrl>ListAgreementItemTerms?agreementId=${agreementItem.agreementId}&agreementItemSeqId=${agreementItem.agreementItemSeqId}</@ofbizUrl>">${uiLabelMap.AccountingAgreementItemTerms}</a></li>
       <#if agreement.agreementTypeId == "PURCHASE_AGREEMENT">
-      <li<#if selected == "ListAgreementItemSupplierProducts"> class="selected"</#if>><a href="<@ofbizUrl>ListAgreementItemSupplierProducts?agreementId=${agreementItem.agreementId}&agreementItemSeqId=${agreementItem.agreementItemSeqId}</@ofbizUrl>">${uiLabelMap.ProductProducts}</a></li>
+        <li<#if selected == "ListAgreementItemSupplierProducts"> class="selected"</#if>><a href="<@ofbizUrl>ListAgreementItemSupplierProducts?agreementId=${agreementItem.agreementId}&agreementItemSeqId=${agreementItem.agreementItemSeqId}</@ofbizUrl>">${uiLabelMap.ProductProducts}</a></li>
       <#else>
-      <li<#if selected == "ListAgreementItemProducts"> class="selected"</#if>><a href="<@ofbizUrl>ListAgreementItemProducts?agreementId=${agreementItem.agreementId}&agreementItemSeqId=${agreementItem.agreementItemSeqId}</@ofbizUrl>">${uiLabelMap.ProductProducts}</a></li>
+        <li<#if selected == "ListAgreementItemProducts"> class="selected"</#if>><a href="<@ofbizUrl>ListAgreementItemProducts?agreementId=${agreementItem.agreementId}&agreementItemSeqId=${agreementItem.agreementItemSeqId}</@ofbizUrl>">${uiLabelMap.ProductProducts}</a></li>
       </#if>
       <li<#if selected == "ListAgreementItemParties"> class="selected"</#if>><a href="<@ofbizUrl>ListAgreementItemParties?agreementId=${agreementItem.agreementId}&agreementItemSeqId=${agreementItem.agreementItemSeqId}</@ofbizUrl>">${uiLabelMap.Party}</a></li>
       <li<#if selected == "ListAgreementGeographicalApplic"> class="selected"</#if>><a href="<@ofbizUrl>ListAgreementGeographicalApplic?agreementId=${agreementItem.agreementId}&agreementItemSeqId=${agreementItem.agreementItemSeqId}</@ofbizUrl>">${uiLabelMap.CommonGeo}</a></li>

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/agreement/CopyAgreement.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/agreement/CopyAgreement.ftl?rev=600242&r1=600241&r2=600242&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/agreement/CopyAgreement.ftl (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/agreement/CopyAgreement.ftl Sat Dec  1 21:11:59 2007
@@ -25,6 +25,8 @@
         ${uiLabelMap.ProductProducts}&nbsp;<input type="checkbox" name="copyAgreementProducts" value="Y" checked/>
         ${uiLabelMap.Party}&nbsp;<input type="checkbox" name="copyAgreementParties" value="Y" checked/>
     </div>
-    <input type="submit" value="${uiLabelMap.CommonCopy}"/>
+    <div class="button-bar">
+        <input type="submit" value="${uiLabelMap.CommonCopy}"/>
+    </div>
 </form>
 </#if>

Modified: ofbiz/trunk/applications/accounting/widget/AgreementScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/AgreementScreens.xml?rev=600242&r1=600241&r2=600242&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/AgreementScreens.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/AgreementScreens.xml Sat Dec  1 21:11:59 2007
@@ -26,23 +26,20 @@
                 <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"/>
+                                <if-service-permission service-name="acctgAgreementPermissionCheck" main-action="VIEW"/>
                             </condition>
                             <widgets>
                                 <platform-specific>
                                     <html><html-template location="component://accounting/webapp/accounting/agreement/AgreementTabBar.ftl"/></html>
                                 </platform-specific>
                                 <container>
-                                    <label style="head1">[${uiLabelMap.CommonId}:${agreement.agreementId}] ${agreement.description}</label>
+                                    <label style="head1">${agreement.description} [${agreement.agreementId}] </label>
                                 </container>
-
                                 <decorator-section-include name="body"/>
-
                             </widgets>
                             <fail-widgets>
-                                <label style="head3">${uiLabelMap.AcccountingViewPermissionError}</label>
+                                <label style="head3">${uiLabelMap.AccountingViewPermissionError}</label>
                             </fail-widgets>
                         </section>                    
                     </decorator-section>
@@ -59,32 +56,44 @@
                 <set field="headerItem" value="agreement"/>
                 <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer" default-value="0"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="50"/>
-
             </actions>
             <widgets>
                 <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
-                        <container>
-                            <label style="head1">${uiLabelMap.AccountingAgreements}</label>
-                        </container>
-                        <container>
-                            <link target="EditAgreement" text="[${uiLabelMap.AccountingNewAgreement}]" style="buttontext"/>
-                        </container>
-                        <include-form name="FindAgreements" location="component://accounting/webapp/accounting/agreement/AgreementForms.xml"/>
-                        <include-form name="ListAgreements" location="component://accounting/webapp/accounting/agreement/AgreementForms.xml"/>
+                        <section>
+                            <condition>
+                                <if-service-permission service-name="acctgAgreementPermissionCheck" main-action="VIEW"/>
+                            </condition>
+                            <widgets>
+                                <container>
+                                    <label style="head1">${uiLabelMap.AccountingAgreements}</label>
+                                </container>
+                                <container style="button-bar">
+                                    <link target="EditAgreement" text="${uiLabelMap.AccountingNewAgreement}" style="buttontext"/>
+                                </container>
+                                <include-form name="FindAgreements" location="component://accounting/webapp/accounting/agreement/AgreementForms.xml"/>
+                                <container style="button-bar">
+                                    <label text=""/>
+                                </container>
+                                <include-form name="ListAgreements" location="component://accounting/webapp/accounting/agreement/AgreementForms.xml"/>
+                            </widgets>
+                            <fail-widgets>
+                                <label style="head3">${uiLabelMap.AcccountingViewPermissionError}</label>
+                            </fail-widgets>
+                        </section>                    
                     </decorator-section>
                 </decorator-screen>
             </widgets>
          </section>
     </screen>
+
     <screen name="EditAgreement">
         <section>
             <actions>
                 <set field="title" value="Edit Agreement"/>
                 <set field="titleProperty" value="PageTitleEditAgreement"/>
                 <set field="headerItem" value="agreement"/>
-                <set field="tabButtonItem" value="EditAgreement"/>
-                
+                <set field="tabButtonItem" value="AgreementMain"/>
                 <set field="agreementId" from-field="parameters.agreementId"/>
                 <entity-one entity-name="Agreement" value-name="agreement"/>
             </actions>
@@ -96,7 +105,7 @@
                                 <not><if-empty field-name="agreement"/></not>
                             </condition>
                             <widgets>
-                                <container>
+                                <container style="button-bar">
                                     <link target="EditAgreement" text="${uiLabelMap.AccountingNewAgreement}" style="buttontext"/>
                                 </container>
                             </widgets>
@@ -110,25 +119,24 @@
             </widgets>
         </section>
     </screen>
+
     <screen name="ListAgreementItems">
         <section>
             <actions>
                 <set field="title" value="List Agreement Items"/>
                 <set field="titleProperty" value="PageTitleListAgreementItems"/>
                 <set field="headerItem" value="agreement"/>
-                <set field="tabButtonItem" value="ListAgreementItems"/>
-    
+                <set field="tabButtonItem" value="AgreementItems"/>
                 <entity-one entity-name="Agreement" value-name="agreement" auto-field-map="true"/>
                 <entity-and entity-name="AgreementItem" list-name="agreementItems">
                     <field-map env-name="agreement.agreementId" field-name="agreementId"/>
                 </entity-and>
-
             </actions>
             <widgets>
                 <decorator-screen name="CommonAgreementDecorator">
                     <decorator-section name="body">
-                        <container>
-                            <link target="EditAgreementItem?agreementId=${agreement.agreementId}" text="[${uiLabelMap.AccountingNewAgreementItem}]" style="buttontext"/>
+                        <container style="button-bar">
+                            <link target="EditAgreementItem?agreementId=${agreement.agreementId}" text="${uiLabelMap.AccountingNewAgreementItem}" style="buttontext"/>
                         </container>
                         <include-form name="ListAgreementItems" location="component://accounting/webapp/accounting/agreement/AgreementForms.xml"/>
                     </decorator-section>
@@ -136,25 +144,26 @@
             </widgets>
         </section>
     </screen>
+
     <screen name="EditAgreementItem">
         <section>
             <actions>
                 <set field="title" value="Edit Agreement Item"/>
                 <set field="titleProperty" value="PageTitleEditAgreementItem"/>
                 <set field="headerItem" value="agreement"/>
-                <set field="tabButtonItem" value="EditAgreementItem"/>
+                <set field="tabButtonItem" value="AgreementItems"/>
+                <set field="buttonBarItem" value="EditAgreementItem"/>
                 <property-to-field field="defaultCurrencyUomId" resource="general" property="currency.uom.id.default" default="USD" />                
                 <set field="agreementId" from-field="parameters.agreementId"/>
                 <set field="agreementItemSeqId" from-field="parameters.agreementItemSeqId"/>
-                
                 <entity-one entity-name="Agreement" value-name="agreement" auto-field-map="true"/>
                 <entity-one entity-name="AgreementItem" value-name="agreementItem"/>
             </actions>
             <widgets>
                 <decorator-screen name="CommonAgreementDecorator">
                     <decorator-section name="body">
-                        <container>
-                            <link target="EditAgreementItem?agreementId=${agreement.agreementId}" text="[${uiLabelMap.AccountingNewAgreementItem}]" style="buttontext"/>
+                        <container style="button-bar">
+                            <link target="EditAgreementItem?agreementId=${agreement.agreementId}" text="${uiLabelMap.AccountingNewAgreementItem}" style="buttontext"/>
                         </container>
                         <include-form name="EditAgreementItem" location="component://accounting/webapp/accounting/agreement/AgreementForms.xml"/>
                     </decorator-section>
@@ -162,13 +171,15 @@
             </widgets>
         </section>
     </screen>
+
     <screen name="EditAgreementTerms">
         <section>
             <actions>
                 <set field="title" value="Edit Agreement Terms"/>
                 <set field="titleProperty" value="PageTitleEditAgreementTerm"/>
                 <set field="headerItem" value="agreement"/>
-                <set field="tabButtonItem" value="EditAgreementTerms"/>
+                <set field="tabButtonItem" value="AgreementTerms"/>
+                <set field="buttonBarItem" value="EditAgreementTerms"/>
                 <set field="agreementId" from-field="parameters.agreementId"/>
                 <entity-one entity-name="Agreement" value-name="agreement" auto-field-map="true"/>
             </actions>
@@ -182,14 +193,15 @@
             </widgets>
         </section>
     </screen>
+
     <screen name="ListAgreementPromoAppls">
         <section>
             <actions>
                 <set field="title" value="List Agreement Promo Appls"/>
                 <set field="titleProperty" value="PageTitleListAgreementPromoAppls"/>
                 <set field="headerItem" value="agreement"/>
-                <set field="tabButtonItem" value="ListAgreementPromoAppls"/>
-    
+                <set field="tabButtonItem" value="AgreementItems"/>
+                <set field="buttonBarItem" value="ListAgreementPromoAppls"/>
                 <entity-one entity-name="Agreement" value-name="agreement" auto-field-map="true"/>
                 <entity-one entity-name="AgreementItem" value-name="agreementItem"/>
                 <entity-and entity-name="AgreementPromoAppl" list-name="agreementPromoAppls">
@@ -210,17 +222,17 @@
             </widgets>
         </section>
     </screen>
+
     <screen name="EditAgreementPromoAppl">
         <section>
             <actions>
                 <set field="title" value="Edit Agreement Promo Appl"/>
                 <set field="titleProperty" value="PageTitleEditAgreementPromoAppl"/>
                 <set field="headerItem" value="agreement"/>
-                <set field="tabButtonItem" value="ListAgreementPromoAppls"/>
-                
+                <set field="tabButtonItem" value="AgreementItems"/>
+                <set field="buttonBarItem" value="ListAgreementPromoAppls"/>
                 <set field="agreementId" from-field="parameters.agreementId"/>
                 <set field="agreementTermId" from-field="parameters.agreementTermId"/>
-
                 <entity-one entity-name="Agreement" value-name="agreement" auto-field-map="true"/>
                 <entity-one entity-name="AgreementItem" value-name="agreementItem" auto-field-map="true"/>
                 <entity-one entity-name="AgreementPromoAppl" value-name="agreementPromoAppl" auto-field-map="true"/>
@@ -237,14 +249,15 @@
             </widgets>
         </section>
     </screen>
+
     <screen name="ListAgreementItemTerms">
         <section>
             <actions>
                 <set field="title" value="List Agreement Item Terms"/>
                 <set field="titleProperty" value="PageTitleListAgreementItemTerms"/>
                 <set field="headerItem" value="agreement"/>
-                <set field="tabButtonItem" value="ListAgreementItemTerms"/>
-
+                <set field="tabButtonItem" value="AgreementItems"/>
+                <set field="buttonBarItem" value="ListAgreementItemTerms"/>
                 <entity-one entity-name="Agreement" value-name="agreement" auto-field-map="true"/>
                 <entity-one entity-name="AgreementItem" value-name="agreementItem"/>
                 <entity-and entity-name="AgreementTerm" list-name="agreementTerms">
@@ -264,18 +277,18 @@
             </widgets>
         </section>
     </screen>
+
     <screen name="EditAgreementItemTerm">
         <section>
             <actions>
                 <set field="title" value="Edit Agreement Item Term"/>
                 <set field="titleProperty" value="PageTitleEditAgreementItemTerm"/>
                 <set field="headerItem" value="agreement"/>
-                <set field="tabButtonItem" value="ListAgreementItemTerms"/>
-                
+                <set field="tabButtonItem" value="AgreementItems"/>
+                <set field="buttonBarItem" value="ListAgreementItemTerms"/>
                 <set field="agreementId" from-field="parameters.agreementId"/>
                 <set field="agreementItemSeqId" from-field="parameters.agreementItemSeqId"/>
                 <set field="agreementTermId" from-field="parameters.agreementTermId"/>
-
                 <entity-one entity-name="Agreement" value-name="agreement" auto-field-map="true"/>
                 <entity-one entity-name="AgreementItem" value-name="agreementItem" auto-field-map="true"/>
                 <entity-one entity-name="AgreementTerm" value-name="agreementTerm" auto-field-map="true"/>
@@ -292,14 +305,15 @@
             </widgets>
         </section>
     </screen>
+
     <screen name="ListAgreementItemProducts">
         <section>
             <actions>
                 <set field="title" value="List Agreement Item Products"/>
                 <set field="titleProperty" value="PageTitleListAgreementItemProducts"/>
                 <set field="headerItem" value="agreement"/>
-                <set field="tabButtonItem" value="ListAgreementItemProducts"/>
-
+                <set field="tabButtonItem" value="AgreementItems"/>
+                <set field="buttonBarItem" value="ListAgreementItemProducts"/>
                 <entity-one entity-name="Agreement" value-name="agreement" auto-field-map="true"/>
                 <entity-one entity-name="AgreementItem" value-name="agreementItem"/>
                 <entity-and entity-name="AgreementProductAppl" list-name="agreementProducts">
@@ -320,6 +334,7 @@
             </widgets>
         </section>
     </screen>
+
     <screen name="ListAgreementItemProductsReport">
         <section>
             <actions>
@@ -351,13 +366,14 @@
             </widgets>
         </section>
     </screen>
+
     <screen name="EditAgreementItemProduct">
         <section>
             <actions>
                 <set field="title" value="Edit Agreement Item Product"/>
                 <set field="titleProperty" value="PageTitleEditAgreementItemProduct"/>
                 <set field="headerItem" value="agreement"/>
-                <set field="tabButtonItem" value="ListAgreementItemProducts"/>
+                <set field="tabButtonItem" value="AgreementItems"/>
                 
                 <set field="agreementId" from-field="parameters.agreementId"/>
                 <set field="agreementItemSeqId" from-field="parameters.agreementItemSeqId"/>
@@ -386,8 +402,8 @@
                 <set field="title" value="List Agreement Item Products"/>
                 <set field="titleProperty" value="PageTitleListAgreementItemProducts"/>
                 <set field="headerItem" value="agreement"/>
-                <set field="tabButtonItem" value="ListAgreementItemSupplierProducts"/>
-
+                <set field="tabButtonItem" value="AgreementItems"/>
+                <set field="buttonBarItem" value="ListAgreementItemSupplierProducts"/>
                 <entity-one entity-name="Agreement" value-name="agreement" auto-field-map="true"/>
                 <entity-one entity-name="AgreementItem" value-name="agreementItem"/>
                 <entity-and entity-name="SupplierProduct" list-name="agreementProducts">
@@ -408,6 +424,7 @@
             </widgets>
         </section>
     </screen>
+
     <screen name="ListAgreementItemSupplierProductsReport">
         <section>
             <actions>
@@ -439,18 +456,18 @@
             </widgets>
         </section>
     </screen>
+
     <screen name="EditAgreementItemSupplierProduct">
         <section>
             <actions>
                 <set field="title" value="Edit Agreement Item Product"/>
                 <set field="titleProperty" value="PageTitleEditAgreementItemProduct"/>
                 <set field="headerItem" value="agreement"/>
-                <set field="tabButtonItem" value="ListAgreementItemSupplierProducts"/>
-                
+                <set field="tabButtonItem" value="AgreementItems"/>
+                <set field="buttonBarItem" value="ListAgreementItemSupplierProducts"/>
                 <set field="agreementId" from-field="parameters.agreementId"/>
                 <set field="agreementItemSeqId" from-field="parameters.agreementItemSeqId"/>
                 <set field="productId" from-field="parameters.productId"/>
-
                 <entity-one entity-name="Agreement" value-name="agreement" auto-field-map="true"/>
                 <entity-one entity-name="AgreementItem" value-name="agreementItem"/>
                 <entity-one entity-name="SupplierProduct" value-name="agreementProductAppl" auto-field-map="true"/>
@@ -493,8 +510,8 @@
                 <set field="title" value="List Agreement Item Parties"/>
                 <set field="titleProperty" value="PageTitleListAgreementItemParties"/>
                 <set field="headerItem" value="agreement"/>
-                <set field="tabButtonItem" value="ListAgreementItemParties"/>
-
+                <set field="tabButtonItem" value="AgreementItems"/>
+                <set field="buttonBarItem" value="ListAgreementItemParties"/>
                 <entity-one entity-name="Agreement" value-name="agreement" auto-field-map="true"/>
                 <entity-one entity-name="AgreementItem" value-name="agreementItem"/>
                 <entity-and entity-name="AgreementPartyApplic" list-name="agreementParties">
@@ -514,18 +531,18 @@
             </widgets>
         </section>
     </screen>
+
     <screen name="EditAgreementItemParty">
         <section>
             <actions>
                 <set field="title" value="Edit Agreement Item Party"/>
                 <set field="titleProperty" value="PageTitleEditAgreementItemParty"/>
                 <set field="headerItem" value="agreement"/>
-                <set field="tabButtonItem" value="ListAgreementItemParties"/>
-                
+                <set field="tabButtonItem" value="AgreementItems"/>
+                <set field="buttonBarItem" value="ListAgreementItemParties"/>
                 <set field="agreementId" from-field="parameters.agreementId"/>
                 <set field="agreementItemSeqId" from-field="parameters.agreementItemSeqId"/>
                 <set field="partyId" from-field="parameters.partyId"/>
-
                 <entity-one entity-name="Agreement" value-name="agreement" auto-field-map="true"/>
                 <entity-one entity-name="AgreementItem" value-name="agreementItem"/>
                 <entity-one entity-name="AgreementPartyApplic" value-name="agreementPartyApplic" auto-field-map="true"/>
@@ -542,14 +559,15 @@
             </widgets>
         </section>
     </screen>
+
     <screen name="ListAgreementGeographicalApplic">
         <section>
             <actions>
                 <set field="title" value="List Agreement Geos"/>
                 <set field="titleProperty" value="PageTitleListAgreementGeographicalApplic"/>
                 <set field="headerItem" value="agreement"/>
-                <set field="tabButtonItem" value="ListAgreementGeographicalApplic"/>
-
+                <set field="tabButtonItem" value="AgreementItems"/>
+                <set field="buttonBarItem" value="ListAgreementGeographicalApplic"/>
                 <entity-one entity-name="Agreement" value-name="agreement" auto-field-map="true"/>
                 <entity-one entity-name="AgreementItem" value-name="agreementItem"/>
                 <entity-and entity-name="AgreementGeographicalApplic" list-name="agreementGeographicalApplics">
@@ -569,18 +587,18 @@
             </widgets>
         </section>
     </screen>
+
     <screen name="EditAgreementGeographicalApplic">
         <section>
             <actions>
                 <set field="title" value="Edit Agreement Geo"/>
                 <set field="titleProperty" value="PageTitleEditAgreementGeographicalApplic"/>
                 <set field="headerItem" value="agreement"/>
-                <set field="tabButtonItem" value="ListAgreementGeographicalApplic"/>
-                
+                <set field="tabButtonItem" value="AgreementItems"/>
+                <set field="buttonBarItem" value="ListAgreementGeographicalApplic"/>
                 <set field="agreementId" from-field="parameters.agreementId"/>
                 <set field="agreementItemSeqId" from-field="parameters.agreementItemSeqId"/>
                 <set field="geoId" from-field="parameters.geoId"/>
-
                 <entity-one entity-name="Agreement" value-name="agreement" auto-field-map="true"/>
                 <entity-one entity-name="AgreementItem" value-name="agreementItem" auto-field-map="true"/>
                 <entity-one entity-name="AgreementGeographicalApplic" value-name="agreementGeographicalApplic" auto-field-map="true"/>