Commit 59dcd259 authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

Merge branch 'sb/spartan-recall-timesheet' of git.unicaen.fr:open-source/oscar...

Merge branch 'sb/spartan-recall-timesheet' of git.unicaen.fr:open-source/oscar into sb/spartan-recall-timesheet
parents ef1e3e93 54cdc20c
Loading
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -124,7 +124,6 @@ class AdministrationController extends AbstractOscarController implements UsePro
                } catch (\Exception $e) {
                    return $this->getResponseInternalError($e->getMessage());
                }

            }
        );
    }
@@ -140,7 +139,6 @@ class AdministrationController extends AbstractOscarController implements UsePro
    {
        $this->getOscarUserContextService()->check(Privileges::DROIT_ROLE_VISUALISATION);
        if ($this->isAjax()) {

        }
        return [];
    }
@@ -487,7 +485,6 @@ class AdministrationController extends AbstractOscarController implements UsePro
                default:
                    return $this->getResponseBadRequest("Erreur d'API");
            }

        }
        return [];
    }
@@ -1508,7 +1505,6 @@ class AdministrationController extends AbstractOscarController implements UsePro
        }



        return [];
    }

+13 −1
Original line number Diff line number Diff line
@@ -22,7 +22,19 @@ class RecallExceptionRepository extends EntityRepository
        $qb = $this->getBaseIncludeQueryBuilder()
            ->select('p.id');

        $r = $qb->getQuery()->setParameter('include', RecallException::TYPE_INCLUDED)->getArrayResult();
        $r = $qb->getQuery()->getArrayResult();
        return array_map('current', $r);
    }

    /**
     * @return int[]
     */
    public function getExcludedPersonsIds(): array
    {
        $qb = $this->getBaseExcludeQueryBuilder()
            ->select('p.id');

        $r = $qb->getQuery()->getArrayResult();
        return array_map('current', $r);
    }

+4 −5
Original line number Diff line number Diff line
@@ -1511,14 +1511,15 @@ class PersonService implements UseOscarConfigurationService, UseEntityManager, U
    }

    /**
     * Ajout d'une personne dans la liste blanche.
     *
     * @param Person[] $persons
     * @param Person $adder
     */
    public function addDeclarersToWhitelist(array $persons, Person $adder): void
    {
        $included = $this->getRecallExceptionRepository()->getIncludedPersonsIds();
        /** @var RecallExceptionRepository $recallExceptions */
        $recallExceptions = $this->getEntityManager()->getRepository(RecallException::class);

        $included = $recallExceptions->getIncludedPersonsIds();
        foreach ($persons as $person) {
            if (!in_array($person->getId(), $included)) {
                $include = new RecallException();
@@ -1529,7 +1530,6 @@ class PersonService implements UseOscarConfigurationService, UseEntityManager, U
        }
        $this->getEntityManager()->flush();
    }

    /**
     * Liste des personnes dans la liste noire
     *
@@ -1541,7 +1541,6 @@ class PersonService implements UseOscarConfigurationService, UseEntityManager, U
    }



    /**
     * Ajout d'une personne dans la liste noire.
     *