Changeset 284 for trunk/contactcenter/js/cc.js
- Timestamp:
- 05/21/08 16:56:17 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/contactcenter/js/cc.js
r258 r284 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 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 } 313 318 } 314 319 315 320 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++) { 319 324 option = document.createElement('option'); 320 325 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']+')'; 322 327 Element('contact_in_list').options[Element('contact_in_list').options.length] = option; 323 328 } 324 } 325 329 } 330 326 331 Element('title').value = data['title']; 327 332 } 328 333 329 334 if (typeof(data) != 'object' || data['result'] != 'ok') 330 335 { … … 333 338 } 334 339 }; 335 340 336 341 id = typeof(id) == 'undefined' ? id = 0 : id; 337 338 ccAddGroup.clear(true); 342 343 ccAddGroup.clear(true); 339 344 Connector.newRequest('populateEditGroup', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_group&id='+id, 'GET', handler); 340 345 } … … 371 376 return false; 372 377 } 373 378 374 379 /* First thing: Send Photo */ 375 380 if (Element('cc_pd_select_photo').value != '' && !is_ie) … … 389 394 frame = old_frame; 390 395 } 391 396 392 397 frame.id = 'cc_photo_frame'; 393 398 frame.style.visibility = 'hidden'; … … 398 403 399 404 form = frame.contentDocument.createElement('form'); 400 405 401 406 var id_contact = Element('cc_full_add_contact_id').value; 402 407 form.id = 'cc_form_photo'; … … 404 409 form.enctype = 'multipart/form-data'; 405 410 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 407 412 var input_clone = Element('cc_pd_select_photo').cloneNode(false); 408 413 form.appendChild(input_clone); 409 414 410 415 frame.contentDocument.body.appendChild(form); 411 416 form.submit(); … … 461 466 var empty = true; 462 467 var replacer = '__##AND##__'; 463 468 464 469 data['commercialAnd'] = replacer; 465 470 466 471 if (Element('cc_full_add_contact_id').value != '' && Element('cc_full_add_contact_id').value != 'null') 467 472 { … … 472 477 /* Status: Full Added */ 473 478 data['id_status'] = CC_STATUS_FULL_ADD; 474 479 475 480 /* Personal Data */ 476 481 data['alias'] = replaceComAnd(Element('cc_pd_alias').value, replacer); … … 510 515 data['connections'] = new Array(); 511 516 } 512 517 513 518 for (var i in CC_contact_full_info['connections'][type]) 514 519 { … … 522 527 data['connections']['connection'+connNumber] = new Array(5); 523 528 } 524 529 525 530 data['connections']['connection'+connNumber]['id_connection'] = CC_contact_full_info['connections'][type][i]['id']; 526 531 data['connections']['connection'+connNumber]['id_typeof_connection'] = type; … … 531 536 data['connections']['connection'+connNumber]['connection_is_default'] = 'TRUE'; 532 537 } 533 else 538 else 534 539 data['connections']['connection'+connNumber]['connection_is_default'] = 'FALSE'; 535 540 } 536 541 537 542 // data['connections']['connection'+connNumber].length = 5; 538 543 539 544 empty = false; 540 545 connNumber++; … … 543 548 544 549 } 545 550 546 551 if (!empty) 547 552 { … … 550 555 } 551 556 } 552 557 553 558 if (CC_contact_full_info['removed_conns']) 554 559 { 555 560 empty = false; 556 561 557 562 if (typeof(data['connections']) != 'object') 558 563 { … … 589 594 for (var i in CC_contact_full_info['connections'][type]){ 590 595 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'); 593 598 return false; 594 599 } … … 596 601 var _options_default = Element("cc_"+(type == 1 ? 'email' : 'phone')+"_default"); 597 602 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!"); 599 604 return false; 600 605 } 601 606 } 602 607 603 608 } 604 609 … … 609 614 610 615 /********* Personal Data Functions *********/ 611 /* 616 /* 612 617 * data[0] => cc_pd_select_photo 613 618 * data[1] => cc_pd_alias … … 657 662 { 658 663 Element('cc_addr_types').selectedIndex = 0; 659 664 660 665 Element('cc_addr_countries').selectedIndex = 0; 661 666 Element('cc_addr_countries').disabled = true; 662 667 663 668 Element('cc_addr_states').selectedIndex = 0; 664 669 Element('cc_addr_states').disabled = true; … … 711 716 var type = Element('cc_addr_types'); 712 717 var oldSelected = type.value; 713 718 714 719 saveAddressFields(); 715 720 716 721 if (oldSelected == '_NONE_') 717 722 { … … 719 724 return true; 720 725 } 721 726 722 727 CC_addr_last_selected = type.selectedIndex; 723 728 724 729 Element('cc_addr_countries').disabled = false; 725 730 726 731 var data = CC_contact_full_info['addresses']; 727 732 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') 730 735 { 731 736 resetAddressFields(); … … 736 741 return true; 737 742 } 738 743 739 744 var addrTypeID = Element('cc_addr_types').value; 740 745 741 746 data = CC_contact_full_info['addresses'][addrIndex]; 742 747 743 748 Element('cc_addr_id').value = data['id_address'] ? data['id_address'] : ''; 744 749 Element('cc_addr_1').value = data['address1'] ? data['address1'] : ''; … … 762 767 states.selectedIndex = 0; 763 768 clearSelectBox(states, 4); 764 updateAddrCities(); 769 updateAddrCities(); 765 770 return; 766 771 } … … 777 782 { 778 783 var data = unserialize(responseText); 779 784 780 785 clearSelectBox(states, 1); 781 786 782 787 if (typeof(data) != 'object') 783 788 { 784 789 showMessage(Element('cc_msg_err_contacting_server').value); 785 790 786 791 return; 787 792 } … … 790 795 { 791 796 states.disabled = true; 792 cities.disabled = true; 797 cities.disabled = true; 793 798 states.selectedIndex = 0; 794 799 cities.selectedIndex = 0; … … 830 835 } 831 836 }; 832 837 833 838 Connector.newRequest('populateStates', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_states&country='+Element('cc_addr_countries').value, 'GET', handler); 834 839 } … … 858 863 newState.disabled = false; 859 864 updateAddrNewStateOnMouseOut(); 860 865 861 866 cities.disabled = false; 862 867 clearSelectBox(cities, 3); … … 869 874 case '_NOSTATE_': 870 875 clearSelectBox(cities, 3); 871 876 872 877 cities.disabled = false; 873 878 cities.selectedIndex = 0; 874 879 875 880 requestStr = 'country='+Element('cc_addr_countries').value; 876 881 break; 877 882 878 883 default: 879 884 requestStr = 'country='+Element('cc_addr_countries').value+'&state='+states.value; … … 890 895 { 891 896 var cities = Element('cc_addr_cities'); 892 897 893 898 var handler = function (responseText) 894 899 { 895 900 var data = unserialize(responseText); 896 901 897 902 clearSelectBox(cities, 1); 898 903 899 904 if (typeof(data) != 'object') 900 905 { 901 906 showMessage(Element('cc_msg_err_contacting_server').value); 902 907 903 908 return; 904 909 } … … 945 950 } 946 951 }; 947 952 948 953 Connector.newRequest('populateCities', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_cities&'+requestStr, 'GET', handler); 949 954 } … … 951 956 function updateAddrNewStateOnMouseOver () 952 957 { 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) 954 959 { 955 960 Element('cc_addr_states_new').value = ''; … … 959 964 function updateAddrNewStateOnMouseOut () 960 965 { 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) 962 967 { 963 968 Element('cc_addr_states_new').value = Element('cc_msg_type_state').value; … … 979 984 return; 980 985 } 981 986 982 987 Element('cc_addr_1').readonly = false; 983 988 Element('cc_addr_1').disabled = false; … … 1009 1014 1010 1015 //resetAddrFillingFields(); 1011 1016 1012 1017 return; 1013 1018 … … 1017 1022 newCity.disabled = false; 1018 1023 updateAddrNewCityOnMouseOut(); 1019 1024 1020 1025 break; 1021 1026 … … 1031 1036 function updateAddrNewCityOnMouseOver () 1032 1037 { 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) 1034 1039 { 1035 1040 Element('cc_addr_cities_new').value = ''; … … 1039 1044 function updateAddrNewCityOnMouseOut () 1040 1045 { 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) 1042 1047 { 1043 1048 Element('cc_addr_cities_new').value = Element('cc_msg_type_city').value; … … 1053 1058 return true; 1054 1059 } 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', 1059 1064 'cc_addr_other', 1060 'cc_addr_postal_code', 1065 'cc_addr_postal_code', 1061 1066 'cc_addr_po_box', 1062 1067 'cc_addr_countries', … … 1065 1070 1066 1071 var empty = true; 1067 1072 1068 1073 for (var i = 0; i < 8; i++) 1069 1074 { … … 1074 1079 } 1075 1080 } 1076 1081 1077 1082 if (empty) 1078 1083 { … … 1103 1108 default: 1104 1109 addrInfo['id_country'] = Element('cc_addr_countries').value; 1105 1110 1106 1111 } 1107 1112 … … 1117 1122 default: 1118 1123 addrInfo['id_state'] = Element('cc_addr_states').value; 1119 1124 1120 1125 } 1121 1126 … … 1130 1135 default: 1131 1136 addrInfo['id_city'] = Element('cc_addr_cities').value; 1132 1133 } 1137 1138 } 1134 1139 1135 1140 addrInfo['id_typeof_address'] = Element('cc_addr_types').options[lastIndex].value; … … 1144 1149 CC_contact_full_info['addresses']['address'+Element('cc_addr_types').options[lastIndex].value] = addrInfo; 1145 1150 1146 if (Element('cc_addr_cities').value == '_NEW_' && 1151 if (Element('cc_addr_cities').value == '_NEW_' && 1147 1152 Element('cc_msg_type_city').value != Element('cc_addr_cities_new').value && 1148 1153 Element('cc_addr_cities_new').value != '') 1149 1154 { 1150 1155 var addrRootInfo = CC_contact_full_info['addresses']['new_cities']; 1151 1156 1152 1157 if (!addrRootInfo) 1153 1158 { 1154 1159 addrRootInfo = new Array(); 1155 1160 } 1156 1161 1157 1162 var i = addrRootInfo.length; 1158 1163 addrRootInfo[addrInfo['id_typeof_address']] = new Array(); … … 1163 1168 } 1164 1169 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 && 1167 1172 Element('cc_addr_states_new').value != '') 1168 1173 { 1169 1174 var addrRootInfo = CC_contact_full_info['addresses']['new_states']; 1170 1175 1171 1176 if (!addrRootInfo) 1172 1177 { 1173 1178 addrRootInfo = new Array(); 1174 1179 } 1175 1180 1176 1181 var i = addrRootInfo.length; 1177 1182 addrRootInfo[addrInfo['id_typeof_address']] = new Array(); … … 1203 1208 for(idx_conn; idx_conn < cc_conn_default.options.length; idx_conn++) 1204 1209 if(cc_conn_default.options[idx_conn].value == _label) 1205 break; 1206 1210 break; 1211 1207 1212 if(idx_conn == cc_conn_default.options.length) 1208 1213 cc_conn_default.options[idx_conn] = new Option (_label,_label, false,false); 1209 1214 1210 1215 if (!document.all) 1211 1216 { 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>'; 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 } 1217 1233 } 1218 1234 else … … 1238 1254 img.align = 'top'; 1239 1255 img.onclick = function(e){ removeConnField(remove_id);}; 1240 1256 1241 1257 for (var i = 0; i < 3; i++) 1242 1258 { … … 1249 1265 1250 1266 inputs[1].id = 'cc_conn_name_'+CC_conn_count; 1251 inputs[1].type = 'hidden'; 1267 inputs[1].type = 'hidden'; 1252 1268 1253 1269 inputs[2].id = 'cc_conn_value_'+CC_conn_count; … … 1278 1294 || typeof(CC_contact_full_info['connections'][CC_conn_last_selected]) == 'undefined' 1279 1295 || typeof(CC_contact_full_info['connections'][CC_conn_last_selected][CC_conn_count]) == 'undefined'); 1280 1281 if(_emptyLine) { 1282 1296 1297 if(_emptyLine) { 1298 1283 1299 if(Element("cc_conn_type_sel").value == '-1'){ 1284 return false; 1285 } 1286 1300 return false; 1301 } 1302 1287 1303 for(k = 0; k < CC_conn_count; k++) { 1288 1304 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; 1291 1307 return false; 1292 1308 } 1293 1309 } 1294 } 1310 } 1295 1311 if (!document.all) 1296 1312 { … … 1319 1335 1320 1336 function connRemoveLine(id) 1321 { 1337 { 1322 1338 var p = Element(id).parentNode; 1323 1339 var cc_conn_default = Element("cc_phone_default").style.display == '' ? Element("cc_phone_default") : Element("cc_email_default"); … … 1358 1374 } 1359 1375 } 1360 1376 1361 1377 CC_conn_count = 0; 1362 1378 } … … 1380 1396 function updateConnFields() 1381 1397 { 1382 1398 1383 1399 var connID; 1384 1400 var i; … … 1389 1405 var cc_conn_is_default = ''; 1390 1406 var selected_index = ''; 1391 1407 1392 1408 cc_conn_type_sel.disabled = false; 1393 1409 div_cc_conn_is_default.style.display = ""; 1394 1410 1395 1411 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 1398 1414 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'); 1405 1418 connID = 1; 1406 1419 selected_index = cc_email_default.options.selectedIndex; … … 1409 1422 } 1410 1423 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 1413 1426 cc_phone_default.style.display = 'none'; 1414 cc_email_default.style.display = ''; 1427 cc_email_default.style.display = ''; 1415 1428 cc_conn_is_default = cc_email_default; 1416 1429 } 1417 1430 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'); 1431 1437 connID = 2; 1432 1438 selected_index = cc_phone_default.options.selectedIndex; … … 1435 1441 } 1436 1442 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'); 1439 1444 cc_email_default.style.display = 'none'; 1440 1445 cc_phone_default.style.display = ''; 1441 1446 cc_conn_is_default = cc_phone_default; 1442 1447 } 1443 1448 1444 1449 Element("cc_conn_type_sel").options.selectedIndex = 0; 1445 1450 /* First save the data */ … … 1447 1452 1448 1453 CC_conn_last_selected = connID; 1449 1454 1450 1455 clearConn(); 1451 1456 1452 1457 if (connID == '_NONE_') 1453 1458 { cc_conn_is_default.disabled = true; 1454 1459 return; 1455 1460 } 1456 1461 1457 1462 /* If no data already available, return */ 1458 1463 if (!CC_contact_full_info['connections']) … … 1478 1483 } 1479 1484 } 1480 } 1485 } 1481 1486 if(cc_conn_is_default.options.length > selected_index) 1482 1487 cc_conn_is_default.options.selectedIndex = (selected_index == "-1" ? 0 : selected_index); … … 1499 1504 CC_contact_full_info['connections'][CC_conn_last_selected] = new Array(); 1500 1505 } 1501 else 1506 else 1502 1507 { 1503 1508 delete CC_contact_full_info['connections'][CC_conn_last_selected]; … … 1511 1516 var subNodes = nodes[i].childNodes; 1512 1517 var found = false; 1513 1518 1514 1519 for (var j = 0; j < subNodes.length; j++) 1515 1520 { 1516 if (subNodes[j].childNodes.length > 0 && 1521 if (subNodes[j].childNodes.length > 0 && 1517 1522 subNodes[j].childNodes[0].id) 1518 1523 { … … 1522 1527 CC_contact_full_info['connections'][CC_conn_last_selected][k] = new Array(); 1523 1528 } 1524 1529 1525 1530 if (subNodes[j].childNodes[0].id.indexOf('cc_conn_name') != -1) 1526 1531 { … … 1542 1547 else 1543 1548 { 1544 CC_contact_full_info['connections'][CC_conn_last_selected][k]['value'] = ''; 1549 CC_contact_full_info['connections'][CC_conn_last_selected][k]['value'] = ''; 1545 1550 } 1546 1551 } … … 1553 1558 } 1554 1559 } 1555 1560 1556 1561 if (found) 1557 1562 { … … 1570 1575 delete CC_contact_full_info['connections'][CC_conn_last_selected]; 1571 1576 } 1572 1577 1573 1578 } 1574 1579 … … 1596 1601 var number = randomString().toLowerCase(); 1597 1602 var result = ''; 1598 1603 1599 1604 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); 1601 1606 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,""); 1603 1608 1604 1609 if(result) { … … 1606 1611 Connector.newRequest('removeAllEntries', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=remove_all_entries', 'GET', handler); 1607 1612 else 1608 alert('C ódigo Incorreto');1609 } 1613 alert('Cï¿œdigo Incorreto'); 1614 } 1610 1615 } 1611 1616 … … 1618 1623 return; 1619 1624 } 1620 1625 1621 1626 var handler = function (responseText) 1622 1627 { … … 1628 1633 return; 1629 1634 } 1630 1635 1631 1636 if (data['status'] != 'ok') 1632 1637 { … … 1634 1639 return; 1635 1640 } 1636 1641 1637 1642 setTimeout('updateCards()',80);; 1638 1643 }; 1639 1644 1640 1645 typeArg = (type == 'groups' ? 'group' : 'entry'); 1641 1646 1642 1647 Connector.newRequest('removeEntry', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=remove_'+typeArg+'&remove=' + id, 'GET', handler); 1643 1648 } … … 1662 1667 var w_height = 0; 1663 1668 var w_extra = 200; 1664 1669 1665 1670 if (document.body.clientHeight) 1666 1671 { … … 1691 1696 Element('cc_letter_' + i).className = 'letter_box'; 1692 1697 } 1698 } 1699 } 1700 1701 function clearLetterSelection() 1702 { 1703 for (var i = 0; i < 28; i++) 1704 { 1705 Element('cc_letter_' + i).className = 'letter_box'; 1693 1706 } 1694 1707 } … … 1758 1771 final_page = 1; 1759 1772 } 1760 1773 1761 1774 html_pages += '<a href="javascript:setPages('+npages+', '+ actual_page +', '+ final_page +')">...</a> '; 1762 1775 1763 1776 page = showing_page ? showing_page : actual_page; 1764 1777 } 1765 1778 1766 1779 for (; page <= npages; page++) 1767 1780 { … … 1823 1836 Element('cc_panel_arrow_last').style.cursor = 'hand'; 1824 1837 } 1825 1838 1826 1839 Element('cc_panel_pages').innerHTML = html_pages; 1827 1840 } … … 1829 1842 function populateCards(data, type) 1830 1843 { 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 1840 1845 if(type == 'groups') 1841 1846 return populateGroupsInCards(data); 1842 1847 1843 1848 var pos = 0; 1844 1849 var ncards = data[3].length; 1845 1850 1846 1851 if (typeof(data[3]) == 'object' && ncards > 0) 1847 1852 { … … 1851 1856 { 1852 1857 id = 'cc_card:'+j+':'+i; 1853 1858 1854 1859 for (var k = 0; k < data[2].length; k++) 1855 1860 { … … 1858 1863 Element(id).style.display = 'none'; 1859 1864 continue; 1860 } 1861 1865 } 1866 1862 1867 if(data[3][pos][k] != 'none') 1863 1868 { … … 1875 1880 } 1876 1881 break; 1877 1882 1878 1883 case 'cc_mail': 1879 1880 1884 if (data[3][pos][k].length > (CC_visual == 'table' ? 50 : 20)) 1881 1885 { … … 1885 1889 else 1886 1890 { 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>'; 1888 1892 } 1889 1893 break; 1890 1894 1891 1895 case 'cc_phone': 1892 1896 if (data[3][pos][k].length > 20) … … 1919 1923 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] : ''); 1920 1924 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>'; 1922 1926 break; 1923 1927 1924 1928 case 'cc_forwarding_address': 1925 1929 var contacts = data[3][pos][k]; 1926 1930 1927 1931 if( !contacts) 1928 1932 break; 1929 1933 1930 1934 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 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]; 1931 1962 break; 1932 1963 … … 1939 1970 else 1940 1971 { 1972 if (Element(id+':'+data[2][k]) == null) alert('ï¿œ nulovgdfv'); 1941 1973 Element(id+':'+data[2][k]).innerHTML = data[3][pos][k]; 1942 1974 } … … 1944 1976 } 1945 1977 } 1946 1978 1947 1979 if (--ncards == 0) 1948 1980 { … … 1950 1982 i = CC_max_cards[1]; 1951 1983 } 1952 1984 1953 1985 pos++; 1954 1986 } … … 1958 1990 1959 1991 function populateGroupsInCards(data) 1960 { 1992 { 1961 1993 var pos = 0; 1962 var contacts = data[5]; 1994 var contacts = data[5]; 1963 1995 var ncards = data[3].length; 1964 1996 1965 1997 if (typeof(data[3]) == 'object' && ncards > 0) 1966 1998 { … … 1970 2002 { 1971 2003 id = 'cc_card:'+j+':'+i; 1972 2004 1973 2005 for (var k = 0; k < data[2].length; k++) 1974 2006 { 1975 2007 1976 2008 if(data[3][pos][k] != 'none') 1977 { 1978 2009 { 2010 1979 2011 switch (data[2][k]) 1980 { 2012 { 1981 2013 case 'cc_title': 1982 2014 if (data[3][pos][k].length > 50) … … 1990 2022 } 1991 2023 break; 1992 2024 1993 2025 case 'cc_short_name': 1994 2026 if (data[3][pos][k].length > (CC_visual == 'table' ? 50 : 20)) … … 2002 2034 } 2003 2035 break; 2004 2036 2005 2037 case 'cc_contacts': 2006 2038 … … 2011 2043 var email = ""; 2012 2044 2013 for (var d = 0; d < contacts.length; d++) { 2045 for (var d = 0; d < contacts.length; d++) { 2014 2046 contact += contacts[d]['names_ordered']+ ","; 2015 2047 email += contacts[d]['connection_value']+","; 2016 2048 } 2017 2049 2018 2050 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>'; 2019 2051 2020 2052 break; 2021 2053 2022 2054 case 'cc_id': 2023 2055 var id_contact = data[3][pos][k]; 2024 2056 Element(id+':'+data[2][k]).value = data[3][pos][k]; 2025 2057 2026 2058 break; 2027 2059 2028 2060 } 2029 2061 } 2030 2062 } 2031 2063 2032 2064 if (--ncards == 0) 2033 2065 { … … 2035 2067 i = CC_max_cards[1]; 2036 2068 } 2037 2069 2038 2070 pos++; 2039 2071 } … … 2064 2096 }; 2065 2097 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'); 2067 2099 } 2068 2100 … … 2070 2102 { 2071 2103 var coord = new Array(); 2072 2104 2073 2105 //Element('cc_card_space').innerHTML = ''; 2074 2106 //return; … … 2077 2109 //card_space_width = parseInt(is_ie ? document.body.offsetWidth : window.innerWidth) - parseInt(Element('cc_left').offsetWidth) - parseInt(CC_card_extra) - 40; 2078 2110 card_space_height = parseInt(Element('cc_card_space').offsetHeight) - parseInt(CC_card_extra); 2079 2111 2080 2112 card_width = CC_card_image_width + CC_card_extra; 2081 2113 card_height = CC_card_image_height + CC_card_extra; … … 2083 2115 ncols = parseInt(card_space_width / card_width); 2084 2116 nlines = parseInt(card_space_height / card_height); 2085 2117 2086 2118 coord[0] = ncols; 2087 2119 //coord[1] = nlines; … … 2097 2129 { 2098 2130 if(type != 'groups') { 2099 2131 2100 2132 html_card = '<td id="' + id + '" style="width: ' + CC_card_image_width + 'px; height: ' + CC_card_image_height + '">' + 2101 2133 '<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);">' + 2103 2135 ( ccTree.catalog_perms == 1 ? 2104 2136 '<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>':'') + … … 2106 2138 '<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">' + 2107 2139 '<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);">' + 2109 2141 '<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"> </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"> </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>' + 2116 2152 '<input id="' + id + ':cc_id" type="hidden">' + 2117 2153 '</div>' + '</td>'; 2118 2154 2119 2155 } else { 2120 2156 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;">' + 2122 2158 '<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);">' + 2123 2159 '<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">' + 2125 2161 '<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>' + 2126 2162 '<span id="' + id + ':cc_participantes" style="cursor: pointer; cursor: hand; z-index: 1;position: absolute; top: 15px; left: 15px"></span>' + … … 2129 2165 '</div>' + '</td>'; 2130 2166 } 2131 2167 2132 2168 2133 2169 return html_card; … … 2141 2177 else 2142 2178 bg = "this.style.background=\'#EEEEEE\'"; 2143 2179 2144 2180 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"> </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"> </span><span id="' + id + ':cc_name"></span></td>' + 2148 2186 '<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>' + 2150 2192 ( ccTree.catalog_perms == 1 ? 2151 2193 '<td align="left"><span valign="bottom" id="' + id + ':cc_icon_data"></span></td>':'') + … … 2156 2198 '<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">' : '') + 2157 2199 '<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>' + 2161 2205 '</td></tr>'; 2162 2206 } … … 2170 2214 ' | '+ 2171 2215 '<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">'+ 2173 2217 '</td></tr>'; 2174 2218 } … … 2180 2224 { 2181 2225 var pos; 2182 2226 2183 2227 html_cards = '<div id="divScrollMain" style="overflow:auto;z-index:1"><table width="100%" border="0" cellpadding="0" cellspacing="3">'; 2184 2228 2185 2229 if (ncards > 0) 2186 2230 { … … 2202 2246 if((ccTree.catalog_perms & 2) && type != 'groups') 2203 2247 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 } 2205 2249 else if (CC_max_cards != 0) 2206 2250 { … … 2222 2266 html_cards = '<div id="divScrollMain" style="overflow:auto;z-index:1">'; 2223 2267 html_cards += '<table border="0" cellpadding="0" cellspacing="' + CC_card_extra + '">'; 2224 2268 2225 2269 if (ncards > 0) 2226 2270 { … … 2241 2285 if((ccTree.catalog_perms & 2) && type != 'groups') 2242 2286 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 } 2244 2288 else if (CC_max_cards != 0) 2245 2289 { … … 2278 2322 else if(CC_visual == 'table') 2279 2323 drawTable(0); 2280 2324 2281 2325 setPages(0,0); 2282 2326 return; … … 2288 2332 data = unserialize(responseText); 2289 2333 if (data[0] == '0') 2290 { 2291 Element('cc_type_contact').value = data[1]; 2334 { 2335 Element('cc_type_contact').value = data[1]; 2292 2336 CC_npages = 0; 2293 2337 CC_actual_page = 1; … … 2301 2345 else 2302 2346 Element('cc_type_contact').value = data[10]; 2303 2304 // Element('cc_debug').innerHTML = responseText; 2305 2347 2348 // Element('cc_debug').innerHTML = responseText; 2349 2306 2350 if (typeof(data) != 'object') 2307 2351 { … … 2309 2353 return; 2310 2354 } 2311 2355 2312 2356 if (typeof(data[3]) == 'object') 2313 2357 { 2314 2358 CC_npages = parseInt(data[0]); 2315 CC_actual_page = parseInt(data[1]); 2359 CC_actual_page = parseInt(data[1]); 2316 2360 if(CC_visual == 'cards') 2317 2361 drawCards(data[3].length, data[10]); … … 2321 2365 populateCards(data, data[10]); 2322 2366 setPages(data[0], data[1]); 2323 2367 2368 } 2369 else if (data['error']) 2370 { 2371 showMessage(data['error']); 2324 2372 } 2325 2373 else … … 2332 2380 var info = "letter="+letter+"&page="+CC_actual_page+"&ids="+ids; 2333 2381 Connector.newRequest('showCards', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_cards_data', 'POST', handler, info); 2382 } 2383 2384 2385 function 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; 2334 2398 } 2335 2399 … … 2342 2406 var table_h = Element('cc_panel_table'); 2343 2407 var cards_h = Element('cc_panel_cards'); 2344 2408 2345 2409 switch (type) 2346 2410 { … … 2355 2419 break; 2356 2420 } 2357 2421 2358 2422 CC_visual = type; 2359 2423 showCards(getActualLetter(), getActualPage()); 2360 2424 } 2361 2425 2362 function ccSearchUpdate(ids)2426 /*function ccSearchUpdate(ids) 2363 2427 { 2364 2428 Element('cc_panel_letters').style.display = 'none'; 2365 2429 Element('cc_panel_search').style.display = 'inline'; 2366 2430 2367 2431 if(CC_visual == 'cards') 2368 2432 drawCards(0); … … 2375 2439 return; 2376 2440 } 2377 2441 2378 2442 var sIds = serialize(ids); 2379 2443 … … 2383 2447 } 2384 2448 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); 2385 2467 } 2386 2468 … … 2399 2481 Element('cc_panel_search').style.display = 'none'; 2400 2482 Element('cc_panel_letters').style.display = 'inline'; 2401 showCards(CC_last_letter, '1'); 2483 clearCards(); 2484 //showCards(CC_last_letter, '1'); 2402 2485 } 2403 2486 … … 2424 2507 data[3] = Element('cc_qa_phone').value; 2425 2508 data[4] = Element('cc_qa_email').value; 2509 2510 return data; 2511 } 2512 2513 function 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 2426 2534 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 } 2535 function connectVoip (phoneUser, typePhone){ 2536 var handler_voip = function (responseText){ 2537 if(!responseText) { 2538 alert("Erro conectando servidor VoIP."); 2539 } 2540 else{ 2541 data = unserialize(responseText); 2542 alert("Requisitando chamada para o ramal: "+data); 2543 } 2544 } 2545 Connector.newRequest('voip', "../../expressoMail1_2/controller.php?action=expressoMail1_2.functions.callVoipconnect&to="+phoneUser+"&typePhone="+typePhone, 'POST', handler_voip); 2546 }
Note: See TracChangeset
for help on using the changeset viewer.