From dfc5e43cc9be79e825c588753a707625646fd230 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Tue, 29 Sep 2015 12:29:52 +0200 Subject: [PATCH] Bug 14815: Different leader values per framework code Content-Type: text/plain; charset=utf-8 NOTE: This is not yet ready for signoff, but just a concept. Use the defaultvalue in the framework to fill the leader. Add different defaults in the simple_bib_frameworks. TODO: Copy those changes to the various install languages. Remove the default from the plugin code. Add a db rev to insert the default into existing frameworks. TODO: Make sure that you run this only for MARC21 databases. Use existing functionality to change the default for your frameworks. --- cataloguing/value_builder/marc21_leader.pl | 1 + installer/data/mysql/atomicupdate/14815_leader.sql | 7 +++++++ .../marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql | 2 +- .../marc21/optional/marc21_simple_bib_frameworks.sql | 6 ++++++ 4 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/14815_leader.sql diff --git a/cataloguing/value_builder/marc21_leader.pl b/cataloguing/value_builder/marc21_leader.pl index 755300a..ad98e8f 100755 --- a/cataloguing/value_builder/marc21_leader.pl +++ b/cataloguing/value_builder/marc21_leader.pl @@ -35,6 +35,7 @@ my $builder = sub { function Focus$function_name(event) { if(!document.getElementById(event.data.id).value){ + // TODO: Remove this code when all frameworks have a default document.getElementById(event.data.id).value = ' nam a22 7a 4500'; } } diff --git a/installer/data/mysql/atomicupdate/14815_leader.sql b/installer/data/mysql/atomicupdate/14815_leader.sql new file mode 100644 index 0000000..fe67f3f --- /dev/null +++ b/installer/data/mysql/atomicupdate/14815_leader.sql @@ -0,0 +1,7 @@ +-- Update leader defaultvalue for MARC21 installs +-- General update on all frameworks +UPDATE marc_subfield_structure SET defaultvalue = ' nam a22 7a 4500' WHERE tagfield = '000' AND tagsubfield = '@'; +-- Specific exceptions +UPDATE marc_subfield_structure SET defaultvalue = ' nmm a22 7a 4500' WHERE tagfield = '000' AND tagsubfield = '@' AND frameworkcode = 'CF'; +UPDATE marc_subfield_structure SET defaultvalue = ' nas a22 7a 4500' WHERE tagfield = '000' AND tagsubfield = '@' AND frameworkcode = 'SER'; +-- Still check: ('AR','IR','KT','SR','VR'); diff --git a/installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql b/installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql index 7a8316c..4780d03 100644 --- a/installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql +++ b/installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql @@ -509,7 +509,7 @@ INSERT IGNORE INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, INSERT IGNORE INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES - ('000', '@', 'fixed length control field', 'fixed length control field', 0, 1, '', 0, '', '', 'marc21_leader.pl', 0, 0, '', '', '', NULL), + ('000', '@', 'fixed length control field', 'fixed length control field', 0, 1, '', 0, '', '', 'marc21_leader.pl', 0, 0, '', '', '', ' nam a22 7a 4500'), ('001', '@', 'control field', 'control field', 0, 0, '', 0, '', '', '', 0, 0, '', '', '', NULL), ('003', '@', 'control field', 'control field', 0, 1, '', 0, '', '', 'marc21_field_003.pl', 0, 0, '', '', '', NULL), ('005', '@', 'control field', 'control field', 0, 1, '', 0, '', '', 'marc21_field_005.pl', 0, 0, '', '', '', NULL), diff --git a/installer/data/mysql/en/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql b/installer/data/mysql/en/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql index 629067b..81e9ef6 100644 --- a/installer/data/mysql/en/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql +++ b/installer/data/mysql/en/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql @@ -484,3 +484,9 @@ UPDATE marc_subfield_structure SET hidden = -6 WHERE tagfield = '887' AND tagsub UPDATE marc_subfield_structure SET hidden = -6 WHERE tagfield = '887' AND tagsubfield = 'a' AND frameworkcode IN ('AR','BKS','CF','IR','KT','SER','SR','VR'); UPDATE marc_subfield_structure SET hidden = 9 WHERE tagfield = '942' AND tagsubfield = 'i' AND frameworkcode IN ('AR','BKS','CF','IR','KT','SER','SR','VR'); UPDATE marc_subfield_structure SET hidden = 0 WHERE tagfield = '952' AND tagsubfield = '1' AND frameworkcode IN ('AR','BKS','CF','IR','KT','SER','SR','VR'); + +-- ************************************** +-- UPDATE SOME DEFAULT VALUES +-- ************************************** +UPDATE marc_subfield_structure SET defaultvalue = ' nmm a22 7a 4500' WHERE tagfield = '000' AND tagsubfield = '@' AND frameworkcode = 'CF'; +-- Still check: ('AR','BKS','IR','KT','SER','SR','VR'); -- 1.7.10.4