Loading module/Oscar/src/Oscar/Formatter/EnrollToArrayFormatter.php +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 Loading @@ -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(); Loading @@ -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; Loading module/Oscar/src/Oscar/Service/ProjectService.php +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 Loading @@ -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; Loading Loading
module/Oscar/src/Oscar/Formatter/EnrollToArrayFormatter.php +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 Loading @@ -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(); Loading @@ -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; Loading
module/Oscar/src/Oscar/Service/ProjectService.php +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 Loading @@ -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; Loading