From 5fd7a8094f53c8fa1e3a78d4bd4d883f02661c65 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 --- .../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 786e644a5d..8353980000 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 8dd7e58409..d27ee41700 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt @@ -1149,14 +1149,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.30.2