diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index be260b419..45a20bf05 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -86,6 +86,7 @@ class AdminController < ApplicationController @flags = { :default_admin_changed => User.find(:first, :conditions => ["login=? and hashed_password=?", 'admin', User.hash_password('admin')]).nil?, :file_repository_writable => File.writable?(Attachment.storage_path), + :plugin_assets_writable => File.writable?(Engines.public_directory), :rmagick_available => Object.const_defined?(:Magick) } end diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 7d89e2163..e8d0a85b7 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -175,6 +175,7 @@ class ApplicationController < ActionController::Base # TODO: move to model def attach_files(obj, attachments) attached = [] + unsaved = [] if attachments && attachments.is_a?(Hash) attachments.each_value do |attachment| file = attachment['file'] @@ -183,7 +184,10 @@ class ApplicationController < ActionController::Base :file => file, :description => attachment['description'].to_s.strip, :author => User.current) - attached << a unless a.new_record? + a.new_record? ? (unsaved << a) : (attached << a) + end + if unsaved.any? + flash[:warning] = l(:warning_attachments_not_saved, unsaved.size) end end attached diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index a935ce9ec..35d1670ae 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -147,6 +147,15 @@ module ApplicationHelper end content end + + # Renders flash messages + def render_flash_messages + s = '' + flash.each do |k,v| + s << content_tag('div', v, :class => "flash #{k}") + end + s + end # Truncates and returns the string as a single line def truncate_single_line(string, *args) diff --git a/app/models/mailer.rb b/app/models/mailer.rb index dd4b5be87..9a0f3a501 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -40,6 +40,7 @@ class Mailer < ActionMailer::Base 'Issue-Id' => issue.id, 'Issue-Author' => issue.author.login redmine_headers 'Issue-Assignee' => issue.assigned_to.login if issue.assigned_to + @author = journal.user recipients issue.recipients # Watchers in cc cc(issue.watcher_recipients - @recipients) @@ -209,9 +210,10 @@ class Mailer < ActionMailer::Base def create_mail # Removes the current user from the recipients and cc # if he doesn't want to receive notifications about what he does - if User.current.pref[:no_self_notified] - recipients.delete(User.current.mail) if recipients - cc.delete(User.current.mail) if cc + @author ||= User.current + if @author.pref[:no_self_notified] + recipients.delete(@author.mail) if recipients + cc.delete(@author.mail) if cc end # Blind carbon copy recipients if Setting.bcc_recipients? diff --git a/app/models/project.rb b/app/models/project.rb index e8d3ed179..c792b9c3b 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -60,7 +60,7 @@ class Project < ActiveRecord::Base validates_associated :repository, :wiki validates_length_of :name, :maximum => 30 validates_length_of :homepage, :maximum => 255 - validates_length_of :identifier, :in => 3..20 + validates_length_of :identifier, :in => 2..20 validates_format_of :identifier, :with => /^[a-z0-9\-]*$/ before_destroy :delete_all_members diff --git a/app/views/admin/info.rhtml b/app/views/admin/info.rhtml index 141746888..8c126b50a 100644 --- a/app/views/admin/info.rhtml +++ b/app/views/admin/info.rhtml @@ -4,7 +4,8 @@ - + +
<%= l(:text_default_administrator_account_changed) %><%= image_tag (@flags[:default_admin_changed] ? 'true.png' : 'false.png'), :style => "vertical-align:bottom;" %>
<%= l(:text_file_repository_writable) %><%= image_tag (@flags[:file_repository_writable] ? 'true.png' : 'false.png'), :style => "vertical-align:bottom;" %>
<%= l(:text_file_repository_writable) %> (<%= Attachment.storage_path %>)<%= image_tag (@flags[:file_repository_writable] ? 'true.png' : 'false.png'), :style => "vertical-align:bottom;" %>
<%= l(:text_plugin_assets_writable) %> (<%= Engines.public_directory %>)<%= image_tag (@flags[:plugin_assets_writable] ? 'true.png' : 'false.png'), :style => "vertical-align:bottom;" %>
<%= l(:text_rmagick_available) %><%= image_tag (@flags[:rmagick_available] ? 'true.png' : 'false.png'), :style => "vertical-align:bottom;" %>
diff --git a/app/views/issues/new.rhtml b/app/views/issues/new.rhtml index 280e2009b..732a562a3 100644 --- a/app/views/issues/new.rhtml +++ b/app/views/issues/new.rhtml @@ -17,3 +17,7 @@ <% end %>
+ +<% content_for :header_tags do %> + <%= stylesheet_link_tag 'scm' %> +<% end %> diff --git a/app/views/layouts/base.rhtml b/app/views/layouts/base.rhtml index b146d615e..0de3b0e3d 100644 --- a/app/views/layouts/base.rhtml +++ b/app/views/layouts/base.rhtml @@ -50,8 +50,7 @@
- <%= content_tag('div', flash[:error], :class => 'flash error') if flash[:error] %> - <%= content_tag('div', flash[:notice], :class => 'flash notice') if flash[:notice] %> + <%= render_flash_messages %> <%= yield %>
diff --git a/app/views/projects/_form.rhtml b/app/views/projects/_form.rhtml index 860b19fe4..f0c9fda55 100644 --- a/app/views/projects/_form.rhtml +++ b/app/views/projects/_form.rhtml @@ -11,7 +11,7 @@

<%= f.text_area :description, :rows => 5, :class => 'wiki-edit' %>

<%= f.text_field :identifier, :required => true, :disabled => @project.identifier_frozen? %> <% unless @project.identifier_frozen? %> -
<%= l(:text_length_between, 3, 20) %> <%= l(:text_project_identifier_info) %> +
<%= l(:text_length_between, 2, 20) %> <%= l(:text_project_identifier_info) %> <% end %>

<%= f.text_field :homepage, :size => 60 %>

<%= f.check_box :is_public %>

diff --git a/lang/bg.yml b/lang/bg.yml index 5170a977e..df1869040 100644 --- a/lang/bg.yml +++ b/lang/bg.yml @@ -696,3 +696,5 @@ label_user_activity: "%s's activity" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/ca.yml b/lang/ca.yml index 79398078b..d0d6b8278 100644 --- a/lang/ca.yml +++ b/lang/ca.yml @@ -697,3 +697,5 @@ label_user_activity: "%s's activity" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/cs.yml b/lang/cs.yml index ba22ab12c..16fde6274 100644 --- a/lang/cs.yml +++ b/lang/cs.yml @@ -701,3 +701,5 @@ label_user_activity: "%s's activity" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/da.yml b/lang/da.yml index 5b8ee5b89..8f1049d05 100644 --- a/lang/da.yml +++ b/lang/da.yml @@ -697,3 +697,5 @@ label_user_activity: "%s's activity" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/de.yml b/lang/de.yml index 517bc3a4d..4697aae6a 100644 --- a/lang/de.yml +++ b/lang/de.yml @@ -698,3 +698,5 @@ default_activity_development: Entwicklung enumeration_issue_priorities: Ticket-Prioritäten enumeration_doc_categories: Dokumentenkategorien enumeration_activities: Aktivitäten (Zeiterfassung) +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/en.yml b/lang/en.yml index b2d7efc4f..9bd56e875 100644 --- a/lang/en.yml +++ b/lang/en.yml @@ -85,6 +85,8 @@ error_scm_command_failed: "An error occurred when trying to access the repositor error_scm_annotate: "The entry does not exist or can not be annotated." error_issue_not_found_in_project: 'The issue was not found or does not belong to this project' +warning_attachments_not_saved: "%d file(s) could not be saved." + mail_subject_lost_password: Your %s password mail_body_lost_password: 'To change your password, click on the following link:' mail_subject_register: Your %s account activation @@ -660,7 +662,8 @@ text_status_changed_by_changeset: Applied in changeset %s. text_issues_destroy_confirmation: 'Are you sure you want to delete the selected issue(s) ?' text_select_project_modules: 'Select modules to enable for this project:' text_default_administrator_account_changed: Default administrator account changed -text_file_repository_writable: File repository writable +text_file_repository_writable: Attachments directory writable +text_plugin_assets_writable: Plugin assets directory writable text_rmagick_available: RMagick available (optional) text_destroy_time_entries_question: %.02f hours were reported on the issues you are about to delete. What do you want to do ? text_destroy_time_entries: Delete reported hours diff --git a/lang/es.yml b/lang/es.yml index 8437beca1..83c51e6ca 100644 --- a/lang/es.yml +++ b/lang/es.yml @@ -681,3 +681,5 @@ text_user_mail_option: "De los proyectos no seleccionados, sólo recibirá notif text_user_wrote: '%s escribió:' text_wiki_destroy_confirmation: ¿Seguro que quiere borrar el wiki y todo su contenido? text_workflow_edit: Seleccionar un flujo de trabajo para actualizar +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/fi.yml b/lang/fi.yml index be0a46b06..236338600 100644 --- a/lang/fi.yml +++ b/lang/fi.yml @@ -696,3 +696,5 @@ label_user_activity: "Käyttäjän %s historia" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/fr.yml b/lang/fr.yml index 9d0230093..c3210a554 100644 --- a/lang/fr.yml +++ b/lang/fr.yml @@ -85,6 +85,8 @@ error_scm_command_failed: "Une erreur s'est produite lors de l'accès au dépôt error_scm_annotate: "L'entrée n'existe pas ou ne peut pas être annotée." error_issue_not_found_in_project: "La demande n'existe pas ou n'appartient pas à ce projet" +warning_attachments_not_saved: "%d fichier(s) n'ont pas pu être sauvegardés." + mail_subject_lost_password: Votre mot de passe %s mail_body_lost_password: 'Pour changer votre mot de passe, cliquez sur le lien suivant:' mail_subject_register: Activation de votre compte %s @@ -661,6 +663,7 @@ text_issues_destroy_confirmation: 'Etes-vous sûr de vouloir supprimer le(s) dem text_select_project_modules: 'Selectionner les modules à activer pour ce project:' text_default_administrator_account_changed: Compte administrateur par défaut changé text_file_repository_writable: Répertoire de stockage des fichiers accessible en écriture +text_plugin_assets_writable: Répertoire public des plugins accessible en écriture text_rmagick_available: Bibliothèque RMagick présente (optionnelle) text_destroy_time_entries_question: %.02f heures ont été enregistrées sur les demandes à supprimer. Que voulez-vous faire ? text_destroy_time_entries: Supprimer les heures diff --git a/lang/he.yml b/lang/he.yml index 6066bee59..617b3acbb 100644 --- a/lang/he.yml +++ b/lang/he.yml @@ -694,3 +694,7 @@ permission_edit_own_messages: ערוך הודעות של עצמך permission_delete_own_messages: מחק הודעות של עצמך label_user_activity: "הפעילות של %s" label_updated_time_by: עודכן ע"י %s לפני %s +setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/hu.yml b/lang/hu.yml index 170c6956e..1768cedbb 100644 --- a/lang/hu.yml +++ b/lang/hu.yml @@ -697,3 +697,5 @@ label_user_activity: "%s tevékenységei" label_updated_time_by: "Módosította %s ennyivel ezelőtt: %s" text_diff_truncated: '... A diff fájl vége nem jelenik meg, mert hosszab, mint a megjeleníthető sorok száma.' setting_diff_max_lines_displayed: A megjelenítendő sorok száma (maximum) a diff fájloknál +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/it.yml b/lang/it.yml index c5efcb219..134096ba0 100644 --- a/lang/it.yml +++ b/lang/it.yml @@ -696,3 +696,5 @@ label_user_activity: "%s's activity" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/ja.yml b/lang/ja.yml index e1dfa2d8a..2ca1a4e4e 100644 --- a/lang/ja.yml +++ b/lang/ja.yml @@ -697,3 +697,5 @@ label_user_activity: "%s's activity" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/ko.yml b/lang/ko.yml index 6d1f1195e..cc072e104 100644 --- a/lang/ko.yml +++ b/lang/ko.yml @@ -696,3 +696,5 @@ label_user_activity: "%s의 작업내역" label_updated_time_by: %s가 %s 전에 변경 text_diff_truncated: '... 이 차이점은 표시할 수 있는 최대 줄수를 초과해서 이 차이점은 잘렸습니다.' setting_diff_max_lines_displayed: 차이점보기에 표시할 최대 줄수 +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/lt.yml b/lang/lt.yml index e8d663d6c..ef2978e80 100644 --- a/lang/lt.yml +++ b/lang/lt.yml @@ -698,3 +698,5 @@ default_activity_development: Vystymas enumeration_issue_priorities: Darbo prioritetai enumeration_doc_categories: Dokumento kategorijos enumeration_activities: Veiklos (laiko sekimas) +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/nl.yml b/lang/nl.yml index 51b91a1a1..bbffbf111 100644 --- a/lang/nl.yml +++ b/lang/nl.yml @@ -698,3 +698,5 @@ label_user_activity: "%s's activity" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/no.yml b/lang/no.yml index 8cf2321f1..9d0ccc932 100644 --- a/lang/no.yml +++ b/lang/no.yml @@ -697,3 +697,5 @@ label_user_activity: "%s's activity" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/pl.yml b/lang/pl.yml index f42a8d269..9742e19a1 100644 --- a/lang/pl.yml +++ b/lang/pl.yml @@ -715,3 +715,5 @@ label_user_activity: "Aktywność: %s" label_updated_time_by: Uaktualnione przez %s %s temu text_diff_truncated: '... Ten plik różnic został przycięty ponieważ jest zbyt długi.' setting_diff_max_lines_displayed: Maksymalna liczba linii różnicy do pokazania +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/pt-br.yml b/lang/pt-br.yml index c0320b9c1..90e7e770c 100644 --- a/lang/pt-br.yml +++ b/lang/pt-br.yml @@ -697,3 +697,5 @@ label_user_activity: "Atividade de %s" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/pt.yml b/lang/pt.yml index 5b4ea1cd8..17cc36b04 100644 --- a/lang/pt.yml +++ b/lang/pt.yml @@ -698,3 +698,5 @@ label_user_activity: "Actividade de %s" label_updated_time_by: Actualizado por %s há %s text_diff_truncated: '... Este diff foi truncado porque excede o tamanho máximo que pode ser mostrado.' setting_diff_max_lines_displayed: Número máximo de linhas de diff mostradas +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/ro.yml b/lang/ro.yml index 72d8f871c..25684ced3 100644 --- a/lang/ro.yml +++ b/lang/ro.yml @@ -696,3 +696,5 @@ label_user_activity: "%s's activity" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/ru.yml b/lang/ru.yml index ce051bd5c..2a8bd3c63 100644 --- a/lang/ru.yml +++ b/lang/ru.yml @@ -730,3 +730,5 @@ text_user_wrote: '%s написал(а):' text_wiki_destroy_confirmation: Вы уверены, что хотите удалить данную Wiki и все ее содержимое? text_workflow_edit: Выберите роль и трекер для редактирования последовательности состояний +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/sk.yml b/lang/sk.yml index 8f874356b..f1a96fcca 100644 --- a/lang/sk.yml +++ b/lang/sk.yml @@ -702,3 +702,5 @@ label_user_activity: "%s's activity" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/sr.yml b/lang/sr.yml index 4a4b6d083..dbe5c5ef5 100644 --- a/lang/sr.yml +++ b/lang/sr.yml @@ -697,3 +697,5 @@ label_user_activity: "%s's activity" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/sv.yml b/lang/sv.yml index df5fccff8..8cd5cbe1a 100644 --- a/lang/sv.yml +++ b/lang/sv.yml @@ -696,4 +696,6 @@ default_activity_development: Utveckling enumeration_issue_priorities: Ärendeprioriteter enumeration_doc_categories: Dokumentkategorier -enumeration_activities: Aktiviteter (tidsuppföljning) \ No newline at end of file +enumeration_activities: Aktiviteter (tidsuppföljning) +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/th.yml b/lang/th.yml index a569a50d5..cd3c481c2 100644 --- a/lang/th.yml +++ b/lang/th.yml @@ -699,3 +699,5 @@ label_user_activity: "%s's activity" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/tr.yml b/lang/tr.yml index a587b4214..d6f32ce3c 100644 --- a/lang/tr.yml +++ b/lang/tr.yml @@ -697,3 +697,5 @@ label_user_activity: "%s's activity" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/uk.yml b/lang/uk.yml index b5d7c9789..845fdece2 100644 --- a/lang/uk.yml +++ b/lang/uk.yml @@ -698,3 +698,5 @@ label_user_activity: "%s's activity" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/vn.yml b/lang/vn.yml index de5a4f058..59176772f 100644 --- a/lang/vn.yml +++ b/lang/vn.yml @@ -699,3 +699,5 @@ label_user_activity: "%s's activity" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/zh-tw.yml b/lang/zh-tw.yml index ad6be1b4b..5679069a2 100644 --- a/lang/zh-tw.yml +++ b/lang/zh-tw.yml @@ -698,3 +698,5 @@ default_activity_development: 開發 enumeration_issue_priorities: 項目優先權 enumeration_doc_categories: 文件分類 enumeration_activities: 活動 (時間追蹤) +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/zh.yml b/lang/zh.yml index 6e6b42b50..e1e30d27e 100644 --- a/lang/zh.yml +++ b/lang/zh.yml @@ -698,3 +698,5 @@ default_activity_development: 开发 enumeration_issue_priorities: 问题优先级 enumeration_doc_categories: 文档类别 enumeration_activities: 活动(时间跟踪) +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lib/redmine/imap.rb b/lib/redmine/imap.rb index a6cd958cd..383d82f23 100644 --- a/lib/redmine/imap.rb +++ b/lib/redmine/imap.rb @@ -1,4 +1,4 @@ -# redMine - project management software +# Redmine - project management software # Copyright (C) 2006-2008 Jean-Philippe Lang # # This program is free software; you can redistribute it and/or @@ -33,9 +33,18 @@ module Redmine msg = imap.fetch(message_id,'RFC822')[0].attr['RFC822'] logger.debug "Receiving message #{message_id}" if logger && logger.debug? if MailHandler.receive(msg, options) + logger.debug "Message #{message_id} successfully received" if logger && logger.debug? + if imap_options[:move_on_success] + imap.copy(message_id, imap_options[:move_on_success]) + end imap.store(message_id, "+FLAGS", [:Seen, :Deleted]) else + logger.debug "Message #{message_id} can not be processed" if logger && logger.debug? imap.store(message_id, "+FLAGS", [:Seen]) + if imap_options[:move_on_failure] + imap.copy(message_id, imap_options[:move_on_failure]) + imap.store(message_id, "+FLAGS", [:Deleted]) + end end end imap.expunge diff --git a/lib/tasks/email.rake b/lib/tasks/email.rake index 30101cab7..0f74d6bd3 100644 --- a/lib/tasks/email.rake +++ b/lib/tasks/email.rake @@ -1,4 +1,4 @@ -# redMine - project management software +# Redmine - project management software # Copyright (C) 2006-2008 Jean-Philippe Lang # # This program is free software; you can redistribute it and/or @@ -71,6 +71,11 @@ Issue attributes control options: allow_override=ATTRS allow email content to override attributes specified by previous options ATTRS is a comma separated list of attributes + +Processed emails control options: + move_on_success=MAILBOX move emails that were successfully received + to MAILBOX instead of deleting them + move_on_failure=MAILBOX move emails that were ignored to MAILBOX Examples: # No project specified. Emails MUST contain the 'Project' keyword: @@ -95,7 +100,9 @@ END_DESC :ssl => ENV['ssl'], :username => ENV['username'], :password => ENV['password'], - :folder => ENV['folder']} + :folder => ENV['folder'], + :move_on_success => ENV['move_on_success'], + :move_on_failure => ENV['move_on_failure']} options = { :issue => {} } %w(project status tracker category priority).each { |a| options[:issue][a.to_sym] = ENV[a] if ENV[a] } diff --git a/public/images/warning.png b/public/images/warning.png index bbef670b6..628cf2dae 100644 Binary files a/public/images/warning.png and b/public/images/warning.png differ diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 751293bfb..824b4cb7b 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -314,6 +314,14 @@ div.flash.notice { color: #005f00; } +div.flash.warning { + background: url(../images/warning.png) 8px 5px no-repeat; + background-color: #FFEBC1; + border-color: #FDBF3B; + color: #A6750C; + text-align: left; +} + .nodata, .warning { text-align: center; background-color: #FFEBC1;