From 2131c78618bb8851bc37bc99f20fa1aaa02c3124 Mon Sep 17 00:00:00 2001 From: Peggy Thrasher Date: Thu, 7 Nov 2013 18:49:51 -0500 Subject: [PATCH] Bug 11040: Add CircAutoPrintQuickSlip option to print regular slip This patch adds a third option to the CircAutoPrintQuickSlip system preference. The three options are now: * print quick slip * print regular slip * clear the screen Test plan: 1. Set the System Preference for CircAutoPrintQuickSlip to "clear the screen". Enter a borrower barcode for checkout Press Enter The screen should be cleared. 2. Set the System Preference for CircCircAutoPrintQuickSlip to "open a quick slip window" Enter a borrower barcode for checkout Press Enter A Quick slip is printed. 3. Apply the patch Update the database using UpdateDatabase.pl 4. Set the System Preference for CircAutoPrintQuickSlip to "clear the screen". Enter a borrower barcode for checkout Press Enter The screen should be cleared. 5. Set the System Preference for CircCircAutoPrintQuickSlip to "open a quick slip window" Enter a borrower barcode for checkout Press Enter A Quick slip is printed. 6. Set the System Preference for CircCircAutoPrintQuickSlip to "open a slip window" Enter a borrower barcode for checkout Press Enter A Slip is printed. 7. Reload the database using sysprefs.sql Set the System Preference for CircAutoPrintQuickSlip to "clear the screen". Enter a borrower barcode for checkout Press Enter The screen should be cleared. 8. Set the System Preference for CircCircAutoPrintQuickSlip to "open a quick slip window" Enter a borrower barcode for checkout Press Enter A Quick slip is printed. 9. Set the System Preference for CircCircAutoPrintQuickSlip to "open a slip window" Enter a borrower barcode for checkout Press Enter A Slip is printed. 10. Verify that the Checkout Help includes information about printing Slips. Signed-off-by: Chris Cormack Signed-off-by: Jonathan Druart Signed-off-by: Galen Charlton --- installer/data/mysql/sysprefs.sql | 2 +- installer/data/mysql/updatedatabase.pl | 9 +++++++++ .../prog/en/modules/admin/preferences/circulation.pref | 5 +++-- .../intranet-tmpl/prog/en/modules/circ/circulation.tt | 4 ++-- .../prog/en/modules/help/circ/circulation.tt | 2 +- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index a07103a915..6438483249 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -77,7 +77,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('CataloguingLog','1',NULL,'If ON, log edit/create/delete actions on bibliographic data. WARNING: this feature is very resource consuming.','YesNo'), ('checkdigit','none','none|katipo','If ON, enable checks on patron cardnumber: none or \"Katipo\" style checks','Choice'), ('CircAutocompl','1',NULL,'If ON, autocompletion is enabled for the Circulation input','YesNo'), -('CircAutoPrintQuickSlip','1',NULL,'Choose what should happen when an empty barcode field is submitted in circulation: Display a print quick slip window or Clear the screen.','YesNo'), +('CircAutoPrintQuickSlip','qslip',NULL,'Choose what should happen when an empty barcode field is submitted in circulation: Display a print quick slip window, Display a print slip window or Clear the screen.','Choice'), ('CircControl','ItemHomeLibrary','PickupLibrary|PatronLibrary|ItemHomeLibrary','Specify the agency that controls the circulation and fines policy','Choice'), ('ConfirmFutureHolds','0','','Number of days for confirming future holds','Integer'), ('COinSinOPACResults','1','','If ON, use COinS in OPAC search results page. NOTE: this can slow down search response time significantly','YesNo'), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index e6f54f98e7..a5a1e15255 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -7762,6 +7762,15 @@ if ( CheckVersion($DBversion) ) { SetVersion ($DBversion); } +$DBversion = "XXX"; +if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { + $dbh->do("UPDATE systempreferences SET value='clear' where variable = 'CircAutoPrintQuickSlip' and value = '0'"); + $dbh->do("UPDATE systempreferences SET value='qslip' where variable = 'CircAutoPrintQuickSlip' and value = '1'"); + $dbh->do("UPDATE systempreferences SET explanation = 'Choose what should happen when an empty barcode field is submitted in circulation: Display a print quick slip window, Display a print slip window or Clear the screen.', type = 'Choice' where variable = 'CircAutoPrintQuickSlip'"); + print "Upgrade to $DBversion done (Bug 11040: Add option to print full slip when checking out a null barcode)"; + 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 9ae9c447c3..2c5469b388 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 @@ -107,8 +107,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" + clear: "clear the screen" + qslip: "open a print quick slip window" + slip: "open a print slip window" - . - - Include the stylesheet at 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 46b82a84b8..81ea2b613a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -75,11 +75,11 @@ var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); $( '.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'); } + return printx_window( '[% CircAutoPrintQuickSlip %]' ); } });[% END %] [% IF ( CAN_user_circulate_override_renewals ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/circulation.tt index 044f25cd71..82f4f83fd5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/circulation.tt @@ -39,7 +39,7 @@

Once you have checked out all of the items for the patron you can print them a receipt by choosing one of two methods.

-

If you have the CircAutoPrintQuickSlip preference set to 'open a print quick slip window' you can simply hit enter on your keyboard or scan a blank piece of paper with your barcode scanner. The idea being that you're "checking out" a blank barcode which triggers Koha to print the 'Quick slip.'

+

If you have the CircAutoPrintQuickSlip preference set to 'open a print quick slip window' or 'open a print slip window' you can simply hit enter on your keyboard or scan a blank piece of paper with your barcode scanner. The idea being that you're "checking out" a blank barcode which triggers Koha to print the 'Quick slip' or the 'Slip.'

You can also click the Print button at the top of the screen and choose 'Print slip' or 'Print quick slip'.

-- 2.39.5