Line 0
Link Here
|
|
|
1 |
#!/usr/bin/perl |
2 |
|
3 |
# Copyright 2011 BibLibre SARL |
4 |
# This file is part of Koha. |
5 |
# |
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 |
9 |
# version. |
10 |
# |
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. |
14 |
# |
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. |
18 |
|
19 |
=head1 NAME |
20 |
|
21 |
modordernotes.pl |
22 |
|
23 |
=head1 DESCRIPTION |
24 |
|
25 |
Modify just notes when basket is closed. |
26 |
|
27 |
=cut |
28 |
|
29 |
use Modern::Perl; |
30 |
|
31 |
use CGI; |
32 |
use C4::Auth; |
33 |
use C4::Output; |
34 |
use C4::Acquisition; |
35 |
|
36 |
my $input = new CGI; |
37 |
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( { |
38 |
template_name => 'acqui/modordernotes.tmpl', |
39 |
query => $input, |
40 |
type => 'intranet', |
41 |
authnotrequired => 0, |
42 |
flagsrequired => { 'acquisition' => '*' }, |
43 |
debug => 1, |
44 |
} ); |
45 |
|
46 |
my $op = $input->param('op'); |
47 |
my $ordernumber = $input->param('ordernumber'); |
48 |
my $referrer = $input->param('referrer') || $input->referer(); |
49 |
|
50 |
my $order = GetOrder($ordernumber); |
51 |
|
52 |
if($op and $op eq 'save') { |
53 |
my $ordernotes = $input->param('ordernotes'); |
54 |
$order->{'notes'} = $ordernotes; |
55 |
ModOrder($order); |
56 |
} else { |
57 |
$template->param( |
58 |
ordernotes => $order->{'notes'}, |
59 |
); |
60 |
} |
61 |
|
62 |
if($op) { |
63 |
$template->param($op => 1); |
64 |
} |
65 |
|
66 |
$template->param( |
67 |
ordernumber => $ordernumber, |
68 |
referrer => $referrer, |
69 |
); |
70 |
|
71 |
|
72 |
output_html_with_http_headers $input, $cookie, $template->output; |