[Koha-patches] [PATCH] Bug 2889: Removed toggle from marc_subfields_structure.pl and .tmpl
Garry Collum
gcollum at gmail.com
Thu Jun 11 22:44:30 CEST 2009
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.
---
admin/marc_subfields_structure.pl | 17 -----------------
.../en/modules/admin/marc_subfields_structure.tmpl | 8 ++++++--
2 files changed, 6 insertions(+), 19 deletions(-)
diff --git a/admin/marc_subfields_structure.pl b/admin/marc_subfields_structure.pl
index a4c0697..7bcd0dc 100755
--- a/admin/marc_subfields_structure.pl
+++ b/admin/marc_subfields_structure.pl
@@ -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&tagfield=$tagfield&tagsubfield="
. $results->[$i]{'tagsubfield'}
. "&frameworkcode=$frameworkcode";
- $row_data{toggle} = $toggle;
if ( $row_data{tab} eq -1 ) {
$row_data{subfield_ignored} = 1;
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tmpl
index 55b3a4b..2ea58de 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tmpl
@@ -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" -->
--
1.5.6.5
More information about the Koha-patches
mailing list