Applied patch from Scott Gray to convert the existing bsh/ftl based "create production run" screen to form widgets (OFBIZ-174)..
git-svn-id: https://svn.apache.org/repos/asf/incubator/ofbiz/trunk@433555 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
-76
@@ -1,76 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2001-2006 The Apache Software Foundation
|
||||
*
|
||||
* Licensed 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.*;
|
||||
import org.ofbiz.entity.*;
|
||||
import org.ofbiz.base.util.*;
|
||||
|
||||
|
||||
// Loads the newly created production run (for the tab bar)
|
||||
delegator = request.getAttribute("delegator");
|
||||
|
||||
productionRunId = request.getAttribute("productionRunId");
|
||||
if (!UtilValidate.isEmpty(productionRunId)) {
|
||||
GenericValue productionRun = delegator.findByPrimaryKey("WorkEffort", UtilMisc.toMap("workEffortId", productionRunId));
|
||||
if (productionRun != null) {
|
||||
context.put("productionRunId", productionRunId);
|
||||
context.put("productionRun", productionRun);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// requestParams = UtilHttp.getParameterMap(request);
|
||||
HashMap productionRunData= new HashMap();
|
||||
productId = request.getParameter("productId");
|
||||
if (productId != null) productionRunData.put("productId",productId);
|
||||
pRQuantity = request.getParameter("pRQuantity");
|
||||
if (pRQuantity != null) productionRunData.put("pRQuantity",pRQuantity);
|
||||
startDate = request.getParameter("startDate");
|
||||
if (startDate != null) productionRunData.put("startDate",startDate);
|
||||
facilityId = request.getParameter("facilityId");
|
||||
if (facilityId != null) productionRunData.put("facilityId", facilityId);
|
||||
routingId = request.getParameter("routingId");
|
||||
if (routingId != null) productionRunData.put("routingId",routingId);
|
||||
workEffortName = request.getParameter("workEffortName");
|
||||
if (workEffortName != null) productionRunData.put("workEffortName",workEffortName);
|
||||
description = request.getParameter("description");
|
||||
if (description != null) productionRunData.put("description",description);
|
||||
List msgResult = new LinkedList();
|
||||
msgResult = request.getParameter("msgResult");
|
||||
if (msgResult == null) msgResult = request.getAttribute("msgResult");
|
||||
// if (msgResult == null) { msgResult.add("truc"); }
|
||||
|
||||
tryEntity = true;
|
||||
errorMessage = request.getAttribute("_ERROR_MESSAGE_");
|
||||
if (errorMessage != null && errorMessage.length() > 0) {
|
||||
tryEntity = false;
|
||||
}
|
||||
|
||||
// get all the warehouses
|
||||
delegator = request.getAttribute("delegator");
|
||||
warehouses = delegator.findByAnd("Facility", UtilMisc.toMap("facilityTypeId", "WAREHOUSE"));
|
||||
context.put("warehouses", warehouses);
|
||||
if (facilityId != null && facilityId.length() > 0) {
|
||||
currentFacilityId = delegator.findByPrimaryKeyCache("Facility", UtilMisc.toMap("facilityId", facilityId));
|
||||
context.put("currentFacilityId", currentFacilityId);
|
||||
}
|
||||
|
||||
|
||||
context.put("msgResult", msgResult);
|
||||
context.put("productionRunData", productionRunData);
|
||||
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
<#--
|
||||
|
||||
Copyright 2001-2006 The Apache Software Foundation
|
||||
|
||||
Licensed 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.
|
||||
-->
|
||||
<div class="head1">${uiLabelMap.ManufacturingCreateProductionRun}</div>
|
||||
<form name="productionRunform" method="post" action="<@ofbizUrl>CreateProductionRunGo</@ofbizUrl>">
|
||||
|
||||
<br/>
|
||||
<table width="90%" border="0" cellpadding="2" cellspacing="0">
|
||||
<tr>
|
||||
<td width='26%' align='right' valign='top'>
|
||||
<div class="tableheadtext">${uiLabelMap.ProductProductId}</div>
|
||||
</td>
|
||||
<td width="5"> </td>
|
||||
<td width="74%">
|
||||
<input type="text" class="inputBox" size="16" name="productId" value="${productionRunData.productId?if_exists}">
|
||||
<a href="javascript:call_fieldlookup2(document.productionRunform.productId,'LookupProduct');"><img src='/images/fieldlookup.gif' width='15' height='14' border='0' alt='Click here For Field Lookup'></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width='26%' align='right' valign='top'><div class="tableheadtext">${uiLabelMap.ManufacturingQuantity}</div></td>
|
||||
<td width="5"> </td>
|
||||
<td width="74%"><input type="text" class="inputBox" size="6" name="pRQuantity" value="${productionRunData.pRQuantity?if_exists}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width='26%' align='right' valign='top'><div class="tableheadtext">${uiLabelMap.ManufacturingStartDate}</div></td>
|
||||
<td width="5"> </td>
|
||||
<td width="74%"><input type="text" class="inputBox" size="19" name="startDate" value="${productionRunData.startDate?if_exists}">
|
||||
<a href="javascript:call_cal(document.productionRunform.startDate, null);"><img src="/images/cal.gif" width="16" height="16" border="0" alt="Click here For Calendar"></a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width='26%' align='right' valign='top'>
|
||||
<div class="tableheadtext">${uiLabelMap.ProductFacilityId}</div>
|
||||
</td>
|
||||
<td width="5"> </td>
|
||||
<td width="74%">
|
||||
<select name='facilityId' class='selectBox'>
|
||||
<#if currentFacilityId?has_content>
|
||||
<option value="${currentFacilityId.facilityId}">${currentFacilityId.facilityName} [${currentFacilityId.facilityId}]</option>
|
||||
<option value="${currentFacilityId.facilityId}">---</option>
|
||||
</#if>
|
||||
<#list warehouses as warehouse>
|
||||
<option value="${warehouse.facilityId}">${warehouse.facilityName} [${warehouse.facilityId}]</option>
|
||||
</#list>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td width='26%' align='right' valign='top'><div class="tableheadtext">${uiLabelMap.ManufacturingRoutingId}</div></td>
|
||||
<td width="5"> </td>
|
||||
<td width="74%"><input type="text" class="inputBox" size="16" name="routingId" value="${productionRunData.routingId?if_exists}">
|
||||
<a href="javascript:call_fieldlookup2(document.productionRunform.routingId,'LookupRouting');"><img src='/images/fieldlookup.gif' width='15' height='14' border='0' alt='Click here For Field Lookup'></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width='26%' align='right' valign='top'><div class="tableheadtext">${uiLabelMap.ManufacturingProductionRunName}</div></td>
|
||||
<td width="5"> </td>
|
||||
<td width="74%"><input type="text" class="inputBox" size="30" name="workEffortName" value="${productionRunData.workEffortName?if_exists}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width='26%' align='right' valign='top'><div class="tableheadtext">${uiLabelMap.CommonDescription}</div></td>
|
||||
<td width="5"> </td>
|
||||
<td width="74%"><input type="text" class="inputBox" size="50" name="description" value="${productionRunData.description?if_exists}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="26%" align="right" valign="top">
|
||||
<td width="5"> </td>
|
||||
<td width="74%"><input type="submit" value="${uiLabelMap.CommonSubmit}" class="smallSubmit"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
@@ -18,6 +18,25 @@ under the License.
|
||||
|
||||
<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"
|
||||
default-title-style="tableheadtext" default-tooltip-style="tabletext" default-widget-style="inputBox">
|
||||
<field name="productId" title="${uiLabelMap.ProductProductId}"><lookup target-form-name="LookupProduct" size="16"/></field>
|
||||
<field name="pRQuantity" title="${uiLabelMap.ManufacturingQuantity}"><text size="6"/></field>
|
||||
<field name="startDate" title="${uiLabelMap.ManufacturingStartDate}"><date-time/></field>
|
||||
<field name="facilityId">
|
||||
<drop-down allow-empty="false">
|
||||
<entity-options entity-name="Facility" description="${facilityName} [${facilityId}]">
|
||||
<entity-constraint name="facilityTypeId" value="WAREHOUSE"/>
|
||||
</entity-options>
|
||||
</drop-down>
|
||||
</field>
|
||||
<field name="routingId"><lookup target-form-name="LookupRouting" size="16"/></field>
|
||||
<field name="workEffortName" title="${uiLabelMap.ManufacturingProductionRunName}"><text size="30"/></field>
|
||||
<field name="description" title="${uiLabelMap.CommonDescription}"><text size="50"/></field>
|
||||
<field name="submitButton" title="${uiLabelMap.CommonSubmit}" widget-style="smallSubmit">
|
||||
<submit button-type="button"/>
|
||||
</field>
|
||||
</form>
|
||||
<form name="findProductionRun" target="FindProductionRun" title="" type="single"
|
||||
default-title-style="tableheadtext" default-tooltip-style="tabletext" default-widget-style="inputBox">
|
||||
<field name="workEffortTypeId"><hidden value="PROD_ORDER_HEADER"/></field>
|
||||
|
||||
@@ -59,15 +59,14 @@ under the License.
|
||||
<set field="title" value="Create a Production Run"/>
|
||||
<set field="titleProperty" value="ManufacturingCreateProductionRun"/>
|
||||
<set field="headerItem" value="jobshop"/>
|
||||
|
||||
<script location="component://manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/CreateProductionRun.bsh"/>
|
||||
</actions>
|
||||
<widgets>
|
||||
<decorator-screen name="main-decorator" location="component://manufacturing/widget/manufacturing/CommonScreens.xml">
|
||||
<decorator-section name="body">
|
||||
<platform-specific>
|
||||
<html><html-template location="component://manufacturing/webapp/manufacturing/jobshopmgt/CreateProductionRun.ftl"/></html>
|
||||
</platform-specific>
|
||||
<container>
|
||||
<label style="head1" text="${uiLabelMap.ManufacturingCreateProductionRun}"/>
|
||||
</container>
|
||||
<include-form name="CreateProductionRun" location="component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml"></include-form>
|
||||
</decorator-section>
|
||||
</decorator-screen>
|
||||
</widgets>
|
||||
|
||||
Reference in New Issue
Block a user