updated advanced pack to 3.12.0:
Reports:
Non-aggregated columns in Grid report export.
Normalized table mode for 2-dimensional Grid reports.
Ability to create internal reports via the UI.
Ability to show/hide and resize columns in the list report result view.
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
* usage to the software or any modified version or derivative work of the software
|
||||
* created by or for you.
|
||||
*
|
||||
* Copyright (C) 2015-2025 EspoCRM, Inc.
|
||||
* Copyright (C) 2015-2026 EspoCRM, Inc.
|
||||
*
|
||||
* License ID: 19bc86a68a7bb01f458cb391d43a9212
|
||||
************************************************************************************/
|
||||
@@ -19,11 +19,16 @@
|
||||
namespace Espo\Modules\Advanced\Hooks\Report;
|
||||
|
||||
use Espo\Modules\Advanced\Entities\Report;
|
||||
use Espo\Modules\Advanced\Entities\Report as ReportEntity;
|
||||
use Espo\Modules\Advanced\Tools\Report\GridType\Data;
|
||||
use Espo\Modules\Advanced\Tools\Report\Internal\InternalReportHelper;
|
||||
use Espo\ORM\Entity;
|
||||
|
||||
class Prepare
|
||||
{
|
||||
public function __construct(
|
||||
private InternalReportHelper $internalReportHelper,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @param Report $entity
|
||||
*/
|
||||
@@ -40,11 +45,35 @@ class Prepare
|
||||
}
|
||||
|
||||
if (
|
||||
$entity->get('type') === ReportEntity::TYPE_GRID &&
|
||||
$entity->getType() === Report::TYPE_GRID &&
|
||||
($entity->has('chartOneColumns') || $entity->has('chartOneY2Columns'))
|
||||
) {
|
||||
$this->handleChartDataList($entity);
|
||||
}
|
||||
|
||||
if ($entity->getInternalClassName()) {
|
||||
$entity->set('isInternal', true);
|
||||
|
||||
if ($entity->isAttributeChanged('internalClassName')) {
|
||||
$this->internalReportHelper->populateFields($entity);
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
$entity->getType() !== Report::TYPE_GRID ||
|
||||
count($entity->getGroupBy()) < 2
|
||||
) {
|
||||
$entity->setTableMode(Data::TABLE_MODE_REGULAR);
|
||||
}
|
||||
|
||||
if (
|
||||
$entity->getType() === Report::TYPE_GRID &&
|
||||
count($entity->getGroupBy()) >= 2 &&
|
||||
$entity->getTableMode() === Data::TABLE_MODE_NORMALIZED
|
||||
) {
|
||||
$entity->setChartType(null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function handleChartDataList(Report $entity): void
|
||||
@@ -87,7 +116,7 @@ class Prepare
|
||||
}
|
||||
}
|
||||
|
||||
$chartType = $entity->get('chartType');
|
||||
$chartType = $entity->getChartType();
|
||||
|
||||
if (!in_array($chartType, ['BarVertical', 'BarHorizontal', 'Line'])) {
|
||||
$newY2 = null;
|
||||
|
||||
Reference in New Issue
Block a user