Package org.projectforge.fibu

Examples of org.projectforge.fibu.EmployeeDO


  }

  public EmployeeDO getEmployee(final Integer userId)
  {
    checkRefresh();
    EmployeeDO employee = this.employeeMap.get(userId);
    if (employee == null) {
      @SuppressWarnings("unchecked")
      final List<EmployeeDO> list = this.hibernateTemplate.find("from EmployeeDO e where e.user.id = ?", userId);
      if (list != null && list.size() > 0) {
        employee = list.get(0);
View Full Code Here


  {
    super(parameters);
    final Label timesheetDisciplineChartTitle = new Label("timesheetDisciplineChartTitle",
        getString("personal.statistics.timesheetDisciplineChart.title"));
    body.add(timesheetDisciplineChartTitle);
    final EmployeeDO employee = employeeDao.getByUserId(PFUserContext.getUserId());
    double workingHoursPerDay = 8;
    if (employee != null && NumberHelper.isGreaterZero(employee.getWeeklyWorkingHours()) == true) {
      workingHoursPerDay = employee.getWeeklyWorkingHours().doubleValue() / 5;
    }
    final TimesheetDisciplineChartBuilder chartBuilder = new TimesheetDisciplineChartBuilder();
    final JFreeChart chart1 = chartBuilder.create(timesheetDao, getUser().getId(), workingHoursPerDay, LAST_N_DAYS, true);
    JFreeChartImage image = new JFreeChartImage("timesheetStatisticsImage1", chart1, IMAGE_WIDTH, IMAGE_HEIGHT);
    image.add(AttributeModifier.replace("width", String.valueOf(IMAGE_WIDTH)));
View Full Code Here

      }

      @Override
      protected String getTooltip()
      {
        final EmployeeDO employee = getModel().getObject();
        if (employee == null) {
          return null;
        }
        return KostFormatter.format(employee.getKost1()) + ": " + employee.getUser().getFullname();
      }

      @Override
      protected void convertInput()
      {
        final EmployeeDO employee = (EmployeeDO) getConverter(getType()).convertToObject(getInput(), getLocale());
        setConvertedInput(employee);
        if (employee != null && (currentEmployee == null || employee.getId() != currentEmployee.getId())) {
          getRecentEmployees().append(formatEmployee(employee));
        }
        currentEmployee = employee;
      }

      @SuppressWarnings({ "rawtypes", "unchecked"})
      @Override
      public IConverter getConverter(final Class type)
      {
        return new IConverter() {
          @Override
          public Object convertToObject(final String value, final Locale locale)
          {
            if (StringUtils.isEmpty(value) == true) {
              getModel().setObject(null);
              return null;
            }
            final int ind = value.indexOf(": ");
            final String username = ind >= 0 ? value.substring(0, ind) : value;
            final PFUserDO user = userGroupCache.getUser(username);
            if (user == null) {
              error(getString("fibu.employee.panel.error.employeeNotFound"));
              return null;
            }
            final EmployeeDO employee = employeeDao.getByUserId(user.getId());
            if (employee == null) {
              error(getString("fibu.employee.panel.error.employeeNotFound"));
              return null;
            }
            getModel().setObject(employee);
            return employee;
          }

          @Override
          public String convertToString(final Object value, final Locale locale)
          {
            if (value == null) {
              return "";
            }
            final EmployeeDO employee = (EmployeeDO) value;
            return employee.getUser().getUsername() + ": " + employee.getUser().getFullname();
          }
        };
      }
    };
    currentEmployee = getModelObject();
View Full Code Here

      return "";
    }
    if (hasLoggedInUserSelectAccess(kost1, false) == true) {
      return KostFormatter.format(kost1);
    } else {
      final EmployeeDO employee = userGroupCache.getEmployee(PFUserContext.getUserId());
      if (employee != null && employee.getKost1Id() != null && employee.getKost1Id().compareTo(id) == 0) {
        kost1.setDescription(""); // Paranoia (if KostFormatter shows description in future times and Kost1DO is not visible for the user).
        return KostFormatter.format(kost1);
      }
    }
    return null;
View Full Code Here

    } else if (value instanceof KundeDO) {
      return KundeFormatter.formatKundeAsString((KundeDO) value, null);
    } else if (value instanceof ProjektDO) {
      return ProjektFormatter.formatProjektKundeAsString((ProjektDO) value, null, null);
    } else if (value instanceof EmployeeDO) {
      final EmployeeDO employee = (EmployeeDO) value;
      return employee.getUser() != null ? employee.getUser().getFullname() : "???";
    }
    return null;
  }
View Full Code Here

    final List<IColumn<EmployeeDO, String>> columns = new ArrayList<IColumn<EmployeeDO, String>>();

    final CellItemListener<EmployeeDO> cellItemListener = new CellItemListener<EmployeeDO>() {
      public void populateItem(final Item<ICellPopulator<EmployeeDO>> item, final String componentId, final IModel<EmployeeDO> rowModel)
      {
        final EmployeeDO employee = rowModel.getObject();
        appendCssClasses(item, employee.getId(), employee.isDeleted());
      }
    };
    columns.add(new CellItemListenerPropertyColumn<EmployeeDO>(new ResourceModel("name"), getSortable("user.lastname", sortable),
        "user.lastname", cellItemListener) {
      /**
       * @see org.projectforge.web.wicket.CellItemListenerPropertyColumn#populateItem(org.apache.wicket.markup.repeater.Item,
       *      java.lang.String, org.apache.wicket.model.IModel)
       */
      @Override
      public void populateItem(final Item<ICellPopulator<EmployeeDO>> item, final String componentId, final IModel<EmployeeDO> rowModel)
      {
        final EmployeeDO employee = rowModel.getObject();
        final PFUserDO user = employee != null ? employee.getUser() : null;
        final String lastname = user != null ? user.getLastname() : null;
        if (isSelectMode() == false) {
          item.add(new ListSelectActionPanel(componentId, rowModel, EmployeeEditPage.class, employee.getId(), returnToPage, lastname));
        } else {
          item.add(new ListSelectActionPanel(componentId, rowModel, caller, selectProperty, employee.getId(), lastname));
        }
        cellItemListener.populateItem(item, componentId, rowModel);
        addRowClick(item);
      }
    });
    columns.add(new CellItemListenerPropertyColumn<EmployeeDO>(new ResourceModel("firstName"), getSortable("user.firstname", sortable),
        "user.firstname", cellItemListener));
    columns.add(new CellItemListenerPropertyColumn<EmployeeDO>(EmployeeDO.class, getSortable("status", sortable), "status",
        cellItemListener));
    columns.add(new CellItemListenerPropertyColumn<EmployeeDO>(new ResourceModel("fibu.kost1"), getSortable("kost1.shortDisplayName",
        sortable), "kost1.shortDisplayName", cellItemListener));
    columns.add(new CellItemListenerPropertyColumn<EmployeeDO>(EmployeeDO.class, getSortable("position", sortable), "position",
        cellItemListener));
    columns.add(new CellItemListenerPropertyColumn<EmployeeDO>(EmployeeDO.class, getSortable("abteilung", sortable), "abteilung",
        cellItemListener));
    columns.add(new CellItemListenerPropertyColumn<EmployeeDO>(EmployeeDO.class, getSortable("eintrittsDatum", sortable), "eintrittsDatum",
        cellItemListener) {
      @Override
      public void populateItem(final Item<ICellPopulator<EmployeeDO>> item, final String componentId, final IModel<EmployeeDO> rowModel)
      {
        final EmployeeDO employee = rowModel.getObject();
        item.add(new Label(componentId, DateTimeFormatter.instance().getFormattedDate(employee.getEintrittsDatum())));
      }
    });
    columns.add(new CellItemListenerPropertyColumn<EmployeeDO>(EmployeeDO.class, getSortable("austrittsDatum", sortable), "austrittsDatum",
        cellItemListener) {
      @Override
      public void populateItem(final Item<ICellPopulator<EmployeeDO>> item, final String componentId, final IModel<EmployeeDO> rowModel)
      {
        final EmployeeDO employee = rowModel.getObject();
        item.add(new Label(componentId, DateTimeFormatter.instance().getFormattedDate(employee.getAustrittsDatum())));
      }
    });
    columns.add(new CellItemListenerPropertyColumn<EmployeeDO>(EmployeeDO.class, getSortable("comment", sortable), "comment",
        cellItemListener));
    return columns;
View Full Code Here

TOP

Related Classes of org.projectforge.fibu.EmployeeDO

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.