Browse Source

Added support to copy T#xxx into clipboard by pressing "ctrl+alt+y" if ticket is open in ticket zoom view.

Martin Edenhofer 8 years ago
parent
commit
5e090a8976

+ 5 - 0
LICENSE-3RD-PARTY.txt

@@ -24,6 +24,11 @@ Source: https://github.com/sliptree/bootstrap-tokenfield
 Copyright 2013-2014 Sliptree and other contributors
 Copyright 2013-2014 Sliptree and other contributors
 License: MIT license
 License: MIT license
 -----------------------------------------------------------------------------
 -----------------------------------------------------------------------------
+clipboard.js
+Source: https://github.com/lgarron/clipboard.js
+Copyright: 2015 Lucas Garron (https://garron.net/)
+License: MIT license
+-----------------------------------------------------------------------------
 cropper.js
 cropper.js
 Source: https://github.com/fengyuanchen/cropper
 Source: https://github.com/fengyuanchen/cropper
 Copyright: 2014-2015 Fengyuan Chen and contributors
 Copyright: 2014-2015 Fengyuan Chen and contributors

+ 1 - 1
app/assets/javascripts/app/controllers/_application_controller_form.coffee

@@ -281,7 +281,7 @@ class App.ControllerForm extends App.Controller
 
 
               # lookup relation if needed
               # lookup relation if needed
               if action.bind.relation
               if action.bind.relation
-                data = App[action.bind.relation].find( value )
+                data = App[action.bind.relation].find(value)
                 value = data.name
                 value = data.name
 
 
               # check if value is used in condition
               # check if value is used in condition

+ 14 - 0
app/assets/javascripts/app/controllers/widget/keyboard_shortcuts.coffee

@@ -240,6 +240,20 @@ App.Config.set(
             }
             }
           ]
           ]
         }
         }
+        {
+          where: 'Used in object views'
+          shortcuts: [
+            {
+              key: 'y'
+              hotkeys: true
+              description: 'Copy current object number (e. g. Ticket#) into clipboard'
+              callback: ->
+                App.Event.trigger('keyboard_shortcuts_close')
+                text = $('.active.content .js-objectNumber').data('number') || ''
+                clipboard.copy(text)
+            }
+          ]
+        }
       ]
       ]
     }
     }
     {
     {

File diff suppressed because it is too large
+ 90 - 0
app/assets/javascripts/app/lib/base/clipboard.js


+ 1 - 1
app/assets/javascripts/app/views/ticket_zoom/meta.jst.eco

@@ -1,3 +1,3 @@
 <small class="task-subline">
 <small class="task-subline">
-  <%- @C('ticket_hook') %> <span class="ticket-number"><%- @ticket.number %></span> - <%- @T('created') %> <%- @humanTime(@ticket.created_at) %> <% if !@isCustomer && @ticket.escalation_time: %> - <%- @T('escalation') %> <%- @humanTime(@ticket.escalation_time, true) %><% end %>
+  <%- @C('ticket_hook') %> <span class="ticket-number js-objectNumber" data-number="<%- @C('ticket_hook') %><%- @ticket.number %>"><%- @ticket.number %></span> - <%- @T('created') %> <%- @humanTime(@ticket.created_at) %> <% if !@isCustomer && @ticket.escalation_time: %> - <%- @T('escalation') %> <%- @humanTime(@ticket.escalation_time, true) %><% end %>
 </small>
 </small>

Some files were not shown because too many files changed in this diff