Esempio n. 1
0
             $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;
 case 'ticketsByTypePerMonth':
     $type_graph = 'barCumulative';
     $placement = 'outsideGrid';
     $num_columns = 3;
     $legend = empty($_GET['legend']) ? "s" : GET('legend');
     $final_values = array();
     $ticket_by_type_per_month = Incident::incidents_by_type_per_month($conn, null, $user);
     if (is_array($ticket_by_type_per_month) && !empty($ticket_by_type_per_month)) {
         $i = 0;
         //Solving problem with type names with special characters.
         foreach ($ticket_by_type_per_month as $event_type => $months) {
             $label[] = "{label: '" . $event_type . "'}";
             $final_values["incident{$i}"] = implode(",", $months);
             $links[] = Menu::get_menu_url("../incidents/index.php?type={$event_type}&status=not_closed", 'analysis', 'tickets', 'tickets');
             $i++;
         }
         if (is_array($links)) {
             $links = "'" . implode("','", $links) . "'";
         }
         $event_types = array_keys($ticket_by_type_per_month);
         $legend_text = array_keys($ticket_by_type_per_month[$event_types[0]]);
     }
$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 == "ticketsByTypePerMonth") {
    $titley = _("Month") . '-' . _("Year");
    $titlex = _("Num. Tickets");
    $title = '';
    $width = 650;
    $user = $shared->get("TicketsStatus4_user");
    $assets = $shared->get("TicketsStatus4_assets");
    $final_values = array();
    $ticket_by_type_per_month = Incident::incidents_by_type_per_month($conn, $assets, $user);
    if (is_array($ticket_by_type_per_month) && !empty($ticket_by_type_per_month)) {
        foreach ($ticket_by_type_per_month as $event_type => $months) {
            $final_values[$event_type] = implode(",", $months);
        }
        $event_types = array_keys($ticket_by_type_per_month);
    }
    $labelx = array_keys($ticket_by_type_per_month[$event_types[0]]);
    $final_values = array_slice($final_values, 0, 18);
} else {
    die(_("Invalid Graph"));
}
$background = "white";
$color = "navy";
$color2 = "navy";
// Setup graph
Esempio n. 3
0
             $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);
             $xaxis_text[] = Util::html_entities2utf8(_("{$month}"));
         }
         $colors = get_widget_colors(count($data));
     }
     break;
 case 'ticketsByTypePerMonth':
     $data = array();
     $ticket_by_type_per_month = Incident::incidents_by_type_per_month($conn, $param_filters["assets"], $param_filters["user"]);
     if (is_array($ticket_by_type_per_month) && !empty($ticket_by_type_per_month)) {
         $i = 0;
         //Solving problem with type names with special characters.
         foreach ($ticket_by_type_per_month as $event_type => $months) {
             $label[] = "{label: '" . $event_type . "'}";
             $data["incident{$i}"] = implode(",", $months);
             $link = Menu::get_menu_url("/ossim/incidents/index.php?type={$event_type}&status=not_closed&hmenu=Tickets&smenu=Tickets", 'analysis', 'tickets');
             $links[] = $link;
             $i++;
         }
         $event_types = array_keys($ticket_by_type_per_month);
         $xaxis_text = array_keys($ticket_by_type_per_month[$event_types[0]]);
         $colors = get_widget_colors(count($data));
     }
     break;