mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
add activity exports in a group
This commit is contained in:
parent
2ce145cace
commit
3cdcccc037
@ -15,12 +15,13 @@ use Chill\ActivityBundle\Repository\ActivityRepository;
|
|||||||
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
||||||
use Chill\MainBundle\Export\ExportInterface;
|
use Chill\MainBundle\Export\ExportInterface;
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
use Doctrine\ORM\Query;
|
use Doctrine\ORM\Query;
|
||||||
use LogicException;
|
use LogicException;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\Security\Core\Role\Role;
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
|
|
||||||
class CountActivity implements ExportInterface
|
class CountActivity implements ExportInterface, GroupedExportInterface
|
||||||
{
|
{
|
||||||
protected ActivityRepository $activityRepository;
|
protected ActivityRepository $activityRepository;
|
||||||
|
|
||||||
@ -99,4 +100,9 @@ class CountActivity implements ExportInterface
|
|||||||
{
|
{
|
||||||
return ['person', 'activity'];
|
return ['person', 'activity'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getGroup(): string
|
||||||
|
{
|
||||||
|
return 'Exports of activities';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ use Chill\ActivityBundle\Entity\ActivityReason;
|
|||||||
use Chill\ActivityBundle\Repository\ActivityRepository;
|
use Chill\ActivityBundle\Repository\ActivityRepository;
|
||||||
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
use Chill\MainBundle\Export\ListInterface;
|
use Chill\MainBundle\Export\ListInterface;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
use DateTime;
|
use DateTime;
|
||||||
@ -32,7 +33,7 @@ use function array_key_exists;
|
|||||||
use function count;
|
use function count;
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
class ListActivity implements ListInterface
|
class ListActivity implements ListInterface, GroupedExportInterface
|
||||||
{
|
{
|
||||||
protected EntityManagerInterface $entityManager;
|
protected EntityManagerInterface $entityManager;
|
||||||
|
|
||||||
@ -276,4 +277,9 @@ class ListActivity implements ListInterface
|
|||||||
{
|
{
|
||||||
return ['activity', 'person'];
|
return ['activity', 'person'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getGroup(): string
|
||||||
|
{
|
||||||
|
return 'Exports of activities';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@ use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
|||||||
use Chill\MainBundle\Entity\Center;
|
use Chill\MainBundle\Entity\Center;
|
||||||
use Chill\MainBundle\Export\ExportInterface;
|
use Chill\MainBundle\Export\ExportInterface;
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
use Doctrine\ORM\Query;
|
use Doctrine\ORM\Query;
|
||||||
use LogicException;
|
use LogicException;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
@ -26,7 +27,7 @@ use Symfony\Component\Security\Core\Role\Role;
|
|||||||
*
|
*
|
||||||
* The desired stat must be given in constructor.
|
* The desired stat must be given in constructor.
|
||||||
*/
|
*/
|
||||||
class StatActivityDuration implements ExportInterface
|
class StatActivityDuration implements ExportInterface, GroupedExportInterface
|
||||||
{
|
{
|
||||||
public const SUM = 'sum';
|
public const SUM = 'sum';
|
||||||
|
|
||||||
@ -128,4 +129,9 @@ class StatActivityDuration implements ExportInterface
|
|||||||
{
|
{
|
||||||
return ['person', 'activity'];
|
return ['person', 'activity'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getGroup(): string
|
||||||
|
{
|
||||||
|
return 'Exports of activities';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -210,6 +210,7 @@ Sum activities duration by various parameters.: Additionne la durée des activit
|
|||||||
List activities: Liste les activités
|
List activities: Liste les activités
|
||||||
List activities description: Créer la liste des activités
|
List activities description: Créer la liste des activités
|
||||||
Number of activities: Nombre d'activités
|
Number of activities: Nombre d'activités
|
||||||
|
Exports of activities: Exports des activités
|
||||||
|
|
||||||
#filters
|
#filters
|
||||||
Filter by reason: Filtrer par sujet d'activité
|
Filter by reason: Filtrer par sujet d'activité
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}{% endfor %}
|
{% endif %}{% endfor %}
|
||||||
|
|
||||||
{% if grouped_exports|keys|length > 1 %}
|
{% if grouped_exports|keys|length > 1 and grouped_exports['_']|length > 0 %}
|
||||||
<h2 class="display-6">{{ 'Ungrouped exports'|trans }}</h2>
|
<h2 class="display-6">{{ 'Ungrouped exports'|trans }}</h2>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user