Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Txuleton
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Patrick Etcheverry
Txuleton
Commits
78da2ab0
Commit
78da2ab0
authored
Jun 23, 2017
by
Patrick Etcheverry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Création de la notion de Formation et ajout dans le menu + traduction + crudage
parent
66741e99
Changes
25
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
718 additions
and
7 deletions
+718
-7
app/Resources/translations/messages.en.yml
app/Resources/translations/messages.en.yml
+2
-0
app/Resources/translations/messages.es.yml
app/Resources/translations/messages.es.yml
+2
-0
app/Resources/translations/messages.fr.yml
app/Resources/translations/messages.fr.yml
+2
-0
app/Resources/views/menu.html.twig
app/Resources/views/menu.html.twig
+8
-1
app/config/security.yml
app/config/security.yml
+2
-2
src/ScenarioBundle/Controller/FormationController.php
src/ScenarioBundle/Controller/FormationController.php
+136
-0
src/ScenarioBundle/Controller/ProjectController.php
src/ScenarioBundle/Controller/ProjectController.php
+1
-1
src/ScenarioBundle/DataFixtures/ORM/LoadPedagogicalScenarioData.php
...ioBundle/DataFixtures/ORM/LoadPedagogicalScenarioData.php
+2
-2
src/ScenarioBundle/Entity/Formation.php
src/ScenarioBundle/Entity/Formation.php
+136
-0
src/ScenarioBundle/Entity/PedagogicalScenario.php
src/ScenarioBundle/Entity/PedagogicalScenario.php
+41
-0
src/ScenarioBundle/Entity/PedagogicalScenarioFormation.php
src/ScenarioBundle/Entity/PedagogicalScenarioFormation.php
+95
-0
src/ScenarioBundle/Form/FormationType.php
src/ScenarioBundle/Form/FormationType.php
+39
-0
src/ScenarioBundle/Repository/FormationRepository.php
src/ScenarioBundle/Repository/FormationRepository.php
+13
-0
src/ScenarioBundle/Repository/PedagogicalScenarionFormationRepository.php
...le/Repository/PedagogicalScenarionFormationRepository.php
+13
-0
src/ScenarioBundle/Resources/config/routing.yml
src/ScenarioBundle/Resources/config/routing.yml
+4
-0
src/ScenarioBundle/Resources/config/routing/formation.yml
src/ScenarioBundle/Resources/config/routing/formation.yml
+24
-0
src/ScenarioBundle/Resources/translations/messages.en.yml
src/ScenarioBundle/Resources/translations/messages.en.yml
+13
-1
src/ScenarioBundle/Resources/translations/messages.es.yml
src/ScenarioBundle/Resources/translations/messages.es.yml
+12
-0
src/ScenarioBundle/Resources/translations/messages.fr.yml
src/ScenarioBundle/Resources/translations/messages.fr.yml
+6
-0
src/ScenarioBundle/Resources/views/formation/edit.html.twig
src/ScenarioBundle/Resources/views/formation/edit.html.twig
+21
-0
src/ScenarioBundle/Resources/views/formation/index.html.twig
src/ScenarioBundle/Resources/views/formation/index.html.twig
+42
-0
src/ScenarioBundle/Resources/views/formation/new.html.twig
src/ScenarioBundle/Resources/views/formation/new.html.twig
+16
-0
src/ScenarioBundle/Resources/views/formation/show.html.twig
src/ScenarioBundle/Resources/views/formation/show.html.twig
+32
-0
src/ScenarioBundle/Resources/views/project/index.html.twig
src/ScenarioBundle/Resources/views/project/index.html.twig
+1
-0
src/ScenarioBundle/Tests/Controller/FormationControllerTest.php
...enarioBundle/Tests/Controller/FormationControllerTest.php
+55
-0
No files found.
app/Resources/translations/messages.en.yml
View file @
78da2ab0
...
...
@@ -13,6 +13,7 @@ position: "Position"
referentLecturer
:
"
Referent
Teacher"
project
:
"
Project"
formation
:
"
Formation"
user
:
"
User"
pedagogicalScenario
:
"
Pedagogical
Scenario"
...
...
@@ -43,6 +44,7 @@ actions: "Actions"
menu
:
scenariopedagogique
:
"
Pedagogical
Scenarios"
projets
:
"
Projects"
formations
:
"
Formations"
utilisateurs
:
"
Users"
parametres
:
"
Settings"
scenarisationProcess
:
"
Scenarisation
Process"
...
...
app/Resources/translations/messages.es.yml
View file @
78da2ab0
...
...
@@ -13,6 +13,7 @@ position: "Position"
referentTeacher
:
"
"
project
:
"
"
formation
:
"
"
user
:
"
"
pedagogicalScenario
:
"
"
...
...
@@ -43,6 +44,7 @@ actions: "Actions"
menu
:
scenariopedagogique
:
"
escenario
pedagogicos"
projets
:
"
Proyectos"
formations
:
"
"
utilisateurs
:
"
Utilizadores"
parametres
:
"
Configuraciones"
scenarisationProcess
:
"
Scenarisation
Processus"
...
...
app/Resources/translations/messages.fr.yml
View file @
78da2ab0
...
...
@@ -13,6 +13,7 @@ position: "Position"
referentTeacher
:
"
Enseignant
Référent"
project
:
"
Projet"
formation
:
"
Formation"
user
:
"
Utilisateur"
pedagogicalScenario
:
"
Scénario
Pédagogique"
...
...
@@ -43,6 +44,7 @@ actions: "Actions"
menu
:
scenariopedagogique
:
"
Scénarios
Pédagogiques"
projets
:
"
Projets"
formations
:
"
Formations"
utilisateurs
:
"
Utilisateurs"
parametres
:
"
Paramètres"
scenarisationProcess
:
"
Démarches
de
scénarisation"
...
...
app/Resources/views/menu.html.twig
View file @
78da2ab0
...
...
@@ -15,10 +15,17 @@
{%
if
currentRole
==
"pedagogical-engineer"
%}
<li>
<a
class=
"lienNonBleu"
href=
"
{{
path
(
'project_index'
,
{
'userRole'
:
currentRole
}
)
}}
"
>
<i
mg
src=
"https://maxcdn.icons8.com/windows8/PNG/26/Business/graduation_cap-26.png"
title=
"Chapeau de diplôme"
width=
"16"
height=
"16"
>
<i
class=
"fa fa-briefcase"
aria-hidden=
"true"
></i
>
<span
class=
"couleurBleuLien"
>
{{
'menu.projets'
|
trans
}}
</span>
</a>
</li>
<li>
<a
class=
"lienNonBleu"
href=
"
{{
path
(
'formation_index'
,
{
'userRole'
:
currentRole
}
)
}}
"
>
<img
src=
"https://maxcdn.icons8.com/windows8/PNG/26/Business/graduation_cap-26.png"
title=
"Chapeau de diplôme"
width=
"16"
height=
"16"
>
<span
class=
"couleurBleuLien"
>
{{
'menu.formations'
|
trans
}}
</span>
</a>
</li>
<li>
<a
class=
"lienNonBleu"
href=
"
{{
path
(
'user_index'
)
}}
"
>
<span
class=
"glyphicon glyphicon-user"
aria-hidden=
"true"
></span>
...
...
app/config/security.yml
View file @
78da2ab0
...
...
@@ -13,8 +13,8 @@ security:
property
:
email
access_control
:
-
{
path
:
^/%languages%/engineer/
,
roles
:
ROLE_PEDAGOGICAL_ENGINEER
}
-
{
path
:
^/%languages%/
lectur
er/
,
roles
:
ROLE_TEACHER
}
-
{
path
:
^/%languages%/
pedagogical-
engineer/
,
roles
:
ROLE_PEDAGOGICAL_ENGINEER
}
-
{
path
:
^/%languages%/
teach
er/
,
roles
:
ROLE_TEACHER
}
firewalls
:
# disables authentication for assets and the profiler
...
...
src/ScenarioBundle/Controller/FormationController.php
0 → 100644
View file @
78da2ab0
<?php
namespace
ScenarioBundle\Controller
;
use
ScenarioBundle\Entity\Formation
;
use
Symfony\Bundle\FrameworkBundle\Controller\Controller
;
use
Symfony\Component\HttpFoundation\Request
;
/**
* Formation controller.
*
*/
class
FormationController
extends
Controller
{
/**
* Lists all formation entities.
*
*/
public
function
indexAction
(
Request
$request
)
{
$em
=
$this
->
getDoctrine
()
->
getManager
();
//$formations = $em->getRepository('ScenarioBundle:Formation')->findAll();
$queryBuilder
=
$em
->
getRepository
(
'ScenarioBundle:Formation'
)
->
createQueryBuilder
(
'formations'
);
$query
=
$queryBuilder
->
getQuery
();
$paginator
=
$this
->
get
(
'knp_paginator'
);
$formations
=
$paginator
->
paginate
(
$query
,
$request
->
query
->
getInt
(
'page'
,
1
)
/*page number*/
,
5
/*limit per page*/
);
return
$this
->
render
(
'ScenarioBundle:formation:index.html.twig'
,
array
(
'formations'
=>
$formations
,
));
}
/**
* Creates a new formation entity.
*
*/
public
function
newAction
(
Request
$request
)
{
$formation
=
new
Formation
();
$form
=
$this
->
createForm
(
'ScenarioBundle\Form\FormationType'
,
$formation
);
$form
->
handleRequest
(
$request
);
if
(
$form
->
isSubmitted
()
&&
$form
->
isValid
())
{
$em
=
$this
->
getDoctrine
()
->
getManager
();
$em
->
persist
(
$formation
);
$em
->
flush
();
return
$this
->
redirectToRoute
(
'formation_show'
,
array
(
'id'
=>
$formation
->
getId
(),
'userRole'
=>
"pedagogical-engineer"
));
}
return
$this
->
render
(
'ScenarioBundle:formation:new.html.twig'
,
array
(
'formation'
=>
$formation
,
'form'
=>
$form
->
createView
(),
));
}
/**
* Finds and displays a formation entity.
*
*/
public
function
showAction
(
Formation
$formation
)
{
$deleteForm
=
$this
->
createDeleteForm
(
$formation
);
return
$this
->
render
(
'ScenarioBundle:formation:show.html.twig'
,
array
(
'formation'
=>
$formation
,
'delete_form'
=>
$deleteForm
->
createView
(),
));
}
/**
* Displays a form to edit an existing formation entity.
*
*/
public
function
editAction
(
Request
$request
,
Formation
$formation
)
{
$deleteForm
=
$this
->
createDeleteForm
(
$formation
);
$editForm
=
$this
->
createForm
(
'ScenarioBundle\Form\FormationType'
,
$formation
);
$editForm
->
handleRequest
(
$request
);
if
(
$editForm
->
isSubmitted
()
&&
$editForm
->
isValid
())
{
$this
->
getDoctrine
()
->
getManager
()
->
flush
();
return
$this
->
redirectToRoute
(
'formation_edit'
,
array
(
'id'
=>
$formation
->
getId
(),
'userRole'
=>
"pedagogical-engineer"
));
}
return
$this
->
render
(
'ScenarioBundle:formation:edit.html.twig'
,
array
(
'formation'
=>
$formation
,
'edit_form'
=>
$editForm
->
createView
(),
'delete_form'
=>
$deleteForm
->
createView
(),
'userRole'
=>
"pedagogical-engineer"
));
}
/**
* Deletes a formation entity.
*
*/
public
function
deleteAction
(
Request
$request
,
Formation
$formation
)
{
$form
=
$this
->
createDeleteForm
(
$formation
);
$form
->
handleRequest
(
$request
);
if
(
$form
->
isSubmitted
()
&&
$form
->
isValid
())
{
$em
=
$this
->
getDoctrine
()
->
getManager
();
$em
->
remove
(
$formation
);
$em
->
flush
();
}
return
$this
->
redirectToRoute
(
'formation_index'
,
array
(
'userRole'
=>
'pedagogical-engineer'
));
}
/**
* Creates a form to delete a formation entity.
*
* @param Formation $formation The formation entity
*
* @return \Symfony\Component\Form\Form The form
*/
private
function
createDeleteForm
(
Formation
$formation
)
{
return
$this
->
createFormBuilder
()
->
setAction
(
$this
->
generateUrl
(
'formation_delete'
,
array
(
'id'
=>
$formation
->
getId
(),
'userRole'
=>
"pedagogical-engineer"
)))
->
setMethod
(
'DELETE'
)
->
getForm
()
;
}
}
src/ScenarioBundle/Controller/ProjectController.php
View file @
78da2ab0
...
...
@@ -92,7 +92,7 @@ class ProjectController extends Controller
if
(
$editForm
->
isSubmitted
()
&&
$editForm
->
isValid
())
{
$this
->
getDoctrine
()
->
getManager
()
->
flush
();
return
$this
->
redirectToRoute
(
'project_edit'
,
array
(
'id'
=>
$project
->
getId
()));
return
$this
->
redirectToRoute
(
'project_edit'
,
array
(
'id'
=>
$project
->
getId
()
,
'userRole'
=>
"pedagogical-engineer"
));
}
return
$this
->
render
(
'ScenarioBundle:project:edit.html.twig'
,
array
(
...
...
src/ScenarioBundle/DataFixtures/ORM/LoadPedagogicalScenarioData.php
View file @
78da2ab0
...
...
@@ -54,7 +54,7 @@ class LoadPedagogicalScenarioData implements FixtureInterface, ContainerAwareInt
$m1102
->
setShortname
(
"M1102"
);
$m1102
->
setFullname
(
"Initiation à l'algorithmique et à la programmation"
);
$m1102
->
updateReferent
Lectur
er
(
$enseignantReferent
);
$m1102
->
updateReferent
Teach
er
(
$enseignantReferent
);
//$m1102->setProject($projet);
...
...
@@ -72,7 +72,7 @@ class LoadPedagogicalScenarioData implements FixtureInterface, ContainerAwareInt
$m1103
->
setShortname
(
"M1103"
);
$m1103
->
setFullname
(
"Gestion de projets"
);
$m1103
->
updateReferent
Lectur
er
(
$enseignantReferent
);
$m1103
->
updateReferent
Teach
er
(
$enseignantReferent
);
$m1103
->
setProject
(
$projet
);
...
...
src/ScenarioBundle/Entity/Formation.php
0 → 100644
View file @
78da2ab0
<?php
namespace
ScenarioBundle\Entity
;
use
Doctrine\ORM\Mapping
as
ORM
;
/**
* Formation
*
* @ORM\Table(name="formation")
* @ORM\Entity(repositoryClass="ScenarioBundle\Repository\FormationRepository")
*/
class
Formation
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private
$id
;
/**
* @var string
*
* @ORM\Column(name="shortname", type="string", length=255)
*/
private
$shortname
;
/**
* @var string
*
* @ORM\Column(name="fullname", type="text")
*/
private
$fullname
;
/**
* @ORM\OneToMany(targetEntity="ScenarioBundle\Entity\PedagogicalScenarioFormation", mappedBy="formation")
* @ORM\JoinColumn(nullable=true)
*/
private
$pedagogicalScenarioFormation
;
/**
* Get id
*
* @return int
*/
public
function
getId
()
{
return
$this
->
id
;
}
/**
* Set shortname
*
* @param string $shortname
*
* @return Formation
*/
public
function
setShortname
(
$shortname
)
{
$this
->
shortname
=
$shortname
;
return
$this
;
}
/**
* Get shortname
*
* @return string
*/
public
function
getShortname
()
{
return
$this
->
shortname
;
}
/**
* Set fullname
*
* @param string $fullname
*
* @return Formation
*/
public
function
setFullname
(
$fullname
)
{
$this
->
fullname
=
$fullname
;
return
$this
;
}
/**
* Get fullname
*
* @return string
*/
public
function
getFullname
()
{
return
$this
->
fullname
;
}
/**
* Add pedagogicalScenarioFormation
*
* @param \ScenarioBundle\Entity\PedagogicalScenarioFormation $pedagogicalScenarioFormation
*
* @return Formation
*/
public
function
addPedagogicalScenarioFormation
(
\
ScenarioBundle\Entity\PedagogicalScenarioFormation
$pedagogicalScenarioFormation
)
{
$this
->
pedagogicalScenarioFormation
[]
=
$pedagogicalScenarioFormation
;
$pedagogicalScenarioFormation
->
setFormation
(
$this
);
return
$this
;
}
/**
* Remove pedagogicalScenarioFormation
*
* @param \ScenarioBundle\Entity\PedagogicalScenarioFormation PedagogicalScenarioFormation
*/
public
function
removePedagogicalScenarioFormation
(
\
ScenarioBundle\Entity\PedagogicalScenarioFormation
$pedagogicalScenarioFormation
)
{
$this
->
pedagogicalScenarioFormation
->
removeElement
(
$pedagogicalScenarioFormation
);
}
/**
* Get pedagogicalScenarioFormation
*
* @return \Doctrine\Common\Collections\Collection
*/
public
function
getPedagogicalScenarioFormation
()
{
return
$this
->
pedagogicalScenarioFormation
;
}
}
src/ScenarioBundle/Entity/PedagogicalScenario.php
View file @
78da2ab0
...
...
@@ -65,6 +65,12 @@ class PedagogicalScenario
*/
private
$generalAnswers
;
/**
* @ORM\OneToMany(targetEntity="ScenarioBundle\Entity\PedagogicalScenarioFormation", mappedBy="pedagogicalScenario")
* @ORM\JoinColumn(nullable=true)
*/
private
$pedagogicalScenarioFormation
;
/**
* Get id
*
...
...
@@ -314,4 +320,39 @@ class PedagogicalScenario
{
return
$this
->
generalAnswers
;
}
/**
* Add pedagogicalScenarioFormation
*
* @param \ScenarioBundle\Entity\PedagogicalScenarioFormation $pedagogicalScenarioFormation
*
* @return PedagogicalScenario
*/
public
function
addPedagogicalScenarioFormation
(
\
ScenarioBundle\Entity\PedagogicalScenarioFormation
$pedagogicalScenarioFormation
)
{
$this
->
pedagogicalScenarioFormation
[]
=
$pedagogicalScenarioFormation
;
$pedagogicalScenarioFormation
->
setPedagogicalScenario
(
$this
);
return
$this
;
}
/**
* Remove pedagogicalScenarioFormation
*
* @param \ScenarioBundle\Entity\PedagogicalScenarioFormation PedagogicalScenarioFormation
*/
public
function
removePedagogicalScenarioFormation
(
\
ScenarioBundle\Entity\PedagogicalScenarioFormation
$pedagogicalScenarioFormation
)
{
$this
->
pedagogicalScenarioFormation
->
removeElement
(
$pedagogicalScenarioFormation
);
}
/**
* Get pedagogicalScenarioFormation
*
* @return \Doctrine\Common\Collections\Collection
*/
public
function
getPedagogicalScenarioFormation
()
{
return
$this
->
pedagogicalScenarioFormation
;
}
}
src/ScenarioBundle/Entity/PedagogicalScenarioFormation.php
0 → 100644
View file @
78da2ab0
<?php
namespace
ScenarioBundle\Entity
;
use
Doctrine\ORM\Mapping
as
ORM
;
/**
* PedagogicalScenarioFormation
*
* @ORM\Table(name="pedagogical_Scenario_formation")
* @ORM\Entity(repositoryClass="ScenarioBundle\Repository\PedagogicalScenarioFormationRepository")
*/
class
PedagogicalScenarioFormation
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private
$id
;
/**
* @ORM\ManyToOne(targetEntity="ScenarioBundle\Entity\PedagogicalScenario", inversedBy="pedagogicalScenarioFormation")
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
*/
private
$pedagogicalScenario
;
/**
* @ORM\ManyToOne(targetEntity="ScenarioBundle\Entity\Formation", inversedBy="pedagogicalScenarioFormation")
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
*/
private
$formation
;
/**
* Get id
*
* @return int
*/
public
function
getId
()
{
return
$this
->
id
;
}
/**
* Set pedagogicalScenario
*
* @param \ScenarioBundle\Entity\PedagogicalScenario $pedagogicalScenario
*
* @return PedagogicalScenarioFormation
*/
public
function
setPedagogicalScenario
(
\
ScenarioBundle\Entity\PedagogicalScenario
$pedagogicalScenario
)
{
$this
->
pedagogicalScenario
=
$pedagogicalScenario
;
return
$this
;
}
/**
* Get pedagogicalScenario
*
* @return \ScenarioBundle\Entity\PedagogicalScenario
*/
public
function
getPedagogicalScenario
()
{
return
$this
->
pedagogicalScenario
;
}
/**
* Set formation
*
* @param \ScenarioBundle\Entity\Formation $formation
*
* @return PedagogicalScenarioFormation
*/
public
function
setFormation
(
\
ScenarioBundle\Entity\Formation
$formation
)
{
$this
->
formation
=
$formation
;
return
$this
;
}
/**
* Get formation
*
* @return \ScenarioBundle\Entity\Formation
*/
public
function
getFormation
()
{
return
$this
->
formation
;
}
}
src/ScenarioBundle/Form/FormationType.php
0 → 100644
View file @
78da2ab0
<?php
namespace
ScenarioBundle\Form
;
use
Symfony\Component\Form\AbstractType
;
use
Symfony\Component\Form\FormBuilderInterface
;
use
Symfony\Component\OptionsResolver\OptionsResolver
;
class
FormationType
extends
AbstractType
{
/**
* {@inheritdoc}
*/
public
function
buildForm
(
FormBuilderInterface
$builder
,
array
$options
)
{
$builder
->
add
(
'shortname'
,
'text'
,
array
(
'label'
=>
'shortname'
));
$builder
->
add
(
'fullname'
,
'text'
,
array
(
'label'
=>
'fullname'
));
}
/**
* {@inheritdoc}
*/
public
function
configureOptions
(
OptionsResolver
$resolver
)
{
$resolver
->
setDefaults
(
array
(
'data_class'
=>
'ScenarioBundle\Entity\Formation'
));
}
/**
* {@inheritdoc}
*/
public
function
getBlockPrefix
()
{
return
'scenariobundle_formation'
;
}
}
src/ScenarioBundle/Repository/FormationRepository.php
0 → 100644
View file @
78da2ab0
<?php
namespace
ScenarioBundle\Repository
;
/**
* FormationRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class
FormationRepository
extends
\
Doctrine\ORM\EntityRepository
{
}
src/ScenarioBundle/Repository/PedagogicalScenarionFormationRepository.php
0 → 100644
View file @
78da2ab0
<?php
namespace
ScenarioBundle\Repository
;
/**
* PedagogicalScenarionFormationRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class
PedagogicalScenarionFormationRepository
extends
\
Doctrine\ORM\EntityRepository
{
}
src/ScenarioBundle/Resources/config/routing.yml
View file @
78da2ab0
...
...
@@ -5,3 +5,7 @@ scenario_pedagogicalscenario:
scenario_project
:
resource
:
"
@ScenarioBundle/Resources/config/routing/project.yml"
prefix
:
/project