You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by si...@apache.org on 2007/03/07 19:48:12 UTC

svn commit: r515693 - in /ofbiz/trunk/applications/product: config/ProductUiLabels.properties webapp/facility/WEB-INF/actions/facility/FindFacilityTransfers.bsh webapp/facility/WEB-INF/controller.xml webapp/facility/facility/FindFacilityTransfers.ftl

Author: sichen
Date: Wed Mar  7 10:48:11 2007
New Revision: 515693

URL: http://svn.apache.org/viewvc?view=rev&rev=515693
Log:
OFBIZ-780:  Added link to show requested inventory transfers.  This link causes the list to become a multi-form with use-row-submit so that completing the transfers can be done in bulk.

Modified:
    ofbiz/trunk/applications/product/config/ProductUiLabels.properties
    ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/FindFacilityTransfers.bsh
    ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml
    ofbiz/trunk/applications/product/webapp/facility/facility/FindFacilityTransfers.ftl

Modified: ofbiz/trunk/applications/product/config/ProductUiLabels.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/ProductUiLabels.properties?view=diff&rev=515693&r1=515692&r2=515693
==============================================================================
--- ofbiz/trunk/applications/product/config/ProductUiLabels.properties (original)
+++ ofbiz/trunk/applications/product/config/ProductUiLabels.properties Wed Mar  7 10:48:11 2007
@@ -395,6 +395,7 @@
 ProductCommissions=Commissions
 ProductComplete=Complete
 ProductCompleteForce=Force Complete
+ProductCompleteRequestedTransfers=Complete Requested Transfers
 ProductComments=Comments
 ProductCompanySubtitle=Part of the Open For Business Family of Open Source Software
 ProductCompareAtPrice=Compare At

Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/FindFacilityTransfers.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/FindFacilityTransfers.bsh?view=diff&rev=515693&r1=515692&r2=515693
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/FindFacilityTransfers.bsh (original)
+++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/FindFacilityTransfers.bsh Wed Mar  7 10:48:11 2007
@@ -36,8 +36,9 @@
 boolean activeOnly = !"false".equals(request.getParameter("activeOnly"));
 context.put("activeOnly", activeOnly);
 
-boolean useValues = true;
-if (request.getAttribute("_ERROR_MESSAGE_") != null) useValues = false;
+// if the completeRequested was set, then we'll lookup only requested status
+boolean completeRequested = "true".equals(request.getParameter("completeRequested"));
+context.put("completeRequested", completeRequested);
 
 // get the 'to' this facility transfers
 List exprsTo = null;
@@ -46,6 +47,9 @@
 } else {
     exprsTo = UtilMisc.toList(new EntityExpr("facilityIdTo", EntityOperator.EQUALS, facilityId));
 }
+if (completeRequested) {
+    exprsTo = UtilMisc.toList(new EntityExpr("facilityIdTo", EntityOperator.EQUALS, facilityId), new EntityExpr("statusId", EntityOperator.EQUALS, "IXF_REQUESTED"));
+}
 List toTransfers = delegator.findByAnd("InventoryTransfer", exprsTo, UtilMisc.toList("sendDate"));
 if (toTransfers != null) context.put("toTransfers", toTransfers);
 
@@ -55,6 +59,9 @@
     exprsFrom = UtilMisc.toList(new EntityExpr("facilityId", EntityOperator.EQUALS, facilityId), new EntityExpr("statusId", EntityOperator.NOT_EQUAL, "IXF_COMPLETE"), new EntityExpr("statusId", EntityOperator.NOT_EQUAL, "IXF_CANCELLED"));
 } else {
     exprsFrom = UtilMisc.toList(new EntityExpr("facilityId", EntityOperator.EQUALS, facilityId));
+}
+if (completeRequested) {
+    exprsFrom = UtilMisc.toList(new EntityExpr("facilityId", EntityOperator.EQUALS, facilityId), new EntityExpr("statusId", EntityOperator.EQUALS, "IXF_REQUESTED"));
 }
 List fromTransfers = delegator.findByAnd("InventoryTransfer", exprsFrom, UtilMisc.toList("sendDate"));
 if (fromTransfers != null) context.put("fromTransfers", fromTransfers);

Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml?view=diff&rev=515693&r1=515692&r2=515693
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml Wed Mar  7 10:48:11 2007
@@ -513,6 +513,12 @@
         <response name="success" type="view" value="FindFacilityTransfers"/>
         <response name="error" type="view" value="FindFacilityTransfers"/>
     </request-map>
+    <request-map uri="CompleteRequestedTransfers">
+        <security https="true" auth="true"/>
+        <event type="service-multi" path="" invoke="updateInventoryTransfer"/>
+        <response name="success" type="view" value="FindFacilityTransfers"/>
+        <response name="error" type="view" value="FindFacilityTransfers"/>
+    </request-map>
 
     <!-- ================ Inventory Receive Requests ================= -->
     <request-map uri="ReceiveInventory">

Modified: ofbiz/trunk/applications/product/webapp/facility/facility/FindFacilityTransfers.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/facility/FindFacilityTransfers.ftl?view=diff&rev=515693&r1=515692&r2=515693
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/facility/FindFacilityTransfers.ftl (original)
+++ ofbiz/trunk/applications/product/webapp/facility/facility/FindFacilityTransfers.ftl Wed Mar  7 10:48:11 2007
@@ -24,6 +24,7 @@
     <#else>
         <a href="<@o...@ofbizUrl>" class="buttontext">[${uiLabelMap.ProductActiveOnly}]</a>
     </#if>
+    <a href="<@o...@ofbizUrl>" class="buttontext">[${uiLabelMap.ProductCompleteRequestedTransfers}]</a>
     <a href="<@o...@ofbizUrl>" class="buttontext">[${uiLabelMap.ProductInventoryTransfer}]</a>
     
     <br/>
@@ -62,6 +63,9 @@
     </#if>
     
     <#if (fromTransfers.size() > 0)>
+    <#if completeRequested>
+    <form name="CompleteRequested" method="post" action="CompleteRequestedTransfers?completeRequested=true&facilityId=${facility.facilityId}">
+    </#if>
         <br/>
         <div class="head1">${uiLabelMap.CommonFrom}:<span class="head2">&nbsp;<#if facility?exists>${(facility.facilityName)?if_exists}</#if> [${uiLabelMap.CommonId}:${facilityId?if_exists}]</span></div>
         <table border="1" cellpadding="2" cellspacing="0" width="100%">
@@ -71,7 +75,13 @@
             <td><div class="tabletext"><b>${uiLabelMap.CommonTo}</b></div></td>
             <td><div class="tabletext"><b>${uiLabelMap.CommonSendDate}</b></div></td>
             <td><div class="tabletext"><b>${uiLabelMap.CommonStatus}</b></div></td>
-            <td>&nbsp;</td>
+            <td align="center">
+              <#if completeRequested>
+              <span class="tableheadtext">Select<br><input name="selectAll" value="Y" onclick="javascript:toggleAll(this, 'CompleteRequested');" type="checkbox"></span>
+              <#else>
+              &nbsp;
+              </#if>
+            </td>
             </tr>
         
             <#list fromTransfers as transfer>
@@ -89,8 +99,28 @@
                     <div class="tabletext">&nbsp;${(transferStatus.get("description",locale))?if_exists}</div>
                 </#if>
             </td>
-            <td align="center"><div class="tabletext"><a href="<@o...@ofbizUrl>" class="buttontext">[${uiLabelMap.CommonEdit}]</a></div></td>
+            <td align="center"><div class="tabletext">
+                <#if completeRequested>
+                <input type="hidden" name="inventoryTransferId_o_${transfer_index}" value="${transfer.inventoryTransferId}">
+                <input type="hidden" name="inventoryItemId_o_${transfer_index}" value="${transfer.inventoryItemId}">
+                <input type="hidden" name="statusId_o_${transfer_index}" value="IXF_COMPLETE">
+                <input name="_rowSubmit_o_${transfer_index}" value="Y" type="checkbox">
+                <#else>
+                <a href="<@o...@ofbizUrl>" class="buttontext">[${uiLabelMap.CommonEdit}]</a>
+                </#if>
+            </div></td>
             </tr>
+            <#assign rowCount = transfer_index + 1>
             </#list>
+            <#if completeRequested>
+            <tr><td colspan="6" align="right">
+                <input type="hidden" name="_rowCount" value="${rowCount}">
+                <input type="hidden" name="_useRowSubmit" value="Y"/>
+                <input type="submit" class="smallSubmit" value="${uiLabelMap.CommonUpdate}"/>
+            </td></tr>
+            </#if>
         </table>
+      <#if completeRequested>
+      </form>
+      </#if>
     </#if>