Package org.projectforge.fibu

Examples of org.projectforge.fibu.ProjektDO


        final PFUserDO user = userGroupCache.getUser(sheet.getUserId());
        if (user == null) {
          log.error("Oups, user of time sheet is null or unknown? Ignoring entry: " + sheet);
          continue;
        }
        final ProjektDO projekt = taskTree.getProjekt(sheet.getTaskId());
        final Object targetObject = getTargetObject(filter, projekt);
        if (targetObject == null) {
          data.addTimesheet(sheet, user);
        } else if (targetObject instanceof ProjektDO) {
          data.addTimesheet(sheet, user, (ProjektDO) targetObject);
        } else if (targetObject instanceof KundeDO) {
          data.addTimesheet(sheet, user, (KundeDO) targetObject);
        } else {
          log.error("Target object of type " + targetObject + " not supported.");
          data.addTimesheet(sheet, user);
        }
      }
    }
    if (filter.isShowPlanning() == true) {
      final HRPlanningFilter hrFilter = new HRPlanningFilter();
      final DateHolder date = new DateHolder(filter.getStartTime());
      hrFilter.setStartTime(date.getSQLDate()); // Considers the user's time zone.
      date.setDate(filter.getStopTime());
      hrFilter.setStopTime(date.getSQLDate()); // Considers the user's time zone.
      final List<HRPlanningDO> plannings = hrPlanningDao.getList(hrFilter);
      for (final HRPlanningDO planning : plannings) {
        if (planning.getEntries() == null) {
          continue;
        }
        for (final HRPlanningEntryDO entry : planning.getEntries()) {
          if (entry.isDeleted() == true) {
            continue;
          }
          final PFUserDO user = userGroupCache.getUser(planning.getUserId());
          final ProjektDO projekt = entry.getProjekt();
          final Object targetObject = getTargetObject(filter, projekt);
          if (targetObject == null) {
            data.addHRPlanningEntry(entry, user);
          } else if (targetObject instanceof ProjektDO) {
            data.addHRPlanningEntry(entry, user, (ProjektDO) targetObject);
View Full Code Here


    if (node == null) {
      return null;
    }
    final TaskDO task = node.getTask();
    final String[] blackWhiteList = task.getKost2BlackWhiteItems();
    final ProjektDO projekt = node.getProjekt(blackWhiteList != null); // If black-white-list is null then do not search for projekt of
    // ancestor tasks.
    final List<Kost2DO> list = getKost2List(projekt, task, blackWhiteList, task.isKost2IsBlackList());
    if (list != null) {
      return list;
    } else if (node.parent != null && recursive == true) {
View Full Code Here

      if (access == GanttAccess.ALL) {
        // User has task access:
        return true;
      }
      final TaskTree taskTree = UserRights.getAccessChecker().getTaskTree();
      final ProjektDO project = taskTree.getProjekt(obj.getTaskId());
      if (project == null) {
        // Project manager group not found:
        return UserRights.getAccessChecker().isUserMemberOfGroup(user, ProjectForgeGroup.PROJECT_MANAGER);
      }
      // Users of the project manager group have access:
      return UserRights.getAccessChecker().getUserGroupCache().isUserMemberOfGroup(user, project.getProjektManagerGroupId());
    } else {
      log.error("Unsupported GanttAccess type: " + access);
    }
    return false;
View Full Code Here

   * @param taskId
   * @return
   */
  public ProjektDO getProjekt(final Integer taskId)
  {
    final ProjektDO projekt = __baseDao.getProjekt(taskId);
    if (projekt == null) {
      return null;
    }
    final ProjektDO result = new ProjektDO();
    result.copyValuesFrom(projekt);
    return result;
  }
View Full Code Here

      buf.append(task.getKost2BlackWhiteList()).append(",");
    }
    if (task.getId() == null && task.getParentTaskId() != null) {
      buf.append(kost.getFormattedNumber());
    } else {
      final ProjektDO projekt = task.getId() != null ? taskTree.getProjekt(task.getId()) : taskTree.getProjekt(task.getParentTaskId());
      if (projekt == null) {
        buf.append(kost.getFormattedNumber());
      } else {
        final String projektKost2 = projekt.getKost();
        final String kost2 = kost.getFormattedNumber();
        if (kost2.startsWith(projektKost2) == false) {
          buf.append(kost.getFormattedNumber());
        } else {
          buf.append(StringHelper.format2DigitNumber(kost.getKost2ArtId()));
View Full Code Here

   * @param sheet
   * @param projektId If null, then projekt will be set to null;
   */
  public void setProjekt(final HRPlanningEntryDO sheet, final Integer projektId)
  {
    final ProjektDO projekt = projektDao.getOrLoad(projektId);
    sheet.setProjekt(projekt);
  }
View Full Code Here

    for (final HRPlanningEntryDO entry : list) {
      if (myFilter.isOnlyMyProjects() == true) {
        if (entry.getProjekt() == null) {
          continue;
        }
        final ProjektDO projekt = entry.getProjekt();
        if (projekt.getProjektManagerGroup() == null) {
          continue;
        }
        if (userGroupCache.isLoggedInUserMemberOfGroup(projekt.getProjektManagerGroupId()) == false) {
          continue;
        }
      }
      if (myFilter.isGroupEntries() == true) {
        if (set.contains(entry.getPlanningId()) == true) {
View Full Code Here

   * @param sheet
   * @param projektId If null, then projekt will be set to null;
   */
  public void setProjekt(final HRPlanningEntryDO sheet, final Integer projektId)
  {
    final ProjektDO projekt = projektDao.getOrLoad(projektId);
    sheet.setProjekt(projekt);
  }
View Full Code Here

    }
    if (obj == null) {
      return false;
    }
    final Integer taskId = obj.getId() != null ? obj.getId() : obj.getParentTaskId();
    final ProjektDO projekt = taskTree.getProjekt(taskId);
    // Parent task because id of current task is null and project can't be found.
    if (projekt != null && userGroupCache.isUserProjectManagerOrAssistantForProject(projekt) == true) {
      return true;
    }
    return false;
View Full Code Here

        for (int i = 0; i < getDependentFormComponents().length - 1; i += 2) {
          @SuppressWarnings("unchecked")
          final DropDownChoice<HRPlanningEntryStatus> statusChoice = (DropDownChoice<HRPlanningEntryStatus>) dependentEntryFormComponentsArray[i];
          final HRPlanningEntryStatus status = statusChoice.getConvertedInput();
          final NewProjektSelectPanel projektSelectPanel = (NewProjektSelectPanel) dependentEntryFormComponentsArray[i + 1];
          final ProjektDO projekt = projektSelectPanel.getModelObject();
          if (projekt == null && status == null) {
            projektSelectPanel.error(getString("hr.planning.entry.error.statusOrProjektRequired"));
          } else if (projekt != null && status != null) {
            projektSelectPanel.error(getString("hr.planning.entry.error.statusAndProjektNotAllowed"));
          }
View Full Code Here

TOP

Related Classes of org.projectforge.fibu.ProjektDO

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.