Skip to content

Commit

Permalink
IssueViewPageCommand: regroup monitor flags
Browse files Browse the repository at this point in the history
  • Loading branch information
dregad committed Sep 17, 2019
1 parent b64d993 commit 0785615
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions core/commands/IssueViewPageCommand.php
Expand Up @@ -216,6 +216,12 @@ protected function process() {
$t_flags['monitor_can_add'] = access_has_bug_level( config_get( 'monitor_add_others_bug_threshold' ), $t_issue_id ) ? true : false;
}

$t_monitor_flag = !$t_force_readonly && !$t_anonymous_user;
$t_is_monitoring = user_is_monitoring_bug( $t_user_id, $t_issue_id );
$t_flags['can_monitor'] = $t_monitor_flag && !$t_is_monitoring &&
access_has_bug_level( config_get( 'monitor_bug_threshold' ), $t_issue_id );
$t_flags['can_unmonitor'] = $t_monitor_flag && $t_is_monitoring;

$t_flags['attachments_show'] = in_array( 'attachments', $t_fields );
$t_flags['category_show'] = in_array( 'category_id', $t_fields );
$t_flags['eta_show'] = in_array( 'eta', $t_fields );
Expand All @@ -235,12 +241,6 @@ protected function process() {
access_has_bug_level( config_get( 'update_bug_assign_threshold', config_get( 'update_bug_threshold' ) ), $t_issue_id );
$t_flags['can_change_status'] = !$t_issue_readonly && access_has_bug_level( config_get( 'update_bug_status_threshold' ), $t_issue_id );

$t_monitor_flag = !$t_force_readonly && !$t_anonymous_user;
$t_is_monitoring = user_is_monitoring_bug( $t_user_id, $t_issue_id );
$t_flags['can_monitor'] = $t_monitor_flag && !$t_is_monitoring &&
access_has_bug_level( config_get( 'monitor_bug_threshold' ), $t_issue_id );
$t_flags['can_unmonitor'] = $t_monitor_flag && $t_is_monitoring;

$t_flags['can_clone'] = !$t_issue_readonly && access_has_bug_level( config_get( 'report_bug_threshold' ), $t_issue_id );
$t_flags['can_reopen'] = !$t_force_readonly && access_can_reopen_bug( $t_issue_data );

Expand Down

0 comments on commit 0785615

Please sign in to comment.