Bug 2889: Removed toggle from marc_subfields_structure.pl and .tmpl

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

Corrected a typo in the highlight class definition in .tmpl.

Corrected a readability issue with the description when deleting a subfield in .tmpl.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
This commit is contained in:
Garry Collum 2009-06-11 16:44:30 -04:00 committed by Henri-Damien LAURENT
parent 2db7c0fa14
commit 4d097814ee
2 changed files with 6 additions and 19 deletions

View file

@ -174,16 +174,9 @@ if ( $op eq 'add_form' ) {
); # and tagsubfield='$tagsubfield'");
$sth->execute( $tagfield, $frameworkcode );
my @loop_data = ();
my $toggle = 1;
my $i = 0;
while ( $data = $sth->fetchrow_hashref ) {
my %row_data; # get a fresh hash for the row data
if ( $toggle eq 1 ) {
$toggle = 0;
}
else {
$toggle = 1;
}
$row_data{defaultvalue} = $data->{defaultvalue};
$row_data{tab} = CGI::scrolling_list(
-name => 'tab',
@ -273,7 +266,6 @@ if ( $op eq 'add_form' ) {
-label => ''
);
$row_data{row} = $i;
$row_data{toggle} = $toggle;
$row_data{link} = CGI::escapeHTML( $data->{'link'} );
push( @loop_data, \%row_data );
$i++;
@ -368,7 +360,6 @@ if ( $op eq 'add_form' ) {
-multiple => 0,
);
$row_data{link} = CGI::escapeHTML( $data->{'link'} );
$row_data{toggle} = $toggle;
$row_data{row} = $j;
push( @loop_data, \%row_data );
}
@ -538,7 +529,6 @@ elsif ( $op eq 'delete_confirmed' ) {
}
else { # DEFAULT
my ( $count, $results ) = string_search( $tagfield, $frameworkcode );
my $toggle = 1;
my @loop_data = ();
for (
my $i = $offset ;
@ -546,12 +536,6 @@ else { # DEFAULT
$i++
)
{
if ( $toggle eq 1 ) {
$toggle = 0;
}
else {
$toggle = 1;
}
my %row_data; # get a fresh hash for the row data
$row_data{tagfield} = $results->[$i]{'tagfield'};
$row_data{tagsubfield} = $results->[$i]{'tagsubfield'};
@ -571,7 +555,6 @@ else { # DEFAULT
"$script_name?op=delete_confirm&amp;tagfield=$tagfield&amp;tagsubfield="
. $results->[$i]{'tagsubfield'}
. "&amp;frameworkcode=$frameworkcode";
$row_data{toggle} = $toggle;
if ( $row_data{tab} eq -1 ) {
$row_data{subfield_ignored} = 1;

View file

@ -135,7 +135,7 @@
<h3>Confirm Deletion of Subfield <!-- TMPL_VAR NAME="tagsubfield" -->?</h3>
<p>Subfield: <!-- TMPL_VAR NAME="tagsubfield" --></p>
<p>Description<!-- TMPL_VAR NAME="liblibrarian" --></p>
<p>Description: <!-- TMPL_VAR NAME="liblibrarian" --></p>
<form action="<!-- TMPL_VAR NAME="delete_link" -->" method="post"><input type="hidden" name="op" value="delete_confirmed" />
<input type="hidden" name="searchfield" value="<!-- TMPL_VAR NAME="searchfield" -->" />
@ -177,7 +177,11 @@
<th>Delete</th>
</tr>
<!-- TMPL_LOOP NAME="loop" -->
<!-- TMPL_IF NAME="toggle" --><tr class="highlighted"><!-- TMPL_ELSE --><tr><!-- /TMPL_IF -->
<!-- TMPL_UNLESS NAME="__odd__" -->
<tr class="highlight">
<!-- TMPL_ELSE -->
<tr>
<!-- /TMPL_UNLESS -->
<td><!-- TMPL_VAR NAME="tagsubfield" --></td>
<td>
<!-- TMPL_IF NAME="subfield_ignored" -->