[Koha-patches] [PATCH] Bug 2889: Removed toggle variables from z3950servers.pl and .tmpl

Garry Collum gcollum at gmail.com
Thu Jun 11 01:48:40 CEST 2009


Removed toggle variables from z3950servers.pl and z3950servers.tmpl.  Used template __odd__variable instead.
---
 admin/z3950servers.pl                              |   13 +------------
 .../prog/en/modules/admin/z3950servers.tmpl        |    7 ++++++-
 2 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/admin/z3950servers.pl b/admin/z3950servers.pl
index 37d577c..be7cae5 100755
--- a/admin/z3950servers.pl
+++ b/admin/z3950servers.pl
@@ -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) {
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tmpl
index e495b6a..9a628a0 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tmpl
@@ -295,7 +295,12 @@
                 <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>
 
-- 
1.5.6.5




More information about the Koha-patches mailing list