Our library wants a new “automatic renewal” feature, that enables some patrons to borrow items for a long time, without having to renew manually. So for certain combinations of patron category and item type, renewals will be done by a cronjob. Automatic renewal stops when a hold is placed or when the given number of allowed renewals is exceeded. RFC: http://wiki.koha-community.org/wiki/Automatic_renewal_RFC
Created attachment 28425 [details] [review] Bug 11577: Add auto_renew flags to the database - issues.auto_renew - old_issues.auto_renew - issuingrules.auto_renew Default value is zero. To test: 1) Run installer/data/mysql/updatedatabase.pl 2) Create SQL reports like: SELECT * FROM issues LIMIT 0,1 3) Confirm that a column auto_renew was added to each of the three tables. Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 28426 [details] [review] Bug 11577: Add "Automatic renewal" to the circulation and fine rules This patch adds a column "Automatic renewal" to the circulation and fine rules table. To test: 1) Add or edit some issuing rules. 2) Confirm that "Automatic Renewal" is set to "No" by default and can be switched to "Yes". Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 28427 [details] [review] Bug 11577: Code and intranet template changes This patch adds a checkbox for "Automatic renewal" to the checkout page. CanBookBeRenewed is modified to include two new errors: - auto_renew (renewal shouldn't be done manually) - auto_too_soon (renewal is premature and shouldn't be done manually) To test: 1) Add or edit an issuing rule with "Automatic renewal" and another one without it. 2) Issue at least three items: - automatic renewal by issuing rule - automatic renewal by Checkbox on the checkout page - no automatic renewal 3) Test the following steps for both: Home > Circulation > Checkouts Home > Patrons > Patron details 4) Confirm that issues with automatic renewal cannot be renewed manually, even if there are still renewals left and it's not too soon to renew. 5) Confirm that "Automatic renewal" and the remaining renewals are displayed. If no renewals are left "Not renewable" should be displayed. 6) Confirm that issues without automatic renewal behave as usual. Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 28428 [details] [review] Bug 11577: Add 'auto_renew' and 'auto_too_soon' to renewal page This patch adds the new renewal errors 'auto_renew' and 'auto_too_soon' to the renewal interface. To test: 1) Issue two items: - one with automatic renewal and no value for "No renewal before" - another with automatic renewal and a value for "No renewal before" 2) Try to renew: Home > Circulation > Renew 3) Confirm there are error messages explaining that the items have been sheduled for automatic renewal and that one of the renewals is also premature. 4) If global syspref AllowRenewalLimitOverride is set to "Allow" you should be given the option to override. Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 28429 [details] [review] Bug 11577: Expand description of AllowRenewalLimitOverride With the introduction of the new automatic renewal feature global syspref AllowRenewalLimitOverride is expanded in meaning. It now gives the option to override blocks if: - the number of allowed renewals is exceeded - the renewal is premature (No renewal before) - the item is sheduled for automatic renewal - the renewal is premature and the item is sheduled for automatic renewal Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 28430 [details] [review] Bug 11577: OPAC bootstrap theme changes This patch makes opac-user.pl and the bootstrap version of opac-user.tt handle the new renewal errors "auto_renew" and "auto_too_soon". To test: 1) Set global syspref "opacthemes" to bootstrap. 2) Set global syspref "OpacRenewalAllowed" to Allow. 3) Test the same things as in previous patch, this time for the OPAC summary page. Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 28431 [details] [review] Bug 11577: OPAC prog theme changes This patch makes the prog version of opac-user.tt handle the new renewal errors "auto_renew" and "auto_too_soon". To test: 1) Set global syspref "opacthemes" to prog. 2) Test the same things as in previous patch. Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 28432 [details] [review] Bug 11577: Add an automatic renewal cronjob This patch adds a new cron script automatic_renewals.pl and a new entry in crontab.example. To test: 1) You need a few issues, some with automatic renewal and some without. 2) Confirm that each time you run misc/cronjobs/automatic_renewals.pl those issues are renewed that meet all of the following criteria: - automatic renewal has been sheduled either by issuing rule or by checkbox on the checkout page - the number of allowed renewals isn't exceeded - renewal isn't premature (No renewal before) 3) Confirm that all other issues are not affected. Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 28433 [details] [review] Bug 11577: Unit tests This patch fixes a few unit tests that broke because of the new feature. To test: 1) prove t/db_dependent/Circulation.t 2) prove t/db_dependent/Circulation_Issuingrule.t 3) prove t/db_dependent/Circulation_issue.t Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 28434 [details] [review] Bug 11577: Add Hochschule für Gesundheit to contributing institutions Automatic renewal is the second feature sponsored by the hsg. Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 28454 [details] [review] Bug 11577: Add auto_renew flags to the database - issues.auto_renew - old_issues.auto_renew - issuingrules.auto_renew Default value is zero. To test: 1) Run installer/data/mysql/updatedatabase.pl 2) Create SQL reports like: SELECT * FROM issues LIMIT 0,1 3) Confirm that a column auto_renew was added to each of the three tables. Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Only the first patch of this series broke with the transition from 3.15 to 3.17. I rebased and re-uploaded just this single patch. Or should I rather upload the whole series in correct order?
Created attachment 28595 [details] [review] Bug 11577: Add auto_renew flags to the database - issues.auto_renew - old_issues.auto_renew - issuingrules.auto_renew Default value is zero. To test: 1) Run installer/data/mysql/updatedatabase.pl 2) Create SQL reports like: SELECT * FROM issues LIMIT 0,1 3) Confirm that a column auto_renew was added to each of the three tables. Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 28596 [details] [review] Bug 11577: Add "Automatic renewal" to the circulation and fine rules This patch adds a column "Automatic renewal" to the circulation and fine rules table. To test: 1) Add or edit some issuing rules. 2) Confirm that "Automatic Renewal" is set to "No" by default and can be switched to "Yes". Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 28597 [details] [review] Bug 11577: Code and intranet template changes This patch adds a checkbox for "Automatic renewal" to the checkout page. CanBookBeRenewed is modified to include two new errors: - auto_renew (renewal shouldn't be done manually) - auto_too_soon (renewal is premature and shouldn't be done manually) To test: 1) Add or edit an issuing rule with "Automatic renewal" and another one without it. 2) Issue at least three items: - automatic renewal by issuing rule - automatic renewal by Checkbox on the checkout page - no automatic renewal 3) Test the following steps for both: Home > Circulation > Checkouts Home > Patrons > Patron details 4) Confirm that issues with automatic renewal cannot be renewed manually, even if there are still renewals left and it's not too soon to renew. 5) Confirm that "Automatic renewal" and the remaining renewals are displayed. If no renewals are left "Not renewable" should be displayed. 6) Confirm that issues without automatic renewal behave as usual. Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 28598 [details] [review] Bug 11577: Add 'auto_renew' and 'auto_too_soon' to renewal page This patch adds the new renewal errors 'auto_renew' and 'auto_too_soon' to the renewal interface. To test: 1) Issue two items: - one with automatic renewal and no value for "No renewal before" - another with automatic renewal and a value for "No renewal before" 2) Try to renew: Home > Circulation > Renew 3) Confirm there are error messages explaining that the items have been sheduled for automatic renewal and that one of the renewals is also premature. 4) If global syspref AllowRenewalLimitOverride is set to "Allow" you should be given the option to override. Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 28599 [details] [review] Bug 11577: Expand description of AllowRenewalLimitOverride With the introduction of the new automatic renewal feature global syspref AllowRenewalLimitOverride is expanded in meaning. It now gives the option to override blocks if: - the number of allowed renewals is exceeded - the renewal is premature (No renewal before) - the item is sheduled for automatic renewal - the renewal is premature and the item is sheduled for automatic renewal Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 28600 [details] [review] Bug 11577: OPAC bootstrap theme changes This patch makes opac-user.pl and the bootstrap version of opac-user.tt handle the new renewal errors "auto_renew" and "auto_too_soon". To test: 1) Set global syspref "opacthemes" to bootstrap. 2) Set global syspref "OpacRenewalAllowed" to Allow. 3) Test the same things as in previous patch, this time for the OPAC summary page. Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 28601 [details] [review] Bug 11577: OPAC prog theme changes This patch makes the prog version of opac-user.tt handle the new renewal errors "auto_renew" and "auto_too_soon". To test: 1) Set global syspref "opacthemes" to prog. 2) Test the same things as in previous patch. Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 28602 [details] [review] Bug 11577: Add an automatic renewal cronjob This patch adds a new cron script automatic_renewals.pl and a new entry in crontab.example. To test: 1) You need a few issues, some with automatic renewal and some without. 2) Confirm that each time you run misc/cronjobs/automatic_renewals.pl those issues are renewed that meet all of the following criteria: - automatic renewal has been sheduled either by issuing rule or by checkbox on the checkout page - the number of allowed renewals isn't exceeded - renewal isn't premature (No renewal before) 3) Confirm that all other issues are not affected. Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 28603 [details] [review] Bug 11577: Unit tests This patch fixes a few unit tests that broke because of the new feature. To test: 1) prove t/db_dependent/Circulation.t 2) prove t/db_dependent/Circulation_Issuingrule.t 3) prove t/db_dependent/Circulation_issue.t Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 28604 [details] [review] Bug 11577: Add Hochschule für Gesundheit to contributing institutions Automatic renewal is the second feature sponsored by the hsg. Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 29393 [details] [review] Bug 11577: Add auto_renew flags to the database - issues.auto_renew - old_issues.auto_renew - issuingrules.auto_renew Default value is zero. To test: 1) Run installer/data/mysql/updatedatabase.pl 2) Create SQL reports like: SELECT * FROM issues LIMIT 0,1 3) Confirm that a column auto_renew was added to each of the three tables. Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 29394 [details] [review] Bug 11577: Add "Automatic renewal" to the circulation and fine rules This patch adds a column "Automatic renewal" to the circulation and fine rules table. To test: 1) Add or edit some issuing rules. 2) Confirm that "Automatic Renewal" is set to "No" by default and can be switched to "Yes". Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 29395 [details] [review] Bug 11577: Code and intranet template changes This patch adds a checkbox for "Automatic renewal" to the checkout page. CanBookBeRenewed is modified to include two new errors: - auto_renew (renewal shouldn't be done manually) - auto_too_soon (renewal is premature and shouldn't be done manually) To test: 1) Add or edit an issuing rule with "Automatic renewal" and another one without it. 2) Issue at least three items: - automatic renewal by issuing rule - automatic renewal by Checkbox on the checkout page - no automatic renewal 3) Test the following steps for both: Home > Circulation > Checkouts Home > Patrons > Patron details 4) Confirm that issues with automatic renewal cannot be renewed manually, even if there are still renewals left and it's not too soon to renew. 5) Confirm that "Automatic renewal" and the remaining renewals are displayed. If no renewals are left "Not renewable" should be displayed. 6) Confirm that issues without automatic renewal behave as usual. Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 29396 [details] [review] Bug 11577: Add 'auto_renew' and 'auto_too_soon' to renewal page This patch adds the new renewal errors 'auto_renew' and 'auto_too_soon' to the renewal interface. To test: 1) Issue two items: - one with automatic renewal and no value for "No renewal before" - another with automatic renewal and a value for "No renewal before" 2) Try to renew: Home > Circulation > Renew 3) Confirm there are error messages explaining that the items have been sheduled for automatic renewal and that one of the renewals is also premature. 4) If global syspref AllowRenewalLimitOverride is set to "Allow" you should be given the option to override. Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 29397 [details] [review] Bug 11577: Expand description of AllowRenewalLimitOverride With the introduction of the new automatic renewal feature global syspref AllowRenewalLimitOverride is expanded in meaning. It now gives the option to override blocks if: - the number of allowed renewals is exceeded - the renewal is premature (No renewal before) - the item is sheduled for automatic renewal - the renewal is premature and the item is sheduled for automatic renewal Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 29398 [details] [review] Bug 11577: OPAC bootstrap theme changes This patch makes opac-user.pl and the bootstrap version of opac-user.tt handle the new renewal errors "auto_renew" and "auto_too_soon". To test: 1) Set global syspref "opacthemes" to bootstrap. 2) Set global syspref "OpacRenewalAllowed" to Allow. 3) Test the same things as in previous patch, this time for the OPAC summary page. Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 29399 [details] [review] Bug 11577: OPAC prog theme changes This patch makes the prog version of opac-user.tt handle the new renewal errors "auto_renew" and "auto_too_soon". To test: 1) Set global syspref "opacthemes" to prog. 2) Test the same things as in previous patch. Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 29400 [details] [review] Bug 11577: Add an automatic renewal cronjob This patch adds a new cron script automatic_renewals.pl and a new entry in crontab.example. To test: 1) You need a few issues, some with automatic renewal and some without. 2) Confirm that each time you run misc/cronjobs/automatic_renewals.pl those issues are renewed that meet all of the following criteria: - automatic renewal has been sheduled either by issuing rule or by checkbox on the checkout page - the number of allowed renewals isn't exceeded - renewal isn't premature (No renewal before) 3) Confirm that all other issues are not affected. Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 29401 [details] [review] Bug 11577: Unit tests This patch fixes a few unit tests that broke because of the new feature. To test: 1) prove t/db_dependent/Circulation.t 2) prove t/db_dependent/Circulation_Issuingrule.t 3) prove t/db_dependent/Circulation_issue.t Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 29402 [details] [review] Bug 11577: Add Hochschule für Gesundheit to contributing institutions Automatic renewal is the second feature sponsored by the hsg. Sponsored-by: Hochschule für Gesundheit (hsg), Germany
The 3rd patch does not apply cleanly, a couple of conflicts. The first 2 apply cleanly and I am happy to sign them off, I wont upload them yet, or it will mess up the order, but if you can rebase, Im happy to try signing off the rest again.
Created attachment 29966 [details] [review] Bug 11577: Add auto_renew flags to the database - issues.auto_renew - old_issues.auto_renew - issuingrules.auto_renew Default value is zero. To test: 1) Run installer/data/mysql/updatedatabase.pl 2) Create SQL reports like: SELECT * FROM issues LIMIT 0,1 3) Confirm that a column auto_renew was added to each of the three tables. Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 29967 [details] [review] Bug 11577: Add "Automatic renewal" to the circulation and fine rules This patch adds a column "Automatic renewal" to the circulation and fine rules table. To test: 1) Add or edit some issuing rules. 2) Confirm that "Automatic Renewal" is set to "No" by default and can be switched to "Yes". Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 29968 [details] [review] Bug 11577: Code and intranet template changes This patch adds a checkbox for "Automatic renewal" to the checkout page. CanBookBeRenewed is modified to include two new errors: - auto_renew (renewal shouldn't be done manually) - auto_too_soon (renewal is premature and shouldn't be done manually) To test: 1) Add or edit an issuing rule with "Automatic renewal" and another one without it. 2) Issue at least three items: - automatic renewal by issuing rule - automatic renewal by Checkbox on the checkout page - no automatic renewal 3) Test the following steps for both: Home > Circulation > Checkouts Home > Patrons > Patron details 4) Confirm that issues with automatic renewal cannot be renewed manually, even if there are still renewals left and it's not too soon to renew. 5) Confirm that "Scheduled for automatic renewal" and the remaining renewals are displayed. If no renewals are left "Not renewable" should be displayed. 6) Confirm that issues without automatic renewal behave as usual. Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 29969 [details] [review] Bug 11577: Add 'auto_renew' and 'auto_too_soon' to renewal page This patch adds the new renewal errors 'auto_renew' and 'auto_too_soon' to the renewal interface. To test: 1) Issue two items: - one with automatic renewal and no value for "No renewal before" - another with automatic renewal and a value for "No renewal before" 2) Try to renew: Home > Circulation > Renew 3) Confirm there are error messages explaining that the items have been scheduled for automatic renewal and that one of the renewals is also premature. 4) If global syspref AllowRenewalLimitOverride is set to "Allow" you should be given the option to override. Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 29970 [details] [review] Bug 11577: Expand description of AllowRenewalLimitOverride With the introduction of the new automatic renewal feature global syspref AllowRenewalLimitOverride is expanded in meaning. It now gives the option to override blocks if: - the number of allowed renewals is exceeded - the renewal is premature (No renewal before) - the item is scheduled for automatic renewal - the renewal is premature and the item is scheduled for automatic renewal Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 29971 [details] [review] Bug 11577: OPAC bootstrap theme changes This patch makes opac-user.pl and the bootstrap version of opac-user.tt handle the new renewal errors "auto_renew" and "auto_too_soon". To test: 1) Set global syspref "opacthemes" to bootstrap. 2) Set global syspref "OpacRenewalAllowed" to Allow. 3) Test the same things as in previous patch, this time for the OPAC summary page. Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 29972 [details] [review] Bug 11577: OPAC prog theme changes This patch makes the prog version of opac-user.tt handle the new renewal errors "auto_renew" and "auto_too_soon". To test: 1) Set global syspref "opacthemes" to prog. 2) Test the same things as in previous patch. Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 29973 [details] [review] Bug 11577: Add an automatic renewal cronjob This patch adds a new cron script automatic_renewals.pl and a new entry in crontab.example. To test: 1) You need a few issues, some with automatic renewal and some without. 2) Confirm that each time you run misc/cronjobs/automatic_renewals.pl those issues are renewed that meet all of the following criteria: - automatic renewal has been scheduled either by issuing rule or by checkbox on the checkout page - the number of allowed renewals isn't exceeded - renewal isn't premature (No renewal before) 3) Confirm that all other issues are not affected. Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 29974 [details] [review] Bug 11577: Unit tests This patch fixes a few unit tests that broke because of the new feature. To test: 1) prove t/db_dependent/Circulation.t 2) prove t/db_dependent/Circulation_Issuingrule.t 3) prove t/db_dependent/Circulation_issue.t Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Created attachment 29975 [details] [review] Bug 11577: Add Hochschule für Gesundheit to contributing institutions Automatic renewal is the second feature sponsored by the hsg. Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Thank you for testing, Chris! :) I rebased and switched back to "Needs signoff".
Created attachment 30248 [details] [review] Bug 11577: Add auto_renew flags to the database - issues.auto_renew - old_issues.auto_renew - issuingrules.auto_renew Default value is zero. To test: 1) Run installer/data/mysql/updatedatabase.pl 2) Create SQL reports like: SELECT * FROM issues LIMIT 0,1 3) Confirm that a column auto_renew was added to each of the three tables. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 30249 [details] [review] Bug 11577: Add "Automatic renewal" to the circulation and fine rules This patch adds a column "Automatic renewal" to the circulation and fine rules table. To test: 1) Add or edit some issuing rules. 2) Confirm that "Automatic Renewal" is set to "No" by default and can be switched to "Yes". Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 30250 [details] [review] Bug 11577: Code and intranet template changes This patch adds a checkbox for "Automatic renewal" to the checkout page. CanBookBeRenewed is modified to include two new errors: - auto_renew (renewal shouldn't be done manually) - auto_too_soon (renewal is premature and shouldn't be done manually) To test: 1) Add or edit an issuing rule with "Automatic renewal" and another one without it. 2) Issue at least three items: - automatic renewal by issuing rule - automatic renewal by Checkbox on the checkout page - no automatic renewal 3) Test the following steps for both: Home > Circulation > Checkouts Home > Patrons > Patron details 4) Confirm that issues with automatic renewal cannot be renewed manually, even if there are still renewals left and it's not too soon to renew. 5) Confirm that "Scheduled for automatic renewal" and the remaining renewals are displayed. If no renewals are left "Not renewable" should be displayed. 6) Confirm that issues without automatic renewal behave as usual. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 30251 [details] [review] Bug 11577: Add 'auto_renew' and 'auto_too_soon' to renewal page This patch adds the new renewal errors 'auto_renew' and 'auto_too_soon' to the renewal interface. To test: 1) Issue two items: - one with automatic renewal and no value for "No renewal before" - another with automatic renewal and a value for "No renewal before" 2) Try to renew: Home > Circulation > Renew 3) Confirm there are error messages explaining that the items have been scheduled for automatic renewal and that one of the renewals is also premature. 4) If global syspref AllowRenewalLimitOverride is set to "Allow" you should be given the option to override. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 30252 [details] [review] Bug 11577: Expand description of AllowRenewalLimitOverride With the introduction of the new automatic renewal feature global syspref AllowRenewalLimitOverride is expanded in meaning. It now gives the option to override blocks if: - the number of allowed renewals is exceeded - the renewal is premature (No renewal before) - the item is scheduled for automatic renewal - the renewal is premature and the item is scheduled for automatic renewal Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 30253 [details] [review] Bug 11577: OPAC bootstrap theme changes This patch makes opac-user.pl and the bootstrap version of opac-user.tt handle the new renewal errors "auto_renew" and "auto_too_soon". To test: 1) Set global syspref "opacthemes" to bootstrap. 2) Set global syspref "OpacRenewalAllowed" to Allow. 3) Test the same things as in previous patch, this time for the OPAC summary page. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 30254 [details] [review] Bug 11577: OPAC prog theme changes This patch makes the prog version of opac-user.tt handle the new renewal errors "auto_renew" and "auto_too_soon". To test: 1) Set global syspref "opacthemes" to prog. 2) Test the same things as in previous patch. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 30255 [details] [review] Bug 11577: Add an automatic renewal cronjob This patch adds a new cron script automatic_renewals.pl and a new entry in crontab.example. To test: 1) You need a few issues, some with automatic renewal and some without. 2) Confirm that each time you run misc/cronjobs/automatic_renewals.pl those issues are renewed that meet all of the following criteria: - automatic renewal has been scheduled either by issuing rule or by checkbox on the checkout page - the number of allowed renewals isn't exceeded - renewal isn't premature (No renewal before) 3) Confirm that all other issues are not affected. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 30256 [details] [review] Bug 11577: Unit tests This patch fixes a few unit tests that broke because of the new feature. To test: 1) prove t/db_dependent/Circulation.t 2) prove t/db_dependent/Circulation_Issuingrule.t 3) prove t/db_dependent/Circulation_issue.t Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 30257 [details] [review] Bug 11577: Add Hochschule für Gesundheit to contributing institutions Automatic renewal is the second feature sponsored by the hsg. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 30258 [details] [review] Bug 11577 : Fixing a tiny typo
Created attachment 30692 [details] [review] Bug 11577: Add auto_renew flags to the database - issues.auto_renew - old_issues.auto_renew - issuingrules.auto_renew Default value is zero. To test: 1) Run installer/data/mysql/updatedatabase.pl 2) Create SQL reports like: SELECT * FROM issues LIMIT 0,1 3) Confirm that a column auto_renew was added to each of the three tables. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 30693 [details] [review] Bug 11577: Add "Automatic renewal" to the circulation and fine rules This patch adds a column "Automatic renewal" to the circulation and fine rules table. To test: 1) Add or edit some issuing rules. 2) Confirm that "Automatic Renewal" is set to "No" by default and can be switched to "Yes". Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 30694 [details] [review] Bug 11577: Code and intranet template changes This patch adds a checkbox for "Automatic renewal" to the checkout page. CanBookBeRenewed is modified to include two new errors: - auto_renew (renewal shouldn't be done manually) - auto_too_soon (renewal is premature and shouldn't be done manually) To test: 1) Add or edit an issuing rule with "Automatic renewal" and another one without it. 2) Issue at least three items: - automatic renewal by issuing rule - automatic renewal by Checkbox on the checkout page - no automatic renewal 3) Test the following steps for both: Home > Circulation > Checkouts Home > Patrons > Patron details 4) Confirm that issues with automatic renewal cannot be renewed manually, even if there are still renewals left and it's not too soon to renew. 5) Confirm that "Scheduled for automatic renewal" and the remaining renewals are displayed. If no renewals are left "Not renewable" should be displayed. 6) Confirm that issues without automatic renewal behave as usual. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 30695 [details] [review] Bug 11577: Add 'auto_renew' and 'auto_too_soon' to renewal page This patch adds the new renewal errors 'auto_renew' and 'auto_too_soon' to the renewal interface. To test: 1) Issue two items: - one with automatic renewal and no value for "No renewal before" - another with automatic renewal and a value for "No renewal before" 2) Try to renew: Home > Circulation > Renew 3) Confirm there are error messages explaining that the items have been scheduled for automatic renewal and that one of the renewals is also premature. 4) If global syspref AllowRenewalLimitOverride is set to "Allow" you should be given the option to override. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 30696 [details] [review] Bug 11577: Expand description of AllowRenewalLimitOverride With the introduction of the new automatic renewal feature global syspref AllowRenewalLimitOverride is expanded in meaning. It now gives the option to override blocks if: - the number of allowed renewals is exceeded - the renewal is premature (No renewal before) - the item is scheduled for automatic renewal - the renewal is premature and the item is scheduled for automatic renewal Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 30697 [details] [review] Bug 11577: OPAC bootstrap theme changes This patch makes opac-user.pl and the bootstrap version of opac-user.tt handle the new renewal errors "auto_renew" and "auto_too_soon". To test: 1) Set global syspref "opacthemes" to bootstrap. 2) Set global syspref "OpacRenewalAllowed" to Allow. 3) Test the same things as in previous patch, this time for the OPAC summary page. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 30698 [details] [review] Bug 11577: OPAC prog theme changes This patch makes the prog version of opac-user.tt handle the new renewal errors "auto_renew" and "auto_too_soon". To test: 1) Set global syspref "opacthemes" to prog. 2) Test the same things as in previous patch. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 30699 [details] [review] Bug 11577: Add an automatic renewal cronjob This patch adds a new cron script automatic_renewals.pl and a new entry in crontab.example. To test: 1) You need a few issues, some with automatic renewal and some without. 2) Confirm that each time you run misc/cronjobs/automatic_renewals.pl those issues are renewed that meet all of the following criteria: - automatic renewal has been scheduled either by issuing rule or by checkbox on the checkout page - the number of allowed renewals isn't exceeded - renewal isn't premature (No renewal before) 3) Confirm that all other issues are not affected. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 30700 [details] [review] Bug 11577: Unit tests This patch fixes a few unit tests that broke because of the new feature. To test: 1) prove t/db_dependent/Circulation.t 2) prove t/db_dependent/Circulation_Issuingrule.t 3) prove t/db_dependent/Circulation_issue.t Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 30701 [details] [review] Bug 11577: Add Hochschule für Gesundheit to contributing institutions Automatic renewal is the second feature sponsored by the hsg. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 30702 [details] [review] Bug 11577 : Fixing a tiny typo
I rebased once more. There was a conflict in updatedatabase.pl, due to an increment of the database version.
Comment on attachment 30694 [details] [review] Bug 11577: Code and intranet template changes Review of attachment 30694 [details] [review]: ----------------------------------------------------------------- ::: C4/Circulation.pm @@ +2604,5 @@ > > C<$override_limit>, if supplied with a true value, causes > the limit on the number of times that the loan can be renewed > +(as controlled by the item type) to be ignored. Overriding also allows > +to renew sooner than "No renewal before" und to manually renew loans Very minor typo in here.. 'und => and'.. no biggy
Comment on attachment 30699 [details] [review] Bug 11577: Add an automatic renewal cronjob Review of attachment 30699 [details] [review]: ----------------------------------------------------------------- Could you also make this package safe by adding the relevant cron line to /debian/koha-common.cron.daily please
Comment on attachment 30700 [details] [review] Bug 11577: Unit tests Review of attachment 30700 [details] [review]: ----------------------------------------------------------------- Unless I'm mistaken, you've got these tests passing again, but you've not introduced any testing against your feature specifically.. In the aim of getting test coverage higher, could you add some test cases where aut-renew is enabled please?
Hi Holger, Great work so far, and a fantastic feature! I've given you some very minor follow-ups, hope that's ok. There's nothing major wrong and I'm happy that the code is all in good working order. I'm marking as Failed QA temporarily however whilst awaiting some QA feedback/follow-ups. I'm happy that these are minor enough that we need not go back to the Needs Signoff. Upon your submission, if you reset to Signed Off, I'll jump back in. Cheers for your efforts
Created attachment 31076 [details] [review] Bug 11577: Add auto_renew flags to the database - issues.auto_renew - old_issues.auto_renew - issuingrules.auto_renew Default value is zero. To test: 1) Run installer/data/mysql/updatedatabase.pl 2) Create SQL reports like: SELECT * FROM issues LIMIT 0,1 3) Confirm that a column auto_renew was added to each of the three tables. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 31077 [details] [review] Bug 11577: Add "Automatic renewal" to the circulation and fine rules This patch adds a column "Automatic renewal" to the circulation and fine rules table. To test: 1) Add or edit some issuing rules. 2) Confirm that "Automatic Renewal" is set to "No" by default and can be switched to "Yes". Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 31078 [details] [review] Bug 11577: Code and intranet template changes This patch adds a checkbox for "Automatic renewal" to the checkout page. CanBookBeRenewed is modified to include two new errors: - auto_renew (renewal shouldn't be done manually) - auto_too_soon (renewal is premature and shouldn't be done manually) To test: 1) Add or edit an issuing rule with "Automatic renewal" and another one without it. 2) Issue at least three items: - automatic renewal by issuing rule - automatic renewal by Checkbox on the checkout page - no automatic renewal 3) Test the following steps for both: Home > Circulation > Checkouts Home > Patrons > Patron details 4) Confirm that issues with automatic renewal cannot be renewed manually, even if there are still renewals left and it's not too soon to renew. 5) Confirm that "Scheduled for automatic renewal" and the remaining renewals are displayed. If no renewals are left "Not renewable" should be displayed. 6) Confirm that issues without automatic renewal behave as usual. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 31079 [details] [review] Bug 11577: Add 'auto_renew' and 'auto_too_soon' to renewal page This patch adds the new renewal errors 'auto_renew' and 'auto_too_soon' to the renewal interface. To test: 1) Issue two items: - one with automatic renewal and no value for "No renewal before" - another with automatic renewal and a value for "No renewal before" 2) Try to renew: Home > Circulation > Renew 3) Confirm there are error messages explaining that the items have been scheduled for automatic renewal and that one of the renewals is also premature. 4) If global syspref AllowRenewalLimitOverride is set to "Allow" you should be given the option to override. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 31080 [details] [review] Bug 11577: Expand description of AllowRenewalLimitOverride With the introduction of the new automatic renewal feature global syspref AllowRenewalLimitOverride is expanded in meaning. It now gives the option to override blocks if: - the number of allowed renewals is exceeded - the renewal is premature (No renewal before) - the item is scheduled for automatic renewal - the renewal is premature and the item is scheduled for automatic renewal Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 31081 [details] [review] Bug 11577: OPAC bootstrap theme changes This patch makes opac-user.pl and the bootstrap version of opac-user.tt handle the new renewal errors "auto_renew" and "auto_too_soon". To test: 1) Set global syspref "opacthemes" to bootstrap. 2) Set global syspref "OpacRenewalAllowed" to Allow. 3) Test the same things as in previous patch, this time for the OPAC summary page. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 31082 [details] [review] Bug 11577: OPAC prog theme changes This patch makes the prog version of opac-user.tt handle the new renewal errors "auto_renew" and "auto_too_soon". To test: 1) Set global syspref "opacthemes" to prog. 2) Test the same things as in previous patch. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 31083 [details] [review] Bug 11577: Add an automatic renewal cronjob This patch adds a new cron script automatic_renewals.pl and a new entry in crontab.example. To test: 1) You need a few issues, some with automatic renewal and some without. 2) Confirm that each time you run misc/cronjobs/automatic_renewals.pl those issues are renewed that meet all of the following criteria: - automatic renewal has been scheduled either by issuing rule or by checkbox on the checkout page - the number of allowed renewals isn't exceeded - renewal isn't premature (No renewal before) 3) Confirm that all other issues are not affected. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 31084 [details] [review] Bug 11577: Unit tests This patch fixes two unit tests that broke because of the new feature. Also adds some new test cases. To test: 1) prove t/db_dependent/Circulation.t 2) prove t/db_dependent/Circulation_Issuingrule.t Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 31085 [details] [review] Bug 11577: Add Hochschule für Gesundheit to contributing institutions Automatic renewal is the second feature sponsored by the hsg. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 31086 [details] [review] Bug 11577 : Fixing a tiny typo
Hi Martin, thank you once again, for QA-ing my patches! I fixed the typo, added the cron line, added new test cases and rebased again. Not sure if those test cases are sufficient, but they are all I can think of right now. Setting back to Signed Off. :)
Comment on attachment 31084 [details] [review] Bug 11577: Unit tests Review of attachment 31084 [details] [review]: ----------------------------------------------------------------- Should we be testing against auto_renew => 1 for any cases in Circulation_Issueingrule.t per chance.. probably not so I'm OK with this once a last typo fix is done. Thanks for adding tests to cover your feature in Circulation.t. I'm happy that these work well now. ::: t/db_dependent/Circulation_Issuingrule.t @@ +246,4 @@ > $sampleissuingrule2->{renewalsallowed}, > $sampleissuingrule2->{renewalperiod}, > $sampleissuingrule2->{norenewalbefore}, > + $sampleissuingrule1->{auto_renew}, Is this a copy/paste error here, should it be $sampleissuingrule2->{auto_renew} [spot to '2' instead of '1'] ? @@ +272,4 @@ > $sampleissuingrule3->{renewalsallowed}, > $sampleissuingrule3->{renewalperiod}, > $sampleissuingrule3->{norenewalbefore}, > + $sampleissuingrule1->{auto_renew}, As above.. is there a copy paste issue here?
Created attachment 31198 [details] [review] [PASSED QA] Bug 11577: Add auto_renew flags to the database - issues.auto_renew - old_issues.auto_renew - issuingrules.auto_renew Default value is zero. To test: 1) Run installer/data/mysql/updatedatabase.pl 2) Create SQL reports like: SELECT * FROM issues LIMIT 0,1 3) Confirm that a column auto_renew was added to each of the three tables. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31199 [details] [review] [PASSED QA] Bug 11577: Add "Automatic renewal" to the circulation and fine rules This patch adds a column "Automatic renewal" to the circulation and fine rules table. To test: 1) Add or edit some issuing rules. 2) Confirm that "Automatic Renewal" is set to "No" by default and can be switched to "Yes". Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31200 [details] [review] [PASSED QA] Bug 11577: Code and intranet template changes This patch adds a checkbox for "Automatic renewal" to the checkout page. CanBookBeRenewed is modified to include two new errors: - auto_renew (renewal shouldn't be done manually) - auto_too_soon (renewal is premature and shouldn't be done manually) To test: 1) Add or edit an issuing rule with "Automatic renewal" and another one without it. 2) Issue at least three items: - automatic renewal by issuing rule - automatic renewal by Checkbox on the checkout page - no automatic renewal 3) Test the following steps for both: Home > Circulation > Checkouts Home > Patrons > Patron details 4) Confirm that issues with automatic renewal cannot be renewed manually, even if there are still renewals left and it's not too soon to renew. 5) Confirm that "Scheduled for automatic renewal" and the remaining renewals are displayed. If no renewals are left "Not renewable" should be displayed. 6) Confirm that issues without automatic renewal behave as usual. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31201 [details] [review] [PASSED QA] Bug 11577: Add 'auto_renew' and 'auto_too_soon' to renewal page This patch adds the new renewal errors 'auto_renew' and 'auto_too_soon' to the renewal interface. To test: 1) Issue two items: - one with automatic renewal and no value for "No renewal before" - another with automatic renewal and a value for "No renewal before" 2) Try to renew: Home > Circulation > Renew 3) Confirm there are error messages explaining that the items have been scheduled for automatic renewal and that one of the renewals is also premature. 4) If global syspref AllowRenewalLimitOverride is set to "Allow" you should be given the option to override. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31202 [details] [review] [PASSED QA] Bug 11577: Expand description of AllowRenewalLimitOverride With the introduction of the new automatic renewal feature global syspref AllowRenewalLimitOverride is expanded in meaning. It now gives the option to override blocks if: - the number of allowed renewals is exceeded - the renewal is premature (No renewal before) - the item is scheduled for automatic renewal - the renewal is premature and the item is scheduled for automatic renewal Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31203 [details] [review] [PASSED QA] Bug 11577: OPAC bootstrap theme changes This patch makes opac-user.pl and the bootstrap version of opac-user.tt handle the new renewal errors "auto_renew" and "auto_too_soon". To test: 1) Set global syspref "opacthemes" to bootstrap. 2) Set global syspref "OpacRenewalAllowed" to Allow. 3) Test the same things as in previous patch, this time for the OPAC summary page. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31204 [details] [review] [NOT REQUIRED] Bug 11577: OPAC prog theme changes This patch makes the prog version of opac-user.tt handle the new renewal errors "auto_renew" and "auto_too_soon". To test: 1) Set global syspref "opacthemes" to prog. 2) Test the same things as in previous patch. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31205 [details] [review] [PASSED QA] Bug 11577: Add an automatic renewal cronjob This patch adds a new cron script automatic_renewals.pl and a new entry in crontab.example. To test: 1) You need a few issues, some with automatic renewal and some without. 2) Confirm that each time you run misc/cronjobs/automatic_renewals.pl those issues are renewed that meet all of the following criteria: - automatic renewal has been scheduled either by issuing rule or by checkbox on the checkout page - the number of allowed renewals isn't exceeded - renewal isn't premature (No renewal before) 3) Confirm that all other issues are not affected. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31206 [details] [review] [PASSED QA] Bug 11577: Unit tests This patch fixes two unit tests that broke because of the new feature. Also adds some new test cases. To test: 1) prove t/db_dependent/Circulation.t 2) prove t/db_dependent/Circulation_Issuingrule.t Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31207 [details] [review] [PASSED QA] Bug 11577: Add Hochschule für Gesundheit to contributing institutions Automatic renewal is the second feature sponsored by the hsg. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31208 [details] [review] [PASSED QA] Bug 11577 : Fixing a tiny typo Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31209 [details] [review] [QA FOLLOWUP] Bug 11577 : Fixing a tiny copy/paste issue
Thanks so much again for persevering with this Holger! I've done a minor QA Followup for you to correct that tiny copy/paste error in the unit tests patch, but I'm happy everything else passes and we're covered in the unit tests reasonably comprehensively. I've marked the opac prog theme patch as NOT REQUIRED as we're deprecating that theme, but as it's a completely independent patch, I'm happy it does not fail QA. To the RM: Holger has followed the general practices already present with Circulation.t regarding adding data for testing against. I'm not 100% sure how the roll-back stuff works when using C4 subs to add data within the test so may be sensible to take a glance over that to check I've not missed something obvious. As there's plenty already in that test that will make anything but the most basic of sample database fail, then I didn't see this as something I could reasonably fail QA on. I would like to re-factor this test script to use TestBuilder should that go in and I will happily do that as a follow-up in a separate bug when time permits.
Thank you Martin. You did a great job, spotting those typos and copy/paste errors! I'm a bit embarrassed that I missed them. :)
Created attachment 31640 [details] [review] Bug 11577: Add auto_renew flags to the database - issues.auto_renew - old_issues.auto_renew - issuingrules.auto_renew Default value is zero. To test: 1) Run installer/data/mysql/updatedatabase.pl 2) Create SQL reports like: SELECT * FROM issues LIMIT 0,1 3) Confirm that a column auto_renew was added to each of the three tables. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31641 [details] [review] Bug 11577: Add "Automatic renewal" to the circulation and fine rules This patch adds a column "Automatic renewal" to the circulation and fine rules table. To test: 1) Add or edit some issuing rules. 2) Confirm that "Automatic Renewal" is set to "No" by default and can be switched to "Yes". Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31642 [details] [review] Bug 11577: Code and intranet template changes This patch adds a checkbox for "Automatic renewal" to the checkout page. CanBookBeRenewed is modified to include two new errors: - auto_renew (renewal shouldn't be done manually) - auto_too_soon (renewal is premature and shouldn't be done manually) To test: 1) Add or edit an issuing rule with "Automatic renewal" and another one without it. 2) Issue at least three items: - automatic renewal by issuing rule - automatic renewal by Checkbox on the checkout page - no automatic renewal 3) Test the following steps for both: Home > Circulation > Checkouts Home > Patrons > Patron details 4) Confirm that issues with automatic renewal cannot be renewed manually, even if there are still renewals left and it's not too soon to renew. 5) Confirm that "Scheduled for automatic renewal" and the remaining renewals are displayed. If no renewals are left "Not renewable" should be displayed. 6) Confirm that issues without automatic renewal behave as usual. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31643 [details] [review] Bug 11577: Add 'auto_renew' and 'auto_too_soon' to renewal page This patch adds the new renewal errors 'auto_renew' and 'auto_too_soon' to the renewal interface. To test: 1) Issue two items: - one with automatic renewal and no value for "No renewal before" - another with automatic renewal and a value for "No renewal before" 2) Try to renew: Home > Circulation > Renew 3) Confirm there are error messages explaining that the items have been scheduled for automatic renewal and that one of the renewals is also premature. 4) If global syspref AllowRenewalLimitOverride is set to "Allow" you should be given the option to override. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31644 [details] [review] Bug 11577: Expand description of AllowRenewalLimitOverride With the introduction of the new automatic renewal feature global syspref AllowRenewalLimitOverride is expanded in meaning. It now gives the option to override blocks if: - the number of allowed renewals is exceeded - the renewal is premature (No renewal before) - the item is scheduled for automatic renewal - the renewal is premature and the item is scheduled for automatic renewal Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31645 [details] [review] Bug 11577: OPAC bootstrap theme changes This patch makes opac-user.pl and the bootstrap version of opac-user.tt handle the new renewal errors "auto_renew" and "auto_too_soon". To test: 1) Set global syspref "opacthemes" to bootstrap. 2) Set global syspref "OpacRenewalAllowed" to Allow. 3) Test the same things as in previous patch, this time for the OPAC summary page. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31646 [details] [review] Bug 11577: OPAC prog theme changes This patch makes the prog version of opac-user.tt handle the new renewal errors "auto_renew" and "auto_too_soon". To test: 1) Set global syspref "opacthemes" to prog. 2) Test the same things as in previous patch. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31647 [details] [review] Bug 11577: Add an automatic renewal cronjob This patch adds a new cron script automatic_renewals.pl and a new entry in crontab.example. To test: 1) You need a few issues, some with automatic renewal and some without. 2) Confirm that each time you run misc/cronjobs/automatic_renewals.pl those issues are renewed that meet all of the following criteria: - automatic renewal has been scheduled either by issuing rule or by checkbox on the checkout page - the number of allowed renewals isn't exceeded - renewal isn't premature (No renewal before) 3) Confirm that all other issues are not affected. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31648 [details] [review] Bug 11577: Unit tests This patch fixes two unit tests that broke because of the new feature. Also adds some new test cases. To test: 1) prove t/db_dependent/Circulation.t 2) prove t/db_dependent/Circulation_Issuingrule.t Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31649 [details] [review] Bug 11577: Add Hochschule für Gesundheit to contributing institutions Automatic renewal is the second feature sponsored by the hsg. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31650 [details] [review] Bug 11577 : Fixing a tiny typo Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31651 [details] [review] Bug 11577 : Fixing a tiny copy/paste issue
Created attachment 31652 [details] [review] [PASSED QA] Bug 11577: Add auto_renew flags to the database - issues.auto_renew - old_issues.auto_renew - issuingrules.auto_renew Default value is zero. To test: 1) Run installer/data/mysql/updatedatabase.pl 2) Create SQL reports like: SELECT * FROM issues LIMIT 0,1 3) Confirm that a column auto_renew was added to each of the three tables. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31653 [details] [review] [PASSED QA] Bug 11577: Add "Automatic renewal" to the circulation and fine rules This patch adds a column "Automatic renewal" to the circulation and fine rules table. To test: 1) Add or edit some issuing rules. 2) Confirm that "Automatic Renewal" is set to "No" by default and can be switched to "Yes". Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31654 [details] [review] [PASSED QA] Bug 11577: Code and intranet template changes This patch adds a checkbox for "Automatic renewal" to the checkout page. CanBookBeRenewed is modified to include two new errors: - auto_renew (renewal shouldn't be done manually) - auto_too_soon (renewal is premature and shouldn't be done manually) To test: 1) Add or edit an issuing rule with "Automatic renewal" and another one without it. 2) Issue at least three items: - automatic renewal by issuing rule - automatic renewal by Checkbox on the checkout page - no automatic renewal 3) Test the following steps for both: Home > Circulation > Checkouts Home > Patrons > Patron details 4) Confirm that issues with automatic renewal cannot be renewed manually, even if there are still renewals left and it's not too soon to renew. 5) Confirm that "Scheduled for automatic renewal" and the remaining renewals are displayed. If no renewals are left "Not renewable" should be displayed. 6) Confirm that issues without automatic renewal behave as usual. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31655 [details] [review] [PASSED QA] Bug 11577: Add 'auto_renew' and 'auto_too_soon' to renewal page This patch adds the new renewal errors 'auto_renew' and 'auto_too_soon' to the renewal interface. To test: 1) Issue two items: - one with automatic renewal and no value for "No renewal before" - another with automatic renewal and a value for "No renewal before" 2) Try to renew: Home > Circulation > Renew 3) Confirm there are error messages explaining that the items have been scheduled for automatic renewal and that one of the renewals is also premature. 4) If global syspref AllowRenewalLimitOverride is set to "Allow" you should be given the option to override. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31656 [details] [review] [PASSED QA] Bug 11577: Expand description of AllowRenewalLimitOverride With the introduction of the new automatic renewal feature global syspref AllowRenewalLimitOverride is expanded in meaning. It now gives the option to override blocks if: - the number of allowed renewals is exceeded - the renewal is premature (No renewal before) - the item is scheduled for automatic renewal - the renewal is premature and the item is scheduled for automatic renewal Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31657 [details] [review] [PASSED QA] Bug 11577: OPAC bootstrap theme changes This patch makes opac-user.pl and the bootstrap version of opac-user.tt handle the new renewal errors "auto_renew" and "auto_too_soon". To test: 1) Set global syspref "opacthemes" to bootstrap. 2) Set global syspref "OpacRenewalAllowed" to Allow. 3) Test the same things as in previous patch, this time for the OPAC summary page. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31658 [details] [review] [NOT REQUIRED] Bug 11577: OPAC prog theme changes This patch makes the prog version of opac-user.tt handle the new renewal errors "auto_renew" and "auto_too_soon". To test: 1) Set global syspref "opacthemes" to prog. 2) Test the same things as in previous patch. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31659 [details] [review] [PASSED QA] Bug 11577: Add an automatic renewal cronjob This patch adds a new cron script automatic_renewals.pl and a new entry in crontab.example. To test: 1) You need a few issues, some with automatic renewal and some without. 2) Confirm that each time you run misc/cronjobs/automatic_renewals.pl those issues are renewed that meet all of the following criteria: - automatic renewal has been scheduled either by issuing rule or by checkbox on the checkout page - the number of allowed renewals isn't exceeded - renewal isn't premature (No renewal before) 3) Confirm that all other issues are not affected. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31660 [details] [review] [PASSED QA] Bug 11577: Unit tests This patch fixes two unit tests that broke because of the new feature. Also adds some new test cases. To test: 1) prove t/db_dependent/Circulation.t 2) prove t/db_dependent/Circulation_Issuingrule.t Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31661 [details] [review] [PASSED QA] Bug 11577: Add Hochschule für Gesundheit to contributing institutions Automatic renewal is the second feature sponsored by the hsg. Sponsored-by: Hochschule für Gesundheit (hsg), Germany Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31662 [details] [review] [PASSED QA] Bug 11577 : Fixing a tiny typo Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 31663 [details] [review] [QA FOLLOWUP] Bug 11577 : Fixing a tiny copy/paste issue
I rebased once more, because of two very tiny conflicts in updatedatabase.pl (DBVersion) and Circulation.t (just the number of tests).
New feature pushed to master. Thanks Holger!
*** Bug 13092 has been marked as a duplicate of this bug. ***
Skipping patch for 3.16.x series
Can someone confirm that "No renewal before" is an integer indicating the number of days after the due date to wait before automatically renewing an item? There's nothing that indicates this in the Help file for the circulation rules nor in the test plans below. It was obvious when I looked at t/db_dependent/Circulation/GetHardDueDate.t, but perhaps it would be prudent to clarify this somewhere for Koha users.
(In reply to David Cook from comment #127) > Can someone confirm that "No renewal before" is an integer indicating the > number of days after the due date to wait before automatically renewing an > item? > > There's nothing that indicates this in the Help file for the circulation > rules nor in the test plans below. > > It was obvious when I looked at t/db_dependent/Circulation/GetHardDueDate.t, > but perhaps it would be prudent to clarify this somewhere for Koha users. It looks like I completely misunderstood "No renewal before". It looks like it's referred to in https://wiki.koha-community.org/wiki/Automatic_renewal_RFC and https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7413... It looks like this is the key point: "One solution here would be to allow renewals only x days before the book is due." So it's really "No renewal allowed until X units before due date"
Also, can someone confirm this line from the Help file: "Important: This feature needs to have the "no renewal before" column filled in or it will auto renew everyday after the due date." It looks to me that it will actually auto-renew before the due date if the "no renewal before" column is null. That's just based on code review though. I haven't tested it. The perldoc in automatic_renewals.pl seems to suggest this though.
Created attachment 57734 [details] Explanation for "no renewal before" Hi David, it's been a while since I wrote the feature. At some point I made this little table. I hope it's still accurate and answers your questions. If not, I'll try and take a deeper look. Feel free to include the table into any documentation if it's helpful. I agree that "No renewal allowed until X units before due date" is a much better description than "no renewal before."