Zeiterfassung update

This commit is contained in:
Spitzer Daniel
2024-02-04 11:49:57 +01:00
parent eb20fd935e
commit e57889ee6c
18 changed files with 1148 additions and 331 deletions
+21 -8
View File
@@ -78,10 +78,13 @@ table = $('#datatable').DataTable({
d.dataweek = $('#dataweek').val();
d.datamonth = $('#datamonth').val();
d.datayear = $('#datayear').val();
},
"dataSrc": function (json) {
$('#is-time').text(json.time.is);
$('#must-time').text(json.time.must);
$('#holidays').text(json.time.holidays);
$('#plushours').text(json.time.plushours);
return json.data;
}
@@ -120,8 +123,8 @@ table = $('#datatable').DataTable({
}
, {
"data": {
_: "commend.commend",
"sort": "commend.order"
_: "comment.comment",
"sort": "comment.order"
},
className: "text-center"
}, {
@@ -206,9 +209,9 @@ $(document).ready(function () {
})
}
if (parseInt($(this).find(':selected').data('comment')) === 1) {
$('#commend').prop("required", true);
$('#comment').prop("required", true);
} else {
$('#commend').prop("required", false);
$('#comment').prop("required", false);
}
});
$("body").on("change", "#date", function () {
@@ -216,6 +219,8 @@ $(document).ready(function () {
if ($('#date').val() > $('#enddate').val()) {
$('#enddate').prop("min", $('#date').val());
$('#enddate').val($('#date').val());
} else {
$('#enddate').prop("min", $('#date').val());
}
}
});
@@ -237,7 +242,7 @@ $(document).ready(function () {
$('#start').val($(this).data('start'));
$('#end').val($(this).data('end'));
$('#enddate').val($(this).data('enddate'));
$('#commend').val($(this).data('commend'));
$('#comment').val($(this).data('comment'));
$('.alert-success').remove();
window.scrollTo(0, 0);
});
@@ -248,7 +253,7 @@ $(document).ready(function () {
$('#id').val('');
});
$("body").on("change", "#dataweek,#datamonth", function () {
$("body").on("change", "#dataweek,#datamonth,#datayear", function () {
table.ajax.reload();
});
$("body").on("click", ".display-calendar", function () {
@@ -258,11 +263,19 @@ $(document).ready(function () {
$(this).addClass('active-calendar');
if ($(this).data('datatype') == "1") {
console.log($(this).data('datatype'));
$('#dataweek-col').show();
$('#dynamictime-div').show();
$('#datamonth-col').hide();
$('#datayear-col').hide();
} else if ($(this).data('datatype') == "2") {
$('#datamonth-col').show();
$('#dynamictime-div').show();
$('#dataweek-col').hide();
$('#datayear-col').hide();
} else if ($(this).data('datatype') == "3") {
$('#datayear-col').show();
$('#dynamictime-div').hide();
$('#datamonth-col').hide();
$('#dataweek-col').hide();
}
$(".select2").select2();
@@ -290,7 +303,7 @@ $(document).ready(function () {
enddate: $.trim($('#enddate').val()),
start: $.trim($('#start').val()),
end: $.trim($('#end').val()),
commend: $.trim($('#commend').val()),
comment: $.trim($('#comment').val()),
ajax: 1
}).done(function (data) {
var result = $.parseJSON(data);