diff --git a/src/schedule-2.0/src/Controller/TaskController.php b/src/schedule-2.0/src/Controller/TaskController.php index 260bffa..fb27118 100755 --- a/src/schedule-2.0/src/Controller/TaskController.php +++ b/src/schedule-2.0/src/Controller/TaskController.php @@ -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")); diff --git a/src/schedule-2.0/templates/Project/edit.html.twig b/src/schedule-2.0/templates/Project/edit.html.twig index b99d325..df6c2d3 100755 --- a/src/schedule-2.0/templates/Project/edit.html.twig +++ b/src/schedule-2.0/templates/Project/edit.html.twig @@ -61,7 +61,7 @@ {% endblock %} {% block localjavascript %} -$("#project_customer").addClass("select2entity"); + $("#project_customer").addClass("select2entity"); $(document).ready(function() { $("#project_name").focus(); }); diff --git a/src/schedule-2.0/templates/Task/edit.html.twig b/src/schedule-2.0/templates/Task/edit.html.twig index 4d99524..2bf54ae 100755 --- a/src/schedule-2.0/templates/Task/edit.html.twig +++ b/src/schedule-2.0/templates/Task/edit.html.twig @@ -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();