Commit 0a0bbc2c authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

Merge branch 'master' into spartan

parents 6ea3c029 16ee6ba5
Loading
Loading
Loading
Loading
Loading

doc/problems.md

0 → 100644
+28 −0
Original line number Diff line number Diff line
# Problème connus


## Installation

### Composer : Your requirements could not be resolved to an installable set of packages.

Vous êtes sur PHP 7.4, et composer retourne cette erreur : 

```
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for mpdf/mpdf v7.1.9 -> satisfiable by mpdf/mpdf[v7.1.9].
- mpdf/mpdf v7.1.9 requires php ^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 -> your PHP version (7.4.21) does not satisfy that requirement.
Problem 2
- mpdf/mpdf v7.1.9 requires php ^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 -> your PHP version (7.4.21) does not satisfy that requirement.
- unicaen/app 3.1.12 requires mpdf/mpdf ^7.1 -> satisfiable by mpdf/mpdf[v7.1.9].
- Installation request for unicaen/app 3.1.12 -> satisfiable by unicaen/app[3.1.12].
```

Utiliser la commande *composer* suivant pour ignore les problèmes liès à la version de PHP : 

```
composer install --ignore-platform-reqs
```
 No newline at end of file
+14 −0
Original line number Diff line number Diff line
@@ -379,7 +379,21 @@ class OscarCheckConfigCommand extends OscarCommandAbstract
            $io->warning(sprintf(" ~ CONNECTOR > PERSONS : Pas de connecteur person : %s", $e->getMessage()));
        }

        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ///
        /// GEARMMAN
        ///
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        $io->section(" ### GEARMAN : ");


        // On teste la présence du worker
        $oscarWorkerFile = __DIR__ . '/../../../../../config/oscarworker.service';
        if( !file_exists($oscarWorkerFile)) {
            $io->error("Le fichier OscarWorker est absent (config/oscarworker.service)");
            die();
        }

        $io->write(sprintf("* Envoi d'un job 'HELLO' à Gearman sur '%s' : ", $oscarConfig->getGearmanHost()));
        $client = new \GearmanClient();
        try {
+1 −1
Original line number Diff line number Diff line
@@ -34,6 +34,6 @@ class OscarNotificationsMailsPersonsCommand extends OscarCommandAbstract
        /** @var PersonService $oscarConfig */
        $personService = $this->getServicemanager()->get(PersonService::class);

        $personService->mailPersonsWithUnreadNotification();
        $personService->mailPersonsWithUnreadNotification(null, $io);
    }
}
 No newline at end of file
+123 −88
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
 *
 * @copyright Certic (c) 2015
 */

namespace Oscar\Controller;

use BjyAuthorize\Exception\UnAuthorizedException;
@@ -82,9 +83,11 @@ class ProjectController extends AbstractOscarController

    protected function htmlProjectDetail($project)
    {
        $view = new ViewModel([
        $view = new ViewModel(
            [
                'project' => $project
        ]);
            ]
        );
        $view->setTerminal(true);
        $view->setTemplate('/oscar/project/details');

@@ -169,14 +172,9 @@ class ProjectController extends AbstractOscarController

    public function emptyAction()
    {
        $projects = $this->getProjectService()->getBaseQuery()
            ->where('g.id IS NULL');
        $orderBy = $this->params()->fromQuery('sort', 'p.dateUpdated');
        $projects->orderBy($orderBy, 'DESC');


        $projects = $this->getProjectService()->getEmptyProject();
        return array(
            'projects' => $projects->getQuery()->getResult(),
            'projects' => $projects,
            'search' => '',
        );
    }
@@ -188,7 +186,6 @@ class ProjectController extends AbstractOscarController
     */
    public function newAction()
    {

        // Récupération de/des activités à associer
        $activitiesIds = $this->params()->fromQuery('ids', null);
        $activities = [];
@@ -204,8 +201,13 @@ class ProjectController extends AbstractOscarController
            }

            foreach ($activities as $activity) {
                if( !$this->getOscarUserContextService()->hasPrivileges(Privileges::ACTIVITY_CHANGE_PROJECT, $activity) ){
                    throw new UnAuthorizedException(_("Vous n'avez les les droits suffisant pour modifier le projet de l'activité '%s'", $activity));
                if (!$this->getOscarUserContextService()->hasPrivileges(
                    Privileges::ACTIVITY_CHANGE_PROJECT,
                    $activity
                )) {
                    throw new UnAuthorizedException(
                        _("Vous n'avez les les droits suffisant pour modifier le projet de l'activité '%s'", $activity)
                    );
                }
                $activities[] = $activity;
            }
@@ -232,9 +234,15 @@ class ProjectController extends AbstractOscarController
            }

            // Liste des organisations de l'utilisateur
            $organizations = $this->getOscarUserContextService()->getCurrentUserOrganisationWithPrivilege(Privileges::PROJECT_CREATE);
            $organizations = $this->getOscarUserContextService()->getCurrentUserOrganisationWithPrivilege(
                Privileges::PROJECT_CREATE
            );

            foreach ($this->getEntityManager()->getRepository(OrganizationRole::class)->findBy(['principal' => true]) as $role) {
            foreach (
                $this->getEntityManager()->getRepository(OrganizationRole::class)->findBy(
                    ['principal' => true]
                ) as $role
            ) {
                if ($role->isPrincipal()) {
                    $organizationRoles[$role->getId()] = $role;
                }
@@ -245,11 +253,9 @@ class ProjectController extends AbstractOscarController
        /** @var Request $request */
        $request = $this->getRequest();
        if ($this->getRequest()->isPost()) {

            $form->setData($request->getPost());

            if ($form->isValid()) {

                $assoDatas = [];

                if ($organizations) {
@@ -264,9 +270,9 @@ class ProjectController extends AbstractOscarController
                        }
                    }

                    if( count($assoDatas) )
                    if (count($assoDatas)) {
                        $organizationRolesError = "";

                    }
                }

                if (!$organizationRolesError) {
@@ -303,11 +309,17 @@ class ProjectController extends AbstractOscarController
                        LogActivity::LEVEL_INCHARGE
                    );

                    $this->flashMessenger()->addSuccessMessage(sprintf("Le projet '%s' a bien été créé.",
                        $entity->log()));
                    $this->flashMessenger()->addSuccessMessage(
                        sprintf(
                            "Le projet '%s' a bien été créé.",
                            $entity->log()
                        )
                    );

                    return $this->redirect()->toRoute('project/show',
                        array('id' => $entity->getId()));
                    return $this->redirect()->toRoute(
                        'project/show',
                        array('id' => $entity->getId())
                    );
                }
            }
        }
@@ -343,13 +355,14 @@ class ProjectController extends AbstractOscarController

        $structures = $this->getEntityManager()->getRepository(OrganizationPerson::class)->createQueryBuilder('s')
            ->where('s.person = :person AND s.role IN(:roles)')
            ->setParameters([
            ->setParameters(
                [
                    'person' => $currentPerson,
                    'roles' => $roles,
            ])
                ]
            )
            ->getQuery()
            ->getResult()
        ;
            ->getResult();


        $projects = [];
@@ -365,16 +378,21 @@ class ProjectController extends AbstractOscarController
            }
            /** @var ProjectPartner $partner */
            foreach ($organizationPerson->getOrganization()->getProjects() as $partner) {
                if( in_array($partner->getRole(), $this->getOscarUserContextService()->getRolesOrganisationLeader()))
                if (in_array($partner->getRole(), $this->getOscarUserContextService()->getRolesOrganisationLeader())) {
                    $projects[$orgaId]['projects'][] = $partner->getProject();
                }
            }
            /** @var ActivityOrganization $activityPartner */
            foreach ($organizationPerson->getOrganization()->getActivities() as $activityPartner) {
                // Cas des activités sans projet
                if( $activityPartner->getActivity()->getProject() && in_array($activityPartner->getRole(), $this->getOscarUserContextService()->getRolesOrganisationLeader()) )
                if ($activityPartner->getActivity()->getProject() && in_array(
                        $activityPartner->getRole(),
                        $this->getOscarUserContextService()->getRolesOrganisationLeader()
                    )) {
                    $projects[$orgaId]['projects'][] = $activityPartner->getActivity()->getProject();
                }
            }
        }

        return [
            'email' => $currentPerson->getEmail(),
@@ -416,11 +434,13 @@ class ProjectController extends AbstractOscarController
            }
        }

        $view = new ViewModel(array(
        $view = new ViewModel(
            array(
                'id' => $id,
                'project' => $entity,
                'form' => $form,
        ));
            )
        );

        $view->setTemplate('oscar/project/new');

@@ -442,10 +462,12 @@ class ProjectController extends AbstractOscarController
            ->getRepository('Oscar\Entity\Project')
            ->getSingle($id, ['ignoreDateMember' => true]);

        $view = new ViewModel(array(
        $view = new ViewModel(
            array(
                'id' => $id,
                'project' => $project
        ));
            )
        );
        $view->setTemplate('oscar/project/managemembers');

        return $view;
@@ -499,12 +521,14 @@ class ProjectController extends AbstractOscarController
        $_SESSION['token_' . $tokenName] = $tokenValue;


        $view = new ViewModel([
        $view = new ViewModel(
            [
                'tokenName' => $tokenName,
                'tokenValue' => $tokenValue,
                'urlCancel' => $this->url()->fromRoute('project/show', ['id' => $projectId]),
                'message' => 'Cette opération va supprimer les partenaires des activités déjà présents dans le projet et déplacer dans le projet les partenaires communs à toutes les activités',
        ]);
            ]
        );
        $view->setTemplate('/oscar/prototype/confirm.phtml');
        return $view;
    }
@@ -531,12 +555,14 @@ class ProjectController extends AbstractOscarController
        $_SESSION['token_' . $tokenName] = $tokenValue;


        $view = new ViewModel([
        $view = new ViewModel(
            [
                'tokenName' => $tokenName,
                'tokenValue' => $tokenValue,
                'urlCancel' => $this->url()->fromRoute('project/show', ['id' => $projectId]),
                'message' => 'Cette opération va supprimer les membres des activités déjà présents dans le projet et déplacer dans le projet les membres communs à toutes les activités',
        ]);
            ]
        );
        $view->setTemplate('/oscar/prototype/confirm.phtml');
        return $view;
    }
@@ -576,7 +602,9 @@ class ProjectController extends AbstractOscarController
    public function searchAction()
    {
        if (!$this->getOscarUserContextService()->hasPrivileges(Privileges::ACTIVITY_CHANGE_PROJECT)) {
            if( !$this->getOscarUserContextService()->hasPrivilegeInOrganizations(Privileges::ACTIVITY_CHANGE_PROJECT) ){
            if (!$this->getOscarUserContextService()->hasPrivilegeInOrganizations(
                Privileges::ACTIVITY_CHANGE_PROJECT
            )) {
                return $this->getResponseUnauthorized("Vous n'avez pas accès à la liste des projets.");
            }
        }
@@ -591,10 +619,11 @@ class ProjectController extends AbstractOscarController
            'datas' => []
        ];

        /** @var Project $data */
        foreach ($datas as $data) {
            $json['datas'][] = [
                'id' => $data->getId(),
                'label' => $data->getLabel(),
                'label' => $data->getLabel() . " - " . count($data->getActivities()) . " activité(s)",
                'acronym' => $data->getAcronym(),
                'description' => $data->getDescription(),
            ];
@@ -627,10 +656,12 @@ class ProjectController extends AbstractOscarController

        $organisation = $qb->getQuery()->execute(array('id' => $id));

        $viewModel = new ViewModel(array(
        $viewModel = new ViewModel(
            array(
                'organization' => $organisation[0],
                'projects' => $organisation[0]->getProjects(),
        ));
            )
        );
        $viewModel->setTemplate('oscar/project/search');

        return $viewModel;
@@ -653,15 +684,19 @@ class ProjectController extends AbstractOscarController
            ->orderBy('pj.dateCreated', 'DESC')
            ->where('p.id = :id');

        $person = $qb->getQuery()->setParameter('id',
            $id)->getOneOrNullResult();
        $person = $qb->getQuery()->setParameter(
            'id',
            $id
        )->getOneOrNullResult();
        // $projects = $em->getRepository('Oscar\Entity\Project')->allByPerson($id);

        $viewModel = new ViewModel(array(
        $viewModel = new ViewModel(
            array(
                'person' => $person,
                'search' => '',
                'projects' => $person->getProjectAffectations(),
        ));
            )
        );
        $viewModel->setTemplate('oscar/project/search');

        return $viewModel;
+413 −385

File changed.

Preview size limit exceeded, changes collapsed.

Loading