Bug 31123: Display content warnings on the intranet
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 8 Sep 2022 14:07:57 +0000 (15:07 +0100)
committerTomas Cohen Arazi <tomascohen@theke.io>
Thu, 6 Apr 2023 13:44:58 +0000 (10:44 -0300)
commit7f5732903339ef443cc6a0017212f9206af312c2
tree1d390a420593ed3176544d5613a1d622d5b3dc7c
parentb85e966e160bafa2bbc2d7e28da9f073bba60572
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 <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
C4/XSLT.pm
koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl
koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl