removed some hardcoded project class values
This commit is contained in:
parent
75ecb358e2
commit
c7f681cda7
@ -27,6 +27,7 @@ import org.apache.wicket.spring.injection.annot.SpringBean;
|
||||
|
||||
import se.su.dsv.scipro.data.dao.interfaces.ProjectClassDao;
|
||||
import se.su.dsv.scipro.data.dataobjects.Employee;
|
||||
import se.su.dsv.scipro.data.dataobjects.ProjectClass;
|
||||
import se.su.dsv.scipro.dataproviders.QueryableDataProvider;
|
||||
import se.su.dsv.scipro.match.dao.interfaces.KeywordDao;
|
||||
import se.su.dsv.scipro.match.dao.interfaces.KeywordTypeDao;
|
||||
@ -102,14 +103,14 @@ public class AdminManageSupervisorPanel extends Panel {
|
||||
@Override
|
||||
protected void populateItem(final Item<Employee> item) {
|
||||
final Employee supervisor = item.getModelObject();
|
||||
List<Keyword> keywords = supervisor.getKeywords().getFiltered("Unit");
|
||||
List<Keyword> keywords = supervisor.getKeywords().getFiltered(KeywordTypeDao.TYPE.UNIT.toDbName());
|
||||
String unit = "";
|
||||
if (!keywords.isEmpty()) {
|
||||
unit += keywords.get(0).getKeyword();
|
||||
}
|
||||
|
||||
Availability bachelorAvalibality = supervisorDao.getAvailability(supervisor, projectClassDao.getProjectClass("BACHELOR"));
|
||||
Availability masterAvalibality = supervisorDao.getAvailability(supervisor, projectClassDao.getProjectClass("MASTER"));
|
||||
Availability bachelorAvalibality = supervisorDao.getAvailability(supervisor, projectClassDao.getProjectClass(ProjectClass.BACHELOR));
|
||||
Availability masterAvalibality = supervisorDao.getAvailability(supervisor, projectClassDao.getProjectClass(ProjectClass.MASTER));
|
||||
|
||||
item.add(new AdminSupervisorDetailsPanel("supervisor", item.getModel(), feedbackPanel));
|
||||
item.add(new Label("unit", new Model<String>(unit)));
|
||||
@ -117,14 +118,14 @@ public class AdminManageSupervisorPanel extends Panel {
|
||||
item.add(createDropDown(new Model<Availability>(masterAvalibality), "numCapable", "targetMaster"));
|
||||
|
||||
item.add(new Label("currentBachelor", new Model<Integer>((bachelorAvalibality.getNumMatched().intValue()))));
|
||||
if (supervisor.getCountFromDate(projectClassDao.getProjectClass("BACHELOR")) != null) {
|
||||
if (supervisor.getCountFromDate(projectClassDao.getProjectClass(ProjectClass.BACHELOR)) != null) {
|
||||
item.add(new DateFormatter(DateFormatter.FORMAT.EXTENDED).createFormattedDateLabel("bachelorDate", supervisor.getCountFromDate(projectClassDao.getProjectClass("BACHELOR"))));
|
||||
} else {
|
||||
item.add(new Label("bachelorDate", "no date"));
|
||||
}
|
||||
|
||||
item.add(new Label("currentMaster", new Model<Integer>(masterAvalibality.getNumMatched().intValue())));
|
||||
if (supervisor.getCountFromDate(projectClassDao.getProjectClass("MASTER")) != null) {
|
||||
if (supervisor.getCountFromDate(projectClassDao.getProjectClass(ProjectClass.MASTER)) != null) {
|
||||
item.add(new DateFormatter(DateFormatter.FORMAT.EXTENDED).createFormattedDateLabel("masterDate", supervisor.getCountFromDate(projectClassDao.getProjectClass("MASTER"))));
|
||||
} else {
|
||||
item.add(new Label("masterDate", "no date"));
|
||||
@ -241,7 +242,7 @@ public class AdminManageSupervisorPanel extends Panel {
|
||||
AjaxLink resetAllBachelor = new AjaxLink("resetAllBachelorButton"){
|
||||
@Override
|
||||
public void onClick(AjaxRequestTarget target) {
|
||||
supervisorDao.resetCountFromDate(projectClassDao.getProjectClass("BACHELOR"));
|
||||
supervisorDao.resetCountFromDate(projectClassDao.getProjectClass(ProjectClass.BACHELOR));
|
||||
target.addComponent(container);
|
||||
}
|
||||
};
|
||||
@ -253,7 +254,7 @@ public class AdminManageSupervisorPanel extends Panel {
|
||||
AjaxLink resetAllMaster = new AjaxLink("resetAllMasterButton"){
|
||||
@Override
|
||||
public void onClick(AjaxRequestTarget target) {
|
||||
supervisorDao.resetCountFromDate(projectClassDao.getProjectClass("MASTER"));
|
||||
supervisorDao.resetCountFromDate(projectClassDao.getProjectClass(ProjectClass.MASTER));
|
||||
target.addComponent(container);
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user