Bug 2889: Removed toggle variable from auth_tag_structure.pl and auth_subfields_struc...
authorGarry Collum <gcollum@gmail.com>
Thu, 11 Jun 2009 19:15:38 +0000 (15:15 -0400)
committerGalen Charlton <galen.charlton@liblime.com>
Fri, 12 Jun 2009 15:47:52 +0000 (10:47 -0500)
Removed toggle variable from auth_tag_structure.pl and .tmpl.  Used template __odd__ in auth_tag_structure.tmpl.

Removed toggle variable from auth_subfields_structure.pl and .tmpl. Use __odd__. Removed a type in the highlight class definition. Fixed a minor xhtml error.

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

index 6eb3667..fd86778 100755 (executable)
@@ -134,16 +134,10 @@ if ($op eq 'add_form') {
        my $sth=$dbh->prepare("select * from auth_subfield_structure where tagfield=? and authtypecode=?"); # and tagsubfield='$tagsubfield'");
        $sth->execute($tagfield,$authtypecode);
        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{tab} = CGI::scrolling_list(-name=>'tab',
                                        -id=>"tab$i",
                                         -values =>
@@ -250,7 +244,6 @@ if ($op eq 'add_form') {
                        -value => 1,
                        -label => '');
                $row_data{row} = $i;
-               $row_data{toggle} = $toggle;
                push(@loop_data, \%row_data);
                $i++;
        }
@@ -365,7 +358,6 @@ if ($op eq 'add_form') {
                                        -tabindex=>'',
                                        -multiple=>0,
                                        );
-               $row_data{toggle} = $toggle;
                $row_data{row} = $i;
                push(@loop_data, \%row_data);
        }
@@ -498,14 +490,8 @@ if ($op eq 'add_form') {
 ################## DEFAULT ##################################
 } else { # DEFAULT
        my ($count,$results)=string_search($tagfield,$authtypecode);
-       my $toggle=1;
        my @loop_data = ();
        for (my $i=$offset; $i < ($offset+$pagesize<$count?$offset+$pagesize:$count); $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'};
@@ -521,7 +507,6 @@ if ($op eq 'add_form') {
                $row_data{hidden}       = $results->[$i]{'hidden'} if($results->[$i]{'hidden'} gt "000") ;
                $row_data{isurl}        = $results->[$i]{'isurl'};
                $row_data{delete} = "$script_name?op=delete_confirm&amp;tagfield=$tagfield&amp;tagsubfield=".$results->[$i]{'tagsubfield'}."&amp;authtypecode=$authtypecode";
-               $row_data{toggle} = $toggle;
                if ($row_data{tab} eq -1) {
                        $row_data{subfield_ignored} = 1;
                }
index c09b5d5..656b531 100755 (executable)
@@ -219,14 +219,8 @@ if ($op eq 'add_form') {
                 $template->param(searchfield => $searchfield);
        }
        my ($count,$results)=StringSearch($searchfield,$authtypecode);
-       my $toggle=1;
        my @loop_data = ();
        for (my $i=$offset; $i < ($offset+$pagesize<$count?$offset+$pagesize:$count); $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{liblibrarian}     = $results->[$i]{'liblibrarian'};
@@ -236,7 +230,6 @@ if ($op eq 'add_form') {
         $row_data{subfield_link}    = "auth_subfields_structure.pl?tagfield=" . $results->[$i]{'tagfield'} . "&amp;authtypecode=" . $authtypecode;
         $row_data{edit}             = "$script_name?op=add_form&amp;searchfield=" . $results->[$i]{'tagfield'} . "&amp;authtypecode=" . $authtypecode;
         $row_data{delete}           = "$script_name?op=delete_confirm&amp;searchfield=" . $results->[$i]{'tagfield'} . "&amp;authtypecode=" . $authtypecode;
-        $row_data{toggle}           = $toggle;
                push(@loop_data, \%row_data);
        }
        $template->param(loop => \@loop_data,
index 46054d6..7f77fdd 100644 (file)
@@ -158,7 +158,11 @@ function displayMoreConstraint(numlayer){
         <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_IF -->
         <td><!-- TMPL_VAR NAME="tagsubfield" --></td>
         <td>
             <!-- TMPL_IF NAME="subfield_ignored" -->
@@ -202,7 +206,7 @@ function displayMoreConstraint(numlayer){
        </form>
 
     <!-- TMPL_IF NAME="previous" -->
-    <input type="image" src="<!-- TMPL_VAR NAME="interface" -->/<!-- TMPL_VAR NAME="theme" -->/images/1leftarrow.png" title="previous" alt="previous" border="0" >
+    <input type="image" src="<!-- TMPL_VAR NAME="interface" -->/<!-- TMPL_VAR NAME="theme" -->/images/1leftarrow.png" title="previous" alt="previous" border="0" />
     </a>
     <!-- /TMPL_IF -->
     <!-- TMPL_IF NAME="next" -->
index c0898f5..3b4f9c6 100644 (file)
@@ -212,7 +212,11 @@ return false;
         <th>Delete</th>
        </tr>
     <!-- TMPL_LOOP NAME="loop" -->
-               <!-- TMPL_IF NAME="toggle" --><tr class="highlight"><!-- TMPL_ELSE --><tr><!-- /TMPL_IF -->
+       <!-- TMPL_UNLESS NAME="__odd__" -->
+       <tr class="highlight">
+       <!-- TMPL_ELSE -->
+       <tr>
+       <!-- /TMPL_UNLESS -->
         <td><b><!-- TMPL_VAR NAME="tagfield" --></b></td>
         <td><!-- TMPL_VAR NAME="liblibrarian" --></td>
         <td><!-- TMPL_IF NAME="repeatable" -->Yes<!-- TMPL_ELSE -->No<!-- /TMPL_IF --></td>