road to normalization : changing API = removing getbranchname, replaced by getbranchd...
authortipaul <tipaul>
Thu, 27 Oct 2005 12:05:58 +0000 (12:05 +0000)
committertipaul <tipaul>
Thu, 27 Oct 2005 12:05:58 +0000 (12:05 +0000)
C4/Koha.pm
ISBDdetail.pl
MARCdetail.pl
opac/opac-ISBDdetail.pl
opac/opac-MARCdetail.pl

index 9da8070..8864435 100644 (file)
@@ -55,7 +55,7 @@ Koha.pm provides many functions for Koha scripts.
                        &borrowercategories &getborrowercategory
                        &ethnicitycategories
                        &subfield_is_koha_internal_p
-                       &getbranches &getbranch &getbranchname
+                       &getbranches &getbranch &getbranchdetail
                        &getprinters &getprinter
                        &getitemtypes &getitemtypeinfo
                        &getframeworks &getframeworkinfo
@@ -468,26 +468,27 @@ sub getbranch ($$) {
     return $branch;
 }
 
-=item getbranchname
+=item getbranchdetail
 
-  $branchname = &getbranchname($branchcode);
+  $branchname = &getbranchdetail($branchcode);
 
 Given the branch code, the function returns the corresponding
 branch name for a comprehensive information display
 
 =cut
 
-sub getbranchname
+sub getbranchdetail
 {
        my ($branchcode) = @_;
        my $dbh = C4::Context->dbh;
-       my $sth = $dbh->prepare("SELECT branchname FROM branches WHERE branchcode = ?");
+       my $sth = $dbh->prepare("SELECT * FROM branches WHERE branchcode = ?");
        $sth->execute($branchcode);
-       my $branchname = $sth->fetchrow();
+       my $branchname = $sth->fetchrow_hashref();
        $sth->finish();
        return $branchname;
 } # sub getbranchname
 
+
 sub getprinter ($$) {
     my($query, $printers) = @_; # get printer for this query from printers
     my $printer = $query->param('printer');
index 473713b..f51de62 100755 (executable)
@@ -132,7 +132,7 @@ sub get_authorised_value_desc ($$$$$) {
 
    #---- branch
     if ($tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) {
-       return getbranchname($value);
+       return getbranchdetail($value)->{branchname};
     }
 
    #---- itemtypes
index 5777ed6..25a24cd 100755 (executable)
@@ -235,7 +235,7 @@ sub get_authorised_value_desc ($$$$$) {
 
    #---- branch
     if ($tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) {
-       return getbranchname($value);
+       return getbranchdetail($value)->{branchname};
     }
 
    #---- itemtypes
index 51f84b5..e10ec4d 100755 (executable)
@@ -148,7 +148,7 @@ sub get_authorised_value_desc ($$$$$) {
 
    #---- branch
     if ($tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) {
-       return getbranchname($value);
+       return getbranchdetail($value)->{branchname};
     }
 
    #---- itemtypes
index 49c1baf..f7e0e47 100755 (executable)
@@ -206,7 +206,7 @@ sub get_authorised_value_desc ($$$$$) {
 
    #---- branch
     if ($tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) {
-       return getbranchname($value);
+       return getbranchdetail($value)->{branchname};
     }
 
    #---- itemtypes