@@ -597,9 +719,122 @@ if ( isIE ) {
checkUserVerant();
checkUserEx();
checkUserVer();
+ checkGroupVerant();
+ checkGroupEx();
+ checkGroupVer();
});
},400);
}
+//Groups to Standards
+//VERANTWORTLICHER
+act_verant_group = [];
+{% if update == True %}
+ act_verant_group = [
+ {% for auth in standard.authority_group.all %}
+ '{{auth.pk}}',
+ {% endfor %}
+ ];
+ $("#id_group_verant").val(act_verant_group);
+{% endif %}
+function checkGroupVerant(){
+ var g = $('#searchgroup_verant').val();
+ var id = $('#possgroup_verant').find('option[value="' + g + '"]').attr('id');
+
+ if(id != undefined && id.length > 0){
+ tempid = id.split("_")[0];
+ clearGroupSearchFields("verant");
+ $("#added_group_verant_buttons").append('
'+g+' ');
+ $("#" + tempid + "_verant_group").remove();
+ act_verant_group.push(tempid);
+ $("#id_group_verant").val(act_verant_group);
+ }
+
+ console.log($("#id_group_verant").val());
+}
+
+function removeGroupFromVeran(id, name){
+ index_to_rem = act_verant_group.indexOf(id.toString());
+ act_verant_group.splice(index_to_rem,1);
+ $('#possgroup_verant').append('
'+ name +' ');
+ $("#id_group_verant").val(act_verant_group);
+ $("#span_btn_verant_group_" + id).remove();
+
+ console.log($("#id_group_verant").val());
+}
+
+//AUSFÜHRENDER
+act_ex_group = [];
+{% if update == True %}
+ act_ex_group = [
+ {% for auth in standard.executor_group.all %}
+ '{{auth.pk}}',
+ {% endfor %}
+ ];
+ $("#id_group_ex").val(act_ex_group);
+{% endif %}
+function checkGroupEx(){
+ var g = $('#searchgroup_ex').val();
+ var id = $('#possgroup_ex').find('option[value="' + g + '"]').attr('id');
+
+ if(id != undefined && id.length > 0){
+ tempid = id.split("_")[0];
+ clearGroupSearchFields("ex");
+ $("#added_group_ex_buttons").append('
'+g+' ');
+ $("#" + tempid + "_ex_group").remove();
+ act_ex_group.push(tempid);
+ $("#id_group_ex").val(act_ex_group);
+ }
+
+ console.log($("#id_group_ex").val());
+}
+
+function removeGroupFromEx(id, name){
+ index_to_rem = act_ex_group.indexOf(id.toString());
+ act_ex_group.splice(index_to_rem,1);
+ $('#possgroup_ex').append('
'+ name +' ');
+ $("#id_group_ex").val(act_ex_group);
+ $("#span_btn_ex_group_" + id).remove();
+
+ console.log($("#id_group_ex").val());
+}
+
+//VERTRETER
+act_ver_group = [];
+{% if update == True %}
+ act_ver_group = [
+ {% for auth in standard.representative_group.all %}
+ '{{auth.pk}}',
+ {% endfor %}
+ ];
+ $("#id_group_ver").val(act_ver_group);
+{% endif %}
+function checkGroupVer(){
+ var g = $('#searchgroup_ver').val();
+ var id = $('#possgroup_ver').find('option[value="' + g + '"]').attr('id');
+
+
+
+ if(id != undefined && id.length > 0){
+ tempid = id.split("_")[0];
+ clearGroupSearchFields("ver");
+ $("#added_group_ver_buttons").append('
'+g+' ');
+ $("#" + tempid + "_ver_group").remove();
+ act_ver_group.push(tempid);
+ $("#id_group_ver").val(act_ver_group);
+ }
+
+ console.log($("#id_group_ver").val());
+}
+
+function removeGroupFromVer(id, name){
+ indver_to_rem = act_ver_group.indexOf(id.toString());
+ act_ver_group.splice(indver_to_rem,1);
+ $('#possgroup_ver').append('
'+ name +' ');
+ $("#id_group_ver").val(act_ver_group);
+ $("#span_btn_ver_group_" + id).remove();
+
+ console.log($("#id_group_ver").val());
+}
//USERSTOSTANDARDS
//Verantwortlicher
@@ -677,6 +912,7 @@ act_ver = [];
];
$("#id_us_ver").val(act_ver);
{% endif %}
+
function checkUserVer(){
var g = $('#searchuser_ver').val();
var id = $('#possusers_ver').find('option[value="' + g + '"]').attr('id');
@@ -704,10 +940,19 @@ function clearUserSearchFields(opt){
$("#searchuser_" + opt).val("");
}
+//Clear user search fields
+function clearGroupSearchFields(opt){
+ $("#searchgroup_" + opt).val("");
+}
+
function changeAddedUsers(){
$("#addUsersToStandard").modal("toggle");
}
+function changeAddedGroups(){
+ $("#addGroupsToStandard").modal("toggle");
+}
+
/*
Functions to control the dynamic element fields:
diff --git a/standards/templates/standards/standards_single.html b/standards/templates/standards/standards_single.html
index 2618a36..cbc71ce 100644
--- a/standards/templates/standards/standards_single.html
+++ b/standards/templates/standards/standards_single.html
@@ -24,7 +24,7 @@
- {% if standard.addedfiles.all|length > 0 or standard.linked_standards.all|length > 0 or standard.authority.count > 0 or standard.executor.count > 0 or standard.representative.count > 0 or standard.addedfiles.all|length > 0 or standard.linked_standards.all|length > 0 or standard.freefield_title|length > 0 or standard.addedcontacts.all|length > 0 or standard.addedpasswords.all|length > 0 or standard.addedquicklinks.all|length > 0 %}
+ {% if standard.addedfiles.all|length > 0 or standard.linked_standards.all|length > 0 or standard.authority.count > 0 or standard.executor.count > 0 or standard.representative.count > 0 or standard.addedfiles.all|length > 0 or standard.linked_standards.all|length > 0 or standard.freefield_title|length > 0 or standard.addedcontacts.all|length > 0 or standard.addedpasswords.all|length > 0 or standard.addedquicklinks.all|length > 0 or standard.authority_group.count > 0 or standard.executor_group.count > 0 or standard.representative_group.count > 0 %}
{% else %}
@@ -39,7 +39,7 @@
- {% if standard.addedfiles.all|length > 0 or standard.linked_standards.all|length > 0 or standard.authority.count > 0 or standard.executor.count > 0 or standard.representative.count > 0 or standard.addedfiles.all|length > 0 or standard.linked_standards.all|length > 0 or standard.freefield_title|length > 0 or standard.addedcontacts.all|length > 0 or standard.addedpasswords.all|length > 0 or standard.addedquicklinks.all|length > 0 %}
+ {% if standard.addedfiles.all|length > 0 or standard.linked_standards.all|length > 0 or standard.authority.count > 0 or standard.executor.count > 0 or standard.representative.count > 0 or standard.addedfiles.all|length > 0 or standard.linked_standards.all|length > 0 or standard.freefield_title|length > 0 or standard.addedcontacts.all|length > 0 or standard.addedpasswords.all|length > 0 or standard.addedquicklinks.all|length > 0 or standard.authority_group.count > 0 or standard.executor_group.count > 0 or standard.representative_group.count > 0 %}
@@ -85,17 +85,47 @@
{% endfor %}
{% endif %}
-
-
-
-
-
{% endif %}
+ {% if standard.authority_group.count > 0 or standard.executor_group.count > 0 or standard.representative_group.count > 0 %}
+
+
+
Gruppen
+
+
+ {% if standard.executor_group.count > 0 %}
+ Ausführende
+ {% for g in standard.executor_group.all %}
+ {{g.agencygroupname}} {% if forloop.counter < standard.executor_group.count%} | {% endif %}
+ {% endfor %}
+
+ {% endif %}
+
+ {% if standard.representative_group.count > 0 %}
+ Vertretende
+ {% for g in standard.representative_group.all %}
+ {{g.agencygroupname}} {% if forloop.counter < standard.representative_group.count%} | {% endif %}
+ {% endfor %}
+
+ {% endif %}
+
+
+ {% if standard.authority_group.count > 0 %}
+ Verantwortliche
+ {% for g in standard.authority_group.all %}
+ {{g.agencygroupname}} {% if forloop.counter < standard.authority_group.count%} | {% endif %}
+ {% endfor %}
+
+ {% endif %}
+
+
+
+ {% endif %}
+
{% if standard.addedfiles.all|length > 0 %}
diff --git a/standards/views.py b/standards/views.py
index 1e6a2bb..61cfb0f 100644
--- a/standards/views.py
+++ b/standards/views.py
@@ -147,6 +147,7 @@ def StandardAdd(request, id=False):
#new_standard.executor.set(normalForm.cleaned_data['executor'])
#new_standard.authority.set(normalForm.cleaned_data['authority'])
+ # USERS
# REPRESENTATIV
verant = normalForm.cleaned_data['us_verant'].split(",")
for v in verant:
@@ -165,6 +166,30 @@ def StandardAdd(request, id=False):
if(v.isdigit()):
new_standard.representative.add(User.objects.get(pk=v))
+
+
+ # GROUPS BEI PERSONEN
+ #
+ verant_group = normalForm.cleaned_data['group_verant'].split(",")
+ for v in verant_group:
+ if(v.isdigit()):
+ new_standard.authority_group.add(AgencyGroup.objects.get(pk=v))
+
+ # EXECUTORS
+ ex_group = normalForm.cleaned_data['group_ex'].split(",")
+ for v in ex_group:
+ if(v.isdigit()):
+ new_standard.executor_group.add(AgencyGroup.objects.get(pk=v))
+
+ # AUTHORITY
+ ver_group = normalForm.cleaned_data['group_ver'].split(",")
+ for v in ver_group:
+ if(v.isdigit()):
+ new_standard.representative_group.add(AgencyGroup.objects.get(pk=v))
+
+
+
+
# ADD GROUPS
groups = normalForm.cleaned_data['checked_groups'].split(",")
@@ -241,6 +266,7 @@ def StandardAdd(request, id=False):
'quicklinks' : QuickLinks.objects.filter(agency=request.user.profile.agency),
'contacts' : AGContacts.objects.filter(agency=request.user.profile.agency),
'passwords' : AGPassword.objects.filter(agency=request.user.profile.agency),
+ 'aggroups' : AgencyGroup.objects.filter(agency=request.user.profile.agency),
}
return render(request, 'standards/standards_add.html', context)
# UPDATE A STANDARD
@@ -266,6 +292,12 @@ def StandardAdd(request, id=False):
standard.authority.clear()
standard.executor.clear()
standard.representative.clear()
+
+ # GROUPS
+ standard.authority_group.clear()
+ standard.executor_group.clear()
+ standard.representative_group.clear()
+
standard.visibleby.clear()
standard.linked_standards.clear()
standard.addedfiles.clear()
@@ -292,6 +324,24 @@ def StandardAdd(request, id=False):
if(v.isdigit()):
standard.representative.add(User.objects.get(pk=v))
+
+ verant_group = normalForm.cleaned_data['group_verant'].split(",")
+ for v in verant_group:
+ if(v.isdigit()):
+ standard.authority_group.add(AgencyGroup.objects.get(pk=v))
+
+ # EXECUTORS
+ ex_group = normalForm.cleaned_data['group_ex'].split(",")
+ for v in ex_group:
+ if(v.isdigit()):
+ standard.executor_group.add(AgencyGroup.objects.get(pk=v))
+
+ # AUTHORITY
+ ver_group = normalForm.cleaned_data['group_ver'].split(",")
+ for v in ver_group:
+ if(v.isdigit()):
+ standard.representative_group.add(AgencyGroup.objects.get(pk=v))
+
# ADD GROUPS
groups = normalForm.cleaned_data['checked_groups'].split(",")
@@ -482,6 +532,31 @@ def StandardAdd(request, id=False):
if pv not in standard.representative.all():
possible_ver_final.append(pv)
+
+ # GROUPS VER AUTH EX
+ #possible_verant_group_final
+ #possible_ex_group_final
+ #possible_ver_group_final
+ possible_verant_group = AgencyGroup.objects.filter(agency=request.user.profile.agency)
+ possible_verant_group_final = []
+ for g in possible_verant_group:
+ if g not in standard.authority_group.all():
+ possible_verant_group_final.append(g)
+
+ possible_ex_group = AgencyGroup.objects.filter(agency=request.user.profile.agency)
+ possible_ex_group_final = []
+ for g in possible_ex_group:
+ if g not in standard.executor_group.all():
+ possible_ex_group_final.append(g)
+
+ possible_ver_group = AgencyGroup.objects.filter(agency=request.user.profile.agency)
+ possible_ver_group_final = []
+ for g in possible_ver_group:
+ if g not in standard.representative_group.all():
+ possible_ver_group_final.append(g)
+
+
+
# QUICKLINKS
possible_quicklinks = []
quicklinks = QuickLinks.objects.filter(agency=request.user.profile.agency)
@@ -527,6 +602,9 @@ def StandardAdd(request, id=False):
'poss_verant' : possible_verant_final,
'poss_ex' : possible_ex_final,
'poss_ver' : possible_ver_final,
+ 'possgroup_verant' : possible_verant_group_final,
+ 'possgroup_ex' : possible_ex_group_final,
+ 'possgroup_ver' : possible_ver_group_final,
'possible_quicklinks' : possible_quicklinks,
'possible_passwords' : possible_passwords,
'possible_contacts' : possible_contacts,
@@ -534,7 +612,8 @@ def StandardAdd(request, id=False):
'agencygroups' : AgencyGroup.objects.filter(agency=request.user.profile.agency),
'parentid' : list(DataDir.objects.filter(agency=request.user.profile.agency, is_root=True))[0].pk,
'active_link' : 'standards',
- 'update' : True
+ 'update' : True,
+ 'aggroups' : AgencyGroup.objects.filter(agency=request.user.profile.agency)
}
return render(request, 'standards/standards_add.html', context)
diff --git a/users/templates/users/landingpage.html b/users/templates/users/landingpage.html
index 6398a77..b9bfdcf 100644
--- a/users/templates/users/landingpage.html
+++ b/users/templates/users/landingpage.html
@@ -25,6 +25,7 @@
margin-top: 20px;
}
+
@@ -44,17 +45,8 @@
Registrieren
+
-
Kombi-Paket
-
-
- Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
-
- Registrieren & Bestellen
-
-
-
-
Notfallhilfe
@@ -64,6 +56,15 @@
+
+
+
Kombi-Paket
+
+
+ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
+
+
+