[Koha-cvs] CVS: koha/C4 Acquisition.pm,1.22,1.23 Koha.pm,1.22,1.23

Paul POULAIN tipaul at users.sourceforge.net
Fri Sep 2 16:30:31 CEST 2005


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

Modified Files:
	Acquisition.pm Koha.pm 
Log Message:
removing branches sub, that should be in Koha.pm package (generic sub)

Index: Acquisition.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Acquisition.pm,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -r1.22 -r1.23
*** Acquisition.pm	10 Aug 2005 14:22:48 -0000	1.22
--- Acquisition.pm	2 Sep 2005 14:30:28 -0000	1.23
***************
*** 63,67 ****
  		&updatecurrencies &getcurrency
  
! 		&branches &updatesup &insertsup
  		&bookseller &breakdown
  );
--- 63,67 ----
  		&updatecurrencies &getcurrency
  
! 		&updatesup &insertsup
  		&bookseller &breakdown
  );
***************
*** 988,1026 ****
  }
  
- =item branches
- 
-   ($count, @results) = &branches();
- 
- Returns a list of all library branches.
- 
- C<$count> is the number of elements in C<@results>. C<@results> is an
- array of references-to-hash, whose keys are the fields of the branches
- table of the Koha database.
- 
- =cut
- #'
- sub branches {
-     my $dbh   = C4::Context->dbh;
- 	my $sth;
- 	if (C4::Context->preference("IndependantBranches") && (C4::Context->userenv->{flags}!=1)){
- 		my $strsth ="Select * from branches ";
- 		$strsth.= " WHERE branchcode = ".$dbh->quote(C4::Context->userenv->{branch});
- 		$strsth.= " order by branchname";
- 		warn "C4::Acquisition->branches : ".$strsth;
- 		$sth=$dbh->prepare($strsth);
- 	} else {
-     	$sth = $dbh->prepare("Select * from branches order by branchname");
- 	}
-     my @results = ();
- 
-     $sth->execute();
-     while (my $data = $sth->fetchrow_hashref) {
-         push(@results,$data);
-     } # while
- 
-     $sth->finish;
-     return(scalar(@results), @results);
- } # sub branches
- 
  =item updatesup
  
--- 988,991 ----

Index: Koha.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Koha.pm,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -r1.22 -r1.23
*** Koha.pm	16 Aug 2004 12:49:42 -0000	1.22
--- Koha.pm	2 Sep 2005 14:30:28 -0000	1.23
***************
*** 179,183 ****
  my $branches = getbranches;
  my @branchloop;
! foreach my $thisbranch (keys %$branches) {
  	my $selected = 1 if $thisbranch eq $branch;
  	my %row =(value => $thisbranch,
--- 179,183 ----
  my $branches = getbranches;
  my @branchloop;
! foreach my $thisbranch (sort keys %$branches) {
  	my $selected = 1 if $thisbranch eq $branch;
  	my %row =(value => $thisbranch,
***************
*** 203,207 ****
  	my %branches;
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("select * from branches order by branchname");
  	$sth->execute;
  	while (my $branch=$sth->fetchrow_hashref) {
--- 203,215 ----
  	my %branches;
  	my $dbh = C4::Context->dbh;
! 	my $sth;
! 	if (C4::Context->preference("IndependantBranches") && (C4::Context->userenv->{flags}!=1)){
! 		my $strsth ="Select * from branches ";
! 		$strsth.= " WHERE branchcode = ".$dbh->quote(C4::Context->userenv->{branch});
! 		$strsth.= " order by branchname";
! 		$sth=$dbh->prepare($strsth);
! 	} else {
!     	$sth = $dbh->prepare("Select * from branches order by branchname");
! 	}
  	$sth->execute;
  	while (my $branch=$sth->fetchrow_hashref) {
***************
*** 237,241 ****
  my $itemtypes = getitemtypes;
  my @itemtypesloop;
! foreach my $thisitemtype (keys %$itemtypes) {
  	my $selected = 1 if $thisitemtype eq $itemtype;
  	my %row =(value => $thisitemtype,
--- 245,249 ----
  my $itemtypes = getitemtypes;
  my @itemtypesloop;
! foreach my $thisitemtype (sort keys %$itemtypes) {
  	my $selected = 1 if $thisitemtype eq $itemtype;
  	my %row =(value => $thisitemtype,
***************
*** 267,271 ****
  	my %itemtypes;
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("select * from itemtypes order by description");
  	$sth->execute;
  	while (my $IT=$sth->fetchrow_hashref) {
--- 275,279 ----
  	my %itemtypes;
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("select * from itemtypes");
  	$sth->execute;
  	while (my $IT=$sth->fetchrow_hashref) {





More information about the Koha-cvs mailing list