diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-10-04 07:23:14 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-10-04 07:23:14 +0000 |
commit | 15d5c331ebc15caee6d8acf89d81b506102c8fa4 (patch) | |
tree | 3cf842a10d3b7f580f23fbd2a1b6f3357271f3b9 /app/views/timelog | |
parent | 1232f0670e2002d010d29bb804fa769783314065 (diff) | |
download | redmine-15d5c331ebc15caee6d8acf89d81b506102c8fa4.tar.gz redmine-15d5c331ebc15caee6d8acf89d81b506102c8fa4.zip |
Let the new time_entry form be submitted without project (#17954).
git-svn-id: http://svn.redmine.org/redmine/trunk@13422 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/timelog')
-rw-r--r-- | app/views/timelog/_form.html.erb | 8 | ||||
-rw-r--r-- | app/views/timelog/new.html.erb | 1 |
2 files changed, 5 insertions, 4 deletions
diff --git a/app/views/timelog/_form.html.erb b/app/views/timelog/_form.html.erb index 3256feaac..b51f98dad 100644 --- a/app/views/timelog/_form.html.erb +++ b/app/views/timelog/_form.html.erb @@ -3,10 +3,12 @@ <div class="box tabular"> <% if @time_entry.new_record? %> - <% if params[:project_id] || @time_entry.issue %> - <%= f.hidden_field :project_id %> + <% if params[:project_id] %> + <%= hidden_field_tag 'project_id', params[:project_id] %> + <% elsif params[:issue_id] %> + <%= hidden_field_tag 'issue_id', params[:issue_id] %> <% else %> - <p><%= f.select :project_id, project_tree_options_for_select(Project.allowed_to(:log_time).all, :selected => @time_entry.project), :required => true %></p> + <p><%= f.select :project_id, project_tree_options_for_select(Project.allowed_to(:log_time).all, :selected => @time_entry.project, :include_blank => true) %></p> <% end %> <% end %> <p> diff --git a/app/views/timelog/new.html.erb b/app/views/timelog/new.html.erb index 95253e82f..84bf7dae1 100644 --- a/app/views/timelog/new.html.erb +++ b/app/views/timelog/new.html.erb @@ -1,7 +1,6 @@ <h2><%= l(:label_spent_time) %></h2> <%= labelled_form_for @time_entry, :url => time_entries_path do |f| %> - <%= hidden_field_tag 'project_id', params[:project_id] if params[:project_id] %> <%= render :partial => 'form', :locals => {:f => f} %> <%= submit_tag l(:button_create) %> <%= submit_tag l(:button_create_and_continue), :name => 'continue' %> |