From f2cda93141b6e05754c5f90bc9171d38e9727f45 Mon Sep 17 00:00:00 2001 From: Gianluca Sforna Date: Tue, 31 Jul 2007 22:55:04 +0000 Subject: [PATCH] Fix 8208: Most popular bug table on summary page git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@4517 f5dc347c-c33d-0410-90a0-b07cc1902cb9 --- core/summary_api.php | 43 ++++++++++++++++++++++++++++++++++++++-- lang/strings_english.txt | 10 ++++++---- summary_page.php | 13 +++++++++++- 3 files changed, 59 insertions(+), 7 deletions(-) diff --git a/core/summary_api.php b/core/summary_api.php index 22f3170654..c457946dde 100644 --- a/core/summary_api.php +++ b/core/summary_api.php @@ -6,7 +6,7 @@ # See the README and LICENSE files for details # -------------------------------------------------------- - # $Id: summary_api.php,v 1.49 2007-07-16 08:23:39 giallu Exp $ + # $Id: summary_api.php,v 1.50 2007-07-31 22:55:03 giallu Exp $ # -------------------------------------------------------- ### Summary printing API ### @@ -221,7 +221,6 @@ function summary_resolved_bug_count_by_date( $p_time_length = 1 ) { ON b.id = h.bug_id AND h.type = " . NORMAL_TYPE ." AND h.field_name = 'status' - AND h.new_value = '$t_resolved' WHERE b.status >= '$t_resolved' AND ".db_helper_compare_days(db_now(),"date_modified","<= '$c_time_length'")." AND $specific_where"; @@ -271,6 +270,46 @@ function summary_print_by_date( $p_date_array ) { print( "\n" ); } # end foreach } + + + # Print list of open bugs with the highest activity score + # the score is calculated assigning one "point" for each history event + # associated with the bug + function summary_print_by_activity() { + $t_mantis_bug_table = config_get( 'mantis_bug_table' ); + $t_mantis_history_table = config_get( 'mantis_bug_history_table' ); + + $t_project_id = helper_get_current_project(); + $t_user_id = auth_get_current_user_id(); + $t_resolved = config_get( 'bug_resolved_status_threshold' ); + + $specific_where = helper_project_specific_where( $t_project_id ); + if ( ' 1<>1' == $specific_where ) { + return; + } + $query = "SELECT COUNT(h.id) as count, b.id, b.summary + FROM $t_mantis_bug_table AS b, $t_mantis_history_table AS h + WHERE h.bug_id = b.id + AND b.status < $t_resolved + AND $specific_where + GROUP BY h.bug_id + ORDER BY count DESC, b.last_updated DESC"; + $result = db_query( $query ); + + $t_count = 0; + while ( $row = db_fetch_array( $result ) ) { + if ( $t_count++ == 10 ) break; + $t_bugid = string_get_bug_view_link( $row['id'] ); + $t_summary = $row['summary']; + $t_notescount = $row['count']; + + print "\n"; + print "$t_bugid - $t_summary$t_notescount\n"; + print "\n"; + } + } + + # -------------------- # print bug counts by assigned to each developer function summary_print_by_developer() { diff --git a/lang/strings_english.txt b/lang/strings_english.txt index 0ea00f4749..5bc1a5b9de 100644 --- a/lang/strings_english.txt +++ b/lang/strings_english.txt @@ -11,11 +11,11 @@ ########################################################################### # English strings for Mantis (source language for translations) # ------------------------------------------------- - # $Revision: 1.307 $ - # $Author: zakman $ - # $Date: 2007-07-31 20:28:49 $ + # $Revision: 1.308 $ + # $Author: giallu $ + # $Date: 2007-07-31 22:55:04 $ # - # $Id: strings_english.txt,v 1.307 2007-07-31 20:28:49 zakman Exp $ + # $Id: strings_english.txt,v 1.308 2007-07-31 22:55:04 giallu Exp $ ########################################################################### ?> @@ -1070,6 +1070,8 @@ $s_percentage_errors = '% False'; $s_errors = 'False'; $s_total = 'Total'; $s_balance = 'Balance'; +$s_most_active = 'Most Active'; +$s_score = 'Score'; $s_time_stats = 'Time Stats For Resolved Issues (days)'; $s_longest_open_bug = 'Longest open issue'; $s_longest_open = 'Longest open'; diff --git a/summary_page.php b/summary_page.php index ba3c4f7bc8..342b7a31fa 100644 --- a/summary_page.php +++ b/summary_page.php @@ -6,7 +6,7 @@ # See the README and LICENSE files for details # -------------------------------------------------------- - # $Id: summary_page.php,v 1.52 2007-07-25 15:53:32 giallu Exp $ + # $Id: summary_page.php,v 1.53 2007-07-31 22:55:00 giallu Exp $ # -------------------------------------------------------- ?> + + + + + + + +
+ +
+