mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-19 00:28:47 +02:00
Customer portal : Added highlight classes to items in the manage brick
SVN:trunk[4158]
This commit is contained in:
@@ -375,12 +375,13 @@ class ManageBrickController extends BrickController
|
||||
'actions' => $aActions
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// ... And item's properties
|
||||
$aItems[] = array(
|
||||
'id' => $oCurrentRow->GetKey(),
|
||||
'class' => $sCurrentClass,
|
||||
'attributes' => $aItemAttrs
|
||||
'attributes' => $aItemAttrs,
|
||||
'highlight_class' => $oCurrentRow->GetHilightClass()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -165,6 +165,30 @@
|
||||
"dom": '<"row"<"col-sm-6"l><"col-sm-6"<f><"visible-xs"p>>>t<"row"<"col-sm-6"ri><"col-sm-6"p>>',
|
||||
"columns": getColumnsDefinition('{{ sAreaId }}'),
|
||||
"order": [[0, "desc"]],
|
||||
"rowCallback": function(oRow, oData){
|
||||
if(oData.highlight_class !== undefined)
|
||||
{
|
||||
var sHighlightClass = oData.highlight_class;
|
||||
var sBSHiglightClass = '';
|
||||
|
||||
// Adding classic iTop class
|
||||
$(oRow).addClass(sHighlightClass);
|
||||
// Adding mapped BS class
|
||||
if(sHighlightClass === '{{ constant('HILIGHT_CLASS_CRITICAL') }}')
|
||||
{
|
||||
sBSHiglightClass = 'danger';
|
||||
}
|
||||
else if(sHighlightClass === '{{ constant('HILIGHT_CLASS_WARNING') }}')
|
||||
{
|
||||
sBSHiglightClass = 'warning';
|
||||
}
|
||||
else if(sHighlightClass === '{{ constant('HILIGHT_CLASS_OK') }}')
|
||||
{
|
||||
sBSHiglightClass = 'success';
|
||||
}
|
||||
$(oRow).addClass(sBSHiglightClass);
|
||||
}
|
||||
},
|
||||
"drawCallback": function(settings){
|
||||
// Hiding pagination if only one page
|
||||
if($(this).closest('.dataTables_wrapper').find('.dataTables_paginate:last .paginate_button:not(.previous):not(.next)').length < 2)
|
||||
|
||||
@@ -209,7 +209,6 @@ EOF
|
||||
"columns": getColumnsDefinition_{$this->oField->GetGlobalId()}(),
|
||||
"select": {$sSelectionOptionHtml},
|
||||
"rowId": "id",
|
||||
"rowTest": "id",
|
||||
"data": oRawDatas_{$this->oField->GetGlobalId()},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user