Prevent OPAC renewals if fines are over limit

This introduces a new system preference, OPACFineNoRenewals, that sets a
limit on the total fines a patron can have before they can no longer
renew their own books. opac-user.pl has been updated to obey this limit.

This work sponsered by East Brunswick Public Library, East Brunswick, NJ USA

Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
This commit is contained in:
Jesse Weaver 2009-07-26 13:28:47 +01:00 committed by Galen Charlton
parent 5593a28164
commit f8a43317b1
6 changed files with 21 additions and 0 deletions

View File

@ -165,6 +165,7 @@ $tabsysprefs{AllowNotForLoanOverride} = "Circulation";
$tabsysprefs{RenewalPeriodBase} = "Circulation";
$tabsysprefs{FilterBeforeOverdueReport} = "Circulation";
$tabsysprefs{AllowHoldDateInFuture} = "Circulation";
$tabsysprefs{OPACFineNoRenewals} = "Circulation";
# Staff Client
$tabsysprefs{TemplateEncoding} = "StaffClient";

View File

@ -250,3 +250,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('F
INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('SpineLabelFormat', '<itemcallnumber><copynumber>', '30|10', 'This preference defines the format for the quick spine label printer. Just list the fields you would like to see in the order you would like to see them, surrounded by <>, for example <itemcallnumber>.', 'Textarea');
INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('SpineLabelAutoPrint', '0', '', 'If this setting is turned on, a print dialog will automatically pop up for the quick spine label printer.', 'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AWSPrivateKey','','See: http://aws.amazon.com. Note that this is required after 2009/08/15 in order to retrieve any enhanced content other than book covers from Amazon.','','free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACFineNoRenewals','100','Fine Limit above which user canmot renew books via OPAC','','Integer');

View File

@ -252,3 +252,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('F
INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('SpineLabelFormat', '<itemcallnumber><copynumber>', '30|10', 'This preference defines the format for the quick spine label printer. Just list the fields you would like to see in the order you would like to see them, surrounded by <>, for example <itemcallnumber>.', 'Textarea');
INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('SpineLabelAutoPrint', '0', '', 'If this setting is turned on, a print dialog will automatically pop up for the quick spine label printer.', 'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AWSPrivateKey','','Voir: http://aws.amazon.com. Notez que cela est nécessaire après le 15 Aout 2009 pour pouvoir utiliser les webservices Amazon autre que les couvertures de livre.','','free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACFineNoRenewals','100','amende limite ci-dessus le lecteur ne peut pas renouveler par l\'OPAC','','Integer');

View File

@ -2503,6 +2503,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
print "Upgrade to $DBversion done (added AWSPrivateKey syspref - note that if you use enhanced content from Amazon, this should be set right away.)";
}
$DBversion = '3.01.00.042';
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
$dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACFineNoRenewals','100','Fine Limit above which user canmot renew books via OPAC','','Integer')");
SetVersion ($DBversion);
print "Upgrade to $DBversion done (added OPACFineNoRenewals syspref)\n";
}
=item DropAllForeignKeys($table)
Drop all foreign keys of the table $table

View File

@ -98,6 +98,9 @@ $.tablesorter.addParser({
<!-- TMPL_IF NAME="lost" -->
<li><strong>Please note: </strong> Your library card has been marked as lost or stolen. If this is an error, please take your card to the circulation desk at your local library and the error will be corrected.</li>
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="renewal_blocked_fines" -->
<li><strong>Please note: </strong> Since you have <a href="/cgi-bin/koha/opac-account.pl">more than <!-- TMPL_VAR NAME="renewal_blocked_fines" --></a> in fines, you cannot renew your books online. Please pay your fines if you wish to renew your books.</li>
<!-- /TMPL_IF -->
</ul></div>
<!-- /TMPL_IF -->

View File

@ -74,6 +74,14 @@ if ( $borr->{'amountoutstanding'} > 5 ) {
if ( 5 >= $borr->{'amountoutstanding'} && $borr->{'amountoutstanding'} > 0 ) {
$borr->{'amountoverzero'} = 1;
}
if ( $borr->{'amountoutstanding'} > C4::Context->preference( 'OPACFineNoRenewals' ) ) {
$borr->{'flagged'} = 1;
$template->param(
renewal_blocked_fines => sprintf( "%.02f", C4::Context->preference( 'OPACFineNoRenewals' ) ),
);
}
if ( $borr->{'amountoutstanding'} < 0 ) {
$borr->{'amountlessthanzero'} = 1;
$borr->{'amountoutstanding'} = -1 * ( $borr->{'amountoutstanding'} );