diff --git a/core/bug_api.php b/core/bug_api.php index c0b6237..dbd8b71 100644 --- a/core/bug_api.php +++ b/core/bug_api.php @@ -186,11 +186,11 @@ class BugData { $this->fetch_extended_info(); return $this->{$name}; } - + /** * @private */ - public function __isset($name) { + public function __isset($name) { return isset( $this->{$name} ); } @@ -206,13 +206,13 @@ class BugData { } $this->loading = false; } - + /** * Retrieves extended information for bug (e.g. bug description) * @return null */ private function fetch_extended_info() { - if ( $this->description == '' ) { + if ( $this->description == '' ) { $t_text = bug_text_cache_row($this->id); $this->description = $t_text['description']; @@ -1324,6 +1324,28 @@ function bug_get_newest_bugnote_timestamp( $p_bug_id ) { } /** + * return the reporter (user_id) for the most recent time at which a bugnote + * associated with the bug was modified + * @param int p_bug_id integer representing bug id + * @return bool|int false or user id in integer format representing last bugnote reporter + * @access public + * @uses database_api.php + */ +function bug_get_last_bugnote_reporter( $p_bug_id ) { + $c_bug_id = db_prepare_int( $p_bug_id ); + $t_bugnote_table = db_get_table( 'bugnote' ); + + $query = "SELECT MIN(reporter_id) + FROM $t_bugnote_table A + WHERE A.date_submitted = (SELECT MAX(X.date_submitted) + FROM $t_bugnote_table X + WHERE X.bug_id = A.bug_id) AND + A.bug_id=" . db_param(); + $result = db_query_bound( $query, Array( $c_bug_id ), 1 ); + return db_result( $result ); +} + +/** * return the timestamp for the most recent time at which a bugnote * associated with the bug was modified and the total bugnote * count in one db query diff --git a/my_view_inc.php b/my_view_inc.php index c470b48..2230c3b 100644 --- a/my_view_inc.php +++ b/my_view_inc.php @@ -434,6 +434,9 @@ echo "($v_start - $v_end / $t_bug_count)"; $t_summary = string_display_line_links( $t_bug->summary ); $t_last_updated = date( config_get( 'normal_date_format' ), $t_bug->last_updated ); + $t_last_reporter_id = bug_get_last_bugnote_reporter( $t_bug->id ); + $t_last_reporter = $t_last_reporter_id ? user_get_name( $t_last_reporter_id ) : ''; + # choose color based on status $status_color = get_status_color( $t_bug->status ); @@ -498,9 +501,9 @@ echo "($v_start - $v_end / $t_bug_count)"; echo string_display_line( category_full_name( $t_bug->category_id, true, $t_bug->project_id ) ); if( $t_bug->last_updated > strtotime( '-' . $t_filter[FILTER_PROPERTY_HIGHLIGHT_CHANGED] . ' hours' ) ) { - echo ' - ' . $t_last_updated . ''; + echo ' - ' . $t_last_updated . ' - ' . $t_last_reporter . ''; } else { - echo ' - ' . $t_last_updated; + echo ' - ' . $t_last_updated . ' - ' . $t_last_reporter; } ?>