Skip to content

Commit

Permalink
Move asset page menu items to new Edit menu
Browse files Browse the repository at this point in the history
Several asset page menu items link to separate pages
that allowed asset data shown in portlets to be edited.
With inline edit, these pages are needed much less often,
but they take up significant space in the page menu.

Move links to asset edit pages to a new Edit menu, saving
space and making it clear what the menu links are for.
  • Loading branch information
richieri-bps committed Sep 6, 2024
1 parent f573687 commit 7840474
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/RT/Interface/Web/MenuBuilder.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1075,16 +1075,17 @@ sub _BuildAssetMenu {
if ($asset->id) {
$page->child("display", title => HTML::Mason::Commands::loc("Display"), path => "/Asset/Display.html?id=$id");
$page->child("history", title => HTML::Mason::Commands::loc("History"), path => "/Asset/History.html?id=$id");
$page->child("basics", title => HTML::Mason::Commands::loc("Basics"), path => "/Asset/Modify.html?id=$id");
$page->child("links", title => HTML::Mason::Commands::loc("Links"), path => "/Asset/ModifyLinks.html?id=$id");
$page->child("people", title => HTML::Mason::Commands::loc("People"), path => "/Asset/ModifyPeople.html?id=$id");
$page->child("dates", title => HTML::Mason::Commands::loc("Dates"), path => "/Asset/ModifyDates.html?id=$id");
my $edit = $page->child( edit => title => loc('Edit') );
$edit->child("basics", title => HTML::Mason::Commands::loc("Basics"), path => "/Asset/Modify.html?id=$id");
$edit->child("links", title => HTML::Mason::Commands::loc("Links"), path => "/Asset/ModifyLinks.html?id=$id");
$edit->child("people", title => HTML::Mason::Commands::loc("People"), path => "/Asset/ModifyPeople.html?id=$id");
$edit->child("dates", title => HTML::Mason::Commands::loc("Dates"), path => "/Asset/ModifyDates.html?id=$id");

for my $grouping (RT::CustomField->CustomGroupings($asset)) {
my $cfs = $asset->CustomFields;
$cfs->LimitToGrouping( $asset => $grouping );
next unless $cfs->Count;
$page->child(
$edit->child(
"cf-grouping-$grouping",
title => HTML::Mason::Commands::loc($grouping),
path => "/Asset/ModifyCFs.html?id=$id;Grouping=" . $HTML::Mason::Commands::m->interp->apply_escapes($grouping, 'u'),
Expand Down

0 comments on commit 7840474

Please sign in to comment.