Bug 9451: Quiet warnings and Plackify borrower_stats.pl

There are several warnings and one non-Plack-compatible variable in
reports/borrower_stats.pl.

To test:
1) Apply patch
2) Use the borrower report wizard to create a report that includes an
   extended patron attribute.
3) Check the logs, and make sure that you don't see any of the
   following messages:
   Variable "$period" is not available at
     /home/jcamins/kohaclone/reports/borrowers_stats.pl line 265.
   Use of uninitialized value in hash element at
     /home/jcamins/kohaclone/reports/borrowers_stats.pl line 375.
   Use of uninitialized value in hash element at
     /home/jcamins/kohaclone/reports/borrowers_stats.pl line 376.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_9451' into 3.12-master
Bug 9320 Pending reserves report should not show waiting items

    Test plan : * chose an item reserved by multiple patrons.
                * return the item and confirm reservation =>
                  item is waiting to be picked up
                * run circ/pendingreserves.pl
                    => without patch, this item is shown in the list
                    => with the patch, only really available items are show.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Works according to test plan. The title with one waiting item appeared
in pending holds report before the patch, doesn't appear after the
patch.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_9320' into 3.12-master
Bug 9329: Wrong message for already expired cards

Previously users would see the same message whether their card was about
to expire or was already expired. This patch adds a new message to
handle cards which are about to expire, following the
NotifyBorrowerDeparture system preference.

TEST PLAN :

The best way to test would to have at the same time :
- a SQL client to change the expiry date of a borrower
- an OPAC session opened for the same patron.

Case 1: expiry date is set in the future
-> no warning

Case 2: expiry date is set in the near future (within the
"NotifyBorrowerDeparture" system preference range)
-> a warning says the card will expire on **date**

Case 3: expiry date is set in the past
-> before patch, same warning as Case 2
-> after patch, new warning indicating that the card has expired

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Added description to the patch and copied test plan from the bug report.
Patch passes test plan.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_9329' into 3.12-master
Bug 9332: Display call number in "Holds waiting" notice

When checking out from a patron page, a notice "Holds waiting" appears
if a biblio (on hold) is waiting for this borrower.
This patch adds the call number information to this warning.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Nice little improvement, thanks.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_9332' into 3.12-master
Bug 9417 - Allow number of results per page to be selectable for guided reports

This patch adds the ability to select the number of row to show per page while
retaining the default rows per page as 20.

Test Plan:
1) Apply patch
2) Run a guided report that will have many resultant rows
3) Try the various rows per page options
4) Verify the rows per page selected is retained when paging through results

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_9417' into 3.12-master
Bug 9283 - Change structure of export checkouts form

This patch changes the structure of the export checkouts form
so that it is a little more linear. This change moves generation of the
export options from JavaScript to the markup, eliminating an instance
of dependence on YUI menus.

To test, enable checkout exports by specifying a value for
ExportWithCsvProfile or  ExportRemoveFields. Load a patron with
checkouts in circulation. Try the various checkout export options. Each
should function correctly.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_9283' into 3.12-master
Bug 9392: confirmation does not appear for negative notforloan items issues

When checking-out an item marked "not for loan" with a positive value,
you get a message to forbid or confirm issue (depending on
AllowNotForLoanOverride syspref).  For an item with a negative value
(usually during acquisition process), the issue is made without forbid
or confirm message.

This patch simply changes the test notforloan > 0 into notforloan != 0.

Test plan :
- Checkout an item with items.notforloan = 0
=> The item is issued without message
- Checkout an item with items.notforloan > 0
=> A message forbids or asks confirmation to override
- Checkout an item with items.notforloan < 0 (e.g., on order)
=> A message forbids or asks confirmation to override

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Checked with AllowNotForLoanOverride on and off.
All tests and QA script pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_9392' into 3.12-master
Bug 9380 - branch not recording right on writeoff

Test Plan:
1) Write off fines as various branches
2) Observe the stats lines include the wrong branchcode
3) Apply patch
4) Repeate step 1
5) Observe the stats lines include the correct branchcode

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>

Also tested by changing branch and writing off again - all
tests pass.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Checked individual and complete write off for different branches.
Write offs were always recorded correctly for the logged in branch.
All tests and QA script pas.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_9380' into 3.12-master
Bug 9222: manual history reversed in subscription-detail.pl

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_9222' into 3.12-master