} else { $data = "['" . _("No tickets") . "',0]"; $colors = '"#E9967A"'; } break; case 'ticketTags': $type_graph = 'pie'; $legend = empty($_GET['legend']) ? "w" : GET('legend'); $ticket_by_tags = Incident::incidents_by_tag($conn, null, $user); $i = 0; if (is_array($ticket_by_tags) && !empty($ticket_by_tags)) { if ($i < 10) { foreach ($ticket_by_tags as $type => $ocurrences) { $type_short = strlen($type) > 28 ? substr($type, 0, 25) . " [...]" : $type; $data[] = "['" . $type_short . "'," . $ocurrences . "]"; $links[] = Menu::get_menu_url("../incidents/index.php?tag=" . Incident::get_id_by_tag($conn, $type) . "&status=not_closed", 'analysis', 'tickets', 'tickets'); } } else { break; } $data = implode(",", $data); $links = "'" . implode("','", $links) . "'"; } else { $data = "['" . _("No tickets") . "',0]"; $colors = '"#E9967A"'; } break; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en">
$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'); $links[] = $link; } } $serie = 'Amount of Tickets'; $colors = get_widget_colors(count($data)); break; case 'ticketsClosedByMonth': $ticket_closed_by_month = Incident::incidents_closed_by_month($conn, $param_filters["assets"], $param_filters["user"]); if (is_array($ticket_closed_by_month) && !empty($ticket_closed_by_month)) { foreach ($ticket_closed_by_month as $event_type => $months) { $label[] = "{label: '" . $event_type . "'}"; $data[$event_type] = implode(",", $months); } for ($i = 0; $i < 12; $i++) { $link = Menu::get_menu_url("/ossim/incidents/index.php?status=Closed&hmenu=Tickets&smenu=Tickets", 'analysis', 'tickets');