Bugzilla – Attachment 22931 Details for
Bug 11009
Do not allow reading records of anonymous patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 11009 - Do not allow reading records of anonymous patron
SIGNED-OFF-Bug-11009---Do-not-allow-reading-record.patch (text/plain), 3.20 KB, created by
Owen Leonard
on 2013-11-14 14:16:54 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 11009 - Do not allow reading records of anonymous patron
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2013-11-14 14:16:54 UTC
Size:
3.20 KB
patch
obsolete
>From c5dc7e7c302f231404f359f37b613c568e6c6caf Mon Sep 17 00:00:00 2001 >From: Fridolyn SOMERS <fridolyn.somers@biblibre.com> >Date: Tue, 8 Oct 2013 09:34:42 +0200 >Subject: [PATCH] [SIGNED-OFF] Bug 11009 - Do not allow reading records of > anonymous patron >Content-Type: text/plain; charset="utf-8" > >When using an anonymous patron to anonymise issues history, this patron >may have a huge number of old issues. In this case, trying to display >the reading history of this patron will perform a huge SQL query. >It is not usefull to have the reading history of this anonymous patron. > >This patch adds an alert instead of old issues when displaying reading >records of anonymous patron. > >Test plan : >- Set syspref AnonymousPatron to 0. >- Select a borrower with old issues. For example 123. >- Look at its reading records page : members/readingrec.pl >=> Old issues are displayed in a datatable >- Set syspref AnonymousPatron with this borrower number. For example 123. >- Look at its reading records page >=> Old issues are not displayed and an alert is displayed >- Using SQL query, remove old issues of this borrower : DELETE FROM old_issues WHERE borrowernumber=123. >- Look at its reading records page >=> A message is displayed > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >This works as advertised and seems like a reasonable thing to do. I >suspect that someone will object... Perhaps that person will implement a >solution which uses an AJAX DataTable. >--- > .../prog/en/modules/members/readingrec.tt | 9 ++++++--- > members/readingrec.pl | 8 +++++++- > 2 files changed, 13 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt >index f36e254..47ed060 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt >@@ -46,7 +46,12 @@ > <div class="yui-b"> > [% INCLUDE 'members-toolbar.inc' %] > <h1>Circulation history</h1> >-[% IF loop_reading %] >+ >+[% IF is_anonymous %] >+ <div class="dialog alert">This is the anonymous patron.</div> >+[% ELSIF ( !loop_reading ) %] >+ <div class="dialog message">This patron has no circulation history.</div> >+[% ELSE %] > <form action="/cgi-bin/koha/members/readingrec.pl" method="get"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber %]" /></form> > > >@@ -101,8 +106,6 @@ > </tr> > [% END %] > </table> >-[% ELSE %] >-<div class="dialog message">This patron has no circulation history.</div> > [% END %] > </div> > </div> >diff --git a/members/readingrec.pl b/members/readingrec.pl >index 0f0c3df..2a57c42 100755 >--- a/members/readingrec.pl >+++ b/members/readingrec.pl >@@ -63,7 +63,13 @@ if ($input->param('borrowernumber')) { > > my $order = 'date_due desc'; > my $limit = 0; >-my $issues = GetAllIssues($borrowernumber,$order,$limit); >+my $issues = (); >+# Do not request the old issues of anonymous patron >+if ( $borrowernumber == C4::Context->preference('AnonymousPatron') ){ >+ $template->param( is_anonymous => 1 ); >+} else { >+ $issues = GetAllIssues($borrowernumber,$order,$limit); >+} > > my $branches = GetBranches(); > foreach my $issue ( @{$issues} ) { >-- >1.7.9.5
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 11009
:
21896
|
21898
| 22931 |
22977