Clean up before final commits
[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::Acquisition;
10 use C4::Interface::CGI::Output;
11 use C4::Context;
12 use C4::Search;
13 use C4::Serials;
14
15 my $query = new CGI;
16 my $subscriptionid = $query->param('subscriptionid');
17 my $op = $query->param('op');
18 my $searchstring = $query->param('member');
19 my $dbh = C4::Context->dbh;
20
21 my $env;    
22     
23     my ($template, $loggedinuser, $cookie)
24 = get_template_and_user({template_name => "serials/member-search.tmpl",
25                                 query => $query,
26                                 type => "intranet",
27                                 authnotrequired => 0,
28                                 flagsrequired => {catalogue => 1},
29                                 debug => 1,
30                                 });
31
32
33 if($searchstring){
34     my ($count, $members) = &BornameSearch($env, $searchstring, "surname", "advanced");
35     
36     $template->param(
37         subscriptionid => $subscriptionid,
38             memberloop => $members,
39                 member => $searchstring,
40     );
41 } else {
42     $template->param(
43         subscriptionid => $subscriptionid,
44     );
45 }
46         output_html_with_http_headers $query, $cookie, $template->output;