Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 3 -> master #148

Merged
merged 42 commits into from
Nov 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
4d55975
Remove obsolete branch-alias
Nov 16, 2016
3c49b8d
Update translations
Nov 16, 2016
d8cc024
doc(composer) Removed 'master' branch alias for 2.x branch line
Jan 13, 2017
8794f26
Updates: Readme
johannesx75 Nov 17, 2016
e03ca86
Add self as author to composer.json
Nov 17, 2016
4072408
fix(QueuedJobService) Broken job status set Wait
Feb 7, 2017
f17a1b9
test(QueuedJobService) Added testcase for memory expired broken job
Feb 7, 2017
d375eea
Solved issue #114 where a job's StartAfter date was always being save…
Feb 12, 2017
3dc2935
Add(queue) defaultJobs yml config for setting up a list of required jobs
Feb 14, 2017
b3e40dc
Fix(defaultJobs) add content to missing job email
Feb 14, 2017
a4add19
Merge pull request #115 from sapiensfio/fix-114
nyeholt Feb 16, 2017
0215e70
Fix(defaultJobs) improve code clarity
Feb 19, 2017
a0c75b4
Merge pull request #116 from stephenmcm/feature-defaultjobs
nyeholt Feb 27, 2017
f9ee41f
Add check for status paused to default job check
Mar 31, 2017
5da00e6
Making inclusion-duration of finished jobs configurable
micschk Apr 1, 2017
842712f
Add test for status paused default jobs
Apr 3, 2017
218017e
Update readme to explain default jobs
Apr 3, 2017
3c6fbcb
Merge pull request #121 from stephenmcm/fix-defaultjobs
nyeholt Apr 10, 2017
cccd9fc
Merge pull request #119 from micschk/patch-2
nyeholt Apr 19, 2017
3f094b3
FIX Issue where setting isComplete=true during 'setup()' or 'prepareF…
May 7, 2017
a28aae9
fix(JobErrorHandler): Fix bug where deprecation / variable set in if-…
May 10, 2017
afbfa0f
Merge pull request #128 from SilbinaryWolf/fix-hiddenerrormessages
nyeholt May 11, 2017
2720a98
Always enqueue a new CleanupJob when complete
May 22, 2017
0cafb56
Merge pull request #130 from oddnoc/reenqueue-fix
nyeholt May 23, 2017
a98e02f
FIX, correcting an issue where the module would end up on the wrong p…
Jun 30, 2017
b0a83fb
FIX, correcting an issue where the module would end up on the wrong p…
Jun 30, 2017
4262e03
Making inclusion-duration of finished jobs configurable
micschk Apr 1, 2017
a667ff3
Vendor update
jonom Jul 3, 2017
3e11add
Merge pull request #132 from jonom/patch-1
Jul 4, 2017
308d0a7
fix(QueuedJobService): When a job hits the "Job releasing memory and …
Jul 5, 2017
59f0cb9
Fix(defaultJobs) config now loads correctly. Add SS_Log of missing jo…
Jul 5, 2017
35d1ade
Fix(defaultJobs) update readme and default jobs check to use injector…
Jul 19, 2017
6e7bd17
Merge pull request #135 from stephenmcm/fix-defaultjobs
nyeholt Jul 19, 2017
4103227
Fix(defaultJobs) fix filtering of active jobs. Improve log messages
Jul 20, 2017
1e9f26a
Merge pull request #136 from stephenmcm/fix-defaultjob
stephenmcm Jul 20, 2017
0f5928c
Re-vendor framework 3.x compatible version as 3.0.x-dev
Aug 28, 2017
087c8ca
FIX ImmediateQueueHandler needs `scheduleJob` method to match expecte…
dhensby Nov 2, 2017
b9fc5fe
Merge pull request #146 from dhensby/pulls/2.8/immediate-handler
robbieaverill Nov 2, 2017
ecbd202
Merge branch '2.8' into 2.9
dhensby Nov 6, 2017
84cabea
Merge branch '2.9' into 2.10
dhensby Nov 6, 2017
4ba817c
Merge branch '2.10' into 3
dhensby Nov 6, 2017
c9d7672
Merge branch '3'
dhensby Nov 7, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of SilverStripe nor the names of its contributors may be used to endorse or promote products derived from this software
* Neither the name of SilverStripe nor the names of its contributors may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
81 changes: 80 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# SilverStripe Queued Jobs Module

[![Build Status](https://travis-ci.org/symbiote/silverstripe-queuedjobs.svg?branch=master)](https://travis-ci.org/symbiote/silverstripe-queuedjobs)
[![Scrutinizer](https://scrutinizer-ci.com/g/symbiote/silverstripe-queuedjobs/badges/quality-score.png)](https://scrutinizer-ci.com/g/symbiote/silverstripe-queuedjobs/)


## Maintainer Contact

Marcus Nyeholt

marcus@symbiote.com.au
<marcus (at) symbiote (dot) com (dot) au>

## Requirements

Expand Down Expand Up @@ -128,6 +130,83 @@ Note - if you do NOT have this running, make sure to set `QueuedJobService::$use
so that immediate mode jobs don't stall. By setting this to true, immediate jobs will be executed after
the request finishes as the php script ends.

# Default Jobs

Some jobs should always be either running or queued to run, things like data refreshes or periodic clean up jobs, we call these Default Jobs.
Default jobs are checked for at the end of each job queue process, using the job type and any fields in the filter to create an SQL query e.g.

```
ArbitraryName:
type: 'ScheduledExternalImportJob'
filter:
JobTitle: 'Scheduled import from Services'
```

Will become:

```
QueuedJobDescriptor::get()->filter(array(
'type' => 'ScheduledExternalImportJob',
'JobTitle' => 'Scheduled import from Services'
));
```

This query is checked to see if there's at least 1 healthly (new, run, wait or paused) job matching the filter. If there's not and recreate is true in the yml config we use the construct array as params to pass to a new job object e.g:

```
ArbitraryName:
type: 'ScheduledExternalImportJob'
filter:
JobTitle: 'Scheduled import from Services'
recreate: 1
construct:
repeat: 300
contentItem: 100
target: 157
```
If the above job is missing it will be recreated as:
```
Injector::inst()->createWithArgs('ScheduledExternalImportJob', $construct[])
```

### Pausing Default Jobs

If you need to stop a default job from raising alerts and being recreated, set an existing copy of the job to Paused in the CMS.

### YML config

Default jobs are defined in yml config the sample below covers the options and expected values

```
Injector:
QueuedJobService:
properties:
defaultJobs:
# This key is used as the title for error logs and alert emails
ArbitraryName:
# The job type should be the class name of a job REQUIRED
type: 'ScheduledExternalImportJob'
# This plus the job type is used to create the SQL query REQUIRED
filter:
# 1 or more Fieldname: 'value' sets that will be queried on REQUIRED
# These can be valid ORM filter
JobTitle: 'Scheduled import from Services'
# Sets whether the job will be recreated or not OPTIONAL
recreate: 1
# Set the email address to send the alert to if not set site admin email is used OPTIONAL
email: '[email protected]'
# Parameters set on the recreated object OPTIONAL
construct:
# 1 or more Fieldname: 'value' sets be passed to the constructor OPTIONAL
repeat: 300
title: 'Scheduled import from Services'
# Minimal implementation will send alerts but not recreate
AnotherTitle:
type: 'AJob'
filter:
JobTitle: 'A job'
```

## Configuring the CleanupJob

By default the CleanupJob is disabled. To enable it, set the following in your YML:
Expand Down
10 changes: 5 additions & 5 deletions lang/ar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ ar:
MEMORY_RELEASE: 'ذاكرة إطلاق الوظائف و الانتظار (s% مستخدم)'
STALLED_JOB: 'الوظيفة المؤجلة'
STALLED_JOB_MSG: 'وظيفة باسم s% تبين أنها تعطلت. قد تم توقفها, من فضلك سجل الدخول لكى تتحقق منها'
TABLE_ADDE: تمت إضافته
TABLE_ADDE: 'تمت إضافته'
TABLE_MESSAGES: رسالة
TABLE_NUM_PROCESSED: تم
TABLE_STARTED: تم البدأ
TABLE_NUM_PROCESSED: 'تم'
TABLE_STARTED: 'تم البدأ'
TABLE_START_AFTER: 'ابدأ بعد'
TABLE_STATUS: الحالة
TABLE_TITLE: عنوان
Expand All @@ -33,14 +33,14 @@ ar:
ScheduledExecution:
EXECUTE_EVERY: 'قم بتنفيذ كل'
EXECUTE_FREE: 'محددة (بصيغة إس تى آر تو تايم من التنفيذ الأول)'
ExecuteEveryDay: يوم
ExecuteEveryDay: 'يوم'
ExecuteEveryFortnight: أسبوعان
ExecuteEveryHour: ساعة
ExecuteEveryMonth: شهر
ExecuteEveryWeek: أسبوع
ExecuteEveryYear: سنة
FIRST_EXECUTION: 'التنفيذ الأول'
NEXT_RUN_DATE: 'موعد التشغيل التالى'
ScheduleTabTitle: الجدول الزمني
ScheduleTabTitle: 'الجدول الزمني'
ScheduledExecutionJob:
Title: 'موعد التنفيذ المحدد ل {title}'
4 changes: 2 additions & 2 deletions lang/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ de:
JOB_EXCEPT: 'Auftrag hat einen ''%s'' Fehler verursacht in %s Zeile %s '
JOB_PAUSED: 'Auftrag pausiert um %s'
JOB_STALLED: 'Auftrag angehalten nach %s versuchen. Bitte überprüfen Sie den Auftrag.'
JOB_TYPE: 'Auftragstyp'
JOB_TYPE: Auftragstyp
JobsFieldTitle: Aufträge
STALLED_JOB: 'Angehaltener Auftrag'
STALLED_JOB_MSG: 'Der Auftrag %s scheint festzustecken. Er wurde angehalten. Bitte loggen Sie sich ein, um den Auftrag zu überprüfen.'
Expand All @@ -39,7 +39,7 @@ de:
EXECUTE_EVERY: 'Alle ausführen'
EXECUTE_FREE: 'Geplant (in strtotime-format nach dem ersten Ausführen)'
ExecuteEveryDay: Tag
ExecuteEveryFortnight: Zwei Wochen
ExecuteEveryFortnight: 'Zwei Wochen'
ExecuteEveryHour: Stunde
ExecuteEveryMinute: Minute
ExecuteEveryMonth: Monat
Expand Down
2 changes: 1 addition & 1 deletion lang/eo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ eo:
EXECUTE_EVERY: 'Plenumi ĉiun'
EXECUTE_FREE: 'Planita (en strtotime-formato ek de unua plenumo)'
ExecuteEveryDay: Tago
ExecuteEveryFortnight: Du semajnoj
ExecuteEveryFortnight: 'Du semajnoj'
ExecuteEveryHour: Horo
ExecuteEveryMinute: Minuto
ExecuteEveryMonth: Monato
Expand Down
4 changes: 2 additions & 2 deletions lang/fi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fi:
SINGULARNAME: 'Jonossa olevan tehtävän kuvaaja'
QueuedJobs:
JOB_PAUSED: 'Tehtävä pysäytetty aikaan %s'
JOB_TYPE: 'Tehtävätyyppi'
JOB_TYPE: Tehtävätyyppi
JobsFieldTitle: Tehtävät
STALLED_JOB: 'Pysäytetty työ'
STALLED_JOB_MSG: '%s tehtävä näyttää olevan seisahtunut. Se on nyt pysäytetty. Ole hyvä ja kirjaudu sisään tarkastellaksesi sitä'
Expand All @@ -26,7 +26,7 @@ fi:
ScheduledExecution:
EXECUTE_EVERY: 'Suorita joka'
ExecuteEveryDay: Päivä
ExecuteEveryFortnight: Kaksi viikkoa
ExecuteEveryFortnight: 'Kaksi viikkoa'
ExecuteEveryHour: Tunti
ExecuteEveryMonth: Kuukausi
ExecuteEveryWeek: Viikko
Expand Down
2 changes: 1 addition & 1 deletion lang/hr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ hr:
EXECUTE_EVERY: 'Izvrši svaki'
EXECUTE_FREE: 'Planirano (u strtotime formatu od prvog pokretanja)'
ExecuteEveryDay: dan
ExecuteEveryFortnight: dve nedjelje
ExecuteEveryFortnight: 'dve nedjelje'
ExecuteEveryHour: sat
ExecuteEveryMinute: minuta
ExecuteEveryMonth: mjesec
Expand Down
12 changes: 6 additions & 6 deletions lang/mi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@ mi:
JOB_PAUSED: 'i okioki te mahi i %s'
JOB_STALLED: 'I auporoa te mahi i muri i ngā whakamātauranga %s - me tirotiro'
JOB_TYPE: 'Momo mahi'
JobsFieldTitle: Ngā Mahi
JobsFieldTitle: 'Ngā Mahi'
MEMORY_RELEASE: 'E tuku pūmahara ana te mahi, ka tataru (i whakamahia te %s)'
STALLED_JOB: 'Mahi Kua Auporoa'
STALLED_JOB_MSG: 'Te āhua nei, kua auporoa he mahi e kīia ana ko %s. Kua okioki, me takiuru anō kia tirohia'
TABLE_ADDE: I Tāpiritia
TABLE_ADDE: 'I Tāpiritia'
TABLE_MESSAGES: Karere
TABLE_NUM_PROCESSED: Kua Oti
TABLE_STARTED: I Tīmata
TABLE_NUM_PROCESSED: 'Kua Oti'
TABLE_STARTED: 'I Tīmata'
TABLE_START_AFTER: 'Tīmata Ā Muri'
TABLE_STATUS: Tūnga
TABLE_TITLE: Taitara
TABLE_TOTAL: Tapeke
QueuedJobsAdmin:
MENUTITLE: Ngā Mahi
MENUTITLE: 'Ngā Mahi'
ScheduledExecution:
EXECUTE_EVERY: 'Kawea Te Katoa'
EXECUTE_FREE: 'Kua whakaritea ( i te hōputu strtotime mai i te kawenga tuatahi)'
ExecuteEveryDay: Rā
ExecuteEveryFortnight: Rua Wiki
ExecuteEveryFortnight: 'Rua Wiki'
ExecuteEveryHour: Haora
ExecuteEveryMonth: Marama
ExecuteEveryWeek: Wiki
Expand Down
57 changes: 57 additions & 0 deletions lang/ru.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
ru:
CreateQueuedJobTask:
Description: 'Задача используется для создания отложенного действия. Укажите тип задачи, укажите опциональный параметр "start" (обрабатывается функцией strtotime) для времени начала.'
DeleteObjectJob:
DELETE_JOB: Удалить
DELETE_OBJ2: 'Удалить {title}'
GenerateSitemapJob:
REGENERATE: 'Генерировать Google sitemap .xml файл'
ProcessJobQueueTask:
Description: 'Используется cron для выполнения отложенных задач.'
PublishItemsJob:
Title: 'Опубликовать вложенные объекты {title}'
QueuedJobDescriptor:
PLURALNAME: 'Дескрипторы отложенных задач'
SINGULARNAME: 'Дескриптор отложенной задачи'
QueuedJobRule:
PLURALNAME: 'Настройки отложенных задач'
SINGULARNAME: 'Настройки отложенной задачи'
QueuedJobs:
CREATE_JOB_TYPE: 'Создать задачу типа'
CREATE_NEW_JOB: 'Создать задачу'
JOB_EXCEPT: 'Произошла ошибка задачи %s в %s на строчке %s'
JOB_PAUSED: 'Задача остановлена %s'
JOB_STALLED: 'Задача замороженна после %s попыток - пожалуйста проверьте'
JOB_TYPE: 'Тип задачи'
JOB_TYPE_PARAMS: 'Параметры конструктора задачи'
JobsFieldTitle: Задачи
MEMORY_RELEASE: 'Задача ожидает освобождения памяти (%s использовано)'
STALLED_JOB: 'Замороженная задача'
STALLED_JOB_MSG: 'Задача %s заморожена. Задача была остановлена, войдите в систему для проверки'
START_JOB_TIME: 'Начать задачу в'
TABLE_ADDE: Добавлена
TABLE_MESSAGES: Сообщение
TABLE_NUM_PROCESSED: Выполнено
TABLE_STARTED: Начата
TABLE_START_AFTER: 'Начать после'
TABLE_STATUS: Статус
TABLE_TITLE: Название
TABLE_TOTAL: Итого
TIME_LIMIT: 'Очередь достигла лимита по времени и будет начата заново перед продолжением'
QueuedJobsAdmin:
MENUTITLE: Задачи
ScheduledExecution:
EXECUTE_EVERY: 'Выполнять каждые'
EXECUTE_FREE: 'Запланировано (в формате strtotime после первого выполнения)'
ExecuteEveryDay: День
ExecuteEveryFortnight: 'Две недели'
ExecuteEveryHour: Час
ExecuteEveryMinute: Минута
ExecuteEveryMonth: Месяц
ExecuteEveryWeek: Неделя
ExecuteEveryYear: Год
FIRST_EXECUTION: 'Первое исполнение'
NEXT_RUN_DATE: 'Дата следующего исполнения'
ScheduleTabTitle: 'Расписание'
ScheduledExecutionJob:
Title: 'Запланировано исполнение {title}'
22 changes: 11 additions & 11 deletions lang/zh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,38 @@ zh:
PublishItemsJob:
Title: '发布下列项 {title}'
QueuedJobDescriptor:
PLURALNAME: '排队作业描述符'
SINGULARNAME: '排队作业描述符'
PLURALNAME: 排队作业描述符
SINGULARNAME: 排队作业描述符
QueuedJobs:
JOB_EXCEPT: '作业导致例外 %s 位于 %s 的第 %s 行'
JOB_PAUSED: '作业在 %s 暂停'
JOB_STALLED: '%s 次尝试后作业停滞 —— 请检查'
JOB_TYPE: '工作类型'
JOB_TYPE: 工作类型
JobsFieldTitle: 作业
MEMORY_RELEASE: '工作正在释放内存并等待(%s 已用)'
STALLED_JOB: '呆滞任务'
STALLED_JOB: 呆滞任务
STALLED_JOB_MSG: '名为 %s 的工作似乎停滞不前。它已暂停,请登录查看'
TABLE_ADDE: 已添加
TABLE_ADDE: '已添加'
TABLE_MESSAGES: 消息
TABLE_NUM_PROCESSED: 完成
TABLE_STARTED: 已开始
TABLE_START_AFTER: '开始于'
TABLE_START_AFTER: 开始于
TABLE_STATUS: 状态
TABLE_TITLE: 标题
TABLE_TOTAL: 全部
TABLE_TITLE: '标题'
TABLE_TOTAL: '全部'
QueuedJobsAdmin:
MENUTITLE: 作业
ScheduledExecution:
EXECUTE_EVERY: '执行每'
EXECUTE_EVERY: 执行每
EXECUTE_FREE: '已调度(以首次执行的时间戳格式显示)'
ExecuteEveryDay: 日
ExecuteEveryFortnight: 两周
ExecuteEveryHour: 时
ExecuteEveryMonth: 月
ExecuteEveryWeek: 周
ExecuteEveryYear: 年
FIRST_EXECUTION: '第一次执行'
NEXT_RUN_DATE: '下一次运行日期'
FIRST_EXECUTION: 第一次执行
NEXT_RUN_DATE: 下一次运行日期
ScheduleTabTitle: 日程表
ScheduledExecutionJob:
Title: '{title}计划执行'
13 changes: 13 additions & 0 deletions src/Controllers/QueuedJobsAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use SilverStripe\Forms\GridField\GridFieldDataColumns;
use SilverStripe\Forms\TextareaField;
use SilverStripe\ORM\DataList;
use SilverStripe\Security\Member;
use SilverStripe\Security\Permission;
use Symbiote\QueuedJobs\DataObjects\QueuedJobDescriptor;
use Symbiote\QueuedJobs\Forms\GridFieldQueuedJobExecute;
Expand Down Expand Up @@ -64,6 +65,12 @@ class QueuedJobsAdmin extends ModelAdmin
'EditForm'
];

/**
* European date format
* @var string
*/
private static $date_format_european = 'dd/MM/yyyy';

/**
* @var QueuedJobService
*/
Expand Down Expand Up @@ -171,6 +178,12 @@ public function createjob($data, Form $form)
$params = isset($data['JobParams']) ? explode(PHP_EOL, $data['JobParams']) : array();
$time = isset($data['JobStart']) && is_array($data['JobStart']) ? implode(" ", $data['JobStart']) : null;

// If the user has select the European date format as their setting then replace '/' with '-' in the date string so PHP
// treats the date as this format.
if (Member::currentUser()->DateFormat == self::$date_format_european) {
$time = str_replace('/', '-', $time);
}

if ($jobType && class_exists($jobType)) {
$jobClass = new ReflectionClass($jobType);
$job = $jobClass->newInstanceArgs($params);
Expand Down
Loading