Skip to content

Commit

Permalink
Fix #3924: Graphs did not show query counts, even when flag was set.
Browse files Browse the repository at this point in the history
git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@2601 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
narcissus committed Jun 11, 2004
1 parent c564392 commit 0e57451
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 10 deletions.
56 changes: 46 additions & 10 deletions core/graph_api.php
Expand Up @@ -6,7 +6,7 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: graph_api.php,v 1.17 2004-06-10 23:54:51 narcissus Exp $
# $Id: graph_api.php,v 1.18 2004-06-11 00:17:22 narcissus Exp $
# --------------------------------------------------------

if ( ON == config_get( 'use_jpgraph' ) ) {
Expand Down Expand Up @@ -87,7 +87,7 @@ function enum_bug_group( $p_enum_string, $p_enum ) {
# Function 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;
global $open_bug_count, $closed_bug_count, $resolved_bug_count,$height, $g_queries_array;

#defines margin according to height
$graph = new Graph(350,400);
Expand Down Expand Up @@ -130,6 +130,10 @@ function graph_group( $p_title='' ){

$gbplot = new GroupBarPlot(array($p1,$p2,$p3));
$graph->Add($gbplot);
if ( ON == config_get( 'show_queries_count' ) ) {
$t_count = count( $g_queries_array );
$graph->subtitle->Set( $t_count . ' queries (' . count( array_unique ( $g_queries_array ) ) . ' unique)' );
}
$graph->Stroke();

}
Expand Down Expand Up @@ -219,7 +223,7 @@ function enum_bug_group_pct( $p_enum_string, $p_enum ) {
# 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;
global $open_bug_count, $closed_bug_count, $resolved_bug_count, $g_queries_array;

$graph = new Graph(250,400);
$graph->img->SetMargin(35,35,35,150);
Expand Down Expand Up @@ -251,6 +255,10 @@ function graph_group_pct( $p_title='' ){
$gbplot = new GroupBarPlot(array($p1,$p2,$p3));

$graph->Add($gbplot);
if ( ON == config_get( 'show_queries_count' ) ) {
$t_count = count( $g_queries_array );
$graph->subtitle->Set( $t_count . ' queries (' . count( array_unique ( $g_queries_array ) ) . ' unique)' );
}
$graph->Stroke();
}

Expand Down Expand Up @@ -298,7 +306,7 @@ function create_bug_enum_summary_pct( $p_enum_string, $p_enum ) {
# --------------------
# Function that displays pie charts
function graph_bug_enum_summary_pct( $p_title=''){
global $enum_name, $enum_name_count, $center, $poshorizontal, $posvertical;
global $enum_name, $enum_name_count, $center, $poshorizontal, $posvertical, $g_queries_array;

$graph = new PieGraph(500,350);
$graph->img->SetMargin(40,40,40,100);
Expand All @@ -321,6 +329,10 @@ function graph_bug_enum_summary_pct( $p_title=''){
$p1->value->Show();

$graph->Add($p1);
if ( ON == config_get( 'show_queries_count' ) ) {
$t_count = count( $g_queries_array );
$graph->subtitle->Set( $t_count . ' queries (' . count( array_unique ( $g_queries_array ) ) . ' unique)' );
}
$graph->Stroke();
}

Expand Down Expand Up @@ -371,7 +383,7 @@ function create_category_summary_pct() {
# --------------------
# Pie chart which dispays by categories
function graph_category_summary_pct( $p_title=''){
global $category_name, $category_bug_count;
global $category_name, $category_bug_count, $g_queries_array;

$graph = new PieGraph(600,450);
$graph->img->SetMargin(40,40,40,100);
Expand All @@ -393,6 +405,10 @@ function graph_category_summary_pct( $p_title=''){
$p1->value->Show();

$graph->Add($p1);
if ( ON == config_get( 'show_queries_count' ) ) {
$t_count = count( $g_queries_array );
$graph->subtitle->Set( $t_count . ' queries (' . count( array_unique ( $g_queries_array ) ) . ' unique)' );
}
$graph->Stroke();

}
Expand Down Expand Up @@ -428,7 +444,7 @@ function create_bug_enum_summary( $p_enum_string, $p_enum ) {

# --------------------
function graph_bug_enum_summary( $p_title='' ){
global $enum_name, $enum_name_count;
global $enum_name, $enum_name_count, $g_queries_array;

$graph = new Graph(300,380);
$graph->img->SetMargin(40,40,40,170);
Expand All @@ -446,6 +462,10 @@ function graph_bug_enum_summary( $p_title='' ){
$p1->SetFillColor('yellow');
$p1->SetWidth(0.8);
$graph->Add($p1);
if ( ON == config_get( 'show_queries_count' ) ) {
$t_count = count( $g_queries_array );
$graph->subtitle->Set( $t_count . ' queries (' . count( array_unique ( $g_queries_array ) ) . ' unique)' );
}

$graph->Stroke();

Expand Down Expand Up @@ -518,7 +538,7 @@ function create_developer_summary() {

# --------------------
function graph_developer_summary( ){
global $developer_name, $total_bug_count, $open_bug_count, $resolved_bug_count;
global $developer_name, $total_bug_count, $open_bug_count, $resolved_bug_count, $g_queries_array;

$graph = new Graph(300,380);
$graph->img->SetMargin(40,40,40,170);
Expand Down Expand Up @@ -550,6 +570,10 @@ function graph_developer_summary( ){

$gbplot = new GroupBarPlot( array($p1, $p2, $p3));
$graph->Add($gbplot);
if ( ON == config_get( 'show_queries_count' ) ) {
$t_count = count( $g_queries_array );
$graph->subtitle->Set( $t_count . ' queries (' . count( array_unique ( $g_queries_array ) ) . ' unique)' );
}

$graph->Stroke();

Expand Down Expand Up @@ -611,7 +635,7 @@ function create_reporter_summary() {

# --------------------
function graph_reporter_summary( ){
global $reporter_name, $reporter_count;
global $reporter_name, $reporter_count, $g_queries_array;

$graph = new Graph(300,380);
$graph->img->SetMargin(40,40,40,170);
Expand All @@ -629,6 +653,10 @@ function graph_reporter_summary( ){
$p1->SetWidth(0.8);
$graph->Add($p1);

if ( ON == config_get( 'show_queries_count' ) ) {
$t_count = count( $g_queries_array );
$graph->subtitle->Set( $t_count . ' queries (' . count( array_unique ( $g_queries_array ) ) . ' unique)' );
}
$graph->Stroke();

}
Expand Down Expand Up @@ -670,7 +698,7 @@ function create_category_summary() {

# --------------------
function graph_category_summary(){
global $category_name, $category_bug_count;
global $category_name, $category_bug_count, $g_queries_array;

$graph = new Graph(300,380);
$graph->img->SetMargin(40,40,40,170);
Expand All @@ -688,6 +716,10 @@ function graph_category_summary(){
$p1->SetWidth(0.8);
$graph->Add($p1);

if ( ON == config_get( 'show_queries_count' ) ) {
$t_count = count( $g_queries_array );
$graph->subtitle->Set( $t_count . ' queries (' . count( array_unique ( $g_queries_array ) ) . ' unique)' );
}
$graph->Stroke();

}
Expand Down Expand Up @@ -788,7 +820,7 @@ function create_cumulative_bydate(){

# --------------------
function graph_cumulative_bydate(){
global $metrics;
global $metrics, $g_queries_array;

for ($i=0;$i<count($metrics);$i++) {
$plot_date[] = strtotime($metrics[$i][0]);
Expand Down Expand Up @@ -831,6 +863,10 @@ function graph_cumulative_bydate(){
$graph->Add($p2);


if ( ON == config_get( 'show_queries_count' ) ) {
$t_count = count( $g_queries_array );
$graph->subtitle->Set( $t_count . ' queries (' . count( array_unique ( $g_queries_array ) ) . ' unique)' );
}
$graph->Stroke();
}
?>
1 change: 1 addition & 0 deletions doc/ChangeLog
Expand Up @@ -56,6 +56,7 @@ Mantis ChangeLog
* Fix #3886: Custom HTML page title not displayed.
* Fix #3920: Two missing graphs in advanced summary.
* Fix #3923: "By Developer" and "By Reporter" graphs rewritten to reduce SQL impact.
* Fix #3924: Graphs did not show query counts when flag was set.
* New Config: set_view_status_threshold (default REPORTER) - threshold needed to set the view status while reporting a bug / bugnote.
* New Config: change_view_status_threshold (default UPDATER) - threshold needed to update the view status while updating a bug / bugnote.
* New Config: view_handler_threshold (default VIEWER) - threshold needed to view the bug handler (now works for emails only).
Expand Down

0 comments on commit 0e57451

Please sign in to comment.