final PageParameters parameters = new PageParameters();
parameters.add(TimesheetListPage.PARAMETER_KEY_STORE_FILTER, false);
parameters.add(TimesheetListPage.PARAMETER_KEY_START_TIME, filter.getStartTime().getTime());
parameters.add(TimesheetListPage.PARAMETER_KEY_STOP_TIME, filter.getStopTime().getTime());
parameters.add(TimesheetListPage.PARAMETER_KEY_USER_ID, userData.getUserId());
final TimesheetListPage timesheetListPage = new TimesheetListPage(parameters);
setResponsePage(timesheetListPage);
}
});
item.add(AttributeModifier.append("style", new Model<String>("text-align: right;")));
cellItemListener.populateItem(item, componentId, rowModel);
}
});
columns.add(new CellItemListenerPropertyColumn<HRViewUserData>(getString("rest"), "plannedDaysRestSum", "plannedDaysRestSum",
cellItemListener) {
@Override
public void populateItem(final Item<ICellPopulator<HRViewUserData>> item, final String componentId,
final IModel<HRViewUserData> rowModel)
{
final HRViewUserData userData = rowModel.getObject();
addLabel(item, componentId, userData.getPlannedDaysRestSum(), userData.getActualDaysRestSum());
item.add(AttributeModifier.append("style", new Model<String>("text-align: right;")));
cellItemListener.populateItem(item, componentId, rowModel);
}
});
for (final ProjektDO project : getHRViewData().getProjects()) {
columns.add(new CellItemListenerPropertyColumn<HRViewUserData>(project.getProjektIdentifierDisplayName(), null, null,
cellItemListener) {
@Override
public void populateItem(final Item<ICellPopulator<HRViewUserData>> item, final String componentId,
final IModel<HRViewUserData> rowModel)
{
cellItemListener.populateItem(item, componentId, rowModel);
final HRViewUserData userData = rowModel.getObject();
final HRViewUserEntryData entry = userData.getEntry(project);
if (entry == null) {
item.add(createInvisibleDummyComponent(componentId));
return;
}
final HRFilter filter = form.getSearchFilter();
addListEntry(item, componentId, entry.getPlannedDays(), entry.getActualDays(), new Link<Object>("actualDaysLink") {
@Override
public void onClick()
{
// Redirect to time sheet list page and show the corresponding time sheets.
final PageParameters parameters = new PageParameters();
parameters.add(TimesheetListPage.PARAMETER_KEY_STORE_FILTER, false);
parameters.add(TimesheetListPage.PARAMETER_KEY_TASK_ID, project.getTaskId());
parameters.add(TimesheetListPage.PARAMETER_KEY_START_TIME, filter.getStartTime().getTime());
parameters.add(TimesheetListPage.PARAMETER_KEY_STOP_TIME, filter.getStopTime().getTime());
parameters.add(TimesheetListPage.PARAMETER_KEY_USER_ID, userData.getUserId());
final TimesheetListPage timesheetListPage = new TimesheetListPage(parameters);
setResponsePage(timesheetListPage);
}
});
item.add(AttributeModifier.append("style", new Model<String>("text-align: right;")));
}