Loading CHANGELOG.md +2 −1 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ Journal des modifications - [FIX] Bouton 'Générer l'avis de soutenance' HDR : déplacement avant 'Feu vert' et correction des conditions d'affichage. - [FIX] Ajout d'un delete cascade en BDD pour supprimer les justificatifs liés à un fichier supprimé (ex: PV de soutenance). - [FIX] Module STEP-STAR : correction du plantage en cas d'utilisation du filtre établissement dans la recherche de logs. - [FIX] Module STEP-STAR : serrages de vis pour tenter d'éviter les problèmes difficiles à reproduire. - [FIX] Doctorant : initialisation du 'code_apprenant_in_source' pour le cas où le doctorant est créé dans l'application (source SyGAL). 10.1.1 Loading module/StepStar/src/StepStar/Facade/Generate/GenerateFacade.php +43 −20 Original line number Diff line number Diff line Loading @@ -31,7 +31,14 @@ class GenerateFacade public const TEF_DIR_NAME = 'tef'; /** * Le *chemin absolu* du répertoire créé par le module et dans lequel sont générés le fichier * Préfixe (ou "début") du *chemin absolu* du répertoire à créer et dans lequel sont générés les fichiers. * Un hash sera concaténé à ce préfixe pour prévenir la collision de répertoires. * Ex : '/tmp/sygal_stepstar_' */ private string $outputDirPathPrefix; /** * Le *chemin absolu* du répertoire créé par le module et dans lequel sont générés les fichiers * XML intermédiaire (dans un sous répertoire dédié) et les fichiers TEF (idem). * @var string */ Loading @@ -57,13 +64,26 @@ class GenerateFacade * Spécifie le *préfixe du chemin* du répertoire qui sera créé par le module et dans lequel seront générés le fichier * XML intermédiaire (dans un sous répertoire dédié) et les fichiers TEF (idem). * * Exemple : '/tmp/sygal_stepstar_' donnera lieu à la création de répertoires comme ça : * Exemple : '/tmp/sygal_stepstar_' donnera lieu à la création de répertoires suivante : * - /tmp/sygal_stepstar_660165360b1c3/xml : pour le fichier XML intermédiaire, * - /tmp/sygal_stepstar_660165360b1c3/tef : pour les fichiers TEF. */ public function setOutputDirPathPrefix(string $outputDirPathPrefix): void { $this->outputDirPath = uniqid($outputDirPathPrefix); $this->outputDirPathPrefix = $outputDirPathPrefix; $this->outputDirPath = uniqid($this->outputDirPathPrefix, true); $this->xmlThesesOutputDirPath = $this->generateXmlThesesOutputDirPath($this->outputDirPath); $this->tefOutputDirPath = $this->generateTefOutputDirPath($this->outputDirPath); } private function generateXmlThesesOutputDirPath(string $parentDirPath): string { return $parentDirPath . '/' . self::XML_DIR_NAME; } private function generateTefOutputDirPath(string $parentDirPath): string { return $parentDirPath . '/' . self::TEF_DIR_NAME; } /** Loading Loading @@ -92,7 +112,10 @@ class GenerateFacade } /** * Generation du fichier XML intermediaire (1 pour N theses) & des fichiers TEF (1 par these). * Generation : * - fichier XML intermediaire (1 pour N theses) * - fichiers TEF (1 par these). * * **Un Log unique est créé pour cette opération.** * * @param array $theses Thèses concernées Loading @@ -102,15 +125,21 @@ class GenerateFacade */ public function generateFilesForTheses(array $theses, string $command, ?string $tag = null): Log { $this->xmlThesesOutputDirPath = $this->generateXmlThesesOutputDirPath(); $this->tefOutputDirPath = $this->generateTefOutputDirPath(); $operation = Log::OPERATION__GENERATION_XML; $this->newLog($operation, $command, $tag); $this->success = true; try { // fichier XML intermediaire (1 pour N theses) $this->genererXmlFileForThesesToDir($theses); $this->generateTefFilesFromDir(); // fichiers TEF (1 par these) $tefFilesPaths = $this->generateTefFilesFromDir(); if (count($tefFilesPaths) !== count($theses)) { throw new Exception(sprintf( "Le nombre de fichiers TEF générés (%d) devrait être égal au nombre de thèses spécifiées (%d).", count($tefFilesPaths), count($theses) )); } } catch (Exception $e) { $this->appendExceptionToLog($e); $this->success = false; Loading @@ -120,16 +149,6 @@ class GenerateFacade return $this->log; } private function generateXmlThesesOutputDirPath(): string { return $this->outputDirPath . '/' . self::XML_DIR_NAME; } private function generateTefOutputDirPath(): string { return $this->outputDirPath . '/' . self::TEF_DIR_NAME; } /** * @param array $theses Thèses à exporter au format XML. * @return string Chemin du fichier XML généré Loading @@ -138,7 +157,7 @@ class GenerateFacade private function genererXmlFileForThesesToDir(array $theses): string { if (!is_dir($this->xmlThesesOutputDirPath)) { $ok = mkdir($this->xmlThesesOutputDirPath, 0777, true); $ok = mkdir($this->xmlThesesOutputDirPath, 0600, true); if (!$ok) { throw new Exception("Impossible de créer le répertoire '$this->xmlThesesOutputDirPath'."); } Loading Loading @@ -189,9 +208,11 @@ class GenerateFacade } /** * @return string[] Liste des chemins des fichiers TEF générés. * * @throws \Exception */ private function generateTefFilesFromDir(): void private function generateTefFilesFromDir(): array { $this->appendToLog(sprintf( "Generation des fichiers TEF (1 par these) dans %s, a partir du repertoire %s :", Loading Loading @@ -226,6 +247,8 @@ class GenerateFacade } else { $this->log->setTefFilePath($paths[0]); } return $paths; } /** Loading module/StepStar/src/StepStar/Service/Fetch/FetchService.php +2 −2 Original line number Diff line number Diff line Loading @@ -133,8 +133,8 @@ class FetchService ->leftJoin('ed.structure', 'eds') ->leftJoin('ur.structure', 'urs') ->leftJoin('t.acteurs', 'a', Join::WITH, 'a.histoDestruction is null') ->leftJoin('a.individu', 'ai', Join::WITH, 'ai.histoDestruction is null') ->leftJoin('a.role', 'r', Join::WITH, 'r.histoDestruction is null') ->leftJoin('a.individu', 'ai') ->leftJoin('a.role', 'r') ->andWhereNotHistorise() ->orderBy('es.sourceCode, t.id'); Loading module/StepStar/src/StepStar/Service/Tef/TefService.php +1 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ class TefService throw new TefServiceException("Le répertoire destination spécifié existe déjà : " . $this->outputDir); } mkdir($this->outputDir, 0777, true); mkdir($this->outputDir, 0600, true); } /** Loading module/StepStar/src/StepStar/Service/Xml/XmlService.php +15 −5 Original line number Diff line number Diff line Loading @@ -332,13 +332,18 @@ class XmlService return $validTheses; } /** * @param array $these */ private function validateThese(array $these) private function validateThese(array $these): void { Assert::notNull($these['ecoleDoctorale'], sprintf("La thèse %d n'est liée à aucune ED", $these['id'])); Assert::notNull($these['uniteRecherche'], sprintf("La thèse %d n'est liée à aucune UR", $these['id'])); Assert::notEmpty( $this->extractCodeEtudiant($these), sprintf("Aucun code disponible pour le doctorant %s de la thèse %d.", $these['doctorant']['individu']['nomPatronymique'], $these['id'] ) ); } /** Loading Loading @@ -427,7 +432,7 @@ class XmlService $data = [ // doctorant self::CODE_ETUDIANT => $these['doctorant']['individu']['supannId'], // NB: identifiant unique considéré par STEP-STAR comme immuable self::CODE_ETUDIANT => $this->extractCodeEtudiant($these), // NB: identifiant unique considéré par STEP-STAR comme immuable self::CODE_INE => $these['doctorant']['ine'], self::PPN_DOCTORANT => $these['doctorant']['individu']['idRef'] ?? null, self::NOM_ETUDIANT => $these['doctorant']['individu']['nomPatronymique'] ?: $these['doctorant']['individu']['nomUsuel'], Loading Loading @@ -550,6 +555,11 @@ class XmlService return array_filter($data); } private function extractCodeEtudiant(array $these): ?string { return $these['doctorant']['individu']['supannId'] ?: $these['doctorant']['codeApprenantInSource']; } private function extractStructureEtablissement(array $these): array { return $these['etablissement']['structure']; Loading Loading
CHANGELOG.md +2 −1 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ Journal des modifications - [FIX] Bouton 'Générer l'avis de soutenance' HDR : déplacement avant 'Feu vert' et correction des conditions d'affichage. - [FIX] Ajout d'un delete cascade en BDD pour supprimer les justificatifs liés à un fichier supprimé (ex: PV de soutenance). - [FIX] Module STEP-STAR : correction du plantage en cas d'utilisation du filtre établissement dans la recherche de logs. - [FIX] Module STEP-STAR : serrages de vis pour tenter d'éviter les problèmes difficiles à reproduire. - [FIX] Doctorant : initialisation du 'code_apprenant_in_source' pour le cas où le doctorant est créé dans l'application (source SyGAL). 10.1.1 Loading
module/StepStar/src/StepStar/Facade/Generate/GenerateFacade.php +43 −20 Original line number Diff line number Diff line Loading @@ -31,7 +31,14 @@ class GenerateFacade public const TEF_DIR_NAME = 'tef'; /** * Le *chemin absolu* du répertoire créé par le module et dans lequel sont générés le fichier * Préfixe (ou "début") du *chemin absolu* du répertoire à créer et dans lequel sont générés les fichiers. * Un hash sera concaténé à ce préfixe pour prévenir la collision de répertoires. * Ex : '/tmp/sygal_stepstar_' */ private string $outputDirPathPrefix; /** * Le *chemin absolu* du répertoire créé par le module et dans lequel sont générés les fichiers * XML intermédiaire (dans un sous répertoire dédié) et les fichiers TEF (idem). * @var string */ Loading @@ -57,13 +64,26 @@ class GenerateFacade * Spécifie le *préfixe du chemin* du répertoire qui sera créé par le module et dans lequel seront générés le fichier * XML intermédiaire (dans un sous répertoire dédié) et les fichiers TEF (idem). * * Exemple : '/tmp/sygal_stepstar_' donnera lieu à la création de répertoires comme ça : * Exemple : '/tmp/sygal_stepstar_' donnera lieu à la création de répertoires suivante : * - /tmp/sygal_stepstar_660165360b1c3/xml : pour le fichier XML intermédiaire, * - /tmp/sygal_stepstar_660165360b1c3/tef : pour les fichiers TEF. */ public function setOutputDirPathPrefix(string $outputDirPathPrefix): void { $this->outputDirPath = uniqid($outputDirPathPrefix); $this->outputDirPathPrefix = $outputDirPathPrefix; $this->outputDirPath = uniqid($this->outputDirPathPrefix, true); $this->xmlThesesOutputDirPath = $this->generateXmlThesesOutputDirPath($this->outputDirPath); $this->tefOutputDirPath = $this->generateTefOutputDirPath($this->outputDirPath); } private function generateXmlThesesOutputDirPath(string $parentDirPath): string { return $parentDirPath . '/' . self::XML_DIR_NAME; } private function generateTefOutputDirPath(string $parentDirPath): string { return $parentDirPath . '/' . self::TEF_DIR_NAME; } /** Loading Loading @@ -92,7 +112,10 @@ class GenerateFacade } /** * Generation du fichier XML intermediaire (1 pour N theses) & des fichiers TEF (1 par these). * Generation : * - fichier XML intermediaire (1 pour N theses) * - fichiers TEF (1 par these). * * **Un Log unique est créé pour cette opération.** * * @param array $theses Thèses concernées Loading @@ -102,15 +125,21 @@ class GenerateFacade */ public function generateFilesForTheses(array $theses, string $command, ?string $tag = null): Log { $this->xmlThesesOutputDirPath = $this->generateXmlThesesOutputDirPath(); $this->tefOutputDirPath = $this->generateTefOutputDirPath(); $operation = Log::OPERATION__GENERATION_XML; $this->newLog($operation, $command, $tag); $this->success = true; try { // fichier XML intermediaire (1 pour N theses) $this->genererXmlFileForThesesToDir($theses); $this->generateTefFilesFromDir(); // fichiers TEF (1 par these) $tefFilesPaths = $this->generateTefFilesFromDir(); if (count($tefFilesPaths) !== count($theses)) { throw new Exception(sprintf( "Le nombre de fichiers TEF générés (%d) devrait être égal au nombre de thèses spécifiées (%d).", count($tefFilesPaths), count($theses) )); } } catch (Exception $e) { $this->appendExceptionToLog($e); $this->success = false; Loading @@ -120,16 +149,6 @@ class GenerateFacade return $this->log; } private function generateXmlThesesOutputDirPath(): string { return $this->outputDirPath . '/' . self::XML_DIR_NAME; } private function generateTefOutputDirPath(): string { return $this->outputDirPath . '/' . self::TEF_DIR_NAME; } /** * @param array $theses Thèses à exporter au format XML. * @return string Chemin du fichier XML généré Loading @@ -138,7 +157,7 @@ class GenerateFacade private function genererXmlFileForThesesToDir(array $theses): string { if (!is_dir($this->xmlThesesOutputDirPath)) { $ok = mkdir($this->xmlThesesOutputDirPath, 0777, true); $ok = mkdir($this->xmlThesesOutputDirPath, 0600, true); if (!$ok) { throw new Exception("Impossible de créer le répertoire '$this->xmlThesesOutputDirPath'."); } Loading Loading @@ -189,9 +208,11 @@ class GenerateFacade } /** * @return string[] Liste des chemins des fichiers TEF générés. * * @throws \Exception */ private function generateTefFilesFromDir(): void private function generateTefFilesFromDir(): array { $this->appendToLog(sprintf( "Generation des fichiers TEF (1 par these) dans %s, a partir du repertoire %s :", Loading Loading @@ -226,6 +247,8 @@ class GenerateFacade } else { $this->log->setTefFilePath($paths[0]); } return $paths; } /** Loading
module/StepStar/src/StepStar/Service/Fetch/FetchService.php +2 −2 Original line number Diff line number Diff line Loading @@ -133,8 +133,8 @@ class FetchService ->leftJoin('ed.structure', 'eds') ->leftJoin('ur.structure', 'urs') ->leftJoin('t.acteurs', 'a', Join::WITH, 'a.histoDestruction is null') ->leftJoin('a.individu', 'ai', Join::WITH, 'ai.histoDestruction is null') ->leftJoin('a.role', 'r', Join::WITH, 'r.histoDestruction is null') ->leftJoin('a.individu', 'ai') ->leftJoin('a.role', 'r') ->andWhereNotHistorise() ->orderBy('es.sourceCode, t.id'); Loading
module/StepStar/src/StepStar/Service/Tef/TefService.php +1 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ class TefService throw new TefServiceException("Le répertoire destination spécifié existe déjà : " . $this->outputDir); } mkdir($this->outputDir, 0777, true); mkdir($this->outputDir, 0600, true); } /** Loading
module/StepStar/src/StepStar/Service/Xml/XmlService.php +15 −5 Original line number Diff line number Diff line Loading @@ -332,13 +332,18 @@ class XmlService return $validTheses; } /** * @param array $these */ private function validateThese(array $these) private function validateThese(array $these): void { Assert::notNull($these['ecoleDoctorale'], sprintf("La thèse %d n'est liée à aucune ED", $these['id'])); Assert::notNull($these['uniteRecherche'], sprintf("La thèse %d n'est liée à aucune UR", $these['id'])); Assert::notEmpty( $this->extractCodeEtudiant($these), sprintf("Aucun code disponible pour le doctorant %s de la thèse %d.", $these['doctorant']['individu']['nomPatronymique'], $these['id'] ) ); } /** Loading Loading @@ -427,7 +432,7 @@ class XmlService $data = [ // doctorant self::CODE_ETUDIANT => $these['doctorant']['individu']['supannId'], // NB: identifiant unique considéré par STEP-STAR comme immuable self::CODE_ETUDIANT => $this->extractCodeEtudiant($these), // NB: identifiant unique considéré par STEP-STAR comme immuable self::CODE_INE => $these['doctorant']['ine'], self::PPN_DOCTORANT => $these['doctorant']['individu']['idRef'] ?? null, self::NOM_ETUDIANT => $these['doctorant']['individu']['nomPatronymique'] ?: $these['doctorant']['individu']['nomUsuel'], Loading Loading @@ -550,6 +555,11 @@ class XmlService return array_filter($data); } private function extractCodeEtudiant(array $these): ?string { return $these['doctorant']['individu']['supannId'] ?: $these['doctorant']['codeApprenantInSource']; } private function extractStructureEtablissement(array $these): array { return $these['etablissement']['structure']; Loading