Bugzilla – Attachment 142158 Details for
Bug 19361
Linking an authorised value category to a field in a framework can lose data
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19361: Display unauthorized values when cataloging and add a warning
Bug-19361-Display-unauthorized-values-when-catalog.patch (text/plain), 6.22 KB, created by
Nick Clemens (kidclamp)
on 2022-10-19 14:38:07 UTC
(
hide
)
Description:
Bug 19361: Display unauthorized values when cataloging and add a warning
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-10-19 14:38:07 UTC
Size:
6.22 KB
patch
obsolete
>From 16b584318522227cfd7b29e986406076a73eb502 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >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 >--- > .../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 237500bf7a..2d0f42c4d6 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 @@ > <select name="[% kohafield | html %]" id="[%- mv.id | html -%]" class="input_marceditor select2 [% kohafield | html %]" data-category="[% mv.category | html %]" data-width="50%"> > [% END %] > >+ [% SET matched = 0 %] > [% FOREACH aval IN mv.values %] > [% IF aval == mv.default %] >+ [% SET matched = 1 %] > <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option> > [% ELSE %] > [% IF subfield.IS_LOST_AV && Koha.Preference("ClaimReturnedLostValue") && aval == Koha.Preference("ClaimReturnedLostValue") %] >@@ -122,7 +124,14 @@ > [% END %] > [% END %] > [% END %] >- </select> >+ [% 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 #%] >+ <option value="[%- mv.default | html -%]" selected="selected">[%- mv.default | html -%]</option> >+ </select> >+ <span style="float:right;" title="The current value [% mv.default | html %] is not in the authorised value list"><i class="fa fa-exclamation-circle" aria-hidden="true"></i></span> >+ [% ELSE %] >+ </select> >+ [% END %] > [% ELSIF ( mv.type == 'text_auth' ) %] > [% IF mv.readonly %] > <input type="text" id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor [% kohafield | html %]" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" readonly="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 f16f5c8147..12bfcde203 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 %] > <select name="[%- mv.name | html -%]" tabindex="1" class="input_marceditor select2" id="[%- mv.id | html -%]"> > [% END %] >+ [% SET matched = 0 %] > [% FOREACH aval IN mv.values %] > [% IF aval == mv.default %] >+ [% SET matched = 1 %] > <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option> > [% ELSE %] > <option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option> > [% END %] >+ > [% END %] >+ [% UNLESS matched # If the current value is not in the authorised list %] >+ <option value="[%- mv.default | html -%]" selected="selected">[%- mv.default | html -%]</option> >+ </select> >+ <span style="float:right;" title="The current value [% mv.default | html %] is not in the authorised value list"><i class="fa fa-exclamation-circle" aria-hidden="true"></i></span> >+ [% ELSE %] > </select> >+ [% END %] >+ [% UNLESS matched # If the current value is not in the authorised list %] >+ [% END %] > [% END # /IF (mv.type...) %] > </div> > [% IF ( subfield_loo.mandatory ) %] >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 19361
:
67385
|
67652
|
67655
|
67657
|
67658
|
67955
|
105848
|
142158
|
142159
|
142208
|
142209
|
148377
|
148378
|
148379
|
148380