mirror of https://github.com/MISP/MISP
fix: [user:periodic_notification] Show the correct start date of the report
parent
19cc836070
commit
9f0b72576c
|
@ -1800,7 +1800,7 @@ class User extends AppModel
|
|||
$aggregated_context = $this->__renderAggregatedContext($finalContext);
|
||||
|
||||
$rollingWindows = 2;
|
||||
$trendAnalysis = $this->Event->getTrendsForTagsFromEvents($events, $this->__periodToDays($period), $rollingWindows, $periodicSettings['trending_for_tags']);
|
||||
$trendAnalysis = $this->Event->getTrendsForTagsFromEvents($events, $this->periodToDays($period), $rollingWindows, $periodicSettings['trending_for_tags']);
|
||||
$tagFilterPrefixes = $periodicSettings['trending_for_tags'] ?: array_keys($trendAnalysis['all_tags']);
|
||||
$trendData = [
|
||||
'trendAnalysis' => $trendAnalysis,
|
||||
|
@ -1812,6 +1812,7 @@ class User extends AppModel
|
|||
$emailTemplate->set('events', $events);
|
||||
$emailTemplate->set('filters', $filters);
|
||||
$emailTemplate->set('periodicSettings', $periodicSettings);
|
||||
$emailTemplate->set('period_days', $this->periodToDays($period));
|
||||
$emailTemplate->set('period', $period);
|
||||
$emailTemplate->set('aggregated_context', $aggregated_context);
|
||||
$emailTemplate->set('trending_summary', $trending_summary);
|
||||
|
@ -1883,7 +1884,7 @@ class User extends AppModel
|
|||
return $timerange;
|
||||
}
|
||||
|
||||
private function __periodToDays(string $period='daily'): int
|
||||
public function periodToDays(string $period='daily'): int
|
||||
{
|
||||
return ($period == 'daily' ? 1 : (
|
||||
$period == 'weekly' ? 7 : 31)
|
||||
|
|
|
@ -29,7 +29,7 @@ $default_vars = [
|
|||
$vars = array_merge($default_vars, $this->__vars);
|
||||
|
||||
$now = new DateTime();
|
||||
$start_date = new DateTime('7 days ago');
|
||||
$start_date = new DateTime($period_days . ' days ago');
|
||||
$event_number = count($events);
|
||||
$attribute_number = 0;
|
||||
$object_number = 0;
|
||||
|
|
Loading…
Reference in New Issue