示例#1
0
文件: Help.java 项目: arago/rike
  @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;
  }
示例#2
0
文件: OrderBy.java 项目: viteke/rike
  @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));
    }
  }