Login  Register

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

Posted by Ray Barlow on Jun 11, 2007; 9:26pm
URL: http://ofbiz.116.s1.nabble.com/Re-svn-commit-r544779-ofbiz-branches-release4-0-applications-order-webapp-ordermgr-entry-catalog-keyl-tp181781.html

I tested this on the release branch when I committed it to the trunk and
I couldn't reproduce the bug this fixes so I didn't apply it to the
release branch. I'm guessing the underlying change that caused the bug
was introduced after the branch so this should be reverted as the
release branch now has the wrong page details for search results.

Ray


[hidden email] wrote:

> 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>
>
>
>
>