Merge branch '111_exports_suite' into calendar/finalization

This commit is contained in:
2022-10-24 11:10:44 +02:00
158 changed files with 3064 additions and 1522 deletions

View File

@@ -46,14 +46,7 @@ final class AgentAggregator implements AggregatorInterface
}
$qb->addSelect('caluser.id AS agent_aggregator');
$groupBy = $qb->getDQLPart('groupBy');
if (!empty($groupBy)) {
$qb->addGroupBy('agent_aggregator');
} else {
$qb->groupBy('agent_aggregator');
}
$qb->addGroupBy('agent_aggregator');
}
public function applyOn(): string

View File

@@ -47,14 +47,7 @@ class CancelReasonAggregator implements AggregatorInterface
}
$qb->addSelect('IDENTITY(cal.cancelReason) as cancel_reason_aggregator');
$groupBy = $qb->getDQLPart('groupBy');
if (!empty($groupBy)) {
$qb->addGroupBy('cancel_reason_aggregator');
} else {
$qb->groupBy('cancel_reason_aggregator');
}
$qb->addGroupBy('cancel_reason_aggregator');
}
public function applyOn(): string

View File

@@ -46,14 +46,7 @@ final class JobAggregator implements AggregatorInterface
}
$qb->addSelect('IDENTITY(caluser.userJob) as job_aggregator');
$groupBy = $qb->getDQLPart('groupBy');
if (!empty($groupBy)) {
$qb->addGroupBy('job_aggregator');
} else {
$qb->groupBy('job_aggregator');
}
$qb->addGroupBy('job_aggregator');
}
public function applyOn(): string

View File

@@ -40,14 +40,7 @@ final class LocationAggregator implements AggregatorInterface
$qb->join('cal.location', 'calloc');
}
$qb->addSelect('IDENTITY(cal.location) as location_aggregator');
$groupBy = $qb->getDQLPart('groupBy');
if (!empty($groupBy)) {
$qb->addGroupBy('location_aggregator');
} else {
$qb->groupBy('location_aggregator');
}
$qb->addGroupBy('location_aggregator');
}
public function applyOn(): string

View File

@@ -46,14 +46,7 @@ final class LocationTypeAggregator implements AggregatorInterface
}
$qb->addSelect('IDENTITY(calloc.locationType) as location_type_aggregator');
$groupBy = $qb->getDQLPart('groupBy');
if (!empty($groupBy)) {
$qb->addGroupBy('location_type_aggregator');
} else {
$qb->groupBy('location_type_aggregator');
}
$qb->addGroupBy('location_type_aggregator');
}
public function applyOn(): string

View File

@@ -28,13 +28,7 @@ class MonthYearAggregator implements AggregatorInterface
{
$qb->addSelect("to_char(cal.startDate, 'MM-YYYY') AS month_year_aggregator");
// $qb->addSelect("extract(month from age(cal.startDate, cal.endDate)) AS month_aggregator");
$groupBy = $qb->getDQLPart('groupBy');
if (!empty($groupBy)) {
$qb->addGroupBy('month_year_aggregator');
} else {
$qb->groupBy('month_year_aggregator');
}
$qb->addGroupBy('month_year_aggregator');
}
public function applyOn(): string
@@ -54,10 +48,7 @@ class MonthYearAggregator implements AggregatorInterface
return 'by month and year';
}
$month = (int) substr($value, 0, 2);
$year = (int) substr($value, 3, 4);
return strftime('%B %G', mktime(0, 0, 0, $month, 1, $year));
return $value;
};
}

View File

@@ -46,14 +46,7 @@ final class ScopeAggregator implements AggregatorInterface
}
$qb->addSelect('IDENTITY(caluser.mainScope) as scope_aggregator');
$groupBy = $qb->getDQLPart('groupBy');
if (!empty($groupBy)) {
$qb->addGroupBy('scope_aggregator');
} else {
$qb->groupBy('scope_aggregator');
}
$qb->addGroupBy('scope_aggregator');
}
public function applyOn(): string

View File

@@ -71,9 +71,9 @@ class CountCalendars implements ExportInterface, GroupedExportInterface
return ['export_result'];
}
public function getResult($qb, $data)
public function getResult($query, $data)
{
return $qb->getQuery()->getResult(AbstractQuery::HYDRATE_SCALAR);
return $query->getQuery()->getResult(AbstractQuery::HYDRATE_SCALAR);
}
public function getTitle(): string

View File

@@ -71,9 +71,9 @@ class StatCalendarAvgDuration implements ExportInterface, GroupedExportInterface
return ['export_result'];
}
public function getResult($qb, $data)
public function getResult($query, $data)
{
return $qb->getQuery()->getResult(Query::HYDRATE_SCALAR);
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
}
public function getTitle(): string

View File

@@ -71,9 +71,9 @@ class StatCalendarSumDuration implements ExportInterface, GroupedExportInterface
return ['export_result'];
}
public function getResult($qb, $data)
public function getResult($query, $data)
{
return $qb->getQuery()->getResult(Query::HYDRATE_SCALAR);
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
}
public function getTitle(): string

View File

@@ -76,7 +76,7 @@ class AgentFilter implements FilterInterface
return [
'Filtered by agent: only %agents%', [
'%agents' => implode(', ou ', $users),
'%agents' => implode(', ', $users),
], ];
}

View File

@@ -90,7 +90,7 @@ class JobFilter implements FilterInterface
}
return ['Filtered by agent job: only %jobs%', [
'%jobs%' => implode(', ou ', $userJobs),
'%jobs%' => implode(', ', $userJobs),
]];
}

View File

@@ -90,7 +90,7 @@ class ScopeFilter implements FilterInterface
}
return ['Filtered by agent scope: only %scopes%', [
'%scopes%' => implode(', ou ', $scopes),
'%scopes%' => implode(', ', $scopes),
]];
}