Beispiel #1
0
  public void prepareCreate(Employee empl, TimeOffStatus to) {
    super.prepareCreate();
    if (current != null) {
      TimeOffStatus status = null;
      if (to == null) {
        ConfigurationDataManager configDM = ConfigurationDataManager.getInstance();

        configDM.updateTimeOffStatusData();
        status = configDM.getDefaultStatus();
      } else {
        status = to;
      }
      current.setEmployeeid(empl);
      current.setTimeOffStatusid(status);
    }
  }
Beispiel #2
0
  /** Checks if there are pending time off requests. Displays a message if some are found. */
  public void checkForPendingRequests() {
    TimeOffStatus pending = ConfigurationDataManager.getInstance().getDefaultStatus();

    if (pending != null) {
      if (ejbFacade.findByStatus(pending).size() > 0) {

        FacesContext.getCurrentInstance()
            .addMessage(
                null,
                new FacesMessage(
                    FacesMessage.SEVERITY_WARN,
                    "Time Off Requests Pending",
                    "You have pending time off requests!"));
      }
    }
  }
Beispiel #3
0
 private void sendNotification() {
   ConfigurationDataManager cdm = ConfigurationDataManager.getInstance();
   if (current.getTimeOffStatusid().equals(cdm.getDefaultStatus())) {
     cdm.updateConfigurationData();
     MailUtil.sendNewTimeOffRequestEmail(
         current.getEmployeeid().getName(), current.getStart(), current.getEnd());
     if (!cdm.isAdmin()) {
       cdm.clearData();
     }
   }
 }