Bugzilla – Attachment 164764 Details for
Bug 36453
BlockExpiredPatronOpacActions should allow multiple actions options
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36453: effective_BlockExpiredPatronOpacActions_contains method
Bug-36453-effectiveBlockExpiredPatronOpacActionsco.patch (text/plain), 2.69 KB, created by
Arthur Suzuki
on 2024-04-11 15:10:50 UTC
(
hide
)
Description:
Bug 36453: effective_BlockExpiredPatronOpacActions_contains method
Filename:
MIME Type:
Creator:
Arthur Suzuki
Created:
2024-04-11 15:10:50 UTC
Size:
2.69 KB
patch
obsolete
>From b0463abb62c3eeddc3c153b18eb7acb5a4862f9c Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Tue, 26 Mar 2024 17:12:49 +0000 >Subject: [PATCH] Bug 36453: effective_BlockExpiredPatronOpacActions_contains > method > >effective_BlockExpiredPatronOpacActions >is now >effective_BlockExpiredPatronOpacActions_contains > >This method has been updated to now consider an action param. >Returns true if the given action is to be blocked to expired >patrons or not. > >Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> >--- > Koha/Patron/Category.pm | 56 +++++++++++++++++++++++++++++++++++------ > 1 file changed, 49 insertions(+), 7 deletions(-) > >diff --git a/Koha/Patron/Category.pm b/Koha/Patron/Category.pm >index e24c8d6e79c..6d9841dd669 100644 >--- a/Koha/Patron/Category.pm >+++ b/Koha/Patron/Category.pm >@@ -36,18 +36,60 @@ Koha::Patron;;Category - Koha Patron;;Category Object class > > =cut > >-=head3 effective_BlockExpiredPatronOpacActions >+=head3 effective_BlockExpiredPatronOpacActions_contains > >-my $BlockExpiredPatronOpacActions = $category->effective_BlockExpiredPatronOpacActions >+my $actionBlocked = $category->effective_BlockExpiredPatronOpacActions_contains('hold'); > >-Return the effective BlockExpiredPatronOpacActions value. >+Return if the provided action is blocked by BlockExpiredPatronOpacActions, accounting for the syspref. >+ >+=over >+ >+=item action >+ >+Action, can be one of: ['hold', 'renew'] >+ >+=back > > =cut > >-sub effective_BlockExpiredPatronOpacActions { >- my( $self) = @_; >- return C4::Context->preference('BlockExpiredPatronOpacActions') if $self->BlockExpiredPatronOpacActions == -1; >- return $self->BlockExpiredPatronOpacActions >+sub effective_BlockExpiredPatronOpacActions_contains { >+ my ( $self, $action ) = @_; >+ >+ my $blocked_actions = { >+ map { ( $_, 1 ); } split /\s*\,\s*/, >+ C4::Context->preference('BlockExpiredPatronOpacActions') >+ }; >+ >+ return $blocked_actions->{$action} if $self->BlockExpiredPatronOpacActions_contains('follow_syspref_BlockExpiredPatronOpacActions'); >+ return $self->BlockExpiredPatronOpacActions_contains($action) >+} >+ >+=head3 BlockExpiredPatronOpacActions_contains >+ >+my $actionBlocked = $self->BlockExpiredPatronOpacActions_contains('hold'); >+ >+Return if the provided action is blocked by this category's BlockExpiredPatronOpacActions value. >+ >+=over >+ >+=item action >+ >+Action, can be one of: ['hold', 'renew'] >+ >+=back >+ >+=cut >+ >+sub BlockExpiredPatronOpacActions_contains { >+ my ( $self, $action ) = @_; >+ >+ my $blocked_actions = { >+ map { ( $_, 1 ); } split /\s*\,\s*/, >+ $self->BlockExpiredPatronOpacActions >+ }; >+ >+ return unless $blocked_actions->{$action}; >+ return 1; > } > > =head3 store >-- >2.30.2
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 36453
:
164042
|
164043
|
164044
|
164045
|
164046
|
164047
|
164048
|
164762
|
164763
|
164764
|
164765
|
164766
|
164767
|
164768
|
165413
|
165414
|
165454
|
167461
|
167462
|
167463
|
167464
|
167465
|
167466
|
167467
|
167468
|
167469
|
167470
|
167471
|
167472
|
167473
|
167474
|
167475
|
167476
|
167477
|
167478
|
167479
|
167480
|
168435
|
168436