Example #1
0
$template = new Smarty();
$template = initSmartyTplForPopup($centreon_path . "www/widgets/open-tickets/src/templates/", $template, "./", $centreon_path);
/* Init Objects */
$criticality = new CentreonCriticality($db);
$media = new CentreonMedia($db);
$rule = new Centreon_OpenTickets_Rule($db);
$centreon = $_SESSION['centreon'];
$widgetId = $_REQUEST['widgetId'];
$page = $_REQUEST['page'];
$dbb = new CentreonDB("centstorage");
$widgetObj = new CentreonWidget($centreon, $db);
$preferences = $widgetObj->getWidgetPreferences($widgetId);
if (!isset($preferences['rule'])) {
    exit;
}
$macro_tickets = $rule->getMacroNames($preferences['rule'], $widgetId);
// Set Colors Table
$res = $db->query("SELECT `key`, `value` FROM `options` WHERE `key` LIKE 'color%'");
$stateSColors = array(0 => "#13EB3A", 1 => "#F8C706", 2 => "#F91D05", 3 => "#DCDADA", 4 => "#2AD1D4");
$stateHColors = array(0 => "#13EB3A", 1 => "#F91D05", 2 => "#DCDADA", 3 => "#2AD1D4");
while ($row = $res->fetchRow()) {
    if ($row['key'] == "color_ok") {
        $stateSColors[0] = $row['value'];
    } elseif ($row['key'] == "color_warning") {
        $stateSColors[1] = $row['value'];
    } elseif ($row['key'] == "color_critical") {
        $stateSColors[2] = $row['value'];
    } elseif ($row['key'] == "color_unknown") {
        $stateSColors[3] = $row['value'];
    } elseif ($row['key'] == "color_pending") {
        $stateSColors[4] = $row['value'];