2015-06-30 11:19:31 +02:00
|
|
|
<?php
|
|
|
|
|
2015-10-20 22:34:04 +02:00
|
|
|
namespace Icinga\Module\Director\Controllers;
|
|
|
|
|
2018-10-25 08:35:46 +02:00
|
|
|
use dipl\Html\Link;
|
|
|
|
use dipl\Web\Url;
|
|
|
|
use Icinga\Module\Director\DirectorObject\Automation\ExportInterface;
|
2015-06-30 11:19:31 +02:00
|
|
|
use Icinga\Module\Director\Web\Controller\ObjectsController;
|
|
|
|
|
2015-10-20 22:34:04 +02:00
|
|
|
class ServicesController extends ObjectsController
|
2015-06-30 11:19:31 +02:00
|
|
|
{
|
2017-04-19 19:46:40 +02:00
|
|
|
protected $multiEdit = array(
|
2018-10-25 08:26:09 +02:00
|
|
|
'imports',
|
|
|
|
'groups',
|
2017-04-19 19:46:40 +02:00
|
|
|
'disabled'
|
|
|
|
);
|
2018-10-25 08:35:46 +02:00
|
|
|
|
|
|
|
public function edittemplatesAction()
|
|
|
|
{
|
|
|
|
parent::editAction();
|
|
|
|
|
|
|
|
$objects = $this->loadMultiObjectsFromParams();
|
|
|
|
$names = [];
|
|
|
|
/** @var ExportInterface $object */
|
|
|
|
foreach ($objects as $object) {
|
|
|
|
$names[] = $object->getUniqueIdentifier();
|
|
|
|
}
|
|
|
|
|
|
|
|
$url = Url::fromPath('director/basket/add', [
|
|
|
|
'type' => 'ServiceTemplate',
|
|
|
|
]);
|
|
|
|
|
|
|
|
$url->getParams()->addValues('names', $names);
|
|
|
|
|
|
|
|
$this->actions()->add(Link::create(
|
|
|
|
$this->translate('Add to Basket'),
|
|
|
|
$url,
|
|
|
|
null,
|
|
|
|
['class' => 'icon-tag']
|
|
|
|
));
|
|
|
|
}
|
2015-06-30 11:19:31 +02:00
|
|
|
}
|