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