From ee337b0e06bb8db5159d9e4d3c011ddf713c341f 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. --- circ/circulation.pl | 10 ++++++--- .../prog/en/modules/circ/circulation.tt | 25 ++++++++++++++++++++++ 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 91851d2..34647da 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -96,6 +96,8 @@ 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; } @@ -242,7 +244,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") ); @@ -335,7 +338,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 @@ -595,7 +598,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 6805126..14e0afc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -293,6 +293,8 @@ var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); [% IF CAN_user_circulate_force_checkout or HIGHHOLDS %]
+[% IF (forceallow) %][% END %] + [% IF ( RESERVED ) %]

@@ -332,6 +334,7 @@ var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); [% END %] + [% IF (forceallow) %][% END %] @@ -381,6 +384,7 @@ var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); [% FOREACH book IN options %]
+ [% IF (forceallow) %][% END %] @@ -457,11 +461,20 @@ var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); [% END %] + [% IF (forceallow) %] +

  • Debarment overridden temporarily
  • + [% END %] + [% ELSE %] [% IF ( soundon ) %] [% END %] + + [% IF (forceallow) %] +
    Debarment overridden temporarily
    + [% END %] + [% END %] [% IF ( issued ) %] @@ -483,6 +496,7 @@ No patron matched [% message %]
    Patron selection +[% IF (forceallow) %][% END %] @@ -517,6 +531,8 @@ No patron matched [% message %] x [% END %] + [% IF (forceallow) %][% END %] +
    Enter item barcode:
    @@ -565,6 +581,8 @@ No patron matched [% message %]

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

    + +
      [% IF ( warndeparture ) %] @@ -633,6 +651,13 @@ No patron matched [% message %]
    + +[% IF (noissues && borrowernumber) %] + +[% END %] + [% IF ( WaitingReserveLoop ) %] -- 1.8.3.2