Merge branch 'bug_6506' into 3.14-master
This commit is contained in:
commit
6dd368e2c8
|
|
@ -1967,6 +1967,7 @@ sub MarkIssueReturned {
|
|||
if ( $privacy == 2) {
|
||||
# The default of 0 does not work due to foreign key constraints
|
||||
# The anonymisation will fail quietly if AnonymousPatron is not a valid entry
|
||||
# FIXME the above is unacceptable - bug 9942 relates
|
||||
my $anonymouspatron = (C4::Context->preference('AnonymousPatron')) ? C4::Context->preference('AnonymousPatron') : 0;
|
||||
my $sth_ano = $dbh->prepare("UPDATE old_issues SET borrowernumber=?
|
||||
WHERE borrowernumber = ?
|
||||
|
|
@ -2821,7 +2822,7 @@ sub DeleteTransfer {
|
|||
|
||||
=head2 AnonymiseIssueHistory
|
||||
|
||||
$rows = AnonymiseIssueHistory($date,$borrowernumber)
|
||||
($rows,$err_history_not_deleted) = AnonymiseIssueHistory($date,$borrowernumber)
|
||||
|
||||
This function write NULL instead of C<$borrowernumber> given on input arg into the table issues.
|
||||
if C<$borrowernumber> is not set, it will delete the issue history for all borrower older than C<$date>.
|
||||
|
|
@ -2829,7 +2830,7 @@ if C<$borrowernumber> is not set, it will delete the issue history for all borro
|
|||
If c<$borrowernumber> is set, it will delete issue history for only that borrower, regardless of their opac privacy
|
||||
setting (force delete).
|
||||
|
||||
return the number of affected rows.
|
||||
return the number of affected rows and a value that evaluates to true if an error occurred deleting the history.
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -2856,8 +2857,9 @@ sub AnonymiseIssueHistory {
|
|||
}
|
||||
my $sth = $dbh->prepare($query);
|
||||
$sth->execute(@bind_params);
|
||||
my $anonymisation_err = $dbh->err;
|
||||
my $rows_affected = $sth->rows; ### doublecheck row count return function
|
||||
return $rows_affected;
|
||||
return ($rows_affected, $anonymisation_err);
|
||||
}
|
||||
|
||||
=head2 SendCirculationAlert
|
||||
|
|
|
|||
5
about.pl
5
about.pl
|
|
@ -68,6 +68,10 @@ my $warnPrefBiblioAddsAuthorities = ( $prefAutoCreateAuthorities && ( !$prefBibl
|
|||
my $prefEasyAnalyticalRecords = C4::Context->preference('EasyAnalyticalRecords');
|
||||
my $prefUseControlNumber = C4::Context->preference('UseControlNumber');
|
||||
my $warnPrefEasyAnalyticalRecords = ( $prefEasyAnalyticalRecords && $prefUseControlNumber );
|
||||
my $warnPrefAnonymousPatron = (
|
||||
C4::Context->preference('OPACPrivacy')
|
||||
and not C4::Context->preference('AnonymousPatron')
|
||||
);
|
||||
|
||||
my $errZebraConnection = C4::Context->Zconn("biblioserver",0)->errcode();
|
||||
|
||||
|
|
@ -86,6 +90,7 @@ $template->param(
|
|||
prefAutoCreateAuthorities => $prefAutoCreateAuthorities,
|
||||
warnPrefBiblioAddsAuthorities => $warnPrefBiblioAddsAuthorities,
|
||||
warnPrefEasyAnalyticalRecords => $warnPrefEasyAnalyticalRecords,
|
||||
warnPrefAnonymousPatron => $warnPrefAnonymousPatron,
|
||||
errZebraConnection => $errZebraConnection,
|
||||
warnIsRootUser => $warnIsRootUser,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@
|
|||
<p>Please log in instead with a regular staff account. To create a staff account, create a library, a patron category 'Staff' and add a new patron. Then give this patron permissions from 'More' in the toolbar.</p>
|
||||
[% END %]
|
||||
<h2>Warnings regarding the system configuration</h2>
|
||||
[% IF ( (warnPrefBiblioAddsAuthorities) || warnPrefEasyAnalyticalRecords ) %]
|
||||
[% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatron %]
|
||||
<table>
|
||||
<caption>Preferences</caption>
|
||||
[% IF (warnPrefBiblioAddsAuthorities) %]
|
||||
|
|
@ -113,6 +113,9 @@
|
|||
[% IF (warnPrefEasyAnalyticalRecords) %]
|
||||
<tr><th scope="row"><b>Warning</b> </th><td>System preference 'EasyAnalyticalRecords' set, but UseControlNumber preference is set to 'Use'. Set it to 'Don't use' or else the 'Show analytics' links in the staff client and the OPAC will be broken.</td></tr>
|
||||
[% END %]
|
||||
[% IF warnPrefAnonymousPatron %]
|
||||
<tr><th scope="row"><b>Warning</b> </th><td>System preference 'OPACPrivacy' set, but AnonymousPatron preference is set to '0'. Set it to a valid borrower number if you want that this feature works correctly.</td></tr>
|
||||
[% END %]
|
||||
</table>
|
||||
[% ELSE %]
|
||||
<p>No warnings</p>
|
||||
|
|
|
|||
|
|
@ -13,9 +13,11 @@
|
|||
|
||||
[% IF ( deleted ) %]
|
||||
<div class="dialog message">Your reading history has been deleted.</div>
|
||||
[% ELSIF ( err_history_not_deleted ) %]
|
||||
<div class="dialog alert">The deletion of your reading history failed, because there is a problem with the configuration of this feature. Please help to fix the system by informing your library of this error.</div>
|
||||
[% END %]
|
||||
[% IF ( privacy_updated ) %]
|
||||
<div class="dialog message">Your privacy rules have been updated</div>
|
||||
<div class="dialog message">Your privacy rules have been updated.</div>
|
||||
[% END %]
|
||||
|
||||
<h2>Privacy rule</h2>
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Carp;
|
||||
|
||||
BEGIN {
|
||||
|
||||
|
|
@ -70,7 +71,8 @@ my ($newyear,$newmonth,$newday) = Add_Delta_Days ($year,$month,$day,(-1)*$days);
|
|||
my $formatdate = sprintf "%4d-%02d-%02d",$newyear,$newmonth,$newday;
|
||||
$verbose and print "Checkouts before $formatdate will be anonymised.\n";
|
||||
|
||||
my $rows = AnonymiseIssueHistory($formatdate);
|
||||
my ($rows, $err_history_not_deleted) = AnonymiseIssueHistory($formatdate);
|
||||
carp "Anonymisation of reading history failed." if ($err_history_not_deleted);
|
||||
$verbose and print "$rows checkouts anonymised.\n";
|
||||
|
||||
exit(0);
|
||||
|
|
|
|||
|
|
@ -51,9 +51,14 @@ if ($op eq "update_privacy")
|
|||
if ($op eq "delete_record") {
|
||||
# delete all reading records for items returned
|
||||
# uses a hardcoded date ridiculously far in the future
|
||||
AnonymiseIssueHistory('2999-12-12',$borrowernumber);
|
||||
my ($rows,$err_history_not_deleted) = AnonymiseIssueHistory('2999-12-12',$borrowernumber);
|
||||
# confirm the user the deletion has been done
|
||||
$template->param('deleted' => 1);
|
||||
if ( !$err_history_not_deleted ) {
|
||||
$template->param( 'deleted' => 1 );
|
||||
}
|
||||
else {
|
||||
$template->param( 'err_history_not_deleted' => 1 );
|
||||
}
|
||||
}
|
||||
# get borrower privacy ....
|
||||
my ( $borr ) = GetMemberDetails( $borrowernumber );
|
||||
|
|
|
|||
|
|
@ -145,7 +145,8 @@ if ( $params->{'step3'} ) {
|
|||
|
||||
# Anonymising all members
|
||||
if ($do_anonym) {
|
||||
$totalAno = AnonymiseIssueHistory($filterdate2);
|
||||
#FIXME: anonymisation errors are not handled
|
||||
($totalAno,my $anonymisation_error) = AnonymiseIssueHistory($filterdate2);
|
||||
$template->param(
|
||||
filterdate1 => $filterdate2,
|
||||
do_anonym => '1',
|
||||
|
|
|
|||
Loading…
Reference in New Issue