use of com.autentia.tnt.manager.admin.UserManager in project TNTConcept by autentia.
the class ObjectiveBean method getFiltrableUsers.
public List<SelectItem> getFiltrableUsers() {
List<User> refs = new ArrayList<User>();
ObjectiveSearch search = new ObjectiveSearch();
List<Objective> objetivos = manager.getAllEntities(search, null);
UserManager userManager = UserManager.getDefault();
UserSearch userSearch = new UserSearch();
userSearch.setActive(true);
int sizeMaxUser = userManager.getAllEntities(userSearch, null).size();
for (Objective obj : objetivos) {
User us = obj.getUser();
if (us.isActive() && !refs.contains(us)) {
refs.add(us);
}
if (refs.size() >= sizeMaxUser)
break;
}
Collections.sort(refs, new UserComparator());
ArrayList<SelectItem> ret = new ArrayList<SelectItem>();
ret.add(new SelectItem(Integer.valueOf(ALL_USERS), "--"));
for (User ref : refs) {
ret.add(new SelectItem(ref.getId(), ref.getName()));
}
return ret;
}
use of com.autentia.tnt.manager.admin.UserManager in project TNTConcept by autentia.
the class OccupationBean method insertOccupation.
/* occupation - generated by stajanov (do not edit/delete) */
public String insertOccupation() {
Integer id = Integer.parseInt(FacesUtils.getRequestParameter(ROW_ID));
occupation = new Occupation();
UserManager userManager = UserManager.getDefault();
User user = userManager.getEntityById(id);
occupation.setUser(user);
return "insertOccupation";
}
use of com.autentia.tnt.manager.admin.UserManager in project TNTConcept by autentia.
the class UserHolidaysStateBean method getAll.
public List<UserHolidaysState> getAll() {
List<UserHolidaysState> ret = new ArrayList<UserHolidaysState>();
if (chargeYear == null)
return ret;
UserManager userManager = UserManager.getDefault();
UserSearch searchUser = new UserSearch();
searchUser.setActive(true);
List<User> users = userManager.getAllEntities(searchUser, new SortCriteria(sortColumn, sortAscending));
for (User us : users) {
ret.add(manager.calculateUserHolidaysState(us, this.getChargeYear()));
}
return ret;
}
Aggregations