3 # Copyright 2012 BibLibre
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
17 # with Koha; if not, write to the Free Software Foundation, Inc.,
18 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 use C4
::Bookseller qw
/GetBookSellerFromId/;
31 my $title = $query->param('title_filter');
32 my $ISSN = $query->param('ISSN_filter');
33 my $EAN = $query->param('EAN_filter');
34 my $publisher = $query->param('publisher_filter');
35 my $supplier = $query->param('supplier_filter');
36 my $branch = $query->param('branch_filter');
37 my $routing = $query->param('routing') || C4
::Context
->preference("RoutingSerials");
38 my $searched = $query->param('searched');
39 my $biblionumber = $query->param('biblionumber');
41 my $basketno = $query->param('basketno');
42 my $booksellerid = $query->param('booksellerid');
44 my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user
(
45 { template_name
=> "acqui/newordersubscription.tt",
49 flagsrequired
=> { acquisition
=> 'order_manage' },
53 my $basket = GetBasket
($basketno);
54 $booksellerid = $basket->{booksellerid
} unless $booksellerid;
55 my ($bookseller) = GetBookSellerFromId
($booksellerid);
59 @subscriptions = SearchSubscriptions
({
63 publisher
=> $publisher,
64 bookseller
=> $supplier,
69 foreach my $sub (@subscriptions) {
70 $sub->{alreadyOnOrder
} = subscriptionCurrentlyOnOrder
$sub->{subscriptionid
};
72 # to toggle between create or edit routing list options
74 $sub->{routingedit
} = check_routing
( $sub->{subscriptionid
} );
78 my $branches = GetBranches
();
80 foreach (sort keys %$branches){
82 $selected = 1 if defined $branch && $branch eq $_;
83 push @branches_loop, {
85 branchname
=> $branches->{$_}->{branchname
},
86 selected
=> $selected,
91 subs_loop
=> \
@subscriptions,
92 title_filter
=> $title,
95 publisher_filter
=> $publisher,
96 supplier_filter
=> $supplier,
97 branch_filter
=> $branch,
98 branches_loop
=> \
@branches_loop,
99 done_searched
=> $searched,
101 booksellerid
=> $booksellerid,
102 basketno
=> $basket->{basketno
},
103 basketname
=> $basket->{basketname
},
104 booksellername
=> $bookseller->{name
},
106 output_html_with_http_headers
$query, $cookie, $template->output;