Changeset 7892
- Timestamp:
- 02/19/13 12:54:42 (12 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/js/common_functions.js
r7827 r7892 694 694 } 695 695 696 /* 697 Abre o diálogo de edição de filtro na tela de criação de filtro, 698 com os dados da mensagem (remetente e assunto) pré-carregados. 699 */ 700 function filter_from_msg (msg) { 701 var html = DataLayer.render( BASE_PATH + 'modules/filters/init.ejs', {}); 702 initialize_container(html); 703 list_container = create_filter_dialog(); 704 render_new_rule(msg.from.email, html_entities(msg.subject)); 705 $('.expresso-window-container').dialog('open'); 706 } 696 707 697 708 function sharebox(){ -
trunk/expressoMail1_2/js/doiMenuData.js
r7886 r7892 174 174 "sep1": "---------" 175 175 } 176 176 177 // Desabilita a opção de criar filtro a partir da mensagem, caso mais de uma mensagem esteja selecionada: 178 var is_filterFromMsg_disabled = function () { 179 var base_selector = ".table_box tbody tr.selected_msg"; 180 return ($(base_selector).length > 1) || ($(base_selector + " td span").text().indexOf(get_lang("Draft")) > -1); 181 } 182 177 183 var lastItens = { 178 184 "move": {"name": get_lang("Move to")+"...", "icon": "move", callback: function(key, opt){ wfolders.makeWindow('', 'move_to'); }}, 179 185 "remove": {"name": get_lang("Delete"), "icon": "delete", callback: function(key, opt){ proxy_mensagens.delete_msgs('null','selected','null'); }}, 180 186 "export": {"name": get_lang("Export"), "icon": "export", callback: function(key, opt){ proxy_mensagens.export_all_messages(); }}, 187 /*Abre o diálogo de criação de filtro a partir da mensagem:*/ 188 "filterFromMsg": { 189 "name": get_lang("Create filter from message"), 190 "icon": "filter", 191 callback: function (key, opt) { 192 var msg_number = get_selected_messages(); 193 var msg = onceOpenedHeadersMessages[current_folder][msg_number]; 194 if (msg !== undefined) 195 { 196 filter_from_msg(msg); 197 } 198 }, 199 disabled: is_filterFromMsg_disabled() 200 }, 181 201 "archive": archive 182 202 } -
trunk/expressoMail1_2/js/draw_api.js
r7891 r7892 3004 3004 var option_export = '<span onclick="proxy_mensagens.export_all_messages()" onmouseover="this.className=\'reply_options_active\'" onmouseout="this.className=\'reply_options\'" class="reply_options">'+get_lang("Export")+'</span> | '; 3005 3005 var report_error = '<span onmouseover="this.className=\'reply_options_active\'" onmouseout="this.className=\'reply_options\'" class="reply_options" onclick=reports_window("'+currentTab+'");>'+get_lang("Report error")+'</span> | '; 3006 div_other_more_options.innerHTML += option_move + option_print + option_export + block_user + report_error; 3006 // Opção do menu 'Mais Ações' para criar filtro a partir da mensagem aberta: 3007 var option_create_filter = '<span onmouseover="this.className=\'reply_options_active\'" onmouseout="this.className=\'reply_options\'" class="reply_options" onclick=filter_from_msg(onceOpenedHeadersMessages[\'' + html_entities(info_msg.msg_folder) + '\'][' + info_msg.msg_number + ']);>' + get_lang("Create filter from message") + '</span> | '; 3008 div_other_more_options.innerHTML += option_create_filter + option_move + option_print + option_export + block_user + report_error; 3007 3009 3008 3010 -
trunk/expressoMail1_2/setup/phpgw_pt-br.lang
r7703 r7892 973 973 Error trying to send the message. Retry in a few seconds... expressoMail1_2 pt-br Erro ao tentar enviar a mensagem. Nova tentativa em alguns segundos... 974 974 Sending the message... expressoMail1_2 pt-br Enviando a mensagem... 975 Create filter from message expressoMail1_2 pt-br Criar filtro a partir da mensagem -
trunk/prototype/modules/filters/edit-filter.ejs
r7703 r7892 28 28 29 29 </select> 30 <input type="text" name="criteriaValue[]" />30 <input type="text" name="criteriaValue[]" value="<%= data.from %>" /> 31 31 <input type="hidden" name="criteriaType[]" value="from"/> 32 32 </fieldset> … … 53 53 54 54 </select> 55 <input type="text" name="criteriaValue[]" />55 <input type="text" name="criteriaValue[]" value="<%= data.subject %>" /> 56 56 <input type="hidden" name="criteriaType[]" value="subject"/> 57 57 </fieldset> -
trunk/prototype/modules/filters/filters.js
r7856 r7892 605 605 * Lista os filtros para o usuário 606 606 */ 607 function list_filters(html) {607 function list_filters(html) { 608 608 outOfficeVerify(); 609 for (var index in selectedMessages) { 609 for (var index in selectedMessages) 610 { 610 611 delete selectedMessages[index]; 611 612 } 612 if(html){ 613 if( ! $(".filters-windows").length ) 614 container = $('.expressomail-module-container').append("<div class='filters-windows'></div>").find(".filters-windows").html( html ).find(".expresso-window-container"); 615 list_container = $('.expressomail-module-container').find(".rule-list-container"); 616 } 617 list_container = $(".expresso-window-filters").dialog({ 618 title: get_lang('Filters'), 619 width:700, 620 modal: true, 621 resizable: false, 622 closeOnEscape:true, 623 close:function(event, ui) { 624 event.stopPropagation(); 625 if(list_container.find(".cancel").length) 626 list_container.find(".cancel").trigger('click'); 627 $(".dialog-head-buttonpane").hide(); 628 }, 629 open: function () { 630 $(".ui-dialog .ui-dialog-titlebar") 631 .append('<a href="#" class="ui-dialog-titlebar-minimize ui-corner-all" role="button"><span class="ui-icon ui-icon-minusthick">minimize</span></a>') 632 .find('.ui-dialog-titlebar-minimize').click(function() { 633 $(".ui-dialog-buttonpane, .ui-dialog-content").toggle(); 634 $(".ui-icon-minusthick, .ui-icon-newwin").toggleClass('ui-icon-minusthick').toggleClass('ui-icon-newwin'); 635 }); 636 $(".dialog-head-buttonpane").show(); 637 }, 638 autoOpen: false, 639 buttons: [{ 640 text : get_lang("Close"), 641 click : function() { 642 $( this ).dialog( "close" ); 643 } 644 }] 645 }); 646 $(".ui-dialog-titlebar").after("<div class='dialog-head-buttonpane ui-dialog-buttonpane ui-widget-content ui-helper-clearfix' style='background-color: rgb(224, 238, 238); '><div class='ui-dialog-buttonset header-buttonpane'></div></div>"); 647 $(".dialog-head-buttonpane").css("padding", "5px"). 648 find(".header-buttonpane").html("<a href='#' class='button add' title='"+get_lang("Add new rule")+"'>"+get_lang("New rule")+"</a>"+(!outoffice ? "<a href='#' class='button add vacation' title='"+get_lang("Add rule out of office")+"'>"+get_lang("Out of office")+"</a>" : "")).find(".button").button(); 649 650 $(".ui-dialog-buttonpane.ui-widget-content").css("background-color", "#E0EEEE"); 613 614 initialize_container(html); // Inicializa o container do diálogo de filtros 615 616 list_container = create_filter_dialog(); // Cria a estrutura básica do diálogo 617 651 618 var list = DataLayer.render( BASE_PATH + 'modules/filters/filter-list.ejs', DataLayer.get("filter:detail", true)); 652 619 list_container.html(list).find(".button").button(); … … 868 835 869 836 list_container.parent().find(".button.add:first").click(function(){ 870 list_container.parent().find(".dialog-head-buttonpane").addClass("hidden"); 871 DataLayer.render( BASE_PATH + 'modules/filters/edit-filter.ejs', {folders : DataLayer.get("folder", true), delimiter: cyrus_delimiter},function(html){ 872 list_container.html(html); 873 var accord = list_container.find(".rule-details-container").accordion({autoHeight: false}); 874 list_container.find(".button").button().filter(".forth").click(function(){ 875 accord.accordion('activate',1); 876 }).end().filter(".forth2").click(function(){ 877 accord.accordion('activate',2); 878 }).end().filter(".back").click(function(){ 879 accord.accordion('activate',0); 880 }).end().filter(".back2").click(function(){ 881 accord.accordion('activate',1); 882 }).end().filter(".cancel").click(function(){ 883 DataLayer.render( BASE_PATH + 'modules/filters/init.ejs', {},list_filters); 884 }).end().filter(".submit").click(function() { 885 if(valid_save()) 886 $(this).submit(); 887 else 888 return; 889 DataLayer.commit( 'filter',false,function(){ 890 if($('#gbox_fields-search-messages-grid').length > 0 && action != '') { 891 for (var index in selectedMessages) { 892 set_message_flag(index, action, false); 893 } 894 } 895 DataLayer.render( BASE_PATH + 'modules/filters/init.ejs', {},list_filters); 896 getFromAlertRules(); 897 }); 898 }).end().filter('.button.search').click(function() { 899 if(valid_save()) 900 showGridMessages($(this)); 901 else 902 return; 903 }); // end function click 904 }); // end DataLayer.render 837 render_new_rule(); // Renderiza a tela de criação de nova regra de filtragem. 905 838 }); 906 839 list_container.parent().find(".button.add.vacation").click(function(){ … … 932 865 } 933 866 867 /* 868 Inicializa o container do diálogo de gerenciamento de filtros. 869 */ 870 function initialize_container (html) { 871 if(html) 872 { 873 if(!$(".filters-windows").length) 874 { 875 container = $('.expressomail-module-container').append("<div class='filters-windows'></div>").find(".filters-windows").html(html).find(".expresso-window-container"); 876 } 877 } 878 } 879 880 /* 881 Cria a estrutura básica do diálogo de gerenciamento de filtros. 882 */ 883 function create_filter_dialog () { 884 var dialog = $(".expresso-window-filters").dialog( 885 { 886 title: get_lang('Filters'), 887 width: 700, 888 modal: true, 889 resizable: false, 890 closeOnEscape: true, 891 close: function(event, ui) 892 { 893 event.stopPropagation(); 894 if(list_container.find(".cancel").length) list_container.find(".cancel").trigger('click'); 895 $(".dialog-head-buttonpane").hide(); 896 }, 897 open: function() 898 { 899 $(".ui-dialog .ui-dialog-titlebar").append('<a href="#" class="ui-dialog-titlebar-minimize ui-corner-all" role="button"><span class="ui-icon ui-icon-minusthick">minimize</span></a>').find('.ui-dialog-titlebar-minimize').click(function() 900 { 901 $(".ui-dialog-buttonpane, .ui-dialog-content").toggle(); 902 $(".ui-icon-minusthick, .ui-icon-newwin").toggleClass('ui-icon-minusthick').toggleClass('ui-icon-newwin'); 903 }); 904 $(".dialog-head-buttonpane").show(); 905 }, 906 autoOpen: false, 907 buttons: [ 908 { 909 text: get_lang("Close"), 910 click: function() 911 { 912 $(this).dialog("close"); 913 } 914 }] 915 }); 916 917 $(".ui-dialog-titlebar").after("<div class='dialog-head-buttonpane ui-dialog-buttonpane ui-widget-content ui-helper-clearfix' style='background-color: rgb(224, 238, 238); '><div class='ui-dialog-buttonset header-buttonpane'></div></div>"); 918 $(".dialog-head-buttonpane").css("padding", "5px"). 919 find(".header-buttonpane").html("<a href='#' class='button add' title='" + get_lang("Add new rule") + "'>" + get_lang("New rule") + "</a>" + (!outoffice ? "<a href='#' class='button add vacation' title='" + get_lang("Add rule out of office") + "'>" + get_lang("Out of office") + "</a>" : "")).find(".button").button(); 920 $(".ui-dialog-buttonpane.ui-widget-content").css("background-color", "#E0EEEE"); 921 922 return dialog; 923 } 924 925 /* 926 Renderiza a tela de adição de uma nova regra de filtragem, 927 dentro do diálogo de gerenciamento de filtros. 928 */ 929 function render_new_rule (from, subject) { 930 list_container.parent().find(".dialog-head-buttonpane").addClass("hidden"); 931 var data = { 932 folders: DataLayer.get("folder", true), 933 delimiter: cyrus_delimiter, 934 from: from, 935 subject: subject ? html_entities(subject) : subject 936 } 937 938 DataLayer.render(BASE_PATH + 'modules/filters/edit-filter.ejs', data, function(html) 939 { 940 list_container.html(html); 941 var accord = list_container.find(".rule-details-container").accordion( 942 { 943 autoHeight: false 944 }); 945 list_container.find(".button").button().filter(".forth").click(function() 946 { 947 accord.accordion('activate', 1); 948 }).end().filter(".forth2").click(function() 949 { 950 accord.accordion('activate', 2); 951 }).end().filter(".back").click(function() 952 { 953 accord.accordion('activate', 0); 954 }).end().filter(".back2").click(function() 955 { 956 accord.accordion('activate', 1); 957 }).end().filter(".cancel").click(function() 958 { 959 DataLayer.render(BASE_PATH + 'modules/filters/init.ejs', {}, list_filters); 960 }).end().filter(".submit").click(function() 961 { 962 if(valid_save()) $(this).submit(); 963 else return; 964 DataLayer.commit('filter', false, function() 965 { 966 if($('#gbox_fields-search-messages-grid').length > 0 && action != '') 967 { 968 for(var index in selectedMessages) 969 { 970 set_message_flag(index, action, false); 971 } 972 } 973 DataLayer.render(BASE_PATH + 'modules/filters/init.ejs', {}, list_filters); 974 getFromAlertRules(); 975 }); 976 }).end().filter('.button.search').click(function() 977 { 978 if(valid_save()) showGridMessages($(this)); 979 else return; 980 }); // end function click 981 }); // end DataLayer.render 982 } 934 983 935 984 /* Inicializa os filtros e chama o list_filters
Note: See TracChangeset
for help on using the changeset viewer.