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

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

File:
1 edited

Legend:

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

    r284 r285  
    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  
    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                         } 
     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']; 
    318313                } 
    319314 
    320315                if(data['id_group']) { 
    321  
    322                         if(data['contact_in_list']) { 
    323                                 for(i = 0; i < data['contact_in_list'].length; i++) { 
     316                 
     317                        if(data['contact_in_list']) {                                    
     318                                for(i = 0; i < data['contact_in_list'].length; i++) {                            
    324319                                        option = document.createElement('option'); 
    325320                                        option.value = data['contact_in_list'][i]['id_connection']; 
    326                                         option.text = data['contact_in_list'][i]['names_ordered']+' ('+data['contact_in_list'][i]['connection_value']+')'; 
     321                                        option.text = data['contact_in_list'][i]['names_ordered']+' ('+data['contact_in_list'][i]['connection_value']+')';                               
    327322                                        Element('contact_in_list').options[Element('contact_in_list').options.length] = option; 
    328323                                } 
    329                         } 
    330  
     324                        }                
     325                         
    331326                        Element('title').value =  data['title']; 
    332327                } 
    333  
     328                                 
    334329                if (typeof(data) != 'object' || data['result'] != 'ok') 
    335330                { 
     
    338333                } 
    339334        }; 
    340  
     335                 
    341336        id = typeof(id) == 'undefined' ? id = 0 :  id; 
    342  
    343         ccAddGroup.clear(true); 
     337         
     338        ccAddGroup.clear(true);                  
    344339        Connector.newRequest('populateEditGroup', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_group&id='+id, 'GET', handler); 
    345340} 
     
    376371                return false; 
    377372        } 
    378  
     373         
    379374        /* First thing: Send Photo */ 
    380375        if (Element('cc_pd_select_photo').value != '' && !is_ie) 
     
    394389                        frame = old_frame; 
    395390                } 
    396  
     391                 
    397392                frame.id = 'cc_photo_frame'; 
    398393                frame.style.visibility = 'hidden'; 
     
    403398 
    404399                form = frame.contentDocument.createElement('form'); 
    405  
     400                 
    406401                var id_contact = Element('cc_full_add_contact_id').value; 
    407402                form.id = 'cc_form_photo'; 
     
    409404                form.enctype = 'multipart/form-data'; 
    410405                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 : ''); 
    411  
     406                 
    412407                var input_clone = Element('cc_pd_select_photo').cloneNode(false); 
    413408                form.appendChild(input_clone); 
    414  
     409                 
    415410                frame.contentDocument.body.appendChild(form); 
    416411                form.submit(); 
     
    466461        var empty = true; 
    467462        var replacer = '__##AND##__'; 
    468  
     463         
    469464        data['commercialAnd'] = replacer; 
    470  
     465         
    471466        if (Element('cc_full_add_contact_id').value != '' && Element('cc_full_add_contact_id').value != 'null') 
    472467        { 
     
    477472        /* Status: Full Added */ 
    478473        data['id_status'] = CC_STATUS_FULL_ADD; 
    479  
     474         
    480475        /* Personal Data */ 
    481476        data['alias']         = replaceComAnd(Element('cc_pd_alias').value, replacer); 
     
    515510                                data['connections'] = new Array(); 
    516511                        } 
    517  
     512                         
    518513                        for (var i in CC_contact_full_info['connections'][type]) 
    519514                        { 
     
    527522                                        data['connections']['connection'+connNumber] = new Array(5); 
    528523                                } 
    529  
     524                                 
    530525                                data['connections']['connection'+connNumber]['id_connection'] = CC_contact_full_info['connections'][type][i]['id']; 
    531526                                data['connections']['connection'+connNumber]['id_typeof_connection'] = type; 
     
    536531                                                data['connections']['connection'+connNumber]['connection_is_default']  = 'TRUE'; 
    537532                                        } 
    538                                         else 
     533                                        else  
    539534                                                data['connections']['connection'+connNumber]['connection_is_default']  = 'FALSE'; 
    540535                                } 
    541536 
    542537//                              data['connections']['connection'+connNumber].length = 5; 
    543  
     538                                 
    544539                                empty = false; 
    545540                                connNumber++; 
     
    548543 
    549544                } 
    550  
     545                 
    551546                if (!empty) 
    552547                { 
     
    555550                } 
    556551        } 
    557  
     552         
    558553        if (CC_contact_full_info['removed_conns']) 
    559554        { 
    560555                empty = false; 
    561  
     556                 
    562557                if (typeof(data['connections']) != 'object') 
    563558                { 
     
    594589                        for (var i in CC_contact_full_info['connections'][type]){ 
    595590                                if((CC_contact_full_info['connections'][type][i]['value'].length < 4) || 
    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'); 
     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'); 
    598593                                        return false; 
    599594                                } 
     
    601596                        var _options_default = Element("cc_"+(type == 1 ? 'email' : 'phone')+"_default"); 
    602597                        if(_options_default.value == '-1') { 
    603                                 alert("ï¿œ necessï¿œrio escolher um "+ (type == 1 ? 'E-mail' : 'Telefone')+" como padrï¿œo!"); 
     598                                alert("É necessário escolher um "+ (type == 1 ? 'E-mail' : 'Telefone')+" como padrão!"); 
    604599                                return false; 
    605600                        } 
    606601                } 
    607  
     602                 
    608603        } 
    609604 
     
    614609 
    615610/********* Personal Data Functions *********/ 
    616 /* 
     611/*  
    617612 * data[0] => cc_pd_select_photo 
    618613 * data[1] => cc_pd_alias 
     
    662657{ 
    663658        Element('cc_addr_types').selectedIndex = 0; 
    664  
     659         
    665660        Element('cc_addr_countries').selectedIndex = 0; 
    666661        Element('cc_addr_countries').disabled = true; 
    667  
     662         
    668663        Element('cc_addr_states').selectedIndex = 0; 
    669664        Element('cc_addr_states').disabled = true; 
     
    716711        var type = Element('cc_addr_types'); 
    717712        var oldSelected = type.value; 
    718  
     713         
    719714        saveAddressFields(); 
    720  
     715         
    721716        if (oldSelected == '_NONE_') 
    722717        { 
     
    724719                return true; 
    725720        } 
    726  
     721         
    727722        CC_addr_last_selected = type.selectedIndex; 
    728  
     723         
    729724        Element('cc_addr_countries').disabled = false; 
    730  
     725         
    731726        var data = CC_contact_full_info['addresses']; 
    732727        var addrIndex  = 'address'+Element('cc_addr_types').value; 
    733  
    734         if (typeof(data) != 'object' || typeof(data[addrIndex]) != 'object') 
     728         
     729        if (typeof(data) != 'object' || typeof(data[addrIndex]) != 'object')  
    735730        { 
    736731                resetAddressFields(); 
     
    741736                return true; 
    742737        } 
    743  
     738         
    744739        var addrTypeID = Element('cc_addr_types').value; 
    745  
     740         
    746741        data = CC_contact_full_info['addresses'][addrIndex]; 
    747  
     742         
    748743        Element('cc_addr_id').value                              = data['id_address']           ? data['id_address']                    : ''; 
    749744        Element('cc_addr_1').value                              = data['address1']                      ? data['address1']                              : ''; 
     
    767762                states.selectedIndex = 0; 
    768763                clearSelectBox(states, 4); 
    769                 updateAddrCities(); 
     764                updateAddrCities();      
    770765                return; 
    771766        } 
     
    782777        { 
    783778                var data = unserialize(responseText); 
    784  
     779                 
    785780                clearSelectBox(states, 1); 
    786  
     781                         
    787782                if (typeof(data) != 'object') 
    788783                { 
    789784                        showMessage(Element('cc_msg_err_contacting_server').value); 
    790  
     785         
    791786                        return; 
    792787                } 
     
    795790                { 
    796791                        states.disabled = true; 
    797                         cities.disabled = true; 
     792                        cities.disabled = true;                  
    798793                        states.selectedIndex = 0; 
    799794                        cities.selectedIndex = 0; 
     
    835830                } 
    836831        }; 
    837  
     832         
    838833        Connector.newRequest('populateStates', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_states&country='+Element('cc_addr_countries').value, 'GET', handler); 
    839834} 
     
    863858                        newState.disabled = false; 
    864859                        updateAddrNewStateOnMouseOut(); 
    865  
     860                         
    866861                        cities.disabled = false; 
    867862                        clearSelectBox(cities, 3); 
     
    874869                case '_NOSTATE_': 
    875870                        clearSelectBox(cities, 3); 
    876  
     871                         
    877872                        cities.disabled = false; 
    878873                        cities.selectedIndex = 0; 
    879  
     874                         
    880875                        requestStr = 'country='+Element('cc_addr_countries').value; 
    881876                        break; 
    882  
     877                 
    883878                default: 
    884879                        requestStr = 'country='+Element('cc_addr_countries').value+'&state='+states.value; 
     
    895890{ 
    896891        var cities = Element('cc_addr_cities'); 
    897  
     892         
    898893        var handler = function (responseText) 
    899894        { 
    900895                var data = unserialize(responseText); 
    901  
     896                 
    902897                clearSelectBox(cities, 1); 
    903  
     898                 
    904899                if (typeof(data) != 'object') 
    905900                { 
    906901                        showMessage(Element('cc_msg_err_contacting_server').value); 
    907  
     902                         
    908903                        return; 
    909904                } 
     
    950945                } 
    951946        }; 
    952  
     947         
    953948        Connector.newRequest('populateCities', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_cities&'+requestStr, 'GET', handler); 
    954949} 
     
    956951function updateAddrNewStateOnMouseOver () 
    957952{ 
    958         if (Element('cc_addr_states_new').value == Element('cc_msg_type_state').value && Element('cc_addr_states').selectedIndex == 1) 
     953        if (Element('cc_addr_states_new').value == Element('cc_msg_type_state').value && Element('cc_addr_states').selectedIndex == 1)  
    959954        { 
    960955                Element('cc_addr_states_new').value = ''; 
     
    964959function updateAddrNewStateOnMouseOut () 
    965960{ 
    966         if (Element('cc_addr_states_new').value.length == 0 && Element('cc_addr_states').selectedIndex == 1) 
     961        if (Element('cc_addr_states_new').value.length == 0 && Element('cc_addr_states').selectedIndex == 1)  
    967962        { 
    968963                Element('cc_addr_states_new').value = Element('cc_msg_type_state').value; 
     
    984979                return; 
    985980        } 
    986  
     981         
    987982        Element('cc_addr_1').readonly = false; 
    988983        Element('cc_addr_1').disabled = false; 
     
    10141009 
    10151010                        //resetAddrFillingFields(); 
    1016  
     1011                         
    10171012                        return; 
    10181013 
     
    10221017                        newCity.disabled = false; 
    10231018                        updateAddrNewCityOnMouseOut(); 
    1024  
     1019                         
    10251020                        break; 
    10261021 
     
    10361031function updateAddrNewCityOnMouseOver () 
    10371032{ 
    1038         if (Element('cc_addr_cities_new').value == Element('cc_msg_type_city').value && Element('cc_addr_cities').selectedIndex == 1) 
     1033        if (Element('cc_addr_cities_new').value == Element('cc_msg_type_city').value && Element('cc_addr_cities').selectedIndex == 1)  
    10391034        { 
    10401035                Element('cc_addr_cities_new').value = ''; 
     
    10441039function updateAddrNewCityOnMouseOut () 
    10451040{ 
    1046         if (Element('cc_addr_cities_new').value.length == 0 && Element('cc_addr_cities').selectedIndex == 1) 
     1041        if (Element('cc_addr_cities_new').value.length == 0 && Element('cc_addr_cities').selectedIndex == 1)  
    10471042        { 
    10481043                Element('cc_addr_cities_new').value = Element('cc_msg_type_city').value; 
     
    10581053                return true; 
    10591054        } 
    1060  
    1061         var addrFields = new Array('cc_addr_1', 
    1062                                    'cc_addr_2', 
    1063                                                            'cc_addr_complement', 
     1055         
     1056        var addrFields = new Array('cc_addr_1',  
     1057                                   'cc_addr_2',  
     1058                                                           'cc_addr_complement',  
    10641059                                                           'cc_addr_other', 
    1065                                                            'cc_addr_postal_code', 
     1060                                                           'cc_addr_postal_code',  
    10661061                                                           'cc_addr_po_box', 
    10671062                                                           'cc_addr_countries', 
     
    10701065 
    10711066        var empty = true; 
    1072  
     1067         
    10731068        for (var i = 0; i < 8; i++) 
    10741069        { 
     
    10791074                } 
    10801075        } 
    1081  
     1076                                 
    10821077        if (empty) 
    10831078        { 
     
    11081103                default: 
    11091104                        addrInfo['id_country'] = Element('cc_addr_countries').value; 
    1110  
     1105                 
    11111106        } 
    11121107 
     
    11221117                default: 
    11231118                        addrInfo['id_state'] = Element('cc_addr_states').value; 
    1124  
     1119                 
    11251120        } 
    11261121 
     
    11351130                default: 
    11361131                        addrInfo['id_city'] = Element('cc_addr_cities').value; 
    1137  
    1138         } 
     1132                 
     1133        }        
    11391134 
    11401135        addrInfo['id_typeof_address']  = Element('cc_addr_types').options[lastIndex].value; 
     
    11491144        CC_contact_full_info['addresses']['address'+Element('cc_addr_types').options[lastIndex].value] = addrInfo; 
    11501145 
    1151         if (Element('cc_addr_cities').value == '_NEW_' && 
     1146        if (Element('cc_addr_cities').value == '_NEW_' &&  
    11521147            Element('cc_msg_type_city').value !=  Element('cc_addr_cities_new').value && 
    11531148                Element('cc_addr_cities_new').value != '') 
    11541149        { 
    11551150                var addrRootInfo = CC_contact_full_info['addresses']['new_cities']; 
    1156  
     1151                 
    11571152                if (!addrRootInfo) 
    11581153                { 
    11591154                        addrRootInfo = new Array(); 
    11601155                } 
    1161  
     1156                 
    11621157                var i = addrRootInfo.length; 
    11631158                addrRootInfo[addrInfo['id_typeof_address']] = new Array(); 
     
    11681163        } 
    11691164 
    1170         if (Element('cc_addr_states').value == '_NEW_' && 
    1171             Element('cc_msg_type_state').value !=  Element('cc_addr_states_new').value && 
     1165        if (Element('cc_addr_states').value == '_NEW_' &&  
     1166            Element('cc_msg_type_state').value !=  Element('cc_addr_states_new').value &&  
    11721167                Element('cc_addr_states_new').value != '') 
    11731168        { 
    11741169                var addrRootInfo = CC_contact_full_info['addresses']['new_states']; 
    1175  
     1170                 
    11761171                if (!addrRootInfo) 
    11771172                { 
    11781173                        addrRootInfo = new Array(); 
    11791174                } 
    1180  
     1175                 
    11811176                var i = addrRootInfo.length; 
    11821177                addrRootInfo[addrInfo['id_typeof_address']] = new Array(); 
     
    12081203        for(idx_conn; idx_conn < cc_conn_default.options.length; idx_conn++) 
    12091204                if(cc_conn_default.options[idx_conn].value == _label) 
    1210                         break; 
    1211  
     1205                        break;   
     1206         
    12121207        if(idx_conn == cc_conn_default.options.length) 
    12131208                cc_conn_default.options[idx_conn] = new Option (_label,_label, false,false); 
    1214  
     1209                         
    12151210        if (!document.all) 
    12161211        { 
    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                 } 
     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>'; 
    12331217        } 
    12341218        else 
     
    12541238                img.align = 'top'; 
    12551239                img.onclick = function(e){ removeConnField(remove_id);}; 
    1256  
     1240                 
    12571241                for (var i = 0; i < 3; i++) 
    12581242                { 
     
    12651249 
    12661250                inputs[1].id = 'cc_conn_name_'+CC_conn_count; 
    1267                 inputs[1].type = 'hidden'; 
     1251                inputs[1].type = 'hidden';               
    12681252 
    12691253                inputs[2].id = 'cc_conn_value_'+CC_conn_count; 
     
    12941278                || typeof(CC_contact_full_info['connections'][CC_conn_last_selected]) == 'undefined' 
    12951279                || typeof(CC_contact_full_info['connections'][CC_conn_last_selected][CC_conn_count]) == 'undefined'); 
    1296  
    1297         if(_emptyLine) { 
    1298  
     1280         
     1281        if(_emptyLine) {         
     1282                 
    12991283                if(Element("cc_conn_type_sel").value == '-1'){ 
    1300                                 return false; 
    1301                 } 
    1302  
     1284                                return false;    
     1285                } 
     1286                 
    13031287                for(k = 0; k < CC_conn_count; k++) { 
    13041288                        if(Element("cc_conn_name_"+k) && Element("cc_conn_name_"+k).value != "" && Element("cc_conn_name_"+k).value == Element("cc_conn_type_sel").value) { 
    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; 
     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;                           
    13071291                                return false; 
    13081292                        } 
    13091293                } 
    1310         } 
     1294        }        
    13111295        if (!document.all) 
    13121296        { 
     
    13351319 
    13361320function connRemoveLine(id) 
    1337 { 
     1321{        
    13381322        var p = Element(id).parentNode; 
    13391323        var cc_conn_default = Element("cc_phone_default").style.display == '' ? Element("cc_phone_default") : Element("cc_email_default"); 
     
    13741358                } 
    13751359        } 
    1376  
     1360         
    13771361        CC_conn_count = 0; 
    13781362} 
     
    13961380function updateConnFields() 
    13971381{ 
    1398  
     1382         
    13991383        var connID; 
    14001384        var i; 
     
    14051389        var cc_conn_is_default = ''; 
    14061390        var selected_index = ''; 
    1407  
     1391         
    14081392        cc_conn_type_sel.disabled = false; 
    14091393        div_cc_conn_is_default.style.display = ""; 
    1410  
     1394         
    14111395        for(var i = 0;i < cc_conn_type_sel.options.length; i++) 
    1412                 cc_conn_type_sel.options[i--] = null; 
    1413  
     1396                cc_conn_type_sel.options[i--] = null;    
     1397                 
    14141398        if(Element('cc_conn_type_1').checked) { 
    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'); 
     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);         
    14181405                connID = 1; 
    14191406                selected_index = cc_email_default.options.selectedIndex; 
     
    14221409                } 
    14231410 
    1424                 cc_email_default.options[0] = new Option('Selecionar Email...','-1'); 
    1425  
     1411                var lang_select_email = Element('cc_msg_select_email').value; 
     1412                cc_email_default.options[0] = new Option(lang_select_email,'-1');                
    14261413                cc_phone_default.style.display = 'none'; 
    1427                 cc_email_default.style.display = ''; 
     1414                cc_email_default.style.display = '';                     
    14281415                cc_conn_is_default = cc_email_default; 
    14291416        } 
    14301417        else if(Element('cc_conn_type_2').checked) { 
    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'); 
     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 
    14371431                connID = 2; 
    14381432                selected_index = cc_phone_default.options.selectedIndex; 
     
    14411435                } 
    14421436 
    1443                 cc_phone_default.options[0] = new Option('Selecionar Telefone...','-1'); 
     1437                var lang_choose_phone = Element('cc_msg_choose_phone').value;            
     1438                cc_phone_default.options[0] = new Option(lang_choose_phone,'-1'); 
    14441439                cc_email_default.style.display = 'none'; 
    14451440                cc_phone_default.style.display = ''; 
    14461441                cc_conn_is_default = cc_phone_default; 
    14471442        } 
    1448  
     1443                         
    14491444        Element("cc_conn_type_sel").options.selectedIndex = 0; 
    14501445        /* First save the data */ 
     
    14521447 
    14531448        CC_conn_last_selected = connID; 
    1454  
     1449         
    14551450        clearConn(); 
    1456  
     1451         
    14571452        if (connID == '_NONE_') 
    14581453        {       cc_conn_is_default.disabled = true; 
    14591454                return; 
    14601455        } 
    1461  
     1456         
    14621457        /* If no data already available, return */ 
    14631458        if (!CC_contact_full_info['connections']) 
     
    14831478                        } 
    14841479                } 
    1485         } 
     1480        }        
    14861481        if(cc_conn_is_default.options.length > selected_index) 
    14871482                cc_conn_is_default.options.selectedIndex = (selected_index == "-1" ? 0 : selected_index); 
     
    15041499                        CC_contact_full_info['connections'][CC_conn_last_selected] = new Array(); 
    15051500                } 
    1506                 else 
     1501                else  
    15071502                { 
    15081503                        delete CC_contact_full_info['connections'][CC_conn_last_selected]; 
     
    15161511                                var subNodes = nodes[i].childNodes; 
    15171512                                var found = false; 
    1518  
     1513                                 
    15191514                                for (var j = 0; j < subNodes.length; j++) 
    15201515                                { 
    1521                                         if (subNodes[j].childNodes.length > 0 && 
     1516                                        if (subNodes[j].childNodes.length > 0 &&  
    15221517                                            subNodes[j].childNodes[0].id) 
    15231518                                        { 
     
    15271522                                                        CC_contact_full_info['connections'][CC_conn_last_selected][k] = new Array(); 
    15281523                                                } 
    1529  
     1524                                                 
    15301525                                            if (subNodes[j].childNodes[0].id.indexOf('cc_conn_name') != -1) 
    15311526                                                { 
     
    15471542                                                        else 
    15481543                                                        { 
    1549                                                                 CC_contact_full_info['connections'][CC_conn_last_selected][k]['value'] = ''; 
     1544                                                                CC_contact_full_info['connections'][CC_conn_last_selected][k]['value'] = '';  
    15501545                                                        } 
    15511546                                                } 
     
    15581553                                        } 
    15591554                                } 
    1560  
     1555                                 
    15611556                                if (found) 
    15621557                                { 
     
    15751570                        delete CC_contact_full_info['connections'][CC_conn_last_selected]; 
    15761571                } 
    1577  
     1572                 
    15781573        } 
    15791574 
     
    16011596        var number = randomString().toLowerCase(); 
    16021597        var result = ''; 
    1603  
     1598         
    16041599        if(!is_ie) 
    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); 
     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); 
    16061601        else 
    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,""); 
     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,""); 
    16081603 
    16091604        if(result) { 
     
    16111606                        Connector.newRequest('removeAllEntries', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=remove_all_entries', 'GET', handler); 
    16121607                else 
    1613                         alert('Cï¿œdigo Incorreto'); 
    1614         } 
     1608                        alert('Código Incorreto'); 
     1609        }        
    16151610} 
    16161611 
     
    16231618                return; 
    16241619        } 
    1625  
     1620         
    16261621        var handler = function (responseText) 
    16271622        { 
     
    16331628                        return; 
    16341629                } 
    1635  
     1630                 
    16361631                if (data['status'] != 'ok') 
    16371632                { 
     
    16391634                        return; 
    16401635                } 
    1641  
     1636                 
    16421637                setTimeout('updateCards()',80);; 
    16431638        }; 
    1644  
     1639                 
    16451640        typeArg = (type == 'groups' ? 'group' : 'entry'); 
    1646  
     1641                 
    16471642        Connector.newRequest('removeEntry', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=remove_'+typeArg+'&remove=' + id, 'GET', handler); 
    16481643} 
     
    16671662        var w_height = 0; 
    16681663        var w_extra = 200; 
    1669  
     1664         
    16701665        if (document.body.clientHeight) 
    16711666        { 
     
    17061701        } 
    17071702} 
    1708  
    17091703function getActualPage () 
    17101704{ 
     
    17711765                                final_page = 1; 
    17721766                        } 
    1773  
     1767                         
    17741768                        html_pages += '<a href="javascript:setPages('+npages+', '+ actual_page +', '+ final_page +')">...</a> '; 
    17751769 
    17761770                        page = showing_page ? showing_page : actual_page; 
    17771771                } 
    1778  
     1772                 
    17791773                for (; page <= npages; page++) 
    17801774                { 
     
    18361830                Element('cc_panel_arrow_last').style.cursor = 'hand'; 
    18371831        } 
    1838  
     1832         
    18391833        Element('cc_panel_pages').innerHTML = html_pages; 
    18401834} 
     
    18421836function populateCards(data, type) 
    18431837{ 
    1844  
     1838        if (data[3].length >= 100 ) 
     1839        { 
     1840                alert("Critério de pesquisa muito abrangente, achados " + data[3].length + " resultados"); 
     1841                for (i = 0; i < (Math.sqrt(data[3].length)-1); i++) 
     1842                        for (j = 0; j < 3; j++) 
     1843                                document.getElementById("cc_card:"+j+":"+i).innerHTML = ''; 
     1844                return false; 
     1845        } 
     1846         
    18451847        if(type == 'groups') 
    18461848                return populateGroupsInCards(data); 
    1847  
     1849         
    18481850        var pos = 0; 
    18491851        var ncards = data[3].length; 
    1850  
     1852         
    18511853        if (typeof(data[3]) == 'object' && ncards > 0) 
    18521854        { 
     
    18561858                        { 
    18571859                                id = 'cc_card:'+j+':'+i; 
    1858  
     1860                         
    18591861                                for (var k = 0; k < data[2].length; k++) 
    18601862                                { 
    1861  
    1862                                         if(data[2][k] ==  'cc_mail' && data[3][pos][k] == 'none' && !(ccTree.catalog_perms & 2) ) { 
     1863                                        if(!(ccTree.catalog_perms & 2)) 
     1864                                        { 
     1865                                                switch(data[2][k]) 
     1866                                                { 
     1867                                                        case 'cc_mail' : 
     1868 
     1869                                                                if(data[3][pos][k] === 'none') 
     1870                                                                        data[3][pos][k] = '&nbsp'; 
     1871                                                                break; 
     1872                                                        case 'cc_phone' : 
     1873 
     1874                                                                if(data[3][pos][k] === 'none') 
     1875                                                                        data[3][pos][k] = '&nbsp'; 
     1876                                                                break; 
     1877                                                } 
     1878                                                 
     1879                                        } 
     1880                                         
     1881                                         
     1882                                        /*if(data[2][k] ==  'cc_mail' && data[3][pos][k] == 'none' && !(ccTree.catalog_perms & 2) ) { 
    18631883                                                Element(id).style.display = 'none'; 
    18641884                                                continue; 
    1865                                         } 
    1866  
     1885                                        }*/ 
     1886                                 
    18671887                                        if(data[3][pos][k] != 'none') 
    18681888                                        { 
     
    18801900                                                                } 
    18811901                                                                break; 
    1882  
     1902                                                         
    18831903                                                        case 'cc_mail': 
     1904                                                                 
    18841905                                                                if (data[3][pos][k].length > (CC_visual == 'table'  ? 50 : 20)) 
    18851906                                                                { 
     
    18891910                                                                else 
    18901911                                                                { 
    1891                                                                         Element(id+':'+data[2][k]).innerHTML = data[5] + data[3][pos][k] + '\')">'+ data[3][pos][k]+'</span>'; 
     1912                                                                        Element(id+':'+data[2][k]).innerHTML = data[5] + data[3][pos][k] + '\')">'+ data[3][pos][k]+'</span>';                                                                   
    18921913                                                                } 
    18931914                                                                break; 
    1894  
     1915                                                         
    18951916                                                        case 'cc_phone': 
    18961917                                                                if (data[3][pos][k].length > 20) 
     
    19231944                                                                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] : ''); 
    19241945                                                                if(ccTree.catalog_perms == 1) 
    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>'; 
     1946                                                                        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>'; 
    19261947                                                                break; 
    19271948 
    19281949                                                        case 'cc_forwarding_address': 
    19291950                                                                var contacts = data[3][pos][k]; 
    1930  
     1951                                                                                                                                 
    19311952                                                                if( !contacts) 
    19321953                                                                        break; 
    1933  
     1954                                                                                                                                                                                                                                                                                                                                 
    19341955                                                                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]; 
    19621956                                                                break; 
    19631957 
     
    19701964                                                                else 
    19711965                                                                { 
    1972                                                                         if (Element(id+':'+data[2][k]) == null) alert('ï¿œ nulovgdfv'); 
    19731966                                                                        Element(id+':'+data[2][k]).innerHTML = data[3][pos][k]; 
    19741967                                                                } 
     
    19761969                                        } 
    19771970                                } 
    1978  
     1971         
    19791972                                if (--ncards == 0) 
    19801973                                { 
     
    19821975                                        i = CC_max_cards[1]; 
    19831976                                } 
    1984  
     1977         
    19851978                                pos++; 
    19861979                        } 
     
    19901983 
    19911984function populateGroupsInCards(data) 
    1992 { 
     1985{        
    19931986        var pos = 0; 
    1994         var contacts = data[5]; 
     1987        var contacts = data[5];          
    19951988        var ncards = data[3].length; 
    1996  
     1989         
    19971990        if (typeof(data[3]) == 'object' && ncards > 0) 
    19981991        { 
     
    20021995                        { 
    20031996                                id = 'cc_card:'+j+':'+i; 
    2004  
     1997                         
    20051998                                for (var k = 0; k < data[2].length; k++) 
    20061999                                { 
    2007  
     2000                                 
    20082001                                        if(data[3][pos][k] != 'none') 
    2009                                         { 
    2010  
     2002                                        {        
     2003                                                                                         
    20112004                                                switch (data[2][k]) 
    2012                                                 { 
     2005                                                {                                                        
    20132006                                                        case 'cc_title': 
    20142007                                                                if (data[3][pos][k].length > 50) 
     
    20222015                                                                } 
    20232016                                                                break; 
    2024  
     2017                                                         
    20252018                                                        case 'cc_short_name': 
    20262019                                                                if (data[3][pos][k].length > (CC_visual == 'table'  ? 50 : 20)) 
     
    20342027                                                                } 
    20352028                                                                break; 
    2036  
     2029                                                         
    20372030                                                        case 'cc_contacts': 
    20382031 
     
    20432036                                                                var email = ""; 
    20442037 
    2045                                                                 for (var d = 0; d < contacts.length; d++) { 
     2038                                                                for (var d = 0; d < contacts.length; d++) {                                                                                                                                                                                                                                                                                                      
    20462039                                                                        contact += contacts[d]['names_ordered']+ ","; 
    20472040                                                                        email += contacts[d]['connection_value']+","; 
    20482041                                                                } 
    2049  
     2042                                                                 
    20502043                                                                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>'; 
    2051  
     2044                                                                                                                                                                         
    20522045                                                                break; 
    2053  
     2046                                                         
    20542047                                                        case 'cc_id': 
    20552048                                                                var id_contact = data[3][pos][k]; 
    20562049                                                                Element(id+':'+data[2][k]).value = data[3][pos][k]; 
    2057  
     2050                                                                                                                         
    20582051                                                                break; 
    2059  
     2052                                                                 
    20602053                                                } 
    20612054                                        } 
    20622055                                } 
    2063  
     2056         
    20642057                                if (--ncards == 0) 
    20652058                                { 
     
    20672060                                        i = CC_max_cards[1]; 
    20682061                                } 
    2069  
     2062         
    20702063                                pos++; 
    20712064                        } 
     
    20962089        }; 
    20972090 
    2098         Connector.newRequest('setMaxCards', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=set_n_cards&ncards=' + ncards, 'GET'); 
     2091        Connector.newRequest('setMaxCards', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=set_n_cards&ncards=' + ncards, 'GET');  
    20992092} 
    21002093 
     
    21022095{ 
    21032096        var coord = new Array(); 
    2104  
     2097         
    21052098        //Element('cc_card_space').innerHTML = ''; 
    21062099        //return; 
     
    21092102        //card_space_width = parseInt(is_ie ? document.body.offsetWidth : window.innerWidth) - parseInt(Element('cc_left').offsetWidth) - parseInt(CC_card_extra) - 40; 
    21102103        card_space_height = parseInt(Element('cc_card_space').offsetHeight) - parseInt(CC_card_extra); 
    2111  
     2104         
    21122105        card_width = CC_card_image_width + CC_card_extra; 
    21132106        card_height = CC_card_image_height + CC_card_extra; 
     
    21152108        ncols = parseInt(card_space_width / card_width); 
    21162109        nlines = parseInt(card_space_height / card_height); 
    2117  
     2110         
    21182111        coord[0] = ncols; 
    21192112        //coord[1] = nlines; 
     
    21292122{ 
    21302123                if(type != 'groups') { 
    2131  
     2124                 
    21322125                        html_card = '<td id="' + id + '" style="width: ' + CC_card_image_width + 'px; height: ' + CC_card_image_height + '">' + 
    21332126                                '<div style="border: 0px solid #999; position: relative;">' + 
    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);">' + 
     2127                                        '<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);">' +  
    21352128                                                ( ccTree.catalog_perms == 1 ? 
    21362129                                                '<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>':'') + 
     
    21382131                                                '<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">' + 
    21392132                                                '<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">' : '') + 
    2140                                                 '<img id="' + id + ':cc_photo" style="position: absolute; top: 15px; left: 7px;" src="" border="0" ondblclick="editContact(Element(\'' + id + ':cc_id\').value);">' + 
     2133                                                '<img id="' + id + ':cc_photo" style="position: absolute; top: 15px; left: 7px;" src="" border="0" ondblclick="editContact(Element(\'' + id + ':cc_id\').value);">' +  
    21412134                                                '<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>' + 
    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>' + 
     2135                                                '<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>'+  
     2136                                                '<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>' +  
     2137                                                '<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>' +  
     2138                                                '<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>' +  
     2139                                                '<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>' +  
     2140                                                '<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>' +  
    21522141                                        '<input id="' + id + ':cc_id" type="hidden">' + 
    21532142                                '</div>' + '</td>'; 
    2154  
     2143                 
    21552144                } else { 
    21562145                        html_card = '<td id="' + id + '" style="width: ' + CC_card_image_width + 'px; height: ' + CC_card_image_height + '">' + 
    2157             '<div style="border: 0px solid #999; position: relative;">' + 
     2146            '<div style="border: 0px solid #999; position: relative;">' +  
    21582147                                '<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);">' + 
    21592148                                '<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">' + 
    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">' + 
     2149                                '<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">' +  
    21612150                                '<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>' + 
    21622151                                '<span id="' + id + ':cc_participantes" style="cursor: pointer; cursor: hand; z-index: 1;position: absolute; top: 15px; left: 15px"></span>' + 
     
    21652154                        '</div>' + '</td>'; 
    21662155                } 
    2167  
     2156         
    21682157 
    21692158        return html_card; 
     
    21772166                        else 
    21782167                                bg = "this.style.background=\'#EEEEEE\'"; 
    2179  
     2168                                                 
    21802169                        if(type != 'groups') { 
    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>' + 
     2170                         
     2171                                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;">' +                                        
     2172                                        '<span valign="bottom" id="' + id + ':cc_icon_group">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="' + id + ':cc_name"></span></td>' + 
    21862173                                        '<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>' + 
    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>' + 
     2174                                        '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_phone"></span></td>' +          
    21922175                                        ( ccTree.catalog_perms == 1 ? 
    21932176                                        '<td align="left"><span valign="bottom" id="' + id + ':cc_icon_data"></span></td>':'') + 
     
    22012184                                        '<span id="' + id + ':cc_title" style="display:none"></span>' + 
    22022185                                        '<span id="' + id + ':cc_alias" style="display:none"></span>' + 
    2203                                         // Esse campo ï¿œ necessï¿œrio se o contato possui dados no campo cc_company 
     2186                                        // Esse campo é necessário se o contato possui dados no campo cc_company 
    22042187                                        '<span id="' + id + ':cc_company" style="display:none"></span>' + 
    22052188                                        '</td></tr>'; 
     
    22142197                                        '&nbsp;&nbsp;|&nbsp;&nbsp;'+ 
    22152198                                        '<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">'  + 
    2216                                         '<input id="' + id + ':cc_id" type="hidden">'+ 
     2199                                        '<input id="' + id + ':cc_id" type="hidden">'+                                                                           
    22172200                                        '</td></tr>'; 
    22182201                        } 
     
    22242207{ 
    22252208        var pos; 
    2226  
     2209         
    22272210        html_cards = '<div id="divScrollMain" style="overflow:auto;z-index:1"><table width="100%" border="0" cellpadding="0" cellspacing="3">'; 
    2228  
     2211         
    22292212        if (ncards > 0) 
    22302213        { 
     
    22462229                if((ccTree.catalog_perms & 2) && type != 'groups') 
    22472230                        html_cards += '<tr><td colspan=4 align="right"><button id="cc_button_tools" value="" type="button" onclick="javascript:removeAllEntries()">Remover Todos</button></td></tr>'; 
    2248         } 
     2231        }        
    22492232        else if (CC_max_cards != 0) 
    22502233        { 
     
    22662249        html_cards = '<div id="divScrollMain" style="overflow:auto;z-index:1">'; 
    22672250        html_cards += '<table  border="0" cellpadding="0" cellspacing="' + CC_card_extra + '">'; 
    2268  
     2251         
    22692252        if (ncards > 0) 
    22702253        { 
     
    22852268                if((ccTree.catalog_perms & 2) && type != 'groups') 
    22862269                        html_cards += '<tr><td colspan=3 align="right"><button id="cc_button_tools" value="" type="button" onclick="javascript:removeAllEntries()">Remover Todos</button></td></tr>'; 
    2287         } 
     2270        }        
    22882271        else if (CC_max_cards != 0) 
    22892272        { 
     
    23222305                else if(CC_visual == 'table') 
    23232306                        drawTable(0); 
    2324  
     2307                         
    23252308                setPages(0,0); 
    23262309                return; 
     
    23322315                data = unserialize(responseText); 
    23332316                if (data[0] == '0') 
    2334                 { 
    2335                         Element('cc_type_contact').value = data[1]; 
     2317                {                                
     2318                        Element('cc_type_contact').value = data[1];                      
    23362319                        CC_npages = 0; 
    23372320                        CC_actual_page = 1; 
     
    23452328                else 
    23462329                Element('cc_type_contact').value = data[10]; 
    2347  
    2348 //              Element('cc_debug').innerHTML = responseText; 
    2349  
     2330                 
     2331//              Element('cc_debug').innerHTML = responseText;                                            
     2332                 
    23502333                if (typeof(data) != 'object') 
    23512334                { 
     
    23532336                        return; 
    23542337                } 
    2355  
     2338                 
    23562339                if (typeof(data[3]) == 'object') 
    23572340                { 
    23582341                        CC_npages = parseInt(data[0]); 
    2359                         CC_actual_page = parseInt(data[1]); 
     2342                        CC_actual_page = parseInt(data[1]);                      
    23602343                        if(CC_visual == 'cards') 
    23612344                                drawCards(data[3].length, data[10]); 
     
    23652348                        populateCards(data, data[10]); 
    23662349                        setPages(data[0], data[1]); 
    2367  
    2368                 } 
    2369                 else if (data['error']) 
    2370                 { 
    2371                         showMessage(data['error']); 
     2350                         
    23722351                } 
    23732352                else 
     
    23812360        Connector.newRequest('showCards', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_cards_data', 'POST', handler, info); 
    23822361} 
    2383  
    23842362 
    23852363function clearCards() 
     
    24062384        var table_h = Element('cc_panel_table'); 
    24072385        var cards_h = Element('cc_panel_cards'); 
    2408  
     2386         
    24092387        switch (type) 
    24102388        { 
     
    24192397                        break; 
    24202398        } 
    2421  
     2399         
    24222400        CC_visual = type; 
    24232401        showCards(getActualLetter(), getActualPage()); 
    24242402} 
    24252403 
    2426 /*function ccSearchUpdate(ids) 
     2404function ccSearchUpdate(ids) 
    24272405{ 
    24282406        Element('cc_panel_letters').style.display = 'none'; 
    24292407        Element('cc_panel_search').style.display  = 'inline'; 
    2430  
     2408         
    24312409        if(CC_visual == 'cards') 
    24322410                drawCards(0); 
     
    24362414        if (!ids) 
    24372415        { 
    2438                 //ccSearchHide(); 
     2416                ccSearchHide(); 
    24392417                return; 
    24402418        } 
    2441  
     2419         
    24422420        var sIds = serialize(ids); 
    24432421 
     
    24472425        } 
    24482426        showCards('search', '1', sIds); 
    2449 } 
    2450 */ 
    2451  
    2452 function 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); 
    24672427} 
    24682428 
     
    25072467        data[3] = Element('cc_qa_phone').value; 
    25082468        data[4] = Element('cc_qa_email').value; 
    2509  
     2469         
    25102470        return data; 
    25112471} 
     
    25142474{ 
    25152475        var data = getQuickAdd(); 
    2516  
     2476         
    25172477        var str = serialize(data); 
    25182478 
     
    25322492} 
    25332493 
    2534          
    25352494function connectVoip (phoneUser, typePhone){ 
    25362495        var handler_voip = function (responseText){ 
Note: See TracChangeset for help on using the changeset viewer.