Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide "Report Issue" button in navbar on bug_report_page #1458

Merged
merged 2 commits into from Feb 11, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 ) {
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