This patch introduces a method to determine for a given category if
patrons belonging to it override OpacHiddenItems policies.
To test:
- Apply the patches
- Run:
$ kshell
k$ prove t/db_dependent/Koha/Patron/Category.t
=> SUCCESS: Tests pass!
- Sign off :-D
Signed-off-by: Bin Wen <bin.wen@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
use Modern::Perl;
use Carp;
+use List::MoreUtils qw(any);
use C4::Members::Messaging;
: C4::Context->preference('OpacPasswordChange');
}
+=head3 override_hidden_items
+
+ if ( $patron->category->override_hidden_items ) {
+ ...
+ }
+
+Returns a boolean that if patrons of this category are exempt from the OPACHiddenItems policies
+
+TODO: Remove on bug 22547
+
+=cut
+
+sub override_hidden_items {
+ my ($self) = @_;
+ return any { $_ eq $self->categorycode }
+ split( /\|/, C4::Context->preference('OpacHiddenItemsExceptions') );
+}
+
=head2 Internal methods
=head3 type