add person exports in a group

This commit is contained in:
2022-07-13 10:08:18 +02:00
parent 28ed09b9d9
commit ec38dc4d21
5 changed files with 27 additions and 11 deletions

View File

@@ -13,6 +13,7 @@ namespace Chill\PersonBundle\Export\Export;
use Chill\MainBundle\Export\ExportInterface;
use Chill\MainBundle\Export\FormatterInterface;
use Chill\MainBundle\Export\GroupedExportInterface;
use Chill\PersonBundle\Export\Declarations;
use Chill\PersonBundle\Security\Authorization\PersonVoter;
use Doctrine\ORM\EntityManagerInterface;
@@ -22,7 +23,7 @@ use LogicException;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Security\Core\Role\Role;
class CountPerson implements ExportInterface
class CountPerson implements ExportInterface, GroupedExportInterface
{
/**
* @var EntityManagerInterface
@@ -114,4 +115,9 @@ class CountPerson implements ExportInterface
{
return [Declarations::PERSON_TYPE, Declarations::PERSON_IMPLIED_IN];
}
public function getGroup(): string
{
return 'Exports of persons';
}
}

View File

@@ -16,6 +16,7 @@ use Chill\CustomFieldsBundle\Entity\CustomField;
use Chill\CustomFieldsBundle\Service\CustomFieldProvider;
use Chill\MainBundle\Export\ExportElementValidatedInterface;
use Chill\MainBundle\Export\FormatterInterface;
use Chill\MainBundle\Export\GroupedExportInterface;
use Chill\MainBundle\Export\ListInterface;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\PersonBundle\Entity\Person;
@@ -45,7 +46,7 @@ use function uniqid;
/**
* Render a list of people.
*/
class ListPerson implements ExportElementValidatedInterface, ListInterface
class ListPerson implements ExportElementValidatedInterface, ListInterface, GroupedExportInterface
{
protected CustomFieldProvider $customFieldProvider;
@@ -474,4 +475,9 @@ class ListPerson implements ExportElementValidatedInterface, ListInterface
return $uid;
}
public function getGroup(): string
{
return 'Exports of persons';
}
}

View File

@@ -13,6 +13,7 @@ namespace Chill\PersonBundle\Export\Export;
use Chill\MainBundle\Export\DirectExportInterface;
use Chill\MainBundle\Export\ExportElementValidatedInterface;
use Chill\MainBundle\Export\GroupedExportInterface;
use Chill\PersonBundle\Security\Authorization\PersonVoter;
use Doctrine\ORM\EntityManagerInterface;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
@@ -30,7 +31,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
/**
* Render a list of duplicate peoples.
*/
class ListPersonDuplicate implements DirectExportInterface, ExportElementValidatedInterface
class ListPersonDuplicate implements DirectExportInterface, ExportElementValidatedInterface, GroupedExportInterface
{
/**
* @var float
@@ -196,4 +197,9 @@ class ListPersonDuplicate implements DirectExportInterface, ExportElementValidat
return $result->fetchAllAssociative();
}
public function getGroup(): string
{
return 'Exports of persons';
}
}