Skip to content

Commit

Permalink
Modified search to look in bugnotes.
Browse files Browse the repository at this point in the history
git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@934 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
Kenzaburo Ito committed May 11, 2002
1 parent b0f29b7 commit 17005d9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
1 change: 1 addition & 0 deletions doc/ChangeLog
Expand Up @@ -52,6 +52,7 @@ Mantis
* Modified project user module behavior.
* Modified delete file attachments to chmod( 0775 ) so write permissions are granted.
* Modified get_view_redirect_url() call on bug_assign.php to handle redirects better.
* Modified search to look in bugnotes.
* Added Hungarian translation.
* Added Japanese translation.
* Added Czech translation.
Expand Down
26 changes: 20 additions & 6 deletions view_all_bug_page.php
Expand Up @@ -137,23 +137,37 @@
# Simple Text Search - Thnaks to Alan Knowles
if ( $f_search ) {
$t_columns_clause = " $g_mantis_bug_table.*";
$t_from_clause = " FROM $g_mantis_bug_table, $g_mantis_bug_text_table";
$t_where_clause .= " AND ((summary LIKE '%".addslashes($f_search)."%') OR
/*$t_where_clause .= " AND ((summary LIKE '%".addslashes($f_search)."%') OR
(description LIKE '%".addslashes($f_search)."%') OR
(steps_to_reproduce LIKE '%".addslashes($f_search)."%') OR
(additional_information LIKE '%".addslashes($f_search)."%') OR
($g_mantis_bugnote_text_table.note LIKE '%".addslashes($f_search)."%')) OR
($g_mantis_bug_table.id LIKE '%".addslashes($f_search)."%')) AND
$g_mantis_bug_text_table.id = $g_mantis_bug_table.bug_text_id";
$g_mantis_bug_text_table.id = $g_mantis_bug_table.bug_text_id ";*/

$t_where_clause .= " AND ((summary LIKE '%".addslashes($f_search)."%')
OR (description LIKE '%".addslashes($f_search)."%')
OR (steps_to_reproduce LIKE '%".addslashes($f_search)."%')
OR (additional_information LIKE '%".addslashes($f_search)."%')
OR ($g_mantis_bug_table.id LIKE '%".addslashes($f_search)."%')
OR ($g_mantis_bugnote_text_table.note LIKE '%".addslashes($f_search)."%'))
AND $g_mantis_bug_text_table.id = $g_mantis_bug_table.bug_text_id";


$t_from_clause = " FROM $g_mantis_bug_table, $g_mantis_bug_text_table
LEFT JOIN $g_mantis_bugnote_table ON $g_mantis_bugnote_table.bug_id = $g_mantis_bug_table.id
LEFT JOIN $g_mantis_bugnote_text_table ON $g_mantis_bugnote_text_table.id = $g_mantis_bugnote_table.bugnote_text_id ";

} else {
$t_columns_clause = " *";
$t_from_clause = " FROM $g_mantis_bug_table";
}

# Get the total number of bugs that meet the criteria.
$query3 = "SELECT count(*) " . $t_from_clause . $t_where_clause;
$query3 = "SELECT COUNT( DISTINCT ( $g_mantis_bug_table.id ) ) as count " . $t_from_clause . $t_where_clause;
$result3 = db_query( $query3 );
$row = db_fetch_array( $result3 );
$t_query_count = $row['count(*)'];
$t_query_count = $row['count'];

# Guard against silly values of $f_per_page.
if ( 0 == $f_per_page ) {
Expand All @@ -176,7 +190,7 @@
$f_page_number = $t_page_count;
}

$query = "SELECT ".$t_columns_clause.", UNIX_TIMESTAMP(last_updated) as last_updated";
$query = "SELECT DISTINCT ".$t_columns_clause.", UNIX_TIMESTAMP(last_updated) as last_updated";
$query .= $t_from_clause;
$query .= $t_where_clause;

Expand Down

0 comments on commit 17005d9

Please sign in to comment.