-#
-# 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.
-%>
-
-<% wf = DmsfWorkflow.find_by(id: file.last_revision.dmsf_workflow_id) if file.last_revision.dmsf_workflow_id %>
-
-| <%= check_box_tag('ids[]', "#{name}-#{id}", false, :id => "file_#{id}") %> |
-<% if DmsfFolder.is_column_on?('id') %>
- <%= link_to(file.id, dmsf_file_path(:id => file)) %> |
-<% end %>
-<% if DmsfFolder.is_column_on?('title') %>
-
- <% if @tree_view %>
-
- <% end %>
- <% file_view_url = url_for({:controller => :dmsf_files, :action => 'view', :id => file}) %>
- <%= link_to(h(title),
- file_view_url,
- :target => '_blank',
- :class => "icon icon-file #{DmsfHelper.filetype_css(file.name)}",
- :title => h(file.last_revision.try(:tooltip)),
- 'data-downloadurl' => "#{file.last_revision.detect_content_type}:#{h(file.name)}:#{file_view_url}") %>
- <%= h(link ? link.path : file.display_name) %>
- |
-<% end %>
-<% if DmsfFolder.is_column_on?('extension') %>
-
- <%= file.extension %>
- |
-<% end %>
-<% if DmsfFolder.is_column_on?('size') %>
- <%= number_to_human_size(file.last_revision.size) %> |
-<% end %>
-<% if DmsfFolder.is_column_on?('modified') %>
-
- <%= format_time(file.last_revision.updated_at) %>
- |
-<% end %>
-<% if DmsfFolder.is_column_on?('version') %>
- <%= file.last_revision.version %> |
-<% end %>
-<% if DmsfFolder.is_column_on?('workflow') %>
-
- <% if wf && @file_approval_allowed %>
- <%= link_to(
- file.last_revision.workflow_str(false),
- log_dmsf_workflow_path(
- :project_id => project.id,
- :id => wf.id,
- :dmsf_file_revision_id => file.last_revision.id),
- :title => file.last_revision.workflow_tooltip,
- :remote => true) %>
- <% else %>
- <%= file.last_revision.workflow_str(false) %>
- <% end %>
- |
-<% end %>
-<% if DmsfFolder.is_column_on?('author') %>
- <%= h(file.last_revision.user) %> |
-<% end %>
-<% DmsfFileRevisionCustomField.visible.order(:position).each do |c| %>
- <% if DmsfFolder.is_column_on?(c.name) %>
-
- <%= show_value file.custom_value(c) %>
- |
- <% end %>
-<% end %>
-<%= link_to_context_menu %> |
-<%= position %> |
-<%= file.last_revision.size %> |
-<%= file.last_revision.updated_at.to_i %> |
-<%= file.last_revision.iversion %> |
-<%= clear_title(title) %> |
diff --git a/app/views/dmsf/_file_trash.html.erb b/app/views/dmsf/_file_trash.html.erb
deleted file mode 100644
index 355171b8..00000000
--- a/app/views/dmsf/_file_trash.html.erb
+++ /dev/null
@@ -1,71 +0,0 @@
-<%
-# encoding: utf-8
-#
-# Redmine plugin for Document Management System "Features"
-#
-# Copyright © 2011-20 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
-# 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.
-%>
-
-<%= check_box_tag('ids[]', "#{name}-#{id}", false, :id => "file_#{id}") %> |
-<% if DmsfFolder.is_column_on?('id') %>
- <%= file.id %> |
-<% end %>
-<% if DmsfFolder.is_column_on?('title') %>
-
- <%= content_tag(:span, h(title),
- :title => h(file.last_revision.try(:tooltip)),
- :class => "icon icon-file #{DmsfHelper.filetype_css(file.name)}") %>
- <%= h(link ? link.path : file.display_name) %>
- |
-<% end %>
-<% if DmsfFolder.is_column_on?('extension') %>
-
- <%= $1 if file.last_revision.disk_filename =~ /\.(.+)$/ %>
- |
-<% end %>
-<% if DmsfFolder.is_column_on?('size') %>
- <%= number_to_human_size(file.last_revision.size) %> |
-<% end %>
-<% if DmsfFolder.is_column_on?('modified') %>
-
- <%= format_time(file.last_revision.updated_at) %>
- |
-<% end %>
-<% if DmsfFolder.is_column_on?('version') %>
- <%= file.last_revision.version %> |
-<% end %>
-<% if DmsfFolder.is_column_on?('workflow') %>
-
- <%= file.last_revision.workflow_str(false) %>
- |
-<% end %>
-<% if DmsfFolder.is_column_on?('author') %>
- <%= h(file.last_revision.user) %> |
-<% end %>
-<% DmsfFileRevisionCustomField.visible.order(:position).each do |c| %>
- <% if DmsfFolder.is_column_on?(c.name) %>
-
- <%= show_value file.custom_value(c) %>
- |
- <% end %>
-<% end %>
-<%= link_to_context_menu %> |
-1 |
-<%= file.last_revision.size %> |
-<%= file.last_revision.updated_at.to_i %> |
-<%= file.last_revision.iversion %> |
-<%= clear_title(title) %> |
diff --git a/app/views/dmsf/_list_view.erb b/app/views/dmsf/_list_view.erb
deleted file mode 100644
index b31b41be..00000000
--- a/app/views/dmsf/_list_view.erb
+++ /dev/null
@@ -1,149 +0,0 @@
-<%
-# encoding: utf-8
-#
-# Redmine plugin for Document Management System "Features"
-#
-# Copyright © 2011-20 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
-# 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.
-%>
-
-
-
-
- |
- <% unless @system_folder %>
- <%= check_box_tag 'check_all', '', false, :class => 'toggle-selection',
- :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}" %>
- <% end %>
- |
- <% if DmsfFolder.is_column_on?('id') %>
- # |
- <% end %>
- <% if DmsfFolder.is_column_on?('title') %>
- <%= l(:link_title) %> |
- <% end %>
- <% if DmsfFolder.is_column_on?('extension') %>
- <%= l(:link_extension) %> |
- <% end %>
- <% if DmsfFolder.is_column_on?('size') %>
- <%= l(:link_size) %> |
- <% end %>
- <% if DmsfFolder.is_column_on?('modified') %>
- <%= l(:link_modified) %> |
- <% end %>
- <% if DmsfFolder.is_column_on?('version') %>
- <%= l(:link_ver) %> |
- <% end %>
- <% if DmsfFolder.is_column_on?('workflow') %>
- <%= l(:link_workflow) %> |
- <% end %>
- <% if DmsfFolder.is_column_on?('author') %>
- <%= l(:link_author) %> |
- <% end %>
- <% DmsfFileRevisionCustomField.visible.order(:position).each do |c| %>
- <% if DmsfFolder.is_column_on?(c.name) %>
- <%= h(c.name) %> |
- <% end %>
- <% end %>
- <%# controls %> |
- <%# position %> |
- <%# size calculated %> |
- <%# modified calculated %> |
- <%# version calculated %> |
- <%# clear title %> |
-
-
-
- <% classes = 'dir hascontextmenu' %>
- <% @subfolders.each do |subfolder| %>
-
- <%= render(:partial => 'dir',
- :locals => {
- :project => @project,
- :subfolder => subfolder,
- :link => nil,
- :id => subfolder.id,
- :name => 'folder',
- :title => subfolder.title,
- :position => 0 }) %>
-
- <% end %>
- <% classes = 'dmsf_gray hascontextmenu' %>
- <% @dir_links.each do |link| %>
- <% unless link.target_project %>
- <% Rails.logger.error "Error: dmsf_link id #{link.id} has no target!" %>
- <% next %>
- <% end %>
-
- <%= render(:partial => 'dir',
- :locals => {
- :project => link.target_project,
- :subfolder => link.target_folder,
- :link => link,
- :id => link.id,
- :name => 'folder-link',
- :title => link.name,
- :position => 0}) %>
-
- <% end %>
- <% classes = 'file hascontextmenu' %>
- <% @files.each do |file| %>
- <% unless file.last_revision %>
- <% Rails.logger.error "Error: dmsf_file id #{file.id} has no revision!" %>
- <% next %>
- <% end %>
-
- <%= render(:partial => 'file', :locals => {
- :project => @project,
- :file => file,
- :link => nil,
- :id => file.id,
- :name => 'file',
- :title => file.title,
- :position => 1 }) %>
-
- <% end %>
- <% classes = 'dmsf_gray hascontextmenu' %>
- <% @file_links.each do |link| %>
- <% unless link.target_file && link.target_file.last_revision %>
- <% Rails.logger.error "Error: dmsf_file id #{link.target_id} has no revision!" %>
- <% next %>
- <% end %>
-
- <%= render(:partial => 'file', :locals => {
- :project => link.target_project,
- :file => link.target_file,
- :link => link,
- :id => link.id,
- :name => 'file-link',
- :title => link.name,
- :position => 1}) %>
-
- <% end %>
- <% @url_links.each do |link| %>
-
- <%= render(:partial => 'url', :locals => {
- :project => link.target_project,
- :file => link.target_file,
- :link => link,
- :id => link.id,
- :name => 'url-link',
- :title => link.name,
- :position => 1}) %>
-
- <% end %>
-
-
diff --git a/app/views/dmsf/_tree_view.erb b/app/views/dmsf/_tree_view.erb
deleted file mode 100644
index f26b371e..00000000
--- a/app/views/dmsf/_tree_view.erb
+++ /dev/null
@@ -1,72 +0,0 @@
-<%
-# encoding: utf-8
-#
-# Redmine plugin for Document Management System "Features"
-#
-# Copyright © 2011-20 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
-# 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.
-%>
-
-
-
-
- |
- <% unless @system_folder %>
- <%= check_box_tag 'check_all', '', false, :class => 'toggle-selection',
- :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}" %>
- <% end %>
- |
- <% if DmsfFolder.is_column_on?('id') %>
- # |
- <% end %>
- <% if DmsfFolder.is_column_on?('title') %>
- <%= l(:link_title) %> |
- <% end %>
- <% if DmsfFolder.is_column_on?('extension') %>
- <%= l(:link_extension) %> |
- <% end %>
- <% if DmsfFolder.is_column_on?('size') %>
- <%= l(:link_size) %> |
- <% end %>
- <% if DmsfFolder.is_column_on?('modified') %>
- <%= l(:link_modified) %> |
- <% end %>
- <% if DmsfFolder.is_column_on?('version') %>
- <%= l(:link_ver) %> |
- <% end %>
- <% if DmsfFolder.is_column_on?('workflow') %>
- <%= l(:link_workflow) %> |
- <% end %>
- <% if DmsfFolder.is_column_on?('author') %>
- <%= l(:link_author) %> |
- <% end %>
- <% DmsfFileRevisionCustomField.visible.order(:position).each do |c| %>
- <% if DmsfFolder.is_column_on?(c.name) %>
- <%= c.name %> |
- <% end %>
- <% end %>
- <%# controls %> |
- <%# position %> |
- <%# size calculated %> |
- <%# modified calculated %> |
- <%# version calculated %> |
- <%# clear title %> |
-
-
-
- <%= render partial: 'dmsf/dmsf_rows' %>
-
-
diff --git a/app/views/dmsf/_url.html.erb b/app/views/dmsf/_url.html.erb
deleted file mode 100644
index 9f40e175..00000000
--- a/app/views/dmsf/_url.html.erb
+++ /dev/null
@@ -1,73 +0,0 @@
-<%
-# encoding: utf-8
-#
-# Redmine plugin for Document Management System "Features"
-#
-# Copyright © 2011-20 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
-# 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.
-%>
-
-<%= check_box_tag('ids[]', "#{name}-#{id}", false) %> |
-<% if DmsfFolder.is_column_on?('id') %>
- |
-<% end %>
-<% if DmsfFolder.is_column_on?('title') %>
-
- <% if @tree_view %>
- >
- <% end %>
- <%= link_to(h(title),
- link.external_url,
- :target => '_blank',
- :class => 'icon icon-link') %>
-
- <% if link.external_url && link.external_url.length > 50 %>
- <%= "#{link.external_url[0, 25]}...#{link.external_url[-25, 25]}" %>
- <% else %>
- <%= link.external_url %>
- <% end %>
-
- |
-<% end %>
-<% if DmsfFolder.is_column_on?('extension') %>
- |
-<% end %>
-<% if DmsfFolder.is_column_on?('size') %>
- |
-<% end %>
-<% if DmsfFolder.is_column_on?('modified') %>
- <%= format_time(link.updated_at) %> |
-<% end %>
-<% if DmsfFolder.is_column_on?('version') %>
- |
-<% end %>
-<% if DmsfFolder.is_column_on?('workflow') %>
- |
-<% end %>
-<% if DmsfFolder.is_column_on?('author') %>
- <%= h(link.user) %> |
-<% end %>
-<% DmsfFileRevisionCustomField.visible.order(:position).each do |c| %>
- <% if DmsfFolder.is_column_on?(c.name) %>
- |
- <% end %>
-<% end %>
-<%= link_to_context_menu %> |
-<%= position %> |
- |
-link.updated_at.to_i |
- |
-<%= clear_title(title) %> |
diff --git a/app/views/dmsf/_url_trash.html.erb b/app/views/dmsf/_url_trash.html.erb
deleted file mode 100644
index 94554a64..00000000
--- a/app/views/dmsf/_url_trash.html.erb
+++ /dev/null
@@ -1,70 +0,0 @@
-<%
-# encoding: utf-8
-#
-# Redmine plugin for Document Management System "Features"
-#
-# Copyright © 2011-20 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
-# 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.
-%>
-
-<%= check_box_tag('ids[]', "#{name}-#{id}", false) %> |
-<% if DmsfFolder.is_column_on?('id') %>
- |
-<% end %>
-<% if DmsfFolder.is_column_on?('title') %>
-
- <%= link_to(h(title),
- link.external_url,
- :target => '_blank',
- :class => 'icon icon-link') %>
-
- <% if link.external_url && link.external_url.length > 50 %>
- <%= "#{link.external_url[0, 25]}...#{link.external_url[-25, 25]}" %>
- <% else %>
- <%= link.external_url %>
- <% end %>
-
- |
-<% end %>
-<% if DmsfFolder.is_column_on?('extension') %>
- |
-<% end %>
-<% if DmsfFolder.is_column_on?('size') %>
- |
-<% end %>
-<% if DmsfFolder.is_column_on?('modified') %>
- <%= format_time(link.updated_at) %> |
-<% end %>
-<% if DmsfFolder.is_column_on?('version') %>
- |
-<% end %>
-<% if DmsfFolder.is_column_on?('workflow') %>
- |
-<% end %>
-<% if DmsfFolder.is_column_on?('author') %>
- <%= h(link.user) %> |
-<% end %>
-<% DmsfFileRevisionCustomField.visible.order(:position).each do |c| %>
- <% if DmsfFolder.is_column_on?(c.name) %>
- |
- <% end %>
-<% end %>
-<%= link_to_context_menu %> |
-1 |
- |
-<%= link.updated_at.to_i %> |
- |
-<%= clear_title(title) %> |
diff --git a/app/views/dmsf/dmsf_rows.js.erb b/app/views/dmsf/dmsf_rows.js.erb
deleted file mode 100644
index e047737f..00000000
--- a/app/views/dmsf/dmsf_rows.js.erb
+++ /dev/null
@@ -1,79 +0,0 @@
-// Store DMSF controls
-var dmsfButtons = $('#dmsf_buttons')[0].outerHTML;
-var browserInfo = $('#browser_info').text();
-var tag = $('#dmsf_tag');
-var dmsfTag;
-var browser = $("#browser");
-
-if((tag != null) && tag[0] != null) {
-
- dmsfTag = tag[0].outerHTML
-}
-
-// Destroy the original dataTable
-browser.dataTable().fnDestroy();
-
-// Add rows
-$('#<%= params[:row_id] %>').after('<%= escape_javascript(render(:partial => 'dmsf/dmsf_rows')) %>');
-hideOnLoad();
-$('#dmsf_uploader').hide();
-$('#dmsf_uploader_header').hide();
-$("#dmsf_ajax_loading").show();
-
-// Reinitialize the dataTable
-<% title = DmsfFolder.get_column_position('title') %>
-<% position = DmsfFolder.get_column_position('position') %>
-<% commands = DmsfFolder.get_column_position('commands') %>
-<% position = DmsfFolder.get_column_position('position') %>
-<% version = DmsfFolder.get_column_position('version') %>
-<% size_calculated = DmsfFolder.get_column_position('size_calculated') %>
-<% modified_calculated = DmsfFolder.get_column_position('modified_calculated') %>
-<% version_calculated = DmsfFolder.get_column_position('version_calculated') %>
-<% size = DmsfFolder.get_column_position('size') %>
-<% modified = DmsfFolder.get_column_position('modified') %>
-
-browser.dataTable({
- orderClasses: false,
- responsive: {
- details: false
- },
- language: {
- url: "<%= plugin_asset_path(:redmine_dmsf, 'javascripts', json_url) %>"
- },
- autoWidth: false,
- paginate: false,
- <% if title %>
- order: [[<%= title %>, "asc"]],
- <% end %>
- sortingFixed: [[ <%= position %>, "asc"]],
- columnDefs: [
- { searchable: false, targets: [0, <%= commands %>, <%= position %>, <%= size_calculated %>, <%= modified_calculated %>, <%= version_calculated %>] },
- { sortable: false, targets: [0, <%= commands %>] }
- <% if size %>
- ,{ iDataSort: <%= size_calculated %>, targets: [ <%= size %> ] }
- <% end %>
- <% if modified %>
- ,{ iDataSort: <%= modified_calculated %>, targets: [ <%= modified %> ] }
- <% end %>
- <% if version %>
- ,{ iDataSort: <%= version_calculated %>, targets: [ <%= version %> ] }
- <% end %>
- ],
- "fnInitComplete": function() {
- var wrapper = $("#browser_wrapper div.fg-toolbar")[0];
- $(dmsfButtons).prependTo(wrapper);
- if($(dmsfTag) != null) {
- $(dmsfTag).prependTo(wrapper);
- }
- $("#browser").show();
- $('#dmsf_uploader').show();
- $('#dmsf_uploader_header').show();
- $("#dmsf_ajax_loading").hide();
- },
- "fnInfoCallback": function( oSettings, iStart, iEnd, iMax, iTotal, sPre ) {
- return browserInfo;
- }
-});
-
-// Hot fix
-browser.attr('style', 'width: 100%');
diff --git a/app/views/dmsf/show.html.erb b/app/views/dmsf/show.html.erb
index 36c117b1..af630e81 100644
--- a/app/views/dmsf/show.html.erb
+++ b/app/views/dmsf/show.html.erb
@@ -24,10 +24,7 @@
<% html_title l(:dmsf) %>
- <%= link_to(l(:button_switch), switch_rlf_dmsf_path(id: @project, rlf: @rlf),
- title: l(:label_switch_rlf),
- class: 'icon icon-plugins') %>
- <% if @rlf && @file_manipulation_allowed && !@locked_for_user && !@system_folder %>
+ <% if @file_manipulation_allowed && !@locked_for_user && !@system_folder %>
<%= link_to l(:label_attachment_new), multi_dmsf_upload_path(id: @project, dmsf_folder_id: @folder),
class: 'icon icon-add' %>
<% end %>
@@ -94,156 +91,14 @@