2007-04-08 00:27:19 +04:00
|
|
|
<h2><%=l(:label_permissions_report)%></h2>
|
|
|
|
|
2007-08-29 21:25:22 +04:00
|
|
|
<% form_tag({:action => 'report'}, :id => 'permissions_form') do %>
|
2008-08-26 20:05:02 +04:00
|
|
|
<%= hidden_field_tag 'permissions[0]', '', :id => nil %>
|
2007-04-08 00:27:19 +04:00
|
|
|
<table class="list">
|
2007-08-29 20:52:35 +04:00
|
|
|
<thead>
|
2007-04-08 00:27:19 +04:00
|
|
|
<tr>
|
2007-08-29 20:52:35 +04:00
|
|
|
<th><%=l(:label_permissions)%></th>
|
2007-04-08 00:27:19 +04:00
|
|
|
<% @roles.each do |role| %>
|
2008-08-26 20:05:02 +04:00
|
|
|
<th>
|
|
|
|
<%= content_tag(role.builtin? ? 'em' : 'span', h(role.name)) %>
|
|
|
|
<%= link_to_function(image_tag('toggle_check.png'), "toggleCheckboxesBySelector('input.role-#{role.id}')",
|
|
|
|
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %>
|
|
|
|
</th>
|
2007-04-08 00:27:19 +04:00
|
|
|
<% end %>
|
|
|
|
</tr>
|
2007-08-29 20:52:35 +04:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
2007-09-14 15:34:08 +04:00
|
|
|
<% perms_by_module = @permissions.group_by {|p| p.project_module.to_s} %>
|
|
|
|
<% perms_by_module.keys.sort.each do |mod| %>
|
|
|
|
<% unless mod.blank? %>
|
2008-10-24 19:24:35 +04:00
|
|
|
<tr><%= content_tag('th', l_or_humanize(mod, :prefix => 'project_module_'), :colspan => (@roles.size + 1), :align => 'left') %></tr>
|
2007-04-08 00:27:19 +04:00
|
|
|
<% end %>
|
2007-09-14 15:34:08 +04:00
|
|
|
<% perms_by_module[mod].each do |permission| %>
|
2008-08-26 20:05:02 +04:00
|
|
|
<tr class="<%= cycle('odd', 'even') %> permission-<%= permission.name %>">
|
|
|
|
<td>
|
|
|
|
<%= link_to_function(image_tag('toggle_check.png'), "toggleCheckboxesBySelector('.permission-#{permission.name} input')",
|
|
|
|
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %>
|
2008-10-24 19:24:35 +04:00
|
|
|
<%= l_or_humanize(permission.name, :prefix => 'permission_') %>
|
2008-08-26 20:05:02 +04:00
|
|
|
</td>
|
2007-09-14 15:34:08 +04:00
|
|
|
<% @roles.each do |role| %>
|
|
|
|
<td align="center">
|
|
|
|
<% if role.setable_permissions.include? permission %>
|
2008-08-26 20:05:02 +04:00
|
|
|
<%= check_box_tag "permissions[#{role.id}][]", permission.name, (role.permissions.include? permission.name), :id => nil, :class => "role-#{role.id}" %>
|
2007-09-14 15:34:08 +04:00
|
|
|
<% end %>
|
|
|
|
</td>
|
|
|
|
<% end %>
|
|
|
|
</tr>
|
2007-08-29 20:52:35 +04:00
|
|
|
<% end %>
|
|
|
|
<% end %>
|
2007-04-08 00:27:19 +04:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<p><%= check_all_links 'permissions_form' %></p>
|
|
|
|
<p><%= submit_tag l(:button_save) %></p>
|
2007-08-29 21:25:22 +04:00
|
|
|
<% end %>
|