Changeset 1496 for trunk/contactcenter/js
- Timestamp:
- 10/06/09 10:27:46 (15 years ago)
- Location:
- trunk/contactcenter/js
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/contactcenter/js/cc.js
r1280 r1496 38 38 \***********************************************/ 39 39 40 var owners = new Array(); 41 var flag_compartilhado = false; 42 var qtd_compartilhado = 0; 43 40 44 var CC_visual = 'table'; 41 45 /* Cards Variables */ … … 172 176 Element("cc_conn_type_sel").disabled = true; 173 177 Element("cc_conn_type_sel").selectedIndex = 0; 178 Element("cc_contact_sharing").style.display = 'none'; 179 } 180 181 function openFullAddShared(){ 182 if (flag_compartilhado) 183 { 184 if(!fullAddWin && !is_ie) 185 __f(); 186 187 resetFullAdd(); 188 populateFullAddConst(); 189 fullAddWin.open(); 190 tabs._showTab('cc_contact_tab_0'); 191 Element("cc_conn_type_1").checked = false; 192 Element("cc_conn_type_2").checked = false; 193 Element("cc_conn_type_sel").disabled = true; 194 Element("cc_conn_type_sel").selectedIndex = 0; 195 Element("cc_contact_sharing").align = 'center'; 196 Element("cc_contact_sharing").style.display = 'block'; 197 Element("cc_contact_shared_types").disabled = true; 198 populateSharingSelect(); 199 } else 200 { 201 if(qtd_compartilhado != 0) 202 { 203 ccTree.select(0.2); 204 ccTree.setCatalog(0.2); 205 if(!fullAddWin && !is_ie) 206 __f(); 207 resetFullAdd(); 208 populateFullAddConst(); 209 fullAddWin.open(); 210 tabs._showTab('cc_contact_tab_0'); 211 Element("cc_conn_type_1").checked = false; 212 Element("cc_conn_type_2").checked = false; 213 Element("cc_conn_type_sel").disabled = true; 214 Element("cc_conn_type_sel").selectedIndex = 0; 215 Element("cc_contact_sharing").aling = 'center'; 216 Element("cc_contact_sharing").style.display = 'block'; 217 Element("cc_contact_shared_types").disabled = true; 218 populateSharingSelect(); 219 } else 220 showMessage(Element('cc_msg_err_shared').value); 221 } 174 222 } 175 223 … … 180 228 function newContact(){ 181 229 openFullAdd(); 230 } 231 function newSharedContact(){ 232 openFullAddShared(); 182 233 } 183 234 /************ Edit Contact *************/ … … 202 253 Updates all the constant fields in the 203 254 full add window, like Prefixes, Suffixes, 204 Countries and Types255 Countries, Types and Shared catalogs 205 256 */ 257 258 function populateSharingSelect() 259 { 260 var handler = function(responseText) 261 { 262 var data = unserialize(responseText); 263 var sharers = Element('cc_contact_shared_types'); 264 265 if (typeof(data) != 'object') 266 { 267 showMessage(Element('cc_msg_err_contacting_server').value); 268 return; 269 } 270 271 if (typeof(data[3]) == 'object') 272 { 273 sharers.disabled = false; 274 var i = 1; 275 if (data[6].length != 0) 276 { 277 for (var j in data[6]) 278 { 279 sharers.options[i] = new Option(data[6][j]['cn'], j); 280 owners[i] = j; 281 i++; 282 } 283 } else 284 sharers.disabled = true; 285 return; 286 } else 287 { 288 showMessage(Element('cc_msg_err_contacting_server').value); 289 fullAddWin.close(); 290 return; 291 } 292 293 }; 294 Connector.newRequest('populateSharingSelect', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_cards_data', 'POST', handler); 295 } 296 206 297 function populateFullAddConst() 207 298 { … … 442 533 CC_full_add_photo = true; 443 534 } 444 445 setTimeout('postFullAddInfo()', 100); 535 if (Element('cc_contact_sharing').style.display == 'none') 536 setTimeout('postFullAddInfo()', 100); 537 else 538 setTimeout('postFullAddInfoShared()', 100); 446 539 } 447 540 … … 467 560 updateCards(); 468 561 }; 469 470 562 Connector.newRequest('postFullAddInfo', CC_url+'post_full_add', 'POST', handler, getFullAddData()); 563 } 564 565 function postFullAddInfoShared() 566 { 567 var handler = function (responseText) 568 { 569 var data = unserialize(responseText); 570 if (typeof(data) != 'object') 571 { 572 showMessage(Element('cc_msg_err_contacting_server').value); 573 return; 574 } 575 576 if (data['status'] != 'ok') 577 { 578 showMessage(data['msg']); 579 return; 580 } 581 582 fullAddWin.close(); 583 updateCards(); 584 }; 585 Connector.newRequest('postFullAddInfoShared', CC_url+'post_full_add_shared', 'POST', handler, getFullAddData()); 471 586 } 472 587 … … 476 591 var empty = true; 477 592 var replacer = '__##AND##__'; 478 593 479 594 data['commercialAnd'] = replacer; 480 595 … … 484 599 data.length++; 485 600 } 486 601 602 /* Owner do contato (Para o caso de adicao de contato compartilhado) */ 603 if (Element('cc_contact_sharing').style.display == 'block') 604 { 605 var index = Element('cc_contact_shared_types').selectedIndex; 606 data['owner'] = replaceComAnd(owners[index], replacer); 607 data.length++; 608 } 609 487 610 /* Status: Full Added */ 488 611 data['id_status'] = CC_STATUS_FULL_ADD; … … 580 703 } 581 704 705 var serial = serialize(data); 582 706 return 'data=' + escape(serialize(data)); 583 707 } … … 585 709 function checkFullAdd() 586 710 { 711 712 /* Checa se o listbox esta desativado ou é nulo, ou seja, não existe catálogos compartilhados com o user atual */ 713 714 if (!(Element('cc_contact_sharing').style.display == 'none' )) 715 { 716 if (Element('cc_contact_shared_types').disabled == true) 717 { 718 showMessage('Nenhum catálogo compartilhado existente'); 719 return false; 720 } 721 if (Element('cc_contact_shared_types').selectedIndex == 0) 722 { 723 showMessage('Nenhum catálogo selecionado'); 724 return false; 725 } 726 } 727 587 728 /* Check Personal Data */ 588 589 729 if (Element('cc_pd_given_names').value == '') 590 730 { … … 1633 1773 return; 1634 1774 } 1635 1775 1636 1776 var handler = function (responseText) 1637 1777 { … … 1914 2054 Element(id+':'+data[2][k]).innerHTML = data[3][pos][k]; 1915 2055 } 1916 if(data[3][pos][9]) 1917 Element(id+':'+data[2][k]).innerHTML += "<br><span style='margin-left:30px'><font size='-2' color='#808080'><i>"+data[3][pos][9]+"</i></font></span>"; 2056 if(data[3][pos][9]){ 2057 Element(id+':'+data[2][k]).innerHTML += "<br><span style='margin-left:30px'><font size='-2' color='#808080'><i>"+data[3][pos][9]+"</i></font></span>"; } 1918 2058 break; 1919 2059 … … 2337 2477 { 2338 2478 var data = new Array(); 2339 2479 flag_compartilhado = false; 2340 2480 if ( letter != CC_actual_letter ) 2341 2481 { … … 2360 2500 return; 2361 2501 } 2502 2362 2503 2363 2504 var handler = function (responseText) … … 2390 2531 if (typeof(data[3]) == 'object') 2391 2532 { 2533 if (data[8] == 'bo_shared_people_manager') 2534 { 2535 flag_compartilhado = true; 2536 } 2537 else 2538 { 2539 flag_compartilhado = false; 2540 } 2541 qtd_compartilhado = data[9]; 2392 2542 CC_npages = parseInt(data[0]); 2393 2543 CC_actual_page = parseInt(data[1]); -
trunk/contactcenter/js/ccMain.js
r575 r1496 91 91 submenu = []; 92 92 textmenu = []; 93 94 textmenu[0] = ["cc_msg_contact_qa","cc_msg_contact_full","cc_msg_ group"]95 textmenu[1] = ["cc_quick_add", "cc_full_add_button", "cc_ add_group_button"];93 94 textmenu[0] = ["cc_msg_contact_qa","cc_msg_contact_full","cc_msg_contact_sh","cc_msg_group"]; 95 textmenu[1] = ["cc_quick_add", "cc_full_add_button", "cc_full_add_button_sh", "cc_add_group_button"]; 96 96 function show(){ 97 97 clearTimeout(_timeout); … … 104 104 105 105 if(document.getElementById) { 106 106 107 menu = document.getElementById("Layer1"); 107 108 … … 126 127 ccAddGroup.associateAsButton(Element('cc_add_group_button')); 127 128 Element("cc_full_add_button").onclick = newContact; 128 129 Element("cc_full_add_button_sh").onclick = newSharedContact; 130 129 131 130 132 ccQuickAdd.afterSave = function () -
trunk/contactcenter/js/ccQuickAddContact.js
r285 r1496 45 45 } 46 46 } 47 47 48 48 49 el.innerHTML +='<div id="ccQAFuncitons" style="border: 0px solid black; width: 220px; height: 20px">' + 49 50 '<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" />' +
Note: See TracChangeset
for help on using the changeset viewer.