%# (C) COPYRIGHT HELP/SYSTEMS, L.L.C. 2009 %>
<%
button_id = "button_close_#{@role.id}"
form_id = @role.new_record? ? "new_role" : "edit_role_#{@role.id}"
dialog_id = "edit_#{@role.id}"
url = @role.new_record? ? roles_path : role_path
view_only = (@view_only || @role.unknown_role || @role.admin_role)
change_users = (!@view_only && @role.unknown_role)
admin = @role.admin_role ? true : false
if @role.id.nil?
role_id = Role.get_unknown_role
else
role_id = @role.id
end
@title_section = t('.dialog_title')
@title_section = @title_section + ' ' + t('common.view_only_mode') if @view_only
@title_item = h @role.name
@help_link_anchor = HELP_URL_CONFIG['admin']['roles']['role_settings']
%>
<% form_for @role,
:html => {
:id => form_id,
:class => "edit_role",
:autocomplete => "off",
:onsubmit => "try {helpsys.CntMgr.getController('#{form_id}').submitForm();} catch(e) {console.log(e.message);console.log(e);};return false;"} do |form| %>
<% render(:layout => 'shared/edit_section',
:locals => {
:section_id => "role-general",
:section_title => t('common.general_title')}) do %>
<%= t_label('common.name') %>
<%= h @role.name %>
<%= t_label('common.description') %>
<%= h @role.description %>
<% end %>
<% render(:layout => 'shared/edit_section',
:locals => {
:section_id => "role-users",
:section_title => t('.users_tab')}) do %>
<% if @system_settings.ldap_option == SystemSetting::LDAP_LEVEL_FULL %>
<%= t_label('roles.role.ldap_group') %>
<%= h @role.ldap_group_path %>
<% else %>
<%= t('roles.role.role_members')%>
<% if @role.users.length == 0 %>
- <%= t('roles.role.no_role_members')%>
<% else %>
<%= comma_separated_li( Array.new(@role.users.collect {|i| h i.name + ' (' + i.username + ')'}).sort {|a,b| a.upcase <=> b.upcase} ) %>
<% end %>
<% end
end %>
<% if admin %>
<% render(:layout => 'shared/edit_section',
:locals => {
:section_id => "no-object-security",
:section_title => t('.no_security_tab'),
:details_only => true}) do %>
<%= t('roles.role.no_changes_for_admin') %>
<% end %>
<% else %>
<% render(:layout => 'shared/edit_section',
:locals => {
:section_id => "role-object-security",
:section_title => t('.object_level_security_tab')}) do %>
<%= t('roles.role.change_authority')%>
<%= object_level_sec_li('change') %>
<%= t('roles.role.view_authority')%>
<%= object_level_sec_li('view') %>
<%= t('roles.role.exclude_authority')%>
<%= object_level_sec_li('exclude') %>
<% end %>
<% render(:layout => 'shared/edit_section',
:locals => {
:section_id => "role-action-security",
:section_title => t('.action_level_security_tab')}) do %>
<%= t('roles.role.use_authority')%>
<%= action_level_sec_li('use') %>
<%= t('roles.role.exclude_authority')%>
<%= action_level_sec_li('exclude') %>
<% end %>
<% render(:layout => 'shared/edit_section',
:locals => {
:section_id => "role-record-security",
:section_title => t('.record_level_security_tab')}) do %>
<%= t('roles.role.change_authority')%>
<%= record_level_sec_li('change') %>
<%= t('roles.role.view_authority')%>
<%= record_level_sec_li('view') %>
<%= t('roles.role.exclude_authority')%>
<%= record_level_sec_li('exclude') %>
<%= t('roles.role.execute_authority')%>
<%= record_level_sec_li('execute') %>
<%= t('roles.default_value_caption') %>
<% end %>
<% end %>
<%= standard_buttons(button_id) %>
<% end %>