Skip to content

Commit

Permalink
Switch to "Create Linked Ticket" modal in "Assets" widget on ticket d…
Browse files Browse the repository at this point in the history
…isplay page

This is consistent with page menu.
  • Loading branch information
sunnavy committed Dec 11, 2023
1 parent 86692a8 commit fc3439e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion lib/RT/Interface/Web/MenuBuilder.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1058,6 +1058,7 @@ sub _BuildAssetMenuActionSubmenu {
my $actions = $page->child("actions", title => HTML::Mason::Commands::loc("Actions"));
$actions->child(
"create-linked-ticket",
class => 'asset-create-linked-ticket',
title => HTML::Mason::Commands::loc("Create linked ticket"),
path => ( $is_self_service ? '/SelfService' : '' ) . "/Asset/CreateLinkedTicket.html?Asset=$id"
);
Expand Down Expand Up @@ -1766,7 +1767,12 @@ sub BuildSelfServiceNav {

if ($home->child("new")) {
my $actions = $page->child("actions", title => loc("Actions"));
$actions->child("create-linked-ticket", title => loc("Create linked ticket"), path => "/SelfService/Asset/CreateLinkedTicket.html?Asset=$id");
$actions->child(
"create-linked-ticket",
class => 'asset-create-linked-ticket',
title => loc("Create linked ticket"),
path => "/SelfService/Asset/CreateLinkedTicket.html?Asset=$id"
);
}
}

Expand Down
2 changes: 1 addition & 1 deletion share/static/js/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jQuery(function() {
.map(function(x){return "asset:"+x})
.join(" "));
});
jQuery("#page-actions-create-linked-ticket").click(function(ev){
jQuery(".asset-create-linked-ticket").click(function(ev){
ev.preventDefault();
var url = this.href.replace(/\/Asset\/CreateLinkedTicket\.html\?/g,
'/Asset/Helpers/CreateLinkedTicket?');
Expand Down

0 comments on commit fc3439e

Please sign in to comment.