[Rt-commit] rt branch, 4.6/create_ticket_link_in_menu, created. rt-4.4.4-540-g8a3460cdfe
Aaron Trevena
ast at bestpractical.com
Tue Nov 26 16:00:37 EST 2019
The branch, 4.6/create_ticket_link_in_menu has been created
at 8a3460cdfe913d942233b515967eaad946a73bc1 (commit)
- Log -----------------------------------------------------------------
commit 8a3460cdfe913d942233b515967eaad946a73bc1
Author: Aaron Trevena <aaron at aarontrevena.co.uk>
Date: Tue Nov 26 20:20:49 2019 +0000
Add Create Ticket link in Menu
Adds create ticket item to the home submenu that pops-up modal dialog to select queue and takes you to create ticket page in same way as button
Implements: I#221613
diff --git a/lib/RT/Interface/Web/MenuBuilder.pm b/lib/RT/Interface/Web/MenuBuilder.pm
index 0e1d7b9c36..6d3b1249e3 100644
--- a/lib/RT/Interface/Web/MenuBuilder.pm
+++ b/lib/RT/Interface/Web/MenuBuilder.pm
@@ -92,6 +92,10 @@ sub BuildMainNav {
}
my $home = $top->child( home => title => loc('Homepage'), path => '/' );
+ $home->child( create_ticket =>
+ raw_html => $HTML::Mason::Commands::m->scomp('CreateTicket', MenuItemOnly => 1 )
+ );
+
unless ($HTML::Mason::Commands::session{'dashboards_in_menu'}) {
my $dashboards_in_menu = $current_user->UserObj->Preferences(
'DashboardsInMenu',
diff --git a/share/html/Elements/CreateTicket b/share/html/Elements/CreateTicket
index aa9ae034cb..7cabc77c56 100644
--- a/share/html/Elements/CreateTicket
+++ b/share/html/Elements/CreateTicket
@@ -58,6 +58,8 @@
% my $button_only_start_modal = '<input type="submit" class="btn btn-primary ticket-create-modal" value="';
% my $button_end = '" />';
% my $queue_selector = $m->scomp('/Elements/SelectNewTicketQueue', AutoSubmit => 1, SendTo => $SendTo, Placeholder => loc('Queue'), Hyperlink => $Hyperlink );
+% my $menu_item_start_modal = '<a class="menu-item ticket-create-modal" href="#">';
+% my $menu_item_end_modal = '</a>';
% if ($Hyperlink) {
<% $queue_selector |n %>
@@ -67,6 +69,9 @@
<&|/l_unsafe, $button_only_start_modal, $button_end &>[_1]Create new ticket[_2]</&>
</div>
% }
+% elsif ($MenuItemOnly) {
+<&|/l_unsafe, $menu_item_start_modal, $menu_item_end_modal &>[_1]Create new ticket[_2]</&>
+% }
% else {
<div class="create-wide">
<&|/l_unsafe, $button_start, $button_end, $queue_selector &>[_1]New ticket in[_2] [_3]</&>
@@ -87,4 +92,5 @@ $SendTo => '/Ticket/Create.html',
$IncludeExplanation => 0
$Hyperlink => undef
$ButtonOnly => undef
+$MenuItemOnly => undef
</%ARGS>
-----------------------------------------------------------------------
More information about the rt-commit
mailing list