Skip to content

Commit

Permalink
Bug 12357: Following whitespace failures on koha qa test tools.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Koha-qa tools now happy

Signed-off-by: Jonathan Druart <[email protected]>
Signed-off-by: Tomas Cohen Arazi <[email protected]>
  • Loading branch information
mtompset authored and tomascohen committed Sep 7, 2015
1 parent 95286aa commit cc2452d
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 78 deletions.
42 changes: 21 additions & 21 deletions C4/Record.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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);

}

Expand Down
104 changes: 52 additions & 52 deletions C4/Ris.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
}
}
}
}
}

Expand Down
10 changes: 5 additions & 5 deletions t/db_dependent/Record.t
Original file line number Diff line number Diff line change
Expand Up @@ -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" );
Expand Down

0 comments on commit cc2452d

Please sign in to comment.