* finished Issue 25: Uploading files doesn't send notifications emails by default

git-svn-id: http://redmine-dmsf.googlecode.com/svn/trunk/redmine_dmsf@50 5e329b0b-a2ee-ea63-e329-299493fc886d
This commit is contained in:
vit.jonas@gmail.com 2011-05-18 08:03:20 +00:00
parent 9c1323e9b0
commit 6be21b02a5
4 changed files with 60 additions and 48 deletions

View File

@ -188,6 +188,7 @@ class DmsfFile < ActiveRecord::Base
file.project = project
file.folder = folder
file.name = commited_file["name"]
file.notification = !Setting.plugin_redmine_dmsf["dmsf_default_notifications"].blank?
file.save
end

View File

@ -3,7 +3,7 @@
<div class="contextual">
<% if User.current.allowed_to?(:file_manipulation, @project) %>
<% unless @file.locked_for_user? && !User.current.allowed_to?(:force_file_unlock, @project)%>
<% if @file.locked? %>
<% if @file.locked? %>
<%= link_to(image_tag("unlock.png", :plugin => "redmine_dmsf"),
{:controller => "dmsf_state", :action => "unlock_file", :id => @project, :file_id => @file,
:current => request.url },
@ -65,60 +65,60 @@
:class => "delete-revision", :title => l(:title_delete_revision)) %>
<% end %>
</div>
<p class="no-ident">
<%=label_tag("", (revision.source_revision.nil? ? l(:label_created) : l(:label_changed)) + ":")%>
<%= l(:info_changed_by_user, :changed => revision.updated_at.strftime("%Y-%m-%d %H:%M:%S"), :user => h(revision.user)) %>
</p>
<div class="clear">
<div class="splitcontentleft">
<p>
<%= label_tag("", l(:label_title) + ":") %>
<%= h(revision.title) %>
</p>
</div>
<div class="splitcontentright">
<p>
<%= label_tag("", l(:label_filename) + ":") %>
<%= h(revision.name) %>
</p>
</div>
</div>
<p class="no-ident">
<%= label_tag("", l(:label_description) + ":") %>
</p>
<div class="wiki clear" style="margin-left: 110px">
<%= textilizable(revision.description) %>
</div>
<p class="no-ident">
<%=label_tag("", (revision.source_revision.nil? ? l(:label_created) : l(:label_changed)) + ":")%>
<%= l(:info_changed_by_user, :changed => revision.updated_at.strftime("%Y-%m-%d %H:%M:%S"), :user => h(revision.user)) %>
</p>
<div class="clear">
<div class="splitcontentleft">
<p>
<%= label_tag("", l(:label_version) + ":") %>
<%= revision.major_version %>.<%= revision.minor_version %>
</p>
<p>
<%= label_tag("", l(:label_workflow) + ":") %>
<%= case revision.workflow
when 1 then l(:option_workflow_waiting_for_approval)
when 2 then l(:option_workflow_approved)
else l(:option_workflow_none)
end %>
<%= label_tag("", l(:label_title) + ":") %>
<%= h(revision.title) %>
</p>
</div>
<div class="splitcontentright clear">
<div class="splitcontentright">
<p>
<%= label_tag("", l(:label_mime) + ":") %>
<%= h(revision.mime_type) %>&nbsp;
</p>
<p>
<%= label_tag("", l(:label_size) + ":") %>
<%= number_to_human_size(revision.size) %>
<%= label_tag("", l(:label_filename) + ":") %>
<%= h(revision.name) %>
</p>
</div>
<br style="clear: both"/>
<p class="no-ident clear">
<%= label_tag("", l(:label_comment) + ":") %>
<%= h(revision.comment) %>
</div>
<p class="no-ident">
<%= label_tag("", l(:label_description) + ":") %>
</p>
<div class="wiki clear" style="margin-left: 110px">
<%= textilizable(revision.description) %>
</div>
<div class="splitcontentleft">
<p>
<%= label_tag("", l(:label_version) + ":") %>
<%= revision.major_version %>.<%= revision.minor_version %>
</p>
<p>
<%= label_tag("", l(:label_workflow) + ":") %>
<%= case revision.workflow
when 1 then l(:option_workflow_waiting_for_approval)
when 2 then l(:option_workflow_approved)
else l(:option_workflow_none)
end %>
</p>
</div>
<div class="splitcontentright clear">
<p>
<%= label_tag("", l(:label_mime) + ":") %>
<%= h(revision.mime_type) %>&nbsp;
</p>
<p>
<%= label_tag("", l(:label_size) + ":") %>
<%= number_to_human_size(revision.size) %>
</p>
</div>
<br style="clear: both"/>
<p class="no-ident clear">
<%= label_tag("", l(:label_comment) + ":") %>
<%= h(revision.comment) %>
</p>
</div>
<% end %>

View File

@ -20,6 +20,16 @@
(<%=l(:label_default)%>: <%="#{RAILS_ROOT}/files/dmsf"%>)
</p>
<p>
<%=content_tag(:label, l(:label_default_notifications) + ":") %>
<%=select_tag("settings[dmsf_default_notifications]",
options_for_select([
[l(:select_option_deactivated), nil],
[l(:select_option_activated), "1"]],
:selected => @settings["dmsf_default_notifications"])) %><br/>
(<%=l(:label_default)%>: <%=l(:select_option_deactivated)%>)
</p>
<hr />
<p>
<%=content_tag(:label, l(:label_index_database) + ":") %>
<%=text_field_tag 'settings[dmsf_index_database]', @settings['dmsf_index_database'], :size=>50 %><br/>

View File

@ -106,7 +106,6 @@ en:
:option_version_minor: "Minor"
:option_version_major: "Major"
:label_new_content: "New content"
:label_maximum_files_upload: "Maximum files upload"
:note_maximum_number_of_files_uploaded: "Limits maximum number of files uploaded at once. 0 means unlimited."
:label_maximum_files_download: "Maximum files download"
@ -126,3 +125,5 @@ en:
:note_stem_all: "Search for stemmed forms of all words (note: no 'Z' prefix is added)."
:note_stemming_applied: "Note that the stemming algorithm is only applied to words in probabilistic fields - boolean filter terms are never stemmed."
:label_default_notifications: "File default notifications"