Bugzilla – Attachment 123970 Details for
Bug 11750
Overdue report does not limit patron attributes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11750: Hide patron's attributes on overdue list if needed
Bug-11750-Hide-patrons-attributes-on-overdue-list-.patch (text/plain), 2.19 KB, created by
Jonathan Druart
on 2021-08-19 12:05:41 UTC
(
hide
)
Description:
Bug 11750: Hide patron's attributes on overdue list if needed
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-08-19 12:05:41 UTC
Size:
2.19 KB
patch
obsolete
>From 354c4065125f8bb1d95fa26775d6f434ee45319e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 19 Aug 2021 14:01:17 +0200 >Subject: [PATCH] Bug 11750: Hide patron's attributes on overdue list if needed > >If a patron's attributes is limited to some libraries, we must apply >this limit on the overdue list view. > >Test plan: >1. Create the following patron attributes: >A that is not searchable >B is searchable and does not have library limitation >C is searchable and is limited to another library than yours >2. On the right part of the overdue list view you must see B only >Without this patch C is displayed as well. >--- > circ/overdue.pl | 23 +++++++++++++++++------ > 1 file changed, 17 insertions(+), 6 deletions(-) > >diff --git a/circ/overdue.pl b/circ/overdue.pl >index b8ed200b527..24468d436c3 100755 >--- a/circ/overdue.pl >+++ b/circ/overdue.pl >@@ -26,6 +26,7 @@ use CGI qw(-oldstyle_urls -utf8); > use C4::Auth qw( get_template_and_user ); > use Text::CSV_XS; > use Koha::DateUtils qw( dt_from_string output_pref ); >+use Koha::Patron::Attribute::Types; > use DateTime; > use DateTime::Format::MySQL; > >@@ -117,13 +118,23 @@ my $have_pattr_filter_data = keys(%cgi_attrcode_to_attrvalues) > 0; > > my @patron_attr_filter_loop; # array of [ domid cgivalue ismany isclone ordinal code description repeatable authorised_value_category ] > >-my $sth = $dbh->prepare('SELECT code,description,repeatable,authorised_value_category >- FROM borrower_attribute_types >- WHERE staff_searchable <> 0 >- ORDER BY description'); >-$sth->execute(); >+my $patron_attrs = Koha::Patron::Attribute::Types->search_with_library_limits( >+ { >+ staff_searchable => 1, >+ }, >+ {}, >+ C4::Context->userenv->{'branch'} >+); >+ > my $ordinal = 0; >-while (my $row = $sth->fetchrow_hashref) { >+while (my $attr = $patron_attrs->next ) { >+ warn $attr->code; >+ my $row = { >+ code => $attr->code, >+ description => $attr->description, >+ repeatable => $attr->repeatable, >+ authorised_value_category => $attr->authorised_value_category, >+ }; > $row->{ordinal} = $ordinal; > my $code = $row->{code}; > my $cgivalues = $cgi_attrcode_to_attrvalues{$code} || [ '' ]; >-- >2.25.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 11750
:
123970
|
129221
|
129222