svn commit: r440284 - in /incubator/ofbiz/trunk/applications/order: script/org/ofbiz/order/requirement/ servicedef/ webapp/ordermgr/WEB-INF/ webapp/ordermgr/requirement/ widget/ordermgr/

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

svn commit: r440284 - in /incubator/ofbiz/trunk/applications/order: script/org/ofbiz/order/requirement/ servicedef/ webapp/ordermgr/WEB-INF/ webapp/ordermgr/requirement/ widget/ordermgr/

jacopoc
Author: jacopoc
Date: Tue Sep  5 00:14:53 2006
New Revision: 440284

URL: http://svn.apache.org/viewvc?view=rev&rev=440284
Log:
Implemented services and ui to manage the RequirementRole entries.

Modified:
    incubator/ofbiz/trunk/applications/order/script/org/ofbiz/order/requirement/RequirementServices.xml
    incubator/ofbiz/trunk/applications/order/servicedef/services_requirement.xml
    incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml
    incubator/ofbiz/trunk/applications/order/webapp/ordermgr/requirement/RequirementForms.xml
    incubator/ofbiz/trunk/applications/order/webapp/ordermgr/requirement/RequirementTabBar.ftl
    incubator/ofbiz/trunk/applications/order/widget/ordermgr/RequirementScreens.xml

Modified: incubator/ofbiz/trunk/applications/order/script/org/ofbiz/order/requirement/RequirementServices.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/script/org/ofbiz/order/requirement/RequirementServices.xml?view=diff&rev=440284&r1=440283&r2=440284
==============================================================================
--- incubator/ofbiz/trunk/applications/order/script/org/ofbiz/order/requirement/RequirementServices.xml (original)
+++ incubator/ofbiz/trunk/applications/order/script/org/ofbiz/order/requirement/RequirementServices.xml Tue Sep  5 00:14:53 2006
@@ -100,6 +100,56 @@
                 </if-not-empty>
             </if-not-empty>
         </if-compare>
+    </simple-method>
+    
+    <!-- create a new RequirementRole -->
+    <simple-method method-name="createRequirementRole" short-description="Create a RequirementRole">
+        <check-permission permission="ORDERMGR" action="_CREATE">
+            <fail-message message="Security Error: to run createRequirementRole you must have the ORDERMGR_CREATE or ORDERMGR_ADMIN permission"/>
+        </check-permission>
+        <check-errors/>
+        <set from-field="parameters.partyId" field="lookupPKMap.partyId"/>
+        <set from-field="parameters.roleTypeId" field="lookupPKMap.roleTypeId"/>
+        <find-by-primary-key entity-name="PartyRole" map-name="lookupPKMap" value-name="partyRole"/>
+        <if-empty map-name="partyRole" field-name="partyId">
+            <make-value value-name="partyRole" entity-name="PartyRole"/>
+            <set-pk-fields map-name="lookupPKMap" value-name="partyRole"/>
+            <create-value value-name="partyRole"/>
+        </if-empty>
+        <!-- create new entity and create all the fields -->
+        <make-value value-name="newEntity" entity-name="RequirementRole"/>
+        <set-pk-fields map-name="parameters" value-name="newEntity"/>
+        <set-nonpk-fields map-name="parameters" value-name="newEntity"/>
+        <if-empty field-name="newEntity.fromDate">
+            <now-timestamp-to-env env-name="newEntity.fromDate"/>
+        </if-empty>
+        <create-value value-name="newEntity"/>
+        <check-errors/>
+    </simple-method>
 
+    <!-- update an existing RequirementRole -->
+    <simple-method method-name="updateRequirementRole" short-description="Update an existing RequirementRole">
+        <check-permission permission="ORDERMGR" action="_CREATE">
+            <fail-message message="Security Error: to run updateRequirementRole you must have the ORDERMGR_CREATE or ORDERMGR_ADMIN permission"/>
+        </check-permission>
+        <check-errors/>
+        <entity-one entity-name="RequirementRole" value-name="requirementRole" auto-field-map="true"/>
+        <check-errors/>
+        <set-nonpk-fields map-name="parameters" value-name="requirementRole"/>
+        <store-value value-name="requirementRole"/>
+        <check-errors/>
     </simple-method>
+
+    <!-- remove an existing RequirementRole -->
+    <simple-method method-name="removeRequirementRole" short-description="Remove an existing RequirementRole">
+        <check-permission permission="ORDERMGR" action="_CREATE">
+            <fail-message message="Security Error: to run removeRequirementRole you must have the ORDERMGR_CREATE or ORDERMGR_ADMIN permission"/>
+        </check-permission>
+        <check-errors/>
+        <entity-one entity-name="RequirementRole" value-name="requirementRole" auto-field-map="true"/>
+        <check-errors/>
+        <remove-value value-name="requirementRole"/>
+        <check-errors/>
+    </simple-method>
+
 </simple-methods>

Modified: incubator/ofbiz/trunk/applications/order/servicedef/services_requirement.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/servicedef/services_requirement.xml?view=diff&rev=440284&r1=440283&r2=440284
==============================================================================
--- incubator/ofbiz/trunk/applications/order/servicedef/services_requirement.xml (original)
+++ incubator/ofbiz/trunk/applications/order/servicedef/services_requirement.xml Tue Sep  5 00:14:53 2006
@@ -55,6 +55,25 @@
         <attribute name="requirementId" type="String" mode="IN" optional="false"/>
     </service>
 
+    <service name="createRequirementRole" default-entity-name="RequirementRole" engine="simple" auth="true"
+            location="org/ofbiz/order/requirement/RequirementServices.xml" invoke="createRequirementRole">
+        <description>Creates a new party role for the requirement</description>
+        <auto-attributes mode="IN" include="pk" optional="false"/>
+        <auto-attributes mode="IN" include="nonpk" optional="true"/>
+        <override name="fromDate" optional="true"/>
+    </service>
+    <service name="updateRequirementRole" default-entity-name="RequirementRole" engine="simple"
+                location="org/ofbiz/order/requirement/RequirementServices.xml" invoke="updateRequirementRole" auth="true">
+        <description>Update a RequirementRole</description>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+    </service>
+    <service name="removeRequirementRole" engine="simple" default-entity-name="RequirementRole"
+                location="org/ofbiz/order/requirement/RequirementServices.xml" invoke="removeRequirementRole" auth="true">
+        <description>Remove a RequirementRole</description>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+    </service>
+
     <service name="associatedRequirementWithRequestItem" engine="simple"
      location="org/ofbiz/order/requirement/RequirementServices.xml" invoke="associateRequirementWithRequestItem">
      <description>Creates a CustRequestItem/Requirement association</description>

Modified: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml?view=diff&rev=440284&r1=440283&r2=440284
==============================================================================
--- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml (original)
+++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml Tue Sep  5 00:14:53 2006
@@ -951,6 +951,14 @@
         <security https="true" auth="true"/>
         <response name="success" type="view" value="ListRequirementOrders"/>
     </request-map>
+    <request-map uri="ListRequirementRoles">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="ListRequirementRoles"/>
+    </request-map>
+    <request-map uri="EditRequirementRole">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="EditRequirementRole"/>
+    </request-map>
     <request-map uri="createRequirement">
         <security https="true" auth="true"/>
         <event type="service" invoke="createRequirement"/>
@@ -966,6 +974,21 @@
         <event type="service" invoke="deleteRequirement"/>
         <response name="success" type="view" value="FindRequirements"/>
     </request-map>
+    <request-map uri="removeRequirementRole">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="removeRequirementRole"/>
+        <response name="success" type="view" value="ListRequirementRoles"/>
+    </request-map>
+    <request-map uri="createRequirementRole">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="createRequirementRole"/>
+        <response name="success" type="view" value="ListRequirementRoles"/>
+    </request-map>
+    <request-map uri="updateRequirementRole">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="updateRequirementRole"/>
+        <response name="success" type="view" value="ListRequirementRoles"/>
+    </request-map>
 
     <request-map uri="ApproveRequirements">
         <security https="true" auth="true"/>
@@ -1390,6 +1413,8 @@
     <view-map name="EditRequirement" type="screen" page="component://order/widget/ordermgr/RequirementScreens.xml#EditRequirement"/>
     <view-map name="ListRequirementCustRequests" type="screen" page="component://order/widget/ordermgr/RequirementScreens.xml#ListRequirementCustRequests"/>
     <view-map name="ListRequirementOrders" type="screen" page="component://order/widget/ordermgr/RequirementScreens.xml#ListRequirementOrders"/>
+    <view-map name="ListRequirementRoles" type="screen" page="component://order/widget/ordermgr/RequirementScreens.xml#ListRequirementRoles"/>
+    <view-map name="EditRequirementRole" type="screen" page="component://order/widget/ordermgr/RequirementScreens.xml#EditRequirementRole"/>
     <view-map name="ApproveRequirements" page="component://order/widget/ordermgr/RequirementScreens.xml#ApproveRequirements" type="screen"/>
     <view-map name="RequirementsForSupplier" type="screen" page="component://order/widget/ordermgr/OrderEntryScreens.xml#RequirementsForSupplier"/>
     <view-map name="FindQuoteForCart" type="screen" page="component://order/widget/ordermgr/OrderEntryScreens.xml#FindQuoteForCart"/>

Modified: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/requirement/RequirementForms.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/requirement/RequirementForms.xml?view=diff&rev=440284&r1=440283&r2=440284
==============================================================================
--- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/requirement/RequirementForms.xml (original)
+++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/requirement/RequirementForms.xml Tue Sep  5 00:14:53 2006
@@ -36,6 +36,11 @@
                 </entity-options>
             </drop-down>
         </field>
+        <field name="facilityId">
+            <drop-down allow-empty="true">
+                <entity-options entity-name="Facility" description="${facilityId}"/>
+            </drop-down>
+        </field>
         <field name="productId">
             <lookup target-form-name="LookupProduct"/>
         </field>
@@ -63,6 +68,7 @@
         <field name="requirementTypeId">
             <display-entity entity-name="RequirementType" also-hidden="true"/>
         </field>
+        <field name="facilityId"><display/></field>
         <field name="productId">
             <display-entity entity-name="Product" key-field-name="productId" description="${productId} - ${internalName}"/>
         </field>
@@ -99,7 +105,11 @@
             </drop-down>
         </field>
         <field name="productId"><lookup target-form-name="LookupProduct"/></field>
-        <field name="facilityId"><lookup target-form-name="LookupFacility"/></field>
+        <field name="facilityId">
+            <drop-down allow-empty="false">
+                <entity-options entity-name="Facility" description="${description} [${facilityId}]"/>
+            </drop-down>
+        </field>
         <field name="fixedAssetId"><lookup target-form-name="LookupFixedAsset"/></field>
         <field name="custRequestId" map-name="parameters"><text/></field>
         <field name="custRequestItemSeqId" map-name="parameters"><text/></field>
@@ -127,6 +137,39 @@
         <auto-fields-entity entity-name="OrderRequirementCommitment" default-field-type="display"/>
         <field name="orderId" widget-style="buttontext">
             <hyperlink description="${orderId}" target-type="inter-app" target="/ordermgr/control/orderview?orderId=${orderId}"/>
+        </field>
+    </form>
+    <!-- lists the roles associated with a requirement -->
+    <form name="ListRequirementRoles" type="list"
+            title="" list-name="requirementRoles" paginate-target="ListRequirementRoles"
+            default-title-style="tableheadtext" default-widget-style="tabletext" default-tooltip-style="tabletext">
+        <auto-fields-entity entity-name="RequirementRole" default-field-type="display"/>
+        <field name="requirementId"><hidden/></field>
+        <field name="editLink" widget-style="buttontext" title="${uiLabelMap.CommonEdit}">
+            <hyperlink description="${uiLabelMap.CommonEdit}" target="EditRequirementRole?requirementId=${requirementId}&amp;partyId=${partyId}&amp;roleTypeId=${roleTypeId}&amp;fromDate=${fromDate}"/>
+        </field>
+        <field name="removeLink" widget-style="buttontext" title="${uiLabelMap.CommonRemove}">
+            <hyperlink description="${uiLabelMap.CommonRemove}" target="removeRequirementRole?requirementId=${requirementId}&amp;partyId=${partyId}&amp;roleTypeId=${roleTypeId}&amp;fromDate=${fromDate}"/>
+        </field>
+    </form>
+    <form name="EditRequirementRole" type="single"
+            target="updateRequirementRole" title="" default-map-name="requirementRole"
+            default-title-style="tableheadtext" default-widget-style="inputBox" default-tooltip-style="tabletext">
+        <alt-target use-when="requirementRole==null" target="createRequirementRole"/>
+        <field name="requirementId"><hidden/></field>
+        <field name="partyId" use-when="requirementRole!=null"><display/></field>
+        <field name="partyId" use-when="requirementRole==null"><lookup target-form-name="LookupPartyName"/></field>
+        <field name="roleTypeId" use-when="requirementRole!=null"><display-entity entity-name="RoleType"/></field>
+        <field name="roleTypeId" use-when="requirementRole==null">
+            <drop-down allow-empty="false">
+                <entity-options entity-name="RoleType" description="${description}"/>
+            </drop-down>
+        </field>
+        <field name="fromDate" use-when="requirementRole!=null"><display/></field>
+        <field name="fromDate" use-when="requirementRole==null"><date-time/></field>
+        <field name="thruDate"><date-time/></field>
+        <field name="submitButton" title="${uiLabelMap.CommonSubmit}" widget-style="smallSubmit">
+            <submit button-type="button"/>
         </field>
     </form>
     <form name="FindNotApprovedRequirements" type="single"

Modified: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/requirement/RequirementTabBar.ftl
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/requirement/RequirementTabBar.ftl?view=diff&rev=440284&r1=440283&r2=440284
==============================================================================
--- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/requirement/RequirementTabBar.ftl (original)
+++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/requirement/RequirementTabBar.ftl Tue Sep  5 00:14:53 2006
@@ -23,5 +23,6 @@
     <a href="<@ofbizUrl>EditRequirement?requirementId=${requirement.requirementId}</@ofbizUrl>" class="${selectedClassMap.EditRequirement?default(unselectedClassName)}">${uiLabelMap.OrderRequirement}</a>
     <a href="<@ofbizUrl>ListRequirementCustRequests?requirementId=${requirement.requirementId}</@ofbizUrl>" class="${selectedClassMap.ListRequirementCustRequests?default(unselectedClassName)}">${uiLabelMap.OrderRequests}</a>
     <a href="<@ofbizUrl>ListRequirementOrders?requirementId=${requirement.requirementId}</@ofbizUrl>" class="${selectedClassMap.ListRequirementOrdersTab?default(unselectedClassName)}">${uiLabelMap.OrderOrders}</a>
+    <a href="<@ofbizUrl>ListRequirementRoles?requirementId=${requirement.requirementId}</@ofbizUrl>" class="${selectedClassMap.ListRequirementRolesTab?default(unselectedClassName)}">${uiLabelMap.PartyRoles}</a>
 </div>
 </#if>

Modified: incubator/ofbiz/trunk/applications/order/widget/ordermgr/RequirementScreens.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/widget/ordermgr/RequirementScreens.xml?view=diff&rev=440284&r1=440283&r2=440284
==============================================================================
--- incubator/ofbiz/trunk/applications/order/widget/ordermgr/RequirementScreens.xml (original)
+++ incubator/ofbiz/trunk/applications/order/widget/ordermgr/RequirementScreens.xml Tue Sep  5 00:14:53 2006
@@ -37,7 +37,7 @@
                                     <html><html-template location="component://order/webapp/ordermgr/requirement/RequirementTabBar.ftl"/></html>
                                 </platform-specific>
                                 <container>
-                                    <label style="head1">${uiLabelMap.OrderRequirement}</label>
+                                    <label style="head1">${uiLabelMap.OrderRequirement} [${requirementId}]</label>
                                 </container>
                                 <decorator-section-include name="body"/>
                             </widgets>
@@ -176,6 +176,53 @@
         </section>
     </screen>
 
+    <!-- screen listing orders related to a given requirement -->
+    <screen name="ListRequirementRoles">
+        <section>
+            <actions>
+                <set field="title" value="ListRequirementRoles"/>
+                <set field="titleProperty" value="PageTitleListRequirementRoles"/>
+                <set field="headerItem" value="requirement"/>
+                <set field="tabButtonItem" value="ListRequirementRolesTab"/>
+
+                <set field="requirementId" from-field="parameters.requirementId"/>
+                <entity-one entity-name="Requirement" value-name="requirement" auto-field-map="true"/>
+                <entity-and entity-name="RequirementRole" list-name="requirementRoles">
+                    <field-map env-name="requirementId" field-name="requirementId"/>
+                </entity-and>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonRequirementDecorator">
+                    <decorator-section name="body">
+                        <container>
+                            <link target="EditRequirementRole?requirementId=${requirementId}" text="${uiLabelMap.CommonNew}" style="buttontext"/>
+                        </container>
+                        <include-form name="ListRequirementRoles" location="component://order/webapp/ordermgr/requirement/RequirementForms.xml"/>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+    <screen name="EditRequirementRole">
+        <section>
+            <actions>
+                <set field="title" value="Edit Requirement Role"/>
+                <set field="titleProperty" value="PageTitleEditRequirementRole"/>
+                <set field="headerItem" value="requirement"/>
+                <set field="tabButtonItem" value="ListRequirementRolesTab"/>
+                <set field="requirementId" from-field="parameters.requirementId"/>
+                <entity-one entity-name="Requirement" value-name="requirement" auto-field-map="true"/>
+                <entity-one entity-name="RequirementRole" value-name="requirementRole" auto-field-map="true"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonRequirementDecorator">
+                    <decorator-section name="body">
+                        <include-form name="EditRequirementRole" location="component://order/webapp/ordermgr/requirement/RequirementForms.xml"/>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 
 </screens>