Ignore:
Timestamp:
05/21/08 16:56:17 (16 years ago)
Author:
rafaelraymundo
Message:

Vide Trac - #197, #166, #198, #199

  1. Correção de problema na leitura do arquivo configuração.
  2. Permissão do click2dial também no contactcenter.
  3. Visualização de matricula, e nro celular no resultado da pesquisa(se estiverem populados)
  4. Adicionada a leitura a Catálogos Externos
File:
1 edited

Legend:

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

    r258 r284  
    5757var CC_full_add_const = false; 
    5858var CC_full_add_photo = false; 
    59          
     59 
    6060var CC_last_height = window.innerHeight; 
    6161var CC_last_width = window.innerWidth; 
     
    9090                 photo_input = photo_frame.contentDocument.createElement('input'); 
    9191        } 
    92          
     92 
    9393        photo_frame.id = 'cc_photo_frame'; 
    9494        photo_frame.style.position = 'absolute'; 
     
    9696        photo_frame.style.top = '600px'; 
    9797        photo_frame.style.left = '0px'; 
    98          
     98 
    9999        photo_form.id = 'cc_photo_form'; 
    100100        photo_form.method = 'POST'; 
    101101        photo_form.enctype = 'multipart/form-data'; 
    102          
     102 
    103103        photo_input.id = 'cc_photo_input'; 
    104104        photo_input.type = 'file'; 
    105          
     105 
    106106        if (is_ie) 
    107107        { 
     
    113113        } 
    114114        photo_form.appendChild(photo_input); 
    115          
     115 
    116116} 
    117117 
     
    121121        var obj = Element(id); 
    122122        var max = obj.options.length; 
    123          
     123 
    124124        if (option == undefined) 
    125125        { 
     
    161161function openFullAdd(){ 
    162162        // Build the FullAdd Window. 
    163         if(!fullAddWin && !is_ie)  
     163        if(!fullAddWin && !is_ie) 
    164164                __f(); 
    165165 
     
    168168        fullAddWin.open(); 
    169169        tabs._showTab('cc_contact_tab_0'); 
    170         Element("cc_conn_type_1").checked = false;       
     170        Element("cc_conn_type_1").checked = false; 
    171171        Element("cc_conn_type_2").checked = false; 
    172172        Element("cc_conn_type_sel").disabled = true; 
     
    189189function editGroup(id){ 
    190190        populateEditGroup(id); 
    191         ccAddGroup.window.open();                        
     191        ccAddGroup.window.open(); 
    192192} 
    193193/* 
     
    199199{ 
    200200        CC_full_add_const = false; 
    201          
     201 
    202202        setTimeout('populateFullAddConstAsync()', 10); 
    203203} 
     
    207207        var handler = function(responseText) 
    208208        { 
    209                 //Element('cc_debug').innerHTML = responseText;          
     209                //Element('cc_debug').innerHTML = responseText; 
    210210                var data = unserialize(responseText); 
    211211                var i = 1; 
    212212                var j; 
    213                  
     213 
    214214                if (typeof(data) != 'object') 
    215215                { 
     
    217217                        return; 
    218218                } 
    219                  
     219 
    220220                /* Populate Prefixes */ 
    221221                for (j in data[0]) 
     
    224224                        i++; 
    225225                } 
    226                  
     226 
    227227                /* Populate Suffixes */ 
    228228                i = 1; 
     
    246246                { 
    247247                        Element('cc_addr_countries').options[i] = new Option(data[3][j], j); 
    248                          
     248 
    249249                        if (j == 'BR' || j == 'br') 
    250250                        { 
    251251                                CC_br_index = i; 
    252252                        } 
    253                          
     253 
    254254                        i++; 
    255255                } 
    256                  
     256 
    257257                /* Populate Connection Types */ 
    258258                i = 1; 
     
    262262                        i++; 
    263263                } 
    264                  
     264 
    265265                /* Populate Relations Types */ 
    266266                i = 0; 
     
    270270                        i++; 
    271271                } 
    272                  
     272 
    273273                CC_full_add_const = true; 
    274274 
     
    305305{ 
    306306        var handler = function(responseText) 
    307         {                        
    308                 var data = unserialize(responseText);                    
    309                 Element('group_id').value = data['id_group'];                                                            
    310                 var options_contact_list = Element('contact_list'); 
    311                 if(data['contact_list']) {                                       
    312                         options_contact_list.innerHTML = data['contact_list']; 
     307        { 
     308                var data = unserialize(responseText); 
     309                Element('group_id').value = data['id_group']; 
     310 
     311                if(data['contact_list']) { 
     312                        for(i = 0; i < data['contact_list'].length; i++) { 
     313                                option = document.createElement('option'); 
     314                                option.value = data['contact_list'][i]['id_connection']; 
     315                                option.text = data['contact_list'][i]['names_ordered']+' ('+data['contact_list'][i]['connection_value']+')'; 
     316                                Element('contact_list').options[Element('contact_list').options.length] = option; 
     317                        } 
    313318                } 
    314319 
    315320                if(data['id_group']) { 
    316                  
    317                         if(data['contact_in_list']) {                                    
    318                                 for(i = 0; i < data['contact_in_list'].length; i++) {                            
     321 
     322                        if(data['contact_in_list']) { 
     323                                for(i = 0; i < data['contact_in_list'].length; i++) { 
    319324                                        option = document.createElement('option'); 
    320325                                        option.value = data['contact_in_list'][i]['id_connection']; 
    321                                         option.text = data['contact_in_list'][i]['names_ordered']+' ('+data['contact_in_list'][i]['connection_value']+')';                               
     326                                        option.text = data['contact_in_list'][i]['names_ordered']+' ('+data['contact_in_list'][i]['connection_value']+')'; 
    322327                                        Element('contact_in_list').options[Element('contact_in_list').options.length] = option; 
    323328                                } 
    324                         }                
    325                          
     329                        } 
     330 
    326331                        Element('title').value =  data['title']; 
    327332                } 
    328                                  
     333 
    329334                if (typeof(data) != 'object' || data['result'] != 'ok') 
    330335                { 
     
    333338                } 
    334339        }; 
    335                  
     340 
    336341        id = typeof(id) == 'undefined' ? id = 0 :  id; 
    337          
    338         ccAddGroup.clear(true);                  
     342 
     343        ccAddGroup.clear(true); 
    339344        Connector.newRequest('populateEditGroup', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_group&id='+id, 'GET', handler); 
    340345} 
     
    371376                return false; 
    372377        } 
    373          
     378 
    374379        /* First thing: Send Photo */ 
    375380        if (Element('cc_pd_select_photo').value != '' && !is_ie) 
     
    389394                        frame = old_frame; 
    390395                } 
    391                  
     396 
    392397                frame.id = 'cc_photo_frame'; 
    393398                frame.style.visibility = 'hidden'; 
     
    398403 
    399404                form = frame.contentDocument.createElement('form'); 
    400                  
     405 
    401406                var id_contact = Element('cc_full_add_contact_id').value; 
    402407                form.id = 'cc_form_photo'; 
     
    404409                form.enctype = 'multipart/form-data'; 
    405410                form.action = 'http://'+ document.domain + Element('cc_root_dir').value+'../index.php?menuaction=contactcenter.ui_data.data_manager&method=post_photo&id='+(id_contact != '' && id_contact != 'null' ? id_contact : ''); 
    406                  
     411 
    407412                var input_clone = Element('cc_pd_select_photo').cloneNode(false); 
    408413                form.appendChild(input_clone); 
    409                  
     414 
    410415                frame.contentDocument.body.appendChild(form); 
    411416                form.submit(); 
     
    461466        var empty = true; 
    462467        var replacer = '__##AND##__'; 
    463          
     468 
    464469        data['commercialAnd'] = replacer; 
    465          
     470 
    466471        if (Element('cc_full_add_contact_id').value != '' && Element('cc_full_add_contact_id').value != 'null') 
    467472        { 
     
    472477        /* Status: Full Added */ 
    473478        data['id_status'] = CC_STATUS_FULL_ADD; 
    474          
     479 
    475480        /* Personal Data */ 
    476481        data['alias']         = replaceComAnd(Element('cc_pd_alias').value, replacer); 
     
    510515                                data['connections'] = new Array(); 
    511516                        } 
    512                          
     517 
    513518                        for (var i in CC_contact_full_info['connections'][type]) 
    514519                        { 
     
    522527                                        data['connections']['connection'+connNumber] = new Array(5); 
    523528                                } 
    524                                  
     529 
    525530                                data['connections']['connection'+connNumber]['id_connection'] = CC_contact_full_info['connections'][type][i]['id']; 
    526531                                data['connections']['connection'+connNumber]['id_typeof_connection'] = type; 
     
    531536                                                data['connections']['connection'+connNumber]['connection_is_default']  = 'TRUE'; 
    532537                                        } 
    533                                         else  
     538                                        else 
    534539                                                data['connections']['connection'+connNumber]['connection_is_default']  = 'FALSE'; 
    535540                                } 
    536541 
    537542//                              data['connections']['connection'+connNumber].length = 5; 
    538                                  
     543 
    539544                                empty = false; 
    540545                                connNumber++; 
     
    543548 
    544549                } 
    545                  
     550 
    546551                if (!empty) 
    547552                { 
     
    550555                } 
    551556        } 
    552          
     557 
    553558        if (CC_contact_full_info['removed_conns']) 
    554559        { 
    555560                empty = false; 
    556                  
     561 
    557562                if (typeof(data['connections']) != 'object') 
    558563                { 
     
    589594                        for (var i in CC_contact_full_info['connections'][type]){ 
    590595                                if((CC_contact_full_info['connections'][type][i]['value'].length < 4) || 
    591                                         (!comp.test(CC_contact_full_info['connections'][type][i]['value']))){  
    592                                         showMessage('Endereço para conexão de ' + CC_contact_full_info['connections'][type][i]['name'] + ', não é válido'); 
     596                                        (!comp.test(CC_contact_full_info['connections'][type][i]['value']))){ 
     597                                        showMessage('Endereï¿œo para conexï¿œo de ' + CC_contact_full_info['connections'][type][i]['name'] + ', nï¿œo ï¿œ vï¿œlido'); 
    593598                                        return false; 
    594599                                } 
     
    596601                        var _options_default = Element("cc_"+(type == 1 ? 'email' : 'phone')+"_default"); 
    597602                        if(_options_default.value == '-1') { 
    598                                 alert("É necessário escolher um "+ (type == 1 ? 'E-mail' : 'Telefone')+" como padrão!"); 
     603                                alert("ï¿œ necessï¿œrio escolher um "+ (type == 1 ? 'E-mail' : 'Telefone')+" como padrï¿œo!"); 
    599604                                return false; 
    600605                        } 
    601606                } 
    602                  
     607 
    603608        } 
    604609 
     
    609614 
    610615/********* Personal Data Functions *********/ 
    611 /*  
     616/* 
    612617 * data[0] => cc_pd_select_photo 
    613618 * data[1] => cc_pd_alias 
     
    657662{ 
    658663        Element('cc_addr_types').selectedIndex = 0; 
    659          
     664 
    660665        Element('cc_addr_countries').selectedIndex = 0; 
    661666        Element('cc_addr_countries').disabled = true; 
    662          
     667 
    663668        Element('cc_addr_states').selectedIndex = 0; 
    664669        Element('cc_addr_states').disabled = true; 
     
    711716        var type = Element('cc_addr_types'); 
    712717        var oldSelected = type.value; 
    713          
     718 
    714719        saveAddressFields(); 
    715          
     720 
    716721        if (oldSelected == '_NONE_') 
    717722        { 
     
    719724                return true; 
    720725        } 
    721          
     726 
    722727        CC_addr_last_selected = type.selectedIndex; 
    723          
     728 
    724729        Element('cc_addr_countries').disabled = false; 
    725          
     730 
    726731        var data = CC_contact_full_info['addresses']; 
    727732        var addrIndex  = 'address'+Element('cc_addr_types').value; 
    728          
    729         if (typeof(data) != 'object' || typeof(data[addrIndex]) != 'object')  
     733 
     734        if (typeof(data) != 'object' || typeof(data[addrIndex]) != 'object') 
    730735        { 
    731736                resetAddressFields(); 
     
    736741                return true; 
    737742        } 
    738          
     743 
    739744        var addrTypeID = Element('cc_addr_types').value; 
    740          
     745 
    741746        data = CC_contact_full_info['addresses'][addrIndex]; 
    742          
     747 
    743748        Element('cc_addr_id').value                              = data['id_address']           ? data['id_address']                    : ''; 
    744749        Element('cc_addr_1').value                              = data['address1']                      ? data['address1']                              : ''; 
     
    762767                states.selectedIndex = 0; 
    763768                clearSelectBox(states, 4); 
    764                 updateAddrCities();      
     769                updateAddrCities(); 
    765770                return; 
    766771        } 
     
    777782        { 
    778783                var data = unserialize(responseText); 
    779                  
     784 
    780785                clearSelectBox(states, 1); 
    781                          
     786 
    782787                if (typeof(data) != 'object') 
    783788                { 
    784789                        showMessage(Element('cc_msg_err_contacting_server').value); 
    785          
     790 
    786791                        return; 
    787792                } 
     
    790795                { 
    791796                        states.disabled = true; 
    792                         cities.disabled = true;                  
     797                        cities.disabled = true; 
    793798                        states.selectedIndex = 0; 
    794799                        cities.selectedIndex = 0; 
     
    830835                } 
    831836        }; 
    832          
     837 
    833838        Connector.newRequest('populateStates', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_states&country='+Element('cc_addr_countries').value, 'GET', handler); 
    834839} 
     
    858863                        newState.disabled = false; 
    859864                        updateAddrNewStateOnMouseOut(); 
    860                          
     865 
    861866                        cities.disabled = false; 
    862867                        clearSelectBox(cities, 3); 
     
    869874                case '_NOSTATE_': 
    870875                        clearSelectBox(cities, 3); 
    871                          
     876 
    872877                        cities.disabled = false; 
    873878                        cities.selectedIndex = 0; 
    874                          
     879 
    875880                        requestStr = 'country='+Element('cc_addr_countries').value; 
    876881                        break; 
    877                  
     882 
    878883                default: 
    879884                        requestStr = 'country='+Element('cc_addr_countries').value+'&state='+states.value; 
     
    890895{ 
    891896        var cities = Element('cc_addr_cities'); 
    892          
     897 
    893898        var handler = function (responseText) 
    894899        { 
    895900                var data = unserialize(responseText); 
    896                  
     901 
    897902                clearSelectBox(cities, 1); 
    898                  
     903 
    899904                if (typeof(data) != 'object') 
    900905                { 
    901906                        showMessage(Element('cc_msg_err_contacting_server').value); 
    902                          
     907 
    903908                        return; 
    904909                } 
     
    945950                } 
    946951        }; 
    947          
     952 
    948953        Connector.newRequest('populateCities', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_cities&'+requestStr, 'GET', handler); 
    949954} 
     
    951956function updateAddrNewStateOnMouseOver () 
    952957{ 
    953         if (Element('cc_addr_states_new').value == Element('cc_msg_type_state').value && Element('cc_addr_states').selectedIndex == 1)  
     958        if (Element('cc_addr_states_new').value == Element('cc_msg_type_state').value && Element('cc_addr_states').selectedIndex == 1) 
    954959        { 
    955960                Element('cc_addr_states_new').value = ''; 
     
    959964function updateAddrNewStateOnMouseOut () 
    960965{ 
    961         if (Element('cc_addr_states_new').value.length == 0 && Element('cc_addr_states').selectedIndex == 1)  
     966        if (Element('cc_addr_states_new').value.length == 0 && Element('cc_addr_states').selectedIndex == 1) 
    962967        { 
    963968                Element('cc_addr_states_new').value = Element('cc_msg_type_state').value; 
     
    979984                return; 
    980985        } 
    981          
     986 
    982987        Element('cc_addr_1').readonly = false; 
    983988        Element('cc_addr_1').disabled = false; 
     
    10091014 
    10101015                        //resetAddrFillingFields(); 
    1011                          
     1016 
    10121017                        return; 
    10131018 
     
    10171022                        newCity.disabled = false; 
    10181023                        updateAddrNewCityOnMouseOut(); 
    1019                          
     1024 
    10201025                        break; 
    10211026 
     
    10311036function updateAddrNewCityOnMouseOver () 
    10321037{ 
    1033         if (Element('cc_addr_cities_new').value == Element('cc_msg_type_city').value && Element('cc_addr_cities').selectedIndex == 1)  
     1038        if (Element('cc_addr_cities_new').value == Element('cc_msg_type_city').value && Element('cc_addr_cities').selectedIndex == 1) 
    10341039        { 
    10351040                Element('cc_addr_cities_new').value = ''; 
     
    10391044function updateAddrNewCityOnMouseOut () 
    10401045{ 
    1041         if (Element('cc_addr_cities_new').value.length == 0 && Element('cc_addr_cities').selectedIndex == 1)  
     1046        if (Element('cc_addr_cities_new').value.length == 0 && Element('cc_addr_cities').selectedIndex == 1) 
    10421047        { 
    10431048                Element('cc_addr_cities_new').value = Element('cc_msg_type_city').value; 
     
    10531058                return true; 
    10541059        } 
    1055          
    1056         var addrFields = new Array('cc_addr_1',  
    1057                                    'cc_addr_2',  
    1058                                                            'cc_addr_complement',  
     1060 
     1061        var addrFields = new Array('cc_addr_1', 
     1062                                   'cc_addr_2', 
     1063                                                           'cc_addr_complement', 
    10591064                                                           'cc_addr_other', 
    1060                                                            'cc_addr_postal_code',  
     1065                                                           'cc_addr_postal_code', 
    10611066                                                           'cc_addr_po_box', 
    10621067                                                           'cc_addr_countries', 
     
    10651070 
    10661071        var empty = true; 
    1067          
     1072 
    10681073        for (var i = 0; i < 8; i++) 
    10691074        { 
     
    10741079                } 
    10751080        } 
    1076                                  
     1081 
    10771082        if (empty) 
    10781083        { 
     
    11031108                default: 
    11041109                        addrInfo['id_country'] = Element('cc_addr_countries').value; 
    1105                  
     1110 
    11061111        } 
    11071112 
     
    11171122                default: 
    11181123                        addrInfo['id_state'] = Element('cc_addr_states').value; 
    1119                  
     1124 
    11201125        } 
    11211126 
     
    11301135                default: 
    11311136                        addrInfo['id_city'] = Element('cc_addr_cities').value; 
    1132                  
    1133         }        
     1137 
     1138        } 
    11341139 
    11351140        addrInfo['id_typeof_address']  = Element('cc_addr_types').options[lastIndex].value; 
     
    11441149        CC_contact_full_info['addresses']['address'+Element('cc_addr_types').options[lastIndex].value] = addrInfo; 
    11451150 
    1146         if (Element('cc_addr_cities').value == '_NEW_' &&  
     1151        if (Element('cc_addr_cities').value == '_NEW_' && 
    11471152            Element('cc_msg_type_city').value !=  Element('cc_addr_cities_new').value && 
    11481153                Element('cc_addr_cities_new').value != '') 
    11491154        { 
    11501155                var addrRootInfo = CC_contact_full_info['addresses']['new_cities']; 
    1151                  
     1156 
    11521157                if (!addrRootInfo) 
    11531158                { 
    11541159                        addrRootInfo = new Array(); 
    11551160                } 
    1156                  
     1161 
    11571162                var i = addrRootInfo.length; 
    11581163                addrRootInfo[addrInfo['id_typeof_address']] = new Array(); 
     
    11631168        } 
    11641169 
    1165         if (Element('cc_addr_states').value == '_NEW_' &&  
    1166             Element('cc_msg_type_state').value !=  Element('cc_addr_states_new').value &&  
     1170        if (Element('cc_addr_states').value == '_NEW_' && 
     1171            Element('cc_msg_type_state').value !=  Element('cc_addr_states_new').value && 
    11671172                Element('cc_addr_states_new').value != '') 
    11681173        { 
    11691174                var addrRootInfo = CC_contact_full_info['addresses']['new_states']; 
    1170                  
     1175 
    11711176                if (!addrRootInfo) 
    11721177                { 
    11731178                        addrRootInfo = new Array(); 
    11741179                } 
    1175                  
     1180 
    11761181                var i = addrRootInfo.length; 
    11771182                addrRootInfo[addrInfo['id_typeof_address']] = new Array(); 
     
    12031208        for(idx_conn; idx_conn < cc_conn_default.options.length; idx_conn++) 
    12041209                if(cc_conn_default.options[idx_conn].value == _label) 
    1205                         break;   
    1206          
     1210                        break; 
     1211 
    12071212        if(idx_conn == cc_conn_default.options.length) 
    12081213                cc_conn_default.options[idx_conn] = new Option (_label,_label, false,false); 
    1209                          
     1214 
    12101215        if (!document.all) 
    12111216        { 
    1212                 return '<td style="position: absolute; left: 0; top: 0; z-index: -1; visibility: hidden"><input id="cc_conn_id_' + CC_conn_count + '" type="hidden" value="_NEW_"><input id="cc_conn_is_default_' + CC_conn_count + '" type="hidden" value="false"></td>'+ 
    1213                 //'<td style="width: 30px;" align="right"><input name="cc_conn_is_default" id="cc_conn_is_default_'+ CC_conn_count +'" type="radio"></td>'+ 
    1214                 '<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>' + 
    1215                 '<td align="left"><input id="cc_conn_value_'+ CC_conn_count +'" style="width: 150px;" type="text">&nbsp;' + 
    1216                 '<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>'; 
     1217                if (Element("cc_conn_type_1").checked) 
     1218                { 
     1219                        return '<td style="position: absolute; left: 0; top: 0; z-index: -1; visibility: hidden"><input id="cc_conn_id_' + CC_conn_count + '" type="hidden" value="_NEW_"><input id="cc_conn_is_default_' + CC_conn_count + '" type="hidden" value="false"></td>'+ 
     1220                        //'<td style="width: 30px;" align="right"><input name="cc_conn_is_default" id="cc_conn_is_default_'+ CC_conn_count +'" type="radio"></td>'+ 
     1221                        '<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>' + 
     1222                        '<td align="left"><input id="cc_conn_value_'+ CC_conn_count +'" style="width: 150px;" maxlength="100" type="text">&nbsp;' + 
     1223                        '<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>'; 
     1224                } 
     1225                else if (Element("cc_conn_type_2").checked) 
     1226                { 
     1227                        return '<td style="position: absolute; left: 0; top: 0; z-index: -1; visibility: hidden"><input id="cc_conn_id_' + CC_conn_count + '" type="hidden" value="_NEW_"><input id="cc_conn_is_default_' + CC_conn_count + '" type="hidden" value="false"></td>'+ 
     1228                        //'<td style="width: 30px;" align="right"><input name="cc_conn_is_default" id="cc_conn_is_default_'+ CC_conn_count +'" type="radio"></td>'+ 
     1229                        '<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>' + 
     1230                        '<td align="left"><input id="cc_conn_value_'+ CC_conn_count +'" style="width: 150px;" maxlength="50" type="text">&nbsp;' + 
     1231                        '<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>'; 
     1232                } 
    12171233        } 
    12181234        else 
     
    12381254                img.align = 'top'; 
    12391255                img.onclick = function(e){ removeConnField(remove_id);}; 
    1240                  
     1256 
    12411257                for (var i = 0; i < 3; i++) 
    12421258                { 
     
    12491265 
    12501266                inputs[1].id = 'cc_conn_name_'+CC_conn_count; 
    1251                 inputs[1].type = 'hidden';               
     1267                inputs[1].type = 'hidden'; 
    12521268 
    12531269                inputs[2].id = 'cc_conn_value_'+CC_conn_count; 
     
    12781294                || typeof(CC_contact_full_info['connections'][CC_conn_last_selected]) == 'undefined' 
    12791295                || typeof(CC_contact_full_info['connections'][CC_conn_last_selected][CC_conn_count]) == 'undefined'); 
    1280          
    1281         if(_emptyLine) {         
    1282                  
     1296 
     1297        if(_emptyLine) { 
     1298 
    12831299                if(Element("cc_conn_type_sel").value == '-1'){ 
    1284                                 return false;    
    1285                 } 
    1286                  
     1300                                return false; 
     1301                } 
     1302 
    12871303                for(k = 0; k < CC_conn_count; k++) { 
    12881304                        if(Element("cc_conn_name_"+k) && Element("cc_conn_name_"+k).value != "" && Element("cc_conn_name_"+k).value == Element("cc_conn_type_sel").value) { 
    1289                                 alert('Você já possui uma entrada para o tipo "'+Element("cc_conn_type_sel").value+'"!'); 
    1290                                 Element("cc_conn_type_sel").options.selectedIndex = 0;                           
     1305                                alert('Vocï¿œ jï¿œ possui uma entrada para o tipo "'+Element("cc_conn_type_sel").value+'"!'); 
     1306                                Element("cc_conn_type_sel").options.selectedIndex = 0; 
    12911307                                return false; 
    12921308                        } 
    12931309                } 
    1294         }        
     1310        } 
    12951311        if (!document.all) 
    12961312        { 
     
    13191335 
    13201336function connRemoveLine(id) 
    1321 {        
     1337{ 
    13221338        var p = Element(id).parentNode; 
    13231339        var cc_conn_default = Element("cc_phone_default").style.display == '' ? Element("cc_phone_default") : Element("cc_email_default"); 
     
    13581374                } 
    13591375        } 
    1360          
     1376 
    13611377        CC_conn_count = 0; 
    13621378} 
     
    13801396function updateConnFields() 
    13811397{ 
    1382          
     1398 
    13831399        var connID; 
    13841400        var i; 
     
    13891405        var cc_conn_is_default = ''; 
    13901406        var selected_index = ''; 
    1391          
     1407 
    13921408        cc_conn_type_sel.disabled = false; 
    13931409        div_cc_conn_is_default.style.display = ""; 
    1394          
     1410 
    13951411        for(var i = 0;i < cc_conn_type_sel.options.length; i++) 
    1396                 cc_conn_type_sel.options[i--] = null;    
    1397                  
     1412                cc_conn_type_sel.options[i--] = null; 
     1413 
    13981414        if(Element('cc_conn_type_1').checked) { 
    1399             var lang_new_email = Element('cc_msg_new_email').value; 
    1400             var lang_main = Element('cc_msg_main').value; 
    1401             var lang_alternative = Element('cc_msg_alternative').value;  
    1402             cc_conn_type_sel[0] = new Option(lang_new_email,'-1');       
    1403             cc_conn_type_sel[1] = new Option(lang_main,lang_main); 
    1404             cc_conn_type_sel[2] = new Option(lang_alternative,lang_alternative);         
     1415                cc_conn_type_sel[0] = new Option('Novo Email...','-1'); 
     1416                cc_conn_type_sel[1] = new Option('Principal','Principal'); 
     1417                cc_conn_type_sel[2] = new Option('Alternativo','Alternativo'); 
    14051418                connID = 1; 
    14061419                selected_index = cc_email_default.options.selectedIndex; 
     
    14091422                } 
    14101423 
    1411                 var lang_select_email = Element('cc_msg_select_email').value; 
    1412                 cc_email_default.options[0] = new Option(lang_select_email,'-1');                
     1424                cc_email_default.options[0] = new Option('Selecionar Email...','-1'); 
     1425 
    14131426                cc_phone_default.style.display = 'none'; 
    1414                 cc_email_default.style.display = '';                     
     1427                cc_email_default.style.display = ''; 
    14151428                cc_conn_is_default = cc_email_default; 
    14161429        } 
    14171430        else if(Element('cc_conn_type_2').checked) { 
    1418             var lang_new_telephone = Element('cc_msg_new_phone').value; 
    1419             var lang_home = Element('cc_msg_home').value; 
    1420             var lang_cellphone = Element('cc_msg_cellphone').value; 
    1421             var lang_work = Element('cc_msg_work').value; 
    1422             var lang_fax = Element('cc_msg_fax').value; 
    1423             var lang_pager = Element('cc_msg_pager').value; 
    1424             cc_conn_type_sel[0] = new Option(lang_new_telephone,'-1');   
    1425             cc_conn_type_sel[1] = new Option(lang_home,lang_home); 
    1426             cc_conn_type_sel[2] = new Option(lang_cellphone,lang_cellphone);     
    1427             cc_conn_type_sel[3] = new Option(lang_work,lang_work); 
    1428             cc_conn_type_sel[4] = new Option(lang_fax,lang_fax); 
    1429             cc_conn_type_sel[5] = new Option(lang_pager,lang_pager); 
    1430  
     1431                cc_conn_type_sel[0] = new Option('Novo Telefone...','-1'); 
     1432                cc_conn_type_sel[1] = new Option('Residencial','Residencial'); 
     1433                cc_conn_type_sel[2] = new Option('Celular','Celular'); 
     1434                cc_conn_type_sel[3] = new Option('Comercial','Comercial'); 
     1435                cc_conn_type_sel[4] = new Option('Fax','Fax'); 
     1436                cc_conn_type_sel[5] = new Option('Pager','Pager'); 
    14311437                connID = 2; 
    14321438                selected_index = cc_phone_default.options.selectedIndex; 
     
    14351441                } 
    14361442 
    1437                 var lang_choose_phone = Element('cc_msg_choose_phone').value;            
    1438                 cc_phone_default.options[0] = new Option(lang_choose_phone,'-1'); 
     1443                cc_phone_default.options[0] = new Option('Selecionar Telefone...','-1'); 
    14391444                cc_email_default.style.display = 'none'; 
    14401445                cc_phone_default.style.display = ''; 
    14411446                cc_conn_is_default = cc_phone_default; 
    14421447        } 
    1443                          
     1448 
    14441449        Element("cc_conn_type_sel").options.selectedIndex = 0; 
    14451450        /* First save the data */ 
     
    14471452 
    14481453        CC_conn_last_selected = connID; 
    1449          
     1454 
    14501455        clearConn(); 
    1451          
     1456 
    14521457        if (connID == '_NONE_') 
    14531458        {       cc_conn_is_default.disabled = true; 
    14541459                return; 
    14551460        } 
    1456          
     1461 
    14571462        /* If no data already available, return */ 
    14581463        if (!CC_contact_full_info['connections']) 
     
    14781483                        } 
    14791484                } 
    1480         }        
     1485        } 
    14811486        if(cc_conn_is_default.options.length > selected_index) 
    14821487                cc_conn_is_default.options.selectedIndex = (selected_index == "-1" ? 0 : selected_index); 
     
    14991504                        CC_contact_full_info['connections'][CC_conn_last_selected] = new Array(); 
    15001505                } 
    1501                 else  
     1506                else 
    15021507                { 
    15031508                        delete CC_contact_full_info['connections'][CC_conn_last_selected]; 
     
    15111516                                var subNodes = nodes[i].childNodes; 
    15121517                                var found = false; 
    1513                                  
     1518 
    15141519                                for (var j = 0; j < subNodes.length; j++) 
    15151520                                { 
    1516                                         if (subNodes[j].childNodes.length > 0 &&  
     1521                                        if (subNodes[j].childNodes.length > 0 && 
    15171522                                            subNodes[j].childNodes[0].id) 
    15181523                                        { 
     
    15221527                                                        CC_contact_full_info['connections'][CC_conn_last_selected][k] = new Array(); 
    15231528                                                } 
    1524                                                  
     1529 
    15251530                                            if (subNodes[j].childNodes[0].id.indexOf('cc_conn_name') != -1) 
    15261531                                                { 
     
    15421547                                                        else 
    15431548                                                        { 
    1544                                                                 CC_contact_full_info['connections'][CC_conn_last_selected][k]['value'] = '';  
     1549                                                                CC_contact_full_info['connections'][CC_conn_last_selected][k]['value'] = ''; 
    15451550                                                        } 
    15461551                                                } 
     
    15531558                                        } 
    15541559                                } 
    1555                                  
     1560 
    15561561                                if (found) 
    15571562                                { 
     
    15701575                        delete CC_contact_full_info['connections'][CC_conn_last_selected]; 
    15711576                } 
    1572                  
     1577 
    15731578        } 
    15741579 
     
    15961601        var number = randomString().toLowerCase(); 
    15971602        var result = ''; 
    1598          
     1603 
    15991604        if(!is_ie) 
    1600                 result = prompt("Essa operação removerá TODOS os seus \ncontatos pessoais,  e  NÃO  PODERÁ  ser \ndesfeita. Digite o código abaixo:\n\tCódigo de confirmação: "+number); 
     1605                result = prompt("Essa operaᅵᅵo removerï¿œ TODOS os seus \ncontatos pessoais,  e  Nï¿œO  PODERï¿œ  ser \ndesfeita. Digite o cï¿œdigo abaixo:\n\tCï¿œdigo de confirmaᅵᅵo: "+number); 
    16011606        else 
    1602                 result = prompt("Essa operação removerá TODOS os seus contatos pessoais,  e  NÃO  PODERÁ  ser desfeita. Digite o seguinte código de confirmação: "+number,""); 
     1607                result = prompt("Essa operaᅵᅵo removerï¿œ TODOS os seus contatos pessoais,  e  Nï¿œO  PODERï¿œ  ser desfeita. Digite o seguinte cï¿œdigo de confirmaᅵᅵo: "+number,""); 
    16031608 
    16041609        if(result) { 
     
    16061611                        Connector.newRequest('removeAllEntries', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=remove_all_entries', 'GET', handler); 
    16071612                else 
    1608                         alert('Código Incorreto'); 
    1609         }        
     1613                        alert('Cï¿œdigo Incorreto'); 
     1614        } 
    16101615} 
    16111616 
     
    16181623                return; 
    16191624        } 
    1620          
     1625 
    16211626        var handler = function (responseText) 
    16221627        { 
     
    16281633                        return; 
    16291634                } 
    1630                  
     1635 
    16311636                if (data['status'] != 'ok') 
    16321637                { 
     
    16341639                        return; 
    16351640                } 
    1636                  
     1641 
    16371642                setTimeout('updateCards()',80);; 
    16381643        }; 
    1639                  
     1644 
    16401645        typeArg = (type == 'groups' ? 'group' : 'entry'); 
    1641                  
     1646 
    16421647        Connector.newRequest('removeEntry', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=remove_'+typeArg+'&remove=' + id, 'GET', handler); 
    16431648} 
     
    16621667        var w_height = 0; 
    16631668        var w_extra = 200; 
    1664          
     1669 
    16651670        if (document.body.clientHeight) 
    16661671        { 
     
    16911696                        Element('cc_letter_' + i).className = 'letter_box'; 
    16921697                } 
     1698        } 
     1699} 
     1700 
     1701function clearLetterSelection() 
     1702{ 
     1703        for (var i = 0; i < 28; i++) 
     1704        { 
     1705                Element('cc_letter_' + i).className = 'letter_box'; 
    16931706        } 
    16941707} 
     
    17581771                                final_page = 1; 
    17591772                        } 
    1760                          
     1773 
    17611774                        html_pages += '<a href="javascript:setPages('+npages+', '+ actual_page +', '+ final_page +')">...</a> '; 
    17621775 
    17631776                        page = showing_page ? showing_page : actual_page; 
    17641777                } 
    1765                  
     1778 
    17661779                for (; page <= npages; page++) 
    17671780                { 
     
    18231836                Element('cc_panel_arrow_last').style.cursor = 'hand'; 
    18241837        } 
    1825          
     1838 
    18261839        Element('cc_panel_pages').innerHTML = html_pages; 
    18271840} 
     
    18291842function populateCards(data, type) 
    18301843{ 
    1831         if (data[3].length >= 100 ) 
    1832         { 
    1833                 alert("Critério de pesquisa muito abrangente, achados " + data[3].length + " resultados"); 
    1834                 for (i = 0; i < (Math.sqrt(data[3].length)-1); i++) 
    1835                         for (j = 0; j < 3; j++) 
    1836                                 document.getElementById("cc_card:"+j+":"+i).innerHTML = ''; 
    1837                 return false; 
    1838         } 
    1839          
     1844 
    18401845        if(type == 'groups') 
    18411846                return populateGroupsInCards(data); 
    1842          
     1847 
    18431848        var pos = 0; 
    18441849        var ncards = data[3].length; 
    1845          
     1850 
    18461851        if (typeof(data[3]) == 'object' && ncards > 0) 
    18471852        { 
     
    18511856                        { 
    18521857                                id = 'cc_card:'+j+':'+i; 
    1853                          
     1858 
    18541859                                for (var k = 0; k < data[2].length; k++) 
    18551860                                { 
     
    18581863                                                Element(id).style.display = 'none'; 
    18591864                                                continue; 
    1860                                         }                                        
    1861                                  
     1865                                        } 
     1866 
    18621867                                        if(data[3][pos][k] != 'none') 
    18631868                                        { 
     
    18751880                                                                } 
    18761881                                                                break; 
    1877                                                          
     1882 
    18781883                                                        case 'cc_mail': 
    1879                                                                  
    18801884                                                                if (data[3][pos][k].length > (CC_visual == 'table'  ? 50 : 20)) 
    18811885                                                                { 
     
    18851889                                                                else 
    18861890                                                                { 
    1887                                                                         Element(id+':'+data[2][k]).innerHTML = data[5] + data[3][pos][k] + '\')">'+ data[3][pos][k]+'</span>';                                                                   
     1891                                                                        Element(id+':'+data[2][k]).innerHTML = data[5] + data[3][pos][k] + '\')">'+ data[3][pos][k]+'</span>'; 
    18881892                                                                } 
    18891893                                                                break; 
    1890                                                          
     1894 
    18911895                                                        case 'cc_phone': 
    18921896                                                                if (data[3][pos][k].length > 20) 
     
    19191923                                                                Element(id+':cc_photo').src = '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_photo' + (data[4][pos] != 0 ? '&id='+data[3][pos][k] : ''); 
    19201924                                                                if(ccTree.catalog_perms == 1) 
    1921                                                                         Element(id+':cc_icon_data').innerHTML =  '<span title="'+Element('cc_msg_copy_to_catalog').value+'" id="' + id + ':ccQuickAdd" onmouseout="window.status=\'\';" onclick="ccQuickAddContact.showList(\''+ Element(id+':cc_id').value + '\');return true;" style="cursor: pointer; cursor: hand; z-index: 1"><img src="templates/default/images/address-conduit-16.png" align="center"></span>'; 
     1925                                                                        Element(id+':cc_icon_data').innerHTML =  '<span title="Copiar para o Catï¿œlogo Pessoal" id="' + id + ':ccQuickAdd" onmouseout="window.status=\'\';" onclick="ccQuickAddContact.showList(\''+ Element(id+':cc_id').value + '\');return true;" style="cursor: pointer; cursor: hand; z-index: 1"><img src="templates/default/images/address-conduit-16.png" align="center"></span>'; 
    19221926                                                                break; 
    19231927 
    19241928                                                        case 'cc_forwarding_address': 
    19251929                                                                var contacts = data[3][pos][k]; 
    1926                                                                                                                                  
     1930 
    19271931                                                                if( !contacts) 
    19281932                                                                        break; 
    1929                                                                                                                                                                                                                                                                                                                                  
     1933 
    19301934                                                                Element(id+':cc_icon_group').innerHTML =  '<span title="'+Element('cc_participants').value+'"  onmouseout="window.status=\'\';" onclick="ccListParticipants.showList(\''+ Element(id+':cc_id').value + '\');return true;" style="cursor: pointer; cursor: hand; z-index: 1"><img src="templates/default/images/people-mini.png" align="center">&nbsp;&nbsp;</span>'; 
     1935                                                                break; 
     1936 
     1937                                                        case 'cc_empNumber': 
     1938                                                                if (data[3][pos][k].length > 20) 
     1939                                                                { 
     1940                                                                        Element(id+':'+data[2][k]).innerHTML = adjustString(data[3][pos][k], 20); 
     1941                                                                        Element(id+':'+data[2][k]).title = data[3][pos][k]; 
     1942                                                                } 
     1943                                                                else 
     1944                                                                { 
     1945                                                                        Element(id+':'+data[2][k]).innerHTML = adjustString(data[3][pos][k], 20); 
     1946                                                                } 
     1947                                                                Element(id+':cc_empNumber').innerHTML = data[3][pos][k]; 
     1948                                                                break; 
     1949 
     1950                                                        //Para tratar tamanho do campo "departamento" do empregado 
     1951                                                        case 'cc_department': 
     1952                                                                if (data[3][pos][k].length > 15) 
     1953                                                                { 
     1954                                                                        Element(id+':'+data[2][k]).innerHTML = adjustString(data[3][pos][k], 15); 
     1955                                                                        Element(id+':'+data[2][k]).title = data[3][pos][k]; 
     1956                                                                } 
     1957                                                                else 
     1958                                                                { 
     1959                                                                        Element(id+':'+data[2][k]).innerHTML = adjustString(data[3][pos][k], 15); 
     1960                                                                } 
     1961                                                                Element(id+':cc_department').innerHTML = data[3][pos][k]; 
    19311962                                                                break; 
    19321963 
     
    19391970                                                                else 
    19401971                                                                { 
     1972                                                                        if (Element(id+':'+data[2][k]) == null) alert('ï¿œ nulovgdfv'); 
    19411973                                                                        Element(id+':'+data[2][k]).innerHTML = data[3][pos][k]; 
    19421974                                                                } 
     
    19441976                                        } 
    19451977                                } 
    1946          
     1978 
    19471979                                if (--ncards == 0) 
    19481980                                { 
     
    19501982                                        i = CC_max_cards[1]; 
    19511983                                } 
    1952          
     1984 
    19531985                                pos++; 
    19541986                        } 
     
    19581990 
    19591991function populateGroupsInCards(data) 
    1960 {        
     1992{ 
    19611993        var pos = 0; 
    1962         var contacts = data[5];          
     1994        var contacts = data[5]; 
    19631995        var ncards = data[3].length; 
    1964          
     1996 
    19651997        if (typeof(data[3]) == 'object' && ncards > 0) 
    19661998        { 
     
    19702002                        { 
    19712003                                id = 'cc_card:'+j+':'+i; 
    1972                          
     2004 
    19732005                                for (var k = 0; k < data[2].length; k++) 
    19742006                                { 
    1975                                  
     2007 
    19762008                                        if(data[3][pos][k] != 'none') 
    1977                                         {        
    1978                                                                                          
     2009                                        { 
     2010 
    19792011                                                switch (data[2][k]) 
    1980                                                 {                                                        
     2012                                                { 
    19812013                                                        case 'cc_title': 
    19822014                                                                if (data[3][pos][k].length > 50) 
     
    19902022                                                                } 
    19912023                                                                break; 
    1992                                                          
     2024 
    19932025                                                        case 'cc_short_name': 
    19942026                                                                if (data[3][pos][k].length > (CC_visual == 'table'  ? 50 : 20)) 
     
    20022034                                                                } 
    20032035                                                                break; 
    2004                                                          
     2036 
    20052037                                                        case 'cc_contacts': 
    20062038 
     
    20112043                                                                var email = ""; 
    20122044 
    2013                                                                 for (var d = 0; d < contacts.length; d++) {                                                                                                                                                                                                                                                                                                      
     2045                                                                for (var d = 0; d < contacts.length; d++) { 
    20142046                                                                        contact += contacts[d]['names_ordered']+ ","; 
    20152047                                                                        email += contacts[d]['connection_value']+","; 
    20162048                                                                } 
    2017                                                                  
     2049 
    20182050                                                                Element(id+':cc_participantes').innerHTML = '<span title="Ver Participantes" id="' + id + ':ccQuickAdd" onmouseout="window.status=\'\';" onclick="ccListParticipants.showList(\''+ Element(id+':cc_id').value+'value\', \''+contact+'\', \''+email+'\', \''+title+'\', \''+id_group+'\');return true;" style="cursor: pointer; cursor: hand; z-index: 1"><img title="Ver participantes" align="center" src="templates/default/images/people-mini.png">&nbsp;&nbsp</span>'; 
    2019                                                                                                                                                                          
     2051 
    20202052                                                                break; 
    2021                                                          
     2053 
    20222054                                                        case 'cc_id': 
    20232055                                                                var id_contact = data[3][pos][k]; 
    20242056                                                                Element(id+':'+data[2][k]).value = data[3][pos][k]; 
    2025                                                                                                                          
     2057 
    20262058                                                                break; 
    2027                                                                  
     2059 
    20282060                                                } 
    20292061                                        } 
    20302062                                } 
    2031          
     2063 
    20322064                                if (--ncards == 0) 
    20332065                                { 
     
    20352067                                        i = CC_max_cards[1]; 
    20362068                                } 
    2037          
     2069 
    20382070                                pos++; 
    20392071                        } 
     
    20642096        }; 
    20652097 
    2066         Connector.newRequest('setMaxCards', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=set_n_cards&ncards=' + ncards, 'GET');  
     2098        Connector.newRequest('setMaxCards', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=set_n_cards&ncards=' + ncards, 'GET'); 
    20672099} 
    20682100 
     
    20702102{ 
    20712103        var coord = new Array(); 
    2072          
     2104 
    20732105        //Element('cc_card_space').innerHTML = ''; 
    20742106        //return; 
     
    20772109        //card_space_width = parseInt(is_ie ? document.body.offsetWidth : window.innerWidth) - parseInt(Element('cc_left').offsetWidth) - parseInt(CC_card_extra) - 40; 
    20782110        card_space_height = parseInt(Element('cc_card_space').offsetHeight) - parseInt(CC_card_extra); 
    2079          
     2111 
    20802112        card_width = CC_card_image_width + CC_card_extra; 
    20812113        card_height = CC_card_image_height + CC_card_extra; 
     
    20832115        ncols = parseInt(card_space_width / card_width); 
    20842116        nlines = parseInt(card_space_height / card_height); 
    2085          
     2117 
    20862118        coord[0] = ncols; 
    20872119        //coord[1] = nlines; 
     
    20972129{ 
    20982130                if(type != 'groups') { 
    2099                  
     2131 
    21002132                        html_card = '<td id="' + id + '" style="width: ' + CC_card_image_width + 'px; height: ' + CC_card_image_height + '">' + 
    21012133                                '<div style="border: 0px solid #999; position: relative;">' + 
    2102                                         '<img src="templates/default/images/card.png" border="0" width="' + CC_card_image_width +'" height="' + CC_card_image_height + '"i ondblclick="editContact(Element(\'' + id + ':cc_id\').value);">' +  
     2134                                        '<img src="templates/default/images/card.png" border="0" width="' + CC_card_image_width +'" height="' + CC_card_image_height + '"i ondblclick="editContact(Element(\'' + id + ':cc_id\').value);">' + 
    21032135                                                ( ccTree.catalog_perms == 1 ? 
    21042136                                                '<span id="' + id + ':cc_icon_data" style="position: absolute; top: 35px; left: 222px; width: 18px; height: 18px; cursor: pointer; cursor: hand; z-index: 1"></span>':'') + 
     
    21062138                                                '<img title="'+Element('cc_msg_card_edit').value+'" id="' + id + ':cc_card_edit" style="position: absolute; top: 35px; left: 222px; width: 18px; height: 18px; cursor: pointer; cursor: hand; z-index: 1" onclick="editContact(Element(\'' + id + ':cc_id\').value);" onmouseover="resizeIcon(\''+id+':cc_card_edit\',0)" onmouseout="resizeIcon(\''+id+':cc_card_edit\',1)" src="templates/default/images/cc_card_edit.png">' + 
    21072139                                                '<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">' : '') + 
    2108                                                 '<img id="' + id + ':cc_photo" style="position: absolute; top: 15px; left: 7px;" src="" border="0" ondblclick="editContact(Element(\'' + id + ':cc_id\').value);">' +  
     2140                                                '<img id="' + id + ':cc_photo" style="position: absolute; top: 15px; left: 7px;" src="" border="0" ondblclick="editContact(Element(\'' + id + ':cc_id\').value);">' + 
    21092141                                                '<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>' + 
    2110                                                 '<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>'+  
    2111                                                 '<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>' +  
    2112                                                 '<span id="' + id + ':cc_title" style="position: absolute; top: 60px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 12px; text-align: center; height: 10px;"></span>' +  
    2113                                                 '<span id="' + id + ':cc_phone" style="position: absolute; top: 90px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 10px; text-align: center; height: 10px;"></span>' +  
    2114                                                 '<span id="' + id + ':cc_mail" style="position: absolute; top: 105px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 10px; text-align: center; height: 10px;"></span>' +  
    2115                                                 '<span id="' + id + ':cc_alias" style="position: absolute; top: 95px; left: 10px; width: 60px; border: 0px solid #999; font-weight: normal; font-size: 9px; text-align: center; height: 10px;"></span>' +  
     2142                                                '<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>'+ 
     2143                                                //Para exibir a matricula do empregado nos cartoes 
     2144                                                '<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>' + 
     2145                                                '<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>' + 
     2146                                                '<span id="' + id + ':cc_title" style="position: absolute; top: 60px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 12px; text-align: center; height: 10px;"></span>' + 
     2147                                                //Para exibir o setor/lotacao do empregado nos cartoes 
     2148                                                '<span id="' + id + ':cc_department" style="position: absolute; top: 70px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 10px; text-align: center; height: 10px;"></span>' + 
     2149                                                '<span id="' + id + ':cc_phone" style="position: absolute; top: 90px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 10px; text-align: center; height: 10px;"></span>' + 
     2150                                                '<span id="' + id + ':cc_mail" style="position: absolute; top: 105px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 10px; text-align: center; height: 10px;"></span>' + 
     2151                                                '<span id="' + id + ':cc_alias" style="position: absolute; top: 95px; left: 10px; width: 60px; border: 0px solid #999; font-weight: normal; font-size: 9px; text-align: center; height: 10px;"></span>' + 
    21162152                                        '<input id="' + id + ':cc_id" type="hidden">' + 
    21172153                                '</div>' + '</td>'; 
    2118                  
     2154 
    21192155                } else { 
    21202156                        html_card = '<td id="' + id + '" style="width: ' + CC_card_image_width + 'px; height: ' + CC_card_image_height + '">' + 
    2121             '<div style="border: 0px solid #999; position: relative;">' +  
     2157            '<div style="border: 0px solid #999; position: relative;">' + 
    21222158                                '<img src="templates/default/images/card.png" border="0" width="' + CC_card_image_width +'" height="' + CC_card_image_height + '"i ondblclick="editContact(Element(\'' + id + ':cc_id\').value);">' + 
    21232159                                '<img title="'+Element('cc_msg_group_edit').value+'" id="' + id + ':cc_card_edit" style="position: absolute; top: 35px; left: 222px; width: 18px; height: 18px; cursor: pointer; cursor: hand; z-index: 1" onclick="editGroup(Element(\'' + id + ':cc_id\').value);" onmouseover="resizeIcon(\''+id+':cc_card_edit\',0)" onmouseout="resizeIcon(\''+id+':cc_card_edit\',1)" src="templates/default/images/cc_card_edit.png">' + 
    2124                                 '<img title="'+Element('cc_msg_group_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,\'groups\');" onmouseover="resizeIcon(\''+id+':cc_card_remove\',0)" onmouseout="resizeIcon(\''+id+':cc_card_remove\',1)" src="templates/default/images/cc_x.png">' +  
     2160                                '<img title="'+Element('cc_msg_group_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,\'groups\');" onmouseover="resizeIcon(\''+id+':cc_card_remove\',0)" onmouseout="resizeIcon(\''+id+':cc_card_remove\',1)" src="templates/default/images/cc_x.png">' + 
    21252161                                '<span id="' + id + ':cc_title" 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>' + 
    21262162                                '<span id="' + id + ':cc_participantes" style="cursor: pointer; cursor: hand; z-index: 1;position: absolute; top: 15px; left: 15px"></span>' + 
     
    21292165                        '</div>' + '</td>'; 
    21302166                } 
    2131          
     2167 
    21322168 
    21332169        return html_card; 
     
    21412177                        else 
    21422178                                bg = "this.style.background=\'#EEEEEE\'"; 
    2143                                                  
     2179 
    21442180                        if(type != 'groups') { 
    2145                          
    2146                                 html_card = '<tr  style="height:20px" id="' + id + '" onmouseout="'+bg+'" onmouseover="this.style.background=\'LIGHTYELLOW\'" bgcolor="EEEEEE"><td width="auto" style="font-weight: normal; font-size: 10px; text-align: left; height: 10px;">' +                                        
    2147                                         '<span valign="bottom" id="' + id + ':cc_icon_group">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="' + id + ':cc_name"></span></td>' + 
     2181 
     2182                                html_card = '<tr  style="height:20px" id="' + id + '" onmouseout="'+bg+'" onmouseover="this.style.background=\'LIGHTYELLOW\'" bgcolor="EEEEEE">' + 
     2183                                        //Para exibir a matricula do empregado na tabela 
     2184                                        '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_empNumber"></span></td>' + 
     2185                                        '<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>' + 
    21482186                                        '<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>' + 
    2149                                         '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_phone"></span></td>' +          
     2187                                        '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_phone"></span></td>' + 
     2188                                        //Para exibir o setor/lotacao do empregado na tabela 
     2189                                        '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_department"></span></td>' + 
     2190//                                      '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_mobile"></span></td>' + 
     2191                                        '<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>' + 
    21502192                                        ( ccTree.catalog_perms == 1 ? 
    21512193                                        '<td align="left"><span valign="bottom" id="' + id + ':cc_icon_data"></span></td>':'') + 
     
    21562198                                        '<img title="'+Element('cc_msg_card_remove').value+'" id="' + id + ':cc_card_remove" style="width: 15px; height: 14px; cursor: pointer; cursor: hand; z-index: 1" onclick="removeEntry(Element(\'' + id + ':cc_id\').value);" src="templates/default/images/cc_x.png">' : '') + 
    21572199                                        '<input id="' + id + ':cc_id" type="hidden">'+ 
    2158                                         '<input type="hidden" id="' + id + ':cc_photo">' +  
    2159                                         '<span id="' + id + ':cc_title" style="display:none"></span>' +  
    2160                                         '<span id="' + id + ':cc_alias" style="display:none"></span>' +  
     2200                                        '<input type="hidden" id="' + id + ':cc_photo">' + 
     2201                                        '<span id="' + id + ':cc_title" style="display:none"></span>' + 
     2202                                        '<span id="' + id + ':cc_alias" style="display:none"></span>' + 
     2203                                        // Esse campo ï¿œ necessï¿œrio se o contato possui dados no campo cc_company 
     2204                                        '<span id="' + id + ':cc_company" style="display:none"></span>' + 
    21612205                                        '</td></tr>'; 
    21622206                        } 
     
    21702214                                        '&nbsp;&nbsp;|&nbsp;&nbsp;'+ 
    21712215                                        '<img  title="'+Element('cc_msg_group_remove').value+'" id="' + id + ':cc_card_remove" style="width: 15px; height: 14px; cursor: pointer; cursor: hand; z-index: 1" onclick="removeEntry(Element(\'' + id + ':cc_id\').value,\'groups\');" src="templates/default/images/cc_x.png">'  + 
    2172                                         '<input id="' + id + ':cc_id" type="hidden">'+                                                                           
     2216                                        '<input id="' + id + ':cc_id" type="hidden">'+ 
    21732217                                        '</td></tr>'; 
    21742218                        } 
     
    21802224{ 
    21812225        var pos; 
    2182          
     2226 
    21832227        html_cards = '<div id="divScrollMain" style="overflow:auto;z-index:1"><table width="100%" border="0" cellpadding="0" cellspacing="3">'; 
    2184          
     2228 
    21852229        if (ncards > 0) 
    21862230        { 
     
    22022246                if((ccTree.catalog_perms & 2) && type != 'groups') 
    22032247                        html_cards += '<tr><td colspan=4 align="right"><button id="cc_button_tools" value="" type="button" onclick="javascript:removeAllEntries()">Remover Todos</button></td></tr>'; 
    2204         }        
     2248        } 
    22052249        else if (CC_max_cards != 0) 
    22062250        { 
     
    22222266        html_cards = '<div id="divScrollMain" style="overflow:auto;z-index:1">'; 
    22232267        html_cards += '<table  border="0" cellpadding="0" cellspacing="' + CC_card_extra + '">'; 
    2224          
     2268 
    22252269        if (ncards > 0) 
    22262270        { 
     
    22412285                if((ccTree.catalog_perms & 2) && type != 'groups') 
    22422286                        html_cards += '<tr><td colspan=3 align="right"><button id="cc_button_tools" value="" type="button" onclick="javascript:removeAllEntries()">Remover Todos</button></td></tr>'; 
    2243         }        
     2287        } 
    22442288        else if (CC_max_cards != 0) 
    22452289        { 
     
    22782322                else if(CC_visual == 'table') 
    22792323                        drawTable(0); 
    2280                          
     2324 
    22812325                setPages(0,0); 
    22822326                return; 
     
    22882332                data = unserialize(responseText); 
    22892333                if (data[0] == '0') 
    2290                 {                                
    2291                         Element('cc_type_contact').value = data[1];                      
     2334                { 
     2335                        Element('cc_type_contact').value = data[1]; 
    22922336                        CC_npages = 0; 
    22932337                        CC_actual_page = 1; 
     
    23012345                else 
    23022346                Element('cc_type_contact').value = data[10]; 
    2303                  
    2304 //              Element('cc_debug').innerHTML = responseText;                                            
    2305                  
     2347 
     2348//              Element('cc_debug').innerHTML = responseText; 
     2349 
    23062350                if (typeof(data) != 'object') 
    23072351                { 
     
    23092353                        return; 
    23102354                } 
    2311                  
     2355 
    23122356                if (typeof(data[3]) == 'object') 
    23132357                { 
    23142358                        CC_npages = parseInt(data[0]); 
    2315                         CC_actual_page = parseInt(data[1]);                      
     2359                        CC_actual_page = parseInt(data[1]); 
    23162360                        if(CC_visual == 'cards') 
    23172361                                drawCards(data[3].length, data[10]); 
     
    23212365                        populateCards(data, data[10]); 
    23222366                        setPages(data[0], data[1]); 
    2323                          
     2367 
     2368                } 
     2369                else if (data['error']) 
     2370                { 
     2371                        showMessage(data['error']); 
    23242372                } 
    23252373                else 
     
    23322380        var info = "letter="+letter+"&page="+CC_actual_page+"&ids="+ids; 
    23332381        Connector.newRequest('showCards', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_cards_data', 'POST', handler, info); 
     2382} 
     2383 
     2384 
     2385function clearCards() 
     2386{ 
     2387        clearLetterSelection(); 
     2388        setHeightSpace(); 
     2389        setMaxCards(getMaxCards()); 
     2390 
     2391        if(CC_visual == 'cards') 
     2392                drawCards(0); 
     2393        else if(CC_visual == 'table') 
     2394                drawTable(0); 
     2395 
     2396        setPages(0,0); 
     2397        return; 
    23342398} 
    23352399 
     
    23422406        var table_h = Element('cc_panel_table'); 
    23432407        var cards_h = Element('cc_panel_cards'); 
    2344          
     2408 
    23452409        switch (type) 
    23462410        { 
     
    23552419                        break; 
    23562420        } 
    2357          
     2421 
    23582422        CC_visual = type; 
    23592423        showCards(getActualLetter(), getActualPage()); 
    23602424} 
    23612425 
    2362 function ccSearchUpdate(ids) 
     2426/*function ccSearchUpdate(ids) 
    23632427{ 
    23642428        Element('cc_panel_letters').style.display = 'none'; 
    23652429        Element('cc_panel_search').style.display  = 'inline'; 
    2366          
     2430 
    23672431        if(CC_visual == 'cards') 
    23682432                drawCards(0); 
     
    23752439                return; 
    23762440        } 
    2377          
     2441 
    23782442        var sIds = serialize(ids); 
    23792443 
     
    23832447        } 
    23842448        showCards('search', '1', sIds); 
     2449} 
     2450*/ 
     2451 
     2452function ccSearchUpdate() 
     2453{ 
     2454        Element('cc_panel_letters').style.display = 'none'; 
     2455        Element('cc_panel_search').style.display  = 'inline'; 
     2456 
     2457        if(CC_visual == 'cards') 
     2458                drawCards(0); 
     2459        else if(CC_visual == 'table') 
     2460                drawTable(0); 
     2461 
     2462        if (CC_actual_letter != 'search') 
     2463        { 
     2464                CC_last_letter = CC_actual_letter; 
     2465        } 
     2466        //showCards('search', '1', sIds); 
    23852467} 
    23862468 
     
    23992481        Element('cc_panel_search').style.display  = 'none'; 
    24002482        Element('cc_panel_letters').style.display = 'inline'; 
    2401         showCards(CC_last_letter, '1'); 
     2483        clearCards(); 
     2484        //showCards(CC_last_letter, '1'); 
    24022485} 
    24032486 
     
    24242507        data[3] = Element('cc_qa_phone').value; 
    24252508        data[4] = Element('cc_qa_email').value; 
     2509 
     2510        return data; 
     2511} 
     2512 
     2513function sendQuickAdd () 
     2514{ 
     2515        var data = getQuickAdd(); 
     2516 
     2517        var str = serialize(data); 
     2518 
     2519        if (!str) 
     2520        { 
     2521                return false; 
     2522        } 
     2523 
     2524        var handler = function (responseText) 
     2525        { 
     2526                setTimeout('updateCards()',100);; 
     2527        } 
     2528 
     2529        resetQuickAdd(); 
     2530 
     2531        Connector.newRequest('quickAdd', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=quick_add', 'POST', handler, 'add='+escape(str)); 
     2532} 
     2533 
    24262534         
    2427         return data; 
    2428 } 
    2429  
    2430 function sendQuickAdd () 
    2431 { 
    2432         var data = getQuickAdd(); 
    2433          
    2434         var str = serialize(data); 
    2435  
    2436         if (!str) 
    2437         { 
    2438                 return false; 
    2439         } 
    2440  
    2441         var handler = function (responseText) 
    2442         { 
    2443                 setTimeout('updateCards()',100);; 
    2444         } 
    2445  
    2446         resetQuickAdd(); 
    2447  
    2448         Connector.newRequest('quickAdd', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=quick_add', 'POST', handler, 'add='+escape(str)); 
    2449 } 
     2535function connectVoip (phoneUser, typePhone){ 
     2536        var handler_voip = function (responseText){ 
     2537                if(!responseText) { 
     2538                        alert("Erro conectando servidor VoIP."); 
     2539                } 
     2540                else{ 
     2541                        data = unserialize(responseText); 
     2542                        alert("Requisitando chamada para o ramal: "+data); 
     2543                } 
     2544        } 
     2545        Connector.newRequest('voip', "../../expressoMail1_2/controller.php?action=expressoMail1_2.functions.callVoipconnect&to="+phoneUser+"&typePhone="+typePhone, 'POST', handler_voip); 
     2546        } 
Note: See TracChangeset for help on using the changeset viewer.