Author: jleroux
Date: Sat Oct 26 10:41:08 2013 New Revision: 1535963 URL: http://svn.apache.org/r1535963 Log: "Applied fix from trunk for revision: 1535961 " (conflicts handled by hand) ------------------------------------------------------------------------ r1535961 | jleroux | 2013-10-26 12:22:31 +0200 (sam. 26 oct. 2013) | 14 lignes Fixes "Pagination from category tree is flawed, and not only this pagination" https://issues.apache.org/jira/browse/OFBIZ-5372 It was already flawed in R10.04. If you click on the Gizmos node, the pagination page shows 3 pages when there should be only 2 and if you get to the page 3 it crashes. If you come from the breadcrumb the problem is the same. On the other hand, from R11.04 there is a "Popular Categories" section at top of the main screen, and from there it works correctly. But in this version the "Featured Products" pagination shows the same symptom than the category pagination. The "Featured Products" pagination works almost correctly from R12.04, but shows 2 pages when the second is useless and empty, at least no crashes! Note: This has no side effects on the same in order component Actually what we should do is to create an unique paginationControls macro but there are subtle differences and I'm afraid it would open a can of worms. I will though check... ------------------------------------------------------------------------ Modified: ofbiz/branches/release12.04/ (props changed) ofbiz/branches/release12.04/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/CategoryDetail.groovy ofbiz/branches/release12.04/applications/order/webapp/ordermgr/entry/catalog/categorydetail.ftl ofbiz/branches/release12.04/specialpurpose/ecommerce/webapp/ecommerce/shoppinglist/editShoppingList.ftl Propchange: ofbiz/branches/release12.04/ ------------------------------------------------------------------------------ Merged /ofbiz/trunk:r1535961 Modified: ofbiz/branches/release12.04/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/CategoryDetail.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/CategoryDetail.groovy?rev=1535963&r1=1535962&r2=1535963&view=diff ============================================================================== --- ofbiz/branches/release12.04/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/CategoryDetail.groovy (original) +++ ofbiz/branches/release12.04/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/CategoryDetail.groovy Sat Oct 26 10:41:08 2013 @@ -39,7 +39,7 @@ viewIndex = parameters.VIEW_INDEX; currentCatalogId = CatalogWorker.getCurrentCatalogId(request); // set the default view size -defaultViewSize = request.getAttribute("defaultViewSize") ?: 20; +defaultViewSize = request.getAttribute("defaultViewSize") ?: UtilProperties.getPropertyValue("widget", "widget.form.defaultViewSize", "20"); context.defaultViewSize = defaultViewSize; // set the limit view Modified: ofbiz/branches/release12.04/applications/order/webapp/ordermgr/entry/catalog/categorydetail.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/order/webapp/ordermgr/entry/catalog/categorydetail.ftl?rev=1535963&r1=1535962&r2=1535963&view=diff ============================================================================== --- ofbiz/branches/release12.04/applications/order/webapp/ordermgr/entry/catalog/categorydetail.ftl (original) +++ ofbiz/branches/release12.04/applications/order/webapp/ordermgr/entry/catalog/categorydetail.ftl Sat Oct 26 10:41:08 2013 @@ -44,29 +44,22 @@ under the License. <#assign viewIndexMax = Static["java.lang.Math"].ceil((listSize - 1)?double / viewSize?double)> <#if (viewIndexMax?int > 0)> <div class="product-prevnext"> - <#-- Start Page Select Drop-Down --> - <#-- select name="pageSelect" onchange="window.location=this[this.selectedIndex].value;"> - <option value="#">${uiLabelMap.CommonPage} ${viewIndex?int} ${uiLabelMap.CommonOf} ${viewIndexMax + 1}</option> - <#list 0..viewIndexMax as curViewNum> - <option value="<@ofbizCatalogAltUrl productCategoryId=productCategoryId viewSize=viewSize viewIndex=(curViewNum?int + 1)/>">${uiLabelMap.CommonGotoPage} ${curViewNum + 1}</option> - </#list> - </select --> <select name="pageSelect" onchange="callDocumentByPaginate(this[this.selectedIndex].value);"> - <option value="#">${uiLabelMap.CommonPage} ${viewIndex?int + 1} ${uiLabelMap.CommonOf} ${viewIndexMax + 1}</option> - <#list 0..viewIndexMax as curViewNum> - <option value="${productCategoryId}~${viewSize}~${curViewNum?int}">${uiLabelMap.CommonGotoPage} ${curViewNum + 1}</option> - </#list> + <option value="#">${uiLabelMap.CommonPage} ${viewIndex?int + 1} ${uiLabelMap.CommonOf} ${viewIndexMax}</option> + <#if (viewIndex?int > 1)> + <#list 0..viewIndexMax as curViewNum> + <option value="${productCategoryId}~${viewSize}~${curViewNum?int}">${uiLabelMap.CommonGotoPage} ${curViewNum + 1}</option> + </#list> + </#if> </select> <#-- End Page Select Drop-Down --> <#if (viewIndex?int > 0)> - <#-- a href="<@ofbizUrl>category/~category_id=${productCategoryId}/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${viewIndex?int - 1}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonPrevious}</a --> | <a href="javascript: void(0);" onclick="callDocumentByPaginate('${productCategoryId}~${viewSize}~${viewIndex?int - 1}');" class="buttontext">${uiLabelMap.CommonPrevious}</a> | </#if> <#if ((listSize?int - viewSize?int) > 0)> <span>${lowIndex} - ${highIndex} ${uiLabelMap.CommonOf} ${listSize}</span> </#if> <#if highIndex?int < listSize?int> - <#-- | <a href="<@ofbizUrl>category/~category_id=${productCategoryId}/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${viewIndex?int + 1}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonNext}</a --> | <a href="javascript: void(0);" onclick="callDocumentByPaginate('${productCategoryId}~${viewSize}~${viewIndex?int + 1}');" class="buttontext">${uiLabelMap.CommonNext}</a> </#if> </div> Modified: ofbiz/branches/release12.04/specialpurpose/ecommerce/webapp/ecommerce/shoppinglist/editShoppingList.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/specialpurpose/ecommerce/webapp/ecommerce/shoppinglist/editShoppingList.ftl?rev=1535963&r1=1535962&r2=1535963&view=diff ============================================================================== --- ofbiz/branches/release12.04/specialpurpose/ecommerce/webapp/ecommerce/shoppinglist/editShoppingList.ftl (original) +++ ofbiz/branches/release12.04/specialpurpose/ecommerce/webapp/ecommerce/shoppinglist/editShoppingList.ftl Sat Oct 26 10:41:08 2013 @@ -55,7 +55,7 @@ under the License. <br /> <#macro paginationControls> <#assign viewIndexMax = Static["java.lang.Math"].ceil((listSize)?double / viewSize?double)> - <#if (viewIndexMax?int >= 1)> + <#if (viewIndexMax?int > 0)> <div class="product-prevnext"> <#-- Start Page Select Drop-Down --> <select name="pageSelect" onchange="callDocumentByPaginate(this[this.selectedIndex].value);"> |
Free forum by Nabble | Edit this page |