BUG 9162 - Add a system preference to set which notes fields appears on title notes...
authorVitor FERNANDES <vfernandes@keep.pt>
Wed, 28 Nov 2012 11:07:54 +0000 (11:07 +0000)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Thu, 27 Dec 2012 14:56:19 +0000 (09:56 -0500)
Added a new system preference to control the fields to not appear in the separator.
Change GetMarcNotes to use the system preference created to only appear the fields that aren't in the list,

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
FIX some indentation in C4/Biblio.pm
+FIX 1 end of parentheses in sysprefs.sql
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
C4/Biblio.pm
installer/data/mysql/sysprefs.sql
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref

index d64acfb..7a9b7bb 100644 (file)
@@ -1719,15 +1719,19 @@ 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;
+            }
         }
     }
 
index 079ad47..95d0e7d 100644 (file)
@@ -403,3 +403,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HTML5MediaEnabled','not','Show a tab with a HTML5 media player for files catalogued in field 856','not|opac|staff|both','Choice');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HTML5MediaExtensions','webm|ogg|ogv|oga|vtt','Media file extensions','','free');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowHoldsOnPatronsPossessions', '1', 'Allow holds on records that patron have items of it',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');
index 235c297..381631d 100755 (executable)
@@ -6324,6 +6324,13 @@ if ( CheckVersion($DBversion) ) {
     SetVersion($DBversion);
 }
 
+$DBversion = "3.11.00.XXX";
+if ( CheckVersion($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)
index f2a16c6..09ec796 100644 (file)
@@ -167,3 +167,8 @@ Cataloging:
                 homebranch: 'home branch'
                 holdingbranch: 'holding branch'
             - 'is the branch of user logged in. The other tab contains other items.'
+        -
+            - 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)