[Bps-public-commit] RT-BugTracker branch, 4.2-4.4-compatibility, updated. 5.2-18-g65a708f
Shawn Moore
shawn at bestpractical.com
Wed Jun 21 14:52:14 EDT 2017
The branch, 4.2-4.4-compatibility has been updated
via 65a708f1e408504b67361f06f042463bbb89cc1d (commit)
from f82975985e1774cc7c4e80a59bc8a8bce9e72ab7 (commit)
Summary of changes:
html/Callbacks/BugTracker/Elements/Tabs/SelfService | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
- Log -----------------------------------------------------------------
commit 65a708f1e408504b67361f06f042463bbb89cc1d
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Wed Jun 21 18:51:12 2017 +0000
Avoid breaking self-service UI
There's no "search" menu in self-service, so instead hang off the "Tickets"
menu.
Additionally, suppress adding the Distributions menu entirely if it isn't part
of the self-service UI
diff --git a/html/Callbacks/BugTracker/Elements/Tabs/SelfService b/html/Callbacks/BugTracker/Elements/Tabs/SelfService
index 7a61fb2..73e1b6f 100644
--- a/html/Callbacks/BugTracker/Elements/Tabs/SelfService
+++ b/html/Callbacks/BugTracker/Elements/Tabs/SelfService
@@ -51,7 +51,21 @@ my $escaped_uname = $m->interp->apply_escapes(
$session{'CurrentUser'}->UserObj->Name, 'u'
);
-my $tracker = Menu->child("search")->add_after(
+my $request_path = $HTML::Mason::Commands::r->path_info;
+$request_path =~ s!^/{2,}!/!;
+
+my $menu = Menu->child("search")
+ || Menu->child("tickets");
+
+# only include distributions in self-service menu if BugTracker's urls are
+# accessible to unprivileged users
+if ($request_path =~ RT->Config->Get('SelfServiceRegex')) {
+ if ("/Dist/Search.html" !~ RT->Config->Get('SelfServiceRegex')) {
+ return;
+ }
+}
+
+my $tracker = $menu->add_after(
bugtracker => title => loc('Distributions'),
path => '/Dist/ByMaintainer.html?Name=' . $escaped_uname,
);
@@ -73,8 +87,6 @@ unless (RT->Config->Get('BugTracker_HideBrowseDistributions')) {
);
}
-my $request_path = $HTML::Mason::Commands::r->path_info;
-$request_path =~ s!^/{2,}!/!;
if ( $request_path =~ m{^/Dist/(?:Display|Manage)\.html} ) {
my $Queue = $DECODED_ARGS->{'Name'} || $DECODED_ARGS->{'Queue'};
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list