From d1f35e1536d28c0d0357f9b5579a7ba734eb0f96 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 24 May 2013 07:42:56 -0400 Subject: [PATCH] Bug 10329 - Rename system preference marcflavour to MarcFormat Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) View and edit some records 4) You should not see any change in functionality --- C4/Auth.pm | 2 +- C4/AuthoritiesMarc.pm | 28 +++--- C4/AuthoritiesMarc/MARC21.pm | 2 +- C4/AuthoritiesMarc/UNIMARC.pm | 2 +- C4/Biblio.pm | 120 ++++++++++---------- C4/Breeding.pm | 8 +- C4/Charset.pm | 4 +- C4/Context.pm | 2 +- C4/HTML5Media.pm | 6 +- C4/Heading.pm | 10 +- C4/ImportBatch.pm | 26 ++-- C4/Installer.pm | 56 +++++----- C4/Items.pm | 12 +- C4/Koha.pm | 18 ++-- C4/Record.pm | 18 ++-- C4/Ris.pm | 4 +- C4/Search.pm | 18 ++-- C4/ShelfBrowser.pm | 14 +- C4/VirtualShelves/Page.pm | 10 +- C4/XSLT.pm | 10 +- Koha/Authority.pm | 8 +- Koha/Indexer/Utils.pm | 8 +- acqui/addorderiso2709.pl | 4 +- acqui/basketgroup.pl | 4 +- acqui/histsearch.pl | 2 +- acqui/neworderempty.pl | 10 +- acqui/parcel.pl | 2 +- authorities/authorities-home.pl | 2 +- authorities/authorities.pl | 6 +- authorities/detail.pl | 2 +- authorities/export.pl | 2 +- basket/basket.pl | 12 +- basket/downloadcart.pl | 2 +- basket/sendbasket.pl | 8 +- catalogue/detail.pl | 24 ++-- catalogue/export.pl | 2 +- catalogue/search.pl | 4 +- cataloguing/addbiblio.pl | 24 ++-- cataloguing/additem.pl | 14 +- cataloguing/linkitem.pl | 10 +- ...stem_preferences_optimal_values_insert_only.sql | 2 +- installer/data/mysql/sysprefs.sql | 2 +- ...stem_preferences_optimal_values_insert_only.sql | 2 +- installer/data/mysql/updatedatabase.pl | 41 ++++--- installer/install.pl | 28 +++--- .../en/includes/authorities-search-results.inc | 4 +- .../prog/en/includes/authorities-search.inc | 6 +- .../prog/en/includes/search_indexes.inc | 2 +- .../en/modules/admin/preferences/cataloguing.pref | 2 +- .../prog/en/modules/cataloguing/addbiblio.tt | 8 +- .../prog/en/modules/installer/step3.tt | 6 +- .../prog/en/modules/serials/serials-search.tt | 4 +- .../en/includes/authorities-search-results.inc | 4 +- .../opac-tmpl/prog/en/modules/opac-advsearch.tt | 2 +- .../opac-tmpl/prog/en/modules/opac-auth-detail.tt | 2 +- misc/cronjobs/MARC21_parse_test.pl | 10 +- misc/maintenance/MARC21_utf8_flag_fix.pl | 14 +- misc/maintenance/UNIMARC_fix_collectiontitle.pl | 2 +- .../UNIMARC_sync_date_created_with_marc_biblio.pl | 2 +- .../migration_tools/22_to_30/export_Authorities.pl | 2 +- .../22_to_30/export_Authorities_xml.pl | 2 +- .../22_to_30/move_marc_to_biblioitems.pl | 12 +- misc/migration_tools/build_oai_sets.pl | 4 +- misc/migration_tools/bulkmarcimport.pl | 6 +- misc/migration_tools/fix_onloan.pl | 2 +- misc/migration_tools/rebuild_zebra.pl | 14 +- misc/migration_tools/upgradeitems.pl | 2 +- opac/oai.pl | 4 +- opac/opac-ISBDdetail.pl | 14 +- opac/opac-MARCdetail.pl | 8 +- opac/opac-authoritiesdetail.pl | 4 +- opac/opac-basket.pl | 12 +- opac/opac-detail.pl | 36 +++--- opac/opac-downloadcart.pl | 2 +- opac/opac-downloadshelf.pl | 2 +- opac/opac-export.pl | 2 +- opac/opac-readingrecord.pl | 2 +- opac/opac-search.pl | 6 +- opac/opac-sendbasket.pl | 8 +- opac/opac-sendshelf.pl | 8 +- opac/opac-showmarc.pl | 2 +- opac/opac-showreviews.pl | 10 +- opac/unapi | 10 +- serials/checkexpiration.pl | 2 +- serials/claims.pl | 2 +- serials/routing-preview.pl | 2 +- serials/routing.pl | 2 +- serials/serial-issues.pl | 2 +- serials/serials-collection.pl | 2 +- serials/serials-edit.pl | 2 +- serials/serials-home.pl | 2 +- serials/serials-recieve.pl | 2 +- serials/serials-search.pl | 2 +- serials/subscription-add.pl | 2 +- serials/subscription-detail.pl | 2 +- serials/viewalerts.pl | 2 +- svc/bib | 2 +- svc/import_bib | 4 +- svc/new_bib | 6 +- t/db_dependent/Heading_MARC21.t | 2 +- t/db_dependent/Search.t | 2 +- t/db_dependent/lib/KohaTest.pm | 2 +- t/db_dependent/lib/KohaTest/Installer.pm | 4 +- .../lib/KohaTest/Installer/SqlScripts.pm | 2 +- t/db_dependent/www/batch.t | 6 +- tags/list.pl | 2 +- tools/batchMod.pl | 4 +- tools/export.pl | 6 +- tools/stage-marc-import.pl | 2 +- virtualshelves/downloadshelf.pl | 2 +- virtualshelves/sendshelf.pl | 8 +- xt/fix-old-fsf-address.exclude | 4 +- 112 files changed, 464 insertions(+), 457 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 9dba387..388a9c7 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -326,7 +326,7 @@ sub get_template_and_user { XSLTResultsDisplay => C4::Context->preference("XSLTResultsDisplay"), using_https => $in->{'query'}->https() ? 1 : 0, noItemTypeImages => C4::Context->preference("noItemTypeImages"), - marcflavour => C4::Context->preference("marcflavour"), + MarcFormat => C4::Context->preference("MarcFormat"), persona => C4::Context->preference("persona"), UseCourseReserves => C4::Context->preference("UseCourseReserves"), ); diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index 9ea3b2d..01b742b 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -439,8 +439,8 @@ sub GuessAuthTypeCode { '280'=>{authtypecode=>'GENRE/FORM'}, } }; - foreach my $field (keys %{$heading_fields->{uc(C4::Context->preference('marcflavour'))} }) { - return $heading_fields->{uc(C4::Context->preference('marcflavour'))}->{$field}->{'authtypecode'} if (defined $record->field($field)); + foreach my $field (keys %{$heading_fields->{uc(C4::Context->preference('MarcFormat'))} }) { + return $heading_fields->{uc(C4::Context->preference('MarcFormat'))}->{$field}->{'authtypecode'} if (defined $record->field($field)); } return; } @@ -577,7 +577,7 @@ sub AddAuthority { # if authid empty => true add, find a new authid number my $format; - if (uc(C4::Context->preference('marcflavour')) eq 'UNIMARC') { + if (uc(C4::Context->preference('MarcFormat')) eq 'UNIMARC') { $format= 'UNIMARCAUTH'; } else { @@ -752,7 +752,7 @@ returns xml form of record $authid sub GetAuthorityXML { # Returns MARC::XML of the authority passed in parameter. my ( $authid ) = @_; - if (uc(C4::Context->preference('marcflavour')) eq 'UNIMARC') { + if (uc(C4::Context->preference('MarcFormat')) eq 'UNIMARC') { my $dbh=C4::Context->dbh; my $sth = $dbh->prepare("select marcxml from auth_header where authid=? " ); $sth->execute($authid); @@ -914,7 +914,7 @@ sub BuildSummary { # suit the MARC21 version, so for now the "templating" # feature will be enabled only for UNIMARC for backwards # compatibility. - if ($summary{summary} and C4::Context->preference('marcflavour') eq 'UNIMARC') { + if ($summary{summary} and C4::Context->preference('MarcFormat') eq 'UNIMARC') { my @fields = $record->fields(); # $reported_tag = '$9'.$result[$counter]; my @stringssummary; @@ -949,7 +949,7 @@ sub BuildSummary { my @seefrom; my @seealso; my @otherscript; - if (C4::Context->preference('marcflavour') eq 'UNIMARC') { + if (C4::Context->preference('MarcFormat') eq 'UNIMARC') { # construct UNIMARC summary, that is quite different from MARC21 one # accepted form foreach my $field ($record->field('2..')) { @@ -1116,7 +1116,7 @@ sub GetAuthorizedHeading { $record = GetAuthority($args->{authid}); } return unless (ref $record eq 'MARC::Record'); - if (C4::Context->preference('marcflavour') eq 'UNIMARC') { + if (C4::Context->preference('MarcFormat') eq 'UNIMARC') { # construct UNIMARC summary, that is quite different from MARC21 one # accepted form foreach my $field ($record->field('2..')) { @@ -1176,7 +1176,7 @@ Example of text: sub BuildAuthHierarchies{ my $authid = shift @_; # warn "authid : $authid"; - my $force = shift @_ || (C4::Context->preference('marcflavour') eq 'UNIMARC' ? 0 : 1); + my $force = shift @_ || (C4::Context->preference('MarcFormat') eq 'UNIMARC' ? 0 : 1); my @globalresult; my $dbh=C4::Context->dbh; my $hierarchies; @@ -1192,8 +1192,8 @@ sub BuildAuthHierarchies{ foreach my $field ($record->field('5..')){ my $broader = 0; $broader = 1 if ( - (C4::Context->preference('marcflavour') eq 'UNIMARC' && $field->subfield('5') && $field->subfield('5') eq 'g') || - (C4::Context->preference('marcflavour') ne 'UNIMARC' && $field->subfield('w') && substr($field->subfield('w'), 0, 1) eq 'g')); + (C4::Context->preference('MarcFormat') eq 'UNIMARC' && $field->subfield('5') && $field->subfield('5') eq 'g') || + (C4::Context->preference('MarcFormat') ne 'UNIMARC' && $field->subfield('w') && substr($field->subfield('w'), 0, 1) eq 'g')); if ($broader) { my $subfauthid=_get_authid_subfield($field) || ''; next if ($subfauthid eq $authid); @@ -1247,8 +1247,8 @@ sub BuildAuthHierarchy{ my %cell; my $parents=""; my $children=""; my (@loopparents,@loopchildren); - my $marcflavour = C4::Context->preference('marcflavour'); - my $relationshipsf = $marcflavour eq 'UNIMARC' ? '5' : 'w'; + my $MarcFormat = C4::Context->preference('MarcFormat'); + my $relationshipsf = $MarcFormat eq 'UNIMARC' ? '5' : 'w'; foreach my $field ($record->field('5..')){ my $subfauthid=_get_authid_subfield($field); if ($subfauthid && $field->subfield($relationshipsf) && $field->subfield('a')){ @@ -1267,7 +1267,7 @@ sub BuildAuthHierarchy{ $cell{"class"}=$class; $cell{"authid"}=$authid; $cell{"current_value"} =1 if ($authid eq $authid_constructed); - $cell{"value"}=C4::Context->preference('marcflavour') eq 'UNIMARC' ? $record->subfield('2..',"a") : $record->subfield('1..', 'a'); + $cell{"value"}=C4::Context->preference('MarcFormat') eq 'UNIMARC' ? $record->subfield('2..',"a") : $record->subfield('1..', 'a'); return \%cell; } @@ -1567,7 +1567,7 @@ sub get_auth_type_location { if (defined $tag and defined $subfield and $tag != 0 and $subfield ne '' and $subfield ne ' ') { return ($tag, $subfield); } else { - if (C4::Context->preference('marcflavour') eq "MARC21") { + if (C4::Context->preference('MarcFormat') eq "MARC21") { return C4::AuthoritiesMarc::MARC21::default_auth_type_location(); } else { return C4::AuthoritiesMarc::UNIMARC::default_auth_type_location(); diff --git a/C4/AuthoritiesMarc/MARC21.pm b/C4/AuthoritiesMarc/MARC21.pm index 3701b92..7202cfc 100644 --- a/C4/AuthoritiesMarc/MARC21.pm +++ b/C4/AuthoritiesMarc/MARC21.pm @@ -40,7 +40,7 @@ MARC formats). Functions from this module generally should not be used directly; instead, use the appropriate function from C that will dispatch the appropriate -function based on the marcflavour system preference. +function based on the MarcFormat system preference. =head1 FUNCTIONS diff --git a/C4/AuthoritiesMarc/UNIMARC.pm b/C4/AuthoritiesMarc/UNIMARC.pm index f93b42a..139d75f 100644 --- a/C4/AuthoritiesMarc/UNIMARC.pm +++ b/C4/AuthoritiesMarc/UNIMARC.pm @@ -39,7 +39,7 @@ MARC formats). Functions from this module generally should not be used directly; instead, use the appropriate function from C that will dispatch the appropriate -function based on the marcflavour system preference. +function based on the MarcFormat system preference. =head1 FUNCTIONS diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 7af8619..9ea2bf1 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -566,7 +566,7 @@ sub LinkBibHeadingsToAuthorities { my $authtypedata = C4::AuthoritiesMarc::GetAuthType( $heading->auth_type() ); my $marcrecordauth = MARC::Record->new(); - if ( C4::Context->preference('marcflavour') eq 'MARC21' ) { + if ( C4::Context->preference('MarcFormat') eq 'MARC21' ) { $marcrecordauth->leader(' nz a22 o 4500'); SetMarcUnicodeFlag( $marcrecordauth, 'MARC21' ); } @@ -588,7 +588,7 @@ sub LinkBibHeadingsToAuthorities { # use UTF-8, but as of 2008-08-05, did not want to introduce that kind # of change to a core API just before the 3.0 release. - if ( C4::Context->preference('marcflavour') eq 'MARC21' ) { + if ( C4::Context->preference('MarcFormat') eq 'MARC21' ) { $marcrecordauth->insert_fields_ordered( MARC::Field->new( '667', '', '', @@ -1256,11 +1256,11 @@ sub GetMarcBiblio { $sth->execute($biblionumber); my $row = $sth->fetchrow_hashref; my $marcxml = StripNonXmlChars( $row->{'marcxml'} ); - MARC::File::XML->default_record_format( C4::Context->preference('marcflavour') ); + MARC::File::XML->default_record_format( C4::Context->preference('MarcFormat') ); my $record = MARC::Record->new(); if ($marcxml) { - $record = eval { MARC::Record::new_from_xml( $marcxml, "utf8", C4::Context->preference('marcflavour') ) }; + $record = eval { MARC::Record::new_from_xml( $marcxml, "utf8", C4::Context->preference('MarcFormat') ) }; if ($@) { warn " problem with :$biblionumber : $@ \n$marcxml"; } return unless $record; @@ -1368,7 +1368,7 @@ sub GetCOinSBiblio { $genre = ( $mtx eq 'dc' ) ? "&rft.type=$genre" : "&rft.genre=$genre"; - if ( C4::Context->preference("marcflavour") eq "UNIMARC" ) { + if ( C4::Context->preference("MarcFormat") eq "UNIMARC" ) { # Setting datas $aulast = $record->subfield( '700', 'a' ) || ''; @@ -1448,14 +1448,14 @@ return the prices in accordance with the Marc format. =cut sub GetMarcPrice { - my ( $record, $marcflavour ) = @_; + my ( $record, $MarcFormat ) = @_; my @listtags; my $subfield; - if ( $marcflavour eq "MARC21" ) { + if ( $MarcFormat eq "MARC21" ) { @listtags = ('345', '020'); $subfield="c"; - } elsif ( $marcflavour eq "UNIMARC" ) { + } elsif ( $MarcFormat eq "UNIMARC" ) { @listtags = ('345', '010'); $subfield="d"; } else { @@ -1523,13 +1523,13 @@ Warning : this is not really in the marc standard. In Unimarc, Electre (the most =cut sub GetMarcQuantity { - my ( $record, $marcflavour ) = @_; + my ( $record, $MarcFormat ) = @_; my @listtags; my $subfield; - if ( $marcflavour eq "MARC21" ) { + if ( $MarcFormat eq "MARC21" ) { return 0 - } elsif ( $marcflavour eq "UNIMARC" ) { + } elsif ( $MarcFormat eq "UNIMARC" ) { @listtags = ('969'); $subfield="a"; } else { @@ -1602,18 +1602,18 @@ sub GetAuthorisedValueDesc { =head2 GetMarcControlnumber - $marccontrolnumber = GetMarcControlnumber($record,$marcflavour); + $marccontrolnumber = GetMarcControlnumber($record,$MarcFormat); Get the control number / record Identifier from the MARC record and return it. =cut sub GetMarcControlnumber { - my ( $record, $marcflavour ) = @_; + my ( $record, $MarcFormat ) = @_; my $controlnumber = ""; # Control number or Record identifier are the same field in MARC21, UNIMARC and NORMARC - # Keep $marcflavour for possible later use - if ($marcflavour eq "MARC21" || $marcflavour eq "UNIMARC" || $marcflavour eq "NORMARC") { + # Keep $MarcFormat for possible later use + if ($MarcFormat eq "MARC21" || $MarcFormat eq "UNIMARC" || $MarcFormat eq "NORMARC") { my $controlnumberField = $record->field('001'); if ($controlnumberField) { $controlnumber = $controlnumberField->data(); @@ -1624,7 +1624,7 @@ sub GetMarcControlnumber { =head2 GetMarcISBN - $marcisbnsarray = GetMarcISBN( $record, $marcflavour ); + $marcisbnsarray = GetMarcISBN( $record, $MarcFormat ); Get all ISBNs from the MARC record and returns them in an array. ISBNs stored in different fields depending on MARC flavour @@ -1632,9 +1632,9 @@ ISBNs stored in different fields depending on MARC flavour =cut sub GetMarcISBN { - my ( $record, $marcflavour ) = @_; + my ( $record, $MarcFormat ) = @_; my $scope; - if ( $marcflavour eq "UNIMARC" ) { + if ( $MarcFormat eq "UNIMARC" ) { $scope = '010'; } else { # assume marc21 if not unimarc $scope = '020'; @@ -1665,7 +1665,7 @@ sub GetMarcISBN { =head2 GetMarcISSN - $marcissnsarray = GetMarcISSN( $record, $marcflavour ); + $marcissnsarray = GetMarcISSN( $record, $MarcFormat ); Get all valid ISSNs from the MARC record and returns them in an array. ISSNs are stored in different fields depending on MARC flavour @@ -1673,9 +1673,9 @@ ISSNs are stored in different fields depending on MARC flavour =cut sub GetMarcISSN { - my ( $record, $marcflavour ) = @_; + my ( $record, $MarcFormat ) = @_; my $scope; - if ( $marcflavour eq "UNIMARC" ) { + if ( $MarcFormat eq "UNIMARC" ) { $scope = '011'; } else { # assume MARC21 or NORMARC @@ -1690,7 +1690,7 @@ sub GetMarcISSN { =head2 GetMarcNotes - $marcnotesarray = GetMarcNotes( $record, $marcflavour ); + $marcnotesarray = GetMarcNotes( $record, $MarcFormat ); Get all notes from the MARC record and returns them in an array. The note are stored in different fields depending on MARC flavour @@ -1698,9 +1698,9 @@ The note are stored in different fields depending on MARC flavour =cut sub GetMarcNotes { - my ( $record, $marcflavour ) = @_; + my ( $record, $MarcFormat ) = @_; my $scope; - if ( $marcflavour eq "UNIMARC" ) { + if ( $MarcFormat eq "UNIMARC" ) { $scope = '3..'; } else { # assume marc21 if not unimarc $scope = '5..'; @@ -1734,7 +1734,7 @@ sub GetMarcNotes { =head2 GetMarcSubjects - $marcsubjcts = GetMarcSubjects($record,$marcflavour); + $marcsubjcts = GetMarcSubjects($record,$MarcFormat); Get all subjects from the MARC record and returns them in an array. The subjects are stored in different fields depending on MARC flavour @@ -1742,9 +1742,9 @@ The subjects are stored in different fields depending on MARC flavour =cut sub GetMarcSubjects { - my ( $record, $marcflavour ) = @_; + my ( $record, $MarcFormat ) = @_; my ( $mintag, $maxtag, $fields_filter ); - if ( $marcflavour eq "UNIMARC" ) { + if ( $MarcFormat eq "UNIMARC" ) { $mintag = "600"; $maxtag = "611"; $fields_filter = '6..'; @@ -1780,9 +1780,9 @@ sub GetMarcSubjects { next if ( $subject_subfield->[0] eq '9' ); # don't load unimarc subfields 3,4,5 - next if ( ( $marcflavour eq "UNIMARC" ) and ( $subject_subfield->[0] =~ /2|3|4|5/ ) ); + next if ( ( $MarcFormat eq "UNIMARC" ) and ( $subject_subfield->[0] =~ /2|3|4|5/ ) ); # don't load MARC21 subfields 2 (FIXME: any more subfields??) - next if ( ( $marcflavour eq "MARC21" ) and ( $subject_subfield->[0] =~ /2/ ) ); + next if ( ( $MarcFormat eq "MARC21" ) and ( $subject_subfield->[0] =~ /2/ ) ); my $code = $subject_subfield->[0]; my $value = $subject_subfield->[1]; @@ -1819,7 +1819,7 @@ sub GetMarcSubjects { =head2 GetMarcAuthors - authors = GetMarcAuthors($record,$marcflavour); + authors = GetMarcAuthors($record,$MarcFormat); Get all authors from the MARC record and returns them in an array. The authors are stored in different fields depending on MARC flavour @@ -1827,13 +1827,13 @@ The authors are stored in different fields depending on MARC flavour =cut sub GetMarcAuthors { - my ( $record, $marcflavour ) = @_; + my ( $record, $MarcFormat ) = @_; my ( $mintag, $maxtag, $fields_filter ); # tagslib useful for UNIMARC author reponsabilities my $tagslib = &GetMarcStructure( 1, '' ); # FIXME : we don't have the framework available, we take the default framework. May be buggy on some setups, will be usually correct. - if ( $marcflavour eq "UNIMARC" ) { + if ( $MarcFormat eq "UNIMARC" ) { $mintag = "700"; $maxtag = "712"; $fields_filter = '7..'; @@ -1866,14 +1866,14 @@ sub GetMarcAuthors { next if ( $authors_subfield->[0] eq '9' ); # don't load unimarc subfields 3, 5 - next if ( $marcflavour eq 'UNIMARC' and ( $authors_subfield->[0] =~ /3|5/ ) ); + next if ( $MarcFormat eq 'UNIMARC' and ( $authors_subfield->[0] =~ /3|5/ ) ); my $code = $authors_subfield->[0]; my $value = $authors_subfield->[1]; my $linkvalue = $value; $linkvalue =~ s/(\(|\))//g; # UNIMARC author responsibility - if ( $marcflavour eq 'UNIMARC' and $code eq '4' ) { + if ( $MarcFormat eq 'UNIMARC' and $code eq '4' ) { $value = GetAuthorisedValueDesc( $field->tag(), $code, $value, '', $tagslib ); $linkvalue = "($value)"; } @@ -1907,7 +1907,7 @@ sub GetMarcAuthors { =head2 GetMarcUrls - $marcurls = GetMarcUrls($record,$marcflavour); + $marcurls = GetMarcUrls($record,$MarcFormat); Returns arrayref of URLs from MARC data, suitable to pass to tmpl loop. Assumes web resources (not uncommon in MARC21 to omit resource type ind) @@ -1915,7 +1915,7 @@ Assumes web resources (not uncommon in MARC21 to omit resource type ind) =cut sub GetMarcUrls { - my ( $record, $marcflavour ) = @_; + my ( $record, $MarcFormat ) = @_; my @marcurls; for my $field ( $record->field('856') ) { @@ -1926,7 +1926,7 @@ sub GetMarcUrls { my @urls = $field->subfield('u'); foreach my $url (@urls) { my $marcurl; - if ( $marcflavour eq 'MARC21' ) { + if ( $MarcFormat eq 'MARC21' ) { my $s3 = $field->subfield('3'); my $link = $field->subfield('y'); unless ( $url =~ /^\w+:/ ) { @@ -1962,7 +1962,7 @@ sub GetMarcUrls { =head2 GetMarcSeries - $marcseriesarray = GetMarcSeries($record,$marcflavour); + $marcseriesarray = GetMarcSeries($record,$MarcFormat); Get all series from the MARC record and returns them in an array. The series are stored in different fields depending on MARC flavour @@ -1970,9 +1970,9 @@ The series are stored in different fields depending on MARC flavour =cut sub GetMarcSeries { - my ( $record, $marcflavour ) = @_; + my ( $record, $MarcFormat ) = @_; my ( $mintag, $maxtag, $fields_filter ); - if ( $marcflavour eq "UNIMARC" ) { + if ( $MarcFormat eq "UNIMARC" ) { $mintag = "600"; $maxtag = "619"; $fields_filter = '6..'; @@ -2032,23 +2032,23 @@ sub GetMarcSeries { =head2 GetMarcHosts - $marchostsarray = GetMarcHosts($record,$marcflavour); + $marchostsarray = GetMarcHosts($record,$MarcFormat); Get all host records (773s MARC21, 461 UNIMARC) from the MARC record and returns them in an array. =cut sub GetMarcHosts { - my ( $record, $marcflavour ) = @_; + my ( $record, $MarcFormat ) = @_; my ( $tag,$title_subf,$bibnumber_subf,$itemnumber_subf); - $marcflavour ||="MARC21"; - if ( $marcflavour eq "MARC21" || $marcflavour eq "NORMARC" ) { + $MarcFormat ||="MARC21"; + if ( $MarcFormat eq "MARC21" || $MarcFormat eq "NORMARC" ) { $tag = "773"; $title_subf = "t"; $bibnumber_subf ="0"; $itemnumber_subf='9'; } - elsif ($marcflavour eq "UNIMARC") { + elsif ($MarcFormat eq "UNIMARC") { $tag = "461"; $title_subf = "t"; $bibnumber_subf ="0"; @@ -2103,7 +2103,7 @@ entry from user entry sub TransformKohaToMarc { my $hash = shift; my $record = MARC::Record->new(); - SetMarcUnicodeFlag( $record, C4::Context->preference("marcflavour") ); + SetMarcUnicodeFlag( $record, C4::Context->preference("MarcFormat") ); my $db_to_marc = C4::Context->marcfromkohafield; while ( my ($name, $value) = each %$hash ) { next unless my $dtm = $db_to_marc->{''}->{$name}; @@ -2125,22 +2125,22 @@ sub TransformKohaToMarc { =head2 PrepHostMarcField - $hostfield = PrepHostMarcField ( $hostbiblionumber,$hostitemnumber,$marcflavour ) + $hostfield = PrepHostMarcField ( $hostbiblionumber,$hostitemnumber,$MarcFormat ) This function returns a host field populated with data from the host record, the field can then be added to an analytical record =cut sub PrepHostMarcField { - my ($hostbiblionumber,$hostitemnumber, $marcflavour) = @_; - $marcflavour ||="MARC21"; + my ($hostbiblionumber,$hostitemnumber, $MarcFormat) = @_; + $MarcFormat ||="MARC21"; require C4::Items; my $hostrecord = GetMarcBiblio($hostbiblionumber); my $item = C4::Items::GetItem($hostitemnumber); my $hostmarcfield; - if ( $marcflavour eq "MARC21" || $marcflavour eq "NORMARC" ) { + if ( $MarcFormat eq "MARC21" || $MarcFormat eq "NORMARC" ) { #main entry my $mainentry; @@ -2191,7 +2191,7 @@ sub PrepHostMarcField { 'x' => $issn, 'z' => $isbn ); - } elsif ($marcflavour eq "UNIMARC") { + } elsif ($MarcFormat eq "UNIMARC") { $hostmarcfield = MARC::Field->new( 461, '', '', '0' => $hostbiblionumber, @@ -2226,7 +2226,7 @@ sub TransformHtmlToXml { my ( $tags, $subfields, $values, $indicator, $ind_tag, $auth_type ) = @_; my $xml = MARC::File::XML::header('UTF-8'); $xml .= "\n"; - $auth_type = C4::Context->preference('marcflavour') unless $auth_type; + $auth_type = C4::Context->preference('MarcFormat') unless $auth_type; MARC::File::XML->default_record_format($auth_type); # in UNIMARC, field 100 contains the encoding @@ -2240,7 +2240,7 @@ sub TransformHtmlToXml { my $j = -1; for ( my $i = 0 ; $i < @$tags ; $i++ ) { - if ( C4::Context->preference('marcflavour') eq 'UNIMARC' and @$tags[$i] eq "100" and @$subfields[$i] eq "a" ) { + if ( C4::Context->preference('MarcFormat') eq 'UNIMARC' and @$tags[$i] eq "100" and @$subfields[$i] eq "a" ) { # if we have a 100 field and it's values are not correct, skip them. # if we don't have any valid 100 field, we will create a default one at the end @@ -2324,7 +2324,7 @@ sub TransformHtmlToXml { $prevtag = @$tags[$i]; } $xml .= "\n" if $xml =~ m/preference('marcflavour') eq 'UNIMARC' and !$unimarc_and_100_exist ) { + if ( C4::Context->preference('MarcFormat') eq 'UNIMARC' and !$unimarc_and_100_exist ) { # warn "SETTING 100 for $auth_type"; my $string = strftime( "%Y%m%d", localtime(time) ); @@ -3275,7 +3275,7 @@ sub ModBiblioMarc { my $sth = $dbh->prepare("UPDATE biblio SET frameworkcode=? WHERE biblionumber=?"); $sth->execute( $frameworkcode, $biblionumber ); $sth->finish; - my $encoding = C4::Context->preference("marcflavour"); + my $encoding = C4::Context->preference("MarcFormat"); # deal with UNIMARC field 100 (encoding) : create it if needed & set encoding to unicode if ( $encoding eq "UNIMARC" ) { @@ -3445,21 +3445,21 @@ sub GetHolds { =head2 prepare_host_field -$marcfield = prepare_host_field( $hostbiblioitem, $marcflavour ); +$marcfield = prepare_host_field( $hostbiblioitem, $MarcFormat ); Generate the host item entry for an analytic child entry =cut sub prepare_host_field { - my ( $hostbiblio, $marcflavour ) = @_; - $marcflavour ||= C4::Context->preference('marcflavour'); + my ( $hostbiblio, $MarcFormat ) = @_; + $MarcFormat ||= C4::Context->preference('MarcFormat'); my $host = GetMarcBiblio($hostbiblio); # unfortunately as_string does not 'do the right thing' # if field returns undef my %sfd; my $field; my $host_field; - if ( $marcflavour eq 'MARC21' || $marcflavour eq 'NORMARC' ) { + if ( $MarcFormat eq 'MARC21' || $MarcFormat eq 'NORMARC' ) { if ( $field = $host->field('100') || $host->field('110') || $host->field('11') ) { my $s = $field->as_string('ab'); if ($s) { @@ -3502,7 +3502,7 @@ sub prepare_host_field { $host_field = MARC::Field->new( 773, '0', ' ', %sfd ); return $host_field; } - elsif ( $marcflavour eq 'UNIMARC' ) { + elsif ( $MarcFormat eq 'UNIMARC' ) { #author if ( $field = $host->field('700') || $host->field('710') || $host->field('720') ) { my $s = $field->as_string('ab'); diff --git a/C4/Breeding.pm b/C4/Breeding.pm index 01aca21..d474411 100644 --- a/C4/Breeding.pm +++ b/C4/Breeding.pm @@ -53,7 +53,7 @@ C4::Breeding : module to add biblios to import_records via possible in the breeding C<$encoding> => USMARC or UNIMARC. used for char_decoding. - If not present, the parameter marcflavour is used instead + If not present, the parameter MarcFormat is used instead C<$z3950random> => the random value created during a z3950 search result. =head1 DESCRIPTION @@ -82,7 +82,7 @@ sub ImportBreeding { # FIXME -- not sure that this kind of checking is actually needed my $searchbreeding = $dbh->prepare("select import_record_id from import_biblios where isbn=? and title=?"); -# $encoding = C4::Context->preference("marcflavour") unless $encoding; +# $encoding = C4::Context->preference("MarcFormat") unless $encoding; # fields used for import results my $imported=0; my $alreadyindb = 0; @@ -92,7 +92,7 @@ sub ImportBreeding { for (my $i=0;$i<=$#marcarray;$i++) { my ($marcrecord, $charset_result, $charset_errors); ($marcrecord, $charset_result, $charset_errors) = - MarcToUTF8Record($marcarray[$i]."\x1D", C4::Context->preference("marcflavour"), $encoding); + MarcToUTF8Record($marcarray[$i]."\x1D", C4::Context->preference("MarcFormat"), $encoding); # Normalize the record so it doesn't have separated diacritics SetUTF8Flag($marcrecord); @@ -377,7 +377,7 @@ sub Z3950Search { my $marcrecord; $marcdata = $rec->raw(); my ($charset_result, $charset_errors); - ($marcrecord, $charset_result, $charset_errors)= MarcToUTF8Record($marcdata, C4::Context->preference('marcflavour'), $encoding[$k]); + ($marcrecord, $charset_result, $charset_errors)= MarcToUTF8Record($marcdata, C4::Context->preference('MarcFormat'), $encoding[$k]); # Normalize the record so it doesn't have separated diacritics SetUTF8Flag($marcrecord); my $oldbiblio = TransformMarcToKoha( $dbh, $marcrecord, "" ); diff --git a/C4/Charset.pm b/C4/Charset.pm index f8ddd63..8b6a855 100644 --- a/C4/Charset.pm +++ b/C4/Charset.pm @@ -316,7 +316,7 @@ any actual character conversion. sub SetMarcUnicodeFlag { my $marc_record = shift; - my $marc_flavour = shift; # || C4::Context->preference("marcflavour"); + my $marc_flavour = shift; # || C4::Context->preference("MarcFormat"); $marc_record->encoding('UTF-8'); if ($marc_flavour eq 'MARC21' || $marc_flavour eq 'NORMARC') { @@ -348,7 +348,7 @@ sub SetMarcUnicodeFlag { } $debug && warn "encodage: ", substr( $marc_record->subfield(100, 'a'), $encodingposition, 3 ); } else { - warn "Unrecognized marcflavour: $marc_flavour"; + warn "Unrecognized MarcFormat: $marc_flavour"; } } diff --git a/C4/Context.pm b/C4/Context.pm index 7709f7e..991a268 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -700,7 +700,7 @@ sub Zconn { $context->{"Zconn"}->{$server} = &_new_Zconn($server,$async,$auth,$piggyback,$syntax); $context->{ Zconn }->{ $server }->option( - preferredRecordSyntax => C4::Context->preference("marcflavour") ); + preferredRecordSyntax => C4::Context->preference("MarcFormat") ); return $context->{"Zconn"}->{$server}; } } diff --git a/C4/HTML5Media.pm b/C4/HTML5Media.pm index 89620d3..871c20c 100644 --- a/C4/HTML5Media.pm +++ b/C4/HTML5Media.pm @@ -48,7 +48,7 @@ sub gethtml5media { my $HTML5MediaParent; my $HTML5MediaWidth; my @HTML5MediaExtensions = split( /\|/, C4::Context->preference("HTML5MediaExtensions") ); - my $marcflavour = C4::Context->preference("marcflavour"); + my $MarcFormat = C4::Context->preference("MarcFormat"); foreach my $HTML5Media_field (@HTML5Media_fields) { my %HTML5Media; # protocol @@ -59,10 +59,10 @@ sub gethtml5media { $HTML5Media{protocol} = 'http'; } elsif ( $HTML5Media_field->indicator(1) eq '7' ) { - if ($marcflavour eq 'MARC21' || $marcflavour eq 'NORMARC') { + if ($MarcFormat eq 'MARC21' || $MarcFormat eq 'NORMARC') { $HTML5Media{protocol} = $HTML5Media_field->subfield('2'); } - elsif ($marcflavour eq 'UNIMARC') { + elsif ($MarcFormat eq 'UNIMARC') { $HTML5Media{protocol} = $HTML5Media_field->subfield('y'); } } diff --git a/C4/Heading.pm b/C4/Heading.pm index dca4d1b..b54fb9c 100644 --- a/C4/Heading.pm +++ b/C4/Heading.pm @@ -67,9 +67,9 @@ sub new_from_bib_field { my $class = shift; my $field = shift; my $frameworkcode = shift; - my $marcflavour = @_ ? shift : C4::Context->preference('marcflavour'); + my $MarcFormat = @_ ? shift : C4::Context->preference('MarcFormat'); - my $marc_handler = _marc_format_handler($marcflavour); + my $marc_handler = _marc_format_handler($MarcFormat); my $tag = $field->tag(); return unless $marc_handler->valid_bib_heading_tag( $tag, $frameworkcode ); @@ -219,9 +219,9 @@ depending on the selected MARC flavour. =cut sub _marc_format_handler { - my $marcflavour = uc shift; - $marcflavour = 'MARC21' if ( $marcflavour eq 'NORMARC' ); - my $pname = "C4::Heading::$marcflavour"; + my $MarcFormat = uc shift; + $MarcFormat = 'MARC21' if ( $MarcFormat eq 'NORMARC' ); + my $pname = "C4::Heading::$MarcFormat"; load $pname; return $pname->new(); } diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm index 3ce5c67..6866be6 100644 --- a/C4/ImportBatch.pm +++ b/C4/ImportBatch.pm @@ -255,7 +255,7 @@ sub AddBiblioToBatch { my $z3950random = shift; my $update_counts = @_ ? shift : 1; - my $import_record_id = _create_import_record($batch_id, $record_sequence, $marc_record, 'biblio', $encoding, $z3950random, C4::Context->preference('marcflavour')); + my $import_record_id = _create_import_record($batch_id, $record_sequence, $marc_record, 'biblio', $encoding, $z3950random, C4::Context->preference('MarcFormat')); _add_biblio_fields($import_record_id, $marc_record); _update_batch_record_counts($batch_id) if $update_counts; return $import_record_id; @@ -270,7 +270,7 @@ sub AddBiblioToBatch { sub ModBiblioInBatch { my ($import_record_id, $marc_record) = @_; - _update_import_record_marc($import_record_id, $marc_record, C4::Context->preference('marcflavour')); + _update_import_record_marc($import_record_id, $marc_record, C4::Context->preference('MarcFormat')); _update_biblio_fields($import_record_id, $marc_record); } @@ -289,7 +289,7 @@ sub AddAuthToBatch { my $encoding = shift; my $z3950random = shift; my $update_counts = @_ ? shift : 1; - my $marc_type = shift || C4::Context->preference('marcflavour'); + my $marc_type = shift || C4::Context->preference('MarcFormat'); $marc_type = 'UNIMARCAUTH' if $marc_type eq 'UNIMARC'; @@ -308,8 +308,8 @@ sub AddAuthToBatch { sub ModAuthInBatch { my ($import_record_id, $marc_record) = @_; - my $marcflavour = C4::Context->preference('marcflavour'); - _update_import_record_marc($import_record_id, $marc_record, $marcflavour eq 'UNIMARC' ? 'UNIMARCAUTH' : 'USMARC'); + my $MarcFormat = C4::Context->preference('MarcFormat'); + _update_import_record_marc($import_record_id, $marc_record, $MarcFormat eq 'UNIMARC' ? 'UNIMARCAUTH' : 'USMARC'); } @@ -358,7 +358,7 @@ sub BatchStageMarcRecords { SetImportBatchItemAction($batch_id, 'ignore'); } - my $marc_type = C4::Context->preference('marcflavour'); + my $marc_type = C4::Context->preference('MarcFormat'); $marc_type .= 'AUTH' if ($marc_type eq 'UNIMARC' && $record_type eq 'auth'); my @invalid_records = (); my $num_valid = 0; @@ -440,7 +440,7 @@ sub AddItemsToImportBiblio { if ($#import_items_ids > -1) { _update_batch_record_counts($batch_id) if $update_counts; - _update_import_record_marc($import_record_id, $marc_record, C4::Context->preference('marcflavour')); + _update_import_record_marc($import_record_id, $marc_record, C4::Context->preference('MarcFormat')); } return @import_items_ids; } @@ -555,7 +555,7 @@ sub BatchCommitRecords { LEFT JOIN import_biblios ON (import_records.import_record_id=import_biblios.import_record_id) WHERE import_batch_id = ?"); $sth->execute($batch_id); - my $marcflavour = C4::Context->preference('marcflavour'); + my $MarcFormat = C4::Context->preference('MarcFormat'); my $rec_num = 0; while (my $rowref = $sth->fetchrow_hashref) { $record_type = $rowref->{'record_type'}; @@ -569,9 +569,9 @@ sub BatchCommitRecords { } my $marc_type; - if ($marcflavour eq 'UNIMARC' && $record_type eq 'auth') { + if ($MarcFormat eq 'UNIMARC' && $record_type eq 'auth') { $marc_type = 'UNIMARCAUTH'; - } elsif ($marcflavour eq 'UNIMARC') { + } elsif ($MarcFormat eq 'UNIMARC') { $marc_type = 'UNIMARC'; } else { $marc_type = 'USMARC'; @@ -747,16 +747,16 @@ sub BatchRevertRecords { WHERE import_batch_id = ?"); $sth->execute($batch_id); my $marc_type; - my $marcflavour = C4::Context->preference('marcflavour'); + my $MarcFormat = C4::Context->preference('MarcFormat'); while (my $rowref = $sth->fetchrow_hashref) { $record_type = $rowref->{'record_type'}; if ($rowref->{'status'} eq 'error' or $rowref->{'status'} eq 'reverted') { $num_ignored++; next; } - if ($marcflavour eq 'UNIMARC' && $record_type eq 'auth') { + if ($MarcFormat eq 'UNIMARC' && $record_type eq 'auth') { $marc_type = 'UNIMARCAUTH'; - } elsif ($marcflavour eq 'UNIMARC') { + } elsif ($MarcFormat eq 'UNIMARC') { $marc_type = 'UNIMARC'; } else { $marc_type = 'USMARC'; diff --git a/C4/Installer.pm b/C4/Installer.pm index 5bb9662..9b7e270 100644 --- a/C4/Installer.pm +++ b/C4/Installer.pm @@ -37,7 +37,7 @@ C4::Installer my $list = $installer->sql_file_list('en', 'marc21', { optional => 1, mandatory => 1 }); my ($fwk_language, $error_list) = $installer->load_sql_in_order($all_languages, @$list); $installer->set_version_syspref(); - $installer->set_marcflavour_syspref('MARC21'); + $installer->set_MarcFormat_syspref('MARC21'); =head1 DESCRIPTION @@ -69,7 +69,7 @@ sub new { ( $self->{port} ? ";port=$self->{port}" : "" ), $self->{'user'}, $self->{'password'}); $self->{'language'} = undef; - $self->{'marcflavour'} = undef; + $self->{'MarcFormat'} = undef; $self->{'dbh'}->do('set NAMES "utf8"'); $self->{'dbh'}->{'mysql_enable_utf8'}=1; @@ -77,9 +77,9 @@ sub new { return $self; } -=head2 marcflavour_list +=head2 MarcFormat_list - my ($marcflavours) = $installer->marcflavour_list($lang); + my ($MarcFormats) = $installer->MarcFormat_list($lang); Return a arrayref of the MARC flavour sets available for the specified language C<$lang>. Returns 'undef' if a directory @@ -87,11 +87,11 @@ for the language does not exist. =cut -sub marcflavour_list { +sub MarcFormat_list { my $self = shift; my $lang = shift; - my $dir = C4::Context->config('intranetdir') . "/installer/data/$self->{dbms}/$lang/marcflavour"; + my $dir = C4::Context->config('intranetdir') . "/installer/data/$self->{dbms}/$lang/MarcFormat"; opendir(MYDIR, $dir) or return; my @list = grep { !/^\.|CVS/ && -d "$dir/$_" } readdir(MYDIR); closedir MYDIR; @@ -101,11 +101,11 @@ sub marcflavour_list { =head2 marc_framework_sql_list my ($defaulted_to_en, $list) = - $installer->marc_framework_sql_list($lang, $marcflavour); + $installer->marc_framework_sql_list($lang, $MarcFormat); Returns in C<$list> a structure listing the filename, description, section, and mandatory/optional status of MARC framework scripts available for C<$lang> -and C<$marcflavour>. +and C<$MarcFormat>. If the C<$defaulted_to_en> return value is true, no scripts are available for language C<$lang> and the 'en' ones are returned. @@ -115,24 +115,24 @@ for language C<$lang> and the 'en' ones are returned. sub marc_framework_sql_list { my $self = shift; my $lang = shift; - my $marcflavour = shift; + my $MarcFormat = shift; my $defaulted_to_en = 0; undef $/; - my $dir = C4::Context->config('intranetdir') . "/installer/data/$self->{dbms}/$lang/marcflavour/".lc($marcflavour); + my $dir = C4::Context->config('intranetdir') . "/installer/data/$self->{dbms}/$lang/MarcFormat/".lc($MarcFormat); unless (opendir( MYDIR, $dir )) { if ($lang eq 'en') { warn "cannot open MARC frameworks directory $dir"; } else { # if no translated MARC framework is available, # default to English - $dir = C4::Context->config('intranetdir') . "/installer/data/$self->{dbms}/en/marcflavour/".lc($marcflavour); + $dir = C4::Context->config('intranetdir') . "/installer/data/$self->{dbms}/en/MarcFormat/".lc($MarcFormat); opendir(MYDIR, $dir) or warn "cannot open English MARC frameworks directory $dir"; $defaulted_to_en = 1; } } - my @listdir = sort grep { !/^\.|marcflavour/ && -d "$dir/$_" } readdir(MYDIR); + my @listdir = sort grep { !/^\.|MarcFormat/ && -d "$dir/$_" } readdir(MYDIR); closedir MYDIR; my @fwklist; @@ -210,7 +210,7 @@ sub sample_data_sql_list { $defaulted_to_en = 1; } } - my @listdir = sort grep { !/^\.|marcflavour/ && -d "$dir/$_" } readdir(MYDIR); + my @listdir = sort grep { !/^\.|MarcFormat/ && -d "$dir/$_" } readdir(MYDIR); closedir MYDIR; my @levellist; @@ -259,10 +259,10 @@ sub sample_data_sql_list { =head2 sql_file_list - my $list = $installer->sql_file_list($lang, $marcflavour, $subset_wanted); + my $list = $installer->sql_file_list($lang, $MarcFormat, $subset_wanted); Returns an arrayref containing the filepaths of installer SQL scripts -available for laod. The C<$lang> and C<$marcflavour> arguments +available for laod. The C<$lang> and C<$MarcFormat> arguments specify the desired language and MARC flavour. while C<$subset_wanted> is a hashref containing possible named parameters 'mandatory' and 'optional'. @@ -271,10 +271,10 @@ is a hashref containing possible named parameters 'mandatory' and 'optional'. sub sql_file_list { my $self = shift; my $lang = shift; - my $marcflavour = shift; + my $MarcFormat = shift; my $subset_wanted = shift; - my ($marc_defaulted_to_en, $marc_sql) = $self->marc_framework_sql_list($lang, $marcflavour); + my ($marc_defaulted_to_en, $marc_sql) = $self->marc_framework_sql_list($lang, $MarcFormat); my ($sample_defaulted_to_en, $sample_sql) = $self->sample_data_sql_list($lang); my @sql_list = (); @@ -400,13 +400,13 @@ sub load_sql_in_order { return ($fwk_language, \@list); } -=head2 set_marcflavour_syspref +=head2 set_MarcFormat_syspref - $installer->set_marcflavour_syspref($marcflavour); + $installer->set_MarcFormat_syspref($MarcFormat); -Set the 'marcflavour' system preference. The incoming -C<$marcflavour> references to a subdirectory of -installer/data/$dbms/$lang/marcflavour, and is +Set the 'MarcFormat' system preference. The incoming +C<$MarcFormat> references to a subdirectory of +installer/data/$dbms/$lang/MarcFormat, and is normalized to MARC21, UNIMARC or NORMARC. FIXME: this method assumes that the MARC flavour will be either @@ -414,18 +414,18 @@ MARC21, UNIMARC or NORMARC. =cut -sub set_marcflavour_syspref { +sub set_MarcFormat_syspref { my $self = shift; - my $marcflavour = shift; + my $MarcFormat = shift; # we can have some variants of marc flavour, by having different directories, like : unimarc_small and unimarc_full, for small and complete unimarc frameworks. - # marc_cleaned finds the marcflavour, without the variant. + # marc_cleaned finds the MarcFormat, without the variant. my $marc_cleaned = 'MARC21'; - $marc_cleaned = 'UNIMARC' if $marcflavour =~ /unimarc/i; - $marc_cleaned = 'NORMARC' if $marcflavour =~ /normarc/i; + $marc_cleaned = 'UNIMARC' if $MarcFormat =~ /unimarc/i; + $marc_cleaned = 'NORMARC' if $MarcFormat =~ /normarc/i; my $request = $self->{'dbh'}->prepare( - "INSERT IGNORE INTO `systempreferences` (variable,value,explanation,options,type) VALUES('marcflavour','$marc_cleaned','Define global MARC flavor (MARC21, UNIMARC or NORMARC) used for character encoding','MARC21|UNIMARC|NORMARC','Choice');" + "INSERT IGNORE INTO `systempreferences` (variable,value,explanation,options,type) VALUES('MarcFormat','$marc_cleaned','Define global MARC flavor (MARC21, UNIMARC or NORMARC) used for character encoding','MARC21|UNIMARC|NORMARC','Choice');" ); $request->execute; } diff --git a/C4/Items.pm b/C4/Items.pm index 212a9d3..ad8f424 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -1393,8 +1393,8 @@ sub GetHostItemsInfo { my ($record) = @_; my @returnitemsInfo; - if (C4::Context->preference('marcflavour') eq 'MARC21' || - C4::Context->preference('marcflavour') eq 'NORMARC'){ + if (C4::Context->preference('MarcFormat') eq 'MARC21' || + C4::Context->preference('MarcFormat') eq 'NORMARC'){ foreach my $hostfield ( $record->field('773') ) { my $hostbiblionumber = $hostfield->subfield("0"); my $linkeditemnumber = $hostfield->subfield("9"); @@ -1406,7 +1406,7 @@ sub GetHostItemsInfo { } } } - } elsif ( C4::Context->preference('marcflavour') eq 'UNIMARC'){ + } elsif ( C4::Context->preference('MarcFormat') eq 'UNIMARC'){ foreach my $hostfield ( $record->field('461') ) { my $hostbiblionumber = $hostfield->subfield("0"); my $linkeditemnumber = $hostfield->subfield("9"); @@ -1546,7 +1546,7 @@ sub get_hostitemnumbers_of { my $marcrecord = GetMarcBiblio($biblionumber); my (@returnhostitemnumbers,$tag, $biblio_s, $item_s); - my $marcflavor = C4::Context->preference('marcflavour'); + my $marcflavor = C4::Context->preference('MarcFormat'); if ($marcflavor eq 'MARC21' || $marcflavor eq 'NORMARC') { $tag='773'; $biblio_s='0'; @@ -2787,9 +2787,9 @@ sub PrepareItemrecordDisplay { $subfield_data{marc_value} = qq(); } elsif ( length($defaultvalue) > 100 - or (C4::Context->preference("marcflavour") eq "UNIMARC" and + or (C4::Context->preference("MarcFormat") eq "UNIMARC" and 300 <= $tag && $tag < 400 && $subfield eq 'a' ) - or (C4::Context->preference("marcflavour") eq "MARC21" and + or (C4::Context->preference("MarcFormat") eq "MARC21" and 500 <= $tag && $tag < 600 ) ) { # oversize field (textarea) diff --git a/C4/Koha.pm b/C4/Koha.pm index 9976995..b2f4d00 100644 --- a/C4/Koha.pm +++ b/C4/Koha.pm @@ -698,7 +698,7 @@ sub getallthemes { sub getFacets { my $facets; - if ( C4::Context->preference("marcflavour") eq "UNIMARC" ) { + if ( C4::Context->preference("MarcFormat") eq "UNIMARC" ) { $facets = [ { idx => 'su-to', @@ -1304,10 +1304,10 @@ sub display_marc_indicators { } sub GetNormalizedUPC { - my ($record,$marcflavour) = @_; + my ($record,$MarcFormat) = @_; my (@fields,$upc); - if ($marcflavour eq 'UNIMARC') { + if ($MarcFormat eq 'UNIMARC') { @fields = $record->field('072'); foreach my $field (@fields) { my $upc = _normalize_match_point($field->subfield('a')); @@ -1332,7 +1332,7 @@ sub GetNormalizedUPC { # Normalizes and returns the first valid ISBN found in the record # ISBN13 are converted into ISBN10. This is required to get some book cover images. sub GetNormalizedISBN { - my ($isbn,$record,$marcflavour) = @_; + my ($isbn,$record,$MarcFormat) = @_; my @fields; if ($isbn) { # Koha attempts to store multiple ISBNs in biblioitems.isbn, separated by " | " @@ -1342,7 +1342,7 @@ sub GetNormalizedISBN { } return unless $record; - if ($marcflavour eq 'UNIMARC') { + if ($MarcFormat eq 'UNIMARC') { @fields = $record->field('010'); foreach my $field (@fields) { my $isbn = $field->subfield('a'); @@ -1367,10 +1367,10 @@ sub GetNormalizedISBN { } sub GetNormalizedEAN { - my ($record,$marcflavour) = @_; + my ($record,$MarcFormat) = @_; my (@fields,$ean); - if ($marcflavour eq 'UNIMARC') { + if ($MarcFormat eq 'UNIMARC') { @fields = $record->field('073'); foreach my $field (@fields) { $ean = _normalize_match_point($field->subfield('a')); @@ -1391,10 +1391,10 @@ sub GetNormalizedEAN { } } sub GetNormalizedOCLCNumber { - my ($record,$marcflavour) = @_; + my ($record,$MarcFormat) = @_; my (@fields,$oclc); - if ($marcflavour eq 'UNIMARC') { + if ($MarcFormat eq 'UNIMARC') { # TODO: add UNIMARC fields } else { # assume marc21 if not unimarc diff --git a/C4/Record.pm b/C4/Record.pm index be1912c..a2aea2a 100644 --- a/C4/Record.pm +++ b/C4/Record.pm @@ -92,7 +92,7 @@ sub marc2marc { unless ($error) { my @privatefields; foreach my $field ($marc_record_obj->fields()) { - if ($field->tag() =~ m/9/ && ($field->tag() != '490' || C4::Context->preference("marcflavour") eq 'UNIMARC')) { + if ($field->tag() =~ m/9/ && ($field->tag() != '490' || C4::Context->preference("MarcFormat") eq 'UNIMARC')) { push @privatefields, $field; } elsif (! ($field->is_control_field())) { $field->delete_subfield(code => '9') if ($field->subfield('9')); @@ -148,7 +148,7 @@ sub marc2marcxml { foreach my $warn (@warnings) { warn "\t".$warn }; } unless($encoding) {$encoding = "UTF-8"}; # set default encoding - unless($flavour) {$flavour = C4::Context->preference("marcflavour")}; # set default MARC flavour + unless($flavour) {$flavour = C4::Context->preference("MarcFormat")}; # set default MARC flavour # attempt to convert the record to MARCXML eval { $marcxml = $marc_record_obj->as_xml_record($flavour) }; #handle exceptions @@ -204,7 +204,7 @@ sub marcxml2marc { my $error; # the error string my $marc; # the final ISO-2709 scalar unless($encoding) {$encoding = "UTF-8"}; # set the default encoding - unless($flavour) {$flavour = C4::Context->preference("marcflavour")}; # set the default MARC flavour + unless($flavour) {$flavour = C4::Context->preference("MarcFormat")}; # set the default MARC flavour # attempt to do the conversion eval { $marc = MARC::Record->new_from_xml($marcxml,$encoding,$flavour) }; # handle exceptions @@ -604,7 +604,7 @@ sub changeEncoding { my ($record,$format,$flavour,$to_encoding,$from_encoding) = @_; my $newrecord; my $error; - unless($flavour) {$flavour = C4::Context->preference("marcflavour")}; + unless($flavour) {$flavour = C4::Context->preference("MarcFormat")}; unless($to_encoding) {$to_encoding = "UTF-8"}; # ISO-2709 Record (MARC21 or UNIMARC) @@ -647,13 +647,13 @@ C<$id> - an id for the BibTex record (might be the biblionumber) sub marc2bibtex { my ($record, $id) = @_; my $tex; - my $marcflavour = C4::Context->preference("marcflavour"); + my $MarcFormat = C4::Context->preference("MarcFormat"); # Authors my $author; my @texauthors; my ( $mintag, $maxtag, $fields_filter ); - if ( $marcflavour eq "UNIMARC" ) { + if ( $MarcFormat eq "UNIMARC" ) { $mintag = "700"; $maxtag = "712"; $fields_filter = '7..'; @@ -667,7 +667,7 @@ sub marc2bibtex { next unless $field->tag() >= $mintag && $field->tag() <= $maxtag; # author formatted surname, firstname my $texauthor = ''; - if ( $marcflavour eq "UNIMARC" ) { + if ( $MarcFormat eq "UNIMARC" ) { $texauthor = join ', ', ( $field->subfield('a'), $field->subfield('b') ); } @@ -678,9 +678,9 @@ sub marc2bibtex { } $author = join ' and ', @texauthors; - # Defining the conversion hash according to the marcflavour + # Defining the conversion hash according to the MarcFormat my %bh; - if ( $marcflavour eq "UNIMARC" ) { + if ( $MarcFormat eq "UNIMARC" ) { # FIXME, TODO : handle repeatable fields # TODO : handle more types of documents diff --git a/C4/Ris.pm b/C4/Ris.pm index ce32ea9..fd10572 100644 --- a/C4/Ris.pm +++ b/C4/Ris.pm @@ -90,8 +90,8 @@ sub marc2ris { my ($record) = @_; my $output; - my $marcflavour = C4::Context->preference("marcflavour"); - my $intype = lc($marcflavour); + my $MarcFormat = C4::Context->preference("MarcFormat"); + my $intype = lc($MarcFormat); my $marcprint = 0; # Debug flag; # Let's redirect stdout diff --git a/C4/Search.pm b/C4/Search.pm index aec024b..3a11672 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -463,7 +463,7 @@ sub getRecords { my $tmpauthor; # the minimal record in author/title (depending on MARC flavour) - if ( C4::Context->preference("marcflavour") eq + if ( C4::Context->preference("MarcFormat") eq "UNIMARC" ) { $tmptitle = MARC::Field->new( @@ -1121,9 +1121,9 @@ sub _handle_exploding_index { return unless ($index =~ m/(su-br|su-na|su-rl)/ && $term); - my $marcflavour = C4::Context->preference('marcflavour'); + my $MarcFormat = C4::Context->preference('MarcFormat'); - my $codesubfield = $marcflavour eq 'UNIMARC' ? '5' : 'w'; + my $codesubfield = $MarcFormat eq 'UNIMARC' ? '5' : 'w'; my $wantedcodes = ''; my @subqueries = ( "\@attr 1=Subject \@attr 4=1 \"$term\""); my ($error, $results, $total_hits) = SimpleSearch( "he:$term", undef, undef, [ "authorityserver" ] ); @@ -1692,7 +1692,7 @@ sub searchResults { $times = $hits; # FIXME: if $hits is undefined, why do we want to equal it? } - my $marcflavour = C4::Context->preference("marcflavour"); + my $MarcFormat = C4::Context->preference("MarcFormat"); # We get the biblionumber position in MARC my ($bibliotag,$bibliosubf)=GetMarcFromKohaField('biblio.biblionumber',''); @@ -1712,10 +1712,10 @@ sub searchResults { $oldbiblio->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $oldbiblio->{itemtype} }->{imageurl} ); $oldbiblio->{'authorised_value_images'} = ($search_context eq 'opac' && C4::Context->preference('AuthorisedValueImages')) || ($search_context eq 'intranet' && C4::Context->preference('StaffAuthorisedValueImages')) ? C4::Items::get_authorised_value_images( C4::Biblio::get_biblio_authorised_values( $oldbiblio->{'biblionumber'}, $marcrecord ) ) : []; - $oldbiblio->{normalized_upc} = GetNormalizedUPC( $marcrecord,$marcflavour); - $oldbiblio->{normalized_ean} = GetNormalizedEAN( $marcrecord,$marcflavour); - $oldbiblio->{normalized_oclc} = GetNormalizedOCLCNumber($marcrecord,$marcflavour); - $oldbiblio->{normalized_isbn} = GetNormalizedISBN(undef,$marcrecord,$marcflavour); + $oldbiblio->{normalized_upc} = GetNormalizedUPC( $marcrecord,$MarcFormat); + $oldbiblio->{normalized_ean} = GetNormalizedEAN( $marcrecord,$MarcFormat); + $oldbiblio->{normalized_oclc} = GetNormalizedOCLCNumber($marcrecord,$MarcFormat); + $oldbiblio->{normalized_isbn} = GetNormalizedISBN(undef,$marcrecord,$MarcFormat); $oldbiblio->{content_identifier_exists} = 1 if ($oldbiblio->{normalized_isbn} or $oldbiblio->{normalized_oclc} or $oldbiblio->{normalized_ean} or $oldbiblio->{normalized_upc}); # edition information, if any @@ -1773,7 +1773,7 @@ sub searchResults { # Pull out the items fields my @fields = $marcrecord->field($itemtag); - my $marcflavor = C4::Context->preference("marcflavour"); + my $marcflavor = C4::Context->preference("MarcFormat"); # adding linked items that belong to host records my $analyticsfield = '773'; if ($marcflavor eq 'MARC21' || $marcflavor eq 'NORMARC') { diff --git a/C4/ShelfBrowser.pm b/C4/ShelfBrowser.pm index c885d90..18597d0 100644 --- a/C4/ShelfBrowser.pm +++ b/C4/ShelfBrowser.pm @@ -117,7 +117,7 @@ sub GetNearbyItems { $num_each_side ||= 3; my $dbh = C4::Context->dbh; - my $marcflavour = C4::Context->preference("marcflavour"); + my $MarcFormat = C4::Context->preference("MarcFormat"); my $branches = GetBranches(); my $sth_get_item_details = $dbh->prepare("SELECT cn_sort,homebranch,location,ccode from items where itemnumber=?"); @@ -177,8 +177,8 @@ sub GetNearbyItems { $sth_next_items->execute(@params); # Now we have the query run, suck out the data like marrow - my @prev_items = reverse GetShelfInfo($sth_prev_items, $marcflavour); - my @next_items = GetShelfInfo($sth_next_items, $marcflavour); + my @prev_items = reverse GetShelfInfo($sth_prev_items, $MarcFormat); + my @next_items = GetShelfInfo($sth_next_items, $MarcFormat); my ( $next_itemnumber, $next_biblionumber, @@ -210,7 +210,7 @@ sub GetNearbyItems { # them up with additional info that shelves want, and returns those as a list. # Not really intended to be exported. sub GetShelfInfo { - my ($sth, $marcflavour) = @_; + my ($sth, $MarcFormat) = @_; my @items; while (my $this_item = $sth->fetchrow_hashref()) { @@ -218,9 +218,9 @@ sub GetShelfInfo { next if (!defined($this_biblio)); $this_item->{'title'} = $this_biblio->{'title'}; my $this_record = GetMarcBiblio($this_biblio->{'biblionumber'}); - $this_item->{'browser_normalized_upc'} = GetNormalizedUPC($this_record,$marcflavour); - $this_item->{'browser_normalized_oclc'} = GetNormalizedOCLCNumber($this_record,$marcflavour); - $this_item->{'browser_normalized_isbn'} = GetNormalizedISBN(undef,$this_record,$marcflavour); + $this_item->{'browser_normalized_upc'} = GetNormalizedUPC($this_record,$MarcFormat); + $this_item->{'browser_normalized_oclc'} = GetNormalizedOCLCNumber($this_record,$MarcFormat); + $this_item->{'browser_normalized_isbn'} = GetNormalizedISBN(undef,$this_record,$MarcFormat); push @items, $this_item; } return @items; diff --git a/C4/VirtualShelves/Page.pm b/C4/VirtualShelves/Page.pm index f393cb1..ea40b9d 100644 --- a/C4/VirtualShelves/Page.pm +++ b/C4/VirtualShelves/Page.pm @@ -73,7 +73,7 @@ sub shelfpage { my $itemoff = ( $query->param('itemoff') ? $query->param('itemoff') : 1 ); my $displaymode = ( $query->param('display') ? $query->param('display') : 'publicshelves' ); my ( $shelflimit, $shelfoffset, $shelveslimit, $shelvesoffset ); - my $marcflavour = C4::Context->preference("marcflavour"); + my $MarcFormat = C4::Context->preference("MarcFormat"); # get biblionumbers stored in the cart my @cart_list; @@ -271,10 +271,10 @@ sub shelfpage { $this_item->{'imageurl'} = getitemtypeinfo( $this_item->{'itemtype'}, $type )->{'imageurl'}; $this_item->{'coins'} = GetCOinSBiblio( $record ); $this_item->{'subtitle'} = GetRecordValue('subtitle', $record, GetFrameworkCode($this_item->{'biblionumber'})); - $this_item->{'normalized_upc'} = GetNormalizedUPC( $record,$marcflavour); - $this_item->{'normalized_ean'} = GetNormalizedEAN( $record,$marcflavour); - $this_item->{'normalized_oclc'} = GetNormalizedOCLCNumber($record,$marcflavour); - $this_item->{'normalized_isbn'} = GetNormalizedISBN(undef,$record,$marcflavour); + $this_item->{'normalized_upc'} = GetNormalizedUPC( $record,$MarcFormat); + $this_item->{'normalized_ean'} = GetNormalizedEAN( $record,$MarcFormat); + $this_item->{'normalized_oclc'} = GetNormalizedOCLCNumber($record,$MarcFormat); + $this_item->{'normalized_isbn'} = GetNormalizedISBN(undef,$record,$MarcFormat); # Getting items infos for location display my @items_infos = &GetItemsLocationInfo( $this_item->{'biblionumber'}); $this_item->{'itemsissued'} = CountItemsIssued( $this_item->{'biblionumber'} ); diff --git a/C4/XSLT.pm b/C4/XSLT.pm index 6951674..a9710b5 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -147,22 +147,22 @@ sub XSLTParse4Display { if ($xslsyspref eq "XSLTDetailsDisplay") { $htdocs = C4::Context->config('intrahtdocs'); $theme = C4::Context->preference("template"); - $xslfile = C4::Context->preference('marcflavour') . + $xslfile = C4::Context->preference('MarcFormat') . "slim2intranetDetail.xsl"; } elsif ($xslsyspref eq "XSLTResultsDisplay") { $htdocs = C4::Context->config('intrahtdocs'); $theme = C4::Context->preference("template"); - $xslfile = C4::Context->preference('marcflavour') . + $xslfile = C4::Context->preference('MarcFormat') . "slim2intranetResults.xsl"; } elsif ($xslsyspref eq "OPACXSLTDetailsDisplay") { $htdocs = C4::Context->config('opachtdocs'); $theme = C4::Context->preference("opacthemes"); - $xslfile = C4::Context->preference('marcflavour') . + $xslfile = C4::Context->preference('MarcFormat') . "slim2OPACDetail.xsl"; } elsif ($xslsyspref eq "OPACXSLTResultsDisplay") { $htdocs = C4::Context->config('opachtdocs'); $theme = C4::Context->preference("opacthemes"); - $xslfile = C4::Context->preference('marcflavour') . + $xslfile = C4::Context->preference('MarcFormat') . "slim2OPACResults.xsl"; } $xslfilename = "$htdocs/$theme/$lang/xslt/$xslfile"; @@ -180,7 +180,7 @@ sub XSLTParse4Display { my $record = transformMARCXML4XSLT($biblionumber, $orig_record); #return $record->as_formatted(); my $itemsxml = buildKohaItemsNamespace($biblionumber, $hidden_items); - my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour')); + my $xmlrecord = $record->as_xml(C4::Context->preference('MarcFormat')); my $sysxml = "\n"; foreach my $syspref ( qw/ hidelostitems OPACURLOpenInNewWindow DisplayOPACiconsXSLT URLLinkText viewISBD diff --git a/Koha/Authority.pm b/Koha/Authority.pm index b07db92..20c57b2 100644 --- a/Koha/Authority.pm +++ b/Koha/Authority.pm @@ -40,7 +40,7 @@ use C4::Charset; use base qw(Class::Accessor); -__PACKAGE__->mk_accessors(qw( authid authtype record marcflavour )); +__PACKAGE__->mk_accessors(qw( authid authtype record MarcFormat )); =head2 new @@ -69,19 +69,19 @@ Create the Koha::Authority object associated with the provided authid. sub get_from_authid { my $class = shift; my $authid = shift; - my $marcflavour = C4::Context->preference("marcflavour"); + my $MarcFormat = C4::Context->preference("MarcFormat"); my $dbh=C4::Context->dbh; my $sth=$dbh->prepare("select authtypecode, marcxml from auth_header where authid=?"); $sth->execute($authid); my ($authtypecode, $marcxml) = $sth->fetchrow; my $record=eval {MARC::Record->new_from_xml(StripNonXmlChars($marcxml),'UTF-8', - (C4::Context->preference("marcflavour") eq "UNIMARC"?"UNIMARCAUTH":C4::Context->preference("marcflavour")))}; + (C4::Context->preference("MarcFormat") eq "UNIMARC"?"UNIMARCAUTH":C4::Context->preference("MarcFormat")))}; return if ($@); $record->encoding('UTF-8'); my $self = $class->SUPER::new( { authid => $authid, - marcflavour => $marcflavour, + MarcFormat => $MarcFormat, authtype => $authtypecode, record => $record }); diff --git a/Koha/Indexer/Utils.pm b/Koha/Indexer/Utils.pm index 07e8d23..da3ea3d 100644 --- a/Koha/Indexer/Utils.pm +++ b/Koha/Indexer/Utils.pm @@ -37,7 +37,7 @@ of Koha's bibliographic and authority search indexes. =head2 zebra_record_abs_to_dom -$dom_config = Koha::Indexer::Utils::zebra_record_abs_to_dom($record_abs_config, $marcflavour); +$dom_config = Koha::Indexer::Utils::zebra_record_abs_to_dom($record_abs_config, $MarcFormat); Given a string containing the contents of a records.abs configuration file as used by Zebra's GRS-1 filter, emit an equivalent DOM configuration. @@ -48,7 +48,7 @@ our $idxNS = 'http://www.koha-community.org/schemas/index-defs'; sub zebra_record_abs_to_dom { my $grs1_cfg = shift; - my $marcflavour = shift; + my $MarcFormat = shift; chomp $grs1_cfg; my @grs1_cfg_lines = split /\n/, $grs1_cfg, -1; @@ -73,7 +73,7 @@ sub zebra_record_abs_to_dom { my $root = $dom_cfg->createElement('index_defs'); $root->setNamespace($idxNS, 'kohaidx'); foreach my $grs1_def (@$grs1_defs) { - _append_grs1_def_to_dom_cfg($dom_cfg, $root, $grs1_def, $marcflavour); + _append_grs1_def_to_dom_cfg($dom_cfg, $root, $grs1_def, $MarcFormat); } # and emit the result as a string @@ -140,7 +140,7 @@ sub _append_grs1_def_to_dom_cfg { my $dom_cfg = shift; my $root = shift; my $grs1_def = shift; - my $marcflavour = shift; + my $MarcFormat = shift; my $comment = $dom_cfg->createComment('record.abs line ' . $grs1_def->{lineno} . ': ' . diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl index abfb870..f1d515d 100755 --- a/acqui/addorderiso2709.pl +++ b/acqui/addorderiso2709.pl @@ -192,7 +192,7 @@ if ($op eq ""){ my $patron = C4::Members::GetMember( borrowernumber => $loggedinuser ); my $branch = C4::Branch->GetBranchDetail( $patron->{branchcode} ); # get quantity in the MARC record (1 if none) - my $quantity = GetMarcQuantity($marcrecord, C4::Context->preference('marcflavour')) || 1; + my $quantity = GetMarcQuantity($marcrecord, C4::Context->preference('MarcFormat')) || 1; my %orderinfo = ( "biblionumber", $biblionumber, "basketno", $cgiparams->{'basketno'}, "quantity", $quantity, "branchcode", $branch, @@ -202,7 +202,7 @@ if ($op eq ""){ "currency",$cgiparams->{'currency'}, ); - my $price = GetMarcPrice($marcrecord, C4::Context->preference('marcflavour')); + my $price = GetMarcPrice($marcrecord, C4::Context->preference('MarcFormat')); if ($price){ eval { diff --git a/acqui/basketgroup.pl b/acqui/basketgroup.pl index 398980c..9983a02 100755 --- a/acqui/basketgroup.pl +++ b/acqui/basketgroup.pl @@ -264,9 +264,9 @@ sub printbasketgrouppdf{ my $en; my $marcrecord=eval{MARC::Record::new_from_xml( $ord->{marcxml},'UTF-8' )}; if ($marcrecord){ - if ( C4::Context->preference("marcflavour") eq 'UNIMARC' ) { + if ( C4::Context->preference("MarcFormat") eq 'UNIMARC' ) { $en = $marcrecord->subfield( '345', "b" ); - } elsif ( C4::Context->preference("marcflavour") eq 'MARC21' ) { + } elsif ( C4::Context->preference("MarcFormat") eq 'MARC21' ) { $en = $marcrecord->subfield( '037', "a" ); } } diff --git a/acqui/histsearch.pl b/acqui/histsearch.pl index 971fc18..7d19111 100755 --- a/acqui/histsearch.pl +++ b/acqui/histsearch.pl @@ -133,7 +133,7 @@ $template->param( from_placed_on => $from_date, to_placed_on => $to_date, debug => $debug || $input->param('debug') || 0, - uc(C4::Context->preference("marcflavour")) => 1 + uc(C4::Context->preference("MarcFormat")) => 1 ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl index ce96ff3..7f8d8a6 100755 --- a/acqui/neworderempty.pl +++ b/acqui/neworderempty.pl @@ -121,7 +121,7 @@ our ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user( } ); -our $marcflavour = C4::Context->preference('marcflavour'); +our $MarcFormat = C4::Context->preference('MarcFormat'); if(!$basketno) { my $order = GetOrder($ordernumber); @@ -164,7 +164,7 @@ if ( $ordernumber eq '' and defined $params->{'breedingid'}){ $params->{'frameworkcode'} or $params->{'frameworkcode'} = ""; ( $biblionumber, $bibitemnum ) = AddBiblio( $marcrecord, $params->{'frameworkcode'} ); # get the price if there is one. - $listprice = GetMarcPrice($marcrecord, $marcflavour); + $listprice = GetMarcPrice($marcrecord, $MarcFormat); SetImportRecordStatus($params->{'breedingid'}, 'imported'); } @@ -415,7 +415,7 @@ $template->param( import_batch_id => $import_batch_id, subscriptionid => $subscriptionid, acqcreate => C4::Context->preference("AcqCreateItem") eq "ordering" ? 1 : "", - (uc(C4::Context->preference("marcflavour"))) => 1 + (uc(C4::Context->preference("MarcFormat"))) => 1 ); $template->param ( notes => $data->{'notes'} ) if ( $ordernumber ); @@ -451,7 +451,7 @@ sub MARCfindbreeding { } } # fix the unimarc 100 coded field (with unicode information) - if ($marcflavour eq 'UNIMARC' && $record->subfield(100,'a')) { + if ($MarcFormat eq 'UNIMARC' && $record->subfield(100,'a')) { my $f100a=$record->subfield(100,'a'); my $f100 = $record->field(100); my $f100temp = $f100->as_string; @@ -549,7 +549,7 @@ sub Load_Duplicate { booksellerid => $basket->{'booksellerid'}, breedingid => $params->{'breedingid'}, duplicatetitle => $duplicatetitle, - (uc(C4::Context->preference("marcflavour"))) => 1 + (uc(C4::Context->preference("MarcFormat"))) => 1 ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/acqui/parcel.pl b/acqui/parcel.pl index 8e82283..1f8ddbb 100755 --- a/acqui/parcel.pl +++ b/acqui/parcel.pl @@ -300,7 +300,7 @@ $template->param( book_foot_loop => \@book_foot_loop, totalprice => sprintf($cfstr, $totalprice), totalquantity => $totalquantity, - (uc(C4::Context->preference("marcflavour"))) => 1, + (uc(C4::Context->preference("MarcFormat"))) => 1, total_quantity => $total_quantity, total_gste => sprintf( "%.2f", $total_gste ), total_gsti => sprintf( "%.2f", $total_gsti ), diff --git a/authorities/authorities-home.pl b/authorities/authorities-home.pl index f67f5c9..f5b49a4 100755 --- a/authorities/authorities-home.pl +++ b/authorities/authorities-home.pl @@ -184,7 +184,7 @@ $template->param( op => $op, ); -$template->{VARS}->{marcflavour} = C4::Context->preference("marcflavour"); +$template->{VARS}->{MarcFormat} = C4::Context->preference("MarcFormat"); # Print the page output_html_with_http_headers $query, $cookie, $template->output; diff --git a/authorities/authorities.pl b/authorities/authorities.pl index 19a03e8..ace487a 100755 --- a/authorities/authorities.pl +++ b/authorities/authorities.pl @@ -132,7 +132,7 @@ sub create_input { my $max_length = 9999; if ($tag eq '000') { $max_length = 24; - } elsif ($tag eq '008' and C4::Context->preference('marcflavour') eq 'MARC21') { + } elsif ($tag eq '008' and C4::Context->preference('MarcFormat') eq 'MARC21') { $max_length = 40; } @@ -264,11 +264,11 @@ sub create_input { if ( length($value) > 100 or - ( C4::Context->preference("marcflavour") eq "UNIMARC" && $tag >= 300 + ( C4::Context->preference("MarcFormat") eq "UNIMARC" && $tag >= 300 and $tag < 400 && $subfield eq 'a' ) or ( $tag >= 600 and $tag < 700 - && C4::Context->preference("marcflavour") eq "MARC21" ) + && C4::Context->preference("MarcFormat") eq "MARC21" ) ) { $subfield_data{marc_value} = diff --git a/authorities/detail.pl b/authorities/detail.pl index 6402961..3d718f3 100755 --- a/authorities/detail.pl +++ b/authorities/detail.pl @@ -223,6 +223,6 @@ $template->param(authid => $authid, authtypesloop => \@authtypesloop, ); -$template->{VARS}->{marcflavour} = C4::Context->preference("marcflavour"); +$template->{VARS}->{MarcFormat} = C4::Context->preference("MarcFormat"); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/authorities/export.pl b/authorities/export.pl index 9c8ae17..483b496 100755 --- a/authorities/export.pl +++ b/authorities/export.pl @@ -30,7 +30,7 @@ if ( $op eq "export" ) { my $marc = GetAuthority($authid); if ( $format =~ /marcxml/ ) { - $marc = marc2marcxml($marc, 'UTF-8', C4::Context->preference("marcflavour") eq 'UNIMARC' ? 'UNIMARCAUTH' : 'MARC21' ); + $marc = marc2marcxml($marc, 'UTF-8', C4::Context->preference("MarcFormat") eq 'UNIMARC' ? 'UNIMARCAUTH' : 'MARC21' ); } elsif ($format=~ /mads/) { $marc = marc2madsxml($marc); diff --git a/basket/basket.pl b/basket/basket.pl index d33216c..3c4aef2 100755 --- a/basket/basket.pl +++ b/basket/basket.pl @@ -48,7 +48,7 @@ my @bibs = split( /\//, $bib_list ); my @results; my $num = 1; -my $marcflavour = C4::Context->preference('marcflavour'); +my $MarcFormat = C4::Context->preference('MarcFormat'); if (C4::Context->preference('TagsEnabled')) { $template->param(TagsEnabled => 1); foreach (qw(TagsShowOnList TagsInputOnList)) { @@ -62,11 +62,11 @@ foreach my $biblionumber ( @bibs ) { my $dat = &GetBiblioData($biblionumber); my $record = &GetMarcBiblio($biblionumber); - my $marcnotesarray = GetMarcNotes( $record, $marcflavour ); - my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); - my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); - my $marcseriesarray = GetMarcSeries ($record,$marcflavour); - my $marcurlsarray = GetMarcUrls ($record,$marcflavour); + my $marcnotesarray = GetMarcNotes( $record, $MarcFormat ); + my $marcauthorsarray = GetMarcAuthors( $record, $MarcFormat ); + my $marcsubjctsarray = GetMarcSubjects( $record, $MarcFormat ); + my $marcseriesarray = GetMarcSeries ($record,$MarcFormat); + my $marcurlsarray = GetMarcUrls ($record,$MarcFormat); my @items = GetItemsInfo( $biblionumber ); my $hasauthors = 0; diff --git a/basket/downloadcart.pl b/basket/downloadcart.pl index 392a3e4..c80db17 100755 --- a/basket/downloadcart.pl +++ b/basket/downloadcart.pl @@ -52,7 +52,7 @@ if ($bib_list && $format) { my @bibs = split( /\//, $bib_list ); - my $marcflavour = C4::Context->preference('marcflavour'); + my $MarcFormat = C4::Context->preference('MarcFormat'); my $output; # CSV diff --git a/basket/sendbasket.pl b/basket/sendbasket.pl index 66f73fa..226edc0 100755 --- a/basket/sendbasket.pl +++ b/basket/sendbasket.pl @@ -70,15 +70,15 @@ if ( $email_add ) { my @bibs = split( /\//, $bib_list ); my @results; my $iso2709; - my $marcflavour = C4::Context->preference('marcflavour'); + my $MarcFormat = C4::Context->preference('MarcFormat'); foreach my $biblionumber (@bibs) { $template2->param( biblionumber => $biblionumber ); my $dat = GetBiblioData($biblionumber); my $record = GetMarcBiblio($biblionumber); - my $marcnotesarray = GetMarcNotes( $record, $marcflavour ); - my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); - my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); + my $marcnotesarray = GetMarcNotes( $record, $MarcFormat ); + my $marcauthorsarray = GetMarcAuthors( $record, $MarcFormat ); + my $marcsubjctsarray = GetMarcSubjects( $record, $MarcFormat ); my @items = GetItemsInfo( $biblionumber ); diff --git a/catalogue/detail.pl b/catalogue/detail.pl index ab1df8a..b6d2a0f 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -82,7 +82,7 @@ if($query->cookie("holdfor")){ my $fw = GetFrameworkCode($biblionumber); my $showallitems = $query->param('showallitems'); -my $marcflavour = C4::Context->preference("marcflavour"); +my $MarcFormat = C4::Context->preference("MarcFormat"); # XSLT processing of some stuff if (C4::Context->preference("XSLTDetailsDisplay") ) { @@ -96,10 +96,10 @@ $template->param( ocoins => GetCOinSBiblio($record) ); # some useful variables for enhanced content; # in each case, we're grabbing the first value we find in # the record and normalizing it -my $upc = GetNormalizedUPC($record,$marcflavour); -my $ean = GetNormalizedEAN($record,$marcflavour); -my $oclc = GetNormalizedOCLCNumber($record,$marcflavour); -my $isbn = GetNormalizedISBN(undef,$record,$marcflavour); +my $upc = GetNormalizedUPC($record,$MarcFormat); +my $ean = GetNormalizedEAN($record,$MarcFormat); +my $oclc = GetNormalizedOCLCNumber($record,$MarcFormat); +my $isbn = GetNormalizedISBN(undef,$record,$MarcFormat); $template->param( normalized_upc => $upc, @@ -108,13 +108,13 @@ $template->param( normalized_isbn => $isbn, ); -my $marcnotesarray = GetMarcNotes( $record, $marcflavour ); -my $marcisbnsarray = GetMarcISBN( $record, $marcflavour ); -my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); -my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); -my $marcseriesarray = GetMarcSeries($record,$marcflavour); -my $marcurlsarray = GetMarcUrls ($record,$marcflavour); -my $marchostsarray = GetMarcHosts($record,$marcflavour); +my $marcnotesarray = GetMarcNotes( $record, $MarcFormat ); +my $marcisbnsarray = GetMarcISBN( $record, $MarcFormat ); +my $marcauthorsarray = GetMarcAuthors( $record, $MarcFormat ); +my $marcsubjctsarray = GetMarcSubjects( $record, $MarcFormat ); +my $marcseriesarray = GetMarcSeries($record,$MarcFormat); +my $marcurlsarray = GetMarcUrls ($record,$MarcFormat); +my $marchostsarray = GetMarcHosts($record,$MarcFormat); my $subtitle = GetRecordValue('subtitle', $record, $fw); # Get Branches, Itemtypes and Locations diff --git a/catalogue/export.pl b/catalogue/export.pl index 26e189b..5d32eac 100755 --- a/catalogue/export.pl +++ b/catalogue/export.pl @@ -53,7 +53,7 @@ if ($op eq "export") { } elsif ($format =~ /marcstd/) { C4::Charset::SetUTF8Flag($marc,1); - ($error, $marc) = marc2marc($marc, 'marcstd', C4::Context->preference('marcflavour')); + ($error, $marc) = marc2marc($marc, 'marcstd', C4::Context->preference('MarcFormat')); } print $query->header( -type => 'application/octet-stream', diff --git a/catalogue/search.pl b/catalogue/search.pl index d4e98b1..45d0fd8 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -179,7 +179,7 @@ else { flagsrequired => { catalogue => 1 }, } ); -if (C4::Context->preference("marcflavour") eq "UNIMARC" ) { +if (C4::Context->preference("MarcFormat") eq "UNIMARC" ) { $template->param('UNIMARC' => 1); } if (C4::Context->preference("IntranetNumbersPreferPhrase")) { @@ -333,7 +333,7 @@ if ( $template_type eq 'advsearch' ) { } } - $template->param(uc(C4::Context->preference("marcflavour")) => 1, + $template->param(uc(C4::Context->preference("MarcFormat")) => 1, search_boxes_loop => \@search_boxes_array); # load the language limits (for search) diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index 3a5b7c5..ee67985 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -41,7 +41,7 @@ use MARC::File::USMARC; use MARC::File::XML; use URI::Escape; -if ( C4::Context->preference('marcflavour') eq 'UNIMARC' ) { +if ( C4::Context->preference('MarcFormat') eq 'UNIMARC' ) { MARC::File::XML->default_record_format('UNIMARC'); } @@ -77,7 +77,7 @@ sub MARCfindbreeding { } } # fix the unimarc 100 coded field (with unicode information) - if (C4::Context->preference('marcflavour') eq 'UNIMARC' && $record->subfield(100,'a')) { + if (C4::Context->preference('MarcFormat') eq 'UNIMARC' && $record->subfield(100,'a')) { my $f100a=$record->subfield(100,'a'); my $f100 = $record->field(100); my $f100temp = $f100->as_string; @@ -97,7 +97,7 @@ sub MARCfindbreeding { # normalize author : UNIMARC specific... if ( C4::Context->preference("z3950NormalizeAuthor") and C4::Context->preference("z3950AuthorAuthFields") - and C4::Context->preference("marcflavour") eq 'UNIMARC' ) + and C4::Context->preference("MarcFormat") eq 'UNIMARC' ) { my ( $tag, $subfield ) = GetMarcFromKohaField("biblio.author", ''); @@ -456,11 +456,11 @@ sub create_input { if ( length($value) > 100 or - ( C4::Context->preference("marcflavour") eq "UNIMARC" && $tag >= 300 + ( C4::Context->preference("MarcFormat") eq "UNIMARC" && $tag >= 300 and $tag < 400 && $subfield eq 'a' ) or ( $tag >= 500 and $tag < 600 - && C4::Context->preference("marcflavour") eq "MARC21" ) + && C4::Context->preference("MarcFormat") eq "MARC21" ) ) { $subfield_data{marc_value} = @@ -807,19 +807,19 @@ if ($breedingid) { #populate hostfield if hostbiblionumber is available if ($hostbiblionumber) { - my $marcflavour = C4::Context->preference("marcflavour"); + my $MarcFormat = C4::Context->preference("MarcFormat"); $record = MARC::Record->new(); $record->leader(''); my $field = - PrepHostMarcField( $hostbiblionumber, $hostitemnumber, $marcflavour ); + PrepHostMarcField( $hostbiblionumber, $hostitemnumber, $MarcFormat ); $record->append_fields($field); } # This is a child record if ($parentbiblio) { - my $marcflavour = C4::Context->preference('marcflavour'); + my $MarcFormat = C4::Context->preference('MarcFormat'); $record = MARC::Record->new(); - my $hostfield = prepare_host_field($parentbiblio,$marcflavour); + my $hostfield = prepare_host_field($parentbiblio,$MarcFormat); if ($hostfield) { $record->append_fields($hostfield); } @@ -917,8 +917,8 @@ if ( $op eq "addbiblio" ) { done =>1, popup =>1 ); - $template->param( title => $record->subfield('200',"a") ) if ($record ne "-1" && C4::Context->preference('marcflavour') =~/unimarc/i); - $template->param( title => $record->title() ) if ($record ne "-1" && C4::Context->preference('marcflavour') eq "usmarc"); + $template->param( title => $record->subfield('200',"a") ) if ($record ne "-1" && C4::Context->preference('MarcFormat') =~/unimarc/i); + $template->param( title => $record->title() ) if ($record ne "-1" && C4::Context->preference('MarcFormat') eq "usmarc"); $template->param( popup => $mode, itemtype => $frameworkcode, @@ -967,7 +967,7 @@ elsif ( $op eq "delete" ) { eval { my $uxml = $record->as_xml; MARC::Record::default_record_format("UNIMARC") - if ( C4::Context->preference("marcflavour") eq "UNIMARC" ); + if ( C4::Context->preference("MarcFormat") eq "UNIMARC" ); my $urecord = MARC::Record::new_from_xml( $uxml, 'UTF-8' ); $record = $urecord; }; diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index a2eacef..bf465be 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -265,9 +265,9 @@ sub generate_subfield_form { $subfield_data{marc_value} = qq(); } elsif ( length($value) > 100 - or (C4::Context->preference("marcflavour") eq "UNIMARC" and + or (C4::Context->preference("MarcFormat") eq "UNIMARC" and 300 <= $tag && $tag < 400 && $subfieldtag eq 'a' ) - or (C4::Context->preference("marcflavour") eq "MARC21" and + or (C4::Context->preference("MarcFormat") eq "MARC21" and 500 <= $tag && $tag < 600 ) ) { # oversize field (textarea) @@ -314,7 +314,7 @@ my $biblionumber = $input->param('biblionumber'); my $itemnumber = $input->param('itemnumber'); my $op = $input->param('op'); my $hostitemnumber = $input->param('hostitemnumber'); -my $marcflavour = C4::Context->preference("marcflavour"); +my $MarcFormat = C4::Context->preference("MarcFormat"); # fast cataloguing datas my $fa_circborrowernumber = $input->param('circborrowernumber'); my $fa_barcode = $input->param('barcode'); @@ -608,9 +608,9 @@ if ($op eq "additem") { $nextop="additem"; } elsif ($op eq "delinkitem"){ my $analyticfield = '773'; - if ($marcflavour eq 'MARC21' || $marcflavour eq 'NORMARC'){ + if ($MarcFormat eq 'MARC21' || $MarcFormat eq 'NORMARC'){ $analyticfield = '773'; - } elsif ($marcflavour eq 'UNIMARC') { + } elsif ($MarcFormat eq 'UNIMARC') { $analyticfield = '461'; } foreach my $field ($record->field($analyticfield)){ @@ -644,9 +644,9 @@ my @fields = $temp->fields(); my @hostitemnumbers; if ( C4::Context->preference('EasyAnalyticalRecords') ) { my $analyticfield = '773'; - if ($marcflavour eq 'MARC21' || $marcflavour eq 'NORMARC') { + if ($MarcFormat eq 'MARC21' || $MarcFormat eq 'NORMARC') { $analyticfield = '773'; - } elsif ($marcflavour eq 'UNIMARC') { + } elsif ($MarcFormat eq 'UNIMARC') { $analyticfield = '461'; } foreach my $hostfield ($temp->field($analyticfield)){ diff --git a/cataloguing/linkitem.pl b/cataloguing/linkitem.pl index 9b632f1..fd52ff0 100755 --- a/cataloguing/linkitem.pl +++ b/cataloguing/linkitem.pl @@ -45,11 +45,11 @@ my ($template, $loggedinuser, $cookie) }); my $biblio = GetMarcBiblio($biblionumber); -my $marcflavour = C4::Context->preference("marcflavour"); -$marcflavour ||="MARC21"; -if ($marcflavour eq 'MARC21' || $marcflavour eq 'NORMARC') { +my $MarcFormat = C4::Context->preference("MarcFormat"); +$MarcFormat ||="MARC21"; +if ($MarcFormat eq 'MARC21' || $MarcFormat eq 'NORMARC') { $template->param(bibliotitle => $biblio->subfield('245','a')); -} elsif ($marcflavour eq 'UNIMARC') { +} elsif ($MarcFormat eq 'UNIMARC') { $template->param(bibliotitle => $biblio->subfield('200','a')); } @@ -64,7 +64,7 @@ if ($barcode && $biblionumber) { my $hostbiblionumber = GetBiblionumberFromItemnumber($hostitemnumber); if ($hostbiblionumber) { - my $field = PrepHostMarcField($hostbiblionumber, $hostitemnumber,$marcflavour); + my $field = PrepHostMarcField($hostbiblionumber, $hostitemnumber,$MarcFormat); $biblio->append_fields($field); my $modresult = ModBiblio($biblio, $biblionumber, ''); diff --git a/installer/data/mysql/ru-RU/mandatory/system_preferences_optimal_values_insert_only.sql b/installer/data/mysql/ru-RU/mandatory/system_preferences_optimal_values_insert_only.sql index eb34a8d..359d41e 100644 --- a/installer/data/mysql/ru-RU/mandatory/system_preferences_optimal_values_insert_only.sql +++ b/installer/data/mysql/ru-RU/mandatory/system_preferences_optimal_values_insert_only.sql @@ -45,7 +45,7 @@ UPDATE systempreferences SET value='#942||{942j}|
UPDATE systempreferences SET value='942hv' WHERE variable='itemcallnumber'; -UPDATE systempreferences SET value='UNIMARC' WHERE variable='marcflavour'; +UPDATE systempreferences SET value='UNIMARC' WHERE variable='MarcFormat'; -- Circulation - Оборот diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 9aabdb1..93f8cfd 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -53,7 +53,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('LibraryName','','Define the library name as displayed on the OPAC','',''); -- this is selected by the web installer now --- INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('marcflavour','MARC21','Define global MARC flavor (MARC21 or UNIMARC) used for character encoding','MARC21|UNIMARC','Choice'); +-- INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('MarcFormat','MARC21','Define global MARC flavor (MARC21 or UNIMARC) used for character encoding','MARC21|UNIMARC','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('MARCOrgCode','OSt','Define MARC Organization Code - http://www.loc.gov/marc/organizations/orgshome.html','','free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('MaxFine',NULL,'Maximum fine a patron can have for all late returns at one moment. Single item caps are specified in the circulation rules matrix.','','Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('maxoutstanding',5,'maximum amount withstanding to be able make holds','','Integer'); diff --git a/installer/data/mysql/uk-UA/mandatory/system_preferences_optimal_values_insert_only.sql b/installer/data/mysql/uk-UA/mandatory/system_preferences_optimal_values_insert_only.sql index af0299b..8dabcdd 100644 --- a/installer/data/mysql/uk-UA/mandatory/system_preferences_optimal_values_insert_only.sql +++ b/installer/data/mysql/uk-UA/mandatory/system_preferences_optimal_values_insert_only.sql @@ -45,7 +45,7 @@ UPDATE systempreferences SET value='#942||{942j}|
UPDATE systempreferences SET value='942hv' WHERE variable='itemcallnumber'; -UPDATE systempreferences SET value='UNIMARC' WHERE variable='marcflavour'; +UPDATE systempreferences SET value='UNIMARC' WHERE variable='MarcFormat'; -- Circulation - Обіг diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 3134261..094c33a 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -1057,7 +1057,7 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { } $DBversion = "3.00.00.056"; if (C4::Context->preference("Version") < TransformToNum($DBversion)) { - if (C4::Context->preference("marcflavour") eq 'UNIMARC') { + if (C4::Context->preference("MarcFormat") eq 'UNIMARC') { $dbh->do("INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value` , `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('995', 'v', 'Note sur le N° de périodique','Note sur le N° de périodique', 0, 0, 'items.enumchron', 10, '', '', '', 0, 0, '', '', '', NULL) "); } else { $dbh->do("INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value` , `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('952', 'h', 'Serial Enumeration / chronology','Serial Enumeration / chronology', 0, 0, 'items.enumchron', 10, '', '', '', 0, 0, '', '', '', NULL) "); @@ -1577,7 +1577,7 @@ $DBversion = "3.00.00.084"; $DBversion = "3.00.00.085"; if (C4::Context->preference("Version") < TransformToNum($DBversion)) { - if (C4::Context->preference("marcflavour") eq 'MARC21') { + if (C4::Context->preference("MarcFormat") eq 'MARC21') { $dbh->do("UPDATE marc_subfield_structure SET tab = 0 WHERE tab = 9 AND tagfield = '037'"); $dbh->do("UPDATE marc_subfield_structure SET tab = 1 WHERE tab = 6 AND tagfield in ('100', '110', '111', '130')"); $dbh->do("UPDATE marc_subfield_structure SET tab = 2 WHERE tab = 6 AND tagfield in ('240', '243')"); @@ -1828,7 +1828,7 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { $DBversion = "3.00.00.095"; if (C4::Context->preference("Version") < TransformToNum($DBversion)) { - if (C4::Context->preference("marcflavour") eq 'MARC21') { + if (C4::Context->preference("MarcFormat") eq 'MARC21') { $dbh->do("UPDATE marc_subfield_structure SET authtypecode = 'MEETI_NAME' WHERE authtypecode = 'Meeting Name'"); $dbh->do("UPDATE marc_subfield_structure SET authtypecode = 'CORPO_NAME' WHERE authtypecode = 'CORP0_NAME'"); } @@ -3259,7 +3259,7 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { $dbh->do(qq{ ALTER TABLE deleteditems ADD UNIQUE INDEX deleteditemsstocknumberidx (stocknumber); }); - if (C4::Context->preference('marcflavour') eq 'UNIMARC'){ + if (C4::Context->preference('MarcFormat') eq 'UNIMARC'){ $dbh->do(qq{ INSERT IGNORE INTO marc_subfield_structure (frameworkcode,tagfield, tagsubfield, tab, repeatable, mandatory,kohafield) SELECT DISTINCT (frameworkcode),995,"j",10,0,0,"items.stocknumber" from biblio_framework ; @@ -3976,7 +3976,7 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { $DBversion = "3.03.00.015"; if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { - if ( C4::Context->preference("marcflavour") eq "MARC21" ) { + if ( C4::Context->preference("MarcFormat") eq "MARC21" ) { my $sth = $dbh->prepare( "INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) @@ -4492,13 +4492,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { $DBversion = '3.05.00.017'; if (C4::Context->preference("Version") < TransformToNum($DBversion)) { - if (C4::Context->preference("marcflavour") eq 'MARC21' || - C4::Context->preference("marcflavour") eq 'NORMARC'){ + if (C4::Context->preference("MarcFormat") eq 'MARC21' || + C4::Context->preference("MarcFormat") eq 'NORMARC'){ $dbh->do("INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value` , `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('773', '0', 'Host Biblionumber', 'Host Biblionumber', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, '', '', '', NULL)"); $dbh->do("INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value` , `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('773', '9', 'Host Itemnumber', 'Host Itemnumber', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, '', '', '', NULL)"); print "Upgrade to $DBversion done (Add 773 subfield 9 and 0 to default framework)\n"; SetVersion ($DBversion); - } elsif (C4::Context->preference("marcflavour") eq 'UNIMARC'){ + } elsif (C4::Context->preference("MarcFormat") eq 'UNIMARC'){ $dbh->do("INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value` , `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('461', '9', 'Host Itemnumber', 'Host Itemnumber', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, '', '', '', NULL)"); print "Upgrade to $DBversion done (Add 461 subfield 9 to default framework)\n"; SetVersion ($DBversion); @@ -4612,7 +4612,7 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { $DBversion = '3.07.00.008'; if (C4::Context->preference("Version") < TransformToNum($DBversion)) { - if (C4::Context->preference("marcflavour") eq 'MARC21') { + if (C4::Context->preference("MarcFormat") eq 'MARC21') { if (C4::Context->preference("opaclanguages") eq "de") { $dbh->do("INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES ('545', 'Fußnote zu biografischen oder historischen Daten', 'Fußnote zu biografischen oder historischen Daten', 1, 0, NULL, '');"); } else { @@ -4696,7 +4696,7 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { $sth->execute; my $already_exists = $sth->fetchrow; if ( not $already_exists ) { - my $field = C4::Context->preference("marcflavour") eq "UNIMARC" ? "205" : "250"; + my $field = C4::Context->preference("MarcFormat") eq "UNIMARC" ? "205" : "250"; my $subfield = "a"; my $sth = $dbh->prepare( q| UPDATE marc_subfield_structure SET kohafield = "biblioitems.editionstatement" @@ -5049,13 +5049,13 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { UPDATE `marc_subfield_structure` SET maxlength=24 WHERE tagfield='000'; "); $dbh->do(" - UPDATE marc_subfield_structure SET maxlength = IF ((SELECT value FROM systempreferences WHERE variable = 'marcflavour')='MARC21','40','9999') WHERE tagfield='008'; + UPDATE marc_subfield_structure SET maxlength = IF ((SELECT value FROM systempreferences WHERE variable = 'MarcFormat')='MARC21','40','9999') WHERE tagfield='008'; "); $dbh->do(" - UPDATE marc_subfield_structure SET maxlength = IF ((SELECT value FROM systempreferences WHERE variable = 'marcflavour')='NORMARC','40','9999') WHERE tagfield='008'; + UPDATE marc_subfield_structure SET maxlength = IF ((SELECT value FROM systempreferences WHERE variable = 'MarcFormat')='NORMARC','40','9999') WHERE tagfield='008'; "); $dbh->do(" - UPDATE marc_subfield_structure SET maxlength = IF ((SELECT value FROM systempreferences WHERE variable = 'marcflavour')='UNIMARC','36','9999') WHERE tagfield='100'; + UPDATE marc_subfield_structure SET maxlength = IF ((SELECT value FROM systempreferences WHERE variable = 'MarcFormat')='UNIMARC','36','9999') WHERE tagfield='100'; "); print "Upgrade to $DBversion done (Add new field maxlength to marc_subfield_structure)\n"; SetVersion($DBversion); @@ -5322,11 +5322,11 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { $dbh->do("ALTER TABLE `biblioitems` ADD `ean` VARCHAR( 13 ) NULL AFTER issn"); $dbh->do("CREATE INDEX `ean` ON biblioitems (`ean`) "); $dbh->do("ALTER TABLE `deletedbiblioitems` ADD `ean` VARCHAR( 13 ) NULL AFTER issn"); - if (C4::Context->preference("marcflavour") eq 'UNIMARC') { + if (C4::Context->preference("MarcFormat") eq 'UNIMARC') { $dbh->do("UPDATE marc_subfield_structure SET kohafield='biblioitems.ean' WHERE tagfield='073' and tagsubfield='a'"); } print "Upgrade to $DBversion done (Adding ean in biblioitems and deletedbiblioitems)\n"; - print "If you have records with ean, please run misc/batchRebuildBiblioTables.pl to populate bibliotems.ean\n" if (C4::Context->preference("marcflavour") eq 'UNIMARC'); + print "If you have records with ean, please run misc/batchRebuildBiblioTables.pl to populate bibliotems.ean\n" if (C4::Context->preference("MarcFormat") eq 'UNIMARC'); SetVersion($DBversion); } @@ -5574,7 +5574,7 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { $DBversion = "3.09.00.028"; if (C4::Context->preference("Version") < TransformToNum($DBversion)) { - unless ( C4::Context->preference('marcflavour') eq 'UNIMARC' ) { + unless ( C4::Context->preference('MarcFormat') eq 'UNIMARC' ) { my %referencetypes = ( '00' => 'PERSO_NAME', '10' => 'CORPO_NAME', '11' => 'MEETI_NAME', @@ -6565,7 +6565,7 @@ if ( CheckVersion($DBversion) ) { $DBversion = "3.11.00.105"; if ( CheckVersion($DBversion) ) { - if ( C4::Context->preference("marcflavour") eq 'MARC21' ) { + if ( C4::Context->preference("MarcFormat") eq 'MARC21' ) { $sth = $dbh->prepare( "SELECT frameworkcode FROM marc_tag_structure WHERE tagfield = '029'" ); @@ -6971,6 +6971,13 @@ if(CheckVersion($DBversion)) { SetVersion ($DBversion); } +$DBversion = "3.13.00.XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do("UPDATE systempreferences SET variable = 'MarcFormat' WHERE variable = 'marcflavour'"); + print "Upgrade to $DBversion done (Bug 10329 - Rename system preference marcflavour to MarcFormat)\n"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) diff --git a/installer/install.pl b/installer/install.pl index 58388cb..74a05aa 100755 --- a/installer/install.pl +++ b/installer/install.pl @@ -229,19 +229,19 @@ elsif ( $step && $step == 3 ) { my $langchoice = $query->param('fwklanguage'); $langchoice = $query->cookie('KohaOpacLanguage') unless ($langchoice); $langchoice =~ s/[^a-zA-Z_-]*//g; - my $marcflavour = $query->param('marcflavour'); - if ($marcflavour){ - $installer->set_marcflavour_syspref($marcflavour); + my $MarcFormat = $query->param('MarcFormat'); + if ($MarcFormat){ + $installer->set_MarcFormat_syspref($MarcFormat); }; - $marcflavour = C4::Context->preference('marcflavour') unless ($marcflavour); - #Insert into database the selected marcflavour + $MarcFormat = C4::Context->preference('MarcFormat') unless ($MarcFormat); + #Insert into database the selected MarcFormat undef $/; - my ($marc_defaulted_to_en, $fwklist) = $installer->marc_framework_sql_list($langchoice, $marcflavour); + my ($marc_defaulted_to_en, $fwklist) = $installer->marc_framework_sql_list($langchoice, $MarcFormat); $template->param('en_marc_frameworks' => $marc_defaulted_to_en); $template->param( "frameworksloop" => $fwklist ); - $template->param( "marcflavour" => ucfirst($marcflavour)); + $template->param( "MarcFormat" => ucfirst($MarcFormat)); - my ($sample_defaulted_to_en, $levellist) = $installer->sample_data_sql_list($langchoice, $marcflavour); + my ($sample_defaulted_to_en, $levellist) = $installer->sample_data_sql_list($langchoice, $MarcFormat); $template->param( "en_sample_data" => $sample_defaulted_to_en); $template->param( "levelloop" => $levellist ); $template->param( "$op" => 1 ); @@ -249,12 +249,12 @@ elsif ( $step && $step == 3 ) { elsif ( $op && $op eq 'choosemarc' ) { # # - # 1ST install, 2nd sub-step : show the user the marcflavour available. + # 1ST install, 2nd sub-step : show the user the MarcFormat available. # # #Choose Marc Flavour - #sql data are supposed to be located in installer/data///marcflavour/marcflavourname + #sql data are supposed to be located in installer/data///MarcFormat/MarcFormatname # Where is database type according to DBD syntax # Where is en|fr or any international abbreviation (provided language hash is updated... This will be a problem with internationlisation.) # Where is a category of requirement : required, recommended optional @@ -268,26 +268,26 @@ elsif ( $step && $step == 3 ) { $langchoice = $query->cookie('KohaOpacLanguage') unless ($langchoice); $langchoice =~ s/[^a-zA-Z_-]*//g; my $dir = - C4::Context->config('intranetdir') . "/installer/data/$info{dbms}/$langchoice/marcflavour"; + C4::Context->config('intranetdir') . "/installer/data/$info{dbms}/$langchoice/MarcFormat"; unless (opendir( MYDIR, $dir )) { if ($langchoice eq 'en') { warn "cannot open MARC frameworks directory $dir"; } else { # if no translated MARC framework is available, # default to English - $dir = C4::Context->config('intranetdir') . "/installer/data/$info{dbms}/en/marcflavour"; + $dir = C4::Context->config('intranetdir') . "/installer/data/$info{dbms}/en/MarcFormat"; opendir(MYDIR, $dir) or warn "cannot open English MARC frameworks directory $dir"; } } my @listdir = grep { !/^\./ && -d "$dir/$_" } readdir(MYDIR); closedir MYDIR; - my $marcflavour=C4::Context->preference("marcflavour"); + my $MarcFormat=C4::Context->preference("MarcFormat"); my @flavourlist; foreach my $marc (@listdir) { my %cell=( "label"=> ucfirst($marc), "code"=>uc($marc), - "checked"=> defined($marcflavour) ? uc($marc) eq $marcflavour : 0); + "checked"=> defined($MarcFormat) ? uc($marc) eq $MarcFormat : 0); # $cell{"description"}= do { local $/ = undef; open INPUT "<$dir/$marc.txt"||""; }; push @flavourlist, \%cell; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc index 366c695..4035479 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc @@ -1,5 +1,5 @@ [% BLOCK showreference %] - [% IF marcflavour == 'UNIMARC' %] + [% IF MarcFormat == 'UNIMARC' %] [% SWITCH type %] [% CASE 'broader' %] BT: [% heading | html %] @@ -36,7 +36,7 @@ [% authorize.heading | html %] [% END %] - [% IF ( marcflavour == 'UNIMARC' ) %] + [% IF ( MarcFormat == 'UNIMARC' ) %] [% IF summary.notes %]
[% FOREACH note IN summary.notes %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search.inc index d0b13a7..0f6c3ad 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search.inc @@ -24,7 +24,7 @@ Show MARC tag documentation links
[% END %] @@ -447,7 +447,7 @@ function Changefwk(FwkList) { [% innerloo.tag %] [% ELSE %] [% innerloo.tag %] - [% IF marcflavour != 'NORMARC' %] ?[% END %] + [% IF MarcFormat != 'NORMARC' %] ?[% END %] [% END %] [% IF ( innerloo.fixedfield ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt index 560d4b6..186984d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt @@ -89,9 +89,9 @@ [% FOREACH flavourloo IN flavourloop %]
[% IF ( flavourloo.checked ) %] - [% flavourloo.label %]
+ [% flavourloo.label %]
[% ELSE %] - [% flavourloo.label %]
+ [% flavourloo.label %]
[% END %]
[% END %] @@ -107,7 +107,7 @@ [% IF ( frameworksloop ) %] -

MARC frameworks: [% marcflavour %]

+

MARC frameworks: [% MarcFormat %]

[% IF ( en_marc_frameworks ) %]

No MARC frameworks are available for your language. Defaulting to the frameworks supplied for English (en)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt index 459a80a..1fa6bb8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt @@ -65,7 +65,7 @@ - [% IF ( marcflavour == "UNIMARC" ) %] + [% IF ( MarcFormat == "UNIMARC" ) %]
  • @@ -285,7 +285,7 @@
  • - [% IF ( marcflavour == "UNIMARC" ) %] + [% IF ( MarcFormat == "UNIMARC" ) %]
  • diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/authorities-search-results.inc b/koha-tmpl/opac-tmpl/prog/en/includes/authorities-search-results.inc index 6e6db3c..f1eb0d3 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/authorities-search-results.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/authorities-search-results.inc @@ -1,5 +1,5 @@ [% BLOCK showreference %] - [% IF marcflavour == 'UNIMARC' %] + [% IF MarcFormat == 'UNIMARC' %] [% SWITCH type %] [% CASE 'broader' %] BT: [% heading | html %] @@ -36,7 +36,7 @@ [% authorize.heading | html %] [% END %] - [% IF ( marcflavour == 'UNIMARC' ) %] + [% IF ( MarcFormat == 'UNIMARC' ) %] [% IF summary.notes %]
    [% FOREACH note IN summary.notes %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt index 825e8be..b10abf7 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt @@ -96,7 +96,7 @@ [% END %] [% IF ( expanded_options ) %] - [% IF (marcflavour != 'UNIMARC') %] + [% IF (MarcFormat != 'UNIMARC') %] [% END %] [% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth-detail.tt index de5eae1..f78a051 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth-detail.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth-detail.tt @@ -75,7 +75,7 @@ $(document).ready(function() { [% PROCESS otherscript headings=summary.otherscript wantcategory='seealso' %]
    [% END %] -[% IF marcflavour == 'UNIMARC' && summary.otherscript %] +[% IF MarcFormat == 'UNIMARC' && summary.otherscript %]
    Other forms:
      diff --git a/misc/cronjobs/MARC21_parse_test.pl b/misc/cronjobs/MARC21_parse_test.pl index 3510f2b..af6e393 100755 --- a/misc/cronjobs/MARC21_parse_test.pl +++ b/misc/cronjobs/MARC21_parse_test.pl @@ -88,8 +88,8 @@ if ($lint) { require MARC::Lint; $lint_object = new MARC::Lint; } -my $marcflavour = C4::Context->preference('marcflavour') or die "No marcflavour (MARC21 or UNIMARC) set in syspref"; -(uc($marcflavour) eq 'MARC21') or die "Only marcflavour MARC21, not '$marcflavour'"; +my $MarcFormat = C4::Context->preference('MarcFormat') or die "No MarcFormat (MARC21 or UNIMARC) set in syspref"; +(uc($MarcFormat) eq 'MARC21') or die "Only MarcFormat MARC21, not '$MarcFormat'"; # my $countq = C4::Context->dbh->prepare("SELECT COUNT(*) FROM biblioitems"); # Too SLOW on large systems # $countq->execute; $countq->fetchrow(); @@ -104,7 +104,7 @@ if ($summary) { $verbose and print "# Using temp file: $filename\n" } -MARC::File::XML->default_record_format($marcflavour) or die "FAILED MARC::File::XML->default_record_format($marcflavour)"; +MARC::File::XML->default_record_format($MarcFormat) or die "FAILED MARC::File::XML->default_record_format($MarcFormat)"; my $query = "SELECT * FROM biblioitems "; my $recs; @@ -164,7 +164,7 @@ while ( my $row = next_row() ) { $verbose and printf "# %4d of %4d: biblionumber %s\n", ++$printline, $limit, $row->{biblionumber}; my $stripped = StripNonXmlChars($xml); ($stripped eq $xml) or printf "$bibnum_prefix: %d NON-XML Characters removed!!\n", (length($xml) - length($stripped)); - my $record = eval { MARC::Record::new_from_xml( $stripped, 'utf8', $marcflavour ) }; + my $record = eval { MARC::Record::new_from_xml( $stripped, 'utf8', $MarcFormat ) }; if (not $record) { $found++; my $msg = $@ || ''; @@ -286,7 +286,7 @@ options can still be used with biblionumbers specified from file. Files will be =head1 DESCRIPTION This checks for data corruption or otherwise unparsable data in biblioitems.marcxml. -As the name suggests, this script is only useful for MARC21 and will die for marcflavour UNIMARC. +As the name suggests, this script is only useful for MARC21 and will die for MarcFormat UNIMARC. Run MARC21_parse_test.pl the first time with no options and type in individual biblionumbers to test. Or run with B<--All> to go through the entire table. diff --git a/misc/maintenance/MARC21_utf8_flag_fix.pl b/misc/maintenance/MARC21_utf8_flag_fix.pl index e7e9156..055ef51 100755 --- a/misc/maintenance/MARC21_utf8_flag_fix.pl +++ b/misc/maintenance/MARC21_utf8_flag_fix.pl @@ -72,8 +72,8 @@ if ($debug) { $verbose++; } -my $marcflavour = C4::Context->preference('marcflavour') or die "No marcflavour (MARC21 or UNIMARC) set in syspref"; -($marcflavour eq 'MARC21') or die "marcflavour must be MARC21, not $marcflavour"; +my $MarcFormat = C4::Context->preference('MarcFormat') or die "No MarcFormat (MARC21 or UNIMARC) set in syspref"; +($MarcFormat eq 'MARC21') or die "MarcFormat must be MARC21, not $MarcFormat"; my $all = C4::Context->dbh->prepare("SELECT COUNT(*) FROM biblioitems"); $all->execute; @@ -101,7 +101,7 @@ $limit or $limit = $bad_recs->rows(); # limit becomes max if unspecified $limit += $offset if $offset; # increase limit for offset my $i = 0; -MARC::File::XML->default_record_format($marcflavour) or die "FAILED MARC::File::XML->default_record_format($marcflavour)"; +MARC::File::XML->default_record_format($MarcFormat) or die "FAILED MARC::File::XML->default_record_format($MarcFormat)"; while ( my $row = $bad_recs->fetchrow_hashref() ) { (++$i > $limit) and last; @@ -113,13 +113,13 @@ while ( my $row = $bad_recs->fetchrow_hashref() ) { printf "# %4d of %4d: biblionumber %s : %s\n", $i, $badcount, $row->{biblionumber}, $xml; my $stripped = StripNonXmlChars($row->{marcxml}); ($stripped eq $row->{marcxml}) or printf STDERR "%d NON-XML Characters removed!!\n", (length($row->{marcxml}) - length($stripped)); - my $record = eval { MARC::Record::new_from_xml( $stripped, 'utf8', $marcflavour ) }; + my $record = eval { MARC::Record::new_from_xml( $stripped, 'utf8', $MarcFormat ) }; if ($@ or not $record) { - print STDERR "ERROR in MARC::Record::new_from_xml(\$marcxml, 'utf8', $marcflavour): $@\n\tSkipping $row->{biblionumber}\n"; + print STDERR "ERROR in MARC::Record::new_from_xml(\$marcxml, 'utf8', $MarcFormat): $@\n\tSkipping $row->{biblionumber}\n"; next; } if ($fix) { - SetMarcUnicodeFlag($record, $marcflavour); + SetMarcUnicodeFlag($record, $MarcFormat); if (ModBiblioMarc($record, $row->{biblionumber})) { printf "# %4d of %4d: biblionumber %s : %s\n", $i, $badcount, $row->{biblionumber}, $record->leader(); } else { @@ -187,7 +187,7 @@ presents a problem when records have been inserted with the leader/09 showing blank for MARC8 encoding. This script is used to determine the extent of the problem and to fix the affected leaders. -As the name suggests, this script is only useful for MARC21 and will die for marcflavour UNIMARC. +As the name suggests, this script is only useful for MARC21 and will die for MarcFormat UNIMARC. Run MARC21_utf8_flag_fix.pl the first time with no options, and assuming you agree that the leaders presented need fixing, run it again with B<--fix>. diff --git a/misc/maintenance/UNIMARC_fix_collectiontitle.pl b/misc/maintenance/UNIMARC_fix_collectiontitle.pl index d977222..faf6f0a 100755 --- a/misc/maintenance/UNIMARC_fix_collectiontitle.pl +++ b/misc/maintenance/UNIMARC_fix_collectiontitle.pl @@ -24,7 +24,7 @@ sub process { } -if (lc(C4::Context->preference('marcflavour')) eq "unimarc"){ +if (lc(C4::Context->preference('MarcFormat')) eq "unimarc"){ print "count subfields changed :".process()." kohafields biblio.seriestitle changed into biblioitems.collectiontitle"; } else { diff --git a/misc/maintenance/UNIMARC_sync_date_created_with_marc_biblio.pl b/misc/maintenance/UNIMARC_sync_date_created_with_marc_biblio.pl index 244c2ac..fc50677 100755 --- a/misc/maintenance/UNIMARC_sync_date_created_with_marc_biblio.pl +++ b/misc/maintenance/UNIMARC_sync_date_created_with_marc_biblio.pl @@ -200,7 +200,7 @@ sub process { $verbose and print "Number of modified biblios: " . $mod_count . "\n"; } -if ( lc( C4::Context->preference('marcflavour') ) eq "unimarc" ) { +if ( lc( C4::Context->preference('MarcFormat') ) eq "unimarc" ) { $verbose and !$run and print "*** Not in run mode, modifications will not be applyed ***\n"; diff --git a/misc/migration_tools/22_to_30/export_Authorities.pl b/misc/migration_tools/22_to_30/export_Authorities.pl index aeed3f2..d8acc59 100755 --- a/misc/migration_tools/22_to_30/export_Authorities.pl +++ b/misc/migration_tools/22_to_30/export_Authorities.pl @@ -30,7 +30,7 @@ while (my ($authid,$authtypecode)=$rq->fetchrow){ utf8::decode($record); } - if (C4::Context->preference('marcflavour') eq "UNIMARC"){ + if (C4::Context->preference('MarcFormat') eq "UNIMARC"){ $record->leader(' nac 22 1u 4500'); my $string=$1 if $time=~m/([0-9\-]+)/; $string=~s/\-//g; diff --git a/misc/migration_tools/22_to_30/export_Authorities_xml.pl b/misc/migration_tools/22_to_30/export_Authorities_xml.pl index 42d2e5c..637154d 100755 --- a/misc/migration_tools/22_to_30/export_Authorities_xml.pl +++ b/misc/migration_tools/22_to_30/export_Authorities_xml.pl @@ -29,7 +29,7 @@ open my $fileoutput, '>:encoding(UTF-8)', "./$filename/$authid.xml" or die "unab utf8::decode($record); } -# if (C4::Context->preference('marcflavour') eq "UNIMARC"){ +# if (C4::Context->preference('MarcFormat') eq "UNIMARC"){ $record->leader(' nac 22 1u 4500'); my $string=$1 if $time=~m/([0-9\-]+)/; $string=~s/\-//g; diff --git a/misc/migration_tools/22_to_30/move_marc_to_biblioitems.pl b/misc/migration_tools/22_to_30/move_marc_to_biblioitems.pl index 3635dbc..64d9855 100755 --- a/misc/migration_tools/22_to_30/move_marc_to_biblioitems.pl +++ b/misc/migration_tools/22_to_30/move_marc_to_biblioitems.pl @@ -38,13 +38,13 @@ while (my ($bibid,$biblionumber) = $sth->fetchrow) { my $record = LocalMARCgetbiblio($dbh,$bibid); #Force UTF-8 in record leader $record->encoding('UTF-8'); - my $marcflavour; - if (C4::Context->preference("marcflavour")=~/unimarc/i){ - $marcflavour="UNIMARC"; + my $MarcFormat; + if (C4::Context->preference("MarcFormat")=~/unimarc/i){ + $MarcFormat="UNIMARC"; } else { - $marcflavour="USMARC"; + $MarcFormat="USMARC"; } - $sth_update->execute($record->as_usmarc(),$record->as_xml_record($marcflavour),$biblionumber); + $sth_update->execute($record->as_usmarc(),$record->as_xml_record($MarcFormat),$biblionumber); $totaldone++; print "."; print "\r$totaldone / $totaltodo" unless ($totaldone % 100); @@ -148,7 +148,7 @@ sub LocalMARCgetbiblio { $record->add_fields($field); } } - if (C4::Context->preference('marcflavour')=~/unimarc/i){ + if (C4::Context->preference('MarcFormat')=~/unimarc/i){ $record->leader(' nac 22 1u 4500'); $update=1; my $string; diff --git a/misc/migration_tools/build_oai_sets.pl b/misc/migration_tools/build_oai_sets.pl index 577c06e..13358f4 100755 --- a/misc/migration_tools/build_oai_sets.pl +++ b/misc/migration_tools/build_oai_sets.pl @@ -115,10 +115,10 @@ foreach my $res (@$results) { # The following lines are copied from GetMarcBiblio # We don't call GetMarcBiblio to avoid a sql query to be executed each time $marcxml = StripNonXmlChars($marcxml); - MARC::File::XML->default_record_format(C4::Context->preference('marcflavour')); + MARC::File::XML->default_record_format(C4::Context->preference('MarcFormat')); my $record; eval { - $record = MARC::Record::new_from_xml($marcxml, "utf8", C4::Context->preference('marcflavour')); + $record = MARC::Record::new_from_xml($marcxml, "utf8", C4::Context->preference('MarcFormat')); }; if($@) { warn "(biblio $biblionumber) Error while creating record from marcxml: $@"; diff --git a/misc/migration_tools/bulkmarcimport.pl b/misc/migration_tools/bulkmarcimport.pl index 113aaf2..44fc332 100755 --- a/misc/migration_tools/bulkmarcimport.pl +++ b/misc/migration_tools/bulkmarcimport.pl @@ -129,7 +129,7 @@ if ($test_parameter) { print "TESTING MODE ONLY\n DOING NOTHING\n===============\n"; } -my $marcFlavour = C4::Context->preference('marcflavour') || 'MARC21'; +my $marcFlavour = C4::Context->preference('MarcFormat') || 'MARC21'; print "Characteristic MARC flavour: $marcFlavour\n" if $verbose; my $starttime = gettimeofday; @@ -560,12 +560,12 @@ sub get_heading_fields{ my $headingfields; if ($authtypes){ $headingfields=YAML::LoadFile($authtypes); - $headingfields={C4::Context->preference('marcflavour')=>$headingfields}; + $headingfields={C4::Context->preference('MarcFormat')=>$headingfields}; $debug && warn YAML::Dump($headingfields); } unless ($headingfields){ $headingfields=$dbh->selectall_hashref("SELECT auth_tag_to_report, authtypecode from auth_types",'auth_tag_to_report',{Slice=>{}}); - $headingfields={C4::Context->preference('marcflavour')=>$headingfields}; + $headingfields={C4::Context->preference('MarcFormat')=>$headingfields}; } return $headingfields; } diff --git a/misc/migration_tools/fix_onloan.pl b/misc/migration_tools/fix_onloan.pl index d6e63af..af17b13 100755 --- a/misc/migration_tools/fix_onloan.pl +++ b/misc/migration_tools/fix_onloan.pl @@ -15,7 +15,7 @@ use C4::Biblio; my $dbh=C4::Context->dbh; -# if (C4::Context->preference("marcflavour") ne "UNIMARC") { +# if (C4::Context->preference("MarcFormat") ne "UNIMARC") { # print "this script is for UNIMARC only\n"; # exit; # } diff --git a/misc/migration_tools/rebuild_zebra.pl b/misc/migration_tools/rebuild_zebra.pl index a46526d..95781b8 100755 --- a/misc/migration_tools/rebuild_zebra.pl +++ b/misc/migration_tools/rebuild_zebra.pl @@ -410,7 +410,7 @@ sub export_marc_records_from_sth { eval { my $rec; if ($as_xml) { - $rec = $marc->as_xml_record(C4::Context->preference('marcflavour')); + $rec = $marc->as_xml_record(C4::Context->preference('MarcFormat')); eval { my $doc = $tester->parse_string($rec); }; @@ -459,7 +459,7 @@ sub export_marc_records_from_list { eval { my $rec; if ($as_xml) { - $rec = $marc->as_xml_record(C4::Context->preference('marcflavour')); + $rec = $marc->as_xml_record(C4::Context->preference('MarcFormat')); $rec =~ s!<\?xml version="1.0" encoding="UTF-8"\?>\n!!; } else { $rec = $marc->as_usmarc(); @@ -498,13 +498,13 @@ sub generate_deleted_marc_records { } else { fix_authority_id($marc, $record_number); } - if (C4::Context->preference("marcflavour") eq "UNIMARC") { + if (C4::Context->preference("MarcFormat") eq "UNIMARC") { fix_unimarc_100($marc); } my $rec; if ($as_xml) { - $rec = $marc->as_xml_record(C4::Context->preference('marcflavour')); + $rec = $marc->as_xml_record(C4::Context->preference('MarcFormat')); $rec =~ s!<\?xml version="1.0" encoding="UTF-8"\?>\n!!; } else { $rec = $marc->as_usmarc(); @@ -534,7 +534,7 @@ sub get_corrected_marc_record { my $normalizer = Koha::RecordProcessor->new( { filters => 'EmbedSeeFromHeadings' } ); $marc = $normalizer->process($marc); } - if (C4::Context->preference("marcflavour") eq "UNIMARC") { + if (C4::Context->preference("MarcFormat") eq "UNIMARC") { fix_unimarc_100($marc); } } @@ -886,7 +886,7 @@ if ($authorities) { # # the record model, depending on marc flavour unless (-f "$authorityserverdir/tab/record.abs") { - if (C4::Context->preference("marcflavour") eq "UNIMARC") { + if (C4::Context->preference("MarcFormat") eq "UNIMARC") { system("cp -f $kohadir/etc/zebradb/marc_defs/unimarc/authorities/record.abs $authorityserverdir/tab/record.abs"); print "Info: copied record.abs for UNIMARC\n"; } else { @@ -1032,7 +1032,7 @@ if ($biblios) { # # the record model, depending on marc flavour unless (-f "$biblioserverdir/tab/record.abs") { - if (C4::Context->preference("marcflavour") eq "UNIMARC") { + if (C4::Context->preference("MarcFormat") eq "UNIMARC") { system("cp -f $kohadir/etc/zebradb/marc_defs/unimarc/biblios/record.abs $biblioserverdir/tab/record.abs"); print "Info: copied record.abs for UNIMARC\n"; } else { diff --git a/misc/migration_tools/upgradeitems.pl b/misc/migration_tools/upgradeitems.pl index c5469ee..5f6bdc7 100755 --- a/misc/migration_tools/upgradeitems.pl +++ b/misc/migration_tools/upgradeitems.pl @@ -8,7 +8,7 @@ use C4::Biblio; my $dbh=C4::Context->dbh; -if (C4::Context->preference("marcflavour") ne "UNIMARC") { +if (C4::Context->preference("MarcFormat") ne "UNIMARC") { print "this script is for UNIMARC only\n"; exit; } diff --git a/opac/oai.pl b/opac/oai.pl index 7aa5a7d..9e3fc39 100755 --- a/opac/oai.pl +++ b/opac/oai.pl @@ -610,7 +610,7 @@ sub stylesheet { ? $self->{ conf }->{ format }->{ $format }->{ xsl_file } : ( C4::Context->config('intrahtdocs') . '/prog/en/xslt/' . - C4::Context->preference('marcflavour') . + C4::Context->preference('MarcFormat') . 'slim2OAIDC.xsl' ); my $parser = XML::LibXML->new(); my $xslt = XML::LibXSLT->new(); @@ -645,7 +645,7 @@ In simple mode, repository configuration comes entirely from Koha system preferences (OAI-PMH:archiveID and OAI-PMH:MaxCount) and the server returns records in marcxml or dublin core format. Dublin core records are created from koha marcxml records tranformed with XSLT. Used XSL file is located in -koha-tmpl/intranet-tmpl/prog/en/xslt directory and choosed based on marcflavour, +koha-tmpl/intranet-tmpl/prog/en/xslt directory and choosed based on MarcFormat, respecively MARC21slim2OAIDC.xsl for MARC21 and MARC21slim2OAIDC.xsl for UNIMARC. diff --git a/opac/opac-ISBDdetail.pl b/opac/opac-ISBDdetail.pl index 94055a9..089313c 100755 --- a/opac/opac-ISBDdetail.pl +++ b/opac/opac-ISBDdetail.pl @@ -83,7 +83,7 @@ if($query->cookie("bib_list")){ $template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHolds') ); $template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) ); -my $marcflavour = C4::Context->preference("marcflavour"); +my $MarcFormat = C4::Context->preference("MarcFormat"); my $record = GetMarcBiblio($biblionumber); if ( ! $record ) { print $query->redirect("/cgi-bin/koha/errors/404.pl"); @@ -92,10 +92,10 @@ if ( ! $record ) { # some useful variables for enhanced content; # in each case, we're grabbing the first value we find in # the record and normalizing it -my $upc = GetNormalizedUPC($record,$marcflavour); -my $ean = GetNormalizedEAN($record,$marcflavour); -my $oclc = GetNormalizedOCLCNumber($record,$marcflavour); -my $isbn = GetNormalizedISBN(undef,$record,$marcflavour); +my $upc = GetNormalizedUPC($record,$MarcFormat); +my $ean = GetNormalizedEAN($record,$MarcFormat); +my $oclc = GetNormalizedOCLCNumber($record,$MarcFormat); +my $isbn = GetNormalizedISBN(undef,$record,$MarcFormat); my $content_identifier_exists; if ( $isbn or $ean or $oclc or $upc ) { $content_identifier_exists = 1; @@ -176,8 +176,8 @@ my @export_options = split(/\|/,$OpacExportOptions); $template->{VARS}->{'export_options'} = \@export_options; #Search for title in links -my $marccontrolnumber = GetMarcControlnumber ($record, $marcflavour); -my $marcissns = GetMarcISSN ( $record, $marcflavour ); +my $marccontrolnumber = GetMarcControlnumber ($record, $MarcFormat); +my $marcissns = GetMarcISSN ( $record, $MarcFormat ); my $issn = $marcissns->[0] || ''; if (my $search_for_title = C4::Context->preference('OPACSearchForTitleIn')){ diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl index 2a69244..a4e274d 100755 --- a/opac/opac-MARCdetail.pl +++ b/opac/opac-MARCdetail.pl @@ -288,11 +288,11 @@ my @export_options = split(/\|/,$OpacExportOptions); $template->{VARS}->{'export_options'} = \@export_options; #Search for title in links -my $marcflavour = C4::Context->preference("marcflavour"); +my $MarcFormat = C4::Context->preference("MarcFormat"); my $dat = TransformMarcToKoha( $dbh, $record ); -my $isbn = GetNormalizedISBN(undef,$record,$marcflavour); -my $marccontrolnumber = GetMarcControlnumber ($record, $marcflavour); -my $marcissns = GetMarcISSN( $record, $marcflavour ); +my $isbn = GetNormalizedISBN(undef,$record,$MarcFormat); +my $marccontrolnumber = GetMarcControlnumber ($record, $MarcFormat); +my $marcissns = GetMarcISSN( $record, $MarcFormat ); my $issn = $marcissns->[0] || ''; if (my $search_for_title = C4::Context->preference('OPACSearchForTitleIn')){ diff --git a/opac/opac-authoritiesdetail.pl b/opac/opac-authoritiesdetail.pl index 3e17cf1..8ae5e90 100755 --- a/opac/opac-authoritiesdetail.pl +++ b/opac/opac-authoritiesdetail.pl @@ -122,7 +122,7 @@ if ($show_marc) { my @subfields_data; # skip UNIMARC fields <200, they are useless for a patron - next if C4::Context->preference('marcflavour') eq 'UNIMARC' && $field->tag() <200; + next if C4::Context->preference('MarcFormat') eq 'UNIMARC' && $field->tag() <200; # if tag <10, there's no subfield, use the "@" trick if ( $field->tag() < 10 ) { @@ -134,7 +134,7 @@ if ($show_marc) { $subfield_data{marc_tag} = $field->tag(); push( @subfields_data, \%subfield_data ); } - elsif ( C4::Context->preference('marcflavour') eq 'MARC21' && $field->tag() eq 667 ) { + elsif ( C4::Context->preference('MarcFormat') eq 'MARC21' && $field->tag() eq 667 ) { # tagfield 667 is a nonpublic general note in MARC21, which shouldn't be shown in the OPAC } else { diff --git a/opac/opac-basket.pl b/opac/opac-basket.pl index 7b3a90a..f8513ae 100755 --- a/opac/opac-basket.pl +++ b/opac/opac-basket.pl @@ -50,7 +50,7 @@ my @bibs = split( /\//, $bib_list ); my @results; my $num = 1; -my $marcflavour = C4::Context->preference('marcflavour'); +my $MarcFormat = C4::Context->preference('MarcFormat'); if (C4::Context->preference('TagsEnabled')) { $template->param(TagsEnabled => 1); foreach (qw(TagsShowOnList TagsInputOnList)) { @@ -65,11 +65,11 @@ foreach my $biblionumber ( @bibs ) { my $dat = &GetBiblioData($biblionumber); my $record = &GetMarcBiblio($biblionumber); next unless $record; - my $marcnotesarray = GetMarcNotes( $record, $marcflavour ); - my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); - my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); - my $marcseriesarray = GetMarcSeries ($record,$marcflavour); - my $marcurlsarray = GetMarcUrls ($record,$marcflavour); + my $marcnotesarray = GetMarcNotes( $record, $MarcFormat ); + my $marcauthorsarray = GetMarcAuthors( $record, $MarcFormat ); + my $marcsubjctsarray = GetMarcSubjects( $record, $MarcFormat ); + my $marcseriesarray = GetMarcSeries ($record,$MarcFormat); + my $marcurlsarray = GetMarcUrls ($record,$MarcFormat); my @items = &GetItemsInfo( $biblionumber ); my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber)); diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 9d0851f..6d3befc 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -93,8 +93,8 @@ if($query->cookie("bib_list")){ SetUTF8Flag($record); -my $marcflavour = C4::Context->preference("marcflavour"); -my $ean = GetNormalizedEAN( $record, $marcflavour ); +my $MarcFormat = C4::Context->preference("MarcFormat"); +my $ean = GetNormalizedEAN( $record, $MarcFormat ); # XSLT processing of some stuff if (C4::Context->preference("OPACXSLTDetailsDisplay") ) { @@ -403,9 +403,9 @@ my @all_items = GetItemsInfo( $biblionumber ); # adding items linked via host biblios my $analyticfield = '773'; -if ($marcflavour eq 'MARC21' || $marcflavour eq 'NORMARC'){ +if ($MarcFormat eq 'MARC21' || $MarcFormat eq 'NORMARC'){ $analyticfield = '773'; -} elsif ($marcflavour eq 'UNIMARC') { +} elsif ($MarcFormat eq 'UNIMARC') { $analyticfield = '461'; } foreach my $hostfield ( $record->field($analyticfield)) { @@ -629,13 +629,13 @@ if (scalar(@itemloop) >= 50 && !$viewallitems) { ## get notes and subjects from MARC record my $dbh = C4::Context->dbh; -my $marcnotesarray = GetMarcNotes ($record,$marcflavour); -my $marcisbnsarray = GetMarcISBN ($record,$marcflavour); -my $marcauthorsarray = GetMarcAuthors ($record,$marcflavour); -my $marcsubjctsarray = GetMarcSubjects($record,$marcflavour); -my $marcseriesarray = GetMarcSeries ($record,$marcflavour); -my $marcurlsarray = GetMarcUrls ($record,$marcflavour); -my $marchostsarray = GetMarcHosts($record,$marcflavour); +my $marcnotesarray = GetMarcNotes ($record,$MarcFormat); +my $marcisbnsarray = GetMarcISBN ($record,$MarcFormat); +my $marcauthorsarray = GetMarcAuthors ($record,$MarcFormat); +my $marcsubjctsarray = GetMarcSubjects($record,$MarcFormat); +my $marcseriesarray = GetMarcSeries ($record,$MarcFormat); +my $marcurlsarray = GetMarcUrls ($record,$MarcFormat); +my $marchostsarray = GetMarcHosts($record,$MarcFormat); my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber)); $template->param( @@ -692,9 +692,9 @@ foreach ( keys %{$dat} ) { # some useful variables for enhanced content; # in each case, we're grabbing the first value we find in # the record and normalizing it -my $upc = GetNormalizedUPC($record,$marcflavour); -my $oclc = GetNormalizedOCLCNumber($record,$marcflavour); -my $isbn = GetNormalizedISBN(undef,$record,$marcflavour); +my $upc = GetNormalizedUPC($record,$MarcFormat); +my $oclc = GetNormalizedOCLCNumber($record,$MarcFormat); +my $isbn = GetNormalizedISBN(undef,$record,$MarcFormat); my $content_identifier_exists; if ( $isbn or $ean or $oclc or $upc ) { $content_identifier_exists = 1; @@ -782,7 +782,7 @@ if (C4::Context->preference("OPACFRBRizeEditions")==1) { # Serial Collection my @sc_fields = $record->field(955); -my @lc_fields = $marcflavour eq 'UNIMARC' +my @lc_fields = $MarcFormat eq 'UNIMARC' ? $record->field(930) : $record->field(852); my @serialcollections = (); @@ -793,7 +793,7 @@ foreach my $sc_field (@sc_fields) { $row_data{text} = $sc_field->subfield('r'); $row_data{branch} = $sc_field->subfield('9'); foreach my $lc_field (@lc_fields) { - $row_data{itemcallnumber} = $marcflavour eq 'UNIMARC' + $row_data{itemcallnumber} = $MarcFormat eq 'UNIMARC' ? $lc_field->subfield('a') # 930$a : $lc_field->subfield('h') # 852$h if ($sc_field->subfield('5') eq $lc_field->subfield('5')); @@ -1004,8 +1004,8 @@ if ( C4::Context->preference('OpacStarRatings') !~ /disable/ ) { } #Search for title in links -my $marccontrolnumber = GetMarcControlnumber ($record, $marcflavour); -my $marcissns = GetMarcISSN ( $record, $marcflavour ); +my $marccontrolnumber = GetMarcControlnumber ($record, $MarcFormat); +my $marcissns = GetMarcISSN ( $record, $MarcFormat ); my $issn = $marcissns->[0] || ''; if (my $search_for_title = C4::Context->preference('OPACSearchForTitleIn')){ diff --git a/opac/opac-downloadcart.pl b/opac/opac-downloadcart.pl index 3a4cdc1..81179ab 100755 --- a/opac/opac-downloadcart.pl +++ b/opac/opac-downloadcart.pl @@ -52,7 +52,7 @@ if ($bib_list && $format) { my @bibs = split( /\//, $bib_list ); - my $marcflavour = C4::Context->preference('marcflavour'); + my $MarcFormat = C4::Context->preference('MarcFormat'); my $output; # CSV diff --git a/opac/opac-downloadshelf.pl b/opac/opac-downloadshelf.pl index 662eb25..c176cd4 100755 --- a/opac/opac-downloadshelf.pl +++ b/opac/opac-downloadshelf.pl @@ -53,7 +53,7 @@ if ( ShelfPossibleAction( (defined($borrowernumber) ? $borrowernumber : -1), $sh if ($shelfid && $format) { my ($items, $totitems) = GetShelfContents($shelfid); - my $marcflavour = C4::Context->preference('marcflavour'); + my $MarcFormat = C4::Context->preference('MarcFormat'); my $output; # CSV diff --git a/opac/opac-export.pl b/opac/opac-export.pl index 002c88e..05407cd 100755 --- a/opac/opac-export.pl +++ b/opac/opac-export.pl @@ -76,7 +76,7 @@ elsif ($format =~ /utf8/) { } elsif ($format =~ /marcstd/) { C4::Charset::SetUTF8Flag($marc,1); - ($error,$marc) = marc2marc($marc, 'marcstd', C4::Context->preference('marcflavour')); + ($error,$marc) = marc2marc($marc, 'marcstd', C4::Context->preference('MarcFormat')); $format = 'marcstd'; } else { diff --git a/opac/opac-readingrecord.pl b/opac/opac-readingrecord.pl index 4f16c66..741e620 100755 --- a/opac/opac-readingrecord.pl +++ b/opac/opac-readingrecord.pl @@ -87,7 +87,7 @@ foreach my $issue ( @{$issues} ) { my $marcxml = StripNonXmlChars( $issue->{marcxml} ); my $marc_rec = MARC::Record::new_from_xml( $marcxml, 'utf8', - C4::Context->preference('marcflavour') ); + C4::Context->preference('MarcFormat') ); $issue->{subtitle} = GetRecordValue( 'subtitle', $marc_rec, $issue->{frameworkcode} ); } diff --git a/opac/opac-search.pl b/opac/opac-search.pl index dfe651e..9a4049c 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -137,10 +137,10 @@ if ($format eq 'rss2' or $format eq 'opensearchdescription' or $format eq 'atom' # FIXME - the timestamp is a hack - the biblio update timestamp should be used for each # entry, but not sure if that's worth an extra database query for each bib } -if (C4::Context->preference("marcflavour") eq "UNIMARC" ) { +if (C4::Context->preference("MarcFormat") eq "UNIMARC" ) { $template->param('UNIMARC' => 1); } -elsif (C4::Context->preference("marcflavour") eq "MARC21" ) { +elsif (C4::Context->preference("MarcFormat") eq "MARC21" ) { $template->param('usmarc' => 1); } $template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHolds') ); @@ -298,7 +298,7 @@ if ( $template_type && $template_type eq 'advsearch' ) { } } - $template->param(uc( C4::Context->preference("marcflavour")) => 1, # we already did this for UNIMARC + $template->param(uc( C4::Context->preference("MarcFormat")) => 1, # we already did this for UNIMARC advsearch => 1, search_boxes_loop => \@search_boxes_array); diff --git a/opac/opac-sendbasket.pl b/opac/opac-sendbasket.pl index da74745..aa00eb7 100755 --- a/opac/opac-sendbasket.pl +++ b/opac/opac-sendbasket.pl @@ -82,15 +82,15 @@ if ( $email_add ) { my @bibs = split( /\//, $bib_list ); my @results; my $iso2709; - my $marcflavour = C4::Context->preference('marcflavour'); + my $MarcFormat = C4::Context->preference('MarcFormat'); foreach my $biblionumber (@bibs) { $template2->param( biblionumber => $biblionumber ); my $dat = GetBiblioData($biblionumber); my $record = GetMarcBiblio($biblionumber); - my $marcnotesarray = GetMarcNotes( $record, $marcflavour ); - my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); - my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); + my $marcnotesarray = GetMarcNotes( $record, $MarcFormat ); + my $marcauthorsarray = GetMarcAuthors( $record, $MarcFormat ); + my $marcsubjctsarray = GetMarcSubjects( $record, $MarcFormat ); my @items = GetItemsInfo( $biblionumber ); diff --git a/opac/opac-sendshelf.pl b/opac/opac-sendshelf.pl index 6e60bc9..6427551 100755 --- a/opac/opac-sendshelf.pl +++ b/opac/opac-sendshelf.pl @@ -74,7 +74,7 @@ if ( $email ) { my @shelf = GetShelf($shelfid); my ($items, $totitems) = GetShelfContents($shelfid); - my $marcflavour = C4::Context->preference('marcflavour'); + my $MarcFormat = C4::Context->preference('MarcFormat'); my $iso2709; my @results; @@ -84,9 +84,9 @@ if ( $email ) { my $fw = GetFrameworkCode($biblionumber); my $dat = GetBiblioData($biblionumber); my $record = GetMarcBiblio($biblionumber); - my $marcnotesarray = GetMarcNotes( $record, $marcflavour ); - my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); - my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); + my $marcnotesarray = GetMarcNotes( $record, $MarcFormat ); + my $marcauthorsarray = GetMarcAuthors( $record, $MarcFormat ); + my $marcsubjctsarray = GetMarcSubjects( $record, $MarcFormat ); my $subtitle = GetRecordValue('subtitle', $record, $fw); my @items = GetItemsInfo( $biblionumber ); diff --git a/opac/opac-showmarc.pl b/opac/opac-showmarc.pl index 71fb804..20dcb2a 100755 --- a/opac/opac-showmarc.pl +++ b/opac/opac-showmarc.pl @@ -67,7 +67,7 @@ if ($view eq 'card' || $view eq 'html') { $xslfile = "compact.xsl"; } else { # must be html - $xslfile = C4::Context->preference('marcflavour') . "slim2OPACMARCdetail.xsl"; + $xslfile = C4::Context->preference('MarcFormat') . "slim2OPACMARCdetail.xsl"; } $xslfilename = "$htdocs/$theme/$lang/xslt/$xslfile"; $xslfilename = "$htdocs/$theme/en/xslt/$xslfile" unless ( $lang ne 'en' && -f $xslfilename ); diff --git a/opac/opac-showreviews.pl b/opac/opac-showreviews.pl index 151c101..2355ab1 100755 --- a/opac/opac-showreviews.pl +++ b/opac/opac-showreviews.pl @@ -77,7 +77,7 @@ if ( C4::Context->preference('ShowReviewer') and C4::Context->preference('ShowRe } my $reviews = getallreviews(1,$offset,$results_per_page); -my $marcflavour = C4::Context->preference("marcflavour"); +my $MarcFormat = C4::Context->preference("MarcFormat"); my $hits = numberofreviews(1); my $i = 0; my $latest_comment_date; @@ -87,10 +87,10 @@ for my $result (@$reviews){ my $record = GetMarcBiblio($biblionumber); my $frameworkcode = GetFrameworkCode($biblionumber); my ( $borr ) = GetMemberDetails( $result->{borrowernumber} ); - $result->{normalized_upc} = GetNormalizedUPC($record,$marcflavour); - $result->{normalized_ean} = GetNormalizedEAN($record,$marcflavour); - $result->{normalized_oclc} = GetNormalizedOCLCNumber($record,$marcflavour); - $result->{normalized_isbn} = GetNormalizedISBN(undef,$record,$marcflavour); + $result->{normalized_upc} = GetNormalizedUPC($record,$MarcFormat); + $result->{normalized_ean} = GetNormalizedEAN($record,$MarcFormat); + $result->{normalized_oclc} = GetNormalizedOCLCNumber($record,$MarcFormat); + $result->{normalized_isbn} = GetNormalizedISBN(undef,$record,$MarcFormat); $result->{title} = $bib->{'title'}; $result->{subtitle} = GetRecordValue('subtitle', $record, $frameworkcode); $result->{author} = $bib->{'author'}; diff --git a/opac/unapi b/opac/unapi index a074345..18be669 100755 --- a/opac/unapi +++ b/opac/unapi @@ -182,8 +182,8 @@ sub emit_formats { print "\n"; } - my $marcflavour = uc(C4::Context->preference('marcflavour')); - foreach my $format (sort keys %{ $format_to_stylesheet_map->{$marcflavour} }) { + my $MarcFormat = uc(C4::Context->preference('MarcFormat')); + foreach my $format (sort keys %{ $format_to_stylesheet_map->{$MarcFormat} }) { print $format_info->{$format}, "\n"; } print "\n"; @@ -195,12 +195,12 @@ sub get_transformer { my ($format, $format_to_stylesheet_map, $format_info) = @_; $format = lc $format; - my $marcflavour = uc(C4::Context->preference('marcflavour')); - return unless $format_to_stylesheet_map->{$marcflavour}->{$format}; + my $MarcFormat = uc(C4::Context->preference('MarcFormat')); + return unless $format_to_stylesheet_map->{$MarcFormat}->{$format}; my $xslt_file = C4::Context->config('intranetdir') . "/koha-tmpl/intranet-tmpl/prog/en/xslt/" . - $format_to_stylesheet_map->{$marcflavour}->{$format}; + $format_to_stylesheet_map->{$MarcFormat}->{$format}; my $parser = XML::LibXML->new(); my $xslt = XML::LibXSLT->new(); diff --git a/serials/checkexpiration.pl b/serials/checkexpiration.pl index 8dff415..22849d8 100755 --- a/serials/checkexpiration.pl +++ b/serials/checkexpiration.pl @@ -97,6 +97,6 @@ if ($date) { ); } $template->param ( - (uc(C4::Context->preference("marcflavour"))) => 1 + (uc(C4::Context->preference("MarcFormat"))) => 1 ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/serials/claims.pl b/serials/claims.pl index 5434b2a..a993278 100755 --- a/serials/claims.pl +++ b/serials/claims.pl @@ -98,6 +98,6 @@ $template->param( claimletter => $claimletter, supplierloop => \@supplierinfo, branchloop => $branchloop, - (uc(C4::Context->preference("marcflavour"))) => 1 + (uc(C4::Context->preference("MarcFormat"))) => 1 ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/serials/routing-preview.pl b/serials/routing-preview.pl index 437c852..bc905bd 100755 --- a/serials/routing-preview.pl +++ b/serials/routing-preview.pl @@ -133,7 +133,7 @@ $template->param( routingnotes => $routingnotes, generalroutingnote => C4::Context->preference('RoutingListNote'), hasRouting => check_routing($subscriptionid), - (uc(C4::Context->preference("marcflavour"))) => 1 + (uc(C4::Context->preference("MarcFormat"))) => 1 ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/serials/routing.pl b/serials/routing.pl index a95631b..d9b7655 100755 --- a/serials/routing.pl +++ b/serials/routing.pl @@ -121,7 +121,7 @@ $template->param( dates => $dates, routingnotes => $serials[0]->{'routingnotes'}, hasRouting => check_routing($subscriptionid), - (uc(C4::Context->preference("marcflavour"))) => 1 + (uc(C4::Context->preference("MarcFormat"))) => 1 ); diff --git a/serials/serial-issues.pl b/serials/serial-issues.pl index b57baa1..2a10aa7 100755 --- a/serials/serial-issues.pl +++ b/serials/serial-issues.pl @@ -108,5 +108,5 @@ if ($selectview eq "full"){ virtualshelves => "".C4::Context->preference("virtualshelves"), ); } -$template->param((uc(C4::Context->preference("marcflavour"))) => 1); +$template->param((uc(C4::Context->preference("MarcFormat"))) => 1); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/serials/serials-collection.pl b/serials/serials-collection.pl index 7428494..4b4fc9a 100755 --- a/serials/serials-collection.pl +++ b/serials/serials-collection.pl @@ -170,7 +170,7 @@ $template->param( subscriptioncount => $subscriptioncount, location => $locationlib, callnumber => $callnumber, - uc(C4::Context->preference("marcflavour")) => 1, + uc(C4::Context->preference("MarcFormat")) => 1, serialsadditems => $subscriptiondescs->[0]{'serialsadditems'}, ); diff --git a/serials/serials-edit.pl b/serials/serials-edit.pl index 66d3a4e..264c370 100755 --- a/serials/serials-edit.pl +++ b/serials/serials-edit.pl @@ -401,7 +401,7 @@ $template->param( serialslist => \@serialdatalist, default_bib_view => $default_bib_view, location => $locationlib, - (uc(C4::Context->preference("marcflavour"))) => 1 + (uc(C4::Context->preference("MarcFormat"))) => 1 ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/serials/serials-home.pl b/serials/serials-home.pl index 9ec0336..350f10d 100755 --- a/serials/serials-home.pl +++ b/serials/serials-home.pl @@ -52,7 +52,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( $template->param( routing => $routing, - (uc(C4::Context->preference("marcflavour"))) => 1 + (uc(C4::Context->preference("MarcFormat"))) => 1 ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/serials/serials-recieve.pl b/serials/serials-recieve.pl index 770d10d..1553db6 100755 --- a/serials/serials-recieve.pl +++ b/serials/serials-recieve.pl @@ -278,6 +278,6 @@ $template->param( frommissing => $manualstatus, missingdate => $manualdate, missingid => $manualid, - (uc(C4::Context->preference("marcflavour"))) => 1 + (uc(C4::Context->preference("MarcFormat"))) => 1 ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/serials/serials-search.pl b/serials/serials-search.pl index bc84ed6..48a382a 100755 --- a/serials/serials-search.pl +++ b/serials/serials-search.pl @@ -127,7 +127,7 @@ $template->param( branches_loop => \@branches_loop, done_searched => $searched, routing => $routing, - marcflavour => (uc(C4::Context->preference("marcflavour"))) + MarcFormat => (uc(C4::Context->preference("MarcFormat"))) ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/serials/subscription-add.pl b/serials/subscription-add.pl index 1959b23..1d492ea 100755 --- a/serials/subscription-add.pl +++ b/serials/subscription-add.pl @@ -173,7 +173,7 @@ if ($op eq 'addsubscription') { $template->param(bibliotitle => $bib->{title}); } } - $template->param((uc(C4::Context->preference("marcflavour"))) => 1); + $template->param((uc(C4::Context->preference("MarcFormat"))) => 1); output_html_with_http_headers $query, $cookie, $template->output; } diff --git a/serials/subscription-detail.pl b/serials/subscription-detail.pl index fc57d89..a90e3c1 100755 --- a/serials/subscription-detail.pl +++ b/serials/subscription-detail.pl @@ -174,7 +174,7 @@ $template->param( intranetcolorstylesheet => C4::Context->preference('intranetcolorstylesheet'), irregular_issues => scalar @irregular_issues, default_bib_view => $default_bib_view, - (uc(C4::Context->preference("marcflavour"))) => 1, + (uc(C4::Context->preference("MarcFormat"))) => 1, show_acquisition_details => defined $tmpl_infos->{ordered_exists} || defined $tmpl_infos->{spent_exists} ? 1 : 0, basketno => $order->{basketno}, %$tmpl_infos, diff --git a/serials/viewalerts.pl b/serials/viewalerts.pl index 5944ce1..89d6bc5 100755 --- a/serials/viewalerts.pl +++ b/serials/viewalerts.pl @@ -53,7 +53,7 @@ foreach (@$borrowers) { $template->param(alertloop => $borrowers, bibliotitle => $subscription->{bibliotitle}, subscriptionid => $subscriptionid, - (uc(C4::Context->preference("marcflavour"))) => 1 + (uc(C4::Context->preference("MarcFormat"))) => 1 ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/svc/bib b/svc/bib index 8f6a168..213345d 100755 --- a/svc/bib +++ b/svc/bib @@ -82,7 +82,7 @@ sub update_bib { my $inxml = $query->param('POSTDATA'); print $query->header(-type => 'text/xml'); - my $record = eval {MARC::Record::new_from_xml( $inxml, "utf8", C4::Context->preference('marcflavour'))}; + my $record = eval {MARC::Record::new_from_xml( $inxml, "utf8", C4::Context->preference('MarcFormat'))}; my $do_not_escape = 0; if ($@) { $result->{'status'} = "failed"; diff --git a/svc/import_bib b/svc/import_bib index f93428d..c1fa12f 100755 --- a/svc/import_bib +++ b/svc/import_bib @@ -73,8 +73,8 @@ sub import_bib { return $result; } - my $marcflavour = C4::Context->preference('marcflavour') || 'MARC21'; - my $marc_record = eval {MARC::Record::new_from_xml( $inxml, "utf8", $marcflavour)}; + my $MarcFormat = C4::Context->preference('MarcFormat') || 'MARC21'; + my $marc_record = eval {MARC::Record::new_from_xml( $inxml, "utf8", $MarcFormat)}; if ($@) { $result->{'status'} = "failed"; $result->{'error'} = $@; diff --git a/svc/new_bib b/svc/new_bib index 435d837..654d0a6 100755 --- a/svc/new_bib +++ b/svc/new_bib @@ -53,8 +53,8 @@ sub add_bib { my $inxml = $query->param('POSTDATA'); print $query->header(-type => 'text/xml'); - my $marcflavour = C4::Context->preference('marcflavour') || 'MARC21'; - my $record = eval {MARC::Record::new_from_xml( $inxml, "utf8", $marcflavour)}; + my $MarcFormat = C4::Context->preference('MarcFormat') || 'MARC21'; + my $record = eval {MARC::Record::new_from_xml( $inxml, "utf8", $MarcFormat)}; my $do_not_escape = 0; if ($@) { $result->{'status'} = "failed"; @@ -63,7 +63,7 @@ sub add_bib { # fix character set if ($record->encoding() eq 'MARC-8') { my ($guessed_charset, $charset_errors); - ($record, $guessed_charset, $charset_errors) = MarcToUTF8Record($record, $marcflavour); + ($record, $guessed_charset, $charset_errors) = MarcToUTF8Record($record, $MarcFormat); } my $fullrecord = $record->clone(); diff --git a/t/db_dependent/Heading_MARC21.t b/t/db_dependent/Heading_MARC21.t index 0e1f1c9..234c6e8 100755 --- a/t/db_dependent/Heading_MARC21.t +++ b/t/db_dependent/Heading_MARC21.t @@ -14,7 +14,7 @@ BEGIN { } SKIP: { - skip "MARC21 heading tests not applicable to UNIMARC", 2 if C4::Context->preference('marcflavour') eq 'UNIMARC'; + skip "MARC21 heading tests not applicable to UNIMARC", 2 if C4::Context->preference('MarcFormat') eq 'UNIMARC'; my $field = MARC::Field->new( '650', ' ', '0', a => 'Uncles', x => 'Fiction' ); my $heading = C4::Heading->new_from_bib_field($field); is($heading->display_form(), 'Uncles--Fiction', 'Display form generation'); diff --git a/t/db_dependent/Search.t b/t/db_dependent/Search.t index d1f76a4..7a13384 100644 --- a/t/db_dependent/Search.t +++ b/t/db_dependent/Search.t @@ -40,7 +40,7 @@ $contextmodule->mock('_new_dbh', sub { return $dbh }); $contextmodule->mock('preference', sub { my ($self, $pref) = @_; - if ($pref eq 'marcflavour') { + if ($pref eq 'MarcFormat') { return 'MARC21'; } elsif ($pref eq 'QueryStemming') { return $QueryStemming; diff --git a/t/db_dependent/lib/KohaTest.pm b/t/db_dependent/lib/KohaTest.pm index 5a508ec..1440654 100644 --- a/t/db_dependent/lib/KohaTest.pm +++ b/t/db_dependent/lib/KohaTest.pm @@ -720,7 +720,7 @@ sub create_test_database { mandatory => 1 } ); my ($fwk_language, $installed_list) = $installer->load_sql_in_order($all_languages, @$list); $installer->set_version_syspref(); - $installer->set_marcflavour_syspref('MARC21'); + $installer->set_MarcFormat_syspref('MARC21'); diag 'database created.' } diff --git a/t/db_dependent/lib/KohaTest/Installer.pm b/t/db_dependent/lib/KohaTest/Installer.pm index b014552..f1c17bb 100644 --- a/t/db_dependent/lib/KohaTest/Installer.pm +++ b/t/db_dependent/lib/KohaTest/Installer.pm @@ -16,13 +16,13 @@ sub methods : Test( 1 ) { my $self = shift; my @methods = qw( new - marcflavour_list + MarcFormat_list marc_framework_sql_list sample_data_sql_list sql_file_list load_db_schema load_sql_in_order - set_marcflavour_syspref + set_MarcFormat_syspref set_version_syspref load_sql ); diff --git a/t/db_dependent/lib/KohaTest/Installer/SqlScripts.pm b/t/db_dependent/lib/KohaTest/Installer/SqlScripts.pm index 510c574..6573f18 100644 --- a/t/db_dependent/lib/KohaTest/Installer/SqlScripts.pm +++ b/t/db_dependent/lib/KohaTest/Installer/SqlScripts.pm @@ -32,7 +32,7 @@ sub installer_all_sample_data : Tests { foreach my $lang_code (@languages) { SKIP: { - my $marc_flavours = $self->{installer}->marcflavour_list($lang_code); + my $marc_flavours = $self->{installer}->MarcFormat_list($lang_code); ok(defined($marc_flavours), "at least one MARC flavour for $lang_code"); skip "no MARC flavours for $lang_code" unless defined($marc_flavours); diff --git a/t/db_dependent/www/batch.t b/t/db_dependent/www/batch.t index 13e5010..f127980 100644 --- a/t/db_dependent/www/batch.t +++ b/t/db_dependent/www/batch.t @@ -33,11 +33,11 @@ my $koha_conf = $ENV{KOHA_CONF}; my $xml = XMLin($koha_conf); use C4::Context; -my $marcflavour = C4::Context->preference('marcflavour') || 'MARC21'; +my $MarcFormat = C4::Context->preference('MarcFormat') || 'MARC21'; # For the purpose of this test, we can reasonably take MARC21 and NORMARC to be the same my $file = - $marcflavour eq 'UNIMARC' + $MarcFormat eq 'UNIMARC' ? "$testdir/data/unimarcrecord.mrc" : "$testdir/data/marc21record.mrc"; @@ -157,7 +157,7 @@ $agent->submit_form_ok( $agent->follow_link_ok( { text => 'Manage staged records' }, 'view batch' ); my $bookdescription; -if ( $marcflavour eq 'UNIMARC' ) { +if ( $MarcFormat eq 'UNIMARC' ) { $bookdescription = 'Jeffrey Esakov et Tom Weiss'; } else { diff --git a/tags/list.pl b/tags/list.pl index 91914b3..3db93b7 100755 --- a/tags/list.pl +++ b/tags/list.pl @@ -56,7 +56,7 @@ if ( $op eq "del" ) { } else { - my $marcflavour = C4::Context->preference('marcflavour'); + my $MarcFormat = C4::Context->preference('MarcFormat'); my @results; if ($tag) { diff --git a/tools/batchMod.pl b/tools/batchMod.pl index c299487..902877e 100755 --- a/tools/batchMod.pl +++ b/tools/batchMod.pl @@ -418,9 +418,9 @@ foreach my $tag (sort keys %{$tagslib}) { $subfield_data{marc_value} = qq(); } elsif ( length($value) > 100 - or (C4::Context->preference("marcflavour") eq "UNIMARC" and + or (C4::Context->preference("MarcFormat") eq "UNIMARC" and 300 <= $tag && $tag < 400 && $subfield eq 'a' ) - or (C4::Context->preference("marcflavour") eq "MARC21" and + or (C4::Context->preference("MarcFormat") eq "MARC21" and 500 <= $tag && $tag < 600 ) ) { # oversize field (textarea) diff --git a/tools/export.pl b/tools/export.pl index 0e05e3a..23bd9a3 100755 --- a/tools/export.pl +++ b/tools/export.pl @@ -42,7 +42,7 @@ my $help; my $op = $query->param("op") || ''; my $filename = $query->param("filename") || 'koha.mrc'; my $dbh = C4::Context->dbh; -my $marcflavour = C4::Context->preference("marcflavour"); +my $MarcFormat = C4::Context->preference("MarcFormat"); my $format = $query->param("format") || 'iso2709'; # Checks if the script is called from commandline @@ -379,9 +379,9 @@ if ( $op eq "export" ) { unless ($xml_header_written) { MARC::File::XML->default_record_format( ( - $marcflavour eq 'UNIMARC' + $MarcFormat eq 'UNIMARC' && $record_type eq 'auths' - ) ? 'UNIMARCAUTH' : $marcflavour + ) ? 'UNIMARCAUTH' : $MarcFormat ); print MARC::File::XML::header(); print "\n"; diff --git a/tools/stage-marc-import.pl b/tools/stage-marc-import.pl index fbb5365..0131040 100755 --- a/tools/stage-marc-import.pl +++ b/tools/stage-marc-import.pl @@ -184,7 +184,7 @@ if ($completedJobID) { } else { # initial form - if (C4::Context->preference("marcflavour") eq "UNIMARC") { + if (C4::Context->preference("MarcFormat") eq "UNIMARC") { $template->param("UNIMARC" => 1); } my @matchers = C4::Matcher::GetMatcherList(); diff --git a/virtualshelves/downloadshelf.pl b/virtualshelves/downloadshelf.pl index 1f6ddd9..0982aa4 100755 --- a/virtualshelves/downloadshelf.pl +++ b/virtualshelves/downloadshelf.pl @@ -51,7 +51,7 @@ my $dbh = C4::Context->dbh; if ($shelfid && $format) { my ($items, $totitems) = GetShelfContents($shelfid); - my $marcflavour = C4::Context->preference('marcflavour'); + my $MarcFormat = C4::Context->preference('MarcFormat'); my $output=''; # CSV diff --git a/virtualshelves/sendshelf.pl b/virtualshelves/sendshelf.pl index 37a98ec..3aac574 100755 --- a/virtualshelves/sendshelf.pl +++ b/virtualshelves/sendshelf.pl @@ -71,7 +71,7 @@ if ( $email ) { my @shelf = GetShelf($shelfid); my ($items, $totitems) = GetShelfContents($shelfid); - my $marcflavour = C4::Context->preference('marcflavour'); + my $MarcFormat = C4::Context->preference('MarcFormat'); my $iso2709; my @results; @@ -81,9 +81,9 @@ if ( $email ) { my $fw = GetFrameworkCode($biblionumber); my $dat = GetBiblioData($biblionumber); my $record = GetMarcBiblio($biblionumber); - my $marcnotesarray = GetMarcNotes( $record, $marcflavour ); - my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); - my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); + my $marcnotesarray = GetMarcNotes( $record, $MarcFormat ); + my $marcauthorsarray = GetMarcAuthors( $record, $MarcFormat ); + my $marcsubjctsarray = GetMarcSubjects( $record, $MarcFormat ); my $subtitle = GetRecordValue('subtitle', $record, $fw); my @items = GetItemsInfo( $biblionumber ); diff --git a/xt/fix-old-fsf-address.exclude b/xt/fix-old-fsf-address.exclude index 6925560..b6685f9 100644 --- a/xt/fix-old-fsf-address.exclude +++ b/xt/fix-old-fsf-address.exclude @@ -2,6 +2,6 @@ INSTALL.fedora7 t/smolder_smoke_signal misc/cronjobs/check-url.pl misc/cronjobs/cloud-kw.pl -misc/installer_devel_notes/data/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql -misc/installer_devel_notes/data/en/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql +misc/installer_devel_notes/data/en/MarcFormat/marc21/mandatory/marc21_framework_DEFAULT.sql +misc/installer_devel_notes/data/en/MarcFormat/marc21/optional/marc21_simple_bib_frameworks.sql koha-tmpl/ -- 1.7.2.5