Objects: dedicated tab for external commands

This commit is contained in:
Thomas Gelf 2017-07-31 10:37:08 +02:00
parent 7028a64c1b
commit 5ccb94dfbd
2 changed files with 12 additions and 0 deletions

View File

@ -54,6 +54,10 @@ abstract class ObjectsController extends ActionController
->addTitle($this->translate(ucfirst(strtolower($type)) . 's'))
->actions(new ObjectsActionBar($type, $this->url()));
if ($type === 'command' && $this->params->get('type') === 'external_object') {
$this->tabs()->activate('external');
}
$this->table = ObjectsTable::create($type, $this->db())
->setAuth($this->Auth())
->renderTo($this);

View File

@ -23,6 +23,14 @@ class ObjectsTabs extends Tabs
'label' => $this->translate(ucfirst($type) . 's'),
));
if ($object->getShortTableName() === 'command') {
$this->add('external', array(
'url' => sprintf('director/%ss', strtolower($type)),
'urlParams' => ['type' => 'external_object'],
'label' => $this->translate('External'),
));
}
if ($auth->hasPermission('director/admin') || (
$object->getShortTableName() && $auth->hasPermission('director/notifications')
)) {