From: <jl...@us...> - 2004-02-05 00:37:05
|
Update of /cvsroot/mantisbt/mantisbt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9880 Modified Files: print_all_bug_page.php print_all_bug_page_excel.php print_all_bug_page_word.php view_all_inc.php Log Message: Removed filtering code redundancy in print report pages (thanks to Lincoln Maskey) Index: print_all_bug_page.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/print_all_bug_page.php,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** print_all_bug_page.php 25 Jan 2004 10:34:08 -0000 1.72 --- print_all_bug_page.php 5 Feb 2004 00:34:37 -0000 1.73 *************** *** 45,204 **** print_header_redirect( 'view_all_set.php?type=0&print=1' ); } - - # Load preferences - $f_show_category = $t_setting_arr[1]; - $f_show_severity = $t_setting_arr[2]; - $f_show_status = $t_setting_arr[3]; - $f_per_page = $t_setting_arr[4]; $f_highlight_changed = $t_setting_arr[5]; - $f_hide_closed = $t_setting_arr[6]; - $f_reporter_id = $t_setting_arr[7]; - $f_handler_id = $t_setting_arr[8]; $f_sort = $t_setting_arr[9]; $f_dir = $t_setting_arr[10]; - $f_start_month = $t_setting_arr[11]; - $f_start_day = $t_setting_arr[12]; - $f_start_year = $t_setting_arr[13]; - $f_end_month = $t_setting_arr[14]; - $f_end_day = $t_setting_arr[15]; - $f_end_year = $t_setting_arr[16]; - $f_hide_resolved = $t_setting_arr[18]; - - # Clean input - $c_offset = (integer)$f_offset; - $c_user_id = (integer)$f_reporter_id; - $c_assign_id = (integer)$f_handler_id; - $c_per_page = (integer)$f_per_page; - $c_show_category = addslashes( $f_show_category ); - $c_show_severity = addslashes( $f_show_severity ); - $c_show_status = addslashes( $f_show_status ); - $c_search = addslashes( $f_search ); - $c_sort = addslashes( $f_sort ); - - if ( 'DESC' == $f_dir ) { - $c_dir = 'DESC'; - } else { - $c_dir = 'ASC'; - } - - # Limit reporters to only see their reported bugs - if ( ( ON == $g_limit_reporters ) && - ( !access_has_project_level( UPDATER ) ) ) { - $c_user_id = auth_get_current_user_id(); - } - - # Build our query string based on our viewing criteria - - $query = 'SELECT DISTINCT *, UNIX_TIMESTAMP(last_updated) as last_updated - FROM $g_mantis_bug_table'; - $t_project_id = helper_get_current_project( ); ! # project selection ! if ( ALL_PROJECTS == $t_project_id ) { # ALL projects ! $t_access_level = current_user_get_field( 'access_level' ); ! $t_user_id = auth_get_current_user_id(); ! ! $t_pub = VS_PUBLIC; ! $t_prv = VS_PRIVATE; ! $query2 = "SELECT DISTINCT(p.id) ! FROM $g_mantis_project_table p, $g_mantis_project_user_list_table u ! WHERE (p.enabled=1 AND ! p.view_state='$t_pub') OR ! (p.enabled=1 AND ! p.view_state='$t_prv' AND ! u.user_id='$t_user_id' AND ! u.project_id=p.id) ! ORDER BY p.name"; ! $result2 = db_query( $query2 ); ! $project_count = db_num_rows( $result2 ); ! ! if ( 0 == $project_count ) { ! $t_where_clause = ' WHERE 1=0'; ! } else { ! $t_where_clause = ' WHERE ('; ! for ( $i=0;$i<$project_count;$i++ ) { ! $row = db_fetch_array( $result2 ); ! extract( $row, EXTR_PREFIX_ALL, 'v' ); ! ! $t_where_clause .= "(project_id='$v_id')"; ! if ( $i < $project_count - 1 ) { ! $t_where_clause .= ' OR '; ! } ! } # end for ! $t_where_clause .= ')'; ! } ! } else { ! $t_where_clause = " WHERE project_id='$t_project_id'"; ! } ! # end project selection ! ! if ( $c_user_id != 'any' ) { ! $t_where_clause .= " AND reporter_id='$c_user_id'"; ! } ! ! if ( 'none' == $f_handler_id ) { ! $t_where_clause .= ' AND handler_id=0'; ! } else if ( $f_handler_id != 'any' ) { ! $t_where_clause .= " AND handler_id='$c_assign_id'"; ! } ! ! $t_closed_val = CLOSED; ! if ( ( 'on' == $f_hide_closed ) && ( $t_closed_val != $f_show_status ) ) { ! $t_where_clause = $t_where_clause." AND status<>'$t_closed_val'"; ! } ! ! $t_resolved_val = RESOLVED; ! if ( ( 'on' == $f_hide_resolved ) && ( $t_resolved_val != $f_show_status ) ) { ! $t_where_clause = $t_where_clause." AND status<>'$t_resolved_val'"; ! } ! ! if ( $f_show_category != 'any' ) { ! $t_where_clause = $t_where_clause." AND category='$c_show_category'"; ! } ! if ( $f_show_severity != 'any' ) { ! $t_where_clause = $t_where_clause." AND severity='$c_show_severity'"; ! } ! if ( $f_show_status != 'any' ) { ! $t_where_clause = $t_where_clause." AND status='$c_show_status'"; ! } ! ! # Simple Text Search - Thnaks to Alan Knowles ! if ( $f_search ) { ! $t_columns_clause = " $g_mantis_bug_table.*"; ! ! $t_where_clause .= " AND ((summary LIKE '%$c_search%') ! OR (description LIKE '%$c_search%') ! OR (steps_to_reproduce LIKE '%$c_search%') ! OR (additional_information LIKE '%$c_search%') ! OR ($g_mantis_bug_table.id LIKE '%$c_search%') ! OR ($g_mantis_bugnote_text_table.note LIKE '%$c_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"; ! } ! ! if ( is_blank( $c_sort ) ) { ! $c_sort='last_updated'; ! } ! $query = 'SELECT DISTINCT '.$t_columns_clause.', UNIX_TIMESTAMP(last_updated) as last_updated'; ! $query .= $t_from_clause; ! $query .= $t_where_clause; ! ! $query = $query." ORDER BY '$c_sort' $c_dir"; ! if ( $f_sort != 'priority' ) { ! $query = $query.', priority DESC'; ! } ! ! $query = $query." LIMIT $c_offset, $c_per_page"; ! ! # perform query ! $result = db_query( $query ); ! $row_count = db_num_rows( $result ); # for export --- 45,61 ---- print_header_redirect( 'view_all_set.php?type=0&print=1' ); } $f_highlight_changed = $t_setting_arr[5]; $f_sort = $t_setting_arr[9]; $f_dir = $t_setting_arr[10]; $t_project_id = helper_get_current_project( ); ! # This replaces the actual search that used to be here ! $f_page_number = gpc_get_int( 'page_number', 1 ); ! $t_per_page = null; ! $t_bug_count = null; ! $t_page_count = null; ! ! $result = filter_get_bug_rows( $t_page_number, $t_per_page, $t_page_count, $t_bug_count ); ! $row_count = sizeof( $result ); # for export *************** *** 217,220 **** --- 74,79 ---- <br /> + <?php filter_draw_selection_area( $f_page_number, false ); ?> + <form method="post" action="view_all_set.php"> <input type="hidden" name="type" value="1" /> *************** *** 225,309 **** <table class="width100"> - <tr> - <td class="print"> - <?php echo lang_get( 'search' ) ?> - </td> - <td class="print"> - <?php echo lang_get( 'reporter' ) ?> - </td> - <td class="print"> - <?php echo lang_get( 'assigned_to' ) ?> - </td> - <td class="print"> - <?php echo lang_get( 'category' ) ?> - </td> - <td class="print"> - <?php echo lang_get( 'severity' ) ?> - </td> - <td class="print"> - <?php echo lang_get( 'status' ) ?> - </td> - <td class="print"> - <?php echo lang_get( 'show' ) ?> - </td> - <td class="print"> - <?php echo lang_get( 'changed' ) ?> - </td> - <td class="print"> - <?php echo lang_get( 'hide_status' ) ?> - </td> - </tr> - <tr> - <td> - <input type="text" name="search" size="15" value="<?php echo $f_search; ?>" /> - </td> - <td> - <select name="reporter_id"> - <option value="any"><?php echo lang_get( 'any' ) ?></option> - <option value="any"></option> - <?php print_reporter_option_list( $f_reporter_id ) ?> - </select> - </td> - <td> - <select name="handler_id"> - <option value="any"><?php echo lang_get( 'any' ) ?></option> - <option value="none" <?php check_selected( $f_handler_id, 'none' ); ?>><?php echo lang_get( 'none' ) ?></option> - <option value="any"></option> - <?php print_assign_to_option_list( $f_handler_id ) ?> - </select> - </td> - <td> - <select name="show_category"> - <option value="any"><?php echo lang_get( 'any' ) ?></option> - <option value="any"></option> - <?php print_category_option_list( $f_show_category ) ?> - </select> - </td> - <td> - <select name="show_severity"> - <option value="any"><?php echo lang_get( 'any' ) ?></option> - <option value="any"></option> - <?php print_enum_string_option_list( 'severity', $f_show_severity ) ?> - </select> - </td> - <td> - <select name="show_status"> - <option value="any"><?php echo lang_get( 'any' ) ?></option> - <option value="any"></option> - <?php print_enum_string_option_list( 'status', $f_show_status ) ?> - </select> - </td> - <td> - <input type="text" name="per_page" size="3" maxlength="7" value="<?php echo $f_per_page ?>" /> - </td> - <td> - <input type="text" name="highlight_changed" size="3" maxlength="7" value="<?php echo $f_highlight_changed ?>" /> - </td> - <td> - <input type="checkbox" name="hide_resolved" <?php check_checked( $f_hide_resolved, 'on' ); ?> /> <?PHP echo lang_get( 'filter_resolved' ); ?> - <input type="checkbox" name="hide_closed" <?php check_checked( $f_hide_closed, 'on' ); ?> /> <?PHP echo lang_get( 'filter_closed' ); ?> - </td> - </tr> - <?php #<SQLI> Excel & Print export --- 84,87 ---- *************** *** 356,362 **** ?> </td> - <td class="right"> - <input type="submit" value="<?php echo lang_get( 'filter_button' ) ?>" /> - </td> </tr> <?php #<SQLI> ?> --- 134,137 ---- *************** *** 429,434 **** for( $i=0; $i < $row_count; $i++ ) { # prefix bug data with v_ ! $row = db_fetch_array( $result ); ! extract( $row, EXTR_PREFIX_ALL, 'v' ); $v_summary = string_display_links( $v_summary ); --- 204,208 ---- for( $i=0; $i < $row_count; $i++ ) { # prefix bug data with v_ ! extract( $result[$i], EXTR_PREFIX_ALL, 'v' ); $v_summary = string_display_links( $v_summary ); Index: print_all_bug_page_excel.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/print_all_bug_page_excel.php,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** print_all_bug_page_excel.php 11 Jan 2004 07:16:08 -0000 1.31 --- print_all_bug_page_excel.php 5 Feb 2004 00:34:37 -0000 1.32 *************** *** 54,264 **** } - # Load preferences - $f_show_category = $t_setting_arr[1]; - $f_show_severity = $t_setting_arr[2]; - $f_show_status = $t_setting_arr[3]; - $f_per_page = $t_setting_arr[4]; - $f_highlight_changed = $t_setting_arr[5]; - $f_hide_closed = $t_setting_arr[6]; - $f_reporter_id = $t_setting_arr[7]; - $f_handler_id = $t_setting_arr[8]; - $f_sort = $t_setting_arr[9]; - $f_dir = $t_setting_arr[10]; - $f_start_month = $t_setting_arr[11]; - $f_start_day = $t_setting_arr[12]; - $f_start_year = $t_setting_arr[13]; - $f_end_month = $t_setting_arr[14]; - $f_end_day = $t_setting_arr[15]; - $f_end_year = $t_setting_arr[16]; - $f_hide_resolved = $t_setting_arr[18]; - - # Clean input - $c_offset = (integer)$f_offset; - $c_user_id = (integer)$f_reporter_id; - $c_assign_id = (integer)$f_handler_id; - $c_per_page = (integer)$f_per_page; - $c_show_category = addslashes( $f_show_category ); - $c_show_severity = addslashes( $f_show_severity ); - $c_show_status = addslashes( $f_show_status ); - $c_search = addslashes( $f_search ); - $c_sort = addslashes( $f_sort ); - - if ( 'DESC' == $f_dir ) { - $c_dir = 'DESC'; - } else { - $c_dir = 'ASC'; - } - - # Limit reporters to only see their reported bugs - if ( ( ON == $g_limit_reporters ) && - ( !access_has_project_level( UPDATER ) ) ) { - $c_user_id = auth_get_current_user_id(); - } - - # Build our query string based on our viewing criteria - - $query = 'SELECT DISTINCT *, UNIX_TIMESTAMP(last_updated) as last_updated, UNIX_TIMESTAMP(date_submitted) as date_submitted - FROM $g_mantis_bug_table'; - - $t_project_id = helper_get_current_project(); - - # project selection - if ( ALL_PROJECTS == $t_project_id ) { # ALL projects - $t_access_level = current_user_get_field( 'access_level' ); - $t_user_id = auth_get_current_user_id(); - - $t_pub = VS_PUBLIC; - $t_prv = VS_PRIVATE; - $query2 = "SELECT DISTINCT( p.id ) - FROM $g_mantis_project_table p, $g_mantis_project_user_list_table u - WHERE (p.enabled=1 AND - p.view_state='$t_pub') OR - (p.enabled=1 AND - p.view_state='$t_prv' AND - u.user_id='$t_user_id' AND - u.project_id=p.id) - ORDER BY p.name"; - $result2 = db_query( $query2 ); - $project_count = db_num_rows( $result2 ); - - if ( 0 == $project_count ) { - $t_where_clause = ' WHERE 1=0'; - } else { - $t_where_clause = ' WHERE ('; - for ( $i=0;$i<$project_count;$i++ ) { - $row = db_fetch_array( $result2 ); - extract( $row, EXTR_PREFIX_ALL, 'v' ); - - $t_where_clause .= "(project_id='$v_id')"; - if ( $i < $project_count - 1 ) { - $t_where_clause .= ' OR '; - } - } # end for - $t_where_clause .= ')'; - } - } else { - $t_where_clause = " WHERE project_id='$t_project_id'"; - } - # end project selection - - if ( $f_reporter_id != 'any' ) { - $t_where_clause .= " AND reporter_id='$c_user_id'"; - } - - if ( 'none' == $f_handler_id ) { - $t_where_clause .= ' AND handler_id=0'; - } else if ( $f_handler_id != 'any' ) { - $t_where_clause .= " AND handler_id='$c_assign_id'"; - } - - $t_clo_val = CLOSED; - if ( ( 'on' == $f_hide_closed )&&( 'closed' != $f_show_status ) ) { - $t_where_clause = $t_where_clause." AND status<>'$t_clo_val'"; - } - - $t_resolved_val = RESOLVED; - if ( ( 'on' == $f_hide_resolved )&&( 'resolved' != $f_show_status ) ) { - $t_where_clause = $t_where_clause." AND status<>'$t_resolved_val'"; - } - - if ( $f_show_category != 'any' ) { - $t_where_clause = $t_where_clause." AND category='$c_show_category'"; - } - if ( $f_show_severity != 'any' ) { - $t_where_clause = $t_where_clause." AND severity='$c_show_severity'"; - } - if ( $f_show_status != 'any' ) { - $t_where_clause = $t_where_clause." AND status='$c_show_status'"; - } - - # Simple Text Search - Thnaks to Alan Knowles - if ( $f_search ) { - $t_columns_clause = " $g_mantis_bug_table.*"; - - $t_where_clause .= " AND ((summary LIKE '%$c_search%') - OR (description LIKE '%$c_search%') - OR (steps_to_reproduce LIKE '%$c_search%') - OR (additional_information LIKE '%$c_search%') - OR ($g_mantis_bug_table.id LIKE '%$c_search%') - OR ($g_mantis_bugnote_text_table.note LIKE '%$c_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"; - } - - if ( is_blank( $c_sort ) ) { - $c_sort='last_updated'; - } - $query = 'SELECT DISTINCT '.$t_columns_clause.', UNIX_TIMESTAMP(last_updated) as last_updated, UNIX_TIMESTAMP(date_submitted) as date_submitted'; - $query .= $t_from_clause; - $query .= $t_where_clause; - - $query = $query." ORDER BY '$c_sort' $c_dir"; - if ( $f_sort != 'priority' ) { - $query = $query.', priority DESC'; - } - - $query = $query." LIMIT $c_offset, $c_per_page"; - - # perform query - $result = db_query( $query ); - $row_count = db_num_rows( $result ); - #settings for choosing the fields to print # get the fields list $t_field_name_arr = get_field_names(); ! if ( $f_show_category != 'any' ) { ! $t_where_clause = $t_where_clause." AND category='$c_show_category'"; ! } ! if ( $f_show_severity != 'any' ) { ! $t_where_clause = $t_where_clause." AND severity='$c_show_severity'"; ! } ! if ( $f_show_status != 'any' ) { ! $t_where_clause = $t_where_clause." AND status='$c_show_status'"; ! } ! ! # Simple Text Search - Thnaks to Alan Knowles ! if ( $f_search ) { ! $t_columns_clause = " $g_mantis_bug_table.*"; ! ! $t_where_clause .= " AND ((summary LIKE '%$c_search%') ! OR (description LIKE '%$c_search%') ! OR (steps_to_reproduce LIKE '%$c_search%') ! OR (additional_information LIKE '%$c_search%') ! OR ($g_mantis_bug_table.id LIKE '%$c_search%') ! OR ($g_mantis_bugnote_text_table.note LIKE '%$c_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"; ! } ! ! if ( is_blank( $c_sort ) ) { ! $c_sort='last_updated'; ! } ! $query = 'SELECT DISTINCT '.$t_columns_clause.', UNIX_TIMESTAMP(last_updated) as last_updated, UNIX_TIMESTAMP(date_submitted) as date_submitted'; ! $query .= $t_from_clause; ! $query .= $t_where_clause; ! ! $query = $query." ORDER BY '$c_sort' $c_dir"; ! if ( $f_sort != 'priority' ) { ! $query = $query.', priority DESC'; ! } ! ! $query = $query." LIMIT $c_offset, $c_per_page"; ! ! # perform query ! $result = db_query( $query ); ! $row_count = db_num_rows( $result ); #settings for choosing the fields to print --- 54,69 ---- } #settings for choosing the fields to print # get the fields list $t_field_name_arr = get_field_names(); ! # This is where we used to do the entire actual filter ourselves ! $t_page_number = gpc_get_int( 'page_number', 1 ); ! $t_per_page = null; ! $t_bug_count = null; ! $t_page_count = null; ! ! $result = filter_get_bug_rows( $t_page_number, $t_per_page, $t_page_count, $t_bug_count ); ! $row_count = sizeof( $result ); #settings for choosing the fields to print *************** *** 324,330 **** # prefix bug data with v_ ! $row = db_fetch_array( $result ); ! ! extract( $row, EXTR_PREFIX_ALL, 'v' ); $t_last_updated = date( $g_short_date_format, $v_last_updated ); --- 129,133 ---- # prefix bug data with v_ ! extract( $result[$i], EXTR_PREFIX_ALL, 'v' ); $t_last_updated = date( $g_short_date_format, $v_last_updated ); Index: print_all_bug_page_word.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/print_all_bug_page_word.php,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** print_all_bug_page_word.php 11 Jan 2004 07:16:08 -0000 1.41 --- print_all_bug_page_word.php 5 Feb 2004 00:34:38 -0000 1.42 *************** *** 33,36 **** --- 33,37 ---- $f_export = gpc_get_string( 'export' ); $f_show_flag = gpc_get_bool( 'show_flag' ); + $t_project_id = helper_get_current_project( ); # word or html export *************** *** 55,213 **** } ! # Load preferences ! $f_show_category = $t_setting_arr[1]; ! $f_show_severity = $t_setting_arr[2]; ! $f_show_status = $t_setting_arr[3]; ! $f_per_page = $t_setting_arr[4]; ! $f_highlight_changed = $t_setting_arr[5]; ! $f_hide_closed = $t_setting_arr[6]; ! $f_reporter_id = $t_setting_arr[7]; ! $f_handler_id = $t_setting_arr[8]; ! $f_sort = $t_setting_arr[9]; ! $f_dir = $t_setting_arr[10]; ! $f_start_month = $t_setting_arr[11]; ! $f_start_day = $t_setting_arr[12]; ! $f_start_year = $t_setting_arr[13]; ! $f_end_month = $t_setting_arr[14]; ! $f_end_day = $t_setting_arr[15]; ! $f_end_year = $t_setting_arr[16]; ! $f_hide_resolved = $t_setting_arr[18]; ! ! # Clean input ! $c_offset = (integer)$f_offset; ! $c_user_id = (integer)$f_reporter_id; ! $c_assign_id = (integer)$f_handler_id; ! $c_per_page = (integer)$f_per_page; ! $c_show_category = addslashes( $f_show_category ); ! $c_show_severity = addslashes( $f_show_severity ); ! $c_show_status = addslashes( $f_show_status ); ! $c_search = addslashes( $f_search ); ! $c_sort = addslashes( $f_sort ); ! ! if ( 'DESC' == $f_dir ) { ! $c_dir = 'DESC'; ! } else { ! $c_dir = 'ASC'; ! } ! ! # Limit reporters to only see their reported bugs ! if ( ( ON == $g_limit_reporters ) && ! ( !access_has_project_level( UPDATER ) ) ) { ! $c_user_id = auth_get_current_user_id(); ! } ! ! # Build our query string based on our viewing criteria ! ! $query = 'SELECT DISTINCT *, UNIX_TIMESTAMP(last_updated) as last_updated, UNIX_TIMESTAMP(date_submitted) as date_submitted ! FROM $g_mantis_bug_table'; ! ! $t_project_id = helper_get_current_project(); ! ! # project selection ! if ( ALL_PROJECTS == $t_project_id ) { # ALL projects ! $t_access_level = current_user_get_field( 'access_level' ); ! $t_user_id = auth_get_current_user_id(); ! ! $t_pub = VS_PUBLIC; ! $t_prv = VS_PRIVATE; ! $query2 = "SELECT DISTINCT( p.id ) ! FROM $g_mantis_project_table p, $g_mantis_project_user_list_table u ! WHERE (p.enabled=1 AND ! p.view_state='$t_pub') OR ! (p.enabled=1 AND ! p.view_state='$t_prv' AND ! u.user_id='$t_user_id' AND ! u.project_id=p.id) ! ORDER BY p.name"; ! $result2 = db_query( $query2 ); ! $project_count = db_num_rows( $result2 ); ! ! if ( 0 == $project_count ) { ! $t_where_clause = ' WHERE 1=0'; ! } else { ! $t_where_clause = ' WHERE ('; ! for ( $i=0;$i<$project_count;$i++ ) { ! $row = db_fetch_array( $result2 ); ! extract( $row, EXTR_PREFIX_ALL, 'v' ); ! ! $t_where_clause .= "(project_id='$v_id')"; ! if ( $i < $project_count - 1 ) { ! $t_where_clause .= ' OR '; ! } ! } # end for ! $t_where_clause .= ')'; ! } ! } else { ! $t_where_clause = " WHERE project_id='$t_project_id'"; ! } ! # end project selection ! ! if ( $f_reporter_id != 'any' ) { ! $t_where_clause .= " AND reporter_id='$c_user_id'"; ! } ! ! if ( 'none' == $f_handler_id ) { ! $t_where_clause .= ' AND handler_id=0'; ! } else if ( $f_handler_id != 'any' ) { ! $t_where_clause .= " AND handler_id='$c_assign_id'"; ! } ! ! $t_clo_val = CLOSED; ! if ( ( 'on' == $f_hide_closed )&&( 'closed' != $f_show_status ) ) { ! $t_where_clause = $t_where_clause." AND status<>'$t_clo_val'"; ! } ! ! $t_resolved_val = RESOLVED; ! if ( ( 'on' == $f_hide_resolved )&&( 'resolved' != $f_show_status ) ) { ! $t_where_clause = $t_where_clause." AND status<>'$t_resolved_val'"; ! } ! ! if ( $f_show_category != 'any' ) { ! $t_where_clause = $t_where_clause." AND category='$c_show_category'"; ! } ! if ( $f_show_severity != 'any' ) { ! $t_where_clause = $t_where_clause." AND severity='$c_show_severity'"; ! } ! if ( $f_show_status != 'any' ) { ! $t_where_clause = $t_where_clause." AND status='$c_show_status'"; ! } ! ! # Simple Text Search - Thnaks to Alan Knowles ! if ( $f_search ) { ! $t_columns_clause = " $g_mantis_bug_table.*"; ! ! $t_where_clause .= " AND ((summary LIKE '%$c_search%') ! OR (description LIKE '%$c_search%') ! OR (steps_to_reproduce LIKE '%$c_search%') ! OR (additional_information LIKE '%$c_search%') ! OR ($g_mantis_bug_table.id LIKE '%$c_search%') ! OR ($g_mantis_bugnote_text_table.note LIKE '%$c_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"; ! } ! ! if ( is_blank( $c_sort ) ) { ! $c_sort='last_updated'; ! } ! $query = 'SELECT DISTINCT '.$t_columns_clause.', UNIX_TIMESTAMP(last_updated) as last_updated, UNIX_TIMESTAMP(date_submitted) as date_submitted'; ! $query .= $t_from_clause; ! $query .= $t_where_clause; ! ! $query = $query." ORDER BY '$c_sort' $c_dir"; ! if ( $f_sort != 'priority' ) { ! $query = $query.', priority DESC'; ! } ! ! $query = $query." LIMIT $c_offset, $c_per_page"; ! ! # perform query ! $result = db_query( $query ); ! $row_count = db_num_rows( $result ); ?> --- 56,67 ---- } ! # This is where we used to do the entire actual filter ourselves ! $t_page_number = gpc_get_int( 'page_number', 1 ); ! $t_per_page = null; ! $t_bug_count = null; ! $t_page_count = null; ! ! $result = filter_get_bug_rows( $t_page_number, $t_per_page, $t_page_count, $t_bug_count ); ! $row_count = sizeof( $result ); ?> *************** *** 237,243 **** # prefix bug data with v_ ! $row = db_fetch_array( $result ); - extract( $row, EXTR_PREFIX_ALL, 'v' ); $t_last_updated = date( $g_short_date_format, $v_last_updated ); --- 91,96 ---- # prefix bug data with v_ ! extract( $result[$j], EXTR_PREFIX_ALL, 'v' ); $t_last_updated = date( $g_short_date_format, $v_last_updated ); Index: view_all_inc.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/view_all_inc.php,v retrieving revision 1.130 retrieving revision 1.131 diff -C2 -d -r1.130 -r1.131 *** view_all_inc.php 11 Jan 2004 07:16:08 -0000 1.130 --- view_all_inc.php 5 Feb 2004 00:34:38 -0000 1.131 *************** *** 30,172 **** ?> <?php # -- ====================== FILTER FORM ========================= -- ?> ! <br /> ! <form method="post" action="view_all_set.php?f=3"> ! <input type="hidden" name="type" value="1" /> ! <input type="hidden" name="sort" value="<?php echo $t_sort ?>" /> ! <input type="hidden" name="dir" value="<?php echo $t_dir ?>" /> ! <input type="hidden" name="page_number" value="<?php echo $f_page_number ?>" /> ! <input type="hidden" name="per_page" value="<?php echo $t_filter['per_page'] ?>" /> ! <table class="width100" cellspacing="0"> ! <?php # -- Filter Form Header Row -- ?> ! <tr class="row-category2"> ! <td class="small-caption"><?php echo lang_get( 'reporter' ) ?></td> ! <td class="small-caption"><?php echo lang_get( 'assigned_to' ) ?></td> ! <td class="small-caption"><?php echo lang_get( 'category' ) ?></td> ! <td class="small-caption"><?php echo lang_get( 'severity' ) ?></td> ! <td class="small-caption"><?php echo lang_get( 'status' ) ?></td> ! <td class="small-caption"><?php echo lang_get( 'show' ) ?></td> ! <td class="small-caption"><?php echo lang_get( 'changed' ) ?></td> ! <td class="small-caption"><?php echo lang_get( 'hide_status' ) ?></td> ! </tr> ! <?php # -- Filter Form Fields -- ?> ! <tr> ! <?php # -- Reporter -- ?> ! <td> ! <select name="reporter_id"> ! <option value="any"><?php echo lang_get( 'any' ) ?></option> ! <option value="any"></option> ! <?php print_reporter_option_list( $t_filter['reporter_id'] ) ?> ! </select> ! </td> ! ! <?php # -- Handler -- ?> ! <td> ! <select name="handler_id"> ! <option value="any"><?php echo lang_get( 'any' ) ?></option> ! <option value="none" <?php check_selected( $t_filter['handler_id'], 'none' ); ?>><?php echo lang_get( 'none' ) ?></option> ! <option value="any"></option> ! <?php print_assign_to_option_list( $t_filter['handler_id'] ) ?> ! </select> ! </td> ! ! <?php # -- Category -- ?> ! <td> ! <select name="show_category"> ! <option value="any"><?php echo lang_get( 'any' ) ?></option> ! <option value="any"></option> ! <?php # This shows orphaned categories as well as selectable categories ?> ! <?php print_category_complete_option_list( $t_filter['show_category'] ) ?> ! </select> ! </td> ! ! <?php # -- Severity -- ?> ! <td> ! <select name="show_severity"> ! <option value="any"><?php echo lang_get( 'any' ) ?></option> ! <option value="any"></option> ! <?php print_enum_string_option_list( 'severity', $t_filter['show_severity'] ) ?> ! </select> ! </td> ! ! <?php # -- Status -- ?> ! <td> ! <select name="show_status"> ! <option value="any"><?php echo lang_get( 'any' ) ?></option> ! <option value="any"></option> ! <?php print_enum_string_option_list( 'status', $t_filter['show_status'] ) ?> ! </select> ! </td> ! ! <?php # -- Number of bugs per page -- ?> ! <td> ! <input type="text" name="per_page" size="3" maxlength="7" value="<?php echo $t_filter['per_page'] ?>" /> ! </td> ! ! <?php # -- Highlight changed bugs -- ?> ! <td> ! <input type="text" name="highlight_changed" size="3" maxlength="7" value="<?php echo $t_filter['highlight_changed'] ?>" /> ! </td> ! ! <?php # -- Hide closed bugs -- ?> ! <td> ! <input type="checkbox" name="hide_resolved" <?php check_checked( $t_filter['hide_resolved'], 'on' ); ?> /> <?php echo lang_get( 'filter_resolved' ); ?> ! <input type="checkbox" name="hide_closed" <?php check_checked( $t_filter['hide_closed'], 'on' ); ?> /> <?php echo lang_get( 'filter_closed' ); ?> ! </td> ! </tr> ! ! ! <?php # -- Search and Date Header Row -- ?> ! <tr class="row-category2"> ! <td class="small-caption" colspan="2"><?php echo lang_get( 'search' ) ?></td> ! <td class="small-caption" colspan="2"><!--Start Date--></td> ! <td class="small-caption" colspan="2"><!--End Date--></td> ! <td class="small-caption" colspan="2"> </td> ! </tr> ! ! ! <?php # -- Search and Date fields -- ?> ! <tr> ! <?php # -- Text search -- ?> ! <td colspan="2"> ! <input type="text" size="16" name="search" value="<?php echo $t_filter['search']; ?>" /> ! </td> ! ! <?php # -- Start date -- ?> ! <td class="left" colspan="2"> ! <!-- ! <select name="start_month"> ! <?php print_month_option_list( $t_filter['start_month'] ) ?> ! </select> ! <select name="start_day"> ! <?php print_day_option_list( $t_filter['start_day'] ) ?> ! </select> ! <select name="start_year"> ! <?php print_year_option_list( $t_filter['start_year'] ) ?> ! </select> ! --> ! </td> ! ! <?php # -- End date -- ?> ! <td class="left" colspan="2"> ! <!-- ! <select name="end_month"> ! <?php print_month_option_list( $t_filter['end_month'] ) ?> ! </select> ! <select name="end_day"> ! <?php print_day_option_list( $t_filter['end_day'] ) ?> ! </select> ! <select name="end_year"> ! <?php print_year_option_list( $t_filter['end_year'] ) ?> ! </select> ! --> ! </td> ! ! <?php # -- SUBMIT button -- ?> ! <td class="right" colspan="2"> ! <input type="submit" name="filter" value="<?php echo lang_get( 'filter_button' ) ?>" /> ! </td> ! </tr> ! </table> ! </form> <?php # -- ====================== end of FILTER FORM ========================= -- ?> --- 30,34 ---- ?> <?php # -- ====================== FILTER FORM ========================= -- ?> ! <?php filter_draw_selection_area( $f_page_number ); ?> <?php # -- ====================== end of FILTER FORM ========================= -- ?> |