diff --git a/app/assets/javascripts/app/controllers/cti.coffee b/app/assets/javascripts/app/controllers/cti.coffee index c05a8ed4c..9914a4482 100644 --- a/app/assets/javascripts/app/controllers/cti.coffee +++ b/app/assets/javascripts/app/controllers/cti.coffee @@ -1,6 +1,7 @@ class App.CTI extends App.Controller events: - 'click .js-check': 'done' + 'click .js-check': 'done', + 'click .js-new-user': 'new_user' constructor: -> super @@ -167,6 +168,26 @@ class App.CTI extends App.Controller 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) => @title 'CTI', true @navupdate '#cti' diff --git a/app/assets/javascripts/app/views/cti/index.jst.eco b/app/assets/javascripts/app/views/cti/index.jst.eco index a6a30cecf..99c4d0121 100644 --- a/app/assets/javascripts/app/views/cti/index.jst.eco +++ b/app/assets/javascripts/app/views/cti/index.jst.eco @@ -46,7 +46,7 @@ <% if shown: %> <%= item.from %> <% else: %> - <%= item.from %> + <%= item.from %> <% end %>