Bugzilla – Attachment 167474 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: Update old occurrences of effective_BlockExpiredPatronOpacActions
Bug-36453-Update-old-occurrences-of-effectiveBlock.patch (text/plain), 7.38 KB, created by
Martin Renvoize (ashimema)
on 2024-06-05 16:08:54 UTC
(
hide
)
Description:
Bug 36453: Update old occurrences of effective_BlockExpiredPatronOpacActions
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-06-05 16:08:54 UTC
Size:
7.38 KB
patch
obsolete
>From 3a9a0314c8ba532960e075be7d253aa5a770aacb Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Tue, 26 Mar 2024 17:11:32 +0000 >Subject: [PATCH] Bug 36453: Update old occurrences of > effective_BlockExpiredPatronOpacActions > >Check for 'renew' when appropriate >Check for 'hold' when appropriate > >The following command must return nothing before this is pushed to >master: >git grep "\beffective_BlockExpiredPatronOpacActions\b" > >Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > C4/Circulation.pm | 2 +- > C4/ILSDI/Services.pm | 6 ++++-- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt | 8 ++++---- > opac/opac-renew.pl | 2 +- > opac/opac-reserve.pl | 2 +- > 5 files changed, 11 insertions(+), 9 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index bff0b1e2f56..d8b75fe8585 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -4668,7 +4668,7 @@ sub _CanBookBeAutoRenewed { > } > ); > >- if ( $patron->is_expired && $patron->category->effective_BlockExpiredPatronOpacActions ) { >+ if ( $patron->is_expired && $patron->category->effective_BlockExpiredPatronOpacActions_contains('renew') ) { > return 'auto_account_expired'; > } > >diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm >index ee776423a92..7d40c6b4d14 100644 >--- a/C4/ILSDI/Services.pm >+++ b/C4/ILSDI/Services.pm >@@ -751,7 +751,8 @@ sub HoldTitle { > return { code => 'PatronRestricted' } if $patron->is_debarred; > > # Check for patron expired, category and syspref settings >- return { code => 'PatronExpired' } if ($patron->category->effective_BlockExpiredPatronOpacActions && $patron->is_expired); >+ return { code => 'PatronExpired' } >+ if ( $patron->category->effective_BlockExpiredPatronOpacActions_contains('hold') && $patron->is_expired ); > > # Get the biblio record, or return an error code > my $biblionumber = $cgi->param('bib_id'); >@@ -855,7 +856,8 @@ sub HoldItem { > return { code => 'PatronRestricted' } if $patron->is_debarred; > > # Check for patron expired, category and syspref settings >- return { code => 'PatronExpired' } if ($patron->category->effective_BlockExpiredPatronOpacActions && $patron->is_expired); >+ return { code => 'PatronExpired' } >+ if ( $patron->category->effective_BlockExpiredPatronOpacActions_contains('hold') && $patron->is_expired ); > > # Get the biblio or return an error code > my $biblionumber = $cgi->param('bib_id'); >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >index b9be5c22c52..ae3d38e0456 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >@@ -342,7 +342,7 @@ > <th>Barcode</th> > [% END %] > <th>Call number</th> >- [% IF ( OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions ) ) %] >+ [% IF ( OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions_contains('renew') ) ) %] > <th>Renew</th> > [% END %] > [% IF ( OPACFinesTab ) %] >@@ -444,7 +444,7 @@ > <span class="tdlabel">Call number:</span> > [% ISSUE.itemcallnumber | html %] > </td> >- [% IF ( OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions ) ) %] >+ [% IF ( OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions_contains('renew') ) ) %] > [% IF ( ISSUE.status && canrenew ) %] > <td class="renew" data-order="[% ISSUE.renewsleft | html %]"> > [% ELSE %] >@@ -550,14 +550,14 @@ > [% END # /FOREACH ISSUES %] > </tbody> > </table> >- [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions ) ) %] >+ [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions_contains('renew') ) ) %] > <input type="submit" class="btn btn-primary d-print-none" value="Renew selected" /> > <input type="hidden" name="op" value="cud-renew" /> > <button type="button" id="renewall_js" class="btn btn-primary d-print-none">Renew all</button> > [% END %] > </form> > >- [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions ) ) %] >+ [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions_contains('renew') ) ) %] > <form id="renewall" class="js-hide" action="/cgi-bin/koha/opac-renew.pl" method="post"> > [% INCLUDE 'csrf-token.inc' %] > <legend class="sr-only">Renew</legend> >diff --git a/opac/opac-renew.pl b/opac/opac-renew.pl >index 078fbef2be4..cbee9c7a447 100755 >--- a/opac/opac-renew.pl >+++ b/opac/opac-renew.pl >@@ -51,7 +51,7 @@ my $renewed = q{}; > > my $patron = Koha::Patrons->find( $borrowernumber ); > >-if ( $patron->category->effective_BlockExpiredPatronOpacActions >+if ( $patron->category->effective_BlockExpiredPatronOpacActions_contains('renew') > && $patron->is_expired ) > { > $errorstring = 'card_expired'; >diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl >index bbc016cb794..002a7b13bfc 100755 >--- a/opac/opac-reserve.pl >+++ b/opac/opac-reserve.pl >@@ -113,7 +113,7 @@ if ( $#biblionumbers < 0 && $op ne 'cud-place_reserve' ) { > # > # > my $noreserves = 0; >-if ( $category->effective_BlockExpiredPatronOpacActions ) { >+if ( $category->effective_BlockExpiredPatronOpacActions_contains('hold') ) { > if ( $patron->is_expired ) { > # cannot reserve, their card has expired and the rules set mean this is not allowed > $noreserves = 1; >-- >2.45.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 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