Bug 2889: Removed toggle variables from z3950servers.pl and .tmpl
authorGarry Collum <gcollum@gmail.com>
Wed, 10 Jun 2009 23:48:40 +0000 (19:48 -0400)
committerGalen Charlton <galen.charlton@liblime.com>
Thu, 11 Jun 2009 11:10:42 +0000 (06:10 -0500)
Removed toggle variables from z3950servers.pl and z3950servers.tmpl.  Used template __odd__variable instead.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
admin/z3950servers.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tmpl

index 37d577c..be7cae5 100755 (executable)
@@ -160,7 +160,6 @@ if ($op eq 'add_form') {
        $template->param(else => 1);
        my ($count,$results)=StringSearch($searchfield,'web');
        my @loop;
-       my $toggle = 0;
        for (my $i=$offset; $i < ($offset+$pagesize<$count?$offset+$pagesize:$count); $i++){
                        
                my $urlsearchfield=$results->[$i]{name};
@@ -174,19 +173,9 @@ if ($op eq 'add_form') {
                        checked => $results->[$i]{'checked'},
                        rank => $results->[$i]{'rank'},
                        syntax => $results->[$i]{'syntax'},
-      encoding => $results->[$i]{'encoding'},
-                       toggle => $toggle);
+      encoding => $results->[$i]{'encoding'});
                push @loop, \%row;
 
-                if ( $toggle eq 0 )
-                {
-                        $toggle = 1;
-                }
-                else
-                {
-                        $toggle = 0;
-                }
-
        }
        $template->param(loop => \@loop);
        if ($offset>0) {
index e495b6a..9a628a0 100644 (file)
                 <thead><tr><th>Target</th><th>Hostname/Port</th><th>Database</th><th>Userid</th><th>Password</th><th>Checked</th><th>Rank</th>                         <th>Syntax</th><th>Encoding</th><th colspan="2">&nbsp;</th>
                 </tr></thead>
                 <tbody><!-- TMPL_LOOP NAME="loop" -->
-               <!-- TMPL_IF NAME="toggle" --><tr class="highlight"><!-- TMPL_ELSE --><tr><!-- /TMPL_IF --><td><a href="<!-- TMPL_VAR name="script_name" -->?op=add_form&amp;searchfield=<!-- TMPL_VAR NAME="name" ESCAPE="url" -->"><!-- TMPL_VAR NAME="name" --></a></td><td><!-- TMPL_VAR NAME="host" -->:<!-- TMPL_VAR NAME="port" --></td><td><!-- TMPL_VAR NAME="db" --></td><td><!-- TMPL_VAR NAME="userid" --></td><td><!-- TMPL_VAR NAME="password" --></td><td><!-- TMPL_VAR NAME="checked" --></td><td><!-- TMPL_VAR NAME="rank" --></td>                    <td><!-- TMPL_VAR NAME="syntax" --></td><td><!-- TMPL_VAR NAME="encoding" --></td><td><a href="<!-- TMPL_VAR name="script_name" -->?op=add_form&amp;searchfield=<!-- TMPL_VAR NAME="name" ESCAPE="url" -->">Edit</a></td><td><a href="<!-- TMPL_VAR name="script_name" -->?op=delete_confirm&amp;searchfield=<!-- TMPL_VAR NAME="name" ESCAPE="url" -->">Delete</a></td>                </tr>
+                <!-- TMPL_UNLESS NAME="__odd__" -->
+                    <tr class="highlight">
+                <!-- TMPL_ELSE -->
+                    <tr>
+                <!-- /TMPL_UNLESS -->
+<td><a href="<!-- TMPL_VAR name="script_name" -->?op=add_form&amp;searchfield=<!-- TMPL_VAR NAME="name" ESCAPE="url" -->"><!-- TMPL_VAR NAME="name" --></a></td><td><!-- TMPL_VAR NAME="host" -->:<!-- TMPL_VAR NAME="port" --></td><td><!-- TMPL_VAR NAME="db" --></td><td><!-- TMPL_VAR NAME="userid" --></td><td><!-- TMPL_VAR NAME="password" --></td><td><!-- TMPL_VAR NAME="checked" --></td><td><!-- TMPL_VAR NAME="rank" --></td>                      <td><!-- TMPL_VAR NAME="syntax" --></td><td><!-- TMPL_VAR NAME="encoding" --></td><td><a href="<!-- TMPL_VAR name="script_name" -->?op=add_form&amp;searchfield=<!-- TMPL_VAR NAME="name" ESCAPE="url" -->">Edit</a></td><td><a href="<!-- TMPL_VAR name="script_name" -->?op=delete_confirm&amp;searchfield=<!-- TMPL_VAR NAME="name" ESCAPE="url" -->">Delete</a></td>                </tr>
                 <!-- /TMPL_LOOP --></tbody>
        </table>