[Koha-cvs] koha/reports borrowers_stats.pl [rel_3_0]

Antoine Farnault antoine at koha-fr.org
Fri Nov 10 10:08:18 CET 2006


CVSROOT:	/sources/koha
Module name:	koha
Branch:		rel_3_0
Changes by:	Antoine Farnault <toins>	06/11/10 09:08:18

Modified files:
	reports        : borrowers_stats.pl 

Log message:
	use GetBranches instead of branch.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/reports/borrowers_stats.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.10&r2=1.10.2.1

Patches:
Index: borrowers_stats.pl
===================================================================
RCS file: /sources/koha/koha/reports/borrowers_stats.pl,v
retrieving revision 1.10
retrieving revision 1.10.2.1
diff -u -b -r1.10 -r1.10.2.1
--- borrowers_stats.pl	4 Jul 2006 14:36:52 -0000	1.10
+++ borrowers_stats.pl	10 Nov 2006 09:08:18 -0000	1.10.2.1
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# $Id: borrowers_stats.pl,v 1.10 2006/07/04 14:36:52 toins Exp $
+# $Id: borrowers_stats.pl,v 1.10.2.1 2006/11/10 09:08:18 toins Exp $
 
 # Copyright 2000-2002 Katipo Communications
 #
@@ -122,21 +122,16 @@
 				-size     => 1,
 				-multiple => 0 );
 	
-	my @branches;
-	my @select_branch;
-	my %select_branches;
-	my ($count2, at branches)=branches();
-	push @select_branch,"";
-	$select_branches{''}='';
-	for (my $i=0;$i<$count2;$i++){
-			push @select_branch, $branches[$i]->{'branchcode'};#
-			$select_branches{$branches[$i]->{'branchcode'}} = $branches[$i]->{'branchname'};
-	}
-	my $CGIbranch=CGI::scrolling_list( -name     => 'pickup',
-							-values   => \@select_branch,
-							-labels   => \%select_branches,
-							-size     => 1,
-							-multiple => 0 );
+my $branches = GetBranches;
+my @branchloop;
+foreach my $thisbranch (keys %$branches) {
+   # my $selected = 1 if $thisbranch eq $branch;
+    my %row =(value => $thisbranch,
+#                selected => $selected,
+                branchname => $branches->{$thisbranch}->{'branchname'},
+            );
+    push @branchloop, \%row;
+}
 	
 	$req = $dbh->prepare( "select distinctrow sort1 from borrowers order by sort1");
 	$req->execute;
@@ -198,7 +193,7 @@
 					hassort2 => $hassort2,
 					CGIextChoice => $CGIextChoice,
 					CGIsepChoice => $CGIsepChoice,
-					CGIBranch => $CGIbranch
+					CGIBranch => @branchloop
 					);
 
 }





More information about the Koha-cvs mailing list