Changeset 572


Ignore:
Timestamp:
01/07/09 15:19:37 (15 years ago)
Author:
niltonneto
Message:

Resolve #381

Location:
trunk/admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/js/voip/functions.js

    r395 r572  
    5959        } 
    6060         
     61        function LTrim(value) 
     62        { 
     63                var w_space = String.fromCharCode(32); 
     64                var strTemp = ""; 
     65                var iTemp = 0; 
     66                 
     67                if(v_length < 1) 
     68                        return ""; 
     69         
     70                var v_length = value ? value.length : 0; 
     71                 
     72                while(iTemp < v_length) 
     73                { 
     74                        if(value && value.charAt(iTemp) != w_space) 
     75                        { 
     76                                strTemp = value.substring(iTemp,v_length); 
     77                                break; 
     78                        } 
     79                        iTemp++; 
     80                }        
     81                return strTemp; 
     82        } 
     83         
     84         
    6185        function SearchOu() 
    6286        { 
     
    7397                        for(var i = 0; i < element.options.length ; i++ ) 
    7498                                if( element.options[i].selected ) 
    75                                         organization =  element.options[i].value; 
    76  
    77                 organization = 'ou=' + organization; 
     99                                        organization = 'ou=' + element.options[i].value; 
    78100 
    79101                _conn.go('$this.bovoip.getGroupsLdap', CompleteSelect, organization); 
     
    83105        { 
    84106                var select_voip = document.getElementById('groups_voip'); 
    85                 for(var i = 0 ; i < select_voip.options.length; i++ ) 
     107                for( var i = 0 ; i < select_voip.options.length; i++ ) 
    86108                        select_voip.options[i].selected = true; 
    87109        } 
     
    103125                        } 
    104126        } 
     127         
     128        function validateEmail() 
     129        { 
     130                if( arguments.length > 0 ) 
     131                { 
     132                        var element = arguments[0]; 
     133                        var validate = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; 
     134                         
     135                        if(LTrim(element.value) != "" && element.value != "") 
     136                        { 
     137                                if(!validate.test(element.value)) 
     138                                { 
     139                                        alert('Email field is not valid' + '.'); 
     140                                        element.focus(); 
     141                                        return false; 
     142                                } 
     143                        } 
     144                } 
     145        } 
    105146 
    106147        function Voip() 
     
    113154        Voip.prototype.remove   = removeGroup; 
    114155        Voip.prototype.select_  = Selected; 
     156        Voip.prototype.validateEmail = validateEmail; 
    115157        window.voip = new Voip; 
    116158 
  • trunk/admin/templates/default/voip.tpl

    r357 r572  
    1717                <td>{lang_Enter_your_VoIP_server_port}:</td> 
    1818                <td><input name="voip_port" value="{value_voip_port}"></td> 
     19        </tr> 
     20        <tr class="row_on"> 
     21                <td>{lang_Email_Voip}</td> 
     22                <td><input name="voip_email_redirect" value="{value_voip_email_redirect}" size="50" maxlength="50" onblur="javascript:voip.validateEmail(this);"></td> 
    1923        </tr> 
    2024        <tr class="th"> 
Note: See TracChangeset for help on using the changeset viewer.