View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0005336 | mantisbt | bugtracker | public | 2005-03-13 10:57 | 2005-09-11 08:12 |
Reporter | stb | Assigned To | thraxisp | ||
Priority | normal | Severity | tweak | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | Linux | ||||
Product Version | 0.19.2 | ||||
Fixed in Version | 1.0.0rc2 | ||||
Summary | 0005336: Summary does not combine categories | ||||
Description | I have two different projects with same categories. In summary view (all projects) I see one line for each category and project ("by categories"). This lines should be combined. The links are the same, too. | ||||
Steps To Reproduce | create two projects "p1" and "p2", each having the category "cat_a". Enter a bug for each project in cat_a. Display summary. | ||||
Additional Information | Termine 1 0 0 1 This is an excerpt from my summary view ("by categories"). You can see 3 projects, each having 1 or 2 entries for category "Termine". The http-link behind those numbers are equal (which is correct, IMHO). The lines should be combined: Termine 4 0 0 4 | ||||
Tags | No tags attached. | ||||
Attached Files | summary_api.categories.php.txt (2,342 bytes)
function summary_helper_count_bugs( $query_part ) { $resolved_result = db_query( $query_part .' AND status='. RESOLVED ); $resolved_arr = db_fetch_array( $resolved_result ); list(, $resolved) = each( $resolved_arr ); $closed_result = db_query( $query_part .' AND status='. CLOSED ); $closed_arr = db_fetch_array( $closed_result ); list(, $closed) = each( $closed_arr ); $total_result = db_query( $query_part ); $total_arr = db_fetch_array( $total_result ); list(, $total) = each( $total_arr ); return Array( 'open' => $total - $closed - $resolved, 'resolved' => $resolved, 'closed' => $closed, 'total' => $total); } # -------------------- # print a bug count per category function summary_print_by_category() { $t_mantis_bug_table = config_get( 'mantis_bug_table' ); $t_mantis_project_table = config_get( 'mantis_project_table' ); $t_mantis_project_category_table = config_get( 'mantis_project_category_table' ); $t_summary_category_include_project = config_get( 'summary_category_include_project' ); $t_project_id = helper_get_current_project(); $t_user_id = auth_get_current_user_id(); $specific_where = helper_project_specific_where( $t_project_id ); if ( ' 1<>1' == $specific_where ) { return; } # Sum up the bugs in each category $query = "SELECT DISTINCT category FROM $t_mantis_project_category_table WHERE $specific_where ORDER BY category"; $category_result = db_query( $query ); # Start with empty category $category_row = array( "category" => "" ); do { extract( $category_row, EXTR_PREFIX_ALL, 'v' ); $query_part = "SELECT COUNT(id) FROM $t_mantis_bug_table WHERE $specific_where AND category='". db_prepare_string( $v_category )."'"; $bugs = summary_helper_count_bugs( $query_part ); $t_bug_link = '<a class="subtle" href="' . config_get( 'bug_count_hyperlink_prefix' ) . '&show_category=' . $v_category; summary_helper_print_row( $v_category, $t_bug_link. '&hide_status=' .RESOLVED. '">' .$bugs['open']. '</a>', $t_bug_link. '&show_status=' .RESOLVED. '&hide_status=' .CLOSED. '">' .$bugs['resolved']. '</a>', $t_bug_link. '&show_status=' .CLOSED. '&hide_status=">' .$bugs['closed']. '</a>', $t_bug_link. '&hide_status=">' .$bugs['total']. '</a>' ); } while ( $category_row = db_fetch_array( $category_result ) ); } | ||||
The configuration $g_summary_category_include_project will add the project name to the category. If the categories are really related to the same piece of work/code, you may want to look into the new sub=project feature in 1.0.0. The code is in CVs now. We can add a config variable to control this. Some people want to see, say, documentation for project a separated from documentation for project b. |
|
Suggestion: combine categories in summary when Why not combine categories in summary of that option is disabled (this is I expected)? I think Mantis should combine categories every time the user cannot distinguish them (project name missing). Please note, that the links are equal (getting me to all bugs of the given category), so the information displayed in the link line should be correlated to the link (sum of all bugs of this category over all projects). |
|
To solve this, modify the query in core/summary_api.php:summary_print_by_category(). Remove project_id from the query. |
|
I have made a new summary_print_by_category() function which combines the categories and is faster when there are not that many categories. |
|
Fixed in CVS. core/summary_api.php -> 1.41 |
|