From b1dc52395b280b8f244cbc59e5253d5e45137b17 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 22 May 2014 14:38:33 +0300 Subject: [PATCH] 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. Signed-off-by: Tomas Cohen Arazi --- 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 8f79f71969..131c8b097f 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 3708e0e4cd..8419ccbec8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -252,6 +252,8 @@ $(document).ready(function() { [% IF CAN_user_circulate_force_checkout or HIGHHOLDS %]
+[% IF (forceallow) %][% END %] + [% IF ( RESERVED ) %]

@@ -291,6 +293,7 @@ $(document).ready(function() { [% END %] + [% IF (forceallow) %][% END %] @@ -340,6 +343,7 @@ $(document).ready(function() { [% FOREACH book IN options %]
+ [% IF (forceallow) %][% END %] @@ -420,11 +424,20 @@ $(document).ready(function() { [% END %] + [% IF (forceallow) %] +

  • Debarment overridden temporarily
  • + [% END %] + [% ELSE %] [% IF ( soundon ) %] [% END %] + + [% IF (forceallow) %] +
    Debarment overridden temporarily
    + [% END %] + [% END %] [% IF ( issued ) %] @@ -446,6 +459,7 @@ No patron matched [% message %]
    Patron selection +[% IF (forceallow) %][% END %] @@ -484,6 +498,8 @@ No patron matched [% message %] x [% END %] + [% IF (forceallow) %][% END %] +
    Enter item barcode:
    @@ -541,6 +557,8 @@ No patron matched [% message %]

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

    + +
      [% IF ( warndeparture ) %] @@ -609,6 +627,13 @@ No patron matched [% message %]
    + +[% IF (noissues && borrowernumber) %] + +[% END %] + [% IF ( WaitingReserveLoop ) %] -- 2.39.5