[Koha-cvs] CVS: koha/C4 Koha.pm,1.25,1.26
Paul POULAIN
tipaul at users.sourceforge.net
Thu Oct 27 14:06:00 CEST 2005
Update of /cvsroot/koha/koha/C4
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7330/C4
Modified Files:
Koha.pm
Log Message:
road to normalization : changing API = removing getbranchname, replaced by getbranchdetail (should be getbranch, but this sub already exists and I don't understand what it does...)
Index: Koha.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Koha.pm,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -r1.25 -r1.26
*** Koha.pm 26 Oct 2005 09:12:33 -0000 1.25
--- Koha.pm 27 Oct 2005 12:05:58 -0000 1.26
***************
*** 56,60 ****
ðnicitycategories
&subfield_is_koha_internal_p
! &getbranches &getbranch &getbranchname
&getprinters &getprinter
&getitemtypes &getitemtypeinfo
--- 56,60 ----
ðnicitycategories
&subfield_is_koha_internal_p
! &getbranches &getbranch &getbranchdetail
&getprinters &getprinter
&getitemtypes &getitemtypeinfo
***************
*** 469,475 ****
}
! =item getbranchname
! $branchname = &getbranchname($branchcode);
Given the branch code, the function returns the corresponding
--- 469,475 ----
}
! =item getbranchdetail
! $branchname = &getbranchdetail($branchcode);
Given the branch code, the function returns the corresponding
***************
*** 478,492 ****
=cut
! sub getbranchname
{
my ($branchcode) = @_;
my $dbh = C4::Context->dbh;
! my $sth = $dbh->prepare("SELECT branchname FROM branches WHERE branchcode = ?");
$sth->execute($branchcode);
! my $branchname = $sth->fetchrow();
$sth->finish();
return $branchname;
} # sub getbranchname
sub getprinter ($$) {
my($query, $printers) = @_; # get printer for this query from printers
--- 478,493 ----
=cut
! sub getbranchdetail
{
my ($branchcode) = @_;
my $dbh = C4::Context->dbh;
! my $sth = $dbh->prepare("SELECT * FROM branches WHERE branchcode = ?");
$sth->execute($branchcode);
! my $branchname = $sth->fetchrow_hashref();
$sth->finish();
return $branchname;
} # sub getbranchname
+
sub getprinter ($$) {
my($query, $printers) = @_; # get printer for this query from printers
More information about the Koha-cvs
mailing list