From cfac66af508aca8396bb0069356cb6f85d6dacee Mon Sep 17 00:00:00 2001 From: Caitlin Goodger Date: Wed, 18 Jan 2017 22:03:31 +0000 Subject: [PATCH] Bug 16606 Checkout settings dropdown should have a preference to stay open all the time Test Plan 1: Update database 2: Turn on the CheckoutSettingsVisibility syspref 3: Go to your checkouts 4: COnfirm that the checkout settings is open 5: Turn the syspref and go back to your checkouts 6: Confirm that the Checkout settings are closed --- .../atomicupdate/bug-16606_AddCheckoutSettingsVisibilitysyspref.sql | 1 + installer/data/mysql/sysprefs.sql | 1 + .../prog/en/modules/admin/preferences/circulation.pref | 6 ++++++ koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt | 4 ++++ 4 files changed, 12 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug-16606_AddCheckoutSettingsVisibilitysyspref.sql diff --git a/installer/data/mysql/atomicupdate/bug-16606_AddCheckoutSettingsVisibilitysyspref.sql b/installer/data/mysql/atomicupdate/bug-16606_AddCheckoutSettingsVisibilitysyspref.sql new file mode 100644 index 0000000..1ae4e4b --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug-16606_AddCheckoutSettingsVisibilitysyspref.sql @@ -0,0 +1 @@ +INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES ('CheckoutSettingsVisibility', '0', NULL, 'If on Checkout settings will always be visible', 'YesNo'); diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 423bbdf..e30cc02 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -97,6 +97,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('CatalogModuleRelink','0',NULL,'If OFF the linker will never replace the authids that are set in the cataloging module.','YesNo'), ('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'), +('CheckoutSettingsVisibility', '0', NULL, 'If on Checkout settings will always be visible', 'YesNo'), ('CheckPrevCheckout','hardno','hardyes|softyes|softno|hardno','By default, for every item checked out, should we warn if the patron has borrowed that item in the past?','Choice'), ('CircAutocompl','1',NULL,'If ON, autocompletion is enabled for the Circulation input','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'), 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 e69e37f..95787aa 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 @@ -2,6 +2,12 @@ Circulation: # FIXME: printcirculationslips is also omitted. It _technically_ could work, but C4::Print is HLT specific and needs a little bit of refactoring. Interface: - + - pref: CheckoutSettingsVisibility + choices: + yes: Always show + no: Hide + - checkout settings by default. + - - pref: CircAutocompl choices: yes: Try 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 af88d33..d00f23a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -88,6 +88,10 @@ function Dopop(link) { var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top'); } $(document).ready(function() { + + [% IF Koha.Preference("CheckoutSettingsVisibility") %] + $(".checkout-settings").show(); + [% END %] $('#mainform').on('submit',function() { if ($("#barcode") && $("#barcode").val()) { $('#barcode').on('keypress',function(event) { -- 2.1.4