Bugzilla – Attachment 65545 Details for
Bug 10306
Koha to MARC mappings (Part 1): Allow multiple mappings per kohafield (for say 260/RDA 264)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10306: Do not allow changes to kohafield within MARC frameworks
Bug-10306-Do-not-allow-changes-to-kohafield-within.patch (text/plain), 3.38 KB, created by
Marcel de Rooy
on 2017-08-07 13:08:23 UTC
(
hide
)
Description:
Bug 10306: Do not allow changes to kohafield within MARC frameworks
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2017-08-07 13:08:23 UTC
Size:
3.38 KB
patch
obsolete
>From bfd13b70ae785f4c22ece3dbb48314b547dd666e Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 7 Aug 2017 15:02:10 +0200 >Subject: [PATCH] Bug 10306: Do not allow changes to kohafield within MARC > frameworks >Content-Type: text/plain; charset=utf-8 > >This patch makes two changes to support making the Default authoritative >as for Koha to MARC mappings: > >[1] Disable the kohafield select combo. Add a hidden input to save value. >[2] When a new subfield is added, the kohafield is still empty and should > be overwritten with its Default counterpart. > >Test plan: >[1] Add a new tag and subfield in Default. >[2] Map it to a kohafield in koha2marclinks.pl >[3] Add the same tag and subfield in another framework. > Verify that the kohafield is updated after you saved the subfield. >--- > admin/marc_subfields_structure.pl | 4 ++++ > .../intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt | 5 ++++- > 2 files changed, 8 insertions(+), 1 deletion(-) > >diff --git a/admin/marc_subfields_structure.pl b/admin/marc_subfields_structure.pl >index 077a58b..0f61e22 100755 >--- a/admin/marc_subfields_structure.pl >+++ b/admin/marc_subfields_structure.pl >@@ -310,6 +310,10 @@ elsif ( $op eq 'add_validate' ) { > ), > ); > } else { >+ if( my $rs = Koha::MarcSubfieldStructures->search({ frameworkcode => q{}, tagfield => $tagfield, tagsubfield => $tagsubfield }) ) { >+ # Overwrite empty kohafield from Default >+ $kohafield = $rs->next->kohafield; >+ } > $sth_insert->execute( > $tagfield, > $tagsubfield, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt >index efdac8d..65d8624 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt >@@ -143,7 +143,8 @@ > <li><label for="link[% loo.row %]">Link:</label><input type="text" id="link[% loo.row %]" name="link" value="[% loo.link %]" size="10" maxlength="80" /> (e.g., Title or Local-Number) <span class="error"><em>NOTE: If you change this value you must ask your administrator to run misc/batchRebuildBiblioTables.pl.</em></span></li> > <li> > <label for="kohafield[% loo.row %]">Koha link:</label> >- <select name="kohafield" id="kohafield[% loo.row %]" size="1"> >+ <!-- This select should be DISABLED; value is submitted by the following hidden input --> >+ <select name="kohafield" id="kohafield[% loo.row %]" size="1" disabled> > [% FOREACH value IN loo.kohafields %] > [% IF ( value == loo.kohafield ) %] > <option value="[% value %]" selected="selected">[% value %]</option> >@@ -152,6 +153,8 @@ > [% END %] > [% END %] > </select> >+ <!-- Do NOT remove this next hidden input! We need it to save kohafield. --> >+ <input type="hidden" name="kohafield" value="[% loo.kohafield %]"/> > </li> > </ol> > </fieldset> >-- >2.1.4
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 10306
:
65539
|
65540
|
65541
|
65542
|
65543
|
65544
|
65545
|
65948
|
65949
|
65950
|
65951
|
65952
|
65953
|
66134
|
66135
|
66137
|
66138
|
66139
|
66140
|
66141
|
66142
|
66327
|
66328
|
66329
|
66330
|
66331
|
66332
|
66405
|
66547
|
66548
|
67501
|
67502
|
67503
|
67504
|
67505
|
67506
|
67507
|
68382
|
68766
|
68767
|
68768
|
68769
|
68770
|
68771
|
68772
|
68773