View | Details | Raw Unified | Return to bug 34869
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug-34869-move-opacresultssidebar-to-additional-contents.pl (+31 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "34869",
5
    description => "Move OPACResultsSidebar to additional contents",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        # Get any existing value from the OPACResultsSidebar system preference
11
        my ($opacresultssidebar) = $dbh->selectrow_array(
12
            q|
13
            SELECT value FROM systempreferences WHERE variable='OPACResultsSidebar';
14
        |
15
        );
16
        if ($opacresultssidebar) {
17
18
            # Insert any values found from system preference into additional_contents
19
            foreach my $lang ('default') {
20
                $dbh->do(
21
                    "INSERT INTO additional_contents ( category, code, location, branchcode, title, content, lang, published_on ) VALUES ('html_customizations', 'OPACResultsSidebar', 'OPACResultsSidebar', NULL, ?, ?, ?, CAST(NOW() AS date) )",
22
                    undef, "OPACResultsSidebar $lang", $opacresultssidebar, $lang
23
                );
24
            }
25
26
            # Remove old system preference
27
            $dbh->do("DELETE FROM systempreferences WHERE variable='OPACResultsSidebar'");
28
            say $out "Bug 34869 update done";
29
        }
30
    }
31
    }
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 lines)
Lines 500-506 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
500
('OPACReportProblem', 0, NULL, 'Allow patrons to submit problem reports for OPAC pages to the library or Koha Administrator', 'YesNo'),
500
('OPACReportProblem', 0, NULL, 'Allow patrons to submit problem reports for OPAC pages to the library or Koha Administrator', 'YesNo'),
501
('OpacResetPassword','0','','Shows the ''Forgot your password?'' link in the OPAC','YesNo'),
501
('OpacResetPassword','0','','Shows the ''Forgot your password?'' link in the OPAC','YesNo'),
502
('OPACResultsLibrary', 'homebranch', 'homebranch|holdingbranch', 'Defines whether the OPAC displays the holding or home branch in search results when using XSLT', 'Choice'),
502
('OPACResultsLibrary', 'homebranch', 'homebranch|holdingbranch', 'Defines whether the OPAC displays the holding or home branch in search results when using XSLT', 'Choice'),
503
('OPACResultsSidebar','','70|10','Define HTML to be included on the search results page, underneath the facets sidebar','Textarea'),
504
('OPACResultsUnavailableGroupingBy','branch','branch|substatus|branchonly','Group OPAC XSLT results by branch and substatus, or substatus only, or branch only','Choice'),
503
('OPACResultsUnavailableGroupingBy','branch','branch|substatus|branchonly','Group OPAC XSLT results by branch and substatus, or substatus only, or branch only','Choice'),
505
('OPACSearchForTitleIn','<a href=\"https://worldcat.org/search?q={TITLE}\" target=\"_blank\">Other Libraries (WorldCat)</a>\n<a href=\"https://scholar.google.com/scholar?q={TITLE}\" target=\"_blank\">Other Databases (Google Scholar)</a>\n<a href=\"https://www.bookfinder.com/search/?author={AUTHOR}&amp;title={TITLE}&amp;st=xl&amp;ac=qr\" target=\"_blank\">Online Stores (Bookfinder.com)</a>\n<a href=\"https://openlibrary.org/search?author=({AUTHOR})&title=({TITLE})\" target=\"_blank\">Open Library (openlibrary.org)</a>','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'),
504
('OPACSearchForTitleIn','<a href=\"https://worldcat.org/search?q={TITLE}\" target=\"_blank\">Other Libraries (WorldCat)</a>\n<a href=\"https://scholar.google.com/scholar?q={TITLE}\" target=\"_blank\">Other Databases (Google Scholar)</a>\n<a href=\"https://www.bookfinder.com/search/?author={AUTHOR}&amp;title={TITLE}&amp;st=xl&amp;ac=qr\" target=\"_blank\">Online Stores (Bookfinder.com)</a>\n<a href=\"https://openlibrary.org/search?author=({AUTHOR})&title=({TITLE})\" target=\"_blank\">Open Library (openlibrary.org)</a>','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'),
506
('OpacSeparateHoldings','0',NULL,'Separate current branch holdings from other holdings (OPAC)','YesNo'),
505
('OpacSeparateHoldings','0',NULL,'Separate current branch holdings from other holdings (OPAC)','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-6 lines)
Lines 249-260 OPAC: Link Here
249
              type: textarea
249
              type: textarea
250
              syntax: text/html
250
              syntax: text/html
251
              class: code
251
              class: code
252
        -
253
            - "Include the following HTML under the facets in OPAC search results:"
254
            - pref: OPACResultsSidebar
255
              type: textarea
256
              syntax: text/html
257
              class: code
258
        -
252
        -
259
            - pref: OpacAddMastheadLibraryPulldown
253
            - pref: OpacAddMastheadLibraryPulldown
260
              choices: 
254
              choices: 
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt (-1 / +1 lines)
Lines 494-500 Link Here
494
            [% END %]
494
            [% END %]
495
        [% END %]
495
        [% END %]
496
    [% ELSE %]
496
    [% ELSE %]
497
        [% SET available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup' ] %]
497
        [% SET available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup', 'OPACResultsSidebar' ] %]
498
        [% FOREACH l IN available_options.sort %]
498
        [% FOREACH l IN available_options.sort %]
499
            [% IF l == location %]
499
            [% IF l == location %]
500
                <option value="[% l | html %]" selected="selected">[% l | html %]</option>
500
                <option value="[% l | html %]" selected="selected">[% l | html %]</option>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc (-2 / +3 lines)
Lines 1-6 Link Here
1
[% USE raw %]
1
[% USE raw %]
2
[% USE AuthorisedValues %]
2
[% USE AuthorisedValues %]
3
[% USE Languages %]
3
[% USE Languages %]
4
[% USE AdditionalContents %]
5
[% SET OPACResultsSidebar = AdditionalContents.get( location => "OPACResultsSidebar", lang => lang, library => branchcode || default_branch ) %]
4
[% IF ( opacfacets && facets_loop && total ) %]
6
[% IF ( opacfacets && facets_loop && total ) %]
5
    <div id="search-facets">
7
    <div id="search-facets">
6
        <h2><a href="#" class="menu-collapse-toggle">Refine your search</a></h2>
8
        <h2><a href="#" class="menu-collapse-toggle">Refine your search</a></h2>
Lines 101-107 Link Here
101
103
102
    [% IF ( OPACResultsSidebar ) %]
104
    [% IF ( OPACResultsSidebar ) %]
103
        <div id="opacresultssidebar">
105
        <div id="opacresultssidebar">
104
            [% OPACResultsSidebar | $raw %]
106
            [% PROCESS koha_news_block news => OPACResultsSidebar %]
105
        </div>
107
        </div>
106
    [% END %]
108
    [% END %]
107
[% END # / IF opacfacets && facets_loop %]
109
[% END # / IF opacfacets && facets_loop %]
108
- 

Return to bug 34869