--- /usr/share/icingaweb2/modules/businessprocess/library/Businessprocess/Renderer/TileRenderer/NodeTile.php.orig 2019-10-22 13:41:51.232989947 +0000 +++ /usr/share/icingaweb2/modules/businessprocess/library/Businessprocess/Renderer/TileRenderer/NodeTile.php 2019-10-22 13:49:06.873013721 +0000 @@ -292,52 +292,66 @@ )); } + $params = array( + 'action' => 'delete', + 'deletenode' => $this->node->getName(), + ); + if (! $this->renderer->getBusinessProcess()->getMetadata()->canModify() || $this->node->getBpConfig()->getName() !== $this->renderer->getBusinessProcess()->getName() || $this->node->getName() === '__unbound__' ) { - return; - } - if ($this->node instanceof BpNode) { $this->actions()->add(Html::tag( 'a', [ - 'href' => $baseUrl - ->with('action', 'edit') - ->with('editnode', $this->node->getName()), - 'title' => mt('businessprocess', 'Modify this business process node') + 'href' => $baseUrl->with($params), + 'title' => mt('businessprocess', 'Delete this node') ], - Html::tag('i', ['class' => 'icon icon-edit']) + Html::tag('i', ['class' => 'icon icon-cancel']) )); + } else { + + if ($this->node instanceof BpNode) { + $this->actions()->add(Html::tag( + 'a', + [ + 'href' => $baseUrl + ->with('action', 'edit') + ->with('editnode', $this->node->getName()), + 'title' => mt('businessprocess', 'Modify this business process node') + ], + Html::tag('i', ['class' => 'icon icon-edit']) + )); + + $addUrl = $baseUrl->with([ + 'node' => $this->node->getName(), + 'action' => 'add' + ]); + $addUrl->getParams()->addValues('path', $this->path); + $this->actions()->add(Html::tag( + 'a', + [ + 'href' => $addUrl, + 'title' => mt('businessprocess', 'Add a new sub-node to this business process') + ], + Html::tag('i', ['class' => 'icon icon-plus']) + )); + } + + $params = array( + 'action' => 'delete', + 'deletenode' => $this->node->getName(), + ); - $addUrl = $baseUrl->with([ - 'node' => $this->node->getName(), - 'action' => 'add' - ]); - $addUrl->getParams()->addValues('path', $this->path); $this->actions()->add(Html::tag( 'a', [ - 'href' => $addUrl, - 'title' => mt('businessprocess', 'Add a new sub-node to this business process') + 'href' => $baseUrl->with($params), + 'title' => mt('businessprocess', 'Delete this node') ], - Html::tag('i', ['class' => 'icon icon-plus']) + Html::tag('i', ['class' => 'icon icon-cancel']) )); } - - $params = array( - 'action' => 'delete', - 'deletenode' => $this->node->getName(), - ); - - $this->actions()->add(Html::tag( - 'a', - [ - 'href' => $baseUrl->with($params), - 'title' => mt('businessprocess', 'Delete this node') - ], - Html::tag('i', ['class' => 'icon icon-cancel']) - )); } }