From 6aafb803f3d47ff7ec5f08e7b1a584ba1a18eb28 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 22 May 2014 14:38:33 +0300 Subject: [PATCH] [PASSED QA] Bug 643: Allow override of 'debarred' status Add a button to temporarily override patron debarment. To test: 1) Go to patron check out page 2) If patron has been debarred (eg. due to having fees), there is no way to check out to that patron. 3) Apply patch 4) A debarred patron check out page now has a button for "Override debarment temporarily" - clicking on it should allow checking out to that patron. Signed-off-by: Aleisha Rebased because patch did not apply Signed-off-by: Aleisha Signed-off-by: Nick Clemens Signed-off-by: Katrin Fischer Tested with/without force_checkout and superlibrarian permission. Also checked crafting a URL is no longer working. No regressions found. --- circ/circulation.pl | 18 +++++++++++++--- .../prog/en/modules/circ/circulation.tt | 25 ++++++++++++++++++++++ 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 8f79f71..131c8b0 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -97,6 +97,16 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user ( my $branches = GetBranches(); +my $force_allow_issue = $query->param('forceallow') || 0; + +my @failedrenews = $query->param('failedrenew'); # expected to be itemnumbers +our %renew_failed = (); +for (@failedrenews) { $renew_failed{$_} = 1; } + +my @failedreturns = $query->param('failedreturn'); +our %return_failed = (); +for (@failedreturns) { $return_failed{$_} = 1; } + my $findborrower = $query->param('findborrower') || q{}; $findborrower =~ s|,| |g; my $borrowernumber = $query->param('borrowernumber'); @@ -235,7 +245,8 @@ if ($borrowernumber) { #borrowercard expired, no issues $template->param( flagged => "1", - noissues => "1", + noissues => ($force_allow_issue) ? 0 : "1", + forceallow => $force_allow_issue, expired => "1", renewaldate => format_date("$renew_year-$renew_month-$renew_day") ); @@ -328,7 +339,7 @@ if ($barcode) { ); $blocker = 1; } - if( !$blocker ){ + if( !$blocker || $force_allow_issue ){ my $confirm_required = 0; unless($issueconfirmed){ # Get the item title for more information @@ -400,7 +411,8 @@ foreach my $flag ( sort keys %$flags ) { $flags->{$flag}->{'message'} =~ s#\n#
#g; if ( $flags->{$flag}->{'noissues'} ) { $template->param( - noissues => 'true', + noissues => ($force_allow_issue) ? 0 : 'true', + forceallow => $force_allow_issue, ); if ( $flag eq 'GNA' ) { $template->param( gna => 'true' ); 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 fc61059..8bd3f3c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -250,6 +250,8 @@ $(document).ready(function() { [% IF CAN_user_circulate_force_checkout or HIGHHOLDS %]
+[% IF (forceallow) %][% END %] + [% IF ( RESERVED ) %]

@@ -289,6 +291,7 @@ $(document).ready(function() { [% END %] + [% IF (forceallow) %][% END %] @@ -338,6 +341,7 @@ $(document).ready(function() { [% FOREACH book IN options %]
+ [% IF (forceallow) %][% END %] @@ -414,11 +418,20 @@ $(document).ready(function() { [% END %] + [% IF (forceallow) %] +

  • Debarment overridden temporarily
  • + [% END %] + [% ELSE %] [% IF ( soundon ) %] [% END %] + + [% IF (forceallow) %] +
    Debarment overridden temporarily
    + [% END %] + [% END %] [% IF ( issued ) %] @@ -440,6 +453,7 @@ No patron matched [% message %]
    Patron selection +[% IF (forceallow) %][% END %] @@ -478,6 +492,8 @@ No patron matched [% message %] x [% END %] + [% IF (forceallow) %][% END %] +
    Enter item barcode:
    @@ -535,6 +551,8 @@ No patron matched [% message %]

    [% IF ( noissues ) %] Cannot check out! [% ELSE %]Attention:[% END %]

    + +
      [% IF ( warndeparture ) %] @@ -603,6 +621,13 @@ No patron matched [% message %]
    + +[% IF (noissues && borrowernumber) %] + +[% END %] + [% IF ( WaitingReserveLoop ) %] -- 1.9.1