@@ -, +, @@ --- C4/Biblio.pm | 6 +++--- .../data/mysql/atomicupdate/rename_preference_OpacHiddenNotes.perl | 5 +++++ installer/data/mysql/sysprefs.sql | 2 +- .../prog/en/modules/admin/preferences/cataloguing.pref | 2 +- t/Biblio/GetMarcNotes.t | 4 ++-- 5 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/rename_preference_OpacHiddenNotes.perl --- a/C4/Biblio.pm +++ a/C4/Biblio.pm @@ -1513,11 +1513,11 @@ sub GetMarcNotes { 590 => 1 ); - my %blacklist = map { $_ => 1 } - split( /,/, C4::Context->preference('NotesBlacklist')); + my %hiddenlist = map { $_ => 1 } + split( /,/, C4::Context->preference('OpacHiddenNotes')); foreach my $field ( $record->field($scope) ) { my $tag = $field->tag(); - next if $blacklist{ $tag }; + next if $hiddenlist{ $tag }; next if $opac && $maybe_private{$tag} && !$field->indicator(1); if( $marcflavour ne 'UNIMARC' && $field->subfield('u') ) { # Field 5XX$u always contains URI --- a/installer/data/mysql/atomicupdate/rename_preference_OpacHiddenNotes.perl +++ a/installer/data/mysql/atomicupdate/rename_preference_OpacHiddenNotes.perl @@ -0,0 +1,5 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do( "UPDATE systempreferences SET variable='OpacHiddenNotes' WHERE variable = 'NotesBlacklist'" ); + NewVersion( $DBversion, 25709, "Rename systempreference to OpacHiddenNotes"); +} --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -333,7 +333,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('NoIssuesChargeGuarantees','','','Define maximum amount withstanding before check outs are blocked','Integer'), ('noItemTypeImages','0',NULL,'If ON, disables itemtype images in the staff interface','YesNo'), ('NoRenewalBeforePrecision','exact_time','date|exact_time','Calculate "No renewal before" based on date only or exact time of due date','Choice'), -('NotesBlacklist','',NULL,'List of notes fields that should not appear in the title notes/description separator of details','free'), ('NotHighlightedWords','and|or|not',NULL,'List of words to NOT highlight when OpacHitHighlight is enabled','free'), ('NoticeBcc','','','Email address to bcc outgoing notices sent by email','free'), ('NoticeCSS','',NULL,'Notices CSS url.','free'), @@ -390,6 +389,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OPACFRBRizeEditions','0','','If ON, the OPAC will query one or more ISBN web services for associated ISBNs and display an Editions tab on the details pages','YesNo'), ('OpacHiddenItems','','','This syspref allows to define custom rules for hiding specific items at the OPAC. See http://wiki.koha-community.org/wiki/OpacHiddenItems for more information.','Textarea'), ('OpacHiddenItemsExceptions','',NULL,'List of borrower categories, separated by |, that can see items otherwise hidden by OpacHiddenItems','Textarea'), +('OpacHiddenNotes','',NULL,'List of notes fields that should not appear in the title notes/description separator of details','free'), ('OpacHighlightedWords','1','','If Set, then queried words are higlighted in OPAC','YesNo'), ('OPACHoldingsDefaultSortField','first_column','first_column|homebranch|holdingbranch','Default sort field for the holdings table at the OPAC','choice'), ('OPACHoldsIfAvailableAtPickup','1','','Allow to pickup up holds at libraries where the item is available','YesNo'), --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref @@ -230,7 +230,7 @@ Cataloging: - "is the logged in user's library. The second tab will contain all other items." - - "Don't show" - - pref: NotesBlacklist + - pref: OpacHiddenNotes class: multi - "note fields in the 'Title notes' tab and in the 'Description' tab on the OPAC and staff interface detail pages. Use a comma to separate multiple fields. Examples: 500,502 (MARC21); 300,328 (UNIMARC)." -
--- a/t/Biblio/GetMarcNotes.t +++ a/t/Biblio/GetMarcNotes.t @@ -27,7 +27,7 @@ use C4::Biblio; subtest 'GetMarcNotes MARC21' => sub { plan tests => 11; - t::lib::Mocks::mock_preference( 'NotesBlacklist', '520' ); + t::lib::Mocks::mock_preference( 'OpacHiddenNotes', '520' ); my $record = MARC::Record->new; $record->append_fields( @@ -55,7 +55,7 @@ subtest 'GetMarcNotes MARC21' => sub { subtest 'GetMarcNotes UNIMARC' => sub { plan tests => 3; - t::lib::Mocks::mock_preference( 'NotesBlacklist', '310' ); + t::lib::Mocks::mock_preference( 'OpacHiddenNotes', '310' ); my $record = MARC::Record->new; $record->append_fields( --