Refactor goals_progress_alert_renderer for enhanced department summary rendering
- Simplify multi-period department progress calculations by restructuring logic to render by period first. - Add support for daily target calculations and timeframe-based target adjustments in `goals_criteria`. - Introduce `countOperatingDaysInTimeframe` and related helper methods for improved alert scheduling and progress tracking.
This commit is contained in:
@@ -643,4 +643,15 @@ class goals_criteria implements goals_criteria_i
|
||||
$new_criteria->departments->set([(new \objects\departments_o())->select($department_id)]);
|
||||
return $new_criteria;
|
||||
}
|
||||
|
||||
public function getAlertDaysForDepartment(int $deptId): array
|
||||
{
|
||||
$alert_days = [];
|
||||
foreach ($this->progress_alert_weekdays as $weekday) {
|
||||
if ($weekday instanceof goals_criteria_progress_alert_weekday) {
|
||||
$alert_days[] = $weekday;
|
||||
}
|
||||
}
|
||||
return $alert_days;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user