-
-
+
{% for user in usersofagency %}
-
-
-
-
-
- {% for chatroom in chatrooms %}
+ {% 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 %}
-
+
{{chatroom.roomname}}
@@ -180,17 +108,13 @@
{% endif %}
{% endfor %}
-
-
-
+
+
+
+
+
-
-
-
-
-
-
diff --git a/chat/templates/chat/chatmanagement_SAVE.html b/chat/templates/chat/chatmanagement_SAVE.html
new file mode 100644
index 0000000..73dd178
--- /dev/null
+++ b/chat/templates/chat/chatmanagement_SAVE.html
@@ -0,0 +1,340 @@
+{% extends "users/base.html" %}
+{% block content %}
+{% if request.user.profile.agency.module_chat %}
+
+
+
Chat
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {% for user in usersofagency %}
+
+
+
+
+
+
+
+
+
{{user.first_name}} {{user.last_name}}
+
+
+
+ {% endfor %}
+
+
+
+
+
+
+
+
+ {% 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 %}
+
+
+
+
{{chatroom.roomname}}
+
+ {% for member in chatroom.chatmembers.all %}
+ {{member.first_name}} {{member.last_name}}{% if forloop.counter < chatroom.chatmembers.all|length %}, {% endif %}
+ {% endfor %}
+
+
+
+
+ {% endif %}
+ {% endfor %}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{% else %}
+
Das Module Chat wurde in ihrer Agentur deaktiviert.
+{% endif %}
+{% endblock content %}
diff --git a/cloud/models.py b/cloud/models.py
index 178b25b..3ef779b 100644
--- a/cloud/models.py
+++ b/cloud/models.py
@@ -17,7 +17,7 @@ class Data(models.Model):
file = models.FileField(null=True, max_length=255, upload_to=user_directory_path)
date_created = models.DateTimeField(default = timezone.now)
date_last_modified = models.DateTimeField(default = timezone.now)
- owner = models.ForeignKey(User, on_delete=models.PROTECT)
+ owner = models.ForeignKey(User, on_delete=models.SET_NULL, null=True)
agency = models.ForeignKey(Agency, on_delete=models.CASCADE, default=None)
def __str__(self):
@@ -34,7 +34,7 @@ class DataDir(models.Model):
visibleby = models.ManyToManyField(AgencyGroup, blank=True, related_name='visible_by_user')
date_created = models.DateTimeField(default = timezone.now)
date_last_modified = models.DateTimeField(default = timezone.now)
- owner = models.ForeignKey(User, on_delete=models.PROTECT, blank=True, null=True)
+ owner = models.ForeignKey(User, on_delete=models.SET_NULL, blank=True, null=True)
agency = models.ForeignKey(Agency, on_delete=models.CASCADE)
parent = models.ForeignKey('DataDir', on_delete=models.CASCADE, blank=True, null=True, related_name='dir_in_dir')
@@ -48,7 +48,7 @@ class DataFile(models.Model):
file = models.FileField(null=True, max_length=255, upload_to=user_directory_path, blank=True)
date_created = models.DateTimeField(default = timezone.now)
date_last_modified = models.DateTimeField(default = timezone.now)
- owner = models.ForeignKey(User, on_delete=models.PROTECT, default=None, blank=True, null=True)
+ owner = models.ForeignKey(User, on_delete=models.SET_NULL, default=None, blank=True, null=True)
agency = models.ForeignKey(Agency, on_delete=models.CASCADE, default=None, blank=True, null=True)
parent = models.ForeignKey(DataDir, on_delete=models.PROTECT, related_name='thisfileindir', blank=True, null=True)
diff --git a/news/models.py b/news/models.py
index 4db2990..32408ff 100644
--- a/news/models.py
+++ b/news/models.py
@@ -19,7 +19,7 @@ class News(models.Model):
go_online_on = models.DateTimeField(default=timezone.now, blank=True)
# Default date plus two weeks
- go_offline_on = models.DateTimeField(default=timezone.now()+timedelta(days=14), blank=True, null=True)
+ go_offline_on = models.DateTimeField(default=timezone.now, blank=True, null=True)
last_modified_by = models.ForeignKey(User, on_delete=models.SET_NULL, null=True, related_name='news_mod_by', default=None)
last_modified_on = models.DateTimeField(default=timezone.now, blank=True)
diff --git a/news/templates/news/news_addnews.html b/news/templates/news/news_addnews.html
index 6a85a8b..dab28cd 100644
--- a/news/templates/news/news_addnews.html
+++ b/news/templates/news/news_addnews.html
@@ -23,6 +23,12 @@ $(document).ready(function() {
lang: "de-DE",
disableDragAndDrop: true
});
+
+ //Set offline-Datei plus 2 weeks
+ today = new Date();
+ today = new Date(today.setDate(today.getDate() + 14));
+ $("#id_go_offline_on").data("DateTimePicker").date(today);
+
});
{% else %}
diff --git a/organizer/models.py b/organizer/models.py
index a17b8c9..a10a55b 100644
--- a/organizer/models.py
+++ b/organizer/models.py
@@ -18,7 +18,6 @@ users speichert alle primary-Keys der User, welche diesem Bereich zugeordnet sin
'''
class QuickLinks(models.Model):
- # Wenn die Area gelöscht wird, wird NICHT die Agency gelöscht
agency = models.ForeignKey(Agency, on_delete=models.PROTECT)
name = models.CharField(max_length=200, blank=False)
link = models.CharField(max_length=200, blank=False)
diff --git a/standards/forms.py b/standards/forms.py
index 0a255a5..b118743 100644
--- a/standards/forms.py
+++ b/standards/forms.py
@@ -133,7 +133,7 @@ class StandardUpdateStandard(forms.ModelForm):
self.fields['task'].queryset = Tasks.objects.filter(area__id=areaid).order_by('name')
except (ValueError, TypeError):
pass
- elif loggeduser.pk and standard.area != None:
+ elif loggeduser != None and standard.area != None:
self.fields['task'].queryset = Tasks.objects.filter(area__pk=standard.area.pk)
self.fields['area'].required = True
diff --git a/standards/models.py b/standards/models.py
index 62ab592..5310e35 100644
--- a/standards/models.py
+++ b/standards/models.py
@@ -12,7 +12,7 @@ from django.utils import timezone
class StandardCommentRate(models.Model):
#standard = models.ForeignKey("Standards", on_delete=models.CASCADE)
- rated_by = models.ForeignKey(User, on_delete=models.PROTECT)
+ rated_by = models.ForeignKey(User, on_delete=models.SET_NULL, null=True)
rate_stats = models.IntegerField(default=0)
oncomment = models.ForeignKey("StandardComments", on_delete=models.CASCADE)
@@ -30,13 +30,13 @@ class Standards(models.Model):
name = models.CharField(max_length=200, blank=False, default="")
content = models.TextField(blank=True, verbose_name='Inhalt', default="")
- created_standard_by = models.ForeignKey(User, on_delete=models.PROTECT)
+ created_standard_by = models.ForeignKey(User, default=None, null=True, on_delete=models.SET_NULL)
created_standard_date = models.DateTimeField(default=timezone.now, blank=True)
- published_by = models.ForeignKey(User, on_delete=models.PROTECT, related_name='user_published_standard', default=None)
+ published_by = models.ForeignKey(User, on_delete=models.SET_NULL, related_name='user_published_standard', default=None, null=True)
published_on = models.DateTimeField(default=timezone.now, blank=True)
- last_modified_by = models.ForeignKey(User, on_delete=models.PROTECT, related_name='user_modified_standard', default=None)
+ last_modified_by = models.ForeignKey(User, on_delete=models.SET_NULL, null=True, related_name='user_modified_standard', default=None)
last_modified_on = models.DateTimeField(default=timezone.now, blank=True)
public = models.BooleanField(default=False)
diff --git a/standards/templates/standards/standards_single.html b/standards/templates/standards/standards_single.html
index 2d7b8c6..b0d821c 100644
--- a/standards/templates/standards/standards_single.html
+++ b/standards/templates/standards/standards_single.html
@@ -14,7 +14,7 @@
{{standard.name}}
- {% if standard.created_standard_by == user or perms.users.standardmanager %}
+ {% if standard.created_standard_by != null and standard.created_standard_by == user or perms.users.standardmanager %}
{% endif %}
@@ -64,15 +64,15 @@
{% if standard.executor.count > 0 %}
Ausführende
{% for u in standard.executor.all %}
- {{u.first_name}} {{u.last_name}} {% if forloop.counter < standard.executor.count%} | {% endif %}
+ {{u.first_name}} {{u.last_name}} {% if forloop.counter < standard.executor.count%} | {% endif %}
{% endfor %}
{% endif %}
{% if standard.representative.count > 0 %}
Vertreter
- {% for u in standard.representative.all %}
- {{u.first_name}} {{u.last_name}} {% if forloop.counter < standard.representative.count%} | {% endif %}
+ {% for u in standard.representative.all %}
+ {{u.first_name}} {{u.last_name}} {% if forloop.counter < standard.representative.count%} | {% endif %}
{% endfor %}
{% endif %}
@@ -80,8 +80,8 @@
{% if standard.authority.count > 0 %}
Verantwortliche
- {% for u in standard.authority.all %}
- {{u.first_name}} {{u.last_name}} {% if forloop.counter < standard.authority.count%} | {% endif %}
+ {% for u in standard.authority.all %}
+ {{u.first_name}} {{u.last_name}} {% if forloop.counter < standard.authority.count%} | {% endif %}
{% endfor %}
{% endif %}
@@ -193,8 +193,9 @@
diff --git a/standards/templates/standards/standards_single_agn.html b/standards/templates/standards/standards_single_agn.html
index 773b5e2..07719b6 100644
--- a/standards/templates/standards/standards_single_agn.html
+++ b/standards/templates/standards/standards_single_agn.html
@@ -124,9 +124,8 @@
{% getcommentsup comment.pk as cup %}
{% if cup > 0 %}{{cup}}{% endif %}
-
- {% if comment.comment_by == request.user or standard.created_standard_by == request.user or standard.last_modified_by == request.user %}
+ {% if comment.comment_by == request.user or (standard.created_standard_by != none and standard.created_standard_by == request.user) or standard.last_modified_by == request.user %}
diff --git a/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc b/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc
index e6341fb..20406bc 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 ba57844..9ae4c5f 100644
--- a/standards/templatetags/counter_tag.py
+++ b/standards/templatetags/counter_tag.py
@@ -557,6 +557,19 @@ def gettimeoveralldiff(workday, user):
Es werden nur Tage berücksichtigt, die in der Vergangenheit liegen!
'''
+def format_timedelta(td):
+ hours, remainder = divmod(td.total_seconds(), 3600)
+ minutes, seconds = divmod(remainder, 60)
+ hours, minutes, seconds = int(hours), int(minutes), int(seconds)
+ if hours < 10:
+ hours = '0%s' % int(hours)
+ if minutes < 10:
+ minutes = '0%s' % minutes
+ if seconds < 10:
+ seconds = '0%s' % seconds
+ return '%s:%s:%s' % (hours, minutes, seconds)
+
+
@register.simple_tag
def loadaccounttime(user):
status = 0
@@ -591,14 +604,13 @@ def loadaccounttime(user):
# Wenn GLeitzeit NEGATIV ist
if(finalaccounttimesum.total_seconds() < 0):
status = 1
- final_info_data = str(datetime.timedelta(seconds=finalaccounttimesum.total_seconds()*(-1))).split(":")
+ final_info_data = format_timedelta(datetime.timedelta(seconds=finalaccounttimesum.total_seconds()*(-1)))
else:
status = 0
- final_info_data = str(datetime.timedelta(seconds=finalaccounttimesum.total_seconds())).split(":")
+ final_info_data = format_timedelta(datetime.timedelta(seconds=finalaccounttimesum.total_seconds()))
- final_info = str(final_info_data[0]) + ":" + str(final_info_data[1])
-
- return [final_info, status]
+ #final_info = str(final_info_data[0]) + ":" + str(final_info_data[1])
+ return [final_info_data, status]
'''
diff --git a/standards/views.py b/standards/views.py
index 68e9264..31ea365 100644
--- a/standards/views.py
+++ b/standards/views.py
@@ -607,6 +607,7 @@ def StandardSingle(request, pk):
'active_link':'standards',
'standard' : standard
}
+
return render(request, 'standards/standards_single.html', context)
else:
context = {
diff --git a/tasks/models.py b/tasks/models.py
index c4b2905..a89ac4a 100644
--- a/tasks/models.py
+++ b/tasks/models.py
@@ -18,7 +18,7 @@ class Tasks(models.Model):
name = models.CharField(max_length=200, blank=False, default="")
desc = models.TextField(max_length=3000, blank=True)
usersfield = models.ManyToManyField(User, blank=True, related_name='users_in_task')
- created_area_by = models.ForeignKey(User, on_delete=models.PROTECT)
+ created_area_by = models.ForeignKey(User, on_delete=models.SET_NULL, null=True)
created_area_date = models.DateField(default=datetime.date.today, blank=True)
visible = models.BooleanField(default=True)
diff --git a/timemanagement/templates/timemanagement/rendered_table.html b/timemanagement/templates/timemanagement/rendered_table.html
index b8e5a19..552348a 100644
--- a/timemanagement/templates/timemanagement/rendered_table.html
+++ b/timemanagement/templates/timemanagement/rendered_table.html
@@ -428,15 +428,14 @@ function recalculateChoosenDays(userid=false){
$("#id_start").data("DateTimePicker").date(date_start);
$("#id_end").data("DateTimePicker").date(date_end);
-
- console.log(userid);
+ localStorage.setItem("ab_userid", userid);
$.ajax({
type: "GET",
url: "{% url 'tm-ajax' %}",
data:{
action : "getrestholidays",
- userid : userid,
+ userid : localStorage.getItem("ab_userid"),
startdate : date_start.getFullYear() + "__" + (date_start.getMonth()+1) + "__" + date_start.getDate(),
enddate : date_end.getFullYear() + "__" + (date_end.getMonth()+1) + "__" + date_end.getDate(),
//start_half : $("#id_start_ishalf").prop("checked"),
@@ -462,8 +461,6 @@ function recalculateChoosenDays(userid=false){
$("#ownholidays").hide();
}
-
-
$("#startAbsenceProgress").modal("show");
@@ -504,8 +501,6 @@ function recalculateChoosenDays(userid=false){
}
function recalculateChoosenDaysAfterInit(){
- console.log("CHANGE!")
- console.log(userid);
new_start = $("#id_start").datepicker().val();
new_end = $("#id_end").datepicker().val();
@@ -515,10 +510,10 @@ function recalculateChoosenDaysAfterInit(){
behindcheck_start = new Date(new_start[2], (parseInt(new_start[1])-1), new_start[0]);
behindcheck_end = new Date(new_end[2], (parseInt(new_end[1])-1), new_end[0]);
- if(sameday){
- behindcheck_end = behindcheck_start;
- new_end = new_start;
- }
+ //if(sameday){
+ // behindcheck_end = behindcheck_start;
+ // new_end = new_start;
+ //}
$.ajax({
@@ -526,7 +521,7 @@ function recalculateChoosenDaysAfterInit(){
url: "{% url 'tm-ajax' %}",
data:{
action : "getrestholidays",
- userid : userid,
+ userid : localStorage.getItem("ab_userid"),
startdate : new_start[2] + "__" + new_start[1] + "__" + new_start[0],
enddate : new_end[2] + "__" + new_end[1] + "__" + new_end[0],
//start_half : $("#id_start_ishalf").prop("checked"),
@@ -603,11 +598,11 @@ function recalculateChoosenDaysAfterInit(){
/*
CHANGE LISTENER
*/
-$("#id_start").blur(function(){
+$("#id_start").blur(function(){
recalculateChoosenDaysAfterInit();
})
-$("#id_end").blur(function(){
+$("#id_end").blur(function(){
recalculateChoosenDaysAfterInit();
})
diff --git a/users/SAVE.py b/users/SAVE.py
deleted file mode 100644
index a4ce900..0000000
--- a/users/SAVE.py
+++ /dev/null
@@ -1,229 +0,0 @@
-
-'''
-@receiver(post_save, sender=DataDir)
-def save_dir(sender, instance, **kwargs):
- usersofagency = User.objects.filter(profile__agency__pk=instance.agency.pk)
-
- # CREATED
- if(kwargs["created"]):
- for user in usersofagency:
- if(user.usernotifications.filedir_created_mail):
- notificationtext = " es gibt neue Ordner: " + instance.name
- sendMailNoti(notificationtext, user)
-
-
- if(user.usernotifications.filedir_created_push):
- newnotification = UserNotification(touser=user, notificationtext="Neuer Ordner: " + instance.name, notificationtype="", elementid=instance.pk)
- newnotification.save()
-
- channel_layer = channels.layers.get_channel_layer()
- async_to_sync(channel_layer.group_send)("user_" + str(user.pk), {'type' : 'pushhandler', 'pushtext' : "pushnotification__Ordner | Neuer Ordner: " + instance.name})
- # UPDATED
- else:
- for user in usersofagency:
- if(user.usernotifications.filedir_update_mail):
- notificationtext = " Ordner wurden aktualisiert: " + instance.name
- sendMailNoti(notificationtext, user)
-
-
- if(user.usernotifications.filedir_update_push):
- newnotification = UserNotification(touser=user, notificationtext="Aktualisierter Ordner: " + instance.name, notificationtype="", elementid=instance.pk)
- newnotification.save()
-
- channel_layer = channels.layers.get_channel_layer()
- async_to_sync(channel_layer.group_send)("user_" + str(user.pk), {'type' : 'pushhandler', 'pushtext' : "pushnotification__Ordner | Aktualisierter Ordner: " + instance.name})
-'''
-
-'''
-@receiver(pre_delete, sender=DataDir)
-def del_dir(sender, instance, **kwargs):
- usersofagency = User.objects.filter(profile__agency__pk=instance.agency.pk)
-
- for user in usersofagency:
- if(user.usernotifications.filedir_delete_mail):
- notificationtext = " ein Ordner wurde gelöscht: " + instance.name
- sendMailNoti(notificationtext, user)
-
-
- if(user.usernotifications.filedir_delete_push):
- newnotification = UserNotification(touser=user, notificationtext="Ordner gelöscht: " + instance.name, notificationtype="", elementid=instance.pk)
- newnotification.save()
-
- channel_layer = channels.layers.get_channel_layer()
- async_to_sync(channel_layer.group_send)("user_" + str(user.pk), {'type' : 'pushhandler', 'pushtext' : "pushnotification__Ordner | Ordner gelöscht: " + instance.name})
-'''
-
-
-@receiver(pre_delete, sender=DataFile)
-def del_file(sender, instance, **kwargs):
- usersofagency = User.objects.filter(profile__agency__pk=instance.agency.pk)
-
- for user in usersofagency:
- if(user.usernotifications.filedir_delete_mail):
- notificationtext = " eine Datei wurde gelöscht: " + instance.name
- sendMailNoti(notificationtext, user)
-
-
- if(user.usernotifications.filedir_delete_push):
- newnotification = UserNotification(touser=user, notificationtext="Datei gelöscht: " + instance.name, notificationtype="", elementid=instance.pk)
- newnotification.save()
-
- channel_layer = channels.layers.get_channel_layer()
- async_to_sync(channel_layer.group_send)("user_" + str(user.pk), {'type' : 'pushhandler', 'pushtext' : "pushnotification__Dateiein | Datei gelöscht: " + instance.name})
- # Signals for FILES
-@receiver(post_save, sender=DataFile)
-def save_file(sender, instance, **kwargs):
-
- if(kwargs["created"] and len(instance.name) > 0):
- newNotifiyPush(0, instance, " es gibt eine neue Datei: ", "Neue Datei: ", "Dateien | ", "", "")
- elif(len(instance.name) > 0):
- newNotifiyPush(1, instance, " Datei wurde aktualisiert: ", "Aktualisierter Datei: ", "Dateien | ", "", "")
-
-
- usersofagency = User.objects.filter(profile__agency__pk=instance.agency.pk)
-
- # CREATED
- if(kwargs["created"]):
- for user in usersofagency:
- if(user.usernotifications.filedir_created_mail):
- notificationtext = " es gibt eine neue Datei: " + instance.name
- sendMailNoti(notificationtext, user)
-
-
- if(user.usernotifications.filedir_created_push):
- newnotification = UserNotification(touser=user, notificationtext="Neue Datei: " + instance.name, notificationtype="", elementid=instance.pk)
- newnotification.save()
-
- channel_layer = channels.layers.get_channel_layer()
- async_to_sync(channel_layer.group_send)("user_" + str(user.pk), {'type' : 'pushhandler', 'pushtext' : "pushnotification__Dateien | Neue Datei: " + instance.name})
- # UPDATED
- else:
- for user in usersofagency:
- if(user.usernotifications.filedir_update_mail):
- notificationtext = " Datei wurden aktualisiert: " + instance.name
- sendMailNoti(notificationtext, user)
-
-
- if(user.usernotifications.filedir_update_push):
- newnotification = UserNotification(touser=user, notificationtext="Aktualisierte Datei: " + instance.name, notificationtype="", elementid=instance.pk)
- newnotification.save()
-
- channel_layer = channels.layers.get_channel_layer()
- async_to_sync(channel_layer.group_send)("user_" + str(user.pk), {'type' : 'pushhandler', 'pushtext' : "pushnotification__Dateien | Aktualisierte Datei: " + instance.name})
-
-
-
-@receiver(post_save, sender=QuickLinks)
-def save_ql(sender, instance, **kwargs):
- usersofagency = User.objects.filter(profile__agency__pk=instance.agency.pk)
-
- # CREATED
- if(kwargs["created"]):
- for user in usersofagency:
- if(user.usernotifications.ql_created_mail):
- notificationtext = " es gibt einen neuen Quicklink: " + instance.name
- sendMailNoti(notificationtext, user)
-
-
- if(user.usernotifications.ql_created_push):
- newnotification = UserNotification(touser=user, notificationtext="Neuer Quicklink: " + instance.name, notificationtype="", elementid=instance.pk)
- newnotification.save()
-
- channel_layer = channels.layers.get_channel_layer()
- async_to_sync(channel_layer.group_send)("user_" + str(user.pk), {'type' : 'pushhandler', 'pushtext' : "pushnotification__Organizer | Neuer Quicklink: " + instance.name})
- # UPDATED
- else:
- for user in usersofagency:
- if(user.usernotifications.ql_update_mail):
- notificationtext = " Quicklink wurde aktualisiert: " + instance.name
- sendMailNoti(notificationtext, user)
-
-
- if(user.usernotifications.ql_update_push):
- newnotification = UserNotification(touser=user, notificationtext="Quicklink aktualisiert: " + instance.name, notificationtype="", elementid=instance.pk)
- newnotification.save()
-
- channel_layer = channels.layers.get_channel_layer()
- async_to_sync(channel_layer.group_send)("user_" + str(user.pk), {'type' : 'pushhandler', 'pushtext' : "pushnotification__Organizer | Aktualisierter Quicklink: " + instance.name})
-
-
-@receiver(pre_delete, sender=QuickLinks)
-def del_ql(sender, instance, **kwargs):
- usersofagency = User.objects.filter(profile__agency__pk=instance.agency.pk)
-
- for user in usersofagency:
- if(user.usernotifications.ql_delete_mail):
- notificationtext = " ein Quicklink wurde gelöscht: " + instance.name
- sendMailNoti(notificationtext, user)
-
-
- if(user.usernotifications.ql_delete_push):
- newnotification = UserNotification(touser=user, notificationtext="Quicklink gelöscht: " + instance.name, notificationtype="", elementid=instance.pk)
- newnotification.save()
-
- channel_layer = channels.layers.get_channel_layer()
- async_to_sync(channel_layer.group_send)("user_" + str(user.pk), {'type' : 'pushhandler', 'pushtext' : "pushnotification__Organizer | Quicklink gelöscht: " + instance.name})
-@receiver(post_save, sender=Standards)
-def save_standard(sender, instance, **kwargs):
- usersofagency = User.objects.filter(profile__agency__pk=instance.agency.pk)
- targeturl = settings.BASE_URL + "standards/standard/" + str(instance.pk) + "/single"
- # NEW STANDARD
- if(kwargs["created"]):
- if(instance.public):
- for user in usersofagency:
-
- if(user.usernotifications.standard_created_mail):
- notificationtext = " es wurde ein neuer Agenturstandard erstellt: " + instance.name
- sendMailNoti(notificationtext, user)
-
-
- if(user.usernotifications.standard_created_push):
- newnotification = UserNotification(touser=user, notificationtext="Neuer Agenturstandard: " + instance.name, notificationtype="newstandard", elementid=instance.pk)
- newnotification.save()
-
- channel_layer = channels.layers.get_channel_layer()
- async_to_sync(channel_layer.group_send)("user_" + str(user.pk), {'type' : 'pushhandler', 'pushtext' : "pushnotification__Standards | Neuer Agenturstandard: " + instance.name})
- else:
- for user in usersofagency:
- if(user.has_perm("users.standardmanager") and user.usernotifications.standard_created_unpub_push):
- newnotification = UserNotification(touser=user, notificationtext="Neuer unveröffentlichter Agenturstandard: " + instance.name, notificationtype="newstandard", elementid=instance.pk)
- newnotification.save()
-
- channel_layer = channels.layers.get_channel_layer()
- async_to_sync(channel_layer.group_send)("user_" + str(user.pk), {'type' : 'pushhandler', 'pushtext' : "pushnotification__Standards | Neuer unveröffentlichter Agenturstandard: " + instance.name})
-
- if(user.has_perm("users.standardmanager") and user.usernotifications.standard_created_unpub_mail):
- notificationtext = " es wurde ein neuer unveröffentlichter Agenturstandard erstellt: " + instance.name
- sendMailNoti(notificationtext, user)
- # Standard wurde aktualisiert
- else:
- for user in usersofagency:
-
- if(user.usernotifications.standard_update_mail):
- notificationtext = " es wurde ein neuer Agenturstandard aktualisiert: " + instance.name
- sendMailNoti(notificationtext, user)
-
- if(user.usernotifications.standard_update_push):
- newnotification = UserNotification(touser=user, notificationtext="Agenturstandard aktualisiert: " + instance.name, notificationtype="newstandard", elementid=instance.pk)
- newnotification.save()
-
- channel_layer = channels.layers.get_channel_layer()
- async_to_sync(channel_layer.group_send)("user_" + str(user.pk), {'type' : 'pushhandler', 'pushtext' : "pushnotification__Standards | Agenturstandard aktualisiert: " + instance.name})
-
-
-# DELETE
-@receiver(pre_delete, sender=Standards)
-def delete_standard(sender, instance, **kwargs):
- usersofagency = User.objects.filter(profile__agency__pk=instance.agency.pk)
- for user in usersofagency:
- if(user.usernotifications.standard_delete_mail):
- notificationtext = " es wurde ein neuer Agenturstandard gelöscht: " + instance.name
- sendMailNoti(notificationtext, user)
-
-
- if(user.usernotifications.standard_delete_push):
- newnotification = UserNotification(touser=user, notificationtext="Agenturstandard gelöscht: " + instance.name, notificationtype="", elementid=instance.pk)
- newnotification.save()
-
- channel_layer = channels.layers.get_channel_layer()
- async_to_sync(channel_layer.group_send)("user_" + str(user.pk), {'type' : 'pushhandler', 'pushtext' : "pushnotification__Standards | Agenturstandard gelöscht: " + instance.name})
\ No newline at end of file
diff --git a/users/templates/users/chat_allusers.html b/users/templates/users/chat_allusers.html
index c5da743..41876ea 100644
--- a/users/templates/users/chat_allusers.html
+++ b/users/templates/users/chat_allusers.html
@@ -23,9 +23,9 @@
-
Chat starten
+ Chat starten
-
+
{% for user in usersofagency %}
diff --git a/users/templates/users/user_confirm_delete.html b/users/templates/users/user_confirm_delete.html
index fd81060..de9882f 100644
--- a/users/templates/users/user_confirm_delete.html
+++ b/users/templates/users/user_confirm_delete.html
@@ -10,13 +10,22 @@
+
+
{% endblock content %}
\ No newline at end of file
diff --git a/users/urls.py b/users/urls.py
index 1864935..cfb2149 100644
--- a/users/urls.py
+++ b/users/urls.py
@@ -23,6 +23,7 @@ urlpatterns = [
#path('usersman/