Browse Source

[4.3] MSPB-66: Allow to configure the transcription and announce-only mode features (#178)

* Add new vmbox fields

* Update bmbox properties

* Update vmbox UI

* Handle toggle inputs

* Handle announcement only active
4.3
Ricardo Merino 6 years ago
committed by GitHub
parent
commit
6fc205d298
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 110 additions and 6 deletions
  1. +16
    -1
      i18n/en-US.json
  2. +26
    -2
      submodules/users/users.js
  3. +2
    -1
      submodules/users/users.scss
  4. +27
    -1
      submodules/users/views/feature-vmbox.html
  5. +32
    -0
      submodules/vmboxes/views/edit.html
  6. +7
    -1
      submodules/vmboxes/vmboxes.js

+ 16
- 1
i18n/en-US.json View File

@ -711,7 +711,10 @@
"text": "A voicemail box will be available for this user.",
"label": "Voicemail to e-mail:",
"title": "Voicemail Box",
"vmToEmailHelp": "An e-mail will be sent to {{variable}} for every new voicemail. If you want to change where email notifications go to, please edit the user's email address in the User Administration section."
"vmToEmailHelp": "An e-mail will be sent to {{variable}} for every new voicemail. If you want to change where email notifications go to, please edit the user's email address in the User Administration section.",
"announceOnly": "Announce Only",
"transcribe": "Transcribe",
"attach_voicemail": "Attach voicemail message to email."
},
"find_me_follow_me": {
"title": "Find me, Follow me",
@ -1427,6 +1430,18 @@
"label": "Configurable via Menu?",
"help": " If unchecked, it will disallow the user to configure voicemail via the menu"
},
"transcription": {
"label": "Transcribe Messages",
"help": "Control recent enhancements to the voicemail system"
},
"announceOnly": {
"label": "Announce only-mode",
"help": "Set a voicemail box to announce-only mode"
},
"emailAsAttachment": {
"label": "Attach messages to e-mail",
"help": "E-mail not having the message as an attachment"
},
"__comment": "UI-2634: add support for wav/mp4/mp3 for voicemail media extensions",
"__version": "4.1",
"mediaExtension": {


+ 26
- 2
submodules/users/users.js View File

@ -2270,14 +2270,26 @@ define(function(require) {
usersRenderVMBox: function(currentUser, vmbox) {
var self = this,
vmboxActive = currentUser.extra.mapFeatures.vmbox.active,
transcription = monster.util.getCapability('voicemail.transcription'),
announcement_only = _.get(vmbox, 'announcement_only', false),
vm_to_email_enabled = currentUser.vm_to_email_enabled,
transcribe = _.get(vmbox, 'transcribe', transcription.defaultValue),
featureTemplate = $(self.getTemplate({
name: 'feature-vmbox',
data: currentUser,
data: _.merge(currentUser, {
vm_to_email_enabled: announcement_only ? false : vm_to_email_enabled,
vmbox: _.merge(vmbox, {
transcribe: announcement_only ? false : transcribe,
announcement_only: announcement_only
})
}),
submodule: 'users'
})),
switchFeature = featureTemplate.find('.switch-state'),
featureForm = featureTemplate.find('#vmbox_form'),
switchVmToEmail = featureForm.find('#vm_to_email_enabled');
switchVmToEmail = featureForm.find('#vm_to_email_enabled'),
switchVmTranscribe = featureForm.find('#transcribe'),
switchVmAnnounceOnly = featureForm.find('#announcement_only');
monster.ui.validate(featureForm);
@ -2293,6 +2305,18 @@ define(function(require) {
$(this).prop('checked') ? featureForm.find('.extra-content').slideDown() : featureForm.find('.extra-content').slideUp();
});
switchVmAnnounceOnly.on('change', function() {
var isEnabled = $(this).prop('checked');
switchVmTranscribe
.prop('checked', isEnabled ? false : transcribe)
.prop('disabled', isEnabled);
switchVmToEmail
.prop('checked', isEnabled ? false : vm_to_email_enabled)
.prop('disabled', isEnabled);
});
featureTemplate.find('.save').on('click', function() {
if (!monster.ui.valid(featureForm)) {
return;


+ 2
- 1
submodules/users/users.scss View File

@ -1009,7 +1009,6 @@
&.main{
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding-bottom: 15px;
@ -1017,6 +1016,8 @@
font-size: 1em;
padding-right: 1em;
margin-bottom: 0px;
width: 200px;
text-align: right;
}
}


+ 27
- 1
submodules/users/views/feature-vmbox.html View File

@ -22,6 +22,24 @@
{{i18n.users.vmbox.text}}
</div>
<div class="control-group main">
<label class="title">
{{i18n.users.vmbox.announceOnly}}
</label>
{{#monsterSwitch}}
<input type="checkbox" name="announcement_only" id="announcement_only" data-on="{{i18n.enabled}}" data-off="{{i18n.disabled}}"{{#if vmbox.announcement_only}} checked="checked"{{/if}}></input>
{{/monsterSwitch}}
</div>
<div class="control-group main">
<label class="title">
{{i18n.users.vmbox.transcribe}}
</label>
{{#monsterSwitch}}
<input type="checkbox" name="transcribe" id="transcribe" data-on="{{i18n.enabled}}" data-off="{{i18n.disabled}}"{{#if vmbox.transcribe}} checked="checked"{{/if}}></input>
{{/monsterSwitch}}
</div>
<div class="control-group main">
<label class="title">
{{i18n.users.vmbox.label}}
@ -32,7 +50,7 @@
</div>
<div class="extra-content{{#unless vm_to_email_enabled}} disabled{{/unless}}">
<div class="control-group extra">
<div class="control-group">
<label class="fix-left">
{{#monsterCheckbox i18n.users.vmbox.deleteAfterNotify}}
<input type="checkbox" name="delete_after_notify"{{#if extra.deleteAfterNotify}} checked{{/if}}></input>
@ -40,6 +58,14 @@
</label>
</div>
<div class="control-group extra">
<label class="fix-left">
{{#monsterCheckbox i18n.users.vmbox.attach_voicemail}}
<input type="checkbox" name="delete_after_notify"{{#if extra.deleteAfterNotify}} checked{{/if}}></input>
{{/monsterCheckbox}}
</label>
</div>
{{#monsterText}}
{{replaceVar i18n.users.vmbox.vmToEmailHelp email}}
{{/monsterText}}


+ 32
- 0
submodules/vmboxes/views/edit.html View File

@ -148,6 +148,16 @@
</label>
</div>
<div class="control-group">
<label class="control-input checkbox">
<div data-toggle="tooltip" data-placement="right" data-original-title="{{ i18n.vmboxes.popupSettings.options.announceOnly.help }}">
{{#monsterCheckbox i18n.vmboxes.popupSettings.options.announceOnly.label}}
<input type="checkbox" name="announcement_only" id="announcement_only" {{#if announcement_only }}checked{{/if}} />
{{/monsterCheckbox}}
</div>
</label>
</div>
<div class="control-group">
<label class="control-input checkbox">
<div data-toggle="tooltip" data-placement="right" data-original-title="{{ i18n.vmboxes.popupSettings.options.deleteAfterNotify.help }}">
@ -158,6 +168,28 @@
</label>
</div>
<div class="control-group">
<label class="control-input checkbox">
<div data-toggle="tooltip" data-placement="right" data-original-title="{{ i18n.vmboxes.popupSettings.options.emailAsAttachment.help }}">
{{#monsterCheckbox i18n.vmboxes.popupSettings.options.emailAsAttachment.label}}
<input type="checkbox" name="include_message_on_notify" id="include_message_on_notify" {{#if include_message_on_notify }}checked{{/if}} />
{{/monsterCheckbox}}
</div>
</label>
</div>
{{#if hasTranscribe}}
<div class="control-group">
<label class="control-input checkbox">
<div data-toggle="tooltip" data-placement="right" data-original-title="{{ i18n.vmboxes.popupSettings.options.transcription.help }}">
{{#monsterCheckbox i18n.vmboxes.popupSettings.options.transcription.label}}
<input type="checkbox" name="transcribe" id="transcription" {{#if transcribe }}checked{{/if}} />
{{/monsterCheckbox}}
</div>
</label>
</div>
{{/if}}
<div class="control-group">
<label class="control-input checkbox">
<div data-toggle="tooltip" data-placement="right" data-original-title="{{ i18n.vmboxes.popupSettings.options.configurable.help }}">


+ 7
- 1
submodules/vmboxes/vmboxes.js View File

@ -129,9 +129,15 @@ define(function(require) {
}
})
: self.i18n.active().vmboxes.addTitle,
transcription = monster.util.getCapability('voicemail.transcription'),
templateVMBox = $(self.getTemplate({
name: 'edit',
data: data,
data: _.merge(data, {
hasTranscribe: _.get(transcription, 'isEnabled', false),
transcribe: _.get(data, 'transcribe', transcription.defaultValue),
announcement_only: _.get(data, 'announcement_only', false),
include_message_on_notify: _.get(data, 'include_message_on_notify', false)
}),
submodule: 'vmboxes'
})),
popup,


Loading…
Cancel
Save