rbrindley: branch 2.0 r4792 - /branches/2.0/config/js/features2.js
SVN commits to the Asterisk-GUI project
asterisk-gui-commits at lists.digium.com
Mon May 18 08:16:16 CDT 2009
Author: rbrindley
Date: Mon May 18 08:16:12 2009
New Revision: 4792
URL: http://svn.asterisk.org/svn-view/asterisk-gui?view=rev&rev=4792
Log:
- fixed an issue where the park a call exten could overlap the parking lot extens
- fixed an issue where extension ranges were being improperly read from
gui_preferences.conf
Modified:
branches/2.0/config/js/features2.js
Modified: branches/2.0/config/js/features2.js
URL: http://svn.asterisk.org/svn-view/asterisk-gui/branches/2.0/config/js/features2.js?view=diff&rev=4792&r1=4791&r2=4792
==============================================================================
--- branches/2.0/config/js/features2.js (original)
+++ branches/2.0/config/js/features2.js Mon May 18 08:16:12 2009
@@ -73,6 +73,16 @@
/* lets validate */
validate(val, {num: true, positive: true, extens: true});
+ /* custom validation to make sure it doesn't step over parkpos */
+ var parkpos = $('#parkpos').val();
+ parkpos = parkpos.split('-');
+ parkpos[0] = parseInt(parkpos[0], 10);
+ parkpos[1] = parseInt(parkpos[1], 10);
+ /* return error if parkpos is properly defined and val is inbetween the parkpos numbers */
+ if (!isNaN(parkpos[0]) && !isNaN(parkpos[1]) && val >= parkpos[0] && val <= parkpos[1]) {
+ throw RangeError('Invalid: Conflicts with Parked Call extensions (' + parkpos[0] + '-' + parkpos[1] + ').');
+ }
+
/* kk, all good, now update asterisk and go */
return sendUpdate({cxt: 'general', name: 'parkext', val: val});
};
@@ -612,8 +622,8 @@
continue;
}
- var start = gui_conf[pref + '_start'];
- var end = gui_conf[pref + '_end'];
+ var start = parseInt(gui_conf[pref + '_start'], 10);
+ var end = parseInt(gui_conf[pref + '_end'], 10);
if (val >= start && val <= end) {
top.log.warn('validate: conflicts with ' + pref + '.');
More information about the asterisk-gui-commits
mailing list