From 7e36a3ddd5037e3f7cf3b747dadd562696fe515e Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 22 Aug 2022 11:03:20 +0100 Subject: [PATCH] Bug 31028: Use additional_contents for help block This patch updates the modal to use the additional_contents system for the modals help block --- installer/data/mysql/atomicupdate/bug_31028.pl | 9 +++++++++ installer/data/mysql/en/optional/sample_news.yml | 11 +++++++++++ .../prog/en/includes/modals/add_catalog_concern.inc | 8 +++++++- .../prog/en/modules/tools/additional-contents.tt | 2 +- .../bootstrap/en/includes/modals/catalog_concern.inc | 8 +++++++- 5 files changed, 35 insertions(+), 3 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_31028.pl b/installer/data/mysql/atomicupdate/bug_31028.pl index 6be890a4de..64b1abb0b9 100644 --- a/installer/data/mysql/atomicupdate/bug_31028.pl +++ b/installer/data/mysql/atomicupdate/bug_31028.pl @@ -62,5 +62,14 @@ return { } ); + + if ( ( $dbh->selectrow_array('SELECT COUNT(*) FROM additional_contents WHERE location=?', undef, 'CatalogConcernHelp') )[0] == 0 ) { # Check to make idempotent + $dbh->do( + q{ + INSERT INTO additional_contents ( category, code, location, title, content, lang, published_on ) VALUES ('html_customizations', 'CatalogConcernHelp_1', 'CatalogConcernHelp', 'Catalog concern help text', 'Please describe your concern clearly and the library will try to deal with it as quickly as possible', 'default', CAST(NOW() AS date) ) + } + ); + } + }, } diff --git a/installer/data/mysql/en/optional/sample_news.yml b/installer/data/mysql/en/optional/sample_news.yml index 7023d8c02a..543e9faf87 100644 --- a/installer/data/mysql/en/optional/sample_news.yml +++ b/installer/data/mysql/en/optional/sample_news.yml @@ -55,3 +55,14 @@ tables: published_on: "2007-10-29 05:34:45" expirationdate: "2099-01-10" number: 2 + + - title: "" + category: "html_customizations" + location: "CatalogConcernHelp" + code: "CatalogConcernHelp_1" + content: + - "Please describe your concern clearly and the library will try to deal with it as quickly as possible" + lang: "default" + published_on: "2007-10-29 05:25:58" + expirationdate: "2099-01-10" + number: 1 diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/modals/add_catalog_concern.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/add_catalog_concern.inc index 10bf54c9bb..87174fe594 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/modals/add_catalog_concern.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/add_catalog_concern.inc @@ -1,3 +1,5 @@ +[% USE AdditionalContents %] +[% SET CatalogConcernHelp = AdditionalContents.get( location => "CatalogConcernHelp", lang => lang, library => logged_in_user.branchcode ) %]