Role-based issue custom field visibility (#5037).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12012 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -64,6 +64,24 @@ when "IssueCustomField" %>
|
||||
<p><%= f.check_box :is_for_all %></p>
|
||||
<p><%= f.check_box :is_filter %></p>
|
||||
<p><%= f.check_box :searchable %></p>
|
||||
<p>
|
||||
<label><%= l(:field_visible) %></label>
|
||||
<label class="block">
|
||||
<%= radio_button_tag 'custom_field[visible]', 1, @custom_field.visible?, :id => 'custom_field_visible_on' %>
|
||||
<%= l(:label_visibility_public) %>
|
||||
</label>
|
||||
<label class="block">
|
||||
<%= radio_button_tag 'custom_field[visible]', 0, !@custom_field.visible?, :id => 'custom_field_visible_off' %>
|
||||
<%= l(:label_visibility_roles) %>:
|
||||
</label>
|
||||
<% Role.givable.sorted.each do |role| %>
|
||||
<label class="block custom_field_role" style="padding-left:2em;">
|
||||
<%= check_box_tag 'custom_field[role_ids][]', role.id, @custom_field.roles.include?(role) %>
|
||||
<%= role.name %>
|
||||
</label>
|
||||
<% end %>
|
||||
<%= hidden_field_tag 'custom_field[role_ids][]', '' %>
|
||||
</p>
|
||||
|
||||
<% when "UserCustomField" %>
|
||||
<p><%= f.check_box :is_required %></p>
|
||||
@@ -97,3 +115,12 @@ when "IssueCustomField" %>
|
||||
</div>
|
||||
|
||||
<% include_calendar_headers_tags %>
|
||||
|
||||
<%= javascript_tag do %>
|
||||
function toggleCustomFieldRoles(){
|
||||
var checked = $("#custom_field_visible_on").is(':checked');
|
||||
$('.custom_field_role input').attr('disabled', checked);
|
||||
}
|
||||
$("#custom_field_visible_on, #custom_field_visible_off").change(toggleCustomFieldRoles);
|
||||
$(document).ready(toggleCustomFieldRoles);
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user