Bug 2889: Removed toggle variable from koha2marclinks.tmpl. Used template __odd__...
authorGarry Collum <gcollum@gmail.com>
Mon, 8 Jun 2009 20:54:23 +0000 (16:54 -0400)
committerGalen Charlton <galen.charlton@liblime.com>
Mon, 8 Jun 2009 21:47:55 +0000 (16:47 -0500)
Removed toggle variable from koha2marclinks.tmpl and koh2marclinks.pl.  Used template __odd__ variable instead.

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

index c23c39d..e65e1e5 100755 (executable)
@@ -140,15 +140,8 @@ else {    # DEFAULT
     my $sth2 = $dbh->prepare("SHOW COLUMNS from $tablename");
     $sth2->execute;
 
-    my $toggle    = 1;
     my @loop_data = ();
     while ( ( my $field ) = $sth2->fetchrow_array ) {
-        if ( $toggle eq 1 ) {
-            $toggle = 0;
-        }
-        else {
-            $toggle = 1;
-        }
         my %row_data;    # get a fresh hash for the row data
         $row_data{tagfield} = $fields{ $tablename . "." . $field }->{tagfield};
         $row_data{tagsubfield} =
@@ -158,7 +151,6 @@ else {    # DEFAULT
         $row_data{kohafield} = $field;
         $row_data{edit}      =
 "$script_name?op=add_form&amp;tablename=$tablename&amp;kohafield=$field";
-        $row_data{toggle} = $toggle;
         push( @loop_data, \%row_data );
     }
     $template->param(
index e4e59f3..366c005 100644 (file)
     <th>&nbsp;</th>
 </tr>
 <!-- TMPL_LOOP name="loop" -->
-<!-- TMPL_IF NAME="toggle" --><tr><!-- TMPL_ELSE --><tr class="highlight"><!-- /TMPL_IF -->
+<!-- TMPL_UNLESS name="__odd__" -->
+<tr class="highlight">
+<!-- TMPL_ELSE -->
+<tr>
+<!-- /TMPL_IF -->
     <td><a href="<!-- TMPL_VAR name="edit" -->"><!-- TMPL_VAR name="kohafield" --></a></td>
     <td><!-- TMPL_VAR name="tagfield" --></td>
     <td><!-- TMPL_VAR name="tagsubfield" --></td>