Changeset 7912
- Timestamp:
- 02/26/13 12:01:41 (12 years ago)
- Location:
- sandbox/2.5.1-expresso1
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/2.5.1-expresso1/expressoMail1_2/inc/class.imap_functions.inc.php
r7888 r7912 5237 5237 function searchSieveRule( $params ) 5238 5238 { 5239 5240 $imap = $this->open_mbox( 'INBOX' );5239 5240 $imap = $this->open_mbox( $params['folder']['criteria'] ? $params['folder']['criteria'] : 'INBOX' ); 5241 5241 $msgs = imap_sort( $imap , SORTDATE , 0 , SE_UID); 5242 5242 5243 5243 $rr = array(); 5244 5244 … … 5307 5307 if(isset($params['body'])) 5308 5308 { 5309 $this->mbox = $this->open_mbox( 'INBOX' );5310 $b = $this->get_body_msg( $v , 'INBOX' );5309 $this->mbox = $this->open_mbox( $params['folder']['criteria'] ? $params['folder']['criteria'] : 'INBOX' ); 5310 $b = $this->get_body_msg( $v , $params['folder']['criteria'] ? $params['folder']['criteria'] : 'INBOX' ); 5311 5311 5312 5312 if( $this->filterCheck( $b['body'] , $params['body']['criteria'] , $params['body']['filter'] )) -
sandbox/2.5.1-expresso1/prototype/modules/attach_message/attach_message.js
r7904 r7912 728 728 message['id'] = id; 729 729 msgs.push( message ); 730 731 730 }); 732 731 return msgs; … … 734 733 } 735 734 var search_imap_messages = function(param, folder){ 736 var filters = [ 737 [ 738 'from', 739 '*', 740 param 741 ], 742 [ 743 'OR', 744 'to', 745 '*', 746 param 747 ], 748 [ 749 'OR', 750 'subject', 751 '*', 752 param 753 ] 754 ]; 755 735 var grid = $("#message_attacher_grid"); 736 737 DataLayer.storage.cache = {}; 738 if( $(".attach-message-search-checkbox:checked").length > 0 ){ 739 var filters = [ 740 [ 741 'from', 742 '*', 743 param 744 ], 745 [ 746 'OR', 747 'to', 748 '*', 749 param 750 ], 751 [ 752 'OR', 753 'subject', 754 '*', 755 param 756 ], 757 [ 758 'OR', 759 'folder', 760 '*', 761 folder 762 ], 763 [ 764 'OR', 765 'body', 766 '*', 767 param 768 ] 769 ]; 770 }else{ 771 var filters = [ 772 [ 773 'from', 774 '*', 775 param 776 ], 777 [ 778 'OR', 779 'to', 780 '*', 781 param 782 ], 783 [ 784 'OR', 785 'subject', 786 '*', 787 param 788 ], 789 [ 790 'OR', 791 'folder', 792 '*', 793 folder 794 ] 795 ]; 796 } 797 756 798 var data = DataLayer.get( 'message', { filter: filters, criteria: { properties: { context: { folder: folder } } } }, true ); 757 799 var tmp = [DataLayer.get( 'message', {filter: [ "msgNumber", "IN", data ], criteria: { properties: { context: { folder: folder } } } })]; … … 759 801 msgs = []; 760 802 761 $.each(tmp, function(i, msg){ 762 flag = msg['flag']; 763 id = msg['msg_number']; 764 var message = {}; 765 766 message['msg_number'] = id; 767 message['flags'] = flag; 768 message['from.name'] = msg['from']; 769 message['subject'] = msg['subject']; 770 message['timestamp'] = msg['timestamp']; 771 message['size'] = msg['size']; 772 message['id'] = id; 773 msgs.push( message ); 774 775 }); 776 803 if(tmp[0].rows){ 804 $.each(tmp[0].rows, function(i, msg){ 805 flag = msg['flags']; 806 id = msg['msg_number']; 807 var message = {}; 808 809 message['msg_number'] = id; 810 message['flags'] = flag; 811 message['to'] = { 812 name: msg['toaddress2'], 813 email: msg['toaddress2'] 814 }; 815 816 if(msg['from'] != undefined && msg['header']['from'] != undefined){ 817 message['from'] = { 818 'email' : msg['from']['email'], 819 'name' : msg['header']['from']['name'] 820 } 821 }else{ 822 message['from'] = { 823 'email' : '', 824 'name' : 'Rascunho' 825 } 826 } 827 //message['from']['name'] = msg['from']['name']; 828 message['subject'] = msg['subject'] ? msg['subject'] : "(sem assunto)"; 829 message['timestamp'] = parseInt(msg['timestamp']); 830 message['size'] = msg['size']; 831 message['id'] = id; 832 msgs.push( message ); 833 }); 834 }else{ 835 grid.jqGrid("clearGridData", true); 836 } 777 837 return msgs; 778 838 } … … 781 841 var grid = $("#message_attacher_grid"); 782 842 var folder = $("#foldertree li span.selected").parent().attr("id"); 843 844 if(param == ""){ 845 $('#foldertree [id="'+folder+'"]').trigger("click"); 846 return; 847 } 783 848 784 849 if(folder.indexOf("local_messages_") == 0){ 785 850 // Pesquisa pelas mensagens locais... 786 if(param == ""){787 $("#foldertree #"+folder).trigger("click");788 return;789 }790 851 msgs = search_local_messsages(param, folder); 791 852 } else { … … 797 858 grid.jqGrid("clearGridData", true); 798 859 grid.jqGrid('setGridParam',{datatype: "local",data: msgs}) 799 .trigger("reloadGrid") 800 .jqGrid('setCaption', '<span class="'+child.attr('class')+'">'+child.attr('title')+'</span>');860 .trigger("reloadGrid"); 861 //.jqGrid('setCaption', '<span class="'+child.attr('class')+'">'+child.attr('title')+'</span>'); 801 862 } 802 863 … … 807 868 $("#last_message_attacher_grid_pager").attr("title",title[3]); 808 869 $("#mailgrid-container .ui-jqgrid-titlebar") 809 .append( DataLayer.render("../prototype/modules/ mail/templates/attachment_search.ejs") ).find(".ui-jqgrid-titlebar-close").hide()870 .append( DataLayer.render("../prototype/modules/attach_message/attachment_search.ejs") ).find(".ui-jqgrid-titlebar-close").hide() 810 871 .end().find(".attach-message-search-input").Watermark("Pesquisa...").keydown(function(e){ 811 872 if($.ui.keyCode.ENTER == e.keyCode){ 812 873 search_messages($(this).val()); 813 874 } 875 }); 876 $("#attach-message-search").button({ 877 text: false, 878 icons: { 879 primary: "ui-icon-search" 880 } 881 }).next().button({ 882 text: false, 883 icons: { 884 primary: "ui-icon-script" 885 } 886 }); 887 $("#attach-message-search").parent().buttonset(); 888 889 $("#attach-message-search").click(function(){ 890 search_messages($(this).parents(".attach-message-search-div:first").find(".attach-message-search-input").val()); 814 891 }); 815 892 } -
sandbox/2.5.1-expresso1/prototype/services/ImapServiceAdapter.php
r7719 r7912 178 178 $criteria[ $filter[$i][0] ] = array( 'criteria' => $filter[$i][2], 'filter' => $filter[$i][1] ); 179 179 } 180 181 180 return $this->searchSieveRule($criteria); 182 181 }
Note: See TracChangeset
for help on using the changeset viewer.