@@ -, +, @@ --- circ/circulation.pl | 1 + installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 7 +++++++ .../en/modules/admin/preferences/circulation.pref | 7 +++++++ .../prog/en/modules/circ/circulation.tt | 16 ++++++++++++++-- 5 files changed, 30 insertions(+), 2 deletions(-) --- a/circ/circulation.pl +++ a/circ/circulation.pl @@ -705,6 +705,7 @@ $template->param( fast_cataloging => $fast_cataloging, CircAutoPrintQuickSlip => C4::Context->preference("CircAutoPrintQuickSlip"), activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), + CircPayFinesRedirect => (C4::Context->preference('CircPayFinesRedirect') ? $total : 0), ); # save stickyduedate to session --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -362,3 +362,4 @@ INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES(' INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('AutoResumeSuspendedHolds', '1', NULL , 'Allow suspended holds to be automatically resumed by a set date.', 'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacStarRatings','all',NULL,'disable|all|details','Choice'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacBrowseResults','1','Disable/enable browsing and paging search results from the OPAC detail page.',NULL,'YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CircPayFindsRedirect','0','When an empty barcode is entered into the checkout field will redirect to pay fines page if borrowser has fines to pay (after quickslip if enabled)',NULL,'YesNo'); --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -5212,6 +5212,13 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.08.00.XXX"; +if( C4::Context->preference("Version") < TransformToNum($DBversion) ){ + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CircPayFindsRedirect','0','When an empty barcode is entered into the checkout field will redirect to pay fines page if borrowser has fines to pay (after quickslip if enabled)',NULL,'YesNo')"); + print "Upgrade to $Dbversion done\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -99,6 +99,13 @@ Circulation: no: "clear the screen" - . - + - When an empty barcode field is submitted in circulation (and after any quick slip printing, if enabled) + - pref: CircPayFinesRedirect + choices: + yes: "redirect to pay fines screen if borrower has fines to pay" + no: "do nothing" + - . + - - Include the stylesheet at - pref: NoticeCSS class: url --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -50,8 +50,20 @@ // listen submit to trigger qslip on empty checkout $('#mainform').bind('submit',function() { if ($('#barcode').val() == '') { - return printx_window('qslip'); } - });[% END %] + var code = printx_window('qslip'); + [% IF (CircPayFinesRedirect) %] + window.location = "/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrowernumber %];"; + [% END %] + return code; + } + }); + [% ELSIF ( CircPayFinesRedirect ) %] + $('#mainform').bind('submit', function(){ + if ($('#barcode').val() == '') { + window.location = "/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrowernumber %]"; + } + }); + [% END %] var allcheckboxes = $(".checkboxed"); --