From 73a9b718a3635e312d0f17e266c07443a53158a9 Mon Sep 17 00:00:00 2001 From: "vit.jonas@gmail.com" Date: Fri, 7 Oct 2011 08:38:58 +0000 Subject: [PATCH] * fixed Issue 153: Losing revision history across a move git-svn-id: http://redmine-dmsf.googlecode.com/svn/trunk/redmine_dmsf@249 5e329b0b-a2ee-ea63-e329-299493fc886d --- app/controllers/dmsf_files_copy_controller.rb | 11 ++++++++++- app/views/dmsf_files_copy/new.html.erb | 11 ++++++++++- config/locales/cs.yml | 1 + config/locales/de.yml | 1 + config/locales/en-GB.yml | 1 + config/locales/en-IS.yml | 1 + config/locales/en.yml | 1 + config/locales/es.yml | 1 + config/locales/fr.yml | 1 + config/locales/ja.yml | 3 +++ config/locales/ru.yml | 3 +++ config/locales/zh.yml | 1 + init.rb | 2 +- 13 files changed, 35 insertions(+), 3 deletions(-) diff --git a/app/controllers/dmsf_files_copy_controller.rb b/app/controllers/dmsf_files_copy_controller.rb index ab947f25..a164a684 100644 --- a/app/controllers/dmsf_files_copy_controller.rb +++ b/app/controllers/dmsf_files_copy_controller.rb @@ -98,6 +98,11 @@ class DmsfFilesCopyController < ApplicationController flash[:notice] = l(:notice_file_copied) log_activity(file, "was copied (is copy)") + begin + DmsfMailer.deliver_files_updated(User.current, [file]) + rescue ActionView::MissingTemplate => e + Rails.logger.error "Could not send email notifications: " + e + end redirect_to :controller => "dmsf_files", :action => "show", :id => file end @@ -138,9 +143,13 @@ class DmsfFilesCopyController < ApplicationController flash[:notice] = l(:notice_file_moved) log_activity(@file, "was moved (is copy)") + begin + DmsfMailer.deliver_files_updated(User.current, [@file]) + rescue ActionView::MissingTemplate => e + Rails.logger.error "Could not send email notifications: " + e + end # TODO: implement proper mail notification - #DmsfMailer.deliver_files_deleted(User.current, [@file]) redirect_to :controller => "dmsf_files", :action => "show", :id => @file end diff --git a/app/views/dmsf_files_copy/new.html.erb b/app/views/dmsf_files_copy/new.html.erb index cbd5079b..7e82ad93 100644 --- a/app/views/dmsf_files_copy/new.html.erb +++ b/app/views/dmsf_files_copy/new.html.erb @@ -33,10 +33,19 @@ <%= submit_tag(l(:button_copy)) %> - <%= submit_tag(l(:button_move), :name => 'move') if User.current.allowed_to?(:file_manipulation, @project) %> + <% if User.current.allowed_to?(:file_manipulation, @project) %> + + <% end %> <% end %> <% end %> + + <% content_for :header_tags do %> <%= stylesheet_link_tag "dmsf", :plugin => "redmine_dmsf" %> <%= robot_exclusion_tag %> diff --git a/config/locales/cs.yml b/config/locales/cs.yml index c1952204..fb38a7d7 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -174,4 +174,5 @@ cs: :label_target_folder: "Cílový adresář" :title_copy_or_move: "Kopírovat/Přesunout" :label_dmsf_folder_plural: "Dmsf složky" + :comment_moved_from: "Přesunuto z %{source}" \ No newline at end of file diff --git a/config/locales/de.yml b/config/locales/de.yml index 402d6118..9267a464 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -175,4 +175,5 @@ de: :label_target_folder: "Target folder" :title_copy_or_move: "Copy/Move" :label_dmsf_folder_plural: "Dmsf folders" + :comment_moved_from: "Moved from %{source}" \ No newline at end of file diff --git a/config/locales/en-GB.yml b/config/locales/en-GB.yml index 8bd3679f..dabc6ad6 100644 --- a/config/locales/en-GB.yml +++ b/config/locales/en-GB.yml @@ -170,4 +170,5 @@ en-GB: :label_target_folder: "Target folder" :title_copy_or_move: "Copy/Move" :label_dmsf_folder_plural: "Dmsf folders" + :comment_moved_from: "Moved from %{source}" \ No newline at end of file diff --git a/config/locales/en-IS.yml b/config/locales/en-IS.yml index 8bd3679f..dabc6ad6 100644 --- a/config/locales/en-IS.yml +++ b/config/locales/en-IS.yml @@ -170,4 +170,5 @@ en-GB: :label_target_folder: "Target folder" :title_copy_or_move: "Copy/Move" :label_dmsf_folder_plural: "Dmsf folders" + :comment_moved_from: "Moved from %{source}" \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index 8a1be070..240e9921 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -175,4 +175,5 @@ en: :title_copy_or_move: "Copy/Move" :label_dmsf_folder_plural: "Dmsf folders" + :comment_moved_from: "Moved from %{source}" \ No newline at end of file diff --git a/config/locales/es.yml b/config/locales/es.yml index 6f839d63..854a43fd 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -172,4 +172,5 @@ es: :label_target_folder: "Target folder" :title_copy_or_move: "Copy/Move" :label_dmsf_folder_plural: "Dmsf folders" + :comment_moved_from: "Moved from %{source}" \ No newline at end of file diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 5a72c8dd..7980e33f 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -170,4 +170,5 @@ fr: :label_target_folder: "Target folder" :title_copy_or_move: "Copy/Move" :label_dmsf_folder_plural: "Dmsf folders" + :comment_moved_from: "Moved from %{source}" \ No newline at end of file diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 335e2cab..e86faeea 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -174,3 +174,6 @@ ja: :title_copy_or_move: "コピー/移動" :label_dmsf_folder_plural: "Dmsf フォルダ" +#Not translated + :comment_moved_from: "Moved from %{source}" + \ No newline at end of file diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 960d50b0..1571032a 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -174,4 +174,7 @@ ru: :label_target_folder: "Каталог назначения" :title_copy_or_move: "Скопировать/Переместить" :label_dmsf_folder_plural: "Каталоги документооборота" + +#Not translated + :comment_moved_from: "Moved from %{source}" \ No newline at end of file diff --git a/config/locales/zh.yml b/config/locales/zh.yml index a3770662..4437eef6 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -177,4 +177,5 @@ zh: :label_target_folder: "Target folder" :title_copy_or_move: "Copy/Move" :label_dmsf_folder_plural: "Dmsf folders" + :comment_moved_from: "Moved from %{source}" \ No newline at end of file diff --git a/init.rb b/init.rb index a6bc155a..48cc0fa5 100644 --- a/init.rb +++ b/init.rb @@ -55,7 +55,7 @@ Redmine::Plugin.register :redmine_dmsf do permission :view_dmsf_folders, {:dmsf => [:show]} permission :user_preferences, {:dmsf_state => [:user_pref_save]} permission :view_dmsf_files, {:dmsf => [:entries_operation, :entries_email], - :dmsf_files => [:show], :dmsf_files_copy => [:new, :create]} + :dmsf_files => [:show], :dmsf_files_copy => [:new, :create, :move]} permission :folder_manipulation, {:dmsf => [:new, :create, :delete, :edit, :save, :edit_root, :save_root]} permission :file_manipulation, {:dmsf_files => [:create_revision, :delete, :lock, :unlock], :dmsf_upload => [:upload_files, :upload_file, :commit_files]}