[Rt-commit] rt branch, 4.6/create_ticket_link_in_menu, created. rt-4.4.4-540-g69cf570b2c
Aaron Trevena
ast at bestpractical.com
Tue Nov 26 15:24:23 EST 2019
The branch, 4.6/create_ticket_link_in_menu has been created
at 69cf570b2ce11438dc94fd224388e3aa553e8a42 (commit)
- Log -----------------------------------------------------------------
commit 69cf570b2ce11438dc94fd224388e3aa553e8a42
Author: Aaron Trevena <aaron at aarontrevena.co.uk>
Date: Tue Nov 26 20:20:49 2019 +0000
Add Create Ticket link in Menu
Adds a new ticket submenu, with create ticket item 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..a7287c91ca 100644
--- a/lib/RT/Interface/Web/MenuBuilder.pm
+++ b/lib/RT/Interface/Web/MenuBuilder.pm
@@ -181,6 +181,16 @@ sub BuildMainNav {
$search->child( assets => title => loc("Assets"), path => "/Asset/Search/" )
if $current_user->HasRight( Right => 'ShowAssetsMenu', Object => RT->System );
+ my $tickets_menu = $top->child( tickets =>
+ title => loc('Tickets'),
+ description => loc('Tickets'),
+ path => loc('Search/Simple.html'),
+ );
+
+ $tickets_menu->child( create_ticket =>
+ raw_html => $HTML::Mason::Commands::m->scomp('CreateTicket', MenuItemOnly => 1 )
+ );
+
my $reports = $top->child( reports =>
title => loc('Reports'),
description => loc('Reports summarizing ticket resolution and status'),
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