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 503-509 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
503
('OPACReportProblem', 0, NULL, 'Allow patrons to submit problem reports for OPAC pages to the library or Koha Administrator', 'YesNo'),
503
('OPACReportProblem', 0, NULL, 'Allow patrons to submit problem reports for OPAC pages to the library or Koha Administrator', 'YesNo'),
504
('OpacResetPassword','0','','Shows the ''Forgot your password?'' link in the OPAC','YesNo'),
504
('OpacResetPassword','0','','Shows the ''Forgot your password?'' link in the OPAC','YesNo'),
505
('OPACResultsLibrary', 'homebranch', 'homebranch|holdingbranch', 'Defines whether the OPAC displays the holding or home branch in search results when using XSLT', 'Choice'),
505
('OPACResultsLibrary', 'homebranch', 'homebranch|holdingbranch', 'Defines whether the OPAC displays the holding or home branch in search results when using XSLT', 'Choice'),
506
('OPACResultsSidebar','','70|10','Define HTML to be included on the search results page, underneath the facets sidebar','Textarea'),
507
('OPACResultsUnavailableGroupingBy','branch','branch|substatus|branchonly','Group OPAC XSLT results by branch and substatus, or substatus only, or branch only','Choice'),
506
('OPACResultsUnavailableGroupingBy','branch','branch|substatus|branchonly','Group OPAC XSLT results by branch and substatus, or substatus only, or branch only','Choice'),
508
('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'),
507
('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'),
509
('OpacSeparateHoldings','0',NULL,'Separate current branch holdings from other holdings (OPAC)','YesNo'),
508
('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 245-256 OPAC: Link Here
245
              type: textarea
245
              type: textarea
246
              syntax: text/html
246
              syntax: text/html
247
              class: code
247
              class: code
248
        -
249
            - "Include the following HTML under the facets in OPAC search results:"
250
            - pref: OPACResultsSidebar
251
              type: textarea
252
              syntax: text/html
253
              class: code
254
        -
248
        -
255
            - pref: OpacAddMastheadLibraryPulldown
249
            - pref: OpacAddMastheadLibraryPulldown
256
              choices: 
250
              choices: 
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt (-1 / +1 lines)
Lines 524-530 Link Here
524
            [% END %]
524
            [% END %]
525
        [% END %]
525
        [% END %]
526
    [% ELSE %]
526
    [% ELSE %]
527
        [% SET opac_available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'OpacMaintenanceNotice', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup' ] %]
527
        [% SET opac_available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'OpacMaintenanceNotice', 'OPACResultsSidebar', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup' ] %]
528
        <optgroup label="OPAC">
528
        <optgroup label="OPAC">
529
            [% FOREACH l IN opac_available_options.sort %]
529
            [% FOREACH l IN opac_available_options.sort %]
530
                [% IF l == location %]
530
                [% IF l == location %]
(-)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