From 95f77ac90c5917fcc3e288be28aa1445773f6ba5 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 8 Dec 2011 10:22:07 -0500 Subject: [PATCH] [Signed Off] Bug 7337 - "Debarred Until" display in the opac tells patrons they are debarred until the year 9999 Content-Type: text/plain; charset="utf-8" This patch copies the debarred handling method from circulation.pl for use on opac-user.pl so that debarred dates and comments can be handled properly. I have slightly reworded the message in the OPAC and on circulation.pl to make the display of the debarred comment a little clearer. Signed-off-by: Liz Rea I like this change, nice fix for the bug. Thanks! --- .../prog/en/modules/circ/circulation.tt | 4 ++-- koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt | 4 ++-- opac/opac-user.pl | 12 ++++++++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index 5627109..e3200ca 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -565,12 +565,12 @@ No patron matched [% message %] [% IF ( userdebarred ) %]
  • - Restricted: Patron's account is restricted [% IF (userdebarreddate ) %] until [% userdebarreddate %] [% END %] [% IF (debarredcomment ) %]([% debarredcomment %])[% END %] + Restricted: Patron's account is restricted [% IF (userdebarreddate ) %] until [% userdebarreddate %] [% END %] [% IF (debarredcomment ) %] with the comment "[% debarredcomment %]"[% END %]
    - +
  • [% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt index 0971f46..b16936c 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt @@ -92,8 +92,8 @@ $.tablesorter.addParser({ [% IF ( BORROWER_INF.flagged ) %]
      - [% IF ( BORROWER_INF.debarred ) %] -
    • Please note: Your account has been frozen until [% BORROWER_INF.debarred %] - [% BORROWER_INF.debarredcomment %]. Usually the reason for freezing an account is old overdues or damage fees.If your account page shows your account to be clear, please contact the library.
    • + [% IF ( BORROWER_INF.userdebarred ) %] +
    • Please note: Your account has been frozen[% IF ( BORROWER_INF.userdebarreddate ) %] until [% BORROWER_INF.userdebarreddate %][% END %][% IF ( BORROWER_INF.debarredcomment ) %] with the comment "[% BORROWER_INF.debarredcomment %]"[% END %]. Usually the reason for freezing an account is old overdues or damage fees. If your account page shows your account to be clear, please contact the library.
    • [% END %] [% IF ( BORROWER_INF.gonenoaddress ) %]
    • Please note: According to our records, we don't have up-to-date [% UNLESS ( BORROWER_INF.OPACPatronDetails ) %]contact information[% ELSE %]contact information[% END %] on file. Please contact the library[% IF ( BORROWER_INF.OPACPatronDetails ) %] or use the online update form to submit current information (Please note: there may be a delay in restoring your account if you submit online)[% END %].
    • diff --git a/opac/opac-user.pl b/opac/opac-user.pl index 9806c9f..3b9aa45 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -30,6 +30,7 @@ use C4::Members; use C4::Members::AttributeTypes; use C4::Members::Attributes qw/GetBorrowerAttributeValue/; use C4::Output; +use C4::Overdues qw/CheckBorrowerDebarred/; use C4::Biblio; use C4::Items; use C4::Dates qw/format_date/; @@ -78,7 +79,15 @@ for (qw(dateenrolled dateexpiry dateofbirth)) { } $borr->{'ethnicity'} = fixEthnicity( $borr->{'ethnicity'} ); -if ( $borr->{'debarred'} || $borr->{'gonenoaddress'} || $borr->{'lost'} ) { +my $debar = CheckBorrowerDebarred($borrowernumber); +if ($debar) { + $borr->{'userdebarred'} = 1; + if ( $debar ne "9999-12-31" ) { + $borr->{'userdebarreddate'} = C4::Dates::format_date($debar); + } +} + +if ( $borr->{'userdebarred'} || $borr->{'gonenoaddress'} || $borr->{'lost'} ) { $borr->{'flagged'} = 1; } @@ -104,7 +113,6 @@ if ( $borr->{'amountoutstanding'} < 0 ) { } $borr->{'amountoutstanding'} = sprintf "%.02f", $borr->{'amountoutstanding'}; -$borr->{'debarred'} = C4::Dates->new($borr->{'debarred'},'iso')->output; my @bordat; $bordat[0] = $borr; -- 1.7.2.5