From 4f97f501cb8724826a95d1ef90c171ae64614c64 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 9 Sep 2021 09:37:50 +0000 Subject: [PATCH] Bug 28831: Database revision, add new preference Content-Type: text/plain; charset=utf-8 The preference OPACResultsUnavailableGroupingBy allows you to group unavailable items by substatus, only showing item counts, on the OPAC XSLT results. This is meant to be useful for larger consortia. Test plan: Run dbrev. Check new pref on Admin, preferences, OPAC tab. Signed-off-by: Marcel de Rooy --- installer/data/mysql/atomicupdate/bug_28831.pl | 14 ++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 1 + .../prog/en/modules/admin/preferences/opac.pref | 8 +++++++- 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100755 installer/data/mysql/atomicupdate/bug_28831.pl diff --git a/installer/data/mysql/atomicupdate/bug_28831.pl b/installer/data/mysql/atomicupdate/bug_28831.pl new file mode 100755 index 0000000000..df45764f12 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_28831.pl @@ -0,0 +1,14 @@ +use Modern::Perl; + +return { + bug_number => "28831", + description => "Add system preferences OPACResultsUnavailableGroupingBy", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + $dbh->do(q| + INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES + ('OPACResultsUnavailableGroupingBy','branch','branch|substatus','Group OPAC XSLT results by branch or substatus','Choice'), + |); + }, +} diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 59db857ca6..8c2ffd1a8e 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -458,6 +458,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OpacResetPassword','0','','Shows the ''Forgot your password?'' link in the OPAC','YesNo'), ('OPACResultsLibrary', 'homebranch', 'homebranch|holdingbranch', 'Defines whether the OPAC displays the holding or home branch in search results when using XSLT', 'Choice'), ('OPACResultsSidebar','','70|10','Define HTML to be included on the search results page, underneath the facets sidebar','Textarea'), +('OPACResultsUnavailableGroupingBy','branch','branch|substatus','Group OPAC XSLT results by branch or substatus','Choice'), ('OPACSearchForTitleIn','Other Libraries (WorldCat)\nOther Databases (Google Scholar)\nOnline Stores (Bookfinder.com)\nOpen Library (openlibrary.org)','70|10','Enter the HTML that will appear in the \'Search for this title in\' box on the detail page in the OPAC. Enter {TITLE}, {AUTHOR}, or {ISBN} in place of their respective variables in the URL. Leave blank to disable \'More Searches\' menu.','Textarea'), ('OpacSeparateHoldings','0',NULL,'Separate current branch holdings from other holdings (OPAC)','YesNo'), ('OpacSeparateHoldingsBranch','homebranch','homebranch|holdingbranch','Branch used to separate holdings (OPAC)','Choice'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index 5d8e9cabd5..31b3356316 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -348,7 +348,13 @@ OPAC: - pref: OPACResultsMaxItems - (available) individual items on the OPAC XSLT search results, and show no more than - pref: OPACResultsMaxItemsUnavailable - - "'really unavailable' individual items in categories like Checked out, Damaged, On Hold, etc." + - "(unavailable) individual items for categories like Checked out, Damaged, On Hold, but only when you group them by branch.
" + - Group unavailable items by + - pref: OPACResultsUnavailableGroupingBy + choices: + branch: "branch" + substatus: "substatus" + - ". (NOTE: For large consortia we recommend to group unavailable items by substatus, listing item counts only.)" Features: - -- 2.20.1