Erfolgreich
` + result.message + `
`);
+ $('#businesstrip').prop('checked', false);
+ $('#businesstrip_info').hide();
+ $('#businesstrip_info').val('');
+ $('#businesstrip_info').prop('required', false);
}
if (result.state === "error") {
$('.wrapper .container-fluid').prepend(`
diff --git a/public/js/pages/timerecordingReport/index.js b/public/js/pages/timerecordingReport/index.js
index ba924874e..bc572c3ec 100644
--- a/public/js/pages/timerecordingReport/index.js
+++ b/public/js/pages/timerecordingReport/index.js
@@ -29,8 +29,13 @@ $('#filterrow th').each(function (i) {
if (hidesearch.includes($(this).index())) {
- } else if (columnfilter.includes($(this).index())) {
- $(this).html('');
+ } else if ($(this).index() == 0) {
+ var options = '';
+ $('#user_id_select').find('option').each(function () {
+ options += '';
+ });
+
+ $(this).html('');
} else {
$(this).html('');
@@ -61,7 +66,7 @@ table = $('#datatable').DataTable({
$('#datatable_filter').append('');
$('#clear_cookie').click(function () {
$('#filterrow input').val('');
- $('#filterrow select').val('');
+ $('#filterrow select').val('').change();
table.search('').columns().search('').draw();
});
},
@@ -220,6 +225,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") {
@@ -256,6 +273,12 @@ $(document).ready(function () {
$('#end').val($(this).data('end'));
$('#enddate').val($(this).data('enddate'));
$('#comment').val($(this).data('comment'));
+ if ($(this).data('businesstrip') == 1) {
+ $('#businesstrip').prop("checked", true);
+ $('#businesstrip_info').val($(this).data('businesstripinfo'));
+ $('#businesstrip_info').show();
+ $('#businesstrip_info').prop('required', true);
+ }
$('.alert-success').remove();
window.scrollTo(0, 0);
});
@@ -297,6 +320,21 @@ $(document).ready(function () {
$(".select2").select2();
table.ajax.reload(null, false);
});
+
+ $("body").on("click", "#businesstrip", function () {
+ if ($(this).prop('checked') == true) {
+ $('#businesstrip_info').show();
+ $('#businesstrip_info').prop('required', true);
+
+ } else {
+ $('#businesstrip_info').hide();
+ $('#businesstrip_info').val('');
+ $('#businesstrip_info').prop('required', false);
+ }
+
+
+ });
+
$("body").on("click", ".delete-item", function () {
if (confirm('Buchung wirklich löschen?')) {
$.post(deleteUrl, {
@@ -315,6 +353,10 @@ $(document).ready(function () {
if ($.trim($('#id').val())) {
userid = $('#user_id_input').val();
}
+ var businesstrip = false;
+ if ($('#businesstrip').prop('checked') == true) {
+ businesstrip = 1;
+ }
$.post(insertUrl, {
id: $.trim($('#id').val()),
@@ -325,6 +367,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);
@@ -336,6 +380,10 @@ $(document).ready(function () {
Erfolgreich
` + result.message + `
`);
+ $('#businesstrip').prop('checked', false);
+ $('#businesstrip_info').hide();
+ $('#businesstrip_info').val('');
+ $('#businesstrip_info').prop('required', false);
}
if (result.state === "error") {
$('.wrapper .container-fluid').prepend(`