Mobile Integration: * in footer.php js eingefügt damit das mobile Menu funktioniert * in menu.php bzw. app.css neue Klasse eingefügt mobile-hide um in der mobilen Version Menupünkte zu verstecken Pop Multiple Networks * Pops können nun mehrere Netzgebiete haben * Netzgebiete und Pop ansicht angepasst * (Script muss ausgeführt werden um die PopNetwork Table vom Bestand zu befüllen) DataTables responsible update * Datatables update und responsible addon * Diverse Anpassungen für Responsible in: - Pops, Geräte Hersteller, Geräte Typen, Devices, Benutzer Anpassungen auf neu getProperty Migrations * PopNetwork * Poprackmodulepatch
336 lines
16 KiB
PHP
336 lines
16 KiB
PHP
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php");
|
|
$daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
|
|
?>
|
|
<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: 19px;
|
|
display: inline-block;
|
|
}
|
|
|
|
|
|
</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): ?>
|
|
<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="commend">Anmerkung</label>
|
|
<input type="text" id="commend" name="commend" 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>
|
|
|
|
|
|
</form>
|
|
</div>
|
|
<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>
|
|
</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>
|
|
<?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>';
|
|
}
|
|
?>
|
|
<tr class="">
|
|
<td data-order="<?= $orderdate ?>" class="text-nowrap "><?= $state ?><?= $day . " " . $date ?></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 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="<?= $timerecording->id ?>"
|
|
data-date="<?= $datadate ?>"
|
|
data-category="<?= $timerecording->timerecordingCategory->id ?>"
|
|
data-start="<?= $start ?>"
|
|
data-end="<?= $end ?>"
|
|
data-enddate="<?= $enddate ?>"
|
|
data-commend="<?= $timerecording->commend ?>"
|
|
title="Bearbeiten"></i>
|
|
<?php else : ?>
|
|
<div class="edit-placeholder"></div>
|
|
<?php endif; ?>
|
|
<a href="<?= 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>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script type="text/javascript">
|
|
var hidesearch = [1, 2, 3, 6];
|
|
|
|
$(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'));
|
|
$('#commend').val($(this).data('commend'));
|
|
$('.alert-success').remove();
|
|
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>
|
|
|
|
|
|
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>
|