Bug 14292: Add patron category restrictions to longoverdue.pl
authorBarton Chittenden <barton@bywatersolutins.com>
Mon, 31 Aug 2015 15:42:32 +0000 (08:42 -0700)
committerKyle M Hall <kyle@bywatersolutions.com>
Thu, 31 Dec 2015 14:56:34 +0000 (14:56 +0000)
commit8de21a52ce828c87dc9f24be23f5ed21eb1a5f8b
tree1d2a17c4a97b6d910b8583cbfa4a71936f7e2881
parent19e3e89df8943fac07182ddae8d82ae8e5f39f26
Bug 14292: Add patron category restrictions to longoverdue.pl

Squashed prevoius patch set.

Add command line options --category and --skip-category

Convert usage() to pod2usage. (This was previous FIXME)

Make borrower category handling more user friendly:

    Make --category and --skip-category mutally exclusive

    Check that categories specified by --category
    and --skip-category exist in categories table.

    Add --list-categories opttion to show available
    borrower categories.

http://bugs.koha-community.org/show_bug.cgi?id=14292

QA Follow-up

QA fixes - wording and trailing whitespaces

Simplify the category list

Basically we have 3 lists of categories:
1/ The full one, in the DB
2/ The one we want and list with --category
3/ The one we don't want and list with --skip-category

The list of categories to process is:
 * 1 if none --category or --skip-category options are provided
 * 2 if --category is provided
 * 1 - 3 if --skip-category is provided

(follow-up) Make --category and --skip-category case insensitive

"my" variable $borrower_category masks earlier declaration in same scope
"my" variable $skip_borrower_category masks earlier declaration in same scope

Signed-off-by: hbraum@nekls.org
Signed-off-by: Barton Chittenden <barton@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
misc/cronjobs/longoverdue.pl