From bfdae229962cc11c7d1fbc23b57876d99ae913b0 Mon Sep 17 00:00:00 2001 From: Lari Taskula Date: Tue, 17 May 2022 23:19:58 +0000 Subject: [PATCH] Bug 3935: Add support for recurring scheduled tasks Tools->Task scheduler lacked the ability to repeatedly execute tasks. This patch adds such functionality. It adds a new parameter "--recurring" to misc/cronjobs/runreport.pl After runreport.pl is executed and if --recurring is provided, we will now schedule a new task with the same parameters. To test: 1. Navigate to Tools->Task scheduler 2. Observe there is nothing that allows you to repeatedly execute the task 3. Apply patch 4. Refresh Tools->Task scheduler page 5. Observe new field "Recurring every" ... "minutes/hours/days..." 6. Check current server time 7. Add current server time + 1 minute to "Time" field 8. Add "1 minutes" to "Recurring every" field 9. Select a saved report (if you don't have one, create a new one) 10. Add your email address to "Email" 11. Click "Save" 12. Observe new row at "Jobs already entered" section and note down given datetime 13. Wait one minute 14. Refresh Tools->Task scheduler page 15. Observe updated row at "Jobs already entered" section, it should now have datetime + 1 minute of what you observed at step 12 --- .../prog/en/modules/tools/scheduler.tt | 13 ++++++ misc/cronjobs/runreport.pl | 44 +++++++++++++++++++ tools/scheduler.pl | 20 +++++---- 3 files changed, 68 insertions(+), 9 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/scheduler.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/scheduler.tt index 918ed0ce56..b58408ab4c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/scheduler.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/scheduler.tt @@ -51,6 +51,19 @@
[% INCLUDE 'date-format.inc' %]
+
  • + + + +
    (optional)
    +