set Default Nature Task choice correctly

This commit is contained in:
2020-10-06 15:02:29 +02:00
parent 8b9e27ad50
commit 0d9524f5d2
3 changed files with 3 additions and 6 deletions

View File

@@ -53,7 +53,8 @@ class TaskController extends AbstractController
// Initialisation de l'enregistrement
$em = $this->getDoctrine()->getManager();
$data = new Entity();
$defaultnature = $em->getRepository("App:Nature")->findOneBy(['name' => 'Prestation']);
$data->setNature($defaultnature);
// Création du formulaire
$form = $this->createForm(Form::class,$data,array("mode"=>"submit"));

View File

@@ -61,7 +61,7 @@
{% endblock %}
{% block localjavascript %}
$("#project_customer").addClass("select2entity");
$("#project_customer").addClass("select2entity");
$(document).ready(function() {
$("#project_name").focus();
});

View File

@@ -62,10 +62,6 @@
{% endblock %}
{% block localjavascript %}
var defaultsel = 'Prestation';
$("#task_nature option").filter(function() {
return $(this).text() == defaultsel;
}).prop('selected', true);
$(document).ready(function() {
$("#task_name").focus();