This commit is contained in:
2025-09-30 21:24:37 +02:00
parent d603fb452a
commit b7b9cebacb
258 changed files with 416 additions and 601 deletions

83
templates/Task/edit.html.twig Executable file
View File

@@ -0,0 +1,83 @@
{% extends 'base.html.twig' %}
{% block body %}
{{ form_start(form) }}
<h1 class="page-header">
{% if fgprint is defined and fgprint %}
TACHE
{% elseif mode=="update" %}
Modification TACHE
{% elseif mode=="submit" %}
Création TACHE
{% endif %}
</h1>
{{ form_widget(form.submit) }}
<a class="btn btn-secondary" href={{ path('app_task') }}>Annuler</a>
{% if mode=="update" %}
<a href="{{ path('app_task_delete',{'id':task.id}) }}"
class="btn btn-danger float-right"
data-method="delete"
data-confirm="Êtes-vous sûr de vouloir supprimer cet entregistrement ?">
Supprimer
</a>
{% endif %}
<br><br>
{% if app.session.flashbag.has('error') %}
<div class='alert alert-danger' style='margin: 5px 0px'>
<strong>Erreur</strong><br>
{% for flashMessage in app.session.flashbag.get('error') %}
{{ flashMessage }}<br>
{% endfor %}
</div>
{% endif %}
{% if app.session.flashbag.has('notice') %}
<div class='alert alert-info' style='margin: 5px 0px'>
<strong>Information</strong><br>
{% for flashMessage in app.session.flashbag.get('notice') %}
{{ flashMessage }}<br>
{% endfor %}
</div>
{% endif %}
<div class="card">
<div class="card-header">
<i class="fa fa-pencil-alt fa-fw"></i> Informations
</div>
<div class="card-body">
{{ form_row(form.name) }}
{{ form_row(form.project) }}
{{ form_row(form.nature) }}
{{ form_row(form.active) }}
{{ form_row(form.quantity) }}
{{ form_row(form.color) }}
</div>
</div>
{{ form_end(form) }}
{% endblock %}
{% block localjavascript %}
$(document).ready(function() {
$("#task_name").focus();
$("#task_color").spectrum(
{
type: "text",
showAlpha: false
}
);
});
function myprint() {
href=document.location.href;
document.location.href=href+"?fgprint=true";
}
{% endblock %}

View File

@@ -0,0 +1,176 @@
{% extends "base.html.twig" %}
{% block localstyle %}
td {
padding:5px !important;
}
{% if fgprint is defined and fgprint %}
table { font-size:10px;}
th,td {
border: 1px solid #37474F;
}
thead {
display: table-header-group;
}
tr { page-break-inside: avoid; }
{%endif%}
{% endblock %}
{% block body %}
<h1 class="page-header">
TACHES {% if app.session.get('viewservice') %}PAR ACTVITE{%else%}PAR DOMAINE{%endif%}
</h1>
<a class="btn btn-success" href={{ path('app_task_submit') }}>Ajouter</a>
<div class="custom-control custom-switch float-right">
<input type="checkbox" class="custom-control-input" id="switchactive" {% if app.session.get('activeproject') %} checked {% endif %}>
<label class="custom-control-label" for="switchactive">Projet Actif</label>
</div>
<div class="custom-control custom-switch float-right" style="margin-right:20px">
<input type="checkbox" class="custom-control-input" id="switchactivetask" {% if app.session.get('activetask') %} checked {% endif %}>
<label class="custom-control-label" for="switchactivetask">Tâche Active</label>
</div>
<div class="custom-control custom-switch float-right mr-3">
<input type="checkbox" class="custom-control-input" id="switchservice" {% if app.session.get('viewservice') %} checked {% endif %}>
{% if app.session.get('viewservice') %}
<label class="custom-control-label" for="switchservice">Vue par Activité</label>
{% else %}
<label class="custom-control-label" for="switchservice">Vue par Domaine</label>
{% endif %}
</div>
<p></p>
{% if app.session.get('viewservice') %}
{% set loop01s=services %}
{% else %}
{% set loop01s=domaines %}
{% endif %}
{%for loop01 in loop01s %}
{% if not loop01.projects is empty %}
{% set havetask=false %}
{% set haveproject=false %}
{% for project in loop01.projects %}
{% if app.session.get('activeproject')==project.active and (app.session.get('idproject')=="all" or app.session.get('idproject')==project.id) %}
{% if not project.tasks is empty %}
{% set havetask=true %}
{% endif %}
{% set haveproject=true %}
{% endif %}
{% endfor %}
{% if haveproject and havetask %}
<div class="card">
<div class="card-header">
<i class="fa fa-table fa-fw"></i> {{ loop01.name }}
</div>
<div class="card-body">
<div class="dataTable_wrapper">
<table class="table table-striped table-bordered table-hover small" id="dataTables" style="width:100%">
<thead>
<tr>
<th width="70px" class="no-sort no-print">Action</th>
<th width="150px">Client</th>
<th width="100px">Nature</th>
<th width="100px">Projet</th>
<th>Tâche</th>
<th>Actif</th>
<th width="100px" class="text-center no-string">Estimation</th>
<th width="100px" class="text-center no-string">Validé</th>
<th width="100px" class="text-center no-string">Planifié</th>
<th width="100px" class="text-center no-string">Reste</th>
<th width="70px" class="text-center no-sort">Couleur</th>
</tr>
</thead>
<tbody>
{% for project in loop01.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 %}
{% set totplanified=totplanified+event.duration %}
{% if event.validate %}
{% set totvalidate=totvalidate+event.duration %}
{% endif %}
{% endfor %}
{% for penalty in task.penaltys %}
{% set totplanified=totplanified+penalty.duration %}
{% if penalty.validate %}
{% set totvalidate=totvalidate+penalty.duration %}
{% endif %}
{% endfor %}
<tr>
<td class="no-print">
<a href="{{path("app_task_update",{id:task.id})}}"><i class="fa fa-file"></i></a>
</td>
<td>{{task.project.customer.name}}</td>
<td>{{task.nature.name}}</td>
<td>{{task.project.name}}</td>
<td>{{task.name}}</td>
<td>{{task.active ? "actif":"non-actif"}}</td>
<td class="text-right">{{task.quantity|number_format(2, '.', ' ')}}</td>
<td class="text-right">{{(totvalidate*-1)|number_format(2, '.', ' ')}}</td>
<td class="text-right">{{((totplanified-totvalidate)*-1)|number_format(2, '.', ' ')}}</td>
<td class="text-right">{{(task.quantity-totplanified)|number_format(2, '.', ' ')}}</td>
<td class="text-center" style="background-color:{{task.color}}; color:#ffffff">{{task.color}}</td>
</tr>
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
<br>
{% endif %}
{% endif %}
{% endfor %}
{% endblock %}
{% block localjavascript %}
$(document).ready(function() {
{% if not fgprint is defined or not fgprint %}
$('.table ').DataTable({
columnDefs: [ { "targets": "no-sort", "orderable": false }, { "targets": "no-string", "type" : "num" } ],
responsive: true,
iDisplayLength: 100,
order: [[ 1, "asc" ]]
});
{%else%}
$('#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' )}}";
});
$('#switchservice').change(function() {
window.location="{{ path('app_task_viewservice' )}}";
});
function myprint() {
href=document.location.href;
document.location.href=href+"?fgprint=true";
}
{% endblock %}