From faf7c886f29d5c50fd747ea0627aea794f847bf5 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Mon, 16 Mar 2009 22:05:21 +0100 Subject: [PATCH] 3040 : seriestitle mistaken as collection title If series title was previously taken as collectiontitle then you should launch misc/maintenance/UNIMARC_fix_collectiontitle.pl misc/batchRebuildBiblioTables.pl [RM note: applies only to UNIMARC users - MARC21 users should not run the batch jobs.] Signed-off-by: Galen Charlton --- .../Obligatoire/framework_DEFAULT.sql | 10 +++--- .../UNIMARC_fix_collectiontitle.pl | 32 +++++++++++++++++++ 2 files changed, 37 insertions(+), 5 deletions(-) create mode 100755 misc/maintenance/UNIMARC_fix_collectiontitle.pl diff --git a/installer/data/mysql/fr-FR/marcflavour/unimarc_lecture_pub/Obligatoire/framework_DEFAULT.sql b/installer/data/mysql/fr-FR/marcflavour/unimarc_lecture_pub/Obligatoire/framework_DEFAULT.sql index d50164fb3c..63be2d6556 100644 --- a/installer/data/mysql/fr-FR/marcflavour/unimarc_lecture_pub/Obligatoire/framework_DEFAULT.sql +++ b/installer/data/mysql/fr-FR/marcflavour/unimarc_lecture_pub/Obligatoire/framework_DEFAULT.sql @@ -1179,7 +1179,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian` INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('215', 'c', 'autres carac.', '', 0, 0, '', 0, '', '', '', 0, 1, '', '', '', NULL); INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('215', 'd', 'format', '', 1, 0, 'biblioitems.size', 0, '', '', '', 0, 0, '', '', '', NULL); INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('215', 'e', 'matériel d''accompagnement', '', 1, 0, '', -1, '', '', '', 0, 0, '', '', '', NULL); -INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('225', 'a', 'titre de la collection', '', 0, 0, 'biblio.seriestitle', 0, '', '', 'unimarc_field_225a.pl', 0, -1, '', '''225v'',''225e'',''225i'',''225h'',''410a'',''410h'',''410i''', '225a', NULL); +INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('225', 'a', 'titre de la collection', '', 0, 0, 'biblioitems.collectiontitle', 0, '', '', 'unimarc_field_225a.pl', 0, -1, '', '''225v'',''225e'',''225i'',''225h'',''410a'',''410h'',''410i''', '225a', NULL); INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('225', 'd', 'titre parallèle de la collection', '', 0, 0, '', -1, '', '', '', 0, 0, '', '', '', NULL); INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('225', 'e', 'compléments de titre de la collection', '', 0, 0, '', -1, '', '', '', 0, 0, '', '', '', NULL); INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('225', 'f', 'mention de responsabilité', '', 0, 0, '', -1, '', '', '', 0, 0, '', '', '', NULL); @@ -2521,7 +2521,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian` INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('215', 'c', 'autres carac.', '', 0, 0, '', 0, '', '', '', 0, 1, 'ARTI', NULL, '', NULL); INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('215', 'd', 'format', '', 1, 0, 'biblioitems.size', 0, '', '', '', 0, 0, 'ARTI', NULL, '', NULL); INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('215', 'e', 'matériel d''accompagnement', '', 1, 0, '', -1, '', '', '', 0, 0, 'ARTI', NULL, '', NULL); -INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('225', 'a', 'titre de la collection', '', 0, 0, 'biblio.seriestitle', 0, '', '', 'unimarc_field_225a.pl', NULL, -1, 'ARTI', '''225v'',''225e'',''225i'',''225h'',''410a'',''410h'',''410i''', NULL, NULL); +INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('225', 'a', 'titre de la collection', '', 0, 0, 'biblioitems.collectiontitle', 0, '', '', 'unimarc_field_225a.pl', NULL, -1, 'ARTI', '''225v'',''225e'',''225i'',''225h'',''410a'',''410h'',''410i''', NULL, NULL); INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('225', 'd', 'titre parallèle de la collection', '', 0, 0, '', -1, '', '', '', NULL, 0, 'ARTI', '', NULL, NULL); INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('225', 'e', 'compléments de titre de la collection', '', 0, 0, '', -1, '', '', '', NULL, 0, 'ARTI', '', NULL, NULL); INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('225', 'f', 'mention de responsabilité', '', 0, 0, '', -1, '', '', '', NULL, 0, 'ARTI', '', NULL, NULL); @@ -3862,7 +3862,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian` INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('215', 'c', 'autres carac.', '', 0, 0, '', 0, '', '', '', 0, 1, 'MULT', NULL, '', NULL); INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('215', 'd', 'format', '', 1, 0, 'biblioitems.size', 0, '', '', '', 0, 0, 'MULT', NULL, '', NULL); INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('215', 'e', 'matériel d''accompagnement', '', 1, 0, '', -1, '', '', '', 0, 0, 'MULT', NULL, '', NULL); -INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('225', 'a', 'titre de la collection', '', 0, 0, 'biblio.seriestitle', 0, '', '', 'unimarc_field_225a.pl', NULL, -1, 'MULT', '''225v'',''225e'',''225i'',''225h'',''410a'',''410h'',''410i''', NULL, NULL); +INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('225', 'a', 'titre de la collection', '', 0, 0, 'biblioitems.collectiontitle', 0, '', '', 'unimarc_field_225a.pl', NULL, -1, 'MULT', '''225v'',''225e'',''225i'',''225h'',''410a'',''410h'',''410i''', NULL, NULL); INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('225', 'd', 'titre parallèle de la collection', '', 0, 0, '', -1, '', '', '', NULL, 0, 'MULT', '', NULL, NULL); INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('225', 'e', 'compléments de titre de la collection', '', 0, 0, '', -1, '', '', '', NULL, 0, 'MULT', '', NULL, NULL); INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('225', 'f', 'mention de responsabilité', '', 0, 0, '', -1, '', '', '', NULL, 0, 'MULT', '', NULL, NULL); @@ -5204,7 +5204,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian` INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('215', 'c', 'autres carac.', '', 0, 0, '', 0, '', '', '', 0, 1, 'PERI', NULL, '', NULL); INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('215', 'd', 'format', '', 1, 0, 'biblioitems.size', 0, '', '', '', 0, 0, 'PERI', NULL, '', NULL); INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('215', 'e', 'matériel d''accompagnement', '', 1, 0, '', -1, '', '', '', 0, 0, 'PERI', NULL, '', NULL); -INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('225', 'a', 'titre de la collection', '', 0, 0, 'biblio.seriestitle', 0, '', '', 'unimarc_field_225a.pl', NULL, -1, 'PERI', '''225v'',''225e'',''225i'',''225h'',''410a'',''410h'',''410i''', NULL, NULL); +INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('225', 'a', 'titre de la collection', '', 0, 0, 'biblioitems.collectiontitle', 0, '', '', 'unimarc_field_225a.pl', NULL, -1, 'PERI', '''225v'',''225e'',''225i'',''225h'',''410a'',''410h'',''410i''', NULL, NULL); INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('225', 'd', 'titre parallèle de la collection', '', 0, 0, '', -1, '', '', '', NULL, 0, 'PERI', '', NULL, NULL); INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('225', 'e', 'compléments de titre de la collection', '', 0, 0, '', -1, '', '', '', NULL, 0, 'PERI', '', NULL, NULL); INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('225', 'f', 'mention de responsabilité', '', 0, 0, '', -1, '', '', '', NULL, 0, 'PERI', '', NULL, NULL); @@ -6545,7 +6545,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian` INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('215', 'c', 'autres carac.', '', 0, 0, '', -1, '', '', '', NULL, 1, 'WEB', '', NULL, NULL); INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('215', 'd', 'format', '', 1, 0, 'biblioitems.size', -1, '', '', '', NULL, 0, 'WEB', '', NULL, NULL); INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('215', 'e', 'matériel d''accompagnement', '', 1, 0, '', -1, '', '', '', NULL, 0, 'WEB', '', NULL, NULL); -INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('225', 'a', 'titre de la collection', '', 0, 0, 'biblio.seriestitle', -1, '', '', 'unimarc_field_225a.pl', NULL, -1, 'WEB', '''225v'',''225e'',''225i'',''225h'',''410a'',''410h'',''410i''', NULL, NULL); +INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('225', 'a', 'titre de la collection', '', 0, 0, 'biblioitems.collectiontitle', -1, '', '', 'unimarc_field_225a.pl', NULL, -1, 'WEB', '''225v'',''225e'',''225i'',''225h'',''410a'',''410h'',''410i''', NULL, NULL); INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('225', 'd', 'titre parallèle de la collection', '', 0, 0, '', -1, '', '', '', NULL, 0, 'WEB', '', NULL, NULL); INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('225', 'e', 'compléments de titre de la collection', '', 0, 0, '', -1, '', '', '', NULL, 0, 'WEB', '', NULL, NULL); INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('225', 'f', 'mention de responsabilité', '', 0, 0, '', -1, '', '', '', NULL, 0, 'WEB', '', NULL, NULL); diff --git a/misc/maintenance/UNIMARC_fix_collectiontitle.pl b/misc/maintenance/UNIMARC_fix_collectiontitle.pl new file mode 100755 index 0000000000..d97722272b --- /dev/null +++ b/misc/maintenance/UNIMARC_fix_collectiontitle.pl @@ -0,0 +1,32 @@ +#!/usr/bin/perl +# +# This script should be used only with UNIMARC flavour +# It is designed to report some missing information from biblio +# table into marc data +# +use strict; +use warnings; + +BEGIN { + use FindBin; + eval { require "$FindBin::Bin/../kohalib.pl" }; +} + +use C4::Biblio; + +sub process { + + my $dbh = C4::Context->dbh; + + my $sth = $dbh->prepare(qq{UPDATE marc_subfield_structure SET kohafield='biblioitems.collectiontitle' where kohafield='biblio.seriestitle' and not tagfield like "4__"}); + return $sth->execute(); + + +} + +if (lc(C4::Context->preference('marcflavour')) eq "unimarc"){ +print "count subfields changed :".process()." kohafields biblio.seriestitle changed into biblioitems.collectiontitle"; +} +else { + print "this script is UNIMARC only and should be used only on unimarc databases\n"; +} -- 2.39.5