From b6b197b24574edf117390b8d9a764b64364dc093 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Wed, 27 Apr 2022 17:55:26 +0000 Subject: [PATCH] Bug 29129: Update DisplayClearScreenButton to allow for a choice between issueslip and issueqslip To Test: 1. Apply patch, updatedatabase, and restart_all 2. A small change the global scss file means you should regenerate the CSS as well. ( https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_interface ) 3. Set DisplayClearScreenButton to "don't show" 4. Go to the patron checkout screen and see that no button should show to clear the screen and print 5. Set DisplayClearScreenButton to 'ISSUESLIP' and make sure the button now appears and the ISSUESLIP prints 6. Set DisplayClearScreenButton to 'ISSUEQSLIP' and make sure the button now appears and the ISSUEQSLIP prints Signed-off-by: Andrew Fuerste-Henry Signed-off-by: Katrin Fischer --- circ/circulation.pl | 4 ---- installer/data/mysql/atomicupdate/bug29129.pl | 16 ++++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 2 +- .../intranet-tmpl/prog/css/src/staff-global.scss | 3 ++- .../modules/admin/preferences/circulation.pref | 5 +++-- .../prog/en/modules/circ/circulation.tt | 5 ++++- koha-tmpl/intranet-tmpl/prog/js/members-menu.js | 4 ++++ 7 files changed, 30 insertions(+), 9 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug29129.pl diff --git a/circ/circulation.pl b/circ/circulation.pl index dfa5cb1fd7..b3cba3bf14 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -153,10 +153,6 @@ my $searchtype = $query->param('searchtype') || q{contain}; my $branch = C4::Context->userenv->{'branch'}; -if (C4::Context->preference("DisplayClearScreenButton")) { - $template->param(DisplayClearScreenButton => 1); -} - for my $barcode ( @$barcodes ) { $barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace $barcode = barcodedecode( $barcode ) if $barcode; diff --git a/installer/data/mysql/atomicupdate/bug29129.pl b/installer/data/mysql/atomicupdate/bug29129.pl new file mode 100644 index 0000000000..f5d5c3ea94 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug29129.pl @@ -0,0 +1,16 @@ +use Modern::Perl; + +return { + bug_number => "29129", + description => "Update the DisplayClearnScreenButton system pref to allow for a choice between ISSUESLIP and ISSUEQSLIP", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + # Do you stuffs here + $dbh->do(q{ + UPDATE systempreferences SET options = 'no|issueslip|issueqslip', type = 'Choice', value = REPLACE( value, 0, 'no'), value = REPLACE( value, 1, 'issueslip') WHERE variable = 'DisplayClearScreenButton'; + }); + # Print useful stuff here + say $out "Database updated for Bug 29129"; + }, +}; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index c6d0fd49e9..46c82d1846 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -178,7 +178,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('DefaultToLoggedInLibraryOverdueTriggers', '0', NULL , 'If enabled, overdue status triggers editor will default to the logged in library''s rules, rather than the ''default'' rules.', 'YesNo'), ('CSVDelimiter',';',';|tabulation|,|/|\\|#||','Define the default separator character for exporting reports','Choice'), ('Display856uAsImage','OFF','OFF|Details|Results|Both','Display the URI in the 856u field as an image, the corresponding staff interface XSLT option must be on','Choice'), -('DisplayClearScreenButton','0','','If set to ON, a clear screen button will appear on the circulation page.','YesNo'), +('DisplayClearScreenButton','no','no|issueslip|issueqslip','If set to ON, a clear screen button will appear on the circulation page.','Choice'), ('displayFacetCount','0',NULL,NULL,'YesNo'), ('DisplayIconsXSLT','1','','If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages.','YesNo'), ('DisplayLibraryFacets', 'holding', 'home|holding|both', 'Defines which library facets to display.', 'Choice'), diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss index 2f84696730..30ccf7b767 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -2677,7 +2677,8 @@ td { } } -#printclearscreen { +#printclearscreen, +#printclearscreenq { position: absolute; right: 43px; top: 0; 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 8f77412eb4..ace8d1bb8d 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 @@ -106,8 +106,9 @@ Circulation: - - pref: DisplayClearScreenButton choices: - 1: Show - 0: "Don't show" + no: "Don't show" + issueslip: "Show and print ISSUESLIP" + issueqslip: "Show and print ISSUEQSLIP" - a button to clear the current patron from the screen on the circulation screen. - - pref: RecordLocalUseOnReturn 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 5a35cc181e..dac3c232ec 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -619,9 +619,12 @@
[% END %] - [% IF ( DisplayClearScreenButton ) %] + [% IF Koha.Preference('DisplayClearScreenButton') == 'issueslip' %] x + [% ELSIF Koha.Preference('DisplayClearScreenButton') == 'issueqslip' %] + x + [% END %] [% IF (forceallow) %][% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/members-menu.js b/koha-tmpl/intranet-tmpl/prog/js/members-menu.js index 7b7e6ff1c1..0d70178bfe 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/members-menu.js +++ b/koha-tmpl/intranet-tmpl/prog/js/members-menu.js @@ -82,6 +82,10 @@ $(document).ready(function(){ printx_window("slip"); window.location.replace("/cgi-bin/koha/circ/circulation.pl"); }); + $("#printclearscreenq").click(function(){ + printx_window("qslip"); + window.location.replace("/cgi-bin/koha/circ/circulation.pl"); + }); $("#searchtohold").click(function(){ searchToHold(); return false; -- 2.30.2