Line 0
Link Here
|
0 |
- |
1 |
#!/usr/bin/perl |
|
|
2 |
|
3 |
# This file is part of Koha. |
4 |
# |
5 |
# Koha is free software; you can redistribute it and/or modify it |
6 |
# under the terms of the GNU General Public License as published by |
7 |
# the Free Software Foundation; either version 3 of the License, or |
8 |
# (at your option) any later version. |
9 |
# |
10 |
# Koha is distributed in the hope that it will be useful, but |
11 |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
12 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 |
# GNU General Public License for more details. |
14 |
# |
15 |
# You should have received a copy of the GNU General Public License |
16 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
17 |
|
18 |
|
19 |
use Modern::Perl; |
20 |
use CGI qw ( -utf8 ); |
21 |
use C4::Members; |
22 |
use C4::Auth; |
23 |
use C4::Output; |
24 |
use C4::Serials; |
25 |
use Koha::Patrons; |
26 |
use Koha::Subscriptions; |
27 |
|
28 |
my $query = new CGI; |
29 |
my ( $template, $borrowernumber, $cookie ) = get_template_and_user( |
30 |
{ |
31 |
template_name => "opac-routing-lists.tt", |
32 |
query => $query, |
33 |
type => "opac", |
34 |
authnotrequired => 0, |
35 |
debug => 1, |
36 |
} |
37 |
); |
38 |
|
39 |
my $patron = Koha::Patrons->find( $borrowernumber ); |
40 |
my $category = $patron->category; |
41 |
my $borrower= $patron->unblessed; |
42 |
$borrower->{description} = $category->description; |
43 |
$borrower->{category_type} = $category->category_type; |
44 |
$template->param( BORROWER_INFO => $borrower ); |
45 |
|
46 |
|
47 |
my $count; |
48 |
my @borrowerSubscriptions; |
49 |
($count, @borrowerSubscriptions) = GetSubscriptionsFromBorrower($borrowernumber ); |
50 |
my @subscripLoop; |
51 |
|
52 |
foreach my $num_res (@borrowerSubscriptions) { |
53 |
my %getSubscrip; |
54 |
$getSubscrip{subscriptionid} = $num_res->{'subscriptionid'}; |
55 |
$getSubscrip{title} = $num_res->{'title'}; |
56 |
$getSubscrip{borrowernumber} = $num_res->{'borrowernumber'}; |
57 |
my $subscription = Koha::Subscriptions->find( $num_res->{'subscriptionid'} ); |
58 |
$getSubscrip{biblionumber} = $subscription->biblionumber(); |
59 |
push( @subscripLoop, \%getSubscrip ); |
60 |
} |
61 |
|
62 |
$template->param( |
63 |
countSubscrip => scalar @subscripLoop, |
64 |
subscriptionLoop => \@subscripLoop, |
65 |
routinglistview => 1 |
66 |
); |
67 |
|
68 |
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 }; |