Skip to content

Commit

Permalink
Hide "Report Issue" button in navbar on bug_update_page
Browse files Browse the repository at this point in the history
Fixes #23045
  • Loading branch information
atrol committed Feb 11, 2019
1 parent 5e36221 commit d5ee146
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions core/layout_api.php
Expand Up @@ -571,24 +571,26 @@ function layout_navbar_button_bar() {
return;
}

$t_can_report_bug = access_has_any_project_level( 'report_bug_threshold' );
$t_can_invite_user = current_user_is_administrator();
$t_show_report_bug_button = access_has_any_project_level( 'report_bug_threshold' ) &&
!is_page_name( string_get_bug_page( "report" ) ) &&
!is_page_name( string_get_bug_page( "update" ) );
$t_show_invite_user_button = current_user_is_administrator();

if( !$t_can_report_bug && !$t_can_invite_user ) {
if( !$t_show_report_bug_button && !$t_show_invite_user_button ) {
return;
}

echo '<li class="hidden-sm hidden-xs">';
echo '<div class="btn-group btn-corner padding-right-8 padding-left-8">';

if( $t_can_report_bug && !is_page_name( string_get_bug_page( "report" ) ) ) {
if( $t_show_report_bug_button ) {
$t_bug_url = string_get_bug_report_url();
echo '<a class="btn btn-primary btn-sm" href="' . $t_bug_url . '">';
echo '<i class="fa fa-edit"></i> ' . lang_get( 'report_bug_link' );
echo '</a>';
}

if( $t_can_invite_user ) {
if( $t_show_invite_user_button ) {
echo '<a class="btn btn-primary btn-sm" href="manage_user_create_page.php">';
echo '<i class="fa fa-user-plus"></i> ' . lang_get( 'invite_users' );
echo '</a>';
Expand Down

0 comments on commit d5ee146

Please sign in to comment.