[Koha-patches] [PATCH] Bug 1953 [5/6]: whitespace changes: perltidy.

Galen Charlton galen.charlton at liblime.com
Tue Jul 29 18:42:49 CEST 2008


From: Andrew Moore <andrew.moore at liblime.com>

ran perltidy on the whole method since I've rewritten most of it.

Signed-off-by: Galen Charlton <galen.charlton at liblime.com>
---
 C4/Koha.pm |   32 +++++++++++++++-----------------
 1 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/C4/Koha.pm b/C4/Koha.pm
index 1c07cf0..7f5bb68 100644
--- a/C4/Koha.pm
+++ b/C4/Koha.pm
@@ -889,42 +889,40 @@ SELECT lib,
 
 sub displayServers {
     my ( $position, $type ) = @_;
-    my $dbh    = C4::Context->dbh;
+    my $dbh = C4::Context->dbh;
 
     my $strsth = 'SELECT * FROM z3950servers';
     my @where_clauses;
     my @bind_params;
 
-    if ( $position ) {
-        push @bind_params, $position;
+    if ($position) {
+        push @bind_params,   $position;
         push @where_clauses, ' position = ? ';
     }
 
-    if ( $type ) {
-        push @bind_params, $type;
+    if ($type) {
+        push @bind_params,   $type;
         push @where_clauses, ' type = ? ';
     }
 
-    if ( @where_clauses ) {
+    # reassemble where clause from where clause pieces
+    if (@where_clauses) {
         $strsth .= ' WHERE ' . join( ' AND ', @where_clauses );
     }
 
     my $rq = $dbh->prepare($strsth);
-    $rq->execute( @bind_params );
+    $rq->execute(@bind_params);
     my @primaryserverloop;
 
     while ( my $data = $rq->fetchrow_hashref ) {
         push @primaryserverloop,
-          {
-            label => $data->{description},
-            id    => $data->{name},
-            name  => "server",
-            value => $data->{host} . ":"
-              . $data->{port} . "/"
-              . $data->{database},
-            encoding   => ($data->{encoding}?$data->{encoding}:"iso-5426"),
-            checked    => "checked",
-            icon       => $data->{icon},
+          { label    => $data->{description},
+            id       => $data->{name},
+            name     => "server",
+            value    => $data->{host} . ":" . $data->{port} . "/" . $data->{database},
+            encoding => ( $data->{encoding} ? $data->{encoding} : "iso-5426" ),
+            checked  => "checked",
+            icon     => $data->{icon},
             zed        => $data->{type} eq 'zed',
             opensearch => $data->{type} eq 'opensearch'
           };
-- 
1.5.5.GIT




More information about the Koha-patches mailing list