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
c7290641
Commit
c7290641
authored
Apr 23, 2019
by
Laurent Lécluse
Browse files
Merge branch 'referentiel' into 'master'
Referentiel See merge request
!37
parents
b8dde0e1
1b5ff9d3
Changes
15
Hide whitespace changes
Inline
Side-by-side
bdd/update/08.1.sql
View file @
c7290641
...
...
@@ -5814,4 +5814,149 @@ alter trigger "OSE"."SERVICE_CK" enable
ALTER
TABLE
SYNC_LOG
ADD
(
NMESSAGE
VARCHAR2
(
4000
)
);
UPDATE
SYNC_LOG
SET
NMESSAGE
=
MESSAGE
;
ALTER
TABLE
SYNC_LOG
DROP
COLUMN
MESSAGE
;
ALTER
TABLE
SYNC_LOG
RENAME
COLUMN
NMESSAGE
TO
MESSAGE
;
\ No newline at end of file
ALTER
TABLE
SYNC_LOG
RENAME
COLUMN
NMESSAGE
TO
MESSAGE
;
ALTER
TABLE
fonction_referentiel
ADD
(
parent_id
NUMBER
(
*
,
0
)
);
ALTER
TABLE
fonction_referentiel
ADD
CONSTRAINT
fr_parent_fk
FOREIGN
KEY
(
parent_id
)
REFERENCES
fonction_referentiel
(
id
)
NOT
DEFERRABLE
;
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
composer.lock
View file @
c7290641
...
...
@@ -1413,16 +1413,16 @@
},
{
"name": "symfony/debug",
"version": "v3.4.2
3
",
"version": "v3.4.2
4
",
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
"reference": "
8d8a9e877b3fcdc50ddecf8dcea146059753f782
"
"reference": "
adbdd5d66342fb0a0bce7422ba68181842b6610d
"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/debug/zipball/
8d8a9e877b3fcdc50ddecf8dcea146059753f782
",
"reference": "
8d8a9e877b3fcdc50ddecf8dcea146059753f782
",
"url": "https://api.github.com/repos/symfony/debug/zipball/
adbdd5d66342fb0a0bce7422ba68181842b6610d
",
"reference": "
adbdd5d66342fb0a0bce7422ba68181842b6610d
",
"shasum": ""
},
"require": {
...
...
@@ -1465,7 +1465,7 @@
],
"description": "Symfony Debug Component",
"homepage": "https://symfony.com",
"time": "2019-0
2-24T15:45:11
+00:00"
"time": "2019-0
3-10T17:07:42
+00:00"
},
{
"name": "symfony/polyfill-ctype",
...
...
@@ -1791,11 +1791,11 @@
},
{
"name": "unicaen/oracle",
"version": "1.2.
8
",
"version": "1.2.
11
",
"source": {
"type": "git",
"url": "https://git.unicaen.fr/lib/unicaen/oracle.git",
"reference": "
026e0ef03dc0326ec1e563774852891c894fa03f
"
"reference": "
432835499c6de82258d510e8a4856a6e225b38b6
"
},
"require": {
"doctrine/dbal": "^2.5",
...
...
@@ -1815,7 +1815,7 @@
]
},
"description": "Bibliothèque utile lorsqu'on utilise un base de données Oracle",
"time": "2019-0
3-10T20:11:52
+00:00"
"time": "2019-0
4-05T15:04:45
+00:00"
},
{
"name": "unicaen/tbl",
...
...
config/autoload/application.global.php
View file @
c7290641
...
...
@@ -18,7 +18,7 @@ return [
'configuration'
=>
[
'orm_default'
=>
[
'metadata_cache'
=>
'filesystem'
,
'query_cache'
=>
'filesystem'
,
//
'query_cache' => 'filesystem',
'result_cache'
=>
'filesystem'
,
'hydration_cache'
=>
'array'
,
'generate_proxies'
=>
AppConfig
::
get
(
'bdd'
,
'generateProxies'
),
...
...
data/Query/plafond.sql
View file @
c7290641
...
...
@@ -86,6 +86,46 @@ GROUP BY
UNION
-- Heures max. de référentiel par intervenant et par fonction référentielle mère
SELECT
'ref-par-fonction-mere'
plafond_code
,
t
.
type_volume_horaire_id
,
i
.
annee_id
,
t
.
intervenant_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
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
,
t
.
intervenant_id
UNION
-- Nombre maximum d'heures équivalent TD par intervenant selon son statut
SELECT
'hetd'
plafond_code
,
...
...
module/Application/src/Application/Entity/Db/FonctionReferentiel.php
View file @
c7290641
...
...
@@ -12,6 +12,11 @@ class FonctionReferentiel implements HistoriqueAwareInterface
{
use
HistoriqueAwareTrait
;
/**
* @var self
*/
protected
$parent
;
/**
* @var string
*/
...
...
@@ -59,6 +64,30 @@ class FonctionReferentiel implements HistoriqueAwareInterface
/**
* @return FonctionReferentiel
*/
public
function
getParent
()
{
return
$this
->
parent
;
}
/**
* @param FonctionReferentiel|null $parent
*
* @return FonctionReferentiel
*/
public
function
setParent
(
$parent
=
null
):
FonctionReferentiel
{
$this
->
parent
=
$parent
;
return
$this
;
}
/**
* Set code
*
...
...
@@ -300,23 +329,4 @@ class FonctionReferentiel implements HistoriqueAwareInterface
return
$str
;
}
/**
* @since PHP 5.6.0
* This method is called by var_dump() when dumping an object to get the properties that should be shown.
* If the method isn't defined on an object, then all public, protected and private properties will be shown.
*
* @return array
* @link http://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.debuginfo
*/
function
__debugInfo
()
{
return
[
'id'
=>
$this
->
id
,
'libelleCourt'
=>
$this
->
libelleCourt
,
];
}
}
module/Application/src/Application/Entity/Db/Indicateur/Indicateur1211.php
0 → 100755
View file @
c7290641
<?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 @
c7290641
<?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.FonctionReferentiel.dcm.xml
View file @
c7290641
...
...
@@ -18,6 +18,11 @@
<field
name=
"plafond"
type=
"float"
column=
"PLAFOND"
precision=
"126"
scale=
"0"
nullable=
"true"
/>
<field
name=
"etapeRequise"
type=
"boolean"
column=
"ETAPE_REQUISE"
nullable=
"false"
/>
<field
name=
"serviceStatutaire"
type=
"boolean"
column=
"SERVICE_STATUTAIRE"
nullable=
"false"
/>
<many-to-one
field=
"parent"
target-entity=
"Application\Entity\Db\FonctionReferentiel"
>
<join-columns>
<join-column
name=
"PARENT_ID"
referenced-column-name=
"ID"
/>
</join-columns>
</many-to-one>
<many-to-one
field=
"domaineFonctionnel"
target-entity=
"Application\Entity\Db\DomaineFonctionnel"
>
<join-columns>
<join-column
name=
"DOMAINE_FONCTIONNEL_ID"
referenced-column-name=
"ID"
/>
...
...
module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Indicateur.Indicateur1211.dcm.xml
0 → 100755
View file @
c7290641
<?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 @
c7290641
<?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>
module/Application/src/Application/Entity/PlafondDepassement.php
View file @
c7290641
...
...
@@ -135,7 +135,7 @@ class PlafondDepassement
*/
public
function
__toString
()
{
$errStr
=
'Le plafond
suivant
%s a été dépassé. Il est en effet de %s heures pour %s heures saisies.'
;
$errStr
=
'Le plafond
"
%s
"
a été dépassé. Il est en effet de %s heures pour %s heures saisies.'
;
return
sprintf
(
$errStr
,
...
...
module/Application/src/Application/Form/FonctionReferentiel/FonctionReferentielSaisieForm.php
View file @
c7290641
...
...
@@ -2,9 +2,12 @@
namespace
Application\Form\FonctionReferentiel
;
use
Application\Entity\Db\FonctionReferentiel
;
use
Application\Form\AbstractForm
;
use
Application\Service\Traits\DomaineFonctionnelServiceAwareTrait
;
use
Application\Service\Traits\FonctionReferentielServiceAwareTrait
;
use
Application\Service\Traits\StructureServiceAwareTrait
;
use
UnicaenApp\Util
;
use
Zend\Form\Element\Csrf
;
use
Zend\Stdlib\Hydrator\HydratorInterface
;
use
Application\Service\Traits\ContextServiceAwareTrait
;
...
...
@@ -16,6 +19,7 @@ use Application\Service\Traits\ContextServiceAwareTrait;
*/
class
FonctionReferentielSaisieForm
extends
AbstractForm
{
use
FonctionReferentielServiceAwareTrait
;