Bug 2889: Removed toggle variable from koha2marclinks.tmpl. Used template __odd__ variable.

Removed toggle variable from koha2marclinks.tmpl and koh2marclinks.pl.  Used template __odd__ variable instead.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This commit is contained in:
Garry Collum 2009-06-08 16:54:23 -04:00 committed by Galen Charlton
parent c09bdabaf4
commit fc8b7c27bb
2 changed files with 5 additions and 9 deletions

View file

@ -140,15 +140,8 @@ else { # DEFAULT
my $sth2 = $dbh->prepare("SHOW COLUMNS from $tablename"); my $sth2 = $dbh->prepare("SHOW COLUMNS from $tablename");
$sth2->execute; $sth2->execute;
my $toggle = 1;
my @loop_data = (); my @loop_data = ();
while ( ( my $field ) = $sth2->fetchrow_array ) { 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 my %row_data; # get a fresh hash for the row data
$row_data{tagfield} = $fields{ $tablename . "." . $field }->{tagfield}; $row_data{tagfield} = $fields{ $tablename . "." . $field }->{tagfield};
$row_data{tagsubfield} = $row_data{tagsubfield} =
@ -158,7 +151,6 @@ else { # DEFAULT
$row_data{kohafield} = $field; $row_data{kohafield} = $field;
$row_data{edit} = $row_data{edit} =
"$script_name?op=add_form&amp;tablename=$tablename&amp;kohafield=$field"; "$script_name?op=add_form&amp;tablename=$tablename&amp;kohafield=$field";
$row_data{toggle} = $toggle;
push( @loop_data, \%row_data ); push( @loop_data, \%row_data );
} }
$template->param( $template->param(

View file

@ -155,7 +155,11 @@
<th>&nbsp;</th> <th>&nbsp;</th>
</tr> </tr>
<!-- TMPL_LOOP name="loop" --> <!-- 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><a href="<!-- TMPL_VAR name="edit" -->"><!-- TMPL_VAR name="kohafield" --></a></td>
<td><!-- TMPL_VAR name="tagfield" --></td> <td><!-- TMPL_VAR name="tagfield" --></td>
<td><!-- TMPL_VAR name="tagsubfield" --></td> <td><!-- TMPL_VAR name="tagsubfield" --></td>