Changeset 5131 for trunk/contactcenter/js/cc.js
- Timestamp:
- 11/03/11 11:17:35 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/contactcenter/js/cc.js
r4507 r5131 231 231 function openContactDetails(id){ 232 232 // Build the ContactDetails Window. 233 if( !contactdetailsWin&& !is_ie)233 if((typeof(contactdetailsWin) == 'undefined') && !is_ie) 234 234 __cdWin(); 235 235 … … 996 996 for (var type in CC_contact_full_info['connections']){ 997 997 haveConnections = true; 998 var reEmail = /^[a-zA-Z0-9][_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]{1,})*$/; 998 999 for (var i in CC_contact_full_info['connections'][type]){ 1000 if(type == 1){ 1001 if(!reEmail.test(CC_contact_full_info['connections'][type][i]['value'])){ 1002 showMessage('Endereço para conexão de ' + CC_contact_full_info['connections'][type][i]['name'] + ', não é válido'); 1003 return false; 1004 } 1005 } 1006 else{ 999 1007 if((CC_contact_full_info['connections'][type][i]['value'].length < 4) || 1000 1008 (!comp.test(CC_contact_full_info['connections'][type][i]['value']))){ … … 1002 1010 return false; 1003 1011 } 1012 } 1004 1013 } 1005 1014 var _options_default = Element("cc_"+(type == 1 ? 'email' : 'phone')+"_default"); … … 1009 1018 } 1010 1019 } 1011 }1012 if(!haveConnections){1013 showMessage(Element('cc_msg_tel_or_mail_required').value);1014 return false;1015 1020 } 1016 1021 … … 1634 1639 //'<td style="width: 30px;" align="right"><input name="cc_conn_is_default" id="cc_conn_is_default_'+ CC_conn_count +'" type="radio"></td>'+ 1635 1640 '<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>' + 1636 '<td align="left"><input id="cc_conn_value_'+ CC_conn_count +'" style="width: 150px;" maxlength="100" type="text"> ' +1641 '<td align="left"><input id="cc_conn_value_'+ CC_conn_count +'" onkeyup="javascript:emailTolower(\'cc_conn_value_' + CC_conn_count + '\')" style="width: 150px;" maxlength="100" type="text"> ' + 1637 1642 '<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>'; 1638 1643 } … … 1642 1647 //'<td style="width: 30px;" align="right"><input name="cc_conn_is_default" id="cc_conn_is_default_'+ CC_conn_count +'" type="radio"></td>'+ 1643 1648 '<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>' + 1644 '<td align="left"><input id="cc_conn_value_'+ CC_conn_count +'" style="width: 150px;" maxlength="30" type="text" onkeyup="formatPhone(this)"> ' +1649 '<td align="left"><input id="cc_conn_value_'+ CC_conn_count +'" onkeyup="javascript:emailTolower(\'cc_conn_value_' + CC_conn_count + '\')" style="width: 150px;" maxlength="30" type="text" onkeyup="formatPhone(this)"> ' + 1645 1650 '<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>'; 1646 1651 } … … 1806 1811 1807 1812 connRemoveLine(id); 1813 } 1814 1815 function emailTolower(obj){ 1816 document.getElementById(obj).value = document.getElementById(obj).value.toLowerCase(); 1817 1808 1818 } 1809 1819 … … 2308 2318 2309 2319 if(data[3][pos][k] === 'none') 2310 data[3][pos][k] = ' ';2320 "Não informado."; 2311 2321 break; 2312 2322 case 'cc_phone' : 2313 2323 2314 2324 if(data[3][pos][k] === 'none') 2315 data[3][pos][k] = ' ';2325 data[3][pos][k] = "Não informado."; 2316 2326 break; 2317 2327 } … … 2352 2362 else 2353 2363 { 2364 if(data[3][pos][k] != "Não informado.") 2354 2365 Element(id+':'+data[2][k]).innerHTML = data[5] + data[3][pos][k] + '\')">'+ data[3][pos][k]+'</span>'; 2366 else 2367 Element(id+':'+data[2][k]).innerHTML = data[13] + data[3][pos][k] + '\')">'+ data[3][pos][k]+'</span>'; 2355 2368 } 2356 2369 break; … … 2366 2379 Element(id+':'+data[2][k]).innerHTML = adjustString(data[3][pos][k], 20); 2367 2380 } 2381 if(data[3][pos][k] != " ") 2368 2382 Element(id+':cc_phone').innerHTML = (data[3][pos][k].length < 23) ? data[3][pos][k]:data[3][pos][k].substr(0,22)+"<br>"+data[3][pos][k].substr(22,data[3][pos][k].length); 2383 else 2384 Element(id+':cc_phone').innerHTML = "Não informado."; 2369 2385 break; 2370 2386 2371 2387 case 'cc_title': 2372 if (data[3][pos][k].length > 15) 2388 if(preferences.departmentShow && ccTree.catalog_perms == 1){ 2389 if(data[3][pos][k] == " " || data[3][pos][k] == "" || data[3][pos][k] == "undefined"){ 2390 Element(id+':'+data[2][k]).innerHTML = "Não informado."; 2391 } 2392 else if (data[3][pos][k].length > 15) 2373 2393 { 2374 2394 Element(id+':'+data[2][k]).innerHTML = adjustString(data[3][pos][k], 15); … … 2380 2400 } 2381 2401 break; 2382 2402 }else{ 2403 break; 2404 } 2383 2405 case 'cc_id': 2384 2406 var id_contact = data[3][pos][k]; … … 2410 2432 //Para tratar tamanho do campo "celular" do empregado 2411 2433 case 'cc_mobile': 2434 if(preferences.cellShow && ccTree.catalog_perms == 1){ 2412 2435 if (data[3][pos][k].length > 20) 2413 2436 { … … 2421 2444 Element(id+':cc_mobile').innerHTML = data[3][pos][k]; 2422 2445 break; 2423 2446 }else{ 2447 break; 2448 } 2424 2449 //Para tratar tamanho do campo "matricula" do empregado 2425 2450 case 'cc_empNumber': 2451 if(preferences.empNumShow && ccTree.catalog_perms == 1){ 2426 2452 if (data[3][pos][k].length > 20) 2427 2453 { … … 2435 2461 Element(id+':cc_empNumber').innerHTML = data[3][pos][k]; 2436 2462 break; 2437 2463 }else{ 2464 break; 2465 } 2438 2466 //Para tratar tamanho do campo "departamento" do empregado 2439 2467 case 'cc_department': … … 2461 2489 Element(id+':'+data[2][k]).innerHTML = data[3][pos][k]; 2462 2490 } 2491 } 2492 }else{ 2493 data[3][pos][k] = unescape(data[3][pos][k]); 2494 switch (data[2][k]) 2495 { 2496 case 'cc_mail': 2497 Element(id+':'+data[2][k]).innerHTML = data[13] + "Não informado." + '\')">'+ "Não infomardo." +'</span>'; 2498 break; 2499 2500 case 'cc_phone': 2501 Element(id+':cc_phone').innerHTML = "Não informado."; 2502 break; 2503 case 'cc_empNumber': 2504 if(preferences.empNumShow && ccTree.catalog_perms == 1){ 2505 var cc_empNumberTD = Element(id+':cc_empNumber').parentNode; 2506 cc_empNumberTD.parentNode.removeChild(cc_empNumberTD); 2507 } 2508 break; 2509 case 'cc_mobile': 2510 if(preferences.cellShow && ccTree.catalog_perms == 1){ 2511 var cc_mobileTD = Element(id+':cc_mobile').parentNode; 2512 cc_mobileTD.parentNode.removeChild(cc_mobileTD); 2513 } 2514 break; 2515 case 'cc_title': 2516 if(preferences.departmentShow && ccTree.catalog_perms == 1){ 2517 var cc_titleTD = Element(id+':cc_title').parentNode; 2518 cc_titleTD.parentNode.removeChild(cc_titleTD); 2519 } 2520 break; 2463 2521 } 2464 2522 } … … 2515 2573 { 2516 2574 case 'cc_title': 2517 if (data[3][pos][k].length > 50)2575 if (data[3][pos][k].length > (CC_visual == 'table' ? 50 : 20)) 2518 2576 { 2519 Element(id+':'+data[2][k]).innerHTML = adjustString(data[3][pos][k], 50);2577 Element(id+':'+data[2][k]).innerHTML = adjustString(data[3][pos][k], (CC_visual == 'table' ? 50 : 20)); 2520 2578 Element(id+':'+data[2][k]).title = data[3][pos][k]; 2521 2579 } … … 2663 2721 '<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">' : '') + 2664 2722 '<img id="' + id + ':cc_photo" style="position: absolute; top: 15px; left: 7px;" src="" border="0" ondblclick="editContact(Element(\'' + id + ':cc_id\').value);">' + 2665 '<span id="' + id + ':cc_company" style="position: absolute; top: 5px; left: 75px; width: 135px; border: 0px solid #999; font-weight: bold; font-size: 1 4px; text-align: center; height: 10px;" onmouseover="//Element(\''+id+':cc_company_full\').style.visibility=\'visible\'" onmouseout="//Element(\''+id+':cc_company_full\').style.visibility=\'hidden\'"></span>' +2723 '<span id="' + id + ':cc_company" style="position: absolute; top: 5px; left: 75px; width: 135px; border: 0px solid #999; font-weight: bold; font-size: 10px; text-align: center; height: 10px;" onmouseover="//Element(\''+id+':cc_company_full\').style.visibility=\'visible\'" onmouseout="//Element(\''+id+':cc_company_full\').style.visibility=\'hidden\'"></span>' + 2666 2724 '<span style="cursor: pointer; cursor: hand; z-index: 1;position: absolute; top: 100px; left: 35px" valign="bottom" id="' + id + ':cc_icon_group"> </span>'+ 2667 2725 //Para exibir a matricula do empregado nos cartoes 2668 '<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>' +2726 '<span id="' + id + ':cc_empNumber" style="position: absolute; top: 20px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 9px; text-align: center; height: 10px;"></span>' + 2669 2727 '<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>' + 2670 '<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>' +2728 '<span id="' + id + ':cc_title" style="position: absolute; top: 90px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 12px; text-align: center; height: 10px;"></span>' + 2671 2729 //Para exibir o setor/lotacao do empregado nos cartoes 2672 2730 '<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>' + … … 2694 2752 '<span id="' + id + ':cc_participantes" style="cursor: pointer; cursor: hand; z-index: 1"></span>' + 2695 2753 '<span id="' + id + ':cc_title"></span></td>' + 2696 '<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+'\'"id="' + id + ':cc_short_name"></span></td>' +2697 '<td align=" left" width="55px">'+2754 '<td width="40%" style="solid #999; font-weight: normal; font-size: 10px; text-align: left; height: 10px"><span id="' + id + ':cc_short_name"></span></td>' + 2755 '<td align="center" width="10%">'+ 2698 2756 '<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">' + 2699 2757 ' | '+ … … 2705 2763 html_card = '<tr style="height:20px" id="' + id + '" onmouseout="'+bg+'" onmouseover="this.style.background=\'LIGHTYELLOW\'" bgcolor="EEEEEE">' + 2706 2764 //Para exibir a matricula do empregado na tabela 2707 (preferences.empNumShow && ccTree.catalog_perms == 1 ? '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_empNumber"></span></td>' : '') +2765 (preferences.empNumShow && ccTree.catalog_perms == 1 ? '<td align="center" width="10%" name="cc_name_empNumber" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_empNumber"></span></td>' : '') + 2708 2766 '<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>' + 2709 '<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>' +2710 '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_phone"></span></td>' +2767 '<td width="20%" align="center" name="cc_name_send_mail" style="solid #999; font-weight: normal; font-size: 10px; height: 10px"><span onMouseOver="this.title = \''+Element('cc_send_mail').value+' => '+'\'+document.getElementById(\''+id + ':cc_name\').innerHTML" id="' + id + ':cc_mail"></span></td>' + 2768 '<td width="20%" align="center" name="cc_name_phone" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_phone"></span></td>' + 2711 2769 //Para exibir o celular empresarial do empregado na tabela 2712 (preferences.cellShow && ccTree.catalog_perms == 1 ? '<td align="center" n owrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_mobile"></span></td>' : '') +2770 (preferences.cellShow && ccTree.catalog_perms == 1 ? '<td align="center" name="cc_name_mobile" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_mobile"></span></td>' : '') + 2713 2771 //Para exibir o setor/lotacao do empregado na tabela 2714 (preferences.departmentShow && ccTree.catalog_perms == 1 ? '<td align="center" n owrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_department"></span></td>' : '') +2772 (preferences.departmentShow && ccTree.catalog_perms == 1 ? '<td align="center" name="cc_name_title" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_title"></span></td>' : '') + 2715 2773 ( ccTree.catalog_perms == 1 ? 2716 '<td align=" left"><span valign="bottom" id="' + id + ':cc_icon_data"></span></td>':'') +2774 '<td align="center" width="10%"><span valign="bottom" id="' + id + ':cc_icon_data"></span></td>':'') + 2717 2775 (ccTree.catalog_perms & 2 ? 2718 '<td align=" left" >'+2776 '<td align="center" width="10%" >'+ 2719 2777 '<img title="'+Element('cc_msg_card_edit').value+'" id="' + id + ':cc_card_edit" style=" cursor: pointer; cursor: hand; z-index: 1;width: 18px; height: 18px;" onclick="editContact(Element(\'' + id + ':cc_id\').value);" src="templates/default/images/cc_card_edit.png">' + 2720 2778 ' | '+ … … 2722 2780 '<input id="' + id + ':cc_id" type="hidden">'+ 2723 2781 '<input type="hidden" id="' + id + ':cc_photo">' + 2724 '<span id="' + id + ':cc_title" style="display:none"></span>' +2782 //'<span id="' + id + ':cc_mobile" style="display:none"></span>' + 2725 2783 '<span id="' + id + ':cc_alias" style="display:none"></span>' + 2726 2784 // Esse campo é necessário se o contato possui dados no campo cc_company
Note: See TracChangeset
for help on using the changeset viewer.