Rename ConfirmationForm and ConfirmationWithIdentifierForm
Rename ConfirmationForm to CommandForm and ConfirmationWithIdentifierForm to CommandWithIdentifierForm. refs #4439
This commit is contained in:
parent
3ad4a4281d
commit
d78a5338df
|
@ -42,8 +42,8 @@ use Icinga\Exception\ConfigurationError;
|
|||
use Icinga\Exception\MissingParameterException;
|
||||
use Monitoring\Form\Command\AcknowledgeForm;
|
||||
use Monitoring\Form\Command\CommentForm;
|
||||
use Monitoring\Form\Command\ConfirmationForm;
|
||||
use Monitoring\Form\Command\ConfirmationWithIdentifierForm;
|
||||
use Monitoring\Form\Command\CommandForm;
|
||||
use Monitoring\Form\Command\CommandWithIdentifierForm;
|
||||
use Monitoring\Form\Command\CustomNotificationForm;
|
||||
use Monitoring\Form\Command\DelayNotificationForm;
|
||||
use Monitoring\Form\Command\RescheduleNextCheckForm;
|
||||
|
@ -247,7 +247,7 @@ class Monitoring_CommandController extends ModuleActionController
|
|||
public function disableactivechecksAction()
|
||||
{
|
||||
$this->setSupportedParameters(array('host', 'service'));
|
||||
$form = new ConfirmationForm();
|
||||
$form = new CommandForm();
|
||||
$form->setRequest($this->getRequest());
|
||||
$form->setSubmitLabel(t('Disable active checks'));
|
||||
$form->addNote(t('Disable active checks for this object.'));
|
||||
|
@ -265,7 +265,7 @@ class Monitoring_CommandController extends ModuleActionController
|
|||
public function enableactivechecksAction()
|
||||
{
|
||||
$this->setSupportedParameters(array('host', 'service'));
|
||||
$form = new ConfirmationForm();
|
||||
$form = new CommandForm();
|
||||
$form->setRequest($this->getRequest());
|
||||
$form->setSubmitLabel(t('Enable active checks'));
|
||||
$form->addNote(t('Enable active checks for this object.'));
|
||||
|
@ -320,7 +320,7 @@ class Monitoring_CommandController extends ModuleActionController
|
|||
public function stopobsessingAction()
|
||||
{
|
||||
$this->setSupportedParameters(array('host', 'service'));
|
||||
$form = new ConfirmationForm();
|
||||
$form = new CommandForm();
|
||||
$form->setRequest($this->getRequest());
|
||||
$form->setSubmitLabel(t('Stop obsessing'));
|
||||
$form->addNote(t('Stop obsessing over this object.'));
|
||||
|
@ -338,7 +338,7 @@ class Monitoring_CommandController extends ModuleActionController
|
|||
public function startobsessingAction()
|
||||
{
|
||||
$this->setSupportedParameters(array('host', 'service'));
|
||||
$form = new ConfirmationForm();
|
||||
$form = new CommandForm();
|
||||
$form->setRequest($this->getRequest());
|
||||
$form->setSubmitLabel(t('Start obsessing'));
|
||||
$form->addNote(t('Start obsessing over this object.'));
|
||||
|
@ -356,7 +356,7 @@ class Monitoring_CommandController extends ModuleActionController
|
|||
public function stopacceptingpassivechecksAction()
|
||||
{
|
||||
$this->setSupportedParameters(array('host', 'service'));
|
||||
$form = new ConfirmationForm();
|
||||
$form = new CommandForm();
|
||||
$form->setRequest($this->getRequest());
|
||||
$form->setSubmitLabel(t('Stop accepting passive checks'));
|
||||
$form->addNote(t('Passive checks for this object will be omitted.'));
|
||||
|
@ -374,7 +374,7 @@ class Monitoring_CommandController extends ModuleActionController
|
|||
public function startacceptingpassivechecksAction()
|
||||
{
|
||||
$this->setSupportedParameters(array('host', 'service'));
|
||||
$form = new ConfirmationForm();
|
||||
$form = new CommandForm();
|
||||
$form->setRequest($this->getRequest());
|
||||
$form->setSubmitLabel(t('Start accepting passive checks'));
|
||||
$form->addNote(t('Passive checks for this object will be accepted.'));
|
||||
|
@ -392,7 +392,7 @@ class Monitoring_CommandController extends ModuleActionController
|
|||
public function disablenotificationsAction()
|
||||
{
|
||||
$this->setSupportedParameters(array('host', 'service'));
|
||||
$form = new ConfirmationForm();
|
||||
$form = new CommandForm();
|
||||
$form->setRequest($this->getRequest());
|
||||
$form->setSubmitLabel(t('Disable notifications'));
|
||||
$form->addNote(t('Notifications for this object will be disabled.'));
|
||||
|
@ -409,7 +409,7 @@ class Monitoring_CommandController extends ModuleActionController
|
|||
*/
|
||||
public function enablenotificationsAction()
|
||||
{
|
||||
$form = new ConfirmationForm();
|
||||
$form = new CommandForm();
|
||||
$form->setRequest($this->getRequest());
|
||||
$form->setSubmitLabel(t('Enable notifications'));
|
||||
$form->addNote(t('Notifications for this object will be enabled.'));
|
||||
|
@ -483,7 +483,7 @@ class Monitoring_CommandController extends ModuleActionController
|
|||
public function removedowntimeswithchildrenAction()
|
||||
{
|
||||
$this->setSupportedParameters(array('host'));
|
||||
$form = new ConfirmationForm();
|
||||
$form = new CommandForm();
|
||||
$form->setRequest($this->getRequest());
|
||||
$form->setSubmitLabel(t('Remove downtime(s)'));
|
||||
$form->addNote(t('Remove downtime(s) from this host and its services.'));
|
||||
|
@ -501,7 +501,7 @@ class Monitoring_CommandController extends ModuleActionController
|
|||
public function disablenotificationswithchildrenAction()
|
||||
{
|
||||
$this->setSupportedParameters(array('host'));
|
||||
$form = new ConfirmationForm();
|
||||
$form = new CommandForm();
|
||||
$form->setRequest($this->getRequest());
|
||||
$form->setSubmitLabel(t('Disable notifications'));
|
||||
$form->addNote(t('Notifications for this host and its services will be disabled.'));
|
||||
|
@ -520,7 +520,7 @@ class Monitoring_CommandController extends ModuleActionController
|
|||
public function enablenotificationswithchildrenAction()
|
||||
{
|
||||
$this->setSupportedParameters(array('host'));
|
||||
$form = new ConfirmationForm();
|
||||
$form = new CommandForm();
|
||||
$form->setRequest($this->getRequest());
|
||||
$form->setSubmitLabel(t('Enable notifications'));
|
||||
$form->addNote(t('Notifications for this host and its services will be enabled.'));
|
||||
|
@ -564,7 +564,7 @@ class Monitoring_CommandController extends ModuleActionController
|
|||
public function disableactivecheckswithchildrenAction()
|
||||
{
|
||||
$this->setSupportedParameters(array('host'));
|
||||
$form = new ConfirmationForm();
|
||||
$form = new CommandForm();
|
||||
$form->setRequest($this->getRequest());
|
||||
$form->setSubmitLabel(t('Disable active checks'));
|
||||
$form->addNote(t('Disable active checks for this host and its services.'));
|
||||
|
@ -583,7 +583,7 @@ class Monitoring_CommandController extends ModuleActionController
|
|||
public function enableactivecheckswithchildrenAction()
|
||||
{
|
||||
$this->setSupportedParameters(array('host'));
|
||||
$form = new ConfirmationForm();
|
||||
$form = new CommandForm();
|
||||
$form->setRequest($this->getRequest());
|
||||
$form->setSubmitLabel(t('Enable active checks'));
|
||||
$form->addNote(t('Enable active checks for this host and its services.'));
|
||||
|
@ -602,7 +602,7 @@ class Monitoring_CommandController extends ModuleActionController
|
|||
public function disableeventhandlerAction()
|
||||
{
|
||||
$this->setSupportedParameters(array('host', 'service'));
|
||||
$form = new ConfirmationForm();
|
||||
$form = new CommandForm();
|
||||
$form->setRequest($this->getRequest());
|
||||
$form->setSubmitLabel(t('Disable event handler'));
|
||||
$form->addNote(t('Disable event handler for this object.'));
|
||||
|
@ -620,7 +620,7 @@ class Monitoring_CommandController extends ModuleActionController
|
|||
public function enableeventhandlerAction()
|
||||
{
|
||||
$this->setSupportedParameters(array('host', 'service'));
|
||||
$form = new ConfirmationForm();
|
||||
$form = new CommandForm();
|
||||
$form->setRequest($this->getRequest());
|
||||
$form->setSubmitLabel(t('Enable event handler'));
|
||||
$form->addNote(t('Enable event handler for this object.'));
|
||||
|
@ -638,7 +638,7 @@ class Monitoring_CommandController extends ModuleActionController
|
|||
public function disableflapdetectionAction()
|
||||
{
|
||||
$this->setSupportedParameters(array('host', 'service'));
|
||||
$form = new ConfirmationForm();
|
||||
$form = new CommandForm();
|
||||
$form->setRequest($this->getRequest());
|
||||
$form->setSubmitLabel(t('Disable flapping detection'));
|
||||
$form->addNote(t('Disable flapping detection for this object.'));
|
||||
|
@ -656,7 +656,7 @@ class Monitoring_CommandController extends ModuleActionController
|
|||
public function enableflapdetectionAction()
|
||||
{
|
||||
$this->setSupportedParameters(array('host', 'service'));
|
||||
$form = new ConfirmationForm();
|
||||
$form = new CommandForm();
|
||||
$form->setRequest($this->getRequest());
|
||||
$form->setSubmitLabel(t('Enable flapping detection'));
|
||||
$form->addNote(t('Enable flapping detection for this object.'));
|
||||
|
@ -691,7 +691,7 @@ class Monitoring_CommandController extends ModuleActionController
|
|||
public function resetattributesAction()
|
||||
{
|
||||
$this->setSupportedParameters(array('host', 'service'));
|
||||
$form = new ConfirmationForm();
|
||||
$form = new CommandForm();
|
||||
$form->setRequest($this->getRequest());
|
||||
$form->setSubmitLabel(t('Reset attributes'));
|
||||
$form->addNote(t('Reset modified attributes to its default.'));
|
||||
|
@ -726,7 +726,7 @@ class Monitoring_CommandController extends ModuleActionController
|
|||
public function removeacknowledgementAction()
|
||||
{
|
||||
$this->setSupportedParameters(array('host', 'service'));
|
||||
$form = new ConfirmationForm();
|
||||
$form = new CommandForm();
|
||||
$form->setRequest($this->getRequest());
|
||||
$form->setSubmitLabel(t('Remove problem acknowledgement'));
|
||||
$form->addNote(t('Remove problem acknowledgement for this object.'));
|
||||
|
@ -761,7 +761,7 @@ class Monitoring_CommandController extends ModuleActionController
|
|||
public function removedowntimeAction()
|
||||
{
|
||||
$this->setSupportedParameters(array('downtimeid'));
|
||||
$form = new ConfirmationWithIdentifierForm();
|
||||
$form = new CommandWithIdentifierForm();
|
||||
$form->setRequest($this->getRequest());
|
||||
|
||||
$form->setSubmitLabel(t('Delete downtime'));
|
||||
|
|
|
@ -37,11 +37,11 @@ use Icinga\Protocol\Commandpipe\Comment;
|
|||
/**
|
||||
* Form for acknowledge commands
|
||||
*/
|
||||
class AcknowledgeForm extends ConfirmationForm
|
||||
class AcknowledgeForm extends CommandForm
|
||||
{
|
||||
/**
|
||||
* Interface method to build the form
|
||||
* @see ConfirmationForm::create
|
||||
* @see CommandForm::create
|
||||
*/
|
||||
protected function create()
|
||||
{
|
||||
|
|
|
@ -36,7 +36,7 @@ use \Zend_Validate_Date;
|
|||
/**
|
||||
* Simple confirmation command
|
||||
*/
|
||||
class ConfirmationForm extends Form
|
||||
class CommandForm extends Form
|
||||
{
|
||||
/**
|
||||
* Default date format
|
|
@ -33,7 +33,7 @@ use \Zend_Form_Element_Hidden;
|
|||
/**
|
||||
* Form to handle confirmations with a single value processed
|
||||
*/
|
||||
class ConfirmationWithIdentifierForm extends ConfirmationForm
|
||||
class CommandWithIdentifierForm extends CommandForm
|
||||
{
|
||||
/**
|
||||
* Identifier for data field
|
||||
|
@ -124,7 +124,7 @@ class ConfirmationWithIdentifierForm extends ConfirmationForm
|
|||
|
||||
/**
|
||||
* Interface method to build the form
|
||||
* @see ConfirmationForm::create
|
||||
* @see CommandForm::create
|
||||
*/
|
||||
protected function create()
|
||||
{
|
|
@ -32,11 +32,11 @@ use Icinga\Protocol\Commandpipe\Comment;
|
|||
/**
|
||||
* Form for adding comment commands
|
||||
*/
|
||||
class CommentForm extends ConfirmationForm
|
||||
class CommentForm extends CommandForm
|
||||
{
|
||||
/**
|
||||
* Interface method to build the form
|
||||
* @see ConfirmationForm::create
|
||||
* @see CommandForm::create
|
||||
*/
|
||||
protected function create()
|
||||
{
|
||||
|
|
|
@ -33,11 +33,11 @@ use Zend_Form_Element_Hidden;
|
|||
/**
|
||||
* For for command CustomNotification
|
||||
*/
|
||||
class CustomNotificationForm extends ConfirmationForm
|
||||
class CustomNotificationForm extends CommandForm
|
||||
{
|
||||
/**
|
||||
* Interface method to build the form
|
||||
* @see ConfirmationForm::create
|
||||
* @see CommandForm::create
|
||||
*/
|
||||
protected function create()
|
||||
{
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace Monitoring\Form\Command;
|
|||
/**
|
||||
* Form to handle DelayNotification command
|
||||
*/
|
||||
class DelayNotificationForm extends ConfirmationForm
|
||||
class DelayNotificationForm extends CommandForm
|
||||
{
|
||||
/**
|
||||
* Biggest value for minutes
|
||||
|
@ -39,7 +39,7 @@ class DelayNotificationForm extends ConfirmationForm
|
|||
const MAX_VALUE = 1440;
|
||||
/**
|
||||
* Interface method to build the form
|
||||
* @see ConfirmationForm::create
|
||||
* @see CommandForm::create
|
||||
*/
|
||||
protected function create()
|
||||
{
|
||||
|
|
|
@ -39,7 +39,7 @@ class RescheduleNextCheckForm extends WithChildrenCommandForm
|
|||
{
|
||||
/**
|
||||
* Interface method to build the form
|
||||
* @see ConfirmationForm::create
|
||||
* @see CommandForm::create
|
||||
*/
|
||||
protected function create()
|
||||
{
|
||||
|
|
|
@ -93,7 +93,7 @@ class ScheduleDowntimeForm extends WithChildrenCommandForm
|
|||
/**
|
||||
* Interface method to build the form
|
||||
*
|
||||
* @see ConfirmationForm::create
|
||||
* @see CommandForm::create
|
||||
*/
|
||||
protected function create()
|
||||
{
|
||||
|
|
|
@ -33,7 +33,7 @@ use Icinga\Exception\ProgrammingError;
|
|||
/**
|
||||
* Form for command SubmitPassiveCheckResult
|
||||
*/
|
||||
class SubmitPassiveCheckResultForm extends ConfirmationForm
|
||||
class SubmitPassiveCheckResultForm extends CommandForm
|
||||
{
|
||||
/**
|
||||
* Type constant for host form
|
||||
|
@ -117,7 +117,7 @@ class SubmitPassiveCheckResultForm extends ConfirmationForm
|
|||
|
||||
/**
|
||||
* Interface method to build the form
|
||||
* @see ConfirmationForm::create
|
||||
* @see CommandForm::create
|
||||
*/
|
||||
protected function create()
|
||||
{
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace Monitoring\Form\Command;
|
|||
/**
|
||||
* Class handle specific command flags
|
||||
*/
|
||||
abstract class WithChildrenCommandForm extends ConfirmationForm
|
||||
abstract class WithChildrenCommandForm extends CommandForm
|
||||
{
|
||||
/**
|
||||
* Flag if we handle child objects as well
|
||||
|
|
|
@ -6,7 +6,7 @@ namespace Test\Monitoring\Forms\Command;
|
|||
|
||||
require_once __DIR__.'/BaseFormTest.php';
|
||||
$base = __DIR__.'/../../../../../../../';
|
||||
require_once $base.'modules/monitoring/application/forms/Command/ConfirmationForm.php';
|
||||
require_once $base.'modules/monitoring/application/forms/Command/CommandForm.php';
|
||||
require_once realpath($base.'modules/monitoring/application/forms/Command/WithChildrenCommandForm.php');
|
||||
require_once realpath($base.'modules/monitoring/application/forms/Command/AcknowledgeForm.php');
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ namespace Test\Monitoring\Forms\Command;
|
|||
|
||||
|
||||
require_once __DIR__.'/BaseFormTest.php';
|
||||
require_once __DIR__. '/../../../../../application/forms/Command/ConfirmationForm.php';
|
||||
require_once __DIR__. '/../../../../../application/forms/Command/CommandForm.php';
|
||||
require_once __DIR__. '/../../../../../application/forms/Command/WithChildrenCommandForm.php';
|
||||
require_once __DIR__. '/../../../../../application/forms/Command/CommentForm.php';
|
||||
|
||||
|
|
|
@ -4,19 +4,19 @@ namespace Test\Monitoring\Forms\Command;
|
|||
require_once __DIR__.'/BaseFormTest.php';
|
||||
require_once __DIR__. '/../../../../../../../library/Icinga/Web/Form.php';
|
||||
require_once __DIR__. '/../../../../../../../library/Icinga/Web/Form/Element/Note.php';
|
||||
require_once __DIR__. '/../../../../../application/forms/Command/ConfirmationForm.php';
|
||||
require_once __DIR__. '/../../../../../application/forms/Command/CommandForm.php';
|
||||
|
||||
|
||||
use \Zend_View;
|
||||
use \Zend_Test_PHPUnit_ControllerTestCase;
|
||||
use Monitoring\Form\Command\ConfirmationForm;
|
||||
use Monitoring\Form\Command\CommandForm;
|
||||
|
||||
class ConfirmationFormTest extends BaseFormTest
|
||||
class CommandFormTest extends BaseFormTest
|
||||
{
|
||||
public function testFormCreation()
|
||||
{
|
||||
$view = new Zend_View();
|
||||
$form = new ConfirmationForm();
|
||||
$form = new CommandForm();
|
||||
|
||||
$form->setRequest($this->getRequest());
|
||||
|
||||
|
@ -33,7 +33,7 @@ class ConfirmationFormTest extends BaseFormTest
|
|||
|
||||
public function testFormNotes()
|
||||
{
|
||||
$form = new ConfirmationForm();
|
||||
$form = new CommandForm();
|
||||
$form->addNote('test1');
|
||||
$form->addNote('test2');
|
||||
|
||||
|
|
|
@ -4,17 +4,17 @@
|
|||
namespace Test\Monitoring\Forms\Command;
|
||||
|
||||
require_once __DIR__. '/BaseFormTest.php';
|
||||
require_once __DIR__. '/../../../../../application/forms/Command/ConfirmationForm.php';
|
||||
require_once __DIR__. '/../../../../../application/forms/Command/CommandForm.php';
|
||||
require_once __DIR__. '/../../../../../application/forms/Command/WithChildrenCommandForm.php';
|
||||
require_once __DIR__. '/../../../../../application/forms/Command/ConfirmationWithIdentifierForm.php';
|
||||
require_once __DIR__. '/../../../../../application/forms/Command/CommandWithIdentifierForm.php';
|
||||
|
||||
use Monitoring\Form\Command\ConfirmationWithIdentifierForm;
|
||||
use Monitoring\Form\Command\CommandWithIdentifierForm;
|
||||
use \Zend_View;
|
||||
use \Zend_Test_PHPUnit_ControllerTestCase;
|
||||
|
||||
class ConfirmationWithIdentifierFormTest extends BaseFormTest
|
||||
class CommandWithIdentifierFormTest extends BaseFormTest
|
||||
{
|
||||
const FORMCLASS = "Monitoring\Form\Command\ConfirmationWithIdentifierForm";
|
||||
const FORMCLASS = "Monitoring\Form\Command\CommandWithIdentifierForm";
|
||||
public function testForm()
|
||||
{
|
||||
$form = $this->getRequestForm(array(), self::FORMCLASS);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
namespace Test\Monitoring\Forms\Command;
|
||||
|
||||
require_once __DIR__. '/BaseFormTest.php';
|
||||
require_once __DIR__. '/../../../../../application/forms/Command/ConfirmationForm.php';
|
||||
require_once __DIR__. '/../../../../../application/forms/Command/CommandForm.php';
|
||||
require_once __DIR__. '/../../../../../application/forms/Command/CustomNotificationForm.php';
|
||||
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
namespace Test\Monitoring\Forms\Command;
|
||||
|
||||
require_once __DIR__. '/BaseFormTest.php';
|
||||
require_once __DIR__. '/../../../../../application/forms/Command/ConfirmationForm.php';
|
||||
require_once __DIR__. '/../../../../../application/forms/Command/CommandForm.php';
|
||||
require_once __DIR__. '/../../../../../application/forms/Command/DelayNotificationForm.php';
|
||||
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ namespace Test\Monitoring\Forms\Command;
|
|||
|
||||
|
||||
require_once __DIR__. '/BaseFormTest.php';
|
||||
require_once __DIR__. '/../../../../../application/forms/Command/ConfirmationForm.php';
|
||||
require_once __DIR__. '/../../../../../application/forms/Command/CommandForm.php';
|
||||
require_once __DIR__. '/../../../../../application/forms/Command/WithChildrenCommandForm.php';
|
||||
require_once __DIR__. '/../../../../../application/forms/Command/RescheduleNextCheckForm.php';
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
namespace Test\Monitoring\Forms\Command;
|
||||
|
||||
require_once __DIR__. '/BaseFormTest.php';
|
||||
require_once __DIR__. '/../../../../../application/forms/Command/ConfirmationForm.php';
|
||||
require_once __DIR__. '/../../../../../application/forms/Command/CommandForm.php';
|
||||
require_once __DIR__. '/../../../../../application/forms/Command/WithChildrenCommandForm.php';
|
||||
require_once __DIR__. '/../../../../../application/forms/Command/ScheduleDowntimeForm.php';
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
namespace Test\Monitoring\Forms\Command;
|
||||
|
||||
require_once __DIR__. '/BaseFormTest.php';
|
||||
require_once __DIR__. '/../../../../../application/forms/Command/ConfirmationForm.php';
|
||||
require_once __DIR__. '/../../../../../application/forms/Command/CommandForm.php';
|
||||
require_once __DIR__. '/../../../../../application/forms/Command/WithChildrenCommandForm.php';
|
||||
require_once __DIR__. '/../../../../../application/forms/Command/SubmitPassiveCheckResultForm.php';
|
||||
|
||||
|
|
Loading…
Reference in New Issue