Standardsafarbug und Feiertage Bug

This commit is contained in:
holger.trampe 2020-10-31 11:34:46 +01:00
parent 77877fbab5
commit 77ab97f54a
2 changed files with 29 additions and 2 deletions

View File

@ -705,7 +705,9 @@
<script type="text/javascript">
var ua = window.navigator.userAgent;
var isIE = /MSIE|Trident/.test(ua);
if ( isIE ) {
var isSafari = /Safari/.test(ua);
if ( isIE || isSafari) {
//IE specific code goes here
setInterval(function()
{

View File

@ -90,7 +90,7 @@ def checkDefaultAbsenceReasons(sender, user, request, **kwargs):
today = date.today()
# FREEDAYS LADEN
# FREEDAYS LADEN Zwei Jahre
if len(FreeDays.objects.filter(agency=user.profile.agency, year=today.year+2)) == 0:
tempdays = loadingFreeDays(user.profile.agency.plz, today.year+2)
if(tempdays != False):
@ -98,7 +98,32 @@ def checkDefaultAbsenceReasons(sender, user, request, **kwargs):
tempdate = tempdays[k]["datum"].split("-")
FreeDays(agency=user.profile.agency, name=k, day=datetime.datetime(int(tempdate[0]),int(tempdate[1]),int(tempdate[2])), year=date.today().year+2).save()
# FREEDAYS LADEN DIese Jahr
if len(FreeDays.objects.filter(agency=user.profile.agency, year=today.year+1)) == 0:
tempdays = loadingFreeDays(user.profile.agency.plz, today.year+1)
if(tempdays != False):
for k in tempdays.keys():
tempdate = tempdays[k]["datum"].split("-")
FreeDays(agency=user.profile.agency, name=k, day=datetime.datetime(int(tempdate[0]),int(tempdate[1]),int(tempdate[2])), year=date.today().year+1).save()
# CHECK FOR YEARS
# FREEDAYS LADEN LETZTES JAHR
if len(FreeDays.objects.filter(agency=user.profile.agency, year=today.year-1)) == 0:
tempdays = loadingFreeDays(user.profile.agency.plz, today.year-1)
if(tempdays != False):
for k in tempdays.keys():
tempdate = tempdays[k]["datum"].split("-")
FreeDays(agency=user.profile.agency, name=k, day=datetime.datetime(int(tempdate[0]),int(tempdate[1]),int(tempdate[2])), year=date.today().year-1).save()
# FREEDAYS LADEN
if len(FreeDays.objects.filter(agency=user.profile.agency, year=today.year)) == 0:
tempdays = loadingFreeDays(user.profile.agency.plz, today.year)
if(tempdays != False):
for k in tempdays.keys():
tempdate = tempdays[k]["datum"].split("-")
FreeDays(agency=user.profile.agency, name=k, day=datetime.datetime(int(tempdate[0]),int(tempdate[1]),int(tempdate[2])), year=date.today().year).save()
# NO YEARS FOUND
if len(UserYearAbsenceInfo.objects.filter(agency=user.profile.agency)) == 0: