*/ require_once 'classes/Session.inc'; require_once 'classes/Incident.inc'; 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="">
<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]--> <meta http-equiv="Pragma" content="no-cache"/>
</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"> <table cellpadding='0' cellspacing='0' border='0' width='100%'>
</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"> <table cellpadding='0' cellspacing='0' border='0' width='100%'>
$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) { if ($i < 10) { $user_short = strlen($user) > 28 ? substr($user, 0, 25) . "..." : $user; $data[] = $ocurrences; $label[] = utf8_encode($user_short); $link = Menu::get_menu_url("/ossim/incidents/index.php?in_charge={$user}&status=not_closed&hmenu=Tickets&smenu=Tickets", 'analysis', 'tickets'); $links[] = $link; } else { break; } $i++; } }