Merge branch 'spidev' into 'master'

Zeiterfassung Update/Bugfix/Migration

See merge request fronk/thetool!269
This commit is contained in:
Frank Schubert
2024-02-27 13:36:04 +00:00
14 changed files with 583 additions and 32 deletions
+8 -2
View File
@@ -86,6 +86,11 @@ table = $('#datatable').DataTable({
$('#must-time').text(json.time.must);
$('#holidays').text(json.time.holidays);
$('#plushours').text(json.time.plushours);
if ($("#plushours").text().includes("-")) {
$('#plushours-label').css('background-color', '#fda7a7');
} else {
$('#plushours-label').css('background-color', '#d0fbd9');
}
if (json.time.auto_workinghours == "1") {
$('#auto-workinghours-button').show();
}
@@ -317,7 +322,8 @@ $(document).ready(function () {
});
$("body").on("click", "#auto-workinghours-button", function () {
const date = new Date($('#date').val());
var timestamp = $('#dataweek').val() * 1000
const date = new Date(timestamp);
var day = date.getDay(),
diff = date.getDate() - day + (day == 0 ? -6 : 1);
diff = date.getDate() - day + (day == 0 ? -6 : 1);
@@ -333,7 +339,7 @@ $(document).ready(function () {
if (confirm('Sollen die Arbeitszeiten von ' + monday + ' bis ' + sunday + ' automatisch eingetragen werden?')) {
$.post(autoWorkinghoursUrl, {
dataweek: $.trim($('#date').val()),
dataweek: $.trim($('#dataweek').val()),
ajax: 1
}).done(function (data) {
table.ajax.reload();
+32 -1
View File
@@ -90,6 +90,7 @@ table = $('#datatable').DataTable({
$('#must-time').text(json.time.must);
$('#holidays').text(json.time.holidays);
$('#plushours').text(json.time.plushours);
$('#selectsearch').change();
return json.data;
}
@@ -182,6 +183,7 @@ if (state) {
$(document).ready(function () {
$(".select2").select2();
$("body").on("change", "#timerecordingCategory_id", function () {
if (parseInt($(this).find(':selected').data('hourday')) === 2) {
$("#endtime-div").hide();
@@ -295,6 +297,34 @@ $(document).ready(function () {
$("body").on("change", "#dataweek,#datamonth,#datayear", function () {
table.ajax.reload(null, false);
});
$("body").on("change", "#selectsearch", function () {
var datatype;
if (!$(this).val()) {
$('#must-time').text('N/A');
$('#is-time').text('N/A');
} else {
$('.display-calendar').each(function (index) {
if ($(this).hasClass('active-calendar')) {
datatype = $(this).data('datatype');
}
});
if (datatype == 1 || datatype == 2) {
$.post(requestTimesUrl, {
id: $.trim($(this).data('id')),
datatype: datatype,
user_id: $(this).find(':selected').data('userid'),
dataweek: $('#dataweek').val(),
datamonth: $('#datamonth').val(),
ajax: 1
}).done(function (data) {
var json = $.parseJSON(data);
$('#must-time').text(json.time.must);
$('#is-time').text(json.time.is);
});
}
}
});
$("body").on("click", ".display-calendar", function () {
$('.display-calendar').each(function (index) {
$(this).removeClass('active-calendar');
@@ -350,7 +380,7 @@ $(document).ready(function () {
e.preventDefault();
$('#alert-box').remove();
var userid;
userid = $('#user_id_select').val();
userid = $('#user_id_select').val();
var businesstrip = false;
if ($('#businesstrip').prop('checked') == true) {
businesstrip = 1;
@@ -403,5 +433,6 @@ $(document).ready(function () {
});
});
$('#timerecordingCategory_id').change();
})
;