[icinga-checkins] icinga.org: icingaweb2-module-director/master: DirectorJobForm: allow to choose time period

git at icinga.org git at icinga.org
Fri Jun 17 14:24:22 CEST 2016


Module: icingaweb2-module-director
Branch: master
Commit: b5fddd60fe3f78d3b80be6072d8c2a07676da9b5
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=b5fddd60fe3f78d3b80be6072d8c2a07676da9b5

Author: Thomas Gelf <thomas at gelf.net>
Date:   Fri Jun 17 14:23:34 2016 +0200

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 e083ada..84604ac 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(



More information about the icinga-checkins mailing list