From 5e260c39b1dafd6140d4427d8a4b9862fe361e79 Mon Sep 17 00:00:00 2001 From: Phil Ringnalda Date: Thu, 1 Apr 2021 11:36:43 -0700 Subject: [PATCH] Bug 27739: Advanced editor should use DefaultCountryField008 preference Uses the system preference DefaultCountryField008, falling back to ||| (no attempt to code) if it is not set, for 008/15-17 place of publication in the advanced cataloging editor.. Test plan: 1) Apply patch and restart all the things, something's over-cached here 2) Administration - Toggle the preference EnableAdvancedCatalogingEditor to "Enable", verify the preference DefaultCountryField008 is empty 3) Cataloging - Advanced editor 4) In field 008, verify that the three characters after the two sets of four blank spaces are ||| 5) Administration - Set DefaultCountryField008 to fr 6) Cataloging - Advanced editor 7) In field 008, verify that the three characters after the two sets of four blank spaces are "fr " (including the space, so following characters haven't shifted left, and the last character is still d) Signed-off-by: David Nind Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart (cherry picked from commit 53e1002e1110896ca96624a7bcf616afa18879b7) Signed-off-by: Fridolin Somers --- cataloguing/editor.pl | 1 + .../intranet-tmpl/prog/en/includes/cateditor-widgets-marc21.inc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cataloguing/editor.pl b/cataloguing/editor.pl index b52c8505de..cfef40490a 100755 --- a/cataloguing/editor.pl +++ b/cataloguing/editor.pl @@ -69,6 +69,7 @@ $template->{VARS}->{editable_batches} = [ $schema->resultset('ImportBatch')->sea # Needed information for cataloging plugins $template->{VARS}->{DefaultLanguageField008} = pack( 'A3', C4::Context->preference('DefaultLanguageField008') || 'eng' ); +$template->{VARS}->{DefaultCountryField008} = pack( 'A3', C4::Context->preference('DefaultCountryField008') || '|||' ); my $authtags = Koha::MarcSubfieldStructures->search({ authtypecode => { '!=' => '' }, 'frameworkcode' => '' }); $template->{VARS}->{authtags} = $authtags; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-widgets-marc21.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-widgets-marc21.inc index 8e428ee7eb..701da251c4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-widgets-marc21.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-widgets-marc21.inc @@ -261,7 +261,7 @@ require( [ 'koha-backend', 'widget', 'text-marc' ], function( KohaBackend, Widge Widget.Register( '008@', { makeTemplate: function() { var now = new Date(); - return Widget.PadNum( now.getYear() % 100, 2 ) + Widget.PadNum( now.getMonth() + 1, 2 ) + Widget.PadNum( now.getDate(), 2 ) + "b xxu||||| |||| 00| 0 [% DefaultLanguageField008 | html %] d"; + return Widget.PadNum( now.getYear() % 100, 2 ) + Widget.PadNum( now.getMonth() + 1, 2 ) + Widget.PadNum( now.getDate(), 2 ) + "b [% DefaultCountryField008 | html %]||||| |||| 00| 0 [% DefaultLanguageField008 | html %] d"; }, init: function() { var $result = $( '' + _("Fixed data:") + '' + _("Loading...") + '' ); -- 2.39.5