444 lines
17 KiB
HTML
444 lines
17 KiB
HTML
{% extends "users/base.html" %}
|
|
{% block content %}
|
|
{% load counter_tag %}
|
|
<h3>Zeiterfassung von {{user.get_full_name}} bearbeiten
|
|
<a type="button" class="btn btn-primary btn-sm" style="position: relative; float: right !important;" href="{% url 'tm-add' 1 user.pk %}"><i class="fas fa-plus"></i> Arbeitstag</a>
|
|
</h3>
|
|
<hr>
|
|
<div class="btn-group" role="group" aria-label="" style="min-width: 100% !important">
|
|
<a type="button" class="btn btn-primary mr-1" href="{% url 'tm-team-single' user.pk prev_month prev_year %}" ><i class="fas fa-arrow-circle-left"></i></a>
|
|
<button type="button" class="btn btn-primary mr-1" style="min-width: 150px !important;" onclick="javascript:fastChangeModal()">{{active_month}} {{active_year}}</button>
|
|
<a type="button" class="btn btn-primary mr-1" href="{% url 'tm-team-single' user.pk next_month next_year %}"><i class="fas fa-arrow-circle-right"></i></a>
|
|
</div>
|
|
<hr>
|
|
<div class="table-responsive ">
|
|
<table class="table table-hover" id="table_timemanagement" >
|
|
<thead>
|
|
<tr>
|
|
<th scope="col"></th>
|
|
<th scope="col"></th>
|
|
<th scope="col">Start</th>
|
|
<th scope="col">Ende</th>
|
|
<th scope="col">Gesamtzeit</th>
|
|
<th scope="col">Pausen</th>
|
|
<th scope="col">Arbeitszeit</th>
|
|
<th scope="col">Gleitzeit</th>
|
|
<th scope="col">Manuell geändert</th>
|
|
<th scope="col"> </th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="table_contacts" >
|
|
{% for da in days_this_month %}
|
|
|
|
{% getabscenceday user user da as abday %}
|
|
|
|
<tr id="da_{{da|date:"d-m-y"}}"
|
|
{% if da.weekday == 5 or da.weekday == 6 %}
|
|
style="background-color: #d3d3d3;"
|
|
{% elif abday != False %}
|
|
style="background-color: {{abday.reason.color}}; color: #ffffff"
|
|
{% endif %}>
|
|
<td>
|
|
{{da|date:"l"}}
|
|
</td>
|
|
<td>
|
|
{{da|date:"d.m.y"}}
|
|
</td>
|
|
<td {% if abday != False %} colspan="3" {% endif %}>
|
|
{% if abday != False %}
|
|
{{abday.reason}}
|
|
{% if abday.start == da%}
|
|
{% if abday.startday_info == "1" %}
|
|
(nur Vormittags)
|
|
{% for workday in workdays %}
|
|
{% if workday.start|date:"d-m-y" == da|date:"d-m-y" %}
|
|
<br />
|
|
{{workday.start|date:"H:i"}} - {{workday.end|date:"H:i"}},
|
|
{% getsumworkdayexcludebreak workday as sumworkday %}
|
|
{{ sumworkday }},
|
|
{% getsumbreak workday as sumbreakofday %}
|
|
{{sumbreakofday}} min. ({{workday.breaks.all|length}}),
|
|
{% getsumworkday workday as sumwd %}
|
|
{{sumwd}},
|
|
{% gettimeoveralldiff workday user as erg%}
|
|
{% if erg.1 == 0 %}
|
|
<span style="color: green">+{{erg.0}}</span>
|
|
{% elif erg.1 == 1 %}
|
|
<span>{{erg.0}}</span>
|
|
{% else %}
|
|
<span style="color: red">-{{erg.0}}</span>
|
|
{% endif %}
|
|
|
|
<button class="btn btn-secondary btn-sm ml-2" onclick="window.location.href='{% url 'tm-update' workday.pk 1 %}'"><small><i class="fas fa-pen"></i></small></button>
|
|
<button class="btn btn-secondary btn-sm " onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')"><small><i class="fas fa-trash"></i></small></button>
|
|
|
|
{% endif %}
|
|
{% endfor %}
|
|
|
|
|
|
|
|
{% elif abday.startday_info == "2" %}
|
|
(nur Nachmittags)
|
|
|
|
{% for workday in workdays %}
|
|
{% if workday.start|date:"d-m-y" == da|date:"d-m-y" %}
|
|
<br />
|
|
{{workday.start|date:"H:i"}} - {{workday.end|date:"H:i"}}
|
|
{% getsumworkdayexcludebreak workday as sumworkday %}
|
|
{{ sumworkday }},
|
|
{% getsumbreak workday as sumbreakofday %}
|
|
{{sumbreakofday}} min. ({{workday.breaks.all|length}}),
|
|
{% getsumworkday workday as sumwd %}
|
|
{{sumwd}},
|
|
{% gettimeoveralldiff workday user as erg%}
|
|
{% if erg.1 == 0 %}
|
|
<span style="color: green">+{{erg.0}}</span>
|
|
{% elif erg.1 == 1 %}
|
|
<span>{{erg.0}}</span>
|
|
{% else %}
|
|
<span style="color: red">-{{erg.0}}</span>
|
|
{% endif %}
|
|
|
|
|
|
<button class="btn btn-secondary btn-sm ml-2" onclick="window.location.href='{% url 'tm-update' workday.pk 1 %}'"><small><i class="fas fa-pen"></i></small></button>
|
|
<button class="btn btn-secondary btn-sm " onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')"><small><i class="fas fa-trash"></i></small></button>
|
|
|
|
{% endif %}
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
{% elif abday.end == da%}
|
|
{% if abday.endday_info == "1" %}
|
|
(nur Vormittags)
|
|
|
|
|
|
|
|
{% for workday in workdays %}
|
|
{% if workday.start|date:"d-m-y" == da|date:"d-m-y" %}
|
|
<br />
|
|
{{workday.start|date:"H:i"}} - {{workday.end|date:"H:i"}}
|
|
{% getsumworkdayexcludebreak workday as sumworkday %}
|
|
{{ sumworkday }},
|
|
{% getsumbreak workday as sumbreakofday %}
|
|
{{sumbreakofday}} min. ({{workday.breaks.all|length}}),
|
|
{% getsumworkday workday as sumwd %}
|
|
{{sumwd}},
|
|
{% gettimeoveralldiff workday user as erg%}
|
|
{% if erg.1 == 0 %}
|
|
<span style="color: green">+{{erg.0}}</span>
|
|
{% elif erg.1 == 1 %}
|
|
<span>{{erg.0}}</span>
|
|
{% else %}
|
|
<span style="color: red">-{{erg.0}}</span>
|
|
{% endif %}
|
|
|
|
|
|
<button class="btn btn-secondary btn-sm ml-2" onclick="window.location.href='{% url 'tm-update' workday.pk 1 %}'"><small><i class="fas fa-pen"></i></small></button>
|
|
<button class="btn btn-secondary btn-sm " onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')"><small><i class="fas fa-trash"></i></small></button>
|
|
|
|
|
|
{% endif %}
|
|
{% endfor %}
|
|
|
|
{% elif abday.endday_info == "2" %}
|
|
(nur Nachmittags)
|
|
|
|
|
|
|
|
{% for workday in workdays %}
|
|
{% if workday.start|date:"d-m-y" == da|date:"d-m-y" %}
|
|
<br />
|
|
{{workday.start|date:"H:i"}} - {{workday.end|date:"H:i"}}
|
|
{% getsumworkdayexcludebreak workday as sumworkday %}
|
|
{{ sumworkday }},
|
|
{% getsumbreak workday as sumbreakofday %}
|
|
{{sumbreakofday}} min. ({{workday.breaks.all|length}}),
|
|
{% getsumworkday workday as sumwd %}
|
|
{{sumwd}},
|
|
{% gettimeoveralldiff workday user as erg%}
|
|
{% if erg.1 == 0 %}
|
|
<span style="color: green">+{{erg.0}}</span>
|
|
{% elif erg.1 == 1 %}
|
|
<span>{{erg.0}}</span>
|
|
{% else %}
|
|
<span style="color: red">-{{erg.0}}</span>
|
|
{% endif %}
|
|
|
|
|
|
<button class="btn btn-secondary btn-sm ml-2" onclick="window.location.href='{% url 'tm-update' workday.pk 1 %}'"><small><i class="fas fa-pen"></i></small></button>
|
|
<button class="btn btn-secondary btn-sm " onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')"><small><i class="fas fa-trash"></i></small></button>
|
|
|
|
{% endif %}
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
{% else %}
|
|
{% if abday == False %}
|
|
{% counterWDreset %}
|
|
{% for workday in workdays %}
|
|
{% if workday.start|date:"d-m-y" == da|date:"d-m-y" %}
|
|
|
|
{% getCounterWD as wd_counter %}
|
|
|
|
{% if wd_counter > 0 %}
|
|
<br />
|
|
{% endif %}
|
|
|
|
|
|
{% counterWDUp %}
|
|
{{workday.start|date:"H:i"}}
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endif %}
|
|
</td>
|
|
{% if abday == False %}
|
|
<td>
|
|
{% counterWDreset %}
|
|
{% for workday in workdays %}
|
|
{% if workday.end|date:"d-m-y" == da|date:"d-m-y" %}
|
|
|
|
{% getCounterWD as wd_counter %}
|
|
|
|
{% if wd_counter > 0 %}
|
|
<br />
|
|
{% endif %}
|
|
|
|
|
|
{% counterWDUp %}
|
|
|
|
{{workday.end|date:"H:i"}}
|
|
{% endif %}
|
|
{% endfor %}
|
|
|
|
</td>
|
|
<td>
|
|
{% counterWDreset %}
|
|
{% for workday in workdays %}
|
|
{% if workday.start|date:"d-m-y" == da|date:"d-m-y" %}
|
|
|
|
{% getCounterWD as wd_counter %}
|
|
|
|
{% if wd_counter > 0 %}
|
|
<br />
|
|
{% endif %}
|
|
|
|
|
|
{% counterWDUp %}
|
|
|
|
{% getsumworkdayexcludebreak workday as sumworkday %}
|
|
{{ sumworkday }}
|
|
{% endif %}
|
|
{% endfor %}
|
|
|
|
</td>
|
|
<td>
|
|
{% counterWDreset %}
|
|
{% for workday in workdays %}
|
|
{% if workday.start|date:"d-m-y" == da|date:"d-m-y" %}
|
|
|
|
{% getCounterWD as wd_counter %}
|
|
|
|
{% if wd_counter > 0 %}
|
|
<br />
|
|
{% endif %}
|
|
|
|
{% counterWDUp %}
|
|
|
|
{% getsumbreak workday as sumbreakofday %}
|
|
{{sumbreakofday}} min. ({{workday.breaks.all|length}})
|
|
{% endif %}
|
|
{% endfor %}
|
|
|
|
</td>
|
|
<td>
|
|
|
|
{% counterWDreset %}
|
|
{% for workday in workdays %}
|
|
{% if workday.start|date:"d-m-y" == da|date:"d-m-y" %}
|
|
|
|
{% getCounterWD as wd_counter %}
|
|
|
|
{% if wd_counter > 0 %}
|
|
<br />
|
|
{% endif %}
|
|
|
|
|
|
{% counterWDUp %}
|
|
|
|
{% getsumworkday workday as sumwd %}
|
|
{{sumwd}}
|
|
{% endif %}
|
|
{% endfor %}
|
|
|
|
</td>
|
|
<td>
|
|
|
|
{% counterWDreset %}
|
|
{% for workday in workdays %}
|
|
{% if workday.start|date:"d-m-y" == da|date:"d-m-y" %}
|
|
|
|
{% getCounterWD as wd_counter %}
|
|
|
|
{% if wd_counter > 0 %}
|
|
<br />
|
|
{% endif %}
|
|
{% counterWDUp %}
|
|
{% gettimeoveralldiff workday user as erg%}
|
|
{% if erg.1 == 0 %}
|
|
<span style="color: green">+{{erg.0}}</span>
|
|
{% elif erg.1 == 1 %}
|
|
<span>{{erg.0}}</span>
|
|
{% else %}
|
|
<span style="color: red">-{{erg.0}}</span>
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
|
|
</td>
|
|
<td>
|
|
{% for workday in workdays %}
|
|
{% if workday.end|date:"d-m-y" == da|date:"d-m-y" %}
|
|
|
|
{% getWorkDayHistory workday as wd_history %}
|
|
|
|
{% if wd_history.history_user != None %}
|
|
{{wd_history.history_date|date:"d.m.Y, H:i"}} von {{wd_history.history_user.first_name}} {{wd_history.history_user.last_name}}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
</td>
|
|
<td>
|
|
|
|
{% counterWDreset %}
|
|
{% for workday in workdays %}
|
|
{% if workday.start|date:"d-m-y" == da|date:"d-m-y" %}
|
|
|
|
{% getCounterWD as wd_counter %}
|
|
|
|
{% if wd_counter > 0 %}
|
|
<br />
|
|
{% endif %}
|
|
|
|
|
|
{% counterWDUp %}
|
|
|
|
<button class="btn btn-secondary btn-sm ml-2" onclick="window.location.href='{% url 'tm-update' workday.pk 1 %}'"><small><i class="fas fa-pen"></i></small></button>
|
|
<button class="btn btn-secondary btn-sm " onclick="javascript:$('#confirm-delete_{{workday.pk}}').modal('toggle')"><small><i class="fas fa-trash"></i></small></button>
|
|
|
|
{% endif %}
|
|
{% endfor %}
|
|
</td>
|
|
{% else %}
|
|
<td></td><td></td><td></td><td></td><td></td><td style="display: none;"></td><td style="display: none;"></td>
|
|
{% endif %}
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="modal fade" tabindex="-1" id="fastjumpmodal" data-backdrop="static">
|
|
<div class="modal-dialog" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title">Zeitraum auswählen</h5>
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="form-group">
|
|
<label for="exampleFormControlSelect1">Jahr auswählen</label>
|
|
{% getsomeyears active_year as years %}
|
|
<select class="form-control" id="choosenyear">
|
|
{% for y in years %}
|
|
<option val="{{y}}" {% if y == active_year %} selected {% endif %}>{{y}}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
{% getsomemonths as months %}
|
|
{% for m in months %}
|
|
<button class="btn
|
|
{% if forloop.counter == activemonth %} btn-primary {% else %} btn-secondary {% endif %}
|
|
btn-sm mr-2 mb-2" onclick="javascript:goFastToMonth({{forloop.counter}})">{{m}}</button>
|
|
{% endfor %}
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-primary " data-dismiss="modal">Schließen</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% for workday in workdays %}
|
|
<div class="modal fade" id="confirm-delete_{{workday.pk}}" tabindex="-1" role="dialog" aria-labelledby="" aria-hidden="true">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title">Arbeitstag von {{user.get_full_name}} löschen</h5>
|
|
</div>
|
|
<div class="modal-body">
|
|
Möchten Sie wirklich den Arbeitstag am {{workday.start|date:"d.m"}} löschen?
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button class="btn btn-primary" id="dodel_{{workday.pk}}" >Löschen</button>
|
|
<button type="button" class="btn" data-dismiss="modal">Abbrechen</button>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
$("#dodel_{{workday.pk}}").click(function(){
|
|
$.ajax(
|
|
{
|
|
type: "GET",
|
|
url: "{% url 'tm-ajax' %}",
|
|
data:{
|
|
action : "remove_workday",
|
|
workday: {{workday.pk}},
|
|
},
|
|
success: function( data )
|
|
{
|
|
location.href = location.href;
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
{% endfor %}
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
function fastChangeModal(){
|
|
$("#fastjumpmodal").modal("toggle");
|
|
}
|
|
|
|
$(document).ready(function(){
|
|
|
|
$('#table_timemanagement').DataTable({
|
|
"language": {
|
|
"search" : "Suche",
|
|
"info": "Zeige _START_ bis _END_ von _TOTAL_ Einträgen",
|
|
"lengthMenu": "Zeige _MENU_ Einträge",
|
|
"zeroRecords": "Nichts gefunden",
|
|
"infoEmpty": "Keine Einträge",
|
|
"paginate": {
|
|
"first": "Erste",
|
|
"last": "Letzte",
|
|
"next": "Nächste",
|
|
"previous": "Zurück"
|
|
},
|
|
},
|
|
"buttons" : {
|
|
"className" : "btn-danger"
|
|
},
|
|
"pageLength": 50,
|
|
"order": [[ 1, "asc" ]]
|
|
});
|
|
});
|
|
|
|
</script>
|
|
{% endblock content %} |