From d85e69feac67e2fa972694bf183df5bdb1d6837a Mon Sep 17 00:00:00 2001 From: Damien Regad Date: Wed, 6 Feb 2013 09:37:22 +0100 Subject: [PATCH] Fix #15453: Only display Close button if workflow allows Closed status --- core/html_api.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/html_api.php b/core/html_api.php index c213f55687..1532a867f6 100644 --- a/core/html_api.php +++ b/core/html_api.php @@ -1577,12 +1577,15 @@ function html_button_bug_reopen( $p_bug ) { /** * Print a button to close the given bug + * Only if user can close bugs and workflow allows moving them to that status * @param BugData $p_bug Bug object * @return null */ function html_button_bug_close( $p_bug ) { - if( access_can_close_bug( $p_bug ) ) { - $t_closed_status = config_get( 'bug_closed_status_threshold', null, null, $p_bug->project_id ); + $t_closed_status = config_get( 'bug_closed_status_threshold', null, null, $p_bug->project_id ); + if( access_can_close_bug( $p_bug ) + && bug_check_workflow( $p_bug->status, $t_closed_status ) + ) { html_button( 'bug_change_status_page.php', lang_get( 'close_bug_button' ),