Bug 37418 - Expand delete_patron.pl / Patrons with defined restrictions should not be deleted
Summary: Expand delete_patron.pl / Patrons with defined restrictions should not be del...
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Raphael Straub
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-22 08:13 UTC by Michaela Sieber
Modified: 2024-08-23 15:00 UTC (History)
4 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 37418: delete_patrons.pl: Exclude patrons with restrictions (6.57 KB, patch)
2024-07-26 10:28 UTC, Raphael Straub
Details | Diff | Splinter Review
Bug 37418: delete_patrons.pl: Exclude patrons with restrictions (6.62 KB, patch)
2024-07-30 21:43 UTC, Roman Dolny
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Michaela Sieber 2024-07-22 08:13:17 UTC
In some cases we don't want borrowers / patrons not to be deleted if they have certain restrictions.
Therefor we add a new parameter to the cronjob delete_patrons.pl
(see manual  
https://koha-community.org/manual/latest/en/html/cron_jobs.html#batch-delete-patrons )
Comment 1 Raphael Straub 2024-07-26 10:28:09 UTC
Created attachment 169688 [details] [review]
Bug 37418: delete_patrons.pl: Exclude patrons with restrictions

Add the option "--without_restriction_type" so that delete_patrons.pl
does not delete patrons with given restriction types.

To test:
1) Run
   misc/cronjobs/delete_patrons.pl --not_borrowed_since 2010-01-01
   and choose a borrowernumber that would be deleted.
2) In your browser go to
   /cgi-bin/koha/members/moremember.pl?borrowernumber=<borrowernumber>
   and add a manual restriction to this patron.
3) Apply the patch.
4) Run
   misc/cronjobs/delete_patrons.pl --not_borrowed_since 2010-01-01 \
       --without_restriction_type MANUAL
5) Check that the patron with the manual restriction would not be
   deleted.

Sponsored-by: Karlsruhe Institute of Technology (KIT)
Comment 2 Roman Dolny 2024-07-30 21:43:13 UTC
Created attachment 169879 [details] [review]
Bug 37418: delete_patrons.pl: Exclude patrons with restrictions

Add the option "--without_restriction_type" so that delete_patrons.pl
does not delete patrons with given restriction types.

To test:
1) Run
   misc/cronjobs/delete_patrons.pl --not_borrowed_since 2010-01-01
   and choose a borrowernumber that would be deleted.
2) In your browser go to
   /cgi-bin/koha/members/moremember.pl?borrowernumber=<borrowernumber>
   and add a manual restriction to this patron.
3) Apply the patch.
4) Run
   misc/cronjobs/delete_patrons.pl --not_borrowed_since 2010-01-01 \
       --without_restriction_type MANUAL
5) Check that the patron with the manual restriction would not be
   deleted.

Sponsored-by: Karlsruhe Institute of Technology (KIT)
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>