Commit b3280e55 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Merge branch 'php8_api' into dev

parents 3562a2ef 69921c70
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@
        "unicaen/auth-token": "^6.0",
        "unicaen/console": "^6.0",
        "unicaen/db-anonym": "^3.0",
        "unicaen/db-import": "dev-release_6.0.3",
        "unicaen/db-import": "dev-feature_synchro_des_ids",
        "unicaen/faq": "^6.0",
        "unicaen/idref": "dev-master",
        "unicaen/ldap": "^6.0",
+6 −6
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
        "This file is @generated automatically"
    ],
    "content-hash": "d8761afbe43a9d45c79a738f195198e1",
    "content-hash": "811942e2c7db736d1a857652c843efb3",
    "packages": [
        {
            "name": "api-skeletons/doctrine-orm-hydration-module",
@@ -11355,11 +11355,11 @@
        },
        {
            "name": "unicaen/db-import",
            "version": "dev-release_6.0.3",
            "version": "dev-feature_synchro_des_ids",
            "source": {
                "type": "git",
                "url": "https://git.unicaen.fr/lib/unicaen/db-import.git",
                "reference": "3d88fec764c1df68eb084a14ab1e46cdb2cbd700"
                "reference": "d86526dc480a796d9528d6a9fba6404867e83c99"
            },
            "require": {
                "beberlei/assert": "^3.3",
@@ -11392,7 +11392,7 @@
                }
            },
            "description": "Module d'import entre bases de données",
            "time": "2023-06-19T12:53:32+00:00"
            "time": "2023-09-11T09:56:01+00:00"
        },
        {
            "name": "unicaen/faq",
@@ -11673,7 +11673,7 @@
            "source": {
                "type": "git",
                "url": "https://git.unicaen.fr/open-source/sygal-api.git",
                "reference": "e3b079b9a3daf0e9d15b08bf09234668513d0fcf"
                "reference": "05beed12953964506e9cb821ccd4c706b8234f69"
            },
            "require": {
                "guzzlehttp/guzzle": "^7.0",
@@ -11698,7 +11698,7 @@
                ]
            },
            "description": "API SyGAL",
            "time": "2023-07-05T15:17:40+00:00"
            "time": "2023-09-18T13:36:44+00:00"
        },
        {
            "name": "unicaen/zfc-user",
+178 −22
Original line number Diff line number Diff line
@@ -215,7 +215,8 @@ const CONFIG_IMPORTS = [
            'table' => 'tmp_structure',
            'connection' => 'default',
            'source_code_column' => 'source_code',
            'id_sequence' => false,
            'id_strategy' => null,
            'id_sequence' => null,
        ],
    ],
    [
@@ -243,7 +244,8 @@ const CONFIG_IMPORTS = [
            'table' => 'tmp_etablissement',
            'connection' => 'default',
            'source_code_column' => 'source_code',
            'id_sequence' => false,
            'id_strategy' => null,
            'id_sequence' => null,
        ],
    ],
    [
@@ -271,7 +273,8 @@ const CONFIG_IMPORTS = [
            'table' => 'tmp_ecole_doct',
            'connection' => 'default',
            'source_code_column' => 'source_code',
            'id_sequence' => false,
            'id_strategy' => null,
            'id_sequence' => null,
        ],
    ],
    [
@@ -299,7 +302,8 @@ const CONFIG_IMPORTS = [
            'table' => 'tmp_unite_rech',
            'connection' => 'default',
            'source_code_column' => 'source_code',
            'id_sequence' => false,
            'id_strategy' => null,
            'id_sequence' => null,
        ],
    ],
    [
@@ -338,7 +342,8 @@ const CONFIG_IMPORTS = [
            'table' => 'tmp_individu',
            'connection' => 'default',
            'source_code_column' => 'source_code',
            'id_sequence' => false,
            'id_strategy' => null,
            'id_sequence' => null,
        ],
    ],
    [
@@ -367,7 +372,8 @@ const CONFIG_IMPORTS = [
            'table' => 'tmp_doctorant',
            'connection' => 'default',
            'source_code_column' => 'source_code',
            'id_sequence' => false,
            'id_strategy' => null,
            'id_sequence' => null,
        ],
    ],
    [
@@ -415,7 +421,8 @@ const CONFIG_IMPORTS = [
            'table' => 'tmp_these',
            'connection' => 'default',
            'source_code_column' => 'source_code',
            'id_sequence' => false,
            'id_strategy' => null,
            'id_sequence' => null,
        ],
    ],
    [
@@ -444,7 +451,8 @@ const CONFIG_IMPORTS = [
            'table' => 'tmp_these_annee_univ',
            'connection' => 'default',
            'source_code_column' => 'source_code',
            'id_sequence' => false,
            'id_strategy' => null,
            'id_sequence' => null,
        ],
    ],
    [
@@ -473,7 +481,8 @@ const CONFIG_IMPORTS = [
            'table' => 'tmp_role',
            'connection' => 'default',
            'source_code_column' => 'source_code',
            'id_sequence' => false,
            'id_strategy' => null,
            'id_sequence' => null,
        ],
    ],
    [
@@ -510,7 +519,8 @@ const CONFIG_IMPORTS = [
            'table' => 'tmp_acteur',
            'connection' => 'default',
            'source_code_column' => 'source_code',
            'id_sequence' => false,
            'id_strategy' => null,
            'id_sequence' => null,
        ],
    ],
    [
@@ -540,7 +550,8 @@ const CONFIG_IMPORTS = [
            'table' => 'tmp_origine_financement',
            'connection' => 'default',
            'source_code_column' => 'source_code',
            'id_sequence' => false,
            'id_strategy' => null,
            'id_sequence' => null,
        ],
    ],
    [
@@ -576,7 +587,8 @@ const CONFIG_IMPORTS = [
            'table' => 'tmp_financement',
            'connection' => 'default',
            'source_code_column' => 'source_code',
            'id_sequence' => false,
            'id_strategy' => null,
            'id_sequence' => null,
        ],
    ],
    [
@@ -610,7 +622,8 @@ const CONFIG_IMPORTS = [
            'table' => 'tmp_titre_acces',
            'connection' => 'default',
            'source_code_column' => 'source_code',
            'id_sequence' => false,
            'id_strategy' => null,
            'id_sequence' => null,
        ],
    ],
    [
@@ -642,7 +655,8 @@ const CONFIG_IMPORTS = [
            'table' => 'tmp_variable',
            'connection' => 'default',
            'source_code_column' => 'source_code',
            'id_sequence' => false,
            'id_strategy' => null,
            'id_sequence' => null,
        ],
    ],
];
@@ -654,8 +668,27 @@ const CONFIG_IMPORTS = [
 */
const CONFIG_SYNCHROS = [
    [
        'name' => 'structure-%s',
        'name' => 'pre-structure-%s',
        'order' => 10,
        'source' => [
            'name' => 'SyGAL',
            'code' => 'app',
            'table' => 'SRC_PRE_STRUCTURE',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
        ],
        'destination' => [
            'name' => 'Application',
            'table' => 'PRE_STRUCTURE',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'id_strategy' => null,
            'id_sequence' => null,
        ],
    ],
    [
        'name' => 'structure-%s',
        'order' => 11,
        'source' => [
            'name' => 'SyGAL',
            'code' => 'app',
@@ -668,11 +701,32 @@ const CONFIG_SYNCHROS = [
            'table' => 'STRUCTURE',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'id_strategy' => 'SEQUENCE',
            'id_sequence' => null,
        ],
    ],
    [
        'name' => 'etablissement-%s',
        'name' => 'pre-etablissement-%s',
        'order' => 20,
        'source' => [
            'name' => 'SyGAL',
            'code' => 'app',
            'table' => 'SRC_PRE_ETABLISSEMENT',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
        ],
        'destination' => [
            'name' => 'Application',
            'table' => 'PRE_ETABLISSEMENT',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'id_strategy' => null,
            'id_sequence' => null,
        ],
    ],
    [
        'name' => 'etablissement-%s',
        'order' => 22,
        'source' => [
            'name' => 'SyGAL',
            'code' => 'app',
@@ -685,11 +739,32 @@ const CONFIG_SYNCHROS = [
            'table' => 'ETABLISSEMENT',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'id_strategy' => 'IDENTITY',
            'id_sequence' => null,
        ],
    ],
    [
        'name' => 'ecole-doctorale-%s',
        'name' => 'pre-ecole-doctorale-%s',
        'order' => 30,
        'source' => [
            'name' => 'SyGAL',
            'code' => 'app',
            'table' => 'SRC_PRE_ECOLE_DOCT',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
        ],
        'destination' => [
            'name' => 'Application',
            'table' => 'PRE_ECOLE_DOCT',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'id_strategy' => null,
            'id_sequence' => null,
        ],
    ],
    [
        'name' => 'ecole-doctorale-%s',
        'order' => 31,
        'source' => [
            'name' => 'SyGAL',
            'code' => 'app',
@@ -702,11 +777,32 @@ const CONFIG_SYNCHROS = [
            'table' => 'ECOLE_DOCT',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'id_strategy' => 'IDENTITY',
            'id_sequence' => null,
        ],
    ],
    [
        'name' => 'unite-recherche-%s',
        'name' => 'pre-unite-recherche-%s',
        'order' => 40,
        'source' => [
            'name' => 'SyGAL',
            'code' => 'app',
            'table' => 'SRC_PRE_UNITE_RECH',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
        ],
        'destination' => [
            'name' => 'Application',
            'table' => 'PRE_UNITE_RECH',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'id_strategy' => null,
            'id_sequence' => null,
        ],
    ],
    [
        'name' => 'unite-recherche-%s',
        'order' => 41,
        'source' => [
            'name' => 'SyGAL',
            'code' => 'app',
@@ -719,11 +815,32 @@ const CONFIG_SYNCHROS = [
            'table' => 'UNITE_RECH',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'id_strategy' => 'IDENTITY',
            'id_sequence' => null,
        ],
    ],
    [
        'name' => 'individu-%s',
        'name' => 'pre-individu-%s',
        'order' => 50,
        'source' => [
            'name' => 'SyGAL',
            'code' => 'app',
            'table' => 'SRC_PRE_INDIVIDU',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
        ],
        'destination' => [
            'name' => 'Application',
            'table' => 'PRE_INDIVIDU',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'id_strategy' => null,
            'id_sequence' => null,
        ],
    ],
    [
        'name' => 'individu-%s',
        'order' => 51,
        'source' => [
            'name' => 'SyGAL',
            'code' => 'app',
@@ -736,11 +853,32 @@ const CONFIG_SYNCHROS = [
            'table' => 'INDIVIDU',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'id_strategy' => 'IDENTITY',
            'id_sequence' => null,
        ],
    ],
    [
        'name' => 'doctorant-%s',
        'name' => 'pre-doctorant-%s',
        'order' => 60,
        'source' => [
            'name' => 'SyGAL',
            'code' => 'app',
            'table' => 'SRC_PRE_DOCTORANT',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
        ],
        'destination' => [
            'name' => 'Application',
            'table' => 'PRE_DOCTORANT',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'id_strategy' => null,
            'id_sequence' => null,
        ],
    ],
    [
        'name' => 'doctorant-%s',
        'order' => 61,
        'source' => [
            'name' => 'SyGAL',
            'code' => 'app',
@@ -753,6 +891,8 @@ const CONFIG_SYNCHROS = [
            'table' => 'DOCTORANT',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'id_strategy' => 'IDENTITY',
            'id_sequence' => null,
        ],
    ],
    [
@@ -770,6 +910,8 @@ const CONFIG_SYNCHROS = [
            'table' => 'THESE',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'id_strategy' => 'SEQUENCE',
            'id_sequence' => null,
        ],
    ],
    [
@@ -787,6 +929,8 @@ const CONFIG_SYNCHROS = [
            'table' => 'THESE_ANNEE_UNIV',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'id_strategy' => 'SEQUENCE',
            'id_sequence' => null,
        ],
    ],
    [
@@ -804,6 +948,8 @@ const CONFIG_SYNCHROS = [
            'table' => 'ROLE',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'id_strategy' => 'SEQUENCE',
            'id_sequence' => null,
        ],
    ],
    [
@@ -821,6 +967,8 @@ const CONFIG_SYNCHROS = [
            'table' => 'ACTEUR',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'id_strategy' => 'SEQUENCE',
            'id_sequence' => null,
        ],
    ],
    [
@@ -838,6 +986,8 @@ const CONFIG_SYNCHROS = [
            'table' => 'ORIGINE_FINANCEMENT',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'id_strategy' => 'SEQUENCE',
            'id_sequence' => null,
        ],
    ],
    [
@@ -855,6 +1005,8 @@ const CONFIG_SYNCHROS = [
            'table' => 'FINANCEMENT',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'id_strategy' => 'SEQUENCE',
            'id_sequence' => null,
        ],
    ],
    [
@@ -872,6 +1024,8 @@ const CONFIG_SYNCHROS = [
            'table' => 'TITRE_ACCES',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'id_strategy' => 'SEQUENCE',
            'id_sequence' => null,
        ],
    ],
    [
@@ -889,6 +1043,8 @@ const CONFIG_SYNCHROS = [
            'table' => 'VARIABLE',
            'connection' => 'default',
            'source_code_column' => 'SOURCE_CODE',
            'id_strategy' => 'IDENTITY', // i.e. inserts avec les mêmes ids que dans la source
            'id_sequence' => null,
        ],
    ],
];
@@ -946,7 +1102,7 @@ function generateNameForEtab(string $nameTemplate, string $codeEtablissement): s

/**
 * Génère la clause à utiliser dans un WHERE pour cibler un établissement précis.
 * @param string $codeEtablissement Code établissement, ex : 'UCN'
 * @param string $codeEtablissement Code établissement maison unique, ex : 'UCN', 'URN', etc.
 * @return string Ex : "d.source_id = (... like 'UCN::%')"
 */
function generateWhereForEtab(string $codeEtablissement): string
@@ -956,7 +1112,7 @@ d.source_id in (
    select source.id from source 
    join etablissement on source.etablissement_id = etablissement.id
    join structure on etablissement.structure_id = structure.id
    where structure.code = '$codeEtablissement'
    where structure.source_code = '$codeEtablissement'
)
EOS;
}
+2 −1
Original line number Diff line number Diff line
@@ -4,7 +4,8 @@
#============================================#

#=============== Établissement =============#
ETAB_CODE='UCN'                             # Code unique identifiant l'établissement
ETAB_CODE='UCN'                             # Code maison unique identifiant l'établissement
ETAB_UAI='0141408E'                         # Code UAI (RNE) de l'établissement
ETAB_SIGLE='Unicaen'                        # Sigle ou surnom de l'établissement
ETAB_LIBELLE='Université de Caen Normandie' # Libellé complet de l'établissement
ETAB_DOMAINE='unicaen.fr'                   # Domaine de l'établissement
+1 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ INPUT_DIR=$(realpath "$INPUT_DIR")
function injectEtabParamsInScript() {
  FILE=$1
  sed -i -e "s|{ETAB_CODE}|${ETAB_CODE}|g" $FILE
  sed -i -e "s|{ETAB_UAI}|${ETAB_UAI}|g" $FILE
  sed -i -e "s|{ETAB_SIGLE}|${ETAB_SIGLE}|g" $FILE
  sed -i -e "s|{ETAB_LIBELLE}|${ETAB_LIBELLE}|g" $FILE
  sed -i -e "s|{ETAB_DOMAINE}|${ETAB_DOMAINE}|g" $FILE
Loading