From 265844efcc6dee8e6979ac333278e635396fddc5 Mon Sep 17 00:00:00 2001 From: Jean-Roch Maitre Date: Wed, 11 Oct 2017 14:44:54 -0700 Subject: [PATCH] UI-2921: add way to impersonate users from smart pbx --- i18n/en-US.json | 8 ++++++-- submodules/users/users.css | 4 ++++ submodules/users/users.js | 11 +++++++++++ views/users-name.html | 4 ++++ 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/i18n/en-US.json b/i18n/en-US.json index 8edf2f5..637c0b8 100644 --- a/i18n/en-US.json +++ b/i18n/en-US.json @@ -553,7 +553,7 @@ "deskphone": "A Desk Phone", "number": "This number", "placeholder": "+14157283992", - "requireKeyPress": "Leave voicemails on forwarded numbers", + "requireKeyPress": "Require Key Press", "title": "Call Forwarding", "timeoutWarning": "In order to leave voicemails on forwarded numbers, your ringing timeout needs to be set to at least 30sec. By saving now, you will automatically be redirected to the user edition where you can update the ringing timeout.", "__comment": ": Now add a mode for failover for call forward", @@ -735,7 +735,11 @@ "__version": "4.0", "deleteConferences": "Also remove this user's conferences from the system", "deleteConferencesHelp": "If you leave this option unchecked, you won't be able to use the user's conference number anywhere else, as it will still be used by that conference." - } + }, + + "__comment": "UI-2921: Delete User new Dialog", + "__version": "4.2", + "impersonate": "Impersonate" }, "strategy": { diff --git a/submodules/users/users.css b/submodules/users/users.css index f31dddc..aafd318 100644 --- a/submodules/users/users.css +++ b/submodules/users/users.css @@ -233,6 +233,10 @@ line-height: 30px; } +#users_container .actions a { + margin-right: 10px; +} + #users_container .actions .cancel-link { margin-right: 10px; } diff --git a/submodules/users/users.js b/submodules/users/users.js index b32071f..2be2457 100644 --- a/submodules/users/users.js +++ b/submodules/users/users.js @@ -292,6 +292,8 @@ define(function(require) { dataUser.extra.adminId = self.userId; + dataUser.extra.canImpersonate = monster.util.canImpersonate(self.accountId); + dataUser.extra.presenceIdOptions = []; var temp, @@ -777,6 +779,15 @@ define(function(require) { $(this).parents('.item-row').remove(); }); + template.on('click', '#impersonate_user', function() { + var dataUser = $(this).parents('.grid-row').data(); + + monster.pub('auth.triggerImpersonateUser', { + userId: dataUser.id, + userName: dataUser.name + }); + }); + template.on('click', '#delete_user', function() { var dataUser = $(this).parents('.grid-row').data(); diff --git a/views/users-name.html b/views/users-name.html index 33aecb6..6e78814 100644 --- a/views/users-name.html +++ b/views/users-name.html @@ -129,6 +129,10 @@ {{ i18n.users.delete }} {{/compare}} + {{#if extra.canImpersonate}} + {{ i18n.users.impersonate }} + {{/if}} +
{{ i18n.cancel }}