diff --git a/core_html_API.php b/core_html_API.php index c2863eecd7..f38525830b 100644 --- a/core_html_API.php +++ b/core_html_API.php @@ -370,6 +370,22 @@ function print_menu() { PRINT ''; } } + + ### -------------------- + # prints the links to the graphic pages, in summary_page.php + function print_menu_graph() { + global $s_synthesis_link, $s_status_link,$s_priority_link,$s_severity_link,$s_category_link,$s_resolution_link, $g_use_jpgraph ; + + if ( $g_use_jpgraph != 0 ) { + PRINT "$s_synthesis_link | "; + PRINT "$s_status_link | "; + PRINT "$s_priority_link | "; + PRINT "$s_severity_link | "; + PRINT "$s_category_link | "; + PRINT "$s_resolution_link"; + } + } + # -------------------- # prints the manage menu # if the $p_page matches a url then don't make that a link diff --git a/doc/ChangeLog b/doc/ChangeLog index 5be74d8862..ebf3ebcb1e 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -73,6 +73,7 @@ Mantis ChangeLog * Added a direct link, with a small icon, on each bug row, so that users on a selected project can switch directly to the bug_update_advanced_page. * Added automatic defaults for $g_path and $g_absolute_path rather than dummy values. This should avoid the need of redefining these values in custom_config_inc.php and also support multiple domains. * Added configuration flags ($g_show_queries_count and $g_show_queries_list) that track the executed queries and display their total count, unique queries count, and the actual list of queries executed. + * Added more visual graph pages in summary_page.php. Caution, old versions of JPGraph may cause problems, use v1.6.3 or above if you can. 2002.05.19 - 0.17.3 diff --git a/images/synthese.gif b/images/synthese.gif new file mode 100644 index 0000000000..24e67e5c48 Binary files /dev/null and b/images/synthese.gif differ diff --git a/images/synthgraph.gif b/images/synthgraph.gif new file mode 100644 index 0000000000..0c5d2a6655 Binary files /dev/null and b/images/synthgraph.gif differ diff --git a/summary_graph_bycategory_pct.php b/summary_graph_bycategory_pct.php new file mode 100644 index 0000000000..854b188693 --- /dev/null +++ b/summary_graph_bycategory_pct.php @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/summary_graph_bypriority_mix.php b/summary_graph_bypriority_mix.php new file mode 100644 index 0000000000..f78fdce914 --- /dev/null +++ b/summary_graph_bypriority_mix.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/summary_graph_bypriority_pct.php b/summary_graph_bypriority_pct.php new file mode 100644 index 0000000000..6c1219d331 --- /dev/null +++ b/summary_graph_bypriority_pct.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/summary_graph_byresolution_mix.php b/summary_graph_byresolution_mix.php new file mode 100644 index 0000000000..5b0c08eb39 --- /dev/null +++ b/summary_graph_byresolution_mix.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/summary_graph_byresolution_pct.php b/summary_graph_byresolution_pct.php new file mode 100644 index 0000000000..11805bd5ff --- /dev/null +++ b/summary_graph_byresolution_pct.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/summary_graph_byseverity_mix.php b/summary_graph_byseverity_mix.php new file mode 100644 index 0000000000..867b2e7fbe --- /dev/null +++ b/summary_graph_byseverity_mix.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/summary_graph_byseverity_pct.php b/summary_graph_byseverity_pct.php new file mode 100644 index 0000000000..539100bcfd --- /dev/null +++ b/summary_graph_byseverity_pct.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/summary_graph_bystatus_pct.php b/summary_graph_bystatus_pct.php new file mode 100644 index 0000000000..75e75939a5 --- /dev/null +++ b/summary_graph_bystatus_pct.php @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/summary_graph_functions.php b/summary_graph_functions.php index 0f4bb0074c..ffbacaa76d 100644 --- a/summary_graph_functions.php +++ b/summary_graph_functions.php @@ -2,6 +2,8 @@ include ($g_jpgraph_path.'jpgraph.php'); include ($g_jpgraph_path.'jpgraph_line.php'); include ($g_jpgraph_path.'jpgraph_bar.php'); +include( $g_jpgraph_path.'jpgraph_pie.php'); +include( $g_jpgraph_path.'jpgraph_pie3d.php'); ?> '$t_res_val' AND + status<>'$t_clo_val' $specific_where"; + $result2 = db_query( $query ); + $open_bug_count[] = db_result( $result2, 0, 0); + + # Calculates the number of bugs closed and puts the results in a table + $query = "SELECT COUNT(*) + FROM $g_mantis_bug_table + WHERE $p_enum='$t_s[0]' AND + status='$t_clo_val' $specific_where"; + $result2 = db_query( $query ); + + $closed_bug_count[] = db_result( $result2, 0, 0); + + + # Calculates the number of bugs resolved and puts the results in a table + $query = "SELECT COUNT(*) + FROM $g_mantis_bug_table + WHERE $p_enum='$t_s[0]' AND + status='$t_res_val' $specific_where"; + $result2 = db_query( $query ); + $resolved_bug_count[] = db_result( $result2, 0, 0); + + + } ### end for + } + + + #functions which displays the charts using the absolute values according to the status (opened/closed/resolved) + function graph_group( $p_title='' ){ + global $enum_name, $enum_name_count; + global $open_bug_count, $closed_bug_count, $resolved_bug_count,$height; + + #defines margin according to height + $graph = new Graph(350,400); + $graph->img->SetMargin(35,35,35,$height); + $graph->img->SetAntiAliasing(); + $graph->SetScale('textlin'); + $graph->SetMarginColor('white'); + $graph->SetFrame(false); + $graph->title->Set($p_title); + $graph->xaxis->SetTickLabels($enum_name); + $graph->xaxis->SetLabelAngle(90); + $graph->legend->Pos(0.05, 0.08); + + $graph->yaxis->scale->ticks->SetDirection(-1); + $graph->yscale->SetGrace(10); + + #adds on the same graph + $tot = new LinePlot($enum_name_count); + $tot->SetColor('black'); + $tot->SetWeight(2); + $tot->mark->SetType(MARK_DIAMOND); + + $tot->SetLegend('Total'); + $graph->Add($tot); + + $p1 = new BarPlot($open_bug_count); + $p1->SetFillColor('yellow'); + $p1->SetWidth(0.8); + $p1->SetLegend('Opened'); + + $p2 = new BarPlot($closed_bug_count); + $p2->SetFillColor('blue'); + $p2->SetWidth(0.8); + $p2->SetLegend('Closed'); + + $p3 = new BarPlot($resolved_bug_count); + $p3->SetFillColor('red'); + $p3->SetWidth(0.8); + $p3->SetLegend('Resolved'); + + $gbplot = new GroupBarPlot(array($p1,$p2,$p3)); + $graph->Add($gbplot); + $graph->Stroke(); + + } + + + #function which finds the % according to the status + function enum_bug_group_pct( $p_enum_string, $p_enum ) { + global $g_mantis_bug_table, $g_project_cookie_val, $enum_name, $enum_name_count; + global $open_bug_count, $closed_bug_count, $resolved_bug_count; + $enum_name = Null; + $enum_name_count = Null; + + #calculation per status + $t_res_val = RESOLVED; + $t_clo_val = CLOSED; + + if ($g_project_cookie_val=='0000000') $specific_where = ''; + else $specific_where = " AND project_id='$g_project_cookie_val'"; + + $query = "SELECT COUNT(*) + FROM $g_mantis_bug_table + WHERE status<>'$t_res_val' AND + status<>'$t_clo_val' $specific_where"; + $result = db_query( $query ); + $total_open = db_result( $result, 0); + + + # Bugs closed + $query = "SELECT COUNT(*) + FROM $g_mantis_bug_table + WHERE status='$t_clo_val' $specific_where"; + $result = db_query( $query ); + $total_close= db_result( $result, 0); + + + # Bugs resolved + $query = "SELECT COUNT(*) + FROM $g_mantis_bug_table + WHERE status='$t_res_val' $specific_where"; + $result = db_query( $query ); + $total_resolved = db_result( $result, 0); + + + $t_arr = explode_enum_string( $p_enum_string ); + $enum_count = count( $t_arr ); + for ($i=0;$i<$enum_count;$i++) { + $t_s = explode( ':', $t_arr[$i] ); + $enum_name[] = get_enum_to_string( $p_enum_string, $t_s[0] ); + + $query = "SELECT COUNT(*) + FROM $g_mantis_bug_table + WHERE $p_enum='$t_s[0]' $specific_where"; + $result = db_query( $query ); + $t_enum_count[]= db_result( $result, 0 ); + + $query = "SELECT COUNT(*) + FROM $g_mantis_bug_table + WHERE $p_enum='$t_s[0]' AND + status<>'$t_res_val' AND + status<>'$t_clo_val' $specific_where"; + $result2 = db_query( $query ); + $open_bug_count[] = db_result( $result2, 0, 0) / $total_open * 100; + + $query = "SELECT COUNT(*) + FROM $g_mantis_bug_table + WHERE $p_enum='$t_s[0]' AND + status='$t_clo_val' $specific_where"; + $result2 = db_query( $query ); + $closed_bug_count[] = db_result( $result2, 0, 0) / $total_close * 100; + + $query = "SELECT COUNT(*) + FROM $g_mantis_bug_table + WHERE $p_enum='$t_s[0]' AND + status='$t_res_val' $specific_where"; + $result2 = db_query( $query ); + $resolved_bug_count[] = db_result( $result2, 0, 0) / $total_resolved * 100; + + } ### end for + } + + + #function that displays charts in % according to the status + function graph_group_pct( $p_title='' ){ + global $enum_name, $enum_name_count; + global $open_bug_count, $closed_bug_count, $resolved_bug_count; + + $graph = new Graph(250,400); + $graph->img->SetMargin(35,35,35,150); + $graph->img->SetAntiAliasing(); + $graph->SetScale('textlin'); + $graph->SetMarginColor('white'); + $graph->SetFrame(false); + $graph->title->Set($p_title); + $graph->xaxis->SetTickLabels($enum_name); + $graph->xaxis->SetLabelAngle(90); + + $graph->yaxis->scale->ticks->SetDirection(-1); + + $p1 = new BarPlot($open_bug_count); + $p1->SetFillColor('yellow'); + $p1->SetWidth(0.8); + $p1->SetLegend('Opened'); + + $p2 = new BarPlot($closed_bug_count); + $p2->SetFillColor('blue'); + $p2->SetWidth(0.8); + $p2->SetLegend('Closed'); + + $p3 = new BarPlot($resolved_bug_count); + $p3->SetFillColor('red'); + $p3->SetWidth(0.8); + $p3->SetLegend('Resolved'); + + $gbplot = new GroupBarPlot(array($p1,$p2,$p3)); + + $graph->Add($gbplot); + $graph->Stroke(); +} + + + ########################################################################### + + #function which gets the values in % + function create_bug_enum_summary_pct( $p_enum_string, $p_enum ) { + global $g_mantis_bug_table, $g_project_cookie_val, $enum_name, $enum_name_count, $total; + $enum_name = Null; + $enum_name_count = Null; + + if ($g_project_cookie_val=='0000000') $specific_where = '1=1'; + else $specific_where = " project_id='$g_project_cookie_val'"; + + $query = "SELECT COUNT(*) + FROM $g_mantis_bug_table + WHERE $specific_where"; + $result = db_query( $query ); + $total = db_result( $result, 0 ); + + $t_arr = explode_enum_string( $p_enum_string ); + $enum_count = count( $t_arr ); + for ($i=0;$i<$enum_count;$i++) { + $t_s = explode( ':', $t_arr[$i] ); + $enum_name[] = get_enum_to_string( $p_enum_string, $t_s[0] ); + + $query = "SELECT COUNT(*) + FROM $g_mantis_bug_table + WHERE $p_enum='$t_s[0]' AND $specific_where"; + + $result = db_query( $query ); + if ($total > 0){ + $enum_name_count[] = db_result( $result, 0 ) / $total * 100; + } + else{$enum_name_count[] = db_result( $result, 0 )*0; + + } + } ### end for + } + + + #function that displays pie charts + function graph_bug_enum_summary_pct( $p_title=''){ + global $enum_name, $enum_name_count, $center, $poshorizontal, $posvertical; + + $graph = new PieGraph(500,350); + $graph->img->SetMargin(40,40,40,100); + $graph->title->Set($p_title); + + $graph->SetMarginColor('white'); + $graph->SetFrame(false); + + $graph->legend->Pos($poshorizontal, $posvertical); + + $p1 = new PiePlot3d($enum_name_count); + $p1->SetTheme('earth'); + //$p1->SetTheme("sand"); + $p1->SetCenter($center); + $p1->SetAngle(60); + $p1->SetLegends($enum_name); + + # Label format + $p1->value->SetFormat('%2.0f'); + $p1->value->Show(); + + $graph->Add($p1); + $graph->Stroke(); + +} + +################################################################ + + function create_category_summary_pct() { + global $g_mantis_bug_table, $g_mantis_user_table, + $g_mantis_project_category_table, $g_project_cookie_val, + $category_name, $category_bug_count; + + if ($g_project_cookie_val=='0000000') $specific_where = '1=1'; + else $specific_where = " project_id='$g_project_cookie_val'"; + + $query = "SELECT COUNT(*) + FROM $g_mantis_bug_table + WHERE $specific_where"; + $result = db_query( $query ); + $total = db_result( $result, 0 ); + + + $query = "SELECT category + FROM $g_mantis_project_category_table + WHERE $specific_where + ORDER BY category"; + $result = db_query( $query ); + $category_count = db_num_rows( $result ); + + for ($i=0;$i<$category_count;$i++) { + $row = db_fetch_array( $result ); + $category_name[] = $row['category']; + $c_category_name = addslashes($category_name[$i]); + + $query = "SELECT COUNT(*) + FROM $g_mantis_bug_table + WHERE category='$c_category_name' AND $specific_where"; + + $result2 = db_query( $query ); + + $category_bug_count[] = db_result( $result2, 0 ) / $total * 100; + + } ### end for + } + + # pie chart which dispays by categories + function graph_category_summary_pct( $p_title=''){ + global $category_name, $category_bug_count, $s_by_category; + + $graph = new PieGraph(600,450); + $graph->img->SetMargin(40,40,40,100); + $graph->title->Set($p_title); + + $graph->SetMarginColor('white'); + $graph->SetFrame(false); + $graph->legend->Pos(0.10,0.09); + + $p1 = new PiePlot3d($category_bug_count); + $p1->SetTheme('earth'); + $p1->SetCenter(0.3); + $p1->SetAngle(60); + $p1->SetLegends($category_name); + $p1->SetSize(0.27); + + # Label format + $p1->value->SetFormat('%2.0f'); + $p1->value->Show(); + + $graph->Add($p1); + $graph->Stroke(); + + } +# End of improved charts functions ############################################################# diff --git a/summary_graph_imp_category.php b/summary_graph_imp_category.php new file mode 100644 index 0000000000..ed7b3b30d6 --- /dev/null +++ b/summary_graph_imp_category.php @@ -0,0 +1,88 @@ + + # This page displays "improved" charts on categories : categories on bars and 3Dpie +?> + + + $t_largest_diff ) { + $t_largest_diff = $t_diff; + $t_bug_id = $row['id']; + } + } + if ( $bug_count < 1 ) { + $bug_count = 1; + } + $t_average_time = $t_total_time / $bug_count; + + $t_largest_diff = number_format( $t_largest_diff / 86400, 2 ); + $t_total_time = number_format( $t_total_time / 86400, 2 ); + $t_average_time = number_format( $t_average_time / 86400, 2 ); + +?> + + + + + +

+ + +

+ + + + + + + + + + +
+ +
+ +
+ +
+ + \ No newline at end of file diff --git a/summary_graph_imp_priority.php b/summary_graph_imp_priority.php new file mode 100644 index 0000000000..6f397e2b9f --- /dev/null +++ b/summary_graph_imp_priority.php @@ -0,0 +1,93 @@ + + # This page displays "improved" charts on priorities : bars, 3Dpie and a mix priorities per status +?> + + + $t_largest_diff ) { + $t_largest_diff = $t_diff; + $t_bug_id = $row['id']; + } + } + if ( $bug_count < 1 ) { + $bug_count = 1; + } + $t_average_time = $t_total_time / $bug_count; + + $t_largest_diff = number_format( $t_largest_diff / 86400, 2 ); + $t_total_time = number_format( $t_total_time / 86400, 2 ); + $t_average_time = number_format( $t_average_time / 86400, 2 ); + +?> + + + + + +

+ + +

+ + + + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ + \ No newline at end of file diff --git a/summary_graph_imp_resolution.php b/summary_graph_imp_resolution.php new file mode 100644 index 0000000000..5069a82a91 --- /dev/null +++ b/summary_graph_imp_resolution.php @@ -0,0 +1,94 @@ + + # This page displays "improved" charts on resolutions : bars, 3Dpie and a mix resolutions per status +?> + + + $t_largest_diff ) { + $t_largest_diff = $t_diff; + $t_bug_id = $row['id']; + } + } + if ( $bug_count < 1 ) { + $bug_count = 1; + } + $t_average_time = $t_total_time / $bug_count; + + $t_largest_diff = number_format( $t_largest_diff / 86400, 2 ); + $t_total_time = number_format( $t_total_time / 86400, 2 ); + $t_average_time = number_format( $t_average_time / 86400, 2 ); + +?> + + + + + + +

+ + +

+ + + + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ + \ No newline at end of file diff --git a/summary_graph_imp_severity.php b/summary_graph_imp_severity.php new file mode 100644 index 0000000000..01b4e56909 --- /dev/null +++ b/summary_graph_imp_severity.php @@ -0,0 +1,93 @@ + + # This page displays "improved" charts on severities : bars, 3Dpie and a mix severities per status +?> + + + $t_largest_diff ) { + $t_largest_diff = $t_diff; + $t_bug_id = $row['id']; + } + } + if ( $bug_count < 1 ) { + $bug_count = 1; + } + $t_average_time = $t_total_time / $bug_count; + + $t_largest_diff = number_format( $t_largest_diff / 86400, 2 ); + $t_total_time = number_format( $t_total_time / 86400, 2 ); + $t_average_time = number_format( $t_average_time / 86400, 2 ); + +?> + + + + + +

+ + +

+ + + + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ + \ No newline at end of file diff --git a/summary_graph_imp_status.php b/summary_graph_imp_status.php new file mode 100644 index 0000000000..a7f895646e --- /dev/null +++ b/summary_graph_imp_status.php @@ -0,0 +1,88 @@ + + # This page displays "improved" charts on status : the old one and a 3D Pie +?> + + + $t_largest_diff ) { + $t_largest_diff = $t_diff; + $t_bug_id = $row['id']; + } + } + if ( $bug_count < 1 ) { + $bug_count = 1; + } + $t_average_time = $t_total_time / $bug_count; + + $t_largest_diff = number_format( $t_largest_diff / 86400, 2 ); + $t_total_time = number_format( $t_total_time / 86400, 2 ); + $t_average_time = number_format( $t_average_time / 86400, 2 ); + +?> + + + + + +

+ + +

+ + + + + + + + + + +
+ +
+ +
+ +
+ + \ No newline at end of file diff --git a/summary_page.php b/summary_page.php index dc63e78ac6..c3f0ee6b51 100644 --- a/summary_page.php +++ b/summary_page.php @@ -59,6 +59,8 @@ +

+