From f147bda633c7cdb35ac244460ba77aef3eed49c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20G=C3=B6llner?= Date: Mon, 9 Jan 2017 16:09:46 +0100 Subject: [PATCH 1/3] improved call log workflow (#517) Improved call log workflow, added new customer option to call log. --- .../javascripts/app/controllers/cti.coffee | 23 ++++++++++++++++++- .../javascripts/app/views/cti/index.jst.eco | 2 +- 2 files changed, 23 insertions(+), 2 deletions(-) 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 %> From d11a9544505d6cf7b3ab8ea324a6c46d2c2a8605 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 10 Jan 2017 00:13:38 +0100 Subject: [PATCH 2/3] Ignore node module of chat devel env. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index aad805e24..760d2f3a8 100644 --- a/.gitignore +++ b/.gitignore @@ -45,6 +45,7 @@ /public/assets/*.* /public/assets/app /public/assets/custom +/public/assets/chat/node_modules /tmp/* /tmp/pids/* From 13dd008803357dc86b9d16239698c929c3f89f2a Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 10 Jan 2017 00:15:50 +0100 Subject: [PATCH 3/3] Improved shown realname of email addresses. --- app/assets/javascripts/app/index.coffee | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/app/index.coffee b/app/assets/javascripts/app/index.coffee index 901647b93..c357871c1 100644 --- a/app/assets/javascripts/app/index.coffee +++ b/app/assets/javascripts/app/index.coffee @@ -212,7 +212,14 @@ class App extends Spine.Controller if result result = result + ', ' if item.name - result = result + App.Utils.htmlEscape(item.name) + ' ' + item.name = item.name + .replace(',', '') + .replace(';', '') + .replace('"', '') + .replace('\'', '') + if item.name.match(/\@|,|;|\^|\+|#|ยง|\$|%|&|\/|\(|\)|=|\?|\*/) + item.name = "\"#{item.name}\"" + result = "#{result}#{App.Utils.htmlEscape(item.name)} " if item.address result = result + " <#{App.Utils.htmlEscape(item.address)}>" result