Monitoring: Make downtime for all services checkbox configurable

Signed-off-by: Eric Lippmann <eric.lippmann@icinga.com>
This commit is contained in:
tfylling 2017-09-15 11:51:49 +02:00 committed by Eric Lippmann
parent 401eda2d29
commit 46a82c2739
1 changed files with 5 additions and 1 deletions

View File

@ -4,6 +4,7 @@
namespace Icinga\Module\Monitoring\Forms\Command\Object;
use DateTime;
use Icinga\Application\Config;
use Icinga\Module\Monitoring\Command\Object\PropagateHostDowntimeCommand;
use Icinga\Module\Monitoring\Command\Object\ScheduleHostDowntimeCommand;
use Icinga\Module\Monitoring\Command\Object\ScheduleServiceDowntimeCommand;
@ -22,6 +23,8 @@ class ScheduleHostDowntimeCommandForm extends ScheduleServiceDowntimeCommandForm
{
parent::createElements($formData);
$config = Config::module('monitoring');
$this->addElement(
'checkbox',
'all_services',
@ -29,7 +32,8 @@ class ScheduleHostDowntimeCommandForm extends ScheduleServiceDowntimeCommandForm
'description' => $this->translate(
'Schedule downtime for all services on the hosts and the hosts themselves.'
),
'label' => $this->translate('All Services')
'label' => $this->translate('All Services'),
'value' => (bool) $config->get('settings', 'hostdowntime_all_services', false)
)
);