end
@roles = Role.find(:all, :order => 'builtin, position')
@trackers = Tracker.find(:all, :order => 'position')
- @statuses = IssueStatus.find(:all, :include => :workflows, :order => 'position')
+ @statuses = IssueStatus.find(:all, :order => 'position')
end
def report
<% for old_status in @statuses %>
<tr>
- <td><%= old_status.name %></td>
- <% for new_status in @statuses %>
+ <td><%= old_status.name %></td>
+ <% new_status_ids_allowed = old_status.find_new_statuses_allowed_to(@role, @tracker).collect(&:id) -%>
+ <% for new_status in @statuses -%>
<td align="center">
-
- <input type="checkbox"
+ <input type="checkbox"
name="issue_status[<%= old_status.id %>][]"
value="<%= new_status.id %>"
- <%if old_status.new_statuses_allowed_to(@role, @tracker).include? new_status%>checked="checked"<%end%>
- >
+ <%= 'checked="checked"' if new_status_ids_allowed.include? new_status.id %>>
</td>
- <% end %>
-
+ <% end -%>
</tr>
<% end %>
</table>
--- /dev/null
+class AddRoleTrackerOldStatusIndexToWorkflows < ActiveRecord::Migration
+ def self.up
+ add_index :workflows, [:role_id, :tracker_id, :old_status_id], :name => :workflows_role_tracker_old_status
+ end
+
+ def self.down
+ remove_index :workflows, :name => :workflows_role_tracker_old_status
+ end
+end