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

(-)a/Koha/Patron.pm (-1 / +16 lines)
Lines 39-44 use Koha::Patrons; Link Here
39
use Koha::Virtualshelves;
39
use Koha::Virtualshelves;
40
use Koha::Club::Enrollments;
40
use Koha::Club::Enrollments;
41
use Koha::Account;
41
use Koha::Account;
42
use Koha::Subscription::Routinglists;
42
43
43
use base qw(Koha::Object);
44
use base qw(Koha::Object);
44
45
Lines 571-577 sub old_checkouts { Link Here
571
572
572
my $overdue_items = $patron->get_overdues
573
my $overdue_items = $patron->get_overdues
573
574
574
Return the overdued items
575
Return the overdue items
575
576
576
=cut
577
=cut
577
578
Lines 588-593 sub get_overdues { Link Here
588
    );
589
    );
589
}
590
}
590
591
592
=head3 get_routinglists
593
594
my @routinglists = $patron->get_routinglists
595
596
Returns the routing lists a patron is subscribed to.
597
598
=cut
599
600
sub get_routinglists {
601
    my ($self) = @_;
602
    my @subscribed_routings = Koha::Subscription::Routinglists->search({ borrowernumber => $self->borrowernumber });
603
    return @subscribed_routings;
604
}
605
591
=head3 get_age
606
=head3 get_age
592
607
593
my $age = $patron->get_age
608
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
=head2 Internal methods
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 (+62 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
use Koha::Subscription::Routinglist;
25
26
use base qw(Koha::Objects);
27
28
=head1 NAME
29
30
Koha::Subscription::Routinglists - Koha subscription routing lists object class
31
32
=head1 API
33
34
=head2 Class methods
35
36
=cut
37
38
=head2 Internal methods
39
40
=head3 _type
41
42
=cut
43
44
sub _type {
45
    return 'Subscriptionroutinglist';
46
}
47
48
=head3 object_class
49
50
=cut
51
52
sub object_class {
53
    return 'Koha::Subscription::Routinglist';
54
}
55
56
=head1 AUTHOR
57
58
Katrin Fischer <katrin.fischer@bsz-bw.de>
59
60
=cut
61
62
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
                        <p id="routing-list-intro">You are subscribed to the routing lists for following serial titles. If you wish to make changes, please contact the library.</p>
35
                        <p id="routing-list-intro">You are subscribed to the routing lists for following serial titles. If you wish to make changes, please contact the library.</p>
36
36
37
                        <table class="table table-bordered table-striped" id="routingtable">
37
                        <table class="table table-bordered table-striped" id="routingtable">
Lines 42-52 Link Here
42
                            </thead>
42
                            </thead>
43
43
44
                            <tbody>
44
                            <tbody>
45
                            [% FOREACH subscription IN subscriptionLoop %]
45
                            [% FOREACH routinglist IN routinglists %]
46
                                [% IF ( subscripLoop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
46
                                [% IF ( titles_loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
47
                                    <td>
47
                                    <td>
48
                                        <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% subscription.biblionumber %]">
48
                                        <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% routinglist.subscription.biblio.biblionumber %]">
49
                                            [% subscription.title %]
49
                                            [% routinglist.subscription.biblio.title %]
50
                                        </a>
50
                                        </a>
51
                                    </td>
51
                                    </td>
52
                                </tr>
52
                                </tr>
(-)a/opac/opac-routing-lists.pl (-21 / +3 lines)
Lines 21-29 use CGI qw ( -utf8 ); Link Here
21
use C4::Members;
21
use C4::Members;
22
use C4::Auth;
22
use C4::Auth;
23
use C4::Output;
23
use C4::Output;
24
use C4::Serials;
25
use Koha::Patrons;
24
use Koha::Patrons;
26
use Koha::Subscriptions;
27
25
28
my $query = new CGI;
26
my $query = new CGI;
29
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
27
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
Lines 43-68 $borrower->{description} = $category->description; Link Here
43
$borrower->{category_type} = $category->category_type;
41
$borrower->{category_type} = $category->category_type;
44
$template->param( BORROWER_INFO => $borrower );
42
$template->param( BORROWER_INFO => $borrower );
45
43
46
44
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
45
62
$template->param(
46
$template->param(
63
    countSubscrip => scalar @subscripLoop,
47
    routinglists  => \@routinglists,
64
    subscriptionLoop  => \@subscripLoop,
48
    routinglistview => 1,
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