Commit b0248d94 authored by lecluse's avatar lecluse
Browse files

Keybeyrie :

	- début d'implémentation
	- tests
	- début d'implémentation du tableau de bord de formule
divers
parent 63e15813
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "f2d0e4ac21618082b1fd832714225418",
"packages": [
......@@ -291,16 +292,16 @@
},
{
"name": "doctrine/common",
"version": "v2.4.1",
"version": "v2.4.2",
"source": {
"type": "git",
"url": "https://github.com/doctrine/common.git",
"reference": "ceb18cf9b0230f3ea208b6238130fd415abda0a7"
"reference": "5db6ab40e4c531f14dad4ca96a394dfce5d4255b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/common/zipball/ceb18cf9b0230f3ea208b6238130fd415abda0a7",
"reference": "ceb18cf9b0230f3ea208b6238130fd415abda0a7",
"url": "https://api.github.com/repos/doctrine/common/zipball/5db6ab40e4c531f14dad4ca96a394dfce5d4255b",
"reference": "5db6ab40e4c531f14dad4ca96a394dfce5d4255b",
"shasum": ""
},
"require": {
......@@ -311,6 +312,9 @@
"doctrine/lexer": "1.*",
"php": ">=5.3.2"
},
"require-dev": {
"phpunit/phpunit": "~3.7"
},
"type": "library",
"extra": {
"branch-alias": {
......@@ -362,7 +366,7 @@
"persistence",
"spl"
],
"time": "2013-09-07 10:20:34"
"time": "2014-05-21 19:28:51"
},
{
"name": "doctrine/dbal",
......@@ -701,7 +705,7 @@
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com",
"homepage": "http://jmsyst.com",
"homepage": "https://github.com/schmittjoh",
"role": "Developer of wrapped JMSSerializerBundle"
}
],
......@@ -715,16 +719,16 @@
},
{
"name": "doctrine/orm",
"version": "v2.4.2",
"version": "v2.4.3",
"source": {
"type": "git",
"url": "https://github.com/doctrine/doctrine2.git",
"reference": "0363a5548d9263f979f9ca149decb9cfc66419ab"
"reference": "8a13376d42b5ea467727ffe730aa0e14ca3c5e29"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/doctrine2/zipball/0363a5548d9263f979f9ca149decb9cfc66419ab",
"reference": "0363a5548d9263f979f9ca149decb9cfc66419ab",
"url": "https://api.github.com/repos/doctrine/doctrine2/zipball/8a13376d42b5ea467727ffe730aa0e14ca3c5e29",
"reference": "8a13376d42b5ea467727ffe730aa0e14ca3c5e29",
"shasum": ""
},
"require": {
......@@ -787,7 +791,7 @@
"database",
"orm"
],
"time": "2014-02-08 16:35:09"
"time": "2014-06-10 11:49:08"
},
{
"name": "intouch/phpcas",
......@@ -902,20 +906,20 @@
},
{
"name": "rwoverdijk/assetmanager",
"version": "1.3.7",
"version": "1.4.1",
"source": {
"type": "git",
"url": "https://github.com/RWOverdijk/AssetManager.git",
"reference": "bfba7e3151b719aa8168136de897dff2bca9dead"
"reference": "47d29f56fc7935833adba9e18e17f777b9e8a2d6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/RWOverdijk/AssetManager/zipball/bfba7e3151b719aa8168136de897dff2bca9dead",
"reference": "bfba7e3151b719aa8168136de897dff2bca9dead",
"url": "https://api.github.com/repos/RWOverdijk/AssetManager/zipball/47d29f56fc7935833adba9e18e17f777b9e8a2d6",
"reference": "47d29f56fc7935833adba9e18e17f777b9e8a2d6",
"shasum": ""
},
"require": {
"kriswallsmith/assetic": "~1.1.0",
"kriswallsmith/assetic": "~1.1.2",
"php": ">=5.3.3",
"zendframework/zend-eventmanager": "2.*",
"zendframework/zend-loader": "2.*",
......@@ -960,36 +964,38 @@
"zend framework 2",
"zf2"
],
"time": "2014-04-07 04:56:33"
"time": "2014-05-29 15:34:41"
},
{
"name": "symfony/console",
"version": "v2.4.4",
"version": "v2.5.0",
"target-dir": "Symfony/Component/Console",
"source": {
"type": "git",
"url": "https://github.com/symfony/Console.git",
"reference": "2e452005b1e1d003d23702d227e23614679eb5ca"
"reference": "ef4ca73b0b3a10cbac653d3ca482d0cdd4502b2c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Console/zipball/2e452005b1e1d003d23702d227e23614679eb5ca",
"reference": "2e452005b1e1d003d23702d227e23614679eb5ca",
"url": "https://api.github.com/repos/symfony/Console/zipball/ef4ca73b0b3a10cbac653d3ca482d0cdd4502b2c",
"reference": "ef4ca73b0b3a10cbac653d3ca482d0cdd4502b2c",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"psr/log": "~1.0",
"symfony/event-dispatcher": "~2.1"
},
"suggest": {
"psr/log": "For using the console logger",
"symfony/event-dispatcher": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.4-dev"
"dev-master": "2.5-dev"
}
},
"autoload": {
......@@ -1015,21 +1021,21 @@
],
"description": "Symfony Console Component",
"homepage": "http://symfony.com",
"time": "2014-04-27 13:34:57"
"time": "2014-05-22 08:54:24"
},
{
"name": "symfony/process",
"version": "v2.4.4",
"version": "v2.5.0",
"target-dir": "Symfony/Component/Process",
"source": {
"type": "git",
"url": "https://github.com/symfony/Process.git",
"reference": "8721f1476d5d38a43c7d6ccb6435b351cf8f3bb7"
"reference": "5d7d78e23894544740219e006320678cfa4cd45b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Process/zipball/8721f1476d5d38a43c7d6ccb6435b351cf8f3bb7",
"reference": "8721f1476d5d38a43c7d6ccb6435b351cf8f3bb7",
"url": "https://api.github.com/repos/symfony/Process/zipball/5d7d78e23894544740219e006320678cfa4cd45b",
"reference": "5d7d78e23894544740219e006320678cfa4cd45b",
"shasum": ""
},
"require": {
......@@ -1038,7 +1044,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.4-dev"
"dev-master": "2.5-dev"
}
},
"autoload": {
......@@ -1064,7 +1070,7 @@
],
"description": "Symfony Process Component",
"homepage": "http://symfony.com",
"time": "2014-04-27 13:34:57"
"time": "2014-05-23 09:02:52"
},
{
"name": "unicaen/unicaen-app",
......@@ -2992,16 +2998,16 @@
},
{
"name": "zf-commons/zfc-user",
"version": "0.1.3",
"version": "1.1.0",
"source": {
"type": "git",
"url": "https://github.com/ZF-Commons/ZfcUser.git",
"reference": "db5b39df5f640c86299c74f46a91869c09c9a3ed"
"reference": "206ead0d5e204fcaba56bbb1f583e0d90172c5a6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ZF-Commons/ZfcUser/zipball/db5b39df5f640c86299c74f46a91869c09c9a3ed",
"reference": "db5b39df5f640c86299c74f46a91869c09c9a3ed",
"url": "https://api.github.com/repos/ZF-Commons/ZfcUser/zipball/206ead0d5e204fcaba56bbb1f583e0d90172c5a6",
"reference": "206ead0d5e204fcaba56bbb1f583e0d90172c5a6",
"shasum": ""
},
"require": {
......@@ -3065,7 +3071,7 @@
"keywords": [
"zf2"
],
"time": "2014-04-17 10:31:44"
"time": "2014-06-08 20:38:58"
},
{
"name": "zf-commons/zfc-user-doctrine-orm",
......@@ -3073,18 +3079,18 @@
"source": {
"type": "git",
"url": "https://github.com/ZF-Commons/ZfcUserDoctrineORM.git",
"reference": "17efcb024e8f628ba777b5bbbb6201821ac14dfd"
"reference": "9a2e148c9a5a03ca8592b93ea28a21e37b06e053"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ZF-Commons/ZfcUserDoctrineORM/zipball/17efcb024e8f628ba777b5bbbb6201821ac14dfd",
"reference": "17efcb024e8f628ba777b5bbbb6201821ac14dfd",
"url": "https://api.github.com/repos/ZF-Commons/ZfcUserDoctrineORM/zipball/9a2e148c9a5a03ca8592b93ea28a21e37b06e053",
"reference": "9a2e148c9a5a03ca8592b93ea28a21e37b06e053",
"shasum": ""
},
"require": {
"doctrine/doctrine-orm-module": "0.*",
"php": ">=5.3.3",
"zf-commons/zfc-user": "0.*"
"zf-commons/zfc-user": "1.*"
},
"type": "library",
"extra": {
......@@ -3121,7 +3127,7 @@
"keywords": [
"zf2"
],
"time": "2014-04-17 19:39:44"
"time": "2014-04-18 10:21:19"
}
],
"packages-dev": [
......@@ -3493,17 +3499,17 @@
},
{
"name": "symfony/yaml",
"version": "v2.4.4",
"version": "v2.5.0",
"target-dir": "Symfony/Component/Yaml",
"source": {
"type": "git",
"url": "https://github.com/symfony/Yaml.git",
"reference": "65539ecde838f9c0d18b006b2101e3deb4b5c9ff"
"reference": "b4b09c68ec2f2727574544ef0173684281a5033c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Yaml/zipball/65539ecde838f9c0d18b006b2101e3deb4b5c9ff",
"reference": "65539ecde838f9c0d18b006b2101e3deb4b5c9ff",
"url": "https://api.github.com/repos/symfony/Yaml/zipball/b4b09c68ec2f2727574544ef0173684281a5033c",
"reference": "b4b09c68ec2f2727574544ef0173684281a5033c",
"shasum": ""
},
"require": {
......@@ -3512,7 +3518,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.4-dev"
"dev-master": "2.5-dev"
}
},
"autoload": {
......@@ -3538,7 +3544,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "http://symfony.com",
"time": "2014-04-18 20:37:09"
"time": "2014-05-16 14:25:18"
},
{
"name": "zendframework/zend-dom",
......
......@@ -60,6 +60,19 @@ return array(
),
),
),
'voir-heures-comp' => array(
'type' => 'Segment',
'options' => array(
'route' => '/voir-heures-comp[/:id]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9]*',
),
'defaults' => array(
'action' => 'voir-heures-comp',
),
),
),
'modification-service-du' => array(
'type' => 'Segment',
'options' => array(
......@@ -157,6 +170,14 @@ return array(
'withtarget' => true,
'resource' => 'controller/Application\Controller\Intervenant:voir',
),
'voir-heures-comp' => array(
'label' => "Heures compplémentaires",
'title' => "Calcul des heures complémentaires {id}",
'route' => 'intervenant/voir-heures-comp',
'action' => 'voir-heures-comp',
'withtarget' => true,
'resource' => 'controller/Application\Controller\Intervenant:voir-heures-comp',
),
'modification-service-du' => array(
'label' => "Modification de service dû",
'title' => "Modification de service dû de l'intervenant {id}",
......@@ -211,7 +232,7 @@ return array(
),
array(
'controller' => 'Application\Controller\Intervenant',
'action' => array('voir', 'choisir', 'rechercher', 'search'),
'action' => array('voir', 'choisir', 'rechercher', 'search', 'voir-heures-comp'),
'roles' => array(ComposanteRole::ROLE_ID),
),
array(
......
......@@ -204,10 +204,12 @@ return array(
'ApplicationServiceValidation' => 'Application\\Service\\ServiceValidation',
'ApplicationPeriode' => 'Application\\Service\\Periode',
'ApplicationMotifNonPaiement' => 'Application\\Service\\MotifNonPaiement',
'ApplicationModificationServiceDu' => 'Application\\Service\\ModificationServiceDu',
'ApplicationTypeVolumeHoraire' => 'Application\\Service\\TypeVolumeHoraire',
'FormServiceRechercheHydrator' => 'Application\Form\Service\RechercheHydrator',
'FormServiceSaisieFieldsetHydrator' => 'Application\Form\Service\SaisieFieldsetHydrator',
'FormServiceSaisieHydrator' => 'Application\Form\Service\SaisieHydrator',
'ProcessFormuleHetd' => 'Application\\Service\\Process\\FormuleHetd',
),
'factories' => array(
),
......
......@@ -168,6 +168,14 @@ class IntervenantController extends AbstractActionController implements \Applica
return $view;
}
public function voirHeuresCompAction()
{
$intervenant = $this->context()->intervenantFromRoute('id');
$formule = $this->getServiceLocator()->get('ProcessFormuleHetd');
return compact('intervenant', 'formule');
}
public function modifierAction()
{
if (!($id = $this->params()->fromRoute('id'))) {
......
......@@ -9,6 +9,9 @@ use Doctrine\ORM\Mapping as ORM;
*/
class Periode
{
const SEMESTRE_1 = 'S1';
const SEMESTRE_2 = 'S2';
/**
* @var \DateTime
*/
......
<?php
namespace Application\Service;
use Doctrine\ORM\QueryBuilder;
/**
* Description of ModificationServiceDu
*
* @author Laurent LÉCLUSE <laurent.lecluse at unicaen.fr>
*/
class ModificationServiceDu extends AbstractEntityService
{
/**
* retourne la classe des entités
*
* @return string
* @throws RuntimeException
*/
public function getEntityClass()
{
return 'Application\Entity\Db\ModificationServiceDu';
}
/**
* Retourne l'alias d'entité courante
*
* @return string
*/
public function getAlias(){
return 'msd';
}
/**
* Filtre la liste selon le contexte courant
*
* @param QueryBuilder|null $qb
* @param string|null $alias
* @return QueryBuilder
*/
public function finderByContext( QueryBuilder $qb=null, $alias=null )
{
list($qb,$alias) = $this->initQuery($qb, $alias);
$globalContext = $this->getContextProvider()->getGlobalContext();
$this->finderByAnnee( $globalContext->getannee(), $qb, $alias ); // Filtre d'année obligatoire
if ($globalContext->getIntervenant()){
$this->finderByIntervenant($globalContext->getIntervenant());
}
return $qb;
}
/**
*
* @param \Doctrine\ORM\QueryBuilder $qb
* @param string $alias
*/
public function getTotal( QueryBuilder $qb=null, $alias=null )
{
list($qb,$alias) = $this->initQuery($qb, $alias);
$list = $this->getList($qb);
$total = 0;
foreach( $list as $modif ){
$total += $modif->heures;
}
return $total;
}
}
\ No newline at end of file
......@@ -58,4 +58,24 @@ class Periode extends AbstractEntityService
$qb->orderBy("$alias.ordre");
return parent::getList($qb, $alias);
}
/**
* Retourne le semestre 1
*
* @return \Application\Entity\Db\Periode
*/
public function getSemestre1()
{
return $this->getRepo()->findOneBy(array('code' => PeriodeEntity::SEMESTRE_1));
}
/**
* Retourne le semestre 2
*
* @return \Application\Entity\Db\Periode
*/
public function getSemestre2()
{
return $this->getRepo()->findOneBy(array('code' => PeriodeEntity::SEMESTRE_2));
}
}
\ No newline at end of file
<?php
namespace Application\Service\Process;
use Application\Service\AbstractService;
use Application\Entity\Db\Intervenant;
/**
* Processus de gestion de la formule de Kerbeyrie
*
* @author Laurent LÉCLUSE <laurent.lecluse at unicaen.fr>
*/
class FormuleHetd extends AbstractService
{
/**
* Retourne les heures complémentaires calculées pour un intervenant à partir de ses services
*
* @param Intervenant $intervenant
* @return float
*/
public function getHeuresComplementaires( Intervenant $intervenant )
{
$sql = 'SELECT heures FROM V_FORMULE_HEURES_COMP WHERE intervenant_id = :intervenant';
$result = $this->getEntityManager()->getConnection()->executeQuery($sql, array('intervenant' => $intervenant->getId()))->fetchAll();
if (isset($result[0])){
return (float)$result[0]['HEURES'];
}else{
return 0;
}
return ;
}
/**
*
* @param \Application\Entity\Db\Intervenant $intervenant
*/
public function calculServiceDu( Intervenant $intervenant )
{
$smsd = $this->getServiceLocator()->get('applicationModificationServiceDu');
/* @var $smsd \Application\Service\ModificationServiceDu */
$qb = $smsd->finderByContext();
$smsd->finderByIntervenant( $intervenant, $qb );
$modifications = $smsd->getTotal( $qb );
$plafond = $intervenant->getStatut()->getServiceStatutaire();
return $plafond + $modifications;
}
}
\ No newline at end of file
......@@ -42,4 +42,14 @@ class Source extends AbstractEntityService
{
return $this->getRepo()->findOneBy(array('code' => SourceEntity::CODE_SOURCE_OSE));
}
/**
* Retourne l'entité de test OSE
*
* @return SourceEntity
*/
public function getTest()
{
return $this->getRepo()->findOneBy(array('code' => SourceEntity::CODE_SOURCE_TEST));
}
}
\ No newline at end of file
<?php
echo 'EN COURS DE REALISATION...';
\ No newline at end of file
......@@ -25,7 +25,7 @@ class IntervenantTest extends BaseTest
protected function setUp()
{
parent::setUp();
return null;
$em = $this->getEntityManager();
$this->source = $em->getRepository('Application\Entity\Db\Source')->findOneBy(array('libelle' => "Test"));
......@@ -83,6 +83,8 @@ class IntervenantTest extends BaseTest
public function testIntervenantPermanentClassTableInheritance()
{
$this->markTestSkipped("On verra plus tard...");
$em = $this->getEntityManager();
$ip = Asset::intervenantPermanent($this->civilite, $this->structure, $this->corps, $this->sectionCnu);
......@@ -103,6 +105,8 @@ class IntervenantTest extends BaseTest
public function testIntervenantExterieurClassTableInheritance()
{
$this->markTestSkipped("On verra plus tard...");
$em = $this->getEntityManager();
$ie = Asset::intervenantExterieur($this->civilite, $this->structure, $this->regimeSecu);
......@@ -124,7 +128,7 @@ class IntervenantTest extends BaseTest
protected function tearDown()
{
parent::tearDown();
return null;
$em = $this->getEntityManager();
$em->remove($this->structure);
......
<?php
namespace OSETest\Service;
use Doctrine\ORM\EntityManager;
use OSETest\Bootstrap;
use PHPUnit_Framework_TestCase;
use Zend\ServiceManager\ServiceManager;
/**
* Description of BaseTest
*
* @author Laurent LÉCLUSE <laurent.lecluse at unicaen.fr>
*/
abstract class BaseTest extends PHPUnit_Framework_TestCase
{
protected $em;
protected $eventm;
protected $user;
protected function setUp()
{
$em = $this->getEntityManager();
if (!($this->user = $em->find("Application\Entity\Db\Utilisateur", $id = 1))) {
$this->markTestIncomplete("Utilisateur (id = $id) introuvable.");
}
// recherche du listener de gestion de l'historique pour lui transmettre l'utilisateur
foreach ($this->getEventManager()->getListeners() as $event => $listeners) {
foreach ($listeners as $listener) {
if ($listener instanceof \Common\ORM\Event\Listeners\HistoriqueListener) {
$listener->setIdentity(array('db' => $this->user));
}
}
}
}