)
),
'ringexten' => array(
- 'description' => _("Ring an extension."),
+ 'description' => _("Ring extension"),
'args' => array(
'exten' => array(
'name' => _("Extension"),
)
),
'leave_message' => array(
- 'description' => _("Leave a message."),
+ 'description' => _("Go to voicemail"),
'args' => array(
'mailbox' => array(
'name' => _("Mailbox"),
'type' => 'enum',
'required' => true,
'params' => array(self::getNames($shout->extensions->getExtensions($account)))
- )
+ )
)
),
'conference' => array(
- 'description' => _("Enter conference room"),
+ 'description' => _("Enter conference"),
'args' => array(
'roomno' => array(
'name' => _("Room Number"),
)
),
'directory' => array(
- 'description' => _("Enter company directory."),
+ 'description' => _("Company directory"),
'args' => array()
),
'dial' => array(
- 'description' => _("Place an outgoing call."),
+ 'description' => _("Call out"),
'args' => array(
'number' => array(
'name' => _("Phone Number"),
)
),
'rewind' => array(
- 'description' => _("Restart the current menu."),
+ 'description' => _("Restart menu"),
'args' => array()
),
// TODO: Actions to implement: Queue
var menu = '<?php echo $menu['name']; ?>';
var menuInfo = $H();
var menuActions = $H(<?php echo Horde_Serialize::serialize(Shout::getMenuActions(), Horde_Serialize::JSON, Horde_Nls::getCharset()); ?>);
+var destinations = $H(<?php echo Horde_Serialize::serialize($destinations, Horde_Serialize::JSON, Horde_Nls::getCharset()); ?>);
var curDigit = null;
function editAction(digit)
}
});
var params = $H({'action': action});
- var actionForm;
new Ajax.Updater('editAction', ajax_url + 'getActionForm',
{
method: 'post',
var meta = menuInfo.get('meta');
+ // Draw the menu metainfo box
row = getMetaRow('<?php echo _("Menu Name"); ?>', meta.name);
$('menuInfo').appendChild(row);
row = getMetaRow('<?php echo _("Description"); ?>', meta.description);
text = document.createTextNode('<?php echo _("Sound file"); ?>');
col.appendChild(text);
row.appendChild(col);
-
col = document.createElement('td');
col.className='menuStatValue';
text = document.createTextNode(meta.soundfile);
col.appendChild(img);
row.appendChild(col);
$('menuInfo').appendChild(row);
+
+ // Fill in the actions
+ $H(menuInfo.get('actions')).each(function (pair) {
+ var text;
+ var digit = pair.key;
+ var action = pair.value.action;
+ var button = $('digit_'+digit);
+ empty(button);
+ var p = document.createElement('p');
+ p.className = 'buttonActionLabel';
+ var span = document.createElement('span');
+ span.className='digitLabel';
+ if (digit == 'star') {
+ text = document.createTextNode('*');
+ } else if (digit == 'octothorpe') {
+ text = document.createTextNode('#');
+ } else {
+ text = document.createTextNode(digit);
+ }
+ span.appendChild(text);
+ p.appendChild(span);
+ text = document.createTextNode(menuActions.get(action).description);
+ p.appendChild(text);
+ button.appendChild(p);
+
+ p = document.createElement('p');
+ p.className = 'buttonDetail';
+
+ switch(action) {
+ case 'jump':
+ var menu = pair.value.args.first()['menuName'];
+ text = document.createTextNode(destinations.get(exten).name);
+ break;
+ case 'ringexten':
+ case 'leave_message':
+ // FIXME: Why do I need first() here?
+ var exten = pair.value.args.first()['exten'];
+ text = document.createTextNode(destinations.get(exten).name);
+ break;
+ case 'conference':
+ var roomno = pair.value.args.first()['roomno'];
+ if (roomno != null) {
+ text = document.createTextNode(roomno);
+ } else {
+ text = document.createTextNode('');
+ }
+ break;
+ case 'dial':
+ var number = pair.value.args.first()['number'];
+ text = document.createTextNode(number);
+ break;
+ default:
+ text = document.createTextNode('');
+ break;
+ }
+
+ p.appendChild(text);
+ button.appendChild(p);
+ });
}
function getMetaRow(name, value)