From eac6eee5937652eb54eada1bdec9666fb6218c11 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 19 Oct 2022 13:56:51 +0000 Subject: [PATCH] Bug 19361: Display unauthorized values when cataloging and add a warning This patch adds a warning and tool tip when an unauthorised vlaue is encountered during item or biblio editing, and adds the value to the list to allow preserving the value (in case the librarian is only editing another part of the record, or there is some reason to retain) To test: 1 - Edit a record in advanced cataloging editor 2 - Under settings click 'Show fields verbatim' 3 - Edit 942$c to 'HAM' or some other invalid itemtype 4 - Save record 5 - sudo koha-mysql kohadev UPDATE items SET location = 'HAM' WHERE biblionumber = {biblionumber from above} 6 - Edit the biblio and items, confirm the HAM value shows in dropdowns Signed-off-by: Andrew Fuerste-Henry Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 1dc022513cea57afb39e49273ffc3043d0094cd5) Signed-off-by: Matt Blenkinsop --- .../intranet-tmpl/prog/en/includes/html_helpers.inc | 11 ++++++++++- .../prog/en/modules/cataloguing/addbiblio.tt | 11 +++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc index 14827da355..76b25a68a5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc @@ -109,8 +109,10 @@ + [% UNLESS matched || ( ( kohafield == 'items.damaged' || kohafield == 'items.itemlost' || kohafield == 'items.withdrawn' || kohafield == 'items.notforloan' ) && mv.default == '0' ) %] + [%# If the current value is not in the authorised list and is not a field where 0 means unset #%] + + + + [% ELSE %] + + [% END %] [% ELSIF ( mv.type == 'text_auth' ) %] [% IF mv.readonly %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt index 93415444a6..0789780765 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt @@ -1148,14 +1148,25 @@ function PopupMARCFieldDoc(field) { [% ELSE %] + + [% ELSE %] + [% END %] + [% UNLESS matched # If the current value is not in the authorised list %] + [% END %] [% END # /IF (mv.type...) %] [% IF ( subfield_loo.mandatory ) %] -- 2.20.1