Merge branch 'spidev' into 'master'

Zeiterfassung Update/Bugfix/Migration

See merge request fronk/thetool!269
This commit is contained in:
Frank Schubert
2024-02-27 13:36:04 +00:00
14 changed files with 583 additions and 32 deletions

View File

@@ -294,7 +294,7 @@ $years[time() - 31536000] = date('Y', time() - 31536000);
</div>
<div class="col text-center">
<div class="input-group ">
<label class="col-form-label form-control fixed-state"><span
<label id="plushours-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>

View File

@@ -169,6 +169,7 @@ $daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
let requestUrl = "<?= self::getUrl("TimerecordingReport", "api", ['do' => 'getTimerecordings', 'datatype' => '3', 'datayear' => time()]) ?>";
var cindex = 1;
var holiDays = [];
var birthdays = [];
<?php
$counter = 1;
foreach ($timerecordingholidays as $timerecordingholiday) :?>
@@ -176,12 +177,34 @@ $daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
id: <?= $counter ?>,
start: '<?= date("Y-m-d", $timerecordingholiday->timestamp) ?>',
end: '<?= date("Y-m-d", $timerecordingholiday->timestamp) ?>',
title: '<?= $timerecordingholiday->description ?>'
title: '<?= $timerecordingholiday->description ?>',
description: '<?= $timerecordingholiday->description ?>'
});
<?php
$counter++;
endforeach;
foreach ($timerecordingemployees as $timerecordingemployee) :
if ($timerecordingemployee->birthday) :
$year = date("Y", time());
$year = $year - 1;
$Byear = date("Y", $timerecordingemployee->birthday);
for ($i = 0; $i < 5; $i++) :
$age = $year - $Byear;
?>
birthdays.push({
id: <?= $counter ?>,
start: '<?= date("$year-m-d", $timerecordingemployee->birthday) ?>',
end: '<?= date("$year-m-d", $timerecordingemployee->birthday) ?>',
title: '<?= $timerecordingemployee->user->name ?> (<?= $age ?>)',
description: 'Geburtstag <?= $timerecordingemployee->user->name ?> (<?= $age ?>)'
});
<?php
$year++;
endfor;
$counter++;
endif;
endforeach; ?>
cindex = <?= $counter ?>;
$.getJSON(requestUrl, function (data) {
@@ -223,7 +246,7 @@ $daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
// Calendar Event Source
// Birthday Events Source
var birthdayEvents = {
var holiDayEvents = {
id: 1,
backgroundColor: 'rgba(255, 0, 0 , 1)',
borderColor: 'rgba(255, 0, 0 , 1)',
@@ -232,12 +255,19 @@ $daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
};
var holidayEvents = {
id: 5,
id: 7,
backgroundColor: 'rgba(0,204,204,.25)',
borderColor: 'rgb(192 0 255)',
borderColor: 'rgb(8 241 8)',
textColor: '#000',
events: holidays
};
var birthdayEvents = {
id: 5,
backgroundColor: 'rgb(68 15 241 / 76%)',
borderColor: 'rgb(68 15 241 / 76%)',
textColor: '#fff',
events: birthdays
};
var initialLocaleCode = 'en';
var calendarEl = document.getElementById('calendar');
var calendar = new FullCalendar.Calendar(calendarEl, {
@@ -265,7 +295,7 @@ $daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
navLinks: 'true',
events: [],
height: 800,
eventSources: [holidayEvents, birthdayEvents]
eventSources: [birthdayEvents, holiDayEvents, holidayEvents]
});
calendar.render();
});

View File

@@ -89,6 +89,15 @@ $daysSelect .= "</select>";
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="birthday">Geburtstag</label>
<div class="col-lg-2">
<input type="date" id="birthday" name="birthday"
class="form-control"
value="<?= ($timerecordingemployees->birthday) ? date('Y-m-d', $timerecordingemployees->birthday): "" ?>"/>
</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">
@@ -106,6 +115,14 @@ $daysSelect .= "</select>";
value="<?= str_replace(".", ",", $timerecordingemployees->plushours / 3600) ?>"/>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="overtime">Initiale Überstunden</label>
<div class="col-lg-1">
<input type="text" id="overtime" name="overtime"
class="form-control"
value="<?= str_replace(".", ",", $timerecordingemployees->overtime / 3600) ?>"/>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label"
for="auto_workinghours">Schnellbuchung</label>

View File

@@ -42,6 +42,9 @@ $type[3] = "Lehrling";
<th class="text-center">Start Zeitaufzeichnung</th>
<th class="text-center">Sollzeiten</th>
<th class="text-center">Sollstunden</th>
<th class="text-center">Mehrstunden</th>
<th class="text-center">Überstunden</th>
<th class="text-center">Offene Urlaube</th>
<th class="text-center edit-width">Schnellbuchung</th>
<th class="edit-width"></th>
</tr>
@@ -53,6 +56,9 @@ $type[3] = "Lehrling";
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@@ -73,6 +79,9 @@ $type[3] = "Lehrling";
<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"><?= sprintf('%02d:%02d', ($timerecordingemployees[$timerecordinguser->id]['plushours_now']/ 3600),($timerecordingemployees[$timerecordinguser->id]['plushours_now']/ 60 % 60)) ?></td>
<td class="text-center"><?= sprintf('%02d:%02d', ($timerecordingemployees[$timerecordinguser->id]['overtime_now']/ 3600),($timerecordingemployees[$timerecordinguser->id]['overtime_now']/ 60 % 60)) ?></td>
<td class="text-center"><?= ($timerecordingemployees[$timerecordinguser->id]['holidays_now']) ? $timerecordingemployees[$timerecordinguser->id]['holidays_now'].' Tage' : '' ?> </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
@@ -91,7 +100,7 @@ $type[3] = "Lehrling";
<script type="text/javascript">
var hidesearch = [6];
var hidesearch = [3,4,5,6,7,9];
$(document).ready(function () {

View File

@@ -352,6 +352,7 @@ $years[time() - 31536000] = date('Y', time() - 31536000);
let insertUrl = "<?= self::getUrl("Timerecording", "save") ?>";
let deleteUrl = "<?= self::getUrl("Timerecording", "delete") ?>";
let requestUrl = "<?= self::getUrl("TimerecordingReport", "api", ['do' => 'getTimerecordings']) ?>";
let requestTimesUrl = "<?= self::getUrl("TimerecordingReport", "api", ['do' => 'getTimerecordingsTimes']) ?>";
</script>