From be1bc4451187cb780d78e3f597a3763da606d472 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 30 Jul 2026 14:50:32 -0400 Subject: [PATCH] Bug 43206: cn_browser plugin red background on exact match is hard to read This patch updates the cn_browser plugin output so that table rows are highlighted using row classes and in colors which have sufficient contrast. To test, apply the patch and set your 952$o tag to use the cn_browser plugin: - Administration -> MARC bibliographic frameworks -> BKS -> MARC Structure -> Tag 952 -> Edit subfields. - Under the "Full call number" tab (o), set the "Plugin" dropdown to "cn_browser.pl" and save your changes. - Go to Cataloging and locate a bibliographic record using the cataloging search. - Add or edit items. NOTE: In the testing data there is only one item with a callnumber and it is "FIC/kas" - In the "o - Full call number" field, type "FIC" and then click the plugin editor image. - You should see the record with the "FIC/kas" call number and a green row right above it (indicating where an item with the call number "FIC" would be in the results). - Revise your search using the form at the top, entering "FIC/kas". - The record row should now be highlighted in pale yellow. Sponsored-by: Athens County Public Libraries Signed-off-by: Gretchen Signed-off-by: Andrew Fuerste Henry Signed-off-by: Pedro Amorim --- .../cataloguing/value_builder/cn_browser.tt | 43 +++++++++++++------ 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/cn_browser.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/cn_browser.tt index 545ae7a5c0..70b7c31169 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/cn_browser.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/cn_browser.tt @@ -13,6 +13,16 @@ [% END %] [% INCLUDE 'doc-head-close.inc' %] +[% FILTER collapse %] + +[% END %] @@ -29,14 +39,14 @@
  1. - +
  2. - [% FOREACH class_source IN class_sources %] [% IF class_source.cn_source == cn_source %] @@ -55,8 +65,8 @@
    - + + @@ -65,13 +75,19 @@ [% IF Koha.Preference('item-level_itypes') %] [% END %] - + + [% FOREACH cn_loo IN cn_loop %] - - - + + - - - + + + [% IF Koha.Preference('item-level_itypes') %] - + [% END %] + [% row_class = "" %] [% END %]
    Call number Title LibraryItem type
    [% cn_loo.itemcallnumber | html %] + [% SWITCH ( cn_loo.background ) %] + [% CASE "red" %] + [% SET row_class="match" %] + [% CASE "green" %] + [% SET row_class="position" %] + [% END %] +
    [% cn_loo.itemcallnumber | html %] [% cn_loo.title | html %] [% cn_loo.subtitle | html %] [% cn_loo.subtitle2 | html %] [% IF ( cn_loo.author ) %] @@ -80,13 +96,14 @@ [% IF ( cn_loo.barcode ) %]([% cn_loo.barcode | html %])[% END %] [% cn_loo.branchname | html %][% AuthorisedValues.GetByCode( 'CCODE', cn_loo.ccode ) | html %][% AuthorisedValues.GetByCode( 'LOC', cn_loo.location ) | html %][% cn_loo.branchname | html %][% AuthorisedValues.GetByCode( 'CCODE', cn_loo.ccode ) | html %][% AuthorisedValues.GetByCode( 'LOC', cn_loo.location ) | html %][% ItemTypes.GetDescription( cn_loo.itype ) | html %][% ItemTypes.GetDescription( cn_loo.itype ) | html %]