From b5fddd60fe3f78d3b80be6072d8c2a07676da9b5 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Fri, 17 Jun 2016 14:23:34 +0200 Subject: [PATCH] DirectorJobForm: allow to choose time period --- application/forms/DirectorJobForm.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/application/forms/DirectorJobForm.php b/application/forms/DirectorJobForm.php index e083adaf..84604acd 100644 --- a/application/forms/DirectorJobForm.php +++ b/application/forms/DirectorJobForm.php @@ -48,6 +48,24 @@ class DirectorJobForm extends DirectorObjectForm 'value' => $jobClass::getSuggestedRunInterval($this) )); + $periods = $this->db->enumTimeperiods(); + if (!empty($periods)) { + + $this->addElement( + 'select', + 'timeperiod_id', + array( + 'label' => $this->translate('Time period'), + 'description' => $this->translate( + 'The name of a time period within this job should be active.' + . ' Supports only simple time periods (weekday and multiple' + . ' time definitions)' + ), + 'multiOptions' => $this->optionalEnum($periods), + ) + ); + } + $this->addElement('text', 'job_name', array( 'label' => $this->translate('Job name'), 'description' => $this->translate(