From 084e875b52ffb652cc5a8c027948dce6d075bdb3 Mon Sep 17 00:00:00 2001 From: Mason James Date: Mon, 10 Jun 2013 14:06:43 +1200 Subject: [PATCH] Bug 10096 [FOLLOW-UP] - fix tabs/whitespace errors to pass QA Content-Type: text/plain; charset="utf-8" --- C4/Breeding.pm | 6 +- admin/z3950servers.pl | 156 ++++++++++---------- cataloguing/z3950_auth_search.pl | 2 +- .../prog/en/modules/admin/z3950servers.tt | 12 +- .../en/modules/cataloguing/z3950_auth_search.tt | 8 +- 5 files changed, 93 insertions(+), 91 deletions(-) diff --git a/C4/Breeding.pm b/C4/Breeding.pm index 6937ac2..9bafcee 100644 --- a/C4/Breeding.pm +++ b/C4/Breeding.pm @@ -440,9 +440,9 @@ sub Z3950Search { =head2 ImportBreedingAuth - ImportBreedingAuth($marcrecords,$overwrite_auth,$filename,$encoding,$z3950random,$batch_type); +ImportBreedingAuth($marcrecords,$overwrite_auth,$filename,$encoding,$z3950random,$batch_type); - TODO description +TODO description =cut @@ -464,7 +464,7 @@ sub ImportBreedingAuth { my $breedingid; for (my $i=0;$i<=$#marcarray;$i++) { my ($marcrecord, $charset_result, $charset_errors); - ($marcrecord, $charset_result, $charset_errors) = + ($marcrecord, $charset_result, $charset_errors) = MarcToUTF8Record($marcarray[$i]."\x1D", C4::Context->preference("marcflavour"), $encoding); # Normalize the record so it doesn't have separated diacritics diff --git a/admin/z3950servers.pl b/admin/z3950servers.pl index 86c1e9d..52b254c 100755 --- a/admin/z3950servers.pl +++ b/admin/z3950servers.pl @@ -85,90 +85,90 @@ $template->param(script_name => $script_name, ################## ADD_FORM ################################## # called by default. Used to create form to add or modify a record -if ($op eq 'add_form') { - $template->param(add_form => 1); - #---- if primkey exists, it's a modify action, so read values to modify... - my $data; - if ($searchfield) { - my $dbh = C4::Context->dbh; - my $sth=$dbh->prepare("select host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout,recordtype from z3950servers where (name = ?) order by rank,name"); - $sth->execute($searchfield); - $data=$sth->fetchrow_hashref; - $sth->finish; - } - $template->param( $_ => $data->{$_} ) - for ( qw( host port db userid password checked rank timeout encoding ) ); - $template->param( $_ . $data->{$_} => 1) - for ( qw( syntax recordtype ) ); - # END $OP eq ADD_FORM +if ( $op eq 'add_form' ) { + $template->param( add_form => 1 ); + + #---- if primkey exists, it's a modify action, so read values to modify... + my $data; + if ($searchfield) { + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare( +"select host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout,recordtype from z3950servers where (name = ?) order by rank,name" + ); + $sth->execute($searchfield); + $data = $sth->fetchrow_hashref; + $sth->finish; + } + $template->param( $_ => $data->{$_} ) + for (qw( host port db userid password checked rank timeout encoding )); + $template->param( $_ . $data->{$_} => 1 ) for (qw( syntax recordtype )); + + # END $OP eq ADD_FORM ################## ADD_VALIDATE ################################## -# called by add_form, used to insert/modify data in DB + # called by add_form, used to insert/modify data in DB } elsif ($op eq 'add_validate') { - $template->param(add_validate => 1); - my $dbh=C4::Context->dbh; - my $sth=$dbh->prepare("select * from z3950servers where name=?"); - $sth->execute($input->param('searchfield')); - my $checked = $input->param('checked') ? 1 : 0; - if ($sth->rows) { - $sth=$dbh->prepare("update z3950servers set host=?, port=?, db=?, userid=?, password=?, name=?, checked=?, rank=?,syntax=?,encoding=?,timeout=?,recordtype=? where name=?"); - $sth->execute($input->param('host'), - $input->param('port'), - $input->param('db'), - $input->param('userid'), - $input->param('password'), - $input->param('searchfield'), - $checked, - $input->param('rank'), - $input->param('syntax'), - $input->param('encoding'), - $input->param('timeout'), - $input->param('recordtype'), - $input->param('searchfield'), - ); - } - else { - $sth=$dbh->prepare( - "INSERT INTO z3950servers " . - "(host,port,db,userid,password,name,checked,rank,syntax,encoding,timeout,recordtype) " . - "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" ); + $template->param( add_validate => 1 ); + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare("select * from z3950servers where name=?"); + $sth->execute( $input->param('searchfield') ); + my $checked = $input->param('checked') ? 1 : 0; + if ( $sth->rows ) { + $sth = $dbh->prepare( +"update z3950servers set host=?, port=?, db=?, userid=?, password=?, name=?, checked=?, rank=?,syntax=?,encoding=?,timeout=?,recordtype=? where name=?" + ); $sth->execute( - $input->param( 'host' ), - $input->param( 'port' ), - $input->param( 'db' ), - $input->param( 'userid' ), - $input->param( 'password' ), - $input->param( 'searchfield' ), - $checked, - $input->param( 'rank' ), - $input->param( 'syntax' ), - $input->param( 'encoding' ), - $input->param( 'timeout' ), - $input->param( 'recordtype' ) ); - } - $sth->finish; - # END $OP eq ADD_VALIDATE + $input->param('host'), $input->param('port'), + $input->param('db'), $input->param('userid'), + $input->param('password'), $input->param('searchfield'), + $checked, $input->param('rank'), + $input->param('syntax'), $input->param('encoding'), + $input->param('timeout'), $input->param('recordtype'), + $input->param('searchfield'), + ); + } + else { + $sth = + $dbh->prepare( "INSERT INTO z3950servers " + . "(host,port,db,userid,password,name,checked,rank,syntax,encoding,timeout,recordtype) " + . "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" ); + $sth->execute( + $input->param('host'), $input->param('port'), + $input->param('db'), $input->param('userid'), + $input->param('password'), $input->param('searchfield'), + $checked, $input->param('rank'), + $input->param('syntax'), $input->param('encoding'), + $input->param('timeout'), $input->param('recordtype') + ); + } + $sth->finish; + + # END $OP eq ADD_VALIDATE ################## DELETE_CONFIRM ################################## # called by default form, used to confirm deletion of data in DB } elsif ($op eq 'delete_confirm') { - $template->param(delete_confirm => 1); - my $dbh = C4::Context->dbh; - - my $sth2=$dbh->prepare("select host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout,recordtype from z3950servers where (name = ?) order by rank,name"); - $sth2->execute($searchfield); - my $data=$sth2->fetchrow_hashref; - $sth2->finish; - - $template->param(host => $data->{'host'}, - port => $data->{'port'}, - db => $data->{'db'}, - userid => $data->{'userid'}, - password => $data->{'password'}, - checked => $data->{'checked'}, - rank => $data->{'rank'}, - syntax => $data->{'syntax'}, - timeout => $data->{'timeout'}, - recordtype => $data->{'recordtype'}, - encoding => $data->{'encoding'} ); + $template->param( delete_confirm => 1 ); + my $dbh = C4::Context->dbh; + + my $sth2 = $dbh->prepare( +"select host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout,recordtype from z3950servers where (name = ?) order by rank,name" + ); + $sth2->execute($searchfield); + my $data = $sth2->fetchrow_hashref; + $sth2->finish; + + $template->param( + host => $data->{'host'}, + port => $data->{'port'}, + db => $data->{'db'}, + userid => $data->{'userid'}, + password => $data->{'password'}, + checked => $data->{'checked'}, + rank => $data->{'rank'}, + syntax => $data->{'syntax'}, + timeout => $data->{'timeout'}, + recordtype => $data->{'recordtype'}, + encoding => $data->{'encoding'} + ); # END $OP eq DELETE_CONFIRM ################## DELETE_CONFIRMED ################################## diff --git a/cataloguing/z3950_auth_search.pl b/cataloguing/z3950_auth_search.pl index 9fbddbd..47be33e 100755 --- a/cataloguing/z3950_auth_search.pl +++ b/cataloguing/z3950_auth_search.pl @@ -23,7 +23,7 @@ use strict; use warnings; -use CGI qw( -utf8 ); +use CGI qw / -utf8 /; use C4::Auth; use C4::Output; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt index 1bf8c4a..0e45980 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt @@ -238,7 +238,7 @@ seconds
  • - [% IF ( recordtypebiblio ) %] [% ELSE %] @@ -250,7 +250,7 @@ [% END %] -
  • + @@ -304,7 +304,7 @@ [% IF ( searchfield ) %] You searched for [% searchfield %] - [% END %] + [% END %] @@ -314,9 +314,11 @@ [% ELSE %] [% END %] - + + + [% END %] -
    TargetHostname/PortDatabaseUseridPasswordCheckedRankSyntaxEncodingTimeoutRecord type  
    [% loo.name %][% loo.host %]:[% loo.port %][% loo.db %][% loo.userid %][% loo.password %][% IF ( loo.checked ) %]Yes[% ELSE %]No[% END %][% loo.rank %] [% loo.syntax %][% loo.encoding %][% loo.timeout %][% loo.recordtype %]EditDelete
    [% loo.name %][% loo.host %]:[% loo.port %][% loo.db %][% loo.userid %][% loo.password %][% IF ( loo.checked ) %]Yes[% ELSE %]No[% END %][% loo.rank %][% loo.syntax %][% loo.encoding %][% loo.timeout %][% loo.recordtype %]EditDelete
    + [% IF ( offsetgtzero ) %]
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt index e2b79f1..fb836fc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt @@ -101,7 +101,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
    [% END %]
    - [% IF ( opsearch ) %] + [% IF ( opsearch ) %]

    Z39.50 Authority search points

    @@ -160,7 +160,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : [% FOREACH breeding_loo IN breeding_loop %] [% IF ( breeding_loo.breedingid ) %] - + [% breeding_loo.server %] [% breeding_loo.heading %] [% breeding_loo.heading_code %] @@ -214,11 +214,11 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
    [% END %]
    Nothing found.
    -

    +

    [% END %] [% END %] -
    + [% IF ( numberpending ) %]

    Still [% numberpending %] servers to search

    [% END %] -- 1.7.2.5