From 7b7a84c93a4fe57fdd14ec4729240939714ca412 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Tue, 13 Dec 2016 19:44:28 +0000 Subject: [PATCH] Use multipart forms for objects that may have file custom fields (#6719). git-svn-id: http://svn.redmine.org/redmine/trunk@16068 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/documents/edit.html.erb | 2 +- app/views/enumerations/edit.html.erb | 2 +- app/views/enumerations/new.html.erb | 2 +- app/views/groups/_general.html.erb | 2 +- app/views/groups/new.html.erb | 2 +- app/views/my/account.html.erb | 2 +- app/views/projects/_edit.html.erb | 2 +- app/views/projects/new.html.erb | 2 +- app/views/timelog/edit.html.erb | 2 +- app/views/timelog/new.html.erb | 2 +- app/views/users/_general.html.erb | 2 +- app/views/users/new.html.erb | 2 +- app/views/versions/edit.html.erb | 2 +- app/views/versions/new.html.erb | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/views/documents/edit.html.erb b/app/views/documents/edit.html.erb index 15491168d..87e08e136 100644 --- a/app/views/documents/edit.html.erb +++ b/app/views/documents/edit.html.erb @@ -1,6 +1,6 @@

<%=l(:label_document)%>

-<%= labelled_form_for @document do |f| %> +<%= labelled_form_for @document, :html => {:multipart => true} do |f| %> <%= render :partial => 'form', :locals => {:f => f} %>

<%= submit_tag l(:button_save) %>

<% end %> diff --git a/app/views/enumerations/edit.html.erb b/app/views/enumerations/edit.html.erb index 59a7aa6ba..a7d03ced7 100644 --- a/app/views/enumerations/edit.html.erb +++ b/app/views/enumerations/edit.html.erb @@ -1,6 +1,6 @@ <%= title [l(@enumeration.option_name), enumerations_path], @enumeration.name %> -<%= labelled_form_for :enumeration, @enumeration, :url => enumeration_path(@enumeration), :html => {:method => :put} do |f| %> +<%= labelled_form_for :enumeration, @enumeration, :url => enumeration_path(@enumeration), :html => {:method => :put, :multipart => true} do |f| %> <%= render :partial => 'form', :locals => {:f => f} %> <%= submit_tag l(:button_save) %> <% end %> diff --git a/app/views/enumerations/new.html.erb b/app/views/enumerations/new.html.erb index 1714e8e89..dcd9a495c 100644 --- a/app/views/enumerations/new.html.erb +++ b/app/views/enumerations/new.html.erb @@ -1,6 +1,6 @@ <%= title [l(@enumeration.option_name), enumerations_path], l(:label_enumeration_new) %> -<%= labelled_form_for :enumeration, @enumeration, :url => enumerations_path do |f| %> +<%= labelled_form_for :enumeration, @enumeration, :url => enumerations_path, :html => {:multipart => true} do |f| %> <%= f.hidden_field :type %> <%= render :partial => 'form', :locals => {:f => f} %> <%= submit_tag l(:button_create) %> diff --git a/app/views/groups/_general.html.erb b/app/views/groups/_general.html.erb index c48f54cd4..9cc5be6c3 100644 --- a/app/views/groups/_general.html.erb +++ b/app/views/groups/_general.html.erb @@ -1,4 +1,4 @@ -<%= labelled_form_for @group, :url => group_path(@group) do |f| %> +<%= labelled_form_for @group, :url => group_path(@group), :html => {:multipart => true} do |f| %> <%= render :partial => 'form', :locals => { :f => f } %> <%= submit_tag l(:button_save) %> <% end %> diff --git a/app/views/groups/new.html.erb b/app/views/groups/new.html.erb index 2a7f0034a..c643161fd 100644 --- a/app/views/groups/new.html.erb +++ b/app/views/groups/new.html.erb @@ -1,6 +1,6 @@ <%= title [l(:label_group_plural), groups_path], l(:label_group_new) %> -<%= labelled_form_for @group do |f| %> +<%= labelled_form_for @group, :html => {:multipart => true} do |f| %> <%= render :partial => 'form', :locals => { :f => f } %>

<%= f.submit l(:button_create) %> diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index ca8a1441e..44c75f2a3 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -14,7 +14,7 @@ <%= labelled_form_for :user, @user, :url => { :action => "account" }, :html => { :id => 'my_account_form', - :method => :post } do |f| %> + :method => :post, :multipart => true } do |f| %>

<%=l(:label_information_plural)%> diff --git a/app/views/projects/_edit.html.erb b/app/views/projects/_edit.html.erb index 211762903..5c60b17a8 100644 --- a/app/views/projects/_edit.html.erb +++ b/app/views/projects/_edit.html.erb @@ -1,4 +1,4 @@ -<%= labelled_form_for @project do |f| %> +<%= labelled_form_for @project, :html => {:multipart => true} do |f| %> <%= render :partial => 'form', :locals => { :f => f } %> <%= submit_tag l(:button_save) %> <% end %> diff --git a/app/views/projects/new.html.erb b/app/views/projects/new.html.erb index bd474bb79..e593822a4 100644 --- a/app/views/projects/new.html.erb +++ b/app/views/projects/new.html.erb @@ -1,6 +1,6 @@ <%= title l(:label_project_new) %> -<%= labelled_form_for @project do |f| %> +<%= labelled_form_for @project, :html => {:multipart => true} do |f| %> <%= render :partial => 'form', :locals => { :f => f } %> <%= submit_tag l(:button_create) %> <%= submit_tag l(:button_create_and_continue), :name => 'continue' %> diff --git a/app/views/timelog/edit.html.erb b/app/views/timelog/edit.html.erb index de0ea5993..89a60b7ed 100644 --- a/app/views/timelog/edit.html.erb +++ b/app/views/timelog/edit.html.erb @@ -1,6 +1,6 @@

<%= l(:label_spent_time) %>

-<%= labelled_form_for @time_entry, :url => time_entry_path(@time_entry) do |f| %> +<%= labelled_form_for @time_entry, :url => time_entry_path(@time_entry), :html => {:multipart => true} do |f| %> <%= render :partial => 'form', :locals => {:f => f} %> <%= submit_tag l(:button_save) %> <% end %> diff --git a/app/views/timelog/new.html.erb b/app/views/timelog/new.html.erb index 84bf7dae1..593eb2bc8 100644 --- a/app/views/timelog/new.html.erb +++ b/app/views/timelog/new.html.erb @@ -1,6 +1,6 @@

<%= l(:label_spent_time) %>

-<%= labelled_form_for @time_entry, :url => time_entries_path do |f| %> +<%= labelled_form_for @time_entry, :url => time_entries_path, :html => {:multipart => true} do |f| %> <%= render :partial => 'form', :locals => {:f => f} %> <%= submit_tag l(:button_create) %> <%= submit_tag l(:button_create_and_continue), :name => 'continue' %> diff --git a/app/views/users/_general.html.erb b/app/views/users/_general.html.erb index 7d84c0ced..fddea54bb 100644 --- a/app/views/users/_general.html.erb +++ b/app/views/users/_general.html.erb @@ -1,4 +1,4 @@ -<%= labelled_form_for @user do |f| %> +<%= labelled_form_for @user, :html => {:multipart => true} do |f| %> <%= render :partial => 'form', :locals => { :f => f } %> <% if @user.active? && email_delivery_enabled? && @user != User.current -%>

diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index 255788e02..e9eb102f8 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -1,6 +1,6 @@ <%= title [l(:label_user_plural), users_path], l(:label_user_new) %> -<%= labelled_form_for @user do |f| %> +<%= labelled_form_for @user, :html => {:multipart => true} do |f| %> <%= render :partial => 'form', :locals => { :f => f } %> <% if email_delivery_enabled? %>

diff --git a/app/views/versions/edit.html.erb b/app/views/versions/edit.html.erb index 3c67f09c0..db6bb84e5 100644 --- a/app/views/versions/edit.html.erb +++ b/app/views/versions/edit.html.erb @@ -1,6 +1,6 @@

<%=l(:label_version)%>

-<%= labelled_form_for @version do |f| %> +<%= labelled_form_for @version, :html => {:multipart => true} do |f| %> <%= render :partial => 'form', :locals => { :f => f } %> <%= submit_tag l(:button_save) %> <% end %> diff --git a/app/views/versions/new.html.erb b/app/views/versions/new.html.erb index c63edade7..b52436dbb 100644 --- a/app/views/versions/new.html.erb +++ b/app/views/versions/new.html.erb @@ -1,6 +1,6 @@

<%=l(:label_version_new)%>

-<%= labelled_form_for @version, :url => project_versions_path(@project) do |f| %> +<%= labelled_form_for @version, :url => project_versions_path(@project), :html => {:multipart => true} do |f| %> <%= render :partial => 'versions/form', :locals => { :f => f } %> <%= submit_tag l(:button_create) %> <% end %> -- 2.39.5