Commit f8d21e18 authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

Merge branch 'master' of git.unicaen.fr:open-source/oscar into starling

parents 816095b4 05d470a3
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1382,6 +1382,7 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif
            $project = null;
        }

        $organizationsCount = 0;
        if (!$this->getOscarUserContextService()->hasPrivileges(Privileges::ACTIVITY_CREATE)) {
            if (!$this->getOscarUserContextService()->hasPrivilegeInOrganizations(
                Privileges::ACTIVITY_CREATE
@@ -1391,7 +1392,8 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif
            $organisationsUser = $this->getOscarUserContextService()->getCurrentUserOrganisationWithPrivilege(
                Privileges::ACTIVITY_CREATE
            );
            if (count($organisationsUser)) {
            $organizationsCount = count($organisationsUser);
            if ($organizationsCount) {
                $withOrganization = $organisationsUser;
                $rolesOrganizations = [];
                /** @var OrganizationRole $role */
@@ -1515,7 +1517,8 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif
                'numerotationKeys'   => $numerotationKeys,
                'numbers_keys'       => $numerotationKeys,
                'allowNodeSelection' => $this->getOscarConfigurationService()->isAllowNodeSelection(),
                "tree"               => $this->getPersonService()->getProjectGrantService()->getActivityTypesTree()
                "tree"               => $this->getPersonService()->getProjectGrantService()->getActivityTypesTree(),
                'organizationsCount' => $organizationsCount,
            ]
        );

+1 −1
Original line number Diff line number Diff line
@@ -282,7 +282,7 @@ class OrganizationRepository extends EntityRepository implements IConnectedRepos
        $qb->select('o')
            ->from(Organization::class, 'o')
            ->where('o.connectors LIKE :search')
            ->setParameter('search', '%"' . $connector . '";s:' . strlen($value) . ':"' . $value . '";%');
            ->setParameter('search', '%"' . $connector . '";s:' . strlen($value) . ':"' . str_replace('_', '\\_', $value) . '";%');
        return $qb;
    }

+1 −1
Original line number Diff line number Diff line
@@ -418,7 +418,7 @@ class PersonRepository extends EntityRepository implements IConnectedRepository
    public function getPersonByConnectorQuery($connector, $value)
    {
        $qb = $this->getEntityManager()->createQueryBuilder();
        $search = sprintf('s:%s:"%s";s:%s:"%s";', strlen($connector), $connector, strlen($value), $value);
        $search = sprintf('s:%s:"%s";s:%s:"%s";', strlen($connector), $connector, strlen($value), str_replace('_', '\\_', $value));
        $qb->select('p')
            ->from(Person::class, 'p')
            ->where('p.connectors LIKE :search')
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@
            <p class="alert alert-danger"><?= $errorRoles ?></p>
            <?php endif; ?>
            <p class="alert alert-info">
                <?= ngettext("Choisissez un rôle pour votre structure.", "Choisisser au moins un rôle pour une de vos structures", count($organizations)) ?><br>
                <?= ngettext("Choisissez un rôle pour votre structure.", "Choisisser au moins un rôle pour une de vos structures", $organizationsCount) ?><br>
            </p>
            <?php foreach ($withOrganization as $org): ?>
                <label for="organization[<?= $org->getId() ?>]"><?= $org ?></label>