@@ -, +, @@ allow choosing a modification template --- 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(-) --- a/admin/preferences.pl +++ a/admin/preferences.pl @@ -28,6 +28,7 @@ use C4::ClassSource qw( GetClassSources GetClassSource ); use C4::Output qw( output_html_with_http_headers ); use C4::Templates; use Koha::Acquisition::Currencies; +use Koha::MarcModificationTemplates; use IO::File; use YAML::XS; use Encode; @@ -100,6 +101,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'}; } --- a/installer/data/mysql/atomicupdate/bug_18138-edit-biblio-marc-modification-template-syspref.sql +++ a/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'); --- a/installer/data/mysql/mandatory/sysprefs.sql +++ a/installer/data/mysql/mandatory/sysprefs.sql @@ -586,7 +586,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('RoutingListAddReserves','0','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'), ('RoutingListNote','To change this note edit RoutingListNote 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'), -('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