Bugs gefixed, Zeiterfassung vorbereitet

This commit is contained in:
Holger Trampe 2020-07-20 16:58:44 +02:00
parent e6c7eaf225
commit b63c458df4
32 changed files with 268 additions and 267 deletions

View File

@ -31,7 +31,7 @@ class UsersSelfChangeForm(forms.ModelForm):
email = forms.EmailField()
class Meta:
model = User
model = User
fields = ['email']
# Form für die Benachrichtigungseinstellungen
@ -45,7 +45,7 @@ class UsersNotificationForm(forms.ModelForm):
#"user_standard_public_mail" : "Veröffentlichung meiner Standards",
"agency_new_standard_mail" : "Neue Agentur-Standards",
'add_new_group_mail' : "Gruppenmitgliedschaften",
'add_task_mail' : "Tätigkeitsbereich",
'add_task_mail' : "Tätigkeitsbereich",
'user_messages_mail' : "Mitteilungen"
}
#fields = ['news_mail', 'news_push', 'user_standard_public_mail', 'user_standard_public_push', 'agency_new_standard_mail', 'agency_new_standard_push', 'add_new_group_mail', 'add_new_group_push', 'add_task_mail', 'add_task_push', 'user_messages_mail', 'user_messages_push']
@ -53,7 +53,7 @@ class UsersNotificationForm(forms.ModelForm):
'''
# Form für die Benachrichtigungseinstellungen STANDARDS
class UsersNotificationFormStandard(forms.ModelForm):
class Meta:
model = UserNotifications
labels = {
@ -61,9 +61,9 @@ class UsersNotificationFormStandard(forms.ModelForm):
"standard_update_mail" : "Standard verändert",
"standard_delete_mail" : "Standard gelöscht",
"standard_created_unpub_mail" : "Neuer, unveröffentlichter Standard"
}
fields = [
fields = [
'standard_created_mail',
'standard_created_push',
'standard_update_mail',
@ -71,87 +71,87 @@ class UsersNotificationFormStandard(forms.ModelForm):
'standard_delete_mail',
'standard_delete_push',
'standard_created_unpub_mail',
'standard_created_unpub_push',
'standard_created_unpub_push',
]
# Form für die Benachrichtigungseinstellungen NEWS
class UsersNotificationFormNews(forms.ModelForm):
class Meta:
model = UserNotifications
labels = {
"news_created_mail" : "Neuer Agenturnews",
"news_created_mail" : "Neuer Agenturnews",
}
fields = [
'news_created_mail',
'news_created_push',
fields = [
'news_created_mail',
'news_created_push',
]
# Form für die Benachrichtigungseinstellungen MESSAGES
class UsersNotificationFormMessages(forms.ModelForm):
class Meta:
model = UserNotifications
labels = {
"message_received_mail" : "Neuer Mitteilung",
"message_received_mail" : "Neuer Mitteilung",
}
fields = [
'message_received_mail',
'message_received_push',
fields = [
'message_received_mail',
'message_received_push',
]
# Form für die Benachrichtigungseinstellungen CHAT
class UsersNotificationFormChat(forms.ModelForm):
class Meta:
model = UserNotifications
labels = {
"chat_received_mail" : "Verpasste Chatnachrichten",
"chat_room_activity_mail" : "Raumaktivitäten",
"chat_received_mail" : "Verpasste Chatnachrichten",
"chat_room_activity_mail" : "Raumaktivitäten",
}
fields = [
'chat_received_mail',
fields = [
'chat_received_mail',
'chat_received_push',
'chat_room_activity_mail',
'chat_room_activity_push',
'chat_room_activity_mail',
'chat_room_activity_push',
]
# Form für die Benachrichtigungseinstellungen FILES
class UsersNotificationFormFiles(forms.ModelForm):
class Meta:
model = UserNotifications
labels = {
"filedir_created_mail" : "Datei/Ordner erstellt",
"filedir_update_mail" : "Datei/Ordner aktualisiert",
"filedir_delete_mail" : "Datei/Ordner gelöscht",
"filedir_created_mail" : "Datei/Ordner erstellt",
"filedir_update_mail" : "Datei/Ordner aktualisiert",
"filedir_delete_mail" : "Datei/Ordner gelöscht",
}
fields = [
'filedir_created_mail',
'filedir_created_push',
'filedir_update_mail',
'filedir_update_push',
'filedir_delete_mail',
'filedir_delete_push',
fields = [
'filedir_created_mail',
'filedir_created_push',
'filedir_update_mail',
'filedir_update_push',
'filedir_delete_mail',
'filedir_delete_push',
]
# Form für die Benachrichtigungseinstellungen ABSENCE AND TIME
class UsersNotificationFormAbTime(forms.ModelForm):
class Meta:
model = UserNotifications
labels = {
"absence_created_mail" : "Anfrage erstellt",
"absence_user_is_rep_mail" : "Als Vertreter eingesetzt",
"absence_user_is_rep_reminder_mail" : "Erinnerung für Vertretung",
"time_data_changed_mail" : "Abwesenheit bearbeitet",
"absence_created_mail" : "Anfrage erstellt",
"absence_user_is_rep_mail" : "Als Vertreter eingesetzt",
"absence_user_is_rep_reminder_mail" : "Erinnerung für Vertretung",
"time_data_changed_mail" : "Abwesenheit bearbeitet",
}
fields = [
fields = [
'absence_created_mail',
'absence_created_push',
'absence_user_is_rep_mail',
@ -164,51 +164,51 @@ class UsersNotificationFormAbTime(forms.ModelForm):
# Form für die Benachrichtigungseinstellungen GRUPPEN
class UsersNotificationFormGroups(forms.ModelForm):
class Meta:
model = UserNotifications
labels = {
"group_activity_mail" : "Mitgliedschaftsänderung",
"group_rights_mail" : "Rechteänderung",
"group_activity_mail" : "Mitgliedschaftsänderung",
"group_rights_mail" : "Rechteänderung",
}
fields = [
'group_activity_mail',
'group_activity_push',
'group_rights_mail',
fields = [
'group_activity_mail',
'group_activity_push',
'group_rights_mail',
'group_rights_push',
]
# Form für die Benachrichtigungseinstellungen Tätigkeitsbereiche
class UsersNotificationFormTasks(forms.ModelForm):
class Meta:
model = UserNotifications
labels = {
"task_activity_mail" : "Tätigkeiten",
"task_activity_mail" : "Tätigkeiten",
}
fields = [
'task_activity_mail',
fields = [
'task_activity_mail',
'task_activity_push',
]
# Form für die Benachrichtigungseinstellungen GRUPPEN
class UsersNotificationFormAgn(forms.ModelForm):
class Meta:
model = UserNotifications
labels = {
"agn_standard_created_mail" : "Neuer Standard",
"agn_standard_copied_mail" : "Standard wurde übernommen",
"agn_standard_comment_mail" : "Kommentar zu Standard aus meiner Agentur",
"agn_standard_comment_react_mail" : "Reaktion zu meinem Kommentar",
"agn_own_change_mail" : "Änderungen meiner Agenturverbunde",
"agn_standard_created_mail" : "Neuer Standard",
"agn_standard_copied_mail" : "Standard wurde übernommen",
"agn_standard_comment_mail" : "Kommentar zu Standard aus meiner Agentur",
"agn_standard_comment_react_mail" : "Reaktion zu meinem Kommentar",
"agn_own_change_mail" : "Änderungen meiner Agenturverbunde",
"agn_other_change_mail" : "Änderung anderer Agenturverbunde",
}
fields = [
'agn_standard_created_mail',
'agn_standard_created_push',
fields = [
'agn_standard_created_mail',
'agn_standard_created_push',
'agn_standard_copied_mail',
'agn_standard_copied_push',
'agn_standard_comment_mail',
@ -223,21 +223,21 @@ class UsersNotificationFormAgn(forms.ModelForm):
class UsersNotificationFormOrganizer(forms.ModelForm):
class Meta:
model = UserNotifications
labels = {
"ql_created_mail" : "Quicklink erstellt",
"ql_update_mail" : "Quicklink aktualisiert",
"ql_created_mail" : "Quicklink erstellt",
"ql_update_mail" : "Quicklink aktualisiert",
"ql_delete_mail" : "Quicklink gelöscht",
"contact_created_mail" : "Kontakt erstellt",
"contact_update_mail" : "Kontakt aktualisiert",
"contact_delete_mail" : "Kontakt gelöscht",
"password_created_mail" : "Passwort erstellt",
"password_update_mail" : "Passwort aktualisiert",
"password_delete_mail" : "Passwort gelöscht",
"contact_created_mail" : "Kontakt erstellt",
"contact_update_mail" : "Kontakt aktualisiert",
"contact_delete_mail" : "Kontakt gelöscht",
"password_created_mail" : "Passwort erstellt",
"password_update_mail" : "Passwort aktualisiert",
"password_delete_mail" : "Passwort gelöscht",
}
fields = [
fields = [
'ql_created_mail',
'ql_created_push',
'ql_update_mail',
@ -280,17 +280,17 @@ class UserTimeForm(forms.ModelForm):
fields = ["startdate", "usetime", "usetime_start", "wd_mo", "wd_tu", "wd_we", "wd_th", "wd_fr", "wd_sa", "wd_so", "loose_holidedate"]
widgets = {
"startdate" : DatePickerInput(options={"format":'DD.MM.YYYY', "locale":'de'}),
"usetime_start" : DatePickerInput(options={"format":'DD.MM.YYYY', "locale":'de'})
"usetime_start" : DatePickerInput(options={"format":'DD.MM.YYYY', "locale":'de'})
}
def __init__(self, *args, **kwargs):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['startdate'].required = True
self.fields['usetime_start'].required = False
self.fields['usetime'].required = False
self.fields['usetime'].widget.attrs['readonly'] = True
self.fields['usetime_start'].widget.attrs['readonly'] = True
#self.fields['usetime'].widget.attrs['readonly'] = True
#self.fields['usetime_start'].widget.attrs['readonly'] = True
# PERMISSION GROUPS FORM
class AgencyGroupPerms(forms.Form):
@ -303,11 +303,11 @@ class AgencyGroupPerms(forms.Form):
@param: user
- User ist der aufgerufene User!
'''
def __init__(self, *args, **kwargs):
'''
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
temprof = AgencyGroup
for ele in temprof._meta.permissions:
for ele in temprof._meta.permissions:
self.fields[ele[0]] = forms.BooleanField(required=False, initial=False, help_text=(ele[1]))
# LOADING ALL MODUL-OPTIONS
@ -367,16 +367,16 @@ class UserProfileForm(forms.ModelForm):
"phoneland" : "Festnetznummer",
"image": "Profilbild",
"func" : "Agenturfunktion",
"compfunc" : "Tätigkeit"
"compfunc" : "Tätigkeit"
}
widgets = {"parent" : forms.HiddenInput()}
fields = ["parent", "func", "compfunc", "visible", "phoneland", "phonemobile", "phone_public", "persnumber", "image" ]
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
super().__init__(*args, **kwargs)
self.fields['func'].queryset = AgencyJob.objects.filter(agency__pk=self.instance.agency.pk)
def save(self):
def save(self):
photo = super(UserProfileForm, self).save()
try:
x = self.cleaned_data.get('x')
@ -386,12 +386,12 @@ class UserProfileForm(forms.ModelForm):
rotation = self.cleaned_data.get('rotation')
image = Image.open(photo.image)
rotatet_image = image.rotate(rotation, expand=True)
cropped_image = rotatet_image.crop((x, y, w+x, h+y))
cropped_image = rotatet_image.crop((x, y, w+x, h+y))
resized_image = cropped_image.resize((416, 416), Image.ANTIALIAS)
resized_image.save(photo.image.path)
return photo
except:
print("no photo")
print("no photo")
class AbsenceReasonForm(forms.ModelForm):
@ -405,6 +405,5 @@ class AbsenceReasonForm(forms.ModelForm):
"need_confirm" : "Muss bestätigt werden",
"need_rep" : "Muss vertreten werden",
"is_holiday" : "Geht vom Urlaub ab"
}
}
fields = ["name", "need_confirm", "need_rep", "is_holiday", "rgb_color"]

View File

@ -8,7 +8,7 @@
<div class="card-header" id="notification_standards_acc">
<h5 class="mb-0">
<button class="btn btn-link" data-toggle="collapse" data-target="#notification_standards" aria-expanded="true" aria-controls="notification_standards">
Standards
<i class="fas fa-chevron-down"></i>&nbsp;&nbsp;&nbsp;Standards
</button>
</h5>
</div>
@ -20,13 +20,13 @@
<tr>
<th scope="col">Benachrichtigung</th>
<th scope="col">E-Mail</th>
<th scope="col">Push</th>
<th scope="col">Push</th>
</tr>
</thead>
<tbody>
{% for formfield in notificationforms_standard %}
{% if forloop.counter|divisibleby:2 %}
<td>{{formfield}}</td>
<td>{{formfield}}</td>
</tr>
{% else %}
<tr>
@ -45,7 +45,7 @@
<div class="card-header" id="notification_news_acc">
<h5 class="mb-0">
<button class="btn btn-link" data-toggle="collapse" data-target="#notification_news" aria-expanded="true" aria-controls="notification_news">
News
<i class="fas fa-chevron-down"></i>&nbsp;&nbsp;&nbsp;News
</button>
</h5>
</div>
@ -57,13 +57,13 @@
<tr>
<th scope="col">Benachrichtigung</th>
<th scope="col">E-Mail</th>
<th scope="col">Push</th>
<th scope="col">Push</th>
</tr>
</thead>
<tbody>
{% for formfield in notificationforms_news %}
{% if forloop.counter|divisibleby:2 %}
<td>{{formfield}}</td>
<td>{{formfield}}</td>
</tr>
{% else %}
<tr>
@ -83,7 +83,7 @@
<div class="card-header" id="notification_groups_acc">
<h5 class="mb-0">
<button class="btn btn-link" data-toggle="collapse" data-target="#notification_groups" aria-expanded="true" aria-controls="notification_groups">
Gruppen
<i class="fas fa-chevron-down"></i>&nbsp;&nbsp;&nbsp;Gruppen
</button>
</h5>
</div>
@ -95,13 +95,13 @@
<tr>
<th scope="col">Benachrichtigung</th>
<th scope="col">E-Mail</th>
<th scope="col">Push</th>
<th scope="col">Push</th>
</tr>
</thead>
<tbody>
{% for formfield in notificationforms_groups %}
{% if forloop.counter|divisibleby:2 %}
<td>{{formfield}}</td>
<td>{{formfield}}</td>
</tr>
{% else %}
<tr>
@ -120,7 +120,7 @@
<div class="card-header" id="notification_task_acc">
<h5 class="mb-0">
<button class="btn btn-link" data-toggle="collapse" data-target="#notification_task" aria-expanded="true" aria-controls="notification_task">
Tätigkeiten
<i class="fas fa-chevron-down"></i>&nbsp;&nbsp;&nbsp;Tätigkeiten
</button>
</h5>
</div>
@ -132,13 +132,13 @@
<tr>
<th scope="col">Benachrichtigung</th>
<th scope="col">E-Mail</th>
<th scope="col">Push</th>
<th scope="col">Push</th>
</tr>
</thead>
<tbody>
{% for formfield in notificationforms_task %}
{% if forloop.counter|divisibleby:2 %}
<td>{{formfield}}</td>
<td>{{formfield}}</td>
</tr>
{% else %}
<tr>
@ -159,7 +159,7 @@
<div class="card-header" id="notification_files_acc">
<h5 class="mb-0">
<button class="btn btn-link" data-toggle="collapse" data-target="#notification_files" aria-expanded="true" aria-controls="notification_files">
Dateien und Ordner
<i class="fas fa-chevron-down"></i>&nbsp;&nbsp;&nbsp;Dateien und Ordner
</button>
</h5>
</div>
@ -171,13 +171,13 @@
<tr>
<th scope="col">Benachrichtigung</th>
<th scope="col">E-Mail</th>
<th scope="col">Push</th>
<th scope="col">Push</th>
</tr>
</thead>
<tbody>
{% for formfield in notificationforms_files %}
{% if forloop.counter|divisibleby:2 %}
<td>{{formfield}}</td>
<td>{{formfield}}</td>
</tr>
{% else %}
<tr>
@ -196,7 +196,7 @@
<div class="card-header" id="notification_organizer_acc">
<h5 class="mb-0">
<button class="btn btn-link" data-toggle="collapse" data-target="#notification_organizer" aria-expanded="true" aria-controls="notification_organizer">
Organizer
<i class="fas fa-chevron-down"></i>&nbsp;&nbsp;&nbsp;Organizer
</button>
</h5>
</div>
@ -208,13 +208,13 @@
<tr>
<th scope="col">Benachrichtigung</th>
<th scope="col">E-Mail</th>
<th scope="col">Push</th>
<th scope="col">Push</th>
</tr>
</thead>
<tbody>
{% for formfield in notificationforms_organizer %}
{% if forloop.counter|divisibleby:2 %}
<td>{{formfield}}</td>
<td>{{formfield}}</td>
</tr>
{% else %}
<tr>
@ -233,7 +233,7 @@
<div class="card-header" id="notification_messages_acc">
<h5 class="mb-0">
<button class="btn btn-link" data-toggle="collapse" data-target="#notification_messages" aria-expanded="true" aria-controls="notification_messages">
Mitteilungen
<i class="fas fa-chevron-down"></i>&nbsp;&nbsp;&nbsp;Mitteilungen
</button>
</h5>
</div>
@ -245,13 +245,13 @@
<tr>
<th scope="col">Benachrichtigung</th>
<th scope="col">E-Mail</th>
<th scope="col">Push</th>
<th scope="col">Push</th>
</tr>
</thead>
<tbody>
{% for formfield in notificationforms_messages %}
{% if forloop.counter|divisibleby:2 %}
<td>{{formfield}}</td>
<td>{{formfield}}</td>
</tr>
{% else %}
<tr>
@ -270,7 +270,7 @@
<div class="card-header" id="notification_chat_acc">
<h5 class="mb-0">
<button class="btn btn-link" data-toggle="collapse" data-target="#notification_chat" aria-expanded="true" aria-controls="notification_chat">
Chat
<i class="fas fa-chevron-down"></i>&nbsp;&nbsp;&nbsp;Chat
</button>
</h5>
</div>
@ -282,13 +282,13 @@
<tr>
<th scope="col">Benachrichtigung</th>
<th scope="col">E-Mail</th>
<th scope="col">Push</th>
<th scope="col">Push</th>
</tr>
</thead>
<tbody>
{% for formfield in notificationforms_chat %}
{% if forloop.counter|divisibleby:2 %}
<td>{{formfield}}</td>
<td>{{formfield}}</td>
</tr>
{% else %}
<tr>
@ -307,7 +307,7 @@
<div class="card-header" id="notification_abtime_acc">
<h5 class="mb-0">
<button class="btn btn-link" data-toggle="collapse" data-target="#notification_abtime" aria-expanded="true" aria-controls="notification_abtime">
Abwesenheits- und Zeiterfassung
<i class="fas fa-chevron-down"></i>&nbsp;&nbsp;&nbsp;Abwesenheits- und Zeiterfassung
</button>
</h5>
</div>
@ -319,13 +319,13 @@
<tr>
<th scope="col">Benachrichtigung</th>
<th scope="col">E-Mail</th>
<th scope="col">Push</th>
<th scope="col">Push</th>
</tr>
</thead>
<tbody>
{% for formfield in notificationforms_abtime %}
{% if forloop.counter|divisibleby:2 %}
<td>{{formfield}}</td>
<td>{{formfield}}</td>
</tr>
{% else %}
<tr>
@ -345,7 +345,7 @@
<div class="card-header" id="notification_agn_acc">
<h5 class="mb-0">
<button class="btn btn-link" data-toggle="collapse" data-target="#notification_agn" aria-expanded="true" aria-controls="notification_agn">
Agenturverbund
<i class="fas fa-chevron-down"></i>&nbsp;&nbsp;&nbsp;Agenturverbund
</button>
</h5>
</div>
@ -357,13 +357,13 @@
<tr>
<th scope="col">Benachrichtigung</th>
<th scope="col">E-Mail</th>
<th scope="col">Push</th>
<th scope="col">Push</th>
</tr>
</thead>
<tbody>
{% for formfield in notificationforms_agn %}
{% if forloop.counter|divisibleby:2 %}
<td>{{formfield}}</td>
<td>{{formfield}}</td>
</tr>
{% else %}
<tr>
@ -387,7 +387,7 @@
new_stat = 0;
if($(this).prop("checked")){
new_stat = 1;
}
}
$.ajax(
{
type: "GET",
@ -397,15 +397,15 @@
fieldname : ele,
new_stat : new_stat
},
success: function( data )
{
success: function( data )
{
console.log(data);
if(data['success']){
$('#notchange_done').toast('show');
$('#notchange_done').toast('show');
}
else{
$('#notchange_err').toast('show');
}
}
}
});
}
@ -418,4 +418,4 @@
});
})
</script>
</script>

View File

@ -11,13 +11,13 @@
<!-- Then put toasts within -->
<div id="notchange_done" class="toast alert-success" role="alert" aria-live="assertive" aria-atomic="true">
<div class="toast-header">
<strong class="mr-auto">Gespeichert</strong>
<strong class="mr-auto">Gespeichert</strong>
<!--<button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>-->
</div>
<div class="toast-body">
<div id="toast_savecontent">Änderungen wurden gespeichert.</div>
<div class="toast-body">
<div id="toast_savecontent">Änderungen wurden gespeichert.</div>
</div>
</div>
</div>
@ -25,14 +25,14 @@
<!-- Then put toasts within -->
<div id="notchange_err" class="toast alert-danger" role="alert" aria-live="assertive" aria-atomic="true">
<div class="toast-header">
<strong class="mr-auto">Fehler aufgetreten</strong>
<!--
<strong class="mr-auto">Fehler aufgetreten</strong>
<!--
<button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
-->
</div>
<div class="toast-body">
<div class="toast-body">
<div id="toast_errcontent">Bitte kontaktieren Sie den Support.</div>
</div>
</div>
@ -41,11 +41,11 @@
<div class="content-section col-10">
<h3>Mitarbeiter <span id="user_title_fullname">{{user_fullname}}</span> &nbsp;<small><i data-toggle="tooltip" data-placement="top" title="Geben Sie hier die Profildaten für den Mitarbeiter ein." class="far fa-question-circle"></i></small></h3>
<hr>
{% if newuser == 1 %}
<hr>
{% if newuser == 1 %}
<div class="progress mb-3" style="max-height: 15px;">
<div class="progress-bar" role="progressbar" style="width: 80%; " aria-valuenow="80" aria-valuemin="0" aria-valuemax="100">Schritt 2: Profildaten festlegen</div>
</div>
</div>
{% endif %}
<div class="media">
<img class="img-profile" style="width: 15%;" src="{{ imagelink }}">
@ -83,14 +83,14 @@
<form method="POST" enctype="multipart/form-data" name="profileform_basic">
<input type="hidden" name="userprof_formtype" value="profileform">
<div class="mt-2">
<h5>Gruppen&nbsp;<small><i data-toggle="tooltip" data-placement="top" title="Legen Sie fest, in welchen Gruppen der neue Mitarbeiter sein soll. Standardmäßig sind alle Mitarbeiter in der Gruppe Mitarbeiter (wenn diese nicht umbenannt worden ist)." class="far fa-question-circle"></i></small></h5>
<div class="mt-2">
<h5>Gruppen&nbsp;<small><i data-toggle="tooltip" data-placement="top" title="Legen Sie fest, in welchen Gruppen der neue Mitarbeiter sein soll. Standardmäßig sind alle Mitarbeiter in der Gruppe Mitarbeiter (wenn diese nicht umbenannt worden ist)." class="far fa-question-circle"></i></small></h5>
<div class="row">
<div class="col-4">
{% for g in agencygroups %}
{% if forloop.counter|divisibleby:6 %}
{% if forloop.counter|divisibleby:6 %}
</div><div class="col-4">
<div class="custom-control custom-checkbox mb-2">
<div class="custom-control custom-checkbox mb-2">
{% if vieweduser|useringroupbyid:g.group.name %}
<input type="checkbox" class="custom-control-input" name="group_{{g.pk}}" id="group_{{g.pk}}" onchange="javascript:updateUser({{vieweduser}}, {{g.pk}}, this.checked)" checked="true">
{% else %}
@ -99,7 +99,7 @@
<label class="custom-control-label" for="group_{{g.pk}}" >{{g.agencygroupname}}</label>
</div>
{% else %}
<div class="custom-control custom-checkbox mb-2">
<div class="custom-control custom-checkbox mb-2">
{% if vieweduser|useringroupbyid:g.group.name %}
<input type="checkbox" class="custom-control-input" name="group_{{g.pk}}" id="group_{{g.pk}}" onchange="javascript:updateUser({{vieweduser}}, {{g.pk}}, this.checked)" checked="true">
{% else %}
@ -112,7 +112,7 @@
</div></div>
</div>
<hr>
<div class="mt-2">
<div class="mt-2">
<h5>Übergeordneter Mitarbeiter&nbsp;<small><i data-toggle="tooltip" data-placement="top" title="Legen Sie fest, welche Mitarbeiter über diesen im Organigramm steht. Ist die Einstellung leer, wir" class="far fa-question-circle"></i></small></h5>
<select name="usertoparent" id="usertoparent" class="select form-control col-4">
<option value="">---------</option>
@ -132,7 +132,7 @@
<div class="col-6">
<input type="hidden" name="form_type" value="profileform">
{% for field in profileform %}
{% if forloop.counter|divisibleby:6 %}
{% if forloop.counter|divisibleby:6 %}
</div>
<div class="col-6">
{{field|as_crispy_field}}
@ -141,30 +141,30 @@
{% endif %}
{% endfor %}
</div>
</div>
<hr>
{% if newuser == 1 %}
</div>
<hr>
{% if newuser == 1 %}
<a class="btn" href="{% url 'dasettings' %} ">Profil später bearbeiten</a>
{% else %}
<a class="btn" href="{% url 'dasettings' %} ">Abbrechen</a>
{% endif%}
{% if newuser == 1 %}
{% if newuser == 1 %}
<button type="submit" class="btn btn-primary" style="float: right">Profilerstellung abschließen</button>
{% else %}
<button type="submit" name="submitprof" class="btn btn-primary" style="float: right">Profildaten aktualisieren</button>
{% endif %}
</form>
</form>
</div>
<div class="tab-pane fade" id="contract" role="tabpanel" aria-labelledby="contract-tab">
<div class="col-9 mt-2" style="margin-left: -10px;">
<div class="col-9 mt-2" style="margin-left: -10px;">
<form method="POST" enctype="multipart/form-data" name="usertime_basic">
{% csrf_token %}
<input type="hidden" name="form_type" value="contract">
<h5>Zeiterfassung&nbsp;<small><i data-toggle="tooltip" data-placement="top" title="Legen Sie fest, ob dieser Mitarbeit seine Arbeitszeit erfassen soll." class="far fa-question-circle"></i></small></h5>
<input type="hidden" name="form_type" value="contract">
<h5>Zeiterfassung&nbsp;<small><i data-toggle="tooltip" data-placement="top" title="Legen Sie fest, ob dieser Mitarbeit seine Arbeitszeit erfassen soll." class="far fa-question-circle"></i></small></h5>
<div class="row">
<div class="col-3">
{{usertime_form.usetime|as_crispy_field}}
@ -173,18 +173,18 @@
{{usertime_form.usetime_start|as_crispy_field}}
</div>
</div>
<!--
<script type="text/javascript">
$(document).ready(function(){
$("#id_usetime").prop("disabled", true);
})
</script>
-->
<h5>Arbeitszeiten&nbsp;<small><i data-toggle="tooltip" data-placement="top" title="Legen Sie fest, an welchen Tagen dieser Mitarbeiter wie viele Stunden arbeitet." class="far fa-question-circle"></i></small></h5>
<div class="table-responsive">
<h5>Arbeitszeiten&nbsp;<small><i data-toggle="tooltip" data-placement="top" title="Legen Sie fest, an welchen Tagen dieser Mitarbeiter wie viele Stunden arbeitet." class="far fa-question-circle"></i></small></h5>
<div class="table-responsive">
<table class="table">
<tr>
<tr>
<td>{{usertime_form.wd_mo|as_crispy_field}}</td>
<td>{{usertime_form.wd_tu|as_crispy_field}}</td>
<td>{{usertime_form.wd_we|as_crispy_field}}</td>
@ -198,61 +198,61 @@
<hr style="margin-top: -20px;">
<div class="col-12" >
<div class="col-4" style="margin-left: -10px;">
<h5 class="mt-1">Urlaub&nbsp;<small><i data-toggle="tooltip" data-placement="top" title="Legen Sie fest, wie viel Urlaub dieser Mitarbeiter im Jahr hat." class="far fa-question-circle"></i></small></h5>
</div>
{{usertime_form.media}}
<div class="row col-12">
<h5 class="mt-1">Urlaub&nbsp;<small><i data-toggle="tooltip" data-placement="top" title="Legen Sie fest, wie viel Urlaub dieser Mitarbeiter im Jahr hat." class="far fa-question-circle"></i></small></h5>
</div>
{{usertime_form.media}}
<div class="row col-12">
<div class="col-5">
{{usertime_form.startdate|as_crispy_field}}
{{usertime_form.startdate|as_crispy_field}}
</div>
<div class="col-5">
{{usertime_form.loose_holidedate|as_crispy_field}}
{{usertime_form.loose_holidedate|as_crispy_field}}
</div>
</div>
</div>
<h5 class="mt-2 mb-1">Urlaub Jahresübersicht&nbsp;<small><i data-toggle="tooltip" data-placement="top" title="Hier sehen Sie die aktuelle Jahresübersicht des Mitarbeiters. Beachten Sie das Format beim manuellen anpassen: XX,0 oder XX,5!" class="far fa-question-circle"></i></small>
<button type="button" id="changeHolidayData" style="float: right" class="btn btn-secondary btn-sm" onclick="javascript:loadUpdateTableHolidays()" data-toggle="tooltip" data-placement="top" title="Passen Sie die Urlaubstage und Resturlaubstage manuell an."><small><i class="fas fa-pen"></i></small></button>
<button type="button" id="changeHolidayDataSave" style="float: right; display: none" class="btn btn-primary btn-sm" onclick="javascript:saveUpdateTableHolidays()" data-toggle="tooltip" data-placement="top" title="Urlaub- und Resttage speichern."><small><i class="fas fa-check"></i></small></button>
</h5>
</h5>
<div id="year_overview">
<table class="table table-hover">
<thead>
<tr>
<thead>
<tr>
<th scope="col">Jahr</th>
{% for ab_info in user_years.all %}
{% for ab_info in user_years.all %}
<th scope="">{{ab_info.year}}</th>
{% endfor %}
{% endfor %}
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Urlaub</th>
{% for ab_info in user_years.all %}
{% for ab_info in user_years.all %}
<td class="readytochange_holiday_rest" id="holiday_{{ab_info.pk}}">{{ab_info.days}}</td>
{% endfor %}
{% endfor %}
</tr>
<tr>
<th scope="row">Genommener Urlaub</th>
{% for ab_info in user_years.all %}
{% for ab_info in user_years.all %}
<td>{{ab_info.days_inuse}}</td>
{% endfor %}
{% endfor %}
</tr>
<tr>
<th scope="row">Resturlaub aus Vorjahr</th>
{% for ab_info in user_years.all %}
{% for ab_info in user_years.all %}
{% if forloop.counter0 > 0 %}
<td class="readytochange_holiday_rest" id="rest_holiday_{{ab_info.pk}}">{{ab_info.restdays}}</td>
{% else %}
<td>&nbsp;</td>
{% endif %}
{% endfor %}
{% endfor %}
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-12">
<hr>
<button type="submit" class="btn btn-primary" style="float: right">Vertragsdaten aktualisieren</button>
<button type="submit" class="btn btn-primary" style="float: right">Vertragsdaten aktualisieren</button>
<a class="btn" href="{% url 'dasettings' %} ">Abbrechen</a>
</div>
</form>
@ -275,25 +275,25 @@
<h4 class="modal-title">Bereich bestimmen</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close" onclick="clearImgField()">
<span aria-hidden="true">&times;</span>
</button>
</button>
</div>
<div class="modal-body" id="imgmodbody">
<img src="" id="imagemod" style="max-width: 100%; max-height: 100%;">
</div>
<div class="modal-footer">
<div class="btn-group pull-left" role="group">
<button type="button" class="btn btn-default js-zoom-in">
<i class="fas fa-search-plus"></i>
<button type="button" class="btn btn-default js-zoom-in">
<i class="fas fa-search-plus"></i>
</button>
<button type="button" class="btn btn-default js-zoom-out">
<i class="fas fa-search-minus"></i>
</button>
</button>
<button type="button" class="btn btn-default js-rot-left">
<i class="fas fa-undo-alt"></i>
<i class="fas fa-undo-alt"></i>
</button>
<button type="button" class="btn btn-default js-rot-right">
<i class="fas fa-redo-alt"></i>
</button>
<i class="fas fa-redo-alt"></i>
</button>
</div>
<button type="button" class="btn btn-default" data-dismiss="modal" onclick="clearImgField()">Abbrechen</button>
<button type="button" class="btn btn-primary js-crop-and-upload">Ausschneiden</button>
@ -314,8 +314,8 @@ function loadUpdateTableHolidays(){
action : "update_holidays",
userid: {{vieweduser}}
},
success: function( data )
{
success: function( data )
{
$("#year_overview").html(data);
$("#changeHolidayDataSave").show();
$("#changeHolidayData").hide();
@ -327,9 +327,9 @@ function saveUpdateTableHolidays(){
var new_data_arr = ""
new_data = $(".readytochange_holiday");
for(i = 0; i < new_data.length; i++){
tempele = new_data[i]["id"];
tempele = new_data[i]["id"];
new_data_arr = new_data_arr + tempele + "__" + $("#" + tempele).val().replace(",", ".") + "___";
}
}
$.ajax(
{
@ -340,8 +340,8 @@ function saveUpdateTableHolidays(){
new_data_info : new_data_arr,
userid: {{vieweduser}}
},
success: function( data )
{
success: function( data )
{
$("#year_overview").html(data);
$("#changeHolidayDataSave").hide();
$("#changeHolidayData").show();
@ -368,16 +368,16 @@ function updateNewMail(){
url: "/dasettings/ajax",
data:{
action : "update_usermail",
newmail : newmail,
newmail : newmail,
userid: {{vieweduser}}
},
success: function( data )
{
if(data['success']){
$('#notchange_done').toast('show');
$("#toast_savecontent").html("E-Mailadresse aktualisiert");
success: function( data )
{
if(data['success']){
$('#notchange_done').toast('show');
$("#toast_savecontent").html("E-Mailadresse aktualisiert");
}
else{
else{
$('#notchange_err').toast('show');
$("#toast_errcontent").html("E-Mailadresse nicht aktualisiert! Valide Daten eingeben oder E-Mailadresse ist bereits vorhanden.");
$("#user_email").html(data["data"]["mail"]);
@ -392,27 +392,27 @@ function ChangeName(){
$("#changenamebutton").hide();
}
function updateNewNames(){
function updateNewNames(){
$.ajax(
{
type: "GET",
url: "/dasettings/ajax",
data:{
action : "update_usernames",
new_first_name : $("#user_first_name").val(),
new_first_name : $("#user_first_name").val(),
new_last_name : $("#user_last_name").val(),
userid: {{vieweduser}}
},
success: function( data )
{
if(data['success']){
$('#notchange_done').toast('show');
success: function( data )
{
if(data['success']){
$('#notchange_done').toast('show');
$("#toast_savecontent").html("Vor- und Nachname aktualisiert");
$("#user_fullname").html(data["data"]["userfullname"]);
$("#user_title_fullname").html(data["data"]["userfullname"]);
$("#changenamebutton").show();
}
else{
else{
$('#notchange_err').toast('show');
$("#toast_errcontent").html("Vor- und Nachname konnte nicht aktualisiert werden!");
$("#user_fullname").html(data["data"]["userfullname"]);
@ -427,14 +427,14 @@ function showMainUserForm(){
$("#changeMainUserData").modal("toggle");
}
$(document).ready(function(){
$(document).ready(function(){
$(".toast").toast({
autohide: true,
delay : 3000
});
$('#profil-user').tab('show');
$('#profil-user').tab('show');
});
function updateUser(userid, groupid, newvalue){
@ -443,7 +443,7 @@ function updateUser(userid, groupid, newvalue){
}
else{
removeUserFromGroup(userid, groupid);
}
}
}
function removeUserFromGroup(userid, groupid){
@ -456,13 +456,13 @@ function removeUserFromGroup(userid, groupid){
groupid : groupid,
userid: userid
},
success: function( data )
{
if(data['success']){
$('#notchange_done').toast('show');
success: function( data )
{
if(data['success']){
$('#notchange_done').toast('show');
$("#toast_savecontent").html("Mitarbeiter erfolgreich aus der Gruppe entfernt!");
}
else{
else{
$('#notchange_err').toast('show');
$("#toast_errcontent").html("Mitarbeiter konnte nicht entfernt werden!");
}
@ -476,17 +476,17 @@ function removeUserFromGroup(userid, groupid){
{
type: "GET",
url: "/dashboard/sendpassmail",
data:{
data:{
userid : id
},
success: function( data )
{
$("#mailsend").fadeIn().delay(4000).fadeOut();
success: function( data )
{
$("#mailsend").fadeIn().delay(4000).fadeOut();
}
});
});
}
function addUserToGroup(userid, groupid){
function addUserToGroup(userid, groupid){
$.ajax(
{
type: "GET",
@ -496,13 +496,13 @@ function addUserToGroup(userid, groupid){
groupid : groupid,
userid: userid,
},
success: function( data )
{
if(data['success']){
$('#notchange_done').toast('show');
success: function( data )
{
if(data['success']){
$('#notchange_done').toast('show');
$("#toast_savecontent").html("Mitarbeiter erfolgreich der Gruppe hinzugefügt!");
}
else{
else{
$('#notchange_err').toast('show');
$("#toast_errcontent").html("Mitarbeiter konnte nicht hinzugefügt werden!");
}
@ -517,17 +517,17 @@ function addUserToGroup(userid, groupid){
$("#id_height").val(416);
$("#id_rotation").val(0);
function clearImgField(){
function clearImgField(){
$("#id_image").val("");
}
/* SCRIPT TO OPEN THE MODAL WITH THE PREVIEW */
$("#id_image").change(function () {
if (this.files && this.files[0]) {
$("#id_image").change(function () {
if (this.files && this.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$("#imagemod").attr("src", e.target.result);
$("#imagemod").attr("src", e.target.result);
$("#modalCrop").modal("show");
}
reader.readAsDataURL(this.files[0]);
@ -537,18 +537,18 @@ function addUserToGroup(userid, groupid){
var cropBoxData;
var canvasData;
var $image = $("#imagemod");
$("#modalCrop").on("shown.bs.modal", function () {
$("#modalCrop").on("shown.bs.modal", function () {
$image.cropper({
viewMode: 3,
aspectRatio: 1/1,
viewMode: 3,
aspectRatio: 1/1,
strict: false,
cropBoxMovable: true,
cropBoxResizable: true,
cropBoxResizable: true,
minCropBoxWidth: 300,
minCropBoxHeight: 300,
minCropBoxHeight: 300,
ready: function () {
$image.cropper("setCanvasData", canvasData);
$image.cropper("setCropBoxData", cropBoxData);
$image.cropper("setCropBoxData", cropBoxData);
}
});
$("#imgmodbody").css({
@ -577,16 +577,16 @@ function addUserToGroup(userid, groupid){
$image.cropper("rotate", -90);
});
/* SCRIPT TO COLLECT THE DATA AND POST TO THE SERVER */
$(".js-crop-and-upload").click(function () {
var cropData = $image.cropper("getData");
$(".js-crop-and-upload").click(function () {
var cropData = $image.cropper("getData");
$("#id_x").val(cropData["x"]);
$("#id_y").val(cropData["y"]);
$("#id_height").val(cropData["height"]);
$("#id_width").val(cropData["width"]);
$("#id_rotation").val(cropData["rotate"]);
$("#id_image").attr("src", $image);
$("#id_rotation").val(cropData["rotate"]);
$("#id_image").attr("src", $image);
$("#modalCrop").modal('toggle');
});
</script>
{% endblock content %}
{% endblock content %}

Binary file not shown.

Binary file not shown.

View File

@ -10,12 +10,13 @@
Von: {{absence.start|date:"d.m Y"}}<br />
Bis: {{absence.end|date:"d.m Y"}}<br />
Grund: {{absence.reason.name}}<br />
Vertreter: {{absence.representator.first_name}} {{absence.representator.last_name}}<br />
Informationen: {{absence.info}}<br />
<hr>
<h5>Übersicht Urlaubstage wenn Anfrage genehmigt</h5>
<table class="table table-sm">
<tbody>
<tr>
<tr>
<td>Gewünschte Tage</td>
<td>{{absence.holidays_normal|addition:absence.holidays_rest|addition:absence.holidays_normal_next|addition:absence.holidays_rest_next}}</td>
</tr>
@ -26,13 +27,13 @@ Informationen: {{absence.info}}<br />
<tr>
<td>Resturlaub {{timeinfo_nextyear.year}}</td>
<td>{{timeinfo_nextyear.restdays|addition:timeinfo_nextyear.days|sub:timeinfo_nextyear.days_inuse|addition:absence.holidays_rest_next}}</td>
</tr>
</tr>
</tbody>
</table>
{% if other_absences_string != False %}
<div id="otherholidays">
<hr>
<h5>Andere Abwesenheiten in diesem Zeitraum</h5>
<h5>Andere Abwesenheiten in diesem Zeitraum</h5>
{% for ele in other_absences_string %}
{{ele}}<br />
{% endfor %}
@ -41,7 +42,7 @@ Informationen: {{absence.info}}<br />
{% endif %}
<form method="POST">
<input type="hidden" name="form_type" value="confirmform">
{% csrf_token %}
{% csrf_token %}
{{confirmform|crispy}}
</div>
<div class="modal-footer">
@ -59,4 +60,4 @@ Informationen: {{absence.info}}<br />
<h5>Abwesenheit für {{absence.user.first_name}} {{absence.user.last_name}} annehmen/ablehnen</h5>
<hr>
Diese Daten dürfen Sie nicht abrufen.
{% endif %}
{% endif %}

View File

@ -7,10 +7,10 @@
<th scope="col">Nachname</th>
<th scope="col">Start</th>
<th scope="col">Ende</th>
<th scope="col">Grund</th>
<th scope="col">Info</th>
<th scope="col">Status</th>
<th scope="col">&nbsp;</th>
<th scope="col">Grund</th>
<th scope="col">Info</th>
<th scope="col">Status</th>
<th scope="col">&nbsp;</th>
</tr>
</thead>
<tbody id="">
@ -20,17 +20,18 @@
<td>{{abday.user.last_name}}</td>
<td>{{abday.start|date:"d.M Y"}}</td>
<td>{{abday.end|date:"d.M Y"}}</td>
<td>{{abday.reason.name}}</td>
<td>{{abday.reason.name}}</td>
<td>{{abday.info}}</td>
<td>{% if abday.confirm_status == 0 %} Genehmigt {% elif abday.confirm_status == 1 %} Beantragt {% else %} Abgelehnt {% endif %}</td>
<td style="float: right;">
<button type="button " class="btn btn-secondary btn-sm mr-1" onclick="javascript:changeAbsence({{abday.pk}})"><i class="fas fa-pen"></i></button>
<button type="button " class="btn btn-secondary btn-sm" onclick="javascript:$('#confirm-delete_{{abday.pk}}').modal('toggle')"><i class="fas fa-trash"></i></button>
</td>
<td>{% if abday.confirm_status == 0 %} Genehmigt {% elif abday.confirm_status == 1 %} Beantragt {% else %} Abgelehnt {% endif %}</td>
<td style="float: right !important; min-width: 100%">
<button type="button" style="float: right; margin-left: 2px;" class="btn btn-secondary btn-sm" onclick="javascript:$('#confirm-delete_{{abday.pk}}').modal('toggle')"><i class="fas fa-trash"></i></button>
<button type="button " style="float: right" class="btn btn-secondary btn-sm mr-1" onclick="javascript:changeAbsence({{abday.pk}})"><i class="fas fa-pen"></i></button>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endfor %}
</tbody>
</table>
</div>
</div>
<script type="text/javascript">
@ -41,7 +42,7 @@
}
$(document).ready(function(){
$('#table_allabsences').DataTable({
"language": {
"search" : "Suche",
@ -60,7 +61,7 @@
"className" : "btn-danger"
}
});
});
</script>
{% for ab in allabsences %}
@ -76,7 +77,7 @@
<div class="modal-footer">
<button class="btn btn-primary" id="ab_{{ab.pk}}" >Löschen</button>
<button type="button" class="btn" data-dismiss="modal">Abbrechen</button>
</div>
</div>
</div>
@ -91,11 +92,11 @@
action : "remove_absence",
ab: {{ab.pk}},
},
success: function( data )
{
success: function( data )
{
location.href = "{% url 'tma-management' activemonth activeyear %}"
}
});
});
});
</script>
{% endfor %}
{% endfor %}