$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();
echo "</td></tr></table>"; // Report on project (global, not incident data) if ($only_projects == 1){ if ($total_time > 0){ if ($user_search == ""){ echo "<div>"; echo "<h3>". __("Worktime per person")."</h3>"; echo pie3d_graph ($config['flash_charts'], $worker_data, 400, 320, __('others'), "", "", $config['font'], $config['fontsize']-1, $ttl); echo "</div>"; } else { echo "<div>"; echo "<h3>". __("Project graph report")."</h3>"; echo graph_workunit_user (400, 200, $user_id, $start_date, $end_date, $ttl); echo "</div>"; } } } // Incident report if ($only_incidents == 1){ echo "<h3>".__("Ticket report")."</h3>"; if ($user_id != ""){ $user_search = " AND tworkunit.id_user = '******' "; } else { $user_search = ""; }