Package org.projectforge.calendar

Examples of org.projectforge.calendar.DayHolder


  private void setExpectedTimeOfPayment(final LiquidityEntry entry, final RechnungDO invoice)
  {
    Date dateOfInvoice = invoice.getDatum();
    if (dateOfInvoice == null) {
      dateOfInvoice = new DayHolder().getSQLDate();
    }
    final ProjektDO project = invoice.getProjekt();
    if (project != null
        && setExpectedDateOfPayment(entry, dateOfInvoice, "project#" + project.getId(),
            ProjektFormatter.formatProjektKundeAsString(project, null, null)) == true) {
View Full Code Here


  {
    if (list == null) {
      return this;
    }
    for (final EingangsrechnungDO invoice : list) {
      final DayHolder date = new DayHolder(invoice.getDatum());
      final DayHolder dateOfPayment = new DayHolder(invoice.getBezahlDatum());
      if (date == null || dateOfPayment == null) {
        continue;
      }
      final int timeForPayment = date.daysBetween(dateOfPayment);
      final int amount = invoice.getGrossSum().intValue();
View Full Code Here

  private void setExpectedTimeOfPayment(final LiquidityEntry entry, final EingangsrechnungDO invoice)
  {
    Date dateOfInvoice = invoice.getDatum();
    if (dateOfInvoice == null) {
      dateOfInvoice = new DayHolder().getSQLDate();
    }
    final KontoDO account = invoice.getKonto();
    if (account != null
        && setExpectedDateOfCreditorPayment(entry, dateOfInvoice, "account#" + account.getId(),
            "" + account.getNummer() + " - " + account.getBezeichnung()) == true) {
View Full Code Here

    values.add(timeForPayment, amount);
  }

  private Date getDate(final Date date, final int timeOfPayment)
  {
    final DayHolder day = new DayHolder(date);
    day.add(Calendar.DAY_OF_YEAR, timeOfPayment);
    return day.getSQLDate();
  }
View Full Code Here

        events.add(vEvent);
      }
    }
    final String weeksOfYear = params.get(PARAM_NAME_WEEK_OF_YEARS);
    if ("true".equals(weeksOfYear) == true) {
      final DayHolder from = new DayHolder();
      from.setBeginOfYear().add(java.util.Calendar.YEAR, -2).setBeginOfWeek();
      final DayHolder to = new DayHolder(from);
      to.add(java.util.Calendar.YEAR, 6);
      final DayHolder current = new DayHolder(from);
      int paranoiaCounter = 0;
      do {
        final VEvent vEvent = ICal4JUtils.createVEvent(current.getDate(), current.getDate(), "pf-weekOfYear"
            + current.getYear()
            + "-"
            + paranoiaCounter, PFUserContext.getLocalizedString("calendar.weekOfYearShortLabel") + " " + current.getWeekOfYear(), true);
        events.add(vEvent);
        current.add(java.util.Calendar.WEEK_OF_YEAR, 1);
        if (++paranoiaCounter > 500) {
          log.warn("Dear developer, please have a look here, paranoiaCounter exceeded! Aborting calculation of weeks of year.");
        }
      } while (current.before(to) == true);
    }
    // Integer hrPlanningUserId = NumberHelper.parseInteger(params.get(PARAM_NAME_HR_PLANNING));
    // if (hrPlanningUserId != null) {
    // if (loggedInUser.getId().equals(hrPlanningUserId) == false && isOtherUsersAllowed() == false) {
    // // Only project managers, controllers and administrative staff is allowed to subscribe time-sheets of other users.
View Full Code Here

    do {
      if (++paranoiaCounter > 4000) {
        log.error("Paranoia counter exceeded! Dear developer, please have a look at the implementation of buildEvents.");
        break;
      }
      final DayHolder dh = new DayHolder(day.toDate());
      String backgroundColor, color, textColor;
      if (dh.isHoliday() == true) {
        if (dh.isWorkingDay() == true) {
          backgroundColor = "#FFF0F0";
          color = "#EEEEEE";
          textColor = "#222222";
        } else {
          backgroundColor = "#f9dfde";
          color = "#EEEEEE";
          textColor = "#FF2222";
        }
      } else {
        day = day.plusDays(1);
        continue;
      }

      final Event event = new Event().setAllDay(true);
      final String id = "h-" + (++idCounter);
      event.setId(id);
      event.setStart(day.toDateTime());
      String title;
      final String holidayInfo = dh.getHolidayInfo();
      if (holidayInfo != null && holidayInfo.startsWith("calendar.holiday.") == true) {
        title = PFUserContext.getLocalizedString(holidayInfo);
      } else {
        title = holidayInfo;
      }
View Full Code Here

  @Path(RestPaths.LIST)
  @Produces(MediaType.APPLICATION_JSON)
  public Response getReminderList(@QueryParam("calendarIds") final String calendarIds,
      @QueryParam("modifiedSince") final Integer daysInFuture)
  {
    final DayHolder day = new DayHolder();
    int days = daysInFuture != null ? daysInFuture : 30;
    if (days <= 0 || days > 90) {
      days = 90;
    }
    day.add(Calendar.DAY_OF_YEAR, days);
    final Collection<Integer> cals = new LinkedList<Integer>();
    if (StringUtils.isBlank(calendarIds) == true) {
      final Collection<TeamCalDO> ownCals = TeamCalCache.getInstance().getAllOwnCalendars();
      if (ownCals != null && ownCals.size() > 0) {
        for (final TeamCalDO cal : ownCals) {
          cals.add(cal.getId());
        }
      }
    } else {
      final Integer[] ids = StringHelper.splitToIntegers(calendarIds, ",;:");
      if (ids != null && ids.length > 0) {
        for (final Integer id : ids) {
          if (id != null) {
            cals.add(id);
          }
        }
      }
    }
    final List<CalendarEventObject> result = new LinkedList<CalendarEventObject>();
    if (cals.size() > 0) {
      final Date now = new Date();
      final TeamEventFilter filter = new TeamEventFilter().setStartDate(now).setEndDate(day.getDate()).setTeamCals(cals);
      final List<TeamEvent> list = teamEventDao.getEventList(filter, true);
      if (list != null && list.size() > 0) {
        for (final TeamEvent event : list) {
          if (event.getStartDate().after(now) == true) {
            result.add(TeamEventDOConverter.getEventObject(event));
View Full Code Here

  public PostausgangEditPage(final PageParameters parameters)
  {
    super(parameters, "orga.postausgang");
    init();
    if (isNew() == true) {
      getData().setDatum(new DayHolder().getSQLDate());
      getData().setType(PostType.BRIEF);
    }
  }
View Full Code Here

        {
          final Date value = validatable.getValue();
          if (value == null) {
            return;
          }
          final DayHolder today = new DayHolder();
          final DayHolder date = new DayHolder(value);
          if (today.before(date) == true) { // No dates in the future accepted.
            validatable.error(new ValidationError().addMessageKey("error.dateInFuture"));
          }
        }
      });
View Full Code Here

  public ContractEditPage(final PageParameters parameters)
  {
    super(parameters, "legalAffaires.contract");
    init();
    if (isNew() == true) {
      getData().setDate(new DayHolder().getSQLDate());
    }
  }
View Full Code Here

TOP

Related Classes of org.projectforge.calendar.DayHolder

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.