use of com.autentia.tnt.businessobject.Organization in project TNTConcept by autentia.
the class OccupationBean method getOrganizations.
/**
* Get the list of all organizations
* @return the list of all organizations
*/
public List<SelectItem> getOrganizations() {
ArrayList<SelectItem> ret = new ArrayList<SelectItem>();
List<Organization> refs = organizationDAO.search(new SortCriteria("name"));
for (Organization ref : refs) {
ret.add(new SelectItem(ref, ref.getName()));
}
return ret;
}
use of com.autentia.tnt.businessobject.Organization in project TNTConcept by autentia.
the class ActivityBean method getProjectsVisiblesBySelectedOrganization.
/**
* Get the list of all projects
*
* @return the list of all projects
*/
public List<SelectItem> getProjectsVisiblesBySelectedOrganization() {
Organization companySelected = this.getSelectedOrganization();
List<Project> openProjects = ProjectManager.getDefault().getOpenProjectsByOrganization(companySelected);
ArrayList<SelectItem> ret = new ArrayList<SelectItem>();
if (selectedProject != null && selectedProject.isFinished()) {
ret.add(new SelectItem(selectedProject, selectedProject.getName() + " (*)"));
}
if (openProjects == null || openProjects.size() == 0) {
projects.clear();
return ret;
}
Project proj = null;
for (Object ref : openProjects) {
proj = (Project) ref;
projects.add(proj);
if (!proj.isFinished() && !proj.getRoles().isEmpty()) {
ret.add(new SelectItem(proj, proj.getName()));
}
}
return ret;
}
use of com.autentia.tnt.businessobject.Organization in project TNTConcept by autentia.
the class ActivityBean method getOrganizations.
/**
* @return Organizaciones con proyectos abiertos que ademas tengan ROLES creados
*/
public List<SelectItem> getOrganizations() {
ArrayList<SelectItem> ret = new ArrayList<SelectItem>(32);
List<Project> projects = projectManager.getDefault().getOpenProjects(new SortCriteria("name"));
HashMap<Integer, Organization> companies = new HashMap<Integer, Organization>(32);
if (!CollectionUtils.isEmpty(projects)) {
for (Project project : projects) {
if ((!project.isFinished()) && (project.getOpen())) {
Set<ProjectRole> roles = project.getRoles();
if (!CollectionUtils.isEmpty(roles)) {
Organization company = project.getClient();
if (!companies.containsKey(company.getId())) {
companies.put(company.getId(), company);
ret.add(new SelectItem(company, company.getName()));
}
}
}
}
}
Collections.sort(ret, new OperacionesComparator());
if ((this.selectedOrganization == null) && (ret.size() > 0)) {
this.setSelectedOrganization((Organization) ret.get(0).getValue());
}
return ret;
}
use of com.autentia.tnt.businessobject.Organization in project TNTConcept by autentia.
the class PeriodicalAccountEntryBean method getOrganizations.
/**
* Get the list of all organizations
* @return the list of all organizations
*/
public List<SelectItem> getOrganizations() {
ArrayList<SelectItem> ret = new ArrayList<SelectItem>();
List<Organization> refs = OrganizationManager.getDefault().getAllEntities(null, new SortCriteria("name"));
ret.add(new SelectItem(null, FacesUtils.formatMessage("organization.unknown")));
for (Organization ref : refs) {
ret.add(new SelectItem(ref, ref.getName()));
}
return ret;
}
use of com.autentia.tnt.businessobject.Organization in project TNTConcept by autentia.
the class CreditTitleBean method getOrganizations.
// Getters to list possible values of related entities
/**
* Get the list of all organizations
* @return the list of all organizations
*/
public List<SelectItem> getOrganizations() {
ArrayList<SelectItem> ret = new ArrayList<SelectItem>();
List<Organization> refs = OrganizationManager.getDefault().getAllEntities(null, new SortCriteria("name"));
for (Organization ref : refs) {
ret.add(new SelectItem(ref, ref.getName()));
}
return ret;
}
Aggregations