Commit 0860f8e7 authored by Patrick Etcheverry's avatar Patrick Etcheverry

Correction de bugs au niveau de la gestion des démarches et ajout de messages...

Correction de bugs au niveau de la gestion des démarches et ajout de messages de validation d'ajout/edition (+ergonomique)
parent 43bb4431
......@@ -105,6 +105,18 @@
</nav>
<div class="panel panel-default">
<div class="panel-heading">
<h4><b>{% block viewTitle %}{% endblock %}</b></h4>
</div>
{% if app.session.flashBag.has('success') %}
<div class="alert alert-success">
{% for msg in app.session.flashBag.get('success') %}
{{ msg }}
{% endfor %}
</div>
{% endif %}
{% block body %}{% endblock %}
</div>
......
......@@ -77,7 +77,7 @@
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>{{'incourse'|trans}}</strong></div>
<div class="panel-heading"><strong>{{'Informations'|trans}}</strong></div>
<div>
<ul class="list-group" style='margin-bottom: 0;'>
......
......@@ -11,13 +11,12 @@ use ScenarisationProcessBundle\Entity\ScenarisationStageOrder;
/**
* ScenarisationProcess controller.
*
*/
*/
class ScenarisationProcessController extends Controller
{
/**
* Lists all scenarisationProcess entities.
*
* alreadyUsed = Boolean to know if the selected scenarisation process is already used by a pedagogical scenario.
*/
public function indexAction(Request $request, $alreadyUsed)
{
......@@ -30,6 +29,7 @@ class ScenarisationProcessController extends Controller
//$scenarisationProcesses = $em->getRepository('ScenarisationProcessBundle:ScenarisationProcess')->findAll();
$queryBuilder = $em->getRepository('ScenarisationProcessBundle:ScenarisationProcess')->createQueryBuilder('scenarisationProcesses');
$query = $queryBuilder->getQuery();
$paginator = $this->get('knp_paginator');
......@@ -41,7 +41,7 @@ class ScenarisationProcessController extends Controller
);
return $this->render('ScenarisationProcessBundle:scenarisationprocess:index.html.twig', array(
'scenarisationProcesses' => $scenarisationProcesses,
'alreadyUsed' => $alreadyUsed
'alreadyUsed' => $alreadyUsed,
));
}
......@@ -68,7 +68,10 @@ class ScenarisationProcessController extends Controller
$em->persist($scenarisationProcess);
$em->flush();
return $this->redirectToRoute('scenarisation_process_show', array('id' => $scenarisationProcess->getId()));
/* Pour qu'après la redirection il y ait un joli petite boîte de validation*/
$request->getSession()->getFlashBag()->add('success', 'LE SCENARIO A BIEN ETE AJOUTEE.');
return $this->redirectToRoute('scenarisation_process_index');
}
return $this->render('ScenarisationProcessBundle:scenarisationprocess:new.html.twig', array(
......@@ -115,7 +118,10 @@ class ScenarisationProcessController extends Controller
if ($editForm->isSubmitted() && $editForm->isValid()) {
$this->getDoctrine()->getManager()->flush();
return $this->redirectToRoute('scenarisation_process_edit', array('id' => $scenarisationProcess->getId()));
/* Pour qu'après la redirection il y ait un joli petite boîte de validation*/
$request->getSession()->getFlashBag()->add('success', 'LE SCENARIO A BIEN ETE EDITEE.');
return $this->redirectToRoute('scenarisation_process_index');
}
return $this->render('ScenarisationProcessBundle:scenarisationprocess:edit.html.twig', array(
......
scenarisation_process_index:
path: /{alreadyUsed}
defaults: { _controller: "ScenarisationProcessBundle:ScenarisationProcess:index", alreadyUsed : '0' }
defaults: { _controller: "ScenarisationProcessBundle:ScenarisationProcess:index", alreadyUsed : '0'}
methods: GET
requirements:
alreadyUsed: 1|0
......
{% extends 'base.html.twig' %}
{% block viewTitle %} {{'scenarisationProcess.edit'|trans}} {% endblock %}
{% block body %}
<div class="panel-heading">
<h4>
<b>{{'scenarisationProcess.edit'|trans}}</b>
</h4>
</div>
<div class="panel-body">
<br/>
{{ form_start(edit_form) }}
<div class="formulaire">
{{ form_start(edit_form) }}
{{ form_widget(edit_form) }}
<div style="float: right">
......@@ -21,7 +18,6 @@
</h4>
</div>
{{ form_end(edit_form) }}
<div style="float: left">
<h4>
{{ form_start(delete_form) }}
......
{% extends 'base.html.twig' %}
{% block body %}
<div class="panel-heading">
<h4>
<b>{{ 'scenarisationProcess.list'|trans }}</b>
</h4>
</div>
{% block viewTitle %}{{ 'scenarisationProcess.list'|trans }}{% endblock %}
{% block body %}
<div class="panel-body">
{% if alreadyUsed %}
......
{% extends 'base.html.twig' %}
{% block viewTitle %} {{'scenarisationProcess.add'|trans}} {% endblock %}
{% block body %}
<div class="panel-heading">
<h4>
<b>{{'scenarisationProcess.add'|trans}}</b>
</h4>
</div>
<div class="panel-body">
<br/>
......
......@@ -68,7 +68,7 @@ th[class*="mediumColumn"]
de certains champs car cela dénature la vue */
textarea
{
width : 80% !important;
/* width : -> Ne rien mettre sinon ça flingue les vues d'ajout et d'édition */
float : left;
display: inline-block !important;
resize: vertical;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment