mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 02:28:44 +02:00
N°6251 - 1:n - Actions must not be proposed to user not allowed (#491)
This commit is contained in:
@@ -60,7 +60,8 @@ class BlockIndirectLinkSetViewTable extends AbstractBlockLinkSetViewTable
|
||||
}
|
||||
|
||||
// Add creation in modal if the linkset is not readonly
|
||||
if (!$this->oAttDef->GetReadOnly()) {
|
||||
if (!$this->oAttDef->GetReadOnly()
|
||||
&& $this->bIsAllowCreate) {
|
||||
$aExtraParams['creation_in_modal'] = true;
|
||||
$aExtraParams['creation_in_modal_tooltip'] = $this->GetDictionaryEntry(static::BUTTON_TOOLTIP);
|
||||
$aExtraParams['creation_in_modal_js_handler'] = "{$this->GetWidgetName()}.links_view_table('CreateLinkedObject');";
|
||||
@@ -76,30 +77,34 @@ class BlockIndirectLinkSetViewTable extends AbstractBlockLinkSetViewTable
|
||||
{
|
||||
$aRowActions = array();
|
||||
|
||||
$aRowActions[] = array(
|
||||
'label' => 'UI:Links:ModifyLink:Button',
|
||||
'name' => 'ModifyButton',
|
||||
'tooltip' => $this->GetDictionaryEntry(static::DICT_MODIFY_LINK_BUTTON_TOOLTIP),
|
||||
'icon_classes' => 'fas fa-pen',
|
||||
'js_row_action' => "{$this->GetWidgetName()}.links_view_table('ModifyLinkedObject', aRowData['Link/_key_/raw'], oTrElement, aRowData['Remote/friendlyname']);",
|
||||
'metadata' => [
|
||||
'modal-title' => $this->GetDictionaryEntry(static::DICT_MODIFY_LINK_MODAL_TITLE),
|
||||
],
|
||||
);
|
||||
if ($this->bIsAllowModify) {
|
||||
$aRowActions[] = array(
|
||||
'label' => 'UI:Links:ModifyLink:Button',
|
||||
'name' => 'ModifyButton',
|
||||
'tooltip' => $this->GetDictionaryEntry(static::DICT_MODIFY_LINK_BUTTON_TOOLTIP),
|
||||
'icon_classes' => 'fas fa-pen',
|
||||
'js_row_action' => "{$this->GetWidgetName()}.links_view_table('ModifyLinkedObject', aRowData['Link/_key_/raw'], oTrElement, aRowData['Remote/friendlyname']);",
|
||||
'metadata' => [
|
||||
'modal-title' => $this->GetDictionaryEntry(static::DICT_MODIFY_LINK_MODAL_TITLE),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
$aRowActions[] = array(
|
||||
'label' => 'UI:Links:Remove:Button',
|
||||
'name' => 'RemoveButton',
|
||||
'tooltip' => $this->GetDictionaryEntry(static::DICT_REMOVE_BUTTON_TOOLTIP),
|
||||
'icon_classes' => 'fas fa-minus',
|
||||
'js_row_action' => "{$this->GetWidgetName()}.links_view_table('DeleteLinkedObject', aRowData['Link/_key_/raw'], oTrElement);",
|
||||
'confirmation' => [
|
||||
'title' => $this->GetDictionaryEntry(static::DICT_REMOVE_MODAL_TITLE),
|
||||
'message' => $this->GetDictionaryEntry(static::DICT_REMOVE_MODAL_MESSAGE),
|
||||
'row_data' => "Remote/hyperlink",
|
||||
'do_not_show_again_pref_key' => $this->GetDoNotShowAgainPreferenceKey(),
|
||||
],
|
||||
);
|
||||
if ($this->bIsAllowDelete) {
|
||||
$aRowActions[] = array(
|
||||
'label' => 'UI:Links:Remove:Button',
|
||||
'name' => 'RemoveButton',
|
||||
'tooltip' => $this->GetDictionaryEntry(static::DICT_REMOVE_BUTTON_TOOLTIP),
|
||||
'icon_classes' => 'fas fa-minus',
|
||||
'js_row_action' => "{$this->GetWidgetName()}.links_view_table('DeleteLinkedObject', aRowData['Link/_key_/raw'], oTrElement);",
|
||||
'confirmation' => [
|
||||
'title' => $this->GetDictionaryEntry(static::DICT_REMOVE_MODAL_TITLE),
|
||||
'message' => $this->GetDictionaryEntry(static::DICT_REMOVE_MODAL_MESSAGE),
|
||||
'row_data' => "Remote/hyperlink",
|
||||
'do_not_show_again_pref_key' => $this->GetDoNotShowAgainPreferenceKey(),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
return $aRowActions;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user