Zeiterfassung update

* Kalender Implementation
* Dienstreise Funktionalitäten
This commit is contained in:
Spitzer Daniel
2024-02-18 11:36:16 +01:00
parent 36b3f1e0f8
commit d03e31134b
11 changed files with 334 additions and 7 deletions
+22
View File
@@ -214,6 +214,18 @@ $(document).ready(function () {
} else {
$('#comment').prop("required", false);
}
if (parseInt($(this).find(':selected').data('businesstrip')) === 1) {
$('#businesstrip-div').show();
$('#businesstrip').prop("checked", false);
$('#businesstrip_info').val('');
$('#businesstrip_info').hide();
} else {
$('#businesstrip-div').hide();
$('#businesstrip').prop("checked", false);
$('#businesstrip_info').val('');
$('#businesstrip_info').hide();
}
});
$("body").on("change", "#date", function () {
if ($('#enddate-div').css('display') === "block") {
@@ -309,6 +321,10 @@ $(document).ready(function () {
$('form').submit(function (e) {
e.preventDefault();
$('#alert-box').remove();
var businesstrip = false;
if ($('#businesstrip').prop('checked') == true) {
businesstrip = 1;
}
$.post(insertUrl, {
id: $.trim($('#id').val()),
timerecordingCategory_id: $.trim($('#timerecordingCategory_id').val()),
@@ -317,6 +333,8 @@ $(document).ready(function () {
start: $.trim($('#start').val()),
end: $.trim($('#end').val()),
comment: $.trim($('#comment').val()),
businesstrip: businesstrip,
businesstrip_info: $.trim($('#businesstrip_info').val()),
ajax: 1
}).done(function (data) {
var result = $.parseJSON(data);
@@ -328,6 +346,10 @@ $(document).ready(function () {
<h5><i class="icon fas fa-check"></i> Erfolgreich</h5>
` + result.message + `</div>
</div>`);
$('#businesstrip').prop('checked', false);
$('#businesstrip_info').hide();
$('#businesstrip_info').val('');
$('#businesstrip_info').prop('required', false);
}
if (result.state === "error") {
$('.wrapper .container-fluid').prepend(`<div id="alert-box" class="row">