update subpanel insights for tooltips

This commit is contained in:
Jack Anderson 2021-01-29 08:26:20 +00:00 committed by Dillon-Brown
parent e2d3c13727
commit b2f4c19928
12 changed files with 11 additions and 46 deletions

View file

@ -64,6 +64,7 @@ class SubPanelActivitiesNextDate extends SubpanelDataQueryHandler implements Sta
}
$statistic = $this->buildStatistic($min);
$this->addMetadata($statistic, ['tooltip_title_key' => 'LBL_ACTIVITIES_NEXT_DATE']);
$this->close();
return $statistic;

View file

@ -70,6 +70,7 @@ class SubPanelCampaignsLastReceived extends SubpanelDataQueryHandler implements
$finalDate = $dateFormatService->toDBDate($result);
$statistic = $this->buildSingleValueResponse(self::KEY, 'date', ['value' => $finalDate]);
$this->addMetadata($statistic, ['tooltip_title_key' => 'LBL_CAMPAIGN_LAST_RECEIVED']);
$this->close();

View file

@ -42,7 +42,7 @@ class SubPanelCasesCount extends SubpanelDataQueryHandler implements StatisticsP
$dbQuery = $this->joinQueryParts($parts);
$result = $this->fetchRow($dbQuery);
$statistic = $this->buildSingleValueResponse(self::KEY, 'int', $result);
$this->addMetadata($statistic, ['tooltip_title_key' => 'LBL_OPEN_CASES_COUNT']);
$this->close();
return $statistic;

View file

@ -65,7 +65,7 @@ class SubPanelContractsRenewalDate extends SubpanelDataQueryHandler implements S
}
$statistic = $this->buildSingleValueResponse(self::KEY, 'date', ['value' => $result['end_date']]);
$this->addMetadata($statistic, ['tooltip_title_key' => 'LBL_CONTRACT_RENEWAL']);
$this->close();
return $statistic;

View file

@ -115,6 +115,7 @@ class SubPanelEventsLastDate extends SubpanelDataQueryHandler implements Statist
} else {
$statistic = $this->getEmptyResponse(self::KEY);
}
$this->addMetadata($statistic, ['tooltip_title_key' => 'LBL_EVENTS_LAST_DATE']);
$this->close();

View file

@ -64,6 +64,7 @@ class SubPanelHistoryLastDate extends SubpanelDataQueryHandler implements Statis
}
$statistic = $this->buildStatistic($max);
$this->addMetadata($statistic, ['tooltip_title_key' => 'LBL_HISTORY_LAST_DATE']);
$this->close();
return $statistic;

View file

@ -56,7 +56,7 @@ class SubPanelInvoicesTotal extends SubpanelDataQueryHandler implements Statisti
}
$statistic = $this->buildSingleValueResponse(self::KEY, 'int', $result);
$this->addMetadata($statistic, ['tooltip_title_key' => 'LBL_INVOICES_OVERDUE']);
$this->close();
return $statistic;

View file

@ -63,7 +63,7 @@ class SubPanelQuotesTotal extends SubpanelDataQueryHandler implements Statistics
$date = $result['expiration'];
$statistic = $this->buildSingleValueResponse(self::KEY, 'date', ['value' => $date]);
$this->addMetadata($statistic, ['tooltip_title_key' => 'LBL_QUOTES_EXPIRY']);
return $statistic;
}
}

View file

@ -45,7 +45,7 @@ class SubPanelTasksHistoryCount extends SubpanelDataQueryHandler implements Stat
$innerQuery = $this->joinQueryParts($parts);
$notes = $this->fetchRow($innerQuery);
$statistic = $this->buildSingleValueResponse(self::KEY, 'int', $notes);
$this->addMetadata($statistic, ['tooltip_title_key' => 'LBL_DEFAULT_TOTAL']);
$this->close();
return $statistic;

View file

@ -41,7 +41,7 @@ class SubpanelDefault extends SubpanelDataQueryHandler implements StatisticsProv
$dbQuery = $this->joinQueryParts($parts);
$result = $this->fetchRow($dbQuery);
$statistic = $this->buildSingleValueResponse(self::KEY, 'int', $result);
$this->addMetadata($statistic, ['tooltip_title_key' => 'LBL_DEFAULT_TOTAL']);
$this->close();
return $statistic;
}

View file

@ -1,39 +0,0 @@
<?php
namespace App\Legacy\Statistics;
use App\Entity\Statistic;
use App\Service\StatisticsProviderInterface;
class SubpanelEmpty implements StatisticsProviderInterface
{
public const KEY = 'empty';
/**
* @inheritDoc
*/
public function getKey(): string
{
return self::KEY;
}
/**
* @inheritDoc
*/
public function getData(array $param): Statistic
{
$statistic = new Statistic();
$statistic->setId(self::KEY);
$statistic->setData([
'value' => '-'
]);
$statistic->setMetadata([
'type' => 'single-value-statistic',
'dataType' => 'varchar',
]);
return $statistic;
}
}

View file

@ -47,7 +47,7 @@ class SubpanelOpportunitiesTotal extends SubpanelDataQueryHandler implements Sta
$result = $this->fetchRow($dbQuery);
$statistic = $this->buildCurrencyResult($result);
$this->addMetadata($statistic, ['tooltip_title_key' => 'LBL_OPPORTUNITIES_TOTAL_SUM']);
$this->close();
return $statistic;