diff --git a/app/views/dmsf/show.html.erb b/app/views/dmsf/show.html.erb index e59b50c4..cb423fd8 100644 --- a/app/views/dmsf/show.html.erb +++ b/app/views/dmsf/show.html.erb @@ -43,7 +43,7 @@ <%= render "custom_fields", :object => @folder %> -<%= form_tag({:action => :entries_operation, :id => @project, :folder_id => @folder}, :method => :post, +<%= form_tag({:action => :entries_operation, :id => @project, :folder_id => @folder}, :method => :post, :class => "dmfs_entries", :id => "entries_form") do %> <%= hidden_field_tag("action") %>
|
<%= format_time(file.last_revision.updated_at) %>
<% if file.locked_for_user? %>
- <%= link_to(image_tag("locked.png", :plugin => :redmine_dmsf),
+ <%= link_to(image_tag("locked.png", :plugin => :redmine_dmsf),
{:controller => "users", :action => "show", :id => file.lock.reverse[0].user },
:title => l(:title_locked_by_user, :user => file.lock.reverse[0].user.to_s)) %>
<% elsif file.locked? %>
@@ -194,7 +194,7 @@
<% end %>
- <%= link_to(image_tag("filedetails.png", :plugin => :redmine_dmsf, :class =>"detail_icon"),
+ <%= link_to(image_tag("filedetails.png", :plugin => :redmine_dmsf, :class =>"detail_icon"),
{:controller => "dmsf_files", :action => :show, :id => file },
:title => l(:link_details, :title =>h(file.last_revision.title))) %>
@@ -212,7 +212,7 @@
<%= link_to_function(image_tag("lock.png", :plugin => :redmine_dmsf),
"manipulation_link('#{url_for(:controller => "dmsf_files", :action => 'lock', :id => file)}')",
:title => l(:title_lock_file)) %>
- <% end %>
+ <% end %>
<% end %>
<% if User.current.allowed_to?(:file_manipulation, @project) && !file.locked_for_user? %>
@@ -240,7 +240,7 @@
jQuery("#entries_form").submit();
}
})
-
+
jQuery("#check_all_entries").click(function(event) {
var $this = jQuery(this);
if($this.prop("checked")) {
@@ -248,7 +248,7 @@
} else {
jQuery("input[type=checkbox]", jQuery("#browser > tbody")).prop("checked", false);
}
- })
+ })
<%
@@ -261,7 +261,7 @@ sUrl = "jquery.dataTables/#{I18n.locale.to_s.downcase}.json" if I18n.locale && !
<%= stylesheet_link_tag "plupload/jquery.ui.plupload.css", :plugin => "redmine_dmsf" %>
<%= stylesheet_link_tag "jquery.dataTables/jquery-ui.dataTables.css", :plugin => "redmine_dmsf" %>
<%= stylesheet_link_tag "dmsf", :plugin => "redmine_dmsf" %>
-
+
<%= javascript_include_tag "jquery-1.6.1.min.js", :plugin => "redmine_dmsf" %>
<%= javascript_include_tag "jquery-ui-1.8.13.min.js", :plugin => "redmine_dmsf" %>
<%= javascript_include_tag "jquery.dataTables/jquery.dataTables.min.js", :plugin => "redmine_dmsf" %>
@@ -289,7 +289,7 @@ sUrl = "jquery.dataTables/#{I18n.locale.to_s.downcase}.json" if I18n.locale && !
return "<%= l(:label_number_of_folders)%>: <%= @subfolders.length %>, <%= l(:label_number_of_documents)%>: <%= @files.length %>";
}
});
-
+
jQuery("[data-downloadurl]").each(function() {
var url = this.getAttribute("data-downloadurl");
if (this.addEventListener) {
@@ -300,13 +300,17 @@ sUrl = "jquery.dataTables/#{I18n.locale.to_s.downcase}.json" if I18n.locale && !
},false);
}
});
+
+ jQuery("#entries_form").submit(function () {
+ jQuery(this).removeAttr('data-submitted');
+ });
});
-
+
function manipulation_link(action) {
jQuery("#entries_form").attr("action", action);
jQuery("#entries_form").submit();
};
-
+
function confirmation_link(action) {
if(!window.confirm("<%= l(:question_do_you_really_want_to_delete_this_entry) %>")) return;
jQuery("#entries_form").attr("action", action);
@@ -315,6 +319,6 @@ sUrl = "jquery.dataTables/#{I18n.locale.to_s.downcase}.json" if I18n.locale && !
<% end %>
-<%= render(:partial => "multi_upload") if (User.current.allowed_to?(:file_manipulation, @project) &&
+<%= render(:partial => "multi_upload") if (User.current.allowed_to?(:file_manipulation, @project) &&
( @folder.nil? || (!@folder.nil? &&!@folder.locked_for_user?) ) ) %>
diff --git a/app/views/dmsf_files_copy/new.html.erb b/app/views/dmsf_files_copy/new.html.erb index b37865bc..a51d6dc4 100644 --- a/app/views/dmsf_files_copy/new.html.erb +++ b/app/views/dmsf_files_copy/new.html.erb @@ -7,7 +7,7 @@ <%= render(:partial => "/dmsf/path", :locals => {:path => path}) %> / -<%= link_to(h(@file.title), {:controller => "dmsf_files", :action => "show", :id=> @file}) %> +<%= 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 %>@@ -17,21 +17,17 @@<%= select_tag("target_project_id", - project_tree_options_for_select(DmsfFile.allowed_target_projects_on_copy, :selected => @target_project), - :onchange => remote_function(:url => { :action => 'new' }, - :method => :get, - :update => 'content', - :with => "Form.serialize('copyForm')")) %> + project_tree_options_for_select(DmsfFile.allowed_target_projects_on_copy, :selected => @target_project)) %> <%= label_tag("target_folder_id", l(:label_target_folder) + ":") %> - <%= select_tag("target_folder_id", - options_for_select(DmsfFolder.directory_tree(@target_project), + <%= select_tag("target_folder_id", + options_for_select(DmsfFolder.directory_tree(@target_project), :selected => (@target_folder.id unless @target_folder.nil?))) %> <%= select_tag("target_project_id", - project_tree_options_for_select(DmsfFolder.allowed_target_projects_on_copy, :selected => @target_project), - :onchange => remote_function(:url => { :action => 'new' }, - :method => :get, - :update => 'content', - :with => "Form.serialize('copyForm')")) %> + project_tree_options_for_select(DmsfFolder.allowed_target_projects_on_copy, :selected => @target_project)) %> <%= label_tag("target_folder_id", l(:label_target_folder) + ":") %> - <%= select_tag("target_folder_id", - options_for_select(DmsfFolder.directory_tree(@target_project, @folder), + <%= select_tag("target_folder_id", + options_for_select(DmsfFolder.directory_tree(@target_project, @folder), :selected => (@target_folder.id unless @target_folder.nil?))) %> - + <%= submit_tag(l(:button_copy)) %> <% end %> <% end %> + + <% content_for :header_tags do %> <%= stylesheet_link_tag "dmsf", :plugin => "redmine_dmsf" %> <%= javascript_include_tag "jquery-1.6.1.min.js", :plugin => "redmine_dmsf" %> diff --git a/lib/dmsf_zip.rb b/lib/dmsf_zip.rb index d46cbcca..fee69e17 100644 --- a/lib/dmsf_zip.rb +++ b/lib/dmsf_zip.rb @@ -1,75 +1,76 @@ -# Redmine plugin for Document Management System "Features" -# -# Copyright (C) 2011 Vít Jonáš |