Skip to content
Snippets Groups Projects
Commit 1aed81d1 authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

WIP intégration module export rh dans OSE

parent 10ddbf42
No related branches found
No related tags found
No related merge requests found
...@@ -2,11 +2,6 @@ ...@@ -2,11 +2,6 @@
return [ return [
'export-rh' => [ 'export-rh' => [
'siham-ws' => [ 'connecteur' => 'siham',
'actif' => \AppConfig::get('siham-ws', 'actif', false),
'uri' => \AppConfig::get('siham-ws', 'uri'),
'login' => \AppConfig::get('siham-ws', 'login'),
'password' => \AppConfig::get('siham-ws', 'password'),
],
], ],
]; ];
\ No newline at end of file
...@@ -48,6 +48,7 @@ return [ ...@@ -48,6 +48,7 @@ return [
'visualisation-historises' => 'Voir les intervenants historisés', 'visualisation-historises' => 'Voir les intervenants historisés',
'edition' => 'Edition', 'edition' => 'Edition',
'suppression' => 'Suppression', 'suppression' => 'Suppression',
'exporter' => 'Exporter vers SIRH',
'statut-edition' => 'Statuts (Édition)', 'statut-edition' => 'Statuts (Édition)',
'statut-visualisation' => 'Statuts (Visualisation)', 'statut-visualisation' => 'Statuts (Visualisation)',
'autres-visualisation' => 'Champs autres (Visualisation)', 'autres-visualisation' => 'Champs autres (Visualisation)',
......
...@@ -105,6 +105,15 @@ return [ ...@@ -105,6 +105,15 @@ return [
], ],
], ],
], ],
'export' => [
'type' => 'Segment',
'options' => [
'route' => '/:intervenant/export',
'defaults' => [
'action' => 'exporter',
],
],
],
'supprimer' => [ 'supprimer' => [
'type' => 'Segment', 'type' => 'Segment',
'options' => [ 'options' => [
...@@ -505,6 +514,13 @@ return [ ...@@ -505,6 +514,13 @@ return [
Privileges::INTERVENANT_SUPPRESSION, Privileges::INTERVENANT_SUPPRESSION,
], ],
], ],
[
'controller' => 'Application\Controller\Intervenant',
'action' => ['exporter'],
'privileges' => [
Privileges::INTERVENANT_EXPORTER,
],
],
[ [
'controller' => 'Application\Controller\ModificationServiceDu', 'controller' => 'Application\Controller\ModificationServiceDu',
'action' => ['saisir'], 'action' => ['saisir'],
......
...@@ -26,6 +26,7 @@ use Application\Service\Traits\TypeVolumeHoraireServiceAwareTrait; ...@@ -26,6 +26,7 @@ use Application\Service\Traits\TypeVolumeHoraireServiceAwareTrait;
use Application\Service\Traits\UtilisateurServiceAwareTrait; use Application\Service\Traits\UtilisateurServiceAwareTrait;
use Application\Service\Traits\ValidationServiceAwareTrait; use Application\Service\Traits\ValidationServiceAwareTrait;
use Application\Service\Traits\WorkflowServiceAwareTrait; use Application\Service\Traits\WorkflowServiceAwareTrait;
use ExportRh\Connecteur\Siham\SihamConnecteurAwareTrait;
use UnicaenApp\Traits\SessionContainerTrait; use UnicaenApp\Traits\SessionContainerTrait;
use LogicException; use LogicException;
use Application\Entity\Db\Intervenant; use Application\Entity\Db\Intervenant;
...@@ -67,6 +68,7 @@ class IntervenantController extends AbstractController ...@@ -67,6 +68,7 @@ class IntervenantController extends AbstractController
use DossierServiceAwareTrait; use DossierServiceAwareTrait;
use ImportProcessusAwareTrait; use ImportProcessusAwareTrait;
use DifferentielServiceAwareTrait; use DifferentielServiceAwareTrait;
use SihamConnecteurAwareTrait;
public function indexAction() public function indexAction()
...@@ -503,6 +505,29 @@ class IntervenantController extends AbstractController ...@@ -503,6 +505,29 @@ class IntervenantController extends AbstractController
public function exporterAction()
{
/* Initialisation */
$role = $this->getServiceContext()->getSelectedIdentityRole();
$intervenant = $role->getIntervenant() ?: $this->getEvent()->getParam('intervenant');
if (!$intervenant) {
throw new \LogicException('Intervenant non précisé ou inexistant');
}
/* Récupération du dossier de l'intervenant */
$intervenantDossier = $this->getServiceDossier()->getByIntervenant($intervenant);
/* Récupération de la validation du dossier si elle existe */
$intervenantDossierValidation = $this->getServiceDossier()->getValidation($intervenant);
$typeIntervenant = $intervenant->getStatut()->getTypeIntervenant()->getCode();
$test = $this->getSihamConnecteur();
$test->test();
return compact('typeIntervenant', 'intervenant', 'intervenantDossier', 'intervenantDossierValidation');
}
public function historiserAction() public function historiserAction()
{ {
/* @var $intervenant \Application\Entity\Db\Intervenant */ /* @var $intervenant \Application\Entity\Db\Intervenant */
......
...@@ -139,6 +139,7 @@ class Privileges extends \UnicaenAuth\Provider\Privilege\Privileges ...@@ -139,6 +139,7 @@ class Privileges extends \UnicaenAuth\Provider\Privilege\Privileges
const INTERVENANT_RECHERCHE = 'intervenant-recherche'; const INTERVENANT_RECHERCHE = 'intervenant-recherche';
const INTERVENANT_STATUT_EDITION = 'intervenant-statut-edition'; const INTERVENANT_STATUT_EDITION = 'intervenant-statut-edition';
const INTERVENANT_STATUT_VISUALISATION = 'intervenant-statut-visualisation'; const INTERVENANT_STATUT_VISUALISATION = 'intervenant-statut-visualisation';
const INTERVENANT_EXPORTER = 'intervenant-exporter';
const INTERVENANT_SUPPRESSION = 'intervenant-suppression'; const INTERVENANT_SUPPRESSION = 'intervenant-suppression';
const INTERVENANT_VISUALISATION_HISTORISES = 'intervenant-visualisation-historises'; const INTERVENANT_VISUALISATION_HISTORISES = 'intervenant-visualisation-historises';
const MISE_EN_PAIEMENT_DEMANDE = 'mise-en-paiement-demande'; const MISE_EN_PAIEMENT_DEMANDE = 'mise-en-paiement-demande';
......
...@@ -34,6 +34,16 @@ if ($this->isAllowed(Privileges::getResourceId(Privileges::INTERVENANT_EDITION)) ...@@ -34,6 +34,16 @@ if ($this->isAllowed(Privileges::getResourceId(Privileges::INTERVENANT_EDITION))
]; ];
} }
if ($this->isAllowed(Privileges::getResourceId(Privileges::INTERVENANT_EDITION))) {
$tabs[] = [
'id' => 'export-rh',
'label' => '<span class="glyphicon glyphicon-export"></span> Export RH',
'url' => $this->url('intervenant/export', ['intervenant' => $intervenant->getId()]),
'force-refresh' => true,
];
}
if ($this->isAllowed(Privileges::getResourceId(Privileges::INTERVENANT_SUPPRESSION))) { if ($this->isAllowed(Privileges::getResourceId(Privileges::INTERVENANT_SUPPRESSION))) {
$tabs[] = [ $tabs[] = [
'id' => 'suppression', 'id' => 'suppression',
......
...@@ -14,7 +14,7 @@ interface ExportRhInterface ...@@ -14,7 +14,7 @@ interface ExportRhInterface
* *
* @return array * @return array
*/ */
public function intervenantEquivalents(\Application\Entity\Db\Intervenant $intervenant): Intervenant[]; public function intervenantEquivalents(\Application\Entity\Db\Intervenant $intervenant): Intervenant;
......
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
namespace ExportRh\Connecteur\Siham; namespace ExportRh\Connecteur\Siham;
use Application\Entity\Db\Intervenant;
use ExportRh\Connecteur\ExportRhInterface; use ExportRh\Connecteur\ExportRhInterface;
use ExportRh\Entity\Intervenant;
class SihamConnecteur implements ExportRhInterface class SihamConnecteur implements ExportRhInterface
{ {
...@@ -21,16 +22,9 @@ class SihamConnecteur implements ExportRhInterface ...@@ -21,16 +22,9 @@ class SihamConnecteur implements ExportRhInterface
public function intervenantExists(Intervenant $intervenant): bool public function intervenantEquivalents(\Application\Entity\Db\Intervenant $intervenant): Intervenant
{ {
// TODO: Implement intervenantExists() method.
}
public function intervenantDiff(Intervenant $intervenant): array
{
// TODO: Implement intervenantDiff() method.
} }
......
<?php
namespace ExportRh\Connecteur\Siham;
/**
* Description of SihamConnecteurAwareTrait
*
* @author UnicaenCode
*/
trait SihamConnecteurAwareTrait
{
/**
* @var SihamConnecteur
*/
protected $sihamConnecteur;
/**
* @param SihamConnecteur $exportRhService
*
* @return self
*/
public function setSihamConnecteur(SihamConnecteur $sihamConnecteur)
{
$this->sihamConnecteur = $sihamConnecteur;
return $this;
}
/**
* @return SihamConnecteur
*/
public function getSihamConnecteur(): SihamConnecteur
{
if (!$this->sihamConnecteur) {
$this->sihamConnecteur = \Application::$container->get(SihamConnecteur::class);
}
return $this->sihamConnecteur;
}
}
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
namespace ExportRh\Connecteur\Siham; namespace ExportRh\Connecteur\Siham;
use Psr\Container\ContainerInterface; use Psr\Container\ContainerInterface;
use UnicaenSiham\Service\Siham;
use UnicaenSiham\Service\SihamClient;
class SihamConnecteurFactory class SihamConnecteurFactory
{ {
...@@ -16,6 +18,8 @@ class SihamConnecteurFactory ...@@ -16,6 +18,8 @@ class SihamConnecteurFactory
public function __invoke(ContainerInterface $container, $requestedName, $options = null) public function __invoke(ContainerInterface $container, $requestedName, $options = null)
{ {
$config = $container->get('Config'); $config = $container->get('Config');
$client = new Siham();
var_dump($client);
$configSiham = []; $configSiham = [];
if (isset($config['export-rh']['siham-ws'])) { if (isset($config['export-rh']['siham-ws'])) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment