diff --git a/bug_view_inc.php b/bug_view_inc.php
index ab1e418c1f..dae3ec389c 100644
--- a/bug_view_inc.php
+++ b/bug_view_inc.php
@@ -201,7 +201,7 @@
echo '';
echo '
';
echo '';
- html_buttons_view_bug_page( $f_issue_id );
+ bug_view_action_buttons( $f_issue_id );
echo ' | ';
echo '
';
echo '';
@@ -210,7 +210,7 @@
if( $t_bottom_buttons_enabled ) {
echo '
';
if( !$t_readonly ) {
# UPDATE button
- echo '
';
- html_button_bug_update( $p_bug_id );
- echo '
';
+ if( access_has_bug_level( config_get( 'update_bug_threshold' ), $p_bug_id ) ) {
+ echo '
';
+ html_button( string_get_bug_update_page(), lang_get( 'update_bug_button' ), array( 'bug_id' => $p_bug_id ) );
+ echo '
';
+ }
# ASSIGN button
- echo '
';
- html_button_bug_assign_to( $t_bug );
- echo '
';
+ if( access_has_bug_level( config_get( 'update_bug_assign_threshold', config_get( 'update_bug_threshold' ) ), $p_bug_id ) ) {
+ echo '
';
+ bug_view_button_bug_assign_to( $t_bug );
+ echo '
';
+ }
# Change status button/dropdown
- echo '
';
- html_button_bug_change_status( $t_bug );
- echo '
';
+ if( access_has_bug_level( config_get( 'update_bug_status_threshold' ), $p_bug_id ) ) {
+ echo '
';
+ bug_view_button_bug_change_status( $t_bug );
+ echo '
';
+ }
}
# MONITOR/UNMONITOR button
if( !current_user_is_anonymous() ) {
echo '
';
if( user_is_monitoring_bug( auth_get_current_user_id(), $p_bug_id ) ) {
- html_button_bug_unmonitor( $p_bug_id );
+ html_button( 'bug_monitor_delete.php', lang_get( 'unmonitor_bug_button' ), array( 'bug_id' => $p_bug_id ) );
} else {
- html_button_bug_monitor( $p_bug_id );
+ if( access_has_bug_level( config_get( 'monitor_bug_threshold' ), $p_bug_id ) ) {
+ html_button( 'bug_monitor_add.php', lang_get( 'monitor_bug_button' ), array( 'bug_id' => $p_bug_id ) );
+ }
}
echo '
';
}
# STICK/UNSTICK button
- if( access_has_bug_level( $t_sticky, $p_bug_id ) ) {
+ if( access_has_bug_level( config_get( 'set_bug_sticky_threshold' ), $p_bug_id ) ) {
echo '
';
if( !bug_get_field( $p_bug_id, 'sticky' ) ) {
- html_button_bug_stick( $p_bug_id );
+ html_button( 'bug_stick.php', lang_get( 'stick_bug_button' ), array( 'bug_id' => $p_bug_id, 'action' => 'stick' ) );
} else {
- html_button_bug_unstick( $p_bug_id );
+ html_button( 'bug_stick.php', lang_get( 'unstick_bug_button' ), array( 'bug_id' => $p_bug_id, 'action' => 'unstick' ) );
}
echo '
';
}
# CLONE button
- if( !$t_readonly ) {
+ if( !$t_readonly && access_has_bug_level( config_get( 'report_bug_threshold' ), $p_bug_id ) ) {
echo '
';
- html_button_bug_create_child( $p_bug_id );
+ html_button( string_get_bug_report_url(), lang_get( 'create_child_bug_button' ), array( 'm_id' => $p_bug_id ) );
echo '
';
}
# REOPEN button
- echo '
';
- html_button_bug_reopen( $t_bug );
- echo '
';
+ if( access_can_reopen_bug( $t_bug ) ) {
+ echo '
';
+ $t_reopen_status = config_get( 'bug_reopen_status', null, null, $t_bug->project_id );
+ html_button(
+ 'bug_change_status_page.php',
+ lang_get( 'reopen_bug_button' ),
+ array( 'id' => $t_bug->id, 'new_status' => $t_reopen_status, 'change_type' => BUG_UPDATE_TYPE_REOPEN ) );
+ echo '
';
+ }
# CLOSE button
- echo '
';
- html_button_bug_close( $t_bug );
- echo '
';
+ $t_closed_status = config_get( 'bug_closed_status_threshold', null, null, $t_bug->project_id );
+ if( access_can_close_bug( $t_bug ) && bug_check_workflow( $t_bug->status, $t_closed_status ) ) {
+ echo '
';
+ html_button(
+ 'bug_change_status_page.php',
+ lang_get( 'close_bug_button' ),
+ array( 'id' => $t_bug->id, 'new_status' => $t_closed_status, 'change_type' => BUG_UPDATE_TYPE_CLOSE ) );
+ echo '
';
+ }
# MOVE button
- echo '
';
- html_button_bug_move( $p_bug_id );
- echo '
';
+ if( access_has_bug_level( config_get( 'move_bug_threshold' ), $p_bug_id ) ) {
+ echo '
';
+ html_button( 'bug_actiongroup_page.php', lang_get( 'move_bug_button' ), array( 'bug_arr[]' => $p_bug_id, 'action' => 'MOVE' ) );
+ echo '
';
+ }
# DELETE button
- echo '
';
- html_button_bug_delete( $p_bug_id );
- echo '
';
+ if( access_has_bug_level( config_get( 'delete_bug_threshold' ), $p_bug_id ) ) {
+ echo '
';
+ html_button( 'bug_actiongroup_page.php', lang_get( 'delete_bug_button' ), array( 'bug_arr[]' => $p_bug_id, 'action' => 'DELETE' ) );
+ echo '
';
+ }
helper_call_custom_function( 'print_bug_view_page_custom_buttons', array( $p_bug_id ) );