Created attachment 53093 [details] [review] Bug 16849: Move IsDebarred to Koha::Patron->is_debarred In order to move IsMemberBlocked to Koha::Patron it makes sense to move the code from Koha::Patron::Debarments::IsDebarred to Koha::Patron->is_debarred. Test plan: 1/ Add a restriction to a patron 2/ make sure he is not able to checkout items any more 3/ Make sure he cannot get a discharge 4/ Put a hold and make sure you get "Patron has restrictions"
Testing /4 Put a hold and make sure you get "Patron has restrictions": Works on top of Bug 16854 - request.tt: Logic to display messages broken
Regarding /3 Make sure he cannot get a discharge I added a manual restriction to a patron, and I can discharge her with and without patch. Should discharges be blocked by restrictions?
(In reply to Marc Véron from comment #3) > Regarding /3 Make sure he cannot get a discharge > > I added a manual restriction to a patron, and I can discharge her with and > without patch. > Should discharges be blocked by restrictions? Actually it's a bit tricky :) The expected behavior is: Discharge a patron for the first time will debar the patron and generate a discharge. Click on discharge again: no new discharge will be generated (the pdf will, but no new entries in the discharges table). Remove the debarment and generate a new discharge will create a new entry in the discharges table.
(In reply to Jonathan Druart from comment #4) > (In reply to Marc Véron from comment #3) > > Regarding /3 Make sure he cannot get a discharge > > > > I added a manual restriction to a patron, and I can discharge her with and > > without patch. > > Should discharges be blocked by restrictions? > > Actually it's a bit tricky :) > The expected behavior is: > Discharge a patron for the first time will debar the patron and generate a > discharge. > Click on discharge again: no new discharge will be generated (the pdf will, > but no new entries in the discharges table). > Remove the debarment and generate a new discharge will create a new entry in > the discharges table. Thanks, Jonathan, for the explanation. Patch works as described and I will sign off. For the records: IMO the behavior (with and without patch) is not optimal: - As far as I understand a patron who has got a discharge should not be able to check out items again (adding a restriction that never expires). - However, if I put a manual restriction to this patron that expires let's say tomorrow, discharging will not add it's own restriction. The day after tomorrow, the patron will be able to check out again (but she has got a discharge). What do you think about? Is that intended or is it a Bug?
Created attachment 53131 [details] [review] Bug 16849: Move IsDebarred to Koha::Patron->is_debarred In order to move IsMemberBlocked to Koha::Patron it makes sense to move the code from Koha::Patron::Debarments::IsDebarred to Koha::Patron->is_debarred. Test plan: 1/ Add a restriction to a patron 2/ make sure he is not able to checkout items any more 3/ Make sure he cannot get a discharge 4/ Put a hold and make sure you get "Patron has restrictions" Signed-off-by: Marc Véron <veron@veron.ch>
(In reply to Marc Véron from comment #5) > What do you think about? Is that intended or is it a Bug? I think it's intended: Even if a patron got a discharge, (s)he could come back to the library (next year, or 5 years after).
Created attachment 53238 [details] [review] Bug 16849: Move IsDebarred to Koha::Patron->is_debarred In order to move IsMemberBlocked to Koha::Patron it makes sense to move the code from Koha::Patron::Debarments::IsDebarred to Koha::Patron->is_debarred. Test plan: 1/ Add a restriction to a patron 2/ make sure he is not able to checkout items any more 3/ Make sure he cannot get a discharge 4/ Put a hold and make sure you get "Patron has restrictions" Signed-off-by: Marc Véron <veron@veron.ch>
Patch rebased against master.
Created attachment 53431 [details] [review] Bug 16849: Move IsDebarred to Koha::Patron->is_debarred In order to move IsMemberBlocked to Koha::Patron it makes sense to move the code from Koha::Patron::Debarments::IsDebarred to Koha::Patron->is_debarred. Test plan: 1/ Add a restriction to a patron 2/ make sure he is not able to checkout items any more 3/ Make sure he cannot get a discharge 4/ Put a hold and make sure you get "Patron has restrictions" Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Pushed to master for 16.11, thanks Jonathan!