@Override protected boolean checkViewData(IDataWrapper data) { if (!SecurityHelper.isLoggedIn(data.getUser())) { return false; } if (data.getSessionAttribute("help.shown") == null) { data.setSessionAttribute("help.shown", "false"); String user = SecurityHelper.getUserEmail(data.getUser()); if (user != null && !user.isEmpty()) { TaskUser tu = TaskHelper.checkIfUserExists(user); if (tu != null && "true".equals(tu.getFlagsAsMap().get("DisableOverlay"))) { data.setSessionAttribute("help.shown", "true"); } } } return true; }
@Override public void execute(IDataWrapper data) throws Exception { TaskListFilter filter = (TaskListFilter) data.getSessionAttribute("taskListFilter"); if (filter != null) { String field = data.getRequestAttribute("field"); if (filter.getSortField().toString().equalsIgnoreCase(field)) { if (filter.getSortDirection() == TaskListFilter.SortDirection.ASC) { filter.setSortDirection(TaskListFilter.SortDirection.DESC); } else { filter.setSortDirection(TaskListFilter.SortDirection.ASC); } } else { filter.setSortDirection(TaskListFilter.SortDirection.ASC); } filter.setSortField(field); data.setSessionAttribute("list", TaskHelper.getAllTasks(filter)); } }