From 6bd189271f9d01c168c4ab0346c617bc29b4d590 Mon Sep 17 00:00:00 2001 From: Matthieu Lamalle Date: Thu, 4 Mar 2021 09:18:17 +0100 Subject: [PATCH 1/3] correction fermeture div dans rapport ref #57 --- .../templates/Report/report.html.twig | 45 ++++++++++--------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/src/schedule-2.0/templates/Report/report.html.twig b/src/schedule-2.0/templates/Report/report.html.twig index d3ef41d..0a9b53d 100644 --- a/src/schedule-2.0/templates/Report/report.html.twig +++ b/src/schedule-2.0/templates/Report/report.html.twig @@ -59,7 +59,7 @@ } .astreinte { height: 12px; - font-size: 10px; + font-size: 10px; } {% if fgprint is defined and fgprint %} @@ -68,7 +68,7 @@ float:none !important; margin:0px; } - + table { width:100%; font-size:10px;} .card-header .synthese { @@ -83,10 +83,10 @@ .small { font-size:10px;} h4 { - padding-top: 20px; + padding-top: 20px; } - {% endif %} + {% endif %} {% endblock %} @@ -104,7 +104,7 @@ {% for i in 1..48 %} {% set selected="" %} {%if i==app.session.get('nbmonth') %} - {% set selected="selected" %} + {% set selected="selected" %} {% endif %} {% endfor %} @@ -126,7 +126,7 @@

RAPPORT

- +
 
{% for month in project.months %} @@ -185,14 +185,14 @@ TOTAL {{ (month.total + month.totala)|number_format(2, '.', ' ') }} - + {% endif %} - + {% endfor %} - - + +

CUMUL HEBDOMADAIRE

@@ -204,17 +204,17 @@ {% for week in weeks %} + {% endfor %} {% for week in weeks %} + {% endfor %} {% endfor %} @@ -236,15 +236,15 @@ {% set tot=0 %} {% for offer in project.offers %} - {% if loop.index - + - + - + - {% endif %} + {% endif %} {% endif %} {% endfor %} @@ -358,7 +358,7 @@ {% endfor %}
S{{ week.weeknumber}} -
- + {{ week.cumul}} -
Précédente {{ totbefore10|number_format(2, '.', ' ') }} - {% if decovalidate >= totbefore10 %} + {% if decovalidate >= totbefore10 %} {{ totbefore10|number_format(2, '.', ' ') }} {% set todel=totbefore10 %} {% else %} @@ -272,9 +272,9 @@ {{ offer.name }} {{ offer.ref }} {{ offer.quantity|number_format(2, '.', ' ') }} - {% if decovalidate >= offer.quantity %} + {% if decovalidate >= offer.quantity %} {{ offer.quantity|number_format(2, '.', ' ') }} {% set todel=offer.quantity %} {% else %} @@ -299,9 +299,9 @@ {{ offer.name }} {{ offer.ref }} {{ offer.quantity|number_format(2, '.', ' ') }} - {% if decovalidate >= 0 %} + {% if decovalidate >= 0 %} {{ decovalidate|number_format(2, '.', ' ') }} {% set todel=decovalidate %} {% else %} @@ -316,7 +316,7 @@ {% set decoproposed=decoproposed-totbefore10 %}
- + {% if not project.beforeastreinte is empty %}

ASTREINTES PASSEES

@@ -389,6 +389,7 @@ {% endif %}
+ {% endif %} {% endfor %}
From 5343d614015978d17ef5991d70906ad58da61191 Mon Sep 17 00:00:00 2001 From: Matthieu Lamalle Date: Thu, 4 Mar 2021 09:26:18 +0100 Subject: [PATCH 2/3] correction mise en page rapport pdf ref #58 --- src/schedule-2.0/templates/Report/report.html.twig | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/schedule-2.0/templates/Report/report.html.twig b/src/schedule-2.0/templates/Report/report.html.twig index 0a9b53d..656e3e1 100644 --- a/src/schedule-2.0/templates/Report/report.html.twig +++ b/src/schedule-2.0/templates/Report/report.html.twig @@ -90,7 +90,6 @@ {% endblock %} - {% block body %} {% if fgprint is defined and fgprint %}

Planning

{%endif%} {% if access=="customer" and not app.user %} @@ -127,8 +126,6 @@

RAPPORT

-
 
- {% for month in project.months %}

{{ month.monthlabel }}

@@ -179,7 +176,6 @@ {% endif %} - @@ -188,12 +184,7 @@
{{ month.totala|number_format(2, '.', ' ') }}
TOTAL
{% endif %} - - {% endfor %} - - -

CUMUL HEBDOMADAIRE

{% for year, weeks in project.weeks %} @@ -219,7 +210,6 @@ {% endfor %}
-
 
{% if not project.offers is empty %}

COMMANDES

{% set count=(project.offers|length)-8 %} @@ -326,8 +316,6 @@ {{ (project.proposed - project.validate)|number_format(2, '.', ' ') }} - -
 
{% endif %}

CONSOMMATION PASSEE

{% if project.hors!=0 %} @@ -359,7 +347,6 @@ {% endfor %} - {% if not project.beforeastreinte is empty %}

ASTREINTES PASSEES

@@ -390,6 +377,7 @@ +
 
{% endif %} {% endfor %}
From 94fa9d1f0b010c1d889f6d8289f59ff399e68312 Mon Sep 17 00:00:00 2001 From: Matthieu Lamalle Date: Thu, 4 Mar 2021 10:17:13 +0100 Subject: [PATCH 3/3] switch task inactives ref #61 --- src/schedule-2.0/config/routes.yaml | 4 ++ .../src/Controller/TaskController.php | 47 ++++++++++--------- .../src/Service/sessionListener.php | 15 +++--- .../templates/Task/list.html.twig | 20 ++++++-- 4 files changed, 53 insertions(+), 33 deletions(-) diff --git a/src/schedule-2.0/config/routes.yaml b/src/schedule-2.0/config/routes.yaml index 0300d19..f6b4681 100644 --- a/src/schedule-2.0/config/routes.yaml +++ b/src/schedule-2.0/config/routes.yaml @@ -262,6 +262,10 @@ app_task_activeproject: path: /master/task/activeproject defaults: { _controller: App\Controller\TaskController:activeproject } +app_task_activetask: + path: /master/task/activetask + defaults: { _controller: App\Controller\TaskController:activetask } + #== Event ==================================================================================================== app_event: path: /user/event diff --git a/src/schedule-2.0/src/Controller/TaskController.php b/src/schedule-2.0/src/Controller/TaskController.php index 6828d2f..77bd776 100755 --- a/src/schedule-2.0/src/Controller/TaskController.php +++ b/src/schedule-2.0/src/Controller/TaskController.php @@ -31,13 +31,13 @@ class TaskController extends AbstractController "services" => $services, "useheader" => true, "usesidebar" => true, - "fgprint" => true, + "fgprint" => true, ]); return new PdfResponse( $this->knpSnappy->getOutputFromHtml($render,["orientation"=>"Landscape"]), 'taches.pdf' - ); + ); } else { return $this->render($this->render.'list.html.twig',[ @@ -61,30 +61,30 @@ class TaskController extends AbstractController // Récupération des data du formulaire $form->handleRequest($request); - + // Sur erreur $this->getErrorForm(null,$form,$request,$data,"submit"); - + // Sur validation - if ($form->get('submit')->isClicked() && $form->isValid()) { - $data = $form->getData(); + if ($form->get('submit')->isClicked() && $form->isValid()) { + $data = $form->getData(); $em->persist($data); $em->flush(); // Retour à la liste return $this->redirectToRoute($this->route); } - + // Affichage du formulaire return $this->render($this->render.'edit.html.twig', [ 'useheader' => true, - 'usesidebar' => true, + 'usesidebar' => true, $this->data => $data, 'mode' => 'submit', 'form' => $form->createView() ]); - } - + } + public function update($id,Request $request) { // Initialisation de l'enregistrement @@ -99,43 +99,43 @@ class TaskController extends AbstractController // Sur erreur $this->getErrorForm(null,$form,$request,$data,"update"); - + // Sur validation - if ($form->get('submit')->isClicked() && $form->isValid()) { - $data = $form->getData(); + if ($form->get('submit')->isClicked() && $form->isValid()) { + $data = $form->getData(); $em->persist($data); $em->flush(); // Retour à la liste return $this->redirectToRoute($this->route); } - + // Affichage du formulaire if($request->query->get('fgprint')) { $render = $this->renderView($this->render.'edit.html.twig', [ 'useheader' => true, - 'usesidebar' => true, + 'usesidebar' => true, $this->data => $data, 'mode' => 'update', 'form' => $form->createView(), - "fgprint" => true, + "fgprint" => true, ]); return new PdfResponse( $this->knpSnappy->getOutputFromHtml($render), 'tache.pdf' - ); + ); } else { return $this->render($this->render.'edit.html.twig', [ 'useheader' => true, - 'usesidebar' => true, + 'usesidebar' => true, $this->data => $data, 'mode' => 'update', 'form' => $form->createView() ]); } - } + } public function delete($id,Request $request) { @@ -161,13 +161,18 @@ class TaskController extends AbstractController // Retour à la liste return $this->redirectToRoute($this->route); } - } + } public function activeproject() { $this->get('session')->set('activeproject',!$this->get('session')->get('activeproject')); return $this->redirectToRoute($this->route); } + public function activetask() { + $this->get('session')->set('activetask',!$this->get('session')->get('activetask')); + return $this->redirectToRoute($this->route); + } + public function activeoffer() { $this->get('session')->set('activeoffer',!$this->get('session')->get('activeoffer')); return $this->redirectToRoute($this->route); @@ -189,5 +194,5 @@ class TaskController extends AbstractController $request->getSession()->getFlashBag()->add("error", $error->getMessage()); } } - } + } } diff --git a/src/schedule-2.0/src/Service/sessionListener.php b/src/schedule-2.0/src/Service/sessionListener.php index e99f79d..00b4412 100644 --- a/src/schedule-2.0/src/Service/sessionListener.php +++ b/src/schedule-2.0/src/Service/sessionListener.php @@ -33,7 +33,7 @@ class sessionListener { $haverole=true; } } - + return $haverole; } @@ -67,11 +67,12 @@ class sessionListener { // Initialisation de la session if($regen) { $session->set('activeproject',true); + $session->set('activetask',true); $session->set('activeoffer',true); $session->set('activeholiday',true); $session->set('activetimer',true); $session->set('nbmonth',3); - + if($curentuser!="anon.") { if(in_array("ROLE_USER",$roles)) $session->set('iduser',$curentuser->getId()); @@ -86,7 +87,7 @@ class sessionListener { $session->set('idproject',"all"); $session->set('idservice',"all"); } - + $tbusers=[]; $users=$this->em->getRepository('App:User')->findAll(); foreach($users as $user) { @@ -99,7 +100,7 @@ class sessionListener { } } $session->set('users',$tbusers); - + $tbprojects=[]; $projects=$this->em->getRepository('App:Project')->findBy(["active"=>true]); foreach($projects as $project) { @@ -110,7 +111,7 @@ class sessionListener { array_push($tbprojects,$tmp); } $session->set('projects',$tbprojects); - + $tbservices=[]; $services=$this->em->getRepository('App:Service')->findAll(); foreach($services as $service) { @@ -120,8 +121,8 @@ class sessionListener { ]; array_push($tbservices,$tmp); } - $session->set('services',$tbservices); - + $session->set('services',$tbservices); + } } } diff --git a/src/schedule-2.0/templates/Task/list.html.twig b/src/schedule-2.0/templates/Task/list.html.twig index 188522e..13e40b0 100644 --- a/src/schedule-2.0/templates/Task/list.html.twig +++ b/src/schedule-2.0/templates/Task/list.html.twig @@ -13,7 +13,7 @@ thead { display: table-header-group; } - tr { page-break-inside: avoid; } + tr { page-break-inside: avoid; } {%endif%} {% endblock %} @@ -30,6 +30,11 @@ +
+ + +
+

{%for service in services %} @@ -44,7 +49,7 @@ {% endif %} {% set haveproject=true %} - {% endif %} + {% endif %} {% endfor %} {% if haveproject and havetask %} @@ -75,6 +80,7 @@ {% for project in service.projects %} {% if app.session.get('activeproject')==project.active and (app.session.get('idproject')=="all" or app.session.get('idproject')==project.id) %} {% for task in project.tasks %} + {% if app.session.get('activetask')==task.active %} {% set totvalidate=task.validate %} {% set totplanified=task.validate %} {% for event in task.events %} @@ -107,6 +113,7 @@
+ {% endif %} {% endfor %} {% endif %} {% endfor %} @@ -131,17 +138,20 @@ order: [[ 1, "asc" ]] }); {%else%} - $('#dataTables').removeClass("table table-striped table-bordered table-hover small dataTable no-footer"); + $('#dataTables').removeClass("table table-striped table-bordered table-hover small dataTable no-footer"); {% endif %} }); $('#switchactive').change(function() { window.location="{{ path('app_task_activeproject' )}}"; }); + $('#switchactivetask').change(function() { + window.location="{{ path('app_task_activetask' )}}"; + }); function myprint() { href=document.location.href; document.location.href=href+"?fgprint=true"; - } -{% endblock %} \ No newline at end of file + } +{% endblock %}
{{(task.quantity-totplanified)|number_format(2, '.', ' ')}} {{task.color}}