From 45f3b9e67e0d57293c31df3797482b5cbb8087dc Mon Sep 17 00:00:00 2001 From: Chris Hall Date: Tue, 8 May 2012 10:32:51 +1200 Subject: [PATCH 1/3] bug 8058 allow empty barcode in circulation to redirect to pay fines screen Also adds the option for printing the quickslip and then clearing the screen. --- circ/circulation.pl | 11 ++++++++++- installer/data/mysql/sysprefs.sql | 2 ++ installer/data/mysql/updatedatabase.pl | 6 ++++++ .../en/modules/admin/preferences/circulation.pref | 6 ++++++ .../prog/en/modules/circ/circulation.tt | 4 +++- 5 files changed, 27 insertions(+), 2 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 6c9467b..397cbec 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -98,7 +98,6 @@ for (@failedrenews) { $renew_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'}; @@ -126,6 +125,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 @@ -176,6 +176,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 = ''; } @@ -709,6 +717,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 ), ); # save stickyduedate to session diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 6c6d91b..2102c11 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -371,3 +371,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SuspendHoldsOpac', '1', NULL , 'Allow holds to be suspended from the OPAC.', 'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('DefaultLanguageField008','','Fill in the default language for field 008 Range 35-37 (e.g. eng, nor, ger, see MARC Code List for Languages)','','Free'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OPACShowBarcode','0','Show items barcode in holding tab','','YesNo'); +INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('AllowItemsOnHoldCheckout',0,'Do not generate RESERVE_WAITING and RESERVED warning when checking out items reserved to someone else. This allows self checkouts for those items.','','YesNo'); +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'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index d06a188..b5c2a96 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -5391,6 +5391,12 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { print "Upgrade to $DBversion done (Add customizable OpacNavRight region to the OPAC main page)\n"; SetVersion ($DBversion); } +$DBversion = "3.06.04.001"; +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')"); + print "Upgrade to $DBversion done\n"; + SetVersion ($Dbversion); +} =head1 FUNCTIONS 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 a54e3c5..97b0d72 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 @@ -103,6 +103,12 @@ Circulation: - pref: NoticeCSS class: url - on Notices. (This should be a complete URL, starting with http://) + - + - pref: CircPayFinesRedirect + choices: + yes: "Redirect to pay to fines screen if borrower has outstanding fines" + no: "do nothing" + - . Checkout Policy: - - pref: AllowNotForLoanOverride 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 1001734..5048368 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -52,10 +52,11 @@ // listen submit to trigger qslip on empty checkout $('#mainform').bind('submit',function() { if ($('#barcode').val() == '') { - return printx_window('qslip'); } + printx_window('qslip'); } });[% END %] + var allcheckboxes = $(".checkboxed"); $("#renew_all").click(function(){ $(allcheckboxes).checkCheckboxes(":input[name*=items]"); @@ -484,6 +485,7 @@ No patron matched [% message %] [% END %] + [% IF ( SpecifyDueDate ) %]
Specify due date [% INCLUDE 'date-format.inc' %]:
-- 1.7.4.1