[Koha-cvs] CVS: koha/admin branches.pl,1.27.2.2,1.27.2.3

Owen Leonard oleonard at users.sourceforge.net
Wed Aug 3 21:17:56 CEST 2005


Update of /cvsroot/koha/koha/admin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18347/admin

Modified Files:
      Tag: rel_2_2
	branches.pl 
Log Message:
- Fixing a bug that was preventing error messages from appearing
- Adding option for alternating row colors in branch and branch categories listings

Index: branches.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/branches.pl,v
retrieving revision 1.27.2.2
retrieving revision 1.27.2.3
diff -C2 -r1.27.2.2 -r1.27.2.3
*** branches.pl	1 Aug 2005 12:50:52 -0000	1.27.2.2
--- branches.pl	3 Aug 2005 19:17:51 -0000	1.27.2.3
***************
*** 101,104 ****
--- 101,105 ----
  	my $params = $input->Vars;
  	unless ($params->{'branchcode'} && $params->{'branchname'}) {
+ 		$template->param(else => 1);
  		default ("MESSAGE1");
  	} else {
***************
*** 125,129 ****
  } elsif ($op eq 'editcategory') {
  	# If the user has pressed the "add new category" or "modify" buttons.
- 	heading("Branches: Edit Category");
  	$template->param('heading-branches-edit-category-p' => 1);
  	editcatform($categorycode);
--- 126,129 ----
***************
*** 132,135 ****
--- 132,136 ----
  	my $params = $input->Vars;
  	unless ($params->{'categorycode'} && $params->{'categoryname'}) {
+ 		$template->param(else => 1);
  		default ("MESSAGE4");
  	} else {
***************
*** 260,267 ****
  		$branchinfo = getbranchinfo();
  	}
! 	my $color;
  	my @loop_data =();
  	foreach my $branch (@$branchinfo) {
! 		($color eq $linecolor1) ? ($color=$linecolor2) : ($color=$linecolor1);
  		#
  		# We export the following fields to the template. These are not
--- 261,269 ----
  		$branchinfo = getbranchinfo();
  	}
! 	my $toggle;
! 	my $i;
  	my @loop_data =();
  	foreach my $branch (@$branchinfo) {
! 		($i % 2) ? ($toggle = 1) : ($toggle = 0);
  		#
  		# We export the following fields to the template. These are not
***************
*** 319,337 ****
  		$row{'branch_name'} = $branch->{'branchname'};
  		$row{'branch_code'} = $branch->{'branchcode'};
! 		$row{'color'} = $color;
  		$row{'value'} = $branch->{'branchcode'};
  		$row{'action'} = '/cgi-bin/koha/admin/branches.pl';
  
  		push @loop_data, { %row };
  	}
  	my @branchcategories =();
  	my $catinfo = getcategoryinfo();
  	foreach my $cat (@$catinfo) {
  		push @branchcategories, {
  			categoryname    => $cat->{'categoryname'},
  			categorycode    => $cat->{'categorycode'},
  			codedescription => $cat->{'codedescription'},
  		};
! 	}
  
  	$template->param(branches => \@loop_data,
--- 321,345 ----
  		$row{'branch_name'} = $branch->{'branchname'};
  		$row{'branch_code'} = $branch->{'branchcode'};
! 		$row{'toggle'} = $toggle;
  		$row{'value'} = $branch->{'branchcode'};
  		$row{'action'} = '/cgi-bin/koha/admin/branches.pl';
  
  		push @loop_data, { %row };
+ 		$i++;
  	}
  	my @branchcategories =();
  	my $catinfo = getcategoryinfo();
+ 	my $toggle;
+ 	my $i = 0;
  	foreach my $cat (@$catinfo) {
+ 		($i % 2) ? ($toggle = 1) : ($toggle = 0);
  		push @branchcategories, {
+ 			toggle => $toggle,
  			categoryname    => $cat->{'categoryname'},
  			categorycode    => $cat->{'categorycode'},
  			codedescription => $cat->{'codedescription'},
  		};
! 		$i++;
! 	} 
  
  	$template->param(branches => \@loop_data,





More information about the Koha-cvs mailing list