Author: jacopoc
Date: Mon Apr 14 01:43:33 2008 New Revision: 647699 URL: http://svn.apache.org/viewvc?rev=647699&view=rev Log: Small improvement for reusability of bsh scripts for the data preparation of the production run screens. Added: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/productionRunAllFixedAssets.bsh (with props) Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunDeclaration.bsh ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ViewProductionRun.bsh ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunDeclaration.bsh URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunDeclaration.bsh?rev=647699&r1=647698&r2=647699&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunDeclaration.bsh (original) +++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunDeclaration.bsh Mon Apr 14 01:43:33 2008 @@ -248,15 +248,5 @@ context.put("productionRunComponentsData", productionRunComponentsData); context.put("productionRunComponentsDataReadyForIssuance", productionRunComponentsDataReadyForIssuance); context.put("productionRunComponentsAlreadyIssued", productionRunComponentsAlreadyIssued); - - // Fixed assets list - List productionRunFixedAssetsData = new LinkedList(); - for (Iterator tasksIt = productionRunRoutingTasks.iterator(); tasksIt.hasNext();) { - GenericValue prodRunTask = (GenericValue)tasksIt.next(); - List taskFixedAssets = prodRunTask.getRelated("WorkEffortFixedAssetAssign"); - productionRunFixedAssetsData.addAll(taskFixedAssets); - } - context.put("productionRunFixedAssetsData", productionRunFixedAssetsData); - } } Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ViewProductionRun.bsh URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ViewProductionRun.bsh?rev=647699&r1=647698&r2=647699&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ViewProductionRun.bsh (original) +++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ViewProductionRun.bsh Mon Apr 14 01:43:33 2008 @@ -76,14 +76,5 @@ // Product component/parts list List productionRunComponentsData = productionRun.getProductionRunComponents(); context.put("productionRunComponents", productionRunComponentsData); - - // Fixed assets list - List productionRunFixedAssetsData = new LinkedList(); - for (Iterator tasksIt = productionRunRoutingTasks.iterator(); tasksIt.hasNext();) { - GenericValue prodRunTask = (GenericValue)tasksIt.next(); - List taskFixedAssets = prodRunTask.getRelated("WorkEffortFixedAssetAssign"); - productionRunFixedAssetsData.addAll(taskFixedAssets); - } - context.put("productionRunFixedAssetsData", productionRunFixedAssetsData); } } Added: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/productionRunAllFixedAssets.bsh URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/productionRunAllFixedAssets.bsh?rev=647699&view=auto ============================================================================== --- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/productionRunAllFixedAssets.bsh (added) +++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/productionRunAllFixedAssets.bsh Mon Apr 14 01:43:33 2008 @@ -0,0 +1,41 @@ +/* + * 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.UtilValidate; +import org.ofbiz.manufacturing.jobshopmgt.ProductionRun; + +import javolution.util.FastList; + +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 productionRunFixedAssetsData = FastList.newInstance(); + List productionRunRoutingTasks = productionRun.getProductionRunRoutingTasks(); + for (Iterator tasksIt = productionRunRoutingTasks.iterator(); tasksIt.hasNext();) { + GenericValue prodRunTask = (GenericValue)tasksIt.next(); + List taskFixedAssets = prodRunTask.getRelated("WorkEffortFixedAssetAssign"); + productionRunFixedAssetsData.addAll(taskFixedAssets); + } + context.put("productionRunFixedAssetsData", productionRunFixedAssetsData); + } +} Propchange: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/productionRunAllFixedAssets.bsh ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/productionRunAllFixedAssets.bsh ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/productionRunAllFixedAssets.bsh ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml?rev=647699&r1=647698&r2=647699&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml (original) +++ ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml Mon Apr 14 01:43:33 2008 @@ -92,6 +92,7 @@ <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer"/> <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="500"/> <script location="component://manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ViewProductionRun.bsh"/> + <script location="component://manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/productionRunallFixedAssets.bsh"/> </actions> <widgets> <decorator-screen name="CommonJobshopDecorator" location="${parameters.commonJobshopDecorator}"> @@ -193,6 +194,7 @@ <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="500"/> <script location="component://manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunDeclaration.bsh"/> + <script location="component://manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/productionRunallFixedAssets.bsh"/> </actions> <widgets> <decorator-screen name="CommonJobshopDecorator" location="${parameters.commonJobshopDecorator}"> |
Free forum by Nabble | Edit this page |