Changeset 284 for trunk/contactcenter/js


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
Location:
trunk/contactcenter/js
Files:
7 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        } 
  • trunk/contactcenter/js/ccAddGroup.js

    r118 r284  
    158158                 
    159159                if(!this.title.value) { 
    160                         alert(Element('cc_msg_fill_field_name').value); 
     160                        alert('Preencha o campo obrigatório "Nome Completo"'); 
    161161                        this.title.focus(); 
    162162                        return false; 
     
    164164                                 
    165165                if(! contacts.length) { 
    166                         alert(Element('cc_msg_add_contact_to_group').value); 
     166                        alert('Você não adicionou nenhum contato para esse grupo'); 
    167167                        return false; 
    168168                } 
  • trunk/contactcenter/js/ccIEContacts.js

    r270 r284  
    33                this.el;                 
    44                this.wWidth = 395; 
    5                 this.wHeight = 255; 
     5                this.wHeight = 240; 
    66        } 
    77         
     
    1616                }        
    1717        } 
    18          
    19         cIEContacts.prototype.showFailures = function(data){ 
    20                 if (data == 'undefined') 
    21                         return; 
    22                 if (data){ 
    23                         var lang_clean = Element('cc_msg_clean').value; 
    24                         var info_box = document.getElementById('s_info2'); 
    25                         info_box.innerHTML = data; 
    26                         info_box.style.visibility = ''; 
    27                         var cleanButton = document.createElement('input'); 
    28                         cleanButton.type='button'; 
    29                         cleanButton.value=lang_clean; 
    30                         cleanButton.onclick= function() { ccIEContacts.cleanInfo() }; 
    31                         info_box.appendChild(cleanButton); 
    32                         } 
    33         } 
    34  
    35         cIEContacts.prototype.cleanInfo = function(){ 
    36         var info_box = document.getElementById('s_info2'); 
    37         info_box.innerHTML = ''; 
    38         }        
    3918         
    4019        cIEContacts.prototype.showList = function(){ 
     
    5837                        this.el.id = 'cc_rectIEContacts'; 
    5938                        document.body.appendChild(this.el); 
    60  
    61                         var lang_import_contacts = Element('cc_msg_import_contacts').value; 
    62             var lang_close_win = Element('cc_msg_close_win').value 
    63             var lang_export_contacts = Element('cc_msg_export_contacts').value; 
    64             var lang_expresso_info_csv = Element('cc_msg_expresso_info_csv').value; 
    65             var lang_expresso_default = Element('cc_msg_expresso_default').value; 
    66             var lang_choose_contacts_file       = Element('cc_msg_choose_contacts_file').value; 
    67             var lang_msg_choose_type            = Element('cc_msg_choose_file_type').value; 
    68                         var lang_msg_expresso_info_csv  = Element('cc_msg_expresso_info_csv').value; 
    69                         var lang_msg_export_csv                 = Element('cc_msg_export_csv').value;; 
    70             var lang_msg_automatic = Element('cc_msg_automatic').value; 
    71                         var lang_moz_tb = Element('cc_msg_moz_thunderbird').value; 
    72                         var lang_outl_pt = Element('cc_msg_outlook_express_pt').value; 
    73                         var lang_outl_en = Element('cc_msg_outlook_express_en').value; 
    74                         var lang_outl2k_pt = Element('cc_msg_outlook_2k_pt').value; 
    75                         var lang_outl2k_en = Element('cc_msg_outlook_2k_en').value; 
    76                         var lang_expresso_default_csv = Element('cc_msg_expresso_default_csv').value; 
    77  
    78                  
    7939                        this.el.innerHTML =  
    8040                        '<div align="left" id="divAppbox"><table width="100%" border=0>'+ 
    81                         '<tr><td style="border-bottom:1px solid black"><input onclick="javascript:ccIEContacts.changeOptions(this.value)" id="type" type="radio" name="type" value="i" style="border:0" checked>'+lang_import_contacts+ 
    82                         '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input onclick="javascript:ccIEContacts.changeOptions(this.value)" id="type" type="radio" name="type" style="border:0" value="e"/>'+lang_export_contacts+' <br></td></tr>'+ 
     41                        '<tr><td style="border-bottom:1px solid black"><input onclick="javascript:ccIEContacts.changeOptions(this.value)" id="type" type="radio" name="type" value="i" style="border:0" checked>Importar Contatos'+ 
     42                        '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input onclick="javascript:ccIEContacts.changeOptions(this.value)" id="type" type="radio" name="type" style="border:0" value="e"/>Exportar Contatos<br></td></tr>'+ 
    8343                        '</table>'+ 
    8444                        '<table border=0 height="208px"  width="100%" id="import_span">'+ 
    8545                        '<tr><td>'+ 
    86                         '<font color="DARKBLUE" size="2">'+lang_expresso_info_csv+'</font></td></tr>'+ 
     46                        '<font color="DARKBLUE" size="2">O Expresso suporta a importação de contatos no formato de arquivo CSV.</font></td></tr>'+ 
    8747                        '<tr><td height="75px" valign="top">'+ 
    88                         '<form name="formCSV" method="POST" enctype="multipart/form-data">'+ lang_msg_choose_type + 
    89                         ':&nbsp;<select id="typeImport"><option value="auto" selected>'+lang_msg_automatic+'</option>'+ 
    90                         '<option value="outlook">'+("Outlook Express")+'</option>'+ 
    91                         '<option value="outlook2000">'+("Outlook 2000")+'</option>'+ 
    92                         '<option value="thunderbird">'+("Mozilla Thunderbird")+'</option>'+ 
    93                         '<option value="expresso">'+lang_expresso_default+'</option></select><br>'+ 
    94                         '<br>'+lang_choose_contacts_file+'<br><br>'+                     
     48                        '<form name="formCSV" method="POST" enctype="multipart/form-data">'+                                                                             
     49                        'Selecione o tipo do arquivo:&nbsp;<select id="typeImport">'+ 
     50                        '<option value="outlook">Outlook Express</option>'+ 
     51                        '<option value="outlook2000">Outlook 2000</option>'+ 
     52                        '<option value="thunderbird">Mozilla Thunderbird</option>'+ 
     53                        '<option value="expresso" selected>Expresso (padrão)</option></select><br>'+ 
     54                        '<br>Selecione o arquivo que contém os contatos a serem importados:<br><br>'+                    
    9555                        '<input id="import_file" type="file" name="import_file">'+ 
    9656                        '</form></td></tr>'+ 
    9757                        '<tr><td height="10px" align="center" nowrap><span style="visibility:hidden" id="s_info"></span></td></tr>'+ 
    9858                        '<tr><td height="10px" align="center"></td></tr>'+ 
    99                         '<tr><td nowrap><center><input id="import_button" type="button" value='+lang_import_contacts+' onClick="javascript:ccIEContacts.importCSV(this)">&nbsp;&nbsp;&nbsp;&nbsp;'+ 
    100                         '<input type="button" value='+lang_close_win+' onClick="javascript:ccIEContacts.close()"></center></td></tr>'+ 
    101                         '<tr><td height="10px" align="center" nowrap><span style="visibility:hidden" id="s_info2"></span></td></tr></table>'+ 
     59                        '<tr><td nowrap><center><input id="import_button" type="button" value="Importar Contatos" onClick="javascript:ccIEContacts.importCSV(this)">&nbsp;&nbsp;&nbsp;&nbsp;'+ 
     60                        '<input type="button" value="Fechar" onClick="javascript:ccIEContacts.close()"></center></td></tr>'+ 
     61                        '</table>'+ 
    10262                        '<table border=0  height="208px"  width="100%" style="display:none" id="export_span">'+ 
    10363                        '<tr><td>'+                                              
    104                         '<font color="DARKBLUE" size="2">'+ lang_msg_expresso_info_csv+'</font></td></tr>'+ 
    105                         '<tr><td height="85px" valign="top">'+lang_msg_export_csv+'<br><br>'+ 
    106                         '<input style="border:0" id="typeExport_0" name="radio" type="radio" value="expresso" checked/>'+lang_expresso_default_csv+'<br>'+ 
    107                         '<input style="border:0" id="typeExport_1" name="radio" type="radio" value="outlook_pt-BR">'+lang_outl_pt+ '<br>'+ 
    108                         '<input style="border:0" id="typeExport_2" name="radio" type="radio" value="outlook_en">'+lang_outl_en+ '<br>'+ 
    109                         '<input style="border:0" id="typeExport_3" name="radio" type="radio" value="outlook2000_pt-BR">'+lang_outl2k_pt + '<br>'+ 
    110                         '<input style="border:0" id="typeExport_4" name="radio" type="radio" value="outlook2000_en">'+lang_outl2k_en + '<br>'+ 
    111                         '<input style="border:0" id="typeExport_5" name="radio" type="radio" value="thunderbird">'+lang_moz_tb + '<br>'+ 
     64                        '<font color="DARKBLUE" size="2">O Expresso suporta a exportação de contatos no formato de arquivo CSV.</font></td></tr>'+ 
     65                        '<tr><td height="85px" valign="top">'+                                           
     66                        'Selecione o tipo do formato que deseja exportar seus contatos:<br><br>'+ 
     67                        '<input style="border:0" id="typeExport_0" name="radio" type="radio" value="expresso" checked/>Exportar como CSV do Expresso (padrão)<br>'+ 
     68                        '<input style="border:0" id="typeExport_1" name="radio" type="radio" value="outlook_pt-BR">Exportar como CSV do Outlook Express (Português)<br>'+ 
     69                        '<input style="border:0" id="typeExport_2" name="radio" type="radio" value="outlook_en">Exportar como CSV do Outlook Express (Inglês)<br>'+ 
     70                        '<input style="border:0" id="typeExport_3" name="radio" type="radio" value="outlook2000_pt-BR">Exportar como CSV do Outlook 2000 (Português)<br>'+ 
     71                        '<input style="border:0" id="typeExport_4" name="radio" type="radio" value="outlook2000_en">Exportar como CSV do Outlook 2000 (Inglês)<br>'+ 
     72                        '<input style="border:0" id="typeExport_5" name="radio" type="radio" value="thunderbird">Exportar como CSV do Mozilla Thunderbird<br>'+ 
    11273                        '</td></tr>'+ 
    11374                        '<tr><td align="center">&nbsp;</td></tr>'+ 
    114                         '<tr><td nowrap><center><input id="export_button" type="button" value='+lang_export_contacts+ ' onClick="javascript:ccIEContacts.exportCSV(this)">&nbsp;&nbsp;&nbsp;&nbsp;'+ 
    115                         '<input type="button" value='+lang_close_win+ ' onClick="javascript:ccIEContacts.close()"></center></td></tr>'+ 
     75                        '<tr><td nowrap><center><input id="export_button" type="button" value="Exportar Contatos" onClick="javascript:ccIEContacts.exportCSV(this)">&nbsp;&nbsp;&nbsp;&nbsp;'+ 
     76                        '<input type="button" value="Fechar" onClick="javascript:ccIEContacts.close()"></center></td></tr>'+ 
    11677                        '</table></div>'; 
    11778                }                
    11879                this.showWindow(); 
    11980        } 
    120          
     81                 
    12182        cIEContacts.prototype.showWindow = function () 
    12283        {                                                
    12384                if(!this.win) { 
    124          
    125                                 this.win = new dJSWin({                  
     85 
     86                        this.win = new dJSWin({                  
    12687                                id: 'ccIEContacts', 
    12788                                content_id: this.el.id, 
     
    13091                                title_color: '#3978d6', 
    13192                                bg_color: '#eee', 
    132                                 title: Element('cc_msg_ie_personal').value,  
     93                                title: "Importar / Exportar Contatos Pessoais",                                          
    13394                                title_text_color: 'white', 
    13495                                button_x_img: '../phpgwapi/images/winclose.gif', 
     
    151112                var status = ''; 
    152113 
    153                 var lang_import_fail = Element('cc_msg_import_fail').value; 
    154                 var lang_importing = Element('cc_msg_importing_contacts').value; 
    155                 var lang_import_finish = Element('cc_msg_import_finished').value; 
    156                 var lang_new = Element('cc_msg_new').value; 
    157                 var lang_failure = Element('cc_msg_failure').value; 
    158                 var lang_exists = Element('cc_msg_exists').value; 
    159                 var lang_show_more_info = Element('cc_msg_show_more_info').value; 
    160  
    161                 var l_1         = '<font face="Verdana" size="1" color="GREEN">['+args[1]+lang_new+']</font>'; 
    162                 var l_2         = '<font face="Verdana" size="1" color="RED">['+args[2]+lang_failure+']</font>'; 
    163                 var l_3         = '<font face="Verdana" size="1" color="DARKBLUE">['+args[3]+lang_exists+']</font>'; 
    164                 var l_4         = '<br><a font face="Verdana" size="1" href="javascript:ccIEContacts.showFailures(\''+args[4]+'\')">'+lang_show_more_info+'</a>'; 
    165                 var l_error     = '<span style="height:15px;background:#cc4444">&nbsp;&nbsp;<font face="Verdana" size="1" color="WHITE">'+lang_import_fail+ '&nbsp;</font></span>'; 
    166                 var l_importing = '<span style="height:15px;background:rgb(250, 209, 99)">&nbsp;&nbsp;<font face="Verdana" size="1" color="DARKBLUE">'+lang_importing + '&nbsp;</font></span>'; 
     114                var l_1         = '<font face="Verdana" size="1" color="GREEN">['+args[1]+' novos]</font>'; 
     115                var l_2         = '<font face="Verdana" size="1" color="RED">['+args[2]+' falharam]</font>'; 
     116                var l_3         = '<font face="Verdana" size="1" color="DARKBLUE">['+args[3]+' já existiam]</font>'; 
     117                var l_error     = '<span style="height:15px;background:#cc4444">&nbsp;&nbsp;<font face="Verdana" size="1" color="WHITE">A importação falhou. Verifique o formato do arquivo.&nbsp;</font></span>'; 
     118                var l_importing = '<span style="height:15px;background:rgb(250, 209, 99)">&nbsp;&nbsp;<font face="Verdana" size="1" color="DARKBLUE">Importando contatos ....&nbsp;</font></span>'; 
    167119 
    168120                if(args[0] == 'success') { 
    169121 
    170                         for(i = 1; i < 5; i++) { 
     122                        for(i = 1; i < 4; i++) { 
    171123                                status += "&nbsp;"+eval('l_'+i); 
    172124                        } 
    173                         Element('s_info').innerHTML = '&nbsp;&nbsp;<font face="Verdana" size="1" color="BLACK"><b>'+lang_import_finish+'</b></font><br>&nbsp;'+status; 
     125                        Element('s_info').innerHTML = '&nbsp;&nbsp;<font face="Verdana" size="1" color="BLACK"><b>A importação foi concluída.</b></font><br>&nbsp;'+status; 
    174126                } 
    175127                else  
     
    196148        cIEContacts.prototype.importCSV = function () 
    197149        {                
    198                 var lang_msg_invalid_csv = Element('cc_msg_invalid_csv').value; 
    199150                var form = document.formCSV; 
     151                 
    200152                if ((form.import_file.value.length < 10) ||  
    201                 (form.import_file.value.substring(form.import_file.value.length - 4, form.import_file.value.length).toLowerCase() != ".csv")){ 
    202                         alert(lang_msg_invalid_csv); 
     153                (form.import_file.value.substring(form.import_file.value.length - 4, form.import_file.value.length) != ".csv")){ 
     154                        alert('Selecione um arquivo CSV válido para importar seus contatos.'); 
    203155                        return; 
    204156                } 
     
    218170                                args[2] = data._failure ? data._failure : 0; 
    219171                                args[3] = data._existing ? data._existing : 0; 
    220                                 args[4] = data._failure_status 
    221  
    222172                        } 
    223173                        _this.importWriteStatus(args); 
     
    258208         
    259209        cIEContacts.prototype.exportCSV = function() { 
    260                 var lang_export_error = Element('cc_msg_export_error'); 
     210 
    261211                var handler_export = function(data) { 
    262212                        if(!data){ 
    263                                 alert(lang_export_error ); 
     213                                alert("Ocorreu um erro durante a exportação."); 
    264214                                return; 
    265215                        }                                
  • trunk/contactcenter/js/ccMain.js

    r119 r284  
    1 var last_id = 0;         
    2  
    3 function openwindow(url){        
    4         var window_features =   "scrollbars=yes,resizable=yes,location=no,menubar=no," +  
    5                                                 "personalbar=no,status=no,titlebar=no,toolbar=no," +  
    6                                                 "screenX=0,screenY=0,top=0,left=0,width=" +  
    7                                                 screen.width + ",height=" + screen.height/5*3;  
    8                          
    9         window.open(url,'', window_features);  
     1var last_id = 0; 
     2 
     3function openwindow(url){ 
     4        var window_features =   "scrollbars=yes,resizable=yes,location=no,menubar=no," + 
     5                                                "personalbar=no,status=no,titlebar=no,toolbar=no," + 
     6                                                "screenX=0,screenY=0,top=0,left=0,width=" + 
     7                                                screen.width + ",height=" + screen.height/5*3; 
     8 
     9        window.open(url,'', window_features); 
    1010} 
    1111 
    1212var Main_pre_load = document.body.onload; 
    1313var ccSearch, ccTree; 
    14 var Main_load = function ()  
    15         {        
     14var Main_load = function () 
     15        { 
    1616                Connector.setProgressBox(Element('cc_loading'), true); 
    17                 Connector.setProgressHolder(Element('cc_loading_inner'));                
     17                Connector.setProgressHolder(Element('cc_loading_inner')); 
    1818                /* Associate the Quick Add Button with the Plugin */ 
    19                                          
     19 
    2020 
    2121                /* Create the Search Object */ 
     
    3737                ccSearch.DOMresult.style.visibility = 'hidden'; 
    3838                ccSearch.onSearchFinish = ccSearchUpdate; 
    39                          
     39 
    4040                Connector.setProgressBox(Element('cc_loading'), true); 
    4141                Connector.setProgressHolder(Element('cc_loading_inner')); 
    42                          
     42 
    4343                /* Create the Tree Object */ 
    44                 ccTree = new ccCatalogTree({name: 'ccTree', id_destination: 'cc_tree', afterSetCatalog: 'ccSearchHidePanel(); updateCards()'}); 
     44                //ccTree = new ccCatalogTree({name: 'ccTree', id_destination: 'cc_tree', afterSetCatalog: 'ccSearchHidePanel(); updateCards()'}); 
     45                ccTree = new ccCatalogTree({name: 'ccTree', id_destination: 'cc_tree', afterSetCatalog: 'ccSearchHidePanel(); clearCards();'}); 
    4546 
    4647                ccTree.Connector = Connector; 
     
    6465        var _timeout = ''; 
    6566        var menu = function () { 
    66                   
     67 
    6768         if(! this.menuStarted) 
    6869                this.menuStarted = true; 
    69                  
     70 
    7071                submenu = []; 
    7172                textmenu = []; 
    72                          
     73 
    7374                textmenu[0] = ["cc_msg_contact_qa","cc_msg_contact_full","cc_msg_group"] 
    74                 textmenu[1] = ["cc_quick_add", "cc_full_add", "cc_add_group"];           
     75                textmenu[1] = ["cc_quick_add", "cc_full_add", "cc_add_group"]; 
    7576                function show(){ 
    7677                        clearTimeout(_timeout); 
    7778                        button = document.getElementById("cc_button_new"); 
    78                                  
    79                         this.style.top = 19 + findPosY(button) + "px";  
    80                         this.style.visibility='visible';  
     79 
     80                        this.style.top = 19 + findPosY(button) + "px"; 
     81                        this.style.visibility='visible'; 
    8182                } 
    8283                function hide(){ _timeout = setTimeout("menu.style.visibility='hidden';",200); }; 
    83                          
     84 
    8485                if(document.getElementById) { 
    8586                        menu = document.getElementById("Layer1"); 
    86                                  
     87 
    8788                        for (i=0; i< textmenu[0].length; i++) { 
    8889                                textmenu[0][i] = "<span onclick= 'menu.onmouseout();'>" + document.getElementById(textmenu[0][i]).value + "</span><br>"; 
    89                                 submenu[i] = document.createElement("DIV");                              
     90                                submenu[i] = document.createElement("DIV"); 
    9091                                submenu[i].innerHTML = textmenu[0][i]; 
    9192                                submenu[i].id = textmenu[1][i]; 
    9293                                submenu[i].onmouseover = function () {this.style.backgroundColor = 'LIGHTYELLOW';this.style.color = 'DARKBLUE';}; 
    93                                 submenu[i].onmouseout   = function () {  this.style.backgroundColor = '#DCDCDC'; this.style.color = '#006699';};                                         
     94                                submenu[i].onmouseout   = function () {  this.style.backgroundColor = '#DCDCDC'; this.style.color = '#006699';}; 
    9495                                submenu[i].setAttribute("className", "special"); 
    9596                                submenu[i].setAttribute("class", "special"); 
    96                                 submenu[i].style.padding = "5px";                                          
     97                                submenu[i].style.padding = "5px"; 
    9798                                menu.appendChild(submenu[i]); 
    98                         }                        
    99                                  
     99                        } 
     100 
    100101                        menu.onmouseover = show; 
    101102                        menu.onmouseout = hide; 
    102103                } 
    103                          
     104 
    104105                ccQuickAdd.associateAsButton(Element('cc_quick_add')); 
    105106                ccAddGroup.associateAsButton(Element('cc_add_group')); 
    106107                document.getElementById("cc_full_add").onclick= newContact; 
    107                           
    108                          
     108 
     109 
    109110                ccQuickAdd.afterSave = function () 
    110111                { 
    111112                        updateCards(); 
    112                 }                        
    113                          
    114                 ccAddGroup.load = function ()  
    115                 {                                
    116                         editGroup();                     
    117                 } 
    118                          
     113                } 
     114 
     115                ccAddGroup.load = function () 
     116                { 
     117                        editGroup(); 
     118                } 
     119 
    119120                ccAddGroup.afterSave = function () 
    120121                { 
    121122                        updateCards(); 
    122123                } 
    123                          
     124 
    124125                return true; 
    125126        } 
     
    127128        if (is_ie) 
    128129        { 
    129                          
     130 
    130131                document.body.onload = function (e) 
    131                 {                        
    132                         Main_pre_load();                                                                 
    133                         Main_load();                                     
    134                                                                  
     132                { 
     133                        Main_pre_load(); 
     134                        Main_load(); 
     135 
    135136                } 
    136137        } 
    137138        else 
    138         {                
    139                 Main_load();     
    140                          
    141         }        
     139        { 
     140                Main_load(); 
     141 
     142        } 
    142143 
    143144// BEGIN: FUNCTION RESIZE WINDOW 
     
    156157showBar = __showBar; 
    157158hideBar = __hideBar; 
    158          
     159 
    159160var _onResize   = window.onresize; 
    160161window.onresize = resizeWindow; 
    161162var defaultHeight = 0; 
    162163function setDefaultHeight(){ 
    163          
     164 
    164165        var bar = Element("toolbar"); 
    165166        var offset = 0; 
    166         if(bar.style.visibility != 'hidden')  
    167                 offset = (bar.offsetHeight ? bar.offsetHeight :  bar.clientHeight);      
     167        if(bar.style.visibility != 'hidden') 
     168                offset = (bar.offsetHeight ? bar.offsetHeight :  bar.clientHeight); 
    168169 
    169170        var screenHeight = document.body.clientHeight ? document.body.clientHeight : document.body.offsetHeight; 
    170         defaultHeight = screenHeight - offset;   
    171         Element("cc_tree").style.height                 = defaultHeight - 68;    
    172         Element("cc_left_main").style.height    = defaultHeight - 68;    
     171        defaultHeight = screenHeight - offset; 
     172        Element("cc_tree").style.height                 = defaultHeight - 68; 
     173        Element("cc_left_main").style.height    = defaultHeight - 68; 
    173174} 
    174175 
     
    176177        setDefaultHeight(); 
    177178        if(Element("divScrollMain")) 
    178                 Element("divScrollMain").style.height   = defaultHeight - 108;   
     179                Element("divScrollMain").style.height   = defaultHeight - 108; 
    179180        if (!is_ie) 
    180181                Element('tableDivAppbox').width = '100%'; 
     
    184185setDefaultHeight(); 
    185186Element('cc_main').style.height = defaultHeight; 
    186 var lang_warn_firefox = Element('cc_msg_warn_firefox'); 
    187 var lang_firefox_msg1 = Element('cc_msg_firefox_half1'); 
    188 var lang_firefox_msg2 = Element('cc_msg_firefox_half2'); 
    189 var lang_install_now = Element('cc_msg_install_now'); 
    190 var lang_install_new_firefox = Element('cc_msg_install_new_firefox'); 
    191 var lang_close = Element('cc_msg_close'); 
    192187function buildWarningMsg(_version) { 
    193188        var screenWidth = document.body.clientWidth ? document.body.clientWidth: document.body.offsetWidth; 
     
    196191        "border:1px solid black;left:"+(screenWidth - 330)+";top:10px;width:300px;padding:10px;"+ 
    197192        (document.body.clientWidth ? "-moz-border-radius: 9px 9px 9px 9px;'>" : "")+ 
    198             "<font color='RED' size='2'>"+lang_warn_firefox +  "("+_version+")</font><BR>"+ 
    199             "<font color='black' size='2'><p style='text-align:justify'>&nbsp;"+lang_firefox_msg1+ 
    200             lang_firefox_msg2 + ".</p></font><div style='width:100%' align='center'>"+ 
    201             "<a title='"+lang_install_now+"' href='http://br.mozdev.org/firefox/download.html' target='_blank'>"+lang_install_new_firefox+ "</a>"+       
     193        "<font color='RED' size='2'>Aviso: Versão muito antiga do Firefox ("+_version+")</font><BR>"+ 
     194        "<font color='black' size='2'><p style='text-align:justify'>&nbsp;Para que essa aplicação funcione <u>corretamente</u> "+ 
     195        "é necessário atualizar o seu navegador Firefox para uma versão mais nova (versão > 1.5). "+ 
     196        "Instale agora clicando no link abaixo ou caso queira atualizar mais tarde (não recomendável), clique em Fechar.</p></font><div style='width:100%' align='center'>"+ 
     197        "<a title='Instalar agora' href='http://br.mozdev.org/firefox/download.html' target='_blank'>Instalar nova versão do Firefox</a>"+ 
    202198        "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ 
    203             "<a title='"+lang_close+"' href='javascript:void(0)' onclick='javascript:myOpacity.toggle()'>"+lang_close+"</a></div>"+ 
    204  
     199        "<a title='Fechar' href='javascript:void(0)' onclick='javascript:myOpacity.toggle()'>Fechar</a></div>"+ 
    205200        "</DIV>"; 
    206201 
     
    208203 
    209204        myOpacity = new fx.Opacity('warning_msg', {duration: 600}); 
    210         document.getElementById("warning_msg").style.visibility = 'hidden';              
     205        document.getElementById("warning_msg").style.visibility = 'hidden'; 
    211206        myOpacity.now = 0; 
    212207        setTimeout("myOpacity.toggle()",3000); 
  • trunk/contactcenter/js/ccQuickAddContact.js

    r118 r284  
    66        } 
    77 
    8          
     8 
    99        cQuickAddContact.prototype.showList = function(id){ 
    1010                _this = this; 
    1111                var handler = function (responseText) { 
    1212                        var contacts = unserialize(responseText); 
    13                         var title = contacts['names_ordered'];                   
    14                         el = document.createElement("DIV");                                                                      
    15                         el.style.visibility = "hidden";                                                                  
     13                        var title = contacts['names_ordered']; 
     14                        el = document.createElement("DIV"); 
     15                        el.style.visibility = "hidden"; 
    1616                        el.style.position = "absolute"; 
    1717                        el.style.left = "0px"; 
     
    2121                        el.style.height = wHeight + 'px'; 
    2222                        el.className = "div_cc_rectQuickAddContact"; 
    23                         el.id = id+':cc_rectQuickAddContact';                                                                                                                                                                                    
    24                         document.body.appendChild(el);                                                                                                                           
    25                         el.innerHTML = "";                                                               
     23                        el.id = id+':cc_rectQuickAddContact'; 
     24                        document.body.appendChild(el); 
     25                        el.innerHTML = ""; 
    2626 
    2727                        var fieldsTop = 10; 
    2828                        var fieldsSpace = 30; 
    2929                        fields = new Array(Element('cc_qa_alias').value, Element('cc_qa_given_names').value, Element('cc_qa_family_names').value, Element('cc_qa_phone').value, Element('cc_qa_email').value); 
    30                          
     30 
    3131                        for (i=0; i<fields.length; i++) { 
    3232                                var contact = contacts[i] != null ? contacts[i] : ''; 
    3333                                el.innerHTML += '<span id="ccQuickAddCT' + i + id + '" style="position: absolute; top: ' +  (fieldsTop+i*fieldsSpace) + 'px; left: 5px; width: 100px; text-align: right; border: 0px solid #999;">' + fields[i] + '</span>'; 
    34                                 el.innerHTML += '<input id="ccQuickAddCI' + i + id + '" type="text" value="' + contact + '" maxlength="50" style="position: absolute; top: ' + (fieldsTop+i*fieldsSpace) + 'px; left: 110px; width: 135px;">'; 
     34                                if (i == 0) 
     35                                { 
     36                                        el.innerHTML += '<input id="ccQuickAddCI' + i + id + '" type="text" value="' + contact + '" maxlength="30" style="position: absolute; top: ' + (fieldsTop+i*fieldsSpace) + 'px; left: 110px; width: 135px;">'; 
     37                                } 
     38                                else if (i == 4) 
     39                                { 
     40                                        el.innerHTML += '<input id="ccQuickAddCI' + i + id + '" type="text" value="' + contact + '" maxlength="100" style="position: absolute; top: ' + (fieldsTop+i*fieldsSpace) + 'px; left: 110px; width: 135px;">'; 
     41                                } 
     42                                else 
     43                                { 
     44                                        el.innerHTML += '<input id="ccQuickAddCI' + i + id + '" type="text" value="' + contact + '" maxlength="50" style="position: absolute; top: ' + (fieldsTop+i*fieldsSpace) + 'px; left: 110px; width: 135px;">'; 
     45                                } 
    3546                        } 
    36                          
     47 
    3748                        el.innerHTML +='<div id="ccQAFuncitons" style="border: 0px solid black; width: 220px; height: 20px">' + 
    38                                 '<input title="' + Element('cc_qa_save').value + '" type="button" onclick="ccQuickAddContact.send(\'' + id + '\');" value="' + Element('cc_qa_save').value + '" style="position: absolute; top: ' + (fieldsTop+i*fieldsSpace) + 'px; left: 75px; width: 60px" />' + 
    39                                 '<input title="' + Element('cc_qa_close').value + '" type="button" onclick="ccQuickAddContact.fechar(\'' + id + '\');" value="' + Element('cc_qa_close').value + '" style="position: absolute; top: ' + (fieldsTop+i*fieldsSpace) + 'px; left: 140px; width: 60px" />' + 
     49                                '<input title="ccQASave" type="button" onclick="ccQuickAddContact.send(\'' + id + '\');" value="' + Element('cc_qa_save').value + '" style="position: absolute; top: ' + (fieldsTop+i*fieldsSpace) + 'px; left: 75px; width: 60px" />' + 
     50                                '<input title="ccQAClear" type="button" onclick="ccQuickAddContact.fechar(\'' + id + '\');" value="' + Element('cc_qa_clear').value + '" style="position: absolute; top: ' + (fieldsTop+i*fieldsSpace) + 'px; left: 140px; width: 60px" />' + 
    4051                                '</div>'; 
    4152                        el.innerHTML += "<br>"; 
    42                                                                  
     53 
    4354                        _this.showWindow(el); 
    4455                } 
    45                  
     56 
    4657                div = document.getElementById(id+':cc_rectQuickAddContact'); 
    47                                  
     58 
    4859                if(div) 
    4960                        this.showWindow(div); 
     
    5263                } 
    5364        } 
    54          
     65 
    5566        cQuickAddContact.prototype.showWindow = function (div) 
    56         {                                                
     67        { 
    5768                if(! this.arrayWin[div.id]) { 
    5869 
    59                         win = new dJSWin({                       
     70                        win = new dJSWin({ 
    6071                                id: 'ccQuickAddContact_'+div.id, 
    6172                                content_id: div.id, 
     
    6475                                title_color: '#3978d6', 
    6576                                bg_color: '#eee', 
    66                                 title: Element('ccQATitle').value,                                               
     77                                title: Element('ccQATitle').value, 
    6778                                title_text_color: 'white', 
    6879                                button_x_img: Element('cc_phpgw_img_dir').value+'/winclose.gif', 
    6980                                border: true }); 
    70                          
     81 
    7182                        this.arrayWin[div.id] = win; 
    72                         win.draw();                      
     83                        win.draw(); 
    7384                } 
    7485                else { 
    7586                        win = this.arrayWin[div.id]; 
    76                 }                        
     87                } 
    7788                win.open(); 
    7889        } 
    79          
     90 
    8091        cQuickAddContact.prototype.send = function (id) 
    8192        { 
     
    104115                                return; 
    105116                        } 
    106                          
     117 
    107118                        win.close(); 
    108119 
     
    121132                        } 
    122133                } 
    123          
     134 
    124135                var sdata = new Array(); 
    125                  
     136 
    126137                for (var f = 0; f < 5; f++){ 
    127138                        sdata[f] = document.getElementById('ccQuickAddCI' + f + id).value; 
    128139                } 
    129                  
     140 
    130141                //Utiliza expressão regular para validar email 
    131142                var reEmail = /^[A-Za-z\d_-]+(\.[A-Za-z\d_-]+)*@(([A-Za-z\d][A-Za-z\d-]{0,61}[A-Za-z\d]\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/; 
     
    136147                        return false; 
    137148                } 
    138                  
     149 
    139150                //Utiliza expressão regular para validar telefone 
    140151                var rePhone = /^[0-9|(-)| |-]{0,15}$/; 
    141                  
     152 
    142153                if (!rePhone.test(sdata[3])){ 
    143154                        alert("O número de telefone '" + sdata[3] + "' não é valido! Utilize apenas números.\n" + 
    144155                        "Parenteses, traços ou espaços em branco podem ser usados como carácter separador."); 
    145156                        return false; 
    146                 }  
    147                  
     157                } 
     158 
    148159                var sdata = 'add='+escape(serialize(sdata)); 
    149160 
    150161                Connector.newRequest('cQuickAdd.Send', CC_url+'quick_add', 'POST', handler, sdata); 
    151162        } 
    152          
     163 
    153164        cQuickAddContact.prototype.fechar = function(id) { 
    154          
     165 
    155166                div = document.getElementById(id+':cc_rectQuickAddContact'); 
    156167                win = this.arrayWin[div.id]; 
    157168                win.close(); 
    158169        } 
    159          
    160          
     170 
     171 
    161172/* Build the Object */ 
    162173        var ccQuickAddContact ; 
     
    164175 
    165176        if (is_ie) 
    166         {  
    167                 document.body.onload = function (e)  
    168                 {  
     177        { 
     178                document.body.onload = function (e) 
     179                { 
    169180                        cQuickAddContact_pre_load(); 
    170181                        ccQuickAddContact = new cQuickAddContact(); 
    171                          
     182 
    172183                }; 
    173184        } 
  • trunk/contactcenter/js/cc_search.js

    r2 r284  
    6060                this.DOMinput.value = params['value'] ? params['value'] : ''; 
    6161                this.DOMinput.style.width = params['input_width'] ? params['input_width'] : '200px'; 
    62                 this.DOMinput.onkeypress = function (e) {  
     62                this.DOMinput.onkeypress = function (e) { 
    6363                                if (is_ie) 
    6464                                { 
     
    8686                if (params['progress_color']) 
    8787                        this.DOMprogHold.style.color = params['progress_color']; 
    88                  
     88 
    8989                this.DOMresult.style.position = 'absolute'; 
    9090                this.DOMresult.style.top = params['progress_top'] ? params['progress_top'] : '0px'; 
     
    9696                        this.DOMresult.style.color = params['progress_color']; 
    9797 
    98                 this.DOMholder.appendChild(this.DOMdiv);         
     98                this.DOMholder.appendChild(this.DOMdiv); 
    9999                this.DOMdiv.appendChild(this.DOMfields); 
    100100                this.DOMdiv.appendChild(this.DOMinput); 
     
    104104                this.DOMdiv.appendChild(this.DOMresult); 
    105105        } 
    106          
     106 
    107107        ccSearchClass.prototype.go = function() 
    108108        { 
    109109                var data = new Array(); 
    110                  
     110 
    111111                this.DOMresult.innerHTML = ''; 
    112112 
    113113                //TODO: Make Generic! 
    114114                var type = Element('cc_type_contact').value; 
    115                  
     115 
    116116                data['fields']           = new Array(); 
    117                  
     117 
    118118                if (type == 'groups') { 
    119                         data['fields']['id']     = 'group.id_group';                     
     119                        data['fields']['id']     = 'group.id_group'; 
    120120                        data['fields']['search'] = 'group.title'; 
    121                 }                
    122                 else {                   
    123                         data['fields']['id']     = 'contact.id_contact';                 
    124                         data['fields']['search'] = 'contact.names_ordered';                                      
    125                 } 
    126                  
     121                } 
     122                else { 
     123                        data['fields']['id']     = 'contact.id_contact'; 
     124                        data['fields']['search'] = 'contact.names_ordered'; 
     125                } 
     126 
    127127                data['search_for']       = this.DOMinput.value; 
    128128                //data['recursive']        = this.recursive.checked ? true : false; 
    129                  
     129                // Exige que a consulta por nome seja feita com no mínimo 4 caracteres 
     130                var search_for = data['search_for'].split(' '); 
     131                var greaterThan4 = false; 
     132 
     133                for (i = 0; i < search_for.length; i++) 
     134                { 
     135                        if (search_for[i].length >= 4) 
     136                        { 
     137                                greaterThan4 = true; 
     138                        } 
     139                } 
     140 
     141                if (!greaterThan4){ 
     142                        alert("Favor fazer a consulta com pelo menos 4 caracteres!"); 
     143                        return; 
     144                } 
     145 
    130146                var _this = this; 
    131147 
     148        var handler = function (responseText) 
     149        { 
     150                var data = new Array(); 
     151                data = unserialize(responseText); 
     152 
     153                ccSearchUpdate(); 
     154 
     155                letter = 'search'; 
     156 
     157                if ( letter != CC_actual_letter ) 
     158                { 
     159                        CC_actual_page = '1'; 
     160                } 
     161                else 
     162                { 
     163                        CC_actual_page = parseInt(data[1]); 
     164                } 
     165 
     166                CC_actual_letter = letter; 
     167 
     168                if (CC_max_cards[0] == 0) 
     169                { 
     170 
     171                        if(CC_visual == 'cards') 
     172                                drawCards(0); 
     173                        else if(CC_visual == 'table') 
     174                                drawTable(0); 
     175 
     176                        setPages(0,0); 
     177                        return; 
     178                } 
     179 
     180                if (data[0] == '0') 
     181                { 
     182                        Element('cc_type_contact').value = data[1]; 
     183                        CC_npages = 0; 
     184                        CC_actual_page = 1; 
     185                        if(CC_visual == 'cards') 
     186                                drawCards(0); 
     187                        else if(CC_visual == 'table') 
     188                                drawTable(0); 
     189                        setPages(0,0); 
     190                        return; 
     191                } 
     192                else 
     193                { 
     194                        Element('cc_type_contact').value = data[10]; 
     195                } 
     196 
     197//              Element('cc_debug').innerHTML = responseText; 
     198 
     199                if (typeof(data) != 'object') 
     200                { 
     201                        showMessage(Element('cc_msg_err_contacting_server').value); 
     202                        return; 
     203                } 
     204 
     205                if (typeof(data[3]) == 'object') 
     206                { 
     207                        CC_npages = parseInt(data[0]); 
     208                        CC_actual_page = parseInt(data[1]); 
     209                        if(CC_visual == 'cards') 
     210                                drawCards(data[3].length, data[10]); 
     211                        else if(CC_visual == 'table') 
     212                                drawTable(data[3].length, data[10]); 
     213                        resizeWindow(); 
     214                        populateCards(data, data[10]); 
     215                        setPages(data[0], data[1]); 
     216                } 
     217                else if (data['error']) 
     218                { 
     219                        showMessage(data['error']); 
     220                } 
     221                else 
     222                { 
     223                        showMessage(Element('cc_msg_err_contacting_server').value); 
     224                        return; 
     225                } 
     226 
     227 
     228        }; 
     229 
     230 
     231/* 
    132232                var handler = function (responseText) 
    133233                { 
    134234                        Element('cc_debug').innerHTML = responseText; 
    135                          
     235 
    136236                        var data = unserialize(responseText); 
    137                          
     237 
    138238                        if (!data || !data['status']) 
    139239                        { 
     
    147247                                _this.DOMresult.innerHTML = data['msg']; 
    148248                                setTimeout(function(){_this.DOMresult.innerHTML = '';}, 1000); 
    149                                  
     249 
    150250                                if (_this.onSearchFinish) 
    151251                                { 
     
    163263                        } 
    164264 
    165                         //showMessage(data['msg']); 
     265                        // Mostra a mensagem se a busca retornar mais de 300 resultados. 
     266                        if (data['data'].length > 300) 
     267                        { 
     268 
     269                                TODO: Usar o esquema de tradução do expresso para este alert 
     270 
     271                                alert("Mais de 300 resultados foram retornados!\n" + 
     272                                        "Favor refinar sua busca."); 
     273                        } 
    166274 
    167275                        if (_this.onSearchFinish) 
     
    170278                        } 
    171279                }; 
    172                  
    173                 this.Connector.newRequest('search', CC_url+'search&data='+serialize(data), 'GET', handler); 
     280*/ 
     281                var info = "letter="+'search'+"&page="+'1'+"&data="+serialize(data); 
     282                this.Connector.newRequest('get_cards_data', CC_url+'get_cards_data', 'POST', handler, info); 
    174283        } 
  • trunk/contactcenter/js/cc_tree.js

    r56 r284  
    2020                throw('dFTree lib must be loaded!'); 
    2121        } 
    22          
     22 
    2323        function ccCatalogTree(params) 
    2424        { 
     
    2929 
    3030                var _tree = this; 
    31                  
     31 
    3232                /* This is the property that holds the Tree Object */ 
    3333                this.name = params['name']; 
     
    3939                this.Connector = params['connector']; 
    4040 
    41                 /* Build the Inicial Tree */  
     41                /* Build the Inicial Tree */ 
    4242                //this._getActualLevel(); 
    4343                setTimeout(function(){ _tree._updateTree('0', true);}, 100); 
     
    5757                                return; 
    5858                        } 
    59                          
     59 
    6060                        if (data['status'] != 'ok') 
    6161                        { 
     
    6666 
    6767                        _this.catalog_perms = parseInt(data['perms']); 
    68                          
     68 
    6969                        if (_this.afterSetCatalog) 
    7070                        { 
     
    7575                Connector.newRequest(this.name+'catalog', CC_url+'set_catalog&catalog='+catalog, 'GET', handler); 
    7676        } 
    77          
     77 
    7878        ccCatalogTree.prototype.setCatalogSearch = function (catalog) { 
    79          
     79 
    8080                var _this = this; 
    8181                var handler = function (responseText) 
     
    8989                                return; 
    9090                        } 
    91                          
     91 
    9292                        if (data['status'] != 'ok') 
    9393                        { 
     
    100100 
    101101                        this.afterSetCatalog = ccEmailWin.search.go(); 
    102                          
     102 
    103103                }; 
    104104 
    105105                Connector.newRequest(this.name+'catalog', CC_url+'set_catalog&catalog='+catalog, 'GET', handler); 
    106106        } 
    107                  
    108          
     107 
     108 
    109109        ccCatalogTree.prototype.select = function(level, search) 
    110110        { 
    111                 if (!search) {  
     111                if (!search) { 
    112112                        this.tree.openTo(level); 
    113113                        this.tree.getNodeById(level)._select(); 
    114                  
     114 
    115115                        if (level != this.actualLevel) 
    116116                        { 
     
    129129         *                    Methods For Internal Use                           * 
    130130        \*************************************************************************/ 
    131          
     131 
    132132        ccCatalogTree.prototype._waitForTree = function(level, rlevel) 
    133133        { 
     
    142142                        return; 
    143143                } 
    144                  
     144 
    145145                setTimeout(this.name+'._waitForTree(\''+level+'\', '+rlevel+')', 100); 
    146146        } 
     
    176176                                _this.tree.getNodeById(_this.actualLevel)._select(); 
    177177                                _this.setCatalog(_this.actualLevel); 
    178                                 _this.expandTree(); 
    179  
    180                         } 
    181                 }; 
    182                  
     178                        } 
     179                }; 
     180 
    183181                Connector.newRequest(this.name+'actual', CC_url+'get_actual_catalog', 'GET', handler); 
    184182        } 
    185183 
    186         ccCatalogTree.prototype.expandTree = function() { 
    187                 for (i=0; i < this.tree._aNodes.length; i++) 
    188                         this._expandSubTree(this.tree._aNodes[i]); 
    189         } 
    190  
    191         ccCatalogTree.prototype._expandSubTree = function(node) { 
    192                 if ( node._children == '' ) { 
    193                         return; 
    194                 } 
    195                 if (node._children != '') { 
    196                         for (i = 0; i <= node._children.length; i++) { 
    197                                 if ( node._io == false ) 
    198                                         node.changeState(); 
    199                                 this._expandSubTree(node._children[i]); 
    200                         } 
    201                 } 
    202         } 
    203  
    204  
    205184        ccCatalogTree.prototype._updateTree = function(level, open) 
    206185        { 
     
    222201                        { 
    223202                                showMessage(data['msg']); 
    224                                 return; 
     203                                if (data['status'] != 'error') 
     204                                { 
     205                                        return; 
     206                                } 
    225207                        } 
    226208 
    227209                        treeData = data['data']; 
    228                          
     210 
    229211                        var timeout = 10; 
    230212                        var limit = 0; 
     
    261243                                timeout += 5; 
    262244                        } 
    263                          
     245 
    264246                        _this.treeAvailable = true; 
    265247 
     
    271253                        } 
    272254                }; 
     255 
    273256                Connector.newRequest(this.name+'update', CC_url+'get_catalog_tree&level='+level, 'GET', handler); 
    274257        } 
Note: See TracChangeset for help on using the changeset viewer.