Commit 41e021b7 authored by Laurent Lécluse's avatar Laurent Lécluse
Browse files

Refonte de l'infrastructure de gestion de la formule de calcul

et nouvelle implémentation de la formule
parent 91a6aba4
......@@ -7,20 +7,3 @@
* @var $sl \Zend\ServiceManager\ServiceLocatorInterface
*/
use Application\Service\EtatVolumeHoraireService;
use Application\Service\FormuleResultatService;
use Application\Service\IntervenantService;
use Application\Service\TypeVolumeHoraireService;
$intervenant = $sl->get(IntervenantService::class)->get(648);
$typeVolumeHoraire = $sl->get(TypeVolumeHoraireService::class)->get(1);
$etatVolumeHoraire = $sl->get(EtatVolumeHoraireService::class)->get(1);
$frs = $sl->get(FormuleResultatService::class);
$data = $frs->getData($intervenant, $typeVolumeHoraire, $etatVolumeHoraire);
unset($data['structure-affectation']);
var_dump($data );
\ No newline at end of file
......@@ -7,69 +7,69 @@
* @var $sl \Zend\ServiceManager\ServiceLocatorInterface
*/
use Application\Connecteur\LdapConnecteur;
use Application\Constants;
use Doctrine\ORM\EntityManager;
use UnicaenApp\Mapper\Ldap\People;
use Application\Entity\Db\Fichier;
use Application\Entity\Db\PieceJointe;
use Application\Entity\Db\Validation;
use Application\Service\FichierService;
use Application\Service\IntervenantService;
use Application\Service\PieceJointeService;
use Application\Service\TypePieceJointeService;
use Application\Service\TypeValidationService;
use Application\Service\ValidationService;
use Application\Service\WorkflowService;
$sql = '
SELECT
a.id,
p.supann_emp_id
FROM
affectation a
JOIN personnel p ON p.id = a.personnel_id
WHERE
a.histo_destruction IS NULL
';
$dirs = scandir('/home/laurent/cv');
//$dirs = ['2624.pdf'];
/** @var IntervenantService $si */
$si = $sl->get(IntervenantService::class);
/** @var EntityManager $em */
$em = $sl->get(Constants::BDD);
$typePieceJointe = $sl->get(TypePieceJointeService::class)->get(1);
$tvPJ = $sl->get(TypeValidationService::class)->get(4);
$tvFichier = $sl->get(TypeValidationService::class)->get(5);
/** @var People $ldap */
$ldapMapper = $sl->get('ldap_people_mapper');
foreach( $dirs as $dir ){
if ($dir == '.' || $dir == '..') continue;
/** @var LdapConnecteur $ldap */
$ldap = $sl->get(LdapConnecteur::class);
$code = explode('.', $dir)[0];
$a = $em->getConnection()->fetchAll($sql);
$intervenant = $si->getBySourceCode($code);
foreach( $a as $aff ){
$p = $ldapMapper->findOneByNoIndividu($aff['SUPANN_EMP_ID'], true);
$aid = $aff['ID'];
if ($p){
$login = $p->getSupannAliasLogin();
$fichier = new Fichier();
$fichier->setContenu(file_get_contents('/home/laurent/cv/'.$dir));
$fichier->setNom($dir);
$fichier->setTaille(filesize('/home/laurent/cv/'.$dir));
$fichier->setTypeMime('application/pdf');
$utilisateur = $ldap->getUtilisateur($login);
$valFichier = new Validation();
$valFichier->setIntervenant($intervenant);
$valFichier->setTypeValidation($tvFichier);
$valFichier->setStructure($intervenant->getStructure());
$sl->get(ValidationService::class)->save($valFichier);
$fichier->setValidation($valFichier);
$uid = $utilisateur->getId();
$usql = "UPDATE affectation SET utilisateur_id=$uid WHERE id = $aid;";
echo $usql."<br />";
$pj = $sl->get(PieceJointeService::class)->getByType($intervenant, $typePieceJointe);
if (!$pj || !$pj->estNonHistorise()) {
$pj = new PieceJointe();
$pj->setIntervenant($intervenant);
$pj->setType($typePieceJointe);
$sl->get(PieceJointeService::class)->save($pj);
}
}
$sl->get(FichierService::class)->save($fichier);
/*
$sql = "INSERT INTO piece_jointe_fichier(piece_jointe_id,fichier_id) values (".$pj->getId().",".$fichier->getId().")";
select
a.id,
p.nom_usuel || ' ' || p.prenom personnel,
p.supann_emp_id supp,
r.libelle role,
s.libelle_court structure,
s.libelle source,
a.source_code a_sc,
p.source_code p_sc
from
affectation a
JOIN source s ON s.id = a.source_id
JOIN personnel p ON p.id = a.personnel_id
JOIN role r ON r.id = a.role_id
LEFT JOIN structure s ON s.id = a.structure_id
where
a.utilisateur_id is null
and a.histo_destruction is null;
/* Validation */
if (!($pj->getValidation() && $pj->getValidation()->estNonHistorise())){
$validation = new Validation();
$validation->setIntervenant($intervenant);
$validation->setTypeValidation($tvPJ);
$validation->setStructure($intervenant->getStructure());
$sl->get(ValidationService::class)->save($validation);
$pj->setValidation($validation);
$sl->get(PieceJointeService::class)->save($pj);
}
update affectation set utilisateur_id = 1 where id = 1;
delete from affectation where utilisateur_id is null;
$sl->get(WorkflowService::class)->calculerTableauxBord([], $intervenant);
*/
\ No newline at end of file
echo $dir.' '.$intervenant->getCode()."<br />";
}
......@@ -9,8 +9,8 @@
],
"require" : {
"php" : "^7.0",
"unicaen/app" : "1.3.16",
"unicaen/auth" : "1.2.13",
"unicaen/app" : "1.3.21",
"unicaen/auth" : "1.2.18",
"zendframework/zend-code" : "^2.4",
"zendframework/zend-text" : "^2.4",
"bjyoungblood/bjy-authorize": "dev-master",
......
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "e0242f63ab7d625a4f4b2b15d3ad8d99",
"content-hash": "782d389b10ffacb1bc285c94d038d271",
"packages": [
{
"name": "bjyoungblood/bjy-authorize",
......@@ -881,16 +881,16 @@
},
{
"name": "jasig/phpcas",
"version": "1.3.5",
"version": "1.3.6",
"source": {
"type": "git",
"url": "https://github.com/apereo/phpCAS.git",
"reference": "61c8899c8f91204e8b9135d795461e50fe5c2db0"
"reference": "7972833e84f6ee5fa41f1479eab5d855109627f5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/apereo/phpCAS/zipball/61c8899c8f91204e8b9135d795461e50fe5c2db0",
"reference": "61c8899c8f91204e8b9135d795461e50fe5c2db0",
"url": "https://api.github.com/repos/apereo/phpCAS/zipball/7972833e84f6ee5fa41f1479eab5d855109627f5",
"reference": "7972833e84f6ee5fa41f1479eab5d855109627f5",
"shasum": ""
},
"require": {
......@@ -928,10 +928,11 @@
"description": "Provides a simple API for authenticating users against a CAS server",
"homepage": "https://wiki.jasig.org/display/CASC/phpCAS",
"keywords": [
"apereo",
"cas",
"jasig"
],
"time": "2017-04-10T19:12:45+00:00"
"time": "2018-10-25T20:22:09+00:00"
},
{
"name": "kriswallsmith/assetic",
......@@ -1060,16 +1061,16 @@
},
{
"name": "psr/log",
"version": "1.0.2",
"version": "1.1.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
"reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
"reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
"url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd",
"reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd",
"shasum": ""
},
"require": {
......@@ -1103,7 +1104,7 @@
"psr",
"psr-3"
],
"time": "2016-10-10T12:19:37+00:00"
"time": "2018-11-20T15:27:04+00:00"
},
{
"name": "rwoverdijk/assetmanager",
......@@ -1285,16 +1286,16 @@
},
{
"name": "symfony/debug",
"version": "v3.4.17",
"version": "v3.4.20",
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
"reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6"
"reference": "a2233f555ddf55e5600f386fba7781cea1cb82d3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/debug/zipball/0a612e9dfbd2ccce03eb174365f31ecdca930ff6",
"reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6",
"url": "https://api.github.com/repos/symfony/debug/zipball/a2233f555ddf55e5600f386fba7781cea1cb82d3",
"reference": "a2233f555ddf55e5600f386fba7781cea1cb82d3",
"shasum": ""
},
"require": {
......@@ -1337,20 +1338,20 @@
],
"description": "Symfony Debug Component",
"homepage": "https://symfony.com",
"time": "2018-10-02T16:33:53+00:00"
"time": "2018-11-27T12:43:10+00:00"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.9.0",
"version": "v1.10.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8"
"reference": "c79c051f5b3a46be09205c73b80b346e4153e494"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8",
"reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494",
"reference": "c79c051f5b3a46be09205c73b80b346e4153e494",
"shasum": ""
},
"require": {
......@@ -1396,20 +1397,20 @@
"portable",
"shim"
],
"time": "2018-08-06T14:22:27+00:00"
"time": "2018-09-21T13:07:52+00:00"
},
{
"name": "symfony/process",
"version": "v2.8.46",
"version": "v2.8.49",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "f09e21b7c5aba06c47bbfad9cbcf13ac7f0db0a6"
"reference": "c3591a09c78639822b0b290d44edb69bf9f05dc8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/f09e21b7c5aba06c47bbfad9cbcf13ac7f0db0a6",
"reference": "f09e21b7c5aba06c47bbfad9cbcf13ac7f0db0a6",
"url": "https://api.github.com/repos/symfony/process/zipball/c3591a09c78639822b0b290d44edb69bf9f05dc8",
"reference": "c3591a09c78639822b0b290d44edb69bf9f05dc8",
"shasum": ""
},
"require": {
......@@ -1445,15 +1446,15 @@
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
"time": "2018-09-06T17:11:15+00:00"
"time": "2018-11-11T11:18:13+00:00"
},
{
"name": "unicaen/app",
"version": "1.3.16",
"version": "1.3.21",
"source": {
"type": "git",
"url": "https://git.unicaen.fr/lib/unicaen/app.git",
"reference": "6ebaf169356e018220e26456fe0bd525de4c728a"
"reference": "b9bff28b8f304748390ef9b8b8d4f30889147a0f"
},
"require": {
"doctrine/doctrine-orm-module": ">=0.7",
......@@ -1496,15 +1497,15 @@
]
},
"description": "Module de base des applications unicaen",
"time": "2018-09-13T07:34:51+00:00"
"time": "2018-12-14T10:27:17+00:00"
},
{
"name": "unicaen/auth",
"version": "1.2.13",
"version": "1.2.18",
"source": {
"type": "git",
"url": "https://git.unicaen.fr/lib/unicaen/auth.git",
"reference": "037dee5a1d68bc9de93ede25892186c955d95ad3"
"reference": "87c6802dfadfcdc8b05602607ea69b959c1ec063"
},
"require": {
"bjyoungblood/bjy-authorize": ">=1.4",
......@@ -1526,7 +1527,7 @@
]
},
"description": "Module d'authentification pour les applications Unicaen",
"time": "2018-06-13T09:28:44+00:00"
"time": "2018-11-19T16:04:53+00:00"
},
{
"name": "unicaen/code",
......@@ -1604,11 +1605,11 @@
},
{
"name": "unicaen/oracle",
"version": "1.2.1",
"version": "1.2.3",
"source": {
"type": "git",
"url": "https://git.unicaen.fr/lib/unicaen/oracle.git",
"reference": "fc16a7394c40ffa50324f7028e90431f9ecae12a"
"reference": "bc79ca51396e377999225c02f1726a153a2f342c"
},
"require": {
"doctrine/dbal": "^2.5",
......@@ -1628,7 +1629,7 @@
]
},
"description": "Bibliothèque utile lorsqu'on utilise un base de données Oracle",
"time": "2018-09-11T07:47:55+00:00"
"time": "2018-12-06T10:39:40+00:00"
},
{
"name": "unicaen/tbl",
......
......@@ -49,6 +49,25 @@ INSERT INTO parametre (
);
UPDATE tbl SET feuille_de_route = 1 WHERE tbl_name IN (
'agrement',
'cloture_realise',
'contrat',
'dossier',
'paiement',
'piece_jointe',
'piece_jointe_demande',
'piece_jointe_fournie',
'service',
'service_referentiel',
'service_saisie',
'validation_referentiel',
'workflow',
'validation_enseignement',
'formule'
);
-- =!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
-- = bien ajouter les requêtes de modif de DDL générées ! ! ! ! =
-- =!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
\ No newline at end of file
......@@ -250,7 +250,7 @@ class DossierFieldset extends AbstractFieldset
'label' => 'Adresse mail personnelle (éventuelle)',
],
'attributes' => [
'info_icon' => "Si vous renseignez une adresse mail perso, celle-ci sera uttilisée pour vous contacter.",
'info_icon' => "Si vous renseignez une adresse mail perso, celle-ci sera utilisée pour vous contacter.",
'readonly' => false,
],
'type' => 'Text',
......
......@@ -2,6 +2,8 @@
namespace Application\Service;
use Application\Entity\Db\ElementPedagogique;
use Application\Entity\Db\Etablissement;
use Application\Entity\Db\EtatVolumeHoraire;
use Application\Entity\Db\Intervenant;
use Application\Entity\Db\Structure;
......@@ -213,6 +215,15 @@ class FormuleResultatService extends AbstractEntityService
foreach ($fr as $k => $v) {
$data[$k] = $v;
}
$data['SERVICE_TOTAL'] = $data['SERVICE_FI']
+ $data['SERVICE_FA']
+ $data['SERVICE_FC']
+ $data['SERVICE_REFERENTIEL'];
$data['HEURES_COMPL_TOTAL'] = $data['HEURES_COMPL_FI']
+ $data['HEURES_COMPL_FA']
+ $data['HEURES_COMPL_FC']
+ $data['HEURES_COMPL_FC_MAJOREES']
+ $data['HEURES_COMPL_REFERENTIEL'];
$sql = "SELECT * FROM formule_resultat_service WHERE formule_resultat_id = :frId";
$frss = $conn->fetchAll($sql, compact('frId'));
foreach ($frss as $frs) {
......@@ -245,6 +256,27 @@ class FormuleResultatService extends AbstractEntityService
return $ti1->getOrdre() > $ti2->getOrdre();
});
usort($data['s'], function ($ee1, $ee2) {
if ($ee1['element-etablissement'] instanceof ElementPedagogique){
$ee1Code = $ee1['element-etablissement']->getCode();
}elseif($ee1['element-etablissement'] instanceof Etablissement){
$ee1Code = $ee1['element-etablissement']->getLibelle();
}
if ($ee2['element-etablissement'] instanceof ElementPedagogique){
$ee2Code = $ee2['element-etablissement']->getCode();
}elseif($ee2['element-etablissement'] instanceof Etablissement){
$ee2Code = $ee2['element-etablissement']->getLibelle();
}
return $ee1Code > $ee2Code;
});
usort($data['r'], function ($r1, $r2) {
return $r1['fonction']->getLibelleCourt() > $r2['fonction']->getLibelleCourt();
});
return $data;
}
}
\ No newline at end of file
......@@ -211,11 +211,11 @@ function vn(array $array, $key, $type = 's')
<div class="col-sm-2 nombre"><?= vn($data, 'SERVICE_FI') ?></div>
</div>
<div class="row">
<div class="col-sm-4">Service FA</div>
<div class="col-sm-4">+ Service FA</div>
<div class="col-sm-2 nombre"><?= vn($data, 'SERVICE_FA') ?></div>
</div>
<div class="row">
<div class="col-sm-4">Service FC</div>
<div class="col-sm-4">+ Service FC</div>
<div class="col-sm-2 nombre"><?= vn($data, 'SERVICE_FC') ?></div>
</div>
<div class="row">
......@@ -225,7 +225,7 @@ function vn(array $array, $key, $type = 's')
<div class="row">
<div class="col-sm-4">= Service assuré</div>
<div class="col-sm-2 nombre"><span class="label label-info"
style="font-size:12pt"><?= vn($data, 'TOTAL') ?></span>
style="font-size:12pt"><?= vn($data, 'SERVICE_TOTAL') ?></span>
</div>
</div>
<div class="row">&nbsp;</div>
......@@ -234,26 +234,26 @@ function vn(array $array, $key, $type = 's')
<div class="col-sm-2 nombre"><?= vn($data, 'HEURES_COMPL_FI') ?></div>
</div>
<div class="row">
<div class="col-sm-4"><abbr title="Heures complémentaires (formation en apprentissage)">HC FA</abbr></div>
<div class="col-sm-4"><abbr title="Heures complémentaires (formation en apprentissage)">+ HC FA</abbr></div>
<div class="col-sm-2 nombre"><?= vn($data, 'HEURES_COMPL_FA') ?></div>
</div>
<div class="row">
<div class="col-sm-4"><abbr title="Heures complémentaires (formation continue)">HC FC</abbr></div>
<div class="col-sm-4"><abbr title="Heures complémentaires (formation continue)">+ HC FC</abbr></div>
<div class="col-sm-2 nombre"><?= vn($data, 'HEURES_COMPL_FC') ?></div>
</div>
<div class="row">
<div class="col-sm-4"><abbr title="Rémunération FC au titre de l'article D714-60 du code de l’Éducation">Rémunération FC
<div class="col-sm-4"><abbr title="Rémunération FC au titre de l'article D714-60 du code de l’Éducation">+ Rémunération FC
D714-60</abbr></div>
<div class="col-sm-2 nombre"><?= vn($data, 'HEURES_COMPL_FC_MAJOREES') ?></div>
</div>
<div class="row">
<div class="col-sm-4"><abbr title="Heures complémentaires (référentiel)">HC Référentiel</abbr></div>
<div class="col-sm-4"><abbr title="Heures complémentaires (référentiel)">+ HC Référentiel</abbr></div>
<div class="col-sm-2 nombre"><?= vn($data, 'HEURES_COMPL_REFERENTIEL') ?></div>
</div>
<div class="row">
<div class="col-sm-4">= Heures complémentaires</div>
<div class="col-sm-2 nombre"><span class="label label-info"
style="font-size:12pt"><?= vn($data, 'HEURES_COMPL_FI') ?></span>
style="font-size:12pt"><?= vn($data, 'HEURES_COMPL_TOTAL') ?></span>
</div>
</div>
<br/>
......
Markdown is supported
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