Add call to Bookfund.pm
[koha.git] / serials / member-search.pl
1 #!/usr/bin/perl
2
3 # Member Search.pl script used to search for members to add to a routing list
4 use strict;
5 use CGI;
6 use C4::Koha;
7 use C4::Auth;
8 use C4::Date;
9 use C4::Output;
10 use C4::Acquisition;
11 use C4::Interface::CGI::Output;
12 use C4::Context;
13 use HTML::Template;
14 use C4::Search;
15 use C4::Serials;
16
17 my $query = new CGI;
18 my $subscriptionid = $query->param('subscriptionid');
19 my $op = $query->param('op');
20 my $searchstring = $query->param('member');
21 my $dbh = C4::Context->dbh;
22
23 my $env;    
24     
25     my ($template, $loggedinuser, $cookie)
26 = get_template_and_user({template_name => "serials/member-search.tmpl",
27                                 query => $query,
28                                 type => "intranet",
29                                 authnotrequired => 0,
30                                 flagsrequired => {catalogue => 1},
31                                 debug => 1,
32                                 });
33
34
35 if($searchstring){
36     my ($count, $members) = &BornameSearch($env, $searchstring, "surname", "advanced");
37     
38     $template->param(
39         subscriptionid => $subscriptionid,
40             memberloop => $members,
41                 member => $searchstring,
42     );
43 } else {
44     $template->param(
45         subscriptionid => $subscriptionid,
46     );
47 }
48         output_html_with_http_headers $query, $cookie, $template->output;