offboardng process function reached
This commit is contained in:
parent
86f30c8479
commit
da8c744227
|
@ -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'),
|
||||
),
|
||||
]
|
|
@ -55,6 +55,8 @@ class Employee(models.Model):
|
|||
# general work related stuff
|
||||
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")
|
||||
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_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)
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
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 = [
|
||||
path('', EvaFormView.as_view(condition_dict = {'1': long_process,
|
||||
'2': long_process,
|
||||
'3': long_process,
|
||||
|
||||
'4': change_process,}),
|
||||
|
||||
'4': offboarding_process,}),
|
||||
name='evaform'),
|
||||
path('success', success, name='success')
|
||||
]
|
||||
|
|
|
@ -14,7 +14,7 @@ from django.contrib.auth.mixins import LoginRequiredMixin
|
|||
from .models import Employee, DEPARTMENT_CHOICES, OS_CHOICES, VENDOR_CHOICES, \
|
||||
LANG_CHOICES, ACCOUNT_CHOICES, TRANSPONDER_CHOICES, KEYBOARD_CHOICES
|
||||
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
|
||||
|
||||
def success(request):
|
||||
|
@ -31,13 +31,18 @@ def long_process(wizard):
|
|||
print(data)
|
||||
if data.get('choice') != 'CHANGE':
|
||||
wizard.set_choice('IN')
|
||||
print('PROZESS IN')
|
||||
#print('PROZESS IN')
|
||||
return True
|
||||
else:
|
||||
wizard.set_choice('CHANGE')
|
||||
print('PROZESS NOT IN')
|
||||
#print('PROZESS NOT IN')
|
||||
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):
|
||||
''' this method is called via urls.py to determine if the form is part of the change process'''
|
||||
print('CHANGE PROZESS')
|
||||
|
@ -46,7 +51,7 @@ def change_process(wizard):
|
|||
|
||||
class EvaFormView(LoginRequiredMixin, CookieWizardView):
|
||||
template_name = 'evapp/employee_form.html'
|
||||
form_list = [PersonalForm, WorkingForm, ITForm, OfficeForm, ChangeForm, DummyForm]
|
||||
form_list = [PersonalForm, WorkingForm, ITForm, OfficeForm, OffboardingForm, DummyForm]
|
||||
instance = None
|
||||
choice = 'IN'
|
||||
|
||||
|
|
Loading…
Reference in New Issue