Abwesenheit OHNE Benachrichtigungen FERTIG
This commit is contained in:
parent
19447ce4f7
commit
bcc87e7811
|
|
@ -4,10 +4,18 @@
|
||||||
{% load counter_tag %}
|
{% load counter_tag %}
|
||||||
{% if request.user.profile.agency.module_timemanagement %}
|
{% if request.user.profile.agency.module_timemanagement %}
|
||||||
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
|
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
|
||||||
|
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.6/Chart.bundle.min.js"></script>
|
||||||
<div class="content-section col-12">
|
<div class="content-section col-12">
|
||||||
<h3>Abwesenheiten{% if request.user.profile.showtooltips %} <small><i data-toggle="tooltip" data-placement="top" title="Bearbeiten Sie hier Ihre Abwesenheiten." class="far fa-question-circle"></i></small>{% endif %}</h3>
|
<h3>Abwesenheiten{% if request.user.profile.showtooltips %} <small><i data-toggle="tooltip" data-placement="top" title="Bearbeiten Sie hier Ihre Abwesenheiten." class="far fa-question-circle"></i></small>{% endif %}
|
||||||
|
|
||||||
|
</h3>
|
||||||
<hr>
|
<hr>
|
||||||
|
{% if yearinfo != False %}
|
||||||
|
<p>Verbrauchte Urlaubstage: {{yearinfo.days_inuse}} | Verfügbar: {{yearinfo.days}}</p>
|
||||||
|
{% else %}
|
||||||
|
<p>Keine Abwesenheitsinformationen vorhanden</p>
|
||||||
|
{% endif %}
|
||||||
|
<div >
|
||||||
|
|
||||||
<ul class="nav nav-tabs " id="absencetabs" role="tablist" >
|
<ul class="nav nav-tabs " id="absencetabs" role="tablist" >
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
|
|
@ -31,8 +39,13 @@
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
<div class="chart-container" style="position: absolute; height:160px; width:160px; margin-bottom: -150px; right: -15px; top:54px">
|
||||||
|
<canvas id="datainfo_restdays"></canvas>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
<div class="tab-content" id="absencetabsContent">
|
<div class="tab-content" id="absencetabsContent">
|
||||||
|
|
||||||
<div class="tab-pane fade" id="team" role="tabpanel" aria-labelledby="team-tab">
|
<div class="tab-pane fade" id="team" role="tabpanel" aria-labelledby="team-tab">
|
||||||
|
|
@ -437,6 +450,27 @@ $('#absencetabs a').on('click', function (e) {
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var ctx = document.getElementById("datainfo_restdays");
|
||||||
|
var myChart = new Chart(ctx, {
|
||||||
|
type: 'doughnut',
|
||||||
|
data: {
|
||||||
|
labels: ['Kontigent', 'Genutzt'],
|
||||||
|
datasets: [{
|
||||||
|
backgroundColor: ['#5a5c69','#ff304f'],
|
||||||
|
data: [{{kontingent}}, {{inuse}}]
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
options : {
|
||||||
|
legend: {
|
||||||
|
display: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
<h3>Das Modul Abwesenheits- und Zeiterfassung wurde in ihrer Agentur deaktiviert.</h3>
|
<h3>Das Modul Abwesenheits- und Zeiterfassung wurde in ihrer Agentur deaktiviert.</h3>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
||||||
|
|
@ -153,6 +153,16 @@ def AbsenceManagmenet(request, activemonth=False, activeyear=False):
|
||||||
if(tempTime.startdate == None):
|
if(tempTime.startdate == None):
|
||||||
missinguserdata.append(user)
|
missinguserdata.append(user)
|
||||||
|
|
||||||
|
kontingent = 0
|
||||||
|
inuse = 0
|
||||||
|
yearinfo = False
|
||||||
|
try:
|
||||||
|
yearinfo = list(UserYearAbsenceInfo.objects.filter(year=activeyear, user=request.user))[0]
|
||||||
|
inuse = int(yearinfo.days_inuse)
|
||||||
|
kontingent = int(yearinfo.days)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
context = {
|
context = {
|
||||||
"active_link" : "abscence",
|
"active_link" : "abscence",
|
||||||
"usersofagency" : User.objects.filter(profile__agency=request.user.profile.agency).order_by("-last_name"),
|
"usersofagency" : User.objects.filter(profile__agency=request.user.profile.agency).order_by("-last_name"),
|
||||||
|
|
@ -164,6 +174,9 @@ def AbsenceManagmenet(request, activemonth=False, activeyear=False):
|
||||||
"prevyear" : prevyear,
|
"prevyear" : prevyear,
|
||||||
"activemonth" : activemonth,
|
"activemonth" : activemonth,
|
||||||
"activeyear" : activeyear,
|
"activeyear" : activeyear,
|
||||||
|
"inuse" : inuse,
|
||||||
|
"yearinfo" : yearinfo,
|
||||||
|
"kontingent" : kontingent,
|
||||||
"abscenceform" : AddAbsence(instance=request.user),
|
"abscenceform" : AddAbsence(instance=request.user),
|
||||||
"userown" : Absence.objects.filter(agency=request.user.profile.agency, user=request.user).order_by("-start")
|
"userown" : Absence.objects.filter(agency=request.user.profile.agency, user=request.user).order_by("-start")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue