diff --git a/dump.rdb b/dump.rdb index bf4df83..3670352 100644 Binary files a/dump.rdb and b/dump.rdb differ diff --git a/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc b/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc index 218e5f3..930949e 100644 Binary files a/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc and b/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc differ diff --git a/standards/templatetags/counter_tag.py b/standards/templatetags/counter_tag.py index 8ac8e85..4dc9db4 100644 --- a/standards/templatetags/counter_tag.py +++ b/standards/templatetags/counter_tag.py @@ -69,6 +69,11 @@ def getbool(): def getmesscounter(user): return len(Message.objects.filter(target_user=user)) +# WORKDAY HISTORY +@register.simple_tag +def getWorkDayHistory(workday): + workday = Workday.objects.get(pk=workday.pk) + return workday.history.first() # usergperm ''' diff --git a/timemanagement/models.py b/timemanagement/models.py index a4b6021..5082d1f 100644 --- a/timemanagement/models.py +++ b/timemanagement/models.py @@ -5,6 +5,8 @@ from django.core.exceptions import ValidationError from colorful.fields import RGBColorField from django.utils import timezone +from simple_history.models import HistoricalRecords + # Create your models here. class Workday(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) @@ -13,6 +15,7 @@ class Workday(models.Model): start = models.DateTimeField(default=None, null=True, blank=True) end = models.DateTimeField(default=None, null=True, blank=True) target = models.FloatField(default=8.0) + history = HistoricalRecords() class Breaks(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) @@ -20,6 +23,7 @@ class Breaks(models.Model): workday = models.ForeignKey("Workday", on_delete=models.CASCADE, related_name='workdayele') start = models.DateTimeField(default=None, null=True, blank=True) end = models.DateTimeField(default=None, null=True, blank=True) + class AbsenceReason(models.Model): agency = models.ForeignKey(Agency, on_delete=models.CASCADE) diff --git a/timemanagement/templates/timemanagement/timemanagement_teamview_single.html b/timemanagement/templates/timemanagement/timemanagement_teamview_single.html index bc18e46..3e3215a 100644 --- a/timemanagement/templates/timemanagement/timemanagement_teamview_single.html +++ b/timemanagement/templates/timemanagement/timemanagement_teamview_single.html @@ -23,6 +23,7 @@ Pausen Gesamtzeit Gleitzeit + Manuell geändert   @@ -297,6 +298,18 @@ {% endfor %} + + {% 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 %} + {% counterWDreset %} @@ -319,7 +332,7 @@ {% endfor %} {% else %} - + {% endif %} {% endfor %} diff --git a/users/views.py b/users/views.py index 7b01717..72442de 100644 --- a/users/views.py +++ b/users/views.py @@ -1492,7 +1492,7 @@ def cronactionsdaily(request, code): # Erinnerungsmails/Push bei Vertretung verschicken one_week_later = date.today() + timedelta(days=7) repre_absence = Absence.objects.filter(representator=user, start=one_week_later, confirm_status=0) - + for r in repre_absence: if(r.representator.usernotifications.absence_user_is_rep_reminder_mail): sendMailNoti(" in einer Woche startet Ihre Vertretung für " + r.user.first_name + " " + r.user.last_name + "!", user)