Zeiterfassung update
* Mails für Antragspflichtige Buchungen * Mails für Genehmigungen und Ablehnungen * Korrekturen Update
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -139,7 +139,8 @@ $years[time() - 31536000] = date('Y', time() - 31536000);
|
||||
<option value="<?= $timerecordingCategories->id ?>"
|
||||
data-approval="<?= $timerecordingCategories->approval ?>"
|
||||
data-comment="<?= $timerecordingCategories->require_comment ?>"
|
||||
data-hourday="<?= $timerecordingCategories->hourday ?>"><?= $timerecordingCategories->name ?></option>
|
||||
data-hourday="<?= $timerecordingCategories->hourday ?>"
|
||||
data-businesstrip="<?= $timerecordingCategories->businesstrip ?>"><?= $timerecordingCategories->name ?></option>
|
||||
<?php
|
||||
endforeach; ?>
|
||||
</select>
|
||||
@@ -191,6 +192,25 @@ $years[time() - 31536000] = date('Y', time() - 31536000);
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="businesstrip-div">
|
||||
|
||||
<div class="col-lg-2 mb-2">
|
||||
|
||||
<div class="form-check text-center mt-1">
|
||||
<input class="form-check-input" type="checkbox" name="businesstrip"
|
||||
id="businesstrip" value="1">
|
||||
<label class="form-check-label" for="businesstrip">
|
||||
Dienstreise > 12KM
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-2">
|
||||
<input style="display:none" type="text" id="businesstrip_info" name="businesstrip_info"
|
||||
placeholder="Ort"
|
||||
class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class=" row mt-2">
|
||||
<div class="col-lg-2 ">
|
||||
<button id="submit-button" type="submit" class="btn btn-primary">Speichern</button>
|
||||
@@ -271,25 +291,25 @@ $years[time() - 31536000] = date('Y', time() - 31536000);
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="col-lg-3">-->
|
||||
<!-- <div class="form-row">-->
|
||||
<!-- <div class="col text-center">-->
|
||||
<!-- <div class="input-group ">-->
|
||||
<!-- <label class="col-form-label form-control fixed-state"><span-->
|
||||
<!-- class="text-bold">Urlaubstage: </span><span id="holidays"-->
|
||||
<!-- class="ml-1 text-normal"></span></label>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="col text-center">-->
|
||||
<!-- <div class="input-group ">-->
|
||||
<!-- <label class="col-form-label form-control fixed-state"><span-->
|
||||
<!-- class="text-bold">Gutzeit: </span><span-->
|
||||
<!-- id="plushours"-->
|
||||
<!-- class="ml-1 text-normal"></span></label>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="col-lg-3">-->
|
||||
<!-- <div class="form-row">-->
|
||||
<!-- <div class="col text-center">-->
|
||||
<!-- <div class="input-group ">-->
|
||||
<!-- <label class="col-form-label form-control fixed-state"><span-->
|
||||
<!-- class="text-bold">Urlaubstage: </span><span id="holidays"-->
|
||||
<!-- class="ml-1 text-normal"></span></label>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="col text-center">-->
|
||||
<!-- <div class="input-group ">-->
|
||||
<!-- <label class="col-form-label form-control fixed-state"><span-->
|
||||
<!-- class="text-bold">Gutzeit: </span><span-->
|
||||
<!-- id="plushours"-->
|
||||
<!-- class="ml-1 text-normal"></span></label>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -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 = '<i class="fa-regular fa-circle-check mr-1"></i>';
|
||||
}
|
||||
$edit = "";
|
||||
if ($timerecording->businesstrip == 1) {
|
||||
$category = "<span>" . $timerecording->timerecordingCategory->name . "</span><span class='text-bold ml-2'> (Dienstreise: " . $timerecording->businesstrip_info . ")</span>";
|
||||
} else {
|
||||
$category = $timerecording->timerecordingCategory->name;
|
||||
}
|
||||
|
||||
if ($timerecording->completed == 0 && $timerecording->timerecordingCategory->only_admin == 0):
|
||||
if ($timerecording->approved == 0) :
|
||||
$edit = '<i class="far fa-edit edit-button" data-id="' . $timerecording->id . '"
|
||||
@@ -406,6 +419,8 @@ class TimerecordingController extends mfBaseController
|
||||
data-end="' . $end . '"
|
||||
data-enddate="' . $enddate . '"
|
||||
data-comment="' . $timerecording->comment . '"
|
||||
data-businesstrip="' . $timerecording->businesstrip . '"
|
||||
data-businesstripinfo="' . $timerecording->businesstrip_info . '"
|
||||
title="Bearbeiten"></i>';
|
||||
else :
|
||||
$edit .= '<div class="edit-placeholder"></div>';
|
||||
@@ -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),
|
||||
);
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -202,7 +202,14 @@ class TimerecordingReportController extends mfBaseController
|
||||
$state = '<i class="fa-regular fa-circle-check mr-1"></i>';
|
||||
}
|
||||
$edit = "";
|
||||
if ($timerecording->completed == 0 && $timerecording->timerecordingCategory->only_admin == 0):
|
||||
if ($timerecording->businesstrip == 1) {
|
||||
$category = "<span>" . $timerecording->timerecordingCategory->name . "</span><span class='text-bold ml-2'> (Dienstreise: " . $timerecording->businesstrip_info . ")</span>";
|
||||
} else {
|
||||
$category = $timerecording->timerecordingCategory->name;
|
||||
}
|
||||
|
||||
|
||||
if ($timerecording->completed == 0):
|
||||
if ($timerecording->approved == 0) :
|
||||
$edit = '<i class="far fa-edit edit-button" data-id="' . $timerecording->id . '"
|
||||
data-date="' . $datadate . '"
|
||||
@@ -212,6 +219,8 @@ class TimerecordingReportController extends mfBaseController
|
||||
data-enddate="' . $enddate . '"
|
||||
data-comment="' . $timerecording->comment . '"
|
||||
data-userid="' . $timerecording->user_id . '"
|
||||
data-businesstrip="' . $timerecording->businesstrip . '"
|
||||
data-businesstripinfo="' . $timerecording->businesstrip_info . '"
|
||||
title="Bearbeiten"></i>';
|
||||
else :
|
||||
$edit .= '<div class="edit-placeholder"></div>';
|
||||
@@ -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),
|
||||
);
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
@@ -29,8 +29,13 @@ $('#filterrow th').each(function (i) {
|
||||
|
||||
if (hidesearch.includes($(this).index())) {
|
||||
|
||||
} else if (columnfilter.includes($(this).index())) {
|
||||
$(this).html('<select style="padding: 0;height: 28px;;text-align: center;" id="selectsearch" class="form-control form-control-select form-control-special" data-index="' + i + '">' + columnoptions + '</select>');
|
||||
} else if ($(this).index() == 0) {
|
||||
var options = '<option value="">Alle</option>';
|
||||
$('#user_id_select').find('option').each(function () {
|
||||
options += '<option data-userid="' + $(this).val() + '" value="' + $(this).text() + '">' + $(this).text() + '</option>';
|
||||
});
|
||||
|
||||
$(this).html('<select style="padding: 0;height: 28px;;text-align: center;" id="selectsearch" class="form-control form-control-select form-control-special select2" data-index="' + i + '">' + options + '</select>');
|
||||
|
||||
} else {
|
||||
$(this).html('<input type="text" placeholder="' + title + '" class="form-control" data-index="' + i + '" value="" />');
|
||||
@@ -61,7 +66,7 @@ table = $('#datatable').DataTable({
|
||||
$('#datatable_filter').append('<i id="clear_cookie" class="fas fa-times clear-fa" title="Filter löschen" aria-hidden="true" ></i>');
|
||||
$('#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 () {
|
||||
<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">
|
||||
|
||||
Reference in New Issue
Block a user