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,223 @@
{% extends "base.html.twig" %}
{% block localstyle %}
.homecard {
margin: 20px 20px 0px 0px;
float:left;
}
table {
}
th,td {
border: 1px solid #37474F;
color: #ffffff;
background-color:#37474F;
text-align:center;
width: 70px;
}
td {
background-color:#e8ecf1;
cursor: help;
height: 44px;
vertical-align: top;
color: #ffffff;
}
.date {
font-size: 9px;
color: #37474F;
}
.allday {
font-size: 12px;
float:left;
width:100%;
height: 18px;
flex: 0 0 auto;
}
.am, .ap {
font-size: 12px;
float:left;
width:50%;
height: 18px;
flex: 0 0 auto;
}
.astreinte {
font-size: 11px;
float:left;
width:100%;
height:12px;
}
{% endblock %}
{% block body %}
{% if fgprint is defined and fgprint %}<h1>Validation</h1>{%endif%}
{% for user in users %}
{% set nbday=1 %}
<div class="card homecard" style="width:380px;">
<div class="card-header">
<img src="\{{appAlias}}\uploads\avatar\{{user.user.avatar}}" class='avatar no-print'>
{{ user.user.displayname }}
</div>
<div class="card-body">
<table>
<thead>
<th class="no-print"></th>
<th>S</th>
<th>L</th>
<th>M</th>
<th>M</th>
<th>J</th>
<th>V</th>
<th>S</th>
<th>D</th>
</thead>
{% set btnvalidate=false %}
{% for event in user.events %}
{% if nbday==1 %}
<tr id="{{user.user.id}}-{{event.date|date("Ymd")}}"}">
<td class="no-print" style="vertical-align:middle">
{% set first=event.events|first %}
{% if first and first.validate %}
<i class="fa fa-thumbs-down devalidate-{{user.user.id}}" onClick="devalidate({{user.user.id}},'{{event.date|date("Ymd")}}','{{event.date|date("m/d/Y")}}')" style="cursor:pointer; color:red;"></i>
{%else%}
<i class="fa fa-thumbs-up validate-{{user.user.id}}" onClick="validate({{user.user.id}},'{{event.date|date("Ymd")}}','{{event.date|date("m/d/Y")}}')" style="cursor:pointer; color:green;{% if btnvalidate %}display:none{% endif %}"></i>
{% set btnvalidate=true %}
{%endif%}
</td>
<td class="date" style="vertical-align:middle">{{event.date|date("W")}}</td>
{% endif %}
<td>
<div class="date">{{ event.date | date("d/m") }}</div>
<div class="d-flex flex-wrap">
{% set haveam=false %}
{% for detail in event.events %}
{% if detail.allday %}
<div class='allday' style='background-color:{{ detail.colorday }};' title='{{ detail.descriptionday }}'>1</div>
{% else %}
{%if detail.am %}
{% set haveam=true %}
<div class='am' style='background-color:{{ detail.coloram }};' title='{{ detail.descriptionam }}'>0.5</div>
{% endif %}
{%if detail.ap %}
{% if not haveam %}<div class='am'></div>{%endif%}
<div class='ap' style='background-color:{{ detail.colorap }};' title='{{ detail.descriptionap }}'>0.5</div>
{% endif %}
{% endif %}
{% endfor %}
</div>
{% if event.astreinte %}
<div class='astreinte' style='background-color:{{ event.colorastreinte }};' title='{{ event.descriptionastreinte }}'>*</div>
{% else %}
<div class='astreinte'></div>
{% endif %}
</td>
{% set nbday=nbday+1 %}
{% if nbday==8 %}
</tr>
{% set nbday=1 %}
{% endif %}
{% endfor %}
</table>
</div>
</div>
{% if (loop.index % 2) == 0 %} <div class="new-page">&nbsp;</div> {% endif %}
{% endfor %}
{% endblock %}
{% block localjavascript %}
$(document).ready(function() {
resizePanel();
});
$( window ).resize(function() {
resizePanel();
});
function printPage(pdf,pdfName,options,lstPage,cpt) {
pdf.addHTML($("#content h1"), 10, 10, options, function(){
pdf.addHTML(lstPage[cpt], 0, 40, options, function(){
cpt=cpt+1;
if(cpt>=lstPage.length) {
$("#page-wrapper").first("row").css("width","initial");
}
else {
pdf.addPage();
printPage(pdf,pdfName,options,lstPage,cpt);
}
});
});
}
function myprint() {
document.location.href="{{path(app.request.attributes.get('_route'),{fgprint:true})}}";
}
function resizePanel() {
maxheight=0;
$( ".homecard" ).each(function( index ) {
if($(this).height()>maxheight)
maxheight=$(this).height();
});
$( ".homecard" ).height(maxheight);
}
function validate(iduser,idday,day) {
$.ajax({
type: "POST",
data: {
iduser: iduser,
day: day,
},
url: "{{ path('app_validation_validate') }}",
success: function (response) {
response=JSON.parse(response);
if(response.return=="KO") {
alert(response.error);
}
else {
$(".devalidate-"+iduser).remove();
html="<i class=\"fa fa-thumbs-down devalidate-"+iduser+"\" onClick=\"devalidate("+iduser+",'"+idday+"','"+day+"')\" style=\"cursor:pointer; color:red;\"></i>";
$(".validate-"+iduser).first().replaceWith(html);
$(".validate-"+iduser).first().show();
}
}
});
}
function devalidate(iduser,idday,day) {
$.ajax({
type: "POST",
data: {
iduser: iduser,
day: day,
},
url: "{{ path('app_validation_devalidate') }}",
success: function (response) {
response=JSON.parse(response);
if(response.return=="KO") {
alert(response.error);
}
else {
location.reload();
}
}
});
}
{% endblock %}

View File

@@ -0,0 +1,157 @@
{% extends "base.html.twig" %}
{% block localstyle %}
{% 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; }
.homecard {width: 100% }
{%endif%}
{% endblock %}
{% block body %}
<h1 class="page-header">
VALIDATION CONGES
</h1>
<div class="custom-control custom-switch float-right">
<input type="checkbox" class="custom-control-input" id="switchactive" {% if app.session.get('activeholiday') %} checked {% endif %}>
<label class="custom-control-label" for="switchactive">Congès à Valider</label>
</div>
<div style="height:30px;">
{% if not app.session.get('activeholiday') %}
On ne peut dévalider des congés que si la semaine de travail n'a pas été validée
{% endif %}
</div>
<div class="card homecard">
<div class="card-header">
{% if not app.session.get('activeholiday') %}
Congé à Dévalider
{% else %}
Congé à Valider
{% endif %}
</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>
<th class="no-print"></th>
<th>Utilisateur</th>
<th>Tâche</th>
<th>Début</th>
<th>Fin</th>
<th>Durée</th>
</thead>
{% for user in users %}
{% for event in user.holidays %}
<tr id="row-{{event.id}}">
<td class="no-print" style="vertical-align:middle">
{% if event.validateholiday %}
<i class="fa fa-thumbs-down validate-{{user.user.id}}" onClick="devalidate({{event.id}})" style="cursor:pointer; color:red;"></i>
{% else %}
<i class="fa fa-thumbs-up validate-{{user.user.id}}" onClick="validate({{event.id}})" style="cursor:pointer; color:green;"></i>
{% endif %}
</td>
<td>
{{ user.user.displayname }}
</td>
<td>
{{ event.task }}
</td>
<td>
{{ event.start|date("d/m/Y H:i") }}
</td>
<td>
{{ event.end|date("d/m/Y H:i") }}
</td>
<td>
{{ event.duration }}
</td>
</tr>
{% endfor %}
{% endfor %}
</table>
</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" ]]
});
{%else%}
$('#dataTables').removeClass("table table-striped table-bordered table-hover small dataTable no-footer");
{% endif %}
});
function myprint() {
href=document.location.href;
document.location.href=href+"?fgprint=true";
}
function validate(id) {
$.ajax({
type: "POST",
data: {
id: id,
},
url: "{{ path('app_validationholiday_validate') }}",
success: function (response) {
response=JSON.parse(response);
if(response.return=="KO") {
alert(response.error);
}
else {
$("#row-"+id).remove();
}
}
});
}
function devalidate(id) {
$.ajax({
type: "POST",
data: {
id: id,
},
url: "{{ path('app_validationholiday_devalidate') }}",
success: function (response) {
response=JSON.parse(response);
if(response.return=="KO") {
alert(response.error);
}
else {
$("#row-"+id).remove();
}
}
});
}
$('#switchactive').change(function() {
window.location="{{ path('app_validationholiday_activeholiday' )}}";
});
{% endblock %}

View File

@@ -0,0 +1,163 @@
{% extends "base.html.twig" %}
{% block localstyle %}
{% 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; }
.homecard {width: 100% }
{%endif%}
{% endblock %}
{% block body %}
<h1 class="page-header">
VALIDATION HORAIRES
</h1>
<div class="custom-control custom-switch float-right">
<input type="checkbox" class="custom-control-input" id="switchactive" {% if app.session.get('activetimer') %} checked {% endif %}>
<label class="custom-control-label" for="switchactive">Horaires à Valider</label>
</div>
<div style="height:30px;">
</div>
<div class="card homecard">
<div class="card-header">
{% if not app.session.get('activetimer') %}
Horaires à Dévalider
{% else %}
Horaires à Valider
{% endif %}
</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>
<th class="no-print"></th>
<th width="150px">Utilisateur</th>
<th>Tâche</th>
<th>Description</th>
<th>Début</th>
<th>Fin</th>
<th>Durée</th>
</thead>
{% for user in users %}
{% for timer in user.timers %}
<tr id="row-{{timer.id}}">
<td class="no-print" style="vertical-align:middle">
{% if timer.validate %}
<i class="fa fa-thumbs-down validate-{{user.user.id}}" onClick="devalidate({{timer.id}})" style="cursor:pointer; color:red;"></i>
{% else %}
<i class="fa fa-thumbs-up validate-{{user.user.id}}" onClick="validate({{timer.id}})" style="cursor:pointer; color:green;"></i>
{% endif %}
</td>
<td>
{{ user.user.displayname }}
</td>
<td>
{{ timer.taskname }}
</td>
<td>
<span class="font-weight-bold">
{{ timer.activepenalty ? "<i class='fa fa-exclamation' style='color:red;opacity: 0.33;'></i> Astreinte active" : "" }}
</span>
<span class="font-weight-bold">
{{ timer.additionalhour ? "<i class='fa fa-exclamation-triangle' style='color:red;opacity: 0.33;'></i> Heures supplémentaires" : "" }}
</span>
<p>{{ timer.description }}</p>
</td>
<td>
{{ timer.start|date("d/m/Y H:i") }}
</td>
<td>
{{ timer.end|date("d/m/Y H:i") }}
</td>
<td>
{{ timer.duration|date("H:i") }}
</td>
</tr>
{% endfor %}
{% endfor %}
</table>
</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" ]]
});
{%else%}
$('#dataTables').removeClass("table table-striped table-bordered table-hover small dataTable no-footer");
{% endif %}
});
function myprint() {
href=document.location.href;
document.location.href=href+"?fgprint=true";
}
function validate(id) {
$.ajax({
type: "POST",
data: {
id: id,
},
url: "{{ path('app_validationtimer_validate') }}",
success: function (response) {
response=JSON.parse(response);
if(response.return=="KO") {
alert(response.error);
}
else {
$("#row-"+id).remove();
}
}
});
}
function devalidate(id) {
$.ajax({
type: "POST",
data: {
id: id,
},
url: "{{ path('app_validationtimer_devalidate') }}",
success: function (response) {
response=JSON.parse(response);
if(response.return=="KO") {
alert(response.error);
}
else {
$("#row-"+id).remove();
}
}
});
}
$('#switchactive').change(function() {
window.location="{{ path('app_validationtimer_activetimer' )}}";
});
{% endblock %}