Show
Ignore:
Timestamp:
04/07/11 01:49:34 (2 years ago)
Author:
GameGamer43
Message:

closes #4871 - adds js to core module to do dup ext check onsubmit()

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.9/core/functions.inc.php

    r11961 r11969  
    63696369      $currentcomponent->addjsfunc('onsubmit()', "\treturn checkBlankUserPwd();\n", 9); 
    63706370    } 
     6371    $currentcomponent->addjsfunc('onsubmit()', " 
     6372      var exten = $('#extension').val(); 
     6373      var ajax_result = true; 
     6374      $('#error').remove(); 
     6375      $.ajax({ 
     6376        type: 'POST', 
     6377        url: 'config.php', 
     6378        data: 'handler=api&function=framework_get_conflict_url_helper&args=' + exten, 
     6379        dataType: 'json', 
     6380        cache: false, 
     6381        async: false, 
     6382        success: function(data, textStatus, XMLHttpRequest) { 
     6383          if (data.length !== 0) { 
     6384            $('#title').after('<div id=\"error\"><h5>"._("Conflicting Extensions")."</h5>' + data + '</div>'); 
     6385            ajax_result = false; 
     6386          } 
     6387        }, 
     6388        error: function(data) { 
     6389          console.log('an error was recevied: ' + data); 
     6390          // TODO: Should we stop the submital and do something here? 
     6391        } 
     6392      }); 
     6393      if (!ajax_result) { 
     6394        alert('". _("Extension number conflict, please choose another.") . "'); 
     6395        $('#extension').focus(); 
     6396        return false; 
     6397    }", 9); 
    63716398    $currentcomponent->addguielem($section, new gui_textbox('name', $name, _("Display Name"), _("The CallerID name for calls from this user will be set to this name. Only enter the name, NOT the number."),  '!isAlphanumeric() || isWhitespace()', $msgInvalidDispName, false)); 
    63726399    $cid_masquerade = (trim($cid_masquerade) == $extdisplay)?"":$cid_masquerade;