"Applied fix from trunk for revision: 1550201" (actually merged and tested by hand)
------------------------------------------------------------------------
r1550201 | jleroux | 2013-12-11 18:48:37 +0100 (mer. 11 déc. 2013) | 20 lignes

A patch from Gareth Carter for "htmlFormMacroLibrary.ftl renderNextPrev does not calculate number of pages correctly" https://issues.apache.org/jira/browse/OFBIZ-5422

There are 2 issues with the existing code.
1 - floor is applied to viewSize only not the computed value
2 - if the listSize divides with viewSize evenly, you'll get one extra
eg
24/2=12 - no of pages = 13
24/5=4.8 - no of pages = 5

Change to correctly calculate the number of pages using ceiling rather than floor

To repoduce this I went into find party screen, search for all and manually set the view size (I had to click next and change the VIEW_SIZE parameter in the url).

In my description I mention 24/2=12 and 24/5=4.8,
24 is number of parties I had
2/5 is the view size

It does not matter what the item size is (as long as its more than 0), you just have to make sure listSize divides by viewSize evenly. In my case 24/2 divided evenly and which should have have given 12 pages but gave 13.


------------------------------------------------------------------------


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/branches/release11.04@1550210 13f79535-47bb-0310-9956-ffa450edef68