Koha/misc
Jonathan Druart 286be46e8a Bug 16966: Koha::Patrons - Move GetBorrowersWithIssuesHistoryOlderThan to search_patrons_to_anonymise
The C4::Members::GetBorrowersWithIssuesHistoryOlderThan subroutine is supposed
to return the patrons with an issue history older than a given date.

It would make more sense to return a list of Koha::Patrons.

On the way, the code from AnonymiseIssueHistory will be moved as well to
anonymise_issue_history.

Note that these 2 subroutines are strongly linked: one is used to know the
number of patrons we will anonymise the history, the other one is used to
anonymise the issues history. The problem is that the first one is not used to
do the action, but only for displayed purpose.

In some cases, these 2 values can differ, which could be confusing.
Case 1:
The logged in librarian is not superlibrarian and IndependentBranches is set:
if 2+ patrons from different libraries match the date parameter, the interface
will display "Checkout history for 2 patrons will be anonymized", when actually
only 1 will be.
Case 2:
If 2+ patrons match the date parameter but one of them has his privacy set to
forever (privacy=0), the same issue will appear.

This patch moves the code from C4::Members::GetBorrowersWithIssuesHistoryOlderThan
to Koha::Patrons->search_patrons_to_anonymise and from
C4::Circulation::AnonymiseIssueHistory to
Koha::Patrons->anonymise_issue_history

Test plan:
1/ Confirm the 2 issues and make sure they are fixed using the Batch
patron anonymization tool (tools/cleanborrowers.pl)
2/ At the OPAC, use the 'Immediate deletion' button to delete all your
reading history (regardless the setting of the privacy rule)
3/ Use the cronjob script (misc/cronjobs/batch_anonymise.pl) to
anonymise patrons.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-03-03 17:20:03 +00:00
..
admin
bin
cronjobs Bug 16966: Koha::Patrons - Move GetBorrowersWithIssuesHistoryOlderThan to search_patrons_to_anonymise 2017-03-03 17:20:03 +00:00
devel
interface_customization Bug 17645 - Remove obsolete interface customization images 2016-11-18 14:16:08 +00:00
load_testing
maintenance Bug 17196: Update POD of sanitise_records.pl 2017-01-13 13:49:28 +00:00
migration_tools Bug 17935: Adjust some POD lines, fix a few typos 2017-02-14 14:12:50 +00:00
plack
release_notes Bug 17681: Exiisting typos might thow some feees when recieved 2016-12-16 11:29:33 +00:00
search_tools
translator Translations update for 16.11.0 2016-11-20 20:55:51 -03:00
batchCompareMARCvsFrameworks.pl
batchdeletebiblios.pl
batchDeleteUnusedSubfields.pl
batchImportMARCWithBiblionumbers.pl
batchRebuildBiblioTables.pl
batchRebuildItemsTables.pl Bug 17447: %opt is unused 2017-01-13 11:37:01 +00:00
batchRepairMissingBiblionumbers.pl
check_sysprefs.pl
commit_file.pl
export_borrowers.pl Bug 17578: GetMemberDetails - Remove GetMemberDetails 2016-12-16 13:12:44 +00:00
export_records.pl
exportauth.pl
koha-install-log
kohalib.pl
link_bibs_to_authorities.pl
mod_zebraqueue.pl
perlmodule_ls.pl
perlmodule_rm.pl
recreateIssueStatistics.pl
sax_parser_print.pl Bug 17626 (QA followup) 2016-11-22 11:29:07 +00:00
sax_parser_test.pl
sip_cli_emulator.pl
stage_file.pl