Bug 11577 - Automatic renewals
Summary: Automatic renewals
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: master
Hardware: All All
: P5 - low new feature
Assignee: Holger Meißner
QA Contact: Martin Renvoize
URL:
Whiteboard:
Keywords:
: 13092 (view as bug list)
Depends on:
Blocks: 13377 15569
  Show dependency treegraph
 
Reported: 2014-01-17 10:25 UTC by Holger Meißner
Modified: 2016-01-13 16:36 UTC (History)
11 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Medium patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 11577: Add auto_renew flags to the database (3.84 KB, patch)
2014-05-22 12:17 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add "Automatic renewal" to the circulation and fine rules (6.82 KB, patch)
2014-05-22 12:17 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Code and intranet template changes (13.70 KB, patch)
2014-05-22 12:17 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add 'auto_renew' and 'auto_too_soon' to renewal page (3.91 KB, patch)
2014-05-22 12:17 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Expand description of AllowRenewalLimitOverride (1.90 KB, patch)
2014-05-22 12:17 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: OPAC bootstrap theme changes (2.90 KB, patch)
2014-05-22 12:17 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: OPAC prog theme changes (1.73 KB, patch)
2014-05-22 12:17 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add an automatic renewal cronjob (3.71 KB, patch)
2014-05-22 12:17 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Unit tests (4.16 KB, patch)
2014-05-22 12:17 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add Hochschule für Gesundheit to contributing institutions (1.25 KB, patch)
2014-05-22 12:17 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add auto_renew flags to the database (3.84 KB, patch)
2014-05-23 07:52 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add auto_renew flags to the database (3.84 KB, patch)
2014-06-02 12:03 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add "Automatic renewal" to the circulation and fine rules (6.99 KB, patch)
2014-06-02 12:03 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Code and intranet template changes (13.70 KB, patch)
2014-06-02 12:03 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add 'auto_renew' and 'auto_too_soon' to renewal page (3.91 KB, patch)
2014-06-02 12:03 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Expand description of AllowRenewalLimitOverride (1.90 KB, patch)
2014-06-02 12:03 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: OPAC bootstrap theme changes (2.90 KB, patch)
2014-06-02 12:03 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: OPAC prog theme changes (1.73 KB, patch)
2014-06-02 12:03 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add an automatic renewal cronjob (3.71 KB, patch)
2014-06-02 12:03 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Unit tests (4.16 KB, patch)
2014-06-02 12:03 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add Hochschule für Gesundheit to contributing institutions (1.25 KB, patch)
2014-06-02 12:03 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add auto_renew flags to the database (3.84 KB, patch)
2014-07-01 08:52 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add "Automatic renewal" to the circulation and fine rules (6.99 KB, patch)
2014-07-01 08:52 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Code and intranet template changes (13.70 KB, patch)
2014-07-01 08:53 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add 'auto_renew' and 'auto_too_soon' to renewal page (3.91 KB, patch)
2014-07-01 08:53 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Expand description of AllowRenewalLimitOverride (1.90 KB, patch)
2014-07-01 08:53 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: OPAC bootstrap theme changes (2.90 KB, patch)
2014-07-01 08:53 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: OPAC prog theme changes (1.73 KB, patch)
2014-07-01 08:53 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add an automatic renewal cronjob (3.71 KB, patch)
2014-07-01 08:53 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Unit tests (4.16 KB, patch)
2014-07-01 08:53 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add Hochschule für Gesundheit to contributing institutions (1.25 KB, patch)
2014-07-01 08:53 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add auto_renew flags to the database (3.84 KB, patch)
2014-07-23 08:59 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add "Automatic renewal" to the circulation and fine rules (6.99 KB, patch)
2014-07-23 08:59 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Code and intranet template changes (10.95 KB, patch)
2014-07-23 09:00 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add 'auto_renew' and 'auto_too_soon' to renewal page (3.90 KB, patch)
2014-07-23 09:00 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Expand description of AllowRenewalLimitOverride (1.90 KB, patch)
2014-07-23 09:00 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: OPAC bootstrap theme changes (2.90 KB, patch)
2014-07-23 09:00 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: OPAC prog theme changes (1.73 KB, patch)
2014-07-23 09:00 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add an automatic renewal cronjob (3.69 KB, patch)
2014-07-23 09:00 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Unit tests (4.16 KB, patch)
2014-07-23 09:00 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add Hochschule für Gesundheit to contributing institutions (1.25 KB, patch)
2014-07-23 09:00 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add auto_renew flags to the database (3.88 KB, patch)
2014-07-29 06:01 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 11577: Add "Automatic renewal" to the circulation and fine rules (7.04 KB, patch)
2014-07-29 06:02 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 11577: Code and intranet template changes (10.99 KB, patch)
2014-07-29 06:02 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 11577: Add 'auto_renew' and 'auto_too_soon' to renewal page (3.95 KB, patch)
2014-07-29 06:03 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 11577: Expand description of AllowRenewalLimitOverride (1.95 KB, patch)
2014-07-29 06:03 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 11577: OPAC bootstrap theme changes (2.94 KB, patch)
2014-07-29 06:03 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 11577: OPAC prog theme changes (1.78 KB, patch)
2014-07-29 06:03 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 11577: Add an automatic renewal cronjob (3.74 KB, patch)
2014-07-29 06:04 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 11577: Unit tests (4.21 KB, patch)
2014-07-29 06:04 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 11577: Add Hochschule für Gesundheit to contributing institutions (1.30 KB, patch)
2014-07-29 06:04 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 11577 : Fixing a tiny typo (1.38 KB, patch)
2014-07-29 06:05 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 11577: Add auto_renew flags to the database (3.89 KB, patch)
2014-08-11 14:53 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add "Automatic renewal" to the circulation and fine rules (7.04 KB, patch)
2014-08-11 14:53 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Code and intranet template changes (11.00 KB, patch)
2014-08-11 14:54 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add 'auto_renew' and 'auto_too_soon' to renewal page (3.96 KB, patch)
2014-08-11 14:54 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Expand description of AllowRenewalLimitOverride (1.96 KB, patch)
2014-08-11 14:54 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: OPAC bootstrap theme changes (3.01 KB, patch)
2014-08-11 14:54 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: OPAC prog theme changes (1.78 KB, patch)
2014-08-11 14:54 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add an automatic renewal cronjob (3.74 KB, patch)
2014-08-11 14:54 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Unit tests (4.22 KB, patch)
2014-08-11 14:54 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add Hochschule für Gesundheit to contributing institutions (1.31 KB, patch)
2014-08-11 14:54 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577 : Fixing a tiny typo (1.38 KB, patch)
2014-08-11 14:54 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add auto_renew flags to the database (3.89 KB, patch)
2014-08-22 11:47 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add "Automatic renewal" to the circulation and fine rules (7.04 KB, patch)
2014-08-22 11:47 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Code and intranet template changes (11.00 KB, patch)
2014-08-22 11:47 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add 'auto_renew' and 'auto_too_soon' to renewal page (3.96 KB, patch)
2014-08-22 11:47 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Expand description of AllowRenewalLimitOverride (1.96 KB, patch)
2014-08-22 11:47 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: OPAC bootstrap theme changes (3.01 KB, patch)
2014-08-22 11:47 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: OPAC prog theme changes (1.78 KB, patch)
2014-08-22 11:47 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add an automatic renewal cronjob (4.48 KB, patch)
2014-08-22 11:47 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Unit tests (6.12 KB, patch)
2014-08-22 11:48 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add Hochschule für Gesundheit to contributing institutions (1.31 KB, patch)
2014-08-22 11:48 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577 : Fixing a tiny typo (1.38 KB, patch)
2014-08-22 11:48 UTC, Holger Meißner
Details | Diff | Splinter Review
[PASSED QA] Bug 11577: Add auto_renew flags to the database (3.94 KB, patch)
2014-08-27 17:36 UTC, Martin Renvoize
Details | Diff | Splinter Review
[PASSED QA] Bug 11577: Add "Automatic renewal" to the circulation and fine rules (7.12 KB, patch)
2014-08-27 17:36 UTC, Martin Renvoize
Details | Diff | Splinter Review
[PASSED QA] Bug 11577: Code and intranet template changes (11.08 KB, patch)
2014-08-27 17:36 UTC, Martin Renvoize
Details | Diff | Splinter Review
[PASSED QA] Bug 11577: Add 'auto_renew' and 'auto_too_soon' to renewal page (4.03 KB, patch)
2014-08-27 17:36 UTC, Martin Renvoize
Details | Diff | Splinter Review
[PASSED QA] Bug 11577: Expand description of AllowRenewalLimitOverride (2.03 KB, patch)
2014-08-27 17:36 UTC, Martin Renvoize
Details | Diff | Splinter Review
[PASSED QA] Bug 11577: OPAC bootstrap theme changes (3.08 KB, patch)
2014-08-27 17:36 UTC, Martin Renvoize
Details | Diff | Splinter Review
[NOT REQUIRED] Bug 11577: OPAC prog theme changes (1.86 KB, patch)
2014-08-27 17:36 UTC, Martin Renvoize
Details | Diff | Splinter Review
[PASSED QA] Bug 11577: Add an automatic renewal cronjob (4.55 KB, patch)
2014-08-27 17:36 UTC, Martin Renvoize
Details | Diff | Splinter Review
[PASSED QA] Bug 11577: Unit tests (6.19 KB, patch)
2014-08-27 17:36 UTC, Martin Renvoize
Details | Diff | Splinter Review
[PASSED QA] Bug 11577: Add Hochschule für Gesundheit to contributing institutions (1.39 KB, patch)
2014-08-27 17:36 UTC, Martin Renvoize
Details | Diff | Splinter Review
[PASSED QA] Bug 11577 : Fixing a tiny typo (1.46 KB, patch)
2014-08-27 17:37 UTC, Martin Renvoize
Details | Diff | Splinter Review
[QA FOLLOWUP] Bug 11577 : Fixing a tiny copy/paste issue (1.30 KB, patch)
2014-08-27 17:37 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 11577: Add auto_renew flags to the database (3.95 KB, patch)
2014-09-17 06:49 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add "Automatic renewal" to the circulation and fine rules (7.10 KB, patch)
2014-09-17 06:49 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Code and intranet template changes (11.06 KB, patch)
2014-09-17 06:49 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add 'auto_renew' and 'auto_too_soon' to renewal page (4.02 KB, patch)
2014-09-17 06:49 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Expand description of AllowRenewalLimitOverride (2.02 KB, patch)
2014-09-17 06:49 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: OPAC bootstrap theme changes (3.07 KB, patch)
2014-09-17 06:49 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: OPAC prog theme changes (1.85 KB, patch)
2014-09-17 06:49 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add an automatic renewal cronjob (4.54 KB, patch)
2014-09-17 06:50 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Unit tests (6.18 KB, patch)
2014-09-17 06:50 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577: Add Hochschule für Gesundheit to contributing institutions (1.37 KB, patch)
2014-09-17 06:50 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577 : Fixing a tiny typo (1.45 KB, patch)
2014-09-17 06:50 UTC, Holger Meißner
Details | Diff | Splinter Review
Bug 11577 : Fixing a tiny copy/paste issue (1.28 KB, patch)
2014-09-17 06:50 UTC, Holger Meißner
Details | Diff | Splinter Review
[PASSED QA] Bug 11577: Add auto_renew flags to the database (3.97 KB, patch)
2014-09-17 07:00 UTC, Holger Meißner
Details | Diff | Splinter Review
[PASSED QA] Bug 11577: Add "Automatic renewal" to the circulation and fine rules (7.12 KB, patch)
2014-09-17 07:00 UTC, Holger Meißner
Details | Diff | Splinter Review
[PASSED QA] Bug 11577: Code and intranet template changes (11.08 KB, patch)
2014-09-17 07:00 UTC, Holger Meißner
Details | Diff | Splinter Review
[PASSED QA] Bug 11577: Add 'auto_renew' and 'auto_too_soon' to renewal page (4.03 KB, patch)
2014-09-17 07:00 UTC, Holger Meißner
Details | Diff | Splinter Review
[PASSED QA] Bug 11577: Expand description of AllowRenewalLimitOverride (2.03 KB, patch)
2014-09-17 07:00 UTC, Holger Meißner
Details | Diff | Splinter Review
[PASSED QA] Bug 11577: OPAC bootstrap theme changes (3.08 KB, patch)
2014-09-17 07:00 UTC, Holger Meißner
Details | Diff | Splinter Review
[NOT REQUIRED] Bug 11577: OPAC prog theme changes (1.86 KB, patch)
2014-09-17 07:00 UTC, Holger Meißner
Details | Diff | Splinter Review
[PASSED QA] Bug 11577: Add an automatic renewal cronjob (4.55 KB, patch)
2014-09-17 07:00 UTC, Holger Meißner
Details | Diff | Splinter Review
[PASSED QA] Bug 11577: Unit tests (6.19 KB, patch)
2014-09-17 07:00 UTC, Holger Meißner
Details | Diff | Splinter Review
[PASSED QA] Bug 11577: Add Hochschule für Gesundheit to contributing institutions (1.39 KB, patch)
2014-09-17 07:01 UTC, Holger Meißner
Details | Diff | Splinter Review
[PASSED QA] Bug 11577 : Fixing a tiny typo (1.46 KB, patch)
2014-09-17 07:01 UTC, Holger Meißner
Details | Diff | Splinter Review
[QA FOLLOWUP] Bug 11577 : Fixing a tiny copy/paste issue (1.30 KB, patch)
2014-09-17 07:01 UTC, Holger Meißner
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Holger Meißner 2014-01-17 10:25:08 UTC
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
Comment 1 Holger Meißner 2014-05-22 12:17:18 UTC
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
Comment 2 Holger Meißner 2014-05-22 12:17:21 UTC
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
Comment 3 Holger Meißner 2014-05-22 12:17:24 UTC
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
Comment 4 Holger Meißner 2014-05-22 12:17:27 UTC
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
Comment 5 Holger Meißner 2014-05-22 12:17:30 UTC
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
Comment 6 Holger Meißner 2014-05-22 12:17:33 UTC
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
Comment 7 Holger Meißner 2014-05-22 12:17:36 UTC
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
Comment 8 Holger Meißner 2014-05-22 12:17:38 UTC
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
Comment 9 Holger Meißner 2014-05-22 12:17:41 UTC
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
Comment 10 Holger Meißner 2014-05-22 12:17:44 UTC
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
Comment 11 Holger Meißner 2014-05-23 07:52:54 UTC
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
Comment 12 Holger Meißner 2014-05-23 08:06:42 UTC
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?
Comment 13 Holger Meißner 2014-06-02 12:03:26 UTC
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
Comment 14 Holger Meißner 2014-06-02 12:03:29 UTC
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
Comment 15 Holger Meißner 2014-06-02 12:03:32 UTC
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
Comment 16 Holger Meißner 2014-06-02 12:03:35 UTC
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
Comment 17 Holger Meißner 2014-06-02 12:03:38 UTC
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
Comment 18 Holger Meißner 2014-06-02 12:03:41 UTC
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
Comment 19 Holger Meißner 2014-06-02 12:03:45 UTC
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
Comment 20 Holger Meißner 2014-06-02 12:03:48 UTC
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
Comment 21 Holger Meißner 2014-06-02 12:03:51 UTC
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
Comment 22 Holger Meißner 2014-06-02 12:03:54 UTC
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
Comment 23 Holger Meißner 2014-07-01 08:52:54 UTC
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
Comment 24 Holger Meißner 2014-07-01 08:52:57 UTC
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
Comment 25 Holger Meißner 2014-07-01 08:53:00 UTC
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
Comment 26 Holger Meißner 2014-07-01 08:53:03 UTC
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
Comment 27 Holger Meißner 2014-07-01 08:53:06 UTC
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
Comment 28 Holger Meißner 2014-07-01 08:53:09 UTC
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
Comment 29 Holger Meißner 2014-07-01 08:53:12 UTC
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
Comment 30 Holger Meißner 2014-07-01 08:53:15 UTC
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
Comment 31 Holger Meißner 2014-07-01 08:53:18 UTC
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
Comment 32 Holger Meißner 2014-07-01 08:53:21 UTC
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
Comment 33 Chris Cormack 2014-07-17 20:00:26 UTC
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.
Comment 34 Holger Meißner 2014-07-23 08:59:56 UTC
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
Comment 35 Holger Meißner 2014-07-23 08:59:59 UTC
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
Comment 36 Holger Meißner 2014-07-23 09:00:03 UTC
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
Comment 37 Holger Meißner 2014-07-23 09:00:07 UTC
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
Comment 38 Holger Meißner 2014-07-23 09:00:10 UTC
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
Comment 39 Holger Meißner 2014-07-23 09:00:14 UTC
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
Comment 40 Holger Meißner 2014-07-23 09:00:17 UTC
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
Comment 41 Holger Meißner 2014-07-23 09:00:21 UTC
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
Comment 42 Holger Meißner 2014-07-23 09:00:24 UTC
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
Comment 43 Holger Meißner 2014-07-23 09:00:28 UTC
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
Comment 44 Holger Meißner 2014-07-23 09:06:11 UTC
Thank you for testing, Chris! :)

I rebased and switched back to "Needs signoff".
Comment 45 Chris Cormack 2014-07-29 06:01:38 UTC
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>
Comment 46 Chris Cormack 2014-07-29 06:02:08 UTC
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>
Comment 47 Chris Cormack 2014-07-29 06:02:49 UTC
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>
Comment 48 Chris Cormack 2014-07-29 06:03:04 UTC
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>
Comment 49 Chris Cormack 2014-07-29 06:03:23 UTC
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>
Comment 50 Chris Cormack 2014-07-29 06:03:39 UTC
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>
Comment 51 Chris Cormack 2014-07-29 06:03:53 UTC
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>
Comment 52 Chris Cormack 2014-07-29 06:04:06 UTC
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>
Comment 53 Chris Cormack 2014-07-29 06:04:21 UTC
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>
Comment 54 Chris Cormack 2014-07-29 06:04:35 UTC
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>
Comment 55 Chris Cormack 2014-07-29 06:05:07 UTC
Created attachment 30258 [details] [review]
Bug 11577 : Fixing a tiny typo
Comment 56 Holger Meißner 2014-08-11 14:53:54 UTC
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>
Comment 57 Holger Meißner 2014-08-11 14:53:58 UTC
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>
Comment 58 Holger Meißner 2014-08-11 14:54:01 UTC
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>
Comment 59 Holger Meißner 2014-08-11 14:54:05 UTC
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>
Comment 60 Holger Meißner 2014-08-11 14:54:08 UTC
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>
Comment 61 Holger Meißner 2014-08-11 14:54:12 UTC
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>
Comment 62 Holger Meißner 2014-08-11 14:54:16 UTC
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>
Comment 63 Holger Meißner 2014-08-11 14:54:19 UTC
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>
Comment 64 Holger Meißner 2014-08-11 14:54:23 UTC
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>
Comment 65 Holger Meißner 2014-08-11 14:54:27 UTC
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>
Comment 66 Holger Meißner 2014-08-11 14:54:30 UTC
Created attachment 30702 [details] [review]
Bug 11577 : Fixing a tiny typo
Comment 67 Holger Meißner 2014-08-11 15:00:46 UTC
I rebased once more. There was a conflict in updatedatabase.pl, due to an increment of the database version.
Comment 68 Martin Renvoize 2014-08-18 14:50:49 UTC
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 69 Martin Renvoize 2014-08-18 14:51:38 UTC
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 70 Martin Renvoize 2014-08-18 14:54:31 UTC
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?
Comment 71 Martin Renvoize 2014-08-18 14:58:10 UTC
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
Comment 72 Holger Meißner 2014-08-22 11:47:27 UTC
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>
Comment 73 Holger Meißner 2014-08-22 11:47:31 UTC
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>
Comment 74 Holger Meißner 2014-08-22 11:47:36 UTC
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>
Comment 75 Holger Meißner 2014-08-22 11:47:42 UTC
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>
Comment 76 Holger Meißner 2014-08-22 11:47:46 UTC
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>
Comment 77 Holger Meißner 2014-08-22 11:47:50 UTC
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>
Comment 78 Holger Meißner 2014-08-22 11:47:54 UTC
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>
Comment 79 Holger Meißner 2014-08-22 11:47:57 UTC
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>
Comment 80 Holger Meißner 2014-08-22 11:48:01 UTC
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>
Comment 81 Holger Meißner 2014-08-22 11:48:06 UTC
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>
Comment 82 Holger Meißner 2014-08-22 11:48:11 UTC
Created attachment 31086 [details] [review]
Bug 11577 : Fixing a tiny typo
Comment 83 Holger Meißner 2014-08-22 12:13:25 UTC
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 84 Martin Renvoize 2014-08-27 17:32:10 UTC
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?
Comment 85 Martin Renvoize 2014-08-27 17:36:09 UTC
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>
Comment 86 Martin Renvoize 2014-08-27 17:36:15 UTC
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>
Comment 87 Martin Renvoize 2014-08-27 17:36:19 UTC
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>
Comment 88 Martin Renvoize 2014-08-27 17:36:23 UTC
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>
Comment 89 Martin Renvoize 2014-08-27 17:36:28 UTC
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>
Comment 90 Martin Renvoize 2014-08-27 17:36:31 UTC
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>
Comment 91 Martin Renvoize 2014-08-27 17:36:36 UTC
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>
Comment 92 Martin Renvoize 2014-08-27 17:36:43 UTC
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>
Comment 93 Martin Renvoize 2014-08-27 17:36:50 UTC
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>
Comment 94 Martin Renvoize 2014-08-27 17:36:56 UTC
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>
Comment 95 Martin Renvoize 2014-08-27 17:37:01 UTC
Created attachment 31208 [details] [review]
[PASSED QA] Bug 11577 : Fixing a tiny typo

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 96 Martin Renvoize 2014-08-27 17:37:06 UTC
Created attachment 31209 [details] [review]
[QA FOLLOWUP] Bug 11577 : Fixing a tiny copy/paste issue
Comment 97 Martin Renvoize 2014-08-27 17:50:41 UTC
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.
Comment 98 Holger Meißner 2014-08-28 07:53:20 UTC
Thank you Martin.

You did a great job, spotting those typos and copy/paste errors! I'm a bit embarrassed that I missed them. :)
Comment 99 Holger Meißner 2014-09-17 06:49:29 UTC
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>
Comment 100 Holger Meißner 2014-09-17 06:49:34 UTC
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>
Comment 101 Holger Meißner 2014-09-17 06:49:38 UTC
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>
Comment 102 Holger Meißner 2014-09-17 06:49:42 UTC
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>
Comment 103 Holger Meißner 2014-09-17 06:49:46 UTC
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>
Comment 104 Holger Meißner 2014-09-17 06:49:52 UTC
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>
Comment 105 Holger Meißner 2014-09-17 06:49:56 UTC
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>
Comment 106 Holger Meißner 2014-09-17 06:50:00 UTC
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>
Comment 107 Holger Meißner 2014-09-17 06:50:06 UTC
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>
Comment 108 Holger Meißner 2014-09-17 06:50:13 UTC
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>
Comment 109 Holger Meißner 2014-09-17 06:50:20 UTC
Created attachment 31650 [details] [review]
Bug 11577 : Fixing a tiny typo

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 110 Holger Meißner 2014-09-17 06:50:25 UTC
Created attachment 31651 [details] [review]
Bug 11577 : Fixing a tiny copy/paste issue
Comment 111 Holger Meißner 2014-09-17 07:00:20 UTC
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>
Comment 112 Holger Meißner 2014-09-17 07:00:25 UTC
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>
Comment 113 Holger Meißner 2014-09-17 07:00:30 UTC
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>
Comment 114 Holger Meißner 2014-09-17 07:00:34 UTC
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>
Comment 115 Holger Meißner 2014-09-17 07:00:38 UTC
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>
Comment 116 Holger Meißner 2014-09-17 07:00:42 UTC
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>
Comment 117 Holger Meißner 2014-09-17 07:00:47 UTC
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>
Comment 118 Holger Meißner 2014-09-17 07:00:53 UTC
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>
Comment 119 Holger Meißner 2014-09-17 07:00:56 UTC
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>
Comment 120 Holger Meißner 2014-09-17 07:01:00 UTC
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>
Comment 121 Holger Meißner 2014-09-17 07:01:05 UTC
Created attachment 31662 [details] [review]
[PASSED QA] Bug 11577 : Fixing a tiny typo

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 122 Holger Meißner 2014-09-17 07:01:08 UTC
Created attachment 31663 [details] [review]
[QA FOLLOWUP] Bug 11577 : Fixing a tiny copy/paste issue
Comment 123 Holger Meißner 2014-09-17 07:15:02 UTC
I rebased once more, because of two very tiny conflicts in updatedatabase.pl (DBVersion) and Circulation.t (just the number of tests).
Comment 124 Tomás Cohen Arazi 2014-09-17 23:16:07 UTC
New feature pushed to master.

Thanks Holger!
Comment 125 Katrin Fischer 2014-10-15 20:00:40 UTC
*** Bug 13092 has been marked as a duplicate of this bug. ***
Comment 126 Mason James 2015-01-20 14:31:08 UTC
Skipping patch for 3.16.x series