Release 2.0.26 (#4087)

- setting "rounding days" not required
- developer: added user pref for public holiday group (to be used by plugins)
- developer: added WorkingTimeYearEvent (to be used by plugins)
- user pref: cleanup work contract form and support more fields (to be used by plugins)
- code cleanup
- bump theme and composer packages
This commit is contained in:
Kevin Papst
2023-06-09 16:29:19 +02:00
committed by GitHub
parent 0663995d06
commit 6e781b59e2
22 changed files with 241 additions and 167 deletions

View File

@@ -1174,6 +1174,13 @@ class User implements UserInterface, EquatableInterface, ThemeUserInterface, Pas
return (int) $this->getPreferenceValue(UserPreference::WORK_HOURS_SUNDAY, 0);
}
public function getPublicHolidayGroup(): null|string
{
$group = $this->getPreferenceValue(UserPreference::PUBLIC_HOLIDAY_GROUP);
return $group === null ? $group : (string) $group;
}
public function getHolidaysPerYear(): int
{
return (int) $this->getPreferenceValue(UserPreference::HOLIDAYS_PER_YEAR, 0);
@@ -1214,6 +1221,11 @@ class User implements UserInterface, EquatableInterface, ThemeUserInterface, Pas
$this->setPreferenceValue(UserPreference::WORK_HOURS_SUNDAY, $seconds);
}
public function setPublicHolidayGroup(null|string $group = null): void
{
$this->setPreferenceValue(UserPreference::PUBLIC_HOLIDAY_GROUP, $group);
}
public function setHolidaysPerYear(int $holidays): void
{
$this->setPreferenceValue(UserPreference::HOLIDAYS_PER_YEAR, $holidays);