Added: debarredcomment and debarreddate in batch patrons modification
It would be usefull for me too
In academic libraries students patrons discharge together as a batch. The option to discharge patron in "Batch patrons modification" under tools would make it easy.
Created attachment 91422 [details] [review] Bug 13552: Add debar option to batch patron modification Test plan: 1. Go to Tools > Batch patron modification 2. Input the cardnumbers of several (undebarred/unrestricted) patrons and submit 3. Notice there is no input for setting a debarred until (restriction expiration) date or debar comment Also notice in the list of matching borrowers at the top of the page there is no display of the debarred or debarredcomment values for the patron 4. Apply patch 5. Restart memcached and plack 6. Refresh the page notice 'Debarred till' (a date picker input) and 'Debarred comment' are now input options Also notice in the table at the top of the page 'Debarred till' and 'Debarred comment' are shown on the far right of the table (you may need to scroll to see this) 7. Pick a date in the 'Debarred till' datepicker and write in text into the 'Debarred comment' field and submit 8. Notice in the next loaded page the selected patrons have the 'Debarred till' and 'Debarred comment' values you entered 9. Click on the cardnumber link of one of the patrons and notice the red text on their patron account page informing you they are restricted until the date you set 10. In the Koha home directory enter Koha shell: sudo koha-shell <instancename> 11. Run: prove xt 12. Confirm all tests pass 13. Sign off Sponsored-By: Brimbank Library, Australia
Hi all, As this ticket has been untouched for a number of years I have attached the fix we have been sponsored to write for Brimbank Library in Australia. If you could please have a test and let us know your findings (or sign off if you are happy with it) that would be wonderful! Many thanks, Alex
Created attachment 91425 [details] [review] Bug 13552: Add debar option to batch patron modification Test plan: 1. Go to Tools > Batch patron modification 2. Input the cardnumbers of several (undebarred/unrestricted) patrons and submit 3. Notice there is no input for setting a debarred until (restriction expiration) date or debar comment Also notice in the list of matching borrowers at the top of the page there is no display of the debarred or debarredcomment values for the patron 4. Apply patch 5. Restart memcached and plack 6. Refresh the page notice 'Debarred till' (a date picker input) and 'Debarred comment' are now input options Also notice in the table at the top of the page 'Debarred till' and 'Debarred comment' are shown on the far right of the table (you may need to scroll to see this) 7. Pick a date in the 'Debarred till' datepicker and write in text into the 'Debarred comment' field and submit 8. Notice in the next loaded page the selected patrons have the 'Debarred till' and 'Debarred comment' values you entered 9. Click on the cardnumber link of one of the patrons and notice the red text on their patron account page informing you they are restricted until the date you set 10. In the Koha home directory enter Koha shell: sudo koha-shell <instancename> 11. Run: prove xt 12. Confirm all tests pass 13. Sign off Sponsored-By: Brimbank Library, Australia Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
In my test this worked to update the borrowers table, but nothing was added to the borrower_debarments table. Both are necessary. Also: If you add a restriction without an "until" date I think it is supposed to be '9999-12-31' in borrowers and NULL in borrower_debarments. At the same time could you update the labels? The default English translation should use the term "Restriction."
Created attachment 91433 [details] [review] Bug 13552: (follow-up) Add debar option to batch patron modification As per test feedback I've changed wording from debarrment to restriction Added insertion into the borrower_debarments table and removal from borrower_debarments table (and borrowers.debarred and borrowers.debarredcomment) when either 'Restriction expiration' or 'Restriction comment' are ticket to be disabled/deleted. Test plan (please follow this instead of following test plan in the first patch): 1. Go to Tools > Batch patron modification 2. Input the cardnumbers of several (undebarred/unrestricted) patrons and submit 3. Notice there is no input for setting Restriction expiration date or Restriction comment Also notice in the list of matching borrowers at the top of the page there is no display of the 'Restriction expiration' or 'Restriction comment' values for the patron 4. Apply patch 5. Restart memcached and plack 6. Refresh the page notice 'Restriction expiration' (a date picker input) and 'Restriction comment'are now input options Also notice in the table at the top of the page 'Restriction expiration' and 'Restriction comment' are shown on the far right of the table (you may need to scroll to see this) 7. Pick a date in the 'Restriction expired' datepicker and write in text into the 'Restriction comment' field and submit 8. Notice in the next loaded page the selected patrons have the 'Restriction expiration' and 'Restriction comment' values you entered 9. Query the borrower_debarments database table and check that the new debarments are added to this table 10. Go back to the Batch patron modification page and re-input the same cardnumbers 11. Write text into the 'Restriction comment' field and don't pick a 'Restriction expiration' value and submit 12. Notice in the next loaded page the selected patrons have the 'Restriction expiration' value of 9999-12-31 and 'Restriction comment' value you just entered 13. Query the borrowers table and notice the borrowers.debarred value for the modified patrons is '9999-12-31' and the borrower.debarredcomment is what you inputted in step 11 14. Query the borrower_debarments table and notice the expiration value is NULL and the comment value is set to what you entered in step 11 Also note the addition of the new debarment has not removed the existing debarment on the patrons 15. Click on the cardnumber link of one of the patrons and notice the red text on their patron account page informing you they are restricted until the date you set 16. In the Koha home directory enter Koha shell: sudo koha-shell <instancename> 17. Run: prove xt 18. All tests should pass 19. Repeat step 10 and tick the checkbox beside the 'Restriction expiration' field and submit 20. In the next loaded screen notice the 'Restricted expiration'and 'Restricted comment' are empty Check the borrower_debarments table and notice all restrictions for the patron are removed. Check the borrowers table and notice the debarred and debarredcomment fields are empty for the patrons 21. Repeat steps 10 and 11 to make a new restriction 22. Repeat step 19 and this time check the 'Restriction comment' field and submit and observe that also clears the restriction in the next loaded page, in the borrower_debarments and borrowers table 23. Sign off Sponsored-By: Brimbank Library, Australia
Thanks for testing Josef and Owen! I think I've addressed all your points in comment #6 Owen. If you two could please re-test again that would be much appreciated. Thanks, Alex
Created attachment 91950 [details] [review] Bug 13552: Add debar option to batch patron modification Test plan: 1. Go to Tools > Batch patron modification 2. Input the cardnumbers of several (undebarred/unrestricted) patrons and submit 3. Notice there is no input for setting a debarred until (restriction expiration) date or debar comment Also notice in the list of matching borrowers at the top of the page there is no display of the debarred or debarredcomment values for the patron 4. Apply patch 5. Restart memcached and plack 6. Refresh the page notice 'Debarred till' (a date picker input) and 'Debarred comment' are now input options Also notice in the table at the top of the page 'Debarred till' and 'Debarred comment' are shown on the far right of the table (you may need to scroll to see this) 7. Pick a date in the 'Debarred till' datepicker and write in text into the 'Debarred comment' field and submit 8. Notice in the next loaded page the selected patrons have the 'Debarred till' and 'Debarred comment' values you entered 9. Click on the cardnumber link of one of the patrons and notice the red text on their patron account page informing you they are restricted until the date you set 10. In the Koha home directory enter Koha shell: sudo koha-shell <instancename> 11. Run: prove xt 12. Confirm all tests pass 13. Sign off Sponsored-By: Brimbank Library, Australia Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 91951 [details] [review] Bug 13552: (follow-up) Add debar option to batch patron modification As per test feedback I've changed wording from debarrment to restriction Added insertion into the borrower_debarments table and removal from borrower_debarments table (and borrowers.debarred and borrowers.debarredcomment) when either 'Restriction expiration' or 'Restriction comment' are ticket to be disabled/deleted. Test plan (please follow this instead of following test plan in the first patch): 1. Go to Tools > Batch patron modification 2. Input the cardnumbers of several (undebarred/unrestricted) patrons and submit 3. Notice there is no input for setting Restriction expiration date or Restriction comment Also notice in the list of matching borrowers at the top of the page there is no display of the 'Restriction expiration' or 'Restriction comment' values for the patron 4. Apply patch 5. Restart memcached and plack 6. Refresh the page notice 'Restriction expiration' (a date picker input) and 'Restriction comment'are now input options Also notice in the table at the top of the page 'Restriction expiration' and 'Restriction comment' are shown on the far right of the table (you may need to scroll to see this) 7. Pick a date in the 'Restriction expired' datepicker and write in text into the 'Restriction comment' field and submit 8. Notice in the next loaded page the selected patrons have the 'Restriction expiration' and 'Restriction comment' values you entered 9. Query the borrower_debarments database table and check that the new debarments are added to this table 10. Go back to the Batch patron modification page and re-input the same cardnumbers 11. Write text into the 'Restriction comment' field and don't pick a 'Restriction expiration' value and submit 12. Notice in the next loaded page the selected patrons have the 'Restriction expiration' value of 9999-12-31 and 'Restriction comment' value you just entered 13. Query the borrowers table and notice the borrowers.debarred value for the modified patrons is '9999-12-31' and the borrower.debarredcomment is what you inputted in step 11 14. Query the borrower_debarments table and notice the expiration value is NULL and the comment value is set to what you entered in step 11 Also note the addition of the new debarment has not removed the existing debarment on the patrons 15. Click on the cardnumber link of one of the patrons and notice the red text on their patron account page informing you they are restricted until the date you set 16. In the Koha home directory enter Koha shell: sudo koha-shell <instancename> 17. Run: prove xt 18. All tests should pass 19. Repeat step 10 and tick the checkbox beside the 'Restriction expiration' field and submit 20. In the next loaded screen notice the 'Restricted expiration'and 'Restricted comment' are empty Check the borrower_debarments table and notice all restrictions for the patron are removed. Check the borrowers table and notice the debarred and debarredcomment fields are empty for the patrons 21. Repeat steps 10 and 11 to make a new restriction 22. Repeat step 19 and this time check the 'Restriction comment' field and submit and observe that also clears the restriction in the next loaded page, in the borrower_debarments and borrowers table 23. Sign off Sponsored-By: Brimbank Library, Australia Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 92103 [details] [review] Bug 13552: Add debar option to batch patron modification Test plan: 1. Go to Tools > Batch patron modification 2. Input the cardnumbers of several (undebarred/unrestricted) patrons and submit 3. Notice there is no input for setting a debarred until (restriction expiration) date or debar comment Also notice in the list of matching borrowers at the top of the page there is no display of the debarred or debarredcomment values for the patron 4. Apply patch 5. Restart memcached and plack 6. Refresh the page notice 'Debarred till' (a date picker input) and 'Debarred comment' are now input options Also notice in the table at the top of the page 'Debarred till' and 'Debarred comment' are shown on the far right of the table (you may need to scroll to see this) 7. Pick a date in the 'Debarred till' datepicker and write in text into the 'Debarred comment' field and submit 8. Notice in the next loaded page the selected patrons have the 'Debarred till' and 'Debarred comment' values you entered 9. Click on the cardnumber link of one of the patrons and notice the red text on their patron account page informing you they are restricted until the date you set 10. In the Koha home directory enter Koha shell: sudo koha-shell <instancename> 11. Run: prove xt 12. Confirm all tests pass 13. Sign off Sponsored-By: Brimbank Library, Australia Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 92104 [details] [review] Bug 13552: (follow-up) Add debar option to batch patron modification As per test feedback I've changed wording from debarrment to restriction Added insertion into the borrower_debarments table and removal from borrower_debarments table (and borrowers.debarred and borrowers.debarredcomment) when either 'Restriction expiration' or 'Restriction comment' are ticket to be disabled/deleted. Test plan (please follow this instead of following test plan in the first patch): 1. Go to Tools > Batch patron modification 2. Input the cardnumbers of several (undebarred/unrestricted) patrons and submit 3. Notice there is no input for setting Restriction expiration date or Restriction comment Also notice in the list of matching borrowers at the top of the page there is no display of the 'Restriction expiration' or 'Restriction comment' values for the patron 4. Apply patch 5. Restart memcached and plack 6. Refresh the page notice 'Restriction expiration' (a date picker input) and 'Restriction comment'are now input options Also notice in the table at the top of the page 'Restriction expiration' and 'Restriction comment' are shown on the far right of the table (you may need to scroll to see this) 7. Pick a date in the 'Restriction expired' datepicker and write in text into the 'Restriction comment' field and submit 8. Notice in the next loaded page the selected patrons have the 'Restriction expiration' and 'Restriction comment' values you entered 9. Query the borrower_debarments database table and check that the new debarments are added to this table 10. Go back to the Batch patron modification page and re-input the same cardnumbers 11. Write text into the 'Restriction comment' field and don't pick a 'Restriction expiration' value and submit 12. Notice in the next loaded page the selected patrons have the 'Restriction expiration' value of 9999-12-31 and 'Restriction comment' value you just entered 13. Query the borrowers table and notice the borrowers.debarred value for the modified patrons is '9999-12-31' and the borrower.debarredcomment is what you inputted in step 11 14. Query the borrower_debarments table and notice the expiration value is NULL and the comment value is set to what you entered in step 11 Also note the addition of the new debarment has not removed the existing debarment on the patrons 15. Click on the cardnumber link of one of the patrons and notice the red text on their patron account page informing you they are restricted until the date you set 16. In the Koha home directory enter Koha shell: sudo koha-shell <instancename> 17. Run: prove xt 18. All tests should pass 19. Repeat step 10 and tick the checkbox beside the 'Restriction expiration' field and submit 20. In the next loaded screen notice the 'Restricted expiration'and 'Restricted comment' are empty Check the borrower_debarments table and notice all restrictions for the patron are removed. Check the borrowers table and notice the debarred and debarredcomment fields are empty for the patrons 21. Repeat steps 10 and 11 to make a new restriction 22. Repeat step 19 and this time check the 'Restriction comment' field and submit and observe that also clears the restriction in the next loaded page, in the borrower_debarments and borrowers table 23. Sign off Sponsored-By: Brimbank Library, Australia Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Nice work! Pushed to master for 19.11.00
Thanks very much!
I think there is a problem. $infos->{debarred} is used by AddDebarment() but also in Koha::Patrons->find( $borrowernumber )->set($infos)->store. In this case borrowers.debarred in DB with get the entered date, even if there is an existing debarment with a greater date. This column must be set only by Patron::Debarments. I think $infos->{debarred} must be deleted after beeing used by AddDebarment(). Same for debarredcomment.
*** Bug 17259 has been marked as a duplicate of this bug. ***