You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2007/03/28 11:36:49 UTC

svn commit: r523248 - in /ofbiz/trunk/applications/manufacturing: config/ script/org/ofbiz/manufacturing/jobshopmgt/ webapp/manufacturing/WEB-INF/ webapp/manufacturing/WEB-INF/actions/jobshopmgt/ webapp/manufacturing/jobshopmgt/ widget/manufacturing/

Author: jacopoc
Date: Wed Mar 28 02:36:48 2007
New Revision: 523248

URL: http://svn.apache.org/viewvc?view=rev&rev=523248
Log:
Misc refactoring and bug fixes to the edit production run tasks screens.

Added:
    ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunTasks.bsh   (with props)
Modified:
    ofbiz/trunk/applications/manufacturing/config/ManufacturingUiLabels.properties
    ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ProductionRunSimpleEvents.xml
    ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/EditProductionRun.bsh
    ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/controller.xml
    ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/EditProductionRun.ftl
    ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml
    ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunTabBar.ftl
    ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml

Modified: ofbiz/trunk/applications/manufacturing/config/ManufacturingUiLabels.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/config/ManufacturingUiLabels.properties?view=diff&rev=523248&r1=523247&r2=523248
==============================================================================
--- ofbiz/trunk/applications/manufacturing/config/ManufacturingUiLabels.properties (original)
+++ ofbiz/trunk/applications/manufacturing/config/ManufacturingUiLabels.properties Wed Mar 28 02:36:48 2007
@@ -110,7 +110,7 @@
 ManufacturingListingBomError=Error while listing the Bill of Material
 ManufacturingListOfProductionRunComponents=List Of ProductionRun Components
 ManufacturingListOfProductionRunFixedAssets=List Of ProductionRun FixedAssets
-ManufacturingListOfProductionRunRoutingTasks=List Of ProductionRun RoutingTasks
+ManufacturingListOfProductionRunRoutingTasks=Tasks
 ManufacturingListProducts=Deliverable Products
 ManufacturingListRoutings=List Routings
 ManufacturingMachineGroupIdAlreadyExist=Fixed Asset Group ID does'nt exist

Modified: ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ProductionRunSimpleEvents.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ProductionRunSimpleEvents.xml?view=diff&rev=523248&r1=523247&r2=523248
==============================================================================
--- ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ProductionRunSimpleEvents.xml (original)
+++ ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ProductionRunSimpleEvents.xml Wed Mar 28 02:36:48 2007
@@ -20,27 +20,23 @@
 
 <simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/simple-methods.xsd">
-    <!-- ProductionRun creation, field check events -->
-    <simple-method method-name="checkFieldCreateProductionRun" 
-            short-description="Check if the field value are valid and convert quantity field to Double">
-        <call-map-processor in-map-name="parameters" out-map-name="context1">
-            <simple-map-processor name="checkFieldCreatePRun">
-                <process field="productId">
+
+    <simple-method method-name="editProductionRunRoutingTask" short-description="Check parameters and edit a production run task.">
+        <call-map-processor in-map-name="parameters" out-map-name="context">
+            <simple-map-processor name="prCheckUpdatePrunRoutingTask">
+                <process field="productionRunId">
                     <copy/>
-                    <not-empty>
-                        <fail-property resource="ProductUiLabels" property="ProductProductIdMissing"/>
-                    </not-empty>
                 </process>
-                <process field="quantity">
+                <process field="routingTaskId">
                     <copy/>
-                    <not-empty>
-                        <fail-property resource="ManufacturingUiLabels" property="ManufacturingProductionRunQuantityMissing"/>
-                    </not-empty>
-                    <convert type="Double">
-                        <fail-property resource="ManufacturingUiLabels" property="ManufacturingProductionRunQuantityNotCorrect"/>
+                </process>
+                <process field="priority">
+                    <copy/>
+                    <convert type="Long">
+                        <fail-property resource="ManufacturingUiLabels" property="ManufacturingRoutingSeqIdFormatNotCorrect"/>
                     </convert>
                 </process>
-                <process field="startDate">
+                <process field="estimatedStartDate">
                     <copy/>
                     <not-empty>
                         <fail-property resource="ManufacturingUiLabels" property="ManufacturingProductionRunStartDateMissing"/>
@@ -49,14 +45,37 @@
                         <fail-property resource="ManufacturingUiLabels" property="ManufacturingProductionRunStartDateNotCorrect"/>
                     </convert>
                 </process>
-                <process field="facilityId">
+                <process field="estimatedSetupMillis">
                     <copy/>
-                    <not-empty>
-                        <fail-property resource="ProductUiLabels" property="ProductFacilityIdMissing"/>
-                    </not-empty>
+                    <convert type="Double">
+                        <fail-property resource="ManufacturingUiLabels" property="ManufacturingProductionRunQuantityNotCorrect"/>
+                    </convert>
+                </process>
+                <process field="estimatedMilliSeconds">
+                    <copy/>
+                    <convert type="Double">
+                        <fail-property resource="ManufacturingUiLabels" property="ManufacturingProductionRunQuantityNotCorrect"/>
+                    </convert>
+                </process>
+            </simple-map-processor>
+        </call-map-processor>
+        <check-errors/>
+        <call-service service-name="checkUpdatePrunRoutingTask" in-map-name="context">
+        </call-service>
+        <check-errors/>
+        <call-map-processor in-map-name="parameters" out-map-name="context1">
+            <simple-map-processor name="prepareUpdateRoutingTask">
+                <process field="productionRunId">
+                    <copy to-field="workEffortParentId"/>
+                </process>
+                <process field="routingTaskId">
+                    <copy to-field="workEffortId"/>
                 </process>
-                <process field="routingId">
+                <process field="priority">
                     <copy/>
+                    <convert type="Long">
+                        <fail-property resource="ManufacturingUiLabels" property="ManufacturingRoutingSeqIdFormatNotCorrect"/>
+                    </convert>
                 </process>
                 <process field="workEffortName">
                     <copy/>
@@ -64,200 +83,81 @@
                 <process field="description">
                     <copy/>
                 </process>
+                <process field="estimatedSetupMillis">
+                    <copy/>
+                    <convert type="Double">
+                        <fail-property resource="ManufacturingUiLabels" property="ManufacturingProductionRunQuantityNotCorrect"/>
+                    </convert>
+                </process>
+                <process field="estimatedMilliSeconds">
+                    <copy/>
+                    <convert type="Double">
+                        <fail-property resource="ManufacturingUiLabels" property="ManufacturingProductionRunQuantityNotCorrect"/>
+                    </convert>
+                </process>
             </simple-map-processor>
         </call-map-processor>
         <check-errors/>
-        <call-service service-name="createProductionRunsForProductBom" in-map-name="context1">
-            <result-to-field result-name="productionRunId"/>
+        <call-service service-name="updateWorkEffort" in-map-name="context1">
         </call-service>
-        <field-to-request field-name="productionRunId"/>
     </simple-method>
 
-    <!-- ProductionRun edition, actions events -->
-    <simple-method method-name="actionEditProductionRun" short-description="Run services, depending of action parameters ">
-        <log level="info" message="debut parameters = ${parameters}"/>
-        <if-compare value="UpdateRoutingTask" field-name="actionForm" map-name="parameters"  operator="equals">
-            <call-map-processor in-map-name="parameters" out-map-name="context">
-                <simple-map-processor name="prCheckUpdatePrunRoutingTask">
-                    <process field="productionRunId">
-                        <copy/>
-                    </process>
-                    <process field="routingTaskId">
-                        <copy/>
-                    </process>
-                    <process field="priority">
-                        <copy/>
-                        <convert type="Long">
-                            <fail-property resource="ManufacturingUiLabels" property="ManufacturingRoutingSeqIdFormatNotCorrect"/>
-                        </convert>
-                    </process>
-                    <process field="estimatedStartDate">
-                        <copy/>
-                        <not-empty>
-                            <fail-property resource="ManufacturingUiLabels" property="ManufacturingProductionRunStartDateMissing"/>
-                        </not-empty>
-                        <convert type="Timestamp">
-                            <fail-property resource="ManufacturingUiLabels" property="ManufacturingProductionRunStartDateNotCorrect"/>
-                        </convert>
-                    </process>
-                    <process field="estimatedSetupMillis">
-                        <copy/>
-                        <convert type="Double">
-                            <fail-property resource="ManufacturingUiLabels" property="ManufacturingProductionRunQuantityNotCorrect"/>
-                        </convert>
-                    </process>
-                    <process field="estimatedMilliSeconds">
-                        <copy/>
-                        <convert type="Double">
-                            <fail-property resource="ManufacturingUiLabels" property="ManufacturingProductionRunQuantityNotCorrect"/>
-                        </convert>
-                    </process>
-                </simple-map-processor>
-            </call-map-processor>
-            <check-errors/>
-            <call-service service-name="checkUpdatePrunRoutingTask" in-map-name="context">
-            </call-service>
-            <check-errors/>
-            <call-map-processor in-map-name="parameters" out-map-name="context1">
-                <simple-map-processor name="prepareUpdateRoutingTask">
-                    <process field="productionRunId">
-                        <copy to-field="workEffortParentId"/>
-                    </process>
-                    <process field="routingTaskId">
-                        <copy to-field="workEffortId"/>
-                    </process>
-                    <process field="priority">
-                        <copy/>
-                        <convert type="Long">
-                            <fail-property resource="ManufacturingUiLabels" property="ManufacturingRoutingSeqIdFormatNotCorrect"/>
-                        </convert>
-                    </process>
-                    <process field="workEffortName">
-                        <copy/>
-                    </process>
-                    <process field="description">
-                        <copy/>
-                    </process>
-                    <process field="estimatedSetupMillis">
-                        <copy/>
-                        <convert type="Double">
-                            <fail-property resource="ManufacturingUiLabels" property="ManufacturingProductionRunQuantityNotCorrect"/>
-                        </convert>
-                    </process>
-                    <process field="estimatedMilliSeconds">
-                        <copy/>
-                        <convert type="Double">
-                            <fail-property resource="ManufacturingUiLabels" property="ManufacturingProductionRunQuantityNotCorrect"/>
-                        </convert>
-                    </process>
-                </simple-map-processor>
-            </call-map-processor>
-            <check-errors/>
-            <call-service service-name="updateWorkEffort" in-map-name="context1">
-            </call-service>
-            <log level="info" message="parameters = ${parameters}"/>
-        </if-compare>
-        <if-compare value="addRoutingTask" field-name="actionForm" map-name="parameters"  operator="equals">
-            <call-map-processor in-map-name="parameters" out-map-name="context">
-                <simple-map-processor name="prepareAddRoutingTask">
-                    <process field="productionRunId">
-                        <copy/>
-                    </process>
-                    <process field="routingTaskId">
-                        <copy/>
-                        <not-empty>
-                            <fail-property resource="ManufacturingUiLabels" property="ManufacturingRoutingTaskIdMissing"/>
-                        </not-empty>
-                    </process>
-                    <process field="priority">
-                        <copy/>
-                        <not-empty>
-                            <fail-property resource="ManufacturingUiLabels" property="ManufacturingProductionRunPriorityMissing"/>
-                        </not-empty>
-                        <convert type="Long">
-                            <fail-property resource="ManufacturingUiLabels" property="ManufacturingRoutingSeqIdFormatNotCorrect"/>
-                        </convert>
-                    </process>
-                    <process field="estimatedStartDate">
-                        <copy/>
-                        <convert type="Timestamp">
-                            <fail-property resource="ManufacturingUiLabels" property="ManufacturingProductionRunStartDateNotCorrect"/>
-                        </convert>
-                    </process>
-                    <process field="estimatedCompletionDate">
-                        <copy/>
-                        <convert type="Timestamp">
-                            <fail-property resource="ManufacturingUiLabels" property="ManufacturingProductionRunCompletionDateNotCorrect"/>
-                        </convert>
-                    </process>
-                    <process field="estimatedSetupMillis">
-                        <copy/>
-                        <convert type="Double">
-                            <fail-property resource="ManufacturingUiLabels" property="ManufacturingProductionRunQuantityNotCorrect"/>
-                        </convert>
-                    </process>
-                    <process field="estimatedMilliSeconds">
-                        <copy/>
-                        <convert type="Double">
-                            <fail-property resource="ManufacturingUiLabels" property="ManufacturingProductionRunQuantityNotCorrect"/>
-                        </convert>
-                    </process>
-                    <process field="workEffortName">
-                        <copy/>
-                    </process>
-                    <process field="description">
-                        <copy/>
-                    </process>
-                </simple-map-processor>
-            </call-map-processor>
-            <check-errors/>
-            <call-service service-name="addProductionRunRoutingTask" in-map-name="context">
-            </call-service>
-            <log level="info" message="parameters = ${parameters}"/>
-        </if-compare>
-    </simple-method>
-    <!-- This method calls the removeWorkEffortFixedAssetAssign service and returns a response according to the 
-        production run status, so that we can show the appropriate screen (EditProductionRun or 
-        ProductionRunDeclaration) -->
-    <simple-method method-name="removeProductionRunFixedAsset" 
-            short-description="Deletes a WorkEffortFixedAssetAssign and direct to the appropiate screen">
+    <simple-method method-name="addProductionRunRoutingTask" short-description="Check parameters and add a production run task.">
         <call-map-processor in-map-name="parameters" out-map-name="context">
-            <simple-map-processor name="prepareRemoveFixedAsset">
-                <process field="workEffortId">
-                    <copy />
-                    <not-empty>
-                        <fail-property property="ManufacturingRoutingTaskIdMissing" resource="ManufacturingUiLabels"/>
-                    </not-empty>
+            <simple-map-processor name="prepareAddRoutingTask">
+                <process field="productionRunId">
+                    <copy/>
                 </process>
-                <process field="fixedAssetId">
-                    <copy />
+                <process field="routingTaskId">
+                    <copy/>
                     <not-empty>
-                        <fail-property property="ManufacturingProductionRunFixedAssetIdMissing" resource="ManufacturingUiLabels"/>
+                        <fail-property resource="ManufacturingUiLabels" property="ManufacturingRoutingTaskIdMissing"/>
                     </not-empty>
                 </process>
-                <process field="fromDate">
-                    <copy />
+                <process field="priority">
+                    <copy/>
                     <not-empty>
-                        <fail-property resource="ManufacturingUiLabels" property="ManufacturingFixedAssetStartDateMissing" />
+                        <fail-property resource="ManufacturingUiLabels" property="ManufacturingProductionRunPriorityMissing"/>
                     </not-empty>
+                    <convert type="Long">
+                        <fail-property resource="ManufacturingUiLabels" property="ManufacturingRoutingSeqIdFormatNotCorrect"/>
+                    </convert>
+                </process>
+                <process field="estimatedStartDate">
+                    <copy/>
+                    <convert type="Timestamp">
+                        <fail-property resource="ManufacturingUiLabels" property="ManufacturingProductionRunStartDateNotCorrect"/>
+                    </convert>
+                </process>
+                <process field="estimatedCompletionDate">
+                    <copy/>
                     <convert type="Timestamp">
-                        <fail-property resource="ManufacturingUiLabels" property="ManufacturingFixedAssetFromDateNotCorrect"/>
+                        <fail-property resource="ManufacturingUiLabels" property="ManufacturingProductionRunCompletionDateNotCorrect"/>
                     </convert>
                 </process>
+                <process field="estimatedSetupMillis">
+                    <copy/>
+                    <convert type="Double">
+                        <fail-property resource="ManufacturingUiLabels" property="ManufacturingProductionRunQuantityNotCorrect"/>
+                    </convert>
+                </process>
+                <process field="estimatedMilliSeconds">
+                    <copy/>
+                    <convert type="Double">
+                        <fail-property resource="ManufacturingUiLabels" property="ManufacturingProductionRunQuantityNotCorrect"/>
+                    </convert>
+                </process>
+                <process field="workEffortName">
+                    <copy/>
+                </process>
+                <process field="description">
+                    <copy/>
+                </process>
             </simple-map-processor>
         </call-map-processor>
-        <check-errors />
-        <call-service service-name="removeWorkEffortFixedAssetAssign" in-map-name="context" />
-        <check-errors />
-        <entity-one entity-name="WorkEffort" value-name="productionRun" auto-field-map="false">
-            <field-map field-name="workEffortId" env-name="parameters.productionRunId" />
-        </entity-one>
-        <if-compare value="PRUN_CREATED" field-name="currentStatusId" map-name="productionRun" operator="equals">
-            <return response-code="docs_not_printed" />
-        <else>
-            <return response-code="docs_printed" />
-        </else>
-        </if-compare>
+        <check-errors/>
+        <call-service service-name="addProductionRunRoutingTask" in-map-name="context">
+        </call-service>
     </simple-method>
 </simple-methods>
 

Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/EditProductionRun.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/EditProductionRun.bsh?view=diff&rev=523248&r1=523247&r2=523248
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/EditProductionRun.bsh (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/EditProductionRun.bsh Wed Mar 28 02:36:48 2007
@@ -98,10 +98,10 @@
         // routingTask add sub-screen
         if (actionForm.equals("AddRoutingTask")){
             Map routingTaskData =UtilMisc.toMap("workEffortParentId",productionRunId);
-            HtmlFormWrapper editPrRoutingTaskWrapper = new HtmlFormWrapper("component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml", "EditProductionRunRoutingTask", request, response);
-            editPrRoutingTaskWrapper.putInContext("routingTaskData", routingTaskData);
-            editPrRoutingTaskWrapper.putInContext("actionForm", "addRoutingTask");
-            editPrRoutingTaskWrapper.putInContext("actionIsAdd", "Y");
+            HtmlFormWrapper editPrRoutingTaskWrapper = new HtmlFormWrapper("component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml", "AddProductionRunRoutingTask", request, response);
+//            editPrRoutingTaskWrapper.putInContext("routingTaskData", routingTaskData);
+//            editPrRoutingTaskWrapper.putInContext("actionForm", "addRoutingTask");
+//            editPrRoutingTaskWrapper.putInContext("actionIsAdd", "Y");
             context.put("editPrRoutingTaskWrapper",editPrRoutingTaskWrapper);
         }
         // routingTask update sub-screen
@@ -117,10 +117,10 @@
                 routingTaskData.put("estimatedMilliSeconds",routingTask.getDouble("estimatedMilliSeconds").toString());
             else
                 routingTaskData.put("estimatedMilliSeconds", "0");
-            HtmlFormWrapper editPrRoutingTaskWrapper = new HtmlFormWrapper("component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml", "EditProductionRunRoutingTask", request, response);
-            editPrRoutingTaskWrapper.putInContext("routingTaskData", routingTaskData);
-            editPrRoutingTaskWrapper.putInContext("actionForm", "UpdateRoutingTask");
-            editPrRoutingTaskWrapper.putInContext("actionIsAdd", "null");
+            HtmlFormWrapper editPrRoutingTaskWrapper = new HtmlFormWrapper("component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml", "updateProductionRunRoutingTask", request, response);
+            editPrRoutingTaskWrapper.putInContext("routingTask", routingTaskData);
+//            editPrRoutingTaskWrapper.putInContext("actionForm", "UpdateRoutingTask");
+//            editPrRoutingTaskWrapper.putInContext("actionIsAdd", "null");
             context.put("editPrRoutingTaskWrapper",editPrRoutingTaskWrapper);
             context.put("routingTaskId",routingTaskId);
         }

Added: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunTasks.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunTasks.bsh?view=auto&rev=523248
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunTasks.bsh (added)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunTasks.bsh Wed Mar 28 02:36:48 2007
@@ -0,0 +1,44 @@
+/*
+ * 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 java.util.List;
+import java.util.Iterator;
+import java.util.ArrayList;
+
+import org.ofbiz.base.util.UtilValidate;
+import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.util.EntityUtil;
+import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.widget.html.HtmlFormWrapper;
+import org.ofbiz.manufacturing.jobshopmgt.ProductionRun;
+
+
+productionRunId = request.getParameter("productionRunId");
+if (UtilValidate.isEmpty(productionRunId)) {
+    productionRunId = request.getParameter("workEffortId");
+}
+
+
+if (!UtilValidate.isEmpty(productionRunId)) {
+    ProductionRun productionRun = new ProductionRun(productionRunId, delegator, dispatcher);
+    if (productionRun.exist()){
+        List productionRunRoutingTasks = productionRun.getProductionRunRoutingTasks();
+        context.put("productionRunRoutingTasks", productionRunRoutingTasks);
+    }
+}

Propchange: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunTasks.bsh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunTasks.bsh
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunTasks.bsh
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/controller.xml?view=diff&rev=523248&r1=523247&r2=523248
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/controller.xml Wed Mar 28 02:36:48 2007
@@ -473,9 +473,9 @@
         <security https="true" auth="true"/>
         <response name="success" type="view" value="CreateProductionRun"/>
     </request-map>
-    <request-map uri="CreateProductionRunGo">
+    <request-map uri="createProductionRun">
         <security https="true" auth="true"/>
-        <event type="simple" path="org/ofbiz/manufacturing/jobshopmgt/ProductionRunSimpleEvents.xml" invoke="checkFieldCreateProductionRun"/>
+        <event type="service" invoke="createProductionRunsForProductBom"/>
         <response name="success" type="view" value="EditProductionRun"/>
         <response name="error" type="view" value="CreateProductionRun"/>
     </request-map>
@@ -486,6 +486,10 @@
         <response name="docs_printed" type="view" value="ProductionRunDeclaration"/>
         <response name="error" type="view" value="FindProductionRun"/>
     </request-map>
+    <request-map uri="EditProductionRun">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="EditProductionRun"/>
+    </request-map>
     <request-map uri="PrintProductionRun">
         <security https="true" auth="true"/>
         <response name="success" type="view" value="PrintProductionRun"/>
@@ -498,11 +502,6 @@
         <security https="true" auth="true"/>
         <response name="success" type="view" value="FindProductionRun"/>
     </request-map>
-    <request-map uri="EditProductionRun">
-        <security https="true" auth="true"/>
-        <event type="simple" path="org/ofbiz/manufacturing/jobshopmgt/ProductionRunSimpleEvents.xml" invoke="actionEditProductionRun"/>
-        <response name="success" type="view" value="EditProductionRun"/>
-    </request-map>
     <request-map uri="updateProductionRun">
         <security https="true" auth="true"/>
         <event type="service" invoke="updateProductionRun"/>
@@ -539,6 +538,26 @@
         <response name="success" type="view" value="ProductionRunFixedAssets"/>
         <response name="error" type="view" value="ProductionRunFixedAssets"/>
     </request-map>
+    <request-map uri="ProductionRunTasks">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="ProductionRunTasks"/>
+    </request-map>
+    <request-map uri="addProductionRunRoutingTask">
+        <security https="true" auth="true"/>
+        <event type="simple" path="org/ofbiz/manufacturing/jobshopmgt/ProductionRunSimpleEvents.xml" invoke="addProductionRunRoutingTask"/>
+        <response name="success" type="view" value="ProductionRunTasks"/>
+    </request-map>
+    <request-map uri="updateProductionRunRoutingTask">
+        <security https="true" auth="true"/>
+        <event type="simple" path="org/ofbiz/manufacturing/jobshopmgt/ProductionRunSimpleEvents.xml" invoke="editProductionRunRoutingTask"/>
+        <response name="success" type="view" value="ProductionRunTasks"/>
+    </request-map>
+    <request-map uri="deleteProductionRunRoutingTask">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="deleteWorkEffort"/>
+        <response name="success" type="view" value="ProductionRunTasks"/>
+        <response name="error" type="view" value="ProductionRunTasks"/>
+    </request-map>
     <request-map uri="ProductionRunComponents">
         <security https="true" auth="true"/>
         <response name="success" type="view" value="ProductionRunComponents"/>
@@ -577,12 +596,6 @@
         <response name="success" type="view" value="ListRoutingTaskProducts"/>
         <response name="error" type="view" value="ListRoutingTaskProducts"/>
     </request-map>
-    <request-map uri="deleteProductionRunRoutingTask">
-        <security https="true" auth="true"/>
-        <event type="service" invoke="deleteWorkEffort"/>
-        <response name="success" type="view" value="EditProductionRun"/>
-        <response name="error" type="view" value="EditProductionRun"/>
-    </request-map>
     <!-- Production Run Declaration -->
     <request-map uri="changeProductionRunStatusToPrinted">
         <security https="true" auth="true"/>
@@ -772,6 +785,7 @@
     <view-map name="PrintProductionRun" type="screenfop" page="component://manufacturing/widget/manufacturing/JobshopScreens.xml#ProductionRunPdf" content-type="application/pdf" encoding="none"/>
     <view-map name="ProductionRunDeclaration" page="component://manufacturing/widget/manufacturing/JobshopScreens.xml#ProductionRunDeclaration" type="screen"/>
     <view-map name="ProductionRunCosts" page="component://manufacturing/widget/manufacturing/JobshopScreens.xml#ProductionRunCosts" type="screen"/>
+    <view-map name="ProductionRunTasks" page="component://manufacturing/widget/manufacturing/JobshopScreens.xml#ProductionRunTasks" type="screen"/>
     <view-map name="ProductionRunComponents" page="component://manufacturing/widget/manufacturing/JobshopScreens.xml#ProductionRunComponents" type="screen"/>
     <view-map name="ProductionRunFixedAssets" page="component://manufacturing/widget/manufacturing/JobshopScreens.xml#ProductionRunFixedAssets" type="screen"/>
     <view-map name="ProductionRunAssocs" page="component://manufacturing/widget/manufacturing/JobshopScreens.xml#ProductionRunAssocs" type="screen"/>

Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/EditProductionRun.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/EditProductionRun.ftl?view=diff&rev=523248&r1=523247&r2=523248
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/EditProductionRun.ftl (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/EditProductionRun.ftl Wed Mar 28 02:36:48 2007
@@ -53,30 +53,3 @@
     </#list>
     </p>
 </#if>
-
-
-<table border="0" width="100%" cellspacing="0" cellpadding="0">
-    <tr valign="top">
-        <#-- RoutingTask sub-screen  Update or Add  -->
-        <#if routingTaskId?has_content || actionForm=="AddRoutingTask">
-            <td> &nbsp; </td>
-            <td>
-                <table border="0" width="100%" cellspacing="0" cellpadding="0" class="boxoutside">
-                  <tr><td>
-                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="boxtop">
-                        <tr>
-                        <#if routingTaskId?has_content> <#-- RoutingTask Update  -->
-                            <td><div class="boxhead">${uiLabelMap.CommonEdit}&nbsp;${uiLabelMap.ManufacturingRoutingTaskId} : ${routingTaskId}</div></td>
-                        <#else> <#-- RoutingTask Add         -->
-                            <td><div class="boxhead">${uiLabelMap.ManufacturingAddRoutingTask}</div></td>
-                        </#if>
-                        </tr>
-                    </table>
-                    ${editPrRoutingTaskWrapper.renderFormString(context)}
-                  </td></tr>
-                </table>
-            </td>
-        </#if>
-        </tr>
-    </table>
-    <br/>

Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml?view=diff&rev=523248&r1=523247&r2=523248
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml Wed Mar 28 02:36:48 2007
@@ -20,7 +20,7 @@
 
 <forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/widget-form.xsd">
-    <form name="CreateProductionRun" target="CreateProductionRunGo" title="" type="single">
+    <form name="CreateProductionRun" target="createProductionRun" title="" type="single">
         <field name="productId" title="${uiLabelMap.ProductProductId}"><lookup target-form-name="LookupProduct" size="16"/></field>
         <field name="quantity" title="${uiLabelMap.ManufacturingQuantity}"><text size="6"/></field>
         <field name="startDate" title="${uiLabelMap.ManufacturingStartDate}"><date-time/></field>
@@ -102,7 +102,7 @@
         <field name="estimatedStartDate"  title="${uiLabelMap.ManufacturingStartDate}"><date-time/></field>
         <field name="estimatedCompletionDate" title="${uiLabelMap.ManufacturingEstimatedCompletionDate}"><display/></field>
         <field name="workEffortName"  title="${uiLabelMap.ManufacturingProductionRunName}"><text/></field>
-        <field name="description"  title="${uiLabelMap.CommonDescription}"><text/></field>
+        <field name="description"><text/></field>
         <field name="submitButton" title="${uiLabelMap.CommonUpdate}"><submit button-type="button"/></field>
     </form>
     <form name="ListProductionRunOrderItems" type="list" target="EditProductionRun" title="" list-name="orderItems">
@@ -126,7 +126,16 @@
         </field>
     </form>
     
-     <form name="ListProductionRunRoutingTasks" type="list" target="EditProductionRun" title="" list-name="productionRunRoutingTasks">
+     <form name="ViewListProductionRunRoutingTasks" type="list" title="" list-name="productionRunRoutingTasks">
+        <field name="priority" title="${uiLabelMap.CommonSequenceNum}"><display/></field>
+        <field name="workEffortId"  title="${uiLabelMap.ManufacturingTaskName}"><display description="${workEffortName} [${workEffortId}]" /></field>
+        <field name="fixedAssetId"  title="${uiLabelMap.ManufacturingMachine}"><display/></field>
+        <field name="estimatedStartDate"  title="${uiLabelMap.ManufacturingStartDate}"><display/></field>
+        <field name="estimatedCompletionDate" title="${uiLabelMap.ManufacturingEstimatedCompletionDate}"><display/></field>
+        <field name="estimatedSetupMillis" title="${uiLabelMap.ManufacturingTaskEstimatedSetupMillis}" ><display/></field>
+        <field name="estimatedMilliSeconds" title="${uiLabelMap.ManufacturingTaskEstimatedMilliSeconds}" ><display/></field>
+    </form>
+     <form name="ListProductionRunRoutingTasks" type="list" target="ProductionRunTasks" title="" list-name="productionRunRoutingTasks">
         <field name="priority" title="${uiLabelMap.CommonSequenceNum}"><display/></field>
         <field name="workEffortId"  title="${uiLabelMap.ManufacturingTaskName}"><display description="${workEffortName} [${workEffortId}]" /></field>
         <field name="fixedAssetId"  title="${uiLabelMap.ManufacturingMachine}"><display/></field>
@@ -135,7 +144,7 @@
         <field name="estimatedSetupMillis" title="${uiLabelMap.ManufacturingTaskEstimatedSetupMillis}" ><display/></field>
         <field name="estimatedMilliSeconds" title="${uiLabelMap.ManufacturingTaskEstimatedMilliSeconds}" ><display/></field>
         <field name="editLink" title="" widget-style="smallSubmit">
-            <hyperlink target="EditProductionRun?actionForm=EditRoutingTask&amp;routingTaskId=${workEffortId}&amp;productionRunId=${workEffortParentId}" description="${uiLabelMap.CommonEdit}" also-hidden="false"/>
+            <hyperlink target="ProductionRunTasks?routingTaskId=${workEffortId}&amp;productionRunId=${workEffortParentId}" description="${uiLabelMap.CommonEdit}" also-hidden="false"/>
         </field>
         <field name="deleteLink" title="" widget-style="smallSubmit">
             <!--<hyperlink target="RemoveRoutingTaskAssoc?workEffortIdFrom=${workEffortIdFrom}&amp;workEffortIdTo=${workEffortIdTo}&amp;fromDate=${fromDate}&amp;workEffortAssocTypeId=ROUTING_COMPONENT" description="[${uiLabelMap.CommonDelete}]" also-hidden="false"/>-->
@@ -153,26 +162,24 @@
         <field name="estimatedQuantity" title="${uiLabelMap.ManufacturingQuantity}"><display/></field>
     </form>
 
-     <form name="EditProductionRunRoutingTask" type="single" target="EditProductionRun" title="" default-map-name="routingTaskData">
-        <field name="actionForm">
-            <hidden value="${actionForm}"/>
-        </field>
+    <form name="EditProductionRunRoutingTask" type="single" target="updateProductionRunRoutingTask" title="" default-map-name="productionRunTask">
+        <alt-target use-when="productionRunTask==null" target="addProductionRunRoutingTask"/>
         <field name="productionRunId">
-            <hidden value="${routingTaskData.workEffortParentId}"/>
+            <hidden value="${productionRunId}"/>
         </field>
-        <field name="routingTaskId" use-when="${actionIsAdd} == null">
-            <hidden value="${routingTaskData.workEffortId}"/>
-        </field>
-        <field name="routingTaskId" title="${uiLabelMap.ManufacturingRoutingTaskId}" use-when="${actionIsAdd} != null">
+        <field name="routingTaskId" title="${uiLabelMap.ManufacturingRoutingTaskId}" use-when="productionRunTask==null">
             <lookup target-form-name="LookupRoutingTask"/>
         </field>
+        <field name="routingTaskId" map-name="workEffortId" title="${uiLabelMap.ManufacturingRoutingTaskId}" use-when="productionRunTask!=null">
+            <display/>
+        </field>
         <field name="priority" title="${uiLabelMap.CommonSequenceNum}">
             <text size="4"/>
         </field>
         <field name="workEffortName" title="${uiLabelMap.ManufacturingTaskName}">
             <text/>
         </field>
-        <field name="description" title="${uiLabelMap.CommonDescription}">
+        <field name="description">
             <text/>
         </field>
         <field name="estimatedStartDate" title="${uiLabelMap.ManufacturingStartDate}">
@@ -187,7 +194,7 @@
         <field name="estimatedMilliSeconds" title="${uiLabelMap.ManufacturingTaskEstimatedMilliSeconds}">
             <text/>
         </field>
-        <field name="submitButton" title="${uiLabelButton}">
+        <field name="submitButton" title="${uiLabelMap.CommonEdit}">
             <submit button-type="button"/>
         </field>
     </form>

Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunTabBar.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunTabBar.ftl?view=diff&rev=523248&r1=523247&r2=523248
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunTabBar.ftl (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunTabBar.ftl Wed Mar 28 02:36:48 2007
@@ -22,14 +22,15 @@
 
 <div class='tabContainer'>
     <#if productionRun?has_content>
-        <#if productionRun.getString("currentStatusId") == "PRUN_CREATED">
+        <#if productionRun.getString("currentStatusId") == "PRUN_CREATED" || productionRun.getString("currentStatusId") == "PRUN_SCHEDULED">
         <a href="<@o...@ofbizUrl>" class="${selectedClassMap.edit?default(unselectedClassName)}">${uiLabelMap.ManufacturingEditProductionRun}</a>
         <#else>
         <a href="<@o...@ofbizUrl>" class="${selectedClassMap.declaration?default(unselectedClassName)}">${uiLabelMap.ManufacturingProductionRunDeclaration}</a>
-        <a href="<@o...@ofbizUrl>" class="${selectedClassMap.costs?default(unselectedClassName)}">${uiLabelMap.ManufacturingActualCosts}</a>
         </#if>
+        <a href="<@o...@ofbizUrl>" class="${selectedClassMap.tasks?default(unselectedClassName)}">${uiLabelMap.ManufacturingListOfProductionRunRoutingTasks}</a>
         <a href="<@o...@ofbizUrl>" class="${selectedClassMap.components?default(unselectedClassName)}">${uiLabelMap.ManufacturingMaterials}</a>
         <a href="<@o...@ofbizUrl>" class="${selectedClassMap.fixedAssets?default(unselectedClassName)}">${uiLabelMap.AccountingFixedAssets}</a>
         <a href="<@o...@ofbizUrl>" class="${selectedClassMap.assocs?default(unselectedClassName)}">${uiLabelMap.ManufacturingProductionRunAssocs}</a>
+        <a href="<@o...@ofbizUrl>" class="${selectedClassMap.costs?default(unselectedClassName)}">${uiLabelMap.ManufacturingActualCosts}</a>
     </#if>
 </div>

Modified: ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml?view=diff&rev=523248&r1=523247&r2=523248
==============================================================================
--- ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml (original)
+++ ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml Wed Mar 28 02:36:48 2007
@@ -109,10 +109,7 @@
                         <container>
                             <label style="head2">${uiLabelMap.ManufacturingListOfProductionRunRoutingTasks}</label>
                         </container>
-                        <container>
-                            <link target="EditProductionRun?productionRunId=${productionRunId}&amp;actionForm=AddRoutingTask" text="${uiLabelMap.ManufacturingAddRoutingTask}" style="buttontext"/>
-                        </container>
-                        <include-form name="ListProductionRunRoutingTasks" location="component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml"/>
+                        <include-form name="ViewListProductionRunRoutingTasks" location="component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml"/>
                         <container>
                             <label style="head2">${uiLabelMap.ManufacturingMaterials}</label>
                         </container>
@@ -251,6 +248,39 @@
                             <label style="head2">${uiLabelMap.ManufacturingDependentWorkEfforts}</label>
                         </container>
                         <include-form name="dependentWorkEfforts" location="component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml"/>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+    <screen name="ProductionRunTasks">
+        <section>
+            <actions>
+                <set field="title" value="Production Run Components"/>
+                <set field="titleProperty" value="ManufacturingProductionRunTasks"/>
+                <set field="tabButtonItem" value="tasks"/>
+                <set field="headerItem" value="jobshop"/>
+                <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer"/>
+                <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="500"/>
+
+                <set field="productionRunId" from-field="parameters.productionRunId"/>
+                <entity-one entity-name="WorkEffort" value-name="productionRun">
+                    <field-map field-name="workEffortId" env-name="productionRunId"/>
+                </entity-one>
+                <set field="routingTaskId" from-field="parameters.routingTaskId"/>
+                <entity-one entity-name="WorkEffort" value-name="productionRunTask">
+                    <field-map field-name="workEffortId" env-name="routingTaskId"/>
+                </entity-one>
+                <script location="component://manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunTasks.bsh"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonJobshopDecorator">
+                    <decorator-section name="body">
+                        <container>
+                            <label style="head2">${uiLabelMap.ManufacturingListOfProductionRunRoutingTasks}</label>
+                        </container>
+                        <include-form name="EditProductionRunRoutingTask" location="component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml"/>
+                        <include-form name="ListProductionRunRoutingTasks" location="component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml"/>
                     </decorator-section>
                 </decorator-screen>
             </widgets>