View | Details | Raw Unified | Return to bug 20400
Collapse All | Expand All

(-)a/Koha/Patron.pm (-1 / +19 lines)
Lines 38-43 use Koha::Patrons; Link Here
38
use Koha::Virtualshelves;
38
use Koha::Virtualshelves;
39
use Koha::Club::Enrollments;
39
use Koha::Club::Enrollments;
40
use Koha::Account;
40
use Koha::Account;
41
use Koha::Subscription::Routinglists;
41
42
42
use base qw(Koha::Object);
43
use base qw(Koha::Object);
43
44
Lines 539-545 sub old_checkouts { Link Here
539
540
540
my $overdue_items = $patron->get_overdues
541
my $overdue_items = $patron->get_overdues
541
542
542
Return the overdued items
543
Return the overdue items
543
544
544
=cut
545
=cut
545
546
Lines 556-561 sub get_overdues { Link Here
556
    );
557
    );
557
}
558
}
558
559
560
=cut
561
562
=head3 get_routinglists
563
564
my @routinglists = $patron->get_routinglists
565
566
Returns the routing lists a patron is subscribed to.
567
568
=cut
569
570
sub get_routinglists {
571
    my ($self) = @_;
572
    my @titles;
573
    my @subscribed_routings = Koha::Subscription::Routinglists->search({ borrowernumber => $self->borrowernumber });
574
    return @subscribed_routings;
575
}
576
559
=head3 get_age
577
=head3 get_age
560
578
561
my $age = $patron->get_age
579
my $age = $patron->get_age
(-)a/Koha/Subscription/Routinglist.pm (+67 lines)
Line 0 Link Here
1
package Koha::Subscription::Routinglist;
2
3
#
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 3 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
use Modern::Perl;
20
21
use Carp;
22
23
use Koha::Database;
24
use Koha::Subscriptions;
25
26
use base qw(Koha::Object);
27
28
=head1 NAME
29
30
Koha::Subscription::Routinglist - Koha subscription routing list object class
31
32
=head1 API
33
34
=head2 Class Methods
35
36
=cut
37
38
=head3 subscription
39
40
my $subscription = $routinglist->subscription
41
42
Returns the subscription for a routing list.
43
44
=cut
45
46
sub subscription {
47
    my ( $self ) = @_;
48
    return scalar Koha::Subscriptions->find( $self->subscriptionid ); 
49
}
50
51
=cut
52
53
=head3 type
54
55
=cut
56
57
sub _type {
58
    return 'Subscriptionroutinglist';
59
}
60
61
=head1 AUTHOR
62
63
Katrin Fischer <katrin.fischer@bsz-bw.de>
64
65
=cut
66
67
1;
(-)a/Koha/Subscription/Routinglists.pm (+57 lines)
Line 0 Link Here
1
package Koha::Subscription::Routinglists;
2
3
#
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 3 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
use Modern::Perl;
20
21
use Carp;
22
23
use Koha::Database;
24
25
use Koha::Subscription::Routinglist;
26
27
use base qw(Koha::Objects);
28
29
=head1 NAME
30
31
Koha::Subscription::Routinglists - Koha subscription routing lists object class
32
33
=head1 API
34
35
=head2 Class Methods
36
37
=cut
38
39
=head3 type
40
41
=cut
42
43
sub _type {
44
    return 'Subscriptionroutinglist';
45
}
46
47
sub object_class {
48
    return 'Koha::Subscription::Routinglist';
49
}
50
51
=head1 AUTHOR
52
53
Katrin Fischer <katrin.fischer@bsz-bw.de>
54
55
=cut
56
57
1;
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-routing-lists.tt (-5 / +5 lines)
Lines 31-37 Link Here
31
31
32
                    <h3>Routing lists</h3>
32
                    <h3>Routing lists</h3>
33
33
34
                    [% IF ( subscriptionLoop ) %]
34
                    [% IF ( routinglists ) %]
35
                        <table class="table table-bordered table-striped" id="finestable">
35
                        <table class="table table-bordered table-striped" id="finestable">
36
                            <thead>
36
                            <thead>
37
                                <tr>
37
                                <tr>
Lines 40-50 Link Here
40
                            </thead>
40
                            </thead>
41
41
42
                            <tbody>
42
                            <tbody>
43
                            [% FOREACH subscription IN subscriptionLoop %]
43
                            [% FOREACH routinglist IN routinglists %]
44
                                [% IF ( subscripLoop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
44
                                [% IF ( titles_loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
45
                                    <td>
45
                                    <td>
46
                                        <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% subscription.biblionumber %]">
46
                                        <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% routinglist.subscription.biblio.biblionumber %]">
47
                                            [% subscription.title %]
47
                                            [% routinglist.subscription.biblio.title %]
48
                                        </a>
48
                                        </a>
49
                                    </td>
49
                                    </td>
50
                                </tr>
50
                                </tr>
(-)a/opac/opac-routing-lists.pl (-20 / +2 lines)
Lines 23-29 use C4::Auth; Link Here
23
use C4::Output;
23
use C4::Output;
24
use C4::Serials;
24
use C4::Serials;
25
use Koha::Patrons;
25
use Koha::Patrons;
26
use Koha::Subscriptions;
27
26
28
my $query = new CGI;
27
my $query = new CGI;
29
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
28
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
Lines 43-68 $borrower->{description} = $category->description; Link Here
43
$borrower->{category_type} = $category->category_type;
42
$borrower->{category_type} = $category->category_type;
44
$template->param( BORROWER_INFO => $borrower );
43
$template->param( BORROWER_INFO => $borrower );
45
44
46
45
my @routinglists = $patron->get_routinglists();
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
46
62
$template->param(
47
$template->param(
63
    countSubscrip => scalar @subscripLoop,
48
    routinglists  => \@routinglists,
64
    subscriptionLoop  => \@subscripLoop,
65
    routinglistview => 1
66
);
49
);
67
50
68
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
51
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
69
- 

Return to bug 20400