ScheduledDowntime, Form, activity: tweak links

This commit is contained in:
Thomas Gelf 2019-04-11 08:58:19 +02:00
parent 69c8018f8d
commit 8106a6ab6e
3 changed files with 22 additions and 0 deletions

View File

@ -105,4 +105,12 @@ class IcingaScheduledDowntimeForm extends DirectorObjectForm
return $this;
}
protected function setObjectSuccessUrl()
{
$this->setSuccessUrl(
'director/scheduled-downtime',
$this->object()->getUrlParams()
);
}
}

View File

@ -73,6 +73,17 @@ class IcingaScheduledDowntime extends IcingaObject
}
}
public function getOnDeleteUrl()
{
if ($this->isApplyRule()) {
return 'director/scheduled-downtimes/applyrules';
} elseif ($this->isTemplate()) {
return 'director/scheduled-downtimes/templates';
} else {
return 'director/scheduled-downtimes';
}
}
public function isActive($now = null)
{
if ($now === null) {

View File

@ -504,12 +504,15 @@ class ActivityLogInfo extends HtmlDocument
protected function getLinkToObject()
{
// TODO: This logic is redundant and should be centralized
$entry = $this->entry;
$name = $entry->object_name;
$controller = preg_replace('/^icinga_/', '', $entry->object_type);
if ($controller === 'service_set') {
$controller = 'serviceset';
} elseif ($controller === 'scheduled_downtime') {
$controller = 'scheduled-downtime';
}
return Link::create(