3 # Copyright 2011 BibLibre SARL
4 # This file is part of Koha.
6 # Koha is free software; you can redistribute it and/or modify it under the
7 # terms of the GNU General Public License as published by the Free Software
8 # Foundation; either version 2 of the License, or (at your option) any later
11 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
12 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License along
16 # with Koha; if not, write to the Free Software Foundation, Inc.,
17 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 subscription-history.pl
25 Modify subscription history
36 use C4::Dates qw(format_date_in_iso);
40 my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
41 template_name => 'serials/subscription-history.tt',
45 flagsrequired => { 'serials' => 'edit_subscription' },
49 my $subscriptionid = $input->param('subscriptionid');
50 my $op = $input->param('op');
52 if(!defined $subscriptionid || $subscriptionid eq '') {
53 print $input->redirect('/cgi-bin/koha/serials/serials-home.pl');
57 if($op && $op eq 'mod') {
58 my $histstartdate = $input->param('histstartdate');
59 my $histenddate = $input->param('histenddate');
60 my $receivedlist = $input->param('receivedlist');
61 my $missinglist = $input->param('missinglist');
62 my $opacnote = $input->param('opacnote');
63 my $librariannote = $input->param('librariannote');
65 ModSubscriptionHistory( $subscriptionid, format_date_in_iso($histstartdate),
66 format_date_in_iso($histenddate), $receivedlist, $missinglist, $opacnote,
69 print $input->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid");
72 my $history = GetSubscriptionHistoryFromSubscriptionId($subscriptionid);
73 my (undef, $biblio) = GetBiblio($history->{'biblionumber'});
76 subscriptionid => $subscriptionid,
77 title => $biblio->{'title'},
78 histstartdate => $history->{'histstartdate'},
79 histenddate => $history->{'histenddate'},
80 receivedlist => $history->{'recievedlist'},
81 missinglist => $history->{'missinglist'},
82 opacnote => $history->{'opacnote'},
83 librariannote => $history->{'librariannote'},
86 output_html_with_http_headers $input, $cookie, $template->output;