<% # encoding: utf-8 # # Redmine plugin for Document Management System "Features" # # Copyright (C) 2011-18 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. %> <% html_title(l(:dmsf)) %>

<%= l(:link_trash_bin) %>

<%= textilizable(@folder ? @folder.description : @project.dmsf_description) %>
<%= error_messages_for('dmsf_workflow') %> <%= form_tag({:action => :entries_operation, :id => @project, :folder_id => @folder}, :method => :post, :class => 'dmsf_entries', :id => 'entries_form') do %> <%= hidden_field_tag('action') %>
<% if @file_manipulation_allowed && @folder_manipulation_allowed %> <%= submit_tag(l(:title_restore), :title => l(:title_restore_checked), :name => 'restore_entries') %> <% if @file_delete_allowed%> <%= submit_tag(l(:button_delete), :title => l(:title_delete_checked), :name => 'destroy_entries') %> <% end %> <% end %>
<% if DmsfFolder.is_column_on?('id') %> <% end %> <% if DmsfFolder.is_column_on?('title') %> <% end %> <% if DmsfFolder.is_column_on?('extension') %> <% end %> <% if DmsfFolder.is_column_on?('size') %> <% end %> <% if DmsfFolder.is_column_on?('modified') %> <% end %> <% if DmsfFolder.is_column_on?('version') %> <% end %> <% if DmsfFolder.is_column_on?('workflow') %> <% end %> <% if DmsfFolder.is_column_on?('author') %> <% end %> <% cfs = CustomField.where(:type => 'DmsfFileRevisionCustomField').order(:position) %> <% cfs.each do |c| %> <% if DmsfFolder.is_column_on?(c.name) %> <% end %> <% end %> <% @subfolders.each do |subfolder| %> <%= render(:partial => 'dir_trash', :locals => { :project => @project, :subfolder => subfolder, :link => nil, :id => subfolder.id, :name => 'subfolders[]', :title => subfolder.title }) %> <% end %> <% @dir_links.each do |link| %> <%= render(:partial => 'dir_trash', :locals => { :project => link.target_project, :subfolder => link.target_folder, :link => link, :id => link.id, :name => 'dir_links[]', :title => link.name }) %> <% end %> <% @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_trash', :locals => { :project => @project, :file => file, :link => nil, :id => file.id, :name => 'files[]', :title => file.title }) %> <% end %> <% @file_links.each do |link| %> <% unless link.target_file %> <% Rails.logger.error "Error: dmsf_link id #{link.id} has no target file!" %> <% next %> <% end %> <% unless link.target_file.last_revision %> <% Rails.logger.error "Error: dmsf_file id #{link.target_id} has no revision!" %> <% next %> <% end %> <%= render(:partial => 'file_trash', :locals => { :project => link.target_project, :file => link.target_file, :link => link, :id => link.id, :name => 'file_links[]', :title => link.name }) %> <% end %> <% @url_links.each do |link| %> <%= render(:partial => 'url_trash', :locals => { :project => link.target_project, :file => link.target_file, :link => link, :id => link.id, :name => 'url_links[]', :title => link.name }) %> <% end %>
#<%= l(:link_title) %><%= l(:link_extension) %><%= l(:link_size) %><%= l(:link_modified) %><%= l(:link_ver) %><%= l(:link_workflow) %><%= l(:link_author) %><%= h(c.name) %><%# controls %> <%# position %> <%# size %> <%# updated %> <%# version %>
<% end %> <%= late_javascript_tag do %> $('#entries_delete_button').click(function() { if(window.confirm("<%= l(:text_are_you_sure) %>")) { $('#entries_form').attr('action', "<%= delete_entries_path(:id => @project, :folder_id => @folder) %>"); $('#entries_form').submit(); } }); $('.list_cf').change(function() { $('#entries_form').attr('action', "<%= tag_changed_path(:id => @project, :folder_id => @folder) %>"); $('#entries_form').submit(); }); $('#check_all_entries').click(function() { $('input[type=checkbox]', $('#browser > tbody')).prop('checked', this.checked); }); <% end %> <% content_for :header_tags do %> <%= stylesheet_link_tag 'jquery.dataTables/jquery-ui.dataTables.css', :plugin => 'redmine_dmsf' %> <%= javascript_include_tag 'jquery.dataTables/jquery.dataTables.min.js', :plugin => 'redmine_dmsf' %> <% 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') %> <%= late_javascript_tag do %> EASY.schedule.main(function() { $('#browser').dataTable({ 'bJQueryUI': true, 'oLanguage': { 'sUrl': "<%= plugin_asset_path(:redmine_dmsf, 'javascripts', json_url) %>" }, 'bAutoWidth': false, 'bPaginate': false, <% if title %> 'aaSorting': [[<%= title %>, 'asc']], <% end %> 'aaSortingFixed': [[ <%= position %>, 'asc']], 'aoColumnDefs': [ { 'bSearchable': false, 'aTargets': [0, <%= commands %>, <%= position %>, <%= size_calculated %>, <%= modified_calculated %>, <%= version_calculated %>] }, { 'bSortable': false, 'aTargets': [0, <%= commands %>] } <% if size %> ,{ 'iDataSort': <%= size_calculated %>, 'aTargets': [ <%= size %> ] } <% end %> <% if modified %> ,{ 'iDataSort': <%= modified_calculated %>, 'aTargets': [ <%= modified %> ] } <% end %> <% if version %> ,{ 'iDataSort': <%= version_calculated %>, 'aTargets': [ <%= version %> ] } <% end %> ], 'fnInitComplete': function() { $('div.dmsf_controls').prependTo($('#browser_wrapper div.fg-toolbar')[0]); }, 'fnInfoCallback': function( oSettings, iStart, iEnd, iMax, iTotal, sPre ) { return "<%= l(:label_number_of_folders)%>: <%= @subfolders.count + @dir_links.count %>, <%= l(:label_number_of_documents)%>: <%= @files.count + @file_links.count + @url_links.count %>"; } }); $('#entries_form').submit(function () { $(this).removeAttr('data-submitted'); }); }); <% end %> <% end %>