* Neue migration für Homeoffice * Soll zeiten nun vom Startdatum abhängig * Neue Summierung der Sollzeiten in der Personalverwaltung * Urlaubstage werden nun Tage statt Stunden angezeigt (in Buchungen und Auswertungen) * Urlaube werden nun bis 1.1.2024 berücksichtigt * Homeoffice Flag nun möglich
364 lines
16 KiB
PHP
364 lines
16 KiB
PHP
<?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();
|
|
|
|
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}-7");
|
|
$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"/>
|
|
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= date('U') ?>" rel="stylesheet"
|
|
type="text/css"/>
|
|
<style>
|
|
.edit-button {
|
|
color: #007bff;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.approved-open {
|
|
background-color: #fdb751 !important;
|
|
color: #000;
|
|
border-radius: 5px;
|
|
}
|
|
|
|
.approved-closed {
|
|
background-color: #96ff68 !important;
|
|
color: #000;
|
|
border-radius: 5px;
|
|
padding-top: 2px;
|
|
}
|
|
|
|
.fa-clock {
|
|
color: #ff9b00;
|
|
font-size: 15px;
|
|
}
|
|
|
|
.edit-placeholder {
|
|
height: 15px;
|
|
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;
|
|
}
|
|
|
|
.form-check-label {
|
|
margin-top: 2px;
|
|
}
|
|
|
|
</style>
|
|
<!-- start page title -->
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="page-title-box">
|
|
<div class="page-title-right">
|
|
<ol class="breadcrumb m-0">
|
|
<li class="breadcrumb-item"><a href="<?= self::getUrl("Dashboard") ?>"><?= MFAPPNAME_SLUG ?></a>
|
|
</li>
|
|
<li class="breadcrumb-item active">Buchungen</li>
|
|
</ol>
|
|
</div>
|
|
<h4 class="page-title">Buchungen</h4>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- end page title -->
|
|
<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="timerecordingCategory_id">Buchungsart</label>
|
|
|
|
<select id="timerecordingCategory_id" name="timerecordingCategory_id"
|
|
class="select2 form-control" required="required">
|
|
<?php foreach ($timerecordingCategoriess as $timerecordingCategories):
|
|
if ($timerecordingCategories->only_admin == 0) :
|
|
?>
|
|
<option value="<?= $timerecordingCategories->id ?>"
|
|
data-approval="<?= $timerecordingCategories->approval ?>"
|
|
data-comment="<?= $timerecordingCategories->require_comment ?>"
|
|
data-hourday="<?= $timerecordingCategories->hourday ?>"
|
|
data-businesstrip="<?= $timerecordingCategories->businesstrip ?>"
|
|
data-homeoffice="<?= ($timerecordingCategories->hourday==1) ? 1 : 0 ?>"><?= $timerecordingCategories->name ?></option>
|
|
</option>
|
|
<?php
|
|
endif;
|
|
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 class="row" >
|
|
<div class="col-lg-1 mb-2" id="homeoffice-div">
|
|
|
|
<div class="form-check text-center mt-1">
|
|
<input class="form-check-input" type="checkbox" name="homeoffice"
|
|
id="homeoffice" value="1">
|
|
<label class="form-check-label" for="homeoffice">
|
|
Homeoffice
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-lg-2 mb-2 businesstrip-div">
|
|
|
|
<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 businesstrip-div">
|
|
<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-3 ">
|
|
<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>
|
|
|
|
<button style="display:none" id="auto-workinghours-button" type="button" class="btn btn-dark">
|
|
Arbeitswoche verbuchen
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class=" row mt-2">
|
|
<div class="col-lg-4" id="message-box">
|
|
|
|
</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='selected'" : 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 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>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<table id="datatable" class="table table-hover table-sm">
|
|
<thead>
|
|
<tr>
|
|
<th style="width: 200px;" class="text-center text-nowrap ">Datum</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="edit-width"></th>
|
|
</tr>
|
|
<tr id="filterrow">
|
|
<th></th>
|
|
<th></th>
|
|
<th></th>
|
|
<th></th>
|
|
<th></th>
|
|
<th></th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
</tbody>
|
|
</table>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script type="text/javascript">
|
|
var hidesearch = [1, 2, 3, 6];
|
|
let insertUrl = "<?= self::getUrl("Timerecording", "save") ?>";
|
|
let deleteUrl = "<?= self::getUrl("Timerecording", "delete") ?>";
|
|
let requestUrl = "<?= self::getUrl("Timerecording", "api", ['do' => 'getTimerecordings']) ?>";
|
|
let autoWorkinghoursUrl = "<?= self::getUrl("Timerecording", "api", ['do' => 'fillWorkinghours']) ?>";
|
|
</script>
|
|
|
|
<script type="text/javascript"
|
|
src="<?= self::getResourcePath() ?>js/pages/timerecording/index.js?<?= date('U') ?>"></script>
|
|
|
|
|
|
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>
|