Skip to content

Commit

Permalink
MantisGraph: replace db_query() calls
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhicks committed Feb 25, 2012
1 parent bf81102 commit e63fff3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions public/plugins/MantisGraph/core/graph_api.php
Expand Up @@ -585,7 +585,7 @@ function create_bug_enum_summary( $p_enum_string, $p_enum ) {
$query = "SELECT COUNT(*)
FROM $t_bug_table
WHERE $p_enum='$t_value' $specific_where";
$result = db_query( $query );
$result = db_query_bound( $query, array() );
$t_metrics[$t_label] = db_result( $result );
}

Expand All @@ -611,15 +611,15 @@ function enum_bug_group( $p_enum_string, $p_enum ) {
FROM $t_bug_table
WHERE $p_enum='$t_value' AND
status<'$t_res_val' $specific_where";
$result2 = db_query( $query );
$result2 = db_query_bound( $query, array() );
$t_metrics['open'][$t_label] = db_result( $result2 );

# Calculates the number of bugs closed and puts the results in a table
$query = "SELECT COUNT(*)
FROM $t_bug_table
WHERE $p_enum='$t_value' AND
status='$t_clo_val' $specific_where";
$result2 = db_query( $query );
$result2 = db_query_bound( $query, array() );
$t_metrics['closed'][$t_label] = db_result( $result2 );

# Calculates the number of bugs resolved and puts the results in a table
Expand All @@ -628,7 +628,7 @@ function enum_bug_group( $p_enum_string, $p_enum ) {
WHERE $p_enum='$t_value' AND
status>='$t_res_val' AND
status<'$t_clo_val' $specific_where";
$result2 = db_query( $query );
$result2 = db_query_bound( $query, array() );
$t_metrics['resolved'][$t_label] = db_result( $result2 );
}

Expand Down Expand Up @@ -820,7 +820,7 @@ function create_cumulative_bydate() {
AND $t_history_table.field_name = 'status' )
OR $t_history_table.id is NULL )
ORDER BY $t_bug_table.id, date_modified ASC";
$result = db_query( $query );
$result = db_query_bound( $query, array() );
$bug_count = db_num_rows( $result );

$t_last_id = 0;
Expand Down
2 changes: 1 addition & 1 deletion public/plugins/MantisGraph/pages/bug_graph_bycategory.php
Expand Up @@ -107,7 +107,7 @@
'(type='.NORMAL_TYPE.' and field_name=\'status\') or type='.NEW_BUG.' ) and '.
'date_modified >= \''. $t_start .'\''.
' order by date_modified DESC';
$t_result = db_query( $t_select );
$t_result = db_query_bound( $t_select, array() );
$row = db_fetch_array( $t_result );

for ($t_now = time() - $t_incr; $t_now >= $t_start; $t_now -= $t_incr) {
Expand Down
2 changes: 1 addition & 1 deletion public/plugins/MantisGraph/pages/bug_graph_bystatus.php
Expand Up @@ -103,7 +103,7 @@
') and ( (type='.NORMAL_TYPE.' and field_name=\'status\')
or type='.NEW_BUG.' ) and date_modified >= \''. $t_start .'\''.
' order by date_modified DESC';
$t_result = db_query( $t_select );
$t_result = db_query_bound( $t_select, array() );
$t_row = db_fetch_array( $t_result );

for ($t_now = time() - $t_incr; $t_now >= $t_start; $t_now -= $t_incr) {
Expand Down
Expand Up @@ -163,7 +163,7 @@ function create_cumulative_bydate2() {
FROM $t_bug_table
WHERE $specific_where
ORDER BY date_submitted";
$result = db_query( $query );
$result = db_query_bound( $query, array() );
$bug_count = db_num_rows( $result );

for( $i = 0;$i < $bug_count;$i++ ) {
Expand Down Expand Up @@ -191,7 +191,7 @@ function create_cumulative_bydate2() {
AND $t_history_table.field_name = 'status' )
OR $t_history_table.id is NULL )
ORDER BY $t_bug_table.id, date_modified ASC";
$result = db_query( $query );
$result = db_query_bound( $query, array() );
$bug_count = db_num_rows( $result );

$t_last_id = 0;
Expand Down

0 comments on commit e63fff3

Please sign in to comment.