Bugzilla – Attachment 14264 Details for
Bug 9162
Add a system preference to set which notes fields appears on title notes/description separator
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
BUG 9162 - Add a system preference to set which notes fields appears on title notes/description separator
BUG-9162---Add-a-system-preference-to-set-which-no.patch (text/plain), 4.76 KB, created by
Jonathan Druart
on 2012-12-26 13:05:35 UTC
(
hide
)
Description:
BUG 9162 - Add a system preference to set which notes fields appears on title notes/description separator
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2012-12-26 13:05:35 UTC
Size:
4.76 KB
patch
obsolete
>From 8d9616da231cb11a9e827b0b32108ec635661f3c Mon Sep 17 00:00:00 2001 >From: Vitor FERNANDES <vfernandes@keep.pt> >Date: Wed, 28 Nov 2012 11:07:54 +0000 >Subject: [PATCH] BUG 9162 - Add a system preference to set which notes fields > appears on title notes/description separator > >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 >--- > C4/Biblio.pm | 20 ++++++++++++-------- > installer/data/mysql/sysprefs.sql | 1 + > installer/data/mysql/updatedatabase.pl | 7 +++++++ > .../en/modules/admin/preferences/cataloguing.pref | 5 +++++ > 4 files changed, 25 insertions(+), 8 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index d64acfb..7a9b7bb 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -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; >+ } > } > } > >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index ccb3fcf..f6c45df 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -400,3 +400,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacSeparateHoldings', '0', 'Separate current branch holdings from other holdings (OPAC)', NULL, 'YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacSeparateHoldingsBranch', 'homebranch', 'Branch used to separate holdings (OPAC)', 'homebranch|holdingbranch', 'Choice'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RenewalSendNotice','0', 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'; >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index d93de4e..fe08202 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -6309,6 +6309,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) >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 f2a16c6..09ec796 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 >@@ -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) >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 9162
:
13730
|
13916
|
14121
|
14264
|
14265