Makes new issue initial status settable in workflow (#5816).

git-svn-id: http://svn.redmine.org/redmine/trunk@14458 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2015-07-26 08:30:19 +00:00
parent fdecb2a17b
commit 2bc5b60f9d
14 changed files with 168 additions and 49 deletions

View File

@@ -75,14 +75,14 @@ module WorkflowsHelper
end
def transition_tag(workflows, old_status, new_status, name)
w = workflows.select {|w| w.old_status_id == old_status.id && w.new_status_id == new_status.id}.size
w = workflows.select {|w| w.old_status == old_status && w.new_status == new_status}.size
tag_name = "transitions[#{ old_status.id }][#{new_status.id}][#{name}]"
tag_name = "transitions[#{ old_status.try(:id) || 0 }][#{new_status.id}][#{name}]"
if w == 0 || w == @roles.size * @trackers.size
hidden_field_tag(tag_name, "0", :id => nil) +
check_box_tag(tag_name, "1", w != 0,
:class => "old-status-#{old_status.id} new-status-#{new_status.id}")
:class => "old-status-#{old_status.try(:id) || 0} new-status-#{new_status.id}")
else
select_tag tag_name,
options_for_select([