@@ -, +, @@ --- C4/Biblio.pm | 22 +++++++++++-------- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 7 ++++++ .../en/modules/admin/preferences/cataloguing.pref | 6 ++++- 4 files changed, 26 insertions(+), 10 deletions(-) --- a/C4/Biblio.pm +++ a/C4/Biblio.pm @@ -1719,16 +1719,20 @@ sub GetMarcNotes { my $note = ""; my $tag = ""; my $marcnote; + my %blacklist = map { $_ => 1 } split(/,/,C4::Context->preference('NotesBlacklist')); foreach my $field ( $record->field($scope) ) { - my $value = $field->as_string(); - if ( $note ne "" ) { - $marcnote = { marcnote => $note, }; - push @marcnotes, $marcnote; - $note = $value; - } - if ( $note ne $value ) { - $note = $note . " " . $value; - } + my $tag = $field->tag(); + if (!$blacklist{$tag}) { + my $value = $field->as_string(); + if ( $note ne "" ) { + $marcnote = { marcnote => $note, }; + push @marcnotes, $marcnote; + $note = $value; + } + if ( $note ne $value ) { + $note = $note . " " . $value; + } + } } if ($note) { --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -388,3 +388,4 @@ INSERT INTO systempreferences (variable, value, options, explanation, type) VALU INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HoldsToPullStartDate','2','Set the default start date for the Holds to pull list to this many days ago',NULL,'Integer'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z','Alphabet than can be expanded into browse links, e.g. on Home > Patrons',NULL,'free'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RefundLostItemFeeOnReturn', '1', 'If enabled, the lost item fee charged to a borrower will be refunded when the lost item is returned.', NULL, 'YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('NotesBlacklist','','List of notes fields that should not appear in the title notes/description separator of details',NULL,'free'; --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -6134,6 +6134,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = "3.11.00.XXX"; +if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('NotesBlacklist','','List of notes fields that should not appear in the title notes/description separator of details',NULL,'free')"); + print "Upgrade to $DBversion done (Bug 9162 - Add a system preference to set which notes fields appears on title notes/description separator)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref @@ -156,4 +156,8 @@ Cataloging: - pref: OpacSuppressionByIPRange class: short - (Leave blank if not used. Define a range like 192.168..) - + - + - Don't show these + - pref: NotesBlacklist + class: multi + - note fields in title notes separator (OPAC record details) and in the description separator (Staff client record details). The fields should appear separated with commas and according with the Koha MARC format (eg 3.. for UNIMARC, 5.. for MARC21) --