Commit e330a140 authored by Patrick Etcheverry's avatar Patrick Etcheverry

Correction de bugs, améliorations

parent 375710d1
......@@ -108,19 +108,20 @@
<div class="panel-heading">
<h4><b>{% block viewTitle %}{% endblock %}</b></h4>
<h6>{% block viewSubTitle %}{% endblock %}</h6>
</div>
<div class="panel-body">
{% if app.session.flashBag.has('success') %}
<div class="alert alert-success">
<strong>SUCCES!</strong>
<strong>Succès !</strong>
{% for msg in app.session.flashBag.get('success') %}
{{ msg }}
{% endfor %}
</div>
{% elseif app.session.flashBag.has('alert') %}
<div class="alert alert-danger">
<strong>ATTENTION!</strong>
<strong>Attention !</strong>
{% for msg in app.session.flashBag.get('alert') %}
{{ msg }}
{% endfor %}
......
......@@ -83,13 +83,14 @@
<ul class="list-group" style='margin-bottom: 0;'>
<li class="list-group-item">
<a href="#">
<i class="fa fa-info-circle" aria-hidden="true"></i>
<i class="fa fa-question-circle" aria-hidden="true"></i>
{{'help'|trans}}
</a>
</li>
<li class="list-group-item">
<a href="#">
<i class="fa fa-info-circle" aria-hidden="true"></i>
{{'about'|trans}}
</a>
</li>
......
......@@ -72,6 +72,20 @@ class PedagogicalScenarioController extends Controller
*/
public function newAction(Request $request)
{
$em = $this->getDoctrine()->getManager();
// On regarde s'il existe des démarches de scénarisation
$scenarisationProcessRepo = $em->getRepository('ScenarisationProcessBundle:ScenarisationProcess');
$nbScenProcess = $scenarisationProcessRepo->getNb();
if ($nbScenProcess <= 0)
{
/* Petit message d'erreur, à traduire */
$request->getSession()->getFlashBag()->add('alert', 'Vous ne pouvez pas créer de scénario pédagogique : il n\'y a aucune démarche de scénarisation à laquelle l\'associer.');
return $this->redirectToRoute('pedagogicalscenario_index', array('userRole' => "pedagogical-engineer"));
}
else
{
// We generate the new breadcrumb
$this->createBreadcrumb("new");
$this->updateMenu();
......@@ -82,10 +96,11 @@ class PedagogicalScenarioController extends Controller
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($pedagogicalScenario);
$em->flush();
/* Message de reussite, à traduire */
$request->getSession()->getFlashBag()->add('success', 'Le scénario pédagogique \'' . $pedagogicalScenario->getShortname() . '\' a bien été ajoutée !');
return $this->redirectToRoute('pedagogicalscenario_show', array('id' => $pedagogicalScenario->getId(), 'userRole' => "pedagogical-engineer"));
}
......@@ -93,6 +108,8 @@ class PedagogicalScenarioController extends Controller
'pedagogicalScenario' => $pedagogicalScenario,
'form' => $form->createView(),
));
}
}
/**
......
......@@ -46,7 +46,7 @@ class PedagogicalScenarioTypeNew extends AbstractType
$builder->add('scenarisationProcess', EntityType::class, array(
'label' => 'scenarisationProcess',
'class' => 'ScenarisationProcessBundle:ScenarisationProcess',
'choice_label' => 'title',
'choice_label' => 'title'
//'multiple' => true
));
......
......@@ -3,25 +3,12 @@
{# On a besoin de stocker le numéro de la page courante pour pouvoir revenir dessus après ajout dans une démarche #}
{% set currentPage = app.request.query.get('page') %}
{% block viewTitle %} {{ 'pedagogicalScenario.teachersManagement'|trans }} {% endblock %}
{% block viewSubTitle %} {{'pedagogicalScenario'|trans}} : {{ pedagogicalScenario.shortname }} <br/>
{{'referentTeacher'|trans}} : {{ pedagogicalScenario.referentTeacher.firstname }} {{ pedagogicalScenario.referentTeacher.lastname }}{% endblock %}
{% block body %}
<div class="panel-heading">
<h4>
<b>{{ 'pedagogicalScenario.teachersManagement'|trans }}</b>
</h4>
<h6>
{{'pedagogicalScenario'|trans}}
:
{{ pedagogicalScenario.shortname }}
</h6>
<h6>
{{'referentTeacher'|trans}}
:
{{ pedagogicalScenario.referentTeacher.firstname }}
{{ pedagogicalScenario.referentTeacher.lastname }}
</h6>
</div>
<div class="panel-body">
<p>
Liste des enseignants concevant le scénario pédagogique :
</p>
......@@ -96,5 +83,4 @@
</i>
</p>
{% endif %}
</div>
{% endblock %}
{% extends 'base.html.twig' %}
{% block body %}
{% block viewTitle %}{{"Conception d'un scénario pédagogique"|upper}}{% endblock %}
{% block viewSubTitle %}{{'pedagogicalScenario'|trans}} : {{ pedagogicalScenario.shortname }}{% endblock %}
<div class="panel-heading">
<h4>
<b>{{"Conception d'un scénario pédagogique"|upper}}</b>
</h4>
<h6>
{{'pedagogicalScenario'|trans}}
:
{{ pedagogicalScenario.shortname }}
</h6>
</div>
<div class="panel-body">
{% block body %}
{% if etapes is not empty %}
<table class="table table-striped table-bordered">
<thead>
......@@ -30,7 +21,7 @@
<tr>
<td>{{stageOrder.position}}</td>
<td>{{stageOrder.scenarisationStage.title}}</td>
<td>33%</td>
<td></td>
<td></td>
<td></td>
<td>
......@@ -53,5 +44,4 @@
{% else %}
<p>{{'processNoStage'|trans}}</p>
{% endif %}
</div>
{% endblock %}
{% extends 'base.html.twig' %}
{% block body %}
<div class="panel-heading">
<h4>
<b>{{'pedagogicalScenario.editName'|trans}}</b>
</h4>
</div>
<div class="panel-body">
<br/>
{% block viewTitle %}{{'pedagogicalScenario.editName'|trans}}{% endblock %}
{% block viewSubTitle %} {% endblock %}
{% block body %}
{{ form_start(edit_form) }}
<div class="formulaire">
{{ form_widget(edit_form) }}
......@@ -32,6 +26,4 @@
</h4>
</div>
</div>
</div>
{% endblock %}
{% extends 'base.html.twig' %}
{% block body %}
<div class="panel-heading">
<h4>
<b>{{ 'pedagogicalScenario.list'|trans }}</b>
</h4>
</div>
<div class="panel-body">
{% block viewTitle %}{{'pedagogicalScenario.list'|trans }}{% endblock %}
{% block viewSubTitle %} {% endblock %}
{% block body %}
<table class="table">
<thead>
<tr>
......@@ -62,6 +57,4 @@
</h4>
</div>
{% endif %}
</div>
{% endblock %}
{% extends 'base.html.twig' %}
{% block body %}
<div class="panel-heading">
<h4>
<b>{{'pedagogicalScenario.add'|trans}}</b>
</h4>
</div>
<div class="panel-body">
<br/>
{% block viewTitle %}{{'pedagogicalScenario.add'|trans}}{% endblock %}
{% block body %}
<div class="formulaire">
{{ form_start(form) }}
......@@ -22,9 +15,6 @@
<input class="boutonSansBordure" type="submit" value="{{'save'|trans}}">
{{ form_end(form) }}
</h4>
</div>
</div>
</div>
</div>
{% endblock %}
{% extends 'base.html.twig' %}
{% block body %}
<div class="panel-heading">
<h4>
<b>{{ 'pedagogicalScenario.info'|trans }}</b>
</h4>
</div>
<div class="panel-body">
{% block viewTitle %}{{ 'pedagogicalScenario.info'|trans }}{% endblock %}
<br/>
{% block body %}
<div class="formulaire">
<table class="table table-bordered">
<tbody>
......@@ -70,7 +64,5 @@
<a href="{{ path('pedagogicalscenario_edit', { 'id': pedagogicalScenario.id, 'userRole': currentRole }) }}">{{"edit"|trans}}</a>
</h4>
</div>
</div>
</div>
{% endblock %}
......@@ -12,20 +12,11 @@
{% set localeWording = 'esWording' %}
{% endif %}
{% block body %}
{% block viewTitle %}{{'answersEdit'|trans}}{% endblock %}
{% block viewSubTitle %}{{pedagogicalScenario.shortname}} - {{scenarisationStage.title}}{% endblock %}
{% block body %}
<link rel="stylesheet" href="{{ asset('css/dynamicSequenceTab.css')}}">
<div class="panel-heading">
<h4>
<b>{{'answersEdit'|trans}}</b>
</h4>
<h6>
{{pedagogicalScenario.shortname}} - {{scenarisationStage.title}}
</h6>
</div>
<div class="panel-body">
{% if questions is not empty %}
{% if submit %}
......@@ -84,7 +75,6 @@
{% else %}
<p><i>Aucune question associée à l'étape courante.</i></p>
{% endif %}
</div>
<script>
var modeleDataPrototype = $('div#sequenceQuestion').children().children().attr('data-prototype');
......
......@@ -11,18 +11,10 @@
{% set localeWording = 'esWording' %}
{% endif %}
{% block body %}
<div class="panel-heading">
<h4>
<b>{{'answersView'|trans}}</b>
</h4>
<h6>
{{pedagogicalScenario.shortname}} - {{scenarisationStage.title}}
</h6>
</div>
<div class="panel-body">
{% block viewTitle %}{{'answersView'|trans}}{% endblock %}
{% block viewSubTitle %}{{pedagogicalScenario.shortname}} - {{scenarisationStage.title}}{% endblock %}
{% block body %}
{% if questions is not empty %}
{# Pour chacune des questions de l'étape #}
......@@ -59,6 +51,4 @@
{% else %}
<p><i>Aucune question associée à l'étape courante.</i></p>
{% endif %}
</div>
{% endblock %}
{% extends 'base.html.twig' %}
{% block body %}
<div class="panel-heading">
<h4>
<b>{{"Gestion des formations d'un scénario pédagogique"|upper}}</b>
</h4>
<h6>
{{'pedagogicalScenario'|trans}}
:
{{ pedagogicalScenario.shortname }}
</h6>
</div>
{% block viewTitle %}{{"Gestion des formations d'un scénario pédagogique"|upper}}{% endblock %}
{% block viewSubTitle %}{{'pedagogicalScenario'|trans}} : {{ pedagogicalScenario.shortname }}{% endblock %}
<div class="panel-body">
{% block body %}
<p>
Liste des formations déjà liées :</p>
{% if trainingCoursesAlreadyLinked is not empty %}
......@@ -78,5 +68,4 @@
</i>
</p>
{% endif %}
</div>
{% endblock %}
{% extends 'base.html.twig' %}
{% block body %}
<div class="panel-heading">
<h4>
<b>{{'project.edit'|trans}}</b>
</h4>
</div>
<div class="panel-body">
<br/>
{% block viewTitle %}{{'project.edit'|trans}}{% endblock %}
{% block viewSubTitle %}{% endblock %}
{% block body %}
{{ form_start(edit_form) }}
<div class="formulaire">
{{ form_widget(edit_form) }}
......@@ -32,6 +26,4 @@
</h4>
</div>
</div>
</div>
{% endblock %}
{% extends 'base.html.twig' %}
{% block body %}
<div class="panel-heading">
<h4>
<b>{{ 'project.list'|trans }}</b>
</h4>
</div>
<div class="panel-body">
<br/>
{% block viewTitle %}{{ 'project.list'|trans }}{% endblock %}
{% block body %}
<table class="table">
<thead>
<tr>
......@@ -54,5 +47,4 @@
<a href="{{ path('project_new', { 'userRole': "pedagogical-engineer" }) }}">{{"project.new"|trans}}</a>
</h4>
</div>
</div>
{% endblock %}
{% extends 'base.html.twig' %}
{% block body %}
<div class="panel-heading">
<h4>
<b>{{'project.add'|trans}}</b>
</h4>
</div>
<div class="panel-body">
<br/>
{% block viewTitle %}{{ 'project.add'|trans }}{% endblock %}
{% block body %}
<div class="formulaire">
{{ form_start(form) }}
......@@ -22,9 +15,6 @@
<input class="boutonSansBordure" type="submit" value="{{'save'|trans}}">
{{ form_end(form) }}
</h4>
</div>
</div>
</div>
</div>
{% endblock %}
{% extends 'base.html.twig' %}
{% block body %}
<div class="panel-heading">
<h4>
<b>GESTION DES SCENARIOS D'UN PROJET</b>
</h4>
<h6>PROJET COURANT :
{{ project.shortname }}</h6>
</div>
<div class="panel-body">
{% block viewTitle %}GESTION DES SCENARIOS D'UN PROJET{% endblock %}
{% block viewSubTitle %}PROJET COURANT : {{ project.shortname }}{% endblock %}
{% block body %}
<p>
Liste des scénarios pédagogiques disponibles
</p>
......@@ -84,6 +79,4 @@
</i>
</p>
{% endif %}
</div>
{% endblock %}
{% extends 'base.html.twig' %}
{% block viewTitle %}{{ 'project.info'|trans }}{% endblock %}
{% block body %}
<div class="panel-heading">
<div class="formulaire">
<table class="table table-bordered">
<tbody>
<tr>
<th>{{ 'shortname'|trans }}</th>
<td>{{ project.shortname }}</td>
</tr>
<tr>
<th>{{ 'fullname'|trans }}</th>
<td>{{ project.fullname }}</td>
</tr>
</tbody>
</table>
<div style="float: right">
<h4>
<b>{{ 'project.info'|trans }}</b>
{# Bouton Éditer #}
<i class="fa fa-pencil" aria-hidden="true"></i>
<a href="{{ path('project_edit', { 'id': project.id, 'userRole': currentRole }) }}">{{"edit"|trans}}</a>
</h4>
</div>
<div class="panel-body">
<br/>
<div class="formulaire">
<table class="table table-bordered">
<tbody>
<tr>
<th>{{ 'shortname'|trans }}</th>
<td>{{ project.shortname }}</td>
</tr>
<tr>
<th>{{ 'fullname'|trans }}</th>
<td>{{ project.fullname }}</td>
</tr>
</tbody>
</table>
<div style="float: right">
<h4>
{# Bouton Éditer #}
<i class="fa fa-pencil" aria-hidden="true"></i>
<a href="{{ path('project_edit', { 'id': project.id, 'userRole': currentRole }) }}">{{"edit"|trans}}</a>
</h4>
</div>
</div>
</div>
{% endblock %}
{% extends 'base.html.twig' %}
{% block body %}
<div class="panel-heading">
<h4>
<b>{{'trainingCourse.edit'|trans}}</b>
</h4>
</div>
<div class="panel-body">
<br/>
{% block viewTitle %}{{'trainingCourse.edit'|trans}}{% endblock %}
{% block viewSubTitle %}{% endblock %}
{% block body %}
{{ form_start(edit_form) }}
<div class="formulaire">
{{ form_widget(edit_form) }}
......@@ -32,6 +26,4 @@
</h4>
</div>
</div>
</div>
{% endblock %}
{% extends 'base.html.twig' %}
{% block body %}
<div class="panel-heading">
<h4>
<b>{{ 'trainingCourse.list'|trans }}</b>
</h4>
</div>
<div class="panel-body">
{% block viewTitle %}{{ 'trainingCourse.list'|trans }}{% endblock %}
{% block viewSubTitle %}{% endblock %}
{% block body %}
<table class="table">
<thead>
<tr>
......@@ -54,6 +50,4 @@
</h4>
</div>
{% endif %}
</div>
{% endblock %}
{% extends 'base.html.twig' %}
{% block body %}
<div class="panel-heading">
<h4>
<b>{{'trainingCourse.add'|trans}}</b>
</h4>
</div>
<div class="panel-body">
<br/>
{% block viewTitle %}{{'trainingCourse.add'|trans}}{% endblock %}
{% block viewSubTitle %}{% endblock %}
{% block body %}
<div class="formulaire">
{{ form_start(form) }}
......@@ -22,9 +16,6 @@
<input class="boutonSansBordure" type="submit" value="{{'save'|trans}}">
{{ form_end(form) }}
</h4>
</div>
</div>
</div>
</div>
{% endblock %}