mirror of
https://github.com/SuiteCRM/SuiteCRM-Core.git
synced 2025-08-29 08:17:18 +08:00
Fix #608 - Leads Listview Quick Charts Leads By Status shows back end value instead of label of status
This commit is contained in:
parent
9df984eccd
commit
349f13476d
1 changed files with 19 additions and 1 deletions
|
@ -129,7 +129,25 @@ class LeadsByStatusCount extends LegacyHandler implements StatisticsProviderInte
|
|||
$nameField = 'name';
|
||||
$valueField = 'value';
|
||||
|
||||
$series = $this->buildSingleSeries($result, $nameField, $valueField);
|
||||
$options = $bean->field_defs['status']['options'];
|
||||
if (gettype($options) == 'array') {
|
||||
$optionsList = $options;
|
||||
} elseif (gettype($options) == 'string') {
|
||||
global $app_list_strings;
|
||||
$optionsList = $app_list_strings[$options];
|
||||
} else {
|
||||
$optionsList = [];
|
||||
}
|
||||
$resultFormatted = [];
|
||||
foreach ($result as $res) {
|
||||
if (isset($optionsList[$res['name']])) {
|
||||
$resultFormatted[] = ['name' => $optionsList[$res['name']], 'value' => $res['value']];
|
||||
} else {
|
||||
$resultFormatted[] = $res;
|
||||
}
|
||||
}
|
||||
|
||||
$series = $this->buildSingleSeries($resultFormatted, $nameField, $valueField);
|
||||
|
||||
|
||||
$chartOptions = new ChartOptions();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue