From 87ac5803aaab95ba269a49568b3d7d08319ea913 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Wed, 18 Nov 2020 23:44:43 +0000 Subject: [PATCH] Bug 26630: Add OpacSuggestionInstructions options to News Test plan: 1. Apply patch 2. Go to /cgi-bin/koha/tools/koha-news.pl and create 'New entry' with a dsiplay location of OpacSuggestionInstructions 3. Login to the OPAC and go to the purchase suggestion page (/cgi-bin/koha/opac-suggestions.pl) 4. Your new content should be there. 5. Delete the OpacSuggestionInstructions news entry. 6. Re-load the OPAC purchase suggestion page and the original text will be restored. Signed-off-by: Kelly McElligott Signed-off-by: Martin Renvoize --- .../prog/en/modules/tools/koha-news.tt | 2 +- .../bootstrap/en/modules/opac-suggestions.tt | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt index 2ad87f82a6..8393dc00b3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt @@ -403,7 +403,7 @@ Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %] [% END %] [% FOREACH lang_lis IN lang_list %] - [% FOREACH location IN [ '', 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions'] %] + [% FOREACH location IN [ '', 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacSuggestionInstructions'] %] [% IF ( location == '' ) %] [% SET location_lang = lang_lis.language %] [% location = BLOCK %]OPAC news[% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt index d5dde87f01..e6e8197924 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt @@ -4,6 +4,8 @@ [% USE Branches %] [% USE AuthorisedValues %] [% USE KohaDates %] +[% USE KohaNews %] +[% SET opacsuggestion = KohaNews.get( location => "OpacSuggestioninstructions", lang => lang, library => branchcode ) %] [% INCLUDE 'doc-head-open.inc' %] [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog › [% IF ( op_add ) %]Enter a new purchase suggestion[% END %] @@ -47,11 +49,14 @@ <h1 class="TooManySuggestions">You cannot place any more suggestions</h1> <h2 class="TooManySuggestionsText">You have reached your limit for suggestions you can place at this time ([% Koha.Preference('MaxOpenSuggestions') | html %]). Once the library has processed those suggestions you will be able to place more.</h2> [% ELSE %] - <h1>Enter a new purchase suggestion</h1> - - <p>Please fill out this form to make a purchase suggestion. You will receive an email when the library processes your suggestion.</p> - <p>Only certain fields (marked in red) are required, but the more information you enter the easier it will be for the librarians to find the title you're requesting. The "Notes" field can be used to provide any additional information.</p> + [% IF ( opacsuggestion ) %] + [% PROCESS koha_news_block news => opacsuggestion %] + [% ELSE %] + <h1>Enter a new purchase suggestion</h1> + <p>Please fill out this form to make a purchase suggestion. You will receive an email when the library processes your suggestion.</p> + <p>Only certain fields (marked in red) are required, but the more information you enter the easier it will be for the librarians to find the title you're requesting. The "Notes" field can be used to provide any additional information.</p> + [% END %] [% FOR m IN messages %] <div class="alert alert-[% m.type | html %]"> [% SWITCH m.code %] -- 2.20.1