Bläddra i källkod

cleanup and fix phpstan issues

Olivier Massot 1 år sedan
förälder
incheckning
6717989b50
1 ändrade filer med 2 tillägg och 54 borttagningar
  1. 2 54
      src/Service/Dolibarr/DolibarrSyncService.php

+ 2 - 54
src/Service/Dolibarr/DolibarrSyncService.php

@@ -61,10 +61,6 @@ class DolibarrSyncService
         self::LOCAL_AUTH_PREMIUM_TAG_ID => 'CT School Premium'
     ];
 
-    private const ASSO1901_JURIDIC_FORM_ID = 92;
-    private const ASSO_JURIDIC_FORM_ID = 608;
-    private const LOCAL_AUTH_JURIDIC_FORM_ID = 72;
-
     private LoggerInterface $logger;
 
     public function __construct(
@@ -325,7 +321,7 @@ class DolibarrSyncService
             $currentTags = $this->dolibarrApiService->getSocietyTagsIds($dolibarrSocietyId);
             $expectedTags = [];
 
-            // Association and local auth, with school or school premium products
+            // Association, school or school premium
             if ($organization->getLegalStatus() === LegalEnum::ASSOCIATION_LAW_1901()->getValue()) {
                 if ($product === SettingsProductEnum::SCHOOL()->getValue()) {
                     $expectedTags[] = self::ASSOCIATION_SCHOOL_TAG_ID;
@@ -334,6 +330,7 @@ class DolibarrSyncService
                     $expectedTags[] = self::ASSOCIATION_PREMIUM_TAG_ID;
                 }
             }
+            // Local authorities, school or school premium
             if ($organization->getLegalStatus() === LegalEnum::LOCAL_AUTHORITY()->getValue()) {
                 if ($product === SettingsProductEnum::SCHOOL()->getValue()) {
                     $expectedTags[] = self::LOCAL_AUTH_SCHOOL_TAG_ID;
@@ -451,9 +448,6 @@ class DolibarrSyncService
 
         $this->logger->info('Execution ended');
 
-//        $this->logger->info('Post-script updates');
-//        $this->postscript();
-
         $this->logger->info('Done : ' . $done);
         $this->logger->info('Errors : ' . $errors);
         if ($unknown > 0) {
@@ -837,50 +831,4 @@ class DolibarrSyncService
             );
         }
     }
-
-//    protected function postscript(): void
-//    {
-//        $this->updateTags();
-//    }
-//
-//    protected function updateTags(): void
-//    {
-//        $ASSOCIATION_SCHOOL_TAG_ID = 67;
-//        $ASSOCIATION_PREMIUM_TAG_ID = 69;
-//        $LOCAL_AUTH_SCHOOL_TAG_ID = 68;
-//        $LOCAL_AUTH_PREMIUM_TAG_ID = 70;
-//
-//
-//
-//        $sql = "delete from llx_categorie_societe where fk_categorie=$ASSOCIATION_SCHOOL_TAG_ID;";
-//        $sql = "delete from llx_categorie_societe where fk_categorie=$LOCAL_AUTH_SCHOOL_TAG_ID;";
-//        $sql = "delete from llx_categorie_societe where fk_categorie=$ASSOCIATION_PREMIUM_TAG_ID;";
-//        $sql = "delete from llx_categorie_societe where fk_categorie=$LOCAL_AUTH_PREMIUM_TAG_ID;";
-//
-//        $sql = "insert into llx_categorie_societe (fk_categorie, fk_soc)
-//                select $ASSOCIATION_SCHOOL_TAG_ID, s.rowid
-//                from doliprod.llx_societe s
-//                left join llx_societe_extrafields e on s.rowid = e.fk_object
-//                where s.fk_forme_juridique in (92, 608) and s.client=1 and e.`2iopen_software_opentalent` = 'Opentalent School';";
-//
-//        $sql = "insert into llx_categorie_societe (fk_categorie, fk_soc)
-//                select $ASSOCIATION_PREMIUM_TAG_ID, s.rowid
-//                from doliprod.llx_societe s
-//                left join llx_societe_extrafields e on s.rowid = e.fk_object
-//                where s.fk_forme_juridique in (92, 608) and s.client=1 and e.`2iopen_software_opentalent` = 'Opentalent School Premium';";
-//
-//        $sql = "insert into llx_categorie_societe (fk_categorie, fk_soc)
-//                select $LOCAL_AUTH_SCHOOL_TAG_ID, s.rowid
-//                from doliprod.llx_societe s
-//                left join llx_societe_extrafields e on s.rowid = e.fk_object
-//                where s.fk_forme_juridique = 72 and s.client=1 and e.`2iopen_software_opentalent` = 'Opentalent School';";
-//
-//        $sql = "insert into llx_categorie_societe (fk_categorie, fk_soc)
-//                select $LOCAL_AUTH_PREMIUM_TAG_ID, s.rowid
-//                from doliprod.llx_societe s
-//                left join llx_societe_extrafields e on s.rowid = e.fk_object
-//                where s.fk_forme_juridique = 72 and s.client=1 and e.`2iopen_software_opentalent` = 'Opentalent School Premium';";
-//
-//    }
-
 }