Beispiel #1
0
$prev_year = $year;
if ($prev_month == 0) {
    $prev_month = 12;
    $prev_year = $prev_year - 1;
}
$next_month = $month + 1;
$next_year = $year;
if ($next_month == 13) {
    $next_month = 1;
    $next_year = $next_year + 1;
}
$day = date('d', strtotime("now"));
$from_one_month = "{$prev_year}-{$prev_month}-{$day}";
$next_one_month = "{$next_year}-{$next_month}-{$day}";
echo "<h1>" . __('Monthly report for') . " {$id_user}</h1>";
echo "<table class=search-table width=99%>";
echo "<tr><td style='text-align: center;'>";
echo "<a href='index.php?sec=users&sec2=operation/user_report/monthly_graph&month={$prev_month}&year={$prev_year}&id={$id_user}'><img src='images/control_rewind_blue.png' title='" . __('Prev') . "'> </a>";
echo "<span style='font-size: 18px;'>" . $year . "/" . $month . "</span>";
echo "<a href='index.php?sec=users&sec2=operation/user_report/monthly_graph&month={$next_month}&year={$next_year}&id={$id_user}'> <img src='images/control_fastforward_blue.png' title='" . __('Next') . "'></a>";
echo "</table>";
// Show graphs
//$from_one_month = date('Y-m-d', strtotime("now - 1 month"));
echo "<table style='width: 100%; padding: 0px'>";
echo "<tr><td class=datos>";
$workunit_by_task = '<br><div class="pie_frame">' . graph_workunit_user(750, 270, $id_user, $from_one_month, 0) . '</div>';
echo print_container('month_report_workunit_by_task', __('Workunit by task'), $workunit_by_task, 'no', true, '10px');
echo "<tr><td class=datos>";
$workunit_by_project = '<br><div class="pie_frame">' . graph_workunit_project_user(750, 270, $id_user, $from_one_month, 0, true) . '</div>';
echo print_container('month_report_workunit_by_project', __('Workunit by project'), $workunit_by_project, 'no', true, '10px');
echo "</table>";
$date_from = get_parameter("date_from", 0);
$date_to = get_parameter("date_to", 0);
$mode = get_parameter("mode", 1);
$percent = get_parameter("percent", 0);
$days = get_parameter("days", 0);
$type = get_parameter("type", "");
$background = get_parameter("background", "#ffffff");
$id_incident = get_parameter("id_incident");
$period = get_parameter("period");
$ajax = get_parameter("is_ajax");
if ($type == "incident_a") {
    incident_peruser($width, $height);
} elseif ($type == "workunit_task") {
    graph_workunit_task($width, $height, $id_task);
} elseif ($type == "workunit_user") {
    graph_workunit_user($width, $height, $id_user, $date_from);
} elseif ($type == "workunit_project_user") {
    graph_workunit_project_user($width, $height, $id_user, $date_from, $date_to);
} elseif ($type == "project_tree") {
    project_tree($id_project, $id_user);
} elseif ($type == "all_project_tree") {
    all_project_tree($id_user, $completion, $project_kind);
} elseif ($type == "sla_slicebar") {
    if ($ajax) {
        echo graph_sla_slicebar($id_incident, $period, $width, $height);
    } else {
        graph_sla_slicebar($id_incident, $period, $width, $height);
    }
}
// Always at the end of the funtions_graph
include_flash_chart_script();
Beispiel #3
0
 }
 $agenda_home .= "</div>";
 $much_more = "<a href='index.php?sec=agenda&sec2=operation/agenda/agenda'>";
 $much_more .= "<img class='much_more' src='images/add.png' title='" . __('See more') . "'>";
 $much_more .= "</a>";
 $subtitle = "<span class='landing_subtitle'>";
 $subtitle .= __('First 5 events for next ten days');
 $subtitle .= "</span>";
 echo print_container('agenda_home', __('Agenda') . $subtitle . $much_more, $agenda_home, 'no');
 // ==============================================================
 // Show Projects items
 // ==============================================================
 $projects_home = '';
 if ($projects > 0) {
     $from_one_month = date('Y-m-d', strtotime("now - 1 month"));
     $graph_result = graph_workunit_project_user(500, 200, $config["id_user"], $from_one_month, 0, true);
     //If there is an error in graph the graph functions returns a string
     $projects_home .= "<div class='landing_empty'>";
     $projects_home .= "<div class='graph_frame'>" . $graph_result . "</div>";
     $projects_home .= "</div>";
 } else {
     $projects_home .= "<div class='landing_empty'>";
     $projects_home .= __("There aren't active projects");
     $projects_home .= "</div>";
 }
 $much_more = "<a href='index.php?sec=projects&sec2=operation/projects/project'>";
 $much_more .= "<img class='much_more' src='images/add.png' title='" . __('See more') . "'>";
 $much_more .= "</a>";
 $subtitle = "<span class='landing_subtitle'>";
 $subtitle .= __("Total active projects") . ": ";
 $subtitle .= projects_active_user($config["id_user"]);