Index: app/views/workflows/_form.html.erb
===================================================================
--- app/views/workflows/_form.html.erb (révision 315)
+++ app/views/workflows/_form.html.erb (copie de travail)
@@ -10,31 +10,56 @@
|
- <% for new_status in @statuses %>
+<%
+ new_status_worflows_present = {}
+ for new_status in @statuses
+ if @used_statuses_only
+ new_status_worflows_present[new_status.id] = workflows.select {|w| w.new_status == new_status}.size > 0
+ end
+
+ if !@used_statuses_only || new_status_worflows_present[new_status.id]
+-%>
<%= link_to_function(image_tag('toggle_check.png'), "toggleCheckboxesBySelector('table.transitions-#{name} input.new-status-#{new_status.id}')",
- :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %>
+ :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %>
<%=h new_status.name %>
|
- <% end %>
+<%
+ end
+ end
+-%>
- <% for old_status in @statuses %>
+<%
+ for old_status in @statuses
+ if @used_statuses_only
+ old_status_worflows_present = workflows.select {|w| w.old_status == old_status}.size > 0
+ end
+ if !@used_statuses_only || old_status_worflows_present
+-%>
">
<%= link_to_function(image_tag('toggle_check.png'), "toggleCheckboxesBySelector('table.transitions-#{name} input.old-status-#{old_status.id}')",
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %>
-
<%=h old_status.name %>
|
- <% for new_status in @statuses -%>
+<%
+ for new_status in @statuses
+ if !@used_statuses_only || new_status_worflows_present[new_status.id]
+-%>
<%= check_box_tag "issue_status[#{ old_status.id }][#{new_status.id}][]", name, workflows.detect {|w| w.old_status_id == old_status.id && w.new_status_id == new_status.id},
:class => "old-status-#{old_status.id} new-status-#{new_status.id}" %>
|
- <% end -%>
+<%
+ end
+ end
+-%>
- <% end %>
+<%
+ end
+ end
+-%>
\ No newline at end of file