From c2895690e73d8dc12da27a656df3b13f660182c1 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 17 Mar 2021 20:29:48 +0000 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 --- admin/preferences.pl | 4 ++++ .../intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref | 1 + 2 files changed, 5 insertions(+) diff --git a/admin/preferences.pl b/admin/preferences.pl index dc4bc0b5d3..c9a46622c9 100755 --- a/admin/preferences.pl +++ b/admin/preferences.pl @@ -29,6 +29,7 @@ use C4::Log; use C4::Output; use C4::Templates; use Koha::Acquisition::Currencies; +use Koha::MarcModificationTemplates; use File::Spec; use IO::File; use YAML::XS; @@ -103,6 +104,9 @@ sub _get_chunk { } elsif ( $options{choices} eq 'patron-categories' ) { $options{choices} = { map { $_->categorycode => $_->description } Koha::Patron::Categories->search }; $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/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref index 42636358d3..d54b1f122a 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 @@ -162,6 +162,7 @@ Cataloging: - Apply the MARC modification template with name - pref: SaveBiblioMarcModificationTemplate class: short + choices: modification-templates - on records saved using the staff client simple MARC editor, advanced editor or HTTP API. Display: - -- 2.11.0