Bugzilla – Attachment 148006 Details for
Bug 18138
Use MARC modification template when adding/updating bibliographic records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18138: (follow-up) Adjust the system preference editor to allow choosing a modification template
Bug-18138-follow-up-Adjust-the-system-preference-e.patch (text/plain), 6.79 KB, created by
David Gustafsson
on 2023-03-09 14:51:26 UTC
(
hide
)
Description:
Bug 18138: (follow-up) Adjust the system preference editor to allow choosing a modification template
Filename:
MIME Type:
Creator:
David Gustafsson
Created:
2023-03-09 14:51:26 UTC
Size:
6.79 KB
patch
obsolete
>From 6666bf941a7f95304d58e7d21165f536d43669f5 Mon Sep 17 00:00:00 2001 >From: David Gustafsson <glasklas@gmail.com> >Date: Fri, 23 Jul 2021 16:37:22 +0200 >Subject: [PATCH] Bug 18138: (follow-up) Adjust the system preference editor to > allow choosing a modification template > >Rather than expecting the librarian to add an ID or a name we should provide a dropdown > >To test: >1 - Apply all patches >2 - Search for sytem preference 'SaveBiblioMarcModificationTemplate' >3 - Note it list all defined Marc modification templates >4 - Select one >5 - confirm value in DB is the template id > >Works fine for me > >Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se> >--- > admin/preferences.pl | 4 ++++ > ...18138-edit-biblio-marc-modification-template-syspref.sql | 2 +- > installer/data/mysql/mandatory/sysprefs.sql | 2 +- > .../prog/en/modules/admin/preferences/cataloguing.pref | 2 +- > .../www/EditBiblioMarcModificationTemplatePreference.t | 6 +++--- > 5 files changed, 10 insertions(+), 6 deletions(-) > >diff --git a/admin/preferences.pl b/admin/preferences.pl >index 45a5891c623..8b5596cc837 100755 >--- a/admin/preferences.pl >+++ b/admin/preferences.pl >@@ -29,6 +29,7 @@ use C4::Output qw( output_html_with_http_headers ); > use C4::Templates; > use Koha::Acquisition::Currencies; > use Koha::Database::Columns; >+use Koha::MarcModificationTemplates; > use IO::File; > use YAML::XS; > use Encode; >@@ -102,6 +103,9 @@ sub _get_chunk { > } elsif ( $options{choices} eq 'patron-categories' ) { > $options{choices} = { map { $_->categorycode => $_->description } Koha::Patron::Categories->search->as_list }; > $add_blank = 1; >+ } elsif ( $options{choices} eq 'modification-templates' ) { >+ $options{choices} = { map { $_->template_id => $_->name } Koha::MarcModificationTemplates->search }; >+ $add_blank = 1; > } else { > die 'Unrecognized source of preference values: ' . $options{'choices'}; > } >diff --git a/installer/data/mysql/atomicupdate/bug_18138-edit-biblio-marc-modification-template-syspref.sql b/installer/data/mysql/atomicupdate/bug_18138-edit-biblio-marc-modification-template-syspref.sql >index 07bf6fce9a2..e9b564a55ab 100644 >--- a/installer/data/mysql/atomicupdate/bug_18138-edit-biblio-marc-modification-template-syspref.sql >+++ b/installer/data/mysql/atomicupdate/bug_18138-edit-biblio-marc-modification-template-syspref.sql >@@ -1 +1 @@ >-INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type`) VALUES ('SaveBiblioMarcModificationTemplate', '', NULL, 'MARC modification template applied when saving bibliographic record in staff client or HTTP API', 'Free'); >+INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type`) VALUES ('SaveBiblioMarcModificationTemplate', '', NULL, 'MARC modification template applied when saving bibliographic record in staff client or HTTP API', 'modification-templates'); >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 142321dbd39..e2fb400e921 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -633,7 +633,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('RoutingListNote','To change this note edit <a href=\"/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=RoutingListNote#jumped\">RoutingListNote</a> system preference.','70|10','Define a note to be shown on all routing lists','Textarea'), > ('RoutingSerials','1',NULL,'If ON, serials routing is enabled','YesNo'), > ('SavedSearchFilters', '0', NULL, 'Allow staff with permission to create/edit custom search filters', 'YesNo'), >-('SaveBiblioMarcModificationTemplate', '', NULL, 'MARC modification template applied when saving bibliographic record in staff client or HTTP API', 'Free'), >+('SaveBiblioMarcModificationTemplate', '', NULL, 'MARC modification template applied when saving bibliographic record in staff client or HTTP API', 'modification-templates'), > ('SCOAllowCheckin','0','','If enabled, patrons may return items through the Web-based Self Checkout','YesNo'), > ('SCOMainUserBlock','','70|10','Add a block of HTML that will display on the self checkout screen','Textarea'), > ('SCOUserCSS','',NULL,'Add CSS to be included in the SCO module in an embedded <style> tag.','free'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref >index ec91f23f615..d2cce32a721 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref >@@ -189,7 +189,7 @@ Cataloging: > - > - Apply the MARC modification template with name > - pref: SaveBiblioMarcModificationTemplate >- class: short >+ class: modification-templates > - on records saved using the staff client simple MARC editor, advanced editor or HTTP API. > Display: > - >diff --git a/t/db_dependent/www/EditBiblioMarcModificationTemplatePreference.t b/t/db_dependent/www/EditBiblioMarcModificationTemplatePreference.t >index 12c10d904b9..f9d69a6427f 100755 >--- a/t/db_dependent/www/EditBiblioMarcModificationTemplatePreference.t >+++ b/t/db_dependent/www/EditBiblioMarcModificationTemplatePreference.t >@@ -23,7 +23,7 @@ require HTTP::Request; > use MARC::Record; > use XML::Simple; > use C4::MarcModificationTemplates; >-use C4::Biblio; >+use C4::Biblio qw(AddBiblio ModBiblioMarc GetMarcBiblio); > > eval{ > use C4::Context; >@@ -82,7 +82,7 @@ subtest 'Templates applied using simple and advanced MARC Editor' => sub { > ); > my ($biblionumber) = AddBiblio($record, ''); > >- my $saved_record = GetMarcBiblio({ biblio => $biblionumber, embed_items => 0 }); >+ my $saved_record = GetMarcBiblio({ biblionumber => $biblionumber, embed_items => 0 }); > my $saved_record_250_field = $saved_record->field('250'); > isa_ok($saved_record_250_field, 'MARC::Field', 'Field with tag 250 has been saved'); > is($saved_record_250_field->subfield('a'), '250 bottles of beer on the wall', 'Field 250a has the same value passed to AddBiblio'); >@@ -109,7 +109,7 @@ subtest 'Templates applied using simple and advanced MARC Editor' => sub { > 'Save bibliographic record using simple MARC editor' > ); > >- $saved_record = GetMarcBiblio({ biblio => $biblionumber, embed_items => 0 }); >+ $saved_record = GetMarcBiblio({ biblionumber => $biblionumber, embed_items => 0 }); > $saved_record_250_field = $saved_record->field('250'); > is($saved_record_250_field->subfield('a'), '251 bottles of beer on the wall', 'Field with tag 250 has been modified by MARC modification template'); > >-- >2.39.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 18138
:
61442
|
61443
|
61734
|
82783
|
86617
|
110266
|
110269
|
110270
|
110272
|
118439
|
118440
|
118441
|
118442
|
118443
|
118444
|
118824
|
120709
|
123125
|
123127
|
123128
|
123129
|
123130
|
123131
|
123132
|
123133
|
123137
|
124466
|
124467
|
124468
|
124469
|
124470
|
124471
|
124472
|
124473
|
124474
|
124475
|
124476
|
124477
|
124478
|
124484
|
124485
|
124486
|
124492
|
124493
|
124991
|
125157
|
148004
|
148005
|
148006
|
148007
|
148008
|
148009
|
157183
|
157184
|
157185
|
157186
|
157187
|
157188
|
157189
|
157190
|
157485
|
157486
|
157487
|
157488
|
157489
|
157490
|
157491
|
158414
|
158415
|
158416
|
158417
|
158418
|
158419
|
158420
|
158421
|
162612
|
162613