A new column issuingrules.no_auto_renewal_after will allow to restrict the auto renewals based on a delay. For instance, if the issue date is 10 days before today, and no_auto_renewal_after is set to 10, tomorrow the issue won't be auto renewed.
Created attachment 46690 [details] [review] Bug 15581: Add a circ rule to limit the auto renewals given a delay This patch adds a new circulation rule (no_auto_renewal_after) to block/allow auto renewals after a given delay. For instance, if the issue date is 10 days before today, and no_auto_renewal_after is set to 10, tomorrow the issue won't be auto renewed. Test plan: 0/ Execute the update DB entry Note: You will have to manually change data in your DB, make sure you have access to the sql cli. 1/ Define a rule with no_auto_renewal_after (10 for instance) and norenewalbefore (5 for instance). (This new rule will behave the same as norenewalbefore: the unit depends on the lengthunit value). The automatic renewals will be done from 5 to 10 days ahead. 2/ Modify the issues.issuedate, to simulate a checkout in the past: UPDATE issues SET issuedate = "yyyy-mm-dd hh:mm:ss" WHERE itemnumber = YOUR_ITEMNUMBER; with issuedate = 2 days before for instance 3/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has not been renewed (too soon) 4/ Repeat step 2 with a due date set as 11 days before 5/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has not been renewed (too late) 6/ Repeat step 2 with a due date set as 7 days before 7/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has been renewed (issues.renewals has been incremented and date_due has been updated according your circ rules). Sponsored-by: University of the Arts London
Created attachment 46691 [details] [review] Bug 15581: Display the latest auto renew date possible when renewing manually If an issue marked as auto_renew is renewed manually, we want to display the latest auto renew date possible. Test plan: 1/ Define circ rules as in the previous patch. 2/ Check a item out, mark it as an auto renewal 3/ Back date the issuedate and make sure it will be too late to renew it 4/ Use the Circulation > renew page (circ/renew.pl) to manually renew this issue. You should get a warning "You barcode has been scheduled for automatic renewal and cannot be renewed anymore since DATE." If the pref AllowRenewalLimitOverride is set, you will be allowed to renew it anyway. Sponsored-by: University of the Arts London
Created attachment 46692 [details] [review] Bug 15581: [DO NOT PUSH] Schema changes
Created attachment 50330 [details] [review] Bug 15581: Add a circ rule to limit the auto renewals given a delay This patch adds a new circulation rule (no_auto_renewal_after) to block/allow auto renewals after a given delay. For instance, if the issue date is 10 days before today, and no_auto_renewal_after is set to 10, tomorrow the issue won't be auto renewed. Test plan: 0/ Execute the update DB entry Note: You will have to manually change data in your DB, make sure you have access to the sql cli. 1/ Define a rule with no_auto_renewal_after (10 for instance) and norenewalbefore (5 for instance). (This new rule will behave the same as norenewalbefore: the unit depends on the lengthunit value). The automatic renewals will be done from 5 to 10 days ahead. 2/ Modify the issues.issuedate, to simulate a checkout in the past: UPDATE issues SET issuedate = "yyyy-mm-dd hh:mm:ss" WHERE itemnumber = YOUR_ITEMNUMBER; with issuedate = 2 days before for instance 3/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has not been renewed (too soon) 4/ Repeat step 2 with a due date set as 11 days before 5/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has not been renewed (too late) 6/ Repeat step 2 with a due date set as 7 days before 7/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has been renewed (issues.renewals has been incremented and date_due has been updated according your circ rules). Sponsored-by: University of the Arts London
Created attachment 50331 [details] [review] Bug 15581: Display the latest auto renew date possible when renewing manually If an issue marked as auto_renew is renewed manually, we want to display the latest auto renew date possible. Test plan: 1/ Define circ rules as in the previous patch. 2/ Check a item out, mark it as an auto renewal 3/ Back date the issuedate and make sure it will be too late to renew it 4/ Use the Circulation > renew page (circ/renew.pl) to manually renew this issue. You should get a warning "You barcode has been scheduled for automatic renewal and cannot be renewed anymore since DATE." If the pref AllowRenewalLimitOverride is set, you will be allowed to renew it anyway. Sponsored-by: University of the Arts London
Created attachment 50332 [details] [review] Bug 15581: [DO NOT PUSH] Schema changes
Patches have been rebased.
Created attachment 50347 [details] [review] Bug 15581: Display the generic "schedule for auto renew" message on the checkouts table
Created attachment 50672 [details] [review] Bug 15581: Add a circ rule to limit the auto renewals given a delay This patch adds a new circulation rule (no_auto_renewal_after) to block/allow auto renewals after a given delay. For instance, if the issue date is 10 days before today, and no_auto_renewal_after is set to 10, tomorrow the issue won't be auto renewed. Test plan: 0/ Execute the update DB entry Note: You will have to manually change data in your DB, make sure you have access to the sql cli. 1/ Define a rule with no_auto_renewal_after (10 for instance) and norenewalbefore (5 for instance). (This new rule will behave the same as norenewalbefore: the unit depends on the lengthunit value). The automatic renewals will be done from 5 to 10 days ahead. 2/ Modify the issues.issuedate, to simulate a checkout in the past: UPDATE issues SET issuedate = "yyyy-mm-dd hh:mm:ss" WHERE itemnumber = YOUR_ITEMNUMBER; with issuedate = 2 days before for instance 3/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has not been renewed (too soon) 4/ Repeat step 2 with a due date set as 11 days before 5/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has not been renewed (too late) 6/ Repeat step 2 with a due date set as 7 days before 7/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has been renewed (issues.renewals has been incremented and date_due has been updated according your circ rules). Sponsored-by: University of the Arts London
Created attachment 50673 [details] [review] Bug 15581: Display the latest auto renew date possible when renewing manually If an issue marked as auto_renew is renewed manually, we want to display the latest auto renew date possible. Test plan: 1/ Define circ rules as in the previous patch. 2/ Check a item out, mark it as an auto renewal 3/ Back date the issuedate and make sure it will be too late to renew it 4/ Use the Circulation > renew page (circ/renew.pl) to manually renew this issue. You should get a warning "You barcode has been scheduled for automatic renewal and cannot be renewed anymore since DATE." If the pref AllowRenewalLimitOverride is set, you will be allowed to renew it anyway. Sponsored-by: University of the Arts London
Created attachment 50674 [details] [review] Bug 15581: [DO NOT PUSH] Schema changes
Created attachment 50675 [details] [review] Bug 15581: Display the generic "schedule for auto renew" message on the checkouts table
Created attachment 50742 [details] [review] Bug 15581: Add a circ rule to limit the auto renewals given a delay
Created attachment 50743 [details] [review] Bug 15581: Display the latest auto renew date possible when renewing manually
Created attachment 50744 [details] [review] Bug 15581: [DO NOT PUSH] Schema changes
Created attachment 50745 [details] [review] Bug 15581: Display the generic "schedule for auto renew" message on the checkouts table
Team Effort, I just uploaded the patched, Jonathan Field Signed them off with the testing help of Janet McGowan and Fiona Borthwick.. go PTFS Europe ;) Progressing to signed off :)
Comment on attachment 50743 [details] [review] Bug 15581: Display the latest auto renew date possible when renewing manually Review of attachment 50743 [details] [review]: ----------------------------------------------------------------- ::: C4/Circulation.pm @@ +3191,5 @@ > + > +=cut > + > +sub GetLatestAutoRenewDate { > + my ( $borrowernumber, $itemnumber ) = @_; You already have the issue, item and patron data where this code is called, why not pass them in? @@ +3195,5 @@ > + my ( $borrowernumber, $itemnumber ) = @_; > + > + my $dbh = C4::Context->dbh; > + > + my $item = GetItem($itemnumber) or return; Re-fetching item we already have. @@ +3196,5 @@ > + > + my $dbh = C4::Context->dbh; > + > + my $item = GetItem($itemnumber) or return; > + my $itemissue = GetItemIssue($itemnumber) or return; Re-fetching issue we already have. @@ +3199,5 @@ > + my $item = GetItem($itemnumber) or return; > + my $itemissue = GetItemIssue($itemnumber) or return; > + > + $borrowernumber ||= $itemissue->{borrowernumber}; > + my $borrower = C4::Members::GetMember( borrowernumber => $borrowernumber ) Re-fetching patron data we already have. ::: circ/renew.pl @@ +83,5 @@ > ); > } > + if ( $error && ( $error eq 'auto_too_late' ) ) { > + $latest_auto_renew_date = C4::Circulation::GetLatestAutoRenewDate( > + $borrower->borrowernumber(), We should pass in the issue, item, and patron objects here.
Would you please update the code to pass the object instead of the keys? It makes sense to avoid fetching all this data multiple times when there is no need to do so.
(In reply to Kyle M Hall from comment #19) > Would you please update the code to pass the object instead of the keys? It > makes sense to avoid fetching all this data multiple times when there is no > need to do so. Kyle, I have written GetLatestAutoRenewDate following the same pattern as GetSoonestRenewDate. I have noticed the inconsistencies in this part of code but opted to keep it as it instead of making the code diverge. If you agree I'd prefer to fix the two subroutines on another bug report, instead of adding a follow-up on this one.
(In reply to Jonathan Druart from comment #20) > (In reply to Kyle M Hall from comment #19) > > Would you please update the code to pass the object instead of the keys? It > > makes sense to avoid fetching all this data multiple times when there is no > > need to do so. > > Kyle, > I have written GetLatestAutoRenewDate following the same pattern as > GetSoonestRenewDate. I have noticed the inconsistencies in this part of code > but opted to keep it as it instead of making the code diverge. > If you agree I'd prefer to fix the two subroutines on another bug report, > instead of adding a follow-up on this one. That sounds like a good plan to me!
(In reply to Kyle M Hall from comment #21) > (In reply to Jonathan Druart from comment #20) > > (In reply to Kyle M Hall from comment #19) > > > Would you please update the code to pass the object instead of the keys? It > > > makes sense to avoid fetching all this data multiple times when there is no > > > need to do so. > > > > Kyle, > > I have written GetLatestAutoRenewDate following the same pattern as > > GetSoonestRenewDate. I have noticed the inconsistencies in this part of code > > but opted to keep it as it instead of making the code diverge. > > If you agree I'd prefer to fix the two subroutines on another bug report, > > instead of adding a follow-up on this one. > > That sounds like a good plan to me! Patches submitted on bug 16413.
Created attachment 53424 [details] [review] Bug 15581: Add a circ rule to limit the auto renewals given a delay This patch adds a new circulation rule (no_auto_renewal_after) to block/allow auto renewals after a given delay. For instance, if the issue date is 10 days before today, and no_auto_renewal_after is set to 10, tomorrow the issue won't be auto renewed. Test plan: 0/ Execute the update DB entry Note: You will have to manually change data in your DB, make sure you have access to the sql cli. 1/ Define a rule with no_auto_renewal_after (10 for instance) and norenewalbefore (5 for instance). (This new rule will behave the same as norenewalbefore: the unit depends on the lengthunit value). The automatic renewals will be done from 5 to 10 days ahead. 2/ Modify the issues.issuedate, to simulate a checkout in the past: UPDATE issues SET issuedate = "yyyy-mm-dd hh:mm:ss" WHERE itemnumber = YOUR_ITEMNUMBER; with issuedate = 2 days before for instance 3/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has not been renewed (too soon) 4/ Repeat step 2 with a due date set as 11 days before 5/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has not been renewed (too late) 6/ Repeat step 2 with a due date set as 7 days before 7/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has been renewed (issues.renewals has been incremented and date_due has been updated according your circ rules). Sponsored-by: University of the Arts London Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Created attachment 53425 [details] [review] Bug 15581: Display the latest auto renew date possible when renewing manually If an issue marked as auto_renew is renewed manually, we want to display the latest auto renew date possible. Test plan: 1/ Define circ rules as in the previous patch. 2/ Check a item out, mark it as an auto renewal 3/ Back date the issuedate and make sure it will be too late to renew it 4/ Use the Circulation > renew page (circ/renew.pl) to manually renew this issue. You should get a warning "You barcode has been scheduled for automatic renewal and cannot be renewed anymore since DATE." If the pref AllowRenewalLimitOverride is set, you will be allowed to renew it anyway. Sponsored-by: University of the Arts London Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Created attachment 53426 [details] [review] Bug 15581: [DO NOT PUSH] Schema changes Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Created attachment 53427 [details] [review] Bug 15581: Display the generic "schedule for auto renew" message on the checkouts table Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Patches rebased (conflict on t/db_dependent/Circulation.t).
Created attachment 55504 [details] [review] Bug 15581: Add a circ rule to limit the auto renewals given a delay This patch adds a new circulation rule (no_auto_renewal_after) to block/allow auto renewals after a given delay. For instance, if the issue date is 10 days before today, and no_auto_renewal_after is set to 10, tomorrow the issue won't be auto renewed. Test plan: 0/ Execute the update DB entry Note: You will have to manually change data in your DB, make sure you have access to the sql cli. 1/ Define a rule with no_auto_renewal_after (10 for instance) and norenewalbefore (5 for instance). (This new rule will behave the same as norenewalbefore: the unit depends on the lengthunit value). The automatic renewals will be done from 5 to 10 days ahead. 2/ Modify the issues.issuedate, to simulate a checkout in the past: UPDATE issues SET issuedate = "yyyy-mm-dd hh:mm:ss" WHERE itemnumber = YOUR_ITEMNUMBER; with issuedate = 2 days before for instance 3/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has not been renewed (too soon) 4/ Repeat step 2 with a due date set as 11 days before 5/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has not been renewed (too late) 6/ Repeat step 2 with a due date set as 7 days before 7/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has been renewed (issues.renewals has been incremented and date_due has been updated according your circ rules). Sponsored-by: University of the Arts London Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Created attachment 55505 [details] [review] Bug 15581: Display the latest auto renew date possible when renewing manually If an issue marked as auto_renew is renewed manually, we want to display the latest auto renew date possible. Test plan: 1/ Define circ rules as in the previous patch. 2/ Check a item out, mark it as an auto renewal 3/ Back date the issuedate and make sure it will be too late to renew it 4/ Use the Circulation > renew page (circ/renew.pl) to manually renew this issue. You should get a warning "You barcode has been scheduled for automatic renewal and cannot be renewed anymore since DATE." If the pref AllowRenewalLimitOverride is set, you will be allowed to renew it anyway. Sponsored-by: University of the Arts London Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Created attachment 55506 [details] [review] Bug 15581: Display the generic "schedule for auto renew" message on the checkouts table Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Created attachment 55507 [details] [review] Bug 15581: [DO NOT PUSH] Schema changes Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Created attachment 56746 [details] [review] Bug 15581: Add a circ rule to limit the auto renewals given a delay This patch adds a new circulation rule (no_auto_renewal_after) to block/allow auto renewals after a given delay. For instance, if the issue date is 10 days before today, and no_auto_renewal_after is set to 10, tomorrow the issue won't be auto renewed. Test plan: 0/ Execute the update DB entry Note: You will have to manually change data in your DB, make sure you have access to the sql cli. 1/ Define a rule with no_auto_renewal_after (10 for instance) and norenewalbefore (5 for instance). (This new rule will behave the same as norenewalbefore: the unit depends on the lengthunit value). The automatic renewals will be done from 5 to 10 days ahead. 2/ Modify the issues.issuedate, to simulate a checkout in the past: UPDATE issues SET issuedate = "yyyy-mm-dd hh:mm:ss" WHERE itemnumber = YOUR_ITEMNUMBER; with issuedate = 2 days before for instance 3/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has not been renewed (too soon) 4/ Repeat step 2 with a due date set as 11 days before 5/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has not been renewed (too late) 6/ Repeat step 2 with a due date set as 7 days before 7/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has been renewed (issues.renewals has been incremented and date_due has been updated according your circ rules). Sponsored-by: University of the Arts London Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Created attachment 56747 [details] [review] Bug 15581: Display the latest auto renew date possible when renewing manually If an issue marked as auto_renew is renewed manually, we want to display the latest auto renew date possible. Test plan: 1/ Define circ rules as in the previous patch. 2/ Check a item out, mark it as an auto renewal 3/ Back date the issuedate and make sure it will be too late to renew it 4/ Use the Circulation > renew page (circ/renew.pl) to manually renew this issue. You should get a warning "You barcode has been scheduled for automatic renewal and cannot be renewed anymore since DATE." If the pref AllowRenewalLimitOverride is set, you will be allowed to renew it anyway. Sponsored-by: University of the Arts London Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Created attachment 56748 [details] [review] Bug 15581: Display the generic "schedule for auto renew" message on the checkouts table Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Created attachment 56749 [details] [review] Bug 15581: [DO NOT PUSH] Schema changes Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Patches rebased. ( Make sure 'Bug 16850: Adjust number of tests' is pushed otherwise you will get a conflict. )
There is a conflict in the Schema changes file. I am regenerating them locally and obsolete the patch here.
Comment on attachment 56748 [details] [review] Bug 15581: Display the generic "schedule for auto renew" message on the checkouts table Review of attachment 56748 [details] [review]: ----------------------------------------------------------------- ::: koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc @@ +17,4 @@ > var NOT_RENEWABLE = _("Not renewable"); > var NOT_RENEWABLE_TOO_SOON = _("No renewal before %s"); > var NOT_RENEWABLE_AUTO_TOO_SOON = _("Scheduled for automatic renewal"); > + var NOT_RENEWABLE_AUTO_TOO_LATE = _("Scheduled for automatic renewal"); I feel like the TOO_SOON and TOO_LATE messages should be more specific - it seems to hide important information here.
Writing a quick summary about how this works for the next reader: In the circulation conditions there is a new value "no automatic renewal after". This means that "after you have checked out the item for more than X days, there will be no more automatic renewals". Ok, 2 things: 1) Couldn't test in the OPAC, because of: Software error: Template process failed: undef error - The method is_expired is not covered by tests! at /home/vagrant/kohaclone/C4/Templates.pm line 121. For help, please send mail to the webmaster ([no address given]), giving this error message and the time and date of the error. 2) In the circulation interface it will show "Scheduled for automatic renewal" when this won't happen again because the item has already been checked out for too long. I think this will lead to confusion. Could we make this message more specific?
(In reply to Katrin Fischer from comment #39) > Writing a quick summary about how this works for the next reader: > In the circulation conditions there is a new value "no automatic renewal > after". This means that "after you have checked out the item for more than X > days, there will be no more automatic renewals". > > Ok, 2 things: > > 1) Couldn't test in the OPAC, because of: > Software error: > > Template process failed: undef error - The method is_expired is not covered > by tests! at /home/vagrant/kohaclone/C4/Templates.pm line 121. > > For help, please send mail to the webmaster ([no address given]), giving > this error message and the time and date of the error. Exists on master and will be fixed by bug 17517. > 2) In the circulation interface it will show "Scheduled for automatic > renewal" when this won't happen again because the item has already been > checked out for too long. I think this will lead to confusion. Could we make > this message more specific? What do you suggest?
(In reply to Jonathan Druart from comment #40) > (In reply to Katrin Fischer from comment #39) > > Writing a quick summary about how this works for the next reader: > > In the circulation conditions there is a new value "no automatic renewal > > after". This means that "after you have checked out the item for more than X > > days, there will be no more automatic renewals". > > > > Ok, 2 things: > > > > 1) Couldn't test in the OPAC, because of: > > Software error: > > > > Template process failed: undef error - The method is_expired is not covered > > by tests! at /home/vagrant/kohaclone/C4/Templates.pm line 121. > > > > For help, please send mail to the webmaster ([no address given]), giving > > this error message and the time and date of the error. > > Exists on master and will be fixed by bug 17517. > > > 2) In the circulation interface it will show "Scheduled for automatic > > renewal" when this won't happen again because the item has already been > > checked out for too long. I think this will lead to confusion. Could we make > > this message more specific? > > What do you suggest? Something like "Can no longer be auto-renewed - number of checkout days exceeded" ?(In reply to Jonathan Druart from comment #40) > (In reply to Katrin Fischer from comment #39) > > Writing a quick summary about how this works for the next reader: > > In the circulation conditions there is a new value "no automatic renewal > > after". This means that "after you have checked out the item for more than X > > days, there will be no more automatic renewals". > > > > Ok, 2 things: > > > > 1) Couldn't test in the OPAC, because of: > > Software error: > > > > Template process failed: undef error - The method is_expired is not covered > > by tests! at /home/vagrant/kohaclone/C4/Templates.pm line 121. > > > > For help, please send mail to the webmaster ([no address given]), giving > > this error message and the time and date of the error. > > Exists on master and will be fixed by bug 17517. > > > 2) In the circulation interface it will show "Scheduled for automatic > > renewal" when this won't happen again because the item has already been > > checked out for too long. I think this will lead to confusion. Could we make > > this message more specific? > > What do you suggest? (In reply to Jonathan Druart from comment #40) > (In reply to Katrin Fischer from comment #39) > > Writing a quick summary about how this works for the next reader: > > In the circulation conditions there is a new value "no automatic renewal > > after". This means that "after you have checked out the item for more than X > > days, there will be no more automatic renewals". > > > > Ok, 2 things: > > > > 1) Couldn't test in the OPAC, because of: > > Software error: > > > > Template process failed: undef error - The method is_expired is not covered > > by tests! at /home/vagrant/kohaclone/C4/Templates.pm line 121. > > > > For help, please send mail to the webmaster ([no address given]), giving > > this error message and the time and date of the error. > > Exists on master and will be fixed by bug 17517. > > > 2) In the circulation interface it will show "Scheduled for automatic > > renewal" when this won't happen again because the item has already been > > checked out for too long. I think this will lead to confusion. Could we make > > this message more specific? > > What do you suggest?
Created attachment 56961 [details] [review] Bug 15581: Add a circ rule to limit the auto renewals given a delay This patch adds a new circulation rule (no_auto_renewal_after) to block/allow auto renewals after a given delay. For instance, if the issue date is 10 days before today, and no_auto_renewal_after is set to 10, tomorrow the issue won't be auto renewed. Test plan: 0/ Execute the update DB entry Note: You will have to manually change data in your DB, make sure you have access to the sql cli. 1/ Define a rule with no_auto_renewal_after (10 for instance) and norenewalbefore (5 for instance). (This new rule will behave the same as norenewalbefore: the unit depends on the lengthunit value). The automatic renewals will be done from 5 to 10 days ahead. 2/ Modify the issues.issuedate, to simulate a checkout in the past: UPDATE issues SET issuedate = "yyyy-mm-dd hh:mm:ss" WHERE itemnumber = YOUR_ITEMNUMBER; with issuedate = 2 days before for instance 3/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has not been renewed (too soon) 4/ Repeat step 2 with a due date set as 11 days before 5/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has not been renewed (too late) 6/ Repeat step 2 with a due date set as 7 days before 7/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has been renewed (issues.renewals has been incremented and date_due has been updated according your circ rules). Sponsored-by: University of the Arts London Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Created attachment 56962 [details] [review] Bug 15581: Display the latest auto renew date possible when renewing manually If an issue marked as auto_renew is renewed manually, we want to display the latest auto renew date possible. Test plan: 1/ Define circ rules as in the previous patch. 2/ Check a item out, mark it as an auto renewal 3/ Back date the issuedate and make sure it will be too late to renew it 4/ Use the Circulation > renew page (circ/renew.pl) to manually renew this issue. You should get a warning "You barcode has been scheduled for automatic renewal and cannot be renewed anymore since DATE." If the pref AllowRenewalLimitOverride is set, you will be allowed to renew it anyway. Sponsored-by: University of the Arts London Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Created attachment 56963 [details] [review] Bug 15581: Display the generic "schedule for auto renew" message on the checkouts table Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Created attachment 56964 [details] [review] Bug 15581: Change wording for auto too late
Patches rebased and wording updated according to Janet's suggestion.
Created attachment 56982 [details] [review] Bug 15581: Change wording for auto too late
This works alright, but my concern is the message we display to the user in the OPAC: Automatic renewal (2 of 3 renewals remaining) My suggestion would be to show a message about renewals being impossible and remove the (2 of 3 renewals remaining) both in staff and the OPAC.
Created attachment 57034 [details] [review] [PASSED QA] Bug 15581: Add a circ rule to limit the auto renewals given a delay This patch adds a new circulation rule (no_auto_renewal_after) to block/allow auto renewals after a given delay. For instance, if the issue date is 10 days before today, and no_auto_renewal_after is set to 10, tomorrow the issue won't be auto renewed. Test plan: 0/ Execute the update DB entry Note: You will have to manually change data in your DB, make sure you have access to the sql cli. 1/ Define a rule with no_auto_renewal_after (10 for instance) and norenewalbefore (5 for instance). (This new rule will behave the same as norenewalbefore: the unit depends on the lengthunit value). The automatic renewals will be done from 5 to 10 days ahead. 2/ Modify the issues.issuedate, to simulate a checkout in the past: UPDATE issues SET issuedate = "yyyy-mm-dd hh:mm:ss" WHERE itemnumber = YOUR_ITEMNUMBER; with issuedate = 2 days before for instance 3/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has not been renewed (too soon) 4/ Repeat step 2 with a due date set as 11 days before 5/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has not been renewed (too late) 6/ Repeat step 2 with a due date set as 7 days before 7/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has been renewed (issues.renewals has been incremented and date_due has been updated according your circ rules). Sponsored-by: University of the Arts London Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Created attachment 57035 [details] [review] [PASSED QA] Bug 15581: Display the latest auto renew date possible when renewing manually If an issue marked as auto_renew is renewed manually, we want to display the latest auto renew date possible. Test plan: 1/ Define circ rules as in the previous patch. 2/ Check a item out, mark it as an auto renewal 3/ Back date the issuedate and make sure it will be too late to renew it 4/ Use the Circulation > renew page (circ/renew.pl) to manually renew this issue. You should get a warning "You barcode has been scheduled for automatic renewal and cannot be renewed anymore since DATE." If the pref AllowRenewalLimitOverride is set, you will be allowed to renew it anyway. Sponsored-by: University of the Arts London Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Created attachment 57036 [details] [review] [PASSED QA] Bug 15581: Display the generic "schedule for auto renew" message on the checkouts table Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Created attachment 57037 [details] [review] [PASSED QA] Bug 15581: Change wording for auto too late Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Created attachment 57038 [details] [review] Bug 15581: Follow-up - suggested change to the OPAC message Instead of showing "Automatic renewal" to the user, this changes it to show "No longer renewable" when the automatic renewal won't happen any longer because of the days the item has already been checked out.
Last patch is a suggestion - I think it's better than to indicate that renewals will still happen, but might need rephrasing. I was not sure how much information to give to the patron about the reasoning, so I kept it general.
(In reply to Katrin Fischer from comment #54) > Last patch is a suggestion - I think it's better than to indicate that > renewals will still happen, but might need rephrasing. I was not sure how > much information to give to the patron about the reasoning, so I kept it > general. I think that reads fine to me. We can tweak the wording later based on real user feedback if necessary.
Pushed to master for 16.05, thanks Jonathan, Katrin!
(In reply to Kyle M Hall from comment #56) > Pushed to master for 16.05, thanks Jonathan, Katrin! hi Kyle, i think you mean 'Pushed to master for 16.11'? :)
Contains DB changes, passing for 16.05.x series
Pushed to master for 16.05, thanks Jonathan!