require_once 'ossim_db.inc'; require_once 'classes/Security.inc'; Session::logcheck("MenuIncidents", "IncidentsReport"); $by = GET('by'); ossim_valid($by, OSS_ALPHA, OSS_SPACE, OSS_SCORE, 'illegal:' . _("Target")); if (ossim_error()) { die(ossim_error()); } $db = new ossim_db(); $conn = $db->connect(); if ($by == "user") { $title = _("TICKET BY USER"); $data_pie = Incident::incidents_by_user($conn); } elseif ($by == "type") { $title = _("TICKET BY TYPE"); $data_pie = Incident::incidents_by_type($conn); } elseif ($by == "type_descr") { $title = _("TICKET BY TYPE DESCRIPTION"); $data_pie = Incident::incidents_by_type_descr($conn); } elseif ($by == "status") { $title = _("TICKET BY STATUS"); $data_pie = Incident::incidents_by_status($conn); } $db->close($conn); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang=""> <head> <meta http-equiv="Pragma" content="no-cache"/> <link rel="stylesheet" type="text/css" href="../style/style.css"/>
<table align='center' width='100%'> <tr> <td style='border-bottom:none;' valign='middle'><?php echo _("No Data Available"); ?> </td> </tr> </table> <?php } } $db = new ossim_db(); $conn = $db->connect(); $user = Session::get_session_user(); $tickets_by_status = Incident::incidents_by_status($conn, null, $user); $tickets_by_type = Incident::incidents_by_type($conn, null, $user); $tickets_by_user = Incident::incidents_by_user($conn, true, null, $user); $tickets_by_tag = Incident::incidents_by_tag($conn, null, $user); /*echo "<pre>"; print_r($tickets_by_status); echo "</pre>";*/ ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title> <?php echo gettext("OSSIM Framework"); ?> </title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/> <!--[if IE]><script language="javascript" type="text/javascript" src="../js/jqplot/excanvas.js"></script><![endif]-->
}); </script> </table> </td> </tr> </table> </td> </tr> </table> <?php } elseif ($screen == "tickets" && Session::menu_perms("MenuIncidents", "IncidentsReport")) { // Incidents report $list1 = Incident::incidents_by_status($conn); // Status $list2 = Incident::incidents_by_type($conn); // Type $list3 = Incident::incidents_by_user($conn); // User ?> <table cellpadding='0' cellspacing='0' border='0' align="center" width='99%'> <tr> <td class="canvas"> <table cellpadding='0' cellspacing='0' border='0' width='100%'> <tr> <td height="3" colspan="11" bgcolor="#A1A1A1"></td> </tr> <tr> <td width="12" valign="top"><img src="../pixmaps/statusbar/btn_minimize.gif" border='0'></td> <td style="padding:5px 10px 3px 0px">
</script> </table> </td> </tr> </table> </td> </tr> </table> <?php } elseif ($screen == "tickets" && Session::menu_perms("analysis-menu", "IncidentsReport")) { // Incidents report $user = Session::get_session_user(); $list1 = Incident::incidents_by_status($conn, null, $user); // Status $list2 = Incident::incidents_by_type($conn, null, $user); // Type $list3 = Incident::incidents_by_user($conn, true, null, $user); // User ?> <table cellpadding='0' cellspacing='0' border='0' align="center" width='100%'> <tr> <td class="canvas"> <table cellpadding='0' cellspacing='0' border='0' width='100%'> <tr> <td height="3" colspan="11" bgcolor="#A1A1A1"></td> </tr> <tr> <td width="12" valign="top"></td> <td style="padding:5px 10px 3px 0px">
switch ($type) { case 'ticketStatus': $ticket_status = Incident::incidents_by_status($conn, $param_filters["assets"], $param_filters["user"]); if (is_array($ticket_status) && !empty($ticket_status)) { foreach ($ticket_status as $type => $ocurrences) { $data[] = $ocurrences; $label[] = _($type); $link = Menu::get_menu_url("/ossim/incidents/index.php?status={$type}&hmenu=Tickets&smenu=Tickets", 'analysis', 'tickets'); $links[] = $link; } } $serie = 'Amount of Tickets'; $colors = get_widget_colors(count($data)); 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) {