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 use C4::Interface::CGI::Output;
36 my $op = $query->param('op');
37 my $dbh = C4::Context->dbh;
40 my ($template, $loggedinuser, $cookie);
41 my $externalid = $query->param('externalid');
42 my $alerttype = $query->param('alerttype');
43 my $biblionumber = $query->param('biblionumber');
45 ($template, $loggedinuser, $cookie)
46 = get_template_and_user({template_name => "opac-alert-subscribe.tmpl",
53 if ($op eq 'alert_confirmed') {
54 addalert($loggedinuser,$alerttype,$externalid);
55 if ($alerttype eq 'issue') {
56 print $query->redirect("opac-serial-issues.pl?biblionumber=$biblionumber");
59 } elsif ($op eq 'cancel_confirmed') {
60 my $alerts =getalert($loggedinuser,$alerttype,$externalid);
61 foreach (@$alerts) { # we are supposed to have only 1 result, but just in case...
62 delalert($_->{alertid});
64 if ($alerttype eq 'issue') {
65 print $query->redirect("opac-serial-issues.pl?biblionumber=$biblionumber");
70 if ($alerttype eq 'issue') { # alert for subscription issues
71 my $subscription = &GetSubscription($externalid);
72 $template->param("typeissue$op" => 1,
73 bibliotitle => $subscription->{bibliotitle},
74 notes => $subscription->{notes},
75 externalid => $externalid,
76 biblionumber => $biblionumber,
82 output_html_with_http_headers $query, $cookie, $template->output;