diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2018-09-15 07:09:14 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2018-09-15 07:09:14 +0000 |
commit | 04e94bd3dda58665c11c09b6f60497b31b397b80 (patch) | |
tree | 056053e16b464eea46f8ab32bbede88ff77a5daa /app/helpers/workflows_helper.rb | |
parent | 72e68c534edd8c6aa5d93e5b2ffc750015144a24 (diff) | |
download | redmine-04e94bd3dda58665c11c09b6f60497b31b397b80.tar.gz redmine-04e94bd3dda58665c11c09b6f60497b31b397b80.zip |
Disable workflow checkboxes with no status change (#5593).
Patch by Mizuki ISHIKAWA.
git-svn-id: http://svn.redmine.org/redmine/trunk@17487 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/workflows_helper.rb')
-rw-r--r-- | app/helpers/workflows_helper.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/helpers/workflows_helper.rb b/app/helpers/workflows_helper.rb index 142569e05..8ac75aa98 100644 --- a/app/helpers/workflows_helper.rb +++ b/app/helpers/workflows_helper.rb @@ -78,8 +78,10 @@ module WorkflowsHelper w = workflows.select {|w| w.old_status == old_status && w.new_status == new_status}.size tag_name = "transitions[#{ old_status.try(:id) || 0 }][#{new_status.id}][#{name}]" - if w == 0 || w == @roles.size * @trackers.size - + if old_status == new_status + check_box_tag(tag_name, "1", true, + {:disabled => true, :class => "old-status-#{old_status.try(:id) || 0} new-status-#{new_status.id}"}) + elsif 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.try(:id) || 0} new-status-#{new_status.id}") |