mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 00:04:05 +02:00
parent
aa0980e168
commit
a2f294fea2
@ -9,6 +9,8 @@ use Icinga\Module\Director\Web\Table\IcingaScheduledDowntimeRangeTable;
|
||||
|
||||
class ScheduledDowntimeController extends ObjectController
|
||||
{
|
||||
protected $objectBaseUrl = 'director/scheduled-downtime';
|
||||
|
||||
public function rangesAction()
|
||||
{
|
||||
/** @var IcingaScheduledDowntime $object */
|
||||
|
@ -15,6 +15,8 @@ class IcingaCloneObjectForm extends DirectorForm
|
||||
/** @var IcingaObject */
|
||||
protected $object;
|
||||
|
||||
protected $baseObjectUrl;
|
||||
|
||||
public function setup()
|
||||
{
|
||||
$name = $this->object->getObjectName();
|
||||
@ -93,6 +95,13 @@ class IcingaCloneObjectForm extends DirectorForm
|
||||
);
|
||||
}
|
||||
|
||||
public function setObjectBaseUrl($url)
|
||||
{
|
||||
$this->baseObjectUrl = $url;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function onSuccess()
|
||||
{
|
||||
$object = $this->object;
|
||||
@ -195,7 +204,7 @@ class IcingaCloneObjectForm extends DirectorForm
|
||||
);
|
||||
} else {
|
||||
$this->setSuccessUrl(
|
||||
'director/' . strtolower($type),
|
||||
$this->baseObjectUrl ?: 'director/' . strtolower($type),
|
||||
$new->getUrlParams()
|
||||
);
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ next (will be 1.8.0)
|
||||
* FIX: Inherited values in sets (arrays) are now shown (#1310)
|
||||
* FIX: Column layout broke with Web 2.8, has been fixed (#2065)
|
||||
* FIX: filter suggestion gave wrong values for DataList fields (#1918)
|
||||
* FIX: clone-related scheduled downtime links have been fixes (#1894)
|
||||
* FEATURE: Data Fields can now be grouped into categories (#1969)
|
||||
* FEATURE: Inspect is now available for Packages, Stages and Files (#1995)
|
||||
* FEATURE: Allow to disable the Director frontend / UI (#2007)
|
||||
|
@ -3,7 +3,6 @@
|
||||
namespace Icinga\Module\Director\Web\Controller;
|
||||
|
||||
use gipfl\Web\Widget\Hint;
|
||||
use ipl\Html\Html;
|
||||
use Icinga\Exception\IcingaException;
|
||||
use Icinga\Exception\InvalidPropertyException;
|
||||
use Icinga\Exception\NotFoundError;
|
||||
@ -46,6 +45,9 @@ abstract class ObjectController extends ActionController
|
||||
|
||||
protected $type;
|
||||
|
||||
/** @var string|null */
|
||||
protected $objectBaseUrl;
|
||||
|
||||
public function init()
|
||||
{
|
||||
parent::init();
|
||||
@ -165,6 +167,7 @@ abstract class ObjectController extends ActionController
|
||||
$object = $this->requireObject();
|
||||
$form = IcingaCloneObjectForm::load()
|
||||
->setObject($object)
|
||||
->setObjectBaseUrl($this->getObjectBaseUrl())
|
||||
->handleRequest();
|
||||
|
||||
if ($object->isExternal()) {
|
||||
@ -315,7 +318,7 @@ abstract class ObjectController extends ActionController
|
||||
{
|
||||
$this->actions()->add(Link::create(
|
||||
$this->translate('Clone'),
|
||||
'director/' . $this->getType() .'/clone',
|
||||
$this->getObjectBaseUrl() . '/clone',
|
||||
$this->object->getUrlParams(),
|
||||
array('class' => 'icon-paste')
|
||||
));
|
||||
@ -518,7 +521,7 @@ abstract class ObjectController extends ActionController
|
||||
|
||||
$this->actions()->add(Link::create(
|
||||
$this->translate('back'),
|
||||
'director/' . strtolower($this->getType()),
|
||||
$this->getObjectBaseUrl(),
|
||||
$params,
|
||||
['class' => 'icon-left-big']
|
||||
));
|
||||
@ -555,6 +558,11 @@ abstract class ObjectController extends ActionController
|
||||
return $form;
|
||||
}
|
||||
|
||||
protected function getObjectBaseUrl()
|
||||
{
|
||||
return $this->objectBaseUrl ?: 'director/' . strtolower($this->getType());
|
||||
}
|
||||
|
||||
protected function hasBasketSupport()
|
||||
{
|
||||
return $this->object->isTemplate() || $this->object->isGroup();
|
||||
|
Loading…
x
Reference in New Issue
Block a user