Skip to content

Commit

Permalink
Take care of SelfService when building asset action menu for "Assets"…
Browse files Browse the repository at this point in the history
… widget

Not only for privileged page menu, _BuildAssetMenuActionSubmenu is also
used to build asset action menu in "Assets" widget on ticket display
page, which may show up in SelfService.
sunnavy committed Dec 11, 2023
1 parent b642745 commit 86692a8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/RT/Interface/Web/MenuBuilder.pm
Original file line number Diff line number Diff line change
@@ -1053,9 +1053,16 @@ sub _BuildAssetMenuActionSubmenu {

my $asset = $args{Asset};
my $id = $asset->id;
my $is_self_service = $request_path =~ m{^/SelfService/} ? 1 : 0;

my $actions = $page->child("actions", title => HTML::Mason::Commands::loc("Actions"));
$actions->child("create-linked-ticket", title => HTML::Mason::Commands::loc("Create linked ticket"), path => "/Asset/CreateLinkedTicket.html?Asset=$id");
$actions->child(
"create-linked-ticket",
title => HTML::Mason::Commands::loc("Create linked ticket"),
path => ( $is_self_service ? '/SelfService' : '' ) . "/Asset/CreateLinkedTicket.html?Asset=$id"
);

return if $is_self_service;

my $status = $asset->Status;
my $lifecycle = $asset->LifecycleObj;

0 comments on commit 86692a8

Please sign in to comment.