Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
open-source
OSE
Commits
1d097333
Commit
1d097333
authored
Apr 23, 2019
by
Laurent Lécluse
Browse files
Mise en place des indicateurs pour les types de fonctions référentielles
parent
39320d67
Changes
5
Hide whitespace changes
Inline
Side-by-side
bdd/update/08.1.sql
View file @
1d097333
...
...
@@ -5827,3 +5827,136 @@ ALTER TABLE fonction_referentiel
INSERT
INTO
plafond
(
ID
,
CODE
,
LIBELLE
)
VALUES
(
plafond_id_seq
.
nextval
,
'ref-par-fonction-mere'
,
'Heures max. de référentiel par intervenant et par type de fonction référentielle'
);
INSERT
INTO
indicateur
(
ID
,
TYPE
,
ORDRE
,
ENABLED
,
NUMERO
,
LIBELLE_SINGULIER
,
LIBELLE_PLURIEL
,
ROUTE
,
TEM_DISTINCT
,
TEM_NOT_STRUCTURE
,
MESSAGE
)
VALUES
(
indicateur_id_seq
.
nextval
,
'Enseignements et référentiel <em>Permanents</em>'
,
1211
,
1
,
1211
,
'%s intervenant a des heures de référentiel <i>prévisionnel</i> dépassant le plafond autorisé pour le type de fonction correspondant'
,
'%s intervenants ont des heures de référentiel <i>prévisionnel</i> dépassant le plafond autorisé pour le type de fonction correspondant'
,
'intervenant/services'
,
1
,
0
,
NULL
);
INSERT
INTO
indicateur
(
ID
,
TYPE
,
ORDRE
,
ENABLED
,
NUMERO
,
LIBELLE_SINGULIER
,
LIBELLE_PLURIEL
,
ROUTE
,
TEM_DISTINCT
,
TEM_NOT_STRUCTURE
,
MESSAGE
)
VALUES
(
indicateur_id_seq
.
nextval
,
'Enseignements et référentiel <em>Permanents</em>'
,
1221
,
1
,
1221
,
'%s intervenant a des heures de référentiel <i>réalisé</i> dépassant le plafond autorisé pour le type de fonction correspondant'
,
'%s intervenants ont des heures de référentiel <i>réalisé</i> dépassant le plafond autorisé pour le type de fonction correspondant'
,
'intervenant/services'
,
1
,
0
,
NULL
);
CREATE
OR
REPLACE
FORCE
VIEW
V_INDICATEUR_1211
AS
SELECT
i
.
id
id
,
i
.
annee_id
,
i
.
id
intervenant_id
,
i
.
structure_id
,
AVG
(
t
.
plafond
)
plafond
,
AVG
(
t
.
heures
)
heures
FROM
(
SELECT
vhr
.
type_volume_horaire_id
type_volume_horaire_id
,
sr
.
intervenant_id
intervenant_id
,
fr
.
plafond
plafond
,
fr
.
id
fr_id
,
SUM
(
vhr
.
heures
)
heures
FROM
service_referentiel
sr
JOIN
fonction_referentiel
frf
ON
frf
.
id
=
sr
.
fonction_id
JOIN
fonction_referentiel
fr
ON
fr
.
id
=
frf
.
parent_id
JOIN
volume_horaire_ref
vhr
ON
vhr
.
service_referentiel_id
=
sr
.
id
AND
vhr
.
histo_destruction
IS
NULL
JOIN
type_volume_horaire
tvh
ON
tvh
.
id
=
vhr
.
type_volume_horaire_id
AND
tvh
.
code
=
'PREVU'
WHERE
sr
.
histo_destruction
IS
NULL
GROUP
BY
vhr
.
type_volume_horaire_id
,
sr
.
intervenant_id
,
fr
.
plafond
,
fr
.
id
)
t
JOIN
intervenant
i
ON
i
.
id
=
t
.
intervenant_id
WHERE
t
.
heures
>
t
.
plafond
/*i.id*/
GROUP
BY
t
.
type_volume_horaire_id
,
i
.
annee_id
,
i
.
id
,
i
.
structure_id
;
CREATE
OR
REPLACE
FORCE
VIEW
V_INDICATEUR_1221
AS
SELECT
i
.
id
id
,
i
.
annee_id
,
i
.
id
intervenant_id
,
i
.
structure_id
,
AVG
(
t
.
plafond
)
plafond
,
AVG
(
t
.
heures
)
heures
FROM
(
SELECT
vhr
.
type_volume_horaire_id
type_volume_horaire_id
,
sr
.
intervenant_id
intervenant_id
,
fr
.
plafond
plafond
,
fr
.
id
fr_id
,
SUM
(
vhr
.
heures
)
heures
FROM
service_referentiel
sr
JOIN
fonction_referentiel
frf
ON
frf
.
id
=
sr
.
fonction_id
JOIN
fonction_referentiel
fr
ON
fr
.
id
=
frf
.
parent_id
JOIN
volume_horaire_ref
vhr
ON
vhr
.
service_referentiel_id
=
sr
.
id
AND
vhr
.
histo_destruction
IS
NULL
JOIN
type_volume_horaire
tvh
ON
tvh
.
id
=
vhr
.
type_volume_horaire_id
AND
tvh
.
code
=
'REALISE'
WHERE
sr
.
histo_destruction
IS
NULL
GROUP
BY
vhr
.
type_volume_horaire_id
,
sr
.
intervenant_id
,
fr
.
plafond
,
fr
.
id
)
t
JOIN
intervenant
i
ON
i
.
id
=
t
.
intervenant_id
WHERE
t
.
heures
>
t
.
plafond
/*i.id*/
GROUP
BY
t
.
type_volume_horaire_id
,
i
.
annee_id
,
i
.
id
,
i
.
structure_id
;
\ No newline at end of file
module/Application/src/Application/Entity/Db/Indicateur/Indicateur1211.php
0 → 100755
View file @
1d097333
<?php
namespace
Application\Entity\Db\Indicateur
;
use
UnicaenApp\Util
;
class
Indicateur1211
extends
AbstractIndicateur
{
/**
* @var float
*/
private
$plafond
;
/**
* @var float
*/
private
$heures
;
/**
* @return float
*/
public
function
getPlafond
()
{
return
$this
->
plafond
;
}
/**
* @param float $plafond
*
* @return self
*/
public
function
setPlafond
(
$plafond
)
{
$this
->
plafond
=
$plafond
;
return
$this
;
}
/**
* @return float
*/
public
function
getHeures
()
{
return
$this
->
heures
;
}
/**
* @param float $heures
*
* @return self
*/
public
function
setHeures
(
$heures
)
{
$this
->
heures
=
$heures
;
return
$this
;
}
/**
* Retourne les détails concernant l'indicateur
*
* @return string|null
*/
public
function
getDetails
()
{
if
(
$this
->
getPlafond
()
==
0
){
return
sprintf
(
'heures = %s'
,
Util
::
formattedNumber
(
$this
->
getHeures
())
);
}
else
{
return
sprintf
(
'heures = %s (plafond = %s)'
,
Util
::
formattedNumber
(
$this
->
getHeures
()),
Util
::
formattedNumber
(
$this
->
getPlafond
())
);
}
}
}
module/Application/src/Application/Entity/Db/Indicateur/Indicateur1221.php
0 → 100755
View file @
1d097333
<?php
namespace
Application\Entity\Db\Indicateur
;
use
UnicaenApp\Util
;
class
Indicateur1221
extends
AbstractIndicateur
{
/**
* @var float
*/
private
$plafond
;
/**
* @var float
*/
private
$heures
;
/**
* @return float
*/
public
function
getPlafond
()
{
return
$this
->
plafond
;
}
/**
* @param float $plafond
*
* @return self
*/
public
function
setPlafond
(
$plafond
)
{
$this
->
plafond
=
$plafond
;
return
$this
;
}
/**
* @return float
*/
public
function
getHeures
()
{
return
$this
->
heures
;
}
/**
* @param float $heures
*
* @return self
*/
public
function
setHeures
(
$heures
)
{
$this
->
heures
=
$heures
;
return
$this
;
}
/**
* Retourne les détails concernant l'indicateur
*
* @return string|null
*/
public
function
getDetails
()
{
if
(
$this
->
getPlafond
()
==
0
){
return
sprintf
(
'heures = %s'
,
Util
::
formattedNumber
(
$this
->
getHeures
())
);
}
else
{
return
sprintf
(
'heures = %s (plafond = %s)'
,
Util
::
formattedNumber
(
$this
->
getHeures
()),
Util
::
formattedNumber
(
$this
->
getPlafond
())
);
}
}
}
module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Indicateur.Indicateur1211.dcm.xml
0 → 100755
View file @
1d097333
<?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=
"Application\Entity\Db\Indicateur\Indicateur1211"
table=
"V_INDICATEUR_1211"
read-only=
"true"
>
<id
name=
"id"
type=
"integer"
column=
"ID"
/>
<field
name=
"heures"
type=
"float"
column=
"HEURES"
precision=
"126"
scale=
"0"
nullable=
"false"
/>
<field
name=
"plafond"
type=
"float"
column=
"PLAFOND"
precision=
"126"
scale=
"0"
nullable=
"false"
/>
<many-to-one
field=
"annee"
target-entity=
"Application\Entity\Db\Annee"
>
<join-column
name=
"ANNEE_ID"
referenced-column-name=
"ID"
/>
</many-to-one>
<many-to-one
field=
"intervenant"
target-entity=
"Application\Entity\Db\Intervenant"
>
<join-column
name=
"INTERVENANT_ID"
referenced-column-name=
"ID"
/>
</many-to-one>
<many-to-one
field=
"structure"
target-entity=
"Application\Entity\Db\Structure"
>
<join-column
name=
"STRUCTURE_ID"
referenced-column-name=
"ID"
/>
</many-to-one>
</entity>
</doctrine-mapping>
module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Indicateur.Indicateur1221.dcm.xml
0 → 100755
View file @
1d097333
<?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=
"Application\Entity\Db\Indicateur\Indicateur1221"
table=
"V_INDICATEUR_1221"
read-only=
"true"
>
<id
name=
"id"
type=
"integer"
column=
"ID"
/>
<field
name=
"heures"
type=
"float"
column=
"HEURES"
precision=
"126"
scale=
"0"
nullable=
"false"
/>
<field
name=
"plafond"
type=
"float"
column=
"PLAFOND"
precision=
"126"
scale=
"0"
nullable=
"false"
/>
<many-to-one
field=
"annee"
target-entity=
"Application\Entity\Db\Annee"
>
<join-column
name=
"ANNEE_ID"
referenced-column-name=
"ID"
/>
</many-to-one>
<many-to-one
field=
"intervenant"
target-entity=
"Application\Entity\Db\Intervenant"
>
<join-column
name=
"INTERVENANT_ID"
referenced-column-name=
"ID"
/>
</many-to-one>
<many-to-one
field=
"structure"
target-entity=
"Application\Entity\Db\Structure"
>
<join-column
name=
"STRUCTURE_ID"
referenced-column-name=
"ID"
/>
</many-to-one>
</entity>
</doctrine-mapping>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment