if (is_array($links)) { $links = "'" . implode("','", $links) . "'"; } $aux_labels = array(_("1 Day"), _("2 Days"), _("3 Days"), _("4 Days"), _("5 Days"), _("6+ Days")); $size = count($aux_labels); for ($i = 0; $i < $size; $i++) { $labelx[$i] = Util::js_entities($aux_labels[$i]); } break; case 'ticketsClosedByMonth': $type_graph = 'barCumulative'; $placement = 'insideGrid'; $num_columns = 3; $legend = empty($_GET['legend']) ? "ne" : GET('legend'); $final_values = array(); $ticket_closed_by_month = Incident::incidents_closed_by_month($conn, null, $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 . "'}"; $final_values[$event_type] = implode(",", $months); } for ($i = 0; $i < 12; $i++) { $links[] = Menu::get_menu_url("../incidents/index.php?status=Closed", 'analysis', 'tickets', 'tickets'); } if (is_array($links)) { $links = "'" . implode("','", $links) . "'"; } $event_types = array_keys($ticket_closed_by_month); $legend_text = array_keys($ticket_closed_by_month[$event_types[0]]); } break;
define('COLOR12', '#D3D3D3'); $conf = $GLOBALS["CONF"]; $jpgraph = $conf->get_conf("jpgraph_path"); require "{$jpgraph}/jpgraph.php"; require "{$jpgraph}/jpgraph_bar.php"; $db = new ossim_db(); $conn = $db->connect(); $shared = new DBA_shared(GET('shared')); if ($by == "ticketsClosedByMonth") { $titley = _("Month") . '-' . _("Year"); $titlex = _("Num. Tickets"); $title = ''; $width = 650; $user = $shared->get("TicketsStatus4_user"); $assets = $shared->get("TicketsStatus4_assets"); $ticket_closed_by_month = Incident::incidents_closed_by_month($conn, $assets, $user); if (is_array($ticket_closed_by_month) && !empty($ticket_closed_by_month)) { foreach ($ticket_closed_by_month as $event_type => $months) { foreach ($months as $month => $occurrences) { $data[$month] = (int) $data[$month] + (int) $occurrences; } } } $labelx = array_keys($data); $datay = array_values($data); } elseif ($by == "resolution_time") { $user = $shared->get("TicketsStatus5_user"); $assets = $shared->get("TicketsStatus5_assets"); $args = $shared->get("TicketsStatus5_args"); $list = Incident::incidents_by_resolution_time($conn, $assets, $user, $args); $ttl_groups = array("1" => 0, "2" => 0, "3" => 0, "4" => 0, "5" => 0, "6" => 0);
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'); $links[] = $link; } //X-axis legend $event_types = array_keys($ticket_closed_by_month); $dates = array_keys($ticket_closed_by_month[$event_types[0]]); $xaxis_text = array(); foreach ($dates as $date) { list($month, $day) = explode('-', $date);