Bug 24476 - Allow patrons to opt-out of auto-renewal
Summary: Allow patrons to opt-out of auto-renewal
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Nick Clemens
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 25029 24988
  Show dependency treegraph
 
Reported: 2020-01-22 00:53 UTC by Nick Clemens
Modified: 2022-12-12 21:24 UTC (History)
11 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Medium patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This development will allow a patron to opt-out of auto-renewals - the regular job will ignore these checkouts and items will remain renewable both via the staff interface and OPAC. Patrons will be able to set this flag themselves, staff will also be able to. **New system preference**: `AllowPatronToControlAutorenewal` defaults to disabled.
Version(s) released in:
20.05.00


Attachments
Bug 24476: Database updates (2.57 KB, patch)
2020-01-23 02:44 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: API Updates (2.10 KB, patch)
2020-01-23 02:45 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: Change CanBookBeRenewed and adjust tests (5.52 KB, patch)
2020-01-23 02:45 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: DO NOT PUSH - Schema updates (2.93 KB, patch)
2020-01-23 02:45 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: Allow patrons to opt out of auto-renewal (10.47 KB, patch)
2020-01-23 02:45 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: Database updates (2.86 KB, patch)
2020-01-23 17:52 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: API Updates (2.08 KB, patch)
2020-01-23 17:52 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: Change CanBookBeRenewed and adjust tests (5.48 KB, patch)
2020-01-23 17:52 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: Allow patrons to opt out of auto-renewal (9.83 KB, patch)
2020-01-23 17:52 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: DO NOT PUSH - Schema updates (3.83 KB, patch)
2020-01-23 17:52 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: Add boolean for all TINYINT (1.03 KB, patch)
2020-01-23 17:52 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: Database updates (3.50 KB, patch)
2020-01-24 20:53 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: API Updates (2.08 KB, patch)
2020-01-24 20:53 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: Change CanBookBeRenewed and adjust tests (5.48 KB, patch)
2020-01-24 20:53 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: Allow patrons to opt out of auto-renewal (13.43 KB, patch)
2020-01-24 20:53 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: DO NOT PUSH - Schema updates (5.55 KB, patch)
2020-01-24 20:53 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: Add boolean for all TINYINT (1.77 KB, patch)
2020-01-24 20:54 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: Database updates (3.55 KB, patch)
2020-01-27 20:27 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 24476: API Updates (2.13 KB, patch)
2020-01-27 20:27 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 24476: Change CanBookBeRenewed and adjust tests (5.53 KB, patch)
2020-01-27 20:27 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 24476: Allow patrons to opt out of auto-renewal (13.48 KB, patch)
2020-01-27 20:27 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 24476: DO NOT PUSH - Schema updates (5.60 KB, patch)
2020-01-27 20:27 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 24476: Add boolean for all TINYINT (1.82 KB, patch)
2020-01-27 20:27 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 24476: Database updates (3.55 KB, patch)
2020-02-28 20:38 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: API Updates (2.13 KB, patch)
2020-02-28 20:38 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: Change CanBookBeRenewed and adjust tests (4.89 KB, patch)
2020-02-28 20:38 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: Allow patrons to opt out of auto-renewal (17.14 KB, patch)
2020-02-28 20:39 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: Rename autorenewal to autorenew_checkouts (24.11 KB, patch)
2020-02-28 20:39 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: DO NOT PUSH - Schema Updates (3.58 KB, patch)
2020-02-28 20:39 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: Add boolean for TINYINT (1.64 KB, patch)
2020-02-28 20:39 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: Allow direct editing of autorenew_checkouts by patron (12.15 KB, patch)
2020-02-28 20:39 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: Database updates (3.62 KB, patch)
2020-03-03 14:13 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 24476: API Updates (2.20 KB, patch)
2020-03-03 14:13 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 24476: Change CanBookBeRenewed and adjust tests (4.96 KB, patch)
2020-03-03 14:13 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 24476: Allow patrons to opt out of auto-renewal (17.21 KB, patch)
2020-03-03 14:13 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 24476: Rename autorenewal to autorenew_checkouts (24.18 KB, patch)
2020-03-03 14:13 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 24476: DO NOT PUSH - Schema Updates (3.65 KB, patch)
2020-03-03 14:13 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 24476: Add boolean for TINYINT (1.71 KB, patch)
2020-03-03 14:13 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 24476: Allow direct editing of autorenew_checkouts by patron (12.22 KB, patch)
2020-03-03 14:13 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 24476 Standardize on 'auto renew(al)' and improve db update (6.26 KB, patch)
2020-03-22 17:17 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 24476: Database updates (3.62 KB, patch)
2020-03-23 11:57 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: API Updates (2.20 KB, patch)
2020-03-23 11:57 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: Change CanBookBeRenewed and adjust tests (4.96 KB, patch)
2020-03-23 11:57 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: Allow patrons to opt out of auto-renewal (17.22 KB, patch)
2020-03-23 11:58 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: Rename autorenewal to autorenew_checkouts (24.19 KB, patch)
2020-03-23 11:58 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: Allow direct editing of autorenew_checkouts by patron (12.22 KB, patch)
2020-03-23 11:58 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: (QA follow-up) Standardize on 'auto renew(al)' and improve db update (6.27 KB, patch)
2020-03-23 11:58 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: DO NOT PUSH - Schema changes (3.58 KB, patch)
2020-03-23 11:58 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24476: Add boolean for TINYINT (1.71 KB, patch)
2020-03-23 11:58 UTC, Nick Clemens
Details | Diff | Splinter Review
Auto-renew setting in the OPAC (99.09 KB, image/png)
2020-03-24 09:11 UTC, Katrin Fischer
Details
Bug 24476: Database updates (3.67 KB, patch)
2020-03-24 09:16 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 24476: API Updates (2.25 KB, patch)
2020-03-24 09:16 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 24476: Change CanBookBeRenewed and adjust tests (5.01 KB, patch)
2020-03-24 09:16 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 24476: Allow patrons to opt out of auto-renewal (17.28 KB, patch)
2020-03-24 09:17 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 24476: Rename autorenewal to autorenew_checkouts (24.25 KB, patch)
2020-03-24 09:17 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 24476: Allow direct editing of autorenew_checkouts by patron (12.27 KB, patch)
2020-03-24 09:17 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 24476: (QA follow-up) Standardize on 'auto renew(al)' and improve db update (6.33 KB, patch)
2020-03-24 09:17 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 24476: DO NOT PUSH - Schema changes (3.64 KB, patch)
2020-03-24 09:17 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 24476: Add boolean for TINYINT (1.76 KB, patch)
2020-03-24 09:17 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 24476: (QA follow-up) Move new option below warnings and messages in OPAC account (5.89 KB, patch)
2020-03-24 09:17 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 24476: (QA follow-up) Move new option below warnings and messages in OPAC account (5.95 KB, patch)
2020-03-24 11:23 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2020-01-22 00:53:50 UTC
Some patrons prefer to renew their books on their own. This development will allow a patron to opt-out of auto-renewals -the cron will ignore these checkouts and items will be renewable both via the staff and opac.

Patrons will be able to set this flag themselves, staff will also be able to.
Comment 1 Nick Clemens 2020-01-23 02:44:59 UTC
Created attachment 97766 [details] [review]
Bug 24476: Database updates
Comment 2 Nick Clemens 2020-01-23 02:45:03 UTC
Created attachment 97767 [details] [review]
Bug 24476: API Updates
Comment 3 Nick Clemens 2020-01-23 02:45:06 UTC
Created attachment 97768 [details] [review]
Bug 24476: Change CanBookBeRenewed and adjust tests
Comment 4 Nick Clemens 2020-01-23 02:45:09 UTC
Created attachment 97769 [details] [review]
Bug 24476: DO NOT PUSH - Schema updates

is_boolean line must be copied however
Comment 5 Nick Clemens 2020-01-23 02:45:12 UTC
Created attachment 97770 [details] [review]
Bug 24476: Allow patrons to opt out of auto-renewal

To test:
1 - Verify on staff side that patron can be edited to opt in our out of auto renewal
2 - Check out some items to a patron opted in to auto renewal
3 - Ensure the items are checked out and set to autorenew
4 - Login on the opac at the patron
5 - Verify items cannot be renewed as scheduled for auto-renewal
6 - On staff side, opt patron out of auto renewal
7 - Verify on opac items are no longer marked for auto renewal
8 - Run the auto renewal cron job, items are not renewed
9 - Set 'no renewal before' to a setting that would prevent renewal
10 - Verify that opting patron in or out of auto renewal changes only the reason items cannot be renewed
11 - Set 'no renewal before' to a setting that would allow for renewal
12 - Verify that opting patron in/out changes their ability to renew
13 - Verify that when opted out cron does not renew
14 - Verify that when opted in the item is auto renewed
15 - Reset the due date, opt out, verify manual renewal succeeds
Comment 6 Andrew Fuerste-Henry 2020-01-23 13:26:57 UTC
Failing on step 7. Once I've opted the patron out of auto-renew, they still show on the OPAC as scheduled for auto-renew.

Taking a step back, I think this could be a little more clear if we weren't defining it as a negative. Right now it's "select Yes to not auto-renew, select No to not not auto-renew." How about "Allow auto-renew: Yes/No" rather than "Disallow auto-renew: Yes/No"?
Comment 7 Owen Leonard 2020-01-23 13:49:16 UTC
It doesn't look like there's a way to turn off this feature. Could it be added to patron category configuration? I know my library would not want patrons to be able to opt out.
Comment 8 Katrin Fischer 2020-01-23 14:08:08 UTC
(In reply to Owen Leonard from comment #7)
> It doesn't look like there's a way to turn off this feature. Could it be
> added to patron category configuration? I know my library would not want
> patrons to be able to opt out.

I agree - academic libraries here might not want that either.
Comment 9 Andrew Fuerste-Henry 2020-01-23 14:09:13 UTC
To Owen's concern, as is there isn't a way for the patron to opt out for themselves from the OPAC, so that makes it easier for a library to disallow it.

But ...

Seems like if we're going to add this feature it'd be good to also give the patron the option to opt out for themselves from the OPAC.

Following existing conventions, this sounds like two sysprefs and a new toggle on the category:
IntranetAutoRenewOptOut
OPACAutoRenewOptOut
and then a thingy in the category to allow an individual category to differ from the syspref
Comment 10 Owen Leonard 2020-01-23 14:17:52 UTC
(In reply to Andrew Fuerste-Henry from comment #9)
> To Owen's concern, as is there isn't a way for the patron to opt out for
> themselves from the OPAC

They can submit the change via the same form they use to update their other personal details. However, this reveals another bug: The request doesn't show up in the staff client in the "Update patron records" page. It shows that a request was made but doesn't list it.


> Following existing conventions, this sounds like two sysprefs and a new
> toggle on the category:
> IntranetAutoRenewOptOut
> OPACAutoRenewOptOut

Is there a need for the global preferences if the option can be configured at the patron category level? Seems redundant.
Comment 11 Andrew Fuerste-Henry 2020-01-23 14:26:26 UTC
Whoops, right you are. Yeah, that doesn't exactly fit with the personal details updating stuff. Maybe it needs to be broken out somehow? As we do with privacy choices and messaging preferences?

I'm not married to the idea of a syspref AND a category configuration, that's just how we've handled other things, like the ability to do a password reset. On the one hand, it's nice to have one main switch for libraries that want all their categories to behave the same. On the other hand, it's always good to avoid making a syspref if possible.
Comment 12 Nick Clemens 2020-01-23 17:52:24 UTC
Created attachment 97831 [details] [review]
Bug 24476: Database updates
Comment 13 Nick Clemens 2020-01-23 17:52:27 UTC
Created attachment 97832 [details] [review]
Bug 24476: API Updates
Comment 14 Nick Clemens 2020-01-23 17:52:30 UTC
Created attachment 97833 [details] [review]
Bug 24476: Change CanBookBeRenewed and adjust tests
Comment 15 Nick Clemens 2020-01-23 17:52:32 UTC
Created attachment 97834 [details] [review]
Bug 24476: Allow patrons to opt out of auto-renewal

To test:
1 - Verify on staff side that patron can be edited to opt in our out of auto renewal
2 - Check out some items to a patron opted in to auto renewal
3 - Ensure the items are checked out and set to autorenew
4 - Login on the opac at the patron
5 - Verify items cannot be renewed as scheduled for auto-renewal
6 - On staff side, opt patron out of auto renewal
7 - Verify on opac items are no longer marked for auto renewal
8 - Run the auto renewal cron job, items are not renewed
9 - Set 'no renewal before' to a setting that would prevent renewal
10 - Verify that opting patron in or out of auto renewal changes only the reason items cannot be renewed
11 - Set 'no renewal before' to a setting that would allow for renewal
12 - Verify that opting patron in/out changes their ability to renew
13 - Verify that when opted out cron does not renew
14 - Verify that when opted in the item is auto renewed
15 - Reset the due date, opt out, verify manual renewal succeeds
Comment 16 Nick Clemens 2020-01-23 17:52:35 UTC
Created attachment 97835 [details] [review]
Bug 24476: DO NOT PUSH - Schema updates
Comment 17 Nick Clemens 2020-01-23 17:52:38 UTC
Created attachment 97836 [details] [review]
Bug 24476: Add boolean for all TINYINT
Comment 18 Nick Clemens 2020-01-23 17:57:04 UTC
I rewrote the column to be a positive instead of negative - all patrons are 'opted in' then can prevent autorenewal

I altered the update to automatically add this field to the unwanted prefs for opac update and self-reg.

I still need to address the column not showing up on patron update requests
Comment 19 Nick Clemens 2020-01-24 20:53:47 UTC
Created attachment 97923 [details] [review]
Bug 24476: Database updates
Comment 20 Nick Clemens 2020-01-24 20:53:50 UTC
Created attachment 97924 [details] [review]
Bug 24476: API Updates
Comment 21 Nick Clemens 2020-01-24 20:53:53 UTC
Created attachment 97925 [details] [review]
Bug 24476: Change CanBookBeRenewed and adjust tests
Comment 22 Nick Clemens 2020-01-24 20:53:56 UTC
Created attachment 97926 [details] [review]
Bug 24476: Allow patrons to opt out of auto-renewal

To test:
1 - Verify on staff side that patron can be edited to opt in our out of auto renewal
2 - Check out some items to a patron opted in to auto renewal
3 - Ensure the items are checked out and set to autorenew
4 - Login on the opac at the patron
5 - Verify items cannot be renewed as scheduled for auto-renewal
6 - On staff side, opt patron out of auto renewal
7 - Verify on opac items are no longer marked for auto renewal
8 - Run the auto renewal cron job, items are not renewed
9 - Set 'no renewal before' to a setting that would prevent renewal
10 - Verify that opting patron in or out of auto renewal changes only the reason items cannot be renewed
11 - Set 'no renewal before' to a setting that would allow for renewal
12 - Verify that opting patron in/out changes their ability to renew
13 - Verify that when opted out cron does not renew
14 - Verify that when opted in the item is auto renewed
15 - Reset the due date, opt out, verify manual renewal succeeds
Comment 23 Nick Clemens 2020-01-24 20:53:58 UTC
Created attachment 97927 [details] [review]
Bug 24476: DO NOT PUSH - Schema updates
Comment 24 Nick Clemens 2020-01-24 20:54:01 UTC
Created attachment 97928 [details] [review]
Bug 24476: Add boolean for all TINYINT
Comment 25 Andrew Fuerste-Henry 2020-01-27 20:26:01 UTC
New test plan:
1 - Set loan period and No Renewal Before such than an item is eligable for renewal immediately upon checkout
2 - Check out an item to a patron opted in to auto renewal
3 - Ensure the item is checked out and set to autorenew
4 - Opt patron out of auto-renew
5 - Verify that patron's checkout now shows as available for manual renewal
6 - Make sure OpacRenewalAllowed is set to Allow and "autorenewal" is not in PatronSelfModificationBorrowerUnwantedField
7 - Login on the opac at the patron
8 - Verify checkout shows as available for manual renewal
9 - Verify you can submit change request from OPAC to opt patron in to auto-renew
10 - Find change request on intranet, verify it shows change to autorenew opt-in, accept change request
11 - Reload patron summary on OPAC, verify it now shows checkout is scheduled for auto-renewal
12 - On staff side, opt patron out of auto-renew
13 - Run misc/cronjobs/automatic_renewals.pl, verify item is not renewed
14 - Manually renew item from the intranet
15 - Manually renew item from the OPAC
16 - Opt patron in for auto-renew
17 - Run misc/cronjobs/automatic_renewals.pl, verify item is renewed
18 - Set No Renewal Before value so item is no longer eligable for renewal
19 - Verify intranet and OPAC still show checkout scheduled for auto-renewal
20 - Opt patron out of auto-renew
21 - Verify intranet and OPAC show checkout ineligible for manual renewal due to No Renewal Before
22 - Opt patron in to auto-renew
22 - Add "autorenewal to PatronSelfModificationBorrowerUnwantedField and BorrowerUnwantedField
23 - Confirm patron can no longer be opted out of auto-renew on intranet or OPAC
Comment 26 ByWater Sandboxes 2020-01-27 20:27:40 UTC
Created attachment 97997 [details] [review]
Bug 24476: Database updates

Signed-off-by: Andrew <andrew@bywatersolutions.com>
Comment 27 ByWater Sandboxes 2020-01-27 20:27:43 UTC
Created attachment 97998 [details] [review]
Bug 24476: API Updates

Signed-off-by: Andrew <andrew@bywatersolutions.com>
Comment 28 ByWater Sandboxes 2020-01-27 20:27:46 UTC
Created attachment 97999 [details] [review]
Bug 24476: Change CanBookBeRenewed and adjust tests

Signed-off-by: Andrew <andrew@bywatersolutions.com>
Comment 29 ByWater Sandboxes 2020-01-27 20:27:48 UTC
Created attachment 98000 [details] [review]
Bug 24476: Allow patrons to opt out of auto-renewal

To test:
1 - Verify on staff side that patron can be edited to opt in our out of auto renewal
2 - Check out some items to a patron opted in to auto renewal
3 - Ensure the items are checked out and set to autorenew
4 - Login on the opac at the patron
5 - Verify items cannot be renewed as scheduled for auto-renewal
6 - On staff side, opt patron out of auto renewal
7 - Verify on opac items are no longer marked for auto renewal
8 - Run the auto renewal cron job, items are not renewed
9 - Set 'no renewal before' to a setting that would prevent renewal
10 - Verify that opting patron in or out of auto renewal changes only the reason items cannot be renewed
11 - Set 'no renewal before' to a setting that would allow for renewal
12 - Verify that opting patron in/out changes their ability to renew
13 - Verify that when opted out cron does not renew
14 - Verify that when opted in the item is auto renewed
15 - Reset the due date, opt out, verify manual renewal succeeds

Signed-off-by: Andrew <andrew@bywatersolutions.com>
Comment 30 ByWater Sandboxes 2020-01-27 20:27:51 UTC
Created attachment 98001 [details] [review]
Bug 24476: DO NOT PUSH - Schema updates

Signed-off-by: Andrew <andrew@bywatersolutions.com>
Comment 31 ByWater Sandboxes 2020-01-27 20:27:54 UTC
Created attachment 98002 [details] [review]
Bug 24476: Add boolean for all TINYINT

Signed-off-by: Andrew <andrew@bywatersolutions.com>
Comment 32 Jonathan Druart 2020-02-26 14:25:39 UTC
Does not apply:
CONFLICT (content): Merge conflict in C4/Circulation.pm

Any chances to get a more meaningful column's name (and so method).
Koha::Patron->autorenewal could be related to renewing a registration.
Comment 33 Nick Clemens 2020-02-28 20:38:53 UTC
Created attachment 99793 [details] [review]
Bug 24476: Database updates

Signed-off-by: Andrew <andrew@bywatersolutions.com>
Comment 34 Nick Clemens 2020-02-28 20:38:56 UTC
Created attachment 99794 [details] [review]
Bug 24476: API Updates

Signed-off-by: Andrew <andrew@bywatersolutions.com>
Comment 35 Nick Clemens 2020-02-28 20:38:59 UTC
Created attachment 99795 [details] [review]
Bug 24476: Change CanBookBeRenewed and adjust tests

Signed-off-by: Andrew <andrew@bywatersolutions.com>
Comment 36 Nick Clemens 2020-02-28 20:39:02 UTC
Created attachment 99796 [details] [review]
Bug 24476: Allow patrons to opt out of auto-renewal

To test:
1 - Verify on staff side that patron can be edited to opt in our out of auto renewal
2 - Check out some items to a patron opted in to auto renewal
3 - Ensure the items are checked out and set to autorenew
4 - Login on the opac at the patron
5 - Verify items cannot be renewed as scheduled for auto-renewal
6 - On staff side, opt patron out of auto renewal
7 - Verify on opac items are no longer marked for auto renewal
8 - Run the auto renewal cron job, items are not renewed
9 - Set 'no renewal before' to a setting that would prevent renewal
10 - Verify that opting patron in or out of auto renewal changes only the reason items cannot be renewed
11 - Set 'no renewal before' to a setting that would allow for renewal
12 - Verify that opting patron in/out changes their ability to renew
13 - Verify that when opted out cron does not renew
14 - Verify that when opted in the item is auto renewed
15 - Reset the due date, opt out, verify manual renewal succeeds

Signed-off-by: Andrew <andrew@bywatersolutions.com>
Comment 37 Nick Clemens 2020-02-28 20:39:05 UTC
Created attachment 99797 [details] [review]
Bug 24476: Rename autorenewal to autorenew_checkouts
Comment 38 Nick Clemens 2020-02-28 20:39:08 UTC
Created attachment 99798 [details] [review]
Bug 24476: DO NOT PUSH - Schema Updates
Comment 39 Nick Clemens 2020-02-28 20:39:11 UTC
Created attachment 99799 [details] [review]
Bug 24476: Add boolean for TINYINT
Comment 40 Nick Clemens 2020-02-28 20:39:14 UTC
Created attachment 99800 [details] [review]
Bug 24476: Allow direct editing of autorenew_checkouts by patron
Comment 41 ByWater Sandboxes 2020-03-03 14:13:30 UTC
Created attachment 100022 [details] [review]
Bug 24476: Database updates

Signed-off-by: Andrew <andrew@bywatersolutions.com>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 42 ByWater Sandboxes 2020-03-03 14:13:33 UTC
Created attachment 100023 [details] [review]
Bug 24476: API Updates

Signed-off-by: Andrew <andrew@bywatersolutions.com>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 43 ByWater Sandboxes 2020-03-03 14:13:35 UTC
Created attachment 100024 [details] [review]
Bug 24476: Change CanBookBeRenewed and adjust tests

Signed-off-by: Andrew <andrew@bywatersolutions.com>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 44 ByWater Sandboxes 2020-03-03 14:13:38 UTC
Created attachment 100025 [details] [review]
Bug 24476: Allow patrons to opt out of auto-renewal

To test:
1 - Verify on staff side that patron can be edited to opt in our out of auto renewal
2 - Check out some items to a patron opted in to auto renewal
3 - Ensure the items are checked out and set to autorenew
4 - Login on the opac at the patron
5 - Verify items cannot be renewed as scheduled for auto-renewal
6 - On staff side, opt patron out of auto renewal
7 - Verify on opac items are no longer marked for auto renewal
8 - Run the auto renewal cron job, items are not renewed
9 - Set 'no renewal before' to a setting that would prevent renewal
10 - Verify that opting patron in or out of auto renewal changes only the reason items cannot be renewed
11 - Set 'no renewal before' to a setting that would allow for renewal
12 - Verify that opting patron in/out changes their ability to renew
13 - Verify that when opted out cron does not renew
14 - Verify that when opted in the item is auto renewed
15 - Reset the due date, opt out, verify manual renewal succeeds

Signed-off-by: Andrew <andrew@bywatersolutions.com>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 45 ByWater Sandboxes 2020-03-03 14:13:41 UTC
Created attachment 100026 [details] [review]
Bug 24476: Rename autorenewal to autorenew_checkouts

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 46 ByWater Sandboxes 2020-03-03 14:13:43 UTC
Created attachment 100027 [details] [review]
Bug 24476: DO NOT PUSH - Schema Updates

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 47 ByWater Sandboxes 2020-03-03 14:13:46 UTC
Created attachment 100028 [details] [review]
Bug 24476: Add boolean for TINYINT

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 48 ByWater Sandboxes 2020-03-03 14:13:49 UTC
Created attachment 100029 [details] [review]
Bug 24476: Allow direct editing of autorenew_checkouts by patron

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 49 Katrin Fischer 2020-03-22 17:17:24 UTC
Created attachment 101385 [details] [review]
Bug 24476 Standardize on 'auto renew(al)' and improve db update

There were several versions: auto renew, auto-renew, autorenew
I've decided to use auto renew (from automatic renewal) to keep
things a bit more consistent.

The DB update was missing AFTER and IGNORE for the sys pref.
Also fixed a tiny typo (tp > to)
Also changed
Comment 50 Katrin Fischer 2020-03-22 17:19:46 UTC
I am stuck on this one :( 

The schema update patch would not apply, so I skipped it.
Tried running DBIC:

Koha::Schema::Result::Zebraqueue->set_primary_key("id");
DBIx::Class::ResultSource::column_info(): No such column autorenew_checkouts at (eval 1297) line 1656


Tried running the updatedatabase script (with and without my patch):

$ updatedatabase 
{UNKNOWN}: DBIx::Class::ResultSource::column_info(): No such column autorenew_checkouts at /home/vagrant/kohaclone/Koha/Schema/Result/Borrower.pm line 1656
Compilation failed in require at /usr/share/perl5/Class/C3/Componentised.pm line 150. at /usr/share/perl5/Class/C3/Componentised.pm line 155
Compilation failed in require at /home/vagrant/kohaclone/Koha/Database.pm line 50.

Can you please check and rabase? Also added a follo-up, please have a look.
Comment 51 Nick Clemens 2020-03-23 11:57:52 UTC
Created attachment 101419 [details] [review]
Bug 24476: Database updates

Signed-off-by: Andrew <andrew@bywatersolutions.com>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 52 Nick Clemens 2020-03-23 11:57:55 UTC
Created attachment 101420 [details] [review]
Bug 24476: API Updates

Signed-off-by: Andrew <andrew@bywatersolutions.com>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 53 Nick Clemens 2020-03-23 11:57:58 UTC
Created attachment 101421 [details] [review]
Bug 24476: Change CanBookBeRenewed and adjust tests

Signed-off-by: Andrew <andrew@bywatersolutions.com>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 54 Nick Clemens 2020-03-23 11:58:02 UTC
Created attachment 101422 [details] [review]
Bug 24476: Allow patrons to opt out of auto-renewal

To test:
1 - Verify on staff side that patron can be edited to opt in our out of auto renewal
2 - Check out some items to a patron opted in to auto renewal
3 - Ensure the items are checked out and set to autorenew
4 - Login on the opac at the patron
5 - Verify items cannot be renewed as scheduled for auto-renewal
6 - On staff side, opt patron out of auto renewal
7 - Verify on opac items are no longer marked for auto renewal
8 - Run the auto renewal cron job, items are not renewed
9 - Set 'no renewal before' to a setting that would prevent renewal
10 - Verify that opting patron in or out of auto renewal changes only the reason items cannot be renewed
11 - Set 'no renewal before' to a setting that would allow for renewal
12 - Verify that opting patron in/out changes their ability to renew
13 - Verify that when opted out cron does not renew
14 - Verify that when opted in the item is auto renewed
15 - Reset the due date, opt out, verify manual renewal succeeds

Signed-off-by: Andrew <andrew@bywatersolutions.com>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 55 Nick Clemens 2020-03-23 11:58:05 UTC
Created attachment 101423 [details] [review]
Bug 24476: Rename autorenewal to autorenew_checkouts

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 56 Nick Clemens 2020-03-23 11:58:08 UTC
Created attachment 101424 [details] [review]
Bug 24476: Allow direct editing of autorenew_checkouts by patron

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 57 Nick Clemens 2020-03-23 11:58:11 UTC
Created attachment 101425 [details] [review]
Bug 24476: (QA follow-up) Standardize on 'auto renew(al)' and improve db update

There were several versions: auto renew, auto-renew, autorenew
I've decided to use auto renew (from automatic renewal) to keep
things a bit more consistent.

The DB update was missing AFTER and IGNORE for the sys pref.
Also fixed a tiny typo (tp > to)
Also changed
Comment 58 Nick Clemens 2020-03-23 11:58:14 UTC
Created attachment 101426 [details] [review]
Bug 24476: DO NOT PUSH - Schema changes
Comment 59 Nick Clemens 2020-03-23 11:58:17 UTC
Created attachment 101427 [details] [review]
Bug 24476: Add boolean for TINYINT

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 60 Nick Clemens 2020-03-23 11:59:55 UTC
(In reply to Katrin Fischer from comment #50)
> I am stuck on this one :( 
> 
> The schema update patch would not apply, so I skipped it.
> Tried running DBIC:

The patch after DBIC relies on that one, I rebased them - I left as separate patch as reminder to RM

> Tried running the updatedatabase script (with and without my patch):

Above should fix that

> Can you please check and rabase? Also added a follo-up, please have a look.

Follow-up is good, tests pass so things appear to work
Comment 61 Katrin Fischer 2020-03-24 09:11:44 UTC
Created attachment 101511 [details]
Auto-renew setting in the OPAC

I think the placement of the new option in the OPAC is not ideal, it appears in a very prominent spot, even atop of our warnings and other messages. I'd suggest to move it lower, even below the checkouts table maybe, but below the warnings.

It will also appear for all patron categories independent of if they are set up to have auto-renewals or not. That's out of the scope of this bug - adding for documentation.
Comment 62 Katrin Fischer 2020-03-24 09:16:48 UTC
Created attachment 101512 [details] [review]
Bug 24476: Database updates

Signed-off-by: Andrew <andrew@bywatersolutions.com>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 63 Katrin Fischer 2020-03-24 09:16:52 UTC
Created attachment 101513 [details] [review]
Bug 24476: API Updates

Signed-off-by: Andrew <andrew@bywatersolutions.com>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 64 Katrin Fischer 2020-03-24 09:16:56 UTC
Created attachment 101514 [details] [review]
Bug 24476: Change CanBookBeRenewed and adjust tests

Signed-off-by: Andrew <andrew@bywatersolutions.com>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 65 Katrin Fischer 2020-03-24 09:17:01 UTC
Created attachment 101515 [details] [review]
Bug 24476: Allow patrons to opt out of auto-renewal

To test:
1 - Verify on staff side that patron can be edited to opt in our out of auto renewal
2 - Check out some items to a patron opted in to auto renewal
3 - Ensure the items are checked out and set to autorenew
4 - Login on the opac at the patron
5 - Verify items cannot be renewed as scheduled for auto-renewal
6 - On staff side, opt patron out of auto renewal
7 - Verify on opac items are no longer marked for auto renewal
8 - Run the auto renewal cron job, items are not renewed
9 - Set 'no renewal before' to a setting that would prevent renewal
10 - Verify that opting patron in or out of auto renewal changes only the reason items cannot be renewed
11 - Set 'no renewal before' to a setting that would allow for renewal
12 - Verify that opting patron in/out changes their ability to renew
13 - Verify that when opted out cron does not renew
14 - Verify that when opted in the item is auto renewed
15 - Reset the due date, opt out, verify manual renewal succeeds

Signed-off-by: Andrew <andrew@bywatersolutions.com>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 66 Katrin Fischer 2020-03-24 09:17:05 UTC
Created attachment 101516 [details] [review]
Bug 24476: Rename autorenewal to autorenew_checkouts

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 67 Katrin Fischer 2020-03-24 09:17:10 UTC
Created attachment 101517 [details] [review]
Bug 24476: Allow direct editing of autorenew_checkouts by patron

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 68 Katrin Fischer 2020-03-24 09:17:14 UTC
Created attachment 101518 [details] [review]
Bug 24476: (QA follow-up) Standardize on 'auto renew(al)' and improve db update

There were several versions: auto renew, auto-renew, autorenew
I've decided to use auto renew (from automatic renewal) to keep
things a bit more consistent.

The DB update was missing AFTER and IGNORE for the sys pref.
Also fixed a tiny typo (tp > to)
Also changed

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 69 Katrin Fischer 2020-03-24 09:17:18 UTC
Created attachment 101519 [details] [review]
Bug 24476: DO NOT PUSH - Schema changes

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 70 Katrin Fischer 2020-03-24 09:17:23 UTC
Created attachment 101520 [details] [review]
Bug 24476: Add boolean for TINYINT

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 71 Katrin Fischer 2020-03-24 09:17:27 UTC
Created attachment 101521 [details] [review]
Bug 24476: (QA follow-up) Move new option below warnings and messages in OPAC account

This makes it so the new option appears right above the table of checkouts etc.
but below any warnings, messages or dialogs.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 72 Katrin Fischer 2020-03-24 09:18:25 UTC
(In reply to Katrin Fischer from comment #61)
> Created attachment 101511 [details]
> Auto-renew setting in the OPAC
> 
> I think the placement of the new option in the OPAC is not ideal, it appears
> in a very prominent spot, even atop of our warnings and other messages. I'd
> suggest to move it lower, even below the checkouts table maybe, but below
> the warnings.
> 
> It will also appear for all patron categories independent of if they are set
> up to have auto-renewals or not. That's out of the scope of this bug -
> adding for documentation.

Added a follow up to move it lower (right above the table still) - RM/Nick, please check!
Comment 73 Nick Clemens 2020-03-24 11:23:00 UTC
Created attachment 101542 [details] [review]
Bug 24476: (QA follow-up) Move new option below warnings and messages in OPAC account

This makes it so the new option appears right above the table of checkouts etc.
but below any warnings, messages or dialogs.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 74 Martin Renvoize 2020-03-24 11:33:54 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 75 Joy Nelson 2020-04-03 21:48:11 UTC
enhancement not backported to 19.11.x
Comment 76 Marcel de Rooy 2021-11-29 14:07:38 UTC
See also bug 24988. But if a patron has no autorenewal, he should not even have this choice. It would be useless and confusing.
Comment 77 David Cook 2021-12-01 03:36:16 UTC
(In reply to Marcel de Rooy from comment #76)
> See also bug 24988. But if a patron has no autorenewal, he should not even
> have this choice. It would be useless and confusing.

It could be confusing for patrons to view and update an autorenewal setting if no autorenewals are allowed, but I'm not sure that there is a simple reasonable alternative.

On one hand, you could calculate the circulation rules to determine if a patron is allowed to have autorenewals.

On the other hand, that wouldn't take into account their existing autorenewal checkouts *plus* it's possible to set autorenewals at checkout time.

So determining if an item is autorenewable and whether a patron allows autorenewals seems to me like 2 completely separate things in the end.