Standards und Gruppen sowie neue LP und Abrechnung mit Notfallhilfenoption
This commit is contained in:
parent
bc2f7844d6
commit
e922c8e192
|
|
@ -76,8 +76,11 @@ class AgencyBillPlan(forms.ModelForm):
|
|||
self.fields['plz'] = forms.CharField(required=True, label="PLZ")
|
||||
self.fields['city'] = forms.CharField(required=True, label="Stadt")
|
||||
|
||||
self.fields['vve'] = forms.CharField(required=True, label="VVE-Mitgliedsnummer - Ihre Mitgliedsnummer entnehmen Sie bitte der Teilnahmebestätigung zur VVE-Jahrestagung.")
|
||||
|
||||
self.fields['agb'] = forms.BooleanField(required=True, label="AGB's akzeptieren")
|
||||
self.fields['contract'] = forms.BooleanField(required=True, label="AV-Vertrag akzeptieren")
|
||||
self.fields['recoverdir'] = forms.BooleanField(required=False, label="Notfallhilfe für 15,00 € bestellen. Sie erhalten eine separate E-Mail vom VVE.")
|
||||
|
||||
|
||||
class AgencyEndBillPlan(forms.ModelForm):
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
<h5>Agenturdaten überprüfen</h5>
|
||||
<hr>
|
||||
{% for formfield in form %}
|
||||
{% if formfield.name != 'agb' and formfield.name != 'contract' %}
|
||||
{% if formfield.name != 'agb' and formfield.name != 'contract' and formfield.name != 'recoverdir' %}
|
||||
{{formfield|as_crispy_field}}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
|
@ -34,13 +34,14 @@
|
|||
<hr>
|
||||
{{form.contract|as_crispy_field}}
|
||||
{{form.agb|as_crispy_field}}
|
||||
{{form.recoverdir|as_crispy_field}}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
<div class="col-8">
|
||||
<a class="btn" href="{% url 'dasettings' %}">Abbrechen</a>
|
||||
<button type="submit" class="btn btn-primary" style="float: right">Jetzt kostenpflichtig bestellen</button>
|
||||
<button type="submit" class="btn btn-primary" style="float: right" id="finalsubmitbutton">Jetzt kostenpflichtig bestellen</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
@ -56,6 +57,17 @@ $(document).ready(function(){
|
|||
})
|
||||
|
||||
|
||||
$( "#id_recoverdir" ).click(function() {
|
||||
console.log($("#id_recoverdir"));
|
||||
if($("#id_recoverdir").prop('checked') == true){
|
||||
$("#finalsubmitbutton").html("Jetzt kostenpflichtig für zzgl. 15 € einmalige Zahlung bestellen")
|
||||
}
|
||||
else{
|
||||
$("#finalsubmitbutton").html("Jetzt kostenpflichtig bestellen")
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function updatePlan(newPlan){
|
||||
new_bill = (monthlybill * newPlan).toFixed(2);
|
||||
monthlybill_str_new = "" + new_bill;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from django.contrib.auth.forms import PasswordChangeForm
|
|||
from users.usersforms import AgencyUpdateForm
|
||||
from users.models import AgencyJob, AgencyGroup, AgencyNetwork, Agency, AgencyNetworkPreperation, UserYearAbsenceInfo
|
||||
from django.contrib.auth.models import User, Group, Permission
|
||||
from users.models import UserTime
|
||||
from users.models import UserTime, RegNotfallhilfe
|
||||
import random
|
||||
import string
|
||||
from django.template.loader import render_to_string
|
||||
|
|
@ -1581,6 +1581,20 @@ class BillPlanUpdate(UpdateView):
|
|||
agency = self.request.user.profile.agency
|
||||
month = agency.registerdate
|
||||
|
||||
# Notfallhilfe soll mitbestellt werden
|
||||
if form.cleaned_data.get("recoverdir") == True:
|
||||
rd = RegNotfallhilfe()
|
||||
rd.mail = form.cleaned_data.get('agency_email')
|
||||
rd.name = form.cleaned_data.get('inhaber')
|
||||
rd.persnumber = "n.v."
|
||||
rd.mitgliedsnummer = form.cleaned_data.get("vve")
|
||||
rd.plz = form.cleaned_data.get("plz")
|
||||
rd.stadt = form.cleaned_data.get("city")
|
||||
rd.street = form.cleaned_data.get("street")
|
||||
rd.data_to_vh = True
|
||||
rd.rabatt = True
|
||||
rd.save()
|
||||
|
||||
# Wenn die Agentur noch KEINE Lexoffice-ID hat, dann ist der Freimonat noch nicht durch.
|
||||
if agency.lexofficeid == "":
|
||||
month = month + relativedelta(months=1)
|
||||
|
|
|
|||
|
|
@ -69,10 +69,17 @@ class StandardAddStandard(forms.ModelForm):
|
|||
self.fields['added_contacts'] = forms.CharField(initial="", required=False, widget=forms.HiddenInput())
|
||||
self.fields['added_passwords'] = forms.CharField(initial="", required=False, widget=forms.HiddenInput())
|
||||
|
||||
#USERS
|
||||
self.fields['us_verant'] = forms.CharField(initial="", required=False, widget=forms.HiddenInput())
|
||||
self.fields['us_ex'] = forms.CharField(initial="", required=False, widget=forms.HiddenInput())
|
||||
self.fields['us_ver'] = forms.CharField(initial="", required=False, widget=forms.HiddenInput())
|
||||
|
||||
#GROUPS
|
||||
self.fields['group_verant'] = forms.CharField(initial="", required=False, widget=forms.HiddenInput())
|
||||
self.fields['group_ex'] = forms.CharField(initial="", required=False, widget=forms.HiddenInput())
|
||||
self.fields['group_ver'] = forms.CharField(initial="", required=False, widget=forms.HiddenInput())
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -158,6 +165,11 @@ class StandardUpdateStandard(forms.ModelForm):
|
|||
self.fields['us_ex'] = forms.CharField(initial="", required=False, widget=forms.HiddenInput())
|
||||
self.fields['us_ver'] = forms.CharField(initial="", required=False, widget=forms.HiddenInput())
|
||||
|
||||
#GROUPS
|
||||
self.fields['group_verant'] = forms.CharField(initial="", required=False, widget=forms.HiddenInput())
|
||||
self.fields['group_ex'] = forms.CharField(initial="", required=False, widget=forms.HiddenInput())
|
||||
self.fields['group_ver'] = forms.CharField(initial="", required=False, widget=forms.HiddenInput())
|
||||
|
||||
self.fields['checked_networks'] = forms.CharField(initial="", required=False, widget=forms.HiddenInput())
|
||||
|
||||
self.fields['public'] = forms.BooleanField(initial=standard.public, required=False)
|
||||
|
|
|
|||
|
|
@ -59,6 +59,11 @@ class Standards(models.Model):
|
|||
#authority = models.ForeignKey(User, on_delete=models.PROTECT, related_name="user_authority", blank=True, null=True)
|
||||
authority = models.ManyToManyField(User, blank=True, related_name='user_aut')
|
||||
|
||||
# GRUPPEN
|
||||
representative_group = models.ManyToManyField(AgencyGroup, blank=True, related_name="group_rep")
|
||||
executor_group = models.ManyToManyField(AgencyGroup, blank=True, related_name="group_ex")
|
||||
authority_group = models.ManyToManyField(AgencyGroup, blank=True, related_name="group_aut")
|
||||
|
||||
# FILES
|
||||
addedfiles = models.ManyToManyField(DataFile, blank=True)
|
||||
# VERLINKTE STANDARDS
|
||||
|
|
|
|||
|
|
@ -53,17 +53,18 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card">
|
||||
<div class="card-header" id="st_useraut">
|
||||
<h5 class="mb-0">
|
||||
<button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#useraut_content" aria-expanded="false" aria-controls="useraut_content">
|
||||
<i class="fas fa-user"></i> Mitarbeiterzuweisung{% if request.user.profile.showtooltips %} <small><i data-toggle="tooltip" data-placement="top" title="Weisen Sie dem Standard verantwortliche, ausführende und vertretende Mitarbeiter zu." class="far fa-question-circle"></i></small>{% endif %}
|
||||
<i class="fas fa-user"></i> Mitarbeiter und Gruppen{% if request.user.profile.showtooltips %} <small><i data-toggle="tooltip" data-placement="top" title="Weisen Sie dem Standard verantwortliche, ausführende und vertretende Mitarbeiter oder Gruppen zu." class="far fa-question-circle"></i></small>{% endif %}
|
||||
</button>
|
||||
</h5>
|
||||
</div>
|
||||
<div id="useraut_content" class="collapse" aria-labelledby="st_useraut" data-parent="#additionalStandardInfos">
|
||||
<div class="card-body">
|
||||
<button type="button" class="btn btn-primary mb-2" onclick="javascript:changeAddedUsers()">Mitarbeiter zuweisen</button>
|
||||
<button type="button" class="btn btn-primary mb-2" onclick="javascript:changeAddedUsers()">Mitarbeiter zuweisen</button><br />
|
||||
<button type="button" class="btn btn-primary mb-2" onclick="javascript:changeAddedGroups()">Gruppen zuweisen</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -404,6 +405,127 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Add GRUPPEN to Standard -->
|
||||
<div class="modal fade" id="addGroupsToStandard" tabindex="-1" data-backdrop="static" aria-labelledby="" aria-hidden="true">
|
||||
<div class="modal-dialog " role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLongTitle">Gruppen zuweisen</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Schließen">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<!--
|
||||
Verantwortlicher
|
||||
Ausführender
|
||||
Vertreter
|
||||
-->
|
||||
<h6>Verantwortliche:</h6>
|
||||
<div class="input-group mb-3">
|
||||
<input class="form-control searchuserfieldstask" list="possgroup_verant" id="searchgroup_verant" type="text" onkeyup="javascript:checkGroupVerant()" >
|
||||
<div class="input-group-append">
|
||||
<button type="button" onclick="javascript:clearGroupSearchFields('verant')" class="btn btn-secondary" ><i class="fas fa-times"></i></button>
|
||||
</div>
|
||||
<datalist id="possgroup_verant">
|
||||
{% if update == True %}
|
||||
{% for ag in possgroup_verant %}
|
||||
<option id="{{ag.pk}}_verant_group" value="{{ag.agencygroupname}}"></option>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{% for ag in aggroups %}
|
||||
<option id="{{ag.pk}}_verant_group" value="{{ag.agencygroupname}}"></option>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</datalist>
|
||||
</div>
|
||||
|
||||
<!--<h6>Verantwortliche Mitarbeiter:</h6>-->
|
||||
<div id="added_group_verant_buttons"></div>
|
||||
{% if update == True %}
|
||||
|
||||
{% for auth in standard.authority_group.all %}
|
||||
|
||||
<span id="span_btn_verant_group_{{auth.pk}}" class="badge badge-pill badge-primary mr-2 mt-2"><a class="btn btn-primary" onclick="javascript:removeGroupFromVeran({{auth.pk}}, '{{auth.agencygroupname}}')">{{auth.agencygroupname}} <i class="fas fa-times"></i></a ></span>
|
||||
|
||||
{% endfor %}
|
||||
|
||||
{% endif %}
|
||||
<hr>
|
||||
<!--
|
||||
Ausführender
|
||||
Vertreter
|
||||
-->
|
||||
<h6>Ausführende:</h6>
|
||||
<div class="input-group mb-3">
|
||||
<input class="form-control searchuserfieldstask" list="possgroup_ex" id="searchgroup_ex" type="text" onkeyup="javascript:checkGroupEx()" >
|
||||
<div class="input-group-append">
|
||||
<button type="button" onclick="javascript:clearGroupSearchFields('ex')" class="btn btn-secondary" ><i class="fas fa-times"></i></button>
|
||||
</div>
|
||||
<datalist id="possgroup_ex">
|
||||
{% if update == True %}
|
||||
{% for ag in possgroup_ex %}
|
||||
<option id="{{ag.pk}}_ex_group" value="{{ag.agencygroupname}}"></option>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{% for ag in aggroups %}
|
||||
<option id="{{ag.pk}}_ex_group" value="{{ag.agencygroupname}}"></option>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</datalist>
|
||||
</div>
|
||||
|
||||
<!--<h6>Ausführende Mitarbeiter:</h6>-->
|
||||
<div id="added_group_ex_buttons"></div>
|
||||
{% if update == True %}
|
||||
{% for auth in standard.executor_group.all %}
|
||||
<span id="span_btn_ex_group_{{auth.pk}}" class="badge badge-pill badge-primary mr-2 mt-2"><a class="btn btn-primary" onclick="javascript:removeGroupFromEx({{auth.pk}}, '{{auth.agencygroupname}}')">{{auth.agencygroupname}} <i class="fas fa-times"></i></a ></span>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
<hr>
|
||||
<!--
|
||||
Vertreter
|
||||
-->
|
||||
<h6>Vertretende:</h6>
|
||||
<div class="input-group mb-3">
|
||||
<input class="form-control searchuserfieldstask" list="possgroup_ver" id="searchgroup_ver" type="text" onkeyup="javascript:checkGroupVer()" >
|
||||
<div class="input-group-append">
|
||||
<button type="button" onclick="javascript:clearGroupSearchFields('ver')" class="btn btn-secondary" ><i class="fas fa-times"></i></button>
|
||||
</div>
|
||||
<datalist id="possgroup_ver">
|
||||
{% if update == True %}
|
||||
{% for ag in possgroup_ver %}
|
||||
<option id="{{ag.pk}}_ver_group" value="{{ag.agencygroupname}}"></option>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{% for ag in aggroups %}
|
||||
<option id="{{ag.pk}}_ver_group" value="{{ag.agencygroupname}}"></option>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</datalist>
|
||||
</div>
|
||||
|
||||
<!--<h6>Vertretende Mitarbeiter:</h6>-->
|
||||
<div id="added_group_ver_buttons"></div>
|
||||
{% if update == True %}
|
||||
{% for auth in standard.representative_group.all %}
|
||||
<span id="span_btn_ver_group_{{auth.pk}}" class="badge badge-pill badge-primary mr-2 mt-2"><a class="btn btn-primary" onclick="javascript:removeGroupFromVer({{auth.pk}}, '{{auth.agencygroupname}}')">{{auth.agencygroupname}} <i class="fas fa-times"></i></a ></span>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" data-dismiss="modal">Fertig</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- UPLOADING PROCESS -->
|
||||
<div class="modal fade" id="uploadModalProgress" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
|
|
@ -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('<span id="span_btn_verant_group_'+tempid+'" class="badge badge-pill badge-primary mr-2 mt-2"><a class="btn btn-primary" onclick="javascript:removeGroupFromVeran('+tempid+', \''+g+'\')">'+g+' <i class="fas fa-times"></i></a ></span>');
|
||||
$("#" + 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('<option id="'+id+'_verant_group" value="'+ name +'">'+ name +'</option>');
|
||||
$("#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('<span id="span_btn_ex_group_'+tempid+'" class="badge badge-pill badge-primary mr-2 mt-2"><a class="btn btn-primary" onclick="javascript:removeGroupFromEx('+tempid+', \''+g+'\')">'+g+' <i class="fas fa-times"></i></a ></span>');
|
||||
$("#" + 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('<option id="'+id+'_ex_group" value="'+ name +'">'+ name +'</option>');
|
||||
$("#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('<span id="span_btn_ver_group_'+tempid+'" class="badge badge-pill badge-primary mr-2 mt-2"><a class="btn btn-primary" onclick="javascript:removeGroupFromVer('+tempid+', \''+g+'\')">'+g+' <i class="fas fa-times"></i></a ></span>');
|
||||
$("#" + 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('<option id="'+id+'_ver_group" value="'+ name +'">'+ name +'</option>');
|
||||
$("#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:
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
<hr>
|
||||
<div class="row col">
|
||||
|
||||
{% 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 %}
|
||||
<div class="card col-9" style="min-height: 500px">
|
||||
{% else %}
|
||||
<div class="card col-12" style="min-height: 500px">
|
||||
|
|
@ -39,7 +39,7 @@
|
|||
</div>
|
||||
|
||||
<!-- PERSONEN -->
|
||||
{% 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 %}
|
||||
<div class="col-3">
|
||||
|
||||
|
||||
|
|
@ -85,17 +85,47 @@
|
|||
{% endfor %}
|
||||
<br />
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% if standard.authority_group.count > 0 or standard.executor_group.count > 0 or standard.representative_group.count > 0 %}
|
||||
<div class="card col-14 ml-1 mb-2" style="min-width: 110%">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Gruppen</h5>
|
||||
<p class="card-text">
|
||||
|
||||
{% if standard.executor_group.count > 0 %}
|
||||
Ausführende<br />
|
||||
{% for g in standard.executor_group.all %}
|
||||
<span style="color: red">{{g.agencygroupname}}</span>{% if forloop.counter < standard.executor_group.count%} | {% endif %}
|
||||
{% endfor %}
|
||||
<br />
|
||||
{% endif %}
|
||||
|
||||
{% if standard.representative_group.count > 0 %}
|
||||
Vertretende<br />
|
||||
{% for g in standard.representative_group.all %}
|
||||
<span style="color: red">{{g.agencygroupname}}</span>{% if forloop.counter < standard.representative_group.count%} | {% endif %}
|
||||
{% endfor %}
|
||||
<br />
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% if standard.authority_group.count > 0 %}
|
||||
Verantwortliche<br />
|
||||
{% for g in standard.authority_group.all %}
|
||||
<span style="color: red">{{g.agencygroupname}}</span>{% if forloop.counter < standard.authority_group.count%} | {% endif %}
|
||||
{% endfor %}
|
||||
<br />
|
||||
{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
<!-- FILES -->
|
||||
{% if standard.addedfiles.all|length > 0 %}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
margin-top: 20px;
|
||||
}
|
||||
</style>
|
||||
<!-- TASK: Hier die Infos zu den Texten noch reinnehmen... -->
|
||||
<div class="card mx-auto" id="overview">
|
||||
<div class="card-body">
|
||||
<p>
|
||||
|
|
@ -44,17 +45,8 @@
|
|||
<a class="btn btn-primary btn-lg" href="{% url 'register' %}">Registrieren</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="col lp_div">
|
||||
<h1>Kombi-Paket</h1>
|
||||
<img src="{% static 'users/extra/kp.png' %}" class="lp_images">
|
||||
<p class="lp_text">
|
||||
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.
|
||||
<p class="lp_btnarea">
|
||||
<a class="btn btn-primary btn-lg" href="{% url 'register-rd' %}">Registrieren & Bestellen</a>
|
||||
</p>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col">
|
||||
<h1>Notfallhilfe</h1>
|
||||
<img src="{% static 'users/extra/nf.png' %}" class="lp_images">
|
||||
<p class="lp_text">
|
||||
|
|
@ -64,6 +56,15 @@
|
|||
</p>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="col ">
|
||||
<h1>Kombi-Paket</h1>
|
||||
<img src="{% static 'users/extra/kp.png' %}" class="lp_images">
|
||||
<p class="lp_text">
|
||||
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.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue