koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] CVS: koha/C4 Search.pm,1.71,1.72


From: Jerome Vizcaino
Subject: [Koha-cvs] CVS: koha/C4 Search.pm,1.71,1.72
Date: Tue, 01 Jul 2003 03:30:07 -0700

Update of /cvsroot/koha/koha/C4
In directory sc8-pr-cvs1:/tmp/cvs-serv17217

Modified Files:
        Search.pm 
Log Message:
Added &getbranchname and &getborrowercategory
getbranchname : given branchcode returns branch name
getborrowercategory : given categorycode returns description


Index: Search.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Search.pm,v
retrieving revision 1.71
retrieving revision 1.72
diff -C2 -r1.71 -r1.72
*** Search.pm   20 Jun 2003 08:48:16 -0000      1.71
--- Search.pm   1 Jul 2003 10:30:05 -0000       1.72
***************
*** 63,67 ****
  &addauthor &bibitems &barcodes &findguarantees &allissues
  &findguarantor &getwebsites &getwebbiblioitems &catalogsearch &itemcount2
! &isbnsearch &breedingsearch &getallthemes &getalllanguages);
  # make all your functions, whether exported or not;
  
--- 63,67 ----
  &addauthor &bibitems &barcodes &findguarantees &allissues
  &findguarantor &getwebsites &getwebbiblioitems &catalogsearch &itemcount2
! &isbnsearch &breedingsearch &getallthemes &getalllanguages &getbranchname 
&getborrowercategory);
  # make all your functions, whether exported or not;
  
***************
*** 1845,1852 ****
    my $dbh = C4::Context->dbh;
    my $query;
!   $query="Select * from issues,biblio,items where borrowernumber='$bornum' and
! items.itemnumber=issues.itemnumber and
! items.biblionumber=biblio.biblionumber and issues.returndate is NULL order
! by date_due";
    #print $query;
    my $sth=$dbh->prepare($query);
--- 1845,1852 ----
    my $dbh = C4::Context->dbh;
    my $query;
!   $query="Select * from issues,biblio,items where borrowernumber='$bornum'
!    and items.itemnumber=issues.itemnumber
!       and items.biblionumber=biblio.biblionumber
!       and issues.returndate is NULL order by date_due";
    #print $query;
    my $sth=$dbh->prepare($query);
***************
*** 2440,2444 ****
  
  
! =item getalllanguages 
  
    (@languages) = &getalllanguages();
--- 2440,2444 ----
  
  
! =item getalllanguages
  
    (@languages) = &getalllanguages();
***************
*** 2525,2529 ****
  }
  
! =item getallthemes 
  
    (@themes) = &getallthemes('opac');
--- 2525,2529 ----
  }
  
! =item getallthemes
  
    (@themes) = &getallthemes('opac');
***************
*** 2594,2597 ****
--- 2594,2640 ----
      return($count, @results);
  } # sub isbnsearch
+ 
+ =item getbranchname
+ 
+   $branchname = &getbranchname($branchcode);
+ 
+ Given the branch code, the function returns the corresponding
+ branch name for a comprehensive information display
+ 
+ =cut
+ 
+ sub getbranchname
+ {
+       my ($branchcode) = @_;
+       my $dbh = C4::Context->dbh;
+       my $query = "SELECT branchname FROM branches WHERE branchcode = 
'$branchcode'";
+       my $sth = $dbh->prepare($query);
+       $sth->execute;
+       my $branchname = $sth->fetchrow();
+       $sth->finish();
+       return $branchname;
+ } # sub getbranchname
+ 
+ =item getborrowercategory
+ 
+   $description = &getborrowercategory($categorycode);
+ 
+ Given the borrower's category code, the function returns the corresponding
+ description for a comprehensive information display.
+ 
+ =cut
+ 
+ sub getborrowercategory
+ {
+       my ($catcode) = @_;
+       my $dbh = C4::Context->dbh;
+       my $query = "SELECT description FROM categories WHERE categorycode = 
'$catcode'";
+       my $sth = $dbh->prepare($query);
+       $sth->execute;
+       my $description = $sth->fetchrow();
+       $sth->finish();
+       return $description;
+ } # sub getborrowercategory
+ 
  
  END { }       # module clean-up code here (global destructor)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]