? mantis.patch ? core/view_columns_api.php Index: config_defaults_inc.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/config_defaults_inc.php,v retrieving revision 1.168 diff -u -r1.168 config_defaults_inc.php --- config_defaults_inc.php 27 May 2004 22:09:20 -0000 1.168 +++ config_defaults_inc.php 7 Jun 2004 01:10:59 -0000 @@ -944,6 +944,7 @@ $g_mantis_custom_field_string_table = $g_db_table_prefix.'_custom_field_string_table'; $g_mantis_upgrade_table = $g_db_table_prefix.'_upgrade_table'; $g_mantis_filters_table = $g_db_table_prefix.'_filters_table'; + $g_mantis_view_columns_table = $g_db_table_prefix.'_view_columns_table'; $g_mantis_sponsorship_table = $g_db_table_prefix.'_sponsorship_table'; ########################### Index: view_all_inc.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/view_all_inc.php,v retrieving revision 1.141 diff -u -r1.141 view_all_inc.php --- view_all_inc.php 26 May 2004 05:25:18 -0000 1.141 +++ view_all_inc.php 7 Jun 2004 01:10:59 -0000 @@ -17,7 +17,9 @@ require_once( $t_core_path.'string_api.php' ); require_once( $t_core_path.'date_api.php' ); require_once( $t_core_path.'icon_api.php' ); - + require_once( $t_core_path.'view_columns_api.php' ); +?> + - - - - - - - -"; - print_view_bug_sort_link( sponsorship_get_currency(), 'sponsorship_total', $t_sort, $t_dir ); - print_sort_icon( $t_dir, $t_sort, 'sponsorship_total' ); - echo "\n"; - } - - # -- Bugnote count column -- -?> - -"; - echo ''; - echo "\n"; - } -?> - - - - - - - + - + + + + + - - - - - - -"; - if ( $v_sponsorship_total > 0 ) { - echo sponsorship_format_amount( $v_sponsorship_total ); - } - echo "\n"; - } -?> - -"; - if ( 0 < $t_attachment_count ) { - echo ''; - echo '' . lang_get( 'attachment_alt' ) . ''; - echo ''; - } else { - echo '   '; - } - echo "\n"; - } -?> - - - - - - - + - - - + +
- "> + + 0 ) { $v_start = $t_filter['per_page'] * ($f_page_number-1) +1; $v_end = $v_start + sizeof( $rows ) -1; @@ -80,7 +79,7 @@ ?> +
    #
   
" , $v_id ); - } else { - echo " "; - } - ?> '; - echo '' . lang_get( 'update_bug_button' ) . ''; - } else { - echo ' '; - } - ?> 0 ) { - $t_bugnote_link = '' - . $bugnote_count . ''; - - if ( $v_bugnote_updated > strtotime( '-'.$t_filter['highlight_changed'].' hours' ) ) { - printf( '%s', $t_bugnote_link ); - } else { - echo $t_bugnote_link; - } - } else { - echo ' '; - } - ?> ['; - print_view_bug_sort_link( $project_name, 'project_id', $t_sort, $t_dir ); - echo ']
'; - } - - echo string_display( $v_category ); - ?>
%s' - , get_enum_element( 'resolution', $v_resolution ) - , get_enum_element( 'status', $v_status ) - ); - - # print username instead of status - if ( ON == config_get( 'show_assigned_names' ) - && $v_handler_id > 0 ) { - echo ' ('; - print_user( $v_handler_id ); - echo ')'; - } - ?> strtotime( '-'.$t_filter['highlight_changed'].' hours' ) ) { - printf( '%s', $t_last_updated ); - } else { - echo $t_last_updated; - } - ?> ' - , $t_icon_path . 'protected.gif' - , lang_get( 'private' ) - , lang_get( 'private' ) - ); - } - ?>
+ @@ -360,12 +114,14 @@ } ?> - - - - + + + + + +
Index: view_all_set.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/view_all_set.php,v retrieving revision 1.31 diff -u -r1.31 view_all_set.php --- view_all_set.php 18 May 2004 19:32:58 -0000 1.31 +++ view_all_set.php 7 Jun 2004 01:11:00 -0000 @@ -280,11 +280,24 @@ $t_setting_arr['custom_fields'] = $t_custom_fields_data; break; - # Just set the search string value - case '5': - $t_setting_arr['search'] = $f_search; - - break; + case '5': + $t_setting_arr['search'] = $f_search; + + break; + + # Change column view + case '6': + $t_view_columns_string = view_columns_db_get_view_columns( $f_view_query_id ); + # If we can use the query that we've requested, + # grab it. We will overwrite the current one at the + # bottom of this page + if ( $t_view_columns_string != null ) { + $t_cookie_detail = explode( '#', $t_view_columns_string, 2 ); + $t_setting_arr = unserialize( $t_cookie_detail[1] ); + + break; + } + break; # does nothing. catch all case default: break; Index: core/current_user_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/current_user_api.php,v retrieving revision 1.17 diff -u -r1.17 current_user_api.php --- core/current_user_api.php 8 Apr 2004 22:44:59 -0000 1.17 +++ core/current_user_api.php 7 Jun 2004 01:11:00 -0000 @@ -12,6 +12,7 @@ $t_core_dir = dirname( __FILE__ ).DIRECTORY_SEPARATOR; require_once( $t_core_dir . 'filter_api.php' ); + require_once( $t_core_dir . 'view_columns_api.php' ); ### Current User API ### @@ -111,4 +112,33 @@ return $t_filter; } + + # -------------------- + # return the bug column format parameters for the current user + # this could be modified to call a user_api function to get the + # filter out of a db or whatever + # This is a modified version of current_user_get_bug_filter + function current_user_get_bug_view_columns() { + # check to see if new cookie is needed + if ( !view_columns_is_cookie_valid() ) { + PRINT "\n"; + return false; + } + + $f_view_columns_string = gpc_get_string( 'view_columns', '' ); + $t_view_all_cookie = ''; + $t_cookie_detail = ''; + $t_view_columns = ''; + + if ( '' != $f_view_columns_string ) { + $t_view_columns = unserialize( $f_view_columns_string ); + } else { + $t_view_all_cookie_id = gpc_get_cookie( config_get( 'view_all_cookie' ), '' ); + $t_view_all_cookie = view_columns_db_get_view_columns( $t_view_all_cookie_id ); + $t_cookie_detail = explode( '#', $t_view_all_cookie, 2 ); + $t_view_columns = unserialize( $t_cookie_detail[1] ); + } + + return $t_view_columns; + } ?> Index: core/filter_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/filter_api.php,v retrieving revision 1.37 diff -u -r1.37 filter_api.php --- core/filter_api.php 28 May 2004 06:11:58 -0000 1.37 +++ core/filter_api.php 7 Jun 2004 01:11:01 -0000 @@ -407,7 +407,7 @@ $t_from_clauses = array( $t_bug_text_table, $t_project_table ); - array_push( $t_join_clauses, ",($t_bug_table LEFT JOIN $t_bugnote_table ON $t_bugnote_table.bug_id = $t_bug_table.id)" ); + array_push( $t_join_clauses, ",$t_bug_table LEFT JOIN $t_bugnote_table ON $t_bugnote_table.bug_id = $t_bug_table.id" ); array_push( $t_join_clauses, "LEFT JOIN $t_bugnote_text_table ON $t_bugnote_text_table.id = $t_bugnote_table.bugnote_text_id" ); } else { Index: lang/strings_english.txt =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/lang/strings_english.txt,v retrieving revision 1.176 diff -u -r1.176 strings_english.txt --- lang/strings_english.txt 26 May 2004 04:45:08 -0000 1.176 +++ lang/strings_english.txt 7 Jun 2004 01:11:02 -0000 @@ -865,6 +865,9 @@ $s_open_queries = 'Manage Filters'; $s_query_delete_msg = 'Are you sure you wish to delete this query?'; +# stored column views strings +$s_switch_view_query = 'Switch View'; + # view_bug_advanced_page.php $s_view_simple_link = 'View Simple'; $s_viewing_bug_advanced_details_title = 'Viewing Issue Advanced Details';