Bug zwischenstand
This commit is contained in:
parent
8af1eeb37a
commit
557b3fb0a4
|
|
@ -37,6 +37,9 @@ Gleitzeitkonto:
|
||||||
<b><span style="color: red">-{{actualaccounttime.0}} Stunden</span></b>
|
<b><span style="color: red">-{{actualaccounttime.0}} Stunden</span></b>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -87,6 +90,9 @@ Gleitzeitkonto:
|
||||||
$("#starttime").html("{{formattetstarttime_last_start}}");
|
$("#starttime").html("{{formattetstarttime_last_start}}");
|
||||||
$("#endtime").html("{{formattetstarttime_last_end}}");
|
$("#endtime").html("{{formattetstarttime_last_end}}");
|
||||||
$("#breaksum").html("00:00:00");
|
$("#breaksum").html("00:00:00");
|
||||||
|
|
||||||
|
$("#timemanagement_clock").toggle();
|
||||||
|
|
||||||
//day info
|
//day info
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
|
|
@ -233,6 +239,7 @@ Gleitzeitkonto:
|
||||||
}
|
}
|
||||||
start = data["wd_starttime_complete"];
|
start = data["wd_starttime_complete"];
|
||||||
realTimeClock();
|
realTimeClock();
|
||||||
|
location.href = location.href;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -274,7 +281,6 @@ Gleitzeitkonto:
|
||||||
realTimeClock();
|
realTimeClock();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -225,8 +225,48 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Modal with all users for OnClick-Add-Absence -->
|
||||||
|
{% if user|usergperm:"absencemanager" %}
|
||||||
|
<div class="modal fade" tabindex="-1" id="chooseUserForNewAbsence" data-backdrop="static">
|
||||||
|
<div class="modal-dialog" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title">Mitarbeiter auswählen</h5>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
Bitte wählen Sie den Mitarbeiter aus, für den Sie eine neue Abwesenheit anlegen wollen.
|
||||||
|
<hr>
|
||||||
|
<div style="float: left;">
|
||||||
|
{% for us in usersofagency %}
|
||||||
|
<button class="btn btn-primary mr-2 mb-2" onclick="javascript:loadNewAbsenceByUser({{us.pk}})">
|
||||||
|
{{us.get_full_name}}
|
||||||
|
</button>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-primary " data-dismiss="modal">Abbrechen</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
function loadNewAbsenceByUser(userid){
|
||||||
|
$("#chooseUserForNewAbsence").modal("toggle");
|
||||||
|
recalculateChoosenDays(userid);
|
||||||
|
}
|
||||||
|
|
||||||
|
function showNewAbsenceByUser(){
|
||||||
|
$("#chooseUserForNewAbsence").modal("toggle");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
var choosenyear = "{{activeyear}}";
|
var choosenyear = "{{activeyear}}";
|
||||||
|
|
||||||
function goFastToMonth(month){
|
function goFastToMonth(month){
|
||||||
|
|
@ -334,6 +374,8 @@ function nextMonth(){
|
||||||
var selectedElements = [];
|
var selectedElements = [];
|
||||||
var active_row = "";
|
var active_row = "";
|
||||||
var sameday = false;
|
var sameday = false;
|
||||||
|
var userid = "";
|
||||||
|
|
||||||
|
|
||||||
var user_has_right = "{{user|usergperm:"absencemanager"}}";
|
var user_has_right = "{{user|usergperm:"absencemanager"}}";
|
||||||
if(user_has_right == "True"){
|
if(user_has_right == "True"){
|
||||||
|
|
@ -343,9 +385,12 @@ else{
|
||||||
user_has_right = false;
|
user_has_right = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function recalculateChoosenDays(){
|
function recalculateChoosenDays(userid=false){
|
||||||
seldates = [];
|
seldates = [];
|
||||||
userid = "";
|
|
||||||
|
//Click on Table
|
||||||
|
if(userid == false){
|
||||||
|
|
||||||
for(i = 0; i < selectedElements.length; i++){
|
for(i = 0; i < selectedElements.length; i++){
|
||||||
seldates.push(selectedElements[i].split("_")[3]);
|
seldates.push(selectedElements[i].split("_")[3]);
|
||||||
userid = selectedElements[i].split("_")[2];
|
userid = selectedElements[i].split("_")[2];
|
||||||
|
|
@ -354,18 +399,38 @@ function recalculateChoosenDays(){
|
||||||
date_start = new Date(seldates[0])
|
date_start = new Date(seldates[0])
|
||||||
date_end = new Date(seldates[seldates.length-1])
|
date_end = new Date(seldates[seldates.length-1])
|
||||||
|
|
||||||
|
|
||||||
if(+date_start == +date_end){
|
if(+date_start == +date_end){
|
||||||
sameday = true;
|
sameday = true;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
sameday = false;
|
sameday = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
//Click on Button
|
||||||
|
else{
|
||||||
|
//Show Modal with all users of agency
|
||||||
|
$("#chooseUserForNewAbsence").modal("toggle");
|
||||||
|
|
||||||
|
//Set initial Date-Infos
|
||||||
|
var today = new Date();
|
||||||
|
var tempdate_user = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
|
||||||
|
|
||||||
|
date_start = new Date(tempdate_user);
|
||||||
|
date_end = new Date(tempdate_user);
|
||||||
|
sameday = true;
|
||||||
|
userid = userid.toString();
|
||||||
|
}
|
||||||
|
|
||||||
$("#div_id_end").show();
|
$("#div_id_end").show();
|
||||||
$("#div_id_end_ishalf").show();
|
$("#div_id_end_ishalf").show();
|
||||||
|
|
||||||
$("#id_start").data("DateTimePicker").date(date_start);
|
$("#id_start").data("DateTimePicker").date(date_start);
|
||||||
$("#id_end").data("DateTimePicker").date(date_end);
|
$("#id_end").data("DateTimePicker").date(date_end);
|
||||||
|
|
||||||
|
|
||||||
|
console.log(userid);
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: "{% url 'tm-ajax' %}",
|
url: "{% url 'tm-ajax' %}",
|
||||||
|
|
@ -381,7 +446,6 @@ function recalculateChoosenDays(){
|
||||||
},
|
},
|
||||||
success : function(data){
|
success : function(data){
|
||||||
|
|
||||||
console.log(data)
|
|
||||||
if(data["other_absences"] != false){
|
if(data["other_absences"] != false){
|
||||||
$("#otherholidays").show();
|
$("#otherholidays").show();
|
||||||
$("#otherholidays_users").html(data["other_absences"]);
|
$("#otherholidays_users").html(data["other_absences"]);
|
||||||
|
|
@ -421,6 +485,8 @@ function recalculateChoosenDays(){
|
||||||
$("#start_absence_contract").prop("disabled", false);
|
$("#start_absence_contract").prop("disabled", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$("#username_abscence").html(data["choosenuser_name"]);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
if(seldates.length == 1){
|
if(seldates.length == 1){
|
||||||
|
|
@ -438,6 +504,8 @@ function recalculateChoosenDays(){
|
||||||
}
|
}
|
||||||
function recalculateChoosenDaysAfterInit(){
|
function recalculateChoosenDaysAfterInit(){
|
||||||
|
|
||||||
|
console.log("CHANGE!")
|
||||||
|
console.log(userid);
|
||||||
new_start = $("#id_start").datepicker().val();
|
new_start = $("#id_start").datepicker().val();
|
||||||
new_end = $("#id_end").datepicker().val();
|
new_end = $("#id_end").datepicker().val();
|
||||||
|
|
||||||
|
|
@ -468,8 +536,6 @@ function recalculateChoosenDaysAfterInit(){
|
||||||
},
|
},
|
||||||
success : function(data){
|
success : function(data){
|
||||||
|
|
||||||
console.log(data);
|
|
||||||
|
|
||||||
if(data["other_absences"] != false){
|
if(data["other_absences"] != false){
|
||||||
$("#otherholidays").show();
|
$("#otherholidays").show();
|
||||||
$("#otherholidays_users").html(data["other_absences"]);
|
$("#otherholidays_users").html(data["other_absences"]);
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@
|
||||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.6/Chart.bundle.min.js"></script>
|
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.6/Chart.bundle.min.js"></script>
|
||||||
<div class="content-section col-12">
|
<div class="content-section col-12">
|
||||||
<h3>Abwesenheiten{% if request.user.profile.showtooltips %} <small><i data-toggle="tooltip" data-placement="top" title="Bearbeiten Sie hier Ihre Abwesenheiten." class="far fa-question-circle"></i></small>{% endif %}
|
<h3>Abwesenheiten{% if request.user.profile.showtooltips %} <small><i data-toggle="tooltip" data-placement="top" title="Bearbeiten Sie hier Ihre Abwesenheiten." class="far fa-question-circle"></i></small>{% endif %}
|
||||||
|
<small><i onclick="javascript:$('#youtubevideoinformation').modal('toggle');" class="far fa-play-circle"></i></small>
|
||||||
|
{% if user|usergperm:"absencemanager" %}<button class="btn btn-primary btn-sm" onclick="javascript:showNewAbsenceByUser()" style="float: right;"><i class="fas fa-plus"></i> Abwesenheit</button> {% endif %}
|
||||||
</h3>
|
</h3>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -906,7 +906,8 @@ def TimeAjax(request):
|
||||||
"need_days_next" : need_days_next,
|
"need_days_next" : need_days_next,
|
||||||
"need_days_this" : need_days_this,
|
"need_days_this" : need_days_this,
|
||||||
"other_absences" : other_absences_string,
|
"other_absences" : other_absences_string,
|
||||||
"userown_absences" : userown_absences_string
|
"userown_absences" : userown_absences_string,
|
||||||
|
"choosenuser_name" : user.first_name + " " + user.last_name
|
||||||
}
|
}
|
||||||
# REQUEST USER NO RIGHTS
|
# REQUEST USER NO RIGHTS
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -987,7 +987,7 @@ def absencecheck(user, daytocheck):
|
||||||
|
|
||||||
return returnstat
|
return returnstat
|
||||||
|
|
||||||
# CRONJOBS UM 00:01!
|
# CRONJOBS UM 00:05!
|
||||||
def cronactionsdaily(request, code):
|
def cronactionsdaily(request, code):
|
||||||
data = {}
|
data = {}
|
||||||
if(code == settings.CRONAPIKEY):
|
if(code == settings.CRONAPIKEY):
|
||||||
|
|
@ -1044,7 +1044,7 @@ def cronactionsdaily(request, code):
|
||||||
targettworktime = user.usertime.wd_so
|
targettworktime = user.usertime.wd_so
|
||||||
|
|
||||||
# Es wird nur ein Arbeitstag erstellt, wenn KEINE Abwesenheiten vorliegen und der Nutzer an diesem Tag arbeiten muss
|
# 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):
|
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 = 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()
|
workdaytemp.save()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue