mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 23:04:51 +02:00
Commands: Use native form title and description support where appropriate
refs #7947 refs #7976
This commit is contained in:
parent
4ba281e7e8
commit
a2f88dc60f
@ -66,8 +66,9 @@ class Monitoring_HostController extends MonitoredObjectController
|
|||||||
{
|
{
|
||||||
$this->assertPermission('monitoring/command/acknowledge-problem');
|
$this->assertPermission('monitoring/command/acknowledge-problem');
|
||||||
|
|
||||||
$this->view->title = $this->translate('Acknowledge Host Problem');
|
$form = new AcknowledgeProblemCommandForm();
|
||||||
$this->handleCommandForm(new AcknowledgeProblemCommandForm());
|
$form->setTitle($this->translate('Acknowledge Host Problem'));
|
||||||
|
$this->handleCommandForm($form);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -77,8 +78,9 @@ class Monitoring_HostController extends MonitoredObjectController
|
|||||||
{
|
{
|
||||||
$this->assertPermission('monitoring/command/comment/add');
|
$this->assertPermission('monitoring/command/comment/add');
|
||||||
|
|
||||||
$this->view->title = $this->translate('Add Host Comment');
|
$form = new AddCommentCommandForm();
|
||||||
$this->handleCommandForm(new AddCommentCommandForm());
|
$form->setTitle($this->translate('Add Host Comment'));
|
||||||
|
$this->handleCommandForm($form);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -88,8 +90,9 @@ class Monitoring_HostController extends MonitoredObjectController
|
|||||||
{
|
{
|
||||||
$this->assertPermission('monitoring/command/schedule-check');
|
$this->assertPermission('monitoring/command/schedule-check');
|
||||||
|
|
||||||
$this->view->title = $this->translate('Reschedule Host Check');
|
$form = new ScheduleHostCheckCommandForm();
|
||||||
$this->handleCommandForm(new ScheduleHostCheckCommandForm());
|
$form->setTitle($this->translate('Reschedule Host Check'));
|
||||||
|
$this->handleCommandForm($form);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -99,8 +102,9 @@ class Monitoring_HostController extends MonitoredObjectController
|
|||||||
{
|
{
|
||||||
$this->assertPermission('monitoring/command/downtime/schedule');
|
$this->assertPermission('monitoring/command/downtime/schedule');
|
||||||
|
|
||||||
$this->view->title = $this->translate('Schedule Host Downtime');
|
$form = new ScheduleHostDowntimeCommandForm();
|
||||||
$this->handleCommandForm(new ScheduleHostDowntimeCommandForm());
|
$form->setTitle($this->translate('Schedule Host Downtime'));
|
||||||
|
$this->handleCommandForm($form);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -110,7 +114,8 @@ class Monitoring_HostController extends MonitoredObjectController
|
|||||||
{
|
{
|
||||||
$this->assertPermission('monitoring/command/process-check-result');
|
$this->assertPermission('monitoring/command/process-check-result');
|
||||||
|
|
||||||
$this->view->title = $this->translate('Submit Passive Host Check Result');
|
$form = new ProcessCheckResultCommandForm();
|
||||||
$this->handleCommandForm(new ProcessCheckResultCommandForm());
|
$form->setTitle($this->translate('Submit Passive Host Check Result'));
|
||||||
|
$this->handleCommandForm($form);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -175,8 +175,9 @@ class Monitoring_HostsController extends Controller
|
|||||||
{
|
{
|
||||||
$this->assertPermission('monitoring/command/acknowledge-problem');
|
$this->assertPermission('monitoring/command/acknowledge-problem');
|
||||||
|
|
||||||
$this->view->title = $this->translate('Acknowledge Host Problems');
|
$form = new AcknowledgeProblemCommandForm();
|
||||||
$this->handleCommandForm(new AcknowledgeProblemCommandForm());
|
$form->setTitle($this->translate('Acknowledge Host Problems'));
|
||||||
|
$this->handleCommandForm($form);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -186,8 +187,9 @@ class Monitoring_HostsController extends Controller
|
|||||||
{
|
{
|
||||||
$this->assertPermission('monitoring/command/schedule-check');
|
$this->assertPermission('monitoring/command/schedule-check');
|
||||||
|
|
||||||
$this->view->title = $this->translate('Reschedule Host Checks');
|
$form = new ScheduleHostCheckCommandForm();
|
||||||
$this->handleCommandForm(new ScheduleHostCheckCommandForm());
|
$form->setTitle($this->translate('Reschedule Host Checks'));
|
||||||
|
$this->handleCommandForm($form);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -197,8 +199,9 @@ class Monitoring_HostsController extends Controller
|
|||||||
{
|
{
|
||||||
$this->assertPermission('monitoring/command/downtime/schedule');
|
$this->assertPermission('monitoring/command/downtime/schedule');
|
||||||
|
|
||||||
$this->view->title = $this->translate('Schedule Host Downtimes');
|
$form = new ScheduleHostDowntimeCommandForm();
|
||||||
$this->handleCommandForm(new ScheduleHostDowntimeCommandForm());
|
$form->setTitle($this->translate('Schedule Host Downtimes'));
|
||||||
|
$this->handleCommandForm($form);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -208,7 +211,8 @@ class Monitoring_HostsController extends Controller
|
|||||||
{
|
{
|
||||||
$this->assertPermission('monitoring/command/process-check-result');
|
$this->assertPermission('monitoring/command/process-check-result');
|
||||||
|
|
||||||
$this->view->title = $this->translate('Submit Passive Host Check Results');
|
$form = new ProcessCheckResultCommandForm();
|
||||||
$this->handleCommandForm(new ProcessCheckResultCommandForm());
|
$form->setTitle($this->translate('Submit Passive Host Check Results'));
|
||||||
|
$this->handleCommandForm($form);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,8 +43,9 @@ class Monitoring_ServiceController extends MonitoredObjectController
|
|||||||
{
|
{
|
||||||
$this->assertPermission('monitoring/command/acknowledge-problem');
|
$this->assertPermission('monitoring/command/acknowledge-problem');
|
||||||
|
|
||||||
$this->view->title = $this->translate('Acknowledge Service Problem');
|
$form = new AcknowledgeProblemCommandForm();
|
||||||
$this->handleCommandForm(new AcknowledgeProblemCommandForm());
|
$form->setTitle($this->translate('Acknowledge Service Problem'));
|
||||||
|
$this->handleCommandForm($form);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -54,8 +55,9 @@ class Monitoring_ServiceController extends MonitoredObjectController
|
|||||||
{
|
{
|
||||||
$this->assertPermission('monitoring/command/comment/add');
|
$this->assertPermission('monitoring/command/comment/add');
|
||||||
|
|
||||||
$this->view->title = $this->translate('Add Service Comment');
|
$form = new AddCommentCommandForm();
|
||||||
$this->handleCommandForm(new AddCommentCommandForm());
|
$form->setTitle($this->translate('Add Service Comment'));
|
||||||
|
$this->handleCommandForm($form);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -65,8 +67,9 @@ class Monitoring_ServiceController extends MonitoredObjectController
|
|||||||
{
|
{
|
||||||
$this->assertPermission('monitoring/command/schedule-check');
|
$this->assertPermission('monitoring/command/schedule-check');
|
||||||
|
|
||||||
$this->view->title = $this->translate('Reschedule Service Check');
|
$form = new ScheduleServiceCheckCommandForm();
|
||||||
$this->handleCommandForm(new ScheduleServiceCheckCommandForm());
|
$form->setTitle($this->translate('Reschedule Service Check'));
|
||||||
|
$this->handleCommandForm($form);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -76,8 +79,9 @@ class Monitoring_ServiceController extends MonitoredObjectController
|
|||||||
{
|
{
|
||||||
$this->assertPermission('monitoring/command/downtime/schedule');
|
$this->assertPermission('monitoring/command/downtime/schedule');
|
||||||
|
|
||||||
$this->view->title = $this->translate('Schedule Service Downtime');
|
$form = new ScheduleServiceDowntimeCommandForm();
|
||||||
$this->handleCommandForm(new ScheduleServiceDowntimeCommandForm());
|
$form->setTitle($this->translate('Schedule Service Downtime'));
|
||||||
|
$this->handleCommandForm($form);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -87,7 +91,8 @@ class Monitoring_ServiceController extends MonitoredObjectController
|
|||||||
{
|
{
|
||||||
$this->assertPermission('monitoring/command/process-check-result');
|
$this->assertPermission('monitoring/command/process-check-result');
|
||||||
|
|
||||||
$this->view->title = $this->translate('Submit Passive Service Check Result');
|
$form = new ProcessCheckResultCommandForm();
|
||||||
$this->handleCommandForm(new ProcessCheckResultCommandForm());
|
$form->setTitle($this->translate('Submit Passive Service Check Result'));
|
||||||
|
$this->handleCommandForm($form);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -224,8 +224,9 @@ class Monitoring_ServicesController extends Controller
|
|||||||
{
|
{
|
||||||
$this->assertPermission('monitoring/command/acknowledge-problem');
|
$this->assertPermission('monitoring/command/acknowledge-problem');
|
||||||
|
|
||||||
$this->view->title = $this->translate('Acknowledge Service Problems');
|
$form = new AcknowledgeProblemCommandForm();
|
||||||
$this->handleCommandForm(new AcknowledgeProblemCommandForm());
|
$form->setTitle($this->translate('Acknowledge Service Problems'));
|
||||||
|
$this->handleCommandForm($form);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -235,8 +236,9 @@ class Monitoring_ServicesController extends Controller
|
|||||||
{
|
{
|
||||||
$this->assertPermission('monitoring/command/schedule-check');
|
$this->assertPermission('monitoring/command/schedule-check');
|
||||||
|
|
||||||
$this->view->title = $this->translate('Reschedule Service Checks');
|
$form = new ScheduleServiceCheckCommandForm();
|
||||||
$this->handleCommandForm(new ScheduleServiceCheckCommandForm());
|
$form->setTitle($this->translate('Reschedule Service Checks'));
|
||||||
|
$this->handleCommandForm($form);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -246,8 +248,9 @@ class Monitoring_ServicesController extends Controller
|
|||||||
{
|
{
|
||||||
$this->assertPermission('monitoring/command/downtime/schedule');
|
$this->assertPermission('monitoring/command/downtime/schedule');
|
||||||
|
|
||||||
$this->view->title = $this->translate('Schedule Service Downtimes');
|
$form = new ScheduleServiceDowntimeCommandForm();
|
||||||
$this->handleCommandForm(new ScheduleServiceDowntimeCommandForm());
|
$form->setTitle($this->translate('Schedule Service Downtimes'));
|
||||||
|
$this->handleCommandForm($form);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -257,7 +260,8 @@ class Monitoring_ServicesController extends Controller
|
|||||||
{
|
{
|
||||||
$this->assertPermission('monitoring/command/process-check-result');
|
$this->assertPermission('monitoring/command/process-check-result');
|
||||||
|
|
||||||
$this->view->title = $this->translate('Submit Passive Service Check Results');
|
$form = new ProcessCheckResultCommandForm();
|
||||||
$this->handleCommandForm(new ProcessCheckResultCommandForm());
|
$form->setTitle($this->translate('Submit Passive Service Check Results'));
|
||||||
|
$this->handleCommandForm($form);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,17 +22,9 @@ class DisableNotificationsExpireCommandForm extends CommandForm
|
|||||||
{
|
{
|
||||||
$this->setRequiredCue(null);
|
$this->setRequiredCue(null);
|
||||||
$this->setSubmitLabel($this->translate('Disable Notifications'));
|
$this->setSubmitLabel($this->translate('Disable Notifications'));
|
||||||
}
|
$this->addDescription($this->translate(
|
||||||
|
|
||||||
/**
|
|
||||||
* (non-PHPDoc)
|
|
||||||
* @see \Icinga\Module\Monitoring\Forms\Command\CommandForm::getHelp() For the method documentation.
|
|
||||||
*/
|
|
||||||
public function getHelp()
|
|
||||||
{
|
|
||||||
return $this->translate(
|
|
||||||
'This command is used to disable host and service notifications for a specific time.'
|
'This command is used to disable host and service notifications for a specific time.'
|
||||||
);
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -13,28 +13,25 @@ use Icinga\Web\Notification;
|
|||||||
*/
|
*/
|
||||||
class AcknowledgeProblemCommandForm extends ObjectsCommandForm
|
class AcknowledgeProblemCommandForm extends ObjectsCommandForm
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Initialize this form
|
||||||
|
*/
|
||||||
|
public function init()
|
||||||
|
{
|
||||||
|
$this->addDescription($this->translate(
|
||||||
|
'This command is used to acknowledge host or service problems. When a problem is acknowledged,'
|
||||||
|
. ' future notifications about problems are temporarily disabled until the host or service'
|
||||||
|
. ' recovers.'
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (non-PHPDoc)
|
* (non-PHPDoc)
|
||||||
* @see \Icinga\Web\Form::getSubmitLabel() For the method documentation.
|
* @see \Icinga\Web\Form::getSubmitLabel() For the method documentation.
|
||||||
*/
|
*/
|
||||||
public function getSubmitLabel()
|
public function getSubmitLabel()
|
||||||
{
|
{
|
||||||
return mtp(
|
return $this->translatePlural('Acknowledge problem', 'Acknowledge problems', count($this->objects));
|
||||||
'monitoring', 'Acknowledge problem', 'Acknowledge problems', count($this->objects)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* (non-PHPDoc)
|
|
||||||
* @see \Icinga\Module\Monitoring\Forms\Command\CommandForm::getHelp() For the method documentation.
|
|
||||||
*/
|
|
||||||
public function getHelp()
|
|
||||||
{
|
|
||||||
return $this->translate(
|
|
||||||
'This command is used to acknowledge host or service problems. When a problem is acknowledged,'
|
|
||||||
. ' future notifications about problems are temporarily disabled until the host or service'
|
|
||||||
. ' recovers.'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -156,8 +153,7 @@ class AcknowledgeProblemCommandForm extends ObjectsCommandForm
|
|||||||
}
|
}
|
||||||
$this->getTransport($this->request)->send($ack);
|
$this->getTransport($this->request)->send($ack);
|
||||||
}
|
}
|
||||||
Notification::success(mtp(
|
Notification::success($this->translatePlural(
|
||||||
'monitoring',
|
|
||||||
'Acknowledging problem..',
|
'Acknowledging problem..',
|
||||||
'Acknowledging problems..',
|
'Acknowledging problems..',
|
||||||
count($this->objects)
|
count($this->objects)
|
||||||
|
@ -11,26 +11,21 @@ use Icinga\Web\Notification;
|
|||||||
*/
|
*/
|
||||||
class AddCommentCommandForm extends ObjectsCommandForm
|
class AddCommentCommandForm extends ObjectsCommandForm
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Initialize this form
|
||||||
|
*/
|
||||||
|
public function init()
|
||||||
|
{
|
||||||
|
$this->addDescription($this->translate('This command is used to add host or service comments.'));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (non-PHPDoc)
|
* (non-PHPDoc)
|
||||||
* @see \Icinga\Web\Form::getSubmitLabel() For the method documentation.
|
* @see \Icinga\Web\Form::getSubmitLabel() For the method documentation.
|
||||||
*/
|
*/
|
||||||
public function getSubmitLabel()
|
public function getSubmitLabel()
|
||||||
{
|
{
|
||||||
return mtp(
|
return $this->translatePlural('Add comment', 'Add comments', count($this->objects));
|
||||||
'monitoring', 'Add comment', 'Add comments', count($this->objects)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* (non-PHPDoc)
|
|
||||||
* @see \Icinga\Module\Monitoring\Forms\Command\CommandForm::getHelp() For the method documentation.
|
|
||||||
*/
|
|
||||||
public function getHelp()
|
|
||||||
{
|
|
||||||
return $this->translate(
|
|
||||||
'This command is used to add host or service comments.'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -84,8 +79,7 @@ class AddCommentCommandForm extends ObjectsCommandForm
|
|||||||
$comment->setPersistent($this->getElement('persistent')->isChecked());
|
$comment->setPersistent($this->getElement('persistent')->isChecked());
|
||||||
$this->getTransport($this->request)->send($comment);
|
$this->getTransport($this->request)->send($comment);
|
||||||
}
|
}
|
||||||
Notification::success(mtp(
|
Notification::success($this->translatePlural(
|
||||||
'monitoring',
|
|
||||||
'Adding comment..',
|
'Adding comment..',
|
||||||
'Adding comments..',
|
'Adding comments..',
|
||||||
count($this->objects)
|
count($this->objects)
|
||||||
|
@ -11,25 +11,24 @@ use Icinga\Module\Monitoring\Command\Object\ProcessCheckResultCommand;
|
|||||||
*/
|
*/
|
||||||
class ProcessCheckResultCommandForm extends ObjectsCommandForm
|
class ProcessCheckResultCommandForm extends ObjectsCommandForm
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Initialize this form
|
||||||
|
*/
|
||||||
|
public function init()
|
||||||
|
{
|
||||||
|
$this->addDescription($this->translate(
|
||||||
|
'This command is used to submit passive host or service check results.'
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (non-PHPDoc)
|
* (non-PHPDoc)
|
||||||
* @see \Icinga\Web\Form::getSubmitLabel() For the method documentation.
|
* @see \Icinga\Web\Form::getSubmitLabel() For the method documentation.
|
||||||
*/
|
*/
|
||||||
public function getSubmitLabel()
|
public function getSubmitLabel()
|
||||||
{
|
{
|
||||||
return mtp(
|
return $this->translatePlural(
|
||||||
'monitoring', 'Submit Passive Check Result', 'Submit Passive Check Results', count($this->objects)
|
'Submit Passive Check Result', 'Submit Passive Check Results', count($this->objects)
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* (non-PHPDoc)
|
|
||||||
* @see \Icinga\Module\Monitoring\Forms\Command\CommandForm::getHelp() For the method documentation.
|
|
||||||
*/
|
|
||||||
public function getHelp()
|
|
||||||
{
|
|
||||||
return $this->translate(
|
|
||||||
'This command is used to submit passive host or service check results.'
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,8 +107,7 @@ class ProcessCheckResultCommandForm extends ObjectsCommandForm
|
|||||||
$this->getTransport($this->request)->send($command);
|
$this->getTransport($this->request)->send($command);
|
||||||
}
|
}
|
||||||
|
|
||||||
Notification::success(mtp(
|
Notification::success($this->translatePlural(
|
||||||
'monitoring',
|
|
||||||
'Processing check result..',
|
'Processing check result..',
|
||||||
'Processing check results..',
|
'Processing check results..',
|
||||||
count($this->objects)
|
count($this->objects)
|
||||||
|
@ -47,8 +47,7 @@ class ScheduleHostCheckCommandForm extends ScheduleServiceCheckCommandForm
|
|||||||
->setOfAllServices($this->getElement('all_services')->isChecked());
|
->setOfAllServices($this->getElement('all_services')->isChecked());
|
||||||
$this->scheduleCheck($check, $this->request);
|
$this->scheduleCheck($check, $this->request);
|
||||||
}
|
}
|
||||||
Notification::success(mtp(
|
Notification::success($this->translatePlural(
|
||||||
'monitoring',
|
|
||||||
'Scheduling host check..',
|
'Scheduling host check..',
|
||||||
'Scheduling host checks..',
|
'Scheduling host checks..',
|
||||||
count($this->objects)
|
count($this->objects)
|
||||||
|
@ -7,7 +7,6 @@ use Icinga\Module\Monitoring\Command\Object\PropagateHostDowntimeCommand;
|
|||||||
use Icinga\Module\Monitoring\Command\Object\ScheduleHostDowntimeCommand;
|
use Icinga\Module\Monitoring\Command\Object\ScheduleHostDowntimeCommand;
|
||||||
use Icinga\Module\Monitoring\Command\Object\ScheduleServiceDowntimeCommand;
|
use Icinga\Module\Monitoring\Command\Object\ScheduleServiceDowntimeCommand;
|
||||||
use Icinga\Web\Notification;
|
use Icinga\Web\Notification;
|
||||||
use Icinga\Web\Request;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Form for scheduling host downtimes
|
* Form for scheduling host downtimes
|
||||||
@ -83,8 +82,7 @@ class ScheduleHostDowntimeCommandForm extends ScheduleServiceDowntimeCommandForm
|
|||||||
$hostDowntime->setObject($object);
|
$hostDowntime->setObject($object);
|
||||||
$this->scheduleDowntime($hostDowntime, $this->request);
|
$this->scheduleDowntime($hostDowntime, $this->request);
|
||||||
}
|
}
|
||||||
Notification::success(mtp(
|
Notification::success($this->translatePlural(
|
||||||
'monitoring',
|
|
||||||
'Scheduling host downtime..',
|
'Scheduling host downtime..',
|
||||||
'Scheduling host downtimes..',
|
'Scheduling host downtimes..',
|
||||||
count($this->objects)
|
count($this->objects)
|
||||||
|
@ -14,27 +14,24 @@ use Icinga\Web\Request;
|
|||||||
*/
|
*/
|
||||||
class ScheduleServiceCheckCommandForm extends ObjectsCommandForm
|
class ScheduleServiceCheckCommandForm extends ObjectsCommandForm
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Initialize this form
|
||||||
|
*/
|
||||||
|
public function init()
|
||||||
|
{
|
||||||
|
$this->addDescription($this->translate(
|
||||||
|
'This command is used to schedule the next check of hosts or services. Icinga will re-queue the'
|
||||||
|
. ' hosts or services to be checked at the time you specify.'
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (non-PHPDoc)
|
* (non-PHPDoc)
|
||||||
* @see \Icinga\Web\Form::getSubmitLabel() For the method documentation.
|
* @see \Icinga\Web\Form::getSubmitLabel() For the method documentation.
|
||||||
*/
|
*/
|
||||||
public function getSubmitLabel()
|
public function getSubmitLabel()
|
||||||
{
|
{
|
||||||
return mtp(
|
return $this->translatePlural('Schedule check', 'Schedule checks', count($this->objects));
|
||||||
'monitoring', 'Schedule check', 'Schedule checks', count($this->objects)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* (non-PHPDoc)
|
|
||||||
* @see \Icinga\Module\Monitoring\Forms\Command\CommandForm::getHelp() For the method documentation.
|
|
||||||
*/
|
|
||||||
public function getHelp()
|
|
||||||
{
|
|
||||||
return $this->translate(
|
|
||||||
'This command is used to schedule the next check of hosts or services. Icinga will re-queue the'
|
|
||||||
. ' hosts or services to be checked at the time you specify.'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -99,8 +96,7 @@ class ScheduleServiceCheckCommandForm extends ObjectsCommandForm
|
|||||||
$check->setObject($object);
|
$check->setObject($object);
|
||||||
$this->scheduleCheck($check, $this->request);
|
$this->scheduleCheck($check, $this->request);
|
||||||
}
|
}
|
||||||
Notification::success(mtp(
|
Notification::success($this->translatePlural(
|
||||||
'monitoring',
|
|
||||||
'Scheduling service check..',
|
'Scheduling service check..',
|
||||||
'Scheduling service checks..',
|
'Scheduling service checks..',
|
||||||
count($this->objects)
|
count($this->objects)
|
||||||
|
@ -25,29 +25,26 @@ class ScheduleServiceDowntimeCommandForm extends ObjectsCommandForm
|
|||||||
const FLEXIBLE = 'flexible';
|
const FLEXIBLE = 'flexible';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (non-PHPDoc)
|
* Initialize this form
|
||||||
* @see \Icinga\Web\Form::getSubmitLabel() For the method documentation.
|
|
||||||
*/
|
*/
|
||||||
public function getSubmitLabel()
|
public function init()
|
||||||
{
|
{
|
||||||
return mtp(
|
$this->addDescription($this->translate(
|
||||||
'monitoring', 'Schedule downtime', 'Schedule downtimes', count($this->objects)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* (non-PHPDoc)
|
|
||||||
* @see \Icinga\Module\Monitoring\Forms\Command\CommandForm::getHelp() For the method documentation.
|
|
||||||
*/
|
|
||||||
public function getHelp()
|
|
||||||
{
|
|
||||||
return $this->translate(
|
|
||||||
'This command is used to schedule host and service downtimes. During the specified downtime,'
|
'This command is used to schedule host and service downtimes. During the specified downtime,'
|
||||||
. ' Icinga will not send notifications out about the hosts and services. When the scheduled'
|
. ' Icinga will not send notifications out about the hosts and services. When the scheduled'
|
||||||
. ' downtime expires, Icinga will send out notifications for the hosts and services as it'
|
. ' downtime expires, Icinga will send out notifications for the hosts and services as it'
|
||||||
. ' normally would. Scheduled downtimes are preserved across program shutdowns and'
|
. ' normally would. Scheduled downtimes are preserved across program shutdowns and'
|
||||||
. ' restarts.'
|
. ' restarts.'
|
||||||
);
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (non-PHPDoc)
|
||||||
|
* @see \Icinga\Web\Form::getSubmitLabel() For the method documentation.
|
||||||
|
*/
|
||||||
|
public function getSubmitLabel()
|
||||||
|
{
|
||||||
|
return $this->translatePlural('Schedule downtime', 'Schedule downtimes', count($this->objects));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -206,8 +203,7 @@ class ScheduleServiceDowntimeCommandForm extends ObjectsCommandForm
|
|||||||
$downtime->setObject($object);
|
$downtime->setObject($object);
|
||||||
$this->scheduleDowntime($downtime, $this->request);
|
$this->scheduleDowntime($downtime, $this->request);
|
||||||
}
|
}
|
||||||
Notification::success(mtp(
|
Notification::success($this->translatePlural(
|
||||||
'monitoring',
|
|
||||||
'Scheduling service downtime..',
|
'Scheduling service downtime..',
|
||||||
'Scheduling service downtimes..',
|
'Scheduling service downtimes..',
|
||||||
count($this->objects)
|
count($this->objects)
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
<hr class="command-separator">
|
<hr class="command-separator">
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content object-command">
|
||||||
<h1 class="command-title"><?= $title; ?> <?= /** @var \Icinga\Module\Monitoring\Forms\Command\CommandForm $form */ $this->icon('help', $form->getHelp()); ?></h1>
|
<?= $form; ?>
|
||||||
<?= $form ?>
|
|
||||||
</div>
|
</div>
|
@ -5,7 +5,7 @@
|
|||||||
<?= $this->render('partials/host/objects-header.phtml'); ?>
|
<?= $this->render('partials/host/objects-header.phtml'); ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content objects-command">
|
||||||
<table class="objectlist">
|
<table class="objectlist">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -27,6 +27,5 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<hr class="command-separator">
|
<hr class="command-separator">
|
||||||
<h1 class="command-title"><?= $title ?> <?= /** @var \Icinga\Module\Monitoring\Forms\Command\CommandForm $form */ $this->icon('help', $form->getHelp()) ?></h1>
|
<?= $form; ?>
|
||||||
<?= $form ?>
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<?= $this->tabs->showOnlyCloseButton() ?>
|
<?= $this->tabs->showOnlyCloseButton() ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<h1><?= $title ?> <?= $this->icon('help', $form->getHelp()) ?></h1>
|
<h1><?= $title; ?></h1>
|
||||||
<?php if ((bool) $programStatus->notifications_enabled === false): ?>
|
<?php if ((bool) $programStatus->notifications_enabled === false): ?>
|
||||||
<div>
|
<div>
|
||||||
<?= $this->translate('Host and service notifications are already disabled.') ?>
|
<?= $this->translate('Host and service notifications are already disabled.') ?>
|
||||||
@ -13,6 +13,6 @@
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<?= $form ?>
|
<?= $form; ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</div>
|
</div>
|
||||||
|
@ -190,7 +190,7 @@ div.selection-info {
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1.command-title {
|
.object-command h1.form-title, .objects-command h1.form-title {
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user