[Koha-cvs] koha/C4 Members.pm
Chris Cormack
chris at katipo.co.nz
Tue May 23 05:18:39 CEST 2006
CVSROOT: /sources/koha
Module name: koha
Branch:
Changes by: Chris Cormack <rangi at savannah.gnu.org> 06/05/23 03:18:39
Modified files:
C4 : Members.pm
Log message:
add_member_orgs, to add borrowers to organisations (other borrowers)
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha/C4/Members.pm.diff?tr1=1.16&tr2=1.17&r1=text&r2=text
Patches:
Index: koha/C4/Members.pm
diff -u koha/C4/Members.pm:1.16 koha/C4/Members.pm:1.17
--- koha/C4/Members.pm:1.16 Tue May 23 00:46:32 2006
+++ koha/C4/Members.pm Tue May 23 03:18:39 2006
@@ -19,7 +19,7 @@
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
-# $Id: Members.pm,v 1.16 2006/05/23 00:46:32 rangi Exp $
+# $Id: Members.pm,v 1.17 2006/05/23 03:18:39 rangi Exp $
use strict;
require Exporter;
@@ -30,7 +30,7 @@
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
-$VERSION = do { my @v = '$Revision: 1.16 $' =~ /\d+/g; shift(@v) . "." . join("_", map {sprintf "%03d", $_ } @v); };
+$VERSION = do { my @v = '$Revision: 1.17 $' =~ /\d+/g; shift(@v) . "." . join("_", map {sprintf "%03d", $_ } @v); };
=head1 NAME
@@ -38,15 +38,18 @@
=head1 SYNOPSIS
+use C4::Members;
=head1 DESCRIPTION
+This module contains routines for adding, modifying and deleting members/patrons/borrowers
=head1 FUNCTIONS
=over 2
=cut
+#'
@ISA = qw(Exporter);
@EXPORT = qw();
@@ -58,7 +61,7 @@
&getboracctrecord
&borrowercategories &getborrowercategory
&fixEthnicity
- ðnicitycategories get_institutions
+ ðnicitycategories get_institutions add_member_orgs
);
@@ -600,7 +603,7 @@
return($data->{'max(borrowernumber)'});
}
-=item borrissues
+=head2 borrissues
($count, $issues) = &borrissues($borrowernumber);
@@ -630,7 +633,7 @@
return(scalar(@result), \@result);
}
-=item allissues
+=head2 allissues
($count, $issues) = &allissues($borrowernumber, $sortkey, $limit);
@@ -676,7 +679,7 @@
return($i,\@result);
}
-=item getboracctrecord
+=head2 getboracctrecord
($count, $acctlines, $total) = &getboracctrecord($env, $borrowernumber);
@@ -788,6 +791,8 @@
guarantorchild
=cut
+#'
+
sub getguarantordata{
my ($borrowerid)=@_;
my $dbh = C4::Context->dbh;
@@ -801,6 +806,7 @@
=head2 getdcity (OUEST-PROVENCE)
recover cityid with city_name condition
=cut
+
sub getidcity {
my ($city_name)=@_;
my $dbh = C4::Context->dbh;
@@ -882,7 +888,7 @@
return(\@codes,\%labels);
}
-=item getborrowercategory
+=head2 getborrowercategory
$description = &getborrowercategory($categorycode);
@@ -972,4 +978,24 @@
return(\%orgs);
} # sub get_institutions
+
+=head2 add_member_orgs
+
+ add_member_orgs($borrowernumber,$borrowernumbers);
+
+Takes a borrowernumber and a list of other borrowernumbers and inserts them into the borrowers_to_borrowers table
+
+=cut
+#'
+sub add_member_orgs {
+ my ($borrowernumber,$otherborrowers) = @_;
+ my $dbh = C4::Context->dbh();
+ my $query = "INSERT INTO borrowers_to_borrowers (borrower1,borrower2) VALUES (?,?)";
+ my $sth = $dbh->prepare($query);
+ foreach my $bornum (@$otherborrowers){
+ $sth->execute($borrowernumber,$bornum);
+ }
+ $sth->finish();
+
+} # sub add_member_orgs
1;
More information about the Koha-cvs
mailing list