diff --git a/timemanagement/templates/timemanagement/tm_ab_management.html b/timemanagement/templates/timemanagement/tm_ab_management.html index 258077f..badbdb7 100644 --- a/timemanagement/templates/timemanagement/tm_ab_management.html +++ b/timemanagement/templates/timemanagement/tm_ab_management.html @@ -4,12 +4,20 @@ {% load counter_tag %} {% if request.user.profile.agency.module_timemanagement %} - +
-

Abwesenheiten{% if request.user.profile.showtooltips %} {% endif %}

+

Abwesenheiten{% if request.user.profile.showtooltips %} {% endif %} + +


- - +
+ +
+ +
@@ -437,6 +450,27 @@ $('#absencetabs a').on('click', function (e) { }); + + + + {% else %}

Das Modul Abwesenheits- und Zeiterfassung wurde in ihrer Agentur deaktiviert.

{% endif %} diff --git a/timemanagement/views.py b/timemanagement/views.py index a921ab1..09f9ada 100644 --- a/timemanagement/views.py +++ b/timemanagement/views.py @@ -153,6 +153,16 @@ def AbsenceManagmenet(request, activemonth=False, activeyear=False): if(tempTime.startdate == None): 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 = { "active_link" : "abscence", "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, "activemonth" : activemonth, "activeyear" : activeyear, + "inuse" : inuse, + "yearinfo" : yearinfo, + "kontingent" : kontingent, "abscenceform" : AddAbsence(instance=request.user), "userown" : Absence.objects.filter(agency=request.user.profile.agency, user=request.user).order_by("-start") }