[Koha-cvs] CVS: koha/admin branches.pl,1.14,1.15

Ambrose Li acli at users.sourceforge.net
Sun Feb 9 07:56:46 CET 2003


Update of /cvsroot/koha/koha/admin
In directory sc8-pr-cvs1:/tmp/cvs-serv12027/admin

Modified Files:
	branches.pl 
Log Message:
Trying to fix bug 130 here; corresponding changes will need to be made to
the templates


Index: branches.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/branches.pl,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** branches.pl	9 Feb 2003 06:39:07 -0000	1.14
--- branches.pl	9 Feb 2003 06:56:43 -0000	1.15
***************
*** 168,187 ****
          $template->param(branchemail => $data->{'branchemail'});
      }
! # make the checkboxs.....
! # FIXME: this way of doing it is wrong (bug 130)
      my $catinfo = getcategoryinfo();
      my $catcheckbox;
  #    print DEBUG "catinfo=".cvs($catinfo)."\n";
      foreach my $cat (@$catinfo) {
  	my $checked = "";
! 	my $tmp = $cat->{'categorycode'};
  	if (grep {/^$tmp$/} @{$data->{'categories'}}) {
  	    $checked = "CHECKED";
  	}
! 	$template->param(categoryname => $cat->{'categoryname'});
! 	$template->param(categorycode => $cat->{'categorycode'});
! 	$template->param(codedescription => $checked>$cat->{'codedescription'});
      }
!    
  }
  
--- 168,203 ----
          $template->param(branchemail => $data->{'branchemail'});
      }
! 
!     # make the checkboxs.....
!     #
!     # We export a "categoryloop" array to the template, each element of which
!     # contains separate 'categoryname', 'categorycode', 'codedescription', and
!     # 'checked' fields. The $checked field is either '' or 'checked'
!     # (see bug 130)
!     #
      my $catinfo = getcategoryinfo();
      my $catcheckbox;
  #    print DEBUG "catinfo=".cvs($catinfo)."\n";
+     my @categoryloop = ();
      foreach my $cat (@$catinfo) {
  	my $checked = "";
! 	my $tmp = quotemeta($cat->{'categorycode'});
  	if (grep {/^$tmp$/} @{$data->{'categories'}}) {
  	    $checked = "CHECKED";
  	}
! 	push @categoryloop, {
! 		categoryname    => $cat->{'categoryname'},
! 		categorycode    => $cat->{'categorycode'},
! 		codedescription => $cat->{'codedescription'},
! 		checked         => $checked,
! 	    };
      }
!     $template->param(categoryloop => \@categoryloop);
! 
!     # {{{ Leave this here until bug 130 is completely resolved in the templates
!     for my $obsolete ('categoryname', 'categorycode', 'codedescription') {
! 	$template->param($obsolete => 'Your template is out of date (bug 130)');
!     }
!     # }}}
  }
  





More information about the Koha-cvs mailing list