exports: add 2 new exports for accompanying courses

This commit is contained in:
Mathieu Jaumotte 2022-07-12 15:16:38 +02:00
parent 56bed12886
commit 28ed09b9d9
5 changed files with 215 additions and 0 deletions

View File

@ -0,0 +1,76 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\PersonBundle\Export\Export;
use Chill\MainBundle\Export\ExportInterface;
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Security\Core\Role\Role;
class CountAccompanyingCourse implements ExportInterface
{
public function buildForm(FormBuilderInterface $builder)
{
// TODO: Implement buildForm() method.
}
public function getTitle()
{
return 'Count accompanying courses';
}
public function getAllowedFormattersTypes()
{
// TODO: Implement getAllowedFormattersTypes() method.
}
public function getDescription()
{
return 'Count accompanying courses by various parameters';
}
public function getLabels($key, array $values, $data)
{
// TODO: Implement getLabels() method.
}
public function getQueryKeys($data)
{
// TODO: Implement getQueryKeys() method.
}
public function getResult($query, $data)
{
// TODO: Implement getResult() method.
}
public function getType()
{
// TODO: Implement getType() method.
}
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{
// TODO: Implement initiateQuery() method.
}
public function requiredRole(): Role
{
return new Role(AccompanyingPeriodVoter::STATS);
}
public function supportsModifiers()
{
// TODO: Implement supportsModifiers() method.
}
}

View File

@ -0,0 +1,116 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\PersonBundle\Export\Export;
use Chill\MainBundle\Export\ExportElementValidatedInterface;
use Chill\MainBundle\Export\ListInterface;
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
class ListAccompanyingCourse implements ListInterface, ExportElementValidatedInterface
{
/**
* @inheritDoc
*/
public function buildForm(FormBuilderInterface $builder)
{
// TODO: Implement buildForm() method.
}
/**
* @inheritDoc
*/
public function getTitle()
{
return 'List accompanying courses';
}
/**
* @inheritDoc
*/
public function getAllowedFormattersTypes()
{
// TODO: Implement getAllowedFormattersTypes() method.
}
/**
* @inheritDoc
*/
public function getDescription()
{
return 'Create a list of accompanying courses according to various filters';
}
/**
* @inheritDoc
*/
public function getLabels($key, array $values, $data)
{
// TODO: Implement getLabels() method.
}
/**
* @inheritDoc
*/
public function getQueryKeys($data)
{
// TODO: Implement getQueryKeys() method.
}
/**
* @inheritDoc
*/
public function getResult($query, $data)
{
// TODO: Implement getResult() method.
}
/**
* @inheritDoc
*/
public function getType()
{
// TODO: Implement getType() method.
}
/**
* @inheritDoc
*/
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{
// TODO: Implement initiateQuery() method.
}
/**
* @inheritDoc
*/
public function requiredRole(): Role
{
return new Role(AccompanyingPeriodVoter::STATS);
}
/**
* @inheritDoc
*/
public function supportsModifiers()
{
// TODO: Implement supportsModifiers() method.
}
public function validateForm($data, ExecutionContextInterface $context)
{
// TODO: Implement validateForm() method.
}
}

View File

@ -38,8 +38,14 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH
self::TOGGLE_CONFIDENTIAL_ALL,
self::TOGGLE_INTENSITY,
self::RE_OPEN_COURSE,
self::STATS,
];
/**
* Give the ability to see statistics
*/
public const STATS = 'CHILL_PERSON_ACCOMPANYING_PERIOD_STATS';
/**
* Give the ability to see all confidential courses.
*/
@ -129,6 +135,7 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH
self::FULL,
self::TOGGLE_CONFIDENTIAL_ALL,
self::REASSIGN_BULK,
self::STATS,
];
}

View File

@ -26,6 +26,18 @@ services:
tags:
- { name: chill.export, alias: list_person_duplicate }
chill.person.export.export_count_accompanying_course:
class: Chill\PersonBundle\Export\Export\CountAccompanyingCourse
arguments:
tags:
- { name: chill.export, alias: count_accompanying_course }
chill.person.export.list_accompanying_course:
class: Chill\PersonBundle\Export\Export\ListAccompanyingCourse
arguments:
tags:
- { name: chill.export, alias: list_accompanying_course }
chill.person.export.filter_gender:
class: Chill\PersonBundle\Export\Filter\GenderFilter
arguments:

View File

@ -334,6 +334,10 @@ Fields to include in export: Champs à inclure dans l'export
Address valid at this date: Addresse valide à cette date
List duplicates: Liste des doublons
Create a list of duplicate people: Créer la liste des personnes détectées comme doublons.
Count accompanying courses: Nombre de parcours
Count accompanying courses by various parameters: Compte le nombre de parcours d'accompagnement en fonction de différents filtres.
List accompanying courses: Liste des parcours
Create a list of accompanying courses according to various filters: Crée une liste des parcours d'accompagnement selon différents filtres.
## filters
Filter by person gender: Filtrer par genre de la personne