Changeset 284 for trunk/contactcenter/js
- Timestamp:
- 05/21/08 16:56:17 (16 years ago)
- Location:
- trunk/contactcenter/js
- Files:
-
- 7 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 } -
trunk/contactcenter/js/ccAddGroup.js
r118 r284 158 158 159 159 if(!this.title.value) { 160 alert( Element('cc_msg_fill_field_name').value);160 alert('Preencha o campo obrigatório "Nome Completo"'); 161 161 this.title.focus(); 162 162 return false; … … 164 164 165 165 if(! contacts.length) { 166 alert( Element('cc_msg_add_contact_to_group').value);166 alert('Você não adicionou nenhum contato para esse grupo'); 167 167 return false; 168 168 } -
trunk/contactcenter/js/ccIEContacts.js
r270 r284 3 3 this.el; 4 4 this.wWidth = 395; 5 this.wHeight = 2 55;5 this.wHeight = 240; 6 6 } 7 7 … … 16 16 } 17 17 } 18 19 cIEContacts.prototype.showFailures = function(data){20 if (data == 'undefined')21 return;22 if (data){23 var lang_clean = Element('cc_msg_clean').value;24 var info_box = document.getElementById('s_info2');25 info_box.innerHTML = data;26 info_box.style.visibility = '';27 var cleanButton = document.createElement('input');28 cleanButton.type='button';29 cleanButton.value=lang_clean;30 cleanButton.onclick= function() { ccIEContacts.cleanInfo() };31 info_box.appendChild(cleanButton);32 }33 }34 35 cIEContacts.prototype.cleanInfo = function(){36 var info_box = document.getElementById('s_info2');37 info_box.innerHTML = '';38 }39 18 40 19 cIEContacts.prototype.showList = function(){ … … 58 37 this.el.id = 'cc_rectIEContacts'; 59 38 document.body.appendChild(this.el); 60 61 var lang_import_contacts = Element('cc_msg_import_contacts').value;62 var lang_close_win = Element('cc_msg_close_win').value63 var lang_export_contacts = Element('cc_msg_export_contacts').value;64 var lang_expresso_info_csv = Element('cc_msg_expresso_info_csv').value;65 var lang_expresso_default = Element('cc_msg_expresso_default').value;66 var lang_choose_contacts_file = Element('cc_msg_choose_contacts_file').value;67 var lang_msg_choose_type = Element('cc_msg_choose_file_type').value;68 var lang_msg_expresso_info_csv = Element('cc_msg_expresso_info_csv').value;69 var lang_msg_export_csv = Element('cc_msg_export_csv').value;;70 var lang_msg_automatic = Element('cc_msg_automatic').value;71 var lang_moz_tb = Element('cc_msg_moz_thunderbird').value;72 var lang_outl_pt = Element('cc_msg_outlook_express_pt').value;73 var lang_outl_en = Element('cc_msg_outlook_express_en').value;74 var lang_outl2k_pt = Element('cc_msg_outlook_2k_pt').value;75 var lang_outl2k_en = Element('cc_msg_outlook_2k_en').value;76 var lang_expresso_default_csv = Element('cc_msg_expresso_default_csv').value;77 78 79 39 this.el.innerHTML = 80 40 '<div align="left" id="divAppbox"><table width="100%" border=0>'+ 81 '<tr><td style="border-bottom:1px solid black"><input onclick="javascript:ccIEContacts.changeOptions(this.value)" id="type" type="radio" name="type" value="i" style="border:0" checked> '+lang_import_contacts+82 ' <input onclick="javascript:ccIEContacts.changeOptions(this.value)" id="type" type="radio" name="type" style="border:0" value="e"/> '+lang_export_contacts+'<br></td></tr>'+41 '<tr><td style="border-bottom:1px solid black"><input onclick="javascript:ccIEContacts.changeOptions(this.value)" id="type" type="radio" name="type" value="i" style="border:0" checked>Importar Contatos'+ 42 ' <input onclick="javascript:ccIEContacts.changeOptions(this.value)" id="type" type="radio" name="type" style="border:0" value="e"/>Exportar Contatos<br></td></tr>'+ 83 43 '</table>'+ 84 44 '<table border=0 height="208px" width="100%" id="import_span">'+ 85 45 '<tr><td>'+ 86 '<font color="DARKBLUE" size="2"> '+lang_expresso_info_csv+'</font></td></tr>'+46 '<font color="DARKBLUE" size="2">O Expresso suporta a importação de contatos no formato de arquivo CSV.</font></td></tr>'+ 87 47 '<tr><td height="75px" valign="top">'+ 88 '<form name="formCSV" method="POST" enctype="multipart/form-data">'+ lang_msg_choose_type +89 ' : <select id="typeImport"><option value="auto" selected>'+lang_msg_automatic+'</option>'+90 '<option value="outlook"> '+("Outlook Express")+'</option>'+91 '<option value="outlook2000"> '+("Outlook 2000")+'</option>'+92 '<option value="thunderbird"> '+("Mozilla Thunderbird")+'</option>'+93 '<option value="expresso" >'+lang_expresso_default+'</option></select><br>'+94 '<br> '+lang_choose_contacts_file+'<br><br>'+48 '<form name="formCSV" method="POST" enctype="multipart/form-data">'+ 49 'Selecione o tipo do arquivo: <select id="typeImport">'+ 50 '<option value="outlook">Outlook Express</option>'+ 51 '<option value="outlook2000">Outlook 2000</option>'+ 52 '<option value="thunderbird">Mozilla Thunderbird</option>'+ 53 '<option value="expresso" selected>Expresso (padrão)</option></select><br>'+ 54 '<br>Selecione o arquivo que contém os contatos a serem importados:<br><br>'+ 95 55 '<input id="import_file" type="file" name="import_file">'+ 96 56 '</form></td></tr>'+ 97 57 '<tr><td height="10px" align="center" nowrap><span style="visibility:hidden" id="s_info"></span></td></tr>'+ 98 58 '<tr><td height="10px" align="center"></td></tr>'+ 99 '<tr><td nowrap><center><input id="import_button" type="button" value= '+lang_import_contacts+'onClick="javascript:ccIEContacts.importCSV(this)"> '+100 '<input type="button" value= '+lang_close_win+'onClick="javascript:ccIEContacts.close()"></center></td></tr>'+101 '< tr><td height="10px" align="center" nowrap><span style="visibility:hidden" id="s_info2"></span></td></tr></table>'+59 '<tr><td nowrap><center><input id="import_button" type="button" value="Importar Contatos" onClick="javascript:ccIEContacts.importCSV(this)"> '+ 60 '<input type="button" value="Fechar" onClick="javascript:ccIEContacts.close()"></center></td></tr>'+ 61 '</table>'+ 102 62 '<table border=0 height="208px" width="100%" style="display:none" id="export_span">'+ 103 63 '<tr><td>'+ 104 '<font color="DARKBLUE" size="2">'+ lang_msg_expresso_info_csv+'</font></td></tr>'+ 105 '<tr><td height="85px" valign="top">'+lang_msg_export_csv+'<br><br>'+ 106 '<input style="border:0" id="typeExport_0" name="radio" type="radio" value="expresso" checked/>'+lang_expresso_default_csv+'<br>'+ 107 '<input style="border:0" id="typeExport_1" name="radio" type="radio" value="outlook_pt-BR">'+lang_outl_pt+ '<br>'+ 108 '<input style="border:0" id="typeExport_2" name="radio" type="radio" value="outlook_en">'+lang_outl_en+ '<br>'+ 109 '<input style="border:0" id="typeExport_3" name="radio" type="radio" value="outlook2000_pt-BR">'+lang_outl2k_pt + '<br>'+ 110 '<input style="border:0" id="typeExport_4" name="radio" type="radio" value="outlook2000_en">'+lang_outl2k_en + '<br>'+ 111 '<input style="border:0" id="typeExport_5" name="radio" type="radio" value="thunderbird">'+lang_moz_tb + '<br>'+ 64 '<font color="DARKBLUE" size="2">O Expresso suporta a exportação de contatos no formato de arquivo CSV.</font></td></tr>'+ 65 '<tr><td height="85px" valign="top">'+ 66 'Selecione o tipo do formato que deseja exportar seus contatos:<br><br>'+ 67 '<input style="border:0" id="typeExport_0" name="radio" type="radio" value="expresso" checked/>Exportar como CSV do Expresso (padrão)<br>'+ 68 '<input style="border:0" id="typeExport_1" name="radio" type="radio" value="outlook_pt-BR">Exportar como CSV do Outlook Express (Português)<br>'+ 69 '<input style="border:0" id="typeExport_2" name="radio" type="radio" value="outlook_en">Exportar como CSV do Outlook Express (Inglês)<br>'+ 70 '<input style="border:0" id="typeExport_3" name="radio" type="radio" value="outlook2000_pt-BR">Exportar como CSV do Outlook 2000 (Português)<br>'+ 71 '<input style="border:0" id="typeExport_4" name="radio" type="radio" value="outlook2000_en">Exportar como CSV do Outlook 2000 (Inglês)<br>'+ 72 '<input style="border:0" id="typeExport_5" name="radio" type="radio" value="thunderbird">Exportar como CSV do Mozilla Thunderbird<br>'+ 112 73 '</td></tr>'+ 113 74 '<tr><td align="center"> </td></tr>'+ 114 '<tr><td nowrap><center><input id="export_button" type="button" value= '+lang_export_contacts+ 'onClick="javascript:ccIEContacts.exportCSV(this)"> '+115 '<input type="button" value= '+lang_close_win+ 'onClick="javascript:ccIEContacts.close()"></center></td></tr>'+75 '<tr><td nowrap><center><input id="export_button" type="button" value="Exportar Contatos" onClick="javascript:ccIEContacts.exportCSV(this)"> '+ 76 '<input type="button" value="Fechar" onClick="javascript:ccIEContacts.close()"></center></td></tr>'+ 116 77 '</table></div>'; 117 78 } 118 79 this.showWindow(); 119 80 } 120 81 121 82 cIEContacts.prototype.showWindow = function () 122 83 { 123 84 if(!this.win) { 124 125 85 86 this.win = new dJSWin({ 126 87 id: 'ccIEContacts', 127 88 content_id: this.el.id, … … 130 91 title_color: '#3978d6', 131 92 bg_color: '#eee', 132 title: Element('cc_msg_ie_personal').value,93 title: "Importar / Exportar Contatos Pessoais", 133 94 title_text_color: 'white', 134 95 button_x_img: '../phpgwapi/images/winclose.gif', … … 151 112 var status = ''; 152 113 153 var lang_import_fail = Element('cc_msg_import_fail').value; 154 var lang_importing = Element('cc_msg_importing_contacts').value; 155 var lang_import_finish = Element('cc_msg_import_finished').value; 156 var lang_new = Element('cc_msg_new').value; 157 var lang_failure = Element('cc_msg_failure').value; 158 var lang_exists = Element('cc_msg_exists').value; 159 var lang_show_more_info = Element('cc_msg_show_more_info').value; 160 161 var l_1 = '<font face="Verdana" size="1" color="GREEN">['+args[1]+lang_new+']</font>'; 162 var l_2 = '<font face="Verdana" size="1" color="RED">['+args[2]+lang_failure+']</font>'; 163 var l_3 = '<font face="Verdana" size="1" color="DARKBLUE">['+args[3]+lang_exists+']</font>'; 164 var l_4 = '<br><a font face="Verdana" size="1" href="javascript:ccIEContacts.showFailures(\''+args[4]+'\')">'+lang_show_more_info+'</a>'; 165 var l_error = '<span style="height:15px;background:#cc4444"> <font face="Verdana" size="1" color="WHITE">'+lang_import_fail+ ' </font></span>'; 166 var l_importing = '<span style="height:15px;background:rgb(250, 209, 99)"> <font face="Verdana" size="1" color="DARKBLUE">'+lang_importing + ' </font></span>'; 114 var l_1 = '<font face="Verdana" size="1" color="GREEN">['+args[1]+' novos]</font>'; 115 var l_2 = '<font face="Verdana" size="1" color="RED">['+args[2]+' falharam]</font>'; 116 var l_3 = '<font face="Verdana" size="1" color="DARKBLUE">['+args[3]+' já existiam]</font>'; 117 var l_error = '<span style="height:15px;background:#cc4444"> <font face="Verdana" size="1" color="WHITE">A importação falhou. Verifique o formato do arquivo. </font></span>'; 118 var l_importing = '<span style="height:15px;background:rgb(250, 209, 99)"> <font face="Verdana" size="1" color="DARKBLUE">Importando contatos .... </font></span>'; 167 119 168 120 if(args[0] == 'success') { 169 121 170 for(i = 1; i < 5; i++) {122 for(i = 1; i < 4; i++) { 171 123 status += " "+eval('l_'+i); 172 124 } 173 Element('s_info').innerHTML = ' <font face="Verdana" size="1" color="BLACK"><b> '+lang_import_finish+'</b></font><br> '+status;125 Element('s_info').innerHTML = ' <font face="Verdana" size="1" color="BLACK"><b>A importação foi concluída.</b></font><br> '+status; 174 126 } 175 127 else … … 196 148 cIEContacts.prototype.importCSV = function () 197 149 { 198 var lang_msg_invalid_csv = Element('cc_msg_invalid_csv').value;199 150 var form = document.formCSV; 151 200 152 if ((form.import_file.value.length < 10) || 201 (form.import_file.value.substring(form.import_file.value.length - 4, form.import_file.value.length) .toLowerCase()!= ".csv")){202 alert( lang_msg_invalid_csv);153 (form.import_file.value.substring(form.import_file.value.length - 4, form.import_file.value.length) != ".csv")){ 154 alert('Selecione um arquivo CSV válido para importar seus contatos.'); 203 155 return; 204 156 } … … 218 170 args[2] = data._failure ? data._failure : 0; 219 171 args[3] = data._existing ? data._existing : 0; 220 args[4] = data._failure_status221 222 172 } 223 173 _this.importWriteStatus(args); … … 258 208 259 209 cIEContacts.prototype.exportCSV = function() { 260 var lang_export_error = Element('cc_msg_export_error'); 210 261 211 var handler_export = function(data) { 262 212 if(!data){ 263 alert( lang_export_error);213 alert("Ocorreu um erro durante a exportação."); 264 214 return; 265 215 } -
trunk/contactcenter/js/ccMain.js
r119 r284 1 var last_id = 0; 2 3 function openwindow(url){ 4 var window_features = "scrollbars=yes,resizable=yes,location=no,menubar=no," + 5 "personalbar=no,status=no,titlebar=no,toolbar=no," + 6 "screenX=0,screenY=0,top=0,left=0,width=" + 7 screen.width + ",height=" + screen.height/5*3; 8 9 window.open(url,'', window_features); 1 var last_id = 0; 2 3 function openwindow(url){ 4 var window_features = "scrollbars=yes,resizable=yes,location=no,menubar=no," + 5 "personalbar=no,status=no,titlebar=no,toolbar=no," + 6 "screenX=0,screenY=0,top=0,left=0,width=" + 7 screen.width + ",height=" + screen.height/5*3; 8 9 window.open(url,'', window_features); 10 10 } 11 11 12 12 var Main_pre_load = document.body.onload; 13 13 var ccSearch, ccTree; 14 var Main_load = function () 15 { 14 var Main_load = function () 15 { 16 16 Connector.setProgressBox(Element('cc_loading'), true); 17 Connector.setProgressHolder(Element('cc_loading_inner')); 17 Connector.setProgressHolder(Element('cc_loading_inner')); 18 18 /* Associate the Quick Add Button with the Plugin */ 19 19 20 20 21 21 /* Create the Search Object */ … … 37 37 ccSearch.DOMresult.style.visibility = 'hidden'; 38 38 ccSearch.onSearchFinish = ccSearchUpdate; 39 39 40 40 Connector.setProgressBox(Element('cc_loading'), true); 41 41 Connector.setProgressHolder(Element('cc_loading_inner')); 42 42 43 43 /* Create the Tree Object */ 44 ccTree = new ccCatalogTree({name: 'ccTree', id_destination: 'cc_tree', afterSetCatalog: 'ccSearchHidePanel(); updateCards()'}); 44 //ccTree = new ccCatalogTree({name: 'ccTree', id_destination: 'cc_tree', afterSetCatalog: 'ccSearchHidePanel(); updateCards()'}); 45 ccTree = new ccCatalogTree({name: 'ccTree', id_destination: 'cc_tree', afterSetCatalog: 'ccSearchHidePanel(); clearCards();'}); 45 46 46 47 ccTree.Connector = Connector; … … 64 65 var _timeout = ''; 65 66 var menu = function () { 66 67 67 68 if(! this.menuStarted) 68 69 this.menuStarted = true; 69 70 70 71 submenu = []; 71 72 textmenu = []; 72 73 73 74 textmenu[0] = ["cc_msg_contact_qa","cc_msg_contact_full","cc_msg_group"] 74 textmenu[1] = ["cc_quick_add", "cc_full_add", "cc_add_group"]; 75 textmenu[1] = ["cc_quick_add", "cc_full_add", "cc_add_group"]; 75 76 function show(){ 76 77 clearTimeout(_timeout); 77 78 button = document.getElementById("cc_button_new"); 78 79 this.style.top = 19 + findPosY(button) + "px"; 80 this.style.visibility='visible'; 79 80 this.style.top = 19 + findPosY(button) + "px"; 81 this.style.visibility='visible'; 81 82 } 82 83 function hide(){ _timeout = setTimeout("menu.style.visibility='hidden';",200); }; 83 84 84 85 if(document.getElementById) { 85 86 menu = document.getElementById("Layer1"); 86 87 87 88 for (i=0; i< textmenu[0].length; i++) { 88 89 textmenu[0][i] = "<span onclick= 'menu.onmouseout();'>" + document.getElementById(textmenu[0][i]).value + "</span><br>"; 89 submenu[i] = document.createElement("DIV"); 90 submenu[i] = document.createElement("DIV"); 90 91 submenu[i].innerHTML = textmenu[0][i]; 91 92 submenu[i].id = textmenu[1][i]; 92 93 submenu[i].onmouseover = function () {this.style.backgroundColor = 'LIGHTYELLOW';this.style.color = 'DARKBLUE';}; 93 submenu[i].onmouseout = function () { this.style.backgroundColor = '#DCDCDC'; this.style.color = '#006699';}; 94 submenu[i].onmouseout = function () { this.style.backgroundColor = '#DCDCDC'; this.style.color = '#006699';}; 94 95 submenu[i].setAttribute("className", "special"); 95 96 submenu[i].setAttribute("class", "special"); 96 submenu[i].style.padding = "5px"; 97 submenu[i].style.padding = "5px"; 97 98 menu.appendChild(submenu[i]); 98 } 99 99 } 100 100 101 menu.onmouseover = show; 101 102 menu.onmouseout = hide; 102 103 } 103 104 104 105 ccQuickAdd.associateAsButton(Element('cc_quick_add')); 105 106 ccAddGroup.associateAsButton(Element('cc_add_group')); 106 107 document.getElementById("cc_full_add").onclick= newContact; 107 108 108 109 109 110 ccQuickAdd.afterSave = function () 110 111 { 111 112 updateCards(); 112 } 113 114 ccAddGroup.load = function () 115 { 116 editGroup(); 117 } 118 113 } 114 115 ccAddGroup.load = function () 116 { 117 editGroup(); 118 } 119 119 120 ccAddGroup.afterSave = function () 120 121 { 121 122 updateCards(); 122 123 } 123 124 124 125 return true; 125 126 } … … 127 128 if (is_ie) 128 129 { 129 130 130 131 document.body.onload = function (e) 131 { 132 Main_pre_load(); 133 Main_load(); 134 132 { 133 Main_pre_load(); 134 Main_load(); 135 135 136 } 136 137 } 137 138 else 138 { 139 Main_load(); 140 141 } 139 { 140 Main_load(); 141 142 } 142 143 143 144 // BEGIN: FUNCTION RESIZE WINDOW … … 156 157 showBar = __showBar; 157 158 hideBar = __hideBar; 158 159 159 160 var _onResize = window.onresize; 160 161 window.onresize = resizeWindow; 161 162 var defaultHeight = 0; 162 163 function setDefaultHeight(){ 163 164 164 165 var bar = Element("toolbar"); 165 166 var offset = 0; 166 if(bar.style.visibility != 'hidden') 167 offset = (bar.offsetHeight ? bar.offsetHeight : bar.clientHeight); 167 if(bar.style.visibility != 'hidden') 168 offset = (bar.offsetHeight ? bar.offsetHeight : bar.clientHeight); 168 169 169 170 var screenHeight = document.body.clientHeight ? document.body.clientHeight : document.body.offsetHeight; 170 defaultHeight = screenHeight - offset; 171 Element("cc_tree").style.height = defaultHeight - 68; 172 Element("cc_left_main").style.height = defaultHeight - 68; 171 defaultHeight = screenHeight - offset; 172 Element("cc_tree").style.height = defaultHeight - 68; 173 Element("cc_left_main").style.height = defaultHeight - 68; 173 174 } 174 175 … … 176 177 setDefaultHeight(); 177 178 if(Element("divScrollMain")) 178 Element("divScrollMain").style.height = defaultHeight - 108; 179 Element("divScrollMain").style.height = defaultHeight - 108; 179 180 if (!is_ie) 180 181 Element('tableDivAppbox').width = '100%'; … … 184 185 setDefaultHeight(); 185 186 Element('cc_main').style.height = defaultHeight; 186 var lang_warn_firefox = Element('cc_msg_warn_firefox');187 var lang_firefox_msg1 = Element('cc_msg_firefox_half1');188 var lang_firefox_msg2 = Element('cc_msg_firefox_half2');189 var lang_install_now = Element('cc_msg_install_now');190 var lang_install_new_firefox = Element('cc_msg_install_new_firefox');191 var lang_close = Element('cc_msg_close');192 187 function buildWarningMsg(_version) { 193 188 var screenWidth = document.body.clientWidth ? document.body.clientWidth: document.body.offsetWidth; … … 196 191 "border:1px solid black;left:"+(screenWidth - 330)+";top:10px;width:300px;padding:10px;"+ 197 192 (document.body.clientWidth ? "-moz-border-radius: 9px 9px 9px 9px;'>" : "")+ 198 "<font color='RED' size='2'>"+lang_warn_firefox + "("+_version+")</font><BR>"+ 199 "<font color='black' size='2'><p style='text-align:justify'> "+lang_firefox_msg1+ 200 lang_firefox_msg2 + ".</p></font><div style='width:100%' align='center'>"+ 201 "<a title='"+lang_install_now+"' href='http://br.mozdev.org/firefox/download.html' target='_blank'>"+lang_install_new_firefox+ "</a>"+ 193 "<font color='RED' size='2'>Aviso: Versão muito antiga do Firefox ("+_version+")</font><BR>"+ 194 "<font color='black' size='2'><p style='text-align:justify'> Para que essa aplicação funcione <u>corretamente</u> "+ 195 "é necessário atualizar o seu navegador Firefox para uma versão mais nova (versão > 1.5). "+ 196 "Instale agora clicando no link abaixo ou caso queira atualizar mais tarde (não recomendável), clique em Fechar.</p></font><div style='width:100%' align='center'>"+ 197 "<a title='Instalar agora' href='http://br.mozdev.org/firefox/download.html' target='_blank'>Instalar nova versão do Firefox</a>"+ 202 198 " "+ 203 "<a title='"+lang_close+"' href='javascript:void(0)' onclick='javascript:myOpacity.toggle()'>"+lang_close+"</a></div>"+ 204 199 "<a title='Fechar' href='javascript:void(0)' onclick='javascript:myOpacity.toggle()'>Fechar</a></div>"+ 205 200 "</DIV>"; 206 201 … … 208 203 209 204 myOpacity = new fx.Opacity('warning_msg', {duration: 600}); 210 document.getElementById("warning_msg").style.visibility = 'hidden'; 205 document.getElementById("warning_msg").style.visibility = 'hidden'; 211 206 myOpacity.now = 0; 212 207 setTimeout("myOpacity.toggle()",3000); -
trunk/contactcenter/js/ccQuickAddContact.js
r118 r284 6 6 } 7 7 8 8 9 9 cQuickAddContact.prototype.showList = function(id){ 10 10 _this = this; 11 11 var handler = function (responseText) { 12 12 var contacts = unserialize(responseText); 13 var title = contacts['names_ordered']; 14 el = document.createElement("DIV"); 15 el.style.visibility = "hidden"; 13 var title = contacts['names_ordered']; 14 el = document.createElement("DIV"); 15 el.style.visibility = "hidden"; 16 16 el.style.position = "absolute"; 17 17 el.style.left = "0px"; … … 21 21 el.style.height = wHeight + 'px'; 22 22 el.className = "div_cc_rectQuickAddContact"; 23 el.id = id+':cc_rectQuickAddContact'; 24 document.body.appendChild(el); 25 el.innerHTML = ""; 23 el.id = id+':cc_rectQuickAddContact'; 24 document.body.appendChild(el); 25 el.innerHTML = ""; 26 26 27 27 var fieldsTop = 10; 28 28 var fieldsSpace = 30; 29 29 fields = new Array(Element('cc_qa_alias').value, Element('cc_qa_given_names').value, Element('cc_qa_family_names').value, Element('cc_qa_phone').value, Element('cc_qa_email').value); 30 30 31 31 for (i=0; i<fields.length; i++) { 32 32 var contact = contacts[i] != null ? contacts[i] : ''; 33 33 el.innerHTML += '<span id="ccQuickAddCT' + i + id + '" style="position: absolute; top: ' + (fieldsTop+i*fieldsSpace) + 'px; left: 5px; width: 100px; text-align: right; border: 0px solid #999;">' + fields[i] + '</span>'; 34 el.innerHTML += '<input id="ccQuickAddCI' + i + id + '" type="text" value="' + contact + '" maxlength="50" style="position: absolute; top: ' + (fieldsTop+i*fieldsSpace) + 'px; left: 110px; width: 135px;">'; 34 if (i == 0) 35 { 36 el.innerHTML += '<input id="ccQuickAddCI' + i + id + '" type="text" value="' + contact + '" maxlength="30" style="position: absolute; top: ' + (fieldsTop+i*fieldsSpace) + 'px; left: 110px; width: 135px;">'; 37 } 38 else if (i == 4) 39 { 40 el.innerHTML += '<input id="ccQuickAddCI' + i + id + '" type="text" value="' + contact + '" maxlength="100" style="position: absolute; top: ' + (fieldsTop+i*fieldsSpace) + 'px; left: 110px; width: 135px;">'; 41 } 42 else 43 { 44 el.innerHTML += '<input id="ccQuickAddCI' + i + id + '" type="text" value="' + contact + '" maxlength="50" style="position: absolute; top: ' + (fieldsTop+i*fieldsSpace) + 'px; left: 110px; width: 135px;">'; 45 } 35 46 } 36 47 37 48 el.innerHTML +='<div id="ccQAFuncitons" style="border: 0px solid black; width: 220px; height: 20px">' + 38 '<input title=" ' + Element('cc_qa_save').value + '"type="button" onclick="ccQuickAddContact.send(\'' + id + '\');" value="' + Element('cc_qa_save').value + '" style="position: absolute; top: ' + (fieldsTop+i*fieldsSpace) + 'px; left: 75px; width: 60px" />' +39 '<input title=" ' + Element('cc_qa_close').value + '" type="button" onclick="ccQuickAddContact.fechar(\'' + id + '\');" value="' + Element('cc_qa_close').value + '" style="position: absolute; top: ' + (fieldsTop+i*fieldsSpace) + 'px; left: 140px; width: 60px" />' +49 '<input title="ccQASave" type="button" onclick="ccQuickAddContact.send(\'' + id + '\');" value="' + Element('cc_qa_save').value + '" style="position: absolute; top: ' + (fieldsTop+i*fieldsSpace) + 'px; left: 75px; width: 60px" />' + 50 '<input title="ccQAClear" type="button" onclick="ccQuickAddContact.fechar(\'' + id + '\');" value="' + Element('cc_qa_clear').value + '" style="position: absolute; top: ' + (fieldsTop+i*fieldsSpace) + 'px; left: 140px; width: 60px" />' + 40 51 '</div>'; 41 52 el.innerHTML += "<br>"; 42 53 43 54 _this.showWindow(el); 44 55 } 45 56 46 57 div = document.getElementById(id+':cc_rectQuickAddContact'); 47 58 48 59 if(div) 49 60 this.showWindow(div); … … 52 63 } 53 64 } 54 65 55 66 cQuickAddContact.prototype.showWindow = function (div) 56 { 67 { 57 68 if(! this.arrayWin[div.id]) { 58 69 59 win = new dJSWin({ 70 win = new dJSWin({ 60 71 id: 'ccQuickAddContact_'+div.id, 61 72 content_id: div.id, … … 64 75 title_color: '#3978d6', 65 76 bg_color: '#eee', 66 title: Element('ccQATitle').value, 77 title: Element('ccQATitle').value, 67 78 title_text_color: 'white', 68 79 button_x_img: Element('cc_phpgw_img_dir').value+'/winclose.gif', 69 80 border: true }); 70 81 71 82 this.arrayWin[div.id] = win; 72 win.draw(); 83 win.draw(); 73 84 } 74 85 else { 75 86 win = this.arrayWin[div.id]; 76 } 87 } 77 88 win.open(); 78 89 } 79 90 80 91 cQuickAddContact.prototype.send = function (id) 81 92 { … … 104 115 return; 105 116 } 106 117 107 118 win.close(); 108 119 … … 121 132 } 122 133 } 123 134 124 135 var sdata = new Array(); 125 136 126 137 for (var f = 0; f < 5; f++){ 127 138 sdata[f] = document.getElementById('ccQuickAddCI' + f + id).value; 128 139 } 129 140 130 141 //Utiliza expressão regular para validar email 131 142 var reEmail = /^[A-Za-z\d_-]+(\.[A-Za-z\d_-]+)*@(([A-Za-z\d][A-Za-z\d-]{0,61}[A-Za-z\d]\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/; … … 136 147 return false; 137 148 } 138 149 139 150 //Utiliza expressão regular para validar telefone 140 151 var rePhone = /^[0-9|(-)| |-]{0,15}$/; 141 152 142 153 if (!rePhone.test(sdata[3])){ 143 154 alert("O número de telefone '" + sdata[3] + "' não é valido! Utilize apenas números.\n" + 144 155 "Parenteses, traços ou espaços em branco podem ser usados como carácter separador."); 145 156 return false; 146 } 147 157 } 158 148 159 var sdata = 'add='+escape(serialize(sdata)); 149 160 150 161 Connector.newRequest('cQuickAdd.Send', CC_url+'quick_add', 'POST', handler, sdata); 151 162 } 152 163 153 164 cQuickAddContact.prototype.fechar = function(id) { 154 165 155 166 div = document.getElementById(id+':cc_rectQuickAddContact'); 156 167 win = this.arrayWin[div.id]; 157 168 win.close(); 158 169 } 159 160 170 171 161 172 /* Build the Object */ 162 173 var ccQuickAddContact ; … … 164 175 165 176 if (is_ie) 166 { 167 document.body.onload = function (e) 168 { 177 { 178 document.body.onload = function (e) 179 { 169 180 cQuickAddContact_pre_load(); 170 181 ccQuickAddContact = new cQuickAddContact(); 171 182 172 183 }; 173 184 } -
trunk/contactcenter/js/cc_search.js
r2 r284 60 60 this.DOMinput.value = params['value'] ? params['value'] : ''; 61 61 this.DOMinput.style.width = params['input_width'] ? params['input_width'] : '200px'; 62 this.DOMinput.onkeypress = function (e) { 62 this.DOMinput.onkeypress = function (e) { 63 63 if (is_ie) 64 64 { … … 86 86 if (params['progress_color']) 87 87 this.DOMprogHold.style.color = params['progress_color']; 88 88 89 89 this.DOMresult.style.position = 'absolute'; 90 90 this.DOMresult.style.top = params['progress_top'] ? params['progress_top'] : '0px'; … … 96 96 this.DOMresult.style.color = params['progress_color']; 97 97 98 this.DOMholder.appendChild(this.DOMdiv); 98 this.DOMholder.appendChild(this.DOMdiv); 99 99 this.DOMdiv.appendChild(this.DOMfields); 100 100 this.DOMdiv.appendChild(this.DOMinput); … … 104 104 this.DOMdiv.appendChild(this.DOMresult); 105 105 } 106 106 107 107 ccSearchClass.prototype.go = function() 108 108 { 109 109 var data = new Array(); 110 110 111 111 this.DOMresult.innerHTML = ''; 112 112 113 113 //TODO: Make Generic! 114 114 var type = Element('cc_type_contact').value; 115 115 116 116 data['fields'] = new Array(); 117 117 118 118 if (type == 'groups') { 119 data['fields']['id'] = 'group.id_group'; 119 data['fields']['id'] = 'group.id_group'; 120 120 data['fields']['search'] = 'group.title'; 121 } 122 else { 123 data['fields']['id'] = 'contact.id_contact'; 124 data['fields']['search'] = 'contact.names_ordered'; 125 } 126 121 } 122 else { 123 data['fields']['id'] = 'contact.id_contact'; 124 data['fields']['search'] = 'contact.names_ordered'; 125 } 126 127 127 data['search_for'] = this.DOMinput.value; 128 128 //data['recursive'] = this.recursive.checked ? true : false; 129 129 // Exige que a consulta por nome seja feita com no mínimo 4 caracteres 130 var search_for = data['search_for'].split(' '); 131 var greaterThan4 = false; 132 133 for (i = 0; i < search_for.length; i++) 134 { 135 if (search_for[i].length >= 4) 136 { 137 greaterThan4 = true; 138 } 139 } 140 141 if (!greaterThan4){ 142 alert("Favor fazer a consulta com pelo menos 4 caracteres!"); 143 return; 144 } 145 130 146 var _this = this; 131 147 148 var handler = function (responseText) 149 { 150 var data = new Array(); 151 data = unserialize(responseText); 152 153 ccSearchUpdate(); 154 155 letter = 'search'; 156 157 if ( letter != CC_actual_letter ) 158 { 159 CC_actual_page = '1'; 160 } 161 else 162 { 163 CC_actual_page = parseInt(data[1]); 164 } 165 166 CC_actual_letter = letter; 167 168 if (CC_max_cards[0] == 0) 169 { 170 171 if(CC_visual == 'cards') 172 drawCards(0); 173 else if(CC_visual == 'table') 174 drawTable(0); 175 176 setPages(0,0); 177 return; 178 } 179 180 if (data[0] == '0') 181 { 182 Element('cc_type_contact').value = data[1]; 183 CC_npages = 0; 184 CC_actual_page = 1; 185 if(CC_visual == 'cards') 186 drawCards(0); 187 else if(CC_visual == 'table') 188 drawTable(0); 189 setPages(0,0); 190 return; 191 } 192 else 193 { 194 Element('cc_type_contact').value = data[10]; 195 } 196 197 // Element('cc_debug').innerHTML = responseText; 198 199 if (typeof(data) != 'object') 200 { 201 showMessage(Element('cc_msg_err_contacting_server').value); 202 return; 203 } 204 205 if (typeof(data[3]) == 'object') 206 { 207 CC_npages = parseInt(data[0]); 208 CC_actual_page = parseInt(data[1]); 209 if(CC_visual == 'cards') 210 drawCards(data[3].length, data[10]); 211 else if(CC_visual == 'table') 212 drawTable(data[3].length, data[10]); 213 resizeWindow(); 214 populateCards(data, data[10]); 215 setPages(data[0], data[1]); 216 } 217 else if (data['error']) 218 { 219 showMessage(data['error']); 220 } 221 else 222 { 223 showMessage(Element('cc_msg_err_contacting_server').value); 224 return; 225 } 226 227 228 }; 229 230 231 /* 132 232 var handler = function (responseText) 133 233 { 134 234 Element('cc_debug').innerHTML = responseText; 135 235 136 236 var data = unserialize(responseText); 137 237 138 238 if (!data || !data['status']) 139 239 { … … 147 247 _this.DOMresult.innerHTML = data['msg']; 148 248 setTimeout(function(){_this.DOMresult.innerHTML = '';}, 1000); 149 249 150 250 if (_this.onSearchFinish) 151 251 { … … 163 263 } 164 264 165 //showMessage(data['msg']); 265 // Mostra a mensagem se a busca retornar mais de 300 resultados. 266 if (data['data'].length > 300) 267 { 268 269 TODO: Usar o esquema de tradução do expresso para este alert 270 271 alert("Mais de 300 resultados foram retornados!\n" + 272 "Favor refinar sua busca."); 273 } 166 274 167 275 if (_this.onSearchFinish) … … 170 278 } 171 279 }; 172 173 this.Connector.newRequest('search', CC_url+'search&data='+serialize(data), 'GET', handler); 280 */ 281 var info = "letter="+'search'+"&page="+'1'+"&data="+serialize(data); 282 this.Connector.newRequest('get_cards_data', CC_url+'get_cards_data', 'POST', handler, info); 174 283 } -
trunk/contactcenter/js/cc_tree.js
r56 r284 20 20 throw('dFTree lib must be loaded!'); 21 21 } 22 22 23 23 function ccCatalogTree(params) 24 24 { … … 29 29 30 30 var _tree = this; 31 31 32 32 /* This is the property that holds the Tree Object */ 33 33 this.name = params['name']; … … 39 39 this.Connector = params['connector']; 40 40 41 /* Build the Inicial Tree */ 41 /* Build the Inicial Tree */ 42 42 //this._getActualLevel(); 43 43 setTimeout(function(){ _tree._updateTree('0', true);}, 100); … … 57 57 return; 58 58 } 59 59 60 60 if (data['status'] != 'ok') 61 61 { … … 66 66 67 67 _this.catalog_perms = parseInt(data['perms']); 68 68 69 69 if (_this.afterSetCatalog) 70 70 { … … 75 75 Connector.newRequest(this.name+'catalog', CC_url+'set_catalog&catalog='+catalog, 'GET', handler); 76 76 } 77 77 78 78 ccCatalogTree.prototype.setCatalogSearch = function (catalog) { 79 79 80 80 var _this = this; 81 81 var handler = function (responseText) … … 89 89 return; 90 90 } 91 91 92 92 if (data['status'] != 'ok') 93 93 { … … 100 100 101 101 this.afterSetCatalog = ccEmailWin.search.go(); 102 102 103 103 }; 104 104 105 105 Connector.newRequest(this.name+'catalog', CC_url+'set_catalog&catalog='+catalog, 'GET', handler); 106 106 } 107 108 107 108 109 109 ccCatalogTree.prototype.select = function(level, search) 110 110 { 111 if (!search) { 111 if (!search) { 112 112 this.tree.openTo(level); 113 113 this.tree.getNodeById(level)._select(); 114 114 115 115 if (level != this.actualLevel) 116 116 { … … 129 129 * Methods For Internal Use * 130 130 \*************************************************************************/ 131 131 132 132 ccCatalogTree.prototype._waitForTree = function(level, rlevel) 133 133 { … … 142 142 return; 143 143 } 144 144 145 145 setTimeout(this.name+'._waitForTree(\''+level+'\', '+rlevel+')', 100); 146 146 } … … 176 176 _this.tree.getNodeById(_this.actualLevel)._select(); 177 177 _this.setCatalog(_this.actualLevel); 178 _this.expandTree(); 179 180 } 181 }; 182 178 } 179 }; 180 183 181 Connector.newRequest(this.name+'actual', CC_url+'get_actual_catalog', 'GET', handler); 184 182 } 185 183 186 ccCatalogTree.prototype.expandTree = function() {187 for (i=0; i < this.tree._aNodes.length; i++)188 this._expandSubTree(this.tree._aNodes[i]);189 }190 191 ccCatalogTree.prototype._expandSubTree = function(node) {192 if ( node._children == '' ) {193 return;194 }195 if (node._children != '') {196 for (i = 0; i <= node._children.length; i++) {197 if ( node._io == false )198 node.changeState();199 this._expandSubTree(node._children[i]);200 }201 }202 }203 204 205 184 ccCatalogTree.prototype._updateTree = function(level, open) 206 185 { … … 222 201 { 223 202 showMessage(data['msg']); 224 return; 203 if (data['status'] != 'error') 204 { 205 return; 206 } 225 207 } 226 208 227 209 treeData = data['data']; 228 210 229 211 var timeout = 10; 230 212 var limit = 0; … … 261 243 timeout += 5; 262 244 } 263 245 264 246 _this.treeAvailable = true; 265 247 … … 271 253 } 272 254 }; 255 273 256 Connector.newRequest(this.name+'update', CC_url+'get_catalog_tree&level='+level, 'GET', handler); 274 257 }
Note: See TracChangeset
for help on using the changeset viewer.