mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Merge remote-tracking branch 'origin/master' into track-address-reference-update
This commit is contained in:
@@ -47,6 +47,7 @@ class ListEvaluation implements ListInterface, GroupedExportInterface
|
||||
'endDate',
|
||||
'maxDate',
|
||||
'warningInterval',
|
||||
'timeSpent',
|
||||
'acpw_id',
|
||||
'acpw_startDate',
|
||||
'acpw_endDate',
|
||||
@@ -295,6 +296,9 @@ class ListEvaluation implements ListInterface, GroupedExportInterface
|
||||
$qb->addSelect(sprintf('workeval.%s AS %s', $field, $field));
|
||||
}
|
||||
|
||||
// add the time spent field
|
||||
$qb->addSelect('(workeval.timeSpent / 60) AS timeSpent');
|
||||
|
||||
// those with identity
|
||||
foreach (['createdBy', 'updatedBy'] as $field) {
|
||||
$qb->addSelect(sprintf('IDENTITY(workeval.%s) AS %s', $field, $field));
|
||||
|
@@ -31,13 +31,9 @@ class ReferrerFilter implements FilterInterface
|
||||
|
||||
private RollingDateConverterInterface $rollingDateConverter;
|
||||
|
||||
private UserRender $userRender;
|
||||
|
||||
public function __construct(
|
||||
UserRender $userRender,
|
||||
RollingDateConverterInterface $rollingDateConverter
|
||||
) {
|
||||
$this->userRender = $userRender;
|
||||
$this->rollingDateConverter = $rollingDateConverter;
|
||||
}
|
||||
|
||||
|
@@ -36,19 +36,15 @@ class UserJobFilter implements FilterInterface
|
||||
|
||||
private RollingDateConverterInterface $rollingDateConverter;
|
||||
|
||||
private Security $security;
|
||||
|
||||
private TranslatableStringHelper $translatableStringHelper;
|
||||
|
||||
private UserJobRepositoryInterface $userJobRepository;
|
||||
|
||||
public function __construct(
|
||||
Security $security,
|
||||
TranslatableStringHelper $translatableStringHelper,
|
||||
UserJobRepositoryInterface $userJobRepository,
|
||||
RollingDateConverterInterface $rollingDateConverter
|
||||
) {
|
||||
$this->security = $security;
|
||||
$this->translatableStringHelper = $translatableStringHelper;
|
||||
$this->userJobRepository = $userJobRepository;
|
||||
$this->rollingDateConverter = $rollingDateConverter;
|
||||
|
@@ -26,13 +26,10 @@ class AddressRefStatusFilter implements \Chill\MainBundle\Export\FilterInterface
|
||||
{
|
||||
private RollingDateConverterInterface $rollingDateConverter;
|
||||
|
||||
private TranslatableStringHelperInterface $translatableStringHelper;
|
||||
|
||||
public function __construct(
|
||||
TranslatableStringHelperInterface $translatableStringHelper,
|
||||
RollingDateConverterInterface $rollingDateConverter
|
||||
) {
|
||||
$this->translatableStringHelper = $translatableStringHelper;
|
||||
$this->rollingDateConverter = $rollingDateConverter;
|
||||
}
|
||||
|
||||
|
@@ -22,13 +22,6 @@ use function in_array;
|
||||
|
||||
class ReferrerFilter implements FilterInterface
|
||||
{
|
||||
private UserRender $userRender;
|
||||
|
||||
public function __construct(UserRender $userRender)
|
||||
{
|
||||
$this->userRender = $userRender;
|
||||
}
|
||||
|
||||
public function addRole(): ?string
|
||||
{
|
||||
return null;
|
||||
|
@@ -19,7 +19,6 @@ use Chill\PersonBundle\Entity\SocialWork\SocialAction;
|
||||
use Chill\PersonBundle\Export\Declarations;
|
||||
use Chill\PersonBundle\Templating\Entity\SocialActionRender;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\Query\Expr\Andx;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Component\Form\CallbackTransformer;
|
||||
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
||||
@@ -52,45 +51,37 @@ class SocialWorkTypeFilter implements FilterInterface
|
||||
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
{
|
||||
$where = $qb->getDQLPart('where');
|
||||
|
||||
if (count($data['actionType']) > 0) {
|
||||
$clause = $qb->expr()->in('acpw.socialAction', ':actionType');
|
||||
|
||||
if ($where instanceof Andx) {
|
||||
$where->add($clause);
|
||||
} else {
|
||||
$where = $qb->expr()->andX($clause);
|
||||
}
|
||||
|
||||
$qb->setParameter('actionType', $data['actionType']);
|
||||
$qb
|
||||
->andWhere($qb->expr()->in('acpw.socialAction', ':actionType'))
|
||||
->setParameter('actionType', $data['actionType']);
|
||||
}
|
||||
|
||||
if (count($data['goal']) > 0) {
|
||||
if (!in_array('goal', $qb->getAllAliases(), true)) {
|
||||
$qb->join('acpw.goals', 'goal');
|
||||
if (!in_array('acpw_goal', $qb->getAllAliases(), true)) {
|
||||
$qb->join('acpw.goals', 'acpw_goal');
|
||||
}
|
||||
|
||||
$where->add(
|
||||
$qb->expr()->in('goal.id', ':goals')
|
||||
);
|
||||
$orX = $qb->expr()->orX();
|
||||
foreach ($data['goal'] as $goal) {
|
||||
/** @var Goal $goal */
|
||||
$andX = $qb->expr()->andX();
|
||||
$andX->add($qb->expr()->eq('acpw_goal.goal', $goalId = ':goal_'.uniqid()));
|
||||
$qb->setParameter($goalId, $goal);
|
||||
|
||||
$qb->setParameter('goals', $data['goal']);
|
||||
}
|
||||
|
||||
if (count($data['result']) > 0) {
|
||||
if (!in_array('result', $qb->getAllAliases(), true)) {
|
||||
$qb->join('acpw.results', 'result');
|
||||
if (count($data['result']) > 0) {
|
||||
$orXResult = $qb->expr()->orX();
|
||||
foreach ($data['result'] as $result) {
|
||||
/** @var Result $result */
|
||||
$orXResult->add($qb->expr()->isMemberOf($resultId = ':result_'.uniqid(), 'acpw_goal.results'));
|
||||
$qb->setParameter($resultId, $result);
|
||||
}
|
||||
$andX->add($orXResult);
|
||||
}
|
||||
$orX->add($andX);
|
||||
}
|
||||
|
||||
$where->add(
|
||||
$qb->expr()->in('result.id', ':results')
|
||||
);
|
||||
|
||||
$qb->setParameter('results', $data['result']);
|
||||
$qb->andWhere($orX);
|
||||
}
|
||||
|
||||
$qb->add('where', $where);
|
||||
}
|
||||
|
||||
public function applyOn(): string
|
||||
|
Reference in New Issue
Block a user