Skip to content

Instantly share code, notes, and snippets.

@kobake
Last active December 18, 2015 17:49
Show Gist options
  • Save kobake/5821205 to your computer and use it in GitHub Desktop.
Save kobake/5821205 to your computer and use it in GitHub Desktop.
(For redmine 2.3.1) Hide status field in new ticket form.
diff --git app/views/issues/_attributes.html.erb app/views/issues/_attributes.html.erb
index 0e29701..830dfc6 100644
--- app/views/issues/_attributes.html.erb
+++ app/views/issues/_attributes.html.erb
@@ -2,7 +2,8 @@
<div class="splitcontent">
<div class="splitcontentleft">
-<% if @issue.safe_attribute?('status_id') && @allowed_statuses.present? %>
+<% if params[:action] == 'new' %>
+<% elsif @issue.safe_attribute?('status_id') && @allowed_statuses.present? %>
<p><%= f.select :status_id, (@allowed_statuses.collect {|p| [p.name, p.id]}), {:required => true},
:onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')" %></p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment