parent
5cb9c67443
commit
4d98b64a1b
|
@ -49,8 +49,7 @@ class AcknowledgeForm extends CommandForm
|
|||
}
|
||||
|
||||
/**
|
||||
* Interface method to build the form
|
||||
* @see CommandForm::create
|
||||
* Create the form's elements
|
||||
*/
|
||||
protected function create()
|
||||
{
|
||||
|
|
|
@ -29,17 +29,19 @@
|
|||
namespace Monitoring\Form\Command;
|
||||
|
||||
/**
|
||||
* Form to handle DelayNotification command
|
||||
* Form for the delay notification command
|
||||
*/
|
||||
class DelayNotificationForm extends CommandForm
|
||||
{
|
||||
/**
|
||||
* Biggest value for minutes
|
||||
* Maximum delay amount in minutes
|
||||
*/
|
||||
const MAX_VALUE = 1440;
|
||||
const MAX_DELAY = 1440; // 1 day
|
||||
|
||||
/**
|
||||
* Interface method to build the form
|
||||
* @see CommandForm::create
|
||||
* Create the form's elements
|
||||
*
|
||||
* @see CommandForm::create()
|
||||
*/
|
||||
protected function create()
|
||||
{
|
||||
|
@ -47,26 +49,32 @@ class DelayNotificationForm extends CommandForm
|
|||
'text',
|
||||
'minutes',
|
||||
array(
|
||||
'label' => t('Notification delay'),
|
||||
'style' => 'width: 80px;',
|
||||
'value' => 0,
|
||||
'required' => true,
|
||||
'validators' => array(
|
||||
'label' => t('Notification Delay (minutes from now)'),
|
||||
'style' => 'width: 80px;',
|
||||
'value' => 0,
|
||||
'required' => true,
|
||||
'validators' => array(
|
||||
array(
|
||||
'between',
|
||||
true,
|
||||
array(
|
||||
'min' => 1,
|
||||
'max' => self::MAX_VALUE
|
||||
'max' => self::MAX_DELAY
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$this->addNote('Delay next notification in minutes from now');
|
||||
$this->addNote(
|
||||
t(
|
||||
'Delay the next problem notification. The notification delay will be '
|
||||
. 'disregarded if the host/service changes state before the next notification is '
|
||||
. 'scheduled to be sent out.'
|
||||
)
|
||||
);
|
||||
|
||||
$this->setSubmitLabel(t('Delay notification'));
|
||||
$this->setSubmitLabel(t('Delay Notification'));
|
||||
|
||||
parent::create();
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace Monitoring\Form\Command;
|
|||
use Icinga\Exception\ProgrammingError;
|
||||
|
||||
/**
|
||||
* Form for command SubmitPassiveCheckResult
|
||||
* Form for submitting passive check results
|
||||
*/
|
||||
class SubmitPassiveCheckResultForm extends CommandForm
|
||||
{
|
||||
|
@ -116,8 +116,9 @@ class SubmitPassiveCheckResultForm extends CommandForm
|
|||
}
|
||||
|
||||
/**
|
||||
* Interface method to build the form
|
||||
* @see CommandForm::create
|
||||
* Create the form's elements
|
||||
*
|
||||
* @see CommandForm::create()
|
||||
*/
|
||||
protected function create()
|
||||
{
|
||||
|
|
|
@ -29,18 +29,19 @@
|
|||
namespace Monitoring\Form\Command;
|
||||
|
||||
/**
|
||||
* Class handle specific command flags
|
||||
* Base class for command forms which allow to propagate the command to child objects too
|
||||
*/
|
||||
abstract class WithChildrenCommandForm extends CommandForm
|
||||
{
|
||||
/**
|
||||
* Flag if we handle child objects as well
|
||||
* Whether to include all objects beyond as well
|
||||
* @var bool
|
||||
*/
|
||||
private $withChildren = false;
|
||||
|
||||
/**
|
||||
* Setter for withChildren
|
||||
*
|
||||
* @param bool $flag
|
||||
*/
|
||||
public function setWithChildren($flag = true)
|
||||
|
@ -50,6 +51,7 @@ abstract class WithChildrenCommandForm extends CommandForm
|
|||
|
||||
/**
|
||||
* Getter for withChildren
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getWithChildren()
|
||||
|
|
Loading…
Reference in New Issue