mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-21 17:48:43 +02:00
N°2677 - Add style definition for classes
This commit is contained in:
@@ -15,6 +15,19 @@ class UIHelper
|
||||
{
|
||||
public static function GetColorFromStatus(string $sClass, ?string $sStateCode): string
|
||||
{
|
||||
// Example on how to get the color for the current status of a class
|
||||
// $sStatusColor = 'neutral';
|
||||
// $sStateAttCode = MetaModel::GetStateAttributeCode($sClass);
|
||||
// if (strlen($sStateAttCode) == 0) {
|
||||
// return $sStatusColor;
|
||||
// }
|
||||
//
|
||||
// $oStyle = MetaModel::GetEnumStyle($sClass, $sStateAttCode, $sStateCode);
|
||||
// if ($oStyle) {
|
||||
// $sStatusColor = $oStyle->GetMainColor();
|
||||
// }
|
||||
// return $sStatusColor;
|
||||
|
||||
$sRootClass = MetaModel::GetRootClass($sClass);
|
||||
switch ($sRootClass) {
|
||||
case 'Ticket':
|
||||
|
||||
Reference in New Issue
Block a user