Loading module/Oscar/config/routes.yml +7 −0 Original line number Diff line number Diff line Loading @@ -963,6 +963,7 @@ contract: route: /debug defaults: action: debug timesheet: type: segment options: Loading Loading @@ -1019,12 +1020,14 @@ contract: route: /orphans defaults: action: orphans moveToProject: type: segment options: route: /modifier-projet/:id defaults: action: changeProject show-old: type: segment options: Loading Loading @@ -1151,12 +1154,14 @@ contract: route: /edit/:id defaults: action: edit delete: type: segment options: route: /delete/:id defaults: action: delete duplicate: type: segment options: Loading @@ -1170,12 +1175,14 @@ contract: route: /makeproject/:id defaults: action: makeProject generatenotifications: type: segment options: route: /generer-notifications/:id defaults: action: generateNotifications csv: type: segment options: Loading module/Oscar/src/Oscar/Controller/ProjectGrantController.php +12 −1 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ use Oscar\Formatter\OscarFormatterConst; use Oscar\Hydrator\PcruInfosFormHydrator; use Oscar\OscarVersion; use Oscar\Provider\Privileges; use Oscar\Service\ActivityAvenantsService; use Oscar\Service\ActivityRequestService; use Oscar\Service\ActivityTypeService; use Oscar\Service\DocumentFormatterService; Loading Loading @@ -1041,6 +1042,17 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif $project = $activity->getProject(); //////////////////////////////////////////////////////////////////////////////////////////////////////////// $avenants = $activity->getAvenants(); if (count($avenants)) { /** @var ActivityAvenantsService $avenantService */ $avenantService = $this->getServiceContainer()->get(ActivityAvenantsService::class); foreach ($avenants as $avenant) { $avenantService->deleteAvenantById($avenant->getId()); } } // Récupération des informations annexes foreach ($activity->getPersons() as $activityPerson) { $this->getPersonService()->personActivityRemove($activityPerson); Loading Loading @@ -1080,7 +1092,6 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif $this->getEntityManager()->flush(); } try { $this->getActivityService()->searchDelete($activity->getId()); } catch (Exception $e) { Loading module/Oscar/src/Oscar/Entity/Activity.php +2 −1 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ namespace Oscar\Entity; use Cocur\Slugify\Slugify; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use Laminas\Permissions\Acl\Resource\ResourceInterface; use Laminas\Validator\Date; Loading Loading @@ -732,7 +733,7 @@ class Activity implements ResourceInterface return $this->dateCached; } public function getAvenants(): ArrayCollection public function getAvenants(): Collection { return $this->avenants; } Loading module/Oscar/src/Oscar/Service/ProjectGrantApiService.php +142 −63 Original line number Diff line number Diff line Loading @@ -53,11 +53,22 @@ use UnicaenSignature\Provider\SignaturePrivileges; use UnicaenSignature\Service\SignatureService; use UnicaenSignature\Utils\SignatureConstants; class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseOscarConfigurationService, UseProjectGrantService, UseLoggerService, UseSpentService, UseServiceContainer class ProjectGrantApiService implements UseEntityManager, UseLoggerService, UseOscarConfigurationService, UsePersonService, UseProjectGrantService, UseServiceContainer, UseSpentService { use UseEntityManagerTrait, UsePersonServiceTrait, UseOscarConfigurationServiceTrait, UseProjectGrantServiceTrait, UseLoggerServiceTrait, UseSpentServiceTrait, UseServiceContainerTrait; use UseEntityManagerTrait, UseLoggerServiceTrait, UseOscarConfigurationServiceTrait, UsePersonServiceTrait, UseProjectGrantServiceTrait, UseServiceContainerTrait, UseSpentServiceTrait; ///////////////////////////////////////////////////////////////////////////////////////////////////////// PERIMETRES const PERIMETER_ADMINISTRATION = 'administration'; Loading @@ -75,7 +86,9 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO const PERIMETER_TIMESHEETS = 'timesheets'; const PERIMETER_WORKPACKAGES = 'workpackages'; /** * @return string[] */ public function getPerimetersKeys(): array { return [ Loading @@ -97,6 +110,18 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO } ///////////////////////////////////////////////////////////////////////////////////////////////////////// ENDPOINT /** * @param int $activityId * @param Url|null $urlPlugin * @param OscarUserContext|null $oscarUserContext * @param string|null $perimeters * @return array * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface * @throws NotSupported * @throws OscarException */ public function getActivityJson( int $activityId, ?Url $urlPlugin = null, Loading Loading @@ -158,7 +183,12 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO } } /** * @param OscarUserContext $oscarUserContext * @param Activity $activity * @return array * @throws OscarException */ protected function getRolesCurrentPersonActivity(OscarUserContext $oscarUserContext, Activity $activity): array { return $oscarUserContext->getRolesPersonInActivityDeep( Loading @@ -167,6 +197,14 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO ); } /** * @param Activity $activity * @param OscarUserContext $oscarUserContext * @param array $perimeters * @return array * @throws NotSupported * @throws OscarException */ public function getActivityJsonCredentials( Activity $activity, OscarUserContext $oscarUserContext, Loading @@ -189,8 +227,8 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO foreach ($perimeters as $perimeter) { switch ($perimeter) { case 'administration': $credentials['administration'] = [ case self::PERIMETER_ADMINISTRATION: $credentials[self::PERIMETER_ADMINISTRATION] = [ 'read' => $oscarUserContext->hasPrivileges(Privileges::MAINTENANCE_MENU_ADMIN), ]; break; Loading @@ -202,14 +240,14 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO ]; break; case 'budget': case self::PERIMETER_BUDGET: $credentials['budget'] = [ 'read' => $oscarUserContext->hasPrivileges(Privileges::ACTIVITY_PAYMENT_SHOW, $activity), 'edit' => $oscarUserContext->hasPrivileges(Privileges::ACTIVITY_PAYMENT_MANAGE, $activity), ]; break; case 'core': case self::PERIMETER_CORE: $credentials['core'] = [ 'read' => $oscarUserContext->hasPrivileges( Privileges::ACTIVITY_PERSON_SHOW, Loading @@ -230,8 +268,7 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO ]; break; case 'documents': case self::PERIMETER_DOCUMENTS: $read = $oscarUserContext->hasPrivileges( Privileges::ACTIVITY_DOCUMENT_SHOW, $activity Loading Loading @@ -271,7 +308,7 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO break; case 'notes': case self::PERIMETER_NOTES: $credentials['notes'] = [ 'read' => $oscarUserContext->hasPrivileges(Privileges::ACTIVITY_NOTES_SHOW, $activity), 'edit' => $oscarUserContext->hasPrivileges(Privileges::ACTIVITY_NOTES_MANAGE_USER, $activity), Loading @@ -282,7 +319,7 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO ]; break; case 'milestones': case self::PERIMETER_MILESTONES: $credentials['milestones'] = [ 'read' => $oscarUserContext->hasPrivileges( Privileges::ACTIVITY_MILESTONE_SHOW, Loading @@ -299,7 +336,7 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO ]; break; case 'organizations': case self::PERIMETER_ORGANIZATIONS: $credentials['organizations'] = [ 'edit' => !$locked && $oscarUserContext->hasPrivileges( Privileges::ACTIVITY_ORGANIZATION_MANAGE, Loading @@ -316,7 +353,8 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO 'read' => $oscarUserContext->hasPrivileges(Privileges::ACTIVITY_PAYMENT_SHOW, $activity), ]; break; case 'persons': case self::PERIMETER_PERSONS: $credentials['persons'] = [ 'edit' => !$locked && $oscarUserContext->hasPrivileges( Privileges::ACTIVITY_PERSON_MANAGE, Loading @@ -327,12 +365,13 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO ]; break; case 'project': case self::PERIMETER_PROJECT: $credentials['project'] = [ 'read' => $oscarUserContext->hasPrivileges(Privileges::PROJECT_SHOW, $activity->getProject()), 'edit' => $oscarUserContext->hasPrivileges(Privileges::ACTIVITY_CHANGE_PROJECT, $activity), ]; break; case self::PERIMETER_SPENTS: $credentials['spents'] = [ 'read' => $oscarUserContext->hasPrivileges(Privileges::DEPENSE_SHOW, $activity), Loading Loading @@ -366,6 +405,16 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO return $credentials; } /** * @param Activity $activity * @param Url|null $urlPlugin * @param array|null $perimeters * @return string[] * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface * @throws NotSupported * @throws OscarException */ public function getActivityJsonDatas( Activity $activity, ?Url $urlPlugin = null, Loading Loading @@ -776,6 +825,12 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO return $out; } /** * @param Activity $activity * @param Url|null $urlPlugin * @return array * @throws NotSupported */ public function getNotesActivity( Activity $activity, ?Url $urlPlugin = null Loading Loading @@ -818,7 +873,12 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO ]; } /** * @param Activity $activity * @param Url|null $urlPlugin * @return array * @throws NotSupported */ public function getOrganizationsActivity(Activity $activity, ?Url $urlPlugin = null): array { $entities = []; Loading Loading @@ -918,6 +978,12 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO ]; } /** * @param Activity $activity * @param Url|null $urlPlugin * @return array * @throws NotSupported */ public function getPersonsActivity(Activity $activity, ?Url $urlPlugin = null): array { $output = []; Loading Loading @@ -1173,7 +1239,7 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO return $out; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////// /** * @param \DateTime|null $datetime Loading @@ -1192,6 +1258,64 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO } } /** * @param Activity $activity * @param Url|null $urlPlugin * @return array */ private function getAdministrationActivity(Activity $activity, ?Url $urlPlugin): array { return [ "url_logs" => $urlPlugin->fromRoute('contract/traces', ['id' => $activity->getId()]), ]; } /** * @param Activity $activity * @param Url|null $urlPlugin * @return array * @throws NotSupported */ private function getAvenantsActivity(Activity $activity, ?Url $urlPlugin) :array { $result = $this->getEntityManager() ->getRepository(ActivityAvenant::class) ->getByActivityId($activity->getId()); $out = []; /** @var ActivityAvenant $item */ foreach ($result as $item) { $modifications = []; /** @var ActivityAvenantModification $modification */ foreach ($item->getModifications() as $modification) { $modifications[] = $modification->toJson(); } $out[] = [ 'id' => $item->getId(), 'comment' => $item->getComment(), 'filename' => $item->getFilename(), 'date' => $item->getDateAvenant()->format('Y-m-d'), 'status' => $item->getStatus(), 'status_text' => $item->getStatusLabel(), 'editable' => ActivityAvenant::STATUS_DRAFT === $item->getStatus(), 'modifications' => $modifications, 'url_api' => $urlPlugin->fromRoute('avenant/api', [ 'activity_id' => $activity->getId(), 'avenant_id' => $item->getId() ]), 'url_download' => $urlPlugin->fromRoute('avenant/download', [ 'avenant_id' => $item->getId() ]), ]; } return [ 'url_api' => $urlPlugin->fromRoute('avenant/api', ['activity_id' => $activity->getId()]), 'avenants' => $out ]; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// Repository shortcut Loading Loading @@ -1243,49 +1367,4 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO $formatter->setUrlHelper($urlHelper); return $formatter; } private function getAdministrationActivity(Activity $activity, ?Url $urlPlugin): array { return [ "url_logs" => $urlPlugin->fromRoute('contract/traces', ['id' => $activity->getId()]), ]; } private function getAvenantsActivity(Activity $activity, ?Url $urlPlugin) { $result = $this->getEntityManager()->getRepository(ActivityAvenant::class) ->getByActivityId($activity->getId()); $out = []; /** @var ActivityAvenant $item */ foreach ($result as $item) { $modifications = []; /** @var ActivityAvenantModification $modification */ foreach ($item->getModifications() as $modification) { $modifications[] = $modification->toJson(); } $out[] = [ 'id' => $item->getId(), 'comment' => $item->getComment(), 'filename' => $item->getFilename(), 'date' => $item->getDateAvenant()->format('Y-m-d'), 'status' => $item->getStatus(), 'status_text' => $item->getStatusLabel(), 'editable' => ActivityAvenant::STATUS_DRAFT === $item->getStatus(), 'modifications' => $modifications, 'url_api' => $urlPlugin->fromRoute('avenant/api', [ 'activity_id' => $activity->getId(), 'avenant_id' => $item->getId() ]), 'url_download' => $urlPlugin->fromRoute('avenant/download', [ 'avenant_id' => $item->getId() ]), ]; } return [ 'url_api' => $urlPlugin->fromRoute('avenant/api', ['activity_id' => $activity->getId()]), 'avenants' => $out ]; } } No newline at end of file ui/src/views/Activity.vue +3 −1 Original line number Diff line number Diff line Loading @@ -307,7 +307,9 @@ </p> <p class="texthighlight baseline"> Mots clés : <span class="cartouche xs" style="line-break: anywhere;" v-for="m in core.motscles">{{ m }}</span> <span class="cartouche complementary" style="line-break: anywhere;" v-for="m in core.motscles"> <i class="icon-tag"></i> {{ m }} </span> </p> </div> </div> Loading Loading
module/Oscar/config/routes.yml +7 −0 Original line number Diff line number Diff line Loading @@ -963,6 +963,7 @@ contract: route: /debug defaults: action: debug timesheet: type: segment options: Loading Loading @@ -1019,12 +1020,14 @@ contract: route: /orphans defaults: action: orphans moveToProject: type: segment options: route: /modifier-projet/:id defaults: action: changeProject show-old: type: segment options: Loading Loading @@ -1151,12 +1154,14 @@ contract: route: /edit/:id defaults: action: edit delete: type: segment options: route: /delete/:id defaults: action: delete duplicate: type: segment options: Loading @@ -1170,12 +1175,14 @@ contract: route: /makeproject/:id defaults: action: makeProject generatenotifications: type: segment options: route: /generer-notifications/:id defaults: action: generateNotifications csv: type: segment options: Loading
module/Oscar/src/Oscar/Controller/ProjectGrantController.php +12 −1 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ use Oscar\Formatter\OscarFormatterConst; use Oscar\Hydrator\PcruInfosFormHydrator; use Oscar\OscarVersion; use Oscar\Provider\Privileges; use Oscar\Service\ActivityAvenantsService; use Oscar\Service\ActivityRequestService; use Oscar\Service\ActivityTypeService; use Oscar\Service\DocumentFormatterService; Loading Loading @@ -1041,6 +1042,17 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif $project = $activity->getProject(); //////////////////////////////////////////////////////////////////////////////////////////////////////////// $avenants = $activity->getAvenants(); if (count($avenants)) { /** @var ActivityAvenantsService $avenantService */ $avenantService = $this->getServiceContainer()->get(ActivityAvenantsService::class); foreach ($avenants as $avenant) { $avenantService->deleteAvenantById($avenant->getId()); } } // Récupération des informations annexes foreach ($activity->getPersons() as $activityPerson) { $this->getPersonService()->personActivityRemove($activityPerson); Loading Loading @@ -1080,7 +1092,6 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif $this->getEntityManager()->flush(); } try { $this->getActivityService()->searchDelete($activity->getId()); } catch (Exception $e) { Loading
module/Oscar/src/Oscar/Entity/Activity.php +2 −1 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ namespace Oscar\Entity; use Cocur\Slugify\Slugify; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use Laminas\Permissions\Acl\Resource\ResourceInterface; use Laminas\Validator\Date; Loading Loading @@ -732,7 +733,7 @@ class Activity implements ResourceInterface return $this->dateCached; } public function getAvenants(): ArrayCollection public function getAvenants(): Collection { return $this->avenants; } Loading
module/Oscar/src/Oscar/Service/ProjectGrantApiService.php +142 −63 Original line number Diff line number Diff line Loading @@ -53,11 +53,22 @@ use UnicaenSignature\Provider\SignaturePrivileges; use UnicaenSignature\Service\SignatureService; use UnicaenSignature\Utils\SignatureConstants; class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseOscarConfigurationService, UseProjectGrantService, UseLoggerService, UseSpentService, UseServiceContainer class ProjectGrantApiService implements UseEntityManager, UseLoggerService, UseOscarConfigurationService, UsePersonService, UseProjectGrantService, UseServiceContainer, UseSpentService { use UseEntityManagerTrait, UsePersonServiceTrait, UseOscarConfigurationServiceTrait, UseProjectGrantServiceTrait, UseLoggerServiceTrait, UseSpentServiceTrait, UseServiceContainerTrait; use UseEntityManagerTrait, UseLoggerServiceTrait, UseOscarConfigurationServiceTrait, UsePersonServiceTrait, UseProjectGrantServiceTrait, UseServiceContainerTrait, UseSpentServiceTrait; ///////////////////////////////////////////////////////////////////////////////////////////////////////// PERIMETRES const PERIMETER_ADMINISTRATION = 'administration'; Loading @@ -75,7 +86,9 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO const PERIMETER_TIMESHEETS = 'timesheets'; const PERIMETER_WORKPACKAGES = 'workpackages'; /** * @return string[] */ public function getPerimetersKeys(): array { return [ Loading @@ -97,6 +110,18 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO } ///////////////////////////////////////////////////////////////////////////////////////////////////////// ENDPOINT /** * @param int $activityId * @param Url|null $urlPlugin * @param OscarUserContext|null $oscarUserContext * @param string|null $perimeters * @return array * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface * @throws NotSupported * @throws OscarException */ public function getActivityJson( int $activityId, ?Url $urlPlugin = null, Loading Loading @@ -158,7 +183,12 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO } } /** * @param OscarUserContext $oscarUserContext * @param Activity $activity * @return array * @throws OscarException */ protected function getRolesCurrentPersonActivity(OscarUserContext $oscarUserContext, Activity $activity): array { return $oscarUserContext->getRolesPersonInActivityDeep( Loading @@ -167,6 +197,14 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO ); } /** * @param Activity $activity * @param OscarUserContext $oscarUserContext * @param array $perimeters * @return array * @throws NotSupported * @throws OscarException */ public function getActivityJsonCredentials( Activity $activity, OscarUserContext $oscarUserContext, Loading @@ -189,8 +227,8 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO foreach ($perimeters as $perimeter) { switch ($perimeter) { case 'administration': $credentials['administration'] = [ case self::PERIMETER_ADMINISTRATION: $credentials[self::PERIMETER_ADMINISTRATION] = [ 'read' => $oscarUserContext->hasPrivileges(Privileges::MAINTENANCE_MENU_ADMIN), ]; break; Loading @@ -202,14 +240,14 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO ]; break; case 'budget': case self::PERIMETER_BUDGET: $credentials['budget'] = [ 'read' => $oscarUserContext->hasPrivileges(Privileges::ACTIVITY_PAYMENT_SHOW, $activity), 'edit' => $oscarUserContext->hasPrivileges(Privileges::ACTIVITY_PAYMENT_MANAGE, $activity), ]; break; case 'core': case self::PERIMETER_CORE: $credentials['core'] = [ 'read' => $oscarUserContext->hasPrivileges( Privileges::ACTIVITY_PERSON_SHOW, Loading @@ -230,8 +268,7 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO ]; break; case 'documents': case self::PERIMETER_DOCUMENTS: $read = $oscarUserContext->hasPrivileges( Privileges::ACTIVITY_DOCUMENT_SHOW, $activity Loading Loading @@ -271,7 +308,7 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO break; case 'notes': case self::PERIMETER_NOTES: $credentials['notes'] = [ 'read' => $oscarUserContext->hasPrivileges(Privileges::ACTIVITY_NOTES_SHOW, $activity), 'edit' => $oscarUserContext->hasPrivileges(Privileges::ACTIVITY_NOTES_MANAGE_USER, $activity), Loading @@ -282,7 +319,7 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO ]; break; case 'milestones': case self::PERIMETER_MILESTONES: $credentials['milestones'] = [ 'read' => $oscarUserContext->hasPrivileges( Privileges::ACTIVITY_MILESTONE_SHOW, Loading @@ -299,7 +336,7 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO ]; break; case 'organizations': case self::PERIMETER_ORGANIZATIONS: $credentials['organizations'] = [ 'edit' => !$locked && $oscarUserContext->hasPrivileges( Privileges::ACTIVITY_ORGANIZATION_MANAGE, Loading @@ -316,7 +353,8 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO 'read' => $oscarUserContext->hasPrivileges(Privileges::ACTIVITY_PAYMENT_SHOW, $activity), ]; break; case 'persons': case self::PERIMETER_PERSONS: $credentials['persons'] = [ 'edit' => !$locked && $oscarUserContext->hasPrivileges( Privileges::ACTIVITY_PERSON_MANAGE, Loading @@ -327,12 +365,13 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO ]; break; case 'project': case self::PERIMETER_PROJECT: $credentials['project'] = [ 'read' => $oscarUserContext->hasPrivileges(Privileges::PROJECT_SHOW, $activity->getProject()), 'edit' => $oscarUserContext->hasPrivileges(Privileges::ACTIVITY_CHANGE_PROJECT, $activity), ]; break; case self::PERIMETER_SPENTS: $credentials['spents'] = [ 'read' => $oscarUserContext->hasPrivileges(Privileges::DEPENSE_SHOW, $activity), Loading Loading @@ -366,6 +405,16 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO return $credentials; } /** * @param Activity $activity * @param Url|null $urlPlugin * @param array|null $perimeters * @return string[] * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface * @throws NotSupported * @throws OscarException */ public function getActivityJsonDatas( Activity $activity, ?Url $urlPlugin = null, Loading Loading @@ -776,6 +825,12 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO return $out; } /** * @param Activity $activity * @param Url|null $urlPlugin * @return array * @throws NotSupported */ public function getNotesActivity( Activity $activity, ?Url $urlPlugin = null Loading Loading @@ -818,7 +873,12 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO ]; } /** * @param Activity $activity * @param Url|null $urlPlugin * @return array * @throws NotSupported */ public function getOrganizationsActivity(Activity $activity, ?Url $urlPlugin = null): array { $entities = []; Loading Loading @@ -918,6 +978,12 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO ]; } /** * @param Activity $activity * @param Url|null $urlPlugin * @return array * @throws NotSupported */ public function getPersonsActivity(Activity $activity, ?Url $urlPlugin = null): array { $output = []; Loading Loading @@ -1173,7 +1239,7 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO return $out; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////// /** * @param \DateTime|null $datetime Loading @@ -1192,6 +1258,64 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO } } /** * @param Activity $activity * @param Url|null $urlPlugin * @return array */ private function getAdministrationActivity(Activity $activity, ?Url $urlPlugin): array { return [ "url_logs" => $urlPlugin->fromRoute('contract/traces', ['id' => $activity->getId()]), ]; } /** * @param Activity $activity * @param Url|null $urlPlugin * @return array * @throws NotSupported */ private function getAvenantsActivity(Activity $activity, ?Url $urlPlugin) :array { $result = $this->getEntityManager() ->getRepository(ActivityAvenant::class) ->getByActivityId($activity->getId()); $out = []; /** @var ActivityAvenant $item */ foreach ($result as $item) { $modifications = []; /** @var ActivityAvenantModification $modification */ foreach ($item->getModifications() as $modification) { $modifications[] = $modification->toJson(); } $out[] = [ 'id' => $item->getId(), 'comment' => $item->getComment(), 'filename' => $item->getFilename(), 'date' => $item->getDateAvenant()->format('Y-m-d'), 'status' => $item->getStatus(), 'status_text' => $item->getStatusLabel(), 'editable' => ActivityAvenant::STATUS_DRAFT === $item->getStatus(), 'modifications' => $modifications, 'url_api' => $urlPlugin->fromRoute('avenant/api', [ 'activity_id' => $activity->getId(), 'avenant_id' => $item->getId() ]), 'url_download' => $urlPlugin->fromRoute('avenant/download', [ 'avenant_id' => $item->getId() ]), ]; } return [ 'url_api' => $urlPlugin->fromRoute('avenant/api', ['activity_id' => $activity->getId()]), 'avenants' => $out ]; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// Repository shortcut Loading Loading @@ -1243,49 +1367,4 @@ class ProjectGrantApiService implements UseEntityManager, UsePersonService, UseO $formatter->setUrlHelper($urlHelper); return $formatter; } private function getAdministrationActivity(Activity $activity, ?Url $urlPlugin): array { return [ "url_logs" => $urlPlugin->fromRoute('contract/traces', ['id' => $activity->getId()]), ]; } private function getAvenantsActivity(Activity $activity, ?Url $urlPlugin) { $result = $this->getEntityManager()->getRepository(ActivityAvenant::class) ->getByActivityId($activity->getId()); $out = []; /** @var ActivityAvenant $item */ foreach ($result as $item) { $modifications = []; /** @var ActivityAvenantModification $modification */ foreach ($item->getModifications() as $modification) { $modifications[] = $modification->toJson(); } $out[] = [ 'id' => $item->getId(), 'comment' => $item->getComment(), 'filename' => $item->getFilename(), 'date' => $item->getDateAvenant()->format('Y-m-d'), 'status' => $item->getStatus(), 'status_text' => $item->getStatusLabel(), 'editable' => ActivityAvenant::STATUS_DRAFT === $item->getStatus(), 'modifications' => $modifications, 'url_api' => $urlPlugin->fromRoute('avenant/api', [ 'activity_id' => $activity->getId(), 'avenant_id' => $item->getId() ]), 'url_download' => $urlPlugin->fromRoute('avenant/download', [ 'avenant_id' => $item->getId() ]), ]; } return [ 'url_api' => $urlPlugin->fromRoute('avenant/api', ['activity_id' => $activity->getId()]), 'avenants' => $out ]; } } No newline at end of file
ui/src/views/Activity.vue +3 −1 Original line number Diff line number Diff line Loading @@ -307,7 +307,9 @@ </p> <p class="texthighlight baseline"> Mots clés : <span class="cartouche xs" style="line-break: anywhere;" v-for="m in core.motscles">{{ m }}</span> <span class="cartouche complementary" style="line-break: anywhere;" v-for="m in core.motscles"> <i class="icon-tag"></i> {{ m }} </span> </p> </div> </div> Loading