Bugzilla – Attachment 12693 Details for
Bug 8058
Circulation empty barcode field redirect to pay fines screen if borrower has outstanding fines
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] 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.
SIGNED-OFF-Bug-8058-allow-empty-barcode-in-circula.patch (text/plain), 9.98 KB, created by
Marc Véron
on 2012-10-05 06:10:31 UTC
(
hide
)
Description:
[SIGNED-OFF] 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.
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2012-10-05 06:10:31 UTC
Size:
9.98 KB
patch
obsolete
>From 76393a80c8d14eb4238c0748f2259de07e28502a Mon Sep 17 00:00:00 2001 >From: Chris Hall <chrish@catalyst.net.nz> >Date: Tue, 8 May 2012 10:32:51 +1200 >Subject: [PATCH] [SIGNED-OFF] 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. >Content-Type: text/plain; charset="utf-8" > >Signed-off-by: Marc Veron <veron@veron.ch> > >Works as expected (see use cases in comment #16) >--- > 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(-) > >diff --git a/circ/circulation.pl b/circ/circulation.pl >index f15d4ce..0b4d355 100755 >--- a/circ/circulation.pl >+++ b/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 >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 178ff40..d71f397 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/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'); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index fb389da..dad9b03 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/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) >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 91eb1ac..f28aef8 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 >@@ -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 >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 652cbf8..9429619 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/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 <span class="ex">[% message %]</span> > <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" /> > [% END %] > <input type="submit" value="Check Out" /> >+ <input type="hidden" name="finesredirect" value="[% CircPayFinesRedirect %]" /> > > [% IF ( SpecifyDueDate ) %]<div class="date-select"> > <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div> >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8058
:
9445
|
9446
|
9574
|
10528
|
10531
|
12567
|
12670
|
12692
|
12693
|
15649