From b62414f613faa5d1de142e3bcf12d375f4df67a0 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 8 Sep 2022 15:07:57 +0100 Subject: [PATCH] Bug 31123: Display content warnings on the intranet This patch adds handling to our XSLT processing to pass the new `ContentWarningField` preference value to the stylesheets and then uses that variable to add content warning notes to both the detail and search result displays of the staff client. Test plan 1) Run the database update to expose the new system preference 2) Set `ContentWarningField` to something sensible, like `599` 3) Add the above select field to one of your frameworks with a subfield `a`. 4) Edit a record with that framework to add a content warning into the record 5) Search for the record and confirm you now see `Content warning: Your test text` 6) Click into the record detail and confirm you see the content warning text there too 7) Bonus points: Assign a new authorized value category to the chosen field and subfield and confirm the staff client display text is used in the above tests. --- C4/XSLT.pm | 2 +- .../en/xslt/MARC21slim2intranetDetail.xsl | 22 +++++++++++++++++++ .../en/xslt/MARC21slim2intranetResults.xsl | 21 ++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/C4/XSLT.pm b/C4/XSLT.pm index 0fb7be0d6c..dd73af5b9b 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -171,7 +171,7 @@ sub get_xslt_sysprefs { OPACResultsLibrary OPACShowOpenURL OpenURLResolverURL OpenURLImageLocation OPACResultsMaxItems OPACResultsMaxItemsUnavailable OPACResultsUnavailableGroupingBy - OpenURLText OPACShowMusicalInscripts OPACPlayMusicalInscripts / ) + OpenURLText OPACShowMusicalInscripts OPACPlayMusicalInscripts ContentWarningField / ) { my $sp = C4::Context->preference( $syspref ); next unless defined($sp); diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl index acaf38a650..2c86e445ac 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl @@ -1053,6 +1053,28 @@ + + + + + Content warning: + + + + + + + + abcdefgijklnou + + + + | + + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl index ab6bbb9530..cc3e353a9b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl @@ -1010,6 +1010,27 @@ + + + + + Content warning: + + + + + + + + abcdefgijklnou + + + + | + + + + -- 2.20.1