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

Nouveau service d'import 'titre-acces' fournissant les titres d'accès à l'inscription en thèse.

parent 67e9a12b
......@@ -38,5 +38,7 @@ des acteurs.
## v1.2.1 (??/11/2018)
- [BUGFIX] Une nouvelle colonne apparaît dans la vue SYGAL_INDIVIDU permettant notamment de détecter les acteurs que
Sygal ne sera pas en mesure de reconnaître à la connexion.
- [FEATURE] Une nouvelle colonne apparaît dans la vue SYGAL_INDIVIDU permettant notamment de détecter les acteurs que
Sygal ne sera pas en mesure de reconnaître à la connexion.
- [FEATURE] Une nouvelle vue SYGAL_TITRE_ACCES apparaît pour fournir les titres d'accès à l'inscription en thèse.
......@@ -126,6 +126,97 @@ create or replace view SYGAL_INDIVIDU as
/
```
La nouvelle vue `SYGAL_TITRE_ACCES` doit être créée :
```sql
create or replace view SYGAL_TITRE_ACCES as
with inscription_administrative as (
select
iae.cod_ind,
iae.cod_dip,
iae.cod_vrs_vdi,
dip.lib_dip,
max ( iae.cod_anu ) as cod_anu_der_iae,
min ( iae.cod_nat_tit_acc_iae ) keep ( dense_rank first order by iae.cod_ind, iae.cod_dip, iae.cod_vrs_vdi, iae.cod_nat_tit_acc_iae desc, iae.cod_anu ) as cod_nat_tit_acc_iae,
min ( iae.cod_dip_acc ) keep ( dense_rank first order by iae.cod_ind, iae.cod_dip, iae.cod_vrs_vdi, iae.cod_nat_tit_acc_iae desc, iae.cod_anu ) as cod_dip_acc,
min ( iae.cod_vrs_vdi_acc ) keep ( dense_rank first order by iae.cod_ind, iae.cod_dip, iae.cod_vrs_vdi, iae.cod_nat_tit_acc_iae desc, iae.cod_anu ) as cod_vrs_vdi_acc,
min ( iae.cod_dac_acc ) keep ( dense_rank first order by iae.cod_ind, iae.cod_dip, iae.cod_vrs_vdi, iae.cod_nat_tit_acc_iae desc, iae.cod_anu ) as cod_dac_acc,
min ( iae.cod_tpe_acc_iae ) keep ( dense_rank first order by iae.cod_ind, iae.cod_dip, iae.cod_vrs_vdi, iae.cod_nat_tit_acc_iae desc, iae.cod_anu ) as cod_tpe_acc_iae,
min ( iae.cod_etb_acc_iae ) keep ( dense_rank first order by iae.cod_ind, iae.cod_dip, iae.cod_vrs_vdi, iae.cod_nat_tit_acc_iae desc, iae.cod_anu ) as cod_etb_acc_iae,
min ( iae.cod_dep_pay_acc ) keep ( dense_rank first order by iae.cod_ind, iae.cod_dip, iae.cod_vrs_vdi, iae.cod_nat_tit_acc_iae desc, iae.cod_anu ) as cod_dep_pay_acc,
min ( iae.cod_typ_dep_pay_acc ) keep ( dense_rank first order by iae.cod_ind, iae.cod_dip, iae.cod_vrs_vdi, iae.cod_nat_tit_acc_iae desc, iae.cod_anu ) as cod_typ_dep_pay_acc
from ins_adm_etp iae
join diplome dip on dip.cod_dip = iae.cod_dip
join typ_diplome tpd on tpd.cod_tpd_etb = dip.cod_tpd_etb
where iae.eta_iae = 'E' -- Inscription administrative non annulee
and iae.eta_pmt_iae = 'P' -- Inscription administrative payee
and dip.cod_tpd_etb in ('39', '40') -- Inscription dans un diplome de type doctorat
and tpd.eta_ths_hdr_drt = 'T' -- Inscription en these
and tpd.tem_sante = 'N' -- Exclusion des theses d exercice
group by
iae.cod_ind,
iae.cod_dip,
iae.cod_vrs_vdi,
dip.lib_dip
),
titre_acces as (
select
iae.cod_ind,
iae.cod_dip,
iae.cod_vrs_vdi,
case iae.cod_nat_tit_acc_iae
when 'A' then null
else iae.cod_nat_tit_acc_iae
end as titre_acces_interne_externe,
case iae.cod_nat_tit_acc_iae
when 'I' then vdi.lib_web_vdi
when 'E' then nvl ( dac.lib_web_dac, dac.lib_dac )
end as libelle_titre_acces,
tpe.lib_tpe as type_etb_titre_acces,
case iae.cod_nat_tit_acc_iae
when 'I' then etb_lib.par_vap
when 'E' then etb.lib_etb
end as libelle_etb_titre_acces,
case iae.cod_nat_tit_acc_iae
when 'I' then etb_dep.par_vap
when 'E' then case iae.cod_typ_dep_pay_acc when 'D' then iae.cod_dep_pay_acc else null end
end as code_dept_titre_acces,
case iae.cod_nat_tit_acc_iae
when 'I' then '100'
when 'E' then case iae.cod_typ_dep_pay_acc when 'P' then iae.cod_dep_pay_acc else null end
end as code_pays_titre_acces
from variable_appli etb_cod
cross join variable_appli etb_typ
cross join variable_appli etb_lib
cross join variable_appli etb_dep
cross join inscription_administrative iae
left join version_diplome vdi on vdi.cod_dip = iae.cod_dip_acc and vdi.cod_vrs_vdi = iae.cod_vrs_vdi_acc
left join dip_aut_cur dac on dac.cod_dac = iae.cod_dac_acc
left join typ_etb tpe on tpe.cod_tpe = case iae.cod_nat_tit_acc_iae when 'I' then etb_typ.par_vap when 'E' then iae.cod_tpe_acc_iae end
left join etablissement etb on etb.cod_etb = iae.cod_etb_acc_iae
where etb_cod.cod_vap = 'ETB_COD'
and etb_typ.cod_vap = 'ETB_TYP'
and etb_lib.cod_vap = 'ETB_LIB'
and etb_dep.cod_vap = 'ETB_DEP'
)
select
'apogee' as source_id, -- Id de la source
ths.cod_ths as id, -- Clé primaire de la vue
ths.cod_ths as these_id, -- Identifiant de la these
tac.titre_acces_interne_externe,
tac.libelle_titre_acces,
tac.type_etb_titre_acces,
tac.libelle_etb_titre_acces,
tac.code_dept_titre_acces,
tac.code_pays_titre_acces
from inscription_administrative iae
join these_hdr_sout ths on ths.cod_ind = iae.cod_ind and ths.cod_dip = iae.cod_dip and ths.cod_vrs_vdi = iae.cod_vrs_vdi
join titre_acces tac on tac.cod_ind = iae.cod_ind and tac.cod_dip = iae.cod_dip and tac.cod_vrs_vdi = iae.cod_vrs_vdi
where
tac.titre_acces_interne_externe is not null
;
```
### Physalis
Une nouvelle colonne `SUPANN_ID` doit être ajoutée dans la vue `SYGAL_INDIVIDU`.
......
......@@ -6,6 +6,7 @@ expose_php = Off
#display_startup_errors = On
#error_reporting = E_ALL & ~E_DEPRECATED & ~E_NOTICE
display_errors = Off
;log_errors = On
# NB: ne peut-être supérieur au memory_limit du php.ini
memory_limit = 256M
......
......@@ -22,3 +22,9 @@ pm.max_requests = 500
request_slowlog_timeout = 30
slowlog = /var/log/php5-fpm.slow.log
; Ensure worker stdout and stderr are sent to the main error log.
; catch_workers_output = yes
; error_log = /var/log/php5-fpm.error.log
; access.log = /var/log/php5-fpm.access.log
......@@ -155,6 +155,15 @@ return [
],
],
],
'import-data.rest.doctrine.titre-acces' => [
'type' => 'Segment',
'options' => [
'route' => '/titre-acces[/:titre_acces_id]',
'defaults' => [
'controller' => 'ImportData\\V1\\Rest\\TitreAcces\\Controller',
],
],
],
],
],
'zf-versioning' => [
......@@ -173,6 +182,7 @@ return [
11 => 'import-data.rest.version',
12 => 'import-data.rest.doctrine.origine-financement',
13 => 'import-data.rest.doctrine.financement',
14 => 'import-data.rest.doctrine.titre-acces',
],
],
'zf-rest' => [
......@@ -189,7 +199,7 @@ return [
0 => 'GET',
],
'collection_query_whitelist' => [],
'page_size' => '100',
'page_size' => '250',
'page_size_param' => null,
'entity_class' => \ImportData\V1\Entity\Db\These::class,
'collection_class' => \ImportData\V1\Rest\These\TheseCollection::class,
......@@ -441,6 +451,25 @@ return [
'collection_class' => \ImportData\V1\Rest\Financement\FinancementCollection::class,
'service_name' => 'Financement',
],
'ImportData\\V1\\Rest\\TitreAcces\\Controller' => [
'listener' => \ImportData\V1\Rest\TitreAcces\TitreAccesResource::class,
'route_name' => 'import-data.rest.doctrine.titre-acces',
'route_identifier_name' => 'titre_acces_id',
'entity_identifier_name' => 'id',
'collection_name' => 'titre_acces',
'entity_http_methods' => [
0 => 'GET',
],
'collection_http_methods' => [
0 => 'GET',
],
'collection_query_whitelist' => [],
'page_size' => '100',
'page_size_param' => null,
'entity_class' => \ImportData\V1\Entity\Db\TitreAcces::class,
'collection_class' => \ImportData\V1\Rest\TitreAcces\TitreAccesCollection::class,
'service_name' => 'TitreAcces',
],
],
'zf-content-negotiation' => [
'controllers' => [
......@@ -458,6 +487,7 @@ return [
'ImportData\\V1\\Rest\\Version\\Controller' => 'HalJson',
'ImportData\\V1\\Rest\\OrigineFinancement\\Controller' => 'HalJson',
'ImportData\\V1\\Rest\\Financement\\Controller' => 'HalJson',
'ImportData\\V1\\Rest\\TitreAcces\\Controller' => 'HalJson',
],
'accept-whitelist' => [
'ImportData\\V1\\Rest\\These\\Controller' => [
......@@ -579,6 +609,11 @@ return [
1 => 'application/hal+json',
2 => 'application/json',
],
'ImportData\\V1\\Rest\\TitreAcces\\Controller' => [
0 => 'application/vnd.import-data.v1+json',
1 => 'application/hal+json',
2 => 'application/json',
],
],
'content_type_whitelist' => [
'ImportData\\V1\\Rest\\Structure\\Controller' => [
......@@ -626,6 +661,10 @@ return [
0 => 'application/vnd.import-data.v1+json',
1 => 'application/json',
],
'ImportData\\V1\\Rest\\TitreAcces\\Controller' => [
0 => 'application/vnd.import-data.v1+json',
1 => 'application/json',
],
],
],
'zf-hal' => [
......@@ -785,6 +824,17 @@ return [
'route_name' => 'import-data.rest.doctrine.financement',
'is_collection' => true,
],
\ImportData\V1\Entity\Db\TitreAcces::class => [
'route_identifier_name' => 'titre_acces_id',
'entity_identifier_name' => 'id',
'route_name' => 'import-data.rest.doctrine.titre-acces',
'hydrator' => 'ImportData\\V1\\Rest\\TitreAcces\\TitreAccesHydrator',
],
\ImportData\V1\Rest\TitreAcces\TitreAccesCollection::class => [
'entity_identifier_name' => 'id',
'route_name' => 'import-data.rest.doctrine.titre-acces',
'is_collection' => true,
],
],
],
'zf-apigility' => [
......@@ -845,6 +895,10 @@ return [
'object_manager' => 'doctrine.entitymanager.orm_default',
'hydrator' => 'ImportData\\V1\\Rest\\Financement\\FinancementHydrator',
],
\ImportData\V1\Rest\TitreAcces\TitreAccesResource::class => [
'object_manager' => 'doctrine.entitymanager.orm_default',
'hydrator' => 'ImportData\\V1\\Rest\\TitreAcces\\TitreAccesHydrator',
],
],
],
'doctrine-hydrator' => [
......@@ -939,6 +993,13 @@ return [
'strategies' => [],
'use_generated_hydrator' => true,
],
'ImportData\\V1\\Rest\\TitreAcces\\TitreAccesHydrator' => [
'entity_class' => \ImportData\V1\Entity\Db\TitreAcces::class,
'object_manager' => 'doctrine.entitymanager.orm_default',
'by_value' => true,
'strategies' => [],
'use_generated_hydrator' => true,
],
],
'zf-content-validation' => [
'ImportData\\V1\\Rest\\These\\Controller' => [
......@@ -983,6 +1044,9 @@ return [
'ImportData\\V1\\Rest\\Financement\\Controller' => [
'input_filter' => 'ImportData\\V1\\Rest\\Financement\\Validator',
],
'ImportData\\V1\\Rest\\TitreAcces\\Controller' => [
'input_filter' => 'ImportData\\V1\\Rest\\TitreAcces\\Validator',
],
],
'input_filter_specs' => [
'ImportData\\V1\\Rest\\These\\Validator' => [
......@@ -2175,6 +2239,112 @@ return [
'validators' => [],
],
],
'ImportData\\V1\\Rest\\TitreAcces\\Validator' => [
0 => [
'name' => 'sourceId',
'required' => false,
'filters' => [
0 => [
'name' => \Zend\Filter\StringTrim::class,
],
1 => [
'name' => \Zend\Filter\StripTags::class,
],
],
'validators' => [],
],
1 => [
'name' => 'theseId',
'required' => false,
'filters' => [
0 => [
'name' => \Zend\Filter\StringTrim::class,
],
1 => [
'name' => \Zend\Filter\StripTags::class,
],
],
'validators' => [],
],
2 => [
'name' => 'titreAccesInterneExterne',
'required' => false,
'filters' => [
0 => [
'name' => \Zend\Filter\StringTrim::class,
],
1 => [
'name' => \Zend\Filter\StripTags::class,
],
],
'validators' => [],
],
3 => [
'name' => 'libelleTitreAcces',
'required' => false,
'filters' => [
0 => [
'name' => \Zend\Filter\StringTrim::class,
],
1 => [
'name' => \Zend\Filter\StripTags::class,
],
],
'validators' => [],
],
4 => [
'name' => 'typeEtabTitreAcces',
'required' => false,
'filters' => [
0 => [
'name' => \Zend\Filter\StringTrim::class,
],
1 => [
'name' => \Zend\Filter\StripTags::class,
],
],
'validators' => [],
],
5 => [
'name' => 'libelleEtabTitreAcces',
'required' => false,
'filters' => [
0 => [
'name' => \Zend\Filter\StringTrim::class,
],
1 => [
'name' => \Zend\Filter\StripTags::class,
],
],
'validators' => [],
],
6 => [
'name' => 'codeDeptTitreAcces',
'required' => false,
'filters' => [
0 => [
'name' => \Zend\Filter\StringTrim::class,
],
1 => [
'name' => \Zend\Filter\StripTags::class,
],
],
'validators' => [],
],
7 => [
'name' => 'codePaysTitreAcces',
'required' => false,
'filters' => [
0 => [
'name' => \Zend\Filter\StringTrim::class,
],
1 => [
'name' => \Zend\Filter\StripTags::class,
],
],
'validators' => [],
],
],
],
'zf-mvc-auth' => [
'authorization' => [
......
<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<entity name="ImportData\V1\Entity\Db\TitreAcces" table="SYGAL_TITRE_ACCES">
<id name="id" type="string" column="ID"/>
<field name="sourceId" column="SOURCE_ID" nullable="true"/>
<field name="theseId" column="THESE_ID" nullable="true"/>
<field name="titreAccesInterneExterne" column="TITRE_ACCES_INTERNE_EXTERNE" nullable="true"/>
<field name="libelleTitreAcces" column="LIBELLE_TITRE_ACCES" nullable="true"/>
<field name="typeEtabTitreAcces" column="TYPE_ETB_TITRE_ACCES" nullable="true"/>
<field name="libelleEtabTitreAcces" column="LIBELLE_ETB_TITRE_ACCES" nullable="true"/>
<field name="codeDeptTitreAcces" column="CODE_DEPT_TITRE_ACCES" nullable="true"/>
<field name="codePaysTitreAcces" column="CODE_PAYS_TITRE_ACCES" nullable="true"/>
</entity>
</doctrine-mapping>
<?php
namespace ImportData\V1\Entity\Db;
/**
* TitreAcces
*/
class TitreAcces
{
protected $id;
protected $sourceId;
protected $theseId;
protected $titreAccesInterneExterne;
protected $libelleTitreAcces;
protected $typeEtabTitreAcces;
protected $libelleEtabTitreAcces;
protected $codeDeptTitreAcces;
protected $codePaysTitreAcces;
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @return mixed
*/
public function getSourceId()
{
return $this->sourceId;
}
/**
* @return mixed
*/
public function getTheseId()
{
return $this->theseId;
}
/**
* @return mixed
*/
public function getTitreAccesInterneExterne()
{
return $this->titreAccesInterneExterne;
}
/**
* @return mixed
*/
public function getLibelleTitreAcces()
{
return $this->libelleTitreAcces;
}
/**
* @return mixed
*/
public function getTypeEtabTitreAcces()
{
return $this->typeEtabTitreAcces;
}
/**
* @return mixed
*/
public function getLibelleEtabTitreAcces()
{
return $this->libelleEtabTitreAcces;
}
/**
* @return mixed
*/
public function getCodeDeptTitreAcces()
{
return $this->codeDeptTitreAcces;
}
/**
* @return mixed
*/
public function getCodePaysTitreAcces()
{
return $this->codePaysTitreAcces;
}
}
......@@ -19,7 +19,7 @@ class FetchAll extends DefaultOrm
/** @var QueryBuilder $qb */
$qb = parent::createQuery($event, $entityClass, $parameters);
$qb->orderBy('row.id', 'asc'); // indispensable car les données sont fournies paginées
$qb->orderBy('row.id', 'asc'); // indispensable car les données sont demandées paginées
return $qb;
}
......
<?php
namespace ImportData\V1\Rest\TitreAcces;
use Zend\Paginator\Paginator;
class TitreAccesCollection extends Paginator
{
}
<?php
namespace ImportData\V1\Rest\TitreAcces;
use ZF\Apigility\Doctrine\Server\Resource\DoctrineResource;
class TitreAccesResource extends DoctrineResource
{
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment