Bugzilla – Attachment 144828 Details for
Bug 32373
Show date of restriction on patron screen
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32373: Show patron restriction date
Bug-32373-Show-patron-restriction-date.patch (text/plain), 4.04 KB, created by
David Nind
on 2022-12-23 19:56:30 UTC
(
hide
)
Description:
Bug 32373: Show patron restriction date
Filename:
MIME Type:
Creator:
David Nind
Created:
2022-12-23 19:56:30 UTC
Size:
4.04 KB
patch
obsolete
>From f7278605be83bd499a5a7e20022574b93e2ca904 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Thu, 22 Dec 2022 15:22:24 +0000 >Subject: [PATCH] Bug 32373: Show patron restriction date > >When viewing a patron account with a restriction there is no way to see when the restriction was placed. This is available in the borrower_debarrments table and has now been added to the UI and matched to the 'dateformat' syspref. (Previous commit missed the moremember.tt render and the syspref formatting) > >Test plan: >1) Create a restriction on a patron and navigate to that patron in Checkouts or the patron details page >2) There should be a message with details about the restriction but the creation date of the restriction won't be included in the message >3) Apply patch >4) The message should now say "Restricted since DATE" as in the screenshot attached. >5) Change the 'dateformat' syspref and refresh, the date should change to reflect the syspref > >Signed-off-by: David Nind <david@davidnind.com> >--- > circ/circulation.pl | 7 ++++++- > .../intranet-tmpl/prog/en/includes/patron_messages.inc | 2 +- > members/moremember.pl | 7 ++++++- > 3 files changed, 13 insertions(+), 3 deletions(-) > >diff --git a/circ/circulation.pl b/circ/circulation.pl >index b7270bfe56..42caeb15a3 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -45,7 +45,7 @@ use Koha::AuthorisedValues; > use Koha::CsvProfiles; > use Koha::Patrons; > use Koha::Patron::Debarments qw( GetDebarments ); >-use Koha::DateUtils qw( dt_from_string ); >+use Koha::DateUtils qw( dt_from_string format_sqldatetime ); > use Koha::Patron::Restriction::Types; > use Koha::Plugins; > use Koha::Database; >@@ -265,10 +265,15 @@ if ($patron) { > finetotal => $balance, > ); > >+ my $debarrment = @{ GetDebarments( { borrowernumber => $borrowernumber } ) }[0] || undef; >+ my $dateformatted = format_sqldatetime( $debarrment->{created} ) if $debarrment; >+ my $debarrmentdate = substr($dateformatted, 0, 10) if $debarrment; >+ > if ( $patron and $patron->is_debarred ) { > $template->param( > 'userdebarred' => $patron->debarred, > 'debarredcomment' => $patron->debarredcomment, >+ 'debarredsince' => $debarrmentdate > ); > > if ( $patron->debarred ne "9999-12-31" ) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc >index db9c3430fc..a72932b62c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc >@@ -58,7 +58,7 @@ > > [% IF ( userdebarred ) %] > <li class="userdebarred blocker"> >- <span class="circ-hlt"> Restricted:</span> Patron's account is restricted >+ <span class="circ-hlt"> Restricted since [% debarredsince %]:</span> Patron's account is restricted > > [% IF ( userdebarreddate ) %] > until [% userdebarreddate | $KohaDates %] >diff --git a/members/moremember.pl b/members/moremember.pl >index 0523d02831..13003a02ce 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -45,6 +45,7 @@ use Koha::Patrons; > use Koha::Patron::Files; > use Koha::Token; > use Koha::Checkouts; >+use Koha::DateUtils qw( format_sqldatetime ); > > my $input = CGI->new; > >@@ -85,10 +86,14 @@ $template->param( > ); > > if ( $patron->is_debarred ) { >+ my $debarrment = @{ GetDebarments( { borrowernumber => $borrowernumber } ) }[0] || undef; >+ my $dateformatted = format_sqldatetime( $debarrment->{created} ); >+ my $debarrmentdate = substr($dateformatted, 0, 10); > $template->param( >- 'debarments' => scalar GetDebarments({ borrowernumber => $borrowernumber }), >+ 'debarments' => scalar $debarrment, > 'userdebarred' => $patron->debarred, > 'debarredcomment' => $patron->debarredcomment, >+ 'debarredsince' => $debarrmentdate > ); > > if ( $patron->debarred ne "9999-12-31" ) { >-- >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 32373
:
144337
|
144796
|
144797
|
144807
|
144813
|
144815
|
144828
|
144931
|
144942
|
144943
|
144944
|
146693
|
147230
|
147763
|
147764