improved call log workflow (#517)

Improved call log workflow, added new customer option to call log.
This commit is contained in:
Timo Göllner 2017-01-09 16:09:46 +01:00 committed by Martin Edenhofer
parent b19af65a46
commit f147bda633
2 changed files with 23 additions and 2 deletions

View file

@ -1,6 +1,7 @@
class App.CTI extends App.Controller class App.CTI extends App.Controller
events: events:
'click .js-check': 'done' 'click .js-check': 'done',
'click .js-new-user': 'new_user'
constructor: -> constructor: ->
super super
@ -167,6 +168,26 @@ class App.CTI extends App.Controller
data: JSON.stringify(done: done) data: JSON.stringify(done: done)
) )
new_user: (e) ->
e.preventDefault()
phone = $(e.currentTarget).text()
new App.ControllerGenericNew(
pageData:
title: 'Users'
home: 'users'
object: 'User'
objects: 'Users'
navupdate: '#users'
genericObject: 'User'
item:
phone: phone
container: @el.closest('.content')
callback: @new_ticket
)
new_ticket: (customer) ->
@navigate "#ticket/create/customer/#{customer.id}"
show: (params) => show: (params) =>
@title 'CTI', true @title 'CTI', true
@navupdate '#cti' @navupdate '#cti'

View file

@ -46,7 +46,7 @@
<% if shown: %> <% if shown: %>
<small><%= item.from %></small> <small><%= item.from %></small>
<% else: %> <% else: %>
<%= item.from %> <a class="js-new-user" href="#"><%= item.from %></a>
<% end %> <% end %>
</td> </td>
<td> <td>