[OFBiz] SVN: r7524 - in trunk/applications/accounting: script/org/ofbiz/accounting/agreement servicedef webapp/accounting/agreement widget

jacopo@svn.ofbiz.org jacopo at svn.ofbiz.org
Fri May 5 09:42:26 CDT 2006


Author: jacopo
Date: 2006-05-05 09:42:02 -0500 (Fri, 05 May 2006)
New Revision: 7524

Modified:
   trunk/applications/accounting/script/org/ofbiz/accounting/agreement/AgreementServices.xml
   trunk/applications/accounting/servicedef/services_agreement.xml
   trunk/applications/accounting/webapp/accounting/agreement/AgreementForms.xml
   trunk/applications/accounting/webapp/accounting/agreement/AgreementTabBar.ftl
   trunk/applications/accounting/widget/AgreementScreens.xml
Log:
Added screens, forms and services to manage AgreementProductAppl entries; from Mario Cappellato.


Modified: trunk/applications/accounting/script/org/ofbiz/accounting/agreement/AgreementServices.xml
===================================================================
--- trunk/applications/accounting/script/org/ofbiz/accounting/agreement/AgreementServices.xml	2006-05-05 13:22:24 UTC (rev 7523)
+++ trunk/applications/accounting/script/org/ofbiz/accounting/agreement/AgreementServices.xml	2006-05-05 14:42:02 UTC (rev 7524)
@@ -229,4 +229,45 @@
         <check-errors/>
     </simple-method>
     
-</simple-methods>
\ No newline at end of file
+    <!-- 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"/>
+        <create-value value-name="newEntity"/>
+        <check-errors/>
+    </simple-method>
+
+    <!-- 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"/>
+        <store-value value-name="agreementProductAppl"/>
+        <check-errors/>
+    </simple-method>
+
+    <!-- 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"/>
+        <check-errors/>
+    </simple-method>
+  
+</simple-methods>

Modified: trunk/applications/accounting/servicedef/services_agreement.xml
===================================================================
--- trunk/applications/accounting/servicedef/services_agreement.xml	2006-05-05 13:22:24 UTC (rev 7523)
+++ trunk/applications/accounting/servicedef/services_agreement.xml	2006-05-05 14:42:02 UTC (rev 7524)
@@ -87,7 +87,7 @@
     <!-- AgreementPromoAppl  -->
     <service name="createAgreementPromoAppl" default-entity-name="AgreementPromoAppl" engine="simple"
                 location="org/ofbiz/accounting/agreement/AgreementServices.xml" invoke="createAgreementPromoAppl" auth="true">
-        <description>Create an PromoAppl</description>
+        <description>Create an AgreementPromoAppl</description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
@@ -103,4 +103,23 @@
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </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>
+        <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>
+        <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>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+    </service>
 </services>

Modified: trunk/applications/accounting/webapp/accounting/agreement/AgreementForms.xml
===================================================================
--- trunk/applications/accounting/webapp/accounting/agreement/AgreementForms.xml	2006-05-05 13:22:24 UTC (rev 7523)
+++ trunk/applications/accounting/webapp/accounting/agreement/AgreementForms.xml	2006-05-05 14:42:02 UTC (rev 7524)
@@ -223,6 +223,38 @@
             <submit button-type="button"/>
         </field>
     </form>
+    <form name="ListAgreementItemProducts" default-title-style="tableheadtext"
+            default-tooltip-style="tabletext" default-widget-style="tabletext" list-name="agreementProducts"
+            target="" paginate-target="ListAgreementItemProducts" title="" type="list">
+        <auto-fields-entity entity-name="AgreementProductAppl" default-field-type="display"/>
+        <field name="agreementId" title="${uiLabelMap.AccountingAgreementId}"><hidden/></field>
+        <field name="agreementItemSeqId" title="${uiLabelMap.AccountingAgreementItemSeqId}"><hidden/></field>
+        <field name="productId" title="${uiLabelMap.CommonEdit}" widget-style="buttontext">
+            <hyperlink also-hidden="false" description="${productId}" target="EditAgreementItemProduct?productId=${productId}&amp;agreementId=${agreementId}&amp;agreementItemSeqId=${agreementItemSeqId}"/>
+        </field>
+        <field name="internalName" entry-name="productId">
+            <display-entity entity-name="Product" key-field-name="productId" description="${internalName}"/>
+        </field>
+        <field name="deleteLink" title="" widget-style="buttontext">
+            <hyperlink target="removeAgreementItemProduct?productId=${productId}&amp;agreementId=${agreementId}&amp;agreementItemSeqId=${agreementItemSeqId}" description="[${uiLabelMap.CommonRemove}]" also-hidden="false"/>
+        </field>
+    </form>
+    <form name="EditAgreementItemProduct" type="single"
+            target="updateAgreementItemProduct" title="" default-map-name="agreementProductAppl"
+            default-title-style="tableheadtext" default-widget-style="inputBox" default-tooltip-style="tabletext">
+        <alt-target use-when="agreementProductAppl==null" target="createAgreementItemProduct"/>
+        <auto-fields-entity entity-name="AgreementProductAppl" default-field-type="edit"/>
+        <field name="agreementId"><hidden/></field>
+        <field name="agreementItemSeqId"><hidden/></field>
+        <field name="productId" use-when="agreementProductAppl==null">
+            <lookup target-form-name="LookupProduct"/>
+        </field>
+        <field name="productId" use-when="agreementProductAppl!=null"><display/></field>
+        <field name="submitButton" title="${uiLabelMap.CommonSubmit}" widget-style="smallSubmit">
+            <submit button-type="button"/>
+        </field>
+    </form>
+
     <form name="ListAgreementPromoAppls" default-title-style="tableheadtext"
             default-tooltip-style="tabletext" default-widget-style="tabletext" list-name="agreementPromoAppls"
             target="" paginate-target="ListAgreementPromoAppls" title="" type="list">

Modified: trunk/applications/accounting/webapp/accounting/agreement/AgreementTabBar.ftl
===================================================================
--- trunk/applications/accounting/webapp/accounting/agreement/AgreementTabBar.ftl	2006-05-05 13:22:24 UTC (rev 7523)
+++ trunk/applications/accounting/webapp/accounting/agreement/AgreementTabBar.ftl	2006-05-05 14:42:02 UTC (rev 7524)
@@ -39,6 +39,7 @@
         <a href="<@ofbizUrl>EditAgreementItem?agreementId=${agreementItem.agreementId}&agreementItemSeqId=${agreementItem.agreementItemSeqId}</@ofbizUrl>" class="${selectedClassMap.EditAgreementItem?default(unselectedClassName)}">${uiLabelMap.AccountingAgreementItem}</a>
         <a href="<@ofbizUrl>ListAgreementPromoAppls?agreementId=${agreementItem.agreementId}&agreementItemSeqId=${agreementItem.agreementItemSeqId}</@ofbizUrl>" class="${selectedClassMap.ListAgreementPromoAppls?default(unselectedClassName)}">${uiLabelMap.AccountingAgreementPromoAppls}</a>
         <a href="<@ofbizUrl>ListAgreementItemTerms?agreementId=${agreementItem.agreementId}&agreementItemSeqId=${agreementItem.agreementItemSeqId}</@ofbizUrl>" class="${selectedClassMap.ListAgreementItemTerms?default(unselectedClassName)}">${uiLabelMap.AccountingAgreementItemTerms}</a>
+        <a href="<@ofbizUrl>ListAgreementItemProducts?agreementId=${agreementItem.agreementId}&agreementItemSeqId=${agreementItem.agreementItemSeqId}</@ofbizUrl>" class="${selectedClassMap.ListAgreementItemProducts?default(unselectedClassName)}">${uiLabelMap.ProductProducts}</a>
     </div>
 </#if>
 

Modified: trunk/applications/accounting/widget/AgreementScreens.xml
===================================================================
--- trunk/applications/accounting/widget/AgreementScreens.xml	2006-05-05 13:22:24 UTC (rev 7523)
+++ trunk/applications/accounting/widget/AgreementScreens.xml	2006-05-05 14:42:02 UTC (rev 7524)
@@ -318,4 +318,59 @@
             </widgets>
         </section>
     </screen>
-</screens>
\ No newline at end of file
+    <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"/>
+
+                <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">
+                    <field-map env-name="agreement.agreementId" field-name="agreementId"/>
+                    <field-map env-name="agreementItem.agreementItemSeqId" field-name="agreementItemSeqId"/>
+                </entity-and>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonAgreementDecorator">
+                    <decorator-section name="body">
+                        <container>
+                            <link target="EditAgreementItemProduct?agreementId=${agreement.agreementId}&amp;agreementItemSeqId=${agreementItem.agreementItemSeqId}" text="${uiLabelMap.ProductNewProduct}" style="buttontext"/>
+                        </container>
+                        <include-form name="ListAgreementItemProducts" location="component://accounting/webapp/accounting/agreement/AgreementForms.xml"/>
+                    </decorator-section>
+                </decorator-screen>
+            </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="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="AgreementProductAppl" value-name="agreementProductAppl" auto-field-map="true"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonAgreementDecorator">
+                    <decorator-section name="body">
+                        <container>
+                            <link target="EditAgreementItemProduct?agreementId=${agreement.agreementId}&amp;agreementItemSeqId=${agreementItem.agreementItemSeqId}" text="${uiLabelMap.ProductNewProduct}" style="buttontext"/>
+                        </container>
+                        <include-form name="EditAgreementItemProduct" location="component://accounting/webapp/accounting/agreement/AgreementForms.xml"/>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+</screens>



More information about the Svn mailing list