[% INCLUDE "ui-header.html" stylesheet="ledgersmb.css" include_stylesheet=["setup.css"]; PROCESS "elements.html"; PROCESS "dynatable.html"; %]
[% IF request.pls_import; text('Duplicate User Found: Importing User'); action = 'save_user'; ELSIF user.user_id; text('Editing User'); action = 'edit_user'; ELSE; text('New User'); action = 'save_user'; END %]
[% IF user.user_id and not request.pls_import %] [% ELSE %] [% END %] [% IF (request.pls_import == 1) OR !user.username %] [% IF request.pls_import; importc1 = 'CHECKED'; importc0 = ''; ELSE; importc1 = ''; importc0 = 'CHECKED'; END; %] [% END # unless employee.entity_id %]
[% text('Username') %] [% user.username; INCLUDE input element_data = { name = 'username' type = 'hidden' value = user.username } %]
[% text('Username') %]
[% PROCESS input element_data = { type = "password" id = "password" name = "password" autocomplete = "off" } %]
[% text('Import') %]
[% INCLUDE input element_data = { label = 'Yes' value = '1' checked = importc1 name = 'pls_import' type = 'radio' } %]
[% INCLUDE input element_data = { label = 'No' value = '0' checked = importc0 name = 'pls_import' type = 'radio' } %]
[% IF user.username and not request.pls_import; PROCESS button element_data = { text = text('Reset Password') #' name = 'action' type = 'submit' class = 'submit' value = 'reset_password' attributes = { autocomplete = "off" } }; ELSE; PROCESS button element_data = { text = text('Add User') #' name = 'action' type = 'submit' class = 'submit' value = 'create_user' }; END; %]
[% IF user.user_id and not request.pls_import%]
[% PROCESS input element_data = { type="hidden" name="id" value=request.id }; %]
[% FOREACH role IN roles %] [% IF loop.even() %] [% END %] [% END %]
[% rolcheck = undef; IF user.roles.grep(role.name).size; rolcheck = "checked"; END %] [% PROCESS input element_data = { type = "checkbox" label = role.description value = 1 name = role.name id = role.name checked = rolcheck }, label_pos = 1 %]
[% PROCESS button element_data = { text = text('Save Groups') #' class = "submit" name = "action" value = "save_user_roles" 'data-lsmb-doing' = text('Saving...') 'data-lsmb-done' = text('Saved') } %]
[% END %]
[% end_html %]