mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-09-25 18:59:05 +02:00
ObjectController: fix history and fields
This commit is contained in:
parent
efe6cfbbaa
commit
120a7532a1
@ -1,12 +0,0 @@
|
|||||||
<div class="controls">
|
|
||||||
<?= $this->tabs ?>
|
|
||||||
<h1><?= $this->escape($this->title) ?></h1>
|
|
||||||
<span class="action-links">
|
|
||||||
<?= $this->actionLinks ?>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="content">
|
|
||||||
<?= $this->form ?>
|
|
||||||
<?= $this->table->render() ?>
|
|
||||||
</div>
|
|
@ -1,9 +0,0 @@
|
|||||||
<div class="controls">
|
|
||||||
<?= $this->tabs ?>
|
|
||||||
<h1><?= $this->escape($this->title) ?></h1>
|
|
||||||
<?= $this->table->getPaginator() ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="content" data-base-target="_next">
|
|
||||||
<?= $this->table->render() ?>
|
|
||||||
</div>
|
|
@ -8,6 +8,7 @@ use Icinga\Exception\InvalidPropertyException;
|
|||||||
use Icinga\Exception\NotFoundError;
|
use Icinga\Exception\NotFoundError;
|
||||||
use Icinga\Module\Director\Exception\DuplicateKeyException;
|
use Icinga\Module\Director\Exception\DuplicateKeyException;
|
||||||
use Icinga\Module\Director\Exception\NestingError;
|
use Icinga\Module\Director\Exception\NestingError;
|
||||||
|
use Icinga\Module\Director\Forms\IcingaObjectFieldForm;
|
||||||
use Icinga\Module\Director\Objects\IcingaObject;
|
use Icinga\Module\Director\Objects\IcingaObject;
|
||||||
use Icinga\Module\Director\Web\Controller\Extension\ObjectRestrictions;
|
use Icinga\Module\Director\Web\Controller\Extension\ObjectRestrictions;
|
||||||
use Icinga\Module\Director\Web\Form\DirectorObjectForm;
|
use Icinga\Module\Director\Web\Form\DirectorObjectForm;
|
||||||
@ -247,13 +248,12 @@ abstract class ObjectController extends ActionController
|
|||||||
|
|
||||||
$this->tabs()->activate('fields');
|
$this->tabs()->activate('fields');
|
||||||
|
|
||||||
$this->view->title = sprintf(
|
$this->addTitle(
|
||||||
$this->translate('Custom fields: %s'),
|
$this->translate('Custom fields: %s'),
|
||||||
$object->object_name
|
$object->object_name
|
||||||
);
|
);
|
||||||
|
|
||||||
$form = $this->view->form = $this
|
$form = IcingaObjectFieldForm::load()
|
||||||
->loadForm('icingaObjectField')
|
|
||||||
->setDb($this->db())
|
->setDb($this->db())
|
||||||
->setIcingaObject($object);
|
->setIcingaObject($object);
|
||||||
|
|
||||||
@ -263,21 +263,17 @@ abstract class ObjectController extends ActionController
|
|||||||
'datafield_id' => $id
|
'datafield_id' => $id
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->view->actionLinks = $this->view->qlink(
|
$this->actions()->add(Link::create(
|
||||||
$this->translate('back'),
|
$this->translate('back'),
|
||||||
$this->getRequest()->getUrl()->without('field_id'),
|
$this->url()->without('field_id'),
|
||||||
null,
|
null,
|
||||||
array('class' => 'icon-left-big')
|
['class' => 'icon-left-big']
|
||||||
);
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
$form->handleRequest();
|
$form->handleRequest();
|
||||||
|
|
||||||
$this->view->table = $this
|
$table = $this->loadTable('icingaObjectDatafield')->setObject($object);
|
||||||
->loadTable('icingaObjectDatafield')
|
$this->content()->add([$form, $table]);
|
||||||
->setObject($object);
|
|
||||||
|
|
||||||
$this->setViewScript('object/fields');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function historyAction()
|
public function historyAction()
|
||||||
@ -287,18 +283,19 @@ abstract class ObjectController extends ActionController
|
|||||||
$db = $this->db();
|
$db = $this->db();
|
||||||
$type = $this->getType();
|
$type = $this->getType();
|
||||||
$this->tabs()->activate('history');
|
$this->tabs()->activate('history');
|
||||||
$this->view->title = sprintf(
|
$this->addTitle(
|
||||||
$this->translate('Activity Log: %s'),
|
$this->translate('Activity Log: %s'),
|
||||||
$this->object->object_name
|
$this->object->object_name
|
||||||
);
|
);
|
||||||
$lastDeployedId = $db->getLastDeploymentActivityLogId();
|
$lastDeployedId = $db->getLastDeploymentActivityLogId();
|
||||||
$this->view->table = $this->applyPaginationLimits(
|
$this->content()->add(
|
||||||
$this->loadTable('activityLog')
|
$this->applyPaginationLimits(
|
||||||
->setConnection($db)
|
$this->loadTable('activityLog')
|
||||||
->setLastDeployedId($lastDeployedId)
|
->setConnection($db)
|
||||||
->filterObject('icinga_' . $type, $this->object->object_name)
|
->setLastDeployedId($lastDeployedId)
|
||||||
);
|
->filterObject('icinga_' . $type, $this->object->object_name)
|
||||||
$this->setViewScript('object/history');
|
)
|
||||||
|
)->addAttributes(['data-base-target' => '_next']);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getType()
|
protected function getType()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user