Commit 418e9f25 authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

FIX : Et les fichiers qui vont avec...

parent 3e09512a
Loading
Loading
Loading
Loading
+6 −16
Changes for module/Oscar/src/Oscar/Formatter/EnrollToArrayFormatter.php: 6 added lines, 16 removed lines.
Original line number Diff line number Diff line
@@ -44,6 +44,12 @@ class EnrollToArrayFormatter
        $showEnrolledPrivilege = $this->getShowEnrolledPrivilege($affectation);
        $context = $this->getContext($affectation);

        if( $affectation->getRoleObj() == null ){
            throw new OscarException(sprintf("%s n'a pas d'objet rôle sur %s.",
                                             $affectation->getEnrolled(),
                                             $affectation->getEnroller()));
        }

        $output['id'] = $affectation->getId();
        $output['enrolledLabel'] = $affectation->getEnrolled()->__toString();
        $output['enrolled'] = $affectation->getEnrolled()->getId();
@@ -60,22 +66,6 @@ class EnrollToArrayFormatter
            $output['urlDelete'] = $this->url->fromRoute($this->getConf($affectation)->delete, ['idenroll' => $affectation->getId()]);
        }


//        if( $context == self::CONTEXT_PROJECT ){
//            if( $this->oscarUserContext->hasPrivileges($manageEnrollPrivilege, $affectation->getEnroller()) ){
//                $manage = true;
//                $output['urlEdit'] = $this->url->fromRoute('personproject/edit', ['idenroll' => $affectation->getId()]);
//                $output['urlDelete'] = $this->url->fromRoute('personproject/delete', ['idenroll' => $affectation->getId()]);
//            }
//        }
//        if( $context == self::CONTEXT_ACTIVITY ){
//            if( $this->oscarUserContext->hasPrivileges($manageEnrollPrivilege, $affectation->getEnroller()) ){
//                $manage = true;
//                $output['urlEdit'] = $this->url->fromRoute('personactivity/edit', ['idenroll' => $affectation->getId()]);
//                $output['urlDelete'] = $this->url->fromRoute('personactivity/delete', ['idenroll' => $affectation->getId()]);
//            }
//        }

        $output['manage'] = $manage;

        return $output;
+4 −0
Changes for module/Oscar/src/Oscar/Service/ProjectService.php: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -600,7 +600,11 @@ class ProjectService implements UseServiceContainer
        );

        foreach ($projet->getOrganisationsDeep() as $organizationProject) {
            try {
                $output['organizations'][] = $organizationProjectFormatter->format($organizationProject);
            } catch (\Exception $exception) {
                $this->getLogger()->error($exception->getMessage());
            }
        }

        return $output;