%# (C) COPYRIGHT HELP/SYSTEMS, L.L.C. 2009 %>
"
helpUrl="<%=help_link(HELP_URL_CONFIG['admin']['users']['user_manager'])%>"
region="center"
lazyRender="true"
dojoType="helpsys.ext.LiveGrid"
authenticity_token="<%= form_authenticity_token %>"
autoExpandColumn="description"
dataColumns="[{ name: 'id' }, { name: 'username' }, { name: 'name' }, { name: 'description'}, { name: 'enabled' }, { name: 'password_last_changed_at'}, { name: 'role_name'}, { name: 'current_login_at'}]"
deletePath="<%= user_path(-1) %>"
editPath="<%= edit_user_path(-1) %>"
editInPopup="false"
itemType='<%= t('common.user') %>'
gridColumns="[
{ dataIndex: 'name', header: '<%=t "common.name" %>', id: 'className', locked: false, sortable: true, width: 200, filter: true, filterType: 'string'},
{ dataIndex: 'description', header: '<%=t "common.description" %>', id: 'description', locked: false, sortable: true, width: 200, filter: true, filterType: 'string'},
{ dataIndex: 'username', header: '<%=t ".username_header" %>', id: 'classUsername', locked: false, sortable: true, width: 200, filter: true, filterType: 'string'},
{ dataIndex: 'enabled', header: '<%=t ".enabled_header" %>', id: 'classEnabled', locketd: false, sortable: true, width: 100, filter: true, filterType: 'list', filterList: <%= "[['TRUE', '#{t('common.key_yes')}'],['FALSE', '#{t('common.key_no')}']]" %>},
{ dataIndex: 'password_last_changed_at', header: '<%=t ".password_last_changed_header" %>', id: 'classPassword', locked: false, sortable: true, width: 150, filter: true, filterType: 'date'},
{ dataIndex: 'role_name', header: '<%=t ".role_header" %>', id: 'classRole', locked: false, sortable: true, width: 200, filter: true, filterType: 'string'},
{ dataIndex: 'current_login_at', header: '<%=t ".last_login_header" %>', id: 'classLastLogin', locked: false, sortable: true, width: 50, filter: true, filterType: 'date'}
]"
includeDelete="true"
includeEdit="true"
includeShow="true"
menuCfg="{items: [{
iconCls: 'icon_edit',
text: '<%=t ".edit_user" %>',
actsOn: 'one',
actionUrl: '<%= edit_user_path(-1) %>'
},{
iconCls: 'icon_delete',
text: '<%=t ".delete_user" %>',
actsOn: 'one',
method: 'DELETE',
actionUrl: '<%= user_path(-1) %>',
ajaxRequest: true,
confirmText: '<%= t".delete_confirmation"%>'
},
<% if @current_user.role.administrator? %>
{
iconCls: 'icon_view_fle',
text: '<%=t ".view_files" %>',
actsOn: 'one',
actionUrl: '<%= user_files_path() + "?user_id=\#{id}" %>'
},
<% end %>
'-',{
iconCls: 'icon_reset_password',
text: '<%=t ".reset_password" %>',
actsOn: 'one',
actionUrl: '<%= edit_other_password_user_path(-1) %>',
usePopup: true
},'-', {
iconCls: 'icon_export',
text: '<%=t ".export_user" %>',
actsOn: 'many',
method: 'EXPORT',
customAction: true,
hideLoadWindow: true,
handler: function(){exportController.openExportPopup.call(exportController)}
}, {
iconCls: 'icon_audit',
text: '<%=t "common.show_audit_changes" %>',
actsOn: 'one',
actionUrl: '<%= audits_path(:auditable_id => -1, :auditable_type => 'User') %>'
}]}"
sortField="{field: 'name', direction: 'ASC'}"
tbar="{items: [{
iconCls: 'icon_create',
text: '<%=t ".create_user" %>',
actsOn: 'none',
actionUrl: '<%= new_user_path %>'
}]}"
url="<%= users_path(:format => 'json') %>" style="height:100%;">