This commit is contained in:
holger.trampe 2020-11-09 20:26:39 +01:00
parent 77ab97f54a
commit 99116da8d3
6 changed files with 41 additions and 41 deletions

View File

@ -68,8 +68,8 @@
<div class="col-3" style="margin-top: -25px; margin-left: -8px;">
<div class="card-body">
{% for user in usersofagency %}
<div class="card hoverchatcard" id="userchat_{{user.pk}}">
<div class="card-body" style="margin: -15px !important;" >
<div class="card hoverchatcard" id="userchat_{{user.pk}}" style="">
<div class="card-body " style="" >
<div style="float: left;" class="col-12 ">
<div class='icon-container mr-2'>
<img class="img-profile roundimg" src="{{ user.profile.get_photo_url }}">
@ -95,7 +95,7 @@
{% for chatroom in chatrooms %}
{% if user in chatroom.chatmembers.all or user in chatroom.chatmembers_admin.all or user == chatroom.creator and chatroom.chatroomtype == 1 %}
<div class="card hoverchatcard" id="groupchat_{{chatroom.pk}}">
<div class="card-body" style="margin: -15px !important;">
<div class="card-body" style="">
<div style="float: left;" class="col-12 ">
<h5 class="mt-3">{{chatroom.roomname}}
</h5>

View File

@ -24,4 +24,4 @@ class UserNotification(models.Model):
# Eventuell automatisches Lösch-Datum
#willdeleted = models.DateTimeField(default=timezone.now()+timedelta(days=30))
# Textcontent
notificationtext = models.CharField(max_length=5000, blank=True)
notificationtext = models.CharField(max_length=15000, blank=True)

View File

@ -39,7 +39,6 @@ def has_group_byname(user, groupname):
agroup = AgencyGroup.objects.filter(agency=user.profile.agency, agencygroupname=groupname)[0]
for g in user.groups.all():
if g.name == agroup.group.name:
print("HIER")
in_group = True
return in_group
@ -523,9 +522,9 @@ def getUserIsRep(user):
# Check, if a user is behind a day in agency (working startdate)
@register.simple_tag
def startdatecheck(usertocheck, day):
uertime = list(UserTime.objects.filter(user=usertocheck))[0]
usertime = list(UserTime.objects.filter(user=usertocheck))[0]
if uertime.startdate < day:
if usertime.startdate != None and usertime.startdate < day:
return True
else:
return False

View File

@ -429,6 +429,8 @@ function recalculateChoosenDays(userid=false){
$("#id_end").data("DateTimePicker").date(date_end);
localStorage.setItem("ab_userid", userid);
$("#id_userid").val(userid);
$.ajax({
type: "GET",

View File

@ -141,7 +141,7 @@ def AbsenceManagmenet(request, activemonth=False, activeyear=False):
formtocheck = AddAbsence(request.POST, instance=request.user)
if(formtocheck.is_valid()):
try:
#try:
workinguser = UserFullName.objects.get(pk=formtocheck.cleaned_data["userid"])
# DIFFERENT USER AGENCY
@ -170,9 +170,9 @@ def AbsenceManagmenet(request, activemonth=False, activeyear=False):
#newab = Absence(agency=request.user.profile.agency, user=workinguser, start=formtocheck.cleaned_data["start"],end=formtocheck.cleaned_data["end"], representator=rep, confirm_status=confirmstat, info=formtocheck.cleaned_data["info"], reason=formtocheck.cleaned_data["reason"], start_ishalf=formtocheck.cleaned_data["start_ishalf"], end_ishalf=formtocheck.cleaned_data["end_ishalf"]).save()
newab = Absence(agency=request.user.profile.agency, user=workinguser, start=formtocheck.cleaned_data["start"],end=formtocheck.cleaned_data["end"], representator=rep, confirm_status=confirmstat, info=formtocheck.cleaned_data["info"], reason=formtocheck.cleaned_data["reason"], startday_info=formtocheck.cleaned_data["startday_info"], endday_info=formtocheck.cleaned_data["endday_info"]).save()
# USER NOT FOUND
except:
messages.success(request, f'Fehler bei Abwesenheitsbearbeitung! Bitte wenden Sie sich an den Support.')
return redirect('tma-management', formtocheck.cleaned_data['activemonth'], formtocheck.cleaned_data['activeyear'])
#except:
# messages.success(request, f'Fehler bei Abwesenheitsbearbeitung! Bitte wenden Sie sich an den Support.')
# return redirect('tma-management', formtocheck.cleaned_data['activemonth'], formtocheck.cleaned_data['activeyear'])
return redirect('tma-management', formtocheck.cleaned_data['activemonth'], formtocheck.cleaned_data['activeyear'])
else:
@ -1066,13 +1066,11 @@ def calculateHolidays(request, start, end, start_half, end_half, user):
weekdays = []
freedaycounter = 0
for dt in daterange(start, end):
if dt.isoweekday() not in weekdays:
counter += 1
for freeday in allfreedays.all():
if(dt == freeday.day):
freedaycounter += 1
# Prüfung, ob der Mitarbeiter an diesem Tag überhaupt arbeitet. Wenn nicht, wird der Freedaycounter einfach erhöht
if(dt.isoweekday() == 1):
if user.usertime.wd_mo == 0.0:
@ -1131,6 +1129,7 @@ def calculatingHolidaysByAbsence(request, absence):
# FREEDAY FOUND
if(dt == freeday.day):
freedaycounter += 1
# Prüfung, ob der Mitarbeiter an diesem Tag überhaupt arbeitet. Wenn nicht, wird der Freedaycounter einfach erhöht
stat = False
if(dt.isoweekday() == 1):