Skip to content

Commit

Permalink
Make timeline show a set of bugs based on filters
Browse files Browse the repository at this point in the history
Make timeline show history for a set of bugs based on a filter.
By default, create a filter to show current project and subprojects, to
match the visibility of my view page.

Fixes: #21072

Signed-off-by: Damien Regad <dregad@mantisbt.org>

Original commit modified to remove unnecessary assignment.
  • Loading branch information
cproensa authored and dregad committed Aug 16, 2016
1 parent 79f8e60 commit 28b6d79
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions core/timeline_api.php
Expand Up @@ -37,12 +37,17 @@
* @param integer $p_start_time Timestamp representing start time of the period.
* @param integer $p_end_time Timestamp representing end time of the period.
* @param integer $p_max_events The maximum number of events to return or 0 for unlimited.
* @param type $p_filter Filter array to use for filtering bugs
* @return array
*/
function timeline_events( $p_start_time, $p_end_time, $p_max_events ) {
function timeline_events( $p_start_time, $p_end_time, $p_max_events, $p_filter = null ) {
$t_timeline_events = array();

$t_result = history_get_range_result( /* $p_bug_id */ null, $p_start_time, $p_end_time, 'DESC' );
if( null === $p_filter ) {
# create an empty filter, to match all bugs
$t_filter = filter_ensure_valid_filter( array() );
}
$t_result = history_get_range_result_filter( $t_filter, $p_start_time, $p_end_time, 'DESC' );
$t_count = 0;

while ( $t_history_event = history_get_event_from_row( $t_result, /* $p_user_id */ auth_get_current_user_id(), /* $p_check_access_to_issue */ true ) ) {
Expand Down

0 comments on commit 28b6d79

Please sign in to comment.