@Override
  public int doAction(final BwRequest request, final BwActionFormBase form) throws Throwable {
    final Client cl = request.getClient();

    cl.setViewMode(Client.gridViewMode);

    gotoDateView(request, request.getDate(), request.getViewType());

    return forwardSuccess;
  }
  @Override
  public int doAction(final BwRequest request, final BwActionFormBase form) throws Throwable {
    if (form.getGuest()) {
      return forwardNoAccess; // First line of defense
    }

    final BwCalendar cal = request.getCalendar(true);
    if (cal == null) {
      return forwardNotFound;
    }

    final String path = cal.getPath();

    if ((cal.getCalType() != BwCalendar.calTypeAlias) && !cal.getCollectionInfo().childrenAllowed) {
      // Ignore - we have no open close state for these
      return forwardSuccess;
    }

    final boolean open = request.getBooleanReqPar("open", true);

    Set<String> cos = form.getCalendarsOpenState();
    if ((cos == null) && !open) {
      return forwardSuccess;
    }

    if (cos == null) {
      cos = new HashSet<>();
      form.setCalendarsOpenState(cos);
    }

    if (open) {
      if (!cos.contains(path)) {
        cos.add(path);
      }
    } else if (cos.contains(path)) {
      cos.remove(path);
    }

    request.getSess().embedCollections(request);
    request.getSess().embedUserCollections(request);
    request.getSess().embedCategories(request, false, BwSession.ownersEntity);

    return forwardSuccess;
  }