diff --git a/Layout/default/TimerecordingCalendar/Index.php b/Layout/default/TimerecordingCalendar/Index.php
index d93db7467..1b7516161 100644
--- a/Layout/default/TimerecordingCalendar/Index.php
+++ b/Layout/default/TimerecordingCalendar/Index.php
@@ -53,7 +53,6 @@ $daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
endforeach;
?>
cindex = = $counter ?>;
- console.log(holiDays);
$.getJSON(requestUrl, function (data) {
}).done(function (json) {
@@ -133,7 +132,7 @@ $daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
hiddenDays: [],
navLinks: 'true',
events: [],
- height: 800,
+ height: 700,
eventSources: [holidayEvents, birthdayEvents]
});
calendar.render();
diff --git a/Layout/default/TimerecordingReport/Index.php b/Layout/default/TimerecordingReport/Index.php
index 0b6f31610..b30b931c3 100644
--- a/Layout/default/TimerecordingReport/Index.php
+++ b/Layout/default/TimerecordingReport/Index.php
@@ -139,7 +139,8 @@ $years[time() - 31536000] = date('Y', time() - 31536000);
+ data-hourday="= $timerecordingCategories->hourday ?>"
+ data-businesstrip="= $timerecordingCategories->businesstrip ?>">= $timerecordingCategories->name ?>
@@ -191,6 +192,25 @@ $years[time() - 31536000] = date('Y', time() - 31536000);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -271,25 +291,25 @@ $years[time() - 31536000] = date('Y', time() - 31536000);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/application/Timerecording/TimerecordingController.php b/application/Timerecording/TimerecordingController.php
index 6449dceb7..0e1a755f3 100644
--- a/application/Timerecording/TimerecordingController.php
+++ b/application/Timerecording/TimerecordingController.php
@@ -224,8 +224,15 @@ class TimerecordingController extends mfBaseController
$email = new Emailnotification();
$email->setSubject('Antrag für ' . $timerecordingCategoriess[0]->name . ' erstellt');
$email->setBody($body);
- $email->setFrom('zeiterfassung@xinon.at', 'Xinon Zeiterfassung');
- $email->setTo('daniel.spitzer@inode.at');
+ $email->setFrom(TT_TIMERECORDING_EMAIL, TT_TIMERECORDING_EMAIL_NAME);
+ $email->setTo($this->me->email);
+ $email->send();
+
+ $email = new Emailnotification();
+ $email->setSubject('Antrag für ' . $timerecordingCategoriess[0]->name . ' erstellt (' . $this->me->name . ')');
+ $email->setBody($body);
+ $email->setFrom(TT_TIMERECORDING_EMAIL, TT_TIMERECORDING_EMAIL_NAME);
+ $email->setTo(TT_TIMERECORDING_EMAIL);
$email->send();
}
}
@@ -397,6 +404,12 @@ class TimerecordingController extends mfBaseController
$state = '';
}
$edit = "";
+ if ($timerecording->businesstrip == 1) {
+ $category = "" . $timerecording->timerecordingCategory->name . " (Dienstreise: " . $timerecording->businesstrip_info . ")";
+ } else {
+ $category = $timerecording->timerecordingCategory->name;
+ }
+
if ($timerecording->completed == 0 && $timerecording->timerecordingCategory->only_admin == 0):
if ($timerecording->approved == 0) :
$edit = '';
else :
$edit .= '';
@@ -419,7 +434,7 @@ class TimerecordingController extends mfBaseController
'start' => array('start' => $start, 'order' => $start),
'end' => array('end' => $end, 'order' => $end),
'sum' => array('sum' => $sum, 'order' => $sum),
- 'category' => array('category' => $timerecording->timerecordingCategory->name, 'order' => $timerecording->timerecordingCategory->name),
+ 'category' => array('category' => $category, 'order' => $timerecording->timerecordingCategory->name),
'comment' => array('comment' => $timerecording->comment, 'order' => $timerecording->comment),
'edit' => array('edit' => $edit, 'order' => $edit),
);
diff --git a/application/TimerecordingPermit/TimerecordingPermitController.php b/application/TimerecordingPermit/TimerecordingPermitController.php
index b332c36d7..5fd339781 100644
--- a/application/TimerecordingPermit/TimerecordingPermitController.php
+++ b/application/TimerecordingPermit/TimerecordingPermitController.php
@@ -56,7 +56,7 @@ class TimerecordingPermitController extends mfBaseController
$body .= 'Buchungsart: ' . $timerecordingCategoriess[0]->name . '
';
if ($timerecordingCategoriess[0]->hourday == "1") {
- $body .= 'von: ' . date("d.m.Y H:i", $timerecordings->start) . ' bis: ' . date("H:i", $timerecordings->end). '
+ $body .= 'von: ' . date("d.m.Y H:i", $timerecordings->start) . ' bis: ' . date("H:i", $timerecordings->end) . '
';
} else if ($timerecordingCategoriess[0]->hourday == "2") {
@@ -69,9 +69,16 @@ class TimerecordingPermitController extends mfBaseController
$email = new Emailnotification();
$email->setSubject('Antrag für ' . $timerecordingCategoriess[0]->name . ' ' . $sendtext);
$email->setBody($body);
- $email->setFrom('zeiterfassung@xinon.at', 'Xinon Zeiterfassung');
+ $email->setFrom(TT_TIMERECORDING_EMAIL, TT_TIMERECORDING_EMAIL_NAME);
$email->setTo($user->email);
$email->send();
+
+ $email = new Emailnotification();
+ $email->setSubject('Antrag für ' . $timerecordingCategoriess[0]->name . ' ' . $sendtext . ' (' . $user->name . ')');
+ $email->setBody($body);
+ $email->setFrom(TT_TIMERECORDING_EMAIL, TT_TIMERECORDING_EMAIL_NAME);
+ $email->setTo(TT_TIMERECORDING_EMAIL);
+ $email->send();
}
protected function approveAction()
diff --git a/application/TimerecordingReport/TimerecordingReportController.php b/application/TimerecordingReport/TimerecordingReportController.php
index c58be658c..128d88f44 100644
--- a/application/TimerecordingReport/TimerecordingReportController.php
+++ b/application/TimerecordingReport/TimerecordingReportController.php
@@ -202,7 +202,14 @@ class TimerecordingReportController extends mfBaseController
$state = '';
}
$edit = "";
- if ($timerecording->completed == 0 && $timerecording->timerecordingCategory->only_admin == 0):
+ if ($timerecording->businesstrip == 1) {
+ $category = "" . $timerecording->timerecordingCategory->name . " (Dienstreise: " . $timerecording->businesstrip_info . ")";
+ } else {
+ $category = $timerecording->timerecordingCategory->name;
+ }
+
+
+ if ($timerecording->completed == 0):
if ($timerecording->approved == 0) :
$edit = '';
else :
$edit .= '';
@@ -228,7 +237,7 @@ class TimerecordingReportController extends mfBaseController
'sum' => array('sum' => $sum, 'order' => $sum),
'cstart' => array('cstart' => $datadate, 'order' => $datadate),
'cend' => array('cend' => $enddate, 'order' => $enddate),
- 'category' => array('category' => $timerecording->timerecordingCategory->name, 'order' => $timerecording->timerecordingCategory->name),
+ 'category' => array('category' => $category, 'order' => $timerecording->timerecordingCategory->name),
'comment' => array('comment' => $timerecording->comment, 'order' => $timerecording->comment),
'edit' => array('edit' => $edit, 'order' => $edit),
);
diff --git a/public/js/pages/timerecording/index.js b/public/js/pages/timerecording/index.js
index 84a6fb7fa..5a0d1a61f 100644
--- a/public/js/pages/timerecording/index.js
+++ b/public/js/pages/timerecording/index.js
@@ -69,7 +69,7 @@ table = $('#datatable').DataTable({
"dom": cstmdom,
"ajax": {
"url": requestUrl,
- "type": "GET",
+ "type": "POST",
"data": function (d) {
$('.display-calendar').each(function (index) {
if ($(this).hasClass('active-calendar')) {
@@ -256,6 +256,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);
});
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(`