@@ -, +, @@ and that the checkout length is not reduced --- C4/Circulation.pm | 23 +++++++--- circ/circulation.pl | 6 ++- .../prog/en/modules/circ/circulation.tt | 48 +++++++++++++++++--- .../{ => Circulation}/DecreaseLoanHighHolds.t | 20 +++++++- 4 files changed, 80 insertions(+), 17 deletions(-) rename t/db_dependent/{ => Circulation}/DecreaseLoanHighHolds.t (86%) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -604,7 +604,7 @@ sub itemissues { =head2 CanBookBeIssued ( $issuingimpossible, $needsconfirmation ) = CanBookBeIssued( $borrower, - $barcode, $duedatespec, $inprocess, $ignore_reserves ); + $barcode, $duedatespec, $inprocess, $ignore_reserves, $override_high_holds ); Check if a book can be issued. @@ -696,7 +696,7 @@ if the borrower borrows to much things =cut sub CanBookBeIssued { - my ( $borrower, $barcode, $duedate, $inprocess, $ignore_reserves ) = @_; + my ( $borrower, $barcode, $duedate, $inprocess, $ignore_reserves, $override_high_holds ) = @_; my %needsconfirmation; # filled with problems that needs confirmations my %issuingimpossible; # filled with problems that causes the issue to be IMPOSSIBLE my %alerts; # filled with messages that shouldn't stop issuing, but the librarian should be aware of. @@ -1014,11 +1014,20 @@ sub CanBookBeIssued { my $check = checkHighHolds( $item, $borrower ); if ( $check->{exceeded} ) { - $needsconfirmation{HIGHHOLDS} = { - num_holds => $check->{outstanding}, - duration => $check->{duration}, - returndate => output_pref( $check->{due_date} ), - }; + if ($override_high_holds) { + $alerts{HIGHHOLDS} = { + num_holds => $check->{outstanding}, + duration => $check->{duration}, + returndate => output_pref( $check->{due_date} ), + }; + } + else { + $needsconfirmation{HIGHHOLDS} = { + num_holds => $check->{outstanding}, + duration => $check->{duration}, + returndate => output_pref( $check->{due_date} ), + }; + } } } --- a/circ/circulation.pl +++ a/circ/circulation.pl @@ -65,6 +65,9 @@ my $query = new CGI; my $sessionID = $query->cookie("CGISESSID") ; my $session = get_session($sessionID); +my $override_high_holds = $query->param('override_high_holds'); +my $override_high_holds_tmp = $query->param('override_high_holds_tmp'); + # branch and printer are now defined by the userenv # but first we have to check if someone has tried to change them @@ -301,7 +304,7 @@ if ($borrowernumber) { if ($barcode) { # always check for blockers on issuing my ( $error, $question, $alerts ) = - CanBookBeIssued( $borrower, $barcode, $datedue , $inprocess ); + CanBookBeIssued( $borrower, $barcode, $datedue, $inprocess, undef, $override_high_holds || $override_high_holds_tmp ); my $blocker = $invalidduedate ? 1 : 0; $template->param( alert => $alerts ); @@ -573,6 +576,7 @@ $template->param( canned_bor_notes_loop => $canned_notes, debarments => GetDebarments({ borrowernumber => $borrowernumber }), todaysdate => output_pref( { dt => dt_from_string()->set(hour => 23)->set(minute => 59), dateformat => 'sql' } ), + override_high_holds => $override_high_holds, ); output_html_with_http_headers $query, $cookie, $template->output; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -206,6 +206,10 @@ $(document).ready(function() {
[% END %] +[% IF alert.HIGHHOLDS %] + +[% END %] + [% IF ( NEEDSCONFIRMATION ) %]+ + +
+[% END %] + [% IF ( RESERVED ) %]@@ -632,6 +651,23 @@ No patron matched [% message %] [% END %] + + [% IF Koha.Preference('decreaseLoanHighHolds') %] + [% IF NEEDSCONFIRMATION %] + [% IF override_high_holds %] + + [% ELSE %] + + [% END %] + [% ELSE %] + [% IF override_high_holds %] + + [% ELSE %] + + [% END %] + [% END %] + + [% END %]