=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();
&getboracctrecord
&borrowercategories &getborrowercategory
&fixEthnicity
- ðnicitycategories get_institutions
+ ðnicitycategories get_institutions add_member_orgs
);
return($data->{'max(borrowernumber)'});
}
-=item borrissues
+=head2 borrissues
($count, $issues) = &borrissues($borrowernumber);
return(scalar(@result), \@result);
}
-=item allissues
+=head2 allissues
($count, $issues) = &allissues($borrowernumber, $sortkey, $limit);
return($i,\@result);
}
-=item getboracctrecord
+=head2 getboracctrecord
($count, $acctlines, $total) = &getboracctrecord($env, $borrowernumber);
guarantorchild
=cut
+#'
+
sub getguarantordata{
my ($borrowerid)=@_;
my $dbh = C4::Context->dbh;
=head2 getdcity (OUEST-PROVENCE)
recover cityid with city_name condition
=cut
+
sub getidcity {
my ($city_name)=@_;
my $dbh = C4::Context->dbh;
return(\@codes,\%labels);
}
-=item getborrowercategory
+=head2 getborrowercategory
$description = &getborrowercategory($categorycode);
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;