Bugzilla – Attachment 72973 Details for
Bug 20400
Add routing list tab to the patron account in OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20400: Add routing list tab in OPAC
Bug-20400-Add-routing-list-tab-in-OPAC.patch (text/plain), 7.48 KB, created by
Katrin Fischer
on 2018-03-15 15:34:51 UTC
(
hide
)
Description:
Bug 20400: Add routing list tab in OPAC
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2018-03-15 15:34:51 UTC
Size:
7.48 KB
patch
obsolete
>From 7307f63f4670bab9c03f8e49ce4815ac89b5eb36 Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <katrin.fischer.83@web.de> >Date: Thu, 15 Mar 2018 08:40:12 +0000 >Subject: [PATCH] Bug 20400: Add routing list tab in OPAC > >This patch adds the base for the new feature: >A list of the routling lists a patron appears on in the OPAC. > >To test: >- Make sure RoutingSerials is not activated >- Check patron account in OPAC - no tab should appear >- Turn the preference on - the tab should appear now >- Add some subscriptions and add your patron to the routing list >- Check tab again - it should now show a list of the serials with > links to the detail page in the OPAC >--- > .../opac-tmpl/bootstrap/en/includes/usermenu.inc | 9 +++ > .../bootstrap/en/modules/opac-routing-lists.tt | 68 ++++++++++++++++++++++ > opac/opac-routing-lists.pl | 68 ++++++++++++++++++++++ > 3 files changed, 145 insertions(+) > create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-routing-lists.tt > create mode 100644 opac/opac-routing-lists.pl > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc >index 7d27f22..173be1f 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc >@@ -96,6 +96,15 @@ > <a href="/cgi-bin/koha/opac-shelves.pl?op=list&category=1">your lists</a></li> > [% END %] > >+ [% IF Koha.Preference( 'RoutingSerials' ) == 1 %] >+ [% IF ( suggestionsview ) %] >+ <li class="active"> >+ [% ELSE %] >+ <li> >+ [% END %] >+ <a href="/cgi-bin/koha/opac-routing-lists.pl">your routing lists</a></li> >+ [% END %] >+ > [% IF Koha.Preference( 'useDischarge' ) == 1 %] > [% IF ( dischargeview ) %] > <li class="active"> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-routing-lists.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-routing-lists.tt >new file mode 100644 >index 0000000..fa791a6 >--- /dev/null >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-routing-lists.tt >@@ -0,0 +1,68 @@ >+[% USE Koha %] >+[% USE KohaDates %] >+[% INCLUDE 'doc-head-open.inc' %] >+<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Your routing lists</title> >+[% INCLUDE 'doc-head-close.inc' %] >+[% BLOCK cssinclude %] >+ <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" /> >+[% END %] >+</head> >+ >+[% INCLUDE 'bodytag.inc' bodyid='opac-account' bodyclass='scrollto' %] >+[% INCLUDE 'masthead.inc' %] >+ >+<div class="main"> >+ <ul class="breadcrumb"> >+ <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li> >+ <li><a href="/cgi-bin/koha/opac-routing-lists.pl">[% INCLUDE 'patron-title.inc' category_type = BORROWER_INFO.category_type firstname = BORROWER_INFO.firstname surname = BORROWER_INFO.surname othernames = BORROWER_INFO.othernames cardnumber = BORROWER_INFO.cardnumber %]</a> <span class="divider">›</span></li> >+ <li><a href="#">Your routing lists</a></li> >+ </ul> >+ >+ <div class="container-fluid"> >+ <div class="row-fluid"> >+ <div class="span2"> >+ <div id="navigation"> >+ [% INCLUDE 'navigation.inc' IsPatronPage=1 %] >+ </div> >+ </div> >+ <div class="span10"> >+ <div id="user-routing-lists" class="maincontent"> >+ >+ >+ <h3>Routing lists</h3> >+ >+ [% IF ( subscriptionLoop ) %] >+ <table class="table table-bordered table-striped" id="finestable"> >+ <thead> >+ <tr> >+ <th>Subscription title</th> >+ </tr> >+ </thead> >+ >+ <tbody> >+ [% FOREACH subscription IN subscriptionLoop %] >+ [% IF ( subscripLoop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %] >+ <td> >+ <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% subscription.biblionumber %]"> >+ [% subscription.title %] >+ </a> >+ </td> >+ </tr> >+ [% END %] >+ </tbody> >+ </table> >+ [% ELSE %] >+ <p>You are currently not listed on any routing lists.</p> >+ [% END %] >+ </div> >+ </div> <!-- / .span10 --> >+ </div> <!-- / .row-fluid --> >+ </div> <!-- / .container-fluid --> >+</div> <!-- / .main --> >+ >+[% INCLUDE 'opac-bottom.inc' %] >+[% BLOCK jsinclude %] >+[% INCLUDE 'datatables.inc' %] >+<script type="text/javascript"> >+</script> >+[% END %] >diff --git a/opac/opac-routing-lists.pl b/opac/opac-routing-lists.pl >new file mode 100644 >index 0000000..55e3878 >--- /dev/null >+++ b/opac/opac-routing-lists.pl >@@ -0,0 +1,68 @@ >+#!/usr/bin/perl >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+ >+use Modern::Perl; >+use CGI qw ( -utf8 ); >+use C4::Members; >+use C4::Auth; >+use C4::Output; >+use C4::Serials; >+use Koha::Patrons; >+use Koha::Subscriptions; >+ >+my $query = new CGI; >+my ( $template, $borrowernumber, $cookie ) = get_template_and_user( >+ { >+ template_name => "opac-routing-lists.tt", >+ query => $query, >+ type => "opac", >+ authnotrequired => 0, >+ debug => 1, >+ } >+); >+ >+my $patron = Koha::Patrons->find( $borrowernumber ); >+my $category = $patron->category; >+my $borrower= $patron->unblessed; >+$borrower->{description} = $category->description; >+$borrower->{category_type} = $category->category_type; >+$template->param( BORROWER_INFO => $borrower ); >+ >+ >+my $count; >+my @borrowerSubscriptions; >+($count, @borrowerSubscriptions) = GetSubscriptionsFromBorrower($borrowernumber ); >+my @subscripLoop; >+ >+foreach my $num_res (@borrowerSubscriptions) { >+ my %getSubscrip; >+ $getSubscrip{subscriptionid} = $num_res->{'subscriptionid'}; >+ $getSubscrip{title} = $num_res->{'title'}; >+ $getSubscrip{borrowernumber} = $num_res->{'borrowernumber'}; >+ my $subscription = Koha::Subscriptions->find( $num_res->{'subscriptionid'} ); >+ $getSubscrip{biblionumber} = $subscription->biblionumber(); >+ push( @subscripLoop, \%getSubscrip ); >+} >+ >+$template->param( >+ countSubscrip => scalar @subscripLoop, >+ subscriptionLoop => \@subscripLoop, >+ routinglistview => 1 >+); >+ >+output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 }; >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20400
:
72973
|
72974
|
73115
|
73116
|
73117
|
73118
|
73121
|
73122
|
73123
|
73124
|
74291
|
74292
|
74293
|
74294
|
74295
|
74296
|
74297
|
74298
|
74299
|
74300
|
74402
|
74588
|
74589
|
74590
|
74592
|
74593
|
74632
|
74633
|
74634
|
74635
|
74636
|
74637
|
74662
|
74664
|
74666