Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b63e181

Browse files
committedJun 15, 2012
MantisGraph: incorrect issues count in graph by severity
When $g_bug_closed_status_threshold is not the "final" entry in status_enum_string list, function enum_bug_group() in graph_api.php computed the number of closed issues incorrectly due to use of '=' operator instead of '>=' in the query's where clause. Also corrects some trailing whitespace. Fixes #14356
1 parent 07cb1b5 commit b63e181

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed
 

‎plugins/MantisGraph/core/graph_api.php

+20-20
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* @link http://www.mantisbt.org
2323
*/
2424

25-
25+
2626
if( OFF == plugin_config_get( 'eczlibrary' ) ) {
2727
$t_font_path = get_font_path();
2828
if( $t_font_path !== '' && !defined('TTF_DIR') ) {
@@ -117,7 +117,7 @@ function graph_bar( $p_metrics, $p_title = '', $p_graph_width = 350, $p_graph_he
117117
$graph->options->font = $t_graph_font ;
118118
$graph->options->font->maxFontSize = 12;
119119
$graph->legend = false;
120-
120+
121121
$graph->data[0] = new ezcGraphArrayDataSet( $p_metrics );
122122
$graph->data[0]->color = '#FFFF00';
123123

@@ -128,9 +128,9 @@ function graph_bar( $p_metrics, $p_title = '', $p_graph_width = 350, $p_graph_he
128128
//$graph->driver->options->supersampling = 1;
129129
$graph->driver->options->jpegQuality = 100;
130130
$graph->driver->options->imageFormat = IMG_JPEG;
131-
131+
132132
$graph->renderer->options->syncAxisFonts = false;
133-
133+
134134
$graph->renderToOutput( $p_graph_width, $p_graph_height);
135135
} else {
136136
$graph = new Graph( $p_graph_width, $p_graph_height );
@@ -200,7 +200,7 @@ function graph_group( $p_metrics, $p_title = '', $p_graph_width = 350, $p_graph_
200200
$graph->options->font = $t_graph_font ;
201201
$graph->options->font->maxFontSize = 12;
202202
$graph->legend = false;
203-
203+
204204
foreach( array( 'open', 'resolved', 'closed' ) as $t_label ) {
205205
$graph->data[$t_label] = new ezcGraphArrayDataSet( $p_metrics[$t_label] );
206206
}
@@ -215,9 +215,9 @@ function graph_group( $p_metrics, $p_title = '', $p_graph_width = 350, $p_graph_
215215
//$graph->driver->options->supersampling = 1;
216216
$graph->driver->options->jpegQuality = 100;
217217
$graph->driver->options->imageFormat = IMG_JPEG;
218-
218+
219219
$graph->renderer->options->syncAxisFonts = false;
220-
220+
221221
$graph->renderToOutput( $p_graph_width, $p_graph_height);
222222
} else {
223223
# defines margin according to height
@@ -293,7 +293,7 @@ function graph_pie( $p_metrics, $p_title = '', $p_graph_width = 500, $p_graph_he
293293
$graph->options->font = $t_graph_font ;
294294
$graph->options->font->maxFontSize = 12;
295295
$graph->legend = false;
296-
296+
297297
$graph->data[0] = new ezcGraphArrayDataSet( $p_metrics );
298298
$graph->data[0]->color = '#FFFF00';
299299

@@ -308,9 +308,9 @@ function graph_pie( $p_metrics, $p_title = '', $p_graph_width = 500, $p_graph_he
308308
//$graph->driver->options->supersampling = 1;
309309
$graph->driver->options->jpegQuality = 100;
310310
$graph->driver->options->imageFormat = IMG_JPEG;
311-
311+
312312
$graph->renderer->options->syncAxisFonts = false;
313-
313+
314314
$graph->renderToOutput( $p_graph_width, $p_graph_height);
315315
} else {
316316
$graph = new PieGraph( $p_graph_width, $p_graph_height );
@@ -358,7 +358,7 @@ function graph_cumulative_bydate( $p_metrics, $p_graph_width = 300, $p_graph_hei
358358
$graph = new ezcGraphLineChart();
359359

360360
$graph->background->color = '#FFFFFF';
361-
361+
362362
$graph->xAxis = new ezcGraphChartElementNumericAxis();
363363

364364
$graph->data[0] = new ezcGraphArrayDataSet( $p_metrics[0] );
@@ -396,7 +396,7 @@ function graph_cumulative_bydate( $p_metrics, $p_graph_width = 300, $p_graph_hei
396396
$graph->options->font = $t_graph_font ;
397397

398398
$graph->renderToOutput( $p_graph_width, $p_graph_height);
399-
} else {
399+
} else {
400400
foreach( $p_metrics[0] as $i => $vals ) {
401401
if( $i > 0 ) {
402402
$plot_date[] = $i;
@@ -475,15 +475,15 @@ function graph_bydate( $p_metrics, $p_labels, $p_title, $p_graph_width = 300, $p
475475
$t_cnt = count($p_metrics);
476476

477477
foreach( $t_dates as $i => $val ) {
478-
//$t_metrics[$val]
478+
//$t_metrics[$val]
479479
for($j = 0; $j < $t_cnt; $j++ ) {
480480
$t_metrics[$j][$val] = $p_metrics[$j][$i];
481481
}
482482
}
483-
483+
484484
$graph = new ezcGraphLineChart();
485485
$graph->background->color = '#FFFFFF';
486-
486+
487487
$graph->xAxis = new ezcGraphChartElementNumericAxis();
488488
for($k = 0; $k < $t_cnt; $k++ ) {
489489
$graph->data[$k] = new ezcGraphArrayDataSet( $t_metrics[$k] );
@@ -508,7 +508,7 @@ function graph_bydate( $p_metrics, $p_labels, $p_title, $p_graph_width = 300, $p
508508
$graph->options->font = $t_graph_font ;
509509

510510
$graph->renderToOutput( $p_graph_width, $p_graph_height);
511-
} else {
511+
} else {
512512
$graph = new Graph( $p_graph_width, $p_graph_height );
513513
$graph->img->SetMargin( 40, 140, 40, 100 );
514514
if( ON == plugin_config_get( 'jpgraph_antialias' ) ) {
@@ -620,7 +620,7 @@ function enum_bug_group( $p_enum_string, $p_enum ) {
620620
$query = "SELECT COUNT(*)
621621
FROM $t_bug_table
622622
WHERE $p_enum='$t_value' AND
623-
status='$t_clo_val' $specific_where";
623+
status>='$t_clo_val' $specific_where";
624624
$result2 = db_query( $query );
625625
$t_metrics['closed'][$t_label] = db_result( $result2, 0, 0 );
626626

@@ -890,11 +890,11 @@ function error_check( $bug_count, $title ) {
890890
}
891891
}
892892

893-
function error_text( $title, $text ) {
893+
function error_text( $title, $text ) {
894894
if( OFF == plugin_config_get( 'eczlibrary' ) ) {
895-
895+
896896
$t_graph_font = graph_get_font();
897-
897+
898898
$graph = new CanvasGraph( 300, 380 );
899899

900900
$txt = new Text( $text, 150, 100 );

0 commit comments

Comments
 (0)
Please sign in to comment.