diff --git a/app/controllers/dmsf_controller.rb b/app/controllers/dmsf_controller.rb index af06b2f7..45172c6f 100644 --- a/app/controllers/dmsf_controller.rb +++ b/app/controllers/dmsf_controller.rb @@ -75,7 +75,7 @@ class DmsfController < ApplicationController DmsfMailer.send_documents(User.current, @email_params["to"], @email_params["cc"], @email_params["subject"], @email_params["zipped_content"], @email_params["body"]).deliver File.delete(@email_params["zipped_content"]) - flash[:notice] = l(:notice_email_sent) + flash[:notice] = l(:notice_email_sent, @email_params["to"]) redirect_to({:controller => "dmsf", :action => "show", :id => @project, :folder_id => @folder}) end @@ -203,26 +203,46 @@ class DmsfController < ApplicationController redirect_to :controller => "dmsf", :action => "show", :id => @project end - def notify_activate - if @folder.notification + def notify_activate + if((@folder && @folder.notification) || (@folder.nil? && @project.dmsf_notification)) flash[:warning] = l(:warning_folder_notifications_already_activated) else - @folder.notify_activate + if @folder + @folder.notify_activate + else + @project.dmsf_notification = true + @project.save + end flash[:notice] = l(:notice_folder_notifications_activated) end - redirect_to params[:current] ? params[:current] : - {:controller => "dmsf", :action => "show", :id => @project, :folder_id => @folder.folder} + if params[:current] + redirect_to params[:current] + elsif @folder + redirect_to({:controller => 'dmsf', :action => 'show', :id => @project, :folder_id => @folder.folder}) + else + redirect_to({:controller => 'dmsf', :action => 'show', :id => @project}) + end end def notify_deactivate - if !@folder.notification + if((@folder && !@folder.notification) || (@folder.nil? && !@project.dmsf_notification)) flash[:warning] = l(:warning_folder_notifications_already_deactivated) else - @folder.notify_deactivate + if @folder + @folder.notify_deactivate + else + @project.dmsf_notification = false + @project.save + end flash[:notice] = l(:notice_folder_notifications_deactivated) end - redirect_to params[:current] ? params[:current] : - {:controller => "dmsf", :action => "show", :id => @project, :folder_id => @folder.folder} + if params[:current] + redirect_to params[:current] + elsif @folder + redirect_to({:controller => 'dmsf', :action => 'show', :id => @project, :folder_id => @folder.folder}) + else + redirect_to({:controller => 'dmsf', :action => 'show', :id => @project}) + end end diff --git a/app/controllers/dmsf_files_controller.rb b/app/controllers/dmsf_files_controller.rb index 6b107d33..f87fed4c 100644 --- a/app/controllers/dmsf_files_controller.rb +++ b/app/controllers/dmsf_files_controller.rb @@ -49,7 +49,11 @@ class DmsfFilesController < ApplicationController end end check_project(@revision.file) - send_revision + begin + send_revision + rescue ActionController::MissingFile => e + render_404 + end return end @@ -125,7 +129,7 @@ class DmsfFilesController < ApplicationController begin DmsfMailer.files_updated(User.current, [@file]).deliver rescue ActionView::MissingTemplate => e - Rails.logger.error "Could not send email notifications: " + e + Rails.logger.error "Could not send email notifications: #{e.message}" end redirect_to :action => "show", :id => @file else diff --git a/app/controllers/dmsf_files_copy_controller.rb b/app/controllers/dmsf_files_copy_controller.rb index c1aba7f9..016d0402 100644 --- a/app/controllers/dmsf_files_copy_controller.rb +++ b/app/controllers/dmsf_files_copy_controller.rb @@ -72,7 +72,7 @@ class DmsfFilesCopyController < ApplicationController begin DmsfMailer.files_updated(User.current, [new_file]).deliver rescue ActionView::MissingTemplate => e - Rails.logger.error "Could not send email notifications: " + e + Rails.logger.error "Could not send email notifications: #{e.message}" end redirect_to :controller => "dmsf_files", :action => "show", :id => new_file @@ -110,7 +110,7 @@ class DmsfFilesCopyController < ApplicationController # TODO: implement proper mail notification DmsfMailer.files_updated(User.current, [@file]).deliver rescue ActionView::MissingTemplate => e - Rails.logger.error "Could not send email notifications: " + e + Rails.logger.error "Could not send email notifications: #{e.message}" end redirect_to :controller => "dmsf_files", :action => "show", :id => @file diff --git a/app/controllers/dmsf_upload_controller.rb b/app/controllers/dmsf_upload_controller.rb index 019c3f2b..78037d0f 100644 --- a/app/controllers/dmsf_upload_controller.rb +++ b/app/controllers/dmsf_upload_controller.rb @@ -121,8 +121,7 @@ class DmsfUploadController < ApplicationController new_revision.title = commited_file["title"] new_revision.description = commited_file["description"] new_revision.comment = commited_file["comment"] - new_revision.increase_version(commited_file["version"].to_i, true) - #new_revision.set_workflow(commited_file[:dmsf_workflow_id], nil) + new_revision.increase_version(commited_file["version"].to_i, true) new_revision.mime_type = Redmine::MimeType.of(new_revision.name) new_revision.size = File.size(commited_disk_filepath) @@ -134,8 +133,13 @@ class DmsfUploadController < ApplicationController end if file.locked? - file.unlock! - flash[:notice] = l(:notice_file_unlocked) + begin + file.unlock! + flash[:notice] = l(:notice_file_unlocked) + rescue DmsfLockError => e + flash[:error] = e.message + next + end end # Need to save file first to generate id for it in case of creation. diff --git a/app/models/dmsf_file.rb b/app/models/dmsf_file.rb index 6fd87643..e2294682 100644 --- a/app/models/dmsf_file.rb +++ b/app/models/dmsf_file.rb @@ -125,23 +125,23 @@ class DmsfFile < ActiveRecord::Base end def title - self.last_revision.title + self.last_revision ? self.last_revision.title : self.name end def description - self.last_revision.description + self.last_revision ? self.last_revision.description : '' end def version - self.last_revision.version + self.last_revision ? self.last_revision.version : '0' end def workflow - self.last_revision.workflow + self.last_revision ? self.last_revision.workflow : nil end def size - self.last_revision.size + self.last_revision ? self.last_revision.size : 0 end def dmsf_path @@ -150,15 +150,14 @@ class DmsfFile < ActiveRecord::Base path end - def dmsf_path_str - path = self.dmsf_path - string_path = path.map { |element| element.title } - string_path.join("/") + def dmsf_path_str + self.dmsf_path.map { |element| element.title }.join('/') end def notify? return true if self.notification return true if folder && folder.notify? + return true if !folder && self.project.dmsf_notification return false end diff --git a/app/models/dmsf_folder.rb b/app/models/dmsf_folder.rb index 8ab595e2..45103f67 100644 --- a/app/models/dmsf_folder.rb +++ b/app/models/dmsf_folder.rb @@ -115,6 +115,7 @@ class DmsfFolder < ActiveRecord::Base def notify? return true if self.notification return true if folder && folder.notify? + return true if !folder && self.project.dmsf_notification return false end diff --git a/app/views/dmsf/_path.html.erb b/app/views/dmsf/_path.html.erb deleted file mode 100644 index a937bff4..00000000 --- a/app/views/dmsf/_path.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -<%= link_to(l(:link_documents), {:controller => "dmsf", :action => "show", :id=> @project }) %> -<% path.each do |path_element| %> - / - <%= link_to(h(path_element.title), {:controller => "dmsf", :action => "show", :id=> @project, :folder_id => path_element}) %> - <% if path_element.notification %> - <%= image_tag("notify.png", :plugin => "redmine_dmsf", :title => l(:title_notifications_active)) %> - <% end %> -<% end %> diff --git a/app/views/dmsf/edit.html.erb b/app/views/dmsf/edit.html.erb index 171896ca..90b31c0d 100644 --- a/app/views/dmsf/edit.html.erb +++ b/app/views/dmsf/edit.html.erb @@ -7,9 +7,15 @@ <% create = @pathfolder == @parent %> -

-<%= render(:partial => "path", :locals => {:path => @pathfolder.nil? ? [] : @pathfolder.dmsf_path}) %> -<%= ("/ " + l(:heading_new_folder)) if create %> + +

+ <% path = @pathfolder ? @pathfolder.dmsf_path : [] %> + <%= link_to l(:link_documents), {:controller => 'dmsf', :action => 'show', :id=> @project } %> + <% path.each do |path_element| %> + / + <%= link_to h(path_element.title), {:controller => 'dmsf', :action => 'show', :id=> @project, :folder_id => path_element} %> + <% end %> + <%= "/ #{l(:heading_new_folder)}" if create %>

<%= form_for(@folder, :url => {:action => create ? "create" : "save", :id => @project, :folder_id => @folder, :parent_id => @parent}, diff --git a/app/views/dmsf/edit_root.html.erb b/app/views/dmsf/edit_root.html.erb index 9bfd70b7..80921403 100644 --- a/app/views/dmsf/edit_root.html.erb +++ b/app/views/dmsf/edit_root.html.erb @@ -3,23 +3,25 @@
-

<%= render(:partial => "path", :locals => {:path => []}) %>

+

+ <%= link_to l(:link_documents), {:controller => 'dmsf', :action => 'show', :id => @project } %> +

-<%= form_for(@project, :url => {:action => "save_root", :id => @project}, - :html => {:method=>:post}) do |f| %> -
-

- <%= label_tag("project_dmsf_description", l(:label_description) + ":") %> -

-
- <%= f.text_area(:dmsf_description, :rows => 15, :class => "wiki-edit") %> -
-
- <%= submit_tag(l(:submit_save)) %> +<%= form_for(@project, :url => {:action => 'save_root', :id => @project}, + :html => {:method=>:post}) do |f| %> +
+

+ <%= label_tag('project_dmsf_description', "#{l(:label_description)}:") %> +

+
+ <%= f.text_area(:dmsf_description, :rows => 15, :class => 'wiki-edit') %> +
+
+ <%= submit_tag(l(:submit_save)) %> <% end %> -<%= wikitoolbar_for "dmsf_folder_description" %> +<%= wikitoolbar_for 'dmsf_folder_description' %> <% content_for :header_tags do %> - <%= stylesheet_link_tag "dmsf", :plugin => "redmine_dmsf" %> + <%= stylesheet_link_tag 'dmsf', :plugin => 'redmine_dmsf' %> <% end %> diff --git a/app/views/dmsf/email_entries.html.erb b/app/views/dmsf/email_entries.html.erb index 7740daa3..35373721 100644 --- a/app/views/dmsf/email_entries.html.erb +++ b/app/views/dmsf/email_entries.html.erb @@ -3,9 +3,13 @@
-<% path = @folder.nil? ? [] : @folder.dmsf_path %> -

-<%= render(:partial => 'path', :locals => {:path => path}) %> +

+ <% path = @folder ? @folder.dmsf_path : [] %> + <%= link_to l(:link_documents), {:controller => 'dmsf', :action => 'show', :id=> @project } %> + <% path.each do |path_element| %> + / + <%= link_to h(path_element.title), {:controller => 'dmsf', :action => 'show', :id=> @project, :folder_id => path_element} %> + <% end %>

<%= l(:heading_send_documents_by_email) %>

diff --git a/app/views/dmsf/show.html.erb b/app/views/dmsf/show.html.erb index 11fb1dd0..cb5be56a 100644 --- a/app/views/dmsf/show.html.erb +++ b/app/views/dmsf/show.html.erb @@ -1,40 +1,56 @@ <% html_title(l(:dmsf)) %>
- <% if User.current.allowed_to?(:folder_manipulation, @project) %> - <% if !@folder.nil? && (!@folder.locked_for_user? || User.current.allowed_to?(:force_file_unlock, @project)) %> - <% if @folder.locked? %> - <% unless @folder.unlockable? %> - <%= image_tag("locked.png", :plugin => :redmine_dmsf, :title => l(:title_folder_parent_locked, :name => @folder.folder.lock.reverse[0].folder.title)) unless @folder.nil?%> - <% else %> - <%= link_to_function(image_tag("unlock.png", :plugin => "redmine_dmsf"), - "manipulation_link('#{url_for(:action => 'unlock', :id => @project, :folder_id => @folder, :current => request.url)}')", - :title => l(:title_unlock_folder)) unless @folder.nil?%> - <% end %> - <% else %> - <%= link_to_function(image_tag("lock.png", :plugin => "redmine_dmsf"), - "manipulation_link('#{url_for(:action => 'lock', :id => @project, :folder_id => @folder, :current => request.url)}')", - :title => l(:title_lock_folder)) unless @folder.nil?%> - <% end %> - <% end %> - <% if @folder.nil? %> -   - <%= link_to("", {:action => "edit_root", :id => @project}, - :title => l(:link_edit, :title => l(:link_documents)), :class => "icon icon-edit") %> - <% elsif (!@folder.nil? && !@folder.locked_for_user? ) %> -   - <%= link_to("", {:action => "edit", :id => @project, :folder_id => @folder }, - :title => l(:link_edit, :title => h(@folder.title)), :class => "icon icon-edit") %> - <% end %> -   - <%= link_to("", {:action => "new", :id => @project, :parent_id => @folder }, - :title => l(:link_create_folder), :class => "icon icon-add") unless (!@folder.nil? && @folder.locked_for_user?) %> - <% end %> + <% if User.current.allowed_to?(:folder_manipulation, @project) %> + <% if @folder.nil? %> +   + <%= link_to('', {:action => 'edit_root', :id => @project}, + :title => l(:link_edit, :title => l(:link_documents)), :class => 'icon icon-edit') %> + <% elsif (@folder && !@folder.locked_for_user? ) %> +   + <%= link_to('', {:action => 'edit', :id => @project, :folder_id => @folder }, + :title => l(:link_edit, :title => h(@folder.title)), :class => 'icon icon-edit') %> + <% end %> + <% if @folder && (!@folder.locked_for_user? || User.current.allowed_to?(:force_file_unlock, @project)) %> + <% if @folder.locked? %> + <% unless @folder.unlockable? %> + <%= image_tag('locked.png', :plugin => :redmine_dmsf, :title => l(:title_folder_parent_locked, :name => @folder.folder.lock.reverse[0].folder.title)) unless @folder.nil?%> + <% else %> + <%= link_to_function(image_tag('unlock.png', :plugin => 'redmine_dmsf'), + "manipulation_link('#{url_for(:action => 'unlock', :id => @project, :folder_id => @folder, :current => request.url)}')", + :title => l(:title_unlock_folder)) if @folder %> + <% end %> + <% else %> + <%= link_to_function(image_tag('lock.png', :plugin => 'redmine_dmsf'), + "manipulation_link('#{url_for(:action => 'lock', :id => @project, :folder_id => @folder, :current => request.url)}')", + :title => l(:title_lock_folder)) if @folder %> + <% end %> + <% end %> + <% unless @folder %> +   + <% if @project.dmsf_notification %> + <%= link_to_function(image_tag('notify.png', :plugin => :redmine_dmsf), + "manipulation_link('#{url_for(:action => 'notify_deactivate', :id => @project)}')", + :title => l(:title_notifications_active_deactivate)) %> + <% else %> + <%= link_to_function(image_tag('notifynot.png', :plugin => :redmine_dmsf), + "manipulation_link('#{url_for(:action => 'notify_activate', :id => @project)}')", + :title => l(:title_notifications_not_active_activate)) %> + <% end %> + <% end %> +   + <%= link_to('', {:action => 'new', :id => @project, :parent_id => @folder }, + :title => l(:link_create_folder), :class => 'icon icon-add') unless (@folder && @folder.locked_for_user?) %> + <% end %>
-<% path = @folder.nil? ? [] : @folder.dmsf_path %> -

- <%= render(:partial => 'path', :locals => {:path => path}) %> +

+ <% path = @folder ? @folder.dmsf_path : [] %> + <%= link_to l(:link_documents), {:controller => 'dmsf', :action => 'show', :id=> @project } %> + <% path.each do |path_element| %> + / + <%= link_to h(path_element.title), {:controller => 'dmsf', :action => 'show', :id=> @project, :folder_id => path_element} %> + <% end %>

@@ -218,13 +234,15 @@ :title => l(:title_waiting_for_approval), :remote => true) %> <% else %> - <%= image_tag('waiting_for_approval.png', :title => "#{l(:label_dmsf_wokflow_action_approve)} #{l(:label_dmsf_wokflow_action_reject)} #{l(:label_dmsf_wokflow_action_delegate)}", :plugin => :redmine_dmsf) %> + <%= image_tag('waiting_for_approval.png', :title => "#{l(:label_dmsf_wokflow_action_approve)} #{l(:label_dmsf_wokflow_action_reject)} #{l(:label_dmsf_wokflow_action_delegate)}", :plugin => :redmine_dmsf) %> <% end %> + <% else %> + <%= image_tag('waiting_for_approval.png', :title => "#{l(:label_dmsf_wokflow_action_approve)} #{l(:label_dmsf_wokflow_action_reject)} #{l(:label_dmsf_wokflow_action_delegate)}", :plugin => :redmine_dmsf) %> <% end %> <% when DmsfWorkflow::STATE_APPROVED %> <%= image_tag('approved.png', :title => l(:title_approved), :plugin => :redmine_dmsf) %> <% when DmsfWorkflow::STATE_ASSIGNED %> - <% if User.current && (file.last_revision.dmsf_workflow_assigned_by == User.current.id) %> + <% if User.current && (file.last_revision.dmsf_workflow_assigned_by == User.current.id) && wf %> <%= link_to_function(image_tag('assigned.png', :plugin => :redmine_dmsf), "manipulation_link('#{start_dmsf_workflow_path( :id => file.last_revision.dmsf_workflow_id, diff --git a/app/views/dmsf_files/show.html.erb b/app/views/dmsf_files/show.html.erb index 8235422b..b448740a 100644 --- a/app/views/dmsf_files/show.html.erb +++ b/app/views/dmsf_files/show.html.erb @@ -40,12 +40,16 @@ <%= link_to(image_tag("copy.png"), {:controller => :dmsf_files_copy, :action => "new", :id => @file }, :title => l(:title_copy_or_move)) %>
-<% path = @file.folder.nil? ? [] : @file.folder.dmsf_path %> -

-<%= render(:partial => "/dmsf/path", :locals => {:path => path}) %> -/ -<%= h(@file.last_revision.title) %> -<%= image_tag("notify.png", :plugin => "redmine_dmsf", :title => l(:title_notifications_active)) if @file.notification %> +

+ <% path = @file.folder ? @file.folder.dmsf_path : [] %> + <%= link_to l(:link_documents), {:controller => 'dmsf', :action => 'show', :id=> @project } %> + <% path.each do |path_element| %> + / + <%= link_to h(path_element.title), {:controller => 'dmsf', :action => 'show', :id=> @project, :folder_id => path_element} %> + <% end %> + / + <%= h(@file.last_revision.title) %> + <%= image_tag('notify.png', :plugin => 'redmine_dmsf', :title => l(:title_notifications_active)) if @file.notification %>

<%= error_messages_for("file") %> diff --git a/app/views/dmsf_files_copy/new.html.erb b/app/views/dmsf_files_copy/new.html.erb index a51d6dc4..3debefac 100644 --- a/app/views/dmsf_files_copy/new.html.erb +++ b/app/views/dmsf_files_copy/new.html.erb @@ -3,12 +3,16 @@
-<% path = @file.folder.nil? ? [] : @file.folder.dmsf_path %> -

-<%= render(:partial => "/dmsf/path", :locals => {:path => path}) %> -/ -<%= link_to(h(@file.title), {:controller => "dmsf_files", :action => "show", :id=> @file}) %> -<%= image_tag("notify.png", :plugin => "redmine_dmsf", :title => l(:title_notifications_active)) if @file.notification %> +

+ <% path = @file.folder ? @file.folder.dmsf_path : [] %> + <%= link_to l(:link_documents), {:controller => 'dmsf', :action => 'show', :id=> @project } %> + <% path.each do |path_element| %> + / + <%= link_to h(path_element.title), {:controller => 'dmsf', :action => 'show', :id=> @project, :folder_id => path_element} %> + <% end %> + / + <%= link_to(h(@file.title), {:controller => "dmsf_files", :action => "show", :id=> @file}) %> + <%= image_tag("notify.png", :plugin => "redmine_dmsf", :title => l(:title_notifications_active)) if @file.notification %>

<% unless DmsfFile.allowed_target_projects_on_copy.blank? %> diff --git a/app/views/dmsf_folders_copy/new.html.erb b/app/views/dmsf_folders_copy/new.html.erb index bda0ef7a..c2d9f365 100644 --- a/app/views/dmsf_folders_copy/new.html.erb +++ b/app/views/dmsf_folders_copy/new.html.erb @@ -3,7 +3,13 @@
-

<%= render(:partial => "/dmsf/path", :locals => {:path => @folder.dmsf_path}) %>

+

+ <%= link_to l(:link_documents), {:controller => 'dmsf', :action => 'show', :id=> @project } %> + <% @folder.dmsf_path.each do |path_element| %> + / + <%= link_to h(path_element.title), {:controller => 'dmsf', :action => 'show', :id=> @project, :folder_id => path_element} %> + <% end %> +

<% unless DmsfFolder.allowed_target_projects_on_copy.blank? %> <%= form_tag({:action => "copy_to", :id => @folder}, :id => "copyForm") do |f| %> diff --git a/app/views/dmsf_mailer/files_deleted.html.erb b/app/views/dmsf_mailer/files_deleted.html.erb index 6c930a4e..17dea212 100644 --- a/app/views/dmsf_mailer/files_deleted.html.erb +++ b/app/views/dmsf_mailer/files_deleted.html.erb @@ -1,17 +1,10 @@ - - - - - - - User <%= link_to(h(@user), {:only_path => false, :controller => "users", :action => "show", :id => @user }) %> - deleted DMSF files in project <%= @project.name %>: - <% @files.each do |file| %> -

- <%= h(file.dmsf_path_str) %> (<%= file.name %>), - <%= number_to_human_size(file.last_revision.size) %>, - version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %> -

- <% end %> - - \ No newline at end of file +User <%= link_to(h(@user), {:only_path => false, :controller => 'users', :action => 'show', :id => @user }) %> +deleted DMSF files in project <%= @project.name %>: +<% @files.each do |file| %> +

+ <%= h(file.dmsf_path_str) %> (<%= file.name %>) + <% if file.last_revision %> + , <%= number_to_human_size(file.last_revision.size) %>, version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %> + <% end %> +

+<% end %> diff --git a/app/views/dmsf_mailer/files_deleted.text.erb b/app/views/dmsf_mailer/files_deleted.text.erb index 52905590..fd6fcbb5 100644 --- a/app/views/dmsf_mailer/files_deleted.text.erb +++ b/app/views/dmsf_mailer/files_deleted.text.erb @@ -1,5 +1,7 @@ User <%= @user %> deleted DMSF files in project <%= @project.name %>: <% @files.each do |file| %> - <%= file.dmsf_path_str %> (<%= file.name %>), <%= number_to_human_size(file.last_revision.size) %>, version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %> - + <%= file.dmsf_path_str %> (<%= file.name %>) + <% if file.last_revision %> + , <%= number_to_human_size(file.last_revision.size) %>, version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %> + <% end %> <% end %> \ No newline at end of file diff --git a/app/views/dmsf_mailer/files_deleted.text.html.rhtml b/app/views/dmsf_mailer/files_deleted.text.html.rhtml deleted file mode 100644 index 6c930a4e..00000000 --- a/app/views/dmsf_mailer/files_deleted.text.html.rhtml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - User <%= link_to(h(@user), {:only_path => false, :controller => "users", :action => "show", :id => @user }) %> - deleted DMSF files in project <%= @project.name %>: - <% @files.each do |file| %> -

- <%= h(file.dmsf_path_str) %> (<%= file.name %>), - <%= number_to_human_size(file.last_revision.size) %>, - version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %> -

- <% end %> - - \ No newline at end of file diff --git a/app/views/dmsf_mailer/files_deleted.text.plain.rhtml b/app/views/dmsf_mailer/files_deleted.text.plain.rhtml deleted file mode 100644 index 52905590..00000000 --- a/app/views/dmsf_mailer/files_deleted.text.plain.rhtml +++ /dev/null @@ -1,5 +0,0 @@ -User <%= @user %> deleted DMSF files in project <%= @project.name %>: -<% @files.each do |file| %> - <%= file.dmsf_path_str %> (<%= file.name %>), <%= number_to_human_size(file.last_revision.size) %>, version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %> - -<% end %> \ No newline at end of file diff --git a/app/views/dmsf_mailer/files_updated.html.erb b/app/views/dmsf_mailer/files_updated.html.erb index 5c6c2bc0..aa38a991 100644 --- a/app/views/dmsf_mailer/files_updated.html.erb +++ b/app/views/dmsf_mailer/files_updated.html.erb @@ -1,25 +1,18 @@ - - - - - - - User <%= link_to(h(@user), {:only_path => false, :controller => "users", :action => "show", :id => @user }) %> - actualized DMSF files in project <%= @project.name %>: - <% @files.each do |file| %> -

- <%= link_to(h(file.dmsf_path_str), - {:only_path => false, :controller => "dmsf_files", :action => "show", :id => file, - :download => ""}) %> (<%= file.name %>), - <%= number_to_human_size(file.last_revision.size) %>, - version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %>, - <%= "#{file.last_revision.workflow_str(true)}," unless file.last_revision.workflow_str(true).blank? %> - <%= link_to("Details", - {:only_path => false, :controller => "dmsf_files", :action => "show", :id => file}) %> - <% unless file.last_revision.comment.blank? %> -
    <%= h(file.last_revision.comment) %> - <% end %> -

- <% end %> - - \ No newline at end of file +User <%= link_to(h(@user), {:only_path => false, :controller => "users", :action => "show", :id => @user }) %> +actualized DMSF files in project <%= @project.name %>: +<% @files.each do |file| %> +

+ <%= link_to(h(file.dmsf_path_str), + {:only_path => false, :controller => "dmsf_files", :action => "show", :id => file, + :download => ""}) %> (<%= file.name %>), + <%= number_to_human_size(file.last_revision.size) %>, + version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %>, + <%= "#{file.last_revision.workflow_str(true)}," unless file.last_revision.workflow_str(true).blank? %> + <%= link_to("Details", + {:only_path => false, :controller => "dmsf_files", :action => "show", :id => file}) %> + <% unless file.last_revision.comment.blank? %> +
    <%= h(file.last_revision.comment) %> + <% end %> +

+<% end %> + \ No newline at end of file diff --git a/app/views/dmsf_mailer/files_updated.text.html.rhtml b/app/views/dmsf_mailer/files_updated.text.html.rhtml deleted file mode 100644 index 5c6c2bc0..00000000 --- a/app/views/dmsf_mailer/files_updated.text.html.rhtml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - User <%= link_to(h(@user), {:only_path => false, :controller => "users", :action => "show", :id => @user }) %> - actualized DMSF files in project <%= @project.name %>: - <% @files.each do |file| %> -

- <%= link_to(h(file.dmsf_path_str), - {:only_path => false, :controller => "dmsf_files", :action => "show", :id => file, - :download => ""}) %> (<%= file.name %>), - <%= number_to_human_size(file.last_revision.size) %>, - version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %>, - <%= "#{file.last_revision.workflow_str(true)}," unless file.last_revision.workflow_str(true).blank? %> - <%= link_to("Details", - {:only_path => false, :controller => "dmsf_files", :action => "show", :id => file}) %> - <% unless file.last_revision.comment.blank? %> -
    <%= h(file.last_revision.comment) %> - <% end %> -

- <% end %> - - \ No newline at end of file diff --git a/app/views/dmsf_mailer/files_updated.text.plain.rhtml b/app/views/dmsf_mailer/files_updated.text.plain.rhtml deleted file mode 100644 index fcd0ea79..00000000 --- a/app/views/dmsf_mailer/files_updated.text.plain.rhtml +++ /dev/null @@ -1,6 +0,0 @@ -User <%= @user %> actualized DMSF files in project <%= @project.name %>: -<% @files.each do |file| %> - <%= file.dmsf_path_str %> (<%= file.name %>), <%= number_to_human_size(file.last_revision.size) %>, version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %><%= ", #{file.last_revision.workflow_str(true)}" unless file.last_revision.workflow_str(true).blank? %> - <%= url_for({:only_path => false, :controller => "dmsf_files", :action => "show", :id => file}) %> - <% unless file.last_revision.comment.blank? %> comment: <%= file.last_revision.comment %><% end %> -<% end %> \ No newline at end of file diff --git a/app/views/dmsf_mailer/workflow_notification.html.erb b/app/views/dmsf_mailer/workflow_notification.html.erb index 9741cca8..765e5d40 100644 --- a/app/views/dmsf_mailer/workflow_notification.html.erb +++ b/app/views/dmsf_mailer/workflow_notification.html.erb @@ -1,15 +1,8 @@ - - - - - - -

Dear user,

-

- <%= @text1 %> -

-

- <%= @text2 %> -

- - \ No newline at end of file +

Dear user,

+

+ <%= @text1 %> +

+

+ <%= @text2 %> +

+ \ No newline at end of file diff --git a/app/views/dmsf_upload/upload_files.html.erb b/app/views/dmsf_upload/upload_files.html.erb index 38a1532b..4a43f9b1 100644 --- a/app/views/dmsf_upload/upload_files.html.erb +++ b/app/views/dmsf_upload/upload_files.html.erb @@ -3,9 +3,13 @@
-<% path = @folder.nil? ? [] : @folder.dmsf_path %> -

- <%= render(:partial => '/dmsf/path', :locals => {:path => path}) %> +

+ <% path = @folder ? @folder.dmsf_path : [] %> + <%= link_to l(:link_documents), {:controller => 'dmsf', :action => 'show', :id=> @project } %> + <% path.each do |path_element| %> + / + <%= link_to h(path_element.title), {:controller => 'dmsf', :action => 'show', :id=> @project, :folder_id => path_element} %> + <% end %>

diff --git a/app/views/hooks/redmine_dmsf/_view_projects_form.html.erb b/app/views/hooks/redmine_dmsf/_view_projects_form.html.erb index 0838399e..42fea1ef 100644 --- a/app/views/hooks/redmine_dmsf/_view_projects_form.html.erb +++ b/app/views/hooks/redmine_dmsf/_view_projects_form.html.erb @@ -1,4 +1,4 @@ -<% if @project.new_record? && !@source_project.nil? %> +<% if @project.new_record? && @source_project %>

diff --git a/config/locales/cs.yml b/config/locales/cs.yml index 59b804b9..54465479 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -3,8 +3,7 @@ cs: dmsf: DMSF label_dmsf_file_plural: Dmsf soubory warning_no_entries_selected: Není nic vybráno - error_email_to_must_be_entered: Musí být zadán adresát - notice_email_sent: Email byl odeslán + error_email_to_must_be_entered: Musí být zadán adresát warning_file_already_locked: Soubor už je zamčen notice_file_locked: Soubor byl zamčen warning_file_not_locked: Soubor není zamčen diff --git a/config/locales/de.yml b/config/locales/de.yml index 4b1634b6..b34b979d 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -3,8 +3,7 @@ de: dmsf: DMS label_dmsf_file_plural: DMS warning_no_entries_selected: Keine Einträge ausgewählt - error_email_to_must_be_entered: Es muss ein Email-Empfänger angegeben werden. - notice_email_sent: Email gesendet + error_email_to_must_be_entered: Es muss ein Email-Empfänger angegeben werden. warning_file_already_locked: Datei schon gesperrt notice_file_locked: Datei gesperrt warning_file_not_locked: Datei nicht gesperrt diff --git a/config/locales/en.yml b/config/locales/en.yml index 692733f2..4f38d307 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -3,8 +3,7 @@ en: dmsf: DMSF label_dmsf_file_plural: Dmsf files warning_no_entries_selected: No entries selected - error_email_to_must_be_entered: Email To must be entered - notice_email_sent: Email sent + error_email_to_must_be_entered: Email To must be entered warning_file_already_locked: File already locked notice_file_locked: File locked warning_file_not_locked: File not locked diff --git a/config/locales/es.yml b/config/locales/es.yml index fef545c9..d5c5e7c2 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -3,8 +3,7 @@ es: dmsf: DMSF label_dmsf_file_plural: DMSF Archivos warning_no_entries_selected: No ha seleccionado ningún ítem - error_email_to_must_be_entered: Ingrese un email - notice_email_sent: Email sent + error_email_to_must_be_entered: Ingrese un email warning_file_already_locked: El archivo ya está bloqueado notice_file_locked: Archivo bloqueado warning_file_not_locked: Archivo no bloqueado diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 16f0f84f..7de2f395 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -3,8 +3,7 @@ fr: dmsf: DMSF label_dmsf_file_plural: Fichiers DMSF warning_no_entries_selected: Aucun fichier sélectionné - error_email_to_must_be_entered: La saisie d'une adresse mail est obligatoire - notice_email_sent: Mail envoyé + error_email_to_must_be_entered: La saisie d'une adresse mail est obligatoire warning_file_already_locked: Fichier déjà verrouillé notice_file_locked: Fichier verrouillé warning_file_not_locked: Fichier déverrouillé diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 64447a7c..3c8101ea 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -3,8 +3,7 @@ ja: dmsf: DMSF label_dmsf_file_plural: Dmsf ファイル warning_no_entries_selected: エントリーが選ばれていません - error_email_to_must_be_entered: 電子メールの To 先は省略できません - notice_email_sent: 電子メールを送信しました + error_email_to_must_be_entered: 電子メールの To 先は省略できません warning_file_already_locked: ファイルは既にロックされています notice_file_locked: ファイルをロックしました warning_file_not_locked: ファイルはロックされていません diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 9c4ccc24..4f4d999e 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -3,8 +3,7 @@ ru: dmsf: DMSF label_dmsf_file_plural: Файлы DMSF warning_no_entries_selected: Файлы не выбраны - error_email_to_must_be_entered: Нужно указать, на какую почту отправить письмо - notice_email_sent: Письмо отправлено + error_email_to_must_be_entered: Нужно указать, на какую почту отправить письмо warning_file_already_locked: Файл уже заблокирован notice_file_locked: Файл заблокирован warning_file_not_locked: Файл не заблокирован diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 0034d3c0..e5b45007 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -3,8 +3,7 @@ zh: dmsf: 文档管家 label_dmsf_file_plural: Dmsf files warning_no_entries_selected: 未选择任何条目 - error_email_to_must_be_entered: 请输入电子邮件 - notice_email_sent: 邮件已发送 + error_email_to_must_be_entered: 请输入电子邮件 warning_file_already_locked: 文件已经锁定 notice_file_locked: 文件锁定 warning_file_not_locked: 文件未锁定 diff --git a/db/migrate/20130819013955_update_projects.rb b/db/migrate/20130819013955_update_projects.rb new file mode 100644 index 00000000..c41f2e2d --- /dev/null +++ b/db/migrate/20130819013955_update_projects.rb @@ -0,0 +1,28 @@ +# Redmine plugin for Document Management System "Features" +# +# Copyright (C) 2013 Karel Picman +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +class UpdateProjects < ActiveRecord::Migration + def self.up + # DMSF - project's root folder notification + add_column :projects, :dmsf_notification, :boolean + end + + def self.down + remove_column :porojects, :dmsf_notification + end +end \ No newline at end of file