From 2a59d22b894aa4d932d021eddf64b2a24c1b8e0c Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 22 Feb 2019 08:00:33 -0500 Subject: [PATCH] Bug 22311: Add a SysPref to allow adding content to the #moresearches div in the opac The idea of this development would be to match the syspref 'OPACSearchForTitleIn' but for populating the search headers (#moresearches) on the opac page to allow staff to easily add links without jQuery. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Update the new OpacMoreSearches system preference to include the following line:
  • Duck Duck Go
  • 4) Browse to the OPAC 5) Note your new link displays in the "moresearches" area of the OPAC. Signed-off-by: Liz Rea Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens --- installer/data/mysql/atomicupdate/bug_22311.perl | 10 ++++++++++ installer/data/mysql/sysprefs.sql | 1 + .../prog/en/modules/admin/preferences/opac.pref | 5 +++++ koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc | 1 + 4 files changed, 17 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_22311.perl diff --git a/installer/data/mysql/atomicupdate/bug_22311.perl b/installer/data/mysql/atomicupdate/bug_22311.perl new file mode 100644 index 0000000000..64527cc76f --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_22311.perl @@ -0,0 +1,10 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do(q{ + INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES + ('OpacMoreSearches', '', NULL, 'Add additional elements to the OPAC more searches bar', 'Textarea') + } ); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 22311 - Add a SysPref to allow adding content to the #moresearches div in the opac)\n"; +} diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index a349e20a08..0b4a2e9396 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -387,6 +387,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OpacMaintenanceNotice','','','A user-defined block of HTML to appear on screen when OpacMaintenace is enabled','Textarea'), ('OpacMainUserBlock','Welcome to Koha...\r\n
    ','70|10','A user-defined block of HTML in the main content area of the opac main page','Textarea'), ('OpacMaxItemsToDisplay','50','','Max items to display at the OPAC on a biblio detail','Integer'), +('OpacMoreSearches', '', NULL, 'Add additional elements to the OPAC more searches bar', 'Textarea'), ('OPACMySummaryHTML','','70|10','Enter the HTML that will appear in a column on the \'my summary\' and \'my reading history\' tabs when a user is logged in to the OPAC. Enter {BIBLIONUMBER}, {TITLE}, {AUTHOR}, or {ISBN} in place of their respective variables in the HTML. Leave blank to disable.','Textarea'), ('OPACMySummaryNote','','','Note to display on the patron summary page. This note only appears if the patron is connected.','Free'), ('OpacNav','Important links here.','70|10','Use HTML tags to add navigational links to the left-hand navigational bar in OPAC','Textarea'), 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 bb9c2a49e5..8d9b39636f 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 @@ -259,6 +259,11 @@ OPAC: type: textarea syntax: text/html class: code + - + - 'Add additional elements to the "More Searches" bar on the OPAC, with the following HTML (leave blank to disable):' + - pref: OpacMoreSearches + type: textarea + class: code - - 'Include a "Links" column on the "my summary" and "my reading history" tabs when a user is logged in to the OPAC, with the following HTML (leave blank to disable):' - '
    Note: The placeholders {BIBLIONUMBER}, {TITLE}, {ISBN} and {AUTHOR} will be replaced with information from the displayed record.' diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc index 3b5e9d9b8b..5a0ff60604 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc @@ -285,6 +285,7 @@
  • Purchase suggestions
  • [% END %] [% END %] + [% Koha.Preference('OpacMoreSearches') | $raw %] -- 2.39.5