Fehler im Organigramm behoben bzgl. Funktion

This commit is contained in:
holger.trampe 2020-03-09 10:11:13 +01:00
parent 195b20d930
commit 7220b8185b
3 changed files with 19 additions and 3 deletions

View File

@ -20,17 +20,24 @@
<script type="text/javascript">
var data = [
{ 'id' : '{{request.user.profile.agency.pk}}', 'parent' : "", 'role': "", 'name': '{{request.user.profile.agency.name}}', 'color': '#71AF17', "imageUrl": "", 'children' : []},
{% for u in agencyuser %}
{% if u.profile.parent == u %}
{ 'id': '{{u.pk}}' , 'name': "{{u.first_name}} {{u.last_name}}",'role': '<b>{{u.profile.get_func_display}}</b></br >{{u.profile.compfunc}}', 'parent': "{{request.user.profile.agency.pk}}", 'color': '#1859B7', "imageUrl": "{{u.profile.get_photo_url}}", 'userid' : '{{u.pk}}', 'children' : [] },
{ 'id': '{{u.pk}}' , 'name': "{{u.first_name}} {{u.last_name}}",'role': '<b>{% if u.profile.func == None %} n.a. {% else %} {{u.profile.func}} {% endif %}</b></br >{{u.profile.compfunc}}', 'parent': "{{request.user.profile.agency.pk}}", 'color': '#1859B7', "imageUrl": "{{u.profile.get_photo_url}}", 'userid' : '{{u.pk}}', 'children' : [] },
{% else %}
{ 'id': '{{u.pk}}', 'name': "{{u.first_name}} {{u.last_name}}", 'role': '<b>{{u.profile.get_func_display}}</b></br >{{u.profile.compfunc}}', 'parent': '{{u.profile.parent.pk}}', 'color': '#1859B7', "imageUrl": "{{u.profile.get_photo_url }}", 'userid' : '{{u.pk}}', 'children' : []},
{ 'id': '{{u.pk}}', 'name': "{{u.first_name}} {{u.last_name}}", 'role': '<b>{% if u.profile.func == None %} n.a. {% else %} {{u.profile.func}} {% endif %}</b></br >{{u.profile.compfunc}}', 'parent': '{{u.profile.parent.pk}}', 'color': '#1859B7', "imageUrl": "{{u.profile.get_photo_url }}", 'userid' : '{{u.pk}}', 'children' : []},
{% endif %}
{% endfor %}
];
//Check for Agency and User-IDs - dont touch the userid for URLs!
for(i = 0; i < data.length; i++){
for(k = 0; k < data.length; k++){

View File

@ -4,6 +4,7 @@ from django.contrib.auth.models import User
from areas.models import Areas
from users.priomodel import Prio
from tasks.models import Tasks
from users.models import AgencyJob
import webcolors
@login_required
@ -24,6 +25,9 @@ def mainorga(request):
except:
pass
agjobs = AgencyJob.objects.filter(agency=request.user.profile.agency)
context = {
'active_link' : 'orga',
'agencyuser' : agencyuser,
@ -59,6 +63,11 @@ def singleorga(request, pk):
user_first_name = user.first_name
user_last_name = user.last_name
user_id = user.pk
try:
userfuncname = AgencyJob.objects.get(pk=user.profile.func.pk).name
except:
userfuncname = "Nicht vergeben"
context = {
'active_link' : 'orga',
'areas' : areas,
@ -67,7 +76,7 @@ def singleorga(request, pk):
'user_id' : user_id,
'prios' : prios,
'mail' : user.email,
'userfunc' : "CHANGE",
'userfunc' : userfuncname,
'imageurl' : user.profile.get_photo_url,
'compfunc' : user.profile.compfunc,
'phoneland' : user.profile.phoneland,