Commit 33bde50f authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

Fix Redmine #66075 : Lors de l'ajout une personne dans les membres d'un...

Fix Redmine #66075 : Lors de l'ajout une personne dans les membres d'un activité, l'état "actif" (affiché barré) est correctement recalculé.
parent 18cf9a0c
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -2423,14 +2423,17 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif
        );

        $out = [
            'organizations' => [],

            'roles'         => $this->getOscarUserContextService()->getRolesOrganizationInActivityArray(),
            'urlNew'        => $this->url()->fromRoute(
                'organizationactivity/new', ['idenroller' => $activity->getId()]
            ),
            'manage'        => $manage
            'manage'        => $manage,
            'organizations' => $this->getProjectGrantApiService()->getOrganizationsActivity($activity, $this->url())['entities']
        ];

        /****

        $editableA = $deletableA = $this->getOscarUserContextService()->hasPrivileges(
            Privileges::ACTIVITY_ORGANIZATION_MANAGE,
            $activity
@@ -2449,9 +2452,6 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif
            ProjectPartner::class       => 'organizationproject'
        ];

        /**
         * @var ActivityOrganization $activityOrganization
         */
        foreach ($activity->getOrganizationsDeep() as $activityOrganization) {
            // Cas particulier (affectation sans rôle)
            // rôle supprimé ? manipulation extérieur
@@ -2527,6 +2527,7 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif
                'end'           => DateTimeUtils::toStr($activityOrganization->getDateEnd(), 'Y-m-d')
            ];
        }
        /****/
        return $this->jsonOutput($out);
    }