Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #153 from grangeway/grangeway-variable-naming

Code Guidelines: Fix naming of variable '$result' to $t_result #119
  • Loading branch information...
commit e842fdd25fd6c51c511596571f26c6566f83fa29 2 parents ef5b4e5 + 9ef51aa
@grangeway grangeway authored
Showing with 414 additions and 504 deletions.
  1. +2 −2 adm_config_report.php
  2. +4 −4 admin/copy_field.php
  3. +10 −10 admin/install.php
  4. +2 −2 admin/test_email.php
  5. +4 −4 admin/test_langs.php
  6. +3 −3 admin/upgrade_unattended.php
  7. +3 −3 api/soap/mc_api.php
  8. +4 −4 api/soap/mc_file_api.php
  9. +3 −3 api/soap/mc_issue_api.php
  10. +7 −6 api/soap/mc_project_api.php
  11. +0 −2  bug_actiongroup_update_severity_inc.php
  12. +2 −2 bug_reminder.php
  13. +3 −3 core/authentication_api.php
  14. +26 −28 core/bug_api.php
  15. +0 −2  core/bug_group_action_api.php
  16. +5 −5 core/bugnote_api.php
  17. +2 −2 core/category_api.php
  18. +1 −4 core/collapse_api.php
  19. +1 −1  core/columns_api.php
  20. +9 −12 core/config_api.php
  21. +10 −10 core/custom_field_api.php
  22. +5 −14 core/database_api.php
  23. +3 −3 core/email_api.php
  24. +4 −4 core/email_queue_api.php
  25. +3 −5 core/error_api.php
  26. +15 −19 core/file_api.php
  27. +30 −35 core/filter_api.php
  28. +2 −3 core/helper_api.php
  29. +3 −4 core/history_api.php
  30. +2 −8 core/html_api.php
  31. +2 −2 core/install_helper_functions_api.php
  32. +9 −9 core/news_api.php
  33. +9 −16 core/print_api.php
  34. +5 −5 core/profile_api.php
  35. +24 −25 core/project_api.php
  36. +2 −2 core/project_hierarchy_api.php
  37. +15 −21 core/relationship_api.php
  38. +0 −3  core/session_api.php
  39. +3 −3 core/sponsorship_api.php
  40. +1 −1  core/string_api.php
  41. +29 −50 core/summary_api.php
  42. +21 −23 core/tag_api.php
  43. +30 −36 core/user_api.php
  44. +2 −2 core/user_pref_api.php
  45. +0 −1  core/utility_api.php
  46. +8 −8 core/version_api.php
  47. +5 −5 excel_xml_export.php
  48. +2 −2 file_download.php
  49. +0 −1  library/disposable
  50. +0 −1  library/securimage
  51. +4 −4 lost_pwd.php
  52. +0 −1  manage_config_email_page.php
  53. +1 −1  manage_user_proj_delete.php
  54. +4 −4 manage_user_prune.php
  55. +3 −3 manage_user_update.php
  56. +28 −27 plugins/MantisGraph/core/graph_api.php
  57. +3 −3 plugins/XmlImportExport/XmlImportExport.php
  58. +8 −10 print_all_bug_options_inc.php
  59. +2 −2 print_all_bug_options_reset.php
  60. +2 −2 print_all_bug_options_update.php
  61. +4 −4 print_all_bug_page.php
  62. +3 −3 print_all_bug_page_word.php
  63. +6 −6 print_bugnote_inc.php
  64. +2 −2 proj_doc_delete.php
  65. +2 −2 proj_doc_edit_page.php
  66. +2 −2 proj_doc_page.php
  67. +3 −3 proj_doc_update.php
  68. +2 −2 summary_page.php
View
4 adm_config_report.php
@@ -266,7 +266,7 @@ function print_option_list_from_array( $p_array, $p_filter_value ) {
FROM $t_config_table
$t_where
ORDER BY user_id, project_id, config_id ";
-$result = db_query_bound( $query, $t_param );
+$t_result = db_query_bound( $query, $t_param );
?>
<!-- FILTER FORM -->
@@ -359,7 +359,7 @@ function print_option_list_from_array( $p_array, $p_filter_value ) {
# db contains a large number of configurations
$t_form_security_token = form_security_token( 'adm_config_delete' );
-while( $row = db_fetch_array( $result ) ) {
+while( $row = db_fetch_array( $t_result ) ) {
extract( $row, EXTR_PREFIX_ALL, 'v' );
?>
View
8 admin/copy_field.php
@@ -68,13 +68,13 @@
$t_bug_table = db_get_table( 'bug' );
$query = 'SELECT * FROM ' . $t_string_table . ' WHERE field_id = ' . db_param() . ' and value <> ' . db_param();
-$result = @db_query_bound( $query, array( $f_source_field_id, '' ) );
-if( FALSE == $result ) {
+$t_result = @db_query_bound( $query, array( $f_source_field_id, '' ) );
+if( FALSE == $t_result ) {
echo '<p>No fields need to be updated.</p>';
}
else {
- $count = db_num_rows( $result );
+ $count = db_num_rows( $t_result );
echo '<p>Found ' . $count . ' fields to be updated.</p>';
$t_failures = 0;
@@ -86,7 +86,7 @@
}
for( $i = 0;$i < $count;$i++ ) {
- $row = db_fetch_array( $result );
+ $row = db_fetch_array( $t_result );
extract( $row, EXTR_PREFIX_ALL, 'v' );
# trace bug id back to project
View
20 admin/install.php
@@ -370,8 +370,8 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes
$f_db_exists = true;
}
if( $f_db_type == 'db2' ) {
- $result = $g_db->execute( 'set schema ' . $f_db_schema );
- if( $result === false ) {
+ $t_result = $g_db->execute( 'set schema ' . $f_db_schema );
+ if( $t_result === false ) {
print_test_result( BAD, true, 'set schema failed: ' . $g_db->errorMsg() );
}
} else {
@@ -400,8 +400,8 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes
if( $t_result == true ) {
$t_db_open = true;
if( $f_db_type == 'db2' ) {
- $result = $g_db->execute( 'set schema ' . $f_db_schema );
- if( $result === false ) {
+ $t_result = $g_db->execute( 'set schema ' . $f_db_schema );
+ if( $t_result === false ) {
print_test_result( BAD, true, 'set schema failed: ' . $g_db->errorMsg() );
}
} else {
@@ -782,8 +782,8 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes
$t_result = @$g_db->Connect( $f_hostname, $f_db_username, $f_db_password, $f_database_name );
if( $f_db_type == 'db2' ) {
- $result = $g_db->execute( 'set schema ' . $f_db_schema );
- if( $result === false ) {
+ $t_result = $g_db->execute( 'set schema ' . $f_db_schema );
+ if( $t_result === false ) {
echo $g_db->errorMsg();
}
}
@@ -832,8 +832,8 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes
}
if( $f_db_type == 'db2' ) {
- $result = $g_db->execute( 'set schema ' . $f_db_schema );
- if( $result === false ) {
+ $t_result = $g_db->execute( 'set schema ' . $f_db_schema );
+ if( $t_result === false ) {
echo $g_db->errorMsg();
}
}
@@ -1181,8 +1181,8 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes
}
if( $f_db_type == 'db2' ) {
- $result = $g_db->execute( 'set schema ' . $f_db_schema );
- if( $result === false ) {
+ $t_result = $g_db->execute( 'set schema ' . $f_db_schema );
+ if( $t_result === false ) {
echo $g_db->errorMsg();
}
}
View
4 admin/test_email.php
@@ -53,9 +53,9 @@
$t_email_data->body = 'Your PHP mail settings appear to be correctly set.';
$t_email_data->metadata['priority'] = config_get( 'mail_priority' );
$t_email_data->metadata['charset'] = 'utf-8';
- $result = email_send( $t_email_data );
+ $t_result = email_send( $t_email_data );
- if( !$result ) {
+ if( !$t_result ) {
echo ' PROBLEMS SENDING MAIL TO: ' . config_get_global( 'webmaster_email' ) . '. Please check your php/mail server settings.<br />';
} else {
echo ' mail() send successful.<br />';
View
8 admin/test_langs.php
@@ -156,10 +156,10 @@ function checkfile( $p_path, $p_file, $p_quiet = false ) {
$file = $p_path . $p_file;
set_error_handler( 'lang_error_handler' );
- $result = checktoken( $file, ($p_file == STRINGS_ENGLISH ) );
+ $t_result = checktoken( $file, ($p_file == STRINGS_ENGLISH ) );
restore_error_handler();
- if( !$result ) {
+ if( !$t_result ) {
print_error( "Language file '$p_file' failed at phase 1.", 'FAILED' );
if( $p_quiet ) {
return false;
@@ -175,12 +175,12 @@ function checkfile( $p_path, $p_file, $p_quiet = false ) {
set_error_handler( 'lang_error_handler' );
ob_start();
- $result = eval( "require_once( '$file' );" );
+ $t_result = eval( "require_once( '$file' );" );
$data = ob_get_contents();
ob_end_clean();
restore_error_handler();
- if( $result === false ) {
+ if( $t_result === false ) {
print_error( "Language file '$p_file' failed at eval", 'FAILED' );
if( $p_quiet ) {
return false;
View
6 admin/upgrade_unattended.php
@@ -51,7 +51,7 @@
/**
* Print the result of an upgrade step.
*
- * @param integer $result GOOD or BAD.
+ * @param integer $p_result GOOD or BAD.
* @param bool $p_hard_fail If result is BAD, sets the global failure flag.
* @param string $p_message The message describing the upgrade step.
* @access private
@@ -76,11 +76,11 @@ function print_test_result( $p_result, $p_hard_fail = true, $p_message = '' ) {
echo "\n";
}
-$result = @db_connect( config_get_global( 'dsn', false ), config_get_global( 'hostname' ),
+$t_result = @db_connect( config_get_global( 'dsn', false ), config_get_global( 'hostname' ),
config_get_global( 'db_username' ), config_get_global( 'db_password' ),
config_get_global( 'database_name' ) );
-if( false == $result ) {
+if( false == $t_result ) {
echo "Opening connection to database " .
config_get_global( 'database_name' ) .
" on host " . config_get_global( 'hostname' ) .
View
6 api/soap/mc_api.php
@@ -411,11 +411,11 @@ function mci_filter_db_get_available_queries( $p_project_id = null, $p_user_id =
AND (is_public = " . db_prepare_bool(true) . "
OR user_id = " . db_param() . ")
ORDER BY is_public DESC, name ASC";
- $result = db_query_bound( $query, array( $t_project_id, $t_user_id ) );
- $query_count = db_num_rows( $result );
+ $t_result = db_query_bound( $query, array( $t_project_id, $t_user_id ) );
+ $query_count = db_num_rows( $t_result );
for( $i = 0;$i < $query_count;$i++ ) {
- $row = db_fetch_array( $result );
+ $row = db_fetch_array( $t_result );
$t_filter_detail = explode( '#', $row['filter_string'], 2 );
if ( !isset($t_filter_detail[1]) ) {
View
8 api/soap/mc_file_api.php
@@ -131,7 +131,7 @@ function mci_file_add( $p_id, $p_name, $p_content, $p_file_type, $p_table, $p_ti
if( 'bug' == $p_table ) {
# bump the last_updated date
- $result = bug_update_date( $t_issue_id );
+ bug_update_date( $t_issue_id );
# add history entry
history_log_event_special( $t_issue_id, FILE_ADDED, $p_name );
@@ -166,13 +166,13 @@ function mci_file_get( $p_file_id, $p_type, $p_user_id ) {
return SoapObjectsFactory::newSoapFault( 'Server', 'Invalid file type '.$p_type. ' .' );
}
- $result = db_query_bound( $t_query, array( $p_file_id ) );
+ $t_result = db_query_bound( $t_query, array( $p_file_id ) );
- if ( $result->EOF ) {
+ if ( $t_result->EOF ) {
return SoapObjectsFactory::newSoapFault( 'Client', 'Unable to find an attachment with type ' . $p_type. ' and id ' . $p_file_id . ' .' );
}
- $row = db_fetch_array( $result );
+ $row = db_fetch_array( $t_result );
if ( $p_type == 'doc' ) {
$t_project_id = $row['project_id'];
View
6 api/soap/mc_issue_api.php
@@ -556,12 +556,12 @@ function mc_issue_get_id_from_summary( $p_username, $p_password, $p_summary ) {
FROM $t_bug_table
WHERE summary = " . db_param();
- $result = db_query_bound( $query, array( $p_summary ), 1 );
+ $t_result = db_query_bound( $query, array( $p_summary ), 1 );
- if( db_num_rows( $result ) == 0 ) {
+ if( db_num_rows( $t_result ) == 0 ) {
return 0;
} else {
- while(( $row = db_fetch_array( $result ) ) !== false ) {
+ while(( $row = db_fetch_array( $t_result ) ) !== false ) {
$t_issue_id = (int) $row['id'];
$t_project_id = bug_get_field( $t_issue_id, 'project_id' );
$g_project_override = $t_project_id;
View
13 api/soap/mc_project_api.php
@@ -722,12 +722,13 @@ function mc_project_get_attachments( $p_username, $p_password, $p_project_id ) {
( ( pult.user_id = " . db_param() . " ) AND ( pult.access_level $t_access_clause ) ) OR
( ut.access_level = " . db_param() . " ) )
ORDER BY pt.name ASC, pft.title ASC";
- $result = db_query_bound( $query, array( $t_user_id, $t_user_id, $t_pub, $t_user_id, $t_admin ) );
- $num_files = db_num_rows( $result );
- $t_result = array();
+ $t_result = db_query_bound( $query, array( $t_user_id, $t_user_id, $t_pub, $t_user_id, $t_admin ) );
+ $num_files = db_num_rows( $t_result );
+
+ $t_attachments = array();
for( $i = 0;$i < $num_files;$i++ ) {
- $row = db_fetch_array( $result );
+ $row = db_fetch_array( $t_result );
$t_attachment = array();
$t_attachment['id'] = $row['id'];
@@ -739,10 +740,10 @@ function mc_project_get_attachments( $p_username, $p_password, $p_project_id ) {
$t_attachment['date_submitted'] = SoapObjectsFactory::newDateTimeVar( $row['date_added'] );
$t_attachment['download_url'] = mci_get_mantis_path() . 'file_download.php?file_id=' . $row['id'] . '&amp;type=doc';
$t_attachment['user_id'] = $row['user_id'];
- $t_result[] = $t_attachment;
+ $t_attachments[] = $t_attachment;
}
- return $t_result;
+ return $t_attachments;
}
function mc_project_get_all_subprojects( $p_username, $p_password, $p_project_id ) {
View
2  bug_actiongroup_update_severity_inc.php
@@ -89,8 +89,6 @@ function action_update_severity_print_fields() {
* @return string|null On failure: the reason why the action could not be validated. On success: null.
*/
function action_update_severity_validate( $p_bug_id ) {
- $f_severity = gpc_get_string( 'severity' );
-
$t_update_severity_threshold = config_get( 'update_bug_threshold' );
$t_bug_id = $p_bug_id;
View
4 bug_reminder.php
@@ -91,14 +91,14 @@
}
}
-$result = email_bug_reminder( $f_to, $f_bug_id, $f_body );
+$t_result = email_bug_reminder( $f_to, $f_bug_id, $f_body );
# Add reminder as bugnote if store reminders option is ON.
if ( ON == config_get( 'store_reminders' ) ) {
# Build list of recipients, truncated to note_attr fields's length
$t_attr = '|';
$t_length = 0;
- foreach( $result as $t_id ) {
+ foreach( $t_result as $t_id ) {
$t_recipient = $t_id . '|';
$t_length += strlen( $t_recipient );
if( $t_length > 250 ) {
View
6 core/authentication_api.php
@@ -777,11 +777,11 @@ function auth_is_cookie_valid( $p_cookie_string ) {
$query = "SELECT *
FROM $t_user_table
WHERE cookie_string=" . db_param();
- $result = db_query_bound( $query, array( $p_cookie_string ) );
+ $t_result = db_query_bound( $query, array( $p_cookie_string ) );
# return true if a matching cookie was found
- if( 1 == db_num_rows( $result ) ) {
- user_cache_database_result( db_fetch_array( $result ) );
+ if( 1 == db_num_rows( $t_result ) ) {
+ user_cache_database_result( db_fetch_array( $t_result ) );
return true;
} else {
return false;
View
54 core/bug_api.php
@@ -399,9 +399,9 @@ private function bug_get_bugnote_count() {
$query = "SELECT COUNT(*)
FROM $t_bugnote_table
WHERE bug_id =" . db_param() . " $t_restriction";
- $result = db_query_bound( $query, array( $this->id ) );
+ $t_result = db_query_bound( $query, array( $this->id ) );
- return db_result( $result );
+ return db_result( $t_result );
}
/**
@@ -486,10 +486,10 @@ function create() {
$query = "SELECT user_id
FROM $t_category_table
WHERE id=" . db_param();
- $result = db_query_bound( $query, array( $this->category_id ) );
+ $t_result = db_query_bound( $query, array( $this->category_id ) );
- if( $t_result = db_result( $result ) ) {
- $this->handler_id = db_result( $result );
+ if( $t_result = db_result( $t_result ) ) {
+ $this->handler_id = db_result( $t_result );
}
}
@@ -655,7 +655,7 @@ function update( $p_update_extended = false, $p_bypass_mail = false ) {
if( $t_old_data->description != $this->description ) {
if ( bug_revision_count( $c_bug_id, REV_DESCRIPTION ) < 1 ) {
- $t_revision_id = bug_revision_add( $c_bug_id, $t_old_data->reporter_id, REV_DESCRIPTION, $t_old_data->description, 0, $t_old_data->date_submitted );
+ bug_revision_add( $c_bug_id, $t_old_data->reporter_id, REV_DESCRIPTION, $t_old_data->description, 0, $t_old_data->date_submitted );
}
$t_revision_id = bug_revision_add( $c_bug_id, $t_current_user, REV_DESCRIPTION, $this->description );
history_log_event_special( $c_bug_id, DESCRIPTION_UPDATED, $t_revision_id );
@@ -663,7 +663,7 @@ function update( $p_update_extended = false, $p_bypass_mail = false ) {
if( $t_old_data->steps_to_reproduce != $this->steps_to_reproduce ) {
if ( bug_revision_count( $c_bug_id, REV_STEPS_TO_REPRODUCE ) < 1 ) {
- $t_revision_id = bug_revision_add( $c_bug_id, $t_old_data->reporter_id, REV_STEPS_TO_REPRODUCE, $t_old_data->steps_to_reproduce, 0, $t_old_data->date_submitted );
+ bug_revision_add( $c_bug_id, $t_old_data->reporter_id, REV_STEPS_TO_REPRODUCE, $t_old_data->steps_to_reproduce, 0, $t_old_data->date_submitted );
}
$t_revision_id = bug_revision_add( $c_bug_id, $t_current_user, REV_STEPS_TO_REPRODUCE, $this->steps_to_reproduce );
history_log_event_special( $c_bug_id, STEP_TO_REPRODUCE_UPDATED, $t_revision_id );
@@ -671,7 +671,7 @@ function update( $p_update_extended = false, $p_bypass_mail = false ) {
if( $t_old_data->additional_information != $this->additional_information ) {
if ( bug_revision_count( $c_bug_id, REV_ADDITIONAL_INFO ) < 1 ) {
- $t_revision_id = bug_revision_add( $c_bug_id, $t_old_data->reporter_id, REV_ADDITIONAL_INFO, $t_old_data->additional_information, 0, $t_old_data->date_submitted );
+ bug_revision_add( $c_bug_id, $t_old_data->reporter_id, REV_ADDITIONAL_INFO, $t_old_data->additional_information, 0, $t_old_data->date_submitted );
}
$t_revision_id = bug_revision_add( $c_bug_id, $t_current_user, REV_ADDITIONAL_INFO, $this->additional_information );
history_log_event_special( $c_bug_id, ADDITIONAL_INFO_UPDATED, $t_revision_id );
@@ -747,9 +747,9 @@ function bug_cache_row( $p_bug_id, $p_trigger_errors = true ) {
$query = "SELECT *
FROM $t_bug_table
WHERE id=" . db_param();
- $result = db_query_bound( $query, array( $c_bug_id ) );
+ $t_result = db_query_bound( $query, array( $c_bug_id ) );
- if( 0 == db_num_rows( $result ) ) {
+ if( 0 == db_num_rows( $t_result ) ) {
$g_cache_bug[$c_bug_id] = false;
if( $p_trigger_errors ) {
@@ -760,7 +760,7 @@ function bug_cache_row( $p_bug_id, $p_trigger_errors = true ) {
}
}
- $row = db_fetch_array( $result );
+ $row = db_fetch_array( $t_result );
return bug_add_to_cache( $row );
}
@@ -858,9 +858,9 @@ function bug_text_cache_row( $p_bug_id, $p_trigger_errors = true ) {
FROM $t_bug_text_table bt, $t_bug_table b
WHERE b.id=" . db_param() . " AND
b.bug_text_id = bt.id";
- $result = db_query_bound( $query, array( $c_bug_id ) );
+ $t_result = db_query_bound( $query, array( $c_bug_id ) );
- if( 0 == db_num_rows( $result ) ) {
+ if( 0 == db_num_rows( $t_result ) ) {
$g_cache_bug_text[$c_bug_id] = false;
if( $p_trigger_errors ) {
@@ -871,7 +871,7 @@ function bug_text_cache_row( $p_bug_id, $p_trigger_errors = true ) {
}
}
- $row = db_fetch_array( $result );
+ $row = db_fetch_array( $t_result );
$g_cache_bug_text[$c_bug_id] = $row;
@@ -1072,11 +1072,9 @@ function bug_copy( $p_bug_id, $p_target_project_id = null, $p_copy_custom_fields
global $g_db;
$t_mantis_custom_field_string_table = db_get_table( 'custom_field_string' );
- $t_mantis_bug_file_table = db_get_table( 'bug_file' );
$t_mantis_bugnote_table = db_get_table( 'bugnote' );
$t_mantis_bugnote_text_table = db_get_table( 'bugnote_text' );
$t_mantis_bug_history_table = db_get_table( 'bug_history' );
- $t_mantis_db = $g_db;
$t_bug_id = (int)$p_bug_id;
$t_target_project_id = (int)$p_target_project_id;
@@ -1116,9 +1114,9 @@ function bug_copy( $p_bug_id, $p_target_project_id = null, $p_copy_custom_fields
$query = "SELECT field_id, bug_id, value
FROM $t_mantis_custom_field_string_table
WHERE bug_id=" . db_param();
- $result = db_query_bound( $query, array( $t_bug_id ) );
+ $t_result = db_query_bound( $query, array( $t_bug_id ) );
- while( $t_bug_custom = db_fetch_array( $result ) ) {
+ while( $t_bug_custom = db_fetch_array( $t_result ) ) {
$c_field_id = (int)$t_bug_custom['field_id'];
$c_new_bug_id = (int)$t_new_bug_id;
$c_value = $t_bug_custom['value'];
@@ -1140,18 +1138,18 @@ function bug_copy( $p_bug_id, $p_target_project_id = null, $p_copy_custom_fields
$query = "SELECT *
FROM $t_mantis_bugnote_table
WHERE bug_id=" . db_param();
- $result = db_query_bound( $query, array( $t_bug_id ) );
+ $t_result = db_query_bound( $query, array( $t_bug_id ) );
- while( $t_bug_note = db_fetch_array( $result ) ) {
+ while( $t_bug_note = db_fetch_array( $t_result ) ) {
$t_bugnote_text_id = $t_bug_note['bugnote_text_id'];
$query2 = "SELECT *
FROM $t_mantis_bugnote_text_table
WHERE id=" . db_param();
- $result2 = db_query_bound( $query2, array( $t_bugnote_text_id ) );
+ $t_result2 = db_query_bound( $query2, array( $t_bugnote_text_id ) );
$t_bugnote_text_insert_id = -1;
- if( $t_bugnote_text = db_fetch_array( $result2 ) ) {
+ if( $t_bugnote_text = db_fetch_array( $t_result2 ) ) {
$query2 = "INSERT INTO $t_mantis_bugnote_text_table
( note )
VALUES ( " . db_param() . ' )';
@@ -1189,9 +1187,9 @@ function bug_copy( $p_bug_id, $p_target_project_id = null, $p_copy_custom_fields
$query = "SELECT *
FROM $t_mantis_bug_history_table
WHERE bug_id = " . db_param();
- $result = db_query_bound( $query, array( $t_bug_id ) );
+ $t_result = db_query_bound( $query, array( $t_bug_id ) );
- while( $t_bug_history = db_fetch_array( $result ) ) {
+ while( $t_bug_history = db_fetch_array( $t_result ) ) {
$query = "INSERT INTO $t_mantis_bug_history_table
( user_id, bug_id, date_modified, field_name, old_value, new_value, type )
VALUES ( " . db_param() . ",
@@ -1484,8 +1482,8 @@ function bug_get_newest_bugnote_timestamp( $p_bug_id ) {
FROM $t_bugnote_table
WHERE bug_id=" . db_param() . "
ORDER BY last_modified DESC";
- $result = db_query_bound( $query, array( $c_bug_id ), 1 );
- $row = db_result( $result );
+ $t_result = db_query_bound( $query, array( $c_bug_id ), 1 );
+ $row = db_result( $t_result );
if( false === $row ) {
return false;
@@ -1974,9 +1972,9 @@ function bug_monitor_copy( $p_source_bug_id, $p_dest_bug_id ) {
$query = 'SELECT user_id
FROM ' . $t_bug_monitor_table . '
WHERE bug_id = ' . db_param();
- $result = db_query_bound( $query, array( $c_source_bug_id ) );
+ $t_result = db_query_bound( $query, array( $c_source_bug_id ) );
- while( $t_bug_monitor = db_fetch_array( $result ) ) {
+ while( $t_bug_monitor = db_fetch_array( $t_result ) ) {
if ( user_exists( $t_bug_monitor['user_id'] ) &&
!user_is_monitoring_bug( $t_bug_monitor['user_id'], $c_dest_bug_id ) ) {
$query = 'INSERT INTO ' . $t_bug_monitor_table . ' ( user_id, bug_id )
View
2  core/bug_group_action_api.php
@@ -102,8 +102,6 @@ function bug_group_action_print_bug_list( $p_bug_ids_array ) {
$t_i = 1;
foreach( $p_bug_ids_array as $t_bug_id ) {
- $t_class = sprintf( "row-%d", ( $t_i++ % 2 ) + 1 );
-
# choose color based on status
$status_label = html_get_status_css_class( bug_get_field( $t_bug_id, 'status' ), auth_get_current_user_id(), bug_get_field( $t_bug_id, 'project_id' ) );
View
10 core/bugnote_api.php
@@ -312,9 +312,9 @@ function bugnote_delete_all( $p_bug_id ) {
$query = "SELECT bugnote_text_id
FROM $t_bugnote_table
WHERE bug_id=" . db_param();
- $result = db_query_bound( $query, array( (int)$p_bug_id ) );
+ $t_result = db_query_bound( $query, array( (int)$p_bug_id ) );
$t_bugnote_text_table = db_get_table( 'bugnote_text' );
- while( $row = db_fetch_array( $result ) ) {
+ while( $row = db_fetch_array( $t_result ) ) {
$t_bugnote_text_id = $row['bugnote_text_id'];
# Delete the corresponding bugnote texts
@@ -326,7 +326,7 @@ function bugnote_delete_all( $p_bug_id ) {
# Delete the corresponding bugnotes
$query = "DELETE FROM $t_bugnote_table
WHERE bug_id=" . db_param();
- $result = db_query_bound( $query, array( (int)$p_bug_id ) );
+ db_query_bound( $query, array( (int)$p_bug_id ) );
# db_query_bound() errors on failure so:
return true;
@@ -375,9 +375,9 @@ function bugnote_get_field( $p_bugnote_id, $p_field_name ) {
$t_bugnote_table = db_get_table( 'bugnote' );
$t_query = "SELECT $p_field_name FROM $t_bugnote_table WHERE id=" . db_param();
- $result = db_query_bound( $t_query, array( $p_bugnote_id ), 1 );
+ $t_result = db_query_bound( $t_query, array( $p_bugnote_id ), 1 );
- return db_result( $result );
+ return db_result( $t_result );
}
/**
View
4 core/category_api.php
@@ -516,9 +516,9 @@ function category_cache_array_rows( $p_cat_id_array ) {
LEFT JOIN $t_project_table p
ON c.project_id=p.id
WHERE c.id IN (" . implode( ',', $c_cat_id_array ) . ')';
- $result = db_query_bound( $query );
+ $t_result = db_query_bound( $query );
- while( $row = db_fetch_array( $result ) ) {
+ while( $row = db_fetch_array( $t_result ) ) {
$g_category_cache[(int) $row['id']] = $row;
}
return;
View
5 core/collapse_api.php
@@ -130,8 +130,6 @@ function collapse_icon( $p_name, $p_section = '' ) {
return;
}
- $t_block = ( is_blank( $p_section ) ? $p_name : $p_section . '_' . $p_name );
-
global $g_open_collapse_section;
if( $g_open_collapse_section === true ) {
@@ -157,7 +155,7 @@ function collapse_end( $p_name, $p_section = '' ) {
global $g_current_collapse_section, $g_open_collapse_section;
$t_block = ( is_blank( $p_section ) ? $p_name : $p_section . '_' . $p_name );
- $t_display = collapse_display( $t_block );
+ collapse_display( $t_block );
# Make sure a section is opened, and it is the same section.
if( $t_block !== $g_current_collapse_section ) {
@@ -210,7 +208,6 @@ function collapse_cache_token() {
return;
}
- $t_user_id = auth_get_current_user_id();
$t_token = token_get_value( TOKEN_COLLAPSE );
if( !is_null( $t_token ) ) {
View
2  core/columns_api.php
@@ -1040,7 +1040,7 @@ function print_column_plugin( $p_column_object, $p_bug, $p_columns_target = COLU
* @access public
*/
function print_column_edit( $p_bug, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
- global $t_icon_path, $t_update_bug_threshold;
+ global $t_icon_path;
echo '<td class="column-edit">';
View
21 core/config_api.php
@@ -139,8 +139,8 @@ function config_get( $p_option, $p_default = null, $p_user = null, $p_project =
if( !$g_cache_filled ) {
$t_config_table = db_get_table( 'config' );
$query = "SELECT config_id, user_id, project_id, type, value, access_reqd FROM $t_config_table";
- $result = db_query_bound( $query );
- while( false <> ( $row = db_fetch_array( $result ) ) ) {
+ $t_result = db_query_bound( $query );
+ while( false <> ( $row = db_fetch_array( $t_result ) ) ) {
$t_config = $row['config_id'];
$t_user = $row['user_id'];
$t_project = $row['project_id'];
@@ -230,7 +230,7 @@ function config_get_access( $p_option, $p_user = null, $p_project = null ) {
global $g_cache_config, $g_cache_config_access, $g_cache_filled;
if( !$g_cache_filled ) {
- $t = config_get( $p_option, -1, $p_user, $p_project );
+ config_get( $p_option, -1, $p_user, $p_project );
}
# prepare the user's list
@@ -286,7 +286,7 @@ function config_is_set( $p_option, $p_user = null, $p_project = null ) {
global $g_cache_config, $g_cache_filled;
if( !$g_cache_filled ) {
- $t = config_get( $p_option, -1, $p_user, $p_project );
+ config_get( $p_option, -1, $p_user, $p_project );
}
# prepare the user's list
@@ -404,7 +404,7 @@ function config_set( $p_option, $p_value, $p_user = NO_USER, $p_project = ALL_PR
);
}
- $result = db_query_bound( $t_set_query, $t_params );
+ db_query_bound( $t_set_query, $t_params );
}
config_set_cache( $p_option, $c_value, $t_type, $p_user, $p_project, $p_access );
@@ -501,8 +501,6 @@ function config_can_delete( $p_option ) {
* @param int $p_project project id
*/
function config_delete( $p_option, $p_user = ALL_USERS, $p_project = ALL_PROJECTS ) {
- global $g_cache_config, $g_cache_config_access;
-
# bypass table lookup for certain options
$t_bypass_lookup = !config_can_set_in_database( $p_option );
@@ -516,7 +514,7 @@ function config_delete( $p_option, $p_user = ALL_USERS, $p_project = ALL_PROJECT
WHERE config_id = " . db_param() . " AND
project_id=" . db_param() . " AND
user_id=" . db_param();
- $result = db_query_bound( $query, array( $p_option, $p_project, $p_user ) );
+ db_query_bound( $query, array( $p_option, $p_project, $p_user ) );
}
config_flush_cache( $p_option, $p_user, $p_project );
@@ -547,9 +545,8 @@ function config_delete_for_user( $p_option, $p_user_id ) {
*/
function config_delete_project( $p_project = ALL_PROJECTS ) {
$t_config_table = db_get_table( 'config' );
- $query = "DELETE FROM $t_config_table
- WHERE project_id=" . db_param();
- $result = db_query_bound( $query, array( $p_project ) );
+ $t_query = "DELETE FROM $t_config_table WHERE project_id=" . db_param();
+ db_query_bound( $t_query, array( $p_project ) );
# flush cache here in case some of the deleted configs are in use.
config_flush_cache();
@@ -564,7 +561,7 @@ function config_delete_project( $p_project = ALL_PROJECTS ) {
* @param int $p_project project id
*/
function config_flush_cache( $p_option = '', $p_user = ALL_USERS, $p_project = ALL_PROJECTS ) {
- global $g_cache_config, $g_cache_config_access, $g_cache_filled;
+ global $g_cache_filled;
if( '' !== $p_option ) {
unset( $GLOBALS['g_cache_config'][$p_option][$p_user][$p_project] );
View
20 core/custom_field_api.php
@@ -625,7 +625,7 @@ function custom_field_get_id_from_name( $p_field_name ) {
* @access public
*/
function custom_field_get_linked_ids( $p_project_id = ALL_PROJECTS ) {
- global $g_cache_cf_linked, $g_cache_custom_field;
+ global $g_cache_cf_linked;
if( !isset( $g_cache_cf_linked[$p_project_id] ) ) {
@@ -942,13 +942,13 @@ function custom_field_get_sequence( $p_field_id, $p_project_id ) {
FROM $t_custom_field_project_table
WHERE field_id=" . db_param() . " AND
project_id=" . db_param();
- $result = db_query_bound( $query, array( $p_field_id, $p_project_id ), 1 );
+ $t_result = db_query_bound( $query, array( $p_field_id, $p_project_id ), 1 );
- if( 0 == db_num_rows( $result ) ) {
+ if( 0 == db_num_rows( $t_result ) ) {
return false;
}
- $t_row = db_fetch_array( $result );
+ $t_row = db_fetch_array( $t_result );
return $t_row['sequence'];
}
@@ -969,8 +969,8 @@ function custom_field_validate( $p_field_id, $p_value ) {
access_level_rw, length_min, length_max, default_value
FROM $t_custom_field_table
WHERE id=" . db_param();
- $result = db_query_bound( $query, array( $p_field_id ) );
- $row = db_fetch_array( $result );
+ $t_result = db_query_bound( $query, array( $p_field_id ) );
+ $row = db_fetch_array( $t_result );
$t_name = $row['name'];
$t_type = $row['type'];
@@ -1206,9 +1206,9 @@ function custom_field_set_value( $p_field_id, $p_bug_id, $p_value, $p_log_insert
FROM $t_custom_field_string_table
WHERE field_id=" . db_param() . " AND
bug_id=" . db_param();
- $result = db_query_bound( $query, array( $p_field_id, $p_bug_id ) );
+ $t_result = db_query_bound( $query, array( $p_field_id, $p_bug_id ) );
- if( db_num_rows( $result ) > 0 ) {
+ if( db_num_rows( $t_result ) > 0 ) {
$query = "UPDATE $t_custom_field_string_table
SET $t_value_field=" . db_param() . "
WHERE field_id=" . db_param() . " AND
@@ -1220,7 +1220,7 @@ function custom_field_set_value( $p_field_id, $p_bug_id, $p_value, $p_log_insert
);
db_query_bound( $query, $t_params );
- $row = db_fetch_array( $result );
+ $row = db_fetch_array( $t_result );
history_log_event_direct( $p_bug_id, $t_name, custom_field_database_to_value( $row[$t_value_field], $t_type ), $p_value );
} else {
$query = "INSERT INTO $t_custom_field_string_table
@@ -1261,7 +1261,7 @@ function custom_field_set_sequence( $p_field_id, $p_project_id, $p_sequence ) {
SET sequence=" . db_param() . "
WHERE field_id=" . db_param() . " AND
project_id=" . db_param();
- $result = db_query_bound( $query, array( $p_sequence, $p_field_id, $p_project_id ) );
+ db_query_bound( $query, array( $p_sequence, $p_field_id, $p_project_id ) );
custom_field_clear_cache( $p_field_id );
View
19 core/database_api.php
@@ -200,7 +200,6 @@ function db_is_connected() {
* @return bool indicating if php current supports the given database type
*/
function db_check_database_support( $p_db_type ) {
- $t_support = false;
switch( $p_db_type ) {
case 'mysql':
$t_support = function_exists( 'mysql_connect' );
@@ -452,8 +451,6 @@ function db_param_push() {
* @return int Record Count
*/
function db_num_rows( $p_result ) {
- global $g_db;
-
return $p_result->RecordCount();
}
@@ -552,8 +549,6 @@ function db_fetch_array( &$p_result ) {
* @return mixed Database result
*/
function db_result( $p_result, $p_index1 = 0, $p_index2 = 0 ) {
- global $g_db;
-
if( $p_result && ( db_num_rows( $p_result ) > 0 ) ) {
$p_result->Move( $p_index1 );
$t_result = $p_result->GetArray();
@@ -578,7 +573,6 @@ function db_result( $p_result, $p_index1 = 0, $p_index2 = 0 ) {
*/
function db_insert_id( $p_table = null, $p_field = "id" ) {
global $g_db;
- $t_db_type = config_get_global( 'db_type' );
if( isset( $p_table ) ) {
if( db_is_oracle() ) {
@@ -587,14 +581,14 @@ function db_insert_id( $p_table = null, $p_field = "id" ) {
$query = "SELECT currval('" . $p_table . "_" . $p_field . "_seq')";
}
if( isset( $query ) ) {
- $result = db_query_bound( $query );
- return db_result( $result );
+ $t_result = db_query_bound( $query );
+ return db_result( $t_result );
}
}
if( db_is_mssql() ) {
$query = "SELECT IDENT_CURRENT('$p_table')";
- $result = db_query_bound( $query );
- return db_result( $result );
+ $t_result = db_query_bound( $query );
+ return db_result( $t_result );
}
return $g_db->Insert_ID();
}
@@ -629,7 +623,7 @@ function db_table_exists( $p_table_name ) {
* @return bool indicating whether the index exists
*/
function db_index_exists( $p_table_name, $p_index_name ) {
- global $g_db, $g_db_schema;
+ global $g_db;
if( is_blank( $p_index_name ) || is_blank( $p_table_name ) ) {
return false;
@@ -660,7 +654,6 @@ function db_index_exists( $p_table_name, $p_index_name ) {
* @return bool indicating whether the field exists
*/
function db_field_exists( $p_field_name, $p_table_name ) {
- global $g_db;
$columns = db_field_names( $p_table_name );
return in_array( $p_field_name, $columns );
}
@@ -845,8 +838,6 @@ function db_prepare_bool( $p_bool ) {
* @return string Formatted Date for DB insertion e.g. 1970-01-01 00:00:00 ready for database insertion
*/
function db_now() {
- global $g_db;
-
return time();
}
View
6 core/email_api.php
@@ -1032,7 +1032,7 @@ function email_bug_reminder( $p_recipients, $p_bug_id, $p_message ) {
$t_subject = email_build_subject( $p_bug_id );
$t_date = date( config_get( 'normal_date_format' ) );
- $result = array();
+ $t_result = array();
foreach( $p_recipients as $t_recipient ) {
lang_push( user_pref_get_language( $t_recipient, $t_project_id ) );
@@ -1048,14 +1048,14 @@ function email_bug_reminder( $p_recipients, $p_bug_id, $p_message ) {
$t_id = email_store( $t_email, $t_subject, $t_contents );
if( $t_id !== null ) {
- $result[] = $t_recipient;
+ $t_result[] = $t_recipient;
}
log_event( LOG_EMAIL, "queued reminder email #$t_id for U$t_recipient" );
lang_pop();
}
- return $result;
+ return $t_result;
}
/**
View
8 core/email_queue_api.php
@@ -182,9 +182,9 @@ function email_queue_get( $p_email_id ) {
$t_email_table = db_get_table( 'email' );
$query = 'SELECT * FROM ' . $t_email_table . ' WHERE email_id=' . db_param();
- $result = db_query_bound( $query, array( $p_email_id ) );
+ $t_result = db_query_bound( $query, array( $p_email_id ) );
- $t_row = db_fetch_array( $result );
+ $t_row = db_fetch_array( $t_result );
return email_queue_row_to_object( $t_row );
}
@@ -212,10 +212,10 @@ function email_queue_get_ids( $p_sort_order = 'DESC' ) {
$t_email_table = db_get_table( 'email' );
$query = "SELECT email_id FROM $t_email_table ORDER BY email_id $p_sort_order";
- $result = db_query_bound( $query );
+ $t_result = db_query_bound( $query );
$t_ids = array();
- while(( $t_row = db_fetch_array( $result ) ) !== false ) {
+ while(( $t_row = db_fetch_array( $t_result ) ) !== false ) {
$t_ids[] = $t_row['email_id'];
}
View
8 core/error_api.php
@@ -71,8 +71,7 @@
* @uses html_api.php (optional)
*/
function error_handler( $p_type, $p_error, $p_file, $p_line, $p_context ) {
- global $g_error_parameters, $g_error_handled, $g_error_proceed_url;
- global $g_lang_overrides;
+ global $g_error_parameters, $g_error_handled;
global $g_error_send_page_header;
# check if errors were disabled with @ somewhere in this call chain
@@ -99,7 +98,6 @@ function error_handler( $p_type, $p_error, $p_file, $p_line, $p_context ) {
$t_lang_pushed = true;
}
- $t_short_file = basename( $p_file );
$t_method_array = config_get_global( 'display_errors' );
if( isset( $t_method_array[$p_type] ) ) {
$t_method = $t_method_array[$p_type];
@@ -164,8 +162,8 @@ function error_handler( $p_type, $p_error, $p_file, $p_line, $p_context ) {
$t_old_contents = ob_get_contents();
if( !error_handled() ) {
# Retrieve the previously output header
- if( false !== preg_match_all( '|^(.*)(</head>.*$)|is', $t_old_contents, $result ) ) {
- $t_old_headers = $result[1][0];
+ if( false !== preg_match_all( '|^(.*)(</head>.*$)|is', $t_old_contents, $t_result ) ) {
+ $t_old_headers = $t_result[1][0];
unset( $t_old_contents );
}
}
View
34 core/file_api.php
@@ -56,8 +56,6 @@
* @return string
*/
function file_get_display_name( $p_filename ) {
- $t_array = explode( '-', $p_filename, 2 );
-
# Check if it's a project document filename (doc-0000000-filename)
# or a bug attachment filename (0000000-filename)
# for newer filenames, the filename in schema is correct.
@@ -375,9 +373,9 @@ function file_delete_attachments( $p_bug_id ) {
$query = "SELECT diskfile, filename
FROM $t_bug_file_table
WHERE bug_id=" . db_param();
- $result = db_query_bound( $query, array( $p_bug_id ) );
+ $t_result = db_query_bound( $query, array( $p_bug_id ) );
- $file_count = db_num_rows( $result );
+ $file_count = db_num_rows( $t_result );
if( 0 == $file_count ) {
return true;
}
@@ -385,7 +383,7 @@ function file_delete_attachments( $p_bug_id ) {
if ( DISK == $t_method ) {
for( $i = 0;$i < $file_count;$i++ ) {
- $row = db_fetch_array( $result );
+ $row = db_fetch_array( $t_result );
$t_local_diskfile = file_normalize_attachment_path( $row['diskfile'], bug_get_field( $p_bug_id, 'project_id' ) );
file_delete_local( $t_local_diskfile );
@@ -415,12 +413,12 @@ function file_delete_project_files( $p_project_id ) {
$query = "SELECT diskfile, filename
FROM $t_project_file_table
WHERE project_id=" . db_param();
- $result = db_query_bound( $query, array( (int) $p_project_id ) );
+ $t_result = db_query_bound( $query, array( (int) $p_project_id ) );
- $file_count = db_num_rows( $result );
+ $file_count = db_num_rows( $t_result );
for( $i = 0;$i < $file_count;$i++ ) {
- $row = db_fetch_array( $result );
+ $row = db_fetch_array( $t_result );
$t_local_diskfile = file_normalize_attachment_path( $row['diskfile'], $p_project_id );
file_delete_local( $t_local_diskfile );
@@ -430,7 +428,7 @@ function file_delete_project_files( $p_project_id ) {
# Delete the corresponding db records
$query = "DELETE FROM $t_project_file_table
WHERE project_id=" . db_param();
- $result = db_query_bound( $query, array( (int) $p_project_id ) );
+ db_query_bound( $query, array( (int) $p_project_id ) );
}
/**
@@ -458,9 +456,9 @@ function file_get_field( $p_file_id, $p_field_name, $p_table = 'bug' ) {
}
$query = "SELECT $p_field_name FROM $t_bug_file_table WHERE id=" . db_param();
- $result = db_query_bound( $query, array( (int) $p_file_id ), 1 );
+ $t_result = db_query_bound( $query, array( (int) $p_file_id ), 1 );
- return db_result( $result );
+ return db_result( $t_result );
}
/**
@@ -765,7 +763,7 @@ function file_add( $p_bug_id, $p_file, $p_table = 'bug', $p_title = '', $p_desc
if( 'bug' == $p_table ) {
# update the last_updated date
if ( !$p_skip_bug_update ) {
- $result = bug_update_date( $p_bug_id );
+ bug_update_date( $p_bug_id );
}
# log file added to bug history
@@ -916,8 +914,8 @@ function file_get_content( $p_file_id, $p_type = 'bug' ) {
default:
return false;
}
- $result = db_query_bound( $query, array( $p_file_id ) );
- $row = db_fetch_array( $result );
+ $t_result = db_query_bound( $query, array( $p_file_id ) );
+ $row = db_fetch_array( $t_result );
if( $p_type == 'bug' ) {
$t_project_id = bug_get_field( $row['bug_id'], 'project_id' );
@@ -1055,18 +1053,16 @@ function file_move_bug_attachments( $p_bug_id, $p_project_id_to ) {
* @param int $p_dest_bug_id
*/
function file_copy_attachments( $p_source_bug_id, $p_dest_bug_id ) {
-
$t_mantis_bug_file_table = db_get_table( 'bug_file' );
$query = 'SELECT * FROM ' . $t_mantis_bug_file_table . ' WHERE bug_id = ' . db_param();
- $result = db_query_bound( $query, array( $p_source_bug_id ) );
- $t_count = db_num_rows( $result );
+ $t_result = db_query_bound( $query, array( $p_source_bug_id ) );
+ $t_count = db_num_rows( $t_result );
$t_project_id = bug_get_field( $p_source_bug_id, 'project_id' );
- $t_bug_file = array();
for( $i = 0;$i < $t_count;$i++ ) {
- $t_bug_file = db_fetch_array( $result );
+ $t_bug_file = db_fetch_array( $t_result );
# prepare the new diskfile name and then copy the file
$t_source_file = $t_bug_file['folder'] . $t_bug_file['diskfile'];
View
65 core/filter_api.php
@@ -1421,9 +1421,7 @@ function filter_get_bug_rows( &$p_page_number, &$p_per_page, &$p_page_count, &$p
$t_available_statuses = MantisEnum::getValues( config_get( 'status_enum_string' ) );
if( 'simple' == $t_filter['_view_type'] ) {
-
# simple filtering: if showing any, restrict by the hide status value, otherwise ignore the hide
- $t_any_found = false;
$t_this_status = $t_filter[FILTER_PROPERTY_STATUS][0];
$t_this_hide_status = $t_filter[FILTER_PROPERTY_HIDE_STATUS][0];
@@ -4230,9 +4228,7 @@ function print_filter_show_sort() {
* @param int $p_field_id
*/
function print_filter_custom_field_date( $p_field_num, $p_field_id ) {
- global $t_filter, $t_accessible_custom_fields_names, $t_accessible_custom_fields_types, $t_accessible_custom_fields_values, $t_accessible_custom_fields_ids, $t_select_modifier;
-
- $t_js_toggle_func = 'toggle_custom_date_field_' . $p_field_id . '_controls';
+ global $t_filter, $t_accessible_custom_fields_values;
# Resort the values so there ordered numerically, they are sorted as strings otherwise which
# may be wrong for dates before early 2001.
@@ -4350,7 +4346,7 @@ function print_filter_custom_field_date( $p_field_num, $p_field_id ) {
* print project field
*/
function print_filter_project_id() {
- global $t_select_modifier, $t_filter, $f_view_type;
+ global $t_select_modifier, $t_filter;
?>
<!-- Project -->
<select <?php echo $t_select_modifier;?> name="<?php echo FILTER_PROPERTY_PROJECT_ID;?>[]">
@@ -4364,7 +4360,7 @@ function print_filter_project_id() {
}
function print_filter_match_type() {
- global $t_select_modifier, $t_filter, $f_view_type;
+ global $t_select_modifier, $t_filter;
?>
<!-- Project -->
<select <?php echo $t_select_modifier;?> name="<?php echo FILTER_PROPERTY_MATCH_TYPE;?>">
@@ -4453,9 +4449,9 @@ function filter_cache_row( $p_filter_id, $p_trigger_errors = true ) {
$t_query = 'SELECT *
FROM ' . $t_filters_table . '
WHERE id=' . db_param();
- $result = db_query_bound( $t_query, array( $p_filter_id ) );
+ $t_result = db_query_bound( $t_query, array( $p_filter_id ) );
- if( 0 == db_num_rows( $result ) ) {
+ if( 0 == db_num_rows( $t_result ) ) {
if( $p_trigger_errors ) {
error_parameters( $p_filter_id );
trigger_error( ERROR_FILTER_NOT_FOUND, ERROR );
@@ -4464,7 +4460,7 @@ function filter_cache_row( $p_filter_id, $p_trigger_errors = true ) {
}
}
- $row = db_fetch_array( $result );
+ $row = db_fetch_array( $t_result );
$g_cache_filter[$p_filter_id] = $row;
@@ -4518,10 +4514,10 @@ function filter_db_set_for_current_user( $p_project_id, $p_is_public, $p_name, $
WHERE user_id=" . db_param() . "
AND project_id=" . db_param() . "
AND name=" . db_param();
- $result = db_query_bound( $query, array( $t_user_id, $c_project_id, $p_name ) );
+ $t_result = db_query_bound( $query, array( $t_user_id, $c_project_id, $p_name ) );
- if( db_num_rows( $result ) > 0 ) {
- $row = db_fetch_array( $result );
+ if( db_num_rows( $t_result ) > 0 ) {
+ $row = db_fetch_array( $t_result );
$query = "UPDATE $t_filters_table
SET is_public=" . db_param() . ",
@@ -4543,10 +4539,10 @@ function filter_db_set_for_current_user( $p_project_id, $p_is_public, $p_name, $
WHERE user_id=" . db_param() . "
AND project_id=" . db_param() . "
AND name=" . db_param();
- $result = db_query_bound( $query, array( $t_user_id, $c_project_id, $p_name ) );
+ $t_result = db_query_bound( $query, array( $t_user_id, $c_project_id, $p_name ) );
- if( db_num_rows( $result ) > 0 ) {
- $row = db_fetch_array( $result );
+ if( db_num_rows( $t_result ) > 0 ) {
+ $row = db_fetch_array( $t_result );
return $row['id'];
}
@@ -4580,10 +4576,10 @@ function filter_db_get_filter( $p_filter_id, $p_user_id = null ) {
$t_filters_table = db_get_table( 'filters' );
$query = 'SELECT * FROM ' . $t_filters_table . ' WHERE id=' . db_param();
- $result = db_query_bound( $query, array( $c_filter_id ) );
+ $t_result = db_query_bound( $query, array( $c_filter_id ) );
- if( db_num_rows( $result ) > 0 ) {
- $row = db_fetch_array( $result );
+ if( db_num_rows( $t_result ) > 0 ) {
+ $row = db_fetch_array( $t_result );
if( $row['user_id'] != $t_user_id ) {
if( $row['is_public'] != true ) {
@@ -4627,10 +4623,10 @@ function filter_db_get_project_current( $p_project_id, $p_user_id = null ) {
WHERE user_id=" . db_param() . "
AND project_id=" . db_param() . "
AND name=" . db_param();
- $result = db_query_bound( $query, array( $c_user_id, $c_project_id, '' ) );
+ $t_result = db_query_bound( $query, array( $c_user_id, $c_project_id, '' ) );
- if( db_num_rows( $result ) > 0 ) {
- $row = db_fetch_array( $result );
+ if( db_num_rows( $t_result ) > 0 ) {
+ $row = db_fetch_array( $t_result );
return $row['id'];
}
@@ -4647,10 +4643,10 @@ function filter_db_get_name( $p_filter_id ) {
$t_filters_table = db_get_table( 'filters' );
$query = 'SELECT * FROM ' . $t_filters_table . ' WHERE id=' . db_param();
- $result = db_query_bound( $query, array( $c_filter_id ) );
+ $t_result = db_query_bound( $query, array( $c_filter_id ) );
- if( db_num_rows( $result ) > 0 ) {
- $row = db_fetch_array( $result );
+ if( db_num_rows( $t_result ) > 0 ) {
+ $row = db_fetch_array( $t_result );
if( $row['user_id'] != auth_get_current_user_id() ) {
if( $row['is_public'] != true ) {
@@ -4685,9 +4681,9 @@ function filter_db_can_delete_filter( $p_filter_id ) {
AND user_id=" . db_param() . "
AND project_id!=" . db_param();
- $result = db_query_bound( $query, array( $c_filter_id, $t_user_id, -1 ) );
+ $t_result = db_query_bound( $query, array( $c_filter_id, $t_user_id, -1 ) );
- if( db_num_rows( $result ) > 0 ) {
+ if( db_num_rows( $t_result ) > 0 ) {
return true;
}
@@ -4702,14 +4698,13 @@ function filter_db_can_delete_filter( $p_filter_id ) {
function filter_db_delete_filter( $p_filter_id ) {
$t_filters_table = db_get_table( 'filters' );
$c_filter_id = (int)$p_filter_id;
- $t_user_id = auth_get_current_user_id();
if( !filter_db_can_delete_filter( $c_filter_id ) ) {
return false;
}
- $query = 'DELETE FROM ' . $t_filters_table . ' WHERE id=' . db_param();
- $result = db_query_bound( $query, array( $c_filter_id ) );
+ $t_query = 'DELETE FROM ' . $t_filters_table . ' WHERE id=' . db_param();
+ db_query_bound( $t_query, array( $c_filter_id ) );
# db_query_bound() errors on failure so:
return true;
@@ -4722,10 +4717,10 @@ function filter_db_delete_current_filters() {
$t_filters_table = db_get_table( 'filters' );
$t_all_id = ALL_PROJECTS;
- $query = "DELETE FROM $t_filters_table
+ $t_query = "DELETE FROM $t_filters_table
WHERE project_id<=" . db_param() . "
AND name=" . db_param();
- $result = db_query_bound( $query, array( $t_all_id, '' ) );
+ db_query_bound( $t_query, array( $t_all_id, '' ) );
}
/**
@@ -4766,11 +4761,11 @@ function filter_db_get_available_queries( $p_project_id = null, $p_user_id = nul
AND (is_public = " . db_prepare_bool(true) . "
OR user_id = " . db_param() . ")
ORDER BY is_public DESC, name ASC";
- $result = db_query_bound( $query, array( $t_project_id, $t_user_id ) );
- $query_count = db_num_rows( $result );
+ $t_result = db_query_bound( $query, array( $t_project_id, $t_user_id ) );
+ $query_count = db_num_rows( $t_result );
for( $i = 0;$i < $query_count;$i++ ) {
- $row = db_fetch_array( $result );
+ $row = db_fetch_array( $t_result );
$t_overall_query_arr[$row['id']] = $row['name'];
}
View
5 core/helper_api.php
@@ -140,12 +140,11 @@ function get_percentage_by_status() {
$query .= ' AND view_state < ' . VS_PRIVATE;
}
$query .= ' GROUP BY status';
- $result = db_query_bound( $query );
+ $t_result = db_query_bound( $query );
- $t_bug_count = 0;
$t_status_count_array = array();
- while( $row = db_fetch_array( $result ) ) {
+ while( $row = db_fetch_array( $t_result ) ) {
$t_status_count_array[$row['status']] = $row['num'];
}
$t_bug_count = array_sum( $t_status_count_array );
View
7 core/history_api.php
@@ -125,7 +125,7 @@ function history_log_event_special( $p_bug_id, $p_type, $p_optional = '', $p_opt
( user_id, bug_id, date_modified, type, old_value, new_value, field_name )
VALUES
( " . db_param() . ', ' . db_param() . ', ' . db_param() . ', ' . db_param() . ', ' . db_param() . ',' . db_param() . ', ' . db_param() . ')';
- $result = db_query_bound( $query, array( $t_user_id, $p_bug_id, db_now(), $p_type, $c_optional, $c_optional2, '' ) );
+ db_query_bound( $query, array( $t_user_id, $p_bug_id, db_now(), $p_type, $c_optional, $c_optional2, '' ) );
}
/**
@@ -180,10 +180,9 @@ function history_get_raw_events_array( $p_bug_id, $p_user_id = null ) {
FROM $t_mantis_bug_history_table
WHERE bug_id=" . db_param() . "
ORDER BY date_modified $t_history_order,id";
- $result = db_query_bound( $query, array( $p_bug_id ) );
+ $t_result = db_query_bound( $query, array( $p_bug_id ) );
$raw_history = array();
- $t_private_bugnote_threshold = config_get( 'private_bugnote_threshold' );
$t_private_bugnote_visible = access_has_bug_level( config_get( 'private_bugnote_threshold' ), $p_bug_id, $t_user_id );
$t_tag_view_threshold = config_get( 'tag_view_threshold' );
$t_show_monitor_list_threshold = config_get( 'show_monitor_list_threshold' );
@@ -191,7 +190,7 @@ function history_get_raw_events_array( $p_bug_id, $p_user_id = null ) {
$t_standard_fields = columns_get_standard();
$j = 0;
- while( $t_row = db_fetch_array( $result ) ) {
+ while( $t_row = db_fetch_array( $t_result ) ) {
extract( $t_row, EXTR_PREFIX_ALL, 'v' );
if ( $v_type == NORMAL_TYPE ) {
View
10 core/html_api.php
@@ -1307,7 +1307,6 @@ function html_status_legend() {
$t_status_array = MantisEnum::getAssocArrayIndexedByValues( config_get( 'status_enum_string' ) );
$t_status_names = MantisEnum::getAssocArrayIndexedByValues( lang_get( 'status_enum_string' ) );
- $enum_count = count( $t_status_array );
# read through the list and eliminate unused ones for the selected project
# assumes that all status are are in the enum array
@@ -1348,7 +1347,6 @@ function html_status_legend() {
echo '<tr>';
# draw the status bar
- $width = (int)( 100 / count( $t_status_array ) );
$t_status_enum_string = config_get('status_enum_string' );
foreach( $t_status_array as $t_status => $t_name ) {
$t_val = isset( $t_status_names[$t_status] ) ? $t_status_names[$t_status] : $t_status_array[$t_status];
@@ -1372,7 +1370,7 @@ function html_status_percentage_legend() {
$t_status_percents = get_percentage_by_status();
$t_status_enum_string = config_get('status_enum_string' );
$t_enum_values = MantisEnum::getValues( $t_status_enum_string );
- $enum_count = count( $t_enum_values );
+ $t_enum_count = count( $t_enum_values );
$t_bug_count = array_sum( $t_status_percents );
@@ -1380,7 +1378,7 @@ function html_status_percentage_legend() {
echo '<br />';
echo '<table class="width100" cellspacing="1">';
echo '<tr>';
- echo '<td class="form-title" colspan="' . $enum_count . '">' . lang_get( 'issue_status_percentage' ) . '</td>';
+ echo '<td class="form-title" colspan="' . $t_enum_count . '">' . lang_get( 'issue_status_percentage' ) . '</td>';
echo '</tr>';
echo '<tr>';
@@ -1531,7 +1529,6 @@ function html_button_bug_assign_to( $p_bug ) {
}
$t_current_user_id = auth_get_current_user_id();
- $t_new_status = ( ON == config_get( 'auto_set_status_to_assigned' ) ) ? config_get( 'bug_assigned_status' ) : $p_bug->status;
$t_options = array();
$t_default_assign_to = null;
@@ -1736,9 +1733,6 @@ function html_button_wiki( $p_bug_id ) {
* @return null
*/
function html_buttons_view_bug_page( $p_bug_id ) {
- $t_resolved = config_get( 'bug_resolved_status_threshold' );
- $t_closed = config_get( 'bug_closed_status_threshold' );
- $t_status = bug_get_field( $p_bug_id, 'status' );
$t_readonly = bug_is_readonly( $p_bug_id );
$t_sticky = config_get( 'set_bug_sticky_threshold' );
View
4 core/install_helper_functions_api.php
@@ -363,7 +363,7 @@ function install_correct_multiselect_custom_fields_db_format() {
SET value = '$c_value'
WHERE field_id = $c_field_id
AND bug_id = $c_bug_id";
- $t_update_result = db_query_bound( $t_update_query );
+ db_query_bound( $t_update_query );
}
# Remove vertical pipe | prefix and suffix from radio custom field values.
@@ -383,7 +383,7 @@ function install_correct_multiselect_custom_fields_db_format() {
SET value = '$c_value'
WHERE field_id = $c_field_id
AND bug_id = $c_bug_id";
- $t_update_result = db_query_bound( $t_update_query );
+ db_query_bound( $t_update_query );
}
# Re-enable query logging if we disabled it
View
18 core/news_api.php
@@ -169,9 +169,9 @@ function news_update( $p_news_id, $p_project_id, $p_view_state, $p_announcement,
function news_get_row( $p_news_id ) {
$t_news_table = db_get_table( 'news' );
$t_query = "SELECT * FROM $t_news_table WHERE id=" . db_param();
- $result = db_query_bound( $t_query, array( $p_news_id ) );
+ $t_result = db_query_bound( $t_query, array( $p_news_id ) );
- $row = db_fetch_array( $result );
+ $row = db_fetch_array( $t_result );
if( !$row ) {
trigger_error( ERROR_NEWS_NOT_FOUND, ERROR );
@@ -197,9 +197,9 @@ function news_get_count( $p_project_id, $p_global = true ) {
$t_query .= ' OR project_id=' . ALL_PROJECTS;
}
- $result = db_query_bound( $t_query );
+ $t_result = db_query_bound( $t_query );
- return db_result( $result, 0 );
+ return db_result( $t_result, 0 );
}
/**
@@ -229,11 +229,11 @@ function news_get_rows( $p_project_id, $p_global = true ) {
$t_query .= " ORDER BY date_posted DESC";
- $result = db_query_bound( $t_query, array() );
+ $t_result = db_query_bound( $t_query, array() );
$t_rows = array();
- while( $t_row = db_fetch_array( $result ) ) {
+ while( $t_row = db_fetch_array( $t_result ) ) {
array_push( $t_rows, $t_row );
}
@@ -303,7 +303,7 @@ function news_get_limited_rows( $p_offset, $p_project_id = null ) {
}
$query .= ' ORDER BY announcement DESC, id DESC';
- $result = db_query_bound( $query, $t_params, $t_news_view_limit, $c_offset );
+ $t_result = db_query_bound( $query, $t_params, $t_news_view_limit, $c_offset );
break;
case 1:
@@ -324,12 +324,12 @@ function news_get_limited_rows( $p_offset, $p_project_id = null ) {
$query .= ' AND project_id IN (' . join( $t_projects, ',' ) . ')';
}
$query .= " ORDER BY announcement DESC, id DESC";
- $result = db_query_bound( $query, $t_params, $t_news_view_limit, $c_offset );
+ $t_result = db_query_bound( $query, $t_params, $t_news_view_limit, $c_offset );
break;
}
$t_rows = array();
- while( $t_row = db_fetch_array( $result ) ) {
+ while( $t_row = db_fetch_array( $t_result ) ) {
array_push( $t_rows, $t_row );
}
View
25 core/print_api.php
@@ -410,11 +410,11 @@ function print_news_item_option_list() {
WHERE project_id=" . db_param() . "
ORDER BY date_posted DESC";
}
- $result = db_query_bound( $query, ($t_global == true ? array() : array( $t_project_id ) ) );
- $news_count = db_num_rows( $result );
+ $t_result = db_query_bound( $query, ($t_global == true ? array() : array( $t_project_id ) ) );
+ $news_count = db_num_rows( $t_result );
for( $i = 0;$i < $news_count;$i++ ) {
- $row = db_fetch_array( $result );
+ $row = db_fetch_array( $t_result );
$t_headline = string_display( $row['headline'] );
$t_announcement = $row['announcement'];
@@ -670,9 +670,6 @@ function print_profile_option_list_from_profiles( $p_profiles, $p_select_id ) {
* @param int $p_project_id project id
*/
function print_category_option_list( $p_category_id = 0, $p_project_id = null ) {
- $t_category_table = db_get_table( 'category' );
- $t_project_table = db_get_table( 'project' );
-
if( null === $p_project_id ) {
$t_project_id = helper_get_current_project();
} else {
@@ -850,11 +847,11 @@ function print_build_option_list( $p_build = '' ) {
FROM $t_bug_table
WHERE $t_project_where
ORDER BY build DESC";
- $result = db_query_bound( $query );
- $option_count = db_num_rows( $result );
+ $t_result = db_query_bound( $query );
+ $option_count = db_num_rows( $t_result );
for( $i = 0;$i < $option_count;$i++ ) {
- $row = db_fetch_array( $result );
+ $row = db_fetch_array( $t_result );
$t_overall_build_arr[] = $row['build'];
}
@@ -1059,10 +1056,10 @@ function print_project_user_list_option_list2( $p_user_id ) {
WHERE p.enabled = " . db_param() . " AND
u.user_id IS NULL
ORDER BY p.name";
- $result = db_query_bound( $query, array( $c_user_id, true ) );
- $category_count = db_num_rows( $result );
+ $t_result = db_query_bound( $query, array( $c_user_id, true ) );
+ $category_count = db_num_rows( $t_result );
for( $i = 0;$i < $category_count;$i++ ) {
- $row = db_fetch_array( $result );
+ $row = db_fetch_array( $t_result );
$t_project_name = string_attribute( $row['name'] );
$t_user_id = $row['id'];
echo "<option value=\"$t_user_id\">$t_project_name</option>";
@@ -1115,8 +1112,6 @@ function print_custom_field_projects_list( $p_field_id ) {
$t_linked_field_ids = custom_field_get_linked_ids( $t_project_id );
- $t_current_project_fields = array();
-
$t_first = true;
foreach( $t_linked_field_ids as $t_current_field_id ) {
if( $t_first ) {
@@ -1409,7 +1404,6 @@ function print_page_link( $p_page_url, $p_text = '', $p_page_no = 0, $p_page_cur
*/
function print_page_links( $p_page, $p_start, $p_end, $p_current, $p_temp_filter_id = 0 ) {
$t_items = array();
- $t_link = '';
# Check if we have more than one page,
# otherwise return without doing anything.
@@ -1703,7 +1697,6 @@ function get_dropdown( $p_control_array, $p_control_name, $p_match = '', $p_add_
*/
function print_bug_attachments_list( $p_bug_id ) {
$t_attachments = file_get_visible_attachments( $p_bug_id );
- $t_attachments_count = count( $t_attachments );
echo "\n<ul>";
foreach ( $t_attachments as $t_attachment ) {
echo "\n<li>";
View
10 core/profile_api.php
@@ -156,7 +156,7 @@ function profile_update( $p_user_id, $p_profile_id, $p_platform, $p_os, $p_os_bu
os_build=" . db_param() . ",
description=" . db_param() . "
WHERE id=" . db_param() . " AND user_id=" . db_param();
- $result = db_query_bound( $query, array( $p_platform, $p_os, $p_os_build, $p_description, $p_profile_id, $p_user_id ) );
+ db_query_bound( $query, array( $p_platform, $p_os, $p_os_build, $p_description, $p_profile_id, $p_user_id ) );
}
/**
@@ -171,9 +171,9 @@ function profile_get_row( $p_user_id, $p_profile_id ) {
$query = "SELECT *
FROM $t_user_profile_table
WHERE id=" . db_param() . " AND user_id=" . db_param();
- $result = db_query_bound( $query, array( $p_profile_id, $p_user_id ) );
+ $t_result = db_query_bound( $query, array( $p_profile_id, $p_user_id ) );
- return db_fetch_array( $result );
+ return db_fetch_array( $t_result );
}
/**
@@ -312,9 +312,9 @@ function profile_get_default( $p_user_id ) {
$query = "SELECT default_profile
FROM $t_mantis_user_pref_table
WHERE user_id=" . db_param();
- $result = db_query_bound( $query, array( $p_user_id ) );
+ $t_result = db_query_bound( $query, array( $p_user_id ) );
- $t_default_profile = (int)db_result( $result, 0, 0 );
+ $t_default_profile = (int)db_result( $t_result, 0, 0 );
return $t_default_profile;
}
View
49 core/project_api.php
@@ -76,9 +76,9 @@ function project_table_empty() {
# Otherwise, check if the projects table contains at least one project.
$t_project_table = db_get_table( 'project' );
$query = "SELECT * FROM $t_project_table";
- $result = db_query_bound( $query, array(), /* limit */ 1 );
+ $t_result = db_query_bound( $query, array(), /* limit */ 1 );
- return db_num_rows( $result ) == 0;
+ return db_num_rows( $t_result ) == 0;
}
/**
@@ -107,9 +107,9 @@ function project_cache_row( $p_project_id, $p_trigger_errors = true ) {
$t_project_table = db_get_table( 'project' );
$query = "SELECT * FROM $t_project_table WHERE id=" . db_param();
- $result = db_query_bound( $query, array( $p_project_id ) );
+ $t_result = db_query_bound( $query, array( $p_project_id ) );
- if( 0 == db_num_rows( $result ) ) {
+ if( 0 == db_num_rows( $t_result ) ) {