From 7f5732903339ef443cc6a0017212f9206af312c2 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 Signed-off-by: Tomas Cohen Arazi --- 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 9e40d4f55d..d6414ac7ba 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl @@ -1061,6 +1061,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 f91a243b16..098e6b0b54 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl @@ -999,6 +999,27 @@ + + + + + Content warning: + + + + + + + + abcdefgijklnou + + + + | + + + + -- 2.39.5