[Koha-bugs] [Bug 14292] Add --category and --skip-category options to longoverdue.pl to include or exclude borrower categories.
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Mon Sep 28 14:10:51 CEST 2015
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14292
--- Comment #7 from Barton Chittenden <barton at bywatersolutions.com> ---
(In reply to Jonathan Druart from comment #4)
> Comment on attachment 42614 [details] [review]
> [SIGNED-OFF] Bug 14292: Add patron category restrictions to longoverdue.pl
>
> Review of attachment 42614 [details] [review]:
> -----------------------------------------------------------------
>
> ::: misc/cronjobs/longoverdue.pl
> @@ +52,5 @@
> > +GetOptions(
> > + 'lost=s%' => \$lost,
> > + 'c|charge=s' => \$charge,
> > + 'confirm' => \$confirm,
> > + 'verbose' => \$verbose,
>
> Doc says v|verbose
>
> @@ +56,5 @@
> > + 'verbose' => \$verbose,
> > + 'quiet' => \$quiet,
> > + 'maxdays=s' => \$endrange,
> > + 'mark-returned' => \$mark_returned,
> > + 'help' => \$help,
>
> Doc says h|help
>
> @@ +77,5 @@
> > +
> > + longoverdue.pl [ --help | -h | --man ]
> > + longoverdue.pl --lost | -l DAYS=LOST_CODE [ --charge | -c CHARGE_CODE ] [ --verbose | -v ] [ --quiet ]
> > + [ --maxdays MAX_DAYS ] [ --mark-returned ] [ --category BORROWER_CATEGOERY ] ...
> > + [ --skip-category BORROWER_CATEGOERY ] ... [ --commit ]
>
> Typo 'CATEGOERY'
>
Fixed v|verbose and h|help options, as well as 'BORROWER_CATEGOERY' typo.
I left the --category and --skip-category options as-is. I don't have a good
reason to keep them, but they're not hurting anything either; we can re-visit
if they cause confusion.
Changed 'die' to
> pod2usage({
> -exitval => 1,
> -msg => q|ERROR: No --lost (-l) option defined|,
> });
Removed borrower_categories_sth in favor of
my $dbh = C4::Context->dbh;
my @categories = map { uc $_->[0] } @{ $dbh->selectall_arrayref(q|SELECT
categorycode FROM categories|) };
> @@ +273,4 @@
> > #FIXME - Should add a 'system' user and get suitable userenv for it for logging, etc.
> >
> > my $count;
> > +# my @ranges = map {
>
> I would simply remove it :)
I wasn't clear about this comment, but I removed the #FIXME comment and the
# my @ranges = map {
statement, both of which seemed useless.
>
> @@ +294,5 @@
> > $sth_items->execute($startrange, $endrange, $lostvalue);
> > $count=0;
> > + ITEM: while (my $row=$sth_items->fetchrow_hashref) {
> > + if( $filter_borrower_categories ) {
> > + my $category = uc Koha::Database->new()->schema->resultset('Borrower')->find( $row->{borrowernumber} )->get_column('categorycode');
>
> Why don't you use Koha::Borrowers?
Done.
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list