svn commit: r544779 - /ofbiz/branches/release4.0/applications/order/webapp/ordermgr/entry/catalog/keywordsearch.ftl

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

svn commit: r544779 - /ofbiz/branches/release4.0/applications/order/webapp/ordermgr/entry/catalog/keywordsearch.ftl

lektran
Author: lektran
Date: Wed Jun  6 02:38:24 2007
New Revision: 544779

URL: http://svn.apache.org/viewvc?view=rev&rev=544779
Log:
Applied fix from trunk for revision: 544429

Modified:
    ofbiz/branches/release4.0/applications/order/webapp/ordermgr/entry/catalog/keywordsearch.ftl

Modified: ofbiz/branches/release4.0/applications/order/webapp/ordermgr/entry/catalog/keywordsearch.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/release4.0/applications/order/webapp/ordermgr/entry/catalog/keywordsearch.ftl?view=diff&rev=544779&r1=544778&r2=544779
==============================================================================
--- ofbiz/branches/release4.0/applications/order/webapp/ordermgr/entry/catalog/keywordsearch.ftl (original)
+++ ofbiz/branches/release4.0/applications/order/webapp/ordermgr/entry/catalog/keywordsearch.ftl Wed Jun  6 02:38:24 2007
@@ -31,23 +31,23 @@
 <#if productIds?has_content>
     <div class="product-prevnext">
         <#-- Start Page Select Drop-Down -->
-        <#assign viewIndexMax = Static["java.lang.Math"].ceil(listSize?double / viewSize?double)>
+        <#assign viewIndexMax = Static["java.lang.Math"].ceil((listSize - 1)?double / viewSize?double)>
         <select name="pageSelect" class="selectBox" onchange="window.location=this[this.selectedIndex].value;">
-          <option value="#">${uiLabelMap.CommonPage} ${viewIndex?int + 1} ${uiLabelMap.CommonOf} ${viewIndexMax}</option>
-          <#list 1..viewIndexMax as curViewNum>
-            <option value="<@ofbizUrl>keywordsearch/~VIEW_INDEX=${curViewNum?int - 1}/~VIEW_SIZE=${viewSize}/~clearSearch=N</@ofbizUrl>">${uiLabelMap.CommonGotoPage} ${curViewNum}</option>
+          <option value="#">${uiLabelMap.CommonPage} ${viewIndex?int + 1} ${uiLabelMap.CommonOf} ${viewIndexMax + 1}</option>
+          <#list 0..viewIndexMax as curViewNum>
+            <option value="<@ofbizUrl>keywordsearch/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${curViewNum?int}/~clearSearch=N</@ofbizUrl>">${uiLabelMap.CommonGotoPage} ${curViewNum + 1}</option>
           </#list>
         </select>
         <#-- End Page Select Drop-Down -->
         <b>
-        <#if 0 < viewIndex?int>
-          <a href="<@ofbizUrl>keywordsearch/~VIEW_INDEX=${viewIndex-1}/~VIEW_SIZE=${viewSize}/~clearSearch=N</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonPrevious}</a> |
+        <#if (viewIndex?int > 0)>
+          <a href="<@ofbizUrl>keywordsearch/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${viewIndex?int - 1}/~clearSearch=N</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonPrevious}</a> |
         </#if>
-        <#if 0 < listSize?int>
+        <#if (listSize?int > 0)>
           <span class="tabletext">${lowIndex+1} - ${highIndex} ${uiLabelMap.CommonOf} ${listSize}</span>
         </#if>
         <#if highIndex?int < listSize?int>
-          | <a href="<@ofbizUrl>keywordsearch/~VIEW_INDEX=${viewIndex+1}/~VIEW_SIZE=${viewSize}/~clearSearch=N</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonNext}</a>
+          | <a href="<@ofbizUrl>keywordsearch/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${viewIndex+1}/~clearSearch=N</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonNext}</a>
         </#if>
         </b>
     </div>
@@ -66,23 +66,23 @@
 <#if productIds?has_content>
     <div class="product-prevnext">
         <#-- Start Page Select Drop-Down -->
-        <#assign viewIndexMax = Static["java.lang.Math"].ceil(listSize?double / viewSize?double)>
+        <#assign viewIndexMax = Static["java.lang.Math"].ceil((listSize - 1)?double / viewSize?double)>
         <select name="pageSelect" class="selectBox" onchange="window.location=this[this.selectedIndex].value;">
-          <option value="#">${uiLabelMap.CommonPage} ${viewIndex?int + 1} ${uiLabelMap.CommonOf} ${viewIndexMax}</option>
-          <#list 1..viewIndexMax as curViewNum>
-            <option value="<@ofbizUrl>keywordsearch/~VIEW_INDEX=${curViewNum?int - 1}/~VIEW_SIZE=${viewSize}/~clearSearch=N</@ofbizUrl>">${uiLabelMap.CommonGotoPage} ${curViewNum}</option>
+          <option value="#">${uiLabelMap.CommonPage} ${viewIndex?int + 1} ${uiLabelMap.CommonOf} ${viewIndexMax + 1}</option>
+          <#list 0..viewIndexMax as curViewNum>
+            <option value="<@ofbizUrl>keywordsearch/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${curViewNum?int}/~clearSearch=N</@ofbizUrl>">${uiLabelMap.CommonGotoPage} ${curViewNum + 1}</option>
           </#list>
         </select>
         <#-- End Page Select Drop-Down -->
         <b>
-        <#if 0 < viewIndex?int>
-          <a href="<@ofbizUrl>keywordsearch/~VIEW_INDEX=${viewIndex-1}/~VIEW_SIZE=${viewSize}/~clearSearch=N</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonPrevious}</a> |
+        <#if (viewIndex?int > 0)>
+          <a href="<@ofbizUrl>keywordsearch/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${viewIndex?int - 1}/~clearSearch=N</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonPrevious}</a> |
         </#if>
-        <#if 0 < listSize?int>
+        <#if (listSize?int > 0)>
           <span class="tabletext">${lowIndex+1} - ${highIndex} ${uiLabelMap.CommonOf} ${listSize}</span>
         </#if>
         <#if highIndex?int < listSize?int>
-          | <a href="<@ofbizUrl>keywordsearch/~VIEW_INDEX=${viewIndex+1}/~VIEW_SIZE=${viewSize}/~clearSearch=N</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonNext}</a>
+          | <a href="<@ofbizUrl>keywordsearch/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${viewIndex+1}/~clearSearch=N</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonNext}</a>
         </#if>
         </b>
     </div>