From 279478025eb95b6cc5c4c8a6d1a3cab0550dc3e5 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 14 Aug 2017 17:27:33 +0200 Subject: [PATCH] Follow up fix for issue #1290 - Missing replacement of Config and Current User objects in text modules and signatures. --- .../javascripts/app/controllers/agent_ticket_create.coffee | 2 +- .../javascripts/app/controllers/ticket_zoom/article_new.coffee | 2 +- app/assets/javascripts/app/lib/app_post/utils.coffee | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/app/controllers/agent_ticket_create.coffee b/app/assets/javascripts/app/controllers/agent_ticket_create.coffee index 44c04a193..d4123771e 100644 --- a/app/assets/javascripts/app/controllers/agent_ticket_create.coffee +++ b/app/assets/javascripts/app/controllers/agent_ticket_create.coffee @@ -228,7 +228,7 @@ class App.TicketCreate extends App.Controller type = @$('[name="formSenderType"]').val() if signature isnt undefined && signature.body && type is 'email-out' - signatureFinished = App.Utils.replaceTags(signature.body, { user: App.Session.get() }) + signatureFinished = App.Utils.replaceTags(signature.body, { user: App.Session.get(), config: App.Config.all() }) body = @$('[data-name=body]') if App.Utils.signatureCheck(body.html() || '', signatureFinished) diff --git a/app/assets/javascripts/app/controllers/ticket_zoom/article_new.coffee b/app/assets/javascripts/app/controllers/ticket_zoom/article_new.coffee index befeae02d..edb39480d 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom/article_new.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom/article_new.coffee @@ -525,7 +525,7 @@ class App.TicketZoomArticleNew extends App.Controller @$('[data-name=body] [data-signature="true"]').remove() # apply new signature - signatureFinished = App.Utils.replaceTags(signature.body, { user: App.Session.get(), ticket: ticketCurrent }) + signatureFinished = App.Utils.replaceTags(signature.body, { user: App.Session.get(), ticket: ticketCurrent, config: App.Config.all() }) body = @$('[data-name=body]') if App.Utils.signatureCheck(body.html() || '', signatureFinished) diff --git a/app/assets/javascripts/app/lib/app_post/utils.coffee b/app/assets/javascripts/app/lib/app_post/utils.coffee index 3730670ba..2c70db01e 100644 --- a/app/assets/javascripts/app/lib/app_post/utils.coffee +++ b/app/assets/javascripts/app/lib/app_post/utils.coffee @@ -126,6 +126,7 @@ class App.Utils # htmlEscapedAndPhoneified = App.Utils.phoneify(rawText) @phoneify: (string) -> + return string if _.isEmpty(string) string = string.replace(/[^0-9,\+,#,\*]+/g, '') .replace(/(.)\+/, '$1') "tel:#{string}"