diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 30cbe2fa85..6fd3bd0028 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -826,9 +826,15 @@ sub CanBookBeIssued { $needsconfirmation{PATRON_CANT} = 1; } else { if($max_loans_allowed){ - $needsconfirmation{TOO_MANY} = 1; - $needsconfirmation{current_loan_count} = $current_loan_count; - $needsconfirmation{max_loans_allowed} = $max_loans_allowed; + if ( C4::Context->preference("AllowTooManyOverride") ) { + $needsconfirmation{TOO_MANY} = 1; + $needsconfirmation{current_loan_count} = $current_loan_count; + $needsconfirmation{max_loans_allowed} = $max_loans_allowed; + } else { + $issuingimpossible{TOO_MANY} = 1; + $issuingimpossible{current_loan_count} = $current_loan_count; + $issuingimpossible{max_loans_allowed} = $max_loans_allowed; + } } } diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 0a3f20f9e6..e3c0f3dc88 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -428,3 +428,4 @@ INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) V INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHoldNotes',0,'Show hold notes on OPAC','','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('CalculateFinesOnReturn','1','Switch to control if overdue fines are calculated on return or not', '', 'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AcqWarnOnDuplicateInvoice','0','Warn librarians when they try to create a duplicate invoice', '', 'YesNo'); +INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('AllowTooManyOverride', '1', 'If on, allow staff to override and check out items when the patron has reached the maximum number of allowed checkouts', '', 'YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 1f7b4914ad..1b88ccccf9 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -7036,7 +7036,6 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } - $DBversion = "3.13.00.012"; if ( CheckVersion($DBversion) ) { $dbh->do("ALTER TABLE issuingrules MODIFY COLUMN overduefinescap decimal(28,6) DEFAULT NULL;"); @@ -7044,6 +7043,13 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion ="3.13.00.XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('AllowTooManyOverride', '1', 'If on, allow staff to override and check out items when the patron has reached the maximum number of allowed checkouts', '', 'YesNo');"); + print "Upgrade to $DBversion done (Bug 9576 - Enable or disable issue limit confirmation)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index 64cf338eb8..c286ed19c0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -125,6 +125,12 @@ Circulation: - (separate fields with space, e.g. 100a 200b 300c) Checkout Policy: + - + - pref: AllowTooManyOverride + choices: + yes: Allow + no: "Don't allow" + - staff to override and check out items when the patron has reached the maximum number of allowed checkouts. - - pref: AllowNotForLoanOverride choices: 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 95252e70f7..c243487d20 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -520,6 +520,10 @@ function validate1(date) {
  • Patron's card is expired
  • [% END %] + [% IF ( TOO_MANY ) %] +
  • Too many checked out. [% current_loan_count %] checked out, only [% max_loans_allowed %] are allowed.
  • + [% END %] + [% IF ( ITEMNOTSAMEBRANCH ) %]
  • This item belongs to [% itemhomebranch %] and cannot be issued from this location.
  • [% END %]