Changeset 1612 for trunk/contactcenter


Ignore:
Timestamp:
11/10/09 11:03:46 (14 years ago)
Author:
eduardoalex
Message:

Ticket #723 - Ajustado o tamanho maximo do telefone para 30 e adicionado regex para formatar o telefone

Location:
trunk/contactcenter
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/contactcenter/inc/class.ui_api.inc.php

    r1517 r1612  
    392392                                else if ($i == 4){ 
    393393                                        $fieldsHTML .= '<input id="ccQuickAddI'.$i.'" type="text" value="" maxlength="100" style="position: absolute; top: '.($fieldsTop+$i*$fieldsSpace).'px; left: 110px; width: 135px;">'."\n"; 
     394                                }else if ($i == 3){ 
     395                                        $fieldsHTML .= '<input id="ccQuickAddI'.$i.'" type="text" value="" onkeyup="formatPhone(this)" maxlength="30" style="position: absolute; top: '.($fieldsTop+$i*$fieldsSpace).'px; left: 110px; width: 135px;">'."\n"; 
    394396                                } 
    395397                                else { 
  • trunk/contactcenter/js/cc.js

    r1599 r1612  
    13921392                        //'<td style="width: 30px;" align="right"><input name="cc_conn_is_default" id="cc_conn_is_default_'+ CC_conn_count +'" type="radio"></td>'+ 
    13931393                        '<td style="width: 10px;" align="right"><input id="cc_conn_name_'+CC_conn_count+'" type="hidden"><td style="width: 100px;" align="right"><span style="width: 150px;" id="cc_conn_label_'+CC_conn_count+'">'+_label+'</span></td>' + 
    1394                         '<td align="left"><input id="cc_conn_value_'+ CC_conn_count +'" style="width: 150px;" maxlength="50" type="text">&nbsp;' + 
     1394                        '<td align="left"><input id="cc_conn_value_'+ CC_conn_count +'" style="width: 150px;" maxlength="30" type="text" onkeyup="formatPhone(this)">&nbsp;' + 
    13951395                        '<img align="top" alt="X" src="templates/default/images/x.png" style="width:18px; height:18px" onclick="javascript:removeConnField(\'cc_conn_tr_' + CC_conn_count + '\')"></td>'; 
    13961396                } 
  • trunk/contactcenter/js/ccAux.js

    r1411 r1612  
    413413} 
    414414 
     415function formatPhone(obj){ 
     416        if (!Element("cc_conn_type_1").checked) { 
     417                obj.value = obj.value.replace(/[^\-\d\+\(\)\sx]/g, ""); 
     418        }   
     419} 
     420 
     421 
    415422/***********************************************\ 
    416423*                   CONSTANTS                   * 
  • trunk/contactcenter/js/ccQuickAdd-plugin.js

    r2 r1612  
    200200                        return false; 
    201201                } 
    202                  
    203                 //Utiliza expressão regular para validar telefone 
    204                 var rePhone = /^[0-9|(-)| |-]{0,15}$/; 
    205                  
    206                 if (!rePhone.test(this._fields[3].value)){ 
    207                         alert("O número de telefone '" + this._fields[3].value + "' não é valido! Utilize apenas números.\n" + 
    208                         "Parenteses, traços ou espaços em branco podem ser usados como carácter separador."); 
    209                         return false; 
    210                 }  
    211                  
     202                                                 
    212203                var sdata = 'add='+escape(serialize(sdata)); 
    213204 
  • trunk/contactcenter/js/ccQuickAddContact.js

    r1496 r1612  
    148148                        return false; 
    149149                } 
    150                  
    151                 //Utiliza expressão regular para validar telefone 
    152                 var rePhone = /^[0-9|(-)| |-]{0,15}$/; 
    153                  
    154                 if (!rePhone.test(sdata[3])){ 
    155                         alert("O número de telefone '" + sdata[3] + "' não é valido! Utilize apenas números.\n" + 
    156                         "Parenteses, traços ou espaços em branco podem ser usados como carácter separador."); 
    157                         return false; 
    158                 }  
    159                  
     150                                 
    160151                var sdata = 'add='+escape(serialize(sdata)); 
    161152 
Note: See TracChangeset for help on using the changeset viewer.