View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004497 | mantisbt | filters | public | 2004-09-07 02:46 | 2004-11-06 05:59 |
Reporter | jwolfgarten | Assigned To | DGtlRift | ||
Priority | normal | Severity | feature | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Fixed in Version | 0.19.1 | ||||
Summary | 0004497: Add filter for priority | ||||
Description | It would be very nice if one could filter the priority field. Or did I miss something? | ||||
Tags | No tags attached. | ||||
Attached Files | mantisbt.4497.filterpriority.txt (10,169 bytes)
Index: view_all_set.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/view_all_set.php,v retrieving revision 1.37 diff -u -r1.37 view_all_set.php --- view_all_set.php 6 Aug 2004 15:38:38 -0000 1.37 +++ view_all_set.php 27 Oct 2004 00:57:44 -0000 @@ -99,6 +99,15 @@ $f_fixed_in_version = array( $f_fixed_in_version ); } + $f_show_priority = array(); + if ( is_array( gpc_get( 'show_priority', null ) ) ) { + $f_show_priority = gpc_get_string_array( 'show_priority', 'any' ); + } else { + $f_show_priority = gpc_get_string( 'show_priority', 'any' ); + $f_show_priority = array( $f_show_priority ); + } + + $f_user_monitor = array(); if ( is_array( gpc_get( 'user_monitor', null ) ) ) { $f_user_monitor = gpc_get_string_array( 'user_monitor', 'any' ); @@ -257,6 +266,7 @@ $t_setting_arr['show_version'] = $f_show_version; $t_setting_arr['do_filter_by_date'] = $f_do_filter_by_date; $t_setting_arr['fixed_in_version'] = $f_fixed_in_version; + $t_setting_arr['show_priority'] = $f_show_priority; $t_setting_arr['user_monitor'] = $f_user_monitor; $t_setting_arr['view_state'] = $f_view_state; $t_setting_arr['custom_fields'] = $f_custom_fields_data; @@ -289,6 +299,7 @@ $t_setting_arr['handler_id'] = array( "any" ); $t_setting_arr['show_build'] = array( "any" ); $t_setting_arr['show_version'] = array( "any" ); + $t_setting_arr['show_priority'] = array( "any" ); $t_setting_arr['fixed_in_version'] = array( "any" ); $t_setting_arr['user_monitor'] = array( "any" ); @@ -344,4 +355,4 @@ } else { print_header_redirect( $t_redirect_url ); } -?> \ No newline at end of file +?> Index: view_filters_page.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/view_filters_page.php,v retrieving revision 1.21 diff -u -r1.21 view_filters_page.php --- view_filters_page.php 12 Sep 2004 11:54:07 -0000 1.21 +++ view_filters_page.php 27 Oct 2004 00:57:44 -0000 @@ -263,7 +263,8 @@ </td> <td class="small-caption" colspan="<?php echo ( 1 * $t_custom_cols ); ?>"><?php echo lang_get( 'product_build' ) ?></td> <td class="small-caption" colspan="<?php echo ( 2 * $t_custom_cols ); ?>"><?php echo lang_get( 'product_version' ) ?></td> - <td class="small-caption" colspan="<?php echo ( 2 * $t_custom_cols ); ?>"><?php echo lang_get( 'fixed_in_version' ) ?></td> + <td class="small-caption" colspan="<?php echo ( 1 * $t_custom_cols ); ?>"><?php echo lang_get( 'fixed_in_version' ) ?></td> + <td class="small-caption" colspan="<?php echo ( 1 * $t_custom_cols ); ?>"><?php echo lang_get( 'priority' ) ?></td> </tr> <tr class="row-1"> <!-- Status --> @@ -307,13 +308,21 @@ </select> </td> <!-- Fixed in Version --> - <td valign="top" colspan="<?php echo ( 2 * $t_custom_cols ); ?>"> + <td valign="top" colspan="<?php echo ( 1 * $t_custom_cols ); ?>"> <select <?php PRINT $t_select_modifier;?> name="fixed_in_version[]"> <option value="any" <?php check_selected( $t_filter['fixed_in_version'], 'any' ); ?>><?php echo lang_get( 'any' ) ?></option> <option value="any"></option> <?php print_version_option_list( $t_filter['fixed_in_version'], null, VERSION_ALL ) ?> </select> </td> + <!-- Priority --> + <td valign="top" colspan="<?php echo ( 1 * $t_custom_cols ); ?>"> + <select <?php PRINT $t_select_modifier;?> name="show_priority[]"> + <option value="any" <?php check_selected( $t_filter['show_priority'], 'any' ); ?>><?php echo lang_get( 'any' ) ?></option> + <option value="any"></option> + <?php print_enum_string_option_list( 'priority', $t_filter['show_priority'] ) ?> + </select> + </td> </tr> <tr class="row-category2"> Index: core/filter_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/filter_api.php,v retrieving revision 1.59 diff -u -r1.59 filter_api.php --- core/filter_api.php 1 Oct 2004 02:41:25 -0000 1.59 +++ core/filter_api.php 27 Oct 2004 00:57:46 -0000 @@ -293,6 +293,27 @@ array_push( $t_where_clauses, '('. implode( ' OR ', $t_clauses ) .')' ); } + # priority + $t_any_found = false; + foreach( $t_filter['show_priority'] as $t_filter_member ) { + if ( 'any' == $t_filter_member ) { + $t_any_found = true; + } + } + if ( count( $t_filter['show_priority'] ) == 0 ) { + $t_any_found = true; + } + if ( !$t_any_found ) { + $t_clauses = array(); + + foreach( $t_filter['show_priority'] as $t_filter_member ) { + $c_show_priority = db_prepare_int( $t_filter_member ); + array_push( $t_clauses, "($t_bug_table.priority='$c_show_priority')" ); + } + array_push( $t_where_clauses, '('. implode( ' OR ', $t_clauses ) .')' ); + } + + # product build $t_any_found = false; foreach( $t_filter['show_build'] as $t_filter_member ) { @@ -654,13 +675,14 @@ $t_tdclass = 'small-caption'; $t_trclass = 'row-category2'; $t_action = 'view_all_set.php?f=3'; - + if ( $p_for_screen == false ) { $t_tdclass = 'print'; $t_trclass = ''; $t_action = 'view_all_set.php'; } -?> +?> + <br /> <form method="post" name="filters" action="<?php PRINT $t_action; ?>"> <input type="hidden" name="type" value="5" /> @@ -675,7 +697,7 @@ <input type="hidden" name="page_number" value="<?php PRINT $p_page_number ?>" /> <input type="hidden" name="view_type" value="<?php PRINT $t_view_type ?>" /> <table class="width100" cellspacing="1"> - + <?php if ( $p_expanded ) { $t_filter_cols = 7; @@ -967,9 +989,12 @@ <td colspan="2" class="small-caption" valign="top"> <a href="<?php PRINT $t_filters_url . 'show_version[]'; ?>"><?php PRINT lang_get( 'product_version' ) ?>:</a> </td> - <td colspan="2" class="small-caption" valign="top"> + <td colspan="1" class="small-caption" valign="top"> <a href="<?php PRINT $t_filters_url . 'fixed_in_version[]'; ?>"><?php PRINT lang_get( 'fixed_in_version' ) ?>:</a> </td> + <td colspan="1" class="small-caption" valign="top"> + <a href="<?php PRINT $t_filters_url . 'show_priority[]'; ?>"><?php PRINT lang_get( 'priority' ) ?>:</a> + </td> </tr> <tr class="row-1"> @@ -1097,7 +1122,7 @@ } ?> </td> - <td colspan="2" class="small-caption" valign="top"> + <td colspan="1" class="small-caption" valign="top"> <?php $t_output = ''; $t_any_found = false; @@ -1127,6 +1152,36 @@ } ?> </td> + <td colspan="1" class="small-caption" valign="top"> + <?php + $t_output = ''; + $t_any_found = false; + if ( count( $t_filter['show_priority'] ) == 0 ) { + PRINT lang_get( 'any' ); + } else { + $t_first_flag = true; + foreach( $t_filter['show_priority'] as $t_current ) { + $t_this_string = ''; + if ( ( $t_current == 'any' ) || ( is_blank( $t_current ) ) ) { + $t_any_found = true; + } else { + $t_this_string = get_enum_element( 'priority', $t_current ); + } + if ( $t_first_flag != true ) { + $t_output = $t_output . '<br>'; + } else { + $t_first_flag = false; + } + $t_output = $t_output . $t_this_string; + } + if ( true == $t_any_found ) { + PRINT lang_get( 'any' ); + } else { + PRINT $t_output; + } + } + ?> + </td> </tr> <tr <?php PRINT "class=\"" . $t_trclass . "\""; ?>> @@ -1709,6 +1764,7 @@ 'reporter_id' => 'int', 'handler_id' => 'string', 'show_resolution' => 'int', + 'show_priority' => 'int', 'show_build' => 'string', 'show_version' => 'string', 'hide_status' => 'int', | ||||