[Koha-bugs] [Bug 14834] Add a range parameter (in days) to membership_expiry cronjob

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Sep 17 13:10:35 CEST 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14834

--- Comment #1 from Marcel de Rooy <m.de.rooy at 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.


More information about the Koha-bugs mailing list