Workdays
This commit is contained in:
@@ -93,6 +93,11 @@ function set_system_setting(string $key, $value): bool {
|
||||
* Haalt alle organisatie werkdag standaarden op (Release v1.4)
|
||||
*/
|
||||
function get_workday_settings(): array {
|
||||
$rawDays = get_system_setting('workdays', '1,2,3,4,5');
|
||||
$workdays = array_values(array_filter(array_map('intval', explode(',', $rawDays)), fn($d) => $d >= 1 && $d <= 7));
|
||||
if (empty($workdays)) {
|
||||
$workdays = [1, 2, 3, 4, 5];
|
||||
}
|
||||
return [
|
||||
'workday_start' => get_system_setting('workday_start', '08:30'),
|
||||
'workday_end' => get_system_setting('workday_end', '17:00'),
|
||||
@@ -102,6 +107,8 @@ function get_workday_settings(): array {
|
||||
'pomodoro_deep' => (int)get_system_setting('pomodoro_deep', 50),
|
||||
'pomodoro_break' => (int)get_system_setting('pomodoro_break', 5),
|
||||
'default_task_duration' => (int)get_system_setting('default_task_duration', 30),
|
||||
'workdays' => $workdays,
|
||||
'workdays_str' => implode(',', $workdays),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user