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>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
|
|
@ -87,6 +90,9 @@ Gleitzeitkonto:
|
|||
$("#starttime").html("{{formattetstarttime_last_start}}");
|
||||
$("#endtime").html("{{formattetstarttime_last_end}}");
|
||||
$("#breaksum").html("00:00:00");
|
||||
|
||||
$("#timemanagement_clock").toggle();
|
||||
|
||||
//day info
|
||||
{% else %}
|
||||
|
||||
|
|
@ -233,6 +239,7 @@ Gleitzeitkonto:
|
|||
}
|
||||
start = data["wd_starttime_complete"];
|
||||
realTimeClock();
|
||||
location.href = location.href;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -274,7 +281,6 @@ Gleitzeitkonto:
|
|||
realTimeClock();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -225,8 +225,48 @@
|
|||
</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">
|
||||
|
||||
function loadNewAbsenceByUser(userid){
|
||||
$("#chooseUserForNewAbsence").modal("toggle");
|
||||
recalculateChoosenDays(userid);
|
||||
}
|
||||
|
||||
function showNewAbsenceByUser(){
|
||||
$("#chooseUserForNewAbsence").modal("toggle");
|
||||
}
|
||||
|
||||
|
||||
var choosenyear = "{{activeyear}}";
|
||||
|
||||
function goFastToMonth(month){
|
||||
|
|
@ -334,6 +374,8 @@ function nextMonth(){
|
|||
var selectedElements = [];
|
||||
var active_row = "";
|
||||
var sameday = false;
|
||||
var userid = "";
|
||||
|
||||
|
||||
var user_has_right = "{{user|usergperm:"absencemanager"}}";
|
||||
if(user_has_right == "True"){
|
||||
|
|
@ -343,29 +385,52 @@ else{
|
|||
user_has_right = false;
|
||||
}
|
||||
|
||||
function recalculateChoosenDays(){
|
||||
function recalculateChoosenDays(userid=false){
|
||||
seldates = [];
|
||||
userid = "";
|
||||
for(i = 0; i < selectedElements.length; i++){
|
||||
seldates.push(selectedElements[i].split("_")[3]);
|
||||
userid = selectedElements[i].split("_")[2];
|
||||
}
|
||||
seldates.sort();
|
||||
date_start = new Date(seldates[0])
|
||||
date_end = new Date(seldates[seldates.length-1])
|
||||
|
||||
//Click on Table
|
||||
if(userid == false){
|
||||
|
||||
if(+date_start == +date_end){
|
||||
sameday = true;
|
||||
for(i = 0; i < selectedElements.length; i++){
|
||||
seldates.push(selectedElements[i].split("_")[3]);
|
||||
userid = selectedElements[i].split("_")[2];
|
||||
}
|
||||
seldates.sort();
|
||||
date_start = new Date(seldates[0])
|
||||
date_end = new Date(seldates[seldates.length-1])
|
||||
|
||||
|
||||
if(+date_start == +date_end){
|
||||
sameday = true;
|
||||
}
|
||||
else{
|
||||
sameday = false;
|
||||
}
|
||||
}
|
||||
//Click on Button
|
||||
else{
|
||||
sameday = false;
|
||||
//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_ishalf").show();
|
||||
$("#div_id_end").show();
|
||||
$("#div_id_end_ishalf").show();
|
||||
|
||||
$("#id_start").data("DateTimePicker").date(date_start);
|
||||
$("#id_end").data("DateTimePicker").date(date_end);
|
||||
|
||||
|
||||
console.log(userid);
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "{% url 'tm-ajax' %}",
|
||||
|
|
@ -381,7 +446,6 @@ function recalculateChoosenDays(){
|
|||
},
|
||||
success : function(data){
|
||||
|
||||
console.log(data)
|
||||
if(data["other_absences"] != false){
|
||||
$("#otherholidays").show();
|
||||
$("#otherholidays_users").html(data["other_absences"]);
|
||||
|
|
@ -421,6 +485,8 @@ function recalculateChoosenDays(){
|
|||
$("#start_absence_contract").prop("disabled", false);
|
||||
}
|
||||
|
||||
$("#username_abscence").html(data["choosenuser_name"]);
|
||||
|
||||
/*
|
||||
|
||||
if(seldates.length == 1){
|
||||
|
|
@ -437,7 +503,9 @@ function recalculateChoosenDays(){
|
|||
});
|
||||
}
|
||||
function recalculateChoosenDaysAfterInit(){
|
||||
|
||||
|
||||
console.log("CHANGE!")
|
||||
console.log(userid);
|
||||
new_start = $("#id_start").datepicker().val();
|
||||
new_end = $("#id_end").datepicker().val();
|
||||
|
||||
|
|
@ -467,9 +535,7 @@ function recalculateChoosenDaysAfterInit(){
|
|||
endday_info : $("#id_endday_info").val(),
|
||||
},
|
||||
success : function(data){
|
||||
|
||||
console.log(data);
|
||||
|
||||
|
||||
if(data["other_absences"] != false){
|
||||
$("#otherholidays").show();
|
||||
$("#otherholidays_users").html(data["other_absences"]);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,9 @@
|
|||
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
|
||||
<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">
|
||||
<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>
|
||||
<hr>
|
||||
|
||||
|
|
|
|||
|
|
@ -906,7 +906,8 @@ def TimeAjax(request):
|
|||
"need_days_next" : need_days_next,
|
||||
"need_days_this" : need_days_this,
|
||||
"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
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -987,7 +987,7 @@ def absencecheck(user, daytocheck):
|
|||
|
||||
return returnstat
|
||||
|
||||
# CRONJOBS UM 00:01!
|
||||
# CRONJOBS UM 00:05!
|
||||
def cronactionsdaily(request, code):
|
||||
data = {}
|
||||
if(code == settings.CRONAPIKEY):
|
||||
|
|
@ -1044,7 +1044,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):
|
||||
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()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue