Bug 22311: Add a SysPref to allow adding content to the #moresearches div in the...
authorKyle M Hall <kyle@bywatersolutions.com>
Fri, 22 Feb 2019 13:00:33 +0000 (08:00 -0500)
committerNick Clemens <nick@bywatersolutions.com>
Wed, 17 Apr 2019 12:25:25 +0000 (12:25 +0000)
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:
    <li><a href="https://duckduckgo.com/">Duck Duck Go</a></li>
4) Browse to the OPAC
5) Note your new link displays in the "moresearches" area of the OPAC.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

installer/data/mysql/atomicupdate/bug_22311.perl [new file with mode: 0644]
installer/data/mysql/sysprefs.sql
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc

diff --git a/installer/data/mysql/atomicupdate/bug_22311.perl b/installer/data/mysql/atomicupdate/bug_22311.perl
new file mode 100644 (file)
index 0000000..64527cc
--- /dev/null
@@ -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";
+}
index a349e20..0b4a2e9 100644 (file)
@@ -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<hr>','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'),
index bb9c2a4..8d9b396 100644 (file)
@@ -260,6 +260,11 @@ OPAC:
               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):'
             - '<br />Note: The placeholders {BIBLIONUMBER}, {TITLE}, {ISBN} and {AUTHOR} will be replaced with information from the displayed record.'
             - pref: OPACMySummaryHTML
index 3b5e9d9..5a0ff60 100644 (file)
                                             <li><a href="/cgi-bin/koha/opac-suggestions.pl">Purchase suggestions</a></li>
                                         [% END %]
                                     [% END %]
+                                    [% Koha.Preference('OpacMoreSearches') | $raw %]
                                 </ul>
                             </div> <!-- /#moresearches -->
                     </div> <!-- /.row-fluid -->