diff --git a/i18n/en-US.json b/i18n/en-US.json index ccd8be20..bbfc4527 100644 --- a/i18n/en-US.json +++ b/i18n/en-US.json @@ -1355,6 +1355,20 @@ "current": "Current", "original": "Original" } + }, + "privacy": { + "title": "Privacy", + "caller_id_title": "Privacy Caller-ID", + "toolbox_name": "Privacy cid", + "toolbox_tip": "Hide your CallerNumber or your CallerName", + "mode": "Mode", + "endpoint_strategy": "Endpoint strategy", + "full": "Full", + "name": "Name", + "number": "Number", + "none": "None", + "overwrite": "Overwrite", + "merge": "Merge" } }, "__comment": "UI-1260: created common control for carrier selection", diff --git a/submodules/misc/misc.js b/submodules/misc/misc.js index 0b9aaaa9..5565584c 100644 --- a/submodules/misc/misc.js +++ b/submodules/misc/misc.js @@ -322,6 +322,59 @@ define(function(require) { } } }, + 'privacy_cid[]': { + name: self.i18n.active().oldCallflows.privacy.toolbox_name, + icon: 'lock', + category: self.i18n.active().oldCallflows.caller_id_cat, + module: 'privacy_cid', + tip: self.i18n.active().oldCallflows.privacy.toolbox_tip, + data: { + endpoint_strategy: 'overwrite', + mode: 'full' + }, + isUsable: 'true', + weight: 10, + caption: function(node) { + return (node.getMetadata('endpoint_strategy') || '') + ' ' + (node.getMetadata('mode') || ''); + }, + edit: function(node, callback) { + var popup, popup_html; + + popup_html = $(monster.template(self, 'misc-privacy', { + data_privacy: { + 'endpoint_strategy': node.getMetadata('endpoint_strategy') || '', + 'mode': node.getMetadata('mode') || '' + } + })); + + $('#add', popup_html).click(function() { + var endpoint_strategy_val = $('#privacy_endpoint_strategy', popup_html).val(), + mode_val = $('#privacy_mode', popup_html).val(); + + node.setMetadata('endpoint_strategy', endpoint_strategy_val); + node.setMetadata('mode', mode_val); + + node.caption = endpoint_strategy_val + ' ' + mode_val; + + popup.dialog('close'); + }); + + popup = monster.ui.dialog(popup_html, { + title: self.i18n.active().oldCallflows.privacy.caller_id_title, + beforeClose: function() { + if (typeof callback === 'function') { + callback(); + } + } + }); + + monster.ui.tooltips(popup); + + if (typeof callback === 'function') { + callback(); + } + } + }, 'prepend_cid[action=prepend]': { name: self.i18n.active().oldCallflows.prepend, icon: 'plus_circle', diff --git a/views/misc-privacy.html b/views/misc-privacy.html new file mode 100644 index 00000000..a44e0c77 --- /dev/null +++ b/views/misc-privacy.html @@ -0,0 +1,27 @@ +
+

{{ i18n.oldCallflows.privacy.title }}

+
+
+ + + +
+
+
+ +
+
\ No newline at end of file