From decb2774267e1e445be74291f7ea3a09e21fcfde Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Mon, 25 May 2015 00:22:07 -0400 Subject: [PATCH] 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 Koha-qa tools now happy Signed-off-by: Jonathan Druart --- C4/Record.pm | 42 +++++++++---------- C4/Ris.pm | 104 ++++++++++++++++++++++++------------------------ t/db_dependent/Record.t | 10 ++--- 3 files changed, 78 insertions(+), 78 deletions(-) diff --git a/C4/Record.pm b/C4/Record.pm index a3bc860..f46651b 100644 --- a/C4/Record.pm +++ b/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); } diff --git a/C4/Ris.pm b/C4/Ris.pm index d35b39e..cd56352 100644 --- a/C4/Ris.pm +++ b/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 "Field $kwfield subfield a:", $kwfield->subfield('a'), "\r\nField $kwfield subfield b:", $kwfield->subfield('b'), "\r\nField $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 "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 "Field $kwfield subfield a:", $kwfield->subfield('a'), "\r\nField $kwfield subfield b:", $kwfield->subfield('b'), "\r\nField $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 "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 "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 "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; + } + } + } + } } } diff --git a/t/db_dependent/Record.t b/t/db_dependent/Record.t index 5dfa36a..8e806d7 100755 --- a/t/db_dependent/Record.t +++ b/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" ); -- 2.1.0