Esempio n. 1
0
function getItemDataOverviewCells($tableRow, $ithosts, $hostName)
{
    $css = '';
    $value = '-';
    $ack = null;
    if (isset($ithosts[$hostName])) {
        $item = $ithosts[$hostName];
        if ($item['tr_value'] == TRIGGER_VALUE_TRUE) {
            $css = getSeverityStyle($item['severity']);
            $ack = get_last_event_by_triggerid($item['triggerid']);
            $ack = $ack['acknowledged'] == 1 ? array(SPACE, new CImg('images/general/tick.png', 'ack')) : null;
        }
        $value = $item['value'] !== null ? formatHistoryValue($item['value'], $item) : UNKNOWN_VALUE;
    }
    if ($value != '-') {
        $value = new CSpan($value, 'link');
    }
    $column = new CCol(array($value, $ack), $css);
    if (isset($ithosts[$hostName])) {
        $column->setMenuPopup(CMenuPopupHelper::getHistory($item));
    }
    $tableRow[] = $column;
    return $tableRow;
}
Esempio n. 2
0
function getItemDataOverviewCells($tableRow, $ithosts, $hostName)
{
    $ack = null;
    $css = '';
    $value = UNKNOWN_VALUE;
    if (isset($ithosts[$hostName])) {
        $item = $ithosts[$hostName];
        if ($item['tr_value'] == TRIGGER_VALUE_TRUE) {
            $css = getSeverityStyle($item['severity']);
            // Display event acknowledgement.
            $config = select_config();
            if ($config['event_ack_enable']) {
                $ack = get_last_event_by_triggerid($item['triggerid']);
                $ack = $ack['acknowledged'] == 1 ? [SPACE, (new CSpan())->addClass(ZBX_STYLE_ICON_ACKN)] : null;
            }
        }
        if ($item['value'] !== null) {
            $value = formatHistoryValue($item['value'], $item);
        }
    }
    if ($value != UNKNOWN_VALUE) {
        $value = $value;
    }
    $column = (new CCol([$value, $ack]))->addClass($css);
    if (isset($ithosts[$hostName])) {
        $column->setMenuPopup(CMenuPopupHelper::getHistory($item))->addClass(ZBX_STYLE_CURSOR_POINTER)->addClass(ZBX_STYLE_NOWRAP);
    }
    $tableRow[] = $column;
    return $tableRow;
}