svn commit: r521688 - in /ofbiz/trunk/applications/order: webapp/ordermgr/WEB-INF/actions/requirement/selectCreatedProposed.bsh webapp/ordermgr/requirement/RequirementForms.xml widget/ordermgr/RequirementScreens.xml

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

svn commit: r521688 - in /ofbiz/trunk/applications/order: webapp/ordermgr/WEB-INF/actions/requirement/selectCreatedProposed.bsh webapp/ordermgr/requirement/RequirementForms.xml widget/ordermgr/RequirementScreens.xml

jacopoc
Author: jacopoc
Date: Fri Mar 23 05:05:24 2007
New Revision: 521688

URL: http://svn.apache.org/viewvc?view=rev&rev=521688
Log:
Now the 'approve requirement' screen shows both created and proposed requirements.

Added:
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/requirement/selectCreatedProposed.bsh
Modified:
    ofbiz/trunk/applications/order/webapp/ordermgr/requirement/RequirementForms.xml
    ofbiz/trunk/applications/order/widget/ordermgr/RequirementScreens.xml

Added: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/requirement/selectCreatedProposed.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/requirement/selectCreatedProposed.bsh?view=auto&rev=521688
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/requirement/selectCreatedProposed.bsh (added)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/requirement/selectCreatedProposed.bsh Fri Mar 23 05:05:24 2007
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.base.util.UtilValidate;
+import org.ofbiz.entity.condition.EntityConditionList;
+import org.ofbiz.entity.condition.EntityExpr;
+import org.ofbiz.entity.condition.EntityOperator;
+
+Map prepare = dispatcher.runSync("prepareFind", UtilMisc.toMap("inputFields", parameters, "entityName", "Requirement"));
+EntityConditionList statusCondition = new EntityConditionList(
+                    UtilMisc.toList(new EntityExpr("statusId", EntityOperator.EQUALS, "REQ_CREATED"),
+                                    new EntityExpr("statusId", EntityOperator.EQUALS, "REQ_PROPOSED")),
+                    EntityOperator.OR);
+EntityConditionList ecl = null;
+if (UtilValidate.isNotEmpty(prepare.get("entityConditionList"))) {
+    ecl = new EntityConditionList(UtilMisc.toList((EntityConditionList)prepare.get("entityConditionList"),
+                                                   statusCondition),
+                                  EntityOperator.AND);
+} else {
+    ecl = statusCondition;
+}
+results = dispatcher.runSync("executeFind", UtilMisc.toMap("entityConditionList", ecl, "entityName", "Requirement"));
+context.put("requirements", results.get("listIt"));

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/requirement/RequirementForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/requirement/RequirementForms.xml?view=diff&rev=521688&r1=521687&r2=521688
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/requirement/RequirementForms.xml (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/requirement/RequirementForms.xml Fri Mar 23 05:05:24 2007
@@ -196,17 +196,9 @@
             <submit button-type="button"/>
         </field>
     </form>
-    <form name="ApproveRequirements" type="multi" use-row-submit="true" target="approveRequirements" title="" list-name="listIt"
+    <form name="ApproveRequirements" type="multi" use-row-submit="true" target="approveRequirements" title="" list-name="requirements"
         default-title-style="tableheadtext" default-widget-style="tabletext" default-tooltip-style="tabletext"
         paginate-target="ApproveRequirements">
-        <actions>
-            <set field="entityName" value="Requirement"/>
-            <set field="requestParameters.statusId" value="REQ_CREATED"/>
-            <service service-name="performFind" result-map-name="result" result-map-list-name="listIt">
-                <field-map field-name="inputFields" env-name="requestParameters"/>
-                <field-map field-name="entityName" env-name="entityName"/>
-            </service>
-        </actions>
         <field name="requirementId" widget-style="buttontext">
             <hyperlink also-hidden="true" description="${requirementId}" target="EditRequirement?requirementId=${requirementId}"/>
         </field>

Modified: ofbiz/trunk/applications/order/widget/ordermgr/RequirementScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/widget/ordermgr/RequirementScreens.xml?view=diff&rev=521688&r1=521687&r2=521688
==============================================================================
--- ofbiz/trunk/applications/order/widget/ordermgr/RequirementScreens.xml (original)
+++ ofbiz/trunk/applications/order/widget/ordermgr/RequirementScreens.xml Fri Mar 23 05:05:24 2007
@@ -113,6 +113,7 @@
                 <set field="tabButtonItem" value="ApproveRequirements"/>
                 <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="50"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/requirement/selectCreatedProposed.bsh"/>
             </actions>
             <widgets>
                 <decorator-screen name="CommonRequirementsDecorator">