Bug 12772 - Overdue Notice/Status triggers tool
Summary: Overdue Notice/Status triggers tool
Status: ASSIGNED
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Maxime Beaulieu
QA Contact: Testopia
URL:
Keywords:
Depends on: 13624 16007
Blocks:
  Show dependency treegraph
 
Reported: 2014-08-15 13:15 UTC by Francois Charbonnier
Modified: 2018-07-16 08:40 UTC (History)
15 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Medium patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 12772 - Update Database (Based on Bug13624) (6.91 KB, patch)
2015-08-13 17:34 UTC, Maxime Beaulieu
Details | Diff | Splinter Review
Bug 12772 - Overdue rules tool and backend library (38.63 KB, patch)
2015-08-13 17:34 UTC, Maxime Beaulieu
Details | Diff | Splinter Review
Bug 12772 - Reworked overdue_notices.pl script (38.32 KB, patch)
2015-08-13 17:34 UTC, Maxime Beaulieu
Details | Diff | Splinter Review
Bug 12772 - Renames atomic update file, .pl -> .perl (976 bytes, patch)
2015-08-13 17:41 UTC, Maxime Beaulieu
Details | Diff | Splinter Review
Bug 12772 - Fix warnings (5.70 KB, patch)
2015-08-24 12:50 UTC, Martin Persson
Details | Diff | Splinter Review
Bug 12772 - Fix rule updates (4.82 KB, patch)
2015-08-31 20:10 UTC, Martin Stenberg
Details | Diff | Splinter Review
Bug 12772: tmp commit rename db updatefile back to .pl for 12772 (3.43 KB, patch)
2015-11-26 18:44 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 12772 - Update Database (Based on Bug13624) (6.91 KB, patch)
2015-11-26 18:44 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 12772 - Overdue rules tool and backend library (38.34 KB, patch)
2015-11-26 18:44 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 12772 - Reworked overdue_notices.pl script (38.48 KB, patch)
2015-11-26 18:45 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 12772 - Renames atomic update file, .pl -> .perl (997 bytes, patch)
2015-11-26 18:45 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 12772 - Fix warnings (5.70 KB, patch)
2015-11-26 18:45 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 12772 - Fix rule updates (4.82 KB, patch)
2015-11-26 18:45 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 12772 - Update Database (Based on Bug13624) (7.25 KB, patch)
2015-11-26 19:01 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 12772 - Overdue rules tool and backend library (38.63 KB, patch)
2015-11-26 19:01 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 12772 - Reworked overdue_notices.pl script (38.48 KB, patch)
2015-11-26 19:01 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 12772 - Renames atomic update file, .pl -> .perl (6.83 KB, patch)
2015-11-26 19:01 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 12772 - Fix warnings (5.70 KB, patch)
2015-11-26 19:02 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 12772 - Fix rule updates (4.82 KB, patch)
2015-11-26 19:02 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 12772: Add back file so next patch does not fail (3.35 KB, patch)
2015-11-26 19:12 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 12772: Add back file so next patch does not fail (3.35 KB, patch)
2015-11-26 19:14 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 12772 - Update Database (Based on Bug13624) (7.25 KB, patch)
2015-11-26 19:14 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 12772 - Overdue rules tool and backend library (38.63 KB, patch)
2015-11-26 19:15 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 12772 - Reworked overdue_notices.pl script (38.48 KB, patch)
2015-11-26 19:15 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 12772 - Renames atomic update file, .pl -> .perl (6.83 KB, patch)
2015-11-26 19:15 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 12772 - Fix warnings (5.70 KB, patch)
2015-11-26 19:15 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 12772 - Fix rule updates (4.82 KB, patch)
2015-11-26 19:15 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Remove merge conflict markers (1.63 KB, patch)
2015-12-09 16:09 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 12772 - Update Database (Based on Bug13624) (6.95 KB, patch)
2015-12-09 16:31 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 12772: Add back file so next patch does not fail (3.35 KB, patch)
2015-12-09 17:07 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 12772 - Update Database (Based on Bug13624) (6.95 KB, patch)
2015-12-09 17:07 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 12772 - Overdue rules tool and backend library (38.63 KB, patch)
2015-12-09 17:07 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 12772 - Reworked overdue_notices.pl script (38.48 KB, patch)
2015-12-09 17:07 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 12772 - Renames atomic update file, .pl -> .perl (6.83 KB, patch)
2015-12-09 17:07 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 12772 - Fix warnings (5.70 KB, patch)
2015-12-09 17:08 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 12772 - Fix rule updates (4.82 KB, patch)
2015-12-09 17:08 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 12772 : Update kohastructure.sql (5.88 KB, patch)
2016-10-06 02:49 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 12772 - Overdue rules tool and backend library (37.25 KB, patch)
2016-10-07 00:02 UTC, Chris Cormack
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Francois Charbonnier 2014-08-15 13:15:07 UTC
Sponsored by Halland County Library

RFC (with mockup) : http://wiki.koha-community.org/wiki/Overdue_Notice_Enhancement#Overdue_Notice.2FStatus_triggers_tool

Description :

The ergonomy of the notice triggers tool will be enhanced with two new parameters : the item type et the on-hold status.

We will re-use the ergonomy and the logic of the circulation rules model. The rules will apply from the more specific to the less specific. One will be able to set up a notice trigger for a specific patron catagory and a specific item type. A default value for the item types and the patron categories will be available to generalize the rules.

For a specific notice level, we will prevent the user to set up different delay for the same combination of options.

For each rule created, the new "on-hold" option will specify that the rule applies for the « on hold » items only.

These new features will allow for example :

    to set up different rules for free of charge items or items with rental fee (since we can set up rules per item types).
    to set up different rules for available item or "on hold" item.
Comment 1 Francois Charbonnier 2015-07-20 20:04:04 UTC
This patch will include the work on Bug 12771.
Comment 2 Maxime Beaulieu 2015-08-13 17:34:21 UTC Comment hidden (obsolete)
Comment 3 Maxime Beaulieu 2015-08-13 17:34:26 UTC Comment hidden (obsolete)
Comment 4 Maxime Beaulieu 2015-08-13 17:34:31 UTC Comment hidden (obsolete)
Comment 5 Maxime Beaulieu 2015-08-13 17:41:51 UTC Comment hidden (obsolete)
Comment 6 Maxime Beaulieu 2015-08-13 17:42:44 UTC
Test plan

Apply patches (Bugs 13624 and 12772)
Run updatedatabase.pl
Add rules in Tools > Overdue notice/status triggers
Change checked out items due date to match the rules defined above
Run the overdue_notices.pl script (in /misc/cronjobs)
You should receive emails corresponding to your overdue rules
Comment 7 Francois Charbonnier 2015-08-13 21:00:34 UTC
Since we had to rewrite part of the overdue_notices.pl script, I put together all the information you'll need to understand what changes with this new script here :
http://wiki.koha-community.org/wiki/Overdue_Notice_Enhancement#Complete_Overdue_notices.pl_test_plan

Also, I put all the test cases I used here :
http://wiki.koha-community.org/wiki/Overdue_Notice_Enhancement#Complete_Overdue_notices.pl_test_plan
Comment 8 Francois Charbonnier 2015-08-13 21:01:46 UTC
The first link is wrong. The changings in the script is here :
http://wiki.koha-community.org/wiki/Overdue_Notice_Enhancement#Changings_in_the_overdue_notices.pl_script
Comment 9 Martin Persson 2015-08-24 12:50:37 UTC Comment hidden (obsolete)
Comment 10 Martin Persson 2015-08-24 14:06:31 UTC
I have done basic testing with this and it seems to work for simple cases at least. I plan to work throught the test plan before I sign off on it.
Comment 11 Martin Stenberg 2015-08-31 20:10:59 UTC Comment hidden (obsolete)
Comment 12 Eivin Giske Skaaren 2015-11-26 18:44:24 UTC Comment hidden (obsolete)
Comment 13 Eivin Giske Skaaren 2015-11-26 18:44:41 UTC Comment hidden (obsolete)
Comment 14 Eivin Giske Skaaren 2015-11-26 18:44:59 UTC Comment hidden (obsolete)
Comment 15 Eivin Giske Skaaren 2015-11-26 18:45:10 UTC Comment hidden (obsolete)
Comment 16 Eivin Giske Skaaren 2015-11-26 18:45:26 UTC Comment hidden (obsolete)
Comment 17 Eivin Giske Skaaren 2015-11-26 18:45:34 UTC Comment hidden (obsolete)
Comment 18 Eivin Giske Skaaren 2015-11-26 18:45:43 UTC Comment hidden (obsolete)
Comment 19 Eivin Giske Skaaren 2015-11-26 19:01:27 UTC Comment hidden (obsolete)
Comment 20 Eivin Giske Skaaren 2015-11-26 19:01:39 UTC Comment hidden (obsolete)
Comment 21 Eivin Giske Skaaren 2015-11-26 19:01:46 UTC Comment hidden (obsolete)
Comment 22 Eivin Giske Skaaren 2015-11-26 19:01:54 UTC Comment hidden (obsolete)
Comment 23 Eivin Giske Skaaren 2015-11-26 19:02:01 UTC Comment hidden (obsolete)
Comment 24 Eivin Giske Skaaren 2015-11-26 19:02:08 UTC Comment hidden (obsolete)
Comment 25 Eivin Giske Skaaren 2015-11-26 19:12:36 UTC Comment hidden (obsolete)
Comment 26 Eivin Giske Skaaren 2015-11-26 19:14:53 UTC Comment hidden (obsolete)
Comment 27 Eivin Giske Skaaren 2015-11-26 19:14:57 UTC Comment hidden (obsolete)
Comment 28 Eivin Giske Skaaren 2015-11-26 19:15:01 UTC Comment hidden (obsolete)
Comment 29 Eivin Giske Skaaren 2015-11-26 19:15:05 UTC Comment hidden (obsolete)
Comment 30 Eivin Giske Skaaren 2015-11-26 19:15:09 UTC Comment hidden (obsolete)
Comment 31 Eivin Giske Skaaren 2015-11-26 19:15:13 UTC Comment hidden (obsolete)
Comment 32 Eivin Giske Skaaren 2015-11-26 19:15:17 UTC Comment hidden (obsolete)
Comment 33 Eivin Giske Skaaren 2015-11-26 19:18:02 UTC
Sorry for the clutter of updates.
This was a bit of a tricky rebase but the patch now applies again.

Remember that applying 13624 is a prereq for applying this patch.
Comment 34 Kyle M Hall 2015-12-09 15:29:37 UTC
I see merge conflict markers in the first patch.
Comment 35 Kyle M Hall 2015-12-09 15:33:16 UTC
(In reply to Kyle M Hall from comment #34)
> I see merge conflict markers in the first patch.

Make that the second patch.
Comment 36 Eivin Giske Skaaren 2015-12-09 16:09:20 UTC Comment hidden (obsolete)
Comment 37 Eivin Giske Skaaren 2015-12-09 16:31:22 UTC Comment hidden (obsolete)
Comment 38 Eivin Giske Skaaren 2015-12-09 17:07:43 UTC
Created attachment 45546 [details] [review]
Bug 12772: Add back file so next patch does not fail
Comment 39 Eivin Giske Skaaren 2015-12-09 17:07:47 UTC
Created attachment 45547 [details] [review]
Bug 12772 - Update Database (Based on Bug13624)

This patch applies to Bug13624.

Removes letter number from overduerules and overdurules_transport_types

	modified:   installer/data/mysql/atomicupdate/update_13624_overduerules_transport_type.pl
	modified:   installer/data/mysql/kohastructure.sql

Remove merge conflict markers
Comment 40 Eivin Giske Skaaren 2015-12-09 17:07:50 UTC
Created attachment 45548 [details] [review]
Bug 12772 - Overdue rules tool and backend library

	modified:   C4/Overdues.pm
	modified:   koha-tmpl/intranet-tmpl/prog/en/modules/tools/overduerules.tt
	modified:   tools/overduerules.pl
Comment 41 Eivin Giske Skaaren 2015-12-09 17:07:54 UTC
Created attachment 45549 [details] [review]
Bug 12772 - Reworked overdue_notices.pl script

	modified:   misc/cronjobs/overdue_notices.pl
Comment 42 Eivin Giske Skaaren 2015-12-09 17:07:58 UTC
Created attachment 45550 [details] [review]
Bug 12772 - Renames atomic update file, .pl -> .perl

	renamed:    update_13624_overduerules_transport_type.pl -> update_13624_overduerules_transport_type.perl
Comment 43 Eivin Giske Skaaren 2015-12-09 17:08:02 UTC
Created attachment 45551 [details] [review]
Bug 12772 - Fix warnings

This commit fixes a bunch of warnings for verbose
messages which would clutter up the output.
They should not affect normal excution.

Sponsored-By: Halland County Library
Comment 44 Eivin Giske Skaaren 2015-12-09 17:08:06 UTC
Created attachment 45552 [details] [review]
Bug 12772 - Fix rule updates

Overduerules ID was not sent correctly when editing rules, resulting in rule
being cleared instead of updated. This patch fixes this issue, and a couple of
uninitilized values as a bonus.
Comment 45 Eivin Giske Skaaren 2015-12-09 17:12:03 UTC
I have fixed so that this patch can be applied to current master again and removed the merge conflict markers.
Comment 46 Eivin Giske Skaaren 2016-03-09 20:42:23 UTC
13624 that this patch depends on was pushed to master but introduced a bug tracked in 16007. Possible new dependency.
Comment 47 Chris Cormack 2016-10-05 22:10:33 UTC
Testing this now
Comment 48 Chris Cormack 2016-10-05 22:33:02 UTC
Ok, this won't apply in its current form.

The bugs it depends on have been pushed, but this is written to modify the sql of them. We can't do that, peoples databases will already have been upgraded.

So we need a new atomic script to just make the changes that are needed now the other changes have been made.

I will work on that
Comment 49 Chris Cormack 2016-10-06 02:49:20 UTC
Created attachment 56063 [details] [review]
Bug 12772 : Update kohastructure.sql

And add atomic update

To rejig the overduerules table so more than 3 types of notices can be
sent

Also removes the letternumber column from overduerules_transport_types

This patch will break the system until the others are applied
Comment 50 Chris Cormack 2016-10-07 00:02:28 UTC
Created attachment 56077 [details] [review]
Bug 12772 - Overdue rules tool and backend library

modified:   C4/Overdues.pm
	modified:   koha-tmpl/intranet-tmpl/prog/en/modules/tools/overduerules.tt
	modified:   tools/overduerules.pl

Note I had to do a lot of work to get this to apply.
It won't work fully until the following patches are done.
But attaching now so that we dont lose history of who wrote.
Working on a follow up now