$event_types = array_keys($ticket_by_type_per_month); $legend_text = array_keys($ticket_by_type_per_month[$event_types[0]]); } break; case 'ticketsByPriority': $type_graph = 'pie'; $colors = null; $legend = empty($_GET['legend']) ? "w" : GET('legend'); $temp_colors = array("0" => "#FFFEAF", "1" => "#FFFD00", "2" => "#FFE200", "3" => "#FFCE00", "4" => "#FFB900", "5" => "#FFA500", "6" => "#FF8C00", "7" => "#FF7700", "8" => "#DA0000", "9" => "#BB0000", "10" => "#8B0000"); $list = Incident::incidents_by_priority($conn); if (is_array($list) && !empty($list)) { foreach ($list as $priority => $v) { if ($v > 0) { $data[] = "['" . _("Priority") . " " . $priority . "'," . $v . "]"; $colors[$temp_colors[$priority]] = $temp_colors[$priority]; $links[] = Menu::get_menu_url("../incidents/index.php?priority=" . Incident::get_priority_string($priority) . "&status=not_closed", 'analysis', 'tickets', 'tickets'); } } if (is_array($data)) { $data = implode(",", $data); $colors = "'" . implode("','", $colors) . "'"; $links = "'" . implode("','", $links) . "'"; } } else { $data = "['" . _("No tickets") . "',0]"; $colors = '"#E9967A"'; } break; case 'ticketTags': $type_graph = 'pie'; $legend = empty($_GET['legend']) ? "w" : GET('legend');
foreach ($data as $dy) { $link = Menu::get_menu_url("/ossim/incidents/index.php?status=Closed&hmenu=Tickets&smenu=Tickets", 'analysis', 'tickets'); $links[] = $link; } $label = array(Util::html_entities2utf8(_("1 Day")), Util::html_entities2utf8(_("2 Days")), Util::html_entities2utf8(_("3 Days")), Util::html_entities2utf8(_("4 Days")), Util::html_entities2utf8(_("5 Days")), Util::html_entities2utf8(_("6+ Days"))); $serie = 'Amount of Tickets'; $colors = get_widget_colors(count($data)); break; case 'ticketsByPriority': $list = Incident::incidents_by_priority($conn, $param_filters["assets"], $param_filters["user"]); if (is_array($list) && !empty($list)) { foreach ($list as $priority => $v) { if ($v > 0) { $data[] = $v; $label[] = _("Priority") . " " . $priority; $link = Menu::get_menu_url("/ossim/incidents/index.php?priority=" . Incident::get_priority_string($priority) . "&status=not_closed&hmenu=Tickets&smenu=Tickets", 'analysis', 'tickets'); $links[] = $link; } } } $serie = 'Amount of Tickets'; $colors = get_widget_colors(count($data)); break; case 'ticketTags': $ticket_by_tags = Incident::incidents_by_tag($conn, $param_filters["assets"], $param_filters["user"]); if (is_array($ticket_by_tags) && !empty($ticket_by_tags)) { foreach ($ticket_by_tags as $type => $ocurrences) { $type_short = strlen($type) > 28 ? substr($type, 0, 25) . "..." : $type; $data[] = $ocurrences; $label[] = _($type_short); $link = Menu::get_menu_url("incidents/index.php?tag=" . Incident::get_id_by_tag($conn, $type) . "&status=not_closed&hmenu=Tickets&smenu=Tickets", 'analysis', 'tickets');
} else { $transferred = false; } } else { $transferred = Session::get_list($conn, "WHERE login='******'"); $transferred = count($transferred) == 1 ? $transferred[0] : false; $transferred_name = format_user($transferred); } } else { $transferred = false; } $descrip = $ticket->get_description(); $action = $ticket->get_action(); $status = $ticket->get_status(); $prio = $ticket->get_priority(); $prio_str = Incident::get_priority_string($prio); $prio_box = Incident::get_priority_in_html($prio); if ($attach = $ticket->get_attachment($conn)) { $file_id = $attach->get_id(); $file_name = $attach->get_name(); $file_type = $attach->get_type(); } ?> <table width="100%" cellspacing="2" align="center"> <!-- ticket head --> <tr> <th width="78%" nowrap='nowrap'><strong><?php echo format_user($creator); ?> </strong> - <?php
function get_status_details($status) { if ($status === null) { $bgcolor = 'white'; $fgcolor = 'red'; $status_str = _("n/a"); } elseif ((int) $status === 0) { $bgcolor = 'white'; $fgcolor = 'green'; $status_str = _("Ok"); } else { $bgcolor = Incident::get_priority_bgcolor($status + 1); $fgcolor = 'white'; $status_str = Incident::get_priority_string($status); } return array($fgcolor, $bgcolor, $status_str); }