ObjectTabs: do not offer preview for services...

...when making part of a Set
This commit is contained in:
Thomas Gelf 2017-09-11 16:07:17 +02:00
parent 804008673a
commit 9fa641b27c

View File

@ -77,11 +77,15 @@ class ObjectTabs extends Tabs
} }
if ($auth->hasPermission('director/showconfig')) { if ($auth->hasPermission('director/showconfig')) {
$this->add('render', array( if ($object->getShortTableName() !== 'service'
'url' => sprintf('director/%s/render', $type), || $object->get('service_set_id') === null
'urlParams' => $params, ) {
'label' => $this->translate('Preview'), $this->add('render', array(
)); 'url' => sprintf('director/%s/render', $type),
'urlParams' => $params,
'label' => $this->translate('Preview'),
));
}
} }
if ($auth->hasPermission('director/audit')) { if ($auth->hasPermission('director/audit')) {