svn commit: r447723 - in /incubator/ofbiz/trunk/applications/product/webapp/catalog: WEB-INF/controller.xml category/EditCategoryProducts.ftl

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r447723 - in /incubator/ofbiz/trunk/applications/product/webapp/catalog: WEB-INF/controller.xml category/EditCategoryProducts.ftl

jonesde
Author: jonesde
Date: Mon Sep 18 21:28:39 2006
New Revision: 447723

URL: http://svn.apache.org/viewvc?view=rev&rev=447723
Log:
Change category products page to use the multi submit instead of per-row submit

Modified:
    incubator/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml
    incubator/ofbiz/trunk/applications/product/webapp/catalog/category/EditCategoryProducts.ftl

Modified: incubator/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml?view=diff&rev=447723&r1=447722&r2=447723
==============================================================================
--- incubator/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml (original)
+++ incubator/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml Mon Sep 18 21:28:39 2006
@@ -226,7 +226,7 @@
     </request-map>
     <request-map uri="updateCategoryProductMember">
         <security https="true" auth="true"/>
-        <event type="service" path="" invoke="updateProductToCategory"/>
+        <event type="service-multi" path="" invoke="updateProductToCategory"/>
         <response name="success" type="view" value="EditCategoryProducts"/>
         <response name="error" type="view" value="EditCategoryProducts"/>
     </request-map>

Modified: incubator/ofbiz/trunk/applications/product/webapp/catalog/category/EditCategoryProducts.ftl
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/product/webapp/catalog/category/EditCategoryProducts.ftl?view=diff&rev=447723&r1=447722&r2=447723
==============================================================================
--- incubator/ofbiz/trunk/applications/product/webapp/catalog/category/EditCategoryProducts.ftl (original)
+++ incubator/ofbiz/trunk/applications/product/webapp/catalog/category/EditCategoryProducts.ftl Mon Sep 18 21:28:39 2006
@@ -15,9 +15,9 @@
 under the License.
 -->
     <#if activeOnly>
-        <a href="<@ofbizUrl>EditCategoryProducts?productCategoryId=${productCategoryId?if_exists}&activeOnly=false</@ofbizUrl>" class="buttontext">[${uiLabelMap.ProductActiveAndInactive}]</a>
+        <a href="<@ofbizUrl>EditCategoryProducts?productCategoryId=${productCategoryId?if_exists}&activeOnly=false</@ofbizUrl>" class="buttontext">${uiLabelMap.ProductActiveAndInactive}</a>
     <#else>
-        <a href="<@ofbizUrl>EditCategoryProducts?productCategoryId=${productCategoryId?if_exists}&activeOnly=true</@ofbizUrl>" class="buttontext">[${uiLabelMap.ProductActiveOnly}]</a>
+        <a href="<@ofbizUrl>EditCategoryProducts?productCategoryId=${productCategoryId?if_exists}&activeOnly=true</@ofbizUrl>" class="buttontext">${uiLabelMap.ProductActiveOnly}</a>
     </#if>    
     <#if productCategoryId?exists && productCategory?exists>
         <#if (listSize > 0)>
@@ -48,8 +48,11 @@
             <td><div class="tabletext"><b>&nbsp;</b></div></td>
         </tr>
         <#if (listSize > 0)>
-            <#assign line = 0>
-            <#list productCategoryMembers as productCategoryMember>
+          <form method="post" action="<@ofbizUrl>updateCategoryProductMember?VIEW_SIZE=${viewSize}&VIEW_INDEX=${viewIndex}</@ofbizUrl>" name="updateCategoryProductForm">
+          <input type="hidden" name="activeOnly" value="${activeOnly.toString()}">
+          <input type="hidden" name="productCategoryId" value="${productCategoryId?if_exists}">
+          <#list productCategoryMembers as productCategoryMember>
+            <#assign suffix = "_o_" + productCategoryMember_index>
             <#assign product = productCategoryMember.getRelatedOne("Product")>
             <#assign hasntStarted = false>
             <#if productCategoryMember.fromDate?exists && nowTimestamp.before(productCategoryMember.getTimestamp("fromDate"))><#assign hasntStarted = true></#if>
@@ -59,25 +62,27 @@
                 <td><a href="<@ofbizUrl>EditProduct?productId=${(productCategoryMember.productId)?if_exists}</@ofbizUrl>" class="buttontext"><#if product?exists>${(product.internalName)?if_exists}</#if> [${(productCategoryMember.productId)?if_exists}]</a></td>
                 <td><div class="tabletext"<#if hasntStarted> style="color: red;"</#if>>${(productCategoryMember.fromDate)?if_exists}</div></td>
                 <td align="center">
-                    <form method="post" action="<@ofbizUrl>updateCategoryProductMember?VIEW_SIZE=${viewSize}&VIEW_INDEX=${viewIndex}</@ofbizUrl>" name="lineForm${line}">
-                        <input type="hidden" name="activeOnly" value="${activeOnly.toString()}">
-                        <input type="hidden" name="productId" value="${(productCategoryMember.productId)?if_exists}">
-                        <input type="hidden" name="productCategoryId" value="${(productCategoryMember.productCategoryId)?if_exists}">
-                        <input type="hidden" name="fromDate" value="${(productCategoryMember.fromDate)?if_exists}">
-                        <input type="text" size="25" name="thruDate" value="${(productCategoryMember.thruDate)?if_exists}" class="inputBox" <#if hasExpired>style="color: red;"</#if>>
-                        <a href="javascript:call_cal(document.lineForm${line}.thruDate, '${(productCategoryMember.thruDate)?default(nowTimestamp?string)}');"><img src="/images/cal.gif" width="16" height="16" border="0" alt="Calendar"></a>
-                        <input type="text" size="5" name="sequenceNum" value="${(productCategoryMember.sequenceNum)?if_exists}" class="inputBox">
-                        <input type="text" size="5" name="quantity" value="${(productCategoryMember.quantity)?if_exists}" class="inputBox">
-                        <input type="submit" value="${uiLabelMap.CommonUpdate}" style="font-size: x-small;">
-                    </form>
+                    <input type="hidden" name="productId${suffix}" value="${(productCategoryMember.productId)?if_exists}">
+                    <input type="hidden" name="productCategoryId${suffix}" value="${(productCategoryMember.productCategoryId)?if_exists}">
+                    <input type="hidden" name="fromDate${suffix}" value="${(productCategoryMember.fromDate)?if_exists}">
+                    <input type="text" size="25" name="thruDate${suffix}" value="${(productCategoryMember.thruDate)?if_exists}" class="inputBox" <#if hasExpired>style="color: red;"</#if>>
+                    <a href="javascript:call_cal(document.updateCategoryProductForm.thruDate${suffix}, '${(productCategoryMember.thruDate)?default(nowTimestamp?string)}');"><img src="/images/cal.gif" width="16" height="16" border="0" alt="Calendar"></a>
+                    <input type="text" size="5" name="sequenceNum${suffix}" value="${(productCategoryMember.sequenceNum)?if_exists}" class="inputBox">
+                    <input type="text" size="5" name="quantity${suffix}" value="${(productCategoryMember.quantity)?if_exists}" class="inputBox">
                 </td>
                 <td align="center">
                 <a href="<@ofbizUrl>removeCategoryProductMember?VIEW_SIZE=${viewSize}&VIEW_INDEX=${viewIndex}&productId=${(productCategoryMember.productId)?if_exists}&productCategoryId=${(productCategoryMember.productCategoryId)?if_exists}&fromDate=${Static["org.ofbiz.base.util.UtilFormatOut"].encodeQueryValue((productCategoryMember.getTimestamp("fromDate").toString()))}&activeOnly=${activeOnly.toString()}</@ofbizUrl>" class="buttontext">
-                [${uiLabelMap.CommonDelete}]</a>
+                ${uiLabelMap.CommonDelete}</a>
                 </td>
             </tr>
-            <#assign line = line + 1>
-            </#list>
+          </#list>
+          <tr valign="middle">
+            <td colspan="4" align="center">
+              <input type="submit" value="${uiLabelMap.CommonUpdate}" style="font-size: x-small;">
+              <input type="hidden" value="${productCategoryMembers.size()}" name="_rowCount">
+            </td>
+          </tr>
+          </form>
         </#if>
         </table>