3 # Copyright 2000-2002 Katipo Communications
5 # This file is part of Koha.
7 # Koha is free software; you can redistribute it and/or modify it under the
8 # terms of the GNU General Public License as published by the Free Software
9 # Foundation; either version 2 of the License, or (at your option) any later
12 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License along with
17 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
18 # Suite 330, Boston, MA 02111-1307 USA
27 this script is launched as a popup. It allows to choose for who the subscription can be distributed.
34 to filter on the members.
37 to know if there are already some members to in the distributed list
40 to know what subscription this scrpit have to distribute.
60 my $searchfield=$input->param('searchfield');
61 defined $searchfield or $searchfield='';
62 my $distributedto=$input->param('distributedto');
63 my $subscriptionid = $input->param('subscriptionid');
64 $searchfield=~ s/\,//g;
65 my $SaveList=$input->param('SaveList');
66 my $dbh = C4
::Context
->dbh;
68 $distributedto = GetDistributedTo
($subscriptionid) unless $distributedto;
70 SetDistributedto
($distributedto,$subscriptionid) if ($SaveList) ;
72 my ($template, $borrowernumber, $cookie)
73 = get_template_and_user
({template_name
=> "serials/distributedto.tmpl",
77 flagsrequired
=> {serials
=> 1},
81 my ($count,$results)=SearchMember
($searchfield,"firstname","simple",) if $searchfield;
84 for (my $i=0; $i < $count; $i++){
91 $row_data{toggle
} = $toggle;
92 $row_data{firstname
} = $results->[$i]{'firstname'};
93 $row_data{surname
} = $results->[$i]{'surname'};
94 push(@loop_data, \
%row_data);
96 $template->param(borlist
=> \
@loop_data,
97 searchfield
=> $searchfield,
98 distributedto
=> $distributedto,
99 SaveList
=> $SaveList,
100 subscriptionid
=> $subscriptionid,
102 output_html_with_http_headers
$input, $cookie, $template->output;