Ticket #605: patch_uid2cn_rev_1328_trunk.diff
File patch_uid2cn_rev_1328_trunk.diff, 14.2 KB (added by gustavoliden, 15 years ago) |
---|
-
expressoMail1_2/js/main.js
### Eclipse Workspace Patch 1.0 #P expressocomunidade
1468 1468 1469 1469 if(data.msg_day == '') 1470 1470 { 1471 header=expresso_local_messages.get_msg_date(data.original_ID , proxy_mensagens.is_local_folder(get_current_folder()));1471 header=expresso_local_messages.get_msg_date(data.original_ID); 1472 1472 1473 1473 data.fulldate=header.fulldate; 1474 1474 data.smalldate=header.smalldate; -
expressoMail1_2/inc/class.imap_functions.inc.php
1423 1423 $tmp_folder_parent = explode($this->imap_delimiter, $folder_id); 1424 1424 $result[$i]['folder_name'] = array_pop($tmp_folder_parent); 1425 1425 $result[$i]['folder_name'] = $result[$i]['folder_name'] == 'INBOX' ? 'Inbox' : $result[$i]['folder_name']; 1426 if (is_numeric($result[$i]['folder_name'])) { 1427 //$this->ldap = new ldap_functions(); 1426 if ($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['uid2cn']) 1427 { 1428 $this->ldap = new ldap_functions(); 1428 1429 if ($cn = $this->ldap->uid2cn($result[$i]['folder_name'])){ 1429 1430 $result[$i]['folder_name'] = $cn; 1430 1431 } … … 2152 2153 } 2153 2154 } 2154 2155 //Este bloco tem a finalidade de transformar o CPF das pastas compartilhadas em common name 2155 if (substr($new_folder_name,0,4) == 'user'){ 2156 $this->ldap = new ldap_functions(); 2157 $tmp_folder_name = explode($this->imap_delimiter, $new_folder_name); 2158 $return['new_folder_name'] = array_pop($tmp_folder_name); 2159 if (is_numeric($return['new_folder_name'])) 2156 if ($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['uid2cn']) 2157 { 2158 if (substr($new_folder_name,0,4) == 'user') 2159 { 2160 $this->ldap = new ldap_functions(); 2161 $tmp_folder_name = explode($this->imap_delimiter, $new_folder_name); 2162 $return['new_folder_name'] = array_pop($tmp_folder_name); 2160 2163 if( $cn = $this->ldap->uid2cn($return['new_folder_name'])) 2161 2164 $return['new_folder_name'] = $cn; 2165 } 2162 2166 } 2163 2167 2164 2168 // Caso estejamos no box principal, nao eh necessario pegar a informacao da mensagem anterior. … … 2916 2920 $name_box = mb_convert_encoding(utf8_decode($name_box), "UTF7-IMAP", "ISO_8859-1" ); 2917 2921 $filter = $this->remove_accents($filter); 2918 2922 //Este bloco tem a finalidade de transformar o login (quando numerico) das pastas compartilhadas em common name 2919 $folder_name = explode($this->imap_delimiter,$name_box); 2920 if (is_numeric($folder_name[1])) { 2923 if ($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['uid2cn']) 2924 { 2925 $folder_name = explode($this->imap_delimiter,$name_box); 2921 2926 $this->ldap = new ldap_functions(); 2922 if ($cn = $this->ldap->uid2cn($folder_name[1])) { 2927 if ($cn = $this->ldap->uid2cn($folder_name[1])) 2928 { 2923 2929 $folder_name[1] = $cn; 2924 2930 } 2931 $folder_name = implode($this->imap_delimiter,$folder_name); 2925 2932 } 2926 $folder_name = implode($this->imap_delimiter,$folder_name); 2933 else 2934 $folder_name = mb_convert_encoding(utf8_decode($name_box), "UTF7-IMAP", "ISO_8859-1" ); 2927 2935 2928 2936 if(!is_resource($mbox_stream)) 2929 2937 $mbox_stream = $this->open_mbox($name_box); … … 2942 2950 if($search_criteria && count($search_criteria) < 50) 2943 2951 { 2944 2952 foreach($search_criteria as $new_search){ 2945 $m_token = trim("##". mb_convert_encoding( $name_box, "ISO_8859-1", "UTF7-IMAP" ) . "--" . $this->get_msg($new_search,$name_box,$mbox_stream) . "--".$new_search."##"."\n");2953 $m_token = trim("##". mb_convert_encoding( $folder_name, "ISO_8859-1", "UTF7-IMAP" ) . "--" . mb_convert_encoding( $name_box, "ISO_8859-1", "UTF7-IMAP" ) . "--" . $this->get_msg($new_search,$name_box,$mbox_stream) . "--".$new_search."##"."\n"); 2946 2954 if(!@strstr($retorno,$m_token)) 2947 2955 $retorno .= $m_token; 2948 2956 } … … 2956 2964 if( is_array( $search_criteria) ) 2957 2965 { 2958 2966 foreach($search_criteria as $new_search) 2959 $retorno .= trim("##". mb_convert_encoding( $name_box, "ISO_8859-1", "UTF7-IMAP" ) . "--" . $this->get_msg($new_search,$name_box,$mbox_stream) . "--" . $new_search."##"."\n");2967 $retorno .= trim("##". mb_convert_encoding( $folder_name, "ISO_8859-1", "UTF7-IMAP" ) . "--" . mb_convert_encoding( $name_box, "ISO_8859-1", "UTF7-IMAP" ) . "--" . $this->get_msg($new_search,$name_box,$mbox_stream) . "--" . $new_search."##"."\n"); 2960 2968 } 2961 2969 } 2962 2970 } -
expressoMail1_2/setup/phpgw_en.lang
79 79 Do you wanna receive an alert for new messages? expressoMail1_2 en Do you wanna receive an alert for new messages? 80 80 Do you want to block this e-mail? expressoMail1_2 en Do you want to block this e-mail? 81 81 Do you want to log the sent messages? admin en Do you want to log the sent messages? 82 Do you want to show common name instead of UID? expressoMail1_2 en Do you want to show common name instead of UID? 82 83 Do you want to use the spam filter? admin en Do you want to use the spam filter? 83 84 Do you wish to exclude the folder expressoMail1_2 en Do you wish to exclude the folder 84 85 Draft expressoMail1_2 en Draft -
expressoMail1_2/inc/hook_settings.inc.php
64 64 '</script>'); 65 65 //} 66 66 67 $default = false; 68 69 create_check_box('Do you want to show common name instead of UID?','uid2cn',$default, 70 'Do you want to show common name instead of UID?'); 71 67 72 $default = array( 68 73 '25' => '25', 69 74 '50' => '50', -
expressoMail1_2/js/search.js
Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream
333 333 var aux = []; 334 334 aux[0] = nw_array[i].substr(0, nw_array[i].indexOf('--')); 335 335 nw_array[i] = nw_array[i].substr(nw_array[i].indexOf('--')+2); 336 aux[3] = nw_array[i].substr(0, nw_array[i].indexOf('--')); 337 nw_array[i] = nw_array[i].substr(nw_array[i].indexOf('--')+2); 336 338 aux[1] = nw_array[i].substr(0, nw_array[i].indexOf('--')); 337 339 aux[2] = nw_array[i].substr(nw_array[i].indexOf('--')+2); 338 340 aux = aux.concat(aux1); … … 340 342 else 341 343 { 342 344 var aux = nw_array[i].split("--"); 345 aux.splice(4,0,aux[1]); 346 var mailbox = aux.shift(); 347 aux.splice(0,1,mailbox); 343 348 } 344 345 var mailbox = aux[0]; 346 var uid_msg = aux[6]; 349 350 var mailbox_name = aux[0]; 351 var mailbox_id = aux[3]; 352 var uid_msg = aux[7]; 347 353 var subject = aux[2]; 348 354 tr.id = uid_msg; 349 tr.setAttribute('name',mailbox );350 if (aux[ 5].match("U"))355 tr.setAttribute('name',mailbox_id); 356 if (aux[6].match("U")) 351 357 add_className(tr,'tr_msg_unread'); 352 358 add_className(tr, i%2 != 0 ? 'tr_msg_read2' : 'tr_msg_read'); 353 359 var _onclick = function () { proxy_mensagens.get_msg(this.parentNode.id,url_encode(this.parentNode.getAttribute('name')),false,show_msg);}; … … 363 369 if (j == 1) 364 370 { 365 371 td.style.width = "2%"; 366 if (aux[ 5].match('T'))372 if (aux[6].match('T')) 367 373 { 368 attachNum = parseInt(aux[ 5].substr(aux[5].indexOf('T')+1));374 attachNum = parseInt(aux[6].substr(aux[6].indexOf('T')+1)); 369 375 td1 = "<img src='templates/"+template+"/images/clip.gif' title='"+attachNum +' '+ get_lang('attachment(s)')+"'>"; 370 376 } 371 377 else … … 375 381 { 376 382 td.style.width = "1%"; 377 383 td.id = "td_message_answered_"+uid_msg; 378 if (aux[ 5].match('X'))384 if (aux[6].match('X')) 379 385 td1 = '<img src=templates/'+template+'/images/forwarded.gif title=Forwarded>'; 380 386 else 381 if (aux[ 5].match('A'))387 if (aux[6].match('A')) 382 388 td1 = '<img src=templates/'+template+'/images/answered.gif>'; 383 389 else 384 390 td1 = ''; … … 387 393 { 388 394 td.style.width = "1%"; 389 395 td.id = "td_message_important_"+uid_msg; 390 if (aux[ 5].match("F"))396 if (aux[6].match("F")) 391 397 { 392 398 add_className(tr, 'flagged_msg'); 393 399 td.style.background = "url(templates/"+template+"/images/important.gif) no-repeat center"; … … 403 409 } 404 410 if (j == 5) 405 411 { 406 td.style.width = " 14%";412 td.style.width = "20%"; 407 413 td.onclick = _onclick; 408 414 var nm_box = aux[0].split(cyrus_delimiter); 409 415 var td1 = nm_box.pop(); … … 411 417 td.style.overflow = "hidden"; 412 418 td.style.color = "#42795b"; 413 419 td.style.fontWeight = "bold"; 414 415 if(td1 == "INBOX"){ 416 var td1 = get_lang("Inbox"); 420 if(proxy_mensagens.is_local_folder(td1)) { 421 var td1 = this.aux_local_folder_display(td1); 422 aux[2] = tr.name = aux[0]; // precisa trocar pelo nome real no banco do gears. 423 } else { 424 if(td1 == "INBOX"){ 425 var td1 = get_lang("Inbox"); 426 } 427 else if (nm_box[0] == 'user') 428 if (nm_box.length > 1) 429 var td1 = nm_box[1] + '/' + lang_folder(td1); 430 else 431 var td1 = td1; 432 else 433 var td1 = lang_folder(td1); 417 434 } 418 435 419 436 if(proxy_mensagens.is_local_folder(td1)) { … … 422 439 } 423 440 if( j == 6) 424 441 { 425 if (aux[ 1].length > 29)426 aux[ 1] = aux[1].substr(0,29) + "...";442 if (aux[2].length > 29) 443 aux[2] = aux[2].substr(0,29) + "..."; 427 444 td.style.width = "20%"; 428 445 td.onclick = _onclick; 429 446 td.setAttribute("NoWrap","true"); … … 435 452 var subject_encode = url_encode(subject); 436 453 if (! subject_encode) 437 454 aux[2] = get_lang("no subject") + "..."; 438 if (aux[2] .length> 70)455 if (aux[2] > 70) 439 456 aux[2] = aux[2].substr(0,70) + "..."; 440 457 td.style.width = "35%"; 441 458 td.onclick = _onclick; 442 459 td.setAttribute("NoWrap","true"); 443 460 td.style.overflow = "hidden"; 444 var td1 = aux[2];461 var td1 = subject; 445 462 446 463 } 447 464 if( j == 8) … … 449 466 td.style.width = "15%"; 450 467 td.align = "center"; 451 468 td.onclick = _onclick; 452 var td1 = aux[ 3];469 var td1 = aux[4]; 453 470 } 454 471 if( j == 9) 455 472 { 456 473 td.style.width = "10%"; 457 474 td.align = "center"; 458 475 td.onclick = _onclick; 459 var td1 = aux[ 4];476 var td1 = aux[5]; 460 477 } 461 478 if (j == 10) 462 479 { 463 if (aux[ 5].match("U"))480 if (aux[6].match("U")) 464 481 add_className(tr, 'tr_msg_unread'); 465 if (aux[ 5].match("F"))482 if (aux[7].match("F")) 466 483 add_className(tr, 'flagged_msg'); 467 484 var td1 = ''; 468 485 } … … 471 488 } 472 489 aux.splice(0,(aux.length)); 473 490 474 _dragArea.makeDragged(tr, uid_msg, subject, true, mailbox );491 _dragArea.makeDragged(tr, uid_msg, subject, true, mailbox_id); 475 492 tbody.appendChild(tr); 476 493 } 477 494 table.appendChild(tbody); … … 506 523 tr_element = document.createElement("TR"); 507 524 tr_element.className = "message_header"; 508 525 td_element0 = document.createElement("TD"); 509 td_element0.setAttribute("width", " 1%");526 td_element0.setAttribute("width", "6%"); 510 527 chk_box_element = document.createElement("INPUT"); 511 528 chk_box_element.id = "chk_box_select_all_messages"; 512 529 chk_box_element.setAttribute("type", "checkbox"); … … 640 657 } 641 658 } 642 659 643 searchE.prototype.open_msg = function(mailbox , uid_msg, subject){660 searchE.prototype.open_msg = function(mailbox_id, uid_msg, subject){ 644 661 var handler_get_msg = function(data){ 645 662 if(Element("border_id_" + uid_msg + "_r")){alert(get_lang("This message is already opened!"));} 646 663 else{draw_message(data,create_border(url_decode(subject), uid_msg + "_r"));} 647 664 //set_msg_as_read(msgs_to_set[i], false); 648 665 } 649 proxy_mensagens.get_msg(uid_msg,mailbox ,false,handler_get_msg);666 proxy_mensagens.get_msg(uid_msg,mailbox_id,false,handler_get_msg); 650 667 /*var args = "$this.imap_functions.get_info_msg"; 651 668 var params = "msg_number=" + uid_msg + "&msg_folder=" + mailbox; 652 669 cExecute(args,handler_get_msg,params);*/ -
expressoMail1_2/js/local_messages.js
568 568 var retorno = ""; 569 569 while(rs.isValidRow()) { 570 570 var header = connector.unserialize(rs.field(0)); 571 retorno+="##"+"local_"+rs.field(1)+"--"+ header["from"]["name"]+"--"+header["subject"]+"--"+header["udate"]+"--"+this.aux_convert_size(rs.field(3))+"--"+header["Unseen"]+header["Recent"]+header["Flagged"]+header["Draft"]+"--"+rs.field(2)+"##";571 retorno+="##"+"local_"+rs.field(1)+"--"+"local_"+rs.field(1)+"--"+header["from"]["name"]+"--"+header["subject"]+"--"+header["udate"]+"--"+this.aux_convert_size(rs.field(3))+"--"+header["Unseen"]+header["Recent"]+header["Flagged"]+header["Draft"]+"--"+rs.field(2)+"##"; 572 572 rs.next(); 573 573 } 574 574 … … 700 700 cExecute ("$this.imap_functions.unarchive_mail&", handler_unarchive, params); 701 701 } 702 702 703 local_messages.prototype.get_msg_date = function (original_id , is_local){703 local_messages.prototype.get_msg_date = function (original_id){ 704 704 705 705 this.init_local_messages(); 706 706 707 if (typeof(is_local) == 'undefined') 708 { 709 is_local = false; 710 } 711 712 var rs; 713 714 if (is_local) 715 { 716 rs = this.dbGears.execute("select mail from mail where rowid="+original_id); 717 } 718 else 719 { 720 rs = this.dbGears.execute("select mail from mail where original_id="+original_id); 721 } 707 var rs = this.dbGears.execute("select mail from mail where rowid="+original_id); 708 // rs = this.dbGears.execute("select mail from mail where original_id="+original_id); 722 709 var tmp = connector.unserialize(rs.field(0)); 723 710 var ret = new Array(); 724 711 ret.fulldate = tmp.fulldate.substr(0,16);