Monitoring/Commands: Add help messages to the submit passive check result form

refs #4524
This commit is contained in:
Eric Lippmann 2013-08-16 12:28:42 +02:00 committed by Jannis Moßhammer
parent b46df485ae
commit 9f1da2db1a
1 changed files with 51 additions and 12 deletions

View File

@ -28,7 +28,8 @@
namespace Monitoring\Form\Command; namespace Monitoring\Form\Command;
use Icinga\Exception\ProgrammingError; use \Icinga\Exception\ProgrammingError;
use \Icinga\Web\Form\Element\Note;
/** /**
* Form for submitting passive check results * Form for submitting passive check results
@ -59,6 +60,7 @@ class SubmitPassiveCheckResultForm extends CommandForm
/** /**
* Setup plugin states * Setup plugin states
*
* @see Zend_Form::init * @see Zend_Form::init
*/ */
public function init() public function init()
@ -85,6 +87,7 @@ class SubmitPassiveCheckResultForm extends CommandForm
/** /**
* Setter for type * Setter for type
*
* @param string $type * @param string $type
*/ */
public function setType($type) public function setType($type)
@ -94,6 +97,7 @@ class SubmitPassiveCheckResultForm extends CommandForm
/** /**
* Getter for type * Getter for type
*
* @return string * @return string
*/ */
public function getType() public function getType()
@ -103,6 +107,7 @@ class SubmitPassiveCheckResultForm extends CommandForm
/** /**
* Return array of options * Return array of options
*
* @return array * @return array
* @throws \Icinga\Exception\ProgrammingError * @throws \Icinga\Exception\ProgrammingError
*/ */
@ -117,20 +122,30 @@ class SubmitPassiveCheckResultForm extends CommandForm
/** /**
* Create the form's elements * Create the form's elements
*
* @see CommandForm::create()
*/ */
protected function create() protected function create()
{ {
$this->addElement(
new Note(
array(
'name' => 'commanddescription',
'value' => t(
'This command is used to submit a passive check result for particular hosts/services. It is '
. 'particularly useful for resetting security-related objects to OK states once they have been '
. 'dealt with.'
)
)
)
);
$this->addElement( $this->addElement(
'select', 'select',
'pluginstate', 'pluginstate',
array( array(
'label' => t('Plugin state'), 'label' => t('Check Result'),
'multiOptions' => $this->getOptions(), 'multiOptions' => $this->getOptions(),
'required' => true, 'required' => true,
'validators' => array( 'validators' => array(
array( array(
'Digits', 'Digits',
true true
@ -145,14 +160,30 @@ class SubmitPassiveCheckResultForm extends CommandForm
) )
) )
); );
$this->addElement(
new Note(
array(
'name' => 'checkresultnote',
'value' => t('Set the state which should be send to Icinga for this objects.')
)
)
);
$this->addElement( $this->addElement(
'textarea', 'textarea',
'checkoutput', 'checkoutput',
array( array(
'label' => t('Check output'), 'label' => t('Check Output'),
'rows' => 2, 'rows' => 2,
'required' => true 'required' => true
)
);
$this->addElement(
new Note(
array(
'name' => 'checkoutputnote',
'value' => t('Fill in the check output string which should be send to Icinga.')
)
) )
); );
@ -160,12 +191,20 @@ class SubmitPassiveCheckResultForm extends CommandForm
'textarea', 'textarea',
'performancedata', 'performancedata',
array( array(
'label' => t('Performance data'), 'label' => t('Performance Data'),
'rows' => 2 'rows' => 2
) )
); );
$this->addElement(
new Note(
array(
'name' => 'performancedatanote',
'value' => t('Fill in the performance data string which should be send to Icinga.')
)
)
);
$this->setSubmitLabel(t('Submit passive check result')); $this->setSubmitLabel(t('Submit Passive Check Result'));
parent::create(); parent::create();
} }