Commit 061806ee authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

Utilisation des formats de fichiers configurés dans unicaen-signature pour...

Utilisation des formats de fichiers configurés dans unicaen-signature pour déterminer si le format de fichier est "signable"
parent 539b1750
Loading
Loading
Loading
Loading
Loading
+38 −36
Original line number Diff line number Diff line
@@ -132,7 +132,8 @@ class ProjectGrantApiService implements
        ?Url              $urlPlugin = null,
        ?OscarUserContext $oscarUserContext = null,
        ?string           $perimeters = null
    ): array {
    ): array
    {
        try {
            $activity = $this->getActivityRepository()->find($activityId);
        } catch (\Exception $exception) {
@@ -210,7 +211,8 @@ class ProjectGrantApiService implements
        Activity         $activity,
        OscarUserContext $oscarUserContext,
        array            $perimeters
    ): array {
    ): array
    {
        $locked = $activity->isLocked();
        $editable = $oscarUserContext->hasPrivileges(Privileges::ACTIVITY_EDIT, $activity);
        $lockEditable = $oscarUserContext->hasPrivileges(Privileges::ACTIVITY_EDIT_LOCKED, $activity);
@@ -430,7 +432,8 @@ class ProjectGrantApiService implements
        Activity $activity,
        ?Url     $urlPlugin = null,
        ?array   $perimeters = null
    ): array {
    ): array
    {
        $datas = [
            "api" => "Oscar Activity API"
        ];
@@ -684,16 +687,12 @@ class ProjectGrantApiService implements
                    );
                }
            } else {
                /**

                $allowProcessCreate = true;
                $sService = $this->getServiceContainer()->get(SignatureService::class);
                if (!array_key_exists($doc->getFileTypeMime(), $sService->getSignatureConfigurationService()->getDocumentMimes())) {
                    $allowProcessCreate = false;
                }
                 */
                if (strpos($doc->getFileTypeMime(), 'application/pdf' ) !== false ){
                    $allowProcessCreate = true;
                }
            }

            // Accès aux fonctionnalités du document.
@@ -879,7 +878,8 @@ class ProjectGrantApiService implements
    public function getNotesActivity(
        Activity $activity,
        ?Url     $urlPlugin = null
    ): array {
    ): array
    {
        /** @var ActivityNoteRepository $notesActivityRepository */
        $notesActivityRepository = $this->getEntityManager()->getRepository(ActivityNote::class);

@@ -1144,7 +1144,8 @@ class ProjectGrantApiService implements
    public function getTimesheetsActivity(
        Activity $activity,
        ?Url     $urlPlugin = null
    ): array {
    ): array
    {
        $out = [
            'enabled' => false,
            'informations' => ""
@@ -1295,7 +1296,8 @@ class ProjectGrantApiService implements
    private function formatDateTime(
        ?\DateTime $datetime,
        string     $format = 'Y-m-d H:i:s'
    ): ?string {
    ): ?string
    {
        if ($datetime === null) {
            return null;
        } else {