Customer portal : Added highlight classes to items in the manage brick

SVN:trunk[4158]
This commit is contained in:
Guillaume Lajarige
2016-05-27 10:32:58 +00:00
parent 13ef1a4084
commit ae52521a3f
3 changed files with 27 additions and 3 deletions

View File

@@ -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()
);
}

View File

@@ -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)

View File

@@ -209,7 +209,6 @@ EOF
"columns": getColumnsDefinition_{$this->oField->GetGlobalId()}(),
"select": {$sSelectionOptionHtml},
"rowId": "id",
"rowTest": "id",
"data": oRawDatas_{$this->oField->GetGlobalId()},
});