Changeset 4500 for sandbox/2.2.0.2/contactcenter/js
- Timestamp:
- 05/25/11 10:47:52 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/2.2.0.2/contactcenter/js/cc.js
r4498 r4500 227 227 function closeFullAdd(){ 228 228 fullAddWin.close(); 229 } 230 /******** Contact details ***********/ 231 function openContactDetails(id){ 232 // Build the ContactDetails Window. 233 if(!contactdetailsWin && !is_ie) 234 __cdWin(); 235 236 contactdetailsWin.open(); 237 238 populateContactDetails(id); 239 } 240 241 function populateContactDetails(id) 242 { 243 var handler = function(responseText) 244 { 245 var fieldsDiv = Element('id_cc_contact_details_fields'); 246 var data = unserialize(responseText); 247 //alert(responseText); 248 fieldsDiv.innerHTML = ""; 249 if (data && data.length > 0) 250 { 251 //fieldsDiv.innerHTML = ""; 252 var table = document.createElement("table"); 253 table.border=0; 254 //table.style.borderBottom = '1px solid #999'; 255 //table.cellSpacing = '0'; 256 table.width = '480px'; 257 var attr_name_size = '50%'; 258 var attr_value_size = '50%'; 259 for(i = 0; i < data.length; i++) 260 { 261 var row = table.insertRow(i); 262 if ((i % 2) == 0) 263 row.setAttribute('class', 'row_off'); 264 else 265 row.setAttribute('class', 'row_on'); 266 //row.style.borderBottom = '1px solid #999'; 267 attr_name = row.insertCell(0); 268 attr_value = row.insertCell(1); 269 attr_name.style.width = attr_name_size; 270 attr_value.style.width = attr_value_size; 271 attr_name.innerHTML = data[i]['name']; 272 if (data[i]['type'] == 'text') 273 attr_value.innerHTML = data[i]['value']; 274 else 275 { 276 var multivalue_div = document.createElement("div"); 277 multivalue_div.style.overflow = 'auto'; 278 multivalue_div.style.height = '100px'; 279 multivalue_div.style.border = '1px solid #999'; 280 //multivalue_div.style.backgroundColor = 'transparent'; 281 for (j = 0; j < data[i]['value'].length; j++) 282 { 283 multivalue_div.appendChild(document.createTextNode(data[i]['value'][j])); 284 multivalue_div.appendChild(document.createElement("br")); 285 } 286 attr_value.appendChild(multivalue_div); 287 } 288 } 289 fieldsDiv.appendChild(table); 290 } 291 else 292 fieldsDiv.innerHTML = Element('cc_contact_details_no_fields').value; 293 }; 294 Connector.newRequest('populateContactDetails', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_contact_details&id=' + id, 'GET', handler); 295 } 296 297 function closeContactDetails(){ 298 contactdetailsWin.close(); 229 299 } 230 300 /********** New Contact *************/ … … 2302 2372 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] : ''); 2303 2373 if(ccTree.catalog_perms == 1) 2374 { 2304 2375 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>'; 2376 if (data[12] == true || data[12] == 'true') 2377 Element(id+':cc_icon_data').innerHTML += " | " + '<span title="'+ Element('cc_msg_show_extra_detail').value+'" id="' + id + ':ccContactDetails" onclick="javascript:openContactDetails(\'' + Element(id+':cc_id').value + '\');" style="cursor: pointer; cursor: hand; z-index: 1"><img src="templates/default/images/addressbook-mini.png" align="center"></span>'; 2378 } 2305 2379 break; 2306 2380
Note: See TracChangeset
for help on using the changeset viewer.