Browse Source

Bug 12357: Following whitespace failures on koha qa test tools.

TEST PLAN
---------
1) Apply all patches before this.
2) run koha qa test tools
   -- whitespace failures
3) Apply this patch
4) run koha qa test tools
   -- no whitespace failures.

NOTE: More tabs were fixed than required, to also clean up a little indenting.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Koha-qa tools now happy

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
3.22.x
Mark Tompsett 9 years ago
committed by Tomas Cohen Arazi
parent
commit
cc2452df23
  1. 42
      C4/Record.pm
  2. 104
      C4/Ris.pm
  3. 10
      t/db_dependent/Record.t

42
C4/Record.pm

@ -326,27 +326,27 @@ sub marc2endnote {
if ($f500) {
$abstract = $f500->subfield('a');
}
my $fields = {
DB => C4::Context->preference("LibraryName"),
Title => $marc_rec_obj->title(),
Author => $marc_rec_obj->author(),
Publisher => $f710a,
City => $f260a,
Year => $marc_rec_obj->publication_date,
Abstract => $abstract,
};
my $endnote;
my $style = new Biblio::EndnoteStyle();
my $template;
$template.= "DB - DB\n" if C4::Context->preference("LibraryName");
$template.="T1 - Title\n" if $marc_rec_obj->title();
$template.="A1 - Author\n" if $marc_rec_obj->author();
$template.="PB - Publisher\n" if $f710a;
$template.="CY - City\n" if $f260a;
$template.="Y1 - Year\n" if $marc_rec_obj->publication_date;
$template.="AB - Abstract\n" if $abstract;
my ($text, $errmsg) = $style->format($template, $fields);
return ($text);
my $fields = {
DB => C4::Context->preference("LibraryName"),
Title => $marc_rec_obj->title(),
Author => $marc_rec_obj->author(),
Publisher => $f710a,
City => $f260a,
Year => $marc_rec_obj->publication_date,
Abstract => $abstract,
};
my $endnote;
my $style = new Biblio::EndnoteStyle();
my $template;
$template.= "DB - DB\n" if C4::Context->preference("LibraryName");
$template.="T1 - Title\n" if $marc_rec_obj->title();
$template.="A1 - Author\n" if $marc_rec_obj->author();
$template.="PB - Publisher\n" if $f710a;
$template.="CY - City\n" if $f260a;
$template.="Y1 - Year\n" if $marc_rec_obj->publication_date;
$template.="AB - Abstract\n" if $abstract;
my ($text, $errmsg) = $style->format($template, $fields);
return ($text);
}

104
C4/Ris.pm

@ -817,36 +817,36 @@ sub get_keywords {
## loop over all 6XX fields
foreach my $kwfield (@keywords) {
if ($kwfield != undef) {
## authornames get special treatment
if ($fieldname eq "600") {
my $val = normalize_author($kwfield->subfield('a'), $kwfield->subfield('b'), $kwfield->subfield('c'), $kwfield->indicator('1'));
push @kw, $val;
print "<marc>Field $kwfield subfield a:", $kwfield->subfield('a'), "\r\n<marc>Field $kwfield subfield b:", $kwfield->subfield('b'), "\r\n<marc>Field $kwfield subfield c:", $kwfield->subfield('c'), "\r\n" if $marcprint;
}
else {
## retrieve all available subfields
my @kwsubfields = $kwfield->subfields();
## loop over all available subfield tuples
foreach my $kwtuple (@kwsubfields) {
## loop over all subfields to check
foreach my $subfield (@subfields) {
## [0] contains subfield code
if (@$kwtuple[0] eq $subfield) {
## [1] contains value, remove trailing separators
@$kwtuple[1] =~ s% *[,;.:/]*$%%;
if (length(@$kwtuple[1]) > 0) {
push @kw, @$kwtuple[1];
print "<marc>Field $fieldname subfield $subfield:", @$kwtuple[1], "\r\n" if $marcprint;
}
## we can leave the subfields loop here
last;
}
}
}
}
}
if ($kwfield != undef) {
## authornames get special treatment
if ($fieldname eq "600") {
my $val = normalize_author($kwfield->subfield('a'), $kwfield->subfield('b'), $kwfield->subfield('c'), $kwfield->indicator('1'));
push @kw, $val;
print "<marc>Field $kwfield subfield a:", $kwfield->subfield('a'), "\r\n<marc>Field $kwfield subfield b:", $kwfield->subfield('b'), "\r\n<marc>Field $kwfield subfield c:", $kwfield->subfield('c'), "\r\n" if $marcprint;
}
else {
## retrieve all available subfields
my @kwsubfields = $kwfield->subfields();
## loop over all available subfield tuples
foreach my $kwtuple (@kwsubfields) {
## loop over all subfields to check
foreach my $subfield (@subfields) {
## [0] contains subfield code
if (@$kwtuple[0] eq $subfield) {
## [1] contains value, remove trailing separators
@$kwtuple[1] =~ s% *[,;.:/]*$%%;
if (length(@$kwtuple[1]) > 0) {
push @kw, @$kwtuple[1];
print "<marc>Field $fieldname subfield $subfield:", @$kwtuple[1], "\r\n" if $marcprint;
}
## we can leave the subfields loop here
last;
}
}
}
}
}
}
return @kw;
}
@ -940,28 +940,28 @@ sub pool_subx {
## loop over all notefields
foreach my $notefield (@notefields) {
if (defined $notefield) {
## retrieve all available subfield tuples
my @notesubfields = $notefield->subfields();
## loop over all subfield tuples
foreach my $notetuple (@notesubfields) {
## loop over all subfields to check
foreach my $subfield (@subfields) {
## [0] contains subfield code
if (@$notetuple[0] eq $subfield) {
## [1] contains value, remove trailing separators
print "<marc>field $fieldname subfield $subfield: ", @$notetuple[1], "\r\n" if $marcprint;
@$notetuple[1] =~ s% *[,;.:/]*$%%;
if (length(@$notetuple[1]) > 0) {
## add to list
push @{$aref}, @$notetuple[1];
}
last;
}
}
}
}
if (defined $notefield) {
## retrieve all available subfield tuples
my @notesubfields = $notefield->subfields();
## loop over all subfield tuples
foreach my $notetuple (@notesubfields) {
## loop over all subfields to check
foreach my $subfield (@subfields) {
## [0] contains subfield code
if (@$notetuple[0] eq $subfield) {
## [1] contains value, remove trailing separators
print "<marc>field $fieldname subfield $subfield: ", @$notetuple[1], "\r\n" if $marcprint;
@$notetuple[1] =~ s% *[,;.:/]*$%%;
if (length(@$notetuple[1]) > 0) {
## add to list
push @{$aref}, @$notetuple[1];
}
last;
}
}
}
}
}
}

10
t/db_dependent/Record.t

@ -113,11 +113,11 @@ is ($bibtex, $test5xml, "testing bibtex");
C4::Context->set_preference( "BibtexExportAdditionalFields", "'\@': 260\$b\ntest: 260\$b" );
$bibtex = marc2bibtex( $marc, 'testID' );
my $test6xml = qq(\@Scholastic{testID,
author = {Rowling, J.K.},
title = {Harry potter},
publisher = {Scholastic},
year = {2001},
test = {Scholastic}
\tauthor = {Rowling, J.K.},
\ttitle = {Harry potter},
\tpublisher = {Scholastic},
\tyear = {2001},
\ttest = {Scholastic}
}
);
is( $bibtex, $test6xml, "testing bibtex" );

Loading…
Cancel
Save