DynStandard LoggedUserBug behoben
This commit is contained in:
parent
05e9f37c3b
commit
97e7a1ce8f
Binary file not shown.
|
|
@ -69,7 +69,7 @@
|
||||||
|
|
||||||
{% if request.user.profile.agency.dynamicprofile %}
|
{% if request.user.profile.agency.dynamicprofile %}
|
||||||
|
|
||||||
als <span id="view_info_0">Verantwortlicher</span>
|
als <span id="view_info_0" style="display: none;">Verantwortlicher</span>
|
||||||
<span id="view_info_1" style="display: none;">Ausführender</span>
|
<span id="view_info_1" style="display: none;">Ausführender</span>
|
||||||
<span id="view_info_2" style="display: none;">Vertreter</span>
|
<span id="view_info_2" style="display: none;">Vertreter</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
@ -90,21 +90,21 @@
|
||||||
{% if request.user.profile.agency.dynamicprofile %}
|
{% if request.user.profile.agency.dynamicprofile %}
|
||||||
|
|
||||||
{% for task in tasks %}
|
{% for task in tasks %}
|
||||||
{% isUserInAuth task area request.user as checkIsUserAuth %}
|
{% isUserInAuth task area user_id as checkIsUserAuth %}
|
||||||
{% if task.area.pk == area.pk and task.visible and checkIsUserAuth %}
|
{% if task.area.pk == area.pk and task.visible and checkIsUserAuth %}
|
||||||
<div style="display: none; background-color: rgba({{area.color.0}},{{area.color.1}},{{area.color.2}}, 1)" class="mb-2 pt-3 pb-1 view_0" id="ele_{{task.pk}}">
|
<div style="display: none; background-color: rgba({{area.color.0}},{{area.color.1}},{{area.color.2}}, 1)" class="mb-2 pt-3 pb-1 view_0" id="ele_{{task.pk}}">
|
||||||
<span ><h6 ><a style=" color: #FFFFFF;"href="{% url 'standard-task' task.pk %}"><span class="arrows_area_{{area.pk}} ml-4" style="display:none; float: left;"><i class="fas fa-sort"></i></span>{{task.name}}</a></h6></span>
|
<span ><h6 ><a style=" color: #FFFFFF;"href="{% url 'standard-task' task.pk %}"><span class="arrows_area_{{area.pk}} ml-4" style="display:none; float: left;"><i class="fas fa-sort"></i></span>{{task.name}}</a></h6></span>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% isUserInEx task area request.user as checkIsUserEx %}
|
{% isUserInEx task area user_id as checkIsUserEx %}
|
||||||
{% if task.area.pk == area.pk and task.visible and checkIsUserEx %}
|
{% if task.area.pk == area.pk and task.visible and checkIsUserEx %}
|
||||||
<div style="display: none; background-color: rgba({{area.color.0}},{{area.color.1}},{{area.color.2}}, 1)" class="mb-2 pt-3 pb-1 view_1" id="ele_{{task.pk}}">
|
<div style="display: none; background-color: rgba({{area.color.0}},{{area.color.1}},{{area.color.2}}, 1)" class="mb-2 pt-3 pb-1 view_1" id="ele_{{task.pk}}">
|
||||||
<span ><h6 ><a style=" color: #FFFFFF;"href="{% url 'standard-task' task.pk %}"><span class="arrows_area_{{area.pk}} ml-4" style="display:none; float: left;"><i class="fas fa-sort"></i></span>{{task.name}}</a></h6></span>
|
<span ><h6 ><a style=" color: #FFFFFF;"href="{% url 'standard-task' task.pk %}"><span class="arrows_area_{{area.pk}} ml-4" style="display:none; float: left;"><i class="fas fa-sort"></i></span>{{task.name}}</a></h6></span>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% isUserInRep task area request.user as checkIsUserRep %}
|
{% isUserInRep task area user_id as checkIsUserRep %}
|
||||||
{% if task.area.pk == area.pk and task.visible and checkIsUserRep %}
|
{% if task.area.pk == area.pk and task.visible and checkIsUserRep %}
|
||||||
<div style="display: none; background-color: rgba({{area.color.0}},{{area.color.1}},{{area.color.2}}, 1)" class="mb-2 pt-3 pb-1 view_2" id="ele_{{task.pk}}">
|
<div style="display: none; background-color: rgba({{area.color.0}},{{area.color.1}},{{area.color.2}}, 1)" class="mb-2 pt-3 pb-1 view_2" id="ele_{{task.pk}}">
|
||||||
<span ><h6 ><a style=" color: #FFFFFF;"href="{% url 'standard-task' task.pk %}"><span class="arrows_area_{{area.pk}} ml-4" style="display:none; float: left;"><i class="fas fa-sort"></i></span>{{task.name}}</a></h6></span>
|
<span ><h6 ><a style=" color: #FFFFFF;"href="{% url 'standard-task' task.pk %}"><span class="arrows_area_{{area.pk}} ml-4" style="display:none; float: left;"><i class="fas fa-sort"></i></span>{{task.name}}</a></h6></span>
|
||||||
|
|
@ -204,7 +204,8 @@ $( document ).ready(function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$(document).find(".view_0").show();
|
$(document).find(".view_1").show();
|
||||||
|
$(document).find("#view_info_1").show();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -218,44 +218,46 @@ def getifuserdidcomment(standard, user):
|
||||||
|
|
||||||
|
|
||||||
@register.simple_tag
|
@register.simple_tag
|
||||||
def isUserInAuth(task, area, user):
|
def isUserInAuth(task, area, user_id):
|
||||||
st_auth = Standards.objects.filter(agency=user.profile.agency, task=task, area=area)
|
|
||||||
|
|
||||||
|
user = User.objects.get(pk=user_id)
|
||||||
|
|
||||||
|
#st_auth = Standards.objects.filter(agency=user.profile.agency, task=task, area=area)
|
||||||
|
st_auth = Standards.objects.filter(agency=user.profile.agency, task=task, area=area, authority__in=[user])
|
||||||
found = False
|
found = False
|
||||||
|
|
||||||
for st in st_auth:
|
if len(st_auth) > 0:
|
||||||
if user in st.authority.all():
|
found = True
|
||||||
found = True
|
|
||||||
print("AUTH FOUND")
|
|
||||||
break
|
|
||||||
|
|
||||||
return found
|
return found
|
||||||
|
|
||||||
@register.simple_tag
|
@register.simple_tag
|
||||||
def isUserInEx(task, area, user):
|
def isUserInEx(task, area, user_id):
|
||||||
st_auth = Standards.objects.filter(agency=user.profile.agency, task=task, area=area)
|
|
||||||
|
user = User.objects.get(pk=user_id)
|
||||||
|
|
||||||
|
|
||||||
|
#st_auth = Standards.objects.filter(agency=user.profile.agency, task=task, area=area)
|
||||||
|
st_auth = Standards.objects.filter(agency=user.profile.agency, task=task, area=area, executor__in=[user])
|
||||||
|
|
||||||
found = False
|
found = False
|
||||||
|
|
||||||
for st in st_auth:
|
if len(st_auth) > 0:
|
||||||
if user in st.executor.all():
|
found = True
|
||||||
found = True
|
|
||||||
print("EX FOUND")
|
|
||||||
break
|
|
||||||
|
|
||||||
return found
|
return found
|
||||||
|
|
||||||
|
|
||||||
@register.simple_tag
|
@register.simple_tag
|
||||||
def isUserInRep(task, area, user):
|
def isUserInRep(task, area, user_id):
|
||||||
st_auth = Standards.objects.filter(agency=user.profile.agency, task=task, area=area)
|
|
||||||
|
|
||||||
|
user = User.objects.get(pk=user_id)
|
||||||
|
|
||||||
|
#st_auth = Standards.objects.filter(agency=user.profile.agency, task=task, area=area)
|
||||||
|
st_auth = Standards.objects.filter(agency=user.profile.agency, task=task, area=area, representative__in=[user])
|
||||||
found = False
|
found = False
|
||||||
|
|
||||||
for st in st_auth:
|
if len(st_auth) > 0:
|
||||||
if user in st.representative.all():
|
found = True
|
||||||
found = True
|
|
||||||
print("REP FOUND")
|
|
||||||
break
|
|
||||||
|
|
||||||
return found
|
return found
|
||||||
Loading…
Reference in New Issue