Author: ashish
Date: Mon Jun 27 07:58:19 2016 New Revision: 1750297 URL: http://svn.apache.org/viewvc?rev=1750297&view=rev Log: Applied patch from jira issue - OFBIZ-7566 - Remove HtmlFormWrapper dependencies from Production Run Screen. Thanks Ravi for the contribution. Modified: ofbiz/trunk/applications/manufacturing/groovyScripts/jobshopmgt/ProductionRunActualComponents.groovy ofbiz/trunk/applications/manufacturing/groovyScripts/jobshopmgt/ProductionRunComponents.groovy ofbiz/trunk/applications/manufacturing/groovyScripts/jobshopmgt/ProductionRunFixedAssets.groovy ofbiz/trunk/applications/manufacturing/template/jobshopmgt/ProductionRunTasksInfo.ftl ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml Modified: ofbiz/trunk/applications/manufacturing/groovyScripts/jobshopmgt/ProductionRunActualComponents.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/groovyScripts/jobshopmgt/ProductionRunActualComponents.groovy?rev=1750297&r1=1750296&r2=1750297&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/groovyScripts/jobshopmgt/ProductionRunActualComponents.groovy (original) +++ ofbiz/trunk/applications/manufacturing/groovyScripts/jobshopmgt/ProductionRunActualComponents.groovy Mon Jun 27 07:58:19 2016 @@ -17,16 +17,12 @@ * under the License. */ -import org.ofbiz.widget.renderer.html.HtmlFormWrapper; - productionRunId = parameters.productionRunId ?: parameters.workEffortId; taskInfos = []; tasks = from("WorkEffort").where("workEffortParentId", productionRunId, "workEffortTypeId", "PROD_ORDER_TASK").orderBy("workEffortId").queryList(); tasks.each { task -> records = from("InventoryItemDetail").where("workEffortId", task.workEffortId).queryList(); - HtmlFormWrapper taskForm = new HtmlFormWrapper("component://manufacturing/widget/manufacturing/ProductionRunForms.xml", "ProductionRunTaskActualComponents", request, response); - taskForm.putInContext("records", records); - taskInfos.add([task : task, taskForm : taskForm]); + taskInfos.add([task : task, records : records]); } context.taskInfos = taskInfos; Modified: ofbiz/trunk/applications/manufacturing/groovyScripts/jobshopmgt/ProductionRunComponents.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/groovyScripts/jobshopmgt/ProductionRunComponents.groovy?rev=1750297&r1=1750296&r2=1750297&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/groovyScripts/jobshopmgt/ProductionRunComponents.groovy (original) +++ ofbiz/trunk/applications/manufacturing/groovyScripts/jobshopmgt/ProductionRunComponents.groovy Mon Jun 27 07:58:19 2016 @@ -17,16 +17,12 @@ * under the License. */ -import org.ofbiz.widget.renderer.html.HtmlFormWrapper; - productionRunId = parameters.productionRunId ?: parameters.workEffortId; taskInfos = []; tasks = from("WorkEffort").where("workEffortParentId", productionRunId, "workEffortTypeId", "PROD_ORDER_TASK").orderBy("workEffortId").queryList(); tasks.each { task -> records = from("WorkEffortGoodStandard").where("workEffortId", task.workEffortId).queryList(); - HtmlFormWrapper taskForm = new HtmlFormWrapper("component://manufacturing/widget/manufacturing/ProductionRunForms.xml", "ProductionRunTaskComponents", request, response); - taskForm.putInContext("records", records); - taskInfos.add([task : task, taskForm : taskForm]); + taskInfos.add([task : task, records : records]); } context.taskInfos = taskInfos; Modified: ofbiz/trunk/applications/manufacturing/groovyScripts/jobshopmgt/ProductionRunFixedAssets.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/groovyScripts/jobshopmgt/ProductionRunFixedAssets.groovy?rev=1750297&r1=1750296&r2=1750297&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/groovyScripts/jobshopmgt/ProductionRunFixedAssets.groovy (original) +++ ofbiz/trunk/applications/manufacturing/groovyScripts/jobshopmgt/ProductionRunFixedAssets.groovy Mon Jun 27 07:58:19 2016 @@ -17,16 +17,12 @@ * under the License. */ -import org.ofbiz.widget.renderer.html.HtmlFormWrapper; - productionRunId = parameters.productionRunId ?: parameters.workEffortId; taskInfos = []; tasks = from("WorkEffort").where("workEffortParentId", productionRunId, "workEffortTypeId", "PROD_ORDER_TASK").orderBy("workEffortId").queryList(); tasks.each { task -> records = task.getRelated("WorkEffortFixedAssetAssign", null, null, false); - HtmlFormWrapper taskForm = new HtmlFormWrapper("component://manufacturing/widget/manufacturing/ProductionRunForms.xml", "ProductionRunTaskFixedAssets", request, response); - taskForm.putInContext("records", records); - taskInfos.add([task : task, taskForm : taskForm]); + taskInfos.add([task : task, records : records]); } context.taskInfos = taskInfos; Modified: ofbiz/trunk/applications/manufacturing/template/jobshopmgt/ProductionRunTasksInfo.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/template/jobshopmgt/ProductionRunTasksInfo.ftl?rev=1750297&r1=1750296&r2=1750297&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/template/jobshopmgt/ProductionRunTasksInfo.ftl (original) +++ ofbiz/trunk/applications/manufacturing/template/jobshopmgt/ProductionRunTasksInfo.ftl Mon Jun 27 07:58:19 2016 @@ -21,11 +21,11 @@ under the License. <div class="screenlet"> <div class="screenlet-title-bar"> <#assign task = taskInfo.task> - <#assign taskForm = taskInfo.taskForm> <h3>${task.workEffortName!} [${task.workEffortId}]</h3> </div> <div class="screenlet-body"> - ${taskForm.renderFormString(context)} + ${setRequestAttribute("records", taskInfo.records)} + ${screens.render("component://manufacturing/widget/manufacturing/JobshopScreens.xml#ProductionRunTasksInfo")} </div> </div> </#list> \ No newline at end of file Modified: ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml?rev=1750297&r1=1750296&r2=1750297&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml (original) +++ ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml Mon Jun 27 07:58:19 2016 @@ -479,6 +479,7 @@ under the License. <set field="titleProperty" value="ManufacturingProductionRunComponents"/> <set field="tabButtonItem" value="components"/> <set field="headerItem" value="jobshop"/> + <set field="formName" value="ProductionRunTaskComponents"/> <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer"/> <property-to-field resource="widget" property="widget.form.defaultViewSize" field="viewSizeDefaultValue"/> <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="${viewSizeDefaultValue}"/> @@ -513,6 +514,7 @@ under the License. <set field="titleProperty" value="ManufacturingProductionRunActualComponents"/> <set field="tabButtonItem" value="actualComponents"/> <set field="headerItem" value="jobshop"/> + <set field="formName" value="ProductionRunTaskActualComponents"/> <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer"/> <property-to-field resource="widget" property="widget.form.defaultViewSize" field="viewSizeDefaultValue"/> <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="${viewSizeDefaultValue}"/> @@ -543,6 +545,7 @@ under the License. <set field="titleProperty" value="ManufacturingProductionRunFixedAssets"/> <set field="tabButtonItem" value="fixedAssets"/> <set field="headerItem" value="jobshop"/> + <set field="formName" value="ProductionRunTaskFixedAssets"/> <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer"/> <property-to-field resource="widget" property="widget.form.defaultViewSize" field="viewSizeDefaultValue"/> <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="${viewSizeDefaultValue}"/> @@ -571,6 +574,16 @@ under the License. </widgets> </section> </screen> + <screen name="ProductionRunTasksInfo"> + <section> + <actions> + <set field="records" value="${groovy: request.getAttribute('records');}"/> + </actions> + <widgets> + <include-form name="${formName}" location="component://manufacturing/widget/manufacturing/ProductionRunForms.xml"/> + </widgets> + </section> + </screen> <screen name="ProductionRunCosts"> <section> <actions> |
Free forum by Nabble | Edit this page |