Browse Source

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 <david@davidnind.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
master
Phil Ringnalda 1 month ago
parent
commit
53e1002e11
2 changed files with 2 additions and 1 deletions
  1. +1
    -0
      cataloguing/editor.pl
  2. +1
    -1
      koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-widgets-marc21.inc

+ 1
- 0
cataloguing/editor.pl View File

@@ -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;


+ 1
- 1
koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-widgets-marc21.inc View File

@@ -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 = $( '<span class="subfield-widget fixed-widget">' + _("Fixed data:") + '<span class="hint widget-loading">' + _("Loading...") + '</span></span>' );


Loading…
Cancel
Save