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
03704f67
Commit
03704f67
authored
Sep 24, 2014
by
lecluse
Browse files
Refactorisation, Optimisation, correction de bugs
parent
dca1c881
Changes
27
Hide whitespace changes
Inline
Side-by-side
data/DoctrineORMModule/Proxy/__CG__ApplicationEntityDbElementPedagogique.php
View file @
03704f67
...
...
@@ -64,10 +64,10 @@ class ElementPedagogique extends \Application\Entity\Db\ElementPedagogique imple
public
function
__sleep
()
{
if
(
$this
->
__isInitialized__
)
{
return
array
(
'__isInitialized__'
,
'histoCreation'
,
'histoDestruction'
,
'histoModification'
,
'libelle'
,
'sourceCode'
,
'tauxFoad'
,
'fi'
,
'fc'
,
'fa'
,
'validiteDebut'
,
'validiteFin'
,
'id'
,
'cheminPedagogique'
,
'structure'
,
'periode'
,
'source'
,
'histoModificateur'
,
'histoCreateur'
,
'histoDestructeur'
,
'etape'
,
'elementModulateur'
,
'hasChanged'
,
''
.
"
\0
"
.
'Application\\Entity\\Db\\ElementPedagogique'
.
"
\0
"
.
'typeIntervention'
);
return
array
(
'__isInitialized__'
,
'histoCreation'
,
'histoDestruction'
,
'histoModification'
,
'libelle'
,
'sourceCode'
,
'tauxFoad'
,
'fi'
,
'fc'
,
'fa'
,
'validiteDebut'
,
'validiteFin'
,
'id'
,
'cheminPedagogique'
,
'service'
,
'structure'
,
'periode'
,
'source'
,
'histoModificateur'
,
'histoCreateur'
,
'histoDestructeur'
,
'etape'
,
'elementModulateur'
,
'hasChanged'
,
''
.
"
\0
"
.
'Application\\Entity\\Db\\ElementPedagogique'
.
"
\0
"
.
'typeIntervention'
);
}
return
array
(
'__isInitialized__'
,
'histoCreation'
,
'histoDestruction'
,
'histoModification'
,
'libelle'
,
'sourceCode'
,
'tauxFoad'
,
'fi'
,
'fc'
,
'fa'
,
'validiteDebut'
,
'validiteFin'
,
'id'
,
'cheminPedagogique'
,
'structure'
,
'periode'
,
'source'
,
'histoModificateur'
,
'histoCreateur'
,
'histoDestructeur'
,
'etape'
,
'elementModulateur'
,
'hasChanged'
,
''
.
"
\0
"
.
'Application\\Entity\\Db\\ElementPedagogique'
.
"
\0
"
.
'typeIntervention'
);
return
array
(
'__isInitialized__'
,
'histoCreation'
,
'histoDestruction'
,
'histoModification'
,
'libelle'
,
'sourceCode'
,
'tauxFoad'
,
'fi'
,
'fc'
,
'fa'
,
'validiteDebut'
,
'validiteFin'
,
'id'
,
'cheminPedagogique'
,
'service'
,
'structure'
,
'periode'
,
'source'
,
'histoModificateur'
,
'histoCreateur'
,
'histoDestructeur'
,
'etape'
,
'elementModulateur'
,
'hasChanged'
,
''
.
"
\0
"
.
'Application\\Entity\\Db\\ElementPedagogique'
.
"
\0
"
.
'typeIntervention'
);
}
/**
...
...
@@ -716,6 +716,39 @@ class ElementPedagogique extends \Application\Entity\Db\ElementPedagogique imple
return
parent
::
getElementModulateur
();
}
/**
* {@inheritDoc}
*/
public
function
addService
(
\
Application\Entity\Db\Service
$service
)
{
$this
->
__initializer__
&&
$this
->
__initializer__
->
__invoke
(
$this
,
'addService'
,
array
(
$service
));
return
parent
::
addService
(
$service
);
}
/**
* {@inheritDoc}
*/
public
function
removeService
(
\
Application\Entity\Db\Service
$service
)
{
$this
->
__initializer__
&&
$this
->
__initializer__
->
__invoke
(
$this
,
'removeService'
,
array
(
$service
));
return
parent
::
removeService
(
$service
);
}
/**
* {@inheritDoc}
*/
public
function
getService
()
{
$this
->
__initializer__
&&
$this
->
__initializer__
->
__invoke
(
$this
,
'getService'
,
array
());
return
parent
::
getService
();
}
/**
* {@inheritDoc}
*/
...
...
module/Application/config/intervenant.config.php
View file @
03704f67
...
...
@@ -133,7 +133,7 @@ return array(
),
'defaults'
=>
array
(
'controller'
=>
'Application\Controller\Service'
,
'action'
=>
'in
tervenant
'
,
'action'
=>
'in
dex
'
,
),
),
),
...
...
@@ -288,7 +288,7 @@ return array(
'intervenant'
,
),
'withtarget'
=>
true
,
'resource'
=>
'controller/Application\Controller\Service:in
tervenant
'
,
'resource'
=>
'controller/Application\Controller\Service:in
dex
'
,
'visible'
=>
'IntervenantNavigationPageVisibility'
,
),
'pieces-jointes'
=>
array
(
...
...
module/Application/config/module.config.php
View file @
03704f67
...
...
@@ -2,24 +2,33 @@
namespace
Application
;
use
Application\Acl\Role
;
use
Application\Acl\AdministrateurRole
;
use
Application\Acl\ComposanteRole
;
use
Application\Acl\DirecteurComposanteRole
;
use
Application\Acl\GestionnaireComposanteRole
;
use
Application\Acl\ResponsableComposanteRole
;
use
Application\Acl\SuperviseurComposanteRole
;
use
Application\Acl\ResponsableRechercheLaboRole
;
use
Application\Acl\DrhRole
;
use
Application\Acl\GestionnaireDrhRole
;
use
Application\Acl\ResponsableDrhRole
;
use
Application\Acl\EtablissementRole
;
use
Application\Acl\SuperviseurEtablissementRole
;
use
Application\Acl\IntervenantRole
;
use
Application\Acl\IntervenantPermanentRole
;
use
Application\Acl\IntervenantExterieurRole
;
use
Application\Acl\FoadRole
;
use
Application\Acl\ResponsableFoadRole
;
const
R_USER
=
'user'
;
const
R_ROLE
=
Acl\Role
::
ROLE_ID
;
const
R_ADMINISTRATEUR
=
Acl\AdministrateurRole
::
ROLE_ID
;
const
R_COMPOSANTE
=
Acl\ComposanteRole
::
ROLE_ID
;
const
R_DIRECTEUR_COMPOSANTE
=
Acl\DirecteurComposanteRole
::
ROLE_ID
;
const
R_GESTIONNAIRE_COMPOSANTE
=
Acl\GestionnaireComposanteRole
::
ROLE_ID
;
const
R_RESPONSABLE_COMPOSANTE
=
Acl\ResponsableComposanteRole
::
ROLE_ID
;
const
R_SUPERVISEUR_COMPOSANTE
=
Acl\SuperviseurComposanteRole
::
ROLE_ID
;
const
R_RESPONSABLE_RECHERCHE_LABO
=
Acl\ResponsableRechercheLaboRole
::
ROLE_ID
;
const
R_DRH
=
Acl\DrhRole
::
ROLE_ID
;
const
R_GESTIONNAIRE_DRH
=
Acl\GestionnaireDrhRole
::
ROLE_ID
;
const
R_RESPONSABLE_DRH
=
Acl\ResponsableDrhRole
::
ROLE_ID
;
const
R_ETABLISSEMENT
=
Acl\EtablissementRole
::
ROLE_ID
;
const
R_SUPERVISEUR_ETABLISSEMENT
=
Acl\SuperviseurEtablissementRole
::
ROLE_ID
;
const
R_INTERVENANT
=
Acl\IntervenantRole
::
ROLE_ID
;
const
R_INTERVENANT_PERMANENT
=
Acl\IntervenantPermanentRole
::
ROLE_ID
;
const
R_INTERVENANT_EXTERIEUR
=
Acl\IntervenantExterieurRole
::
ROLE_ID
;
const
R_FOAD
=
Acl\FoadRole
::
ROLE_ID
;
const
R_RESPONSABLE_FOAD
=
Acl\ResponsableFoadRole
::
ROLE_ID
;
$main
=
array
(
'doctrine'
=>
array
(
...
...
module/Application/config/service.config.php
View file @
03704f67
...
...
@@ -2,26 +2,6 @@
namespace
Application
;
use
Application\Acl\Role
;
use
Application\Acl\AdministrateurRole
;
use
Application\Acl\ComposanteRole
;
use
Application\Acl\DirecteurComposanteRole
;
use
Application\Acl\GestionnaireComposanteRole
;
use
Application\Acl\ResponsableComposanteRole
;
use
Application\Acl\SuperviseurComposanteRole
;
use
Application\Acl\ResponsableRechercheLaboRole
;
use
Application\Acl\DrhRole
;
use
Application\Acl\GestionnaireDrhRole
;
use
Application\Acl\ResponsableDrhRole
;
use
Application\Acl\EtablissementRole
;
use
Application\Acl\SuperviseurEtablissementRole
;
use
Application\Acl\IntervenantRole
;
use
Application\Acl\IntervenantPermanentRole
;
use
Application\Acl\IntervenantExterieurRole
;
use
Application\Acl\FoadRole
;
use
Application\Acl\ResponsableFoadRole
;
return
array
(
'router'
=>
array
(
'routes'
=>
array
(
...
...
@@ -104,12 +84,13 @@ return array(
'default'
=>
array
(
'type'
=>
'Segment'
,
'options'
=>
array
(
'route'
=>
'/:action'
,
'route'
=>
'/:action
[/:id]
'
,
'constraints'
=>
array
(
'action'
=>
'[a-zA-Z][a-zA-Z0-9_-]*'
,
),
'defaults'
=>
array
(
'action'
=>
'index'
,
'id'
=>
'[0-9]*'
,
),
),
),
...
...
@@ -194,15 +175,15 @@ return array(
array
(
'controller'
=>
'Application\Controller\Service'
,
'action'
=>
array
(
'index'
,
'saisie'
,
'suppression'
,
'voir'
,
'rafraichir-ligne'
,
'volumes-horaires-refresh'
),
'roles'
=>
array
(
IntervenantRole
::
ROLE_ID
,
ComposanteRole
::
ROLE_ID
,
AdministrateurRole
::
ROLE_ID
,
DrhRole
::
ROLE_ID
,
EtablissementRole
::
ROLE_ID
,
FoadRole
::
ROLE_ID
)
,
'roles'
=>
[
R_ROLE
]
,
),
array
(
'controller'
=>
'Application\Controller\Service'
,
'action'
=>
array
(
'resume'
,
'resume-refresh'
,
'filtres'
),
'roles'
=>
array
(
ComposanteRole
::
ROLE_ID
,
AdministrateurRole
::
ROLE_ID
,
DrhRole
::
ROLE_ID
,
EtablissementRole
::
ROLE_ID
,
FoadRole
::
ROLE_ID
)
'roles'
=>
[
R_ADMINISTRATEUR
,
R_COMPOSANTE
,
R_RESPONSABLE_RECHERCHE_LABO
,
R_DRH
,
R_ETABLISSEMENT
,
R_FOAD
]
),
array
(
'controller'
=>
'Application\Controller\ServiceReferentiel'
,
'action'
=>
array
(
'index'
,
'intervenant'
,
'saisir'
,
'supprimer'
,
'voir'
,
'voirLigne'
,
'voirListe'
),
'roles'
=>
array
(
IntervenantRole
::
ROLE_ID
,
ComposanteRole
::
ROLE_ID
,
AdministrateurRole
::
ROLE_ID
,
DrhRole
::
ROLE_ID
,
EtablissementRole
::
ROLE_ID
,
FoadRole
::
ROLE_ID
)
'roles'
=>
[
R_ROLE
],
),
),
),
...
...
@@ -217,25 +198,25 @@ return array(
'BjyAuthorize\Provider\Rule\Config'
=>
array
(
'allow'
=>
array
(
array
(
array
(
ComposanteRole
::
ROLE_ID
,
IntervenantRole
::
ROLE_ID
,
AdministrateurRole
::
ROLE_ID
)
,
[
R_ROLE
]
,
'Service'
,
array
(
'create'
,
'read'
,
'delete'
,
'update'
),
'ServiceAssertion'
,
),
array
(
array
(
AdministrateurRole
::
ROLE_ID
,
ComposanteRole
::
ROLE_ID
,
DrhRole
::
ROLE_ID
,
FoadRole
::
ROLE_ID
,
EtablissementRole
::
ROLE_ID
)
,
[
R_ADMINISTRATEUR
,
R_COMPOSANTE
,
R_RESPONSABLE_RECHERCHE_LABO
,
R_DRH
,
R_ETABLISSEMENT
,
R_FOAD
]
,
'ServiceController'
,
array
(
'show-
filtre
s'
),
array
(
'show-
multiples-intervenant
s'
),
'ServiceAssertion'
,
),
array
(
array
(
ComposanteRole
::
ROLE_ID
)
,
[
R_COMPOSANTE
]
,
'ServiceListView'
,
array
(
'info-only-structure'
),
'ServiceAssertion'
,
),
array
(
array
(
IntervenantRole
::
ROLE_ID
)
,
[
R_INTERVENANT
]
,
'ServiceListView'
,
array
(
'aide-intervenant'
),
'ServiceAssertion'
,
...
...
module/Application/src/Application/Assertion/ServiceAssertion.php
View file @
03704f67
...
...
@@ -59,7 +59,9 @@ class ServiceAssertion extends AbstractAssertion
$intervenant
=
$resource
->
getIntervenant
();
$serviceStructure
=
$resource
->
getStructureEns
();
if
(
!
$serviceStructure
&&
$resource
->
getElementPedagogique
())
$serviceStructure
=
$resource
->
getElementPedagogique
()
->
getStructure
();
$intervenantStructure
=
$resource
->
getStructureAff
()
?:
$resource
->
getIntervenant
()
->
getStructure
();
if
(
$intervenant
){
$intervenantStructure
=
$resource
->
getStructureAff
()
?:
$resource
->
getIntervenant
()
->
getStructure
();
}
/*********************************************************
* Rôle intervenant
...
...
@@ -92,6 +94,8 @@ class ServiceAssertion extends AbstractAssertion
return
true
;
}
}
}
elseif
(
'create'
==
$privilege
){
return
true
;
}
}
...
...
module/Application/src/Application/Controller/ServiceController.php
View file @
03704f67
...
...
@@ -6,7 +6,6 @@ use Zend\Mvc\Controller\AbstractActionController;
use
Common\Exception\RuntimeException
;
use
Common\Exception\LogicException
;
use
Application\Exception\DbException
;
use
Application\Acl\IntervenantExterieurRole
;
use
Application\Entity\Db\IntervenantExterieur
;
/**
...
...
@@ -18,6 +17,11 @@ use Application\Entity\Db\IntervenantExterieur;
*/
class
ServiceController
extends
AbstractActionController
{
/**
* Initialisation des filtres Doctrine pour les historique.
* Objectif : laisser passer les enregistrements passés en historique pour mettre en évidence ensuite les erreurs éventuelles
* (services sur des enseignements fermés, etc.)
*/
protected
function
initFilters
()
{
$this
->
em
()
->
getFilters
()
->
enable
(
'historique'
)
...
...
@@ -27,22 +31,42 @@ class ServiceController extends AbstractActionController
}
public
function
indexAction
()
{
$totaux
=
$this
->
params
()
->
fromQuery
(
'totaux'
)
==
'1'
;
$service
=
$this
->
getServiceService
();
$role
=
$this
->
getContextProvider
()
->
getSelectedIdentityRole
();
$annee
=
$this
->
getContextProvider
()
->
getGlobalContext
()
->
getAnnee
();
$qb
=
$service
->
finderByContext
();
$viewModel
=
new
\
Zend\View\Model\ViewModel
();
$typeVolumeHoraire
=
$this
->
getServiceTypeVolumehoraire
()
->
getPrevu
();
$filter
=
new
\
stdClass
();
$title
=
"Enseignements et référentiel <small>
$annee
</small>"
;
{
$totaux
=
$this
->
params
()
->
fromQuery
(
'totaux'
,
0
)
==
'1'
;
$service
=
$this
->
getServiceService
();
$role
=
$this
->
getContextProvider
()
->
getSelectedIdentityRole
();
$intervenant
=
$this
->
context
()
->
intervenantFromRoute
();
$annee
=
$this
->
getContextProvider
()
->
getGlobalContext
()
->
getAnnee
();
$viewModel
=
new
\
Zend\View\Model\ViewModel
();
$typeVolumeHoraire
=
$this
->
getServiceTypeVolumehoraire
()
->
getPrevu
();
$showMultiplesIntervenants
=
(
!
$intervenant
)
&&
$this
->
isAllowed
(
'ServiceController'
,
'show-multiples-intervenants'
);
if
(
!
$this
->
isAllowed
(
$this
->
getServiceService
()
->
newEntity
()
->
setIntervenant
(
$intervenant
),
'read'
)){
throw
new
\
BjyAuthorize\Exception\UnAuthorizedException
();
}
$this
->
initFilters
();
/* Initialisation, si ce n'est pas un intervenant, du formulaire de recherche */
if
(
!
$role
instanceof
\
Application\Acl\IntervenantRole
){
$intervenant
=
null
;
$qb
=
$service
->
finderByContext
();
$service
->
leftJoin
(
$this
->
getServiceElementPedagogique
(),
$qb
,
'elementPedagogique'
,
true
);
$this
->
getServiceElementPedagogique
()
->
leftJoin
(
'applicationEtape'
,
$qb
,
'etape'
,
true
);
$this
->
getServiceElementPedagogique
()
->
leftJoin
(
'applicationPeriode'
,
$qb
,
'periode'
,
true
);
$service
->
join
(
$this
->
getServiceIntervenant
(),
$qb
,
'intervenant'
,
true
);
$volumeHoraireService
=
$this
->
getServiceLocator
()
->
get
(
'applicationVolumehoraire'
);
/* @var $volumeHoraireService \Application\Service\VolumeHoraire */
$service
->
leftjoin
(
$volumeHoraireService
,
$qb
,
'volumeHoraire'
,
true
);
$volumeHoraireService
->
leftJoin
(
'applicationMotifNonPaiement'
,
$qb
,
'motifNonPaiement'
,
true
);
$this
->
getServiceElementPedagogique
()
->
leftJoin
(
'applicationTypeIntervention'
,
$qb
,
'typeIntervention'
,
true
);
if
(
!
$intervenant
){
$intervenant
=
method_exists
(
$role
,
'getIntervenant'
)
?
$role
->
getIntervenant
()
:
null
;
}
else
{
$service
->
finderByIntervenant
(
$intervenant
,
$qb
);
// filtre par intervenant souhaité
}
if
(
$showMultiplesIntervenants
){
$action
=
$this
->
getRequest
()
->
getQuery
(
'action'
,
null
);
// ne pas afficher par défaut, sauf si demandé explicitement
$params
=
$this
->
getEvent
()
->
getRouteMatch
()
->
getParams
();
$params
[
'action'
]
=
'filtres'
;
...
...
@@ -52,17 +76,16 @@ class ServiceController extends AbstractActionController
/* @var $rechercheForm \Application\Form\Service\Recherche */
$filter
=
$rechercheForm
->
hydrateFromSession
();
$service
->
finderByFilterObject
(
$filter
,
null
,
$qb
);
}
else
{
$intervenant
=
$role
->
getIntervenant
();
$service
->
finderByIntervenant
(
$intervenant
,
$qb
);
if
(
$role
instanceof
\
Application\Acl\ComposanteRole
){
$service
->
finderByComposante
(
$role
->
getStructure
(),
$qb
);
}
$this
->
getContextProvider
()
->
getLocalContext
()
->
fromArray
(
// sauvegarde des filtres dans le contexte local
(
new
\
Zend\Stdlib\Hydrator\ObjectProperty
())
->
extract
(
$filter
)
);
}
else
{
$action
=
'afficher'
;
// Affichage par défaut
}
// sauvegarde des filtres dans le contexte local
$this
->
getContextProvider
()
->
getLocalContext
()
->
fromArray
(
(
new
\
Zend\Stdlib\Hydrator\ObjectProperty
())
->
extract
(
$filter
)
);
/* Préparation et affichage */
if
(
'afficher'
===
$action
||
$totaux
){
$services
=
$service
->
getList
(
$qb
);
...
...
@@ -74,64 +97,15 @@ class ServiceController extends AbstractActionController
$params
=
$this
->
getEvent
()
->
getRouteMatch
()
->
getParams
();
$params
[
'action'
]
=
'voirListe'
;
$params
[
'query'
]
=
$this
->
params
()
->
fromQuery
();
$params
[
'renderIntervenants'
]
=
$showMultiplesIntervenants
;
$listeViewModel
=
$this
->
forward
()
->
dispatch
(
$controller
,
$params
);
$viewModel
->
addChild
(
$listeViewModel
,
'servicesRefListe'
);
}
}
else
{
$services
=
array
();
}
$renderReferentiel
=
!
$role
instanceof
IntervenantExterieurRole
&&
!
$intervenant
instanceof
IntervenantExterieur
;
$viewModel
->
setVariables
(
compact
(
'annee'
,
'services'
,
'typeVolumeHoraire'
,
'action'
,
'role'
,
'title'
,
'intervenant'
,
'renderReferentiel'
));
if
(
$totaux
){
$viewModel
->
setTemplate
(
'application/service/rafraichir-totaux'
);
}
else
{
$viewModel
->
setTemplate
(
'application/service/index'
);
}
return
$viewModel
;
}
public
function
intervenantAction
()
{
$totaux
=
$this
->
params
()
->
fromQuery
(
'totaux'
,
0
)
==
'1'
;
$service
=
$this
->
getServiceService
();
$role
=
$this
->
getContextProvider
()
->
getSelectedIdentityRole
();
$annee
=
$this
->
getContextProvider
()
->
getGlobalContext
()
->
getAnnee
();
$typeVolumeHoraire
=
$this
->
getServiceTypeVolumehoraire
()
->
getPrevu
();
$intervenant
=
$this
->
context
()
->
mandatory
()
->
intervenantFromRoute
();
/* @var $intervenant \Application\Entity\Db\Intervenant */
$viewModel
=
new
\
Zend\View\Model\ViewModel
();
$service
->
canAdd
(
$intervenant
,
true
);
$this
->
initFilters
();
if
(
!
$this
->
isAllowed
(
$this
->
getServiceService
()
->
newEntity
()
->
setIntervenant
(
$intervenant
),
'read'
)){
throw
new
\
BjyAuthorize\Exception\UnAuthorizedException
();
}
// fetch des services prévisionnels
$qb
=
$service
->
finderByContext
();
$service
->
finderByIntervenant
(
$intervenant
,
$qb
);
$service
->
leftJoin
(
'applicationElementPedagogique'
,
$qb
,
'elementPedagogique'
);
$this
->
getServiceElementPedagogique
()
->
leftJoin
(
'applicationEtape'
,
$qb
,
'etape'
);
$this
->
getServiceElementPedagogique
()
->
leftJoin
(
'applicationPeriode'
,
$qb
,
'periode'
);
$services
=
$service
->
getList
(
$qb
);
$service
->
setTypeVolumehoraire
(
$services
,
$typeVolumeHoraire
);
// fetch des services référentiels : délégation au contrôleur
$this
->
getContextProvider
()
->
getLocalContext
()
->
setIntervenant
(
$intervenant
);
// sauvegarde des filtres dans le contexte local
$controller
=
'Application\Controller\ServiceReferentiel'
;
$params
=
$this
->
getEvent
()
->
getRouteMatch
()
->
getParams
();
$listeViewModel
=
$this
->
forward
()
->
dispatch
(
$controller
,
$params
);
$viewModel
->
addChild
(
$listeViewModel
,
'servicesRefListe'
);
$renderIntervenants
=
false
;
$renderReferentiel
=
!
$role
instanceof
IntervenantExterieurRole
&&
!
$intervenant
instanceof
IntervenantExterieur
;
$action
=
'afficher'
;
$title
=
"Enseignements <small>
$intervenant
</small>"
;
$viewModel
->
setVariables
(
compact
(
'annee'
,
'services'
,
'typeVolumeHoraire'
,
'action'
,
'role'
,
'title'
,
'renderIntervenants'
,
'renderReferentiel'
,
'intervenant'
));
$renderReferentiel
=
!
$intervenant
instanceof
IntervenantExterieur
;
$viewModel
->
setVariables
(
compact
(
'annee'
,
'services'
,
'typeVolumeHoraire'
,
'action'
,
'role'
,
'intervenant'
,
'renderReferentiel'
,
'showMultiplesIntervenants'
));
if
(
$totaux
){
$viewModel
->
setTemplate
(
'application/service/rafraichir-totaux'
);
}
else
{
...
...
@@ -174,7 +148,7 @@ class ServiceController extends AbstractActionController
);
if
(
'afficher'
==
$action
){
$resumeServices
=
$this
->
getService
Locator
()
->
get
(
'Application
Service
'
)
->
getResumeService
(
$filter
);
$resumeServices
=
$this
->
getServiceService
(
)
->
getResumeService
(
$filter
);
}
else
{
$resumeServices
=
null
;
}
...
...
@@ -197,23 +171,16 @@ class ServiceController extends AbstractActionController
public
function
filtresAction
()
{
$role
=
$this
->
getContextProvider
()
->
getSelectedIdentityRole
();
/* Initialisation, si ce n'est pas un intervenant, du formulaire de recherche */
if
(
!
$role
instanceof
\
Application\Acl\IntervenantRole
){
$rechercheForm
=
$this
->
getServiceLocator
()
->
get
(
'FormElementManager'
)
->
get
(
'ServiceRecherche'
);
/* @var $rechercheForm \Application\Form\Service\Recherche */
$rechercheForm
->
populateOptions
();
$rechercheForm
->
setDataFromSession
();
$rechercheForm
->
setData
(
$this
->
getRequest
()
->
getQuery
()
);
if
(
$rechercheForm
->
isValid
()){
$rechercheForm
->
sessionUpdate
();
}
}
else
{
$rechercheForm
=
null
;
// pas de filtrage
$rechercheForm
=
$this
->
getServiceLocator
()
->
get
(
'FormElementManager'
)
->
get
(
'ServiceRecherche'
);
/* @var $rechercheForm \Application\Form\Service\Recherche */
$rechercheForm
->
populateOptions
();
$rechercheForm
->
setDataFromSession
();
$rechercheForm
->
setData
(
$this
->
getRequest
()
->
getQuery
()
);
if
(
$rechercheForm
->
isValid
()){
$rechercheForm
->
sessionUpdate
();
}
return
compact
(
'rechercheForm'
,
'role'
);
return
compact
(
'rechercheForm'
);
}
public
function
voirAction
()
...
...
@@ -381,7 +348,7 @@ class ServiceController extends AbstractActionController
/**
* @return \Application\Service\Service
*/
p
ublic
function
getServiceService
()
p
rotected
function
getServiceService
()
{
return
$this
->
getServiceLocator
()
->
get
(
'ApplicationService'
);
}
...
...
@@ -389,7 +356,7 @@ class ServiceController extends AbstractActionController
/**
* @return \Application\Service\ElementPedagogique
*/
p
ublic
function
getServiceElementPedagogique
()
p
rotected
function
getServiceElementPedagogique
()
{
return
$this
->
getServiceLocator
()
->
get
(
'ApplicationElementPedagogique'
);
}
...
...
@@ -397,7 +364,7 @@ class ServiceController extends AbstractActionController
/**
* @return \Application\Service\TypeVolumeHoraire
*/
p
ublic
function
getServiceTypeVolumehoraire
()
p
rotected
function
getServiceTypeVolumehoraire
()
{
return
$this
->
getServiceLocator
()
->
get
(
'ApplicationTypeVolumeHoraire'
);
}
...
...
@@ -405,11 +372,19 @@ class ServiceController extends AbstractActionController
/**
* @return \Application\Service\TypeIntervention
*/
p
ublic
function
getServiceTypeIntervention
()
p
rotected
function
getServiceTypeIntervention
()
{
return
$this
->
getServiceLocator
()
->
get
(
'ApplicationTypeIntervention'
);
}
/**
* @return \Application\Service\Intervenant
*/
protected
function
getServiceIntervenant
()
{
return
$this
->
getServiceLocator
()
->
get
(
'applicationIntervenant'
);
}
/**
* @return \Application\Service\ContextProvider
*/
...
...
@@ -417,4 +392,13 @@ class ServiceController extends AbstractActionController
{
return
$this
->
getServiceLocator
()
->
get
(
'ApplicationContextProvider'
);
}
/**
*
* @return \Application\Assertion\ServiceAssertion
*/
public
function
getAssertionService
()
{
return
$this
->
getServiceLocator
()
->
get
(
'ServiceAssertion'
);
}
}
module/Application/src/Application/Controller/ServiceReferentielController.php
View file @
03704f67
...
...
@@ -49,63 +49,13 @@ class ServiceReferentielController extends AbstractActionController implements C
{
return
$this
->
getServiceLocator
()
->
get
(
'ApplicationIntervenant'
);
}
protected
function
initFilters
()
{
$this
->
em
()
->
getFilters
()
->
enable
(
'historique'
)
->
disableForEntity
(
'Application\Entity\Db\FonctionReferentiel'
);
}
// public function indexAction()
// {
// $this->em()->getFilters()->enable('historique');
// $service = $this->getServiceServiceReferentiel();
// $cp = $this->getContextProvider();
// $annee = $cp->getGlobalContext()->getAnnee();
// $criteria = array();
// $services = $service->getFinder($criteria)
// ->orderBy("i.nomUsuel, s.libelleCourt")
// ->getQuery()->execute();
//
// $listeViewModel = new \Zend\View\Model\ViewModel();
// $listeViewModel
// ->setTemplate('application/service-referentiel/voir-liste')
// ->setVariables(compact('services'));
//
// $viewModel = new \Zend\View\Model\ViewModel();
// $viewModel
// ->setVariables(compact('annee'))
// ->addChild($listeViewModel, 'serviceListe');
//
// return $viewModel;
// }
public
function
intervenantAction
()
{
$this
->
initFilters
();
$service
=
$this
->
getServiceServiceReferentiel
();
$role
=
$this
->
getContextProvider
()
->
getSelectedIdentityRole
();
$annee
=
$this
->
getContextProvider
()
->
getGlobalContext
()
->
getAnnee
();
$viewModel
=
new
\
Zend\View\Model\ViewModel
();
$intervenant
=
$this
->
context
()
->
mandatory
()
->
intervenantFromRoute
();
// sauvegarde des filtres dans le contexte local
$this
->
getContextProvider
()
->
getLocalContext
()
->
setIntervenant
(
$intervenant
);
$qb
=
$service
->
getFinder
();
$services
=
$qb
->
getQuery
()
->
execute
();
$renderIntervenants
=
false
;
$renderReferentiel
=
!
$role
instanceof
IntervenantExterieurRole
&&
!
$intervenant
instanceof
IntervenantExterieur
;
$viewModel
->
setVariables
(
compact
(
'annee'
,
'services'
,
'action'
,
'role'
,
'renderIntervenants'
,
'renderReferentiel'
));
$viewModel
->
setTemplate
(
'application/service-referentiel/voir-liste'
);
return
$viewModel
;
}
public
function
voirAction
()
{
$this
->
em
()
->
getFilters
()
->
enable
(
'historique'
);
...
...
@@ -123,12 +73,18 @@ class ServiceReferentielController extends AbstractActionController implements C
public
function
voirListeAction
()
{
$this
->
initFilters
();
$service
=
$this
->
getServiceServiceReferentiel
();