Changeset 285 for trunk/contactcenter/js/cc.js
- Timestamp:
- 05/23/08 17:10:39 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/contactcenter/js/cc.js
r284 r285 57 57 var CC_full_add_const = false; 58 58 var CC_full_add_photo = false; 59 59 60 60 var CC_last_height = window.innerHeight; 61 61 var CC_last_width = window.innerWidth; … … 90 90 photo_input = photo_frame.contentDocument.createElement('input'); 91 91 } 92 92 93 93 photo_frame.id = 'cc_photo_frame'; 94 94 photo_frame.style.position = 'absolute'; … … 96 96 photo_frame.style.top = '600px'; 97 97 photo_frame.style.left = '0px'; 98 98 99 99 photo_form.id = 'cc_photo_form'; 100 100 photo_form.method = 'POST'; 101 101 photo_form.enctype = 'multipart/form-data'; 102 102 103 103 photo_input.id = 'cc_photo_input'; 104 104 photo_input.type = 'file'; 105 105 106 106 if (is_ie) 107 107 { … … 113 113 } 114 114 photo_form.appendChild(photo_input); 115 115 116 116 } 117 117 … … 121 121 var obj = Element(id); 122 122 var max = obj.options.length; 123 123 124 124 if (option == undefined) 125 125 { … … 161 161 function openFullAdd(){ 162 162 // Build the FullAdd Window. 163 if(!fullAddWin && !is_ie) 163 if(!fullAddWin && !is_ie) 164 164 __f(); 165 165 … … 168 168 fullAddWin.open(); 169 169 tabs._showTab('cc_contact_tab_0'); 170 Element("cc_conn_type_1").checked = false; 170 Element("cc_conn_type_1").checked = false; 171 171 Element("cc_conn_type_2").checked = false; 172 172 Element("cc_conn_type_sel").disabled = true; … … 189 189 function editGroup(id){ 190 190 populateEditGroup(id); 191 ccAddGroup.window.open(); 191 ccAddGroup.window.open(); 192 192 } 193 193 /* … … 199 199 { 200 200 CC_full_add_const = false; 201 201 202 202 setTimeout('populateFullAddConstAsync()', 10); 203 203 } … … 207 207 var handler = function(responseText) 208 208 { 209 //Element('cc_debug').innerHTML = responseText; 209 //Element('cc_debug').innerHTML = responseText; 210 210 var data = unserialize(responseText); 211 211 var i = 1; 212 212 var j; 213 213 214 214 if (typeof(data) != 'object') 215 215 { … … 217 217 return; 218 218 } 219 219 220 220 /* Populate Prefixes */ 221 221 for (j in data[0]) … … 224 224 i++; 225 225 } 226 226 227 227 /* Populate Suffixes */ 228 228 i = 1; … … 246 246 { 247 247 Element('cc_addr_countries').options[i] = new Option(data[3][j], j); 248 248 249 249 if (j == 'BR' || j == 'br') 250 250 { 251 251 CC_br_index = i; 252 252 } 253 253 254 254 i++; 255 255 } 256 256 257 257 /* Populate Connection Types */ 258 258 i = 1; … … 262 262 i++; 263 263 } 264 264 265 265 /* Populate Relations Types */ 266 266 i = 0; … … 270 270 i++; 271 271 } 272 272 273 273 CC_full_add_const = true; 274 274 … … 305 305 { 306 306 var handler = function(responseText) 307 { 308 var data = unserialize(responseText); 309 Element('group_id').value = data['id_group']; 310 311 if(data['contact_list']) { 312 for(i = 0; i < data['contact_list'].length; i++) { 313 option = document.createElement('option'); 314 option.value = data['contact_list'][i]['id_connection']; 315 option.text = data['contact_list'][i]['names_ordered']+' ('+data['contact_list'][i]['connection_value']+')'; 316 Element('contact_list').options[Element('contact_list').options.length] = option; 317 } 307 { 308 var data = unserialize(responseText); 309 Element('group_id').value = data['id_group']; 310 var options_contact_list = Element('contact_list'); 311 if(data['contact_list']) { 312 options_contact_list.innerHTML = data['contact_list']; 318 313 } 319 314 320 315 if(data['id_group']) { 321 322 if(data['contact_in_list']) { 323 for(i = 0; i < data['contact_in_list'].length; i++) { 316 317 if(data['contact_in_list']) { 318 for(i = 0; i < data['contact_in_list'].length; i++) { 324 319 option = document.createElement('option'); 325 320 option.value = data['contact_in_list'][i]['id_connection']; 326 option.text = data['contact_in_list'][i]['names_ordered']+' ('+data['contact_in_list'][i]['connection_value']+')'; 321 option.text = data['contact_in_list'][i]['names_ordered']+' ('+data['contact_in_list'][i]['connection_value']+')'; 327 322 Element('contact_in_list').options[Element('contact_in_list').options.length] = option; 328 323 } 329 } 330 324 } 325 331 326 Element('title').value = data['title']; 332 327 } 333 328 334 329 if (typeof(data) != 'object' || data['result'] != 'ok') 335 330 { … … 338 333 } 339 334 }; 340 335 341 336 id = typeof(id) == 'undefined' ? id = 0 : id; 342 343 ccAddGroup.clear(true); 337 338 ccAddGroup.clear(true); 344 339 Connector.newRequest('populateEditGroup', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_group&id='+id, 'GET', handler); 345 340 } … … 376 371 return false; 377 372 } 378 373 379 374 /* First thing: Send Photo */ 380 375 if (Element('cc_pd_select_photo').value != '' && !is_ie) … … 394 389 frame = old_frame; 395 390 } 396 391 397 392 frame.id = 'cc_photo_frame'; 398 393 frame.style.visibility = 'hidden'; … … 403 398 404 399 form = frame.contentDocument.createElement('form'); 405 400 406 401 var id_contact = Element('cc_full_add_contact_id').value; 407 402 form.id = 'cc_form_photo'; … … 409 404 form.enctype = 'multipart/form-data'; 410 405 form.action = 'http://'+ document.domain + Element('cc_root_dir').value+'../index.php?menuaction=contactcenter.ui_data.data_manager&method=post_photo&id='+(id_contact != '' && id_contact != 'null' ? id_contact : ''); 411 406 412 407 var input_clone = Element('cc_pd_select_photo').cloneNode(false); 413 408 form.appendChild(input_clone); 414 409 415 410 frame.contentDocument.body.appendChild(form); 416 411 form.submit(); … … 466 461 var empty = true; 467 462 var replacer = '__##AND##__'; 468 463 469 464 data['commercialAnd'] = replacer; 470 465 471 466 if (Element('cc_full_add_contact_id').value != '' && Element('cc_full_add_contact_id').value != 'null') 472 467 { … … 477 472 /* Status: Full Added */ 478 473 data['id_status'] = CC_STATUS_FULL_ADD; 479 474 480 475 /* Personal Data */ 481 476 data['alias'] = replaceComAnd(Element('cc_pd_alias').value, replacer); … … 515 510 data['connections'] = new Array(); 516 511 } 517 512 518 513 for (var i in CC_contact_full_info['connections'][type]) 519 514 { … … 527 522 data['connections']['connection'+connNumber] = new Array(5); 528 523 } 529 524 530 525 data['connections']['connection'+connNumber]['id_connection'] = CC_contact_full_info['connections'][type][i]['id']; 531 526 data['connections']['connection'+connNumber]['id_typeof_connection'] = type; … … 536 531 data['connections']['connection'+connNumber]['connection_is_default'] = 'TRUE'; 537 532 } 538 else 533 else 539 534 data['connections']['connection'+connNumber]['connection_is_default'] = 'FALSE'; 540 535 } 541 536 542 537 // data['connections']['connection'+connNumber].length = 5; 543 538 544 539 empty = false; 545 540 connNumber++; … … 548 543 549 544 } 550 545 551 546 if (!empty) 552 547 { … … 555 550 } 556 551 } 557 552 558 553 if (CC_contact_full_info['removed_conns']) 559 554 { 560 555 empty = false; 561 556 562 557 if (typeof(data['connections']) != 'object') 563 558 { … … 594 589 for (var i in CC_contact_full_info['connections'][type]){ 595 590 if((CC_contact_full_info['connections'][type][i]['value'].length < 4) || 596 (!comp.test(CC_contact_full_info['connections'][type][i]['value']))){ 597 showMessage('Endere ï¿œo para conexï¿œo de ' + CC_contact_full_info['connections'][type][i]['name'] + ', nï¿œo ï¿œ vï¿œlido');591 (!comp.test(CC_contact_full_info['connections'][type][i]['value']))){ 592 showMessage('Endereço para conexão de ' + CC_contact_full_info['connections'][type][i]['name'] + ', não é válido'); 598 593 return false; 599 594 } … … 601 596 var _options_default = Element("cc_"+(type == 1 ? 'email' : 'phone')+"_default"); 602 597 if(_options_default.value == '-1') { 603 alert(" ï¿œ necessï¿œrio escolher um "+ (type == 1 ? 'E-mail' : 'Telefone')+" como padrï¿œo!");598 alert("É necessário escolher um "+ (type == 1 ? 'E-mail' : 'Telefone')+" como padrão!"); 604 599 return false; 605 600 } 606 601 } 607 602 608 603 } 609 604 … … 614 609 615 610 /********* Personal Data Functions *********/ 616 /* 611 /* 617 612 * data[0] => cc_pd_select_photo 618 613 * data[1] => cc_pd_alias … … 662 657 { 663 658 Element('cc_addr_types').selectedIndex = 0; 664 659 665 660 Element('cc_addr_countries').selectedIndex = 0; 666 661 Element('cc_addr_countries').disabled = true; 667 662 668 663 Element('cc_addr_states').selectedIndex = 0; 669 664 Element('cc_addr_states').disabled = true; … … 716 711 var type = Element('cc_addr_types'); 717 712 var oldSelected = type.value; 718 713 719 714 saveAddressFields(); 720 715 721 716 if (oldSelected == '_NONE_') 722 717 { … … 724 719 return true; 725 720 } 726 721 727 722 CC_addr_last_selected = type.selectedIndex; 728 723 729 724 Element('cc_addr_countries').disabled = false; 730 725 731 726 var data = CC_contact_full_info['addresses']; 732 727 var addrIndex = 'address'+Element('cc_addr_types').value; 733 734 if (typeof(data) != 'object' || typeof(data[addrIndex]) != 'object') 728 729 if (typeof(data) != 'object' || typeof(data[addrIndex]) != 'object') 735 730 { 736 731 resetAddressFields(); … … 741 736 return true; 742 737 } 743 738 744 739 var addrTypeID = Element('cc_addr_types').value; 745 740 746 741 data = CC_contact_full_info['addresses'][addrIndex]; 747 742 748 743 Element('cc_addr_id').value = data['id_address'] ? data['id_address'] : ''; 749 744 Element('cc_addr_1').value = data['address1'] ? data['address1'] : ''; … … 767 762 states.selectedIndex = 0; 768 763 clearSelectBox(states, 4); 769 updateAddrCities(); 764 updateAddrCities(); 770 765 return; 771 766 } … … 782 777 { 783 778 var data = unserialize(responseText); 784 779 785 780 clearSelectBox(states, 1); 786 781 787 782 if (typeof(data) != 'object') 788 783 { 789 784 showMessage(Element('cc_msg_err_contacting_server').value); 790 785 791 786 return; 792 787 } … … 795 790 { 796 791 states.disabled = true; 797 cities.disabled = true; 792 cities.disabled = true; 798 793 states.selectedIndex = 0; 799 794 cities.selectedIndex = 0; … … 835 830 } 836 831 }; 837 832 838 833 Connector.newRequest('populateStates', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_states&country='+Element('cc_addr_countries').value, 'GET', handler); 839 834 } … … 863 858 newState.disabled = false; 864 859 updateAddrNewStateOnMouseOut(); 865 860 866 861 cities.disabled = false; 867 862 clearSelectBox(cities, 3); … … 874 869 case '_NOSTATE_': 875 870 clearSelectBox(cities, 3); 876 871 877 872 cities.disabled = false; 878 873 cities.selectedIndex = 0; 879 874 880 875 requestStr = 'country='+Element('cc_addr_countries').value; 881 876 break; 882 877 883 878 default: 884 879 requestStr = 'country='+Element('cc_addr_countries').value+'&state='+states.value; … … 895 890 { 896 891 var cities = Element('cc_addr_cities'); 897 892 898 893 var handler = function (responseText) 899 894 { 900 895 var data = unserialize(responseText); 901 896 902 897 clearSelectBox(cities, 1); 903 898 904 899 if (typeof(data) != 'object') 905 900 { 906 901 showMessage(Element('cc_msg_err_contacting_server').value); 907 902 908 903 return; 909 904 } … … 950 945 } 951 946 }; 952 947 953 948 Connector.newRequest('populateCities', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_cities&'+requestStr, 'GET', handler); 954 949 } … … 956 951 function updateAddrNewStateOnMouseOver () 957 952 { 958 if (Element('cc_addr_states_new').value == Element('cc_msg_type_state').value && Element('cc_addr_states').selectedIndex == 1) 953 if (Element('cc_addr_states_new').value == Element('cc_msg_type_state').value && Element('cc_addr_states').selectedIndex == 1) 959 954 { 960 955 Element('cc_addr_states_new').value = ''; … … 964 959 function updateAddrNewStateOnMouseOut () 965 960 { 966 if (Element('cc_addr_states_new').value.length == 0 && Element('cc_addr_states').selectedIndex == 1) 961 if (Element('cc_addr_states_new').value.length == 0 && Element('cc_addr_states').selectedIndex == 1) 967 962 { 968 963 Element('cc_addr_states_new').value = Element('cc_msg_type_state').value; … … 984 979 return; 985 980 } 986 981 987 982 Element('cc_addr_1').readonly = false; 988 983 Element('cc_addr_1').disabled = false; … … 1014 1009 1015 1010 //resetAddrFillingFields(); 1016 1011 1017 1012 return; 1018 1013 … … 1022 1017 newCity.disabled = false; 1023 1018 updateAddrNewCityOnMouseOut(); 1024 1019 1025 1020 break; 1026 1021 … … 1036 1031 function updateAddrNewCityOnMouseOver () 1037 1032 { 1038 if (Element('cc_addr_cities_new').value == Element('cc_msg_type_city').value && Element('cc_addr_cities').selectedIndex == 1) 1033 if (Element('cc_addr_cities_new').value == Element('cc_msg_type_city').value && Element('cc_addr_cities').selectedIndex == 1) 1039 1034 { 1040 1035 Element('cc_addr_cities_new').value = ''; … … 1044 1039 function updateAddrNewCityOnMouseOut () 1045 1040 { 1046 if (Element('cc_addr_cities_new').value.length == 0 && Element('cc_addr_cities').selectedIndex == 1) 1041 if (Element('cc_addr_cities_new').value.length == 0 && Element('cc_addr_cities').selectedIndex == 1) 1047 1042 { 1048 1043 Element('cc_addr_cities_new').value = Element('cc_msg_type_city').value; … … 1058 1053 return true; 1059 1054 } 1060 1061 var addrFields = new Array('cc_addr_1', 1062 'cc_addr_2', 1063 'cc_addr_complement', 1055 1056 var addrFields = new Array('cc_addr_1', 1057 'cc_addr_2', 1058 'cc_addr_complement', 1064 1059 'cc_addr_other', 1065 'cc_addr_postal_code', 1060 'cc_addr_postal_code', 1066 1061 'cc_addr_po_box', 1067 1062 'cc_addr_countries', … … 1070 1065 1071 1066 var empty = true; 1072 1067 1073 1068 for (var i = 0; i < 8; i++) 1074 1069 { … … 1079 1074 } 1080 1075 } 1081 1076 1082 1077 if (empty) 1083 1078 { … … 1108 1103 default: 1109 1104 addrInfo['id_country'] = Element('cc_addr_countries').value; 1110 1105 1111 1106 } 1112 1107 … … 1122 1117 default: 1123 1118 addrInfo['id_state'] = Element('cc_addr_states').value; 1124 1119 1125 1120 } 1126 1121 … … 1135 1130 default: 1136 1131 addrInfo['id_city'] = Element('cc_addr_cities').value; 1137 1138 } 1132 1133 } 1139 1134 1140 1135 addrInfo['id_typeof_address'] = Element('cc_addr_types').options[lastIndex].value; … … 1149 1144 CC_contact_full_info['addresses']['address'+Element('cc_addr_types').options[lastIndex].value] = addrInfo; 1150 1145 1151 if (Element('cc_addr_cities').value == '_NEW_' && 1146 if (Element('cc_addr_cities').value == '_NEW_' && 1152 1147 Element('cc_msg_type_city').value != Element('cc_addr_cities_new').value && 1153 1148 Element('cc_addr_cities_new').value != '') 1154 1149 { 1155 1150 var addrRootInfo = CC_contact_full_info['addresses']['new_cities']; 1156 1151 1157 1152 if (!addrRootInfo) 1158 1153 { 1159 1154 addrRootInfo = new Array(); 1160 1155 } 1161 1156 1162 1157 var i = addrRootInfo.length; 1163 1158 addrRootInfo[addrInfo['id_typeof_address']] = new Array(); … … 1168 1163 } 1169 1164 1170 if (Element('cc_addr_states').value == '_NEW_' && 1171 Element('cc_msg_type_state').value != Element('cc_addr_states_new').value && 1165 if (Element('cc_addr_states').value == '_NEW_' && 1166 Element('cc_msg_type_state').value != Element('cc_addr_states_new').value && 1172 1167 Element('cc_addr_states_new').value != '') 1173 1168 { 1174 1169 var addrRootInfo = CC_contact_full_info['addresses']['new_states']; 1175 1170 1176 1171 if (!addrRootInfo) 1177 1172 { 1178 1173 addrRootInfo = new Array(); 1179 1174 } 1180 1175 1181 1176 var i = addrRootInfo.length; 1182 1177 addrRootInfo[addrInfo['id_typeof_address']] = new Array(); … … 1208 1203 for(idx_conn; idx_conn < cc_conn_default.options.length; idx_conn++) 1209 1204 if(cc_conn_default.options[idx_conn].value == _label) 1210 break; 1211 1205 break; 1206 1212 1207 if(idx_conn == cc_conn_default.options.length) 1213 1208 cc_conn_default.options[idx_conn] = new Option (_label,_label, false,false); 1214 1209 1215 1210 if (!document.all) 1216 1211 { 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"> ' + 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"> ' + 1231 '<img align="top" alt="X" src="templates/default/images/x.png" style="width:18px; height:18px" onclick="javascript:removeConnField(\'cc_conn_tr_' + CC_conn_count + '\')"></td>'; 1232 } 1212 return '<td style="position: absolute; left: 0; top: 0; z-index: -1; visibility: hidden"><input id="cc_conn_id_' + CC_conn_count + '" type="hidden" value="_NEW_"><input id="cc_conn_is_default_' + CC_conn_count + '" type="hidden" value="false"></td>'+ 1213 //'<td style="width: 30px;" align="right"><input name="cc_conn_is_default" id="cc_conn_is_default_'+ CC_conn_count +'" type="radio"></td>'+ 1214 '<td style="width: 10px;" align="right"><input id="cc_conn_name_'+CC_conn_count+'" type="hidden"><td style="width: 100px;" align="right"><span style="width: 150px;" id="cc_conn_label_'+CC_conn_count+'">'+_label+'</span></td>' + 1215 '<td align="left"><input id="cc_conn_value_'+ CC_conn_count +'" style="width: 150px;" type="text"> ' + 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>'; 1233 1217 } 1234 1218 else … … 1254 1238 img.align = 'top'; 1255 1239 img.onclick = function(e){ removeConnField(remove_id);}; 1256 1240 1257 1241 for (var i = 0; i < 3; i++) 1258 1242 { … … 1265 1249 1266 1250 inputs[1].id = 'cc_conn_name_'+CC_conn_count; 1267 inputs[1].type = 'hidden'; 1251 inputs[1].type = 'hidden'; 1268 1252 1269 1253 inputs[2].id = 'cc_conn_value_'+CC_conn_count; … … 1294 1278 || typeof(CC_contact_full_info['connections'][CC_conn_last_selected]) == 'undefined' 1295 1279 || typeof(CC_contact_full_info['connections'][CC_conn_last_selected][CC_conn_count]) == 'undefined'); 1296 1297 if(_emptyLine) { 1298 1280 1281 if(_emptyLine) { 1282 1299 1283 if(Element("cc_conn_type_sel").value == '-1'){ 1300 return false; 1301 } 1302 1284 return false; 1285 } 1286 1303 1287 for(k = 0; k < CC_conn_count; k++) { 1304 1288 if(Element("cc_conn_name_"+k) && Element("cc_conn_name_"+k).value != "" && Element("cc_conn_name_"+k).value == Element("cc_conn_type_sel").value) { 1305 alert('Voc ï¿œ jï¿œpossui uma entrada para o tipo "'+Element("cc_conn_type_sel").value+'"!');1306 Element("cc_conn_type_sel").options.selectedIndex = 0; 1289 alert('Você já possui uma entrada para o tipo "'+Element("cc_conn_type_sel").value+'"!'); 1290 Element("cc_conn_type_sel").options.selectedIndex = 0; 1307 1291 return false; 1308 1292 } 1309 1293 } 1310 } 1294 } 1311 1295 if (!document.all) 1312 1296 { … … 1335 1319 1336 1320 function connRemoveLine(id) 1337 { 1321 { 1338 1322 var p = Element(id).parentNode; 1339 1323 var cc_conn_default = Element("cc_phone_default").style.display == '' ? Element("cc_phone_default") : Element("cc_email_default"); … … 1374 1358 } 1375 1359 } 1376 1360 1377 1361 CC_conn_count = 0; 1378 1362 } … … 1396 1380 function updateConnFields() 1397 1381 { 1398 1382 1399 1383 var connID; 1400 1384 var i; … … 1405 1389 var cc_conn_is_default = ''; 1406 1390 var selected_index = ''; 1407 1391 1408 1392 cc_conn_type_sel.disabled = false; 1409 1393 div_cc_conn_is_default.style.display = ""; 1410 1394 1411 1395 for(var i = 0;i < cc_conn_type_sel.options.length; i++) 1412 cc_conn_type_sel.options[i--] = null; 1413 1396 cc_conn_type_sel.options[i--] = null; 1397 1414 1398 if(Element('cc_conn_type_1').checked) { 1415 cc_conn_type_sel[0] = new Option('Novo Email...','-1'); 1416 cc_conn_type_sel[1] = new Option('Principal','Principal'); 1417 cc_conn_type_sel[2] = new Option('Alternativo','Alternativo'); 1399 var lang_new_email = Element('cc_msg_new_email').value; 1400 var lang_main = Element('cc_msg_main').value; 1401 var lang_alternative = Element('cc_msg_alternative').value; 1402 cc_conn_type_sel[0] = new Option(lang_new_email,'-1'); 1403 cc_conn_type_sel[1] = new Option(lang_main,lang_main); 1404 cc_conn_type_sel[2] = new Option(lang_alternative,lang_alternative); 1418 1405 connID = 1; 1419 1406 selected_index = cc_email_default.options.selectedIndex; … … 1422 1409 } 1423 1410 1424 cc_email_default.options[0] = new Option('Selecionar Email...','-1');1425 1411 var lang_select_email = Element('cc_msg_select_email').value; 1412 cc_email_default.options[0] = new Option(lang_select_email,'-1'); 1426 1413 cc_phone_default.style.display = 'none'; 1427 cc_email_default.style.display = ''; 1414 cc_email_default.style.display = ''; 1428 1415 cc_conn_is_default = cc_email_default; 1429 1416 } 1430 1417 else if(Element('cc_conn_type_2').checked) { 1431 cc_conn_type_sel[0] = new Option('Novo Telefone...','-1'); 1432 cc_conn_type_sel[1] = new Option('Residencial','Residencial'); 1433 cc_conn_type_sel[2] = new Option('Celular','Celular'); 1434 cc_conn_type_sel[3] = new Option('Comercial','Comercial'); 1435 cc_conn_type_sel[4] = new Option('Fax','Fax'); 1436 cc_conn_type_sel[5] = new Option('Pager','Pager'); 1418 var lang_new_telephone = Element('cc_msg_new_phone').value; 1419 var lang_home = Element('cc_msg_home').value; 1420 var lang_cellphone = Element('cc_msg_cellphone').value; 1421 var lang_work = Element('cc_msg_work').value; 1422 var lang_fax = Element('cc_msg_fax').value; 1423 var lang_pager = Element('cc_msg_pager').value; 1424 cc_conn_type_sel[0] = new Option(lang_new_telephone,'-1'); 1425 cc_conn_type_sel[1] = new Option(lang_home,lang_home); 1426 cc_conn_type_sel[2] = new Option(lang_cellphone,lang_cellphone); 1427 cc_conn_type_sel[3] = new Option(lang_work,lang_work); 1428 cc_conn_type_sel[4] = new Option(lang_fax,lang_fax); 1429 cc_conn_type_sel[5] = new Option(lang_pager,lang_pager); 1430 1437 1431 connID = 2; 1438 1432 selected_index = cc_phone_default.options.selectedIndex; … … 1441 1435 } 1442 1436 1443 cc_phone_default.options[0] = new Option('Selecionar Telefone...','-1'); 1437 var lang_choose_phone = Element('cc_msg_choose_phone').value; 1438 cc_phone_default.options[0] = new Option(lang_choose_phone,'-1'); 1444 1439 cc_email_default.style.display = 'none'; 1445 1440 cc_phone_default.style.display = ''; 1446 1441 cc_conn_is_default = cc_phone_default; 1447 1442 } 1448 1443 1449 1444 Element("cc_conn_type_sel").options.selectedIndex = 0; 1450 1445 /* First save the data */ … … 1452 1447 1453 1448 CC_conn_last_selected = connID; 1454 1449 1455 1450 clearConn(); 1456 1451 1457 1452 if (connID == '_NONE_') 1458 1453 { cc_conn_is_default.disabled = true; 1459 1454 return; 1460 1455 } 1461 1456 1462 1457 /* If no data already available, return */ 1463 1458 if (!CC_contact_full_info['connections']) … … 1483 1478 } 1484 1479 } 1485 } 1480 } 1486 1481 if(cc_conn_is_default.options.length > selected_index) 1487 1482 cc_conn_is_default.options.selectedIndex = (selected_index == "-1" ? 0 : selected_index); … … 1504 1499 CC_contact_full_info['connections'][CC_conn_last_selected] = new Array(); 1505 1500 } 1506 else 1501 else 1507 1502 { 1508 1503 delete CC_contact_full_info['connections'][CC_conn_last_selected]; … … 1516 1511 var subNodes = nodes[i].childNodes; 1517 1512 var found = false; 1518 1513 1519 1514 for (var j = 0; j < subNodes.length; j++) 1520 1515 { 1521 if (subNodes[j].childNodes.length > 0 && 1516 if (subNodes[j].childNodes.length > 0 && 1522 1517 subNodes[j].childNodes[0].id) 1523 1518 { … … 1527 1522 CC_contact_full_info['connections'][CC_conn_last_selected][k] = new Array(); 1528 1523 } 1529 1524 1530 1525 if (subNodes[j].childNodes[0].id.indexOf('cc_conn_name') != -1) 1531 1526 { … … 1547 1542 else 1548 1543 { 1549 CC_contact_full_info['connections'][CC_conn_last_selected][k]['value'] = ''; 1544 CC_contact_full_info['connections'][CC_conn_last_selected][k]['value'] = ''; 1550 1545 } 1551 1546 } … … 1558 1553 } 1559 1554 } 1560 1555 1561 1556 if (found) 1562 1557 { … … 1575 1570 delete CC_contact_full_info['connections'][CC_conn_last_selected]; 1576 1571 } 1577 1572 1578 1573 } 1579 1574 … … 1601 1596 var number = randomString().toLowerCase(); 1602 1597 var result = ''; 1603 1598 1604 1599 if(!is_ie) 1605 result = prompt("Essa opera ᅵᅵo removerï¿œ TODOS os seus \ncontatos pessoais, e Nï¿œO PODERï¿œ ser \ndesfeita. Digite o cï¿œdigo abaixo:\n\tCï¿œdigo de confirmaᅵᅵo: "+number);1600 result = prompt("Essa operação removerá TODOS os seus \ncontatos pessoais, e NÃO PODERÁ ser \ndesfeita. Digite o código abaixo:\n\tCódigo de confirmação: "+number); 1606 1601 else 1607 result = prompt("Essa opera ᅵᅵo removerï¿œ TODOS os seus contatos pessoais, e Nï¿œO PODERï¿œ ser desfeita. Digite o seguinte cï¿œdigo de confirmaᅵᅵo: "+number,"");1602 result = prompt("Essa operação removerá TODOS os seus contatos pessoais, e NÃO PODERÁ ser desfeita. Digite o seguinte código de confirmação: "+number,""); 1608 1603 1609 1604 if(result) { … … 1611 1606 Connector.newRequest('removeAllEntries', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=remove_all_entries', 'GET', handler); 1612 1607 else 1613 alert('C ï¿œdigo Incorreto');1614 } 1608 alert('Código Incorreto'); 1609 } 1615 1610 } 1616 1611 … … 1623 1618 return; 1624 1619 } 1625 1620 1626 1621 var handler = function (responseText) 1627 1622 { … … 1633 1628 return; 1634 1629 } 1635 1630 1636 1631 if (data['status'] != 'ok') 1637 1632 { … … 1639 1634 return; 1640 1635 } 1641 1636 1642 1637 setTimeout('updateCards()',80);; 1643 1638 }; 1644 1639 1645 1640 typeArg = (type == 'groups' ? 'group' : 'entry'); 1646 1641 1647 1642 Connector.newRequest('removeEntry', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=remove_'+typeArg+'&remove=' + id, 'GET', handler); 1648 1643 } … … 1667 1662 var w_height = 0; 1668 1663 var w_extra = 200; 1669 1664 1670 1665 if (document.body.clientHeight) 1671 1666 { … … 1706 1701 } 1707 1702 } 1708 1709 1703 function getActualPage () 1710 1704 { … … 1771 1765 final_page = 1; 1772 1766 } 1773 1767 1774 1768 html_pages += '<a href="javascript:setPages('+npages+', '+ actual_page +', '+ final_page +')">...</a> '; 1775 1769 1776 1770 page = showing_page ? showing_page : actual_page; 1777 1771 } 1778 1772 1779 1773 for (; page <= npages; page++) 1780 1774 { … … 1836 1830 Element('cc_panel_arrow_last').style.cursor = 'hand'; 1837 1831 } 1838 1832 1839 1833 Element('cc_panel_pages').innerHTML = html_pages; 1840 1834 } … … 1842 1836 function populateCards(data, type) 1843 1837 { 1844 1838 if (data[3].length >= 100 ) 1839 { 1840 alert("Critério de pesquisa muito abrangente, achados " + data[3].length + " resultados"); 1841 for (i = 0; i < (Math.sqrt(data[3].length)-1); i++) 1842 for (j = 0; j < 3; j++) 1843 document.getElementById("cc_card:"+j+":"+i).innerHTML = ''; 1844 return false; 1845 } 1846 1845 1847 if(type == 'groups') 1846 1848 return populateGroupsInCards(data); 1847 1849 1848 1850 var pos = 0; 1849 1851 var ncards = data[3].length; 1850 1852 1851 1853 if (typeof(data[3]) == 'object' && ncards > 0) 1852 1854 { … … 1856 1858 { 1857 1859 id = 'cc_card:'+j+':'+i; 1858 1860 1859 1861 for (var k = 0; k < data[2].length; k++) 1860 1862 { 1861 1862 if(data[2][k] == 'cc_mail' && data[3][pos][k] == 'none' && !(ccTree.catalog_perms & 2) ) { 1863 if(!(ccTree.catalog_perms & 2)) 1864 { 1865 switch(data[2][k]) 1866 { 1867 case 'cc_mail' : 1868 1869 if(data[3][pos][k] === 'none') 1870 data[3][pos][k] = ' '; 1871 break; 1872 case 'cc_phone' : 1873 1874 if(data[3][pos][k] === 'none') 1875 data[3][pos][k] = ' '; 1876 break; 1877 } 1878 1879 } 1880 1881 1882 /*if(data[2][k] == 'cc_mail' && data[3][pos][k] == 'none' && !(ccTree.catalog_perms & 2) ) { 1863 1883 Element(id).style.display = 'none'; 1864 1884 continue; 1865 } 1866 1885 }*/ 1886 1867 1887 if(data[3][pos][k] != 'none') 1868 1888 { … … 1880 1900 } 1881 1901 break; 1882 1902 1883 1903 case 'cc_mail': 1904 1884 1905 if (data[3][pos][k].length > (CC_visual == 'table' ? 50 : 20)) 1885 1906 { … … 1889 1910 else 1890 1911 { 1891 Element(id+':'+data[2][k]).innerHTML = data[5] + data[3][pos][k] + '\')">'+ data[3][pos][k]+'</span>'; 1912 Element(id+':'+data[2][k]).innerHTML = data[5] + data[3][pos][k] + '\')">'+ data[3][pos][k]+'</span>'; 1892 1913 } 1893 1914 break; 1894 1915 1895 1916 case 'cc_phone': 1896 1917 if (data[3][pos][k].length > 20) … … 1923 1944 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] : ''); 1924 1945 if(ccTree.catalog_perms == 1) 1925 Element(id+':cc_icon_data').innerHTML = '<span title=" Copiar para o Catï¿œlogo Pessoal" id="' + id + ':ccQuickAdd" onmouseout="window.status=\'\';" onclick="ccQuickAddContact.showList(\''+ Element(id+':cc_id').value + '\');return true;" style="cursor: pointer; cursor: hand; z-index: 1"><img src="templates/default/images/address-conduit-16.png" align="center"></span>';1946 Element(id+':cc_icon_data').innerHTML = '<span title="'+Element('cc_msg_copy_to_catalog').value+'" id="' + id + ':ccQuickAdd" onmouseout="window.status=\'\';" onclick="ccQuickAddContact.showList(\''+ Element(id+':cc_id').value + '\');return true;" style="cursor: pointer; cursor: hand; z-index: 1"><img src="templates/default/images/address-conduit-16.png" align="center"></span>'; 1926 1947 break; 1927 1948 1928 1949 case 'cc_forwarding_address': 1929 1950 var contacts = data[3][pos][k]; 1930 1951 1931 1952 if( !contacts) 1932 1953 break; 1933 1954 1934 1955 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"> </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 else1944 {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 empregado1951 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 else1958 {1959 Element(id+':'+data[2][k]).innerHTML = adjustString(data[3][pos][k], 15);1960 }1961 Element(id+':cc_department').innerHTML = data[3][pos][k];1962 1956 break; 1963 1957 … … 1970 1964 else 1971 1965 { 1972 if (Element(id+':'+data[2][k]) == null) alert('ï¿œ nulovgdfv');1973 1966 Element(id+':'+data[2][k]).innerHTML = data[3][pos][k]; 1974 1967 } … … 1976 1969 } 1977 1970 } 1978 1971 1979 1972 if (--ncards == 0) 1980 1973 { … … 1982 1975 i = CC_max_cards[1]; 1983 1976 } 1984 1977 1985 1978 pos++; 1986 1979 } … … 1990 1983 1991 1984 function populateGroupsInCards(data) 1992 { 1985 { 1993 1986 var pos = 0; 1994 var contacts = data[5]; 1987 var contacts = data[5]; 1995 1988 var ncards = data[3].length; 1996 1989 1997 1990 if (typeof(data[3]) == 'object' && ncards > 0) 1998 1991 { … … 2002 1995 { 2003 1996 id = 'cc_card:'+j+':'+i; 2004 1997 2005 1998 for (var k = 0; k < data[2].length; k++) 2006 1999 { 2007 2000 2008 2001 if(data[3][pos][k] != 'none') 2009 { 2010 2002 { 2003 2011 2004 switch (data[2][k]) 2012 { 2005 { 2013 2006 case 'cc_title': 2014 2007 if (data[3][pos][k].length > 50) … … 2022 2015 } 2023 2016 break; 2024 2017 2025 2018 case 'cc_short_name': 2026 2019 if (data[3][pos][k].length > (CC_visual == 'table' ? 50 : 20)) … … 2034 2027 } 2035 2028 break; 2036 2029 2037 2030 case 'cc_contacts': 2038 2031 … … 2043 2036 var email = ""; 2044 2037 2045 for (var d = 0; d < contacts.length; d++) { 2038 for (var d = 0; d < contacts.length; d++) { 2046 2039 contact += contacts[d]['names_ordered']+ ","; 2047 2040 email += contacts[d]['connection_value']+","; 2048 2041 } 2049 2042 2050 2043 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">  </span>'; 2051 2044 2052 2045 break; 2053 2046 2054 2047 case 'cc_id': 2055 2048 var id_contact = data[3][pos][k]; 2056 2049 Element(id+':'+data[2][k]).value = data[3][pos][k]; 2057 2050 2058 2051 break; 2059 2052 2060 2053 } 2061 2054 } 2062 2055 } 2063 2056 2064 2057 if (--ncards == 0) 2065 2058 { … … 2067 2060 i = CC_max_cards[1]; 2068 2061 } 2069 2062 2070 2063 pos++; 2071 2064 } … … 2096 2089 }; 2097 2090 2098 Connector.newRequest('setMaxCards', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=set_n_cards&ncards=' + ncards, 'GET'); 2091 Connector.newRequest('setMaxCards', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=set_n_cards&ncards=' + ncards, 'GET'); 2099 2092 } 2100 2093 … … 2102 2095 { 2103 2096 var coord = new Array(); 2104 2097 2105 2098 //Element('cc_card_space').innerHTML = ''; 2106 2099 //return; … … 2109 2102 //card_space_width = parseInt(is_ie ? document.body.offsetWidth : window.innerWidth) - parseInt(Element('cc_left').offsetWidth) - parseInt(CC_card_extra) - 40; 2110 2103 card_space_height = parseInt(Element('cc_card_space').offsetHeight) - parseInt(CC_card_extra); 2111 2104 2112 2105 card_width = CC_card_image_width + CC_card_extra; 2113 2106 card_height = CC_card_image_height + CC_card_extra; … … 2115 2108 ncols = parseInt(card_space_width / card_width); 2116 2109 nlines = parseInt(card_space_height / card_height); 2117 2110 2118 2111 coord[0] = ncols; 2119 2112 //coord[1] = nlines; … … 2129 2122 { 2130 2123 if(type != 'groups') { 2131 2124 2132 2125 html_card = '<td id="' + id + '" style="width: ' + CC_card_image_width + 'px; height: ' + CC_card_image_height + '">' + 2133 2126 '<div style="border: 0px solid #999; position: relative;">' + 2134 '<img src="templates/default/images/card.png" border="0" width="' + CC_card_image_width +'" height="' + CC_card_image_height + '"i ondblclick="editContact(Element(\'' + id + ':cc_id\').value);">' + 2127 '<img src="templates/default/images/card.png" border="0" width="' + CC_card_image_width +'" height="' + CC_card_image_height + '"i ondblclick="editContact(Element(\'' + id + ':cc_id\').value);">' + 2135 2128 ( ccTree.catalog_perms == 1 ? 2136 2129 '<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>':'') + … … 2138 2131 '<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">' + 2139 2132 '<img title="'+Element('cc_msg_card_remove').value+'" id="' + id + ':cc_card_remove" style="position: absolute; top: 78px; left: 223px; width: 15px; height: 14px; cursor: pointer; cursor: hand; z-index: 1" onclick="removeEntry(Element(\'' + id + ':cc_id\').value);" onmouseover="resizeIcon(\''+id+':cc_card_remove\',0)" onmouseout="resizeIcon(\''+id+':cc_card_remove\',1)" src="templates/default/images/cc_x.png">' : '') + 2140 '<img id="' + id + ':cc_photo" style="position: absolute; top: 15px; left: 7px;" src="" border="0" ondblclick="editContact(Element(\'' + id + ':cc_id\').value);">' + 2133 '<img id="' + id + ':cc_photo" style="position: absolute; top: 15px; left: 7px;" src="" border="0" ondblclick="editContact(Element(\'' + id + ':cc_id\').value);">' + 2141 2134 '<span id="' + id + ':cc_company" style="position: absolute; top: 5px; left: 75px; width: 135px; border: 0px solid #999; font-weight: bold; font-size: 14px; text-align: center; height: 10px;" onmouseover="//Element(\''+id+':cc_company_full\').style.visibility=\'visible\'" onmouseout="//Element(\''+id+':cc_company_full\').style.visibility=\'hidden\'"></span>' + 2142 '<span style="cursor: pointer; cursor: hand; z-index: 1;position: absolute; top: 100px; left: 35px" valign="bottom" id="' + id + ':cc_icon_group"> </span>'+ 2143 //Para exibir a matricula do empregado nos cartoes 2144 '<span id="' + id + ':cc_empNumber" style="position: absolute; top: 15px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 9px; text-align: center; height: 10px;"></span>' + 2145 '<span id="' + id + ':cc_name" style="position: absolute; top: 30px; left: 75px; width: 135px; border: 0px solid #999; font-weight: bold; font-size: 10px; text-align: center; height: 10px;" onmouseover="//Element(\''+id+':cc_name_full\').style.visibility=\'visible\'" onmouseout="//Element(\''+id+':cc_name_full\').style.visibility=\'hidden\'"></span>' + 2146 '<span id="' + id + ':cc_title" style="position: absolute; top: 60px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 12px; text-align: center; height: 10px;"></span>' + 2147 //Para exibir o setor/lotacao do empregado nos cartoes 2148 '<span id="' + id + ':cc_department" style="position: absolute; top: 70px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 10px; text-align: center; height: 10px;"></span>' + 2149 '<span id="' + id + ':cc_phone" style="position: absolute; top: 90px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 10px; text-align: center; height: 10px;"></span>' + 2150 '<span id="' + id + ':cc_mail" style="position: absolute; top: 105px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 10px; text-align: center; height: 10px;"></span>' + 2151 '<span id="' + id + ':cc_alias" style="position: absolute; top: 95px; left: 10px; width: 60px; border: 0px solid #999; font-weight: normal; font-size: 9px; text-align: center; height: 10px;"></span>' + 2135 '<span style="cursor: pointer; cursor: hand; z-index: 1;position: absolute; top: 100px; left: 35px" valign="bottom" id="' + id + ':cc_icon_group"> </span>'+ 2136 '<span id="' + id + ':cc_name" style="position: absolute; top: 30px; left: 75px; width: 135px; border: 0px solid #999; font-weight: bold; font-size: 10px; text-align: center; height: 10px;" onmouseover="//Element(\''+id+':cc_name_full\').style.visibility=\'visible\'" onmouseout="//Element(\''+id+':cc_name_full\').style.visibility=\'hidden\'"></span>' + 2137 '<span id="' + id + ':cc_title" style="position: absolute; top: 60px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 12px; text-align: center; height: 10px;"></span>' + 2138 '<span id="' + id + ':cc_phone" style="position: absolute; top: 90px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 10px; text-align: center; height: 10px;"></span>' + 2139 '<span id="' + id + ':cc_mail" style="position: absolute; top: 105px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 10px; text-align: center; height: 10px;"></span>' + 2140 '<span id="' + id + ':cc_alias" style="position: absolute; top: 95px; left: 10px; width: 60px; border: 0px solid #999; font-weight: normal; font-size: 9px; text-align: center; height: 10px;"></span>' + 2152 2141 '<input id="' + id + ':cc_id" type="hidden">' + 2153 2142 '</div>' + '</td>'; 2154 2143 2155 2144 } else { 2156 2145 html_card = '<td id="' + id + '" style="width: ' + CC_card_image_width + 'px; height: ' + CC_card_image_height + '">' + 2157 '<div style="border: 0px solid #999; position: relative;">' + 2146 '<div style="border: 0px solid #999; position: relative;">' + 2158 2147 '<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);">' + 2159 2148 '<img title="'+Element('cc_msg_group_edit').value+'" id="' + id + ':cc_card_edit" style="position: absolute; top: 35px; left: 222px; width: 18px; height: 18px; cursor: pointer; cursor: hand; z-index: 1" onclick="editGroup(Element(\'' + id + ':cc_id\').value);" onmouseover="resizeIcon(\''+id+':cc_card_edit\',0)" onmouseout="resizeIcon(\''+id+':cc_card_edit\',1)" src="templates/default/images/cc_card_edit.png">' + 2160 '<img title="'+Element('cc_msg_group_remove').value+'" id="' + id + ':cc_card_remove" style="position: absolute; top: 78px; left: 223px; width: 15px; height: 14px; cursor: pointer; cursor: hand; z-index: 1" onclick="removeEntry(Element(\'' + id + ':cc_id\').value,\'groups\');" onmouseover="resizeIcon(\''+id+':cc_card_remove\',0)" onmouseout="resizeIcon(\''+id+':cc_card_remove\',1)" src="templates/default/images/cc_x.png">' + 2149 '<img title="'+Element('cc_msg_group_remove').value+'" id="' + id + ':cc_card_remove" style="position: absolute; top: 78px; left: 223px; width: 15px; height: 14px; cursor: pointer; cursor: hand; z-index: 1" onclick="removeEntry(Element(\'' + id + ':cc_id\').value,\'groups\');" onmouseover="resizeIcon(\''+id+':cc_card_remove\',0)" onmouseout="resizeIcon(\''+id+':cc_card_remove\',1)" src="templates/default/images/cc_x.png">' + 2161 2150 '<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>' + 2162 2151 '<span id="' + id + ':cc_participantes" style="cursor: pointer; cursor: hand; z-index: 1;position: absolute; top: 15px; left: 15px"></span>' + … … 2165 2154 '</div>' + '</td>'; 2166 2155 } 2167 2156 2168 2157 2169 2158 return html_card; … … 2177 2166 else 2178 2167 bg = "this.style.background=\'#EEEEEE\'"; 2179 2168 2180 2169 if(type != 'groups') { 2181 2182 html_card = '<tr style="height:20px" id="' + id + '" onmouseout="'+bg+'" onmouseover="this.style.background=\'LIGHTYELLOW\'" bgcolor="EEEEEE">' + 2183 //Para exibir a matricula do empregado na tabela 2184 '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_empNumber"></span></td>' + 2185 '<td width="auto" style="font-weight: normal; font-size: 10px; text-align: left; height: 10px;"><span valign="bottom" id="' + id + ':cc_icon_group"> </span><span id="' + id + ':cc_name"></span></td>' + 2170 2171 html_card = '<tr style="height:20px" id="' + id + '" onmouseout="'+bg+'" onmouseover="this.style.background=\'LIGHTYELLOW\'" bgcolor="EEEEEE"><td width="auto" style="font-weight: normal; font-size: 10px; text-align: left; height: 10px;">' + 2172 '<span valign="bottom" id="' + id + ':cc_icon_group"> </span><span id="' + id + ':cc_name"></span></td>' + 2186 2173 '<td style="solid #999; font-weight: normal; font-size: 10px; text-align: left; height: 10px"><span onMouseOver="this.title = \''+Element('cc_send_mail').value+' => '+'\'+document.getElementById(\''+id + ':cc_name\').innerHTML" id="' + id + ':cc_mail"></span></td>' + 2187 '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_phone"></span></td>' + 2188 //Para exibir o setor/lotacao do empregado na tabela 2189 '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_department"></span></td>' + 2190 // '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_mobile"></span></td>' + 2191 '<td style="solid #999; font-weight: normal; font-size: 10px; text-align: left; height: 10px"><span onMouseOver="this.title = \''+Element('cc_send_mail').value+' => '+'\'+document.getElementById(\''+id + ':cc_name\').innerHTML" id="' + id + ':cc_mail"></span></td>' + 2174 '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_phone"></span></td>' + 2192 2175 ( ccTree.catalog_perms == 1 ? 2193 2176 '<td align="left"><span valign="bottom" id="' + id + ':cc_icon_data"></span></td>':'') + … … 2201 2184 '<span id="' + id + ':cc_title" style="display:none"></span>' + 2202 2185 '<span id="' + id + ':cc_alias" style="display:none"></span>' + 2203 // Esse campo ï¿œ necessï¿œrio se o contato possui dados no campo cc_company2186 // Esse campo é necessário se o contato possui dados no campo cc_company 2204 2187 '<span id="' + id + ':cc_company" style="display:none"></span>' + 2205 2188 '</td></tr>'; … … 2214 2197 ' | '+ 2215 2198 '<img title="'+Element('cc_msg_group_remove').value+'" id="' + id + ':cc_card_remove" style="width: 15px; height: 14px; cursor: pointer; cursor: hand; z-index: 1" onclick="removeEntry(Element(\'' + id + ':cc_id\').value,\'groups\');" src="templates/default/images/cc_x.png">' + 2216 '<input id="' + id + ':cc_id" type="hidden">'+ 2199 '<input id="' + id + ':cc_id" type="hidden">'+ 2217 2200 '</td></tr>'; 2218 2201 } … … 2224 2207 { 2225 2208 var pos; 2226 2209 2227 2210 html_cards = '<div id="divScrollMain" style="overflow:auto;z-index:1"><table width="100%" border="0" cellpadding="0" cellspacing="3">'; 2228 2211 2229 2212 if (ncards > 0) 2230 2213 { … … 2246 2229 if((ccTree.catalog_perms & 2) && type != 'groups') 2247 2230 html_cards += '<tr><td colspan=4 align="right"><button id="cc_button_tools" value="" type="button" onclick="javascript:removeAllEntries()">Remover Todos</button></td></tr>'; 2248 } 2231 } 2249 2232 else if (CC_max_cards != 0) 2250 2233 { … … 2266 2249 html_cards = '<div id="divScrollMain" style="overflow:auto;z-index:1">'; 2267 2250 html_cards += '<table border="0" cellpadding="0" cellspacing="' + CC_card_extra + '">'; 2268 2251 2269 2252 if (ncards > 0) 2270 2253 { … … 2285 2268 if((ccTree.catalog_perms & 2) && type != 'groups') 2286 2269 html_cards += '<tr><td colspan=3 align="right"><button id="cc_button_tools" value="" type="button" onclick="javascript:removeAllEntries()">Remover Todos</button></td></tr>'; 2287 } 2270 } 2288 2271 else if (CC_max_cards != 0) 2289 2272 { … … 2322 2305 else if(CC_visual == 'table') 2323 2306 drawTable(0); 2324 2307 2325 2308 setPages(0,0); 2326 2309 return; … … 2332 2315 data = unserialize(responseText); 2333 2316 if (data[0] == '0') 2334 { 2335 Element('cc_type_contact').value = data[1]; 2317 { 2318 Element('cc_type_contact').value = data[1]; 2336 2319 CC_npages = 0; 2337 2320 CC_actual_page = 1; … … 2345 2328 else 2346 2329 Element('cc_type_contact').value = data[10]; 2347 2348 // Element('cc_debug').innerHTML = responseText; 2349 2330 2331 // Element('cc_debug').innerHTML = responseText; 2332 2350 2333 if (typeof(data) != 'object') 2351 2334 { … … 2353 2336 return; 2354 2337 } 2355 2338 2356 2339 if (typeof(data[3]) == 'object') 2357 2340 { 2358 2341 CC_npages = parseInt(data[0]); 2359 CC_actual_page = parseInt(data[1]); 2342 CC_actual_page = parseInt(data[1]); 2360 2343 if(CC_visual == 'cards') 2361 2344 drawCards(data[3].length, data[10]); … … 2365 2348 populateCards(data, data[10]); 2366 2349 setPages(data[0], data[1]); 2367 2368 } 2369 else if (data['error']) 2370 { 2371 showMessage(data['error']); 2350 2372 2351 } 2373 2352 else … … 2381 2360 Connector.newRequest('showCards', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_cards_data', 'POST', handler, info); 2382 2361 } 2383 2384 2362 2385 2363 function clearCards() … … 2406 2384 var table_h = Element('cc_panel_table'); 2407 2385 var cards_h = Element('cc_panel_cards'); 2408 2386 2409 2387 switch (type) 2410 2388 { … … 2419 2397 break; 2420 2398 } 2421 2399 2422 2400 CC_visual = type; 2423 2401 showCards(getActualLetter(), getActualPage()); 2424 2402 } 2425 2403 2426 /*function ccSearchUpdate(ids)2404 function ccSearchUpdate(ids) 2427 2405 { 2428 2406 Element('cc_panel_letters').style.display = 'none'; 2429 2407 Element('cc_panel_search').style.display = 'inline'; 2430 2408 2431 2409 if(CC_visual == 'cards') 2432 2410 drawCards(0); … … 2436 2414 if (!ids) 2437 2415 { 2438 //ccSearchHide();2416 ccSearchHide(); 2439 2417 return; 2440 2418 } 2441 2419 2442 2420 var sIds = serialize(ids); 2443 2421 … … 2447 2425 } 2448 2426 showCards('search', '1', sIds); 2449 }2450 */2451 2452 function ccSearchUpdate()2453 {2454 Element('cc_panel_letters').style.display = 'none';2455 Element('cc_panel_search').style.display = 'inline';2456 2457 if(CC_visual == 'cards')2458 drawCards(0);2459 else if(CC_visual == 'table')2460 drawTable(0);2461 2462 if (CC_actual_letter != 'search')2463 {2464 CC_last_letter = CC_actual_letter;2465 }2466 //showCards('search', '1', sIds);2467 2427 } 2468 2428 … … 2507 2467 data[3] = Element('cc_qa_phone').value; 2508 2468 data[4] = Element('cc_qa_email').value; 2509 2469 2510 2470 return data; 2511 2471 } … … 2514 2474 { 2515 2475 var data = getQuickAdd(); 2516 2476 2517 2477 var str = serialize(data); 2518 2478 … … 2532 2492 } 2533 2493 2534 2535 2494 function connectVoip (phoneUser, typePhone){ 2536 2495 var handler_voip = function (responseText){
Note: See TracChangeset
for help on using the changeset viewer.