Commit 524d93ae authored by joriot221's avatar joriot221
Browse files

Merge branch 'FJ_Administration_Periodes'

parents a5a2868c 0a0d1f82
......@@ -33,18 +33,6 @@ return [
'position' => 14,
'commentaire' => NULL,
],
'ECART_MOIS_PAIEMENT' => [
'name' => 'ECART_MOIS_PAIEMENT',
'type' => 'int',
'bdd-type' => 'NUMBER',
'length' => 0,
'scale' => NULL,
'precision' => NULL,
'nullable' => FALSE,
'default' => NULL,
'position' => 15,
'commentaire' => NULL,
],
'ENSEIGNEMENT' => [
'name' => 'ENSEIGNEMENT',
'type' => 'bool',
......@@ -52,10 +40,10 @@ return [
'length' => 0,
'scale' => '0',
'precision' => 1,
'nullable' => TRUE,
'default' => NULL,
'nullable' => false,
'default' => null,
'position' => 6,
'commentaire' => NULL,
'commentaire' => null,
],
'HISTO_CREATEUR_ID' => [
'name' => 'HISTO_CREATEUR_ID',
......@@ -146,12 +134,12 @@ return [
'type' => 'string',
'bdd-type' => 'VARCHAR2',
'length' => 15,
'scale' => NULL,
'precision' => NULL,
'nullable' => TRUE,
'default' => NULL,
'scale' => null,
'precision' => null,
'nullable' => false,
'default' => null,
'position' => 4,
'commentaire' => NULL,
'commentaire' => null,
],
'LIBELLE_LONG' => [
'name' => 'LIBELLE_LONG',
......@@ -184,10 +172,10 @@ return [
'length' => 0,
'scale' => '0',
'precision' => 1,
'nullable' => TRUE,
'default' => NULL,
'nullable' => false,
'default' => null,
'position' => 7,
'commentaire' => NULL,
'commentaire' => null,
],
],
];
......
......@@ -1074,7 +1074,6 @@ return [
'HISTO_DESTRUCTION',
'HISTO_DESTRUCTEUR_ID',
'ECART_MOIS',
'ECART_MOIS_PAIEMENT',
],
'PIECE_JOINTE' => [
'ID',
......
......@@ -269,7 +269,6 @@ return [
"ENSEIGNEMENT" => false,
"PAIEMENT" => true,
"ECART_MOIS" => 0,
"ECART_MOIS_PAIEMENT" => -1,
],
[
"CODE" => "P02",
......@@ -279,7 +278,6 @@ return [
"ENSEIGNEMENT" => false,
"PAIEMENT" => true,
"ECART_MOIS" => 1,
"ECART_MOIS_PAIEMENT" => 0,
],
[
"CODE" => "P03",
......@@ -289,7 +287,6 @@ return [
"ENSEIGNEMENT" => false,
"PAIEMENT" => true,
"ECART_MOIS" => 2,
"ECART_MOIS_PAIEMENT" => 1,
],
[
"CODE" => "P04",
......@@ -299,7 +296,6 @@ return [
"ENSEIGNEMENT" => false,
"PAIEMENT" => true,
"ECART_MOIS" => 3,
"ECART_MOIS_PAIEMENT" => 2,
],
[
"CODE" => "P05",
......@@ -309,7 +305,6 @@ return [
"ENSEIGNEMENT" => false,
"PAIEMENT" => true,
"ECART_MOIS" => 4,
"ECART_MOIS_PAIEMENT" => 3,
],
[
"CODE" => "P06",
......@@ -319,7 +314,6 @@ return [
"ENSEIGNEMENT" => false,
"PAIEMENT" => true,
"ECART_MOIS" => 5,
"ECART_MOIS_PAIEMENT" => 4,
],
[
"CODE" => "P07",
......@@ -329,7 +323,6 @@ return [
"ENSEIGNEMENT" => false,
"PAIEMENT" => true,
"ECART_MOIS" => 6,
"ECART_MOIS_PAIEMENT" => 5,
],
[
"CODE" => "P08",
......@@ -339,7 +332,6 @@ return [
"ENSEIGNEMENT" => false,
"PAIEMENT" => true,
"ECART_MOIS" => 7,
"ECART_MOIS_PAIEMENT" => 6,
],
[
"CODE" => "P09",
......@@ -349,7 +341,6 @@ return [
"ENSEIGNEMENT" => false,
"PAIEMENT" => true,
"ECART_MOIS" => 8,
"ECART_MOIS_PAIEMENT" => 7,
],
[
"CODE" => "P10",
......@@ -359,7 +350,6 @@ return [
"ENSEIGNEMENT" => false,
"PAIEMENT" => true,
"ECART_MOIS" => 9,
"ECART_MOIS_PAIEMENT" => 8,
],
[
"CODE" => "P11",
......@@ -369,7 +359,6 @@ return [
"ENSEIGNEMENT" => false,
"PAIEMENT" => true,
"ECART_MOIS" => 10,
"ECART_MOIS_PAIEMENT" => 9,
],
[
"CODE" => "P12",
......@@ -379,7 +368,6 @@ return [
"ENSEIGNEMENT" => false,
"PAIEMENT" => true,
"ECART_MOIS" => 11,
"ECART_MOIS_PAIEMENT" => 10,
],
[
"CODE" => "P13",
......@@ -389,7 +377,6 @@ return [
"ENSEIGNEMENT" => false,
"PAIEMENT" => true,
"ECART_MOIS" => 12,
"ECART_MOIS_PAIEMENT" => 11,
],
[
"CODE" => "P14",
......@@ -399,7 +386,6 @@ return [
"ENSEIGNEMENT" => false,
"PAIEMENT" => true,
"ECART_MOIS" => 13,
"ECART_MOIS_PAIEMENT" => 12,
],
[
"CODE" => "P15",
......@@ -409,7 +395,6 @@ return [
"ENSEIGNEMENT" => false,
"PAIEMENT" => true,
"ECART_MOIS" => 14,
"ECART_MOIS_PAIEMENT" => 13,
],
[
"CODE" => "P16",
......@@ -419,7 +404,6 @@ return [
"ENSEIGNEMENT" => false,
"PAIEMENT" => true,
"ECART_MOIS" => 15,
"ECART_MOIS_PAIEMENT" => 14,
],
[
"CODE" => "PTD",
......@@ -429,7 +413,6 @@ return [
"ENSEIGNEMENT" => false,
"PAIEMENT" => true,
"ECART_MOIS" => 16,
"ECART_MOIS_PAIEMENT" => 15,
],
[
"CODE" => "S1",
......@@ -439,7 +422,6 @@ return [
"ENSEIGNEMENT" => true,
"PAIEMENT" => false,
"ECART_MOIS" => 0,
"ECART_MOIS_PAIEMENT" => -1,
],
[
"CODE" => "S2",
......@@ -449,7 +431,6 @@ return [
"ENSEIGNEMENT" => true,
"PAIEMENT" => false,
"ECART_MOIS" => 5,
"ECART_MOIS_PAIEMENT" => 4,
],
],
......
......@@ -336,6 +336,8 @@ return [
'campagnes-saisie-visualisation' => 'Campagnes de saisie - Visualisation',
'annees-edition' => 'Années - Édition',
'annees-visualisation' => 'Années - Visualisation',
'periodes-edition' => 'Périodes - Édition',
'periodes-visualisation' => 'Périodes - Visualisation',
],
],
......
......@@ -52,7 +52,7 @@ return [
],
'may_terminate' => true,
],
'administration-intervenant' => [
'administration-intervenant' => [
'type' => 'Literal',
'options' => [
'route' => '/administration-intervenant',
......@@ -63,7 +63,7 @@ return [
],
'may_terminate' => true,
],
'administration-nomenclature-rh' => [
'administration-nomenclature-rh' => [
'type' => 'Literal',
'options' => [
'route' => '/administration-nomenclature-rh',
......@@ -74,6 +74,17 @@ return [
],
'may_terminate' => true,
],
'administration-periode' => [
'type' => 'Literal',
'options' => [
'route' => '/administration-periode',
'defaults' => [
'controller' => 'Application\Controller\Administration',
'action' => 'administration-periode',
],
],
'may_terminate' => true,
],
],
],
......@@ -106,7 +117,7 @@ return [
],
],
'gestion-nomenclature-rh' => [
'gestion-nomenclature-rh' => [
'label' => 'Gestion des nomenclatures RH',
'icon' => 'glyphicon glyphicon - list-alt',
'route' => 'administration-nomenclature-rh',
......@@ -133,7 +144,15 @@ return [
],
],
],
'gestion-intervenant' => [
'gestion-periode' => [
'label' => 'Gestion des periodes',
'icon' => 'glyphicon glyphicon - list-alt',
'route' => 'periodes',
'resource' => PrivilegeController::getResourceId('Application\Controller\Periode', 'index'),
'order' => 84,
'border - color' => '#111',
],
'gestion-intervenant' => [
'label' => 'Gestion intervenants (Statuts, PJ, etc...)',
'icon' => 'glyphicon glyphicon - list-alt',
'route' => 'administration-intervenant',
......@@ -216,7 +235,8 @@ return [
'administration-financiere',
'administration-intervenant',
'administration-referentiel-commun',
'administration-nomenclature-rh'],
'administration-nomenclature-rh',
'administration-periode',],
'privileges' => [
Privileges::IMPORT_ECARTS,
Privileges::IMPORT_MAJ,
......@@ -247,6 +267,7 @@ return [
Privileges::MOTIF_NON_PAIEMENT_VISUALISATION,
Privileges::ODF_RECONDUCTION_OFFRE,
Privileges::STRUCTURES_ADMINISTRATION_VISUALISATION,
Privileges::PARAMETRES_PERIODES_VISUALISATION,
],
'assertion' => Assertion\GestionAssertion::class,
],
......
<?php
/*
* @author JORIOT Florian <florian.joriot at unicaen.fr>
*/
namespace Application;
use Application\Provider\Privilege\Privileges;
use UnicaenAuth\Guard\PrivilegeController;
return [
'router' => [
'routes' => [
'periodes' => [
'type' => 'Literal',
'options' => [
'route' => '/periodes',
'defaults' => [
'controller' => 'Application\Controller\Periode',
'action' => 'index',
],
],
'may_terminate' => true,
'child_routes' => [
'saisie' => [
'type' => 'Segment',
'options' => [
'route' => '/saisie[/:periode]',
'constraints' => [
'periode' => '[0-9]*',
],
'defaults' => [
'action' => 'saisie',
],
],
'may_terminate' => true,
],
'supprimer' => [
'type' => 'Segment',
'options' => [
'route' => '/supprimer/:periode',
'constraints' => [
'periode' => '[0-9]*',
],
'defaults' => [
'action' => 'supprimer',
],
],
'may_terminate' => true,
],
'trier' => [
'type' => 'Segment',
'options' => [
'route' => '/trier',
'contraints' => [
],
'defaults' => [
'action' => 'trier',
],
],
'may_terminate' => true,
],
],
],
],
],
'bjyauthorize' => [
'guards' => [
PrivilegeController::class => [
[
'controller' => 'Application\Controller\Periode',
'action' => ['index'],
'privileges' => [Privileges::PARAMETRES_PERIODES_VISUALISATION],
],
[
'controller' => 'Application\Controller\Periode',
'action' => ['saisie', 'supprimer', 'trier'],
'privileges' => [Privileges::PARAMETRES_PERIODES_EDITION],
],
],
],
],
'controllers' => [
'factories' => [
'Application\Controller\Periode' => Controller\Factory\PeriodeControllerFactory::class,
],
],
'form_elements' => [
'factories' => [
Form\Periode\PeriodeSaisieForm::class => Form\Periode\PeriodeSaisieFormFactory::class,
],
],
];
<?php
/*
* @author JORIOT Florian <florian.joriot at unicaen.fr>
*/
namespace Application\Controller\Factory;
use Application\Controller\PeriodeController;
use Psr\Container\ContainerInterface;
class PeriodeControllerFactory
{
/**
* Create controller
*
* @param ContainerInterface $container
*
* @return PeriodeController
*/
public function __invoke(ContainerInterface $container, $requestedName, $options = null)
{
$renderer = $container->get('ViewRenderer');
$controller = new PeriodeController($renderer);
return $controller;
}
}
\ No newline at end of file
<?php
/*
* @author JORIOT Florian <florian.joriot at unicaen.fr>
*/
namespace Application\Controller;
use Application\Form\Periode\Traits\PeriodeSaisieFormAwareTrait;
use Application\Service\Traits\PeriodeServiceAwareTrait;
use Cassandra\Exception\ExecutionException;
use Laminas\View\Model\JsonModel;
use UnicaenApp\View\Model\MessengerViewModel;
use UnicaenApp\Service\EntityManagerAwareTrait;
/**
* Description of PeriodeController
*
* @author Florian JORIOT <florian.joriot at unicaen.fr>
*/
class PeriodeController extends AbstractController
{
use EntityManagerAwareTrait;
use PeriodeSaisieFormAwareTrait;
use PeriodeServiceAwareTrait;
public function indexAction()
{
$query = $this->em()->createQuery('SELECT p FROM Application\Entity\Db\Periode p WHERE p.histoDestruction is null ORDER BY p.ordre');
$periodes = $query->getResult();
return compact('periodes');
}
public function saisieAction()
{
$periode = $this->getEvent()->getParam('periode');
$form = $this->getFormPeriodeSaisie();
if (empty($periode)) {
$title = "Création d'une nouvelle periode";
$periode = $this->getServicePeriode()->newEntity();
} else {
$title = "Edition d'une periode";
}
$form->bindRequestSave($periode, $this->getRequest(), function () use ($periode, $form) {
$this->getServicePeriode()->save($periode);
$this->flashMessenger()->addSuccessMessage(
"Ajout réussis"
);
});
return compact('form', 'title');
}
public function supprimerAction()
{
$periode = $this->getEvent()->getParam('periode');
$this->getServicePeriode()->delete($periode, false);
return new MessengerViewModel();
}
public function trierAction()
{
$champsIds = explode(',', $this->params()->fromPost('champsIds', ''));
$ordre = 1;
foreach ($champsIds as $champId) {
$sp = $this->getServicePeriode()->get($champId);
if ($sp) {
$sp->setOrdre($ordre);
$ordre++;
$this->getServicePeriode()->save($sp);
}
}
return new MessengerViewModel();
}
}
\ No newline at end of file
......@@ -150,7 +150,7 @@ class StatutIntervenantController extends AbstractController
}
}
return new JsonModel(['msg' => 'Tri des champs effectué']);
return new MessengerViewModel();
}
}
......
......@@ -179,7 +179,7 @@ class TypeInterventionController extends AbstractController
}
}
return new JsonModel(['msg' => 'Tri des champs effectué']);
return new MessengerViewModel();
}
......
......@@ -20,7 +20,6 @@
<field name="ordre" type="integer" column="ORDRE" nullable="false"/>
<field name="paiement" type="boolean" column="PAIEMENT" nullable="true"/>
<field name="ecartMois" type="integer" column="ECART_MOIS" nullable="false"/>
<field name="ecartMoisPaiement" type="integer" column="ECART_MOIS_PAIEMENT" nullable="false"/>
<many-to-one field="histoModificateur" target-entity="Application\Entity\Db\Utilisateur">
<join-columns>
<join-column name="HISTO_MODIFICATEUR_ID" referenced-column-name="ID"/>
......
......@@ -56,11 +56,6 @@ class Periode implements HistoriqueAwareInterface
*/
protected $ecartMois;
/**
* @var integer
*/
protected $ecartMoisPaiement;
/**
* miseEnPaiementIntervenantStructure
*
......@@ -282,36 +277,6 @@ class Periode implements HistoriqueAwareInterface
return $this->ecartMois;
}
/**
* Set ecartMoisPaiement
*
* @param integer $ecartMoisPaiement
*
* @return Periode
*/
public function setEcartMoisPaiement($ecartMoisPaiement)
{
$this->ecartMoisPaiement = $ecartMoisPaiement;
return $this;
}
/**
* Get ecartMoisPaiement
*
* @return boolean
*/
public function getEcartMoisPaiement()
{
return $this->ecartMoisPaiement;
}
/**
* Retourne la date de paiement de la période
*
......
<?php
/*
* @author JORIOT Florian <florian.joriot at unicaen.fr>
*/
namespace Application\Form\Periode;
use Application\Filter\FloatFromString;
use Application\Form\AbstractForm;
use Application\Hydrator\GenericHydrator;
use Application\Service\Traits\SourceServiceAwareTrait;
use Laminas\Form\Element\Csrf;
/**
* Description of PeriodeForm
*
* @author Florian JORIOT <florian.joriot at unicaen.fr>
*/
class PeriodeSaisieForm extends AbstractForm