Skip to content

Commit

Permalink
Merge pull request #7 from voxter/KAZUI-7-dynamic-callflows
Browse files Browse the repository at this point in the history
Kazui 7 dynamic callflows
  • Loading branch information
danielfinke committed Jun 7, 2015
2 parents 9c16aa0 + a0d0843 commit ce4897d
Show file tree
Hide file tree
Showing 17 changed files with 270 additions and 172 deletions.
4 changes: 4 additions & 0 deletions whapps/call_center/queue/queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,10 @@ winkstart.module('call_center', 'queue', {
});
});

$('#toggle_advanced', popup_html).click(function () {
$('#route_var_div', popup_html).toggle();
});

$('#add', popup_html).click(function() {
node.setMetadata('id', $('#queue_selector', popup).val());
if($('#route_var', popup_html).val().length > 0) {
Expand Down
14 changes: 13 additions & 1 deletion whapps/call_center/queue/tmpl/queue_callflow.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,19 @@ <h1>${title}</h1>
</div>

<div class="parameter_div">
${_t('route_var_ccv')} <input type="text" id="route_var" value="${route_var}"/>
{{if route_var.length == 0}}
<input type="checkbox" id="toggle_advanced"> Advanced
<div id="route_var_div" style="display: none;">
${_t('route_var_ccv')}
<input type="text" id="route_var" value="${route_var}"/>
</div>
{{else}}
<input type="checkbox" checked="checked" id="toggle_advanced"> Advanced
<div id="route_var_div">
${_t('route_var_ccv')}
<input type="text" id="route_var" value="${route_var}"/>
</div>
{{/if}}
</div>
</form>
<div class="buttons-center">
Expand Down
264 changes: 115 additions & 149 deletions whapps/voip/callflow/callflow.js

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion whapps/voip/callflow/tmpl/edit_dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,19 @@ <h1>${_t('connect_caller_to_another_callflow')}</h1>
</div>

<div class="parameter_div">
${_t('route_var_ccv')} <input type="text" id="route_var" value="${route_var}"/>
{{if route_var.length == 0}}
<input type="checkbox" id="toggle_advanced"> Advanced
<div id="route_var_div" style="display: none;">
${_t('route_var_ccv')}
<input type="text" id="route_var" value="${route_var}"/>
</div>
{{else}}
<input type="checkbox" checked="checked" id="toggle_advanced"> Advanced
<div id="route_var_div">
${_t('route_var_ccv')}
<input type="text" id="route_var" value="${route_var}"/>
</div>
{{/if}}
</div>
</form>
<div class="buttons-center">
Expand Down
22 changes: 7 additions & 15 deletions whapps/voip/callflow/tmpl/routing_variables_callflow.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,13 @@
<h1>${_t('routing_variables_caption')}</h1>
<form name="form" method="post" action="#">
<div class="form_content">
{{if count == 0}}
<div class="popup_field">
<input type="text" name="key[]" value="" placeholder="Variable name"/>&nbsp;:&nbsp;
<input type="text" name="value[]" value="" placeholder="Variable value"/>
<button id="del0" class="btn danger" style="padding: 0; min-width: 20px; width: 20px;">X</button>
</div>
{{else}}
{{each(key, value) items}}
<div class="popup_field">
<input type="text" name="key[]" value="${key}" placeholder="Variable name"/>&nbsp;:&nbsp;
<input type="text" name="value[]" value="${value}" placeholder="Variable value"/>
<button id="del${dataArrayIndex(key, value)}" class="btn danger" style="padding: 0; min-width: 20px; width: 20px;">X</button>
</div>
{{/each}}
{{/if}}
{{each(i, item) items}}
<div class="popup_field" style="white-space: nowrap;">
<input class="large" type="text" name="key[]" value="${item.key}" placeholder="Variable name"/>&nbsp;:&nbsp;
<input class="large" type="text" name="${item.type}" value="${item.value}" placeholder="Variable value"/>
<button id="del${i}" class="btn danger" style="padding: 0; min-width: 20px; width: 20px;">X</button>
</div>
{{/each}}
</div>
</form>

Expand Down
4 changes: 4 additions & 0 deletions whapps/voip/device/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -1206,6 +1206,10 @@ winkstart.module('voip', 'device', {
});
});

$('#toggle_advanced', popup_html).click(function () {
$('#route_var_div', popup_html).toggle();
});

$('#add', popup_html).click(function() {
node.setMetadata('id', $('#device_selector', popup_html).val());
node.setMetadata('timeout', $('#parameter_input', popup_html).val());
Expand Down
14 changes: 13 additions & 1 deletion whapps/voip/device/tmpl/device_callflow.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,19 @@ <h1>${_t('connect_caller_to_device')}</h1>
<div class="parameter_description">${_t('when_you_check_this_box')}</div>
</div>
<div class="parameter_div">
${_t('route_var_ccv')} <input type="text" id="route_var" value="${route_var}"/>
{{if route_var.length == 0}}
<input type="checkbox" id="toggle_advanced"> Advanced
<div id="route_var_div" style="display: none;">
${_t('route_var_ccv')}
<input type="text" id="route_var" value="${route_var}"/>
</div>
{{else}}
<input type="checkbox" checked="checked" id="toggle_advanced"> Advanced
<div id="route_var_div">
${_t('route_var_ccv')}
<input type="text" id="route_var" value="${route_var}"/>
</div>
{{/if}}
</div>
</form>
<div class="buttons-center">
Expand Down
4 changes: 4 additions & 0 deletions whapps/voip/media/media.js
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,10 @@ winkstart.module('voip', 'media', {
});
});

$('#toggle_advanced', popup_html).click(function () {
$('#route_var_div', popup_html).toggle();
});

$('#add', popup_html).click(function() {
node.setMetadata('id', $('#media_selector', popup_html).val());
if($('#route_var', popup_html).val().length > 0) {
Expand Down
14 changes: 13 additions & 1 deletion whapps/voip/media/tmpl/media_callflow.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,19 @@ <h1>${_t('connect_caller_to_media')}</h1>
</div>

<div class="parameter_div">
${_t('route_var_ccv')} <input type="text" id="route_var" value="${route_var}"/>
{{if route_var.length == 0}}
<input type="checkbox" id="toggle_advanced"> Advanced
<div id="route_var_div" style="display: none;">
${_t('route_var_ccv')}
<input type="text" id="route_var" value="${route_var}"/>
</div>
{{else}}
<input type="checkbox" checked="checked" id="toggle_advanced"> Advanced
<div id="route_var_div">
${_t('route_var_ccv')}
<input type="text" id="route_var" value="${route_var}"/>
</div>
{{/if}}
</div>
</form>
<div class="buttons-center">
Expand Down
17 changes: 16 additions & 1 deletion whapps/voip/menu/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,8 @@ winkstart.module('voip', 'menu', {
return window.translate['menu'][param];
},
items: winkstart.sort(data.data),
selected: node.getMetadata('id') || ''
selected: node.getMetadata('id') || '',
route_var: node.getMetadata('var') || ''
});

if($('#menu_selector option:selected', popup_html).val() == undefined) {
Expand All @@ -611,15 +612,29 @@ winkstart.module('voip', 'menu', {

winkstart.publish('menu.popup_edit', _data, function(_data) {
node.setMetadata('id', _data.data.id || 'null');
if($('#route_var', popup_html).val().length > 0) {
node.setMetadata('var', $('#route_var', popup_html).val());
} else {
node.deleteMetadata('var');
}

node.caption = _data.data.name || '';

popup.dialog('close');
});
});

$('#toggle_advanced', popup_html).click(function () {
$('#route_var_div', popup_html).toggle();
});

$('#add', popup_html).click(function() {
node.setMetadata('id', $('#menu_selector', popup).val());
if($('#route_var', popup_html).val().length > 0) {
node.setMetadata('var', $('#route_var', popup_html).val());
} else {
node.deleteMetadata('var');
}

node.caption = $('#menu_selector option:selected', popup).text();

Expand Down
17 changes: 17 additions & 0 deletions whapps/voip/menu/tmpl/menu_callflow.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,25 @@ <h1>${_t('connect_caller_to_menu')}</h1>
</div>
<div class="clear"/>
</div>
<div class="clear"/>
</div>
</div>

<div class="parameter_div">
{{if route_var.length == 0}}
<input type="checkbox" id="toggle_advanced"> Advanced
<div id="route_var_div" style="display: none;">
${_t('route_var_ccv')}
<input type="text" id="route_var" value="${route_var}"/>
</div>
{{else}}
<input type="checkbox" checked="checked" id="toggle_advanced"> Advanced
<div id="route_var_div">
${_t('route_var_ccv')}
<input type="text" id="route_var" value="${route_var}"/>
</div>
{{/if}}
</div>
</form>
<div class="buttons-center">
<button id="add" class="btn primary">OK</button>
Expand Down
4 changes: 4 additions & 0 deletions whapps/voip/queue/queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,10 @@ winkstart.module('voip', 'queue', {
});
});

$('#toggle_advanced', popup_html).click(function () {
$('#route_var_div', popup_html).toggle();
});

$('#add', popup_html).click(function() {
node.setMetadata('id', $('#queue_selector', popup).val());
if($('#route_var', popup_html).val().length > 0) {
Expand Down
14 changes: 13 additions & 1 deletion whapps/voip/queue/tmpl/queue_callflow.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,19 @@ <h1>${_t('connect_caller_to_queue')}</h1>
</div>

<div class="parameter_div">
${_t('route_var_ccv')} <input type="text" id="route_var" value="${route_var}"/>
{{if route_var.length == 0}}
<input type="checkbox" id="toggle_advanced"> Advanced
<div id="route_var_div" style="display: none;">
${_t('route_var_ccv')}
<input type="text" id="route_var" value="${route_var}"/>
</div>
{{else}}
<input type="checkbox" checked="checked" id="toggle_advanced"> Advanced
<div id="route_var_div">
${_t('route_var_ccv')}
<input type="text" id="route_var" value="${route_var}"/>
</div>
{{/if}}
</div>
</form>
<div class="buttons-center">
Expand Down
14 changes: 13 additions & 1 deletion whapps/voip/user/tmpl/user_callflow.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,19 @@ <h1>${_t('connect_caller_to_user')}</h1>
</div>

<div class="parameter_div">
${_t('route_var_ccv')} <input type="text" id="route_var" value="${route_var}"/>
{{if route_var.length == 0}}
<input type="checkbox" id="toggle_advanced"> Advanced
<div id="route_var_div" style="display: none;">
${_t('route_var_ccv')}
<input type="text" id="route_var" value="${route_var}"/>
</div>
{{else}}
<input type="checkbox" checked="checked" id="toggle_advanced"> Advanced
<div id="route_var_div">
${_t('route_var_ccv')}
<input type="text" id="route_var" value="${route_var}"/>
</div>
{{/if}}
</div>
</form>
<div class="buttons-center">
Expand Down
4 changes: 4 additions & 0 deletions whapps/voip/user/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -1058,6 +1058,10 @@ winkstart.module('voip', 'user', {
});
});

$('#toggle_advanced', popup_html).click(function () {
$('#route_var_div', popup_html).toggle();
});

$('#add', popup_html).click(function() {
node.setMetadata('id', $('#user_selector', popup_html).val());
node.setMetadata('timeout', $('#parameter_input', popup_html).val());
Expand Down
14 changes: 13 additions & 1 deletion whapps/voip/vmbox/tmpl/vmbox_callflow.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,19 @@ <h1>${_t('connect_caller_to_voicemail')}</h1>
</div>

<div class="parameter_div">
${_t('route_var_ccv')} <input type="text" id="route_var" value="${route_var}"/>
{{if route_var.length == 0}}
<input type="checkbox" id="toggle_advanced"> Advanced
<div id="route_var_div" style="display: none;">
${_t('route_var_ccv')}
<input type="text" id="route_var" value="${route_var}"/>
</div>
{{else}}
<input type="checkbox" checked="checked" id="toggle_advanced"> Advanced
<div id="route_var_div">
${_t('route_var_ccv')}
<input type="text" id="route_var" value="${route_var}"/>
</div>
{{/if}}
</div>
</div>
</form>
Expand Down
4 changes: 4 additions & 0 deletions whapps/voip/vmbox/vmbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,10 @@ winkstart.module('voip', 'vmbox', {
});
});

$('#toggle_advanced', popup_html).click(function () {
$('#route_var_div', popup_html).toggle();
});

$('#add', popup_html).click(function() {
node.setMetadata('id', $('#vmbox_selector', popup_html).val());
if($('#route_var', popup_html).val().length > 0) {
Expand Down

0 comments on commit ce4897d

Please sign in to comment.