Bugzilla – Attachment 46501 Details for
Bug 15096
Export today's checked in barcodes: Display warning if reading history is set to "never"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15096: Export today's checked in barcodes: Display warning if reading history is set to "never"
Bug-15096-Export-todays-checked-in-barcodes-Displa.patch (text/plain), 5.47 KB, created by
Aleisha Amohia
on 2016-01-11 21:21:27 UTC
(
hide
)
Description:
Bug 15096: Export today's checked in barcodes: Display warning if reading history is set to "never"
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2016-01-11 21:21:27 UTC
Size:
5.47 KB
patch
obsolete
>From ab361f95a27673094668bc811fdb6c1290e61c8f Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Marc=20V=C3=A9ron?= <veron@veron.ch> >Date: Sat, 31 Oct 2015 21:24:44 +0100 >Subject: [PATCH] Bug 15096: Export today's checked in barcodes: Display > warning if reading history is set to "never" > >If a patron's privacy settings are set to "Never" for keeping a reading history, "Export today's checked in barcodes" returns an empty file. > >This patch skips the export if such privacy rule is set and dsiplays a message. > >To test: >- Apply patch >- Search for a user who has privacy rules set to never keeping a circulation history >- Check out / check in in some items >- On users detail page, go to More->Export today's checked in barcodes >- Verify that a message appears about user's privacy settings (in same window) >- Click left tab "Circulation history" >- Verify that the same message appearsar >- Verify the same with the other conditions that prevent the display > of the user's circulation history: > - Syspref 'intranetreadinghistory' is 'Don't allow' > - Patron is 'Anonymous patron' (syspref 'Anonymous patron') >- Search for a user who allows circulation history >- repeat steps above, verify that circulation history appears (if allowed by syspref > 'intranetreadinghistory' and that today's checkouts are exported. > >(Amended for comment #3) > >Signed-off-by: Aleisha <aleishaamohia@hotmail.com> >--- > .../prog/en/includes/members-toolbar.inc | 11 ++++++- > .../prog/en/modules/members/readingrec.tt | 2 ++ > members/readingrec.pl | 34 +++++++++++--------- > 3 files changed, 31 insertions(+), 16 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >index 641bbad..ad7e1ce 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >@@ -117,7 +117,16 @@ function confirm_reregistration() { > } > } > function export_barcodes() { >- window.open('/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% borrowernumber %]&op=export_barcodes'); >+ [% IF ( >+ ( ! Koha.Preference('intranetreadinghistory') ) || >+ ( Koha.Preference('AnonymousPatron') == ( borrowernumber) ) || >+ ( privacy == 2 ) >+ ) >+ %] >+ window.location = '/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% borrowernumber %] ' ; >+ [% ELSE %] >+ window.open('/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% borrowernumber %]&op=export_barcodes'); >+ [% END %] > } > var slip_re = /slip/; > function printx_window(print_type) { >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 6fb109e..e13a0d8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt >@@ -52,6 +52,8 @@ > <div class="dialog alert">Staff members are not allowed to access patron's checkout history</div> > [% ELSIF is_anonymous %] > <div class="dialog alert">This is the anonymous patron, so no circulation history is displayed. To get a list of anonymized loans, please run a report.</div> >+[% ELSIF ( privacy == 2) %] >+ <div class="dialog message">This patron has set the privacy rules to never keeping a circulation history.</div> > [% ELSIF ( !loop_reading ) %] > <div class="dialog message">This patron has no circulation history.</div> > [% ELSE %] >diff --git a/members/readingrec.pl b/members/readingrec.pl >index 20860c2..0ae8808 100755 >--- a/members/readingrec.pl >+++ b/members/readingrec.pl >@@ -75,21 +75,24 @@ my $branches = GetBranches(); > > # barcode export > if ( $op eq 'export_barcodes' ) { >- my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }); >- my @barcodes = >- map { $_->{barcode} } grep { $_->{returndate} =~ m/^$today/o } @{$issues}; >- my $borrowercardnumber = >- GetMember( borrowernumber => $borrowernumber )->{'cardnumber'}; >- my $delimiter = "\n"; >- binmode( STDOUT, ":encoding(UTF-8)" ); >- print $input->header( >- -type => 'application/octet-stream', >- -charset => 'utf-8', >- -attachment => "$today-$borrowercardnumber-checkinexport.txt" >- ); >- my $content = join $delimiter, uniq(@barcodes); >- print $content; >- exit; >+ if ( $data->{'privacy'} < 2) { >+ my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }); >+ my @barcodes = >+ map { $_->{barcode} } grep { $_->{returndate} =~ m/^$today/o } @{$issues}; >+ my $borrowercardnumber = >+ GetMember( borrowernumber => $borrowernumber )->{'cardnumber'}; >+ my $delimiter = "\n"; >+ binmode( STDOUT, ":encoding(UTF-8)" ); >+ print $input->header( >+ -type => 'application/octet-stream', >+ -charset => 'utf-8', >+ -attachment => "$today-$borrowercardnumber-checkinexport.txt" >+ ); >+ >+ my $content = join $delimiter, uniq(@barcodes); >+ print $content; >+ exit; >+ } > } > > if ( $data->{'category_type'} eq 'C') { >@@ -123,6 +126,7 @@ $template->param(%$data); > $template->param( > readingrecordview => 1, > borrowernumber => $borrowernumber, >+ privacy => $data->{'privacy'}, > categoryname => $data->{description}, > roadtype => $roadtype, > is_child => ( $data->{category_type} eq 'C' ), >-- >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 15096
:
44269
|
45508
|
46501
|
46591
|
46628
|
47212