Bug 2889: Removed toggle variable from categorie.pl and categorie.tmpl.
authorGarry Collum <gcollum@gmail.com>
Tue, 9 Jun 2009 22:34:55 +0000 (18:34 -0400)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Wed, 16 Sep 2009 21:19:38 +0000 (23:19 +0200)
Removed toggle variable from categorie.pl and categorie.tmpl.  Used template __odd__variable in categorie.tmpl.

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

index 70de773..692bf6d 100755 (executable)
@@ -174,7 +174,6 @@ if ($op eq 'add_form') {
        $template->param(else => 1);
        my @loop;
        my ($count,$results)=StringSearch($searchfield,'web');
-       my $toggle = 0;
        for (my $i=0; $i < $count; $i++){
                my %row = (categorycode => $results->[$i]{'categorycode'},
                                description => $results->[$i]{'description'},
@@ -188,15 +187,12 @@ if ($op eq 'add_form') {
                                category_type => $results->[$i]{'category_type'},
                                "type_".$results->[$i]{'category_type'} => 1,
                                toggle => $toggle );
-               push @loop, \%row;
-               if ( $toggle eq 0 )
-               {
-                       $toggle = 1;
-               }
-               else
-               {
-                       $toggle = 0;
-               }
+           if (C4::Context->preference('EnhancedMessagingPreferences')) {
+               my $brief_prefs = _get_brief_messaging_prefs($results->[$i]{'categorycode'});
+               $row{messaging_prefs} = $brief_prefs if @$brief_prefs;
+           }
+           
+           push @loop, \%row;
        }
        $template->param(loop => \@loop);
        # check that I (institution) and C (child) exists. otherwise => warning to the user
index 81b8962..9b8c9ea 100644 (file)
@@ -224,7 +224,11 @@ Confirm Deletion of Category <!-- TMPL_VAR NAME="categorycode" escape="html" -->
                        <th scope="col" colspan="2">&nbsp; </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><!-- TMPL_VAR NAME="categorycode" escape="html" --></td>
                         <td>
                             <a href="<!-- TMPL_VAR NAME="script_name" -->?op=add_form&amp;categorycode=<!-- TMPL_VAR NAME="categorycode" escape="url" -->"><!-- TMPL_VAR NAME="description" escape="html" --></a>