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

View File

@@ -0,0 +1,76 @@
{% extends 'base.html.twig' %}
{% block body %}
{{ form_start(form) }}
<h1 class="page-header">
{% if fgprint is defined and fgprint %}
PROJET
{% elseif mode=="update" %}
Modification PROJET
{% elseif mode=="submit" %}
Création PROJET
{% endif %}
</h1>
{{ form_widget(form.submit) }}
<a class="btn btn-secondary" href={{ path('app_project') }}>Annuler</a>
{% if mode=="update" %}
<a href="{{ path('app_project_delete',{'id':project.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.active) }}
{{ form_row(form.customer) }}
{{ form_row(form.visible) }}
{{ form_row(form.service) }}
{{ form_row(form.domaine) }}
</div>
</div>
{{ form_end(form) }}
{% endblock %}
{% block localjavascript %}
$("#project_customer").addClass("select2entity");
$(document).ready(function() {
$("#project_name").focus();
});
function myprint() {
href=document.location.href;
document.location.href=href+"?fgprint=true";
}
{% endblock %}

View File

@@ -0,0 +1,182 @@
{% 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">
PROJETS {% if app.session.get('viewservice') %} PAR ACTVITE{%else%} PAR DOMAINE{%endif%}
</h1>
<a class="btn btn-success" href={{ path('app_project_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 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 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) %}
{% set haveproject=true %}
{% endif %}
{% endfor %}
{% if haveproject %}
<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="200px">Client</th>
<th>Nom</th>
<th width="200px">{% if app.session.get('viewservice') %}Domaine{%else%}Activité{%endif%}</th>
<th width="100px" class="text-center no-string">Estimé</th>
<th width="100px" class="text-center no-string">Commandé</th>
<th width="100px" class="text-center no-string">Validé</th>
<th width="100px" class="text-center no-string">Solde Validé</th>
<th width="100px" class="text-center no-string">Plannifié</th>
<th width="100px" class="text-center no-string">Solde</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) %}
<tr>
<td class="no-print">
<a href="{{path("app_project_update",{id:project.id})}}"><i class="fa fa-file"></i></a>
<a href="{{path("app_project_users",{id:project.id})}}"
data-toggle="tooltip"
data-placement="right"
data-html="true"
title="{% for user in project.userprojects %}<b>{{user.user.username}}:</b> {{user.job.name}} <br />{% endfor %}"
><i class="fa fa-users"></i></a>
</td>
<td>{{project.customer.name}}</td>
<td>{{project.name}}</td>
<td>{% if app.session.get('viewservice') %}{{project.domaine.name}}{%else%}{{project.service.name}}{%endif%}</td>
<td class="text-right">
{% set tottask=0 %}
{% set totvalidate=0 %}
{% set totplanified=0 %}
{% set totoffer=0 %}
{% for offer in project.offers %}
{% set totoffer=(totoffer+offer.quantity) %}
{% set totvalidate=totvalidate+offer.validate %}
{% set totplanified=totplanified+offer.validate %}
{% endfor %}
{% for task in project.tasks %}
{% set tottask=tottask+task.quantity %}
{% 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 %}
{% endfor %}
{{ tottask|number_format(2, '.', ' ') }}
</td>
<td class="text-right">
{{ totoffer|number_format(2, '.', ' ') }}
</td>
<td class="text-right">{{ (totvalidate*-1)|number_format(2, '.', ' ') }}</td>
<td class="text-right">{{ (totoffer-totvalidate)|number_format(2, '.', ' ') }}</td>
<td class="text-right">{{ ((totplanified-totvalidate)*-1)|number_format(2, '.', ' ') }}</td>
<td class="text-right">{{ (totoffer-totplanified)|number_format(2, '.', ' ') }}</td>
</tr>
{%endif%}
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
<br>
{% endif %}
{% endif %}
{% endfor %}
{% endblock %}
{% block localjavascript %}
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
$(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_project_activeproject' )}}";
});
$('#switchservice').change(function() {
window.location="{{ path('app_project_viewservice' )}}";
});
function myprint() {
href=document.location.href;
document.location.href=href+"?fgprint=true";
}
{% endblock %}

View File

@@ -0,0 +1,210 @@
{% 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">
PROJET METIERS<br>
{{project.displayname}}
</h1>
<a class="btn btn-secondary" href={{ path('app_project') }}>Fermer</a>
<p></p>
<div class="row" style="margin: 0px">
<div class="col-md-6">
<div class="card">
<div class="card-header">
<i class="fa fa-table fa-fw"></i> Utilisateurs
</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>Nom</th>
</tr>
</thead>
<tbody>
{%for user in users %}
{% if "ROLE_USER" in user.roles %}
<tr>
<td class="no-print">
<button class="btn btn-link" onClick="modalJob({{user.id}})"><i class="fa fa-plus"></i></a>
</td>
<td>{{user.displayname}}</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-md-6">
{% for userproject in userprojects %}
<div class="card">
<div class="card-header">
<i class="fa fa-table fa-fw"></i> {{ userproject.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>Nom</th>
</tr>
</thead>
<tbody>
{%for user in userproject.users %}
<tr>
<td class="no-print">
<button class="btn btn-link" onClick="delJob({{user.id}})"><i class="fa fa-minus"></i></a>
</td>
<td>{{user.user.displayname}}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
<br>
{% endfor %}
</div>
</div>
<div id="modaljob" class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Métier</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<button onClick="addJob()" class="btn btn-success">Valider</button>
<button onClick="" class="btn btn-secondary" data-dismiss="modal">Annuler</button>
<p></p>
<div class="form-group">
<label class="control-label required" for="idjob">
Métier<span class="mandatory">*</span>
</label>
<select class="select2entity" id="idjob" name="idjob">
<option></option>
{% for job in jobs %}
<option value="{{job.id}}">{{job.name}}</option>
{% endfor %}
</select>
</div>
<input type="hidden" id="iduser" name="iduser" class="form-control" value="">
</div>
</div>
</div>
</div>
{% 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" ]],
searching: false,
paging: false,
info: false
});
{%else%}
$('#dataTables').removeClass("table table-striped table-bordered table-hover small dataTable no-footer");
{% endif %}
});
function modalJob(iduser) {
$("#iduser").val(iduser);
$("#modaljob .alert").remove();
$("#modaljob").modal('show');
}
function addJob() {
$("#modaljob .alert").remove();
iduser=$("#iduser").val();
idjob=$("#idjob").val();
if(idjob) {
$.ajax({
type: "POST",
data: {
idproject: {{project.id}},
idjob: idjob,
iduser: iduser,
},
url: "{{ path('app_project_users_add') }}",
success: function (response) {
response=JSON.parse(response);
if(response.return=="KO") {
$("#modaljob .modal-body").append("<div class='alert alert-danger' style='margin: 5px 0px'>"+response.error+"</div>");
}
else {
location.reload();
}
}
});
}
}
function delJob(iduser) {
$.ajax({
type: "POST",
data: {
iduser: iduser,
},
url: "{{ path('app_project_users_del') }}",
success: function (response) {
response=JSON.parse(response);
if(response.return=="KO") {
}
else {
location.reload();
}
}
});
}
function myprint() {
href=document.location.href;
document.location.href=href+"?fgprint=true";
}
{% endblock %}