summaryrefslogtreecommitdiffstats
path: root/app/views/roles
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-04-07 20:27:19 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-04-07 20:27:19 +0000
commitbd9a44c2254ab785014207cb07f8b2fff1068b34 (patch)
tree4a105efe6e82a5e2fd1fa9ae4bac42b1a51f8fae /app/views/roles
parent30734ba8e8f040f3cff158351733c6228bd2db18 (diff)
downloadredmine-bd9a44c2254ab785014207cb07f8b2fff1068b34.tar.gz
redmine-bd9a44c2254ab785014207cb07f8b2fff1068b34.zip
Added permissions report (link available on roles list view).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@433 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/roles')
-rw-r--r--app/views/roles/list.rhtml4
-rw-r--r--app/views/roles/report.rhtml32
2 files changed, 35 insertions, 1 deletions
diff --git a/app/views/roles/list.rhtml b/app/views/roles/list.rhtml
index a27af8c85..e3e576ed1 100644
--- a/app/views/roles/list.rhtml
+++ b/app/views/roles/list.rhtml
@@ -27,4 +27,6 @@
</tbody>
</table>
-<%= pagination_links_full @role_pages %> \ No newline at end of file
+<p><%= pagination_links_full @role_pages %></p>
+
+<p><%= link_to l(:label_permissions_report), :action => 'report' %></p>
diff --git a/app/views/roles/report.rhtml b/app/views/roles/report.rhtml
new file mode 100644
index 000000000..61e1e18e4
--- /dev/null
+++ b/app/views/roles/report.rhtml
@@ -0,0 +1,32 @@
+<h2><%=l(:label_permissions_report)%></h2>
+
+<%= start_form_tag({:action => 'report'}, :id => 'permissions_form') %>
+
+<table class="list">
+<thead><tr>
+ <th><%=l(:label_permissions)%></th>
+ <th colspan="<%= @roles.length %>"><%= l(:label_role_plural) %></th>
+</tr>
+</thead>
+<tbody>
+<% permissions = @permissions.group_by {|p| p.group_id } %>
+<% permissions.keys.sort.each do |group_id| %>
+ <tr>
+ <th><%= l(Permission::GROUPS[group_id]) %></th>
+ <% @roles.each do |role| %><th align="center"><small><%= role.name %></small></th><% end %>
+ </tr>
+ <% permissions[group_id].each do |p| %>
+ <tr class="<%= cycle("odd", "even") %>">
+ <td><%= l(p.description.to_sym) %></td>
+ <% @roles.each do |role| %>
+ <td align="center"><%= check_box_tag "permission_ids[#{role.id}][]", p.id, (role.permissions.include? p) %></td>
+ <% end %>
+ </tr>
+ <% end %>
+<% reset_cycle
+end %>
+</tbody>
+</table>
+<p><%= check_all_links 'permissions_form' %></p>
+<p><%= submit_tag l(:button_save) %></p>
+<%= end_form_tag %> \ No newline at end of file