Marcel de Rooy
51be8ecd9d
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. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Work as described following test plan. Test pass No errors New parameters work with one (-) or two(--) dashes, no problem with that but convention suggest that 'long' options use two-dashes. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> |
||
---|---|---|
.. | ||
admin | ||
bin | ||
cronjobs | ||
devel | ||
interface_customization | ||
load_testing | ||
maintenance | ||
migration_tools | ||
plack | ||
release_notes | ||
search_tools | ||
translator | ||
batchCompareMARCvsFrameworks.pl | ||
batchdeletebiblios.pl | ||
batchDeleteUnusedSubfields.pl | ||
batchImportMARCWithBiblionumbers.pl | ||
batchRebuildBiblioTables.pl | ||
batchRebuildItemsTables.pl | ||
batchRepairMissingBiblionumbers.pl | ||
batchupdateISBNs.pl | ||
check_sysprefs.pl | ||
commit_file.pl | ||
export_borrowers.pl | ||
export_records.pl | ||
exportauth.pl | ||
koha-install-log | ||
kohalib.pl | ||
link_bibs_to_authorities.pl | ||
mod_zebraqueue.pl | ||
perlmodule_ls.pl | ||
perlmodule_rm.pl | ||
recreateIssueStatistics.pl | ||
sax_parser_print.pl | ||
sax_parser_test.pl | ||
sip_cli_emulator.pl | ||
stage_file.pl |