8 use C4::Interface::CGI::Output;
17 my $op = $query->param('op');
18 my $dbh = C4::Context->dbh;
21 my ($template, $loggedinuser, $cookie);
22 my $externalid = $query->param('externalid');
23 my $alerttype = $query->param('alerttype');
24 my $biblionumber = $query->param('biblionumber');
26 ($template, $loggedinuser, $cookie)
27 = get_template_and_user({template_name => "opac-alert-subscribe.tmpl",
34 if ($op eq 'alert_confirmed') {
35 addalert($loggedinuser,$alerttype,$externalid);
36 if ($alerttype eq 'issue') {
37 print $query->redirect("opac-serial-issues.pl?biblionumber=$biblionumber");
40 } elsif ($op eq 'cancel_confirmed') {
41 my $alerts =getalert($loggedinuser,$alerttype,$externalid);
42 foreach (@$alerts) { # we are supposed to have only 1 result, but just in case...
43 delalert($_->{alertid});
45 if ($alerttype eq 'issue') {
46 print $query->redirect("opac-serial-issues.pl?biblionumber=$biblionumber");
51 if ($alerttype eq 'issue') { # alert for subscription issues
52 my $subscription = &getsubscription($externalid);
53 $template->param("typeissue$op" => 1,
54 bibliotitle => $subscription->{bibliotitle},
55 notes => $subscription->{notes},
56 externalid => $externalid,
57 biblionumber => $biblionumber,
63 output_html_with_http_headers $query, $cookie, $template->output;