Loading src/UnicaenSiham/Exception/SihamException.php +1 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ class SihamException extends \Exception $translateMessage = ''; $defaultMessage = "Un problème est survenu lors de l'appel à l'API SIHAM / " . $message; if (!is_null($previous)) { if (!is_null($previous) && $previous->getMessage() !== $message) { $defaultMessage .= "(" . $previous->getMessage() . ")"; } Loading src/UnicaenSiham/Service/Siham.php +100 −131 Original line number Diff line number Diff line Loading @@ -66,7 +66,6 @@ class Siham protected $result; public function __construct(SihamClient $sihamClient, array $config) { $this->sihamClient = $sihamClient; Loading @@ -90,21 +89,18 @@ class Siham } public function getClient(): SihamClient { return $this->sihamClient; } public function getConfig(): array { return $this->sihamConfig; } /** * Méthode permettant de rechercher une liste d'agent par nom, prénom etc... * Possibilité d'utiliser le joker '?' pour faire des recherches Loading Loading @@ -158,7 +154,6 @@ class Siham } /** * Méthode permettant de récuperer une liste d'agent avec des critères de recherches supplémentaire : nom, prénom, numero INSEE * et date d'observation Loading Loading @@ -234,7 +229,6 @@ class Siham } /** * * Méthode permettant de récupérer les données personnelles d'un agent (Adresse, téléphone, email etc...) Loading Loading @@ -279,7 +273,6 @@ class Siham } /** * * Méthode permettant de récupérer les données administrative d'un agent (Affectation, carrière, contrat etc...) Loading Loading @@ -321,7 +314,6 @@ class Siham } /** * * Méthode permettant de modifier ou créer l'adresse principale d'un agent dans SIHAM Loading Loading @@ -363,7 +355,9 @@ class Siham return true; } else { $message = $result->return->statutMAJ; throw new SihamException($result->return->statutMAJ, 0); $exception = new SihamException($result->return->statutMAJ, 0); $this->sendDebug('WS DossierAgentWebService / METHOD ModifDonneesPersonnelles', $exception); throw $exception; } } } catch (\Exception $e) { Loading @@ -375,7 +369,6 @@ class Siham } /** * * Méthode permettant d'historiser (soft delete) l'adresse d'un agent dans SIHAM Loading Loading @@ -441,7 +434,6 @@ class Siham } /** * * Méthode permettant de modifier ou créer un téléphone (pro, perso) ou un email (pro, perso) d'un agent dans SIHAM Loading Loading @@ -495,7 +487,6 @@ class Siham } /** * * Méthode permettant d'historiser (soft delete) un téléphone (pro, perso) ou un email (pro, perso) d'un agent dans SIHAM Loading Loading @@ -563,7 +554,6 @@ class Siham } public function modifierCoordonnéesBancairesAgent(array $params): bool { $paramsWS = ['ParamMCB' => [ Loading Loading @@ -597,7 +587,6 @@ class Siham } /** * * Méthode permettant la prise en charge (création d'un agent) dans SIHAM. Retour le matricule de l'agent SIHAM qui vient d'être créé. Loading Loading @@ -841,10 +830,13 @@ class Siham ]]; try { $client = $this->sihamClient->getClient('PECWebService'); $result = $client->PriseEnChargeAgent($paramsWS); $this->sendDebug('WS PECWebService / METHOD PriseEnChargeAgent'); } catch (\Exception $e) { $this->sendDebug('WS PECWebService / METHOD PriseEnChargeAgent', $e); throw new SihamException($e->getMessage(), 0, $e); } if ($result->return->statut == 'ERREUR_GENERALE') { $messageErreur = ''; Loading @@ -867,24 +859,22 @@ class Siham } } //Traitement du message d'erreur spécifique à la PEC $this->sendDebug('WS PECWebService / METHOD PriseEnChargeAgent'); throw new SihamException($messageErreur, 0); $exception = new SihamException($messageErreur, 0); $this->sendDebug('WS PECWebService / METHOD PriseEnChargeAgent', $exception); throw $exception; } elseif ($result->return->statut == 'MAJ OK' && !empty($result->return->matricule)) { return $result->return->matricule; } else { $this->sendDebug('WS PECWebService / METHOD PriseEnChargeAgent'); throw new SihamException('Erreur non identifié, veuillez vous rapprocher du support informatique', 0); } } catch (\Exception $e) { $this->sendDebug('WS PECWebService / METHOD PriseEnChargeAgent', $e); throw new SihamException($e->getMessage(), 0, $e); $exception = new SihamException('Erreur non identifié, veuillez vous rapprocher du support informatique', 0); $this->sendDebug('WS PECWebService / METHOD PriseEnChargeAgent', $exception); throw $exception; } return null; } /** * * Méthode permettant le renouvellement d'un agent existant dans SIHAM. Retour le matricule de l'agent SIHAM qui vient d'être créé. Loading Loading @@ -987,13 +977,14 @@ class Siham ]]; try { $client = $this->sihamClient->getClient('PECWebService'); $result = $client->RenouvellementAgent($paramsWS); $this->sendDebug('WS PECWebService / METHOD RenouvellementAgent'); } catch (\Exception $e) { $this->sendDebug('WS PECWebService / METHOD RenouvellementAgent', $e); throw new SihamException($e->getMessage(), 0, $e); } if ($result->return->statut == 'ERREUR_GENERALE') { $messageErreur = ''; $messageWarning = ''; Loading @@ -1015,23 +1006,20 @@ class Siham } } throw new SihamException($messageErreur, 0); $exception = new SihamException($messageErreur, 0); $this->sendDebug('WS PECWebService / METHOD RenouvellementAgent', $exception); throw $exception; } elseif ($result->return->statut == 'MAJ OK' && !empty($result->return->matricule)) { return $result->return->matricule; } else { throw new SihamException('Erreur non identifié, veuillez vous rapprocher du support informatique', 0); $exception = new SihamException('Erreur non identifié, veuillez vous rapprocher du support informatique', 0); $this->sendDebug('WS PECWebService / METHOD RenouvellementAgent', $exception); throw $exception; } } catch (\SoapFault $e) { $this->sendDebug('WS PECWebService / METHOD RenouvellementAgent', $e); throw new SihamException($e->getMessage(), 0, $e); } return null; } public function cloreDossier(array $params): bool { Loading @@ -1056,7 +1044,6 @@ class Siham } /** * * Méthode permettant de récupérer les valeurs d'une nomenclature (code répertoire) de SIHAM Loading Loading @@ -1103,7 +1090,6 @@ class Siham } public function recupererListeStatuts($from = '') { if (!empty($this->sihamConfig['filters'][$this->codeNomenclatureStatuts])) { Loading @@ -1118,7 +1104,6 @@ class Siham } public function recupererListeGrades($from = '') { $params = [ Loading @@ -1131,7 +1116,6 @@ class Siham } public function recupererListeModalites($from = '') { if (!empty($this->sihamConfig['filters'][$this->codeNomenclatureModalites])) { Loading @@ -1148,7 +1132,6 @@ class Siham } public function recupererListePositions($from = '') { if (!empty($this->sihamConfig['filters'][$this->codeNomenclaturePositions])) { Loading @@ -1165,7 +1148,6 @@ class Siham } public function recupererListeEmplois() { if (!empty($this->sihamConfig['filters']['emplois'])) { Loading @@ -1176,7 +1158,6 @@ class Siham } public function recupererListeCorps($from = '') { $params = [ Loading @@ -1189,7 +1170,6 @@ class Siham } public function recupererListeSectionsCnu($from = '') { $params = [ Loading @@ -1202,7 +1182,6 @@ class Siham } public function recupererListeContrats($from = '') { $params = [ Loading @@ -1215,7 +1194,6 @@ class Siham } public function recupererListeFamillesProfessionnelles($from = '') { $params = [ Loading @@ -1228,7 +1206,6 @@ class Siham } public function recupererListeCategories($from = '') { $params = [ Loading @@ -1241,7 +1218,6 @@ class Siham } public function recupererListeEchelons($from = '') { $params = [ Loading @@ -1254,7 +1230,6 @@ class Siham } public function recupererListeAdminsitrations($from = '') { $params = [ Loading @@ -1267,7 +1242,6 @@ class Siham } public function recupererListeEtablissements($from = '') { $params = [ Loading @@ -1280,7 +1254,6 @@ class Siham } public function recupererListeUO(array $params) { //Traitement des listes unité organisationnelle Loading Loading @@ -1348,7 +1321,6 @@ class Siham } public function formatCoordoonneesBancairesForSiham($iban, $bic) { //On récupére l'iban et on doit le décompser pour récupérer les informations nécessaire à SIHAM Loading @@ -1367,21 +1339,18 @@ class Siham } public function getCodeEtablissement() { return $this->codeEtablissement; } public function getCodeAdministration() { return $this->codeAdministration; } public function sendDebug($message = '', $exception = null) { $config = $this->sihamConfig; Loading Loading
src/UnicaenSiham/Exception/SihamException.php +1 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ class SihamException extends \Exception $translateMessage = ''; $defaultMessage = "Un problème est survenu lors de l'appel à l'API SIHAM / " . $message; if (!is_null($previous)) { if (!is_null($previous) && $previous->getMessage() !== $message) { $defaultMessage .= "(" . $previous->getMessage() . ")"; } Loading
src/UnicaenSiham/Service/Siham.php +100 −131 Original line number Diff line number Diff line Loading @@ -66,7 +66,6 @@ class Siham protected $result; public function __construct(SihamClient $sihamClient, array $config) { $this->sihamClient = $sihamClient; Loading @@ -90,21 +89,18 @@ class Siham } public function getClient(): SihamClient { return $this->sihamClient; } public function getConfig(): array { return $this->sihamConfig; } /** * Méthode permettant de rechercher une liste d'agent par nom, prénom etc... * Possibilité d'utiliser le joker '?' pour faire des recherches Loading Loading @@ -158,7 +154,6 @@ class Siham } /** * Méthode permettant de récuperer une liste d'agent avec des critères de recherches supplémentaire : nom, prénom, numero INSEE * et date d'observation Loading Loading @@ -234,7 +229,6 @@ class Siham } /** * * Méthode permettant de récupérer les données personnelles d'un agent (Adresse, téléphone, email etc...) Loading Loading @@ -279,7 +273,6 @@ class Siham } /** * * Méthode permettant de récupérer les données administrative d'un agent (Affectation, carrière, contrat etc...) Loading Loading @@ -321,7 +314,6 @@ class Siham } /** * * Méthode permettant de modifier ou créer l'adresse principale d'un agent dans SIHAM Loading Loading @@ -363,7 +355,9 @@ class Siham return true; } else { $message = $result->return->statutMAJ; throw new SihamException($result->return->statutMAJ, 0); $exception = new SihamException($result->return->statutMAJ, 0); $this->sendDebug('WS DossierAgentWebService / METHOD ModifDonneesPersonnelles', $exception); throw $exception; } } } catch (\Exception $e) { Loading @@ -375,7 +369,6 @@ class Siham } /** * * Méthode permettant d'historiser (soft delete) l'adresse d'un agent dans SIHAM Loading Loading @@ -441,7 +434,6 @@ class Siham } /** * * Méthode permettant de modifier ou créer un téléphone (pro, perso) ou un email (pro, perso) d'un agent dans SIHAM Loading Loading @@ -495,7 +487,6 @@ class Siham } /** * * Méthode permettant d'historiser (soft delete) un téléphone (pro, perso) ou un email (pro, perso) d'un agent dans SIHAM Loading Loading @@ -563,7 +554,6 @@ class Siham } public function modifierCoordonnéesBancairesAgent(array $params): bool { $paramsWS = ['ParamMCB' => [ Loading Loading @@ -597,7 +587,6 @@ class Siham } /** * * Méthode permettant la prise en charge (création d'un agent) dans SIHAM. Retour le matricule de l'agent SIHAM qui vient d'être créé. Loading Loading @@ -841,10 +830,13 @@ class Siham ]]; try { $client = $this->sihamClient->getClient('PECWebService'); $result = $client->PriseEnChargeAgent($paramsWS); $this->sendDebug('WS PECWebService / METHOD PriseEnChargeAgent'); } catch (\Exception $e) { $this->sendDebug('WS PECWebService / METHOD PriseEnChargeAgent', $e); throw new SihamException($e->getMessage(), 0, $e); } if ($result->return->statut == 'ERREUR_GENERALE') { $messageErreur = ''; Loading @@ -867,24 +859,22 @@ class Siham } } //Traitement du message d'erreur spécifique à la PEC $this->sendDebug('WS PECWebService / METHOD PriseEnChargeAgent'); throw new SihamException($messageErreur, 0); $exception = new SihamException($messageErreur, 0); $this->sendDebug('WS PECWebService / METHOD PriseEnChargeAgent', $exception); throw $exception; } elseif ($result->return->statut == 'MAJ OK' && !empty($result->return->matricule)) { return $result->return->matricule; } else { $this->sendDebug('WS PECWebService / METHOD PriseEnChargeAgent'); throw new SihamException('Erreur non identifié, veuillez vous rapprocher du support informatique', 0); } } catch (\Exception $e) { $this->sendDebug('WS PECWebService / METHOD PriseEnChargeAgent', $e); throw new SihamException($e->getMessage(), 0, $e); $exception = new SihamException('Erreur non identifié, veuillez vous rapprocher du support informatique', 0); $this->sendDebug('WS PECWebService / METHOD PriseEnChargeAgent', $exception); throw $exception; } return null; } /** * * Méthode permettant le renouvellement d'un agent existant dans SIHAM. Retour le matricule de l'agent SIHAM qui vient d'être créé. Loading Loading @@ -987,13 +977,14 @@ class Siham ]]; try { $client = $this->sihamClient->getClient('PECWebService'); $result = $client->RenouvellementAgent($paramsWS); $this->sendDebug('WS PECWebService / METHOD RenouvellementAgent'); } catch (\Exception $e) { $this->sendDebug('WS PECWebService / METHOD RenouvellementAgent', $e); throw new SihamException($e->getMessage(), 0, $e); } if ($result->return->statut == 'ERREUR_GENERALE') { $messageErreur = ''; $messageWarning = ''; Loading @@ -1015,23 +1006,20 @@ class Siham } } throw new SihamException($messageErreur, 0); $exception = new SihamException($messageErreur, 0); $this->sendDebug('WS PECWebService / METHOD RenouvellementAgent', $exception); throw $exception; } elseif ($result->return->statut == 'MAJ OK' && !empty($result->return->matricule)) { return $result->return->matricule; } else { throw new SihamException('Erreur non identifié, veuillez vous rapprocher du support informatique', 0); $exception = new SihamException('Erreur non identifié, veuillez vous rapprocher du support informatique', 0); $this->sendDebug('WS PECWebService / METHOD RenouvellementAgent', $exception); throw $exception; } } catch (\SoapFault $e) { $this->sendDebug('WS PECWebService / METHOD RenouvellementAgent', $e); throw new SihamException($e->getMessage(), 0, $e); } return null; } public function cloreDossier(array $params): bool { Loading @@ -1056,7 +1044,6 @@ class Siham } /** * * Méthode permettant de récupérer les valeurs d'une nomenclature (code répertoire) de SIHAM Loading Loading @@ -1103,7 +1090,6 @@ class Siham } public function recupererListeStatuts($from = '') { if (!empty($this->sihamConfig['filters'][$this->codeNomenclatureStatuts])) { Loading @@ -1118,7 +1104,6 @@ class Siham } public function recupererListeGrades($from = '') { $params = [ Loading @@ -1131,7 +1116,6 @@ class Siham } public function recupererListeModalites($from = '') { if (!empty($this->sihamConfig['filters'][$this->codeNomenclatureModalites])) { Loading @@ -1148,7 +1132,6 @@ class Siham } public function recupererListePositions($from = '') { if (!empty($this->sihamConfig['filters'][$this->codeNomenclaturePositions])) { Loading @@ -1165,7 +1148,6 @@ class Siham } public function recupererListeEmplois() { if (!empty($this->sihamConfig['filters']['emplois'])) { Loading @@ -1176,7 +1158,6 @@ class Siham } public function recupererListeCorps($from = '') { $params = [ Loading @@ -1189,7 +1170,6 @@ class Siham } public function recupererListeSectionsCnu($from = '') { $params = [ Loading @@ -1202,7 +1182,6 @@ class Siham } public function recupererListeContrats($from = '') { $params = [ Loading @@ -1215,7 +1194,6 @@ class Siham } public function recupererListeFamillesProfessionnelles($from = '') { $params = [ Loading @@ -1228,7 +1206,6 @@ class Siham } public function recupererListeCategories($from = '') { $params = [ Loading @@ -1241,7 +1218,6 @@ class Siham } public function recupererListeEchelons($from = '') { $params = [ Loading @@ -1254,7 +1230,6 @@ class Siham } public function recupererListeAdminsitrations($from = '') { $params = [ Loading @@ -1267,7 +1242,6 @@ class Siham } public function recupererListeEtablissements($from = '') { $params = [ Loading @@ -1280,7 +1254,6 @@ class Siham } public function recupererListeUO(array $params) { //Traitement des listes unité organisationnelle Loading Loading @@ -1348,7 +1321,6 @@ class Siham } public function formatCoordoonneesBancairesForSiham($iban, $bic) { //On récupére l'iban et on doit le décompser pour récupérer les informations nécessaire à SIHAM Loading @@ -1367,21 +1339,18 @@ class Siham } public function getCodeEtablissement() { return $this->codeEtablissement; } public function getCodeAdministration() { return $this->codeAdministration; } public function sendDebug($message = '', $exception = null) { $config = $this->sihamConfig; Loading