<%# (C) COPYRIGHT HELP/SYSTEMS, L.L.C. 2009 %> <% if @user.is_ldap_user? @ldap_shipped_admin_view = @user.is_shipped_admin? ? true : false else @ldap_shipped_admin_view = true end if !@view_only disabled_email = (@user.is_ldap_authorization? && (@user.update_email_ldap && !@user.is_shipped_admin?)) ? true : false else disabled_email = true end %> <% fields_for @user do |form| %> <% if !@user.is_ldap_authorization? %>
<%= form.label :username, t_label('.username_label'), :class => "username-label item-label" %>
<%= form.text_field :username, :disabled => @view_only, :maxLength => 40, :class => "x-form-field name-field" %>

<%= t('.username_caption') %>

<% else %>

<%= t_label('.username_label') %>

<%= h @user.username%>

<% end %>
<%= form.label :email_address, t_label('.email_address_label'), :class => "email-address-label item-label" %>
<%= form.text_field :email_address, :disabled => disabled_email, :maxLength => 256, :class => "x-form-field name-field" %>

<%= t('.email_address_caption') %>

<% if @user.is_ldap_authorization? && !@user.is_shipped_admin? %>
<%= form.label :update_email_ldap, t_label('.update_email_ldap_label'), :class => "update_email_ldap-label item-label" %>
<%= form.check_box :update_email_ldap, :disabled => @view_only %>

<%= t('.update_email_ldap_caption') %>

<% end %>
<%= form.label :username, t_label('users.profile.language'), :class => "language-label item-label" %>
<%= select_tag(:locale, options_for_select(I18n.available_locales, (@user.locale || I18n.locale).to_sym), {:dojoType => "helpsys.ext.ComboBox", :forceSelection => false, :editable => false, :typeAhead => true, :triggerAction => 'all', :id => '', :width => 50,:cls =>"language-combobox", :fieldLabel => "test", :name => 'user[locale]', :disabled=>@view_only}) %>

<% if !@user.is_ldap_authorization? %>
<%= form.label :role, t_label('.role_label'), :class => "x-form-item label" %>
<% @user.role = Role.find(Role.get_user_role) if @user.role.nil?%> <% form.fields_for :role do |role_fields| %> <%= role_fields.hidden_field :id, :disabled => true %> <%= role_fields.hidden_field :name, :disabled => true %> <% end %>

<%= t('.role_caption') %>

<% else %>

<%= t_label('users.edit_details.role_label') %>

<%= h @user.role.name unless @user.role.nil? %>

<% end %> <% unless current_user.username == @user.username %>
<%= form.label :enabled, t_label('.enabled_label'), :class => "enabled-label item-label" %>
<%= form.check_box :enabled, :disabled => @view_only %>

<%= t('.enabled_caption') %>

<% end %> <% if @ldap_shipped_admin_view %>
<%= form.label :password_expired, t_label('.password_expired'), :class => "password-expired-label item-label" %>
<%= form.check_box :password_expired, :disabled => @view_only %>

<%= t('.password_expired_caption') %>

<% end %> <% unless @user.new_record? %>

<%= t_label('.last_login_label') %>

<%= format_timestamp @user.current_login_at %>

<% if @ldap_shipped_admin_view %>

<%= t_label('.password_changed_label') %>

<%= format_timestamp @user.password_last_changed_at %>

<% end %> <% else if @ldap_shipped_admin_view %>
<%= form.label :password, t_label('.new_password_label'), :class => "password-label item-label" %>
<%= form.password_field :password, {:class => 'inputEdit', :maxLength => 40} %>

<%= t('.new_password_caption') %>

<%= form.label :password_confirmation, t_label('.confirm_new_password_label'), :class => "password-label item-label" %>
<%= form.password_field :password_confirmation, {:class => 'inputEdit', :maxLength => 40} %>

<%= t('.confirm_new_password_caption') %>

<% end end %> <% end %>