<!--
var destinations = [];
+var ajax_url = '<?php echo Horde::getServiceLink('ajax', 'shout') ?>';
function resetExtenDest(exten)
{
var form = document.createElement('form');
form.method = 'post';
- form.action = '#';
+ form.action = ajax_url + 'addDestination';
form.id = 'destX' + exten + 'form';
var hidden = document.createElement('input');
hidden.type = 'hidden';
}
// FIXME: Better error handling
- new Ajax.Request('<?php echo Horde::serviceLink('ajax', 'shout') ?>',
+ new Ajax.Request(form.readAttribute('action'),
{
method: 'post',
parameters: form.serialize(true),
var params = $H({
'extension': exten,
'type': type,
- 'destination': dest,
- 'action': 'deleteDestination'
+ 'destination': dest
});
}
// FIXME: Better error handling
- new Ajax.Request('<?php echo Horde::serviceLink('ajax', 'shout') ?>',
+ new Ajax.Request(ajax_url + 'deleteDestination',
{
method: 'post',
parameters: params,
destinations = $H();
-new Ajax.Request('<?php echo Horde::serviceLink('ajax', 'shout') ?>',
+new Ajax.Request(ajax_url + 'getDestinations',
{
method: 'post',
- parameters: $H({'action': 'getDestinations'}),
onSuccess: function(r) {
destinations = $H(r.responseJSON.response);
resetDestInfo(true);