<!DOCTYPE webproject>
<webproject>
- <project usePreviewPrefix="0" previewPrefix="" type="Local" usePersistentBookmarks="0" name="Shout" encoding="iso 8859-1" enableEvents="true" >
+ <project usePreviewPrefix="0" type="Local" previewPrefix="" usePersistentBookmarks="0" name="Shout" encoding="iso 8859-1" enableEvents="true" >
<upload/>
<defaultDTD>-//w3c//dtd xhtml 1.0 strict//en</defaultDTD>
<item url="config/" uploadstatus="1" />
<item modified_time="1131497449" url="lib/base.php" uploadstatus="1" />
<item modified_time="1131851216" url="lib/Dialplan.php" uploadstatus="1" />
<item modified_time="1130769960" url="lib/Driver.php" uploadstatus="1" />
- <item modified_time="1131826057" url="lib/Shout.php" uploadstatus="1" />
+ <item modified_time="1131864412" url="lib/Shout.php" uploadstatus="1" />
<item modified_time="1121689003" url="lib/System.php" uploadstatus="1" />
<item modified_time="1130769961" url="lib/User.php" uploadstatus="1" />
<item url="main/" uploadstatus="1" />
<uploadeditem upload_time="1130769960" url="lib/Driver.php" />
<uploadeditem upload_time="0" url="lib/Driver/" />
<uploadeditem upload_time="1131765770" url="lib/Driver/ldap.php" />
- <uploadeditem upload_time="1131826057" url="lib/Shout.php" />
+ <uploadeditem upload_time="1131864412" url="lib/Shout.php" />
<uploadeditem upload_time="1121689003" url="lib/System.php" />
<uploadeditem upload_time="1130769961" url="lib/User.php" />
<uploadeditem upload_time="1131600576" url="lib/api.php" />
<uploadeditem upload_time="1121689030" url="templates/dialplan/priority-form-end.inc" />
<uploadeditem upload_time="1121689030" url="templates/dialplan/priority-form-line.inc" />
<uploadeditem upload_time="0" url="templates/javascript/" />
- <uploadeditem upload_time="1131864070" url="templates/javascript/dialplan.js" />
+ <uploadeditem upload_time="1131941381" url="templates/javascript/dialplan.js" />
<uploadeditem upload_time="1131772201" url="templates/menu.inc" />
<uploadeditem upload_time="1121578596" url="templates/table-limiter-begin.inc" />
<uploadeditem upload_time="1121578596" url="templates/table-limiter-end.inc" />
<item modified_time="1131045729" url="lib/defines.php" uploadstatus="1" />
<item modified_time="1131497712" url="security.php" uploadstatus="1" />
<item url="templates/javascript/" uploadstatus="1" />
- <item modified_time="1131864070" url="templates/javascript/dialplan.js" uploadstatus="1" />
+ <item modified_time="1131941381" url="templates/javascript/dialplan.js" uploadstatus="1" />
<item modified_time="1131784175" url="templates/dialplan/manager.inc" uploadstatus="1" />
<treestatus>
<openfolder url="lib" />
} else {
var form = '';
- //form += '<form id="renumber">';
form += ' <span class="priorityBox">';
- form += ' <input type="text" size="3" maxlength="3" name="newprio" value="'+this.curPrio+'" />';
+ form += ' <input id="p" type="text" size="3" maxlength="3" name="newprio"';
+ form += ' value="'+this.curPrio+'" />';
form += ' </span>';
- //form += '</form>';
document.getElementById('pBox-'+this.curExten+'-'+this.curPrio).innerHTML = form;
+ document.getElementById('pBox-'+this.curExten+'-'+this.curPrio).p.focus;
+ document.getElementById('pBox-'+this.curExten+'-'+this.curPrio).p.select;
}
}
document.getElementById('priority-'+this.curExten+'-'+this.curPrio).className = 'priority';
document.getElementById('pButtons-'+this.curExten+'-'+this.curPrio).style['visibility'] = 'hidden';
}
+ this.curPrio = 0;
}
Dialplan.prototype.drawPrioTable = function (exten)
table += ' <span class="pElement" id="pApp-'+exten+'-'+p+'"\n';
table += ' name="pApp-'+exten+'-'+p+'">\n';
table += ' <span class="applicationBox"></span>\n';
- table += ' <select name="app['+exten+']['+p+']">\n';
+ table += ' <select name="app['+exten+']['+p+']"';
+ table += 'onclick="javascript:'+this.object+'.activatePriority(\''+exten+'\', ';
+ table += '\''+p+'\')">\n';
table += this.genAppList(this.dp[exten]['priorities'][p]['application']);
table += ' </select>\n';
table += ' </span>\n';
for (p in this.dp[exten]['priorities']) {
p = Number(p);
- prio = Number(prio);
// Make a notch for the new priority by incrementing all priorities greater
// than the requested one. Try to exclude error handling priorities
// which are unrelated to the changed extension. See README for
// error handling priorities.
if (p > prio && (p < prio + 90 || p > prio + 100)) {
tmp[p + 1] = this.dp[exten]['priorities'][p];
- plist[i] = p + 1;
+ plist[i++] = p + 1;
} else {
tmp[p] = this.dp[exten]['priorities'][p];
- plist[i] = p;
+ plist[i++] = p;
}
- i++;
}
// Seed the new priority
- var newP = Number(prio) + 1;
- tmp[newP] = new Array();
- tmp[newP]['application'] = '';
- tmp[newP]['args'] = '';
- plist[i] = newP;
+ p = prio + 1;
+ tmp[p] = new Array();
+ tmp[p]['application'] = '';
+ tmp[p]['args'] = '';
+ plist[i] = p;
// Empty the original array
// Sort the priorities and put them back into the original array
plist.sort(this._numCompare);
for (i = 0; i < plist.length; i++) {
-
p = Number(plist[i]);
this.dp[exten]['priorities'][p] = tmp[p];
}
}
+
this.curPrio = 0;
this.drawPrioTable(exten);
+ this.activatePriority(exten, prio);
+ return true;
}
Dialplan.prototype.delPrio = function(exten, prio)
{
prio = Number(prio);
if (this.dp[exten]['priorities'][prio] != 'undefined') {
+ // The .length method on this array always reports number of priorities + 1;
+ // Haven't yet solved this mystery but the below test does work correctly.
+ if (this.dp[exten]['priorities'].length <= 2) {
+ alert('Extensions must have at least one priority');
+ return false;
+ }
// Due to javascript's inability to remove an array element while maintaining
// associations, we copy the elements into a tmp array and ultimately replace
// the object's copy. We will also have to sort the resulting array manually
// TODO: Make a decision about whether this is the best way to handle
// error handling priorities.
p = Number(p);
- if (p != prio) {
- if (p > prio && (p < prio + 90 || p > prio + 100)) {
- p = Number(p) - 1;
- }
+ if (p > prio && (p < prio + 90 || p > prio + 100)) {
+ tmp[p - 1] = this.dp[exten]['priorities'][p];
+ plist[i++] = p - 1;
+ } else if (p != prio) {
tmp[p] = this.dp[exten]['priorities'][p];
plist[i++] = p;
}
this.dp[exten]['priorities'][p] = tmp[p];
}
}
+
this.curPrio = 0;
this.drawPrioTable(exten);
+ return true;
}
Dialplan.prototype._numCompare = function(a, b)