mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°5957 - actions rows order and color
This commit is contained in:
@@ -232,6 +232,9 @@ class DataTableUIBlockFactory extends AbstractUIBlockFactory
|
||||
array_key_exists('tooltip', $aAction) ? Dict::S($aAction['tooltip']) : '',
|
||||
array_key_exists('name', $aAction) ? $aAction['name'] : 'undefined'
|
||||
);
|
||||
if (array_key_exists('color', $aAction)) {
|
||||
$oButton->SetColor($aAction['color']);
|
||||
}
|
||||
$oButton->SetDataAttributes(['label' => Dict::S($aAction['label']), 'action-id' => $iKey, 'table-id' => $oTable->GetId()]);
|
||||
$oToolbar->AddSubBlock($oButton);
|
||||
}
|
||||
|
||||
@@ -78,10 +78,17 @@ class BlockDirectLinkSetViewTable extends AbstractBlockLinkSetViewTable
|
||||
|
||||
case LINKSET_EDITMODE_INPLACE: // The whole linkset can be edited 'in-place'
|
||||
case LINKSET_EDITMODE_ACTIONS: // Show the usual 'Actions' popup menu
|
||||
$aRowActions[] = array(
|
||||
'label' => 'UI:Links:ActionRow:Modify',
|
||||
'tooltip' => 'UI:Links:ActionRow:Modify+',
|
||||
'icon_classes' => 'fas fa-pen',
|
||||
'js_row_action' => "{$this->GetWidgetName()}.links_view_table('ModifyLinkedObject', aRowData['{$this->oAttDef->GetLinkedClass()}/_key_/raw']);",
|
||||
);
|
||||
$aRowActions[] = array(
|
||||
'label' => 'UI:Links:ActionRow:Delete',
|
||||
'tooltip' => 'UI:Links:ActionRow:Delete+',
|
||||
'icon_classes' => 'fas fa-trash',
|
||||
'color' => 'danger',
|
||||
'js_row_action' => "{$this->GetWidgetName()}.links_view_table('DeleteLinkedObject', aRowData['{$this->oAttDef->GetLinkedClass()}/_key_/raw'], oTrElement);",
|
||||
'confirmation' => [
|
||||
'message' => 'UI:Links:ActionRow:Delete:Confirmation',
|
||||
@@ -89,15 +96,15 @@ class BlockDirectLinkSetViewTable extends AbstractBlockLinkSetViewTable
|
||||
'do_not_show_again_pref_key' => $this->GetDoNotShowAgainPreferenceKey(),
|
||||
],
|
||||
);
|
||||
break;
|
||||
|
||||
case LINKSET_EDITMODE_ADDREMOVE: // The whole linkset can be edited 'in-place'
|
||||
$aRowActions[] = array(
|
||||
'label' => 'UI:Links:ActionRow:Modify',
|
||||
'tooltip' => 'UI:Links:ActionRow:Modify+',
|
||||
'icon_classes' => 'fas fa-pen',
|
||||
'js_row_action' => "{$this->GetWidgetName()}.links_view_table('ModifyLinkedObject', aRowData['{$this->oAttDef->GetLinkedClass()}/_key_/raw']);",
|
||||
);
|
||||
break;
|
||||
|
||||
case LINKSET_EDITMODE_ADDREMOVE: // The whole linkset can be edited 'in-place'
|
||||
$aRowActions[] = array(
|
||||
'label' => 'UI:Links:ActionRow:Detach',
|
||||
'tooltip' => 'UI:Links:ActionRow:Detach+',
|
||||
@@ -109,12 +116,6 @@ class BlockDirectLinkSetViewTable extends AbstractBlockLinkSetViewTable
|
||||
'do_not_show_again_pref_key' => $this->GetDoNotShowAgainPreferenceKey(),
|
||||
],
|
||||
);
|
||||
$aRowActions[] = array(
|
||||
'label' => 'UI:Links:ActionRow:Modify',
|
||||
'tooltip' => 'UI:Links:ActionRow:Modify+',
|
||||
'icon_classes' => 'fas fa-pen',
|
||||
'js_row_action' => "{$this->GetWidgetName()}.links_view_table('ModifyLinkedObject', aRowData['{$this->oAttDef->GetLinkedClass()}/_key_/raw']);",
|
||||
);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -75,6 +75,13 @@ class BlockIndirectLinkSetViewTable extends AbstractBlockLinkSetViewTable
|
||||
{
|
||||
$aRowActions = array();
|
||||
|
||||
$aRowActions[] = array(
|
||||
'label' => 'UI:Links:ActionRow:Modify',
|
||||
'tooltip' => 'UI:Links:ActionRow:Modify+',
|
||||
'icon_classes' => 'fas fa-pen',
|
||||
'js_row_action' => "{$this->GetWidgetName()}.links_view_table('ModifyLinkedObject', aRowData['Link/_key_/raw']);",
|
||||
);
|
||||
|
||||
$aRowActions[] = array(
|
||||
'label' => 'UI:Links:ActionRow:Detach',
|
||||
'tooltip' => 'UI:Links:ActionRow:Detach+',
|
||||
@@ -87,13 +94,6 @@ class BlockIndirectLinkSetViewTable extends AbstractBlockLinkSetViewTable
|
||||
],
|
||||
);
|
||||
|
||||
$aRowActions[] = array(
|
||||
'label' => 'UI:Links:ActionRow:Modify',
|
||||
'tooltip' => 'UI:Links:ActionRow:Modify+',
|
||||
'icon_classes' => 'fas fa-pen',
|
||||
'js_row_action' => "{$this->GetWidgetName()}.links_view_table('ModifyLinkedObject', aRowData['Link/_key_/raw']);",
|
||||
);
|
||||
|
||||
return $aRowActions;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user