Bugzilla – Attachment 90040 Details for
Bug 20436
Add ability to specify itemtypes for longoverdue.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20436: (RM follow-up) Use Koha objects instead of mysql
Bug-20436-RM-follow-up-Use-Koha-objects-instead-of.patch (text/plain), 2.39 KB, created by
Martin Renvoize
on 2019-05-23 15:40:24 UTC
(
hide
)
Description:
Bug 20436: (RM follow-up) Use Koha objects instead of mysql
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2019-05-23 15:40:24 UTC
Size:
2.39 KB
patch
obsolete
>From 3dbf00c455a7d1fd3a0ca16b4a4acaf8bfda3b6a Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 22 May 2019 14:26:41 +0000 >Subject: [PATCH] Bug 20436: (RM follow-up) Use Koha objects instead of mysql > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > misc/cronjobs/longoverdue.pl | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > >diff --git a/misc/cronjobs/longoverdue.pl b/misc/cronjobs/longoverdue.pl >index 3bda469ae8..754cb62698 100755 >--- a/misc/cronjobs/longoverdue.pl >+++ b/misc/cronjobs/longoverdue.pl >@@ -42,6 +42,8 @@ use Getopt::Long; > use C4::Log; > use Pod::Usage; > use Koha::Patrons; >+use Koha::Patron::Categories; >+use Koha::ItemTypes; > > my $lost; # key=lost value, value=num days. > my ($charge, $verbose, $confirm, $quiet); >@@ -103,13 +105,14 @@ if ( scalar @$itemtype && scalar @$skip_itemtype) { > } > > if ( $list_categories ) { >- my @categories = sort map { uc $_->[0] } @{ C4::Context->dbh->selectall_arrayref(q|SELECT categorycode FROM categories|) }; >+ >+ my @categories = Koha::Patron::Categories->search()->get_column('categorycode'); > print "\nBorrower Categories: " . join( " ", @categories ) . "\n\n"; > exit 0; > } > > if ( $list_itemtypes ) { >- my @itemtypes = sort map { uc $_->[0] } @{ C4::Context->dbh->selectall_arrayref(q|SELECT itemtype FROM itemtypes|) }; >+ my @itemtypes = Koha::ItemTypes->search()->get_column('itemtype'); > print "\nItemtypes: " . join( " ", @itemtypes ) . "\n\n"; > exit 0; > } >@@ -293,7 +296,7 @@ sub longoverdue_sth { > > my $dbh = C4::Context->dbh; > >-my @available_categories = map { uc $_->[0] } @{ $dbh->selectall_arrayref(q|SELECT categorycode FROM categories|) }; >+my @available_categories = Koha::Patron::Categories->search()->get_column('categorycode'); > $borrower_category = [ map { uc $_ } @$borrower_category ]; > $skip_borrower_category = [ map { uc $_} @$skip_borrower_category ]; > my %category_to_process; >@@ -321,7 +324,7 @@ if ( @$skip_borrower_category ) { > > my $filter_borrower_categories = ( scalar @$borrower_category || scalar @$skip_borrower_category ); > >-my @available_itemtypes = map { uc $_->[0] } @{ $dbh->selectall_arrayref(q|SELECT itemtype FROM itemtypes|) }; >+my @available_itemtypes = Koha::ItemTypes->search()->get_column('itemtype'); > $itemtype = [ map { uc $_ } @$itemtype ]; > $skip_itemtype = [ map { uc $_} @$skip_itemtype ]; > my %itemtype_to_process; >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20436
:
73026
|
80984
|
81024
|
86983
|
86984
|
89304
|
89305
|
89962
| 90040