[Koha-patches] [PATCH] Bug 2889: Removed toggle variable from itemtypes.tmpl. Used template __odd__ variable instead.

Garry Collum gcollum at gmail.com
Tue Jun 9 00:00:13 CEST 2009


Removed toggle variable from itemtypes.tmpl and itemtypes.pl.  Used the __odd__ template variable instead.
---
 admin/itemtypes.pl                                 |    2 --
 .../prog/en/modules/admin/itemtypes.tmpl           |    8 ++++----
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/admin/itemtypes.pl b/admin/itemtypes.pl
index 345e172..9f0395c 100755
--- a/admin/itemtypes.pl
+++ b/admin/itemtypes.pl
@@ -240,10 +240,8 @@ else {    # DEFAULT
     # if we are on the last page, the number of the last word to display
     # must not exceed the length of the results array
     my $last = min( $first + $pagesize - 1, scalar @{$results} - 1, );
-    my $toggle = 0;
     my @loop;
     foreach my $itemtype ( @{$results}[ $first .. $last ] ) {
-        $itemtype->{toggle} = ($toggle++ % 2) ? 0 : 1 ;
         $itemtype->{imageurl} = getitemtypeimagelocation( 'intranet', $itemtype->{imageurl} );
         $itemtype->{rentalcharge} = sprintf( '%.2f', $itemtype->{rentalcharge} );
         push( @loop, $itemtype );
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tmpl
index 93bcfb9..2497f99 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tmpl
@@ -290,11 +290,11 @@ Item Types Administration
     <th>Actions</th>
   </tr>
   <!-- TMPL_LOOP name="loop" -->
-    <!-- TMPL_IF NAME="toggle" -->
-  <tr>
-    <!-- TMPL_ELSE -->
+    <!-- TMPL_UNLESS NAME="__odd__" -->
   <tr class="highlight">
-    <!-- /TMPL_IF -->
+    <!-- TMPL_ELSE -->
+  <tr">
+    <!-- /TMPL_UNLESS -->
    <!-- TMPL_UNLESS NAME="noItemTypeImages" --> <td><img src="<!-- TMPL_VAR name="imageurl" -->" alt="" /></td><!-- /TMPL_UNLESS -->
     <td>
       <a href="<!-- TMPL_VAR name="script_name" -->?op=add_form&amp;itemtype=<!-- TMPL_VAR name="itemtype" escape="HTML" -->">
-- 
1.5.6.5




More information about the Koha-patches mailing list