WMDE
/
eva
forked from tohe/eva
7
1
Fork 0

offboardng process function reached

This commit is contained in:
Benni Bärmann 2021-11-10 14:29:42 +01:00
parent 86f30c8479
commit da8c744227
4 changed files with 37 additions and 7 deletions

View File

@ -0,0 +1,23 @@
# Generated by Django 3.1.4 on 2021-11-10 12:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('evapp', '0003_auto_20211110_0832'),
]
operations = [
migrations.AddField(
model_name='employee',
name='lastdate_employment',
field=models.DateField(null=True, verbose_name='Letzter Arbeitstag'),
),
migrations.AddField(
model_name='employee',
name='lastdate_presence',
field=models.DateField(null=True, verbose_name='Letzter Tag der Anwesenheit in der Geschäftsstelle'),
),
]

View File

@ -55,6 +55,8 @@ class Employee(models.Model):
# general work related stuff # general work related stuff
firstdate_employment = models.DateField(null=True, verbose_name="Erster Arbeitstag") firstdate_employment = models.DateField(null=True, verbose_name="Erster Arbeitstag")
firstdate_presence = models.DateField(null=True, verbose_name="Erster Tag der Anwesenheit in der Geschäftsstelle") firstdate_presence = models.DateField(null=True, verbose_name="Erster Tag der Anwesenheit in der Geschäftsstelle")
lastdate_employment= models.DateField(null=True, verbose_name="Letzter Arbeitstag")
lastdate_presence = models.DateField(null=True, verbose_name="Letzter Tag der Anwesenheit in der Geschäftsstelle")
jobdescription_german = models.CharField(null=True, max_length=100, verbose_name="Stellenbezeichnung(deutsch)") jobdescription_german = models.CharField(null=True, max_length=100, verbose_name="Stellenbezeichnung(deutsch)")
jobdescription_english = models.CharField(null=True, max_length=100, verbose_name="Job description(english)") jobdescription_english = models.CharField(null=True, max_length=100, verbose_name="Job description(english)")
works_in_gs = models.BooleanField(verbose_name='Braucht Arbeitsplatz in der Geschäftsstelle?', default=True) works_in_gs = models.BooleanField(verbose_name='Braucht Arbeitsplatz in der Geschäftsstelle?', default=True)

View File

@ -1,13 +1,13 @@
from django.urls import path from django.urls import path
from .views import EvaFormView, success, long_process, change_process from .views import EvaFormView, success, long_process, change_process, offboarding_process
urlpatterns = [ urlpatterns = [
path('', EvaFormView.as_view(condition_dict = {'1': long_process, path('', EvaFormView.as_view(condition_dict = {'1': long_process,
'2': long_process, '2': long_process,
'3': long_process, '3': long_process,
'4': change_process,}), '4': offboarding_process,}),
name='evaform'), name='evaform'),
path('success', success, name='success') path('success', success, name='success')
] ]

View File

@ -14,7 +14,7 @@ from django.contrib.auth.mixins import LoginRequiredMixin
from .models import Employee, DEPARTMENT_CHOICES, OS_CHOICES, VENDOR_CHOICES, \ from .models import Employee, DEPARTMENT_CHOICES, OS_CHOICES, VENDOR_CHOICES, \
LANG_CHOICES, ACCOUNT_CHOICES, TRANSPONDER_CHOICES, KEYBOARD_CHOICES LANG_CHOICES, ACCOUNT_CHOICES, TRANSPONDER_CHOICES, KEYBOARD_CHOICES
from .forms import PersonalForm, WorkingForm, ITForm, OfficeForm, DummyForm,\ from .forms import PersonalForm, WorkingForm, ITForm, OfficeForm, DummyForm,\
ChangeForm, TYPE_CHOICES ChangeForm, TYPE_CHOICES, OffboardingForm
from .settings import MAILS, EVA_MAIL, BASIC_DATA, ONLY_ONBOARDING from .settings import MAILS, EVA_MAIL, BASIC_DATA, ONLY_ONBOARDING
def success(request): def success(request):
@ -31,13 +31,18 @@ def long_process(wizard):
print(data) print(data)
if data.get('choice') != 'CHANGE': if data.get('choice') != 'CHANGE':
wizard.set_choice('IN') wizard.set_choice('IN')
print('PROZESS IN') #print('PROZESS IN')
return True return True
else: else:
wizard.set_choice('CHANGE') wizard.set_choice('CHANGE')
print('PROZESS NOT IN') #print('PROZESS NOT IN')
return False return False
def offboarding_process(wizard):
''' this method is called via urls.py to determine if the form is part of the change process'''
print('OFFBOARDING PROZESS')
return not long_process(wizard)
def change_process(wizard): def change_process(wizard):
''' this method is called via urls.py to determine if the form is part of the change process''' ''' this method is called via urls.py to determine if the form is part of the change process'''
print('CHANGE PROZESS') print('CHANGE PROZESS')
@ -46,7 +51,7 @@ def change_process(wizard):
class EvaFormView(LoginRequiredMixin, CookieWizardView): class EvaFormView(LoginRequiredMixin, CookieWizardView):
template_name = 'evapp/employee_form.html' template_name = 'evapp/employee_form.html'
form_list = [PersonalForm, WorkingForm, ITForm, OfficeForm, ChangeForm, DummyForm] form_list = [PersonalForm, WorkingForm, ITForm, OfficeForm, OffboardingForm, DummyForm]
instance = None instance = None
choice = 'IN' choice = 'IN'