From 7d767a3389214899ece0e38edce11d1079b36cc0 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 3 Sep 2020 12:52:28 +0000 Subject: [PATCH] Bug 26368: Add OCLC options to marc21_leader.tt See documentation at: https://www.oclc.org/bibformats/en/fixedfield/elvl.html To test: 1 - Apply patch, updatedatabase 2 - Edit a record in the basic editor 3 - Edit the leader using the plugin 4 - Note the options for '17 - Encoding level' 5 - Find the system preference 'UseOCLCEncodingLevels' 6 - Edit the record again 7 - Note new options I,J,K,M 8 - Set the value of encodign level to one of the new options and save 9 - Edit again 10 - Confirm the value is displayed correctly selected 11 - Repeat tests using advanced cataloging editor Signed-off-by: David Nind --- .../bug_26368_add_OCLC_encoding_syspref.perl | 15 ++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 1 + .../en/includes/cateditor-widgets-marc21.inc | 6 +++++ .../admin/preferences/cataloguing.pref | 6 +++++ .../value_builder/marc21_leader.tt | 23 +++++++++++++++++++ 5 files changed, 51 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_26368_add_OCLC_encoding_syspref.perl diff --git a/installer/data/mysql/atomicupdate/bug_26368_add_OCLC_encoding_syspref.perl b/installer/data/mysql/atomicupdate/bug_26368_add_OCLC_encoding_syspref.perl new file mode 100644 index 0000000000..8e53efecf2 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_26368_add_OCLC_encoding_syspref.perl @@ -0,0 +1,15 @@ +use Modern::Perl; + +return { + bug_number => "26368", + description => "Add OCLC Encoding Levels system preference", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + $dbh->do(q{ + INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) + VALUES ('UseOCLCEncodingLevels','0',NULL,'If enabled, include OCLC encoding levels in leader value builder dropdown for position 17.','YesNo') + }); + say $out "Added UseOCLCEncodingLevels system preference"; + }, +}; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 617d34b814..26639555f6 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -760,6 +760,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('UseEmailReceipts','0','','Send email receipts for payments and write-offs','YesNo'), ('UseICUStyleQuotes','0','1','Tell Koha whether to use ICU style quotes ({) or default (") when tracing subjects .','YesNo'), ('UseLocationAsAQInSIP', '0', '', 'Use permanent_location instead of homebranch for AQ in SIP response', 'YesNo'), +('UseOCLCEncodingLevels','0',NULL,'If enabled, include OCLC encoding levels in leader value builder dropdown for position 17.','YesNo'), ('UseRecalls','0',NULL,'Enable or disable recalls','YesNo'), ('UseTransportCostMatrix','0','','Use Transport Cost Matrix when filling holds','YesNo'), ('UseWYSIWYGinSystemPreferences','0','','Show WYSIWYG editor when editing certain HTML system preferences.','YesNo'), 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 340c2a2487..2876b9b9ee 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 @@ -49,6 +49,12 @@ + [% IF Koha.Preference('UseOCLCEncodingLevels') %] + + + + + [% END %] 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 5b2cbf8a16..561338684d 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 @@ -171,6 +171,12 @@ Cataloging: choices: biblionumber: generated as biblionumber. "OFF": not generated automatically. + - + - Display OCLC defined values for MARC encoding level in leader value builder? + - pref: UseOCLCEncodingLevels + choices: + 1: Yes. + 0: No. Display: - - 'Separate main entry and subdivisions with ' diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader.tt index e77d2a8537..100725dd06 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader.tt @@ -1,4 +1,5 @@ [% SET footerjs = 1 %] +[% USE Koha %] [% INCLUDE 'doc-head-open.inc' %] 000 - Leader builder › Cataloging › Koha [% INCLUDE 'doc-head-close.inc' %] @@ -236,6 +237,28 @@ [% ELSE %] [% END %] + [% IF Koha.Preference('UseOCLCEncodingLevels') %] + [% IF ( f17I ) %] + + [% ELSE %] + + [% END %] + [% IF ( f17J ) %] + + [% ELSE %] + + [% END %] + [% IF ( f17K ) %] + + [% ELSE %] + + [% END %] + [% IF ( f17K ) %] + + [% ELSE %] + + [% END %] + [% END %] [% IF ( f17u ) %] [% ELSE %] -- 2.30.2