ajout page validation des timer et option heure supplémentaires
This commit is contained in:
@@ -59,6 +59,7 @@
|
||||
{{ form_row(form.task) }}
|
||||
{{ form_row(form.description) }}
|
||||
{{ form_row(form.activepenalty) }}
|
||||
{{ form_row(form.additionalhour) }}
|
||||
{{ form_row(form.start) }}
|
||||
{{ form_row(form.end) }}
|
||||
{{ form_row(form.duration) }}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{% block body %}
|
||||
Astreintes Actives
|
||||
Tâche;Active;Utilisateur;Début;Fin;Durée;Description;
|
||||
Tâche;Astr.Act;H.Supp;Utilisateur;Début;Fin;Durée;Description;
|
||||
{% for timer in timers %}
|
||||
{{timer.taskname}};{{timer.activepenalty}};{{timer.user}};{{timer.start|date("d/m/Y H:i")}};{{timer.end|date("d/m/Y H:i")}};{{timer.duration|date("H:i")}};{{timer.description}};
|
||||
{{timer.taskname}};{{timer.activepenalty}};{{timer.additionalhour}};{{timer.user}};{{timer.start|date("d/m/Y H:i")}};{{timer.end|date("d/m/Y H:i")}};{{timer.duration|date("H:i")}};{{timer.description}};
|
||||
{% endfor %}
|
||||
{% endblock %}
|
@@ -37,7 +37,7 @@ SUIVI HORAIRE
|
||||
</div>
|
||||
|
||||
<a class="btn btn-success" href={{ path('app_timer_view') }}>Voir le calendrier</a>
|
||||
<a class="btn btn-success" href={{ path('app_timer_view') }}>Exporter Astreintes actives</a>
|
||||
<a class="btn btn-success" href={{ path('app_timer_export_activepenalty') }}>Exporter Astreintes actives et heures supplémentaires</a>
|
||||
<p></p>
|
||||
<div class="dataTable_wrapper">
|
||||
<table class="table table-striped table-bordered table-hover small" id="dataTables" style="width:100%">
|
||||
@@ -57,6 +57,7 @@ SUIVI HORAIRE
|
||||
<td>{{ timer.task.displayname }}</td>
|
||||
<td>
|
||||
<span class="font-weight-bold">{{ timer.activepenalty ? "Astreinte active" : "" }}</span>
|
||||
<span class="font-weight-bold">{{ timer.additionalhour ? "Heures supplémentaires" : "" }}</span>
|
||||
<p>{{ timer.description }}</p>
|
||||
</td>
|
||||
<td>{{ timer.start|date("d/m/Y H:i") }}</td>
|
||||
|
159
src/schedule-2.0/templates/Validation/validationtimer.html.twig
Normal file
159
src/schedule-2.0/templates/Validation/validationtimer.html.twig
Normal file
@@ -0,0 +1,159 @@
|
||||
{% 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 ? "Astreinte active" : "" }}</span>
|
||||
<span class="font-weight-bold">{{ timer.additionalhour ? "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 %}
|
@@ -367,7 +367,7 @@
|
||||
|
||||
<li class="last">
|
||||
<a href="{{path("app_holiday")}}">
|
||||
<i class="fa fa-cocktail"></i>Mes Congés
|
||||
<i class="fa fa-umbrella-beach"></i>Mes Congés
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@@ -378,15 +378,21 @@
|
||||
|
||||
<li>
|
||||
<a href="{{path("app_validation")}}">
|
||||
<i class="fa fa-user"></i>Validation
|
||||
<i class="fa fa-user-check"></i>Validation Calendrier
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="{{path("app_validationholiday")}}">
|
||||
<i class="fa fa-user-tag"></i>Validation Congés
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="last">
|
||||
<a href="{{path("app_validationholiday")}}">
|
||||
<i class="fa fa-suitcase"></i>Validation Congés
|
||||
<a href="{{path("app_validationtimer")}}">
|
||||
<i class="fa fa-user-clock"></i>Validation Horaires
|
||||
</a>
|
||||
</li>
|
||||
</li>
|
||||
|
||||
{% endif %}
|
||||
|
||||
|
Reference in New Issue
Block a user