From 5ab6baf311d2b8c748b09e191eb1439d0b5eb659 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 --- .../bug_26368_add_OCLC_encoding_syspref.perl | 8 ++++++++ installer/data/mysql/mandatory/sysprefs.sql | 1 + .../prog/en/includes/cateditor-widgets-marc21.inc | 6 ++++++ .../en/modules/admin/preferences/cataloguing.pref | 6 ++++++ .../cataloguing/value_builder/marc21_leader.tt | 23 ++++++++++++++++++++++ 5 files changed, 44 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..73314698dd --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_26368_add_OCLC_encoding_syspref.perl @@ -0,0 +1,8 @@ +$DBversion = 'XXX'; +if( CheckVersion( $DBversion ) ) { + $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') + }); + NewVersion( $DBversion, 26368, "Add OCLC Encoding Levels system preference"); +} diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index f163912142..bf51997172 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -720,6 +720,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('useDischarge','0','','Allows librarians to discharge borrowers and borrowers to request a discharge','YesNo'), ('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'), +('UseOCLCEncodingLevels','0',NULL,'If enabled, include OCLC encoding levels in leader value builder dropdown for position 17.','YesNo'), ('UseTransportCostMatrix','0','','Use Transport Cost Matrix when filling holds','YesNo'), ('UseWYSIWYGinSystemPreferences','0','','Show WYSIWYG editor when editing certain HTML system preferences.','YesNo'), ('viewISBD','1','','Allow display of ISBD view of bibiographic records','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 701da251c4..ec1620cdca 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 5ffd9a22f3..242d54cad2 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 @@ -158,6 +158,12 @@ Cataloging: - and record's last modifier name in MARC subfield - pref: MarcFieldForModifierName - ".
NOTE: Use a dollar sign between field and subfield like 123$a." + - + - 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 f6b39fb00f..eb35de84ae 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.11.0