[Bug 14834] New: Add a range parameter (in days) to membership_expiry cronjob
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14834 Bug ID: 14834 Summary: Add a range parameter (in days) to membership_expiry cronjob Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: m.de.rooy@rijksmuseum.nl QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com The cronjob from bug 6810 now only looks at the exact day a membership expires. You have to run it each night. But what if you want to run it once a week? Or rerun it a day later and want to include the expires of the day before? An additional range parameter would be handy.. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14834 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=6810 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14834 Amit Gupta <amitddng135@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |amitddng135@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14834 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |6810 Patch complexity|--- |Small patch Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6810 [Bug 6810] Send membership expiry reminder notices -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14834 --- Comment #1 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 42646 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42646&action=edit Bug 14834: Add a range parameter (in days) to membership_expiry cronjob The range parameter allows you to run the cronjob in an adjusted frequency (say once a week with range 3). You can also run it again and pass range 1 to include the expires that should have been mailed yesterday, etc. Or use it to remind the patron more than once: if you choose for pref 14 and run with range 7, the patron may receive two mails. While adding the range parameter, I decided to add a branch parameter too. The parameters are passed via a hashref. The cronjob also supports both new parameters: branch and range. I decided to pass them on the command line and not via a preference. Why? Well, obviously the branch parameter is not suitable for a pref. The range parameter allows you to handle expiry mails different from the normal scheme or could be used in some sort of recovery. In those cases it will be more practical to use a command line parameter than editing a pref. (If needed, we could still add it and optionally override it?) NOTE: The unit test has been adjusted for the above reasons, but I also added some lines to let existing expires not interfere with the added borrowers by an additional count and using the branchcode parameter. Test plan: [1] Run the adjusted unit test GetUpcomingMembershipExpires.t [2] Set the expiry date for one or more patrons to now+16 (when the pref is still 14). [3] Run the cronjob without range. You should not see patrons from step 2. [4] Run the cronjob with range 2. You should see them now. [5] Run range 2 with a branchcode that does not exist. No patrons. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14834 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |m.de.rooy@rijksmuseum.nl |ity.org | Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14834 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |ASSIGNED --- Comment #2 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Wait.. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14834 --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 42650 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42650&action=edit Bug 14834: Add range parameters to membership_expiry cronjob The before/after parameter allows you to run the cronjob in an adjusted frequency (say once a week with before 7 or after 7). You can also run it again and pass before==1 to include the expires that should have been mailed yesterday, etc. Or use it to remind the patron more than once: if you choose for pref 14 and run weekly with before 7, the patron may receive two mails. While adding those two parameters, I decided to add a branch parameter too. The parameters are passed via a hashref. I decided to pass them on the command line and not via a preference. Why? Well, obviously the branch parameter is not suitable for a pref. The before/after parameter allows you to handle expiry mails different from the normal scheme or could be used in some sort of recovery. In those cases it will be more practical to use a command line parameter than editing a pref. (If needed, we could still add them and optionally override..) NOTE: The unit test has been adjusted for the above reasons, but I also added some lines to let existing expires not interfere with the added borrowers by an additional count and using the branchcode parameter. Test plan: [1] Run the adjusted unit test GetUpcomingMembershipExpires.t [2] Set the expiry date for patron A to now+16 (with pref 14). Set the expiry date for patron B to now+11. [3] Run the cronjob without range. You should not see A and B. [4] Run the cronjob with before 3. You should see patron B. [5] Run the cronjob with before 3 and after 2. You should see A and B. [6] Repeat step 5 with a branchcode that does not exist. No patrons. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14834 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff CC| |m.de.rooy@rijksmuseum.nl -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14834 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42646|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14834 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Add a range parameter (in |Add range parameters to |days) to membership_expiry |membership_expiry cronjob |cronjob | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14834 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |15543 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15543 [Bug 15543] Add another option to membership_expiry.pl -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14834 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Does not apply anymore. Rebasing this soon. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14834 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Add range parameters to |Make membership_expiry |membership_expiry cronjob |cronjob more flexible -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14834 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14834 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42650|0 |1 is obsolete| | --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 46765 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46765&action=edit Bug 14834: Make membership_expiry cronjob more flexible This patch adds three parameters to the cron job: -before and -after, and -branch. You can run the cronjob now in an adjusted frequency: say once a week with before 6 or after 6 (not both together). If your pref is set to 14, running before=6 will include expiries from 8 days to 14 days ahead. When you use after=6, you would include 14 days to 20 days ahead, etc. You could also rerun the job of yesterday by setting before=1 and after=-1; this could help in case of problem recovery. Obviously, the branch parameter can be used as a filter. NOTE: Why are these parameters passed only via the command line? Well, obviously the branch parameter is not suitable for a pref. The before/after parameter allows you to handle expiry mails different from the normal scheme or could be used in some sort of recovery. In those cases it will be more practical to use a command line parameter than editing a pref. NOTE: The unit test has been adjusted for the above reasons, but I also added some lines to let existing expires not interfere with the added borrowers by an additional count and using the branchcode parameter. Test plan: [1] Run the adjusted unit test GetUpcomingMembershipExpires.t [2] Set the expiry date for patron A to now+16 (with pref 14). Set the expiry date for patron B to now+11. [3] Run the cronjob without range. You should not see A and B. [4] Run the cronjob with before 3. You should see patron B. [5] Run the cronjob with before 3 and after 2. You should see A and B. [6] Repeat step 5 with a branchcode that does not exist. No patrons. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org