Package org.projectforge.task

Examples of org.projectforge.task.TaskNode


  public String getTaskPath(Integer taskId, final Integer ancestorTaskId, final boolean showCurrentTask, final OutputType outputType)
  {
    if (taskId == null) {
      return null;
    }
    TaskNode n = taskTree.getTaskNodeById(taskId);
    if (n == null) {
      return null;
    }
    if (showCurrentTask == false) {
      n = n.getParent();
      if (n == null) {
        return null;
      }
      taskId = n.getTaskId();
    }
    final List<TaskNode> list = taskTree.getPath(taskId, ancestorTaskId);
    if (CollectionUtils.isEmpty(list) == true) {
      return "";
    }
View Full Code Here


    return super.getNodeList(filter);
  }

  protected void addDescendantNodes(TaskTreeTableNode parent)
  {
    TaskNode task = parent.getTaskNode();
    if (task.getChilds() != null) {
      for (TaskNode node : task.getChilds()) {
        if (taskTree.hasSelectAccess(node) == true) {
          // The logged in user has select access, so add this task node
          // to this tree table:
          TaskTreeTableNode child = new TaskTreeTableNode(parent, node);
          addTreeTableNode(child);
View Full Code Here

        }
        if (cost2Exists == true) {
          if (cost2Choice != null && cost2Choice.getConvertedInput() == null) {
            // cost2Choice is always != null (but may-be invisible) if cost2 entries does exist in the system.
            // Kost2 is not available for current task.
            final TaskNode taskNode = taskTree.getTaskNodeById(data.getTaskId());
            if (taskNode != null) {
              final List<Integer> descendents = taskNode.getDescendantIds();
              for (final Integer taskId : descendents) {
                if (CollectionUtils.isNotEmpty(taskTree.getKost2List(taskId)) == true) {
                  // But Kost2 is available for sub task, so user should book his time sheet
                  // on a sub task with kost2s.
                  if (cost2Choice.isVisible()) {
View Full Code Here

  }

  protected ConsumptionBarPanel getConsumptionBar()
  {
    final Integer taskId = data.getTaskId();
    TaskNode node = taskId != null ? taskTree.getTaskNodeById(taskId) : null;
    if (node != null) {
      final TaskNode personDaysNode = taskTree.getPersonDaysNode(node);
      if (personDaysNode != null) {
        node = personDaysNode;
      }
    }
    consumptionBarPanel = TaskListPage.getConsumptionBarPanel(this.parentPage, consumptionBarId, taskTree, false, node);
View Full Code Here

    mapping.add(PosCol.COMPLETELY_INVOICED, pos.isVollstaendigFakturiert() == true ? "x" : "");
    final Set<RechnungsPositionVO> invoicePositions = rechnungCache.getRechnungsPositionVOSetByAuftragsPositionId(pos.getId());
    mapping.add(PosCol.INVOICES, getInvoices(invoicePositions));
    mapping.add(PosCol.PERIOD_OF_PERFORMANCE_BEGIN, pos.getPeriodOfPerformanceBegin());
    mapping.add(PosCol.PERIOD_OF_PERFORMANCE_END, pos.getPeriodOfPerformanceEnd());
    final TaskNode node = taskTree.getTaskNodeById(pos.getTaskId());
    mapping.add(PosCol.TASK, node != null ? node.getTask().getTitle() : "");
    mapping.add(PosCol.COMMENT, pos.getBemerkung());
  }
View Full Code Here

    }
    final QueryFilter queryFilter = new QueryFilter(myFilter);
    if (myFilter.getTaskId() != null) {
      List<Integer> descendants = null;
      List<Integer> ancestors = null;
      final TaskNode node = taskTree.getTaskNodeById(myFilter.getTaskId());
      if (myFilter.isIncludeDescendentTasks() == true) {
        descendants = node.getDescendantIds();
      }
      if (myFilter.isInherit() == true || myFilter.isIncludeAncestorTasks() == true) {
        ancestors = node.getAncestorIds();
      }
      if (descendants != null || ancestors != null) {
        final List<Integer> taskIds = new ArrayList<Integer>();
        if (descendants != null) {
          taskIds.addAll(descendants);
        }
        if (ancestors != null) {
          taskIds.addAll(ancestors);
        }
        taskIds.add(node.getId());
        queryFilter.add(Restrictions.in("task.id", taskIds));
      } else {
        queryFilter.add(Restrictions.eq("task.id", myFilter.getTaskId()));
      }
    }
    if (myFilter.getGroupId() != null) {
      final GroupDO group = new GroupDO();
      group.setId(myFilter.getGroupId());
      queryFilter.add(Restrictions.eq("group", group));
    }
    final List<GroupTaskAccessDO> qlist = getList(queryFilter);
    List<GroupTaskAccessDO> list;
    if (myFilter.getTaskId() != null && myFilter.isInherit() == true && myFilter.isIncludeAncestorTasks() == false) {
      // Now we have to remove all inherited entries of ancestor nodes which are not declared as recursive.
      list = new ArrayList<GroupTaskAccessDO>();
      final TaskNode taskNode = taskTree.getTaskNodeById(myFilter.getTaskId());
      if (taskNode == null) { // Paranoia
        list = qlist;
      } else {
        for (final GroupTaskAccessDO access : qlist) {
          if (access.isRecursive() == false) {
            final TaskNode accessNode = taskTree.getTaskNodeById(access.getTaskId());
            // && myFilter.getTaskId().equals(access.getTaskId()) == false) {
            if (accessNode.isParentOf(taskNode) == true) {
              // This entry is not recursive and inherited, therefore this entry will be ignored.
              continue;
            }
          }
          list.add(access);
View Full Code Here

    final TaskObject task = TaskDOConverter.getTaskObject(taskDO);
    if (taskDO == null) {
      log.error("Oups, task is null.");
      return task;
    }
    final TaskNode taskNode = taskDao.getTaskTree().getTaskNodeById(taskDO.getId());
    if (taskNode == null) {
      log.error("Oups, task node with id '" + taskDO.getId() + "' not found in taskTree.");
      return task;
    }
    task.setBookableForTimesheets(taskNode.isBookableForTimesheets());
    return task;
  }
View Full Code Here

    final TaskObject task = TaskDOConverter.getTaskObject(taskDO);
    if (taskDO == null) {
      log.error("Oups, task is null.");
      return task;
    }
    final TaskNode taskNode = taskDao.getTaskTree().getTaskNodeById(taskDO.getId());
    if (taskNode == null) {
      log.error("Oups, task node with id '" + taskDO.getId() + "' not found in taskTree.");
      return task;
    }
    task.setBookableForTimesheets(taskNode.isBookableForTimesheets());
    return task;
  }
View Full Code Here

  {
    if (actionRequired() == false) {
      log.info("create: Nothing to do.");
      return;
    }
    final TaskNode taskNode = taskDao.getTaskTree().getTaskNodeById(form.task.getId());
    createAccessRights(taskNode, form.managerGroup, true, true);
    createAccessRights(taskNode, form.team, false, true);
    setResponsePage(TaskTreePage.class);
  }
View Full Code Here

      }
      if (col.size() > 0) {
        queryFilter.add(Restrictions.in("status", col));
      }
      if (myFilter.getTaskId() != null) {
        final TaskNode node = taskTree.getTaskNodeById(myFilter.getTaskId());
        final List<Integer> taskIds = node.getDescendantIds();
        taskIds.add(node.getId());
        queryFilter.add(Restrictions.in("task.id", taskIds));
      }
      if (myFilter.getAssigneeId() != null) {
        final PFUserDO assignee = new PFUserDO();
        assignee.setId(myFilter.getAssigneeId());
View Full Code Here

TOP

Related Classes of org.projectforge.task.TaskNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.