Ignore:
Timestamp:
05/23/08 17:10:39 (16 years ago)
Author:
brunocosta
Message:

Correção dos problemas gerados no commit anterior, a funcionalidade citada no ticket #199 foram temporariamente desativadas.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/contactcenter/js/ccQuickAddContact.js

    r284 r285  
    66        } 
    77 
    8  
     8         
    99        cQuickAddContact.prototype.showList = function(id){ 
    1010                _this = this; 
    1111                var handler = function (responseText) { 
    1212                        var contacts = unserialize(responseText); 
    13                         var title = contacts['names_ordered']; 
    14                         el = document.createElement("DIV"); 
    15                         el.style.visibility = "hidden"; 
     13                        var title = contacts['names_ordered'];                   
     14                        el = document.createElement("DIV");                                                                      
     15                        el.style.visibility = "hidden";                                                                  
    1616                        el.style.position = "absolute"; 
    1717                        el.style.left = "0px"; 
     
    2121                        el.style.height = wHeight + 'px'; 
    2222                        el.className = "div_cc_rectQuickAddContact"; 
    23                         el.id = id+':cc_rectQuickAddContact'; 
    24                         document.body.appendChild(el); 
    25                         el.innerHTML = ""; 
     23                        el.id = id+':cc_rectQuickAddContact';                                                                                                                                                                                    
     24                        document.body.appendChild(el);                                                                                                                           
     25                        el.innerHTML = "";                                                               
    2626 
    2727                        var fieldsTop = 10; 
    2828                        var fieldsSpace = 30; 
    2929                        fields = new Array(Element('cc_qa_alias').value, Element('cc_qa_given_names').value, Element('cc_qa_family_names').value, Element('cc_qa_phone').value, Element('cc_qa_email').value); 
    30  
     30                         
    3131                        for (i=0; i<fields.length; i++) { 
    3232                                var contact = contacts[i] != null ? contacts[i] : ''; 
     
    4343                                { 
    4444                                        el.innerHTML += '<input id="ccQuickAddCI' + i + id + '" type="text" value="' + contact + '" maxlength="50" style="position: absolute; top: ' + (fieldsTop+i*fieldsSpace) + 'px; left: 110px; width: 135px;">'; 
    45                                 } 
     45                                }                                
    4646                        } 
    47  
     47                         
    4848                        el.innerHTML +='<div id="ccQAFuncitons" style="border: 0px solid black; width: 220px; height: 20px">' + 
    49                                 '<input title="ccQASave" type="button" onclick="ccQuickAddContact.send(\'' + id + '\');" value="' + Element('cc_qa_save').value + '" style="position: absolute; top: ' + (fieldsTop+i*fieldsSpace) + 'px; left: 75px; width: 60px" />' + 
    50                                 '<input title="ccQAClear" type="button" onclick="ccQuickAddContact.fechar(\'' + id + '\');" value="' + Element('cc_qa_clear').value + '" style="position: absolute; top: ' + (fieldsTop+i*fieldsSpace) + 'px; left: 140px; width: 60px" />' + 
     49                                '<input title="' + Element('cc_qa_save').value + '" type="button" onclick="ccQuickAddContact.send(\'' + id + '\');" value="' + Element('cc_qa_save').value + '" style="position: absolute; top: ' + (fieldsTop+i*fieldsSpace) + 'px; left: 75px; width: 60px" />' + 
     50                                '<input title="' + Element('cc_qa_close').value + '" type="button" onclick="ccQuickAddContact.fechar(\'' + id + '\');" value="' + Element('cc_qa_close').value + '" style="position: absolute; top: ' + (fieldsTop+i*fieldsSpace) + 'px; left: 140px; width: 60px" />' + 
    5151                                '</div>'; 
    5252                        el.innerHTML += "<br>"; 
    53  
     53                                                                 
    5454                        _this.showWindow(el); 
    5555                } 
    56  
     56                 
    5757                div = document.getElementById(id+':cc_rectQuickAddContact'); 
    58  
     58                                 
    5959                if(div) 
    6060                        this.showWindow(div); 
     
    6363                } 
    6464        } 
    65  
     65         
    6666        cQuickAddContact.prototype.showWindow = function (div) 
    67         { 
     67        {                                                
    6868                if(! this.arrayWin[div.id]) { 
    6969 
    70                         win = new dJSWin({ 
     70                        win = new dJSWin({                       
    7171                                id: 'ccQuickAddContact_'+div.id, 
    7272                                content_id: div.id, 
     
    7575                                title_color: '#3978d6', 
    7676                                bg_color: '#eee', 
    77                                 title: Element('ccQATitle').value, 
     77                                title: Element('ccQATitle').value,                                               
    7878                                title_text_color: 'white', 
    7979                                button_x_img: Element('cc_phpgw_img_dir').value+'/winclose.gif', 
    8080                                border: true }); 
    81  
     81                         
    8282                        this.arrayWin[div.id] = win; 
    83                         win.draw(); 
     83                        win.draw();                      
    8484                } 
    8585                else { 
    8686                        win = this.arrayWin[div.id]; 
    87                 } 
     87                }                        
    8888                win.open(); 
    8989        } 
    90  
     90         
    9191        cQuickAddContact.prototype.send = function (id) 
    9292        { 
     
    115115                                return; 
    116116                        } 
    117  
     117                         
    118118                        win.close(); 
    119119 
     
    132132                        } 
    133133                } 
    134  
     134         
    135135                var sdata = new Array(); 
    136  
     136                 
    137137                for (var f = 0; f < 5; f++){ 
    138138                        sdata[f] = document.getElementById('ccQuickAddCI' + f + id).value; 
    139139                } 
    140  
     140                 
    141141                //Utiliza expressão regular para validar email 
    142142                var reEmail = /^[A-Za-z\d_-]+(\.[A-Za-z\d_-]+)*@(([A-Za-z\d][A-Za-z\d-]{0,61}[A-Za-z\d]\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/; 
     
    147147                        return false; 
    148148                } 
    149  
     149                 
    150150                //Utiliza expressão regular para validar telefone 
    151151                var rePhone = /^[0-9|(-)| |-]{0,15}$/; 
    152  
     152                 
    153153                if (!rePhone.test(sdata[3])){ 
    154154                        alert("O número de telefone '" + sdata[3] + "' não é valido! Utilize apenas números.\n" + 
    155155                        "Parenteses, traços ou espaços em branco podem ser usados como carácter separador."); 
    156156                        return false; 
    157                 } 
    158  
     157                }  
     158                 
    159159                var sdata = 'add='+escape(serialize(sdata)); 
    160160 
    161161                Connector.newRequest('cQuickAdd.Send', CC_url+'quick_add', 'POST', handler, sdata); 
    162162        } 
    163  
     163         
    164164        cQuickAddContact.prototype.fechar = function(id) { 
    165  
     165         
    166166                div = document.getElementById(id+':cc_rectQuickAddContact'); 
    167167                win = this.arrayWin[div.id]; 
    168168                win.close(); 
    169169        } 
    170  
    171  
     170         
     171         
    172172/* Build the Object */ 
    173173        var ccQuickAddContact ; 
     
    175175 
    176176        if (is_ie) 
    177         { 
    178                 document.body.onload = function (e) 
    179                 { 
     177        {  
     178                document.body.onload = function (e)  
     179                {  
    180180                        cQuickAddContact_pre_load(); 
    181181                        ccQuickAddContact = new cQuickAddContact(); 
    182  
     182                         
    183183                }; 
    184184        } 
Note: See TracChangeset for help on using the changeset viewer.