Merge branch 'spidev' into 'master'

Spidev

See merge request fronk/thetool!242
This commit is contained in:
Frank Schubert
2024-02-12 10:52:54 +00:00
25 changed files with 1343 additions and 357 deletions

View File

@@ -19,10 +19,10 @@ for ($i = 1; $i <= 25; $i++) {
$year = date('Y', $time);
$timestamp_montag = strtotime("{$year}-W{$kw}");
$timestamp_freitag = strtotime("{$year}-W{$kw}-5");
$weeks[$time] = "KW" . $kw . " " . $year . " (" . date('d.m', $timestamp_montag) . "-" . date('d.m', $timestamp_freitag) . ")";
$time = $time - 604800;
}
$time = time();
for ($i = 1; $i <= 12; $i++) {
$mon = date('n', $time);
@@ -30,7 +30,12 @@ for ($i = 1; $i <= 12; $i++) {
$month[$time] = $monthger[$mon] . " " . $year;
$time = strtotime('-1 month', $time);
}
$years[time() + 31536000] = date('Y', time() + 31536000);
$years[time()] = date('Y', time());
$years[time() - 31536000] = date('Y', time() - 31536000);
?>
<link href="<?= self::getResourcePath() ?>assets/css/select2-cstm.css?<?= date('U') ?>" rel="stylesheet"
type="text/css"/>
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= date('U') ?>" rel="stylesheet"
@@ -73,10 +78,19 @@ for ($i = 1; $i <= 12; $i++) {
font-weight: 500;
color: #000;
}
.text-normal {
color: #000;
}
.fixed-state {
background-color: #d0fbd9;
}
.form-check-label {
margin-top: 2px;
}
</style>
<!-- start page title -->
<div class="row">
@@ -111,7 +125,8 @@ for ($i = 1; $i <= 12; $i++) {
<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
endif;
endforeach; ?>
@@ -158,25 +173,45 @@ for ($i = 1; $i <= 12; $i++) {
</div>
</div>
<div class="form-group col-lg-2">
<label class="col-form-label" for="commend">Anmerkung</label>
<input type="text" id="commend" name="commend" class="form-control"
<label class="col-form-label" for="comment">Anmerkung</label>
<input type="text" id="comment" name="comment" class="form-control"/>
</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" value=""
id="businesstrip">
<label class="form-check-label" for="businesstrip" value="1">
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>
<button id="cancel-button" type="button" class="btn btn-secondary" style="display:none">
Abbrechen
</button>
</div>
</div>
</div>
<div class=" row mt-2">
<div class="col-lg-2 ">
<button id="submit-button" type="submit" class="btn btn-primary">Speichern</button>
<button id="cancel-button" type="button" class="btn btn-secondary" style="display:none">Abbrechen
</button>
</div>
</div>
<div class=" row mt-2">
<div class="col-lg-4" id="message-box">
</div>
</div>
</div>
</form>
@@ -188,9 +223,11 @@ for ($i = 1; $i <= 12; $i++) {
<label class="col-form-label label-calendar" for="lenght">Buchungszeitraum:</label>
</div>
<div class="col-6 col-lg-1 text-center">
<i class="fa-regular fa-calendar-week display-calendar active-calendar" title="Kalenderwoche"
data-datatype="1"></i> <i class="fa-regular fa-calendar-days display-calendar"
title="Kalendermonat" data-datatype="2"></i>
<i class="fa-duotone fa-calendar-week display-calendar active-calendar" title="Kalenderwoche"
data-datatype="1"></i> <i class="fa-duotone fa-calendar-days display-calendar"
title="Kalendermonat" data-datatype="2"></i> <i title="Abwesenheiten"
class="fa-duotone fa-calendar-clock display-calendar"
data-datatype="3"></i>
</div>
<div class="col-lg-2">
<div class="form-row">
@@ -212,9 +249,19 @@ for ($i = 1; $i <= 12; $i++) {
</select>
</div>
</div>
<div class="col" id="datayear-col" style="display:none">
<div class="input-group">
<select id="datayear" class="form-control select2">
<?php foreach ($years as $key => $Year): ?>
<option <?= (date('Y', time()) == $Year) ? "selected='selected'" : NULL ?>
value="<?= $key ?>"><?= $Year ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
</div>
<div class="col-lg-3">
<div id="dynamictime-div" class="col-lg-3">
<div class="form-row">
<div class="col text-center">
<div class="input-group ">
@@ -232,6 +279,25 @@ for ($i = 1; $i <= 12; $i++) {
</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>
@@ -272,8 +338,6 @@ for ($i = 1; $i <= 12; $i++) {
let insertUrl = "<?= self::getUrl("Timerecording", "save") ?>";
let deleteUrl = "<?= self::getUrl("Timerecording", "delete") ?>";
let requestUrl = "<?= self::getUrl("Timerecording", "api", ['do' => 'getTimerecordings']) ?>";
</script>
<script type="text/javascript"
src="<?= self::getResourcePath() ?>js/pages/timerecording/index.js?<?= date('U') ?>"></script>

View File

@@ -80,6 +80,15 @@
</div>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="businesstrip">Dienstreisemöglichkeit</label>
<div class="col-lg-3">
<div class="form-check">
<input id="businesstrip" class="form-check-input" <?php if ($timerecordingcategoriess->businesstrip) echo 'checked="checked"'; ?>
type="checkbox" name="businesstrip" value="1">
</div>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="only_admin">Nur für Buchhaltung zu buchen</label>
<div class="col-lg-3">

View File

@@ -40,6 +40,7 @@
<th class="text-center">BMD KZ</th>
<th class="text-center">Buchungszeitraum</th>
<th class="text-center">Genehmigungspflichtig</th>
<th class="text-center">Dienstreisemöglichkeit</th>
<th class="text-center">Anmerkung Pflichtfeld</th>
<th class="text-center">Nur Buchhaltung</th>
<th class="edit-width"></th>
@@ -52,17 +53,19 @@
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<?php foreach ($timerecordingcategoriess as $timerecordingcategories): ?>
<tr>
<td><?= $timerecordingcategories->name ?></td>
<td><?= $timerecordingcategories->short ?></td>
<td><?= $timerecordingcategorieshourday[$timerecordingcategories->hourday] ?></td>
<td><?= $timerecordingcategoriesapproval[$timerecordingcategories->approval] ?></td>
<td><?= $timerecordingcategoriesrequire_comment[$timerecordingcategories->require_comment] ?></td>
<td><?= $timerecordingcategoriesrequire_comment[$timerecordingcategories->only_admin] ?></td>
<td class="text-center"><?= $timerecordingcategories->name ?></td>
<td class="text-center"><?= $timerecordingcategories->short ?></td>
<td class="text-center"><?= $timerecordingcategorieshourday[$timerecordingcategories->hourday] ?></td>
<td class="text-center"><?= $timerecordingcategoriesapproval[$timerecordingcategories->approval] ?></td>
<td class="text-center"><?= $timerecordingcategoriesbusinesstrip[$timerecordingcategories->businesstrip] ?></td>
<td class="text-center"><?= $timerecordingcategoriesrequire_comment[$timerecordingcategories->require_comment] ?></td>
<td class="text-center"><?= $timerecordingcategoriesrequire_only_admin[$timerecordingcategories->only_admin] ?></td>
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
<a href="<?= self::getUrl("TimerecordingCategory", "edit", ["id" => $timerecordingcategories->id]) ?>"><i
class="far fa-edit" title="Bearbeiten"></i></a>
@@ -83,7 +86,7 @@
<script type="text/javascript">
var hidesearch = [6];
var hidesearch = [7];
$(document).ready(function () {

View File

@@ -70,6 +70,25 @@ $daysSelect .= "</select>";
</select>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="type">Vertragsart *</label>
<div class="col-lg-3">
<select class="select2 form-control " name="type" id="type">
<option value="1" <?= ($timerecordingemployees->type == '1') ? "selected='selected'" : "" ?>>Angestellter</option>
<option value="2" <?= ($timerecordingemployees->type == '2') ? "selected='selected'" : "" ?>>Arbeiter</option>
<option value="3" <?= ($timerecordingemployees->type == '3') ? "selected='selected'" : "" ?>>Lehrling</option>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="startdate">Startdatum
Zeiterfassung</label>
<div class="col-lg-2">
<input required="required" type="date" id="startdate" name="startdate"
class="form-control"
value="<?= ($timerecordingemployees->startdate) ? date('Y-m-d', $timerecordingemployees->startdate): "" ?>"/>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="holidays">Initiale Urlaubstage</label>
<div class="col-lg-1">
@@ -78,6 +97,7 @@ $daysSelect .= "</select>";
value="<?= $timerecordingemployees->holidays ?>"/>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="plushours">Initiale Gutstunden</label>
<div class="col-lg-1">

View File

@@ -1,4 +1,8 @@
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php"); ?>
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php");
$type[1] = "Angestellter";
$type[2] = "Arbeiter";
$type[3] = "Lehrling";
?>
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= date('U') ?>" rel="stylesheet"
type="text/css"/>
<!-- start page title -->
@@ -34,6 +38,8 @@
<thead>
<tr>
<th class="text-center">Mitarbeiter</th>
<th class="text-center">Vertragsart</th>
<th class="text-center">Start Zeitaufzeichnung</th>
<th class="text-center">Sollzeiten</th>
<th class="text-center">Sollstunden</th>
<th class="text-center edit-width">Schnellbuchung</th>
@@ -45,6 +51,8 @@
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@@ -61,11 +69,13 @@
<tr>
<td><?= $timerecordinguser->name ?></td>
<td><?= $type[$timerecordingemployees[$timerecordinguser->id]['type']] ?></td>
<td class="text-center"><?= ($timerecordingemployees[$timerecordinguser->id]['startdate']) ? date("d.m.Y", $timerecordingemployees[$timerecordinguser->id]['startdate']) : "-" ?></td>
<td class="text-center"><?= ($timerecordingworkinghours) ? $timerecordingworkinghours[$timerecordinguser->id]['datetimetext'] : "" ?></td>
<td class="text-center"><?= $sum ?></td>
<td class="text-center"><?= ($timerecordingemployees[$timerecordinguser->id]['auto_workinghours'] == '1') ? 'Ja' : 'Nein' ?></td>
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
<a href="<?= self::getUrl("TimerecordingEmployee", "edit", ['id'=> $timerecordingemployees[$timerecordinguser->id]['id'],"userid" => $timerecordinguser->id]) ?>"><i
<a href="<?= self::getUrl("TimerecordingEmployee", "edit", ['id' => $timerecordingemployees[$timerecordinguser->id]['id'], "userid" => $timerecordinguser->id]) ?>"><i
class="far fa-edit" title="Bearbeiten"></i></a>
</td>
</tr>
@@ -81,7 +91,7 @@
<script type="text/javascript">
var hidesearch = [4];
var hidesearch = [6];
$(document).ready(function () {

View File

@@ -3,7 +3,6 @@ $daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
?>
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= date('U') ?>" rel="stylesheet"
type="text/css"/>
<!-- start page title -->
@@ -33,7 +32,8 @@ $daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
</div>
<div class="float-right">
<a class="btn btn-primary mb-2" href="<?= self::getUrl("TimerecordingHoliday", "add") ?>"><i
class="fas fa-plus"></i> Neuen Feiertag anlegen</a>
class="fas fa-plus"></i> <span
class="d-none d-lg-inline"> Neuen Feiertag anlegen</span></a>
</div>
</div>
</div>
@@ -41,8 +41,8 @@ $daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
<thead>
<tr>
<th style="width: 200px;" class="text-center">Datum</th>
<th class="text-center">Name</th>
<th class="edit-width"></th>
<th class="text-center ">Name</th>
<th class="edit-width desktop"></th>
</tr>
<tr id="filterrow">
<th></th>
@@ -53,8 +53,8 @@ $daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
<tbody>
<?php foreach ($timerecordingholidays as $timerecordingholiday): ?>
<tr>
<td data-order="<?= $timerecordingholiday->timestamp ?>"><?= $daysgerm[date("w", $timerecordingholiday->timestamp)]." ".date("d.m.Y", $timerecordingholiday->timestamp) ?></td>
<td><?= $timerecordingholiday->description ?></td>
<td data-order="<?= $timerecordingholiday->timestamp ?>"><?= $daysgerm[date("w", $timerecordingholiday->timestamp)] . " " . date("d.m.Y", $timerecordingholiday->timestamp) ?></td>
<td class="text-nowrap all"><?= $timerecordingholiday->description ?></td>
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
<a href="<?= self::getUrl("TimerecordingHoliday", "edit", ["id" => $timerecordingholiday->id]) ?>"><i
class="far fa-edit" title="Bearbeiten"></i></a>

View File

@@ -121,7 +121,7 @@ $daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
$enddate = date("Y-m-d", $timerecording->end);
$start = "-";
$end = "-";
$day=$daysgerm[date("w", $timerecording->start)];
$day = $daysgerm[date("w", $timerecording->start)];
} else if ($timerecording->timerecordingCategory->hourday == 3 || $timerecording->timerecordingCategory->hourday == 4) {
$date = date("d.m.Y", $timerecording->start);
$datadate = date("Y-m-d", $timerecording->start);
@@ -141,13 +141,14 @@ $daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
// if ($timerecording->completed == 1) $completed = 'Genehmigt';
?>
<tr class="">
<td data-order="<?= $orderdate ?>" class="text-nowrap "><?= $state ?><?= $day . " " . $date ?></td>
<td data-order="<?= $orderdate ?>"
class="text-nowrap "><?= $state ?><?= $day . " " . $date ?></td>
<td class="text-nowrap "><?= $timerecording->user->name ?></td>
<td class="text-nowrap text-center"><?= $start ?></td>
<td class="text-nowrap text-center"><?= $end ?></td>
<td class="text-nowrap text-center"><?= $sum ?></td>
<td class="text-nowrap"><?= $timerecording->timerecordingCategory->name ?></td>
<td><?= $timerecording->commend ?></td>
<td><?= $timerecording->comment ?></td>
<td class="text-center"><?= $approved ?></td>
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
<?php if ($timerecording->completed == 0):
@@ -156,30 +157,14 @@ $daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
onclick="if(!confirm('Buchung genehmigen?')) return false;"> <i
class="fa-regular fa-square-check permit-button" title="genehmigen"
data-id="<?= $timerecording->id ?>"></i></a>
<a href="<?php self::getUrl("TimerecordingPermit", "deny", ["id" => $timerecording->id]) ?>"
onclick="if(!confirm('Buchung wirklich ablehnen?')) return false;"
class="text-danger"
title="Ablehnen"><i class="fas fa-ban deny-button"></i></a>
<a href="<?= self::getUrl("TimerecordingPermit", "deny", ["id" => $timerecording->id]) ?>"
onclick="if(!confirm('Buchung wirklich ablehnen?')) return false;"> <i
class="fas fa-ban deny-button" title="genehmigen"
data-id="<?= $timerecording->id ?>"></i></a>
<?php else : ?>
<div class="edit-placeholder"></div>
<?php endif; ?>
<!-- <i class="far fa-edit edit-button" data-id="--><?php //= $timerecording->id
?><!--"-->
<!-- data-date="--><?php //= $datadate
?><!--"-->
<!-- data-category="--><?php //= $timerecording->timerecordingCategory->id
?><!--"-->
<!-- data-start="--><?php //= $start
?><!--"-->
<!-- data-end="--><?php //= $end
?><!--"-->
<!-- data-enddate="--><?php //= $enddate
?><!--"-->
<!-- title="Bearbeiten"></i>-->
<!-- <a href="--><?php //= self::getUrl("Timerecording", "delete", ["id" => $timerecording->id])
?><!--"-->
<!-- onclick="if(!confirm('Buchung wirklich löschen?')) return false;" class="text-danger"-->
<!-- title="Löschen"><i class="fas fa-trash"></i></a>-->
<?php endif; ?>
</td>
</tr>
@@ -199,89 +184,9 @@ $daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
var columnfilter = [7];
var columnoptions = '<option value=""></option><option value="Offen">Offen</option><option value="Genehmigt">Genehmigt</option><option value="Abgelehnt">Abgelehnt</option>';
$(document).ready(function () {
$(".select2").select2();
$("body").on("change", "#timerecordingCategory_id", function () {
if (parseInt($(this).find(':selected').data('hourday')) === 2) {
$("#endtime-div").hide();
$("#endtime-div").find('input').each(function () {
$(this).prop("required", false);
});
$("#enddate-div").show();
$("#enddate-div").find('input').each(function () {
$(this).prop("required", true);
$(this).prop("min", $('#date').val());
$(this).val($('#date').val());
})
} else if (parseInt($(this).find(':selected').data('hourday')) === 1) {
$("#endtime-div").show();
$("#endtime-div").find('input').each(function () {
$(this).prop("required", true);
$(this).prop("disabled", false);
});
$("#enddate-div").hide();
$("#enddate-div").find('input').each(function () {
$(this).prop("required", false);
$(this).prop("min", '');
$(this).val('');
})
} else if (parseInt($(this).find(':selected').data('hourday')) === 3 || parseInt($(this).find(':selected').data('hourday')) === 4) {
$("#endtime-div").hide();
$("#endtime-div").find('input').each(function () {
$(this).prop("required", false);
$(this).prop("disabled", true);
});
$("#enddate-div").hide();
$("#enddate-div").find('input').each(function () {
$(this).prop("required", false);
$(this).prop("min", '');
$(this).val('');
})
}
if (parseInt($(this).find(':selected').data('comment')) === 1) {
$('#commend').prop("required", true);
} else {
$('#commend').prop("required", false);
}
});
$("body").on("change", "#date", function () {
if ($('#enddate-div').css('display') === "block") {
if ($('#date').val() > $('#enddate').val()) {
$('#enddate').prop("min", $('#date').val());
$('#enddate').val($('#date').val());
}
}
});
$("body").on("change", "#date", function () {
if ($('#endtime').css('display') === "block") {
if ($('#start').val() > $('#end').val()) {
console.log('größer');
$('#end').prop("min", $('#start').val());
$('#end').val($('#start').val());
}
}
});
$("body").on("click", ".edit-button", function () {
$('#submit-button').hide().removeClass('btn-primary').addClass('btn-danger').show();
$('#submit-button').text('Ändern');
$('#cancel-button').show();
$('#timerecordingCategory_id').val($(this).data('category')).change();
$('#id').val($(this).data('id'));
$('#date').val($(this).data('date'));
$('#start').val($(this).data('start'));
$('#end').val($(this).data('end'));
$('#enddate').val($(this).data('enddate'));
window.scrollTo(0, 0);
});
$("body").on("click", "#cancel-button", function () {
$('#submit-button').hide().removeClass('btn-danger').addClass('btn-primary').show();
$('#submit-button').text('Speichern');
$('#cancel-button').hide();
$('#id').val('');
});
});
</script>
<script type="text/javascript"
src="<?= self::getResourcePath() ?>assets/js/datatables-std.js?<?= date('U') ?>"></script>

View File

@@ -1,5 +1,46 @@
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php");
$daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
$monthger[1] = "Jänner";
$monthger[2] = "Februar";
$monthger[3] = "März";
$monthger[4] = "April";
$monthger[5] = "Mai";
$monthger[6] = "Juni";
$monthger[7] = "Juli";
$monthger[8] = "August";
$monthger[9] = "September";
$monthger[10] = "Oktober";
$monthger[11] = "November";
$monthger[12] = "Dezember";
$time = time();
foreach ($timerecordingusers as $timerecordinguser) {
$timerecordingUsers[$timerecordinguser->name] = $timerecordinguser->id;
}
ksort($timerecordingUsers);
for ($i = 1; $i <= 25; $i++) {
$kw = date('W', $time);
$year = date('Y', $time);
$timestamp_montag = strtotime("{$year}-W{$kw}");
$timestamp_freitag = strtotime("{$year}-W{$kw}-5");
$weeks[$time] = "KW" . $kw . " " . $year . " (" . date('d.m', $timestamp_montag) . "-" . date('d.m', $timestamp_freitag) . ")";
$time = $time - 604800;
}
$time = time();
for ($i = 1; $i <= 12; $i++) {
$mon = date('n', $time);
$year = date('Y', $time);
$month[$time] = $monthger[$mon] . " " . $year;
$time = strtotime('-1 month', $time);
}
$years[time() + 31536000] = date('Y', time() + 31536000);
$years[time()] = date('Y', time());
$years[time() - 31536000] = date('Y', time() - 31536000);
?>
<link href="<?= self::getResourcePath() ?>assets/css/select2-cstm.css?<?= date('U') ?>" rel="stylesheet"
type="text/css"/>
@@ -31,10 +72,26 @@ $daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
.edit-placeholder {
height: 15px;
width: 19px;
width: 27px;
display: inline-block;
}
.fa-trash {
cursor: pointer;
}
.text-bold {
font-weight: 500;
color: #000;
}
.text-normal {
color: #000;
}
.fixed-state {
background-color: #d0fbd9;
}
</style>
<!-- start page title -->
@@ -52,29 +109,201 @@ $daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
</div>
</div>
</div>
<!-- end page title -->
<div class="card">
<div class="card-body mb-3">
<div class="row">
<div class="col-12">
<div class="float-left">
<h4 class="header-title">Liste aller Buchungen</h4>
<form class="form-horizontal" method="post"
action="<?= self::getUrl("Timerecording", "save") ?>">
<div class="card">
<div class="card-body">
<input id="id" type="hidden" name="id" value=""/>
<div class="form-row">
<div class="form-group col-lg-2">
<label class="col-form-label" for="user_id">Buchungsart</label>
<select id="user_id_select" name="user_id"
class="select2 form-control" required="required">
<?php foreach ($timerecordingUsers as $key => $timerecordingUser): ?>
<option value="<?= $timerecordingUser ?>"><?= $key ?></option>
<?php
endforeach; ?>
</select>
<input id="user_id_input" name="user_id" disabled="disabled" style="display:none">
</div>
<div class="form-group col-lg-2">
<label class="col-form-label" for="timerecordingCategory_id">Buchungsart</label>
<select id="timerecordingCategory_id" name="timerecordingCategory_id"
class="select2 form-control" required="required">
<?php foreach ($timerecordingCategoriess as $timerecordingCategories): ?>
<option value="<?= $timerecordingCategories->id ?>"
data-approval="<?= $timerecordingCategories->approval ?>"
data-comment="<?= $timerecordingCategories->require_comment ?>"
data-hourday="<?= $timerecordingCategories->hourday ?>"><?= $timerecordingCategories->name ?></option>
<?php
endforeach; ?>
</select>
</div>
<div class="form-group col-lg-1">
<label class="col-form-label" for="date">Datum</label>
<div class="form-row">
<div class="col">
<input type="date" id="date" name="date" class="form-control "
value="<?= date("Y-m-d", time()) ?>"
placeholder="<?= date("d.m.Y", time()); ?>" required="required"/>
</div>
</div>
</div>
<div id="enddate-div" class="form-group col-lg-1" style="display:none">
<label class="col-form-label" for="enddate">bis Datum</label>
<div class="form-row">
<div class="col">
<input type="date" id="enddate" name="enddate" class="form-control "
value=""
placeholder=""/>
</div>
</div>
</div>
<div id="endtime-div" class="col-lg-2">
<div class="form-row">
<div class="form-group col">
<label class=" col-form-label" for="start">Von</label>
<input type="time" id="start" name="start" class="form-control "
value="08:00" placeholder="07:00" required="required"/>
</div>
<div class="form-group col">
<label class=" col-form-label" for="end">Bis</label>
<input type="time" id="end" name="end" class="form-control "
value="15:00" min="08:00" placeholder="15:00" required="required"/>
</div>
</div>
</div>
<div class="form-group col-lg-2">
<label class="col-form-label" for="comment">Anmerkung</label>
<input type="text" id="comment" name="comment" class="form-control"
</div>
</div>
</div>
<div class=" row mt-2">
<div class="col-lg-2 ">
<button id="submit-button" type="submit" class="btn btn-primary">Speichern</button>
<button id="cancel-button" type="button" class="btn btn-secondary" style="display:none">Abbrechen
</button>
</div>
</div>
<div class=" row mt-2">
<div class="col-lg-4" id="message-box">
</div>
</div>
</div>
</form>
</div>
<div class="card">
<div class="card-body mb-3">
<div class="form-group module-row row mb-3">
<div class="col-6 col-lg-1">
<label class="col-form-label label-calendar" for="lenght">Buchungszeitraum:</label>
</div>
<div class="col-6 col-lg-1 text-center">
<i class="fa-duotone fa-calendar-week display-calendar active-calendar" title="Kalenderwoche"
data-datatype="1"></i> <i class="fa-duotone fa-calendar-days display-calendar"
title="Kalendermonat" data-datatype="2"></i> <i title="Abwesenheiten"
class="fa-duotone fa-calendar-clock display-calendar"
data-datatype="3"></i>
</div>
<div class="col-lg-2">
<div class="form-row">
<div class="col" id="dataweek-col">
<div class="input-group">
<select id="dataweek" class="form-control select2">
<?php foreach ($weeks as $key => $week): ?>
<option value="<?= $key ?>"><?= $week ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
<div class="col" id="datamonth-col" style="display:none">
<div class="input-group">
<select id="datamonth" class="form-control select2">
<?php foreach ($month as $key => $Month): ?>
<option value="<?= $key ?>"><?= $Month ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
<div class="col" id="datayear-col" style="display:none">
<div class="input-group">
<select id="datayear" class="form-control select2">
<?php foreach ($years as $key => $Year): ?>
<option <?= (date('Y', time()) == $Year) ? "selected='selsected'" : NULL ?>
value="<?= $key ?>"><?= $Year ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
</div>
<div id="dynamictime-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"><span
class="text-bold">Sollzeit: </span><span id="must-time"
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"><span class="text-bold">Istzeit: </span><span
id="is-time"
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>
<table id="datatable" class="table table-hover table-sm">
<thead>
<tr>
<th class="text-center text-nowrap ">Mitarbeiter</th>
<th style="width: 200px;" class="text-center text-nowrap ">Datum</th>
<th style="width: 200px;" class="text-nowrap">Mitarbeiter</th>
<th class="text-nowrap text-center edit-width">Von</th>
<th class="text-nowrap text-center edit-width">Bis</th>
<th class="text-nowrap edit-width text-center">Von</th>
<th class="text-nowrap edit-width text-center">Bis</th>
<th class="text-nowrap edit-width text-center">Summe</th>
<th class="text-center text-nowrap">Buchungsart</th>
<th class="text-center">Anmerkung</th>
<th class="text-center edit-width">Verbucht</th>
<!-- <th class="edit-width"></th>-->
<th class="edit-width"></th>
</tr>
<tr id="filterrow">
<th></th>
@@ -85,79 +314,9 @@ $daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
<th></th>
<th></th>
<th></th>
<!-- <th></th>-->
</tr>
</thead>
<tbody>
<?php foreach ($timerecordings as $timerecording):
$state = "";
$enddate = "";
$sum = "-";
$day = "";
$orderdate = $timerecording->start;
if ($timerecording->timerecordingCategory->hourday == 1) {
$date = date("d.m.Y", $timerecording->start);
$datadate = date("Y-m-d", $timerecording->start);
$start = date("H:i", $timerecording->start);
$end = date("H:i", $timerecording->end);
$seconds = $timerecording->end - $timerecording->start;
$minutes = floor(($seconds % 3600) / 60);
$hours = floor($seconds / 3600);
$sum = sprintf("%02d", $hours) . ":" . sprintf("%02d", $minutes);
$day = $daysgerm[date("w", $timerecording->start)];
} else if ($timerecording->timerecordingCategory->hourday == 2) {
$date = date("d.m.", $timerecording->start) . " - " . $daysgerm[date("w", $timerecording->end)] . " " . date("d.m.Y", $timerecording->end);
$datadate = date("Y-m-d", $timerecording->start);
$enddate = date("Y-m-d", $timerecording->end);
$start = "-";
$end = "-";
$day = $daysgerm[date("w", $timerecording->start)];
} else if ($timerecording->timerecordingCategory->hourday == 3 || $timerecording->timerecordingCategory->hourday == 4) {
$date = date("d.m.Y", $timerecording->start);
$datadate = date("Y-m-d", $timerecording->start);
$start = "-";
$end = "-";
$day = $daysgerm[date("w", $timerecording->start)];
}
if ($timerecording->timerecordingCategory->approval == 1 && $timerecording->approved == 0) {
$state = '<i class="fa-regular fa-clock mr-1"></i>';
} else if ($timerecording->timerecordingCategory->approval == 1 && $timerecording->approved == 1) {
$state = '<i class="fa-regular fa-circle-check mr-1"></i>';
}
$completed = 'Nein';
if ($timerecording->completed == 1) $completed = 'Ja';
?>
<tr class="">
<td data-order="<?= $orderdate ?>" class="text-nowrap "><?= $state ?><?= $day . " " . $date ?></td>
<td class="text-nowrap "><?= $timerecording->user->name ?></td>
<td class="text-nowrap text-center"><?= $start ?></td>
<td class="text-nowrap text-center"><?= $end ?></td>
<td class="text-nowrap text-center"><?= $sum ?></td>
<td class="text-nowrap"><?= $timerecording->timerecordingCategory->name ?></td>
<td><?= $timerecording->commend ?></td>
<td><?= $completed ?></td>
<!-- <td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">-->
<!-- --><?php //if ($timerecording->completed == 0):
// if ($timerecording->approved == 0) : ?>
<!-- <i class="far fa-edit edit-button" data-id="--><?php //= $timerecording->id ?><!--"-->
<!-- data-date="--><?php //= $datadate ?><!--"-->
<!-- data-category="--><?php //= $timerecording->timerecordingCategory->id ?><!--"-->
<!-- data-start="--><?php //= $start ?><!--"-->
<!-- data-end="--><?php //= $end ?><!--"-->
<!-- data-enddate="--><?php //= $enddate ?><!--"-->
<!-- title="Bearbeiten"></i>-->
<!-- --><?php //else : ?>
<!-- <div class="edit-placeholder"></div>-->
<!-- --><?php //endif; ?>
<!-- <a href="--><?php //= self::getUrl("Timerecording", "delete", ["id" => $timerecording->id]) ?><!--"-->
<!-- onclick="if(!confirm('Buchung wirklich löschen?')) return false;" class="text-danger"-->
<!-- title="Löschen"><i class="fas fa-trash"></i></a>-->
<!-- --><?php //endif; ?>
<!-- </td>-->
</tr>
<?php endforeach; ?>
</tbody>
</table>
@@ -169,96 +328,15 @@ $daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
<script type="text/javascript">
var hidesearch = [2, 3, 4, 8];
var columnfilter = [7];
var columnoptions = '<option value=""></option><option value="Ja">Ja</option><option value="Nein">Nein</option>';
$(document).ready(function () {
$(".select2").select2();
var hidesearch = [2, 3, 4, 7];
let insertUrl = "<?= self::getUrl("Timerecording", "save") ?>";
let deleteUrl = "<?= self::getUrl("Timerecording", "delete") ?>";
let requestUrl = "<?= self::getUrl("TimerecordingReport", "api", ['do' => 'getTimerecordings']) ?>";
$("body").on("change", "#timerecordingCategory_id", function () {
if (parseInt($(this).find(':selected').data('hourday')) === 2) {
$("#endtime-div").hide();
$("#endtime-div").find('input').each(function () {
$(this).prop("required", false);
});
$("#enddate-div").show();
$("#enddate-div").find('input').each(function () {
$(this).prop("required", true);
$(this).prop("min", $('#date').val());
$(this).val($('#date').val());
})
} else if (parseInt($(this).find(':selected').data('hourday')) === 1) {
$("#endtime-div").show();
$("#endtime-div").find('input').each(function () {
$(this).prop("required", true);
$(this).prop("disabled", false);
});
$("#enddate-div").hide();
$("#enddate-div").find('input').each(function () {
$(this).prop("required", false);
$(this).prop("min", '');
$(this).val('');
})
} else if (parseInt($(this).find(':selected').data('hourday')) === 3 || parseInt($(this).find(':selected').data('hourday')) === 4) {
$("#endtime-div").hide();
$("#endtime-div").find('input').each(function () {
$(this).prop("required", false);
$(this).prop("disabled", true);
});
$("#enddate-div").hide();
$("#enddate-div").find('input').each(function () {
$(this).prop("required", false);
$(this).prop("min", '');
$(this).val('');
})
}
if (parseInt($(this).find(':selected').data('comment')) === 1) {
$('#commend').prop("required", true);
} else {
$('#commend').prop("required", false);
}
});
$("body").on("change", "#date", function () {
if ($('#enddate-div').css('display') === "block") {
if ($('#date').val() > $('#enddate').val()) {
$('#enddate').prop("min", $('#date').val());
$('#enddate').val($('#date').val());
}
}
});
$("body").on("change", "#date", function () {
if ($('#endtime').css('display') === "block") {
if ($('#start').val() > $('#end').val()) {
console.log('größer');
$('#end').prop("min", $('#start').val());
$('#end').val($('#start').val());
}
}
});
$("body").on("click", ".edit-button", function () {
$('#submit-button').hide().removeClass('btn-primary').addClass('btn-danger').show();
$('#submit-button').text('Ändern');
$('#cancel-button').show();
$('#timerecordingCategory_id').val($(this).data('category')).change();
$('#id').val($(this).data('id'));
$('#date').val($(this).data('date'));
$('#start').val($(this).data('start'));
$('#end').val($(this).data('end'));
$('#enddate').val($(this).data('enddate'));
window.scrollTo(0, 0);
});
$("body").on("click", "#cancel-button", function () {
$('#submit-button').hide().removeClass('btn-danger').addClass('btn-primary').show();
$('#submit-button').text('Speichern');
$('#cancel-button').hide();
$('#id').val('');
});
});
</script>
<script type="text/javascript"
src="<?= self::getResourcePath() ?>assets/js/datatables-std.js?<?= date('U') ?>"></script>
src="<?= self::getResourcePath() ?>js/pages/timerecordingReport/index.js?<?= $git_merge_ts ?>"></script>
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>