set Default Nature Task choice correctly
This commit is contained in:
@@ -53,7 +53,8 @@ class TaskController extends AbstractController
|
|||||||
// Initialisation de l'enregistrement
|
// Initialisation de l'enregistrement
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
$data = new Entity();
|
$data = new Entity();
|
||||||
|
$defaultnature = $em->getRepository("App:Nature")->findOneBy(['name' => 'Prestation']);
|
||||||
|
$data->setNature($defaultnature);
|
||||||
// Création du formulaire
|
// Création du formulaire
|
||||||
$form = $this->createForm(Form::class,$data,array("mode"=>"submit"));
|
$form = $this->createForm(Form::class,$data,array("mode"=>"submit"));
|
||||||
|
|
||||||
|
@@ -61,7 +61,7 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block localjavascript %}
|
{% block localjavascript %}
|
||||||
$("#project_customer").addClass("select2entity");
|
$("#project_customer").addClass("select2entity");
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$("#project_name").focus();
|
$("#project_name").focus();
|
||||||
});
|
});
|
||||||
|
@@ -62,10 +62,6 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block localjavascript %}
|
{% block localjavascript %}
|
||||||
var defaultsel = 'Prestation';
|
|
||||||
$("#task_nature option").filter(function() {
|
|
||||||
return $(this).text() == defaultsel;
|
|
||||||
}).prop('selected', true);
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$("#task_name").focus();
|
$("#task_name").focus();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user