@@ -0,0 +1,32 | |||||
|
1 | <h2><%=l(:label_permissions_report)%></h2> | |||
|
2 | ||||
|
3 | <%= start_form_tag({:action => 'report'}, :id => 'permissions_form') %> | |||
|
4 | ||||
|
5 | <table class="list"> | |||
|
6 | <thead><tr> | |||
|
7 | <th><%=l(:label_permissions)%></th> | |||
|
8 | <th colspan="<%= @roles.length %>"><%= l(:label_role_plural) %></th> | |||
|
9 | </tr> | |||
|
10 | </thead> | |||
|
11 | <tbody> | |||
|
12 | <% permissions = @permissions.group_by {|p| p.group_id } %> | |||
|
13 | <% permissions.keys.sort.each do |group_id| %> | |||
|
14 | <tr> | |||
|
15 | <th><%= l(Permission::GROUPS[group_id]) %></th> | |||
|
16 | <% @roles.each do |role| %><th align="center"><small><%= role.name %></small></th><% end %> | |||
|
17 | </tr> | |||
|
18 | <% permissions[group_id].each do |p| %> | |||
|
19 | <tr class="<%= cycle("odd", "even") %>"> | |||
|
20 | <td><%= l(p.description.to_sym) %></td> | |||
|
21 | <% @roles.each do |role| %> | |||
|
22 | <td align="center"><%= check_box_tag "permission_ids[#{role.id}][]", p.id, (role.permissions.include? p) %></td> | |||
|
23 | <% end %> | |||
|
24 | </tr> | |||
|
25 | <% end %> | |||
|
26 | <% reset_cycle | |||
|
27 | end %> | |||
|
28 | </tbody> | |||
|
29 | </table> | |||
|
30 | <p><%= check_all_links 'permissions_form' %></p> | |||
|
31 | <p><%= submit_tag l(:button_save) %></p> | |||
|
32 | <%= end_form_tag %> No newline at end of file |
@@ -99,4 +99,17 class RolesController < ApplicationController | |||||
99 | @trackers = Tracker.find(:all, :order => 'position') |
|
99 | @trackers = Tracker.find(:all, :order => 'position') | |
100 | @statuses = IssueStatus.find(:all, :include => :workflows, :order => 'position') |
|
100 | @statuses = IssueStatus.find(:all, :include => :workflows, :order => 'position') | |
101 | end |
|
101 | end | |
|
102 | ||||
|
103 | def report | |||
|
104 | @roles = Role.find :all | |||
|
105 | @permissions = Permission.find :all, :conditions => ["is_public=?", false], :order => 'sort' | |||
|
106 | if request.post? | |||
|
107 | @roles.each do |role| | |||
|
108 | role.permissions = Permission.find(params[:permission_ids] ? (params[:permission_ids][role.id.to_s] || []) : [] ) | |||
|
109 | end | |||
|
110 | Permission.allowed_to_role_expired | |||
|
111 | flash[:notice] = l(:notice_successful_update) | |||
|
112 | redirect_to :action => 'list' | |||
|
113 | end | |||
|
114 | end | |||
102 | end |
|
115 | end |
@@ -27,4 +27,6 | |||||
27 | </tbody> |
|
27 | </tbody> | |
28 | </table> |
|
28 | </table> | |
29 |
|
29 | |||
30 | <%= pagination_links_full @role_pages %> No newline at end of file |
|
30 | <p><%= pagination_links_full @role_pages %></p> | |
|
31 | ||||
|
32 | <p><%= link_to l(:label_permissions_report), :action => 'report' %></p> |
@@ -355,6 +355,7 label_diff_inline: inline | |||||
355 | label_diff_side_by_side: side by side |
|
355 | label_diff_side_by_side: side by side | |
356 | label_options: Options |
|
356 | label_options: Options | |
357 | label_copy_workflow_from: Copy workflow from |
|
357 | label_copy_workflow_from: Copy workflow from | |
|
358 | label_permissions_report: Permissions report | |||
358 |
|
359 | |||
359 | button_login: Einloggen |
|
360 | button_login: Einloggen | |
360 | button_submit: OK |
|
361 | button_submit: OK |
@@ -355,6 +355,7 label_diff_inline: inline | |||||
355 | label_diff_side_by_side: side by side |
|
355 | label_diff_side_by_side: side by side | |
356 | label_options: Options |
|
356 | label_options: Options | |
357 | label_copy_workflow_from: Copy workflow from |
|
357 | label_copy_workflow_from: Copy workflow from | |
|
358 | label_permissions_report: Permissions report | |||
358 |
|
359 | |||
359 | button_login: Login |
|
360 | button_login: Login | |
360 | button_submit: Submit |
|
361 | button_submit: Submit |
@@ -355,6 +355,7 label_diff_inline: inline | |||||
355 | label_diff_side_by_side: side by side |
|
355 | label_diff_side_by_side: side by side | |
356 | label_options: Options |
|
356 | label_options: Options | |
357 | label_copy_workflow_from: Copy workflow from |
|
357 | label_copy_workflow_from: Copy workflow from | |
|
358 | label_permissions_report: Permissions report | |||
358 |
|
359 | |||
359 | button_login: Conexión |
|
360 | button_login: Conexión | |
360 | button_submit: Someter |
|
361 | button_submit: Someter |
@@ -355,6 +355,7 label_diff_inline: en ligne | |||||
355 | label_diff_side_by_side: côte à côte |
|
355 | label_diff_side_by_side: côte à côte | |
356 | label_options: Options |
|
356 | label_options: Options | |
357 | label_copy_workflow_from: Copier le workflow de |
|
357 | label_copy_workflow_from: Copier le workflow de | |
|
358 | label_permissions_report: Synthèse des permissions | |||
358 |
|
359 | |||
359 | button_login: Connexion |
|
360 | button_login: Connexion | |
360 | button_submit: Soumettre |
|
361 | button_submit: Soumettre |
@@ -355,6 +355,7 label_diff_inline: inline | |||||
355 | label_diff_side_by_side: side by side |
|
355 | label_diff_side_by_side: side by side | |
356 | label_options: Options |
|
356 | label_options: Options | |
357 | label_copy_workflow_from: Copy workflow from |
|
357 | label_copy_workflow_from: Copy workflow from | |
|
358 | label_permissions_report: Permissions report | |||
358 |
|
359 | |||
359 | button_login: Login |
|
360 | button_login: Login | |
360 | button_submit: Invia |
|
361 | button_submit: Invia |
@@ -356,6 +356,7 label_diff_inline: インライン | |||||
356 | label_diff_side_by_side: 横に並べる |
|
356 | label_diff_side_by_side: 横に並べる | |
357 | label_options: Options |
|
357 | label_options: Options | |
358 | label_copy_workflow_from: Copy workflow from |
|
358 | label_copy_workflow_from: Copy workflow from | |
|
359 | label_permissions_report: Permissions report | |||
359 |
|
360 | |||
360 | button_login: ログイン |
|
361 | button_login: ログイン | |
361 | button_submit: 変更 |
|
362 | button_submit: 変更 |
@@ -358,6 +358,7 label_diff_inline: inline | |||||
358 | label_diff_side_by_side: side by side |
|
358 | label_diff_side_by_side: side by side | |
359 | label_options: Options |
|
359 | label_options: Options | |
360 | label_copy_workflow_from: Copy workflow from |
|
360 | label_copy_workflow_from: Copy workflow from | |
|
361 | label_permissions_report: Permissions report | |||
361 |
|
362 | |||
362 | button_login: 登录 |
|
363 | button_login: 登录 | |
363 | button_submit: 提交 |
|
364 | button_submit: 提交 |
@@ -302,9 +302,10 table.list thead th { | |||||
302 | } |
|
302 | } | |
303 |
|
303 | |||
304 | table.list tbody th { |
|
304 | table.list tbody th { | |
305 |
font-weight: |
|
305 | font-weight: bold; | |
306 | background: #eed; |
|
306 | background: #eed; | |
307 | border: 1px solid #d7d7d7; |
|
307 | border: 1px solid #d7d7d7; | |
|
308 | color: #777; | |||
308 | } |
|
309 | } | |
309 |
|
310 | |||
310 | /********** Validation error messages *************/ |
|
311 | /********** Validation error messages *************/ |
General Comments 0
You need to be logged in to leave comments.
Login now