This commit is contained in:
holger.trampe 2021-01-15 10:37:04 +01:00
parent 08ac7201c0
commit d75a95652c
17 changed files with 249 additions and 12 deletions

View File

@ -85,7 +85,10 @@ Es liegen keine Rechnungen vor.
<script type="text/javascript">
$(document).ready(function(){
$('#agdata').DataTable({
"language": {
columnDefs: [
{ 'targets': 3, type: 'date-euro' },
],
"language": {
"search" : "Suche",
"info": "Zeige _START_ bis _END_ von _TOTAL_ Einträgen",
"lengthMenu": "Zeige _MENU_ Einträge",

View File

@ -39,6 +39,9 @@
<script type="text/javascript">
$(document).ready(function(){
$('#agdata').DataTable({
columnDefs: [
{ 'targets': 1, type: 'date-euro' },
],
"language": {
"search" : "Suche",
"info": "Zeige _START_ bis _END_ von _TOTAL_ Einträgen",

View File

@ -38,6 +38,9 @@
<script type="text/javascript">
$(document).ready(function(){
$('#agdata').DataTable({
columnDefs: [
{ 'targets': 1, type: 'date-euro' },
],
"language": {
"search" : "Suche",
"info": "Zeige _START_ bis _END_ von _TOTAL_ Einträgen",

View File

@ -43,11 +43,11 @@
{% endfor %}
</tbody>
</table>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('#users_groups').DataTable({
"language": {
"language": {
"search" : "Suche",
"info": "Zeige _START_ bis _END_ von _TOTAL_ Einträgen",
"lengthMenu": "Zeige _MENU_ Einträge",
@ -68,6 +68,170 @@
})
</script>
<hr>
<h5>Arbeitstage</h5>
Beginn der Zeiterfassung: {{usertimedata.startdate|date:"d.m.Y"}}
<table class="table table-hover" id="user_workdays" >
<thead>
<tr>
<th scope="col"></th>
<th scope="col">Start</th>
<th scope="col">Ende</th>
</tr>
</thead>
<tbody >
{% for wd in workdays %}
<tr>
<td>{{forloop.counter}}</td>
<td>{{wd.start|date:"d.m.Y H:i"}}</td>
<td>{{wd.end|date:"d.m.Y H:i"}}</td>
</tr>
{% endfor %}
</tbody>
</table>
<script type="text/javascript">
$(document).ready(function(){
$('#user_workdays').DataTable({
columnDefs: [
{ 'targets': 1, type: 'date-euro' },
{ 'targets': 2, type: 'date-euro' }
],
order: [
[1, 'asc'] // date column
],
"language": {
"search" : "Suche",
"info": "Zeige _START_ bis _END_ von _TOTAL_ Einträgen",
"lengthMenu": "Zeige _MENU_ Einträge",
"zeroRecords": "Nichts gefunden",
"infoEmpty": "Keine Einträge",
"paginate": {
"first": "Erste",
"last": "Letzte",
"next": "Nächste",
"previous": "Zurück"
},
},
"pageLength": 20,
"buttons" : {
"className" : "btn-danger"
}
});
})
</script>
<hr>
<h5>Abwesenheiten</h5>
<table class="table table-hover" id="user_absences" >
<thead>
<tr>
<th scope="col"></th>
<th scope="col">Start</th>
<th scope="col">Ende</th>
<th scope="col">Halbstart</th>
<th scope="col">Halbende</th>
<th scope="col">Erstellt am</th>
<th scope="col">Status</th>
<th scope="col">Urlaub N</th>
<th scope="col">Urlaub R</th>
<th scope="col">Urlaub Next N</th>
<th scope="col">Urlaub Next Rest</th>
</tr>
</thead>
<tbody >
{% for ab in absences %}
<tr>
<td>{{forloop.counter}}</td>
<td>{{ab.start|date:"d.m.Y"}}</td>
<td>{{ab.end|date:"d.m.Y"}}</td>
<td>{{ab.start_ishalf}}</td>
<td>{{ab.end_ishalf}}</td>
<td>{{ab.created_date|date:"d.m.Y"}}</td>
<td>{% if ab.confirm_status == 0 %} OK {% elif ab.confirm_status == 1 %} Beantragt {% else %} Abgelehnt {% endif %} </td>
<td>{{ab.holidays_normal}}</td>
<td>{{ab.holidays_rest}}</td>
<td>{{ab.holidays_normal_next}}</td>
<td>{{ab.holidays_rest_next}}</td>
</tr>
{% endfor %}
</tbody>
</table>
<script type="text/javascript">
$(document).ready(function(){
$('#user_absences').DataTable({
columnDefs: [
{ 'targets': 1, type: 'date-euro' },
{ 'targets': 2, type: 'date-euro' }
],
order: [
[1, 'asc'] // date column
],
"language": {
"search" : "Suche",
"info": "Zeige _START_ bis _END_ von _TOTAL_ Einträgen",
"lengthMenu": "Zeige _MENU_ Einträge",
"zeroRecords": "Nichts gefunden",
"infoEmpty": "Keine Einträge",
"paginate": {
"first": "Erste",
"last": "Letzte",
"next": "Nächste",
"previous": "Zurück"
},
},
"pageLength": 10,
"buttons" : {
"className" : "btn-danger"
}
});
})
</script>
<hr>
<h5>Jahresübersicht</h5>
<table class="table table-hover" id="user_absence_year" >
<thead>
<tr>
<th scope="col"></th>
<th scope="col">Jahr</th>
<th scope="col">Tage Gesamt</th>
<th scope="col">Tage Verbraucht</th>
<th scope="col">Rest Vorjahr</th>
</tr>
</thead>
<tbody >
{% for yi in yearinfo %}
<tr>
<td>{{forloop.counter}}</td>
<td>{{yi.year}}</td>
<td>{{yi.days}}</td>
<td>{{yi.days_inuse}}</td>
<td>{{yi.restdays}}</td>
</tr>
{% endfor %}
</tbody>
</table>
<script type="text/javascript">
$(document).ready(function(){
$('#user_absence_year').DataTable({
"language": {
"search" : "Suche",
"info": "Zeige _START_ bis _END_ von _TOTAL_ Einträgen",
"lengthMenu": "Zeige _MENU_ Einträge",
"zeroRecords": "Nichts gefunden",
"infoEmpty": "Keine Einträge",
"paginate": {
"first": "Erste",
"last": "Letzte",
"next": "Nächste",
"previous": "Zurück"
},
},
"pageLength": 10,
"buttons" : {
"className" : "btn-danger"
}
});
})
</script>
<hr>
<h5>Logins (letzten 50)</h5>
{% for ele in logdata reversed %}
{{forloop.revcounter}}. {{ele|date:"d.m.Y, H:i"}}<br />

View File

@ -13,7 +13,8 @@ import csv
from auditlog.models import LogEntry
from datetime import date, datetime
import json
from users.models import UserYearAbsenceInfo, UserTime
from timemanagement.models import Workday, Absence
'''
Prüfung, ob angemeldeter User Mitarbeiterstatus hat. IMMER PER DISPATCH EINBAUEN!
'''
@ -195,9 +196,12 @@ class AdmUserSingle(TemplateView):
return redirect("login")
def get_context_data(self, **kwargs):
userrequested = User.objects.get(pk=kwargs['uspk'])
context = super().get_context_data(**kwargs)
context.update({'active_link' : "adm-users"})
context.update({'userdata' : User.objects.get(pk=kwargs['uspk'])})
context.update({'userdata' : userrequested})
# Loading Logindata
logdata = LogEntry.objects.filter(object_pk=kwargs['uspk'])[:50]
@ -215,6 +219,10 @@ class AdmUserSingle(TemplateView):
context.update({'logdata' : logdata_logins})
context.update({'workdays' : Workday.objects.filter(user=userrequested)})
context.update({'absences' : Absence.objects.filter(user=userrequested)})
context.update({'yearinfo' : UserYearAbsenceInfo.objects.filter(user=userrequested)})
context.update({'usertimedata' : UserTime.objects.get(user=userrequested)})
return context

View File

@ -161,7 +161,7 @@ a.disabled {
</small></p>
</div>
<hr>
<small>Erlaubte Dateitypen: doc/docx, xls/xlsx, odt, ods, ppt/pptx, mov, avi, svg, png, jpg/jpeg, mp3, mp4, wav, zip, rar, mwv, flv, eps, txt, pdf. Maximale Uploadgröße: 2 GB</small>
<small>Erlaubte Dateitypen: doc/docx, xls/xlsx/xlsm, odt, ods, ppt/pptx, mov, avi, svg, png, jpg/jpeg, mp3, mp4, wav, zip, rar, mwv, flv, eps, txt, pdf. Maximale Uploadgröße: 2 GB</small>
</div>
{% endif %}
<!-- MODAL CHANGE DIRNAME -->
@ -223,7 +223,7 @@ a.disabled {
</button>
</div>
<div class="modal-body">
Die Datei konnte nicht hochgeladen werden. Bitte prüfen Sie die erlaubten Dateitypen und den verfügbaren Speicherplatz. Andernfalls melden Sie sich bei unserem Support support@digitale-agentur.com!
Die Datei konnte nicht hochgeladen werden. Bitte prüfen Sie die erlaubten Dateitypen und den verfügbaren Speicherplatz. <a href="{% url 'supportda' %}">Andernfalls melden Sie sich bei unserem Support</a>!
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" data-dismiss="modal">Schließen</button>
@ -427,7 +427,7 @@ a.disabled {
</div>
<!-- UPLOADING PROCESS -->
<div class="modal fade" id="uploadModalProgress" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal fade" id="uploadModalProgress" tabindex="-1" role="dialog" data-backdrop="static" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
@ -507,6 +507,10 @@ if ( isIE ) {
$('#dirfilestable').DataTable({
columnDefs: [
{ 'targets': 3, type: 'date-euro' },
{ 'targets': 4, type: 'date-euro' },
],
responsive : true,
"language": {
"search" : "Suche",

View File

@ -760,7 +760,10 @@ function mainmodalAreaSave(){
$(document).ready(function(){
{% for area in agencyareas %}
$('#areatask_{{area.pk}}_table').DataTable({
$('#areatask_{{area.pk}}_table').DataTable({
columnDefs: [
{ 'targets': 3, type: 'date-euro' },
],
"language": {
"search" : "Suche",
"info": "Zeige _START_ bis _END_ von _TOTAL_ Einträgen",

BIN
dump.rdb

Binary file not shown.

View File

@ -109,6 +109,10 @@
$('#send').tab('show');
$('#allmessages').DataTable({
columnDefs: [
{ 'targets': 1, type: 'date-euro' },
],
"language": {
"search" : "Suche",
"info": "Zeige _START_ bis _END_ von _TOTAL_ Einträgen",

View File

@ -180,6 +180,10 @@
$(document).ready(function(){
$('#activenews').DataTable({
columnDefs: [
{ 'targets': 2, type: 'date-euro' },
],
"language": {
"search" : "Suche",
"info": "Zeige _START_ bis _END_ von _TOTAL_ Einträgen",
@ -200,6 +204,10 @@ $(document).ready(function(){
});
$('#archnews').DataTable({
columnDefs: [
{ 'targets': 2, type: 'date-euro' },
],
"language": {
"search" : "Suche",
"info": "Zeige _START_ bis _END_ von _TOTAL_ Einträgen",
@ -220,6 +228,10 @@ $(document).ready(function(){
});
$('#comingnews').DataTable({
columnDefs: [
{ 'targets': 2, type: 'date-euro' },
],
"language": {
"search" : "Suche",
"info": "Zeige _START_ bis _END_ von _TOTAL_ Einträgen",

View File

@ -109,6 +109,10 @@
$(document).ready(function(){
$('#agntable').DataTable({
columnDefs: [
{ 'targets': 2, type: 'date-euro' },
],
"language": {
"search" : "Suche",
"info": "Zeige _START_ bis _END_ von _TOTAL_ Einträgen",

View File

@ -51,8 +51,15 @@
</div>
<script type="text/javascript">
$(document).ready( function () {
$('#standardstable').DataTable({
responsive: true,
columnDefs: [
{ 'targets': 2, type: 'date-euro' },
{ 'targets': 3, type: 'date-euro' },
],
"language": {
"search" : "Suche",
"info": "Zeige _START_ bis _END_ von _TOTAL_ Einträgen",

View File

@ -64,7 +64,15 @@ function goToArea(name){
}
$(document).ready( function () {
$('#standardstable').DataTable({
columnDefs: [
{ 'targets': 2, type: 'date-euro' },
{ 'targets': 4, type: 'date-euro' }
],
order: [
[2, 'desc'] // date column
],
responsive: true,
"language": {
"search" : "Suche",

View File

@ -98,6 +98,9 @@
$('#agnstandards').DataTable({
columnDefs: [
{ 'targets': 2, type: 'date-euro' },
],
responsive: true,
"language": {
"search" : "Suche",

View File

@ -270,6 +270,10 @@
$('#userownstandards').DataTable({
responsive: true,
columnDefs: [
{ 'targets': 1, type: 'date-euro' },
{ 'targets': 3, type: 'date-euro' }
],
"language": {
"search" : "Suche",
"zeroRecords": "Nichts gefunden",
@ -291,6 +295,10 @@
$('#unpubstandardsofuser').DataTable({
responsive: true,
columnDefs: [
{ 'targets': 1, type: 'date-euro' },
{ 'targets': 3, type: 'date-euro' }
],
"language": {
"search" : "Suche",
"zeroRecords": "Nichts gefunden",

View File

@ -63,6 +63,8 @@
<!-- DATABLES JS -->
<!--<script type="text/javascript" src="https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"></script>-->
<script type="text/javascript" src="{%static 'users/js/jquery_dataTables.min.js' %}"></script>
<script type="text/javascript" src="https://cdn.datatables.net/plug-ins/1.10.22/dataRender/datetime.js"></script>
<!--<script type="text/javascript" src="https://cdn.datatables.net/1.10.20/js/dataTables.bootstrap4.min.js"></script>-->
<script type="text/javascript" src="{%static 'users/js/bs4_dt.js' %}"></script>

View File

@ -1272,7 +1272,8 @@ def support(request):
"email": mail,
"subject": 'Digitale Agentur: '+problemconc,
"ip": "1.1.1.1",
"message": "*****************************\nAgentur: "+ request.user.profile.agency.name +" (ID: "+ str(request.user.profile.agency.pk) +")\nBenutzer: "+request.user.first_name+" "+request.user.last_name+" (ID: "+ str(request.user.pk) +")\n*******************************\n\n" + problem
""
"message": "*****************************\nAgentur: "+ request.user.profile.agency.name +" (ID: "+ str(request.user.profile.agency.pk) +")\nBenutzer: "+request.user.first_name+" "+request.user.last_name+" (ID: "+ str(request.user.pk) +")\nBrowser: " + request.META['HTTP_USER_AGENT'] + "\n*******************************\n\n" + problem
#"attachments" : attachments
}
@ -1285,7 +1286,7 @@ def support(request):
messages.warning(request, f'Supportanfrage fehlgeschlagen!' + str(r))
else:
messages.success(request, f'Supportanfrage erfolgreich! Ihre Ticketnummer ist '+ str(r.json()) +'!')
# TASK: Hier Browserversion usw. mit einfügen beim TICKET!
send_mail(
"Digitale Agentur: " + str(problemconc),
"Hallo " + name, ", wir haben Ihre Anfrage unter der Ticketnummer " + str(r.json()) + " aufgenommen. Vielen Dank. Ihr Team der Digitalen Agentur",
@ -1559,7 +1560,7 @@ def cronactionsdaily(request, code):
targettworktime = user.usertime.wd_so
# Es wird nur ein Arbeitstag erstellt, wenn KEINE Abwesenheiten vorliegen und der Nutzer an diesem Tag arbeiten muss
if(workdays_yesterday == 0 and absencecheck(user, yesterday) == False and targettworktime > 0.0 and user.usertime.usetime_start <= today):
if(workdays_yesterday == 0 and absencecheck(user, yesterday) == False and targettworktime > 0.0 and user.usertime.usetime_start < today):
workdaytemp = Workday(user=user, agency=user.profile.agency, start=datetime(yesterday.year, yesterday.month, yesterday.day, 8, 0), end=datetime(yesterday.year, yesterday.month, yesterday.day, 8, 0), target=targettworktime)
workdaytemp.save()
except: