Bugzilla – Attachment 125391 Details for
Bug 29116
request.pl re-invents Koha::Patron::is_expired accessor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29116: Use a pre-existing accessor instead of reimplementing it
Bug-29116-Use-a-pre-existing-accessor-instead-of-r.patch (text/plain), 3.45 KB, created by
Fridolin Somers
on 2021-09-28 07:22:11 UTC
(
hide
)
Description:
Bug 29116: Use a pre-existing accessor instead of reimplementing it
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2021-09-28 07:22:11 UTC
Size:
3.45 KB
patch
obsolete
>From 623cc5614d6c3af5d54b228755f1415e46bdd312 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= <joonas.kylmala@iki.fi> >Date: Sun, 26 Sep 2021 16:09:20 +0000 >Subject: [PATCH] Bug 29116: Use a pre-existing accessor instead of > reimplementing it > >We can use the Koha::Patron::is_expired accessor instead of re-writing >it in request.pl. > >To test: > 1) Make that a warning is being shown with and without this patch > when placing a hold to an expired patron account > >Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> >--- > .../intranet-tmpl/prog/en/modules/reserve/request.tt | 6 +++--- > reserve/request.pl | 9 --------- > 2 files changed, 3 insertions(+), 12 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >index f54ac0d32a..665c3fce4c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -385,10 +385,10 @@ > </div> > [% END # /IF ( exceeded_maxreserves || ... %] > >- [% IF ( expiry || diffbranch || patron.is_debarred || ( amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') ) ) %] >+ [% IF ( patron.is_expired || diffbranch || patron.is_debarred || ( amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') ) ) %] > <div class="dialog message"> > <ul> >- [% IF ( expiry ) %] >+ [% IF ( patron.is_expired ) %] > <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a>: <strong>Account has expired</strong></li> > [% END %] > >@@ -405,7 +405,7 @@ > [% END %] > </ul> <!-- /.dialog.message --> > </div> >- [% END # /IF expiry || diffbranch ... %] >+ [% END # /IF patron.is_expired || diffbranch ... %] > > [% IF ( messageborrower ) %] > <div class="dialog alert"> >diff --git a/reserve/request.pl b/reserve/request.pl >index 6ab8ba7ac5..59ef1d79c7 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -204,14 +204,6 @@ if ($borrowernumber_hold && !$action) { > ); > } > >- # we check the date expiry of the borrower (only if there is an expiry date, otherwise, set to 1 (warn) >- my $expiry_date = $patron->dateexpiry; >- my $expiry = 0; # flag set if patron account has expired >- if ($expiry_date and >- Date_to_Days(split /-/,$date) > Date_to_Days(split /-/,$expiry_date)) { >- $expiry = 1; >- } >- > # check if the borrower make the reserv in a different branch > if ( $patron->branchcode ne C4::Context->userenv->{'branch'} ) { > $diffbranch = 1; >@@ -220,7 +212,6 @@ if ($borrowernumber_hold && !$action) { > my $amount_outstanding = $patron->account->balance; > $template->param( > patron => $patron, >- expiry => $expiry, > diffbranch => $diffbranch, > messages => $messages, > warnings => $warnings, >-- >2.32.0
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 29116
:
125341
|
125391
|
125860