From 54e96898fb3af35092a6706b3172fb197e49f4f2 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 24 May 2013 07:54:42 -0400 Subject: [PATCH] Bug 10330 - Rename system preference authoritysep to AuthoritySeperator Test Plan: 1) Apply patch 2) Run updatedatabase.pl 3) View some records with authorities 4) Note your previously set authority separator should still be in use --- C4/AuthoritiesMarc.pm | 2 +- C4/Biblio.pm | 12 ++++++------ .../value_builder/unimarc_field_210c_bis.pl | 2 +- cataloguing/value_builder/unimarc_field_225a.pl | 2 +- installer/data/mysql/sysprefs.sql | 2 +- installer/data/mysql/updatedatabase.pl | 7 +++++++ .../en/modules/admin/preferences/cataloguing.pref | 2 +- 7 files changed, 18 insertions(+), 11 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index 9ea3b2d..1215d89 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -268,7 +268,7 @@ sub SearchAuthorities { my $rec=$oAResult->record($counter); my $marcdata=$rec->raw(); my $authrecord; - my $separator=C4::Context->preference('authoritysep'); + my $separator=C4::Context->preference('AuthoritySeperator'); $authrecord = MARC::File::USMARC::decode($marcdata); my $authid=$authrecord->field('001')->data(); my %newline; diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 7af8619..1782335 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -1757,7 +1757,7 @@ sub GetMarcSubjects { my @marcsubjects; my $subject_limit = C4::Context->preference("TraceCompleteSubfields") ? 'su,complete-subfield' : 'su'; - my $authoritysep = C4::Context->preference('authoritysep'); + my $AuthoritySeperator = C4::Context->preference('AuthoritySeperator'); foreach my $field ( $record->field($fields_filter) ) { next unless ($field->tag() >= $mintag && $field->tag() <= $maxtag); @@ -1803,7 +1803,7 @@ sub GetMarcSubjects { code => $code, value => $value, link_loop => \@this_link_loop, - separator => (scalar @subfields_loop) ? $authoritysep : '' + separator => (scalar @subfields_loop) ? $AuthoritySeperator : '' }; } } @@ -1844,7 +1844,7 @@ sub GetMarcAuthors { } my @marcauthors; - my $authoritysep = C4::Context->preference('authoritysep'); + my $AuthoritySeperator = C4::Context->preference('AuthoritySeperator'); foreach my $field ( $record->field($fields_filter) ) { next unless $field->tag() >= $mintag && $field->tag() <= $maxtag; @@ -1893,7 +1893,7 @@ sub GetMarcAuthors { code => $code, value => $value, link_loop => \@this_link_loop, - separator => (scalar @subfields_loop) ? $authoritysep : '' + separator => (scalar @subfields_loop) ? $AuthoritySeperator : '' }; } } @@ -1983,7 +1983,7 @@ sub GetMarcSeries { } my @marcseries; - my $authoritysep = C4::Context->preference('authoritysep'); + my $AuthoritySeperator = C4::Context->preference('AuthoritySeperator'); foreach my $field ( $record->field($fields_filter) ) { next unless $field->tag() >= $mintag && $field->tag() <= $maxtag; @@ -2019,7 +2019,7 @@ sub GetMarcSeries { code => $code, value => $value, link_loop => \@link_loop, - separator => (scalar @subfields_loop) ? $authoritysep : '', + separator => (scalar @subfields_loop) ? $AuthoritySeperator : '', volumenum => $volume_number, } } diff --git a/cataloguing/value_builder/unimarc_field_210c_bis.pl b/cataloguing/value_builder/unimarc_field_210c_bis.pl index 420fa8f..e9be5a9 100755 --- a/cataloguing/value_builder/unimarc_field_210c_bis.pl +++ b/cataloguing/value_builder/unimarc_field_210c_bis.pl @@ -88,7 +88,7 @@ sub plugin { my $index = $input->param('index'); my $result = $input->param('result'); my $editor_found = $input->param('editor_found'); - my $authoritysep = C4::Context->preference("authoritysep"); + my $AuthoritySeperator = C4::Context->preference("AuthoritySeperator"); warn Data::Dumper::Dumper $index; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( diff --git a/cataloguing/value_builder/unimarc_field_225a.pl b/cataloguing/value_builder/unimarc_field_225a.pl index daba32e..a3275af 100755 --- a/cataloguing/value_builder/unimarc_field_225a.pl +++ b/cataloguing/value_builder/unimarc_field_225a.pl @@ -108,7 +108,7 @@ sub plugin { my $index = $input->param('index'); my $result = $input->param('result'); my $editor_found = $input->param('editor_found'); - my $authoritysep = C4::Context->preference("authoritysep"); + my $AuthoritySeperator = C4::Context->preference("AuthoritySeperator"); my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 9aabdb1..ef25110 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -8,7 +8,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AnonymousPatron', '0', 'Set the identifier (borrowernumber) of the anonymous patron. Used for Suggestion and reading history privacy',NULL,''); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('Babeltheque',0,'Turn ON Babeltheque content - See babeltheque.com to subscribe to this service','','YesNo'); -INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('authoritysep','--','Used to separate a list of authorities in a display. Usually --',10,'free'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AuthoritySeperator','--','Used to separate a list of authorities in a display. Usually --',10,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('autoBarcode','OFF','Used to autogenerate a barcode: incremental will be of the form 1, 2, 3; annual of the form 2007-0001, 2007-0002; hbyymmincr of the form HB08010001 where HB=Home Branch','incremental|annual|hbyymmincr|EAN13|OFF','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AutoLocation',0,'If ON, IP authentication is enabled, blocking access to the staff client from unauthorized IP addresses',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AutomaticItemReturn',1,'If ON, Koha will automatically set up a transfer of this item to its homebranch',NULL,'YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 3134261..2881dca 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -6971,6 +6971,13 @@ if(CheckVersion($DBversion)) { SetVersion ($DBversion); } +$DBversion = "3.13.00.XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do("UPDATE systempreferences SET variable = 'AuthoritySeperator' WHERE variable = 'authoritysep'"); + print "Upgrade to $DBversion done (Bug 10330 - Rename system preference authoritysep to AuthoritySeperator)\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 96f3603..1c21bd3 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 @@ -112,7 +112,7 @@ Cataloging: Display: - - 'Separate multiple displayed authors, series or subjects with ' - - pref: authoritysep + - pref: AuthoritySeperator class: short - '.' - -- 1.7.2.5