Administrators currently associated to <%= theFarm.getName() %>:
<%
String orderByCol = ParamUtil.getString(request, "orderByCol");
String orderByType = ParamUtil.getString(request, "orderByType");
String sortingOrder = orderByType;
//Logic for toggle asc and desc
if (orderByType.equals("desc"))
orderByType = "asc";
else
orderByType = "desc";
if (Validator.isNull(orderByType)) {
orderByType = "asc";
}
%>
<%
int totalUsers = admins.size();
List sortableUsers = ListUtil.subList(admins, searchContainer.getStart(),
searchContainer.getEnd());
if (Validator.isNotNull(orderByCol)) {
Collections.sort(sortableUsers, new UserComparator());
if (sortingOrder.equalsIgnoreCase("desc"))
Collections.reverse(sortableUsers);
}
pageContext.setAttribute("results", sortableUsers);
pageContext.setAttribute("total", totalUsers);
%>
${item.fullname}${item.email}${item.jobTitle}
Liferay.provide(
window,
'removeAdministratorRoleFromUsers',
function() {
var removeUserIds = Liferay.Util.listCheckedExcept(document.fm, 'allRowIds');
var array = removeUserIds.split(',');
var totalUsers = document.getElementById('totalUsers');
if (array.length == totalUsers.value) {
alert("Forbidden: You are trying removing the role from all the users of the company, at least one must have it.")
return;
}
if (removeUserIds && confirm("Are you sure you want to remove the Administrator role from the selected users?")) {
document.fm.removeUserIds.value = removeUserIds;
submitForm(document.fm, '');
} else {
}
},
['liferay-util-list-fields']
);