Author: ashish
Date: Mon Jun 27 07:59:17 2016
New Revision: 1750299

URL: http://svn.apache.org/viewvc?rev=1750299&view=rev
Log:
Applied patch from jira issue - OFBIZ-7567 - Remove HtmlFormWrapper 
dependencies from Production Run Cost screen.
Thanks Ravi for the contribution.

Modified:
    
ofbiz/trunk/applications/manufacturing/groovyScripts/jobshopmgt/ProductionRunCosts.groovy
    
ofbiz/trunk/applications/manufacturing/template/jobshopmgt/ProductionRunCosts.ftl
    
ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml

Modified: 
ofbiz/trunk/applications/manufacturing/groovyScripts/jobshopmgt/ProductionRunCosts.groovy
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/groovyScripts/jobshopmgt/ProductionRunCosts.groovy?rev=1750299&r1=1750298&r2=1750299&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/manufacturing/groovyScripts/jobshopmgt/ProductionRunCosts.groovy
 (original)
+++ 
ofbiz/trunk/applications/manufacturing/groovyScripts/jobshopmgt/ProductionRunCosts.groovy
 Mon Jun 27 07:59:17 2016
@@ -18,22 +18,17 @@
  */
 
 import org.ofbiz.entity.util.EntityUtil;
-import org.ofbiz.widget.renderer.html.HtmlFormWrapper;
 
 productionRunId = parameters.productionRunId ?: parameters.workEffortId;
-taskCosts = [];
+taskInfoList = [];
 tasks = from("WorkEffort").where("workEffortParentId", productionRunId, 
"workEffortTypeId", "PROD_ORDER_TASK").orderBy("workEffortId").queryList();
 tasks.each { task ->
     costs = from("CostComponent").where("workEffortId", 
task.workEffortId).filterByDate().queryList();
-    HtmlFormWrapper taskCostsForm = new 
HtmlFormWrapper("component://manufacturing/widget/manufacturing/ProductionRunForms.xml",
 "ProductionRunTaskCosts", request, response);
-    taskCostsForm.putInContext("taskCosts", costs);
-    taskCosts.add([task : task ,costsForm : taskCostsForm]);
+    taskInfoList.add([task : task, taskCosts : costs]);
 }
 // get the costs directly associated to the production run (e.g. overhead 
costs)
 productionRun = from("WorkEffort").where("workEffortId", 
productionRunId).cache(true).queryOne();
 costs = from("CostComponent").where("workEffortId", 
productionRunId).filterByDate().queryList();
-HtmlFormWrapper taskCostsForm = new 
HtmlFormWrapper("component://manufacturing/widget/manufacturing/ProductionRunForms.xml",
 "ProductionRunTaskCosts", request, response);
-taskCostsForm.putInContext("taskCosts", costs);
-taskCosts.add([task : productionRun ,costsForm : taskCostsForm]);
+taskInfoList.add([task : productionRun, taskCosts : costs]);
 
-context.taskCosts = taskCosts;
+context.taskInfoList = taskInfoList;
\ No newline at end of file

Modified: 
ofbiz/trunk/applications/manufacturing/template/jobshopmgt/ProductionRunCosts.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/template/jobshopmgt/ProductionRunCosts.ftl?rev=1750299&r1=1750298&r2=1750299&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/manufacturing/template/jobshopmgt/ProductionRunCosts.ftl
 (original)
+++ 
ofbiz/trunk/applications/manufacturing/template/jobshopmgt/ProductionRunCosts.ftl
 Mon Jun 27 07:59:17 2016
@@ -17,15 +17,16 @@ specific language governing permissions
 under the License.
 -->
 
-<#list taskCosts as taskCost>
+<#list taskInfoList as taskInfo>
   <div class="screenlet">
     <div class="screenlet-title-bar">
-      <#assign task = taskCost.task>
+      <#assign task = taskInfo.task>
       <h3>${uiLabelMap.ManufacturingActualCosts} ${task.workEffortName!} 
[${task.workEffortId}]</h3>
     </div>
     <div class="screenlet-body">
-      <#assign costsForm = taskCost.costsForm>
-      ${costsForm.renderFormString(context)}
+      <#assign taskCosts = taskInfo.taskCosts>
+      ${setRequestAttribute("taskCosts", taskCosts)}
+      
${screens.render("component://manufacturing/widget/manufacturing/JobshopScreens.xml#ProductionRunTaskCosts")}
     </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=1750299&r1=1750298&r2=1750299&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml 
(original)
+++ 
ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml 
Mon Jun 27 07:59:17 2016
@@ -612,6 +612,16 @@ under the License.
             </widgets>
         </section>
     </screen>
+    <screen name="ProductionRunTaskCosts">
+        <section>
+            <actions>
+                <set field="taskCosts" value="${groovy: 
request.getAttribute('taskCosts');}"/>
+            </actions>
+            <widgets>
+                <include-form name="ProductionRunTaskCosts" 
location="component://manufacturing/widget/manufacturing/ProductionRunForms.xml"/>
+            </widgets>
+        </section>
+    </screen>
     <screen name="ProductionRunContent">
         <section>
             <actions>


Reply via email to