Commit 649b9c35 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

[FIX] Correction de bugs divers

parent eed1c0fc
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
Changelog
=========

5.2.0
-----
- [FIX] Correction de divers bugs.

5.1.1
-----
- [FIX] Import : seules les données issues de la source concernée doivent être préalablement purgées, pas toute la table. 
+19 −12
Original line number Diff line number Diff line
@@ -399,13 +399,14 @@ return [
            [
                'name' => "IMPORT_SIMPLE",
                'source' => [
                    'code'               => 'UTILISATEUR_OCTOPUS',
                    'code'               => 'OCTOPUS', // DOIT correspondre à un `CODE` de la table `SOURCE`
                    'name'               => 'UTILISATEUR_OCTOPUS',
                    'table'              => 'UTILISATEUR', 
                    'connection'         => 'orm_B',
                    'source_code_column' => 'CODE',
                ],
                'destination' => [
                    'code'               => 'TABLE UTILISATEUR LOCALE',
                    'name'               => 'TABLE UTILISATEUR LOCALE',
                    'table'              => 'UTILISATEUR',
                    'connection'         => 'orm_A',
                    'source_code_column' => 'CODE',
@@ -434,12 +435,13 @@ return [
                'name' => "IMPORT_REGIONS_API",
                'source' => [
                    'code'               => 'geo_api', // DOIT correspondre à un `CODE` de la table `SOURCE`
                    'name'               => 'API Geo',
                    'select'             => '/regions?fields=nom,code',
                    'connection'         => 'geo',
                    'source_code_column' => 'code',
                ],
                'destination' => [
                    'code'               => 'Table REGION',
                    'name'               => 'Table REGION',
                    'table'              => 'REGION',
                    'connection'         => 'orm_A',
                    'source_code_column' => 'CODE',
@@ -471,13 +473,14 @@ return [
            [
                'name' => "SYNCHRO_LOCALE_ROLE",
                'source' => [
                    'code'               => 'app',
                    'code'               => 'APP', // DOIT correspondre à un `CODE` de la table `SOURCE`
                    'name'               => 'Roles',
                    'select'             => 'SELECT CODE, LIBELLE, DESCRIPTION FROM SRC_ROLE',
                    'connection'         => 'orm_A',
                    'source_code_column' => 'CODE',
                ],
                'destination' => [
                    'code'               => 'Table ROLE',
                    'name'               => 'Table ROLE',
                    'table'              => 'ROLE',
                    'connection'         => 'orm_A',
                    'source_code_column' => 'CODE',
@@ -515,13 +518,14 @@ return [
            [
                'name' => "SYNCHRO_BDD_EXTERNE",
                'source' => [
                    'code'               => 'UTILISATEUR_OCTOPUS',
                    'code'               => 'OCTOPUS', // DOIT correspondre à un `CODE` de la table `SOURCE`
                    'name'               => 'UTILISATEUR_OCTOPUS',
                    'select'             => 'SELECT CODE, NOM, PRENOM, NAISSANCE FROM UTILISATEUR',
                    'connection'         => 'orm_B',
                    'source_code_column' => 'CODE',
                ],
                'destination' => [
                    'code'               => 'Table UTILISATEUR',
                    'name'               => 'Table UTILISATEUR',
                    'table'              => 'UTILISATEUR',
                    'connection'         => 'orm_A',
                    'source_code_column' => 'CODE',
@@ -559,12 +563,13 @@ return [
                'name' => "SYNCHRO_COMMUNES",
                'source' => [
                    'code'               => 'geo_api', // DOIT correspondre à un `CODE` de la table `SOURCE`
                    'name'               => 'geo_api',
                    'select'             => '/departements/63/communes?fields=nom,code',
                    'connection'         => 'geo',
                    'source_code_column' => 'code',
                ],
                'destination' => [
                    'code'               => 'Table locale',
                    'name'               => 'Table locale',
                    'table'              => 'REGION',
                    'connection'         => 'orm_A',
                    'source_code_column' => 'CODE',
@@ -619,13 +624,14 @@ return [
            [
                'name' => "IMPORT_PRÉALABLE", // Importation des données externes dans une table intermédiaire
                'source' => [
                    'code'               => 'FORMATION_FCA',
                    'code'               => 'FCA', // DOIT correspondre à un `CODE` de la table `SOURCE`
                    'name'               => 'FORMATION_FCA',
                    'select'             => 'SELECT ID, CODE, NOM, COMPOSANTE_CODE FROM FORMATION',
                    'connection'         => 'orm_B',
                    'source_code_column' => 'ID',
                ],
                'destination' => [
                    'code'               => 'Table TMP_FORMATION locale',
                    'name'               => 'Table TMP_FORMATION locale',
                    'table'              => 'TMP_FORMATION',
                    'connection'         => 'orm_A',
                    'source_code_column' => 'ID',
@@ -636,13 +642,14 @@ return [
            [
                'name' => "SYNCHRO_FINALE", // Synchro des données mise en forme vers la table finale
                'source' => [
                    'code'               => 'TABLE SRC_FORMATION DE MA BASE A UTILISANT TMP_FORMATION',
                    'code'               => 'APP', // DOIT correspondre à un `CODE` de la table `SOURCE`
                    'name'               => 'TABLE SRC_FORMATION DE MA BASE A UTILISANT TMP_FORMATION',
                    'select'             => 'SELECT * FROM SRC_FORMATION',
                    'connection'         => 'orm_A',
                    'source_code_column' => 'ID',
                ],
                'destination' => [
                    'code'               => 'TABLE FORMATION DE MA BASE A',
                    'name'               => 'TABLE FORMATION DE MA BASE A',
                    'table'              => 'FORMATION',
                    'connection'         => 'orm_A',
                    'source_code_column' => 'ID',
+1 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ function installLancementMultiple()
        } else {
            btn.addClass('disabled');
        }
        if(urlPattern  === undefined){return;}
        btn.prop("href", urlPattern.replace('__names__', generateNames($checkboxes)));
    }
}
 No newline at end of file
+11 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

namespace UnicaenDbImport\Controller;

use Exception;
use Laminas\Http\PhpEnvironment\Response;
use Laminas\Mvc\Controller\AbstractActionController;
use Laminas\View\Model\JsonModel;
@@ -42,8 +43,13 @@ class SynchroController extends AbstractActionController
        foreach ($synchros as $synchro) {
            $importLog = $this->importLogService->findLastLogForSynchro($synchro);
            $importLogs[$synchro->getName()] = $importLog;
            try{
                $diffCounts[$synchro->getName()] = $this->synchroService->fetchSynchroDiffCount($synchro);
            }
            catch (Exception $e){
                $this->flashMessenger()->addErrorMessage(sprintf("Erreur rencontrée lors du calcul des différences pour la syncho %s", $synchro));
            }
        }

        return [
            'synchros' => $synchros,
@@ -62,7 +68,12 @@ class SynchroController extends AbstractActionController
    {
        $name = $this->params('name');
        $synchro = $this->synchroService->getSynchroByName($name);
        try{
            $diffCount = $this->synchroService->fetchSynchroDiffCount($synchro);
        }
        catch (Exception $e){
            $this->flashMessenger()->addErrorMessage(sprintf("Erreur rencontrée lors du calcul des différences pour la syncho %s", $synchro));
        }
        $importLog = $this->importLogService->findLastLogForSynchro($synchro);

        return [
+1 −1
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ class SourceListener implements EventSubscriber
     * @param EntityManager $entityManager
     * @return Source
     */
    private function fetchDefaultSource(EntityManager $entityManager)
    private function fetchDefaultSource(EntityManager $entityManager): Source
    {
        if ($this->sourceEntityClass === null) {
            throw new RuntimeException("La classe d'entité Source n'a pas été spécifiée");
Loading