diff --git a/app/controllers/dmsf_controller.rb b/app/controllers/dmsf_controller.rb
index def3b251..63121919 100644
--- a/app/controllers/dmsf_controller.rb
+++ b/app/controllers/dmsf_controller.rb
@@ -83,7 +83,7 @@ class DmsfController < ApplicationController
end
@file_links = []
DmsfLink.where(:project_id => @project.id, :target_type => DmsfFile.model_name).visible.each do |l|
- r = l.target_file.last_revision
+ r = l.target_file.last_revision if l.target_file
if r
r.custom_field_values.each do |v|
if v.custom_field_id == params[:custom_field_id].to_i
@@ -97,7 +97,7 @@ class DmsfController < ApplicationController
end
@url_links = []
DmsfLink.where(:project_id => @project.id, :target_type => 'DmsfUrl').visible.each do |l|
- r = l.target_file.last_revision
+ r = l.target_file.last_revision if l.target_file
if r
r.custom_field_values.each do |v|
if v.custom_field_id == params[:custom_field_id].to_i
diff --git a/app/controllers/dmsf_files_controller.rb b/app/controllers/dmsf_files_controller.rb
index ede478ee..10e85842 100644
--- a/app/controllers/dmsf_files_controller.rb
+++ b/app/controllers/dmsf_files_controller.rb
@@ -101,9 +101,9 @@ class DmsfFilesController < ApplicationController
flash[:error] = l(:error_file_is_locked)
else
if (Rails::VERSION::MAJOR > 3)
- aparams = frev_params
+ aparams = frev_params[:dmsf_file_revision]
else
- aparams = params
+ aparams = params[:dmsf_file_revision]
end
revision = DmsfFileRevision.new(aparams)
diff --git a/app/models/dmsf_folder.rb b/app/models/dmsf_folder.rb
index a8f6bcc1..8669c53f 100644
--- a/app/models/dmsf_folder.rb
+++ b/app/models/dmsf_folder.rb
@@ -27,7 +27,7 @@ class DmsfFolder < ActiveRecord::Base
cattr_reader :invalid_characters
@@invalid_characters = /\A[^\/\\\?":<>]*\z/
- attr_accessible :title, :description, :dmsf_folder_id
+ attr_accessible :title, :description, :dmsf_folder_id, :project
belongs_to :project
belongs_to :folder, :class_name => 'DmsfFolder', :foreign_key => 'dmsf_folder_id'
diff --git a/app/views/dmsf_mailer/files_deleted.html.erb b/app/views/dmsf_mailer/files_deleted.html.erb
index dc6734ab..6000d864 100644
--- a/app/views/dmsf_mailer/files_deleted.html.erb
+++ b/app/views/dmsf_mailer/files_deleted.html.erb
@@ -1,8 +1,8 @@
<%# Redmine plugin for Document Management System "Features"
#
-# Copyright (C) 2011 Vít Jonáš
-# Copyright (C) 2012 Daniel Munn
-# Copyright (C) 2014 Karel Pičman
+# Copyright (C) 2011 Vít Jonáš
+# Copyright (C) 2012 Daniel Munn
+# Copyright (C) 2011-15 Karel Pičman
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -18,8 +18,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.%>
-<%= link_to User.current, user_path(User.current, :only_path => false) %> <%= l(:text_email_doc_deleted) %>
-<%= link_to @project, project_path(@project, :only_path => false) %> <%= l(:text_email_doc_follows) %>
+<%= link_to User.current, user_url(User.current) %> <%= l(:text_email_doc_deleted) %>
+<%= link_to @project, project_url(@project) %> <%= l(:text_email_doc_follows) %>
<% @files.each do |file| %>
<%= h(file.dmsf_path_str) %> (<%= file.name %>)
@@ -27,4 +27,4 @@
, <%= number_to_human_size(file.last_revision.size) %>, <%= l(:label_version) %> <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %>
<% end %>
-<% end %>
+<% end %>
\ No newline at end of file
diff --git a/app/views/dmsf_mailer/files_deleted.text.erb b/app/views/dmsf_mailer/files_deleted.text.erb
index ae78d992..a6cd02a0 100644
--- a/app/views/dmsf_mailer/files_deleted.text.erb
+++ b/app/views/dmsf_mailer/files_deleted.text.erb
@@ -1,8 +1,8 @@
<%# Redmine plugin for Document Management System "Features"
#
-# Copyright (C) 2011 Vít Jonáš
-# Copyright (C) 2012 Daniel Munn
-# Copyright (C) 2014 Karel Pičman
+# Copyright (C) 2011 Vít Jonáš
+# Copyright (C) 2012 Daniel Munn
+# Copyright (C) 2011-15 Karel Pičman
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
diff --git a/app/views/dmsf_mailer/files_updated.html.erb b/app/views/dmsf_mailer/files_updated.html.erb
index 8de4d931..d3e2a999 100644
--- a/app/views/dmsf_mailer/files_updated.html.erb
+++ b/app/views/dmsf_mailer/files_updated.html.erb
@@ -1,8 +1,8 @@
<%# Redmine plugin for Document Management System "Features"
#
-# Copyright (C) 2011 Vít Jonáš
-# Copyright (C) 2012 Daniel Munn
-# Copyright (C) 2014 Karel Pičman
+# Copyright (C) 2011 Vít Jonáš
+# Copyright (C) 2012 Daniel Munn
+# Copyright (C) 2011-15 Karel Pičman
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -18,21 +18,20 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.%>
-<%= link_to User.current, user_path(User.current, :only_path => false) %> <%= l(:text_email_doc_updated) %>
-<%= link_to @project, project_path(@project, :only_path => false) %> <%= l(:text_email_doc_follows) %>
+<%= link_to User.current, user_url(User.current) %> <%= l(:text_email_doc_updated) %>
+<%= link_to @project, project_url(@project) %> <%= l(:text_email_doc_follows) %>
<% @files.each do |file| %>
<%= link_to(h(file.dmsf_path_str),
- dmsf_file_path(file, :download => '', :only_path => false)) %>
+ dmsf_file_url(file, :download => '')) %>
(<%= file.name %>),
<%= number_to_human_size(file.last_revision.size) %>,
<%= l(:label_version) %> <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %>,
<%= "#{file.last_revision.workflow_str(true)}," if file.last_revision.workflow_str(true) != l(:title_none) %>
<%= link_to(l(:link_details, :title => h(file.title)),
- dmsf_file_path(file, :only_path => false)) %>
+ dmsf_file_url(file)) %>
<% if file.last_revision.comment.present? %>
<%= h(file.last_revision.comment) %>
<% end %>
-<% end %>
-
\ No newline at end of file
+<% end %>
\ No newline at end of file
diff --git a/app/views/dmsf_mailer/files_updated.text.erb b/app/views/dmsf_mailer/files_updated.text.erb
index 147a1922..899d3b71 100644
--- a/app/views/dmsf_mailer/files_updated.text.erb
+++ b/app/views/dmsf_mailer/files_updated.text.erb
@@ -1,8 +1,8 @@
<%# Redmine plugin for Document Management System "Features"
#
-# Copyright (C) 2011 Vít Jonáš
-# Copyright (C) 2012 Daniel Munn
-# Copyright (C) 2014 Karel Pičman
+# Copyright (C) 2011 Vít Jonáš
+# Copyright (C) 2012 Daniel Munn
+# Copyright (C) 2011-15 Karel Pičman
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -25,7 +25,7 @@
<%= number_to_human_size(file.last_revision.size) %>,
<%= l(:label_version) %> <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %>,
<%= "#{file.last_revision.workflow_str(true)}," if file.last_revision.workflow_str(true) != l(:title_none) %>
- <%= dmsf_file_path(file, :only_path => false) %>
+ <%= dmsf_file_url(file) %>
<% if file.last_revision.comment.present? %>
<%= l(:label_comment) %> <%= h(file.last_revision.comment) %>
<% end %>
diff --git a/app/views/dmsf_mailer/send_documents.html.erb b/app/views/dmsf_mailer/send_documents.html.erb
index 6e0248d2..ef98e05a 100644
--- a/app/views/dmsf_mailer/send_documents.html.erb
+++ b/app/views/dmsf_mailer/send_documents.html.erb
@@ -2,7 +2,7 @@
#
# Copyright (C) 2011 Vít Jonáš
# Copyright (C) 2012 Daniel Munn
-# Copyright (C) 2011-14 Karel Pičman
+# Copyright (C) 2011-15 Karel Pičman
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -32,8 +32,8 @@
<%= link_to(h(dir.dmsf_path_str), dmsf_folder_path(:id => dir.project_id, :folder_id => dir.id, :only_path => false)) %>
<% dir.files.each do |file| %>
- <%= link_to(h(file.title), dmsf_file_path(file, :only_path => false)) %>
- (<%= link_to(h(file.name), dmsf_file_path(file, :download => '', :only_path => false)) %>)
+ <%= link_to(h(file.title), dmsf_file_url(file)) %>
+ (<%= link_to(h(file.name), dmsf_file_url(file, :download => '')) %>)
<% end %>
<% end %>
@@ -46,8 +46,8 @@
<% JSON.parse(@files).each do |id| %>
<% file = DmsfFile.find_by_id id %>
<% if file %>
- <%= link_to(h(file.title), dmsf_file_path(file, :only_path => false)) %>
- (<%= link_to(h(file.name), dmsf_file_path(file, :download => '', :only_path => false)) %>)
+ <%= link_to(h(file.title), dmsf_file_url(file)) %>
+ (<%= link_to(h(file.name), dmsf_file_url(file, :download => '')) %>)
<% end %>
<% end %>
diff --git a/app/views/dmsf_mailer/send_documents.text.erb b/app/views/dmsf_mailer/send_documents.text.erb
index 10abf892..62f4baec 100644
--- a/app/views/dmsf_mailer/send_documents.text.erb
+++ b/app/views/dmsf_mailer/send_documents.text.erb
@@ -2,7 +2,7 @@
#
# Copyright (C) 2011 Vít Jonáš
# Copyright (C) 2012 Daniel Munn
-# Copyright (C) 2011-14 Karel Pičman
+# Copyright (C) 2011-15 Karel Pičman
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -30,7 +30,7 @@
<% if dir %>
<%= dir.dmsf_path_str %>
<% dir.files.each do |file| %>
- <%= dmsf_file_path(file, :download => '', :only_path => false) %>
+ <%= dmsf_file_url(file, :download => '') %>
<% end %>
<% end %>
<% end %>
@@ -41,7 +41,7 @@
<% JSON.parse(@files).each do |id| %>
<% file = DmsfFile.find_by_id id %>
<% if file %>
- <%= dmsf_file_path(file, :download => '', :only_path => false) %>
+ <%= dmsf_file_url(file, :download => '') %>
<% end %>
<% end %>
<% end %>
diff --git a/app/views/dmsf_mailer/workflow_notification.html.erb b/app/views/dmsf_mailer/workflow_notification.html.erb
index 6a6d43f6..911c9ee1 100644
--- a/app/views/dmsf_mailer/workflow_notification.html.erb
+++ b/app/views/dmsf_mailer/workflow_notification.html.erb
@@ -1,6 +1,6 @@
<%# Redmine plugin for Document Management System "Features"
#
-# Copyright (C) 2013 Karel Pičman
+# Copyright (C) 2011-15 Karel Pičman
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -24,10 +24,9 @@
<%= @text2 %>
<% unless @revision.file.folder %>
<%= link_to l(:link_documents),
- dmsf_folder_path(:id => @revision.file.project, :only_path => false) %>
+ dmsf_folder_url(:id => @revision.file.project) %>
<% else %>
<%= link_to @revision.file.folder.title,
- dmsf_folder_path(:id => @revision.file.project, :folder_id => @revision.file.folder, :only_path => false) %>
+ dmsf_folder_url(:id => @revision.file.project, :folder_id => @revision.file.folder) %>
<% end %>.
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/views/dmsf_mailer/workflow_notification.text.erb b/app/views/dmsf_mailer/workflow_notification.text.erb
index 038de02a..f2e104bd 100644
--- a/app/views/dmsf_mailer/workflow_notification.text.erb
+++ b/app/views/dmsf_mailer/workflow_notification.text.erb
@@ -1,6 +1,6 @@
<%# Redmine plugin for Document Management System "Features"
#
-# Copyright (C) 2013 Karel Pičman
+# Copyright (C) 2011-15 Karel Pičman
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -19,7 +19,7 @@
<%= @user.name %>,
<%= @text1 %>
<% unless @revision.file.folder %>
- <%= @text2 %> <%= dmsf_folder_path(:id => @revision.file.project, :only_path => false) %>.
+ <%= @text2 %> <%= dmsf_folder_url(:id => @revision.file.project) %>.
<% else %>
- <%= @text2 %> <%= dmsf_folder_path(:id => @revision.file.project, :folder_id => @revision.file.folder, :only_path => false) %>.
-<% end %>
+ <%= @text2 %> <%= dmsf_folder_url(:id => @revision.file.project, :folder_id => @revision.file.folder) %>.
+<% end %>
\ No newline at end of file