[Rt-commit] rt branch, 4.4/keyboard-shortcut-correspond, created. rt-4.4.2-74-g4738a5e2e
Craig Kaiser
craig at bestpractical.com
Thu Apr 5 15:13:04 EDT 2018
The branch, 4.4/keyboard-shortcut-correspond has been created
at 4738a5e2ed22de8a8e4cbd63cb99009f35e04da0 (commit)
- Log -----------------------------------------------------------------
commit 4738a5e2ed22de8a8e4cbd63cb99009f35e04da0
Author: craig Kaiser <craig at bestpractical.com>
Date: Thu Apr 5 12:44:44 2018 -0400
Add key shortcut for correspond on ticket
diff --git a/share/html/Elements/ShortcutHelp b/share/html/Elements/ShortcutHelp
index 41180a279..db71d4b8d 100644
--- a/share/html/Elements/ShortcutHelp
+++ b/share/html/Elements/ShortcutHelp
@@ -46,8 +46,9 @@
%#
%# END BPS TAGGED BLOCK }}}
<%args>
-$show_search => 0
-$show_bulk_update => 0
+$show_search => 0
+$show_bulk_update => 0
+$show_ticket_summary => 0
</%args>
<div class="keyboard-shortcuts">
@@ -114,5 +115,25 @@ $show_bulk_update => 0
</div>
% }
-
+% if ($show_ticket_summary) {
+ <div class="titlebox">
+ <div class="titlebox-title">
+ <span class="left"><&|/l&>Ticket Display</&></span>
+ <span class="right-empty"></span>
+ </div>
+ <div class="titlebox-content">
+ <hr class="clear">
+ <table>
+ <tr>
+ <td class="key-column"><span class="keyboard-shortcuts-key">r</span></td>
+ <td><&|/l&>Reply To Current Ticket</&></td>
+ </tr>
+ <tr>
+ <td class="key-column"><span class="keyboard-shortcuts-key">c</span></td>
+ <td><&|/l&>Comment On Current Ticket</&></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+% }
</div>
diff --git a/share/html/Helpers/ShortcutHelp b/share/html/Helpers/ShortcutHelp
index b9e71fd7d..04545f6ed 100644
--- a/share/html/Helpers/ShortcutHelp
+++ b/share/html/Helpers/ShortcutHelp
@@ -46,8 +46,9 @@
%#
%# END BPS TAGGED BLOCK }}}
<%args>
-$show_search => 0
-$show_bulk_update => 0
+$show_search => 0
+$show_bulk_update => 0
+$show_ticket_summary => 0
</%args>
<& /Elements/ShortcutHelp, %ARGS &>
% $m->abort;
diff --git a/share/static/js/keyboard-shortcuts.js b/share/static/js/keyboard-shortcuts.js
index a7b4cf54f..924b98031 100644
--- a/share/static/js/keyboard-shortcuts.js
+++ b/share/static/js/keyboard-shortcuts.js
@@ -34,10 +34,12 @@ jQuery(function() {
var is_search = jQuery('body#comp-Search-Results').length > 0;
var is_bulk_update = jQuery('body#comp-Search-Bulk').length > 0;
+ var is_ticket_summary = jQuery('table.ticket-summary').length > 0;
var url = RT.Config.WebHomePath + '/Helpers/ShortcutHelp' +
'?show_search=' + ( is_search || is_bulk_update ? '1' : '0' ) +
- '&show_bulk_update=' + ( is_bulk_update ? '1' : '0' );
+ '&show_bulk_update=' + ( is_bulk_update ? '1' : '0' ) +
+ '&show_ticket_summary=' + ( is_ticket_summary ? '1' : '0' );
jQuery.ajax({
url: url,
@@ -63,9 +65,7 @@ jQuery(function() {
Mousetrap.bind('g h', goHome);
Mousetrap.bind('/', simpleSearch);
Mousetrap.bind('?', openHelp);
-});
-jQuery(function() {
// Only load these shortcuts if there is a ticket list on the page
var hasTicketList = jQuery('table.ticket-list').length;
if (!hasTicketList) return;
@@ -124,20 +124,28 @@ jQuery(function() {
};
var replyToTicket = function() {
- if (!currentRow) return;
-
- var ticketId = currentRow.closest('tbody').data('recordId');
- var replyLink = generateUpdateLink(ticketId, 'Respond');
+ var ticketId = jQuery('tr.id').children('td.value').text();
+ if (!currentRow && !ticketId ) return;
+ if ( !currentRow ) {
+ var replyLink = generateUpdateLink(ticketId, 'Respond');
+ } else {
+ var ticketId = currentRow.closest('tbody').data('recordId');
+ var replyLink = generateUpdateLink(ticketId, 'Respond');
+ };
if (!replyLink) return;
window.location.href = replyLink;
};
var commentOnTicket = function() {
- if (!currentRow) return;
-
- var ticketId = currentRow.closest('tbody').data('recordId');
- var commentLink = generateUpdateLink(ticketId, 'Comment');
+ var ticketId = jQuery('tr.id').children('td.value').text();
+ if (!currentRow && !ticketId) return;
+ if ( !currentRow ) {
+ var commentLink = generateUpdateLink(ticketId, 'Comment');
+ } else {
+ var ticketId = currentRow.closest('tbody').data('recordId');
+ var commentLink = generateUpdateLink(ticketId, 'Comment');
+ };
if (!commentLink) return;
window.location.href = commentLink;
-----------------------------------------------------------------------
More information about the rt-commit
mailing list