From ada7677996273f85c3048bd007c000c66def7624 Mon Sep 17 00:00:00 2001 From: Nahuel ANGELINETTI Date: Fri, 2 Jan 2009 16:55:32 +0100 Subject: [PATCH] (bug #2893) Allow loan forcing if a syspref is set If the syspref 'AllowNotForLoanForcing'(YESNO) is set to YES, the librarian is able to force a loan on an item set as "not for loan". If the item is not for loan and the syspref is set to YES, koha will ask to the librarian if he really want to check-out it, else do nothing. Signed-off-by: Henri-Damien LAURENT --- C4/Circulation.pm | 6 +++++- circ/circulation.pl | 5 +++++ .../prog/en/modules/circ/circulation.tmpl | 16 +++++++++++++++- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index f1ff0b8867..cdf9ab70c4 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -716,7 +716,11 @@ sub CanBookBeIssued { if ( $item->{'notforloan'} && $item->{'notforloan'} > 0 ) { - $issuingimpossible{NOT_FOR_LOAN} = 1; + if(C4::Context->preference("AllowNotForLoanForcing")){ + $issuingimpossible{NOT_FOR_LOAN_CAN_FORCE} = 1; + }else{ + $issuingimpossible{NOT_FOR_LOAN} = 1; + } } elsif ( !$item->{'notforloan'} ){ # we have to check itemtypes.notforloan also diff --git a/circ/circulation.pl b/circ/circulation.pl index 5991e086ee..8097705e68 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -269,6 +269,11 @@ if ($barcode) { $inprocess = 1; } elsif ($issueconfirmed){ # FIXME: Do something? Or is this to *intentionally* do nothing? + if (C4::Context->preference("AllowNotForLoanForcing")){ + AddIssue( $borrower, $barcode, $datedue, $cancelreserve ); + $template->param(IMPOSSIBLE => 0); + $inprocess = 1; + } } else { my $noquestion = 1; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl index 0e2207d729..02d7037b89 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl @@ -144,13 +144,27 @@ $.tablesorter.addParser({ " /> -
+ +
+

Not for loan

+

Item not for loan, are you sure you want to loan it?

+ " /> + " /> + + +
+
+ " /> + +
+ +
    -- 2.39.5