Ignore:
Timestamp:
11/03/11 11:17:35 (12 years ago)
Author:
wmerlotto
Message:

Ticket #2305 - Enviando alteracoes, desenvolvidas internamente na Prognus, do modulo contactcenter.

File:
1 edited

Legend:

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

    r4507 r5131  
    231231function openContactDetails(id){ 
    232232        // Build the ContactDetails Window. 
    233         if(!contactdetailsWin && !is_ie)  
     233        if((typeof(contactdetailsWin) == 'undefined') && !is_ie)  
    234234                __cdWin(); 
    235235 
     
    996996        for (var type in CC_contact_full_info['connections']){ 
    997997            haveConnections = true; 
     998                        var reEmail = /^[a-zA-Z0-9][_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]{1,})*$/; 
    998999            for (var i in CC_contact_full_info['connections'][type]){ 
     1000                                if(type == 1){ 
     1001                                        if(!reEmail.test(CC_contact_full_info['connections'][type][i]['value'])){ 
     1002                                                showMessage('Endereço para conexão de ' + CC_contact_full_info['connections'][type][i]['name'] + ', não é válido'); 
     1003                                                return false; 
     1004                                        } 
     1005                                } 
     1006                                else{ 
    9991007                if((CC_contact_full_info['connections'][type][i]['value'].length < 4) || 
    10001008                    (!comp.test(CC_contact_full_info['connections'][type][i]['value']))){ 
     
    10021010                    return false; 
    10031011                } 
     1012            } 
    10041013            } 
    10051014            var _options_default = Element("cc_"+(type == 1 ? 'email' : 'phone')+"_default"); 
     
    10091018            } 
    10101019        } 
    1011     } 
    1012     if(!haveConnections){ 
    1013         showMessage(Element('cc_msg_tel_or_mail_required').value); 
    1014         return false; 
    10151020    } 
    10161021 
     
    16341639                        //'<td style="width: 30px;" align="right"><input name="cc_conn_is_default" id="cc_conn_is_default_'+ CC_conn_count +'" type="radio"></td>'+ 
    16351640                        '<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>' + 
    1636                         '<td align="left"><input id="cc_conn_value_'+ CC_conn_count +'" style="width: 150px;" maxlength="100" type="text">&nbsp;' + 
     1641                        '<td align="left"><input id="cc_conn_value_'+ CC_conn_count +'" onkeyup="javascript:emailTolower(\'cc_conn_value_' + CC_conn_count + '\')" style="width: 150px;" maxlength="100" type="text">&nbsp;' + 
    16371642                        '<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>'; 
    16381643                } 
     
    16421647                        //'<td style="width: 30px;" align="right"><input name="cc_conn_is_default" id="cc_conn_is_default_'+ CC_conn_count +'" type="radio"></td>'+ 
    16431648                        '<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>' + 
    1644                         '<td align="left"><input id="cc_conn_value_'+ CC_conn_count +'" style="width: 150px;" maxlength="30" type="text" onkeyup="formatPhone(this)">&nbsp;' + 
     1649                        '<td align="left"><input id="cc_conn_value_'+ CC_conn_count +'" onkeyup="javascript:emailTolower(\'cc_conn_value_' + CC_conn_count + '\')" style="width: 150px;" maxlength="30" type="text" onkeyup="formatPhone(this)">&nbsp;' + 
    16451650                        '<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>'; 
    16461651                } 
     
    18061811 
    18071812        connRemoveLine(id); 
     1813} 
     1814 
     1815function emailTolower(obj){ 
     1816        document.getElementById(obj).value = document.getElementById(obj).value.toLowerCase(); 
     1817 
    18081818} 
    18091819 
     
    23082318 
    23092319                                                                if(data[3][pos][k] === 'none') 
    2310                                                                         data[3][pos][k] = '&nbsp'; 
     2320                                                                        "Não informado."; 
    23112321                                                                break; 
    23122322                                                        case 'cc_phone' : 
    23132323 
    23142324                                                                if(data[3][pos][k] === 'none') 
    2315                                                                         data[3][pos][k] = '&nbsp'; 
     2325                                                                        data[3][pos][k] = "Não informado."; 
    23162326                                                                break; 
    23172327                                                } 
     
    23522362                                                                else 
    23532363                                                                { 
     2364                                                                        if(data[3][pos][k] != "Não informado.") 
    23542365                                                                        Element(id+':'+data[2][k]).innerHTML = data[5] + data[3][pos][k] + '\')">'+ data[3][pos][k]+'</span>'; 
     2366                                                                        else 
     2367                                                                                Element(id+':'+data[2][k]).innerHTML = data[13] + data[3][pos][k] + '\')">'+ data[3][pos][k]+'</span>'; 
    23552368                                                                } 
    23562369                                                                break; 
     
    23662379                                                                        Element(id+':'+data[2][k]).innerHTML = adjustString(data[3][pos][k], 20); 
    23672380                                                                } 
     2381                                                                if(data[3][pos][k] != " ") 
    23682382                                                                Element(id+':cc_phone').innerHTML = (data[3][pos][k].length < 23) ? data[3][pos][k]:data[3][pos][k].substr(0,22)+"<br>"+data[3][pos][k].substr(22,data[3][pos][k].length); 
     2383                                                                else 
     2384                                                                        Element(id+':cc_phone').innerHTML = "Não informado."; 
    23692385                                                                break; 
    23702386 
    23712387                                                        case 'cc_title': 
    2372                                                                 if (data[3][pos][k].length > 15) 
     2388                                                                if(preferences.departmentShow && ccTree.catalog_perms == 1){ 
     2389                                                                        if(data[3][pos][k] == " " || data[3][pos][k] == "" || data[3][pos][k] == "undefined"){ 
     2390                                                                                Element(id+':'+data[2][k]).innerHTML = "Não informado."; 
     2391                                                                        } 
     2392                                                                        else if (data[3][pos][k].length > 15) 
    23732393                                                                { 
    23742394                                                                        Element(id+':'+data[2][k]).innerHTML = adjustString(data[3][pos][k], 15); 
     
    23802400                                                                } 
    23812401                                                                break; 
    2382  
     2402                                                                }else{ 
     2403                                                                        break; 
     2404                                                                } 
    23832405                                                        case 'cc_id': 
    23842406                                                                var id_contact = data[3][pos][k]; 
     
    24102432                                                        //Para tratar tamanho do campo "celular" do empregado 
    24112433                                                        case 'cc_mobile': 
     2434                                                                if(preferences.cellShow && ccTree.catalog_perms == 1){ 
    24122435                                                                if (data[3][pos][k].length > 20) 
    24132436                                                                { 
     
    24212444                                                                Element(id+':cc_mobile').innerHTML = data[3][pos][k]; 
    24222445                                                                break; 
    2423  
     2446                                                                }else{ 
     2447                                                                        break; 
     2448                                                                }                
    24242449                                                        //Para tratar tamanho do campo "matricula" do empregado 
    24252450                                                        case 'cc_empNumber': 
     2451                                                                if(preferences.empNumShow && ccTree.catalog_perms == 1){ 
    24262452                                                                if (data[3][pos][k].length > 20) 
    24272453                                                                { 
     
    24352461                                                                Element(id+':cc_empNumber').innerHTML = data[3][pos][k]; 
    24362462                                                                break; 
    2437  
     2463                                                                }else{ 
     2464                                                                        break; 
     2465                                                                } 
    24382466                                                        //Para tratar tamanho do campo "departamento" do empregado 
    24392467                                                        case 'cc_department': 
     
    24612489                                                                        Element(id+':'+data[2][k]).innerHTML = data[3][pos][k]; 
    24622490                                                                } 
     2491                                                } 
     2492                                        }else{ 
     2493                                                data[3][pos][k] = unescape(data[3][pos][k]); 
     2494                                                switch (data[2][k]) 
     2495                                                { 
     2496                                                        case 'cc_mail': 
     2497                                                                Element(id+':'+data[2][k]).innerHTML = data[13] + "Não informado." + '\')">'+ "Não infomardo." +'</span>'; 
     2498                                                                break; 
     2499 
     2500                                                        case 'cc_phone': 
     2501                                                                Element(id+':cc_phone').innerHTML = "Não informado."; 
     2502                                                                break; 
     2503                                                        case 'cc_empNumber': 
     2504                                                                if(preferences.empNumShow && ccTree.catalog_perms == 1){ 
     2505                                                                        var cc_empNumberTD = Element(id+':cc_empNumber').parentNode; 
     2506                                                                        cc_empNumberTD.parentNode.removeChild(cc_empNumberTD); 
     2507                                                                } 
     2508                                                                break; 
     2509                                                        case 'cc_mobile': 
     2510                                                                if(preferences.cellShow && ccTree.catalog_perms == 1){ 
     2511                                                                        var cc_mobileTD = Element(id+':cc_mobile').parentNode; 
     2512                                                                        cc_mobileTD.parentNode.removeChild(cc_mobileTD); 
     2513                                                                } 
     2514                                                                break; 
     2515                                                        case 'cc_title': 
     2516                                                                if(preferences.departmentShow && ccTree.catalog_perms == 1){ 
     2517                                                                        var cc_titleTD = Element(id+':cc_title').parentNode; 
     2518                                                                        cc_titleTD.parentNode.removeChild(cc_titleTD); 
     2519                                                                } 
     2520                                                                break; 
    24632521                                                } 
    24642522                                        } 
     
    25152573                                                { 
    25162574                                                        case 'cc_title': 
    2517                                                                 if (data[3][pos][k].length > 50) 
     2575                                                                if (data[3][pos][k].length > (CC_visual == 'table'  ? 50 : 20)) 
    25182576                                                                { 
    2519                                                                         Element(id+':'+data[2][k]).innerHTML = adjustString(data[3][pos][k], 50); 
     2577                                                                        Element(id+':'+data[2][k]).innerHTML = adjustString(data[3][pos][k], (CC_visual == 'table'  ? 50 : 20)); 
    25202578                                                                        Element(id+':'+data[2][k]).title = data[3][pos][k]; 
    25212579                                                                } 
     
    26632721                                                '<img title="'+Element('cc_msg_card_remove').value+'" id="' + id + ':cc_card_remove" style="position: absolute; top: 78px; left: 223px; width: 15px; height: 14px; cursor: pointer; cursor: hand; z-index: 1" onclick="removeEntry(Element(\'' + id + ':cc_id\').value);" onmouseover="resizeIcon(\''+id+':cc_card_remove\',0)" onmouseout="resizeIcon(\''+id+':cc_card_remove\',1)" src="templates/default/images/cc_x.png">' : '') + 
    26642722                                                '<img id="' + id + ':cc_photo" style="position: absolute; top: 15px; left: 7px;" src="" border="0" ondblclick="editContact(Element(\'' + id + ':cc_id\').value);">' + 
    2665                                                 '<span id="' + id + ':cc_company" style="position: absolute; top: 5px; left: 75px; width: 135px; border: 0px solid #999; font-weight: bold; font-size: 14px; text-align: center; height: 10px;" onmouseover="//Element(\''+id+':cc_company_full\').style.visibility=\'visible\'" onmouseout="//Element(\''+id+':cc_company_full\').style.visibility=\'hidden\'"></span>' + 
     2723                                                '<span id="' + id + ':cc_company" style="position: absolute; top: 5px; left: 75px; width: 135px; border: 0px solid #999; font-weight: bold; font-size: 10px; text-align: center; height: 10px;" onmouseover="//Element(\''+id+':cc_company_full\').style.visibility=\'visible\'" onmouseout="//Element(\''+id+':cc_company_full\').style.visibility=\'hidden\'"></span>' + 
    26662724                                                '<span style="cursor: pointer; cursor: hand; z-index: 1;position: absolute; top: 100px; left: 35px"  valign="bottom" id="' + id + ':cc_icon_group">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>'+ 
    26672725                                                //Para exibir a matricula do empregado nos cartoes 
    2668                                                 '<span id="' + id + ':cc_empNumber" style="position: absolute; top: 15px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 9px; text-align: center; height: 10px;"></span>' + 
     2726                                                '<span id="' + id + ':cc_empNumber" style="position: absolute; top: 20px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 9px; text-align: center; height: 10px;"></span>' + 
    26692727                                                '<span id="' + id + ':cc_name" style="position: absolute; top: 30px; left: 75px; width: 135px; border: 0px solid #999; font-weight: bold; font-size: 10px; text-align: center; height: 10px;" onmouseover="//Element(\''+id+':cc_name_full\').style.visibility=\'visible\'" onmouseout="//Element(\''+id+':cc_name_full\').style.visibility=\'hidden\'"></span>' + 
    2670                                                 '<span id="' + id + ':cc_title" style="position: absolute; top: 50px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 12px; text-align: center; height: 10px;"></span>' + 
     2728                                                '<span id="' + id + ':cc_title" style="position: absolute; top: 90px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 12px; text-align: center; height: 10px;"></span>' + 
    26712729                                                //Para exibir o setor/lotacao do empregado nos cartoes 
    26722730                                                '<span id="' + id + ':cc_department" style="position: absolute; top: 60px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 10px; text-align: center; height: 10px;"></span>' + 
     
    26942752                                        '<span id="' + id + ':cc_participantes" style="cursor: pointer; cursor: hand; z-index: 1"></span>' + 
    26952753                                        '<span id="' + id + ':cc_title"></span></td>' + 
    2696                                         '<td width="40%" style="solid #999; font-weight: normal; font-size: 10px; text-align: left; height: 10px"><span onMouseOver="this.title = \''+Element('cc_send_mail').value+'\'"  id="' + id + ':cc_short_name"></span></td>' + 
    2697                                         '<td align="left" width="55px">'+ 
     2754                                        '<td width="40%" style="solid #999; font-weight: normal; font-size: 10px; text-align: left; height: 10px"><span id="' + id + ':cc_short_name"></span></td>' + 
     2755                                        '<td align="center" width="10%">'+ 
    26982756                                        '<img  title="'+Element('cc_msg_group_edit').value+'" id="' + id + ':cc_card_edit" style=" cursor: pointer; cursor: hand; z-index: 1;width: 18px; height: 18px;"  onclick="editGroup(Element(\'' + id + ':cc_id\').value);" src="templates/default/images/cc_card_edit.png">' + 
    26992757                                        '&nbsp;&nbsp;|&nbsp;&nbsp;'+ 
     
    27052763                                html_card = '<tr  style="height:20px" id="' + id + '" onmouseout="'+bg+'" onmouseover="this.style.background=\'LIGHTYELLOW\'" bgcolor="EEEEEE">' + 
    27062764                                        //Para exibir a matricula do empregado na tabela 
    2707                                         (preferences.empNumShow && ccTree.catalog_perms == 1 ? '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_empNumber"></span></td>' : '') + 
     2765                                        (preferences.empNumShow && ccTree.catalog_perms == 1 ? '<td align="center" width="10%" name="cc_name_empNumber" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_empNumber"></span></td>' : '') + 
    27082766                                        '<td width="auto" style="font-weight: normal; font-size: 10px; text-align: left; height: 10px;"><span valign="bottom" id="' + id + ':cc_icon_group">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="' + id + ':cc_name"></span></td>' + 
    2709                                         '<td style="solid #999; font-weight: normal; font-size: 10px; text-align: left; height: 10px"><span onMouseOver="this.title = \''+Element('cc_send_mail').value+' => '+'\'+document.getElementById(\''+id + ':cc_name\').innerHTML" id="' + id + ':cc_mail"></span></td>' + 
    2710                                         '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_phone"></span></td>' + 
     2767                                        '<td width="20%" align="center" name="cc_name_send_mail" style="solid #999; font-weight: normal; font-size: 10px; height: 10px"><span onMouseOver="this.title = \''+Element('cc_send_mail').value+' => '+'\'+document.getElementById(\''+id + ':cc_name\').innerHTML" id="' + id + ':cc_mail"></span></td>' + 
     2768                                        '<td width="20%" align="center" name="cc_name_phone" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_phone"></span></td>' + 
    27112769                                        //Para exibir o celular empresarial do empregado na tabela 
    2712                                         (preferences.cellShow && ccTree.catalog_perms == 1 ?    '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_mobile"></span></td>' : '') + 
     2770                                        (preferences.cellShow && ccTree.catalog_perms == 1 ?    '<td align="center" name="cc_name_mobile" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_mobile"></span></td>' : '') +  
    27132771                                        //Para exibir o setor/lotacao do empregado na tabela 
    2714                                         (preferences.departmentShow && ccTree.catalog_perms == 1 ? '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_department"></span></td>' : '') + 
     2772                                        (preferences.departmentShow && ccTree.catalog_perms == 1 ? '<td align="center" name="cc_name_title" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_title"></span></td>' : '') + 
    27152773                                        ( ccTree.catalog_perms == 1 ? 
    2716                                         '<td align="left"><span valign="bottom" id="' + id + ':cc_icon_data"></span></td>':'') +                                         
     2774                                        '<td align="center" width="10%"><span valign="bottom" id="' + id + ':cc_icon_data"></span></td>':'') +                                   
    27172775                                        (ccTree.catalog_perms & 2 ? 
    2718                                         '<td align="left" >'+ 
     2776                                        '<td align="center" width="10%" >'+ 
    27192777                                        '<img  title="'+Element('cc_msg_card_edit').value+'" id="' + id + ':cc_card_edit" style=" cursor: pointer; cursor: hand; z-index: 1;width: 18px; height: 18px;"  onclick="editContact(Element(\'' + id + ':cc_id\').value);" src="templates/default/images/cc_card_edit.png">' + 
    27202778                                        '&nbsp;&nbsp;|&nbsp;&nbsp;'+ 
     
    27222780                                        '<input id="' + id + ':cc_id" type="hidden">'+ 
    27232781                                        '<input type="hidden" id="' + id + ':cc_photo">' + 
    2724                                         '<span id="' + id + ':cc_title" style="display:none"></span>' + 
     2782                                        //'<span id="' + id + ':cc_mobile" style="display:none"></span>' + 
    27252783                                        '<span id="' + id + ':cc_alias" style="display:none"></span>' + 
    27262784                                        // Esse campo é necessário se o contato possui dados no campo cc_company 
Note: See TracChangeset for help on using the changeset viewer.