From 2f38969e4932aa0aab26ebfb5f276814f8228f1b 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 --- installer/data/mysql/atomicupdate/bug_22311.perl | 10 ++++++++++ installer/data/mysql/sysprefs.sql | 1 + .../intranet-tmpl/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 be111b6a65..92cb19e58b 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -381,6 +381,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 da1d86540c..faa090ea70 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 @@ -250,6 +250,11 @@ OPAC: type: textarea 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.' - pref: OPACMySummaryHTML diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc index 9466c2d9c6..3aee568cbe 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc @@ -284,6 +284,7 @@
  • Purchase suggestions
  • [% END %] [% END %] + [% Koha.Preference('OpacMoreSearches') | $raw %] -- 2.11.0