From 1c68ea8229620ed6f34712a60828a97a4f080f85 Mon Sep 17 00:00:00 2001 From: toins Date: Fri, 21 Jul 2006 10:15:57 +0000 Subject: [PATCH] new function & subs renamed. --- C4/Members.pm | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/C4/Members.pm b/C4/Members.pm index 761a4c6278..f9997bd2cc 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -64,6 +64,7 @@ This module contains routines for adding, modifying and deleting members/patrons &fixEthnicity ðnicitycategories get_institutions add_member_orgs &get_age &GetBorrowersFromSurname &GetBranchCodeFromBorrowers + &GetFlagsAndBranchFromBorrower ); @@ -165,6 +166,37 @@ the C table in the Koha database. =cut +=head3 + +=over 4 + +($flags, $homebranch) = GetFlagsAndBranchFromBorrower($loggedinuser); + +this function read on the database to get flags and homebranch for a user +given on input arg. + +return : +it returns the $flags & the homebranch in scalar context. + +=back + +=cut + +sub GetFlagsAndBranchFromBorrower { + my $loggedinuser = @_; + my $dbh = C4::Context->dbh; + my $query = " + SELECT flags, branchcode + FROM borrowers + WHERE borrowernumber = ? + "; + my $sth = $dbh->prepare($query); + $sth->execute($loggedinuser); + + return $sth->fetchrow; +} + + #' sub getmember { my ( $cardnumber, $bornum ) = @_; -- 2.39.5