/** * @see org.projectforge.business.teamcal.filter.ICalendarFilter#setShowTimesheets(boolean) */ public TemplateEntry setShowTimesheets(final boolean showTimesheets) { this.timesheetUserId = ThreadLocalUserContext.getUserId(); return this; }
public CalendarFilter() { super(); timesheetUserId = ThreadLocalUserContext.getUserId(); selectedCalendar = Const.EVENT_CLASS_NAME; }
@Override public String getCurrentUserId() { Integer userId = ThreadLocalUserContext.getUserId(); if (userId != null) { return userId.toString(); } return "anon"; }
/** * @see org.projectforge.web.calendar.AbstractICSExportDialog#getUrl() */ @Override protected String getUrl() { return calendarFeedService .getUrl4Timesheets(timesheetUserId != null ? timesheetUserId : ThreadLocalUserContext.getUserId()); }
/** * @return the tenants */ @Override public Collection<TenantDO> getTenantsOfLoggedInUser() { return getTenantsOfUser(ThreadLocalUserContext.getUserId()); }
/** * Check for current logged in user. * * @param groupId * @return */ public boolean isLoggedInUserMemberOfGroup(final Integer groupId) { return isUserMemberOfGroup(ThreadLocalUserContext.getUserId(), groupId); }
/** * Uses the context user. * * @param data * @return * @see #encrypt(Integer, String) */ @Override public String encrypt(final String data) { return encrypt(ThreadLocalUserContext.getUserId(), data); }
public boolean isUserMemberOfMarketingGroup() { return isUserMemberOfMarketingGroup(ThreadLocalUserContext.getUserId()); }
@Override protected FFPDebtFilter newSearchFilterInstance() { return new FFPDebtFilter(ThreadLocalUserContext.getUserId()); } }
/** * @return the tenants */ public Collection<TenantDO> getTenantsOfLoggedInUser() { return getTenantsOfUser(ThreadLocalUserContext.getUserId()); }
@Override public void onSubmit() { caller.select(selectProperty, ThreadLocalUserContext.getUserId()); markTextFieldModelAsChanged(); }
@Override public String getObject() { if (ThreadLocalUserContext.getUserId().equals(user.getId()) == true) { return userDao.getAuthenticationToken(user.getId()); } else { // Administrators shouldn't see the token. return "*****"; } } }));
@Override protected void onEvent(final AjaxRequestTarget target) { userXmlPreferencesDao.saveOrUpdate(ThreadLocalUserContext.getUserId(), "disableSnowEffectPermant", Boolean.TRUE, true); userXmlPreferencesCache.putEntry(ThreadLocalUserContext.getUserId(), "disableSnowEffectPermant", Boolean.TRUE, true); setResponsePage(getPage().getPageClass()); } }));
@Override protected void onSave(final ToDoDO obj) { if (ObjectUtils.equals(ThreadLocalUserContext.getUserId(), obj.getAssigneeId()) == false) { // To-do is changed by other user than assignee, so set recent flag for this to-do for the assignee. obj.setRecent(true); } }
private boolean checkWriteAccess() { if (data.getEmployee().getUser().getPk().equals(ThreadLocalUserContext.getUserId()) == true || (data.getManager() != null && data.getManager().getUser().getPk().equals(ThreadLocalUserContext.getUserId())) == true) { return true; } if (checkHRWriteRight()) { return true; } return false; }
/** * @see org.projectforge.framework.persistence.api.BaseDao#getListForSearchDao(org.projectforge.framework.persistence.api.BaseSearchFilter) */ @Override public List<TimesheetDO> getListForSearchDao(final BaseSearchFilter filter) { final TimesheetFilter timesheetFilter = new TimesheetFilter(filter); if (filter.getModifiedByUserId() == null) { timesheetFilter.setUserId(ThreadLocalUserContext.getUserId()); } return getList(timesheetFilter); }
@Override protected VacationFilter newSearchFilterInstance() { EmployeeDO employee = employeeService.getEmployeeByUserId(ThreadLocalUserContext.getUserId()); if (employee == null) { throw new AccessException("access.exception.noEmployeeToUser"); } return new VacationFilter(employee.getPk()); }
@Override protected void updateButtonVisibility() { super.updateButtonVisibility(); //Set delete button only for employee or hr write right markAsDeletedButtonPanel.setVisible(false); if (data.getEmployee().getUser().getPk().equals(ThreadLocalUserContext.getUserId()) || checkHRWriteRight()) { markAsDeletedButtonPanel.setVisible(true); } } }
private void createDefaultEntry() { final TemplateEntry newTemplate = new TemplateEntry(); newTemplate.setName(ThreadLocalUserContext.getLocalizedString("default")); newTemplate.setTimesheetUserId(ThreadLocalUserContext.getUserId()).setShowBirthdays(true).setShowBreaks(true) .setShowPlanning(true) .setShowStatistics(true); add(newTemplate); }
@Override public HRPlanningListFilter reset() { super.reset(); setUserId(ThreadLocalUserContext.getUserId()); final DateHolder date = new DateHolder(DatePrecision.DAY); date.setBeginOfWeek(); setStartTime(date.getTimestamp()); date.setEndOfWeek(); setStopTime(date.getTimestamp()); return this; } }