@@ -, +, @@ --- circ/circulation.pl | 11 ++++++++++- installer/data/mysql/sysprefs.sql | 3 ++- installer/data/mysql/updatedatabase.pl | 15 +++++++++++++++ .../en/modules/admin/preferences/circulation.pref | 12 ++++++++++-- .../prog/en/modules/circ/circulation.tt | 18 +++++++++++++++--- 5 files changed, 52 insertions(+), 7 deletions(-) --- a/circ/circulation.pl +++ a/circ/circulation.pl @@ -104,7 +104,6 @@ for (@failedreturns) { $return_failed{$_} = 1; } my $findborrower = $query->param('findborrower'); $findborrower =~ s|,| |g; my $borrowernumber = $query->param('borrowernumber'); - $branch = C4::Context->userenv->{'branch'}; $printer = C4::Context->userenv->{'branchprinter'}; @@ -132,6 +131,7 @@ my $issueconfirmed = $query->param('issueconfirmed'); my $cancelreserve = $query->param('cancelreserve'); my $organisation = $query->param('organisations'); my $print = $query->param('print'); +my $finesredirect = $query->param('finesredirect'); my $newexpiry = $query->param('dateexpiry'); my $debt_confirmed = $query->param('debt_confirmed') || 0; # Don't show the debt error dialog twice @@ -180,6 +180,14 @@ if ( $print eq 'yes' && $borrowernumber ne '' ) { NetworkPrint($letter->{content}); } $query->param( 'borrowernumber', '' ); +} + +if ( $finesredirect && $borrowernumber ne '' && $barcode eq '' ){ + print $query->redirect("/cgi-bin/koha/members/pay.pl?borrowernumber=$borrowernumber"); +} + +# this was initially inside the previous if with the same conditions but was interfering with $finesredirect +if ( $print eq 'yes' && $borrowernumber ne '' ) { $borrowernumber = ''; } @@ -716,6 +724,7 @@ $template->param( activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), SuspendHoldsIntranet => C4::Context->preference('SuspendHoldsIntranet'), AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'), + CircPayFinesRedirect => (C4::Context->preference('CircPayFinesRedirect') ? $total > 0 : 0 ), ); # save stickyduedate to session --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -326,7 +326,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OpacKohaUrl','1',"Show 'Powered by Koha' text on OPAC footer.",NULL,NULL); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('EasyAnalyticalRecords','0','If on, display in the catalogue screens tools to easily setup analytical record relationships','','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowRecentComments',0,'If ON a link to recent comments will appear in the OPAC masthead',NULL,'YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('CircAutoPrintQuickSlip', '1', 'Choose what should happen when an empty barcode field is submitted in circulation: Display a print quick slip window or Clear the screen.',NULL,'YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('CircAutoPrintQuickSlip', '1', 'Choose what should happen when an empty barcode field is submitted in circulation: Display a print quick slip window or Clear the screen.','Clear|Print|ClearAndPrin','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('NoticeCSS','','Notices CSS url.',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SlipCSS','','Slips CSS url.',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('TransferWhenCancelAllWaitingHolds','0','Transfer items when cancelling all waiting holds',NULL,'YesNo'); @@ -386,3 +386,4 @@ INSERT INTO systempreferences (variable,value,explanation,type) VALUES('OPACdidy INSERT INTO systempreferences (variable,value,explanation,type) VALUES('INTRAdidyoumean',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'); INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('BlockReturnOfWithdrawnItems', '1', '0', 'If enabled, items that are marked as withdrawn cannot be returned.', 'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HoldsToPullStartDate','2','Set the default start date for the Holds to pull list to this many days ago',NULL,'Integer'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CircPayFinesRedirect','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 @@ -6002,6 +6002,21 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.09.00.XXX"; +if( C4::Context->preference("Version") < TransformToNum($DBversion) ){ + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CircPayFinesRedirect',' 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')"); + + my $sth = $dbh->prepare("SELECT value FROM systempreferences WHERE variable='CircAutoPrintQuickSlip'"); + $sth->execute; + my @result = $sth->fetchrow_array; + print "REST IS (@result)\n"; + + # a value of 1 maps to the new value of 'Print', a value of 0 maps to the new value 'Clear' + $dbh->do("UPDATE systempreferences SET type='Choice', options='Clear|Print|PrintAndClear', value=? WHERE variable='CircAutoPrintQuickSlip'", undef, ($result[0] ? 'Print' : 'Clear') ); + print "Upgrade to $DBversion done (added syspref CircPayFinesRedirect and updated CircAutoPrintQuickSlip)\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 @@ -101,8 +101,9 @@ Circulation: - When an empty barcode field is submitted in circulation - pref: CircAutoPrintQuickSlip choices: - yes: "open a print quick slip window" - no: "clear the screen" + Print: "open a print quick slip window" + Clear: "clear the screen" + PrintAndClear: "open a print quick slip window and clear the screen" - . - - Include the stylesheet at @@ -121,6 +122,13 @@ Circulation: yes: Export no: "Don't export" - fields for csv or iso2709 export + - + - When an empty barcode field is submitted in circulation and a patron has outstanding fines + - pref: CircPayFinesRedirect + choices: + yes: "Redirect to pay to fines screen" + no: "do nothing" + - . Checkout Policy: - - pref: AllowNotForLoanOverride --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -54,12 +54,23 @@ $( '.renewals-allowed' ).hide(); $( '.renewals-disabled' ).show(); } } ).attr( 'checked', false ); - [% END %][% IF ( CircAutoPrintQuickSlip ) %] + [% END %] + + [% IF ( CircAutoPrintQuickSlip != 'Clear') %] // listen submit to trigger qslip on empty checkout $('#mainform').bind('submit',function() { if ($('#barcode').val() == '') { - return printx_window('qslip'); } - });[% END %] + [% IF CircAutoPrintQuickSlip == 'PrintAndClear' || CircPayFinesRedirect %] + /* if we want to continue submitting the form, needed for redirect (return false will stop this) */ + printx_window('qslip'); + [% ELSE %] + /* show quick slip window and do not redirect or clear screen */ + return printx_window('qslip'); + [% END %] + } + }); + [% END %] + var allcheckboxes = $(".checkboxed"); @@ -574,6 +585,7 @@ No patron matched [% message %] [% END %] + [% IF ( SpecifyDueDate ) %]
Specify due date [% INCLUDE 'date-format.inc' %]:
--