Bugzilla – Attachment 35875 Details for
Bug 7957
Routing lists: manage several routing list for each subscription, and export them as CSV
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED OFF] Bug 7957: Fix members/routing-lists.pl page
0004-Bug-7957-Fix-members-routing-lists.pl-page.patch (text/plain), 6.09 KB, created by
Paola Rossi
on 2015-02-12 13:49:40 UTC
(
hide
)
Description:
[SIGNED OFF] Bug 7957: Fix members/routing-lists.pl page
Filename:
MIME Type:
Creator:
Paola Rossi
Created:
2015-02-12 13:49:40 UTC
Size:
6.09 KB
patch
obsolete
>From 7613e373ba8d6f810878e9f1a64a50725ded258d Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Thu, 12 Feb 2015 09:06:30 +0100 >Subject: [PATCH 4/4] Bug 7957: Fix members/routing-lists.pl page > > >Signed-off-by: Paola Rossi <paola.rossi@cineca.it> >--- > C4/Serials.pm | 18 ++--- > .../prog/en/modules/members/routing-lists.tt | 75 ++++++++++---------- > members/routing-lists.pl | 16 +---- > 3 files changed, 45 insertions(+), 64 deletions(-) > >diff --git a/C4/Serials.pm b/C4/Serials.pm >index d062167..517de41 100644 >--- a/C4/Serials.pm >+++ b/C4/Serials.pm >@@ -2259,21 +2259,17 @@ sub GetSubscriptionsFromBorrower { > my ($borrowernumber) = @_; > my $dbh = C4::Context->dbh; > my $sth = $dbh->prepare( >- "SELECT subscription.subscriptionid, biblio.title >- FROM subscription >+ "SELECT subscriptionroutinglist.*, biblio.title AS bibliotitle >+ FROM subscriptionroutinglist >+ JOIN subscriptionrouting ON (subscriptionroutinglist.routinglistid = subscriptionrouting.routinglistid) >+ JOIN subscription ON (subscriptionroutinglist.subscriptionid = subscription.subscriptionid) > JOIN biblio ON biblio.biblionumber = subscription.biblionumber >- JOIN subscriptionroutinglist USING (subscriptionid) >- WHERE subscriptionroutinglist.borrowernumber = ? ORDER BY title ASC >+ WHERE subscriptionrouting.borrowernumber = ? ORDER BY title ASC > " > ); > $sth->execute($borrowernumber); >- my @routinglist; >- my $count = 0; >- while ( my $line = $sth->fetchrow_hashref ) { >- $count++; >- push( @routinglist, $line ); >- } >- return ( $count, @routinglist ); >+ my $routinglists = $sth->fetchall_arrayref({}); >+ return $routinglists ? @$routinglists : (); > } > > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/routing-lists.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/routing-lists.tt >index f6f6f92..69e36bc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/routing-lists.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/routing-lists.tt >@@ -21,50 +21,47 @@ > <!-- Search Bar End --> > > <h1> >-[% IF ( countSubscrip ) %] >-[% countSubscrip %] Subscription routing list(s) >+[% IF ( routinglists.size > 0 ) %] >+ [% routinglists.size %] Subscription routing list(s) > [% ELSE %] >-0 Subscription routing lists >+ 0 Subscription routing lists > [% END %] > </h1> > > <div id="subscriptions"> >-[% IF ( subscripLoop ) %] >-<table id="subscriptiont"> >- <thead> >- <tr> >- <th>Subscription title</th> >- <th>Routing list</th> >- </tr> >- </thead> >- <tbody> >-[% FOREACH subscripLoop IN subscripLoop %] >-<tr> >- <td> >- <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscripLoop.subscriptionid %]"><strong> >- [% subscripLoop.title %] >- </strong> >- </a> >- </td> >- <td> >- <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscripLoop.subscriptionid %]"><strong> >- Edit routing list >- </strong> >- </a> >- <input type="hidden" name="biblionumber" value="[% biblionumber %]" /> >- <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" /> >- </td> >- </tr> >- [% END %] >- </tbody> >- </table> >- </form> >- [% ELSE %] >- <p>Patron does not belong to any subscription routing lists.</p> >- <input type="hidden" name="biblionumber" value="[% biblionumber %]" /> >- <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" /> >- [% END %] >- >+ [% IF ( routinglists.size > 0 ) %] >+ <table id="subscriptiont"> >+ <thead> >+ <tr> >+ <th>Subscription title</th> >+ <th>Routing list</th> >+ <th>Actions</th> >+ </tr> >+ </thead> >+ <tbody> >+ [% FOREACH routinglist IN routinglists %] >+ <tr> >+ <td> >+ <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% routinglist.subscriptionid %]"> >+ <strong> >+ [% routinglist.bibliotitle %] >+ </strong> >+ </a> >+ </td> >+ <td>[% routinglist.title %]</td> >+ <td> >+ <a href="/cgi-bin/koha/serials/routinglist.pl?routinglistid=[% routinglist.routinglistid %]"><strong> >+ Edit routing list >+ </strong> >+ </a> >+ </td> >+ </tr> >+ [% END %] >+ </tbody> >+ </table> >+ [% ELSE %] >+ <p>Patron does not belong to any subscription routing lists.</p> >+ [% END %] > </div> > > >diff --git a/members/routing-lists.pl b/members/routing-lists.pl >index efd067e..5cd65b2 100755 >--- a/members/routing-lists.pl >+++ b/members/routing-lists.pl >@@ -76,22 +76,10 @@ if ($borrowernumber) { > > if ($borrowernumber) { > # new op dev >- 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'}; >- push( @subscripLoop, \%getSubscrip ); >- } >+ my @routinglists = GetSubscriptionsFromBorrower($borrowernumber ); > > $template->param( >- countSubscrip => scalar @subscripLoop, >- subscripLoop => \@subscripLoop, >+ routinglists => \@routinglists, > routinglistview => 1 > ); > >-- >1.7.10.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 7957
:
9259
|
10973
|
13217
|
16614
|
21340
|
22726
|
35709
|
35801
|
35802
|
35803
|
35804
|
35842
|
35860
|
35872
|
35873
|
35874
|
35875
|
38425
|
41762
|
41763
|
41764
|
42427
|
42428
|
42429
|
47633
|
47634
|
47635
|
47659
|
47660
|
47661
|
47662
|
47663
|
47664
|
50226
|
50227
|
50228
|
50265
|
50266
|
50270
|
50273
|
97519
|
97520
|
97521
|
97522
|
97523
|
97524