From fac3627e0af53866b6c4c1935b7243765c3315d2 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 10 Jun 2020 16:00:46 +0000 Subject: [PATCH] Bug 25709: Rename systemprefrence to NotesDenylist Signed-off-by: Owen Leonard --- C4/Biblio.pm | 6 +++--- .../data/mysql/atomicupdate/rename_preference_NotesDenylist.perl | 5 +++++ installer/data/mysql/sysprefs.sql | 2 +- installer/data/mysql/updatedatabase.pl | 2 +- .../prog/en/modules/admin/preferences/cataloguing.pref | 2 +- misc/release_notes/release_notes_20_05_00.html | 2 +- misc/release_notes/release_notes_20_05_00.md | 2 +- misc/release_notes/release_notes_3_12_0.txt | 2 +- t/Biblio/GetMarcNotes.t | 4 ++-- 9 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/rename_preference_NotesDenylist.perl diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 9eb3696a54..a424c1b340 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -1513,11 +1513,11 @@ sub GetMarcNotes { 590 => 1 ); - my %blacklist = map { $_ => 1 } - split( /,/, C4::Context->preference('NotesBlacklist')); + my %denylist = map { $_ => 1 } + split( /,/, C4::Context->preference('NotesDenylist')); foreach my $field ( $record->field($scope) ) { my $tag = $field->tag(); - next if $blacklist{ $tag }; + next if $denylist{ $tag }; next if $opac && $maybe_private{$tag} && !$field->indicator(1); if( $marcflavour ne 'UNIMARC' && $field->subfield('u') ) { # Field 5XX$u always contains URI diff --git a/installer/data/mysql/atomicupdate/rename_preference_NotesDenylist.perl b/installer/data/mysql/atomicupdate/rename_preference_NotesDenylist.perl new file mode 100644 index 0000000000..0c13f8d178 --- /dev/null +++ b/installer/data/mysql/atomicupdate/rename_preference_NotesDenylist.perl @@ -0,0 +1,5 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do( "UPDATE systempreferences SET variable='NotesDenylist' WHERE variable = 'NotesBlacklist'" ); + NewVersion( $DBversion, 25709, "Rename systempreference to NotesDenylist"); +} diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 4ad73ef827..a92d60c12c 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -333,7 +333,7 @@ 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'), +('NotesDenylist','',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'), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index b53146f873..c1aeedf197 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -6377,7 +6377,7 @@ if ( CheckVersion($DBversion) ) { $DBversion = "3.11.00.013"; 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')"); + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('NotesDenylist','','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); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref index 613b2dbcd6..a2e11942f5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref @@ -231,7 +231,7 @@ Cataloging: - "is the logged in user's library. The second tab will contain all other items." - - "Don't show" - - pref: NotesBlacklist + - pref: NotesDenylist 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)." -
diff --git a/misc/release_notes/release_notes_20_05_00.html b/misc/release_notes/release_notes_20_05_00.html index a772ddd2c0..6718571a5a 100644 --- a/misc/release_notes/release_notes_20_05_00.html +++ b/misc/release_notes/release_notes_20_05_00.html @@ -2029,7 +2029,7 @@ have already been fixed in maintainance releases)

  • [17221] Orphan comma in shelf browser

    Sponsored by California College of the Arts

  • -
  • [17697] Improve NotesBlacklist system preference description to make clear where it will apply
  • +
  • [17697] Improve NotesDenylist system preference description to make clear where it will apply
  • [17853] MARC21: Don't remove () from link text for 780/785
  • [17938] XSLT: Label of 583 is repeated for multiple tags and private notes don't display in staff

    diff --git a/misc/release_notes/release_notes_20_05_00.md b/misc/release_notes/release_notes_20_05_00.md index 68482c864e..f3544954ed 100644 --- a/misc/release_notes/release_notes_20_05_00.md +++ b/misc/release_notes/release_notes_20_05_00.md @@ -1554,7 +1554,7 @@ have already been fixed in maintainance releases) - [[17221]](http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17221) Orphan comma in shelf browser **Sponsored by** *California College of the Arts* -- [[17697]](http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17697) Improve NotesBlacklist system preference description to make clear where it will apply +- [[17697]](http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17697) Improve NotesDenylist system preference description to make clear where it will apply - [[17853]](http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17853) MARC21: Don't remove () from link text for 780/785 - [[17938]](http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17938) XSLT: Label of 583 is repeated for multiple tags and private notes don't display in staff diff --git a/misc/release_notes/release_notes_3_12_0.txt b/misc/release_notes/release_notes_3_12_0.txt index 68d19e5b24..a5b221cf0b 100644 --- a/misc/release_notes/release_notes_3_12_0.txt +++ b/misc/release_notes/release_notes_3_12_0.txt @@ -982,7 +982,7 @@ New sysprefs in 3.12.0 * IDreamBooksReviews * IntranetNumbersPreferPhrase * ManInvInNoissuesCharge - * NotesBlacklist + * NotesDenylist * OpacItemLocation * OPACNumbersPreferPhrase * OpacSeparateHoldings diff --git a/t/Biblio/GetMarcNotes.t b/t/Biblio/GetMarcNotes.t index bb55226bdc..8659ed62af 100755 --- a/t/Biblio/GetMarcNotes.t +++ b/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( 'NotesDenylist', '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( 'NotesDenylist', '310' ); my $record = MARC::Record->new; $record->append_fields( -- 2.11.0