pari: branch 2.0 r4206 - /branches/2.0/config/js/users.js
SVN commits to the Asterisk-GUI project
asterisk-gui-commits at lists.digium.com
Mon Nov 24 15:06:22 CST 2008
Author: pari
Date: Mon Nov 24 15:06:21 2008
New Revision: 4206
URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=4206
Log:
When suggesting a new extension, consider all extensions on the system to check for duplicates.
Modified:
branches/2.0/config/js/users.js
Modified: branches/2.0/config/js/users.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/users.js?view=diff&rev=4206&r1=4205&r2=4206
==============================================================================
--- branches/2.0/config/js/users.js (original)
+++ branches/2.0/config/js/users.js Mon Nov 24 15:06:21 2008
@@ -234,11 +234,8 @@
ASTGUI.updateFieldToValue( 'edit_hasIax', 'yes' );
ASTGUI.updateFieldToValue( 'edit_flash', '750' );
ASTGUI.updateFieldToValue( 'edit_rxflash', '1250' );
- var ul = ASTGUI.cloneObject( parent.astgui_manageusers.listOfUsers() );
- if( parent.sessionData.pbxinfo['localextensions'].hasOwnProperty('VoiceMailMain') ){
- ul.push( ASTGUI.parseContextLine.getExten( parent.sessionData.pbxinfo['localextensions']['VoiceMailMain'] ) );
- }
- var tmp_newEXT = ul.firstAvailable( parent.sessionData.GUI_PREFERENCES.getProperty('ue_start') );
+ var tmp_allextensions = ASTGUI.cloneObject( parent.miscFunctions.getAllExtensions() );
+ var tmp_newEXT = tmp_allextensions.firstAvailable( parent.sessionData.GUI_PREFERENCES.getProperty('ue_start') );
ASTGUI.updateFieldToValue( 'new_ext', tmp_newEXT );
$('#edit_callerid_span').html(tmp_newEXT);
}
@@ -399,15 +396,14 @@
}
if( isNewUSER ){
-
var NU_EXT = ASTGUI.getFieldValue('new_ext');
+ if( parent.miscFunctions.ifExtensionAlreadyExists(NU_EXT) ){
+ ASTGUI.highlightField('new_ext', 'Extension already exists');
+ parent.ASTGUI.dialog.hide();
+ return;
+ }
if( ! ASTGUI.miscFunctions.isExtensionInRange( NU_EXT ,'ue_start','ue_end') ){
ASTGUI.highlightField('new_ext' , 'Extension is not in preferred range');
- parent.ASTGUI.dialog.hide();
- return;
- }
- if( parent.miscFunctions.ifExtensionAlreadyExists(NU_EXT) ){
- ASTGUI.highlightField('new_ext', 'Extension already exists');
parent.ASTGUI.dialog.hide();
return;
}
More information about the asterisk-gui-commits
mailing list