Bugzilla – Attachment 68776 Details for
Bug 19096
Koha to MARC mappings (Part 2): Make Default authoritative
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19096: Do not allow changes to kohafield within MARC frameworks
Bug-19096-Do-not-allow-changes-to-kohafield-within.patch (text/plain), 5.43 KB, created by
Kyle M Hall (khall)
on 2017-10-27 16:53:44 UTC
(
hide
)
Description:
Bug 19096: Do not allow changes to kohafield within MARC frameworks
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2017-10-27 16:53:44 UTC
Size:
5.43 KB
patch
obsolete
>From b70915b678a85621c4ef876eef06789b8d0e8698 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 19096: Do not allow changes to kohafield within MARC > frameworks > >This patch makes two changes in the script for managing the MARC >frameworks in order 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. > Note: Although we could leave the field empty, since Koha looks at the > Default framework only, it does not cost much to keep these fields in > sync with Default and perhaps catch a bug when someone somewhere looks > in the wrong framework. > >Note: The description of Koha to MARC mapping on admin-home has been >adjusted accordingly (removing last two lines). > >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. > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > admin/marc_subfields_structure.pl | 5 +++++ > koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt | 2 +- > .../intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt | 5 ++++- > 3 files changed, 10 insertions(+), 2 deletions(-) > >diff --git a/admin/marc_subfields_structure.pl b/admin/marc_subfields_structure.pl >index ebec042..9b478fa 100755 >--- a/admin/marc_subfields_structure.pl >+++ b/admin/marc_subfields_structure.pl >@@ -310,6 +310,11 @@ elsif ( $op eq 'add_validate' ) { > ), > ); > } else { >+ if( $frameworkcode ne q{} ) { >+ # BZ 19096: Overwrite kohafield from Default when adding a new record >+ my $rec = Koha::MarcSubfieldStructures->find( q{}, $tagfield, $tagsubfield ); >+ $kohafield = $rec->kohafield if $rec; >+ } > $sth_insert->execute( > $tagfield, > $tagsubfield, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt >index 0d43e6f..71341c1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt >@@ -70,7 +70,7 @@ > <dt><a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC bibliographic framework</a></dt> > <dd>Create and manage Bibliographic frameworks that define the characteristics of your MARC Records (field and subfield definitions) as well as templates for the MARC editor.</dd> > <dt><a href="/cgi-bin/koha/admin/koha2marclinks.pl">Koha to MARC mapping</a></dt> >- <dd>Define the mapping between the Koha transactional database (SQL) and the MARC Bibliographic records. Note that the mapping can be defined through MARC Bibliographic Framework. This tool is just a shortcut to speed up linkage.</dd> >+ <dd>Define the mapping between the Koha transactional database (SQL) and the MARC Bibliographic records.</dd> > <dt><a href="/cgi-bin/koha/admin/fieldmapping.pl">Keywords to MARC mapping</a></dt> > <dd>Define the mapping between keywords and MARC fields. The keywords are used to find some data independently of the framework.</dd> > <dt><a href="/cgi-bin/koha/admin/checkmarc.pl">MARC Bibliographic framework test</a></dt> >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.10.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 19096
:
66333
|
66334
|
66335
|
66336
|
66337
|
66338
|
66406
|
66407
|
66408
|
66409
|
66410
|
66411
|
67508
|
67509
|
67510
|
67511
|
67512
|
67513
|
67590
|
67591
|
67592
|
67593
|
67594
|
67595
|
68205
|
68206
|
68207
|
68208
|
68209
|
68210
|
68774
|
68775
| 68776 |
68777
|
68778
|
68779
|
69629
|
69646
|
69647
|
69681