Bug 34869: Convert OPACResultsSidebar system preference to HTML customization
This patch moves the OPACResultsSidebar system preference into HTML customizations, making it possible to have language- and library-specific content. To test you should have some content in the OPACResultsSidebar system preference before applying the patch. Apply the patch and run the database update process. - Go to the OPAC and perform a catalog search. - Confirm that the content in the sidebar under the search facets, which was previously in the OPACResultsSidebar system preference, is still displayed. - In the staff client, go to Tools -> HTML customizations and verify that the content from OPACResultsSidebar is now stored there. - The HTML customization entry form should offer OPACResultsSidebar as a choice under "Display location." - Update and reinstall active translations (for instance fr-FR): - cd misc/translator/ - perl translate update fr-FR - perl translate install fr-FR - Enable the translation if necessary under Administration -> System preferences -> language. - Enable the "opaclanguagesdisplay" preference if necessary. - Edit the OPACResultsSidebar HTML customization and add unique content to the "fr-FR" tab. - Go to the OPAC and switch to your updated translation. Perform another catalog search to confirm that the content you added for your translation shows up correctly. - Go to Administration -> System preferences and confirm that the OPACResultsSidebar preference has been removed. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
15fefd7c3e
commit
781ef6c4c4
5 changed files with 35 additions and 9 deletions
|
@ -0,0 +1,31 @@
|
|||
use Modern::Perl;
|
||||
|
||||
return {
|
||||
bug_number => "34869",
|
||||
description => "Move OPACResultsSidebar to additional contents",
|
||||
up => sub {
|
||||
my ($args) = @_;
|
||||
my ( $dbh, $out ) = @$args{qw(dbh out)};
|
||||
|
||||
# Get any existing value from the OPACResultsSidebar system preference
|
||||
my ($opacresultssidebar) = $dbh->selectrow_array(
|
||||
q|
|
||||
SELECT value FROM systempreferences WHERE variable='OPACResultsSidebar';
|
||||
|
|
||||
);
|
||||
if ($opacresultssidebar) {
|
||||
|
||||
# Insert any values found from system preference into additional_contents
|
||||
foreach my $lang ('default') {
|
||||
$dbh->do(
|
||||
"INSERT INTO additional_contents ( category, code, location, branchcode, title, content, lang, published_on ) VALUES ('html_customizations', 'OPACResultsSidebar', 'OPACResultsSidebar', NULL, ?, ?, ?, CAST(NOW() AS date) )",
|
||||
undef, "OPACResultsSidebar $lang", $opacresultssidebar, $lang
|
||||
);
|
||||
}
|
||||
|
||||
# Remove old system preference
|
||||
$dbh->do("DELETE FROM systempreferences WHERE variable='OPACResultsSidebar'");
|
||||
say $out "Bug 34869 update done";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -507,7 +507,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
|
|||
('OPACReportProblem', 0, NULL, 'Allow patrons to submit problem reports for OPAC pages to the library or Koha Administrator', 'YesNo'),
|
||||
('OpacResetPassword','0','','Shows the ''Forgot your password?'' link in the OPAC','YesNo'),
|
||||
('OPACResultsLibrary', 'homebranch', 'homebranch|holdingbranch', 'Defines whether the OPAC displays the holding or home branch in search results when using XSLT', 'Choice'),
|
||||
('OPACResultsSidebar','','70|10','Define HTML to be included on the search results page, underneath the facets sidebar','Textarea'),
|
||||
('OPACResultsUnavailableGroupingBy','branch','branch|substatus|branchonly','Group OPAC XSLT results by branch and substatus, or substatus only, or branch only','Choice'),
|
||||
('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}&title={TITLE}&st=xl&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'),
|
||||
('OpacSeparateHoldings','0',NULL,'Separate current branch holdings from other holdings (OPAC)','YesNo'),
|
||||
|
|
|
@ -245,12 +245,6 @@ OPAC:
|
|||
type: textarea
|
||||
syntax: text/html
|
||||
class: code
|
||||
-
|
||||
- "Include the following HTML under the facets in OPAC search results:"
|
||||
- pref: OPACResultsSidebar
|
||||
type: textarea
|
||||
syntax: text/html
|
||||
class: code
|
||||
-
|
||||
- pref: OpacAddMastheadLibraryPulldown
|
||||
choices:
|
||||
|
|
|
@ -524,7 +524,7 @@
|
|||
[% END %]
|
||||
[% END %]
|
||||
[% ELSE %]
|
||||
[% SET opac_available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'OpacMaintenanceNotice', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup' ] %]
|
||||
[% SET opac_available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'OpacMaintenanceNotice', 'OPACResultsSidebar', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup' ] %]
|
||||
<optgroup label="OPAC">
|
||||
[% FOREACH l IN opac_available_options.sort %]
|
||||
[% IF l == location %]
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
[% USE AuthorisedValues %]
|
||||
[% USE Languages %]
|
||||
[% PROCESS 'i18n.inc' %]
|
||||
[% USE AdditionalContents %]
|
||||
[% SET OPACResultsSidebar = AdditionalContents.get( location => "OPACResultsSidebar", lang => lang, library => branchcode || default_branch ) %]
|
||||
[% IF ( opacfacets && facets_loop && total ) %]
|
||||
<div id="search-facets">
|
||||
<h2><a href="#" class="menu-collapse-toggle">Refine your search</a></h2>
|
||||
|
@ -122,7 +124,7 @@
|
|||
|
||||
[% IF ( OPACResultsSidebar ) %]
|
||||
<div id="opacresultssidebar">
|
||||
[% OPACResultsSidebar | $raw %]
|
||||
[% PROCESS koha_news_block news => OPACResultsSidebar %]
|
||||
</div>
|
||||
[% END %]
|
||||
[% END # / IF opacfacets && facets_loop %]
|
||||
|
|
Loading…
Reference in a new issue