Commit 1e01f78a by Nilu

HT012 - Manage Users

Disable ‘Invite ‘ button by default
If email address is at least entered and is valid, then enable ‘Invite’ button
Default ‘Role’ to Standard
parent 953300bf
......@@ -47,19 +47,43 @@
Collection<CompanyUser> sortedCompanyUsers = Utils.getUsersSorted(companyUsers, userSortOpt);
Collection<CompanyUser> sortedPendingUsers = Utils.getUsersSorted(pendingUsers, userSortOpt);
company.setRoleType(RoleType.STANDARD);
%>
<script type="text/javascript">
$(document).ready(function()
{
recalcFunction = setupRecalc ($("form"), {'recalcOnError':true});
$(".user-role").change(function()
{
var id = $(this).closest('.user-list-row').attr('id');
$('.save-user' + id).click();
});
validate();
$('input[name$=UserEmail]').keyup(function() {
recalcFunction();
validate();
});
});
function validate() {
if ($('.invite-btn').hasClass('disabled')) {
$('.btn-invite').attr('disabled', 'disabled');
} else {
$('.btn-invite').removeAttr('disabled');
}
}
</script>
<style>
button[disabled]{
opacity: 0.6;
background-color: #0582ba;
}
</style>
<oneit:form name="listUsers" method="post" enctype="multipart/form-data">
<div class="dashboard-content-area second-part">
......@@ -184,13 +208,13 @@
<label><oneit:label GUIName="Role" /></label>
<oneit:ormEnum obj="<%= company %>" attributeName="RoleType" cssClass="form-control"/>
</div>
<div class="invite-btn">
<oneit:recalcClass htmlTag="div" classScript="company.getUserEmail()== null? 'invite-btn disabled': 'invite-btn enabled'" company="<%= company %>">
<oneit:button value="Invite" name="sendUserInvites" cssClass="btn btn-invite"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", currentPage)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry(NotificationUtils.NOTIFICATION_MSG_PARAM, "invitationSent")
.toMap() %>" />
</div>
</oneit:recalcClass>
</div>
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment