Browse Source

change the admin. functions in dolibarr sync, complete translations

Olivier Massot 7 months ago
parent
commit
d5c5d8f1b3

+ 15 - 7
src/Service/Dolibarr/DolibarrSyncService.php

@@ -105,12 +105,6 @@ class DolibarrSyncService
         // Get all active accesses
         $membersIndex = $this->getActiveMembersIndex();
 
-        // Get all the missions with an admin default role
-        $adminMissions = [];
-        foreach ($this->functionTypeRepository->findBy(['roleByDefault' => RoleEnum::ROLE_ADMIN]) as $functionType) {
-            $adminMissions[] = $functionType->getMission()->value;
-        }
-
         // Store networks ids id dolibarr
         $cmfDolibarrId = (int) $this->dolibarrApiService->getSociety(OrganizationIdsEnum::CMF->value)['id'];
         $ffecDolibarrId = (int) $this->dolibarrApiService->getSociety(OrganizationIdsEnum::FFEC->value)['id'];
@@ -188,8 +182,22 @@ class DolibarrSyncService
                 $infos[] = $this->translator->trans('ADHERENTS_COUNT').' : '.
                     $this->countWithMission([FunctionEnum::ADHERENT->value], $organizationMembers);
             }
+
             $infos[] = $this->translator->trans('ADMIN_ACCESS_COUNT').' : '.
-                $this->countWithMission($adminMissions, $organizationMembers);
+                $this->countWithMission(
+                    [
+                        FunctionEnum::NETWORK_ANIMATOR->value, FunctionEnum::ARCHIVIST->value, FunctionEnum::COM_STAFF->value, FunctionEnum::ACCOUNTANT->value,
+                        FunctionEnum::COORDINATOR->value, FunctionEnum::CORRESPONDING->value, FunctionEnum::ADMINISTRATIVE_DIRECTOR->value,
+                        FunctionEnum::ADMINISTRATIVE_DIRECTOR_ASSISTANT->value, FunctionEnum::ADMINISTRATIVE_STAFF->value, FunctionEnum::TECHNICAL_STAFF->value,
+                        FunctionEnum::PRESENTER->value, FunctionEnum::ADMINISTRATIVE_OFFICER->value, FunctionEnum::ADMINISTRATIVE_SECRETARY->value,
+                        FunctionEnum::ACTIVE_MEMBER_OF_THE_CA->value, FunctionEnum::ACTIVE_COOPTED_MEMBER_OF_THE_CA->value, FunctionEnum::ACTIVE_SUBSTITUTE_MEMBER_OF_THE_CA->value,
+                        FunctionEnum::MEMBER_OF_THE_BOARD->value, FunctionEnum::PRESIDENT->value, FunctionEnum::PRESIDENT_ASSISTANT->value, FunctionEnum::SECRETARY->value,
+                        FunctionEnum::ASSISTANT_SECRETARY->value, FunctionEnum::TREASURER->value, FunctionEnum::TREASURER_ASSISTANT->value,
+                        FunctionEnum::VICE_PRESIDENT->value, FunctionEnum::ARTISTIC_DIRECTOR->value, FunctionEnum::ARTISTIC_DIRECTOR_ASSISTANT->value,
+                        FunctionEnum::DIRECTOR->value, FunctionEnum::DIRECTOR_ASSISTANT->value
+                    ],
+                    $organizationMembers
+                );
 
             // /!\ On est forcé de passer la sub-array entière pour mettre à jour le champ modifié, sinon
             //     tous les autres champs seront passés à null...

+ 19 - 1
translations/enum/missions/messages+intl-icu.fr.yaml

@@ -75,7 +75,7 @@ ARCHIVIST: Archiviste
 PRESENTER:  >-
   {gender, select,
   M      {Présentateur}
-  F      {Présentatrice}
+  F      {Présentatrice}f
   other  {Présentateur(ice)}
   }
 ADMINISTRATIVE_STAFF: Personnel administratif
@@ -190,3 +190,21 @@ MEMBER_OF_BOARD_OF_HONOR: Membre d'Honneur du CA
 HONORARY_MEMBER: Membre d'honneur
 BENEFACTOR_MEMBER: Membre bienfaiteur
 HOUR_MEMBER: Membre honoraire
+COM_STAFF : >-
+  {gender, select,
+  M      {Chargé de communication}
+  F      {Chargée de communication}
+  other  {Chargé(e) de communication}
+  }
+ARTISTIC_DIRECTOR : >-
+  {gender, select,
+  M      {Directeur artistique}
+  F      {Directrice artistique}
+  other  {Directeur(ice) artistique}
+  }
+ARTISTIC_DIRECTOR_ASSISTANT : >-
+  {gender, select,
+  M      {Directeur artistique adjoint}
+  F      {Directrice artistique adjoint}
+  other  {Directeur(ice) artistique adjoint(e)}
+  }