Foros de discusión
Getting all users reporting to a manager
Gaurav Sharma, modificado hace 11 años.
Getting all users reporting to a manager
Junior Member Mensajes: 39 Fecha de incorporación: 1/11/12 Mensajes recientes
I've created a tree hierarchy of users by using the "Organization" feature of Liferay CE. So, there is a "Company "org. under which there is a "Sales Team" org. Under that, there is a "Sales Managers" org. There is a user assigned to the "Sales Managers" org. Under the "Sales Managers" org., there is a "Salesmen" org. and that has users assigned as well.
So, to summarize:
Company->Sales->Sales Managers->Salesmen
I'd like to display all "salesmen" when the "Sales Manager" logs in. What would be the best way to do this?
So, to summarize:
Company->Sales->Sales Managers->Salesmen
I'd like to display all "salesmen" when the "Sales Manager" logs in. What would be the best way to do this?
Barrie Selack, modificado hace 11 años.
RE: Getting all users reporting to a manager (Respuesta)
New Member Mensajes: 3 Fecha de incorporación: 11/06/10 Mensajes recientes
UserLocalServiceUtil has a method to return all users in an organization.
/**
* Returns all the users belonging to the organization.
*
* @param organizationId the primary key of the organization
* @return the users belonging to the organization
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.liferay.portal.model.user> getOrganizationUsers(
long organizationId)
throws com.liferay.portal.kernel.exception.SystemException {
return getService().getOrganizationUsers(organizationId);
}
</com.liferay.portal.model.user>
Barrie Selack, modificado hace 11 años.
RE: Getting all users reporting to a manager (Respuesta)
New Member Mensajes: 3 Fecha de incorporación: 11/06/10 Mensajes recientes
If you want to get the organizations under another organization, you can use
in OrganizationLocalServiceUtil
/**
* Returns all the organizations belonging to the parent organization.
*
* @param companyId the primary key of the organization's company
* @param parentOrganizationId the primary key of the organization's parent
organization
* @return the organizations belonging to the parent organization
* @throws SystemException if a system exception occurred
*/
public static java.util.List<com.liferay.portal.model.organization> getOrganizations(
long companyId, long parentOrganizationId)
throws com.liferay.portal.kernel.exception.SystemException {
return getService().getOrganizations(companyId, parentOrganizationId);
}
</com.liferay.portal.model.organization>
in OrganizationLocalServiceUtil