Changeset 1599 for trunk/contactcenter/js/cc.js
- Timestamp:
- 11/06/09 09:58:04 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/contactcenter/js/cc.js
r1517 r1599 61 61 var CC_full_add_const = false; 62 62 var CC_full_add_photo = false; 63 63 64 64 var CC_last_height = window.innerHeight; 65 65 var CC_last_width = window.innerWidth; … … 94 94 photo_input = photo_frame.contentDocument.createElement('input'); 95 95 } 96 96 97 97 photo_frame.id = 'cc_photo_frame'; 98 98 photo_frame.style.position = 'absolute'; … … 100 100 photo_frame.style.top = '600px'; 101 101 photo_frame.style.left = '0px'; 102 102 103 103 photo_form.id = 'cc_photo_form'; 104 104 photo_form.method = 'POST'; 105 105 photo_form.enctype = 'multipart/form-data'; 106 106 107 107 photo_input.id = 'cc_photo_input'; 108 108 photo_input.type = 'file'; 109 109 110 110 if (is_ie) 111 111 { … … 117 117 } 118 118 photo_form.appendChild(photo_input); 119 119 120 120 } 121 121 … … 125 125 var obj = Element(id); 126 126 var max = obj.options.length; 127 127 128 128 if (option == undefined) 129 129 { … … 165 165 function openFullAdd(){ 166 166 // Build the FullAdd Window. 167 if(!fullAddWin && !is_ie) 167 if(!fullAddWin && !is_ie) 168 168 __f(); 169 169 … … 172 172 fullAddWin.open(); 173 173 tabs._showTab('cc_contact_tab_0'); 174 Element("cc_conn_type_1").checked = false; 174 Element("cc_conn_type_1").checked = false; 175 175 Element("cc_conn_type_2").checked = false; 176 176 Element("cc_conn_type_sel").disabled = true; … … 243 243 /************ Edit Group *************/ 244 244 function editGroup(id){ 245 populateEditGroup(id); 245 populateEditGroup(id); 246 ccAddGroup.window.open(); 246 247 } 247 248 … … 253 254 Updates all the constant fields in the 254 255 full add window, like Prefixes, Suffixes, 255 Countries , Types and Shared catalogs256 Countries and Types 256 257 */ 257 258 … … 268 269 return; 269 270 } 270 271 271 272 if (typeof(data[3]) == 'object') 272 273 { … … 298 299 { 299 300 CC_full_add_const = false; 300 301 301 302 setTimeout('populateFullAddConstAsync()', 10); 302 303 } … … 306 307 var handler = function(responseText) 307 308 { 308 //Element('cc_debug').innerHTML = responseText; 309 //Element('cc_debug').innerHTML = responseText; 309 310 var data = unserialize(responseText); 310 311 var i = 1; 311 312 var j; 312 313 313 314 if (typeof(data) != 'object') 314 315 { … … 316 317 return; 317 318 } 318 319 319 320 /* Populate Prefixes */ 320 321 for (j in data[0]) … … 323 324 i++; 324 325 } 325 326 326 327 /* Populate Suffixes */ 327 328 i = 1; … … 345 346 { 346 347 Element('cc_addr_countries').options[i] = new Option(data[3][j], j); 347 348 348 349 if (j == 'BR' || j == 'br') 349 350 { 350 351 CC_br_index = i; 351 352 } 352 353 353 354 i++; 354 355 } 355 356 356 357 /* Populate Connection Types */ 357 358 i = 1; … … 361 362 i++; 362 363 } 363 364 364 365 /* Populate Relations Types */ 365 366 i = 0; … … 369 370 i++; 370 371 } 371 372 372 373 CC_full_add_const = true; 373 374 … … 397 398 //populateRelations(data['relations']); 398 399 }; 399 400 400 Connector.newRequest('populateFullEdit', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_full_data&id=' + id + "&catalog="+catalog, 'GET', handler); 401 401 } … … 416 416 select_contact_list += data['contact_list'] + "</select>"; 417 417 options_contact_list.innerHTML = select_contact_list; 418 419 if(data['id_group']) { 420 Element('title').value = data['title']; 418 419 if(data['id_group']) { 420 Element('title').value = data['title']; 421 421 if(data['contact_in_list']) { 422 422 for(i = 0; i < data['contact_in_list'].length; i++) { … … 425 425 option.text = data['contact_in_list'][i]['names_ordered']+' ('+data['contact_in_list'][i]['connection_value']+')'; 426 426 Element('contact_in_list').options[Element('contact_in_list').options.length] = option; 427 } 428 } 427 } 428 } 429 430 Element('title').value = data['title']; 429 431 } 430 432 … … 439 441 id = typeof(id) == 'undefined' ? id = 0 : id; 440 442 441 ccAddGroup.clear(true); 443 ccAddGroup.clear(true); 442 444 if(!shared) 443 445 Connector.newRequest('populateEditGroup', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_group&id='+id, 'GET', handler); … … 445 447 Connector.newRequest('populateEditGroup', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_group&id='+id+'&shared_from='+shared, 'GET', handler); 446 448 } 449 447 450 448 451 … … 478 481 return false; 479 482 } 480 483 481 484 /* First thing: Send Photo */ 482 485 if (Element('cc_pd_select_photo').value != '' && !is_ie) … … 496 499 frame = old_frame; 497 500 } 498 501 499 502 frame.id = 'cc_photo_frame'; 500 503 frame.style.visibility = 'hidden'; … … 505 508 506 509 form = frame.contentDocument.createElement('form'); 507 510 508 511 var id_contact = Element('cc_full_add_contact_id').value; 509 512 form.id = 'cc_form_photo'; … … 511 514 form.enctype = 'multipart/form-data'; 512 515 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 : ''); 513 516 514 517 var input_clone = Element('cc_pd_select_photo').cloneNode(false); 515 518 form.appendChild(input_clone); 516 519 517 520 frame.contentDocument.body.appendChild(form); 518 521 form.submit(); … … 535 538 } 536 539 if (Element('cc_contact_sharing').style.display == 'none') 537 540 setTimeout('postFullAddInfo()', 100); 538 541 else 539 542 setTimeout('postFullAddInfoShared()', 100); … … 561 564 updateCards(); 562 565 }; 566 563 567 Connector.newRequest('postFullAddInfo', CC_url+'post_full_add', 'POST', handler, getFullAddData()); 564 568 } … … 594 598 595 599 data['commercialAnd'] = replacer; 596 600 597 601 if (Element('cc_full_add_contact_id').value != '' && Element('cc_full_add_contact_id').value != 'null') 598 602 { … … 600 604 data.length++; 601 605 } 602 606 603 607 /* Owner do contato (Para o caso de adicao de contato compartilhado) */ 604 608 if (Element('cc_contact_sharing').style.display == 'block') 605 609 { 606 610 var index = Element('cc_contact_shared_types').selectedIndex; 607 data['owner'] = replaceComAnd(owners[index], replacer); 611 data['owner'] = replaceComAnd(owners[index], replacer); 608 612 data.length++; 609 613 } 610 614 611 615 /* Status: Full Added */ 612 616 data['id_status'] = CC_STATUS_FULL_ADD; 613 617 614 618 /* Personal Data */ 615 619 data['alias'] = replaceComAnd(Element('cc_pd_alias').value, replacer); … … 631 635 data['corporate_name'] = replaceComAnd(Element('cc_name_corporate').value, replacer); 632 636 data['job_title'] = replaceComAnd(Element('cc_job_title').value, replacer); 633 data['department'] = replaceComAnd(Element('cc_dep artment').value, replacer);637 data['department'] = replaceComAnd(Element('cc_dept').value, replacer); 634 638 data['web_page'] = replaceComAnd(Element('cc_web_page').value, replacer); 635 639 data.length += 18; 636 640 } 637 638 639 640 641 641 642 /* Addresses */ … … 660 661 data['connections'] = new Array(); 661 662 } 662 663 663 664 for (var i in CC_contact_full_info['connections'][type]) 664 665 { … … 672 673 data['connections']['connection'+connNumber] = new Array(5); 673 674 } 674 675 675 676 data['connections']['connection'+connNumber]['id_connection'] = CC_contact_full_info['connections'][type][i]['id']; 676 677 data['connections']['connection'+connNumber]['id_typeof_connection'] = type; … … 681 682 data['connections']['connection'+connNumber]['connection_is_default'] = 'TRUE'; 682 683 } 683 else 684 else 684 685 data['connections']['connection'+connNumber]['connection_is_default'] = 'FALSE'; 685 686 } 686 687 687 688 // data['connections']['connection'+connNumber].length = 5; 688 689 689 690 empty = false; 690 691 connNumber++; … … 693 694 694 695 } 695 696 696 697 if (!empty) 697 698 { … … 700 701 } 701 702 } 702 703 703 704 if (CC_contact_full_info['removed_conns']) 704 705 { 705 706 empty = false; 706 707 707 708 if (typeof(data['connections']) != 'object') 708 709 { … … 727 728 { 728 729 if (Element('cc_contact_shared_types').disabled == true) 729 { 730 { 730 731 showMessage('Nenhum catálogo compartilhado existente'); 731 732 return false; … … 737 738 } 738 739 } 739 740 740 741 /* Check Personal Data */ 742 741 743 if (Element('cc_pd_given_names').value == '') 742 744 { … … 756 758 for (var i in CC_contact_full_info['connections'][type]){ 757 759 if((CC_contact_full_info['connections'][type][i]['value'].length < 4) || 758 (!comp.test(CC_contact_full_info['connections'][type][i]['value']))){ 760 (!comp.test(CC_contact_full_info['connections'][type][i]['value']))){ 759 761 showMessage('Endereço para conexão de ' + CC_contact_full_info['connections'][type][i]['name'] + ', não é válido'); 760 762 return false; … … 767 769 } 768 770 } 769 771 770 772 } 771 773 … … 776 778 777 779 /********* Personal Data Functions *********/ 778 /* 780 /* 779 781 * data[0] => cc_pd_select_photo 780 782 * data[1] => cc_pd_alias … … 788 790 * data[9] => cc_pd_gpg_finger_print 789 791 * data[10] => cc_pd_notes 790 * data[11] => cc_name_corporate791 * data[12] => cc_job_title792 * data[13] => cc_department793 * data[14] => cc_we_page794 792 */ 795 793 … … 828 826 { 829 827 Element('cc_addr_types').selectedIndex = 0; 830 828 831 829 Element('cc_addr_countries').selectedIndex = 0; 832 830 Element('cc_addr_countries').disabled = true; 833 831 834 832 Element('cc_addr_states').selectedIndex = 0; 835 833 Element('cc_addr_states').disabled = true; … … 882 880 var type = Element('cc_addr_types'); 883 881 var oldSelected = type.value; 884 882 885 883 saveAddressFields(); 886 884 887 885 if (oldSelected == '_NONE_') 888 886 { … … 890 888 return true; 891 889 } 892 890 893 891 CC_addr_last_selected = type.selectedIndex; 894 892 895 893 Element('cc_addr_countries').disabled = false; 896 894 897 895 var data = CC_contact_full_info['addresses']; 898 896 var addrIndex = 'address'+Element('cc_addr_types').value; 899 900 if (typeof(data) != 'object' || typeof(data[addrIndex]) != 'object') 897 898 if (typeof(data) != 'object' || typeof(data[addrIndex]) != 'object') 901 899 { 902 900 resetAddressFields(); … … 907 905 return true; 908 906 } 909 907 910 908 var addrTypeID = Element('cc_addr_types').value; 911 909 912 910 data = CC_contact_full_info['addresses'][addrIndex]; 913 911 914 912 Element('cc_addr_id').value = data['id_address'] ? data['id_address'] : ''; 915 913 Element('cc_addr_1').value = data['address1'] ? data['address1'] : ''; … … 933 931 states.selectedIndex = 0; 934 932 clearSelectBox(states, 4); 935 updateAddrCities(); 933 updateAddrCities(); 936 934 return; 937 935 } … … 948 946 { 949 947 var data = unserialize(responseText); 950 948 951 949 clearSelectBox(states, 1); 952 950 953 951 if (typeof(data) != 'object') 954 952 { 955 953 showMessage(Element('cc_msg_err_contacting_server').value); 956 954 957 955 return; 958 956 } … … 961 959 { 962 960 states.disabled = true; 963 cities.disabled = true; 961 cities.disabled = true; 964 962 states.selectedIndex = 0; 965 963 cities.selectedIndex = 0; … … 1001 999 } 1002 1000 }; 1003 1001 1004 1002 Connector.newRequest('populateStates', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_states&country='+Element('cc_addr_countries').value, 'GET', handler); 1005 1003 } … … 1029 1027 newState.disabled = false; 1030 1028 updateAddrNewStateOnMouseOut(); 1031 1029 1032 1030 cities.disabled = false; 1033 1031 clearSelectBox(cities, 3); … … 1040 1038 case '_NOSTATE_': 1041 1039 clearSelectBox(cities, 3); 1042 1040 1043 1041 cities.disabled = false; 1044 1042 cities.selectedIndex = 0; 1045 1043 1046 1044 requestStr = 'country='+Element('cc_addr_countries').value; 1047 1045 break; 1048 1046 1049 1047 default: 1050 1048 requestStr = 'country='+Element('cc_addr_countries').value+'&state='+states.value; … … 1061 1059 { 1062 1060 var cities = Element('cc_addr_cities'); 1063 1061 1064 1062 var handler = function (responseText) 1065 1063 { 1066 1064 var data = unserialize(responseText); 1067 1065 1068 1066 clearSelectBox(cities, 1); 1069 1067 1070 1068 if (typeof(data) != 'object') 1071 1069 { 1072 1070 showMessage(Element('cc_msg_err_contacting_server').value); 1073 1071 1074 1072 return; 1075 1073 } … … 1116 1114 } 1117 1115 }; 1118 1116 1119 1117 Connector.newRequest('populateCities', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_cities&'+requestStr, 'GET', handler); 1120 1118 } … … 1122 1120 function updateAddrNewStateOnMouseOver () 1123 1121 { 1124 if (Element('cc_addr_states_new').value == Element('cc_msg_type_state').value && Element('cc_addr_states').selectedIndex == 1) 1122 if (Element('cc_addr_states_new').value == Element('cc_msg_type_state').value && Element('cc_addr_states').selectedIndex == 1) 1125 1123 { 1126 1124 Element('cc_addr_states_new').value = ''; … … 1130 1128 function updateAddrNewStateOnMouseOut () 1131 1129 { 1132 if (Element('cc_addr_states_new').value.length == 0 && Element('cc_addr_states').selectedIndex == 1) 1130 if (Element('cc_addr_states_new').value.length == 0 && Element('cc_addr_states').selectedIndex == 1) 1133 1131 { 1134 1132 Element('cc_addr_states_new').value = Element('cc_msg_type_state').value; … … 1150 1148 return; 1151 1149 } 1152 1150 1153 1151 Element('cc_addr_1').readonly = false; 1154 1152 Element('cc_addr_1').disabled = false; … … 1180 1178 1181 1179 //resetAddrFillingFields(); 1182 1180 1183 1181 return; 1184 1182 … … 1188 1186 newCity.disabled = false; 1189 1187 updateAddrNewCityOnMouseOut(); 1190 1188 1191 1189 break; 1192 1190 … … 1202 1200 function updateAddrNewCityOnMouseOver () 1203 1201 { 1204 if (Element('cc_addr_cities_new').value == Element('cc_msg_type_city').value && Element('cc_addr_cities').selectedIndex == 1) 1202 if (Element('cc_addr_cities_new').value == Element('cc_msg_type_city').value && Element('cc_addr_cities').selectedIndex == 1) 1205 1203 { 1206 1204 Element('cc_addr_cities_new').value = ''; … … 1210 1208 function updateAddrNewCityOnMouseOut () 1211 1209 { 1212 if (Element('cc_addr_cities_new').value.length == 0 && Element('cc_addr_cities').selectedIndex == 1) 1210 if (Element('cc_addr_cities_new').value.length == 0 && Element('cc_addr_cities').selectedIndex == 1) 1213 1211 { 1214 1212 Element('cc_addr_cities_new').value = Element('cc_msg_type_city').value; … … 1224 1222 return true; 1225 1223 } 1226 1227 var addrFields = new Array('cc_addr_1', 1228 'cc_addr_2', 1229 'cc_addr_complement', 1224 1225 var addrFields = new Array('cc_addr_1', 1226 'cc_addr_2', 1227 'cc_addr_complement', 1230 1228 'cc_addr_other', 1231 'cc_addr_postal_code', 1229 'cc_addr_postal_code', 1232 1230 'cc_addr_po_box', 1233 1231 'cc_addr_countries', … … 1236 1234 1237 1235 var empty = true; 1238 1236 1239 1237 for (var i = 0; i < 8; i++) 1240 1238 { … … 1245 1243 } 1246 1244 } 1247 1245 1248 1246 if (empty) 1249 1247 { … … 1274 1272 default: 1275 1273 addrInfo['id_country'] = Element('cc_addr_countries').value; 1276 1274 1277 1275 } 1278 1276 … … 1288 1286 default: 1289 1287 addrInfo['id_state'] = Element('cc_addr_states').value; 1290 1288 1291 1289 } 1292 1290 … … 1301 1299 default: 1302 1300 addrInfo['id_city'] = Element('cc_addr_cities').value; 1303 1304 } 1301 1302 } 1305 1303 1306 1304 addrInfo['id_typeof_address'] = Element('cc_addr_types').options[lastIndex].value; … … 1315 1313 CC_contact_full_info['addresses']['address'+Element('cc_addr_types').options[lastIndex].value] = addrInfo; 1316 1314 1317 if (Element('cc_addr_cities').value == '_NEW_' && 1315 if (Element('cc_addr_cities').value == '_NEW_' && 1318 1316 Element('cc_msg_type_city').value != Element('cc_addr_cities_new').value && 1319 1317 Element('cc_addr_cities_new').value != '') 1320 1318 { 1321 1319 var addrRootInfo = CC_contact_full_info['addresses']['new_cities']; 1322 1320 1323 1321 if (!addrRootInfo) 1324 1322 { 1325 1323 addrRootInfo = new Array(); 1326 1324 } 1327 1325 1328 1326 var i = addrRootInfo.length; 1329 1327 addrRootInfo[addrInfo['id_typeof_address']] = new Array(); … … 1334 1332 } 1335 1333 1336 if (Element('cc_addr_states').value == '_NEW_' && 1337 Element('cc_msg_type_state').value != Element('cc_addr_states_new').value && 1334 if (Element('cc_addr_states').value == '_NEW_' && 1335 Element('cc_msg_type_state').value != Element('cc_addr_states_new').value && 1338 1336 Element('cc_addr_states_new').value != '') 1339 1337 { 1340 1338 var addrRootInfo = CC_contact_full_info['addresses']['new_states']; 1341 1339 1342 1340 if (!addrRootInfo) 1343 1341 { 1344 1342 addrRootInfo = new Array(); 1345 1343 } 1346 1344 1347 1345 var i = addrRootInfo.length; 1348 1346 addrRootInfo[addrInfo['id_typeof_address']] = new Array(); … … 1374 1372 for(idx_conn; idx_conn < cc_conn_default.options.length; idx_conn++) 1375 1373 if(cc_conn_default.options[idx_conn].value == _label) 1376 break; 1377 1374 break; 1375 1378 1376 if(idx_conn == cc_conn_default.options.length) 1379 1377 cc_conn_default.options[idx_conn] = new Option (_label,_label, false,false); 1380 1378 1381 1379 if (!document.all) 1382 1380 { 1383 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>'+ 1384 //'<td style="width: 30px;" align="right"><input name="cc_conn_is_default" id="cc_conn_is_default_'+ CC_conn_count +'" type="radio"></td>'+ 1385 '<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>' + 1386 '<td align="left"><input id="cc_conn_value_'+ CC_conn_count +'" style="width: 150px;" type="text"> ' + 1387 '<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>'; 1381 if (Element("cc_conn_type_1").checked) 1382 { 1383 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>'+ 1384 //'<td style="width: 30px;" align="right"><input name="cc_conn_is_default" id="cc_conn_is_default_'+ CC_conn_count +'" type="radio"></td>'+ 1385 '<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>' + 1386 '<td align="left"><input id="cc_conn_value_'+ CC_conn_count +'" style="width: 150px;" maxlength="100" type="text"> ' + 1387 '<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>'; 1388 } 1389 else if (Element("cc_conn_type_2").checked) 1390 { 1391 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>'+ 1392 //'<td style="width: 30px;" align="right"><input name="cc_conn_is_default" id="cc_conn_is_default_'+ CC_conn_count +'" type="radio"></td>'+ 1393 '<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>' + 1394 '<td align="left"><input id="cc_conn_value_'+ CC_conn_count +'" style="width: 150px;" maxlength="50" type="text"> ' + 1395 '<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>'; 1396 } 1388 1397 } 1389 1398 else … … 1409 1418 img.align = 'top'; 1410 1419 img.onclick = function(e){ removeConnField(remove_id);}; 1411 1420 1412 1421 for (var i = 0; i < 3; i++) 1413 1422 { … … 1420 1429 1421 1430 inputs[1].id = 'cc_conn_name_'+CC_conn_count; 1422 inputs[1].type = 'hidden'; 1431 inputs[1].type = 'hidden'; 1423 1432 1424 1433 inputs[2].id = 'cc_conn_value_'+CC_conn_count; … … 1449 1458 || typeof(CC_contact_full_info['connections'][CC_conn_last_selected]) == 'undefined' 1450 1459 || typeof(CC_contact_full_info['connections'][CC_conn_last_selected][CC_conn_count]) == 'undefined'); 1451 1452 if(_emptyLine) { 1453 1460 1461 if(_emptyLine) { 1462 1454 1463 if(Element("cc_conn_type_sel").value == '-1'){ 1455 return false; 1456 } 1457 1464 return false; 1465 } 1466 1458 1467 for(k = 0; k < CC_conn_count; k++) { 1459 1468 if(Element("cc_conn_name_"+k) && Element("cc_conn_name_"+k).value != "" && Element("cc_conn_name_"+k).value == Element("cc_conn_type_sel").value) { 1460 1469 alert('Você já possui uma entrada para o tipo "'+Element("cc_conn_type_sel").value+'"!'); 1461 Element("cc_conn_type_sel").options.selectedIndex = 0; 1470 Element("cc_conn_type_sel").options.selectedIndex = 0; 1462 1471 return false; 1463 1472 } 1464 1473 } 1465 } 1474 } 1466 1475 if (!document.all) 1467 1476 { … … 1490 1499 1491 1500 function connRemoveLine(id) 1492 { 1501 { 1493 1502 var p = Element(id).parentNode; 1494 1503 var cc_conn_default = Element("cc_phone_default").style.display == '' ? Element("cc_phone_default") : Element("cc_email_default"); … … 1529 1538 } 1530 1539 } 1531 1540 1532 1541 CC_conn_count = 0; 1533 1542 } … … 1551 1560 function updateConnFields() 1552 1561 { 1553 1562 1554 1563 var connID; 1555 1564 var i; … … 1560 1569 var cc_conn_is_default = ''; 1561 1570 var selected_index = ''; 1562 1571 1563 1572 cc_conn_type_sel.disabled = false; 1564 1573 div_cc_conn_is_default.style.display = ""; 1565 1574 1566 1575 for(var i = 0;i < cc_conn_type_sel.options.length; i++) 1567 cc_conn_type_sel.options[i--] = null; 1568 1576 cc_conn_type_sel.options[i--] = null; 1577 1569 1578 if(Element('cc_conn_type_1').checked) { 1570 1579 var lang_new_email = Element('cc_msg_new_email').value; 1571 1580 var lang_main = Element('cc_msg_main').value; 1572 var lang_alternative = Element('cc_msg_alternative').value; 1573 cc_conn_type_sel[0] = new Option(lang_new_email,'-1'); 1581 var lang_alternative = Element('cc_msg_alternative').value; 1582 cc_conn_type_sel[0] = new Option(lang_new_email,'-1'); 1574 1583 cc_conn_type_sel[1] = new Option(lang_main,lang_main); 1575 cc_conn_type_sel[2] = new Option(lang_alternative,lang_alternative); 1584 cc_conn_type_sel[2] = new Option(lang_alternative,lang_alternative); 1576 1585 connID = 1; 1577 1586 selected_index = cc_email_default.options.selectedIndex; … … 1581 1590 1582 1591 var lang_select_email = Element('cc_msg_select_email').value; 1583 cc_email_default.options[0] = new Option(lang_select_email,'-1'); 1592 cc_email_default.options[0] = new Option(lang_select_email,'-1'); 1584 1593 cc_phone_default.style.display = 'none'; 1585 cc_email_default.style.display = ''; 1594 cc_email_default.style.display = ''; 1586 1595 cc_conn_is_default = cc_email_default; 1587 1596 } … … 1596 1605 var lang_corporative_fax = Element('cc_msg_corporative_fax').value; 1597 1606 var lang_corporative_pager = Element('cc_msg_corporative_pager').value; 1598 1599 cc_conn_type_sel[0] = new Option(lang_new_telephone,'-1'); 1607 1608 cc_conn_type_sel[0] = new Option(lang_new_telephone,'-1'); 1600 1609 cc_conn_type_sel[1] = new Option(lang_home,lang_home); 1601 cc_conn_type_sel[2] = new Option(lang_cellphone,lang_cellphone); 1610 cc_conn_type_sel[2] = new Option(lang_cellphone,lang_cellphone); 1602 1611 cc_conn_type_sel[3] = new Option(lang_work,lang_work); 1603 1612 cc_conn_type_sel[4] = new Option(lang_fax,lang_fax); … … 1608 1617 cc_conn_type_sel[8] = new Option(lang_corporative_pager, lang_corporative_pager); 1609 1618 } 1610 1619 1611 1620 connID = 2; 1612 1621 selected_index = cc_phone_default.options.selectedIndex; … … 1615 1624 } 1616 1625 1617 var lang_choose_phone = Element('cc_msg_choose_phone').value; 1626 var lang_choose_phone = Element('cc_msg_choose_phone').value; 1618 1627 cc_phone_default.options[0] = new Option(lang_choose_phone,'-1'); 1619 1628 cc_email_default.style.display = 'none'; … … 1621 1630 cc_conn_is_default = cc_phone_default; 1622 1631 } 1623 1632 1624 1633 Element("cc_conn_type_sel").options.selectedIndex = 0; 1625 1634 /* First save the data */ … … 1627 1636 1628 1637 CC_conn_last_selected = connID; 1629 1638 1630 1639 clearConn(); 1631 1640 1632 1641 if (connID == '_NONE_') 1633 1642 { cc_conn_is_default.disabled = true; 1634 1643 return; 1635 1644 } 1636 1645 1637 1646 /* If no data already available, return */ 1638 1647 if (!CC_contact_full_info['connections']) … … 1658 1667 } 1659 1668 } 1660 } 1669 } 1661 1670 if(cc_conn_is_default.options.length > selected_index) 1662 1671 cc_conn_is_default.options.selectedIndex = (selected_index == "-1" ? 0 : selected_index); … … 1679 1688 CC_contact_full_info['connections'][CC_conn_last_selected] = new Array(); 1680 1689 } 1681 else 1690 else 1682 1691 { 1683 1692 delete CC_contact_full_info['connections'][CC_conn_last_selected]; … … 1691 1700 var subNodes = nodes[i].childNodes; 1692 1701 var found = false; 1693 1702 1694 1703 for (var j = 0; j < subNodes.length; j++) 1695 1704 { 1696 if (subNodes[j].childNodes.length > 0 && 1705 if (subNodes[j].childNodes.length > 0 && 1697 1706 subNodes[j].childNodes[0].id) 1698 1707 { … … 1702 1711 CC_contact_full_info['connections'][CC_conn_last_selected][k] = new Array(); 1703 1712 } 1704 1713 1705 1714 if (subNodes[j].childNodes[0].id.indexOf('cc_conn_name') != -1) 1706 1715 { … … 1722 1731 else 1723 1732 { 1724 CC_contact_full_info['connections'][CC_conn_last_selected][k]['value'] = ''; 1733 CC_contact_full_info['connections'][CC_conn_last_selected][k]['value'] = ''; 1725 1734 } 1726 1735 } … … 1733 1742 } 1734 1743 } 1735 1744 1736 1745 if (found) 1737 1746 { … … 1750 1759 delete CC_contact_full_info['connections'][CC_conn_last_selected]; 1751 1760 } 1752 1761 1753 1762 } 1754 1763 … … 1776 1785 var number = randomString().toLowerCase(); 1777 1786 var result = ''; 1778 1787 1779 1788 if(!is_ie) 1780 1789 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); … … 1787 1796 else 1788 1797 alert('Código Incorreto'); 1789 } 1798 } 1790 1799 } 1791 1800 … … 1808 1817 return; 1809 1818 } 1810 1819 1811 1820 if (data['status'] != 'ok') 1812 1821 { … … 1814 1823 return; 1815 1824 } 1816 1825 1817 1826 setTimeout('updateCards()',80);; 1818 1827 }; 1819 1828 1820 1829 typeArg = (type == 'groups' ? 'group' : 'entry'); 1821 1830 1822 1831 Connector.newRequest('removeEntry', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=remove_'+typeArg+'&remove=' + id, 'GET', handler); 1823 1832 } … … 1842 1851 var w_height = 0; 1843 1852 var w_extra = 200; 1844 1853 1845 1854 if (document.body.clientHeight) 1846 1855 { … … 1881 1890 } 1882 1891 } 1892 1883 1893 function getActualPage () 1884 1894 { … … 1945 1955 final_page = 1; 1946 1956 } 1947 1957 1948 1958 html_pages += '<a href="javascript:setPages('+npages+', '+ actual_page +', '+ final_page +')">...</a> '; 1949 1959 1950 1960 page = showing_page ? showing_page : actual_page; 1951 1961 } 1952 1962 1953 1963 for (; page <= npages; page++) 1954 1964 { … … 2010 2020 Element('cc_panel_arrow_last').style.cursor = 'hand'; 2011 2021 } 2012 2022 2013 2023 Element('cc_panel_pages').innerHTML = html_pages; 2014 2024 } … … 2022 2032 for (j = 0; j < 3; j++) 2023 2033 document.getElementById("cc_card:"+j+":"+i).innerHTML = ''; 2024 return false;2025 } 2026 2027 if(type == 'groups' || type == 2034 return false; 2035 } 2036 2037 if(type == 'groups' || type =='shared_groups') 2028 2038 return populateGroupsInCards(data,type); 2029 2039 2030 2040 var pos = 0; 2031 2041 var ncards = data[3].length; 2032 2042 2033 2043 if (typeof(data[3]) == 'object' && ncards > 0) 2034 2044 { … … 2038 2048 { 2039 2049 id = 'cc_card:'+j+':'+i; 2040 2050 2041 2051 for (var k = 0; k < data[2].length; k++) 2042 2052 { … … 2056 2066 break; 2057 2067 } 2058 2068 2059 2069 } 2060 2061 2070 2071 2062 2072 /*if(data[2][k] == 'cc_mail' && data[3][pos][k] == 'none' && !(ccTree.catalog_perms & 2) ) { 2063 2073 Element(id).style.display = 'none'; 2064 2074 continue; 2065 2075 }*/ 2066 2076 2067 2077 if(data[3][pos][k] != 'none') 2068 2078 { … … 2079 2089 Element(id+':'+data[2][k]).innerHTML = data[3][pos][k]; 2080 2090 } 2081 if(data[3][pos][ 9]){2082 Element(id+':'+data[2][k]).innerHTML += "<br><span style='margin-left:30px'><font size='-2' color='#808080'><i>"+data[3][pos][ 9]+"</i></font></span>"; }2091 if(data[3][pos][12]) 2092 Element(id+':'+data[2][k]).innerHTML += "<br><span style='margin-left:30px'><font size='-2' color='#808080'><i>"+data[3][pos][12]+"</i></font></span>"; 2083 2093 break; 2084 2094 2085 2095 case 'cc_mail': 2086 2087 2096 if (data[3][pos][k].length > (CC_visual == 'table' ? 50 : 20)) 2088 2097 { … … 2092 2101 else 2093 2102 { 2094 Element(id+':'+data[2][k]).innerHTML = data[5] + data[3][pos][k] + '\')">'+ data[3][pos][k]+'</span>'; 2103 Element(id+':'+data[2][k]).innerHTML = data[5] + data[3][pos][k] + '\')">'+ data[3][pos][k]+'</span>'; 2095 2104 } 2096 2105 break; 2097 2106 2098 2107 case 'cc_phone': 2099 2108 if (data[3][pos][k].length > 20) … … 2131 2140 case 'cc_forwarding_address': 2132 2141 var account_type = data[3][pos][k]; 2133 2142 2134 2143 if( !account_type) 2135 2144 break; 2136 2145 2137 2146 Element(id+':cc_icon_group').innerHTML = '<span title="'+Element('cc_participants').value+'" onmouseout="window.status=\'\';" onclick="ccListParticipants.showList(\''+ Element(id+':cc_id').value + '\',null,null,null,\''+account_type+'\');return true;" style="cursor: pointer; cursor: hand; z-index: 1"><img src="templates/default/images/people-mini.png" align="center"> </span>'; 2147 break; 2148 2149 //Para tratar tamanho do campo "celular" do empregado 2150 case 'cc_mobile': 2151 if (data[3][pos][k].length > 20) 2152 { 2153 Element(id+':'+data[2][k]).innerHTML = adjustString(data[3][pos][k], 20); 2154 Element(id+':'+data[2][k]).title = data[3][pos][k]; 2155 } 2156 else 2157 { 2158 Element(id+':'+data[2][k]).innerHTML = adjustString(data[3][pos][k], 20); 2159 } 2160 Element(id+':cc_mobile').innerHTML = data[3][pos][k]; 2161 break; 2162 2163 //Para tratar tamanho do campo "matricula" do empregado 2164 case 'cc_empNumber': 2165 if (data[3][pos][k].length > 20) 2166 { 2167 Element(id+':'+data[2][k]).innerHTML = adjustString(data[3][pos][k], 20); 2168 Element(id+':'+data[2][k]).title = data[3][pos][k]; 2169 } 2170 else 2171 { 2172 Element(id+':'+data[2][k]).innerHTML = adjustString(data[3][pos][k], 20); 2173 } 2174 Element(id+':cc_empNumber').innerHTML = data[3][pos][k]; 2175 break; 2176 2177 //Para tratar tamanho do campo "departamento" do empregado 2178 case 'cc_department': 2179 if (data[3][pos][k].length > 15) 2180 { 2181 Element(id+':'+data[2][k]).innerHTML = adjustString(data[3][pos][k], 15); 2182 Element(id+':'+data[2][k]).title = data[3][pos][k]; 2183 } 2184 else 2185 { 2186 Element(id+':'+data[2][k]).innerHTML = adjustString(data[3][pos][k], 15); 2187 } 2188 Element(id+':cc_department').innerHTML = data[3][pos][k]; 2138 2189 break; 2139 2190 … … 2146 2197 else 2147 2198 { 2199 if (Element(id+':'+data[2][k]) == null) alert('É nulo'); 2148 2200 Element(id+':'+data[2][k]).innerHTML = data[3][pos][k]; 2149 2201 } 2150 2202 } 2151 2203 } 2152 } 2204 } 2205 2153 2206 if (type == "shared_contacts") { 2154 if (data[3][pos][ 8] & 4)2207 if (data[3][pos][11] & 4) 2155 2208 eval("document.getElementById(id + ':cc_card_edit').onclick = function(){editSharedContact(Element('"+id+"' + ':cc_id').value);};"); 2156 2209 else … … 2158 2211 alert(Element('cc_msg_not_allowed').value); 2159 2212 }; 2160 if (data[3][pos][ 8] & 8)2213 if (data[3][pos][11] & 8) 2161 2214 eval("document.getElementById(id + ':cc_card_remove').onclick = function(){removeEntry(Element('" + id + "' + ':cc_id').value);};"); 2162 2215 else … … 2165 2218 }; 2166 2219 } 2167 2168 2169 2220 2170 2221 if (--ncards == 0) 2171 2222 { … … 2173 2224 i = CC_max_cards[1]; 2174 2225 } 2175 2226 2176 2227 pos++; 2177 2228 } … … 2181 2232 2182 2233 function populateGroupsInCards(data,type) 2183 { 2234 { 2184 2235 var pos = 0; 2185 var contacts = data[5]; 2236 var contacts = data[5]; 2186 2237 var ncards = data[3].length; 2187 2238 2188 2239 if (typeof(data[3]) == 'object' && ncards > 0) 2189 2240 { … … 2193 2244 { 2194 2245 id = 'cc_card:'+j+':'+i; 2195 2246 2196 2247 for (var k = 0; k < data[2].length; k++) 2197 2248 { 2198 2249 2199 2250 if(data[3][pos][k] != 'none') 2200 { 2201 2251 { 2252 2202 2253 switch (data[2][k]) 2203 { 2254 { 2204 2255 case 'cc_title': 2205 2256 if (data[3][pos][k].length > 50) … … 2215 2266 Element(id+':'+data[2][k]).innerHTML += "<br><span style='margin-left:30px'><font size='-2' color='#808080'><i>"+data[3][pos][5]+"</i></font></span>"; 2216 2267 break; 2217 2268 2218 2269 case 'cc_short_name': 2219 2270 if (data[3][pos][k].length > (CC_visual == 'table' ? 50 : 20)) … … 2227 2278 } 2228 2279 break; 2229 2280 2230 2281 case 'cc_contacts': 2231 2282 … … 2236 2287 var email = ""; 2237 2288 2238 for (var d = 0; d < contacts.length; d++) { 2289 for (var d = 0; d < contacts.length; d++) { 2239 2290 contact += contacts[d]['names_ordered']+ ","; 2240 2291 email += contacts[d]['connection_value']+","; 2241 2292 } 2242 2293 2243 2294 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>'; 2244 2295 2245 2296 break; 2246 2297 2247 2298 case 'cc_id': 2248 2299 var id_contact = data[3][pos][k]; 2249 2300 Element(id+':'+data[2][k]).value = data[3][pos][k]; 2250 2301 2251 2302 break; 2252 2303 2253 2304 } 2254 2305 } 2255 2306 } 2256 2307 2257 2308 if (type == "shared_groups") { 2258 2309 … … 2269 2320 }; 2270 2321 } 2271 2272 2322 2273 2323 if (--ncards == 0) 2274 2324 { … … 2276 2326 i = CC_max_cards[1]; 2277 2327 } 2278 2328 2279 2329 pos++; 2280 2330 } … … 2305 2355 }; 2306 2356 2307 Connector.newRequest('setMaxCards', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=set_n_cards&ncards=' + ncards, 'GET'); 2357 Connector.newRequest('setMaxCards', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=set_n_cards&ncards=' + ncards, 'GET'); 2308 2358 } 2309 2359 … … 2311 2361 { 2312 2362 var coord = new Array(); 2313 2363 2314 2364 //Element('cc_card_space').innerHTML = ''; 2315 2365 //return; … … 2318 2368 //card_space_width = parseInt(is_ie ? document.body.offsetWidth : window.innerWidth) - parseInt(Element('cc_left').offsetWidth) - parseInt(CC_card_extra) - 40; 2319 2369 card_space_height = parseInt(Element('cc_card_space').offsetHeight) - parseInt(CC_card_extra); 2320 2370 2321 2371 card_width = CC_card_image_width + CC_card_extra; 2322 2372 card_height = CC_card_image_height + CC_card_extra; … … 2324 2374 ncols = parseInt(card_space_width / card_width); 2325 2375 nlines = parseInt(card_space_height / card_height); 2326 2376 2327 2377 coord[0] = ncols; 2328 2378 //coord[1] = nlines; … … 2339 2389 if(type == 'groups' || type == 'shared_groups') { 2340 2390 html_card = '<td id="' + id + '" style="width: ' + CC_card_image_width + 'px; height: ' + CC_card_image_height + '">' + 2341 '<div style="border: 0px solid #999; position: relative;">' + 2391 '<div style="border: 0px solid #999; position: relative;">' + 2342 2392 '<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);">' + 2343 2393 '<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">' + 2344 '<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">' + 2394 '<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">' + 2345 2395 '<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>' + 2346 2396 '<span id="' + id + ':cc_participantes" style="cursor: pointer; cursor: hand; z-index: 1;position: absolute; top: 15px; left: 15px"></span>' + … … 2348 2398 '<input id="' + id + ':cc_id" type="hidden">' + 2349 2399 '</div>' + '</td>'; 2350 2400 2351 2401 } 2352 2402 else { 2353 2403 html_card = '<td id="' + id + '" style="width: ' + CC_card_image_width + 'px; height: ' + CC_card_image_height + '">' + 2354 2404 '<div style="border: 0px solid #999; position: relative;">' + 2355 '<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);">' + 2405 '<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);">' + 2356 2406 ( ccTree.catalog_perms == 1 ? 2357 2407 '<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>':'') + … … 2359 2409 '<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">' + 2360 2410 '<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">' : '') + 2361 '<img id="' + id + ':cc_photo" style="position: absolute; top: 15px; left: 7px;" src="" border="0" ondblclick="editContact(Element(\'' + id + ':cc_id\').value);">' + 2411 '<img id="' + id + ':cc_photo" style="position: absolute; top: 15px; left: 7px;" src="" border="0" ondblclick="editContact(Element(\'' + id + ':cc_id\').value);">' + 2362 2412 '<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>' + 2363 '<span style="cursor: pointer; cursor: hand; z-index: 1;position: absolute; top: 100px; left: 35px" valign="bottom" id="' + id + ':cc_icon_group"> </span>'+ 2364 '<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>' + 2365 '<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>' + 2366 '<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>' + 2367 '<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>' + 2368 '<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>' + 2413 '<span style="cursor: pointer; cursor: hand; z-index: 1;position: absolute; top: 100px; left: 35px" valign="bottom" id="' + id + ':cc_icon_group"> </span>'+ 2414 //Para exibir a matricula do empregado nos cartoes 2415 '<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>' + 2416 '<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>' + 2417 '<span id="' + id + ':cc_title" style="position: absolute; top: 50px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 12px; text-align: center; height: 10px;"></span>' + 2418 //Para exibir o setor/lotacao do empregado nos cartoes 2419 '<span id="' + id + ':cc_department" style="position: absolute; top: 60px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 10px; text-align: center; height: 10px;"></span>' + 2420 '<span id="' + id + ':cc_phone" style="position: absolute; top: 75px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 10px; text-align: center; height: 10px;"></span>' + 2421 //Para exibir o celular empresarial do empregado na tabela 2422 '<span id="' + id + ':cc_mobile" 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>' + 2423 '<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>' + 2424 '<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>' + 2369 2425 '<input id="' + id + ':cc_id" type="hidden">' + 2370 2426 '</div>' + '</td>'; 2371 } 2372 2427 2428 /*} else { 2429 html_card = '<td id="' + id + '" style="width: ' + CC_card_image_width + 'px; height: ' + CC_card_image_height + '">' + 2430 '<div style="border: 0px solid #999; position: relative;">' + 2431 '<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);">' + 2432 '<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">' + 2433 '<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">' + 2434 '<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>' + 2435 '<span id="' + id + ':cc_participantes" style="cursor: pointer; cursor: hand; z-index: 1;position: absolute; top: 15px; left: 15px"></span>' + 2436 '<span onMouseOver="this.title = \''+Element('cc_send_mail').value+'\'" id="' + id + ':cc_short_name" 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>' + 2437 '<input id="' + id + ':cc_id" type="hidden">' + 2438 '</div>' + '</td>';*/ 2439 } 2373 2440 2374 2441 return html_card; … … 2391 2458 ' | '+ 2392 2459 '<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">' + 2393 '<input id="' + id + ':cc_id" type="hidden">'+ 2460 '<input id="' + id + ':cc_id" type="hidden">'+ 2394 2461 '</td></tr>'; 2395 2396 2397 } 2398 else { 2399 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;">' + 2400 '<span valign="bottom" id="' + id + ':cc_icon_group"> </span><span id="' + id + ':cc_name"></span></td>' + 2401 '<td style="solid #999; font-weight: normal; font-size: 10px; text-align: left; height: 10px"><span onMouseOver="this.title = \''+Element('cc_send_mail').value+'\'" id="' + id + ':cc_mail"></span></td>' + 2402 '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_phone"></span></td>' + 2462 2463 // if(type != 'groups'||type=='shared_groups') { 2464 } 2465 else { 2466 html_card = '<tr style="height:20px" id="' + id + '" onmouseout="'+bg+'" onmouseover="this.style.background=\'LIGHTYELLOW\'" bgcolor="EEEEEE">' + 2467 //Para exibir a matricula do empregado na tabela 2468 '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_empNumber"></span></td>' + 2469 '<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>' + 2470 '<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>' + 2471 '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_phone"></span></td>' + 2472 //Para exibir o celular empresarial do empregado na tabela 2473 '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_mobile"></span></td>' + 2474 //Para exibir o setor/lotacao do empregado na tabela 2475 '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_department"></span></td>' + 2476 '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_mobile"></span></td>' + 2477 '<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>' + 2403 2478 ( ccTree.catalog_perms == 1 ? 2404 2479 '<td align="left"><span valign="bottom" id="' + id + ':cc_icon_data"></span></td>':'') + … … 2416 2491 '</td></tr>'; 2417 2492 } 2493 /*else { 2494 html_card = '<tr width="40%" 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;">' + 2495 '<span id="' + id + ':cc_participantes" style="cursor: pointer; cursor: hand; z-index: 1"></span>' + 2496 '<span id="' + id + ':cc_title"></span></td>' + 2497 '<td width="40%" 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_title\').innerHTML" id="' + id + ':cc_short_name"></span></td>' + 2498 '<td align="left" width="55px">'+ 2499 '<img title="'+Element('cc_msg_group_edit').value+'" id="' + id + ':cc_card_edit" style=" cursor: pointer; cursor: hand; z-index: 1;width: 18px; height: 18px;" onclick="editGroup(Element(\'' + id + ':cc_id\').value);" src="templates/default/images/cc_card_edit.png">' + 2500 ' | '+ 2501 '<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">' + 2502 '<input id="' + id + ':cc_id" type="hidden">'+ 2503 '</td></tr>'; 2504 }*/ 2418 2505 2419 2506 return html_card; … … 2423 2510 { 2424 2511 var pos; 2425 2512 2426 2513 html_cards = '<div id="divScrollMain" style="overflow:auto;z-index:1"><table width="100%" border="0" cellpadding="0" cellspacing="3">'; 2427 2514 2428 2515 if (ncards > 0) 2429 2516 { … … 2445 2532 if((ccTree.catalog_perms & 2) && type != 'groups' && type !='shared_contacts' && type !='shared_groups') 2446 2533 html_cards += '<tr><td colspan=4 align="right"><button id="cc_button_tools" value="" type="button" onclick="javascript:removeAllEntries()">Remover Todos</button></td></tr>'; 2447 } 2534 } 2448 2535 else if (CC_max_cards != 0) 2449 2536 { … … 2465 2552 html_cards = '<div id="divScrollMain" style="overflow:auto;z-index:1">'; 2466 2553 html_cards += '<table border="0" cellpadding="0" cellspacing="' + CC_card_extra + '">'; 2467 2554 2468 2555 if (ncards > 0) 2469 2556 { … … 2484 2571 if((ccTree.catalog_perms & 2) && type != 'groups' && type !='shared_contacts' && type !='shared_groups') 2485 2572 html_cards += '<tr><td colspan=3 align="right"><button id="cc_button_tools" value="" type="button" onclick="javascript:removeAllEntries()">Remover Todos</button></td></tr>'; 2486 } 2573 } 2487 2574 else if (CC_max_cards != 0) 2488 2575 { … … 2521 2608 else if(CC_visual == 'table') 2522 2609 drawTable(0); 2523 2610 2524 2611 setPages(0,0); 2525 2612 return; 2526 2613 } 2527 2528 2614 2529 2615 var handler = function (responseText) … … 2532 2618 data = unserialize(responseText); 2533 2619 if (data[0] == '0') 2534 { 2535 Element('cc_type_contact').value = data[1]; 2620 { 2621 Element('cc_type_contact').value = data[1]; 2536 2622 CC_npages = 0; 2537 2623 CC_actual_page = 1; … … 2545 2631 else 2546 2632 Element('cc_type_contact').value = data[10]; 2547 2548 // Element('cc_debug').innerHTML = responseText; 2549 2633 2634 // Element('cc_debug').innerHTML = responseText; 2635 2550 2636 if (typeof(data) != 'object') 2551 2637 { … … 2553 2639 return; 2554 2640 } 2555 2641 2556 2642 if (typeof(data[3]) == 'object') 2557 2643 { … … 2566 2652 qtd_compartilhado = data[9]; 2567 2653 CC_npages = parseInt(data[0]); 2568 CC_actual_page = parseInt(data[1]); 2654 CC_actual_page = parseInt(data[1]); 2569 2655 if(CC_visual == 'cards') 2570 2656 drawCards(data[3].length, data[10]); … … 2574 2660 populateCards(data, data[10]); 2575 2661 setPages(data[0], data[1]); 2576 2662 2663 } 2664 else if (data['error']) 2665 { 2666 showMessage(data['error']); 2577 2667 } 2578 2668 else … … 2586 2676 Connector.newRequest('showCards', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_cards_data', 'POST', handler, info); 2587 2677 } 2678 2588 2679 2589 2680 function clearCards() … … 2610 2701 var table_h = Element('cc_panel_table'); 2611 2702 var cards_h = Element('cc_panel_cards'); 2612 2703 2613 2704 switch (type) 2614 2705 { … … 2623 2714 break; 2624 2715 } 2625 2716 2626 2717 CC_visual = type; 2627 2718 showCards(getActualLetter(), getActualPage()); 2628 2719 } 2629 2720 2630 function ccSearchUpdate(ids)2721 /*function ccSearchUpdate(ids) 2631 2722 { 2632 2723 Element('cc_panel_letters').style.display = 'none'; 2633 2724 Element('cc_panel_search').style.display = 'inline'; 2634 2725 2635 2726 if(CC_visual == 'cards') 2636 2727 drawCards(0); … … 2640 2731 if (!ids) 2641 2732 { 2642 ccSearchHide();2733 //ccSearchHide(); 2643 2734 return; 2644 2735 } 2645 2736 2646 2737 var sIds = serialize(ids); 2647 2738 … … 2651 2742 } 2652 2743 showCards('search', '1', sIds); 2744 } 2745 */ 2746 2747 function ccSearchUpdate() 2748 { 2749 Element('cc_panel_letters').style.display = 'none'; 2750 Element('cc_panel_search').style.display = 'inline'; 2751 2752 if(CC_visual == 'cards') 2753 drawCards(0); 2754 else if(CC_visual == 'table') 2755 drawTable(0); 2756 2757 if (CC_actual_letter != 'search') 2758 { 2759 CC_last_letter = CC_actual_letter; 2760 } 2761 //showCards('search', '1', sIds); 2653 2762 } 2654 2763 … … 2693 2802 data[3] = Element('cc_qa_phone').value; 2694 2803 data[4] = Element('cc_qa_email').value; 2804 2805 return data; 2806 } 2807 2808 function sendQuickAdd () 2809 { 2810 var data = getQuickAdd(); 2811 2812 var str = serialize(data); 2813 2814 if (!str) 2815 { 2816 return false; 2817 } 2818 2819 var handler = function (responseText) 2820 { 2821 setTimeout('updateCards()',100);; 2822 } 2823 2824 resetQuickAdd(); 2825 2826 Connector.newRequest('quickAdd', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=quick_add', 'POST', handler, 'add='+escape(str)); 2827 } 2828 2695 2829 2696 return data;2697 }2698 2699 function sendQuickAdd ()2700 {2701 var data = getQuickAdd();2702 2703 var str = serialize(data);2704 2705 if (!str)2706 {2707 return false;2708 }2709 2710 var handler = function (responseText)2711 {2712 setTimeout('updateCards()',100);;2713 }2714 2715 resetQuickAdd();2716 2717 Connector.newRequest('quickAdd', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=quick_add', 'POST', handler, 'add='+escape(str));2718 }2719 2720 2830 function connectVoip (phoneUser, typePhone){ 2721 2831 var handler_voip = function (responseText){ … … 2724 2834 } 2725 2835 else{ 2726 2836 data = unserialize(responseText); 2727 2837 alert("Requisitando chamada para o ramal: "+data); 2728 2838 } 2729 2839 } 2730 2840 Connector.newRequest('voip', "../../expressoMail1_2/controller.php?action=expressoMail1_2.functions.callVoipconnect&to="+phoneUser+"&typePhone="+typePhone, 'POST', handler_voip);
Note: See TracChangeset
for help on using the changeset viewer.