読者です 読者をやめる 読者になる 読者になる

clock-up-blog

go-mi-tech

(Redmine) Hiding a status field on new ticket form

Redmine

Summary

In redmine, it's not cool a status field appears on new ticket form.
This patch hide it.

Version

Redmine version: 2.3.1

Patch

https://gist.github.com/kobake/5821205

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>

Apply

cd {Redmine directory}
wget https://gist.github.com/kobake/5821205/raw/fba2309531f1110e608bfa27458842b0bd68142c/redmine_hide_status_when_new_ticket_form.patch
patch -p0 < redmine_hide_status_when_new_ticket_form.patch
});