mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 00:34:03 +02:00
monitoring/commands: Fix instance command forms code compliance
refs #6593
This commit is contained in:
parent
16bc0e5d5a
commit
e5e806a3a1
@ -71,5 +71,4 @@ class DisableNotificationsExpireCommandForm extends CommandForm
|
||||
Notification::success(mt('monitoring', 'Disabling host and service notifications..'));
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -59,6 +59,21 @@ class ToggleInstanceFeaturesCommandForm extends CommandForm
|
||||
*/
|
||||
public function createElements(array $formData = array())
|
||||
{
|
||||
if ((bool) $this->status->notifications_enabled) {
|
||||
$description = sprintf(
|
||||
'<a title="%s" href="%s" data-base-target="_next">%s</a>',
|
||||
mt('monitoring', 'Disable notifications for a specific time on a program-wide basis'),
|
||||
$this->getView()->href('monitoring/process/disable-notifications'),
|
||||
mt('monitoring', 'Disable temporarily')
|
||||
);
|
||||
} elseif ($this->status->disable_notif_expire_time) {
|
||||
$description = sprintf(
|
||||
mt('monitoring', 'Notifications will be re-enabled in <strong>%s</strong>'),
|
||||
$this->getView()->timeUntil($this->status->disable_notif_expire_time)
|
||||
);
|
||||
} else {
|
||||
$description = '';
|
||||
}
|
||||
$this->addElements(array(
|
||||
array(
|
||||
'checkbox',
|
||||
@ -97,7 +112,18 @@ class ToggleInstanceFeaturesCommandForm extends CommandForm
|
||||
ToggleInstanceFeatureCommand::FEATURE_NOTIFICATIONS,
|
||||
array(
|
||||
'label' => mt('monitoring', 'Notifications Enabled'),
|
||||
'autosubmit' => true
|
||||
'autosubmit' => true,
|
||||
'description' => $description,
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
'Errors',
|
||||
array(
|
||||
'Description',
|
||||
array('tag' => 'span', 'class' => 'feature-instance-notifications', 'escape' => false)
|
||||
),
|
||||
'Label',
|
||||
array('HtmlTag', array('tag' => 'div'))
|
||||
),
|
||||
)
|
||||
),
|
||||
array(
|
||||
|
Loading…
x
Reference in New Issue
Block a user