$links[] = Menu::get_menu_url("../incidents/index.php?type={$type}&status=not_closed", 'analysis', 'tickets', 'tickets'); } } else { break; } $data = implode(",", $data); $links = "'" . implode("','", $links) . "'"; } else { $data = "['" . _("No tickets") . "',0]"; $colors = '"#E9967A"'; } break; case 'ticketsByClass': $type_graph = 'pie'; $legend = empty($_GET['legend']) ? "w" : GET('legend'); $ticket_by_class = Incident::incidents_by_class($conn, null, $user); if (is_array($ticket_by_class) && !empty($ticket_by_class)) { foreach ($ticket_by_class as $class => $ocurrences) { $data[] = "['" . $class . "'," . $ocurrences . "]"; $links[] = Menu::get_menu_url("../incidents/index.php?ref={$class}&status=not_closed", 'analysis', 'tickets', 'tickets'); } $data = implode(",", $data); $links = "'" . implode("','", $links) . "'"; } else { $data = "['" . _("No tickets") . "',0]"; $colors = '"#E9967A"'; } break; case 'openedTicketsByUser': $type_graph = 'pie'; $legend = empty($_GET['legend']) ? "w" : GET('legend');
break; case 'ticketTypes': $ticket_by_type = Incident::incidents_by_type($conn, $param_filters['assets'], $param_filters['user']); if (is_array($ticket_by_type) && !empty($ticket_by_type)) { foreach ($ticket_by_type as $type => $ocurrences) { $type_short = strlen($type) > 28 ? substr($type, 0, 25) . "..." : $type; $data[] = $ocurrences; $label[] = _($type_short); $link = Menu::get_menu_url("/ossim/incidents/index.php?type={$type}&status=not_closed&hmenu=Tickets&smenu=Tickets", 'analysis', 'tickets'); $links[] = $link; } } $colors = get_widget_colors(count($data)); break; case 'ticketsByClass': $ticket_by_class = Incident::incidents_by_class($conn, $param_filters["assets"], $param_filters["user"]); if (is_array($ticket_by_class) && !empty($ticket_by_class)) { foreach ($ticket_by_class as $class => $ocurrences) { $data[] = $ocurrences; $label[] = _($class); $link = Menu::get_menu_url("/ossim/incidents/index.php?ref={$class}&status=not_closed&hmenu=Tickets&smenu=Tickets", 'analysis', 'tickets'); $links[] = $link; } } $colors = get_widget_colors(count($data)); break; case 'openedTicketsByUser': $ticket_by_user = Incident::incidents_by_user($conn, true, $param_filters["assets"], $param_filters["user"]); $i = 0; if (is_array($ticket_by_user) && !empty($ticket_by_user)) { foreach ($ticket_by_user as $user => $ocurrences) {