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.
Signed-off-by: The Minh Luong <the-minh.luong@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 278b8b2d97)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
This commit is contained in:
parent
82391bb604
commit
78dbe4ada5
|
|
@ -27,6 +27,7 @@ use C4::Auth;
|
|||
use C4::Debug;
|
||||
use Text::CSV_XS;
|
||||
use Koha::DateUtils;
|
||||
use Koha::Patron::Attribute::Types;
|
||||
use DateTime;
|
||||
use DateTime::Format::MySQL;
|
||||
|
||||
|
|
@ -120,13 +121,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} || [ '' ];
|
||||
|
|
|
|||
Loading…
Reference in New Issue