From c1671a8c07ed9ebecba72b043ac67490328278d7 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. Signed-off-by: David Nind Signed-off-by: Nick Clemens --- C4/XSLT.pm | 2 +- .../en/xslt/MARC21slim2intranetDetail.xsl | 21 +++++++++++++++++++ .../en/xslt/MARC21slim2intranetResults.xsl | 21 +++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/C4/XSLT.pm b/C4/XSLT.pm index 21d270e3df..2b5c797de4 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -98,7 +98,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 c5fd064e63..9151496e24 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl @@ -1069,6 +1069,27 @@ + + + + + Content warning: + + + + + + + + abcdefgijklnou + + + + | + + + + Holdings: diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl index fa94894870..12f069d23f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl @@ -1007,6 +1007,27 @@ + + + + + Content warning: + + + + + + + + abcdefgijklnou + + + + | + + + + -- 2.30.2