Merge branch 'master' into fronkdev

This commit is contained in:
Frank Schubert
2024-07-11 13:28:35 +02:00
17 changed files with 483 additions and 208 deletions

View File

@@ -8,8 +8,8 @@
<ol class="breadcrumb m-0">
<li class="breadcrumb-item"><a href="javascript: void(0);"><?=MFAPPNAME_SLUG?></a></li>
<li class="breadcrumb-item"><a href="<?=self::getUrl("Address")?>">Personen & Firmen</a></li>
<li class="breadcrumb-item"><a href="<?=self::getUrl("Address", "view", ["address_id" => $address->id])?>"><?=$address->getCompanyOrName()?> [<?=$address->customer_number?>]</a></li>
<li class="breadcrumb-item active"><?=$address->getCompanyOrName()?> [<?=$address->customer_number?>]</li>
<li class="breadcrumb-item"><a href="<?=self::getUrl("Address", "view", ["id" => $address->id])?>"><?=$address->getCompanyOrName()?> [<?=$address->customer_number?>]</a></li>
<li class="breadcrumb-item active">Rechnungen</li>
</ol>
</div>
<h4 class="page-title">Personen & Firmen</h4>
@@ -93,4 +93,4 @@
</div>
</div>
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>

View File

@@ -1,39 +1,5 @@
<?php
$typeOption[1] = "Einzel";
$typeOption[2] = "Schutzrohr";
$typeOption[3] = "Verband";
$dimension_v1Option[1] = "MR7";
$dimension_v1Option[2] = "MR14";
$dimension_v1Option[3] = "MR16";
$dimension_v1Option[4] = "MR20";
$dimension_v1Option[5] = "PE32";
$dimension_v1Option[6] = "PE40";
$dimension_v1Option[7] = "PE50";
$dimension_v1Option[8] = "KSR50";
$dimension_v1Option[9] = "KSR80";
$dimension_v1Option[10] = "KSR100";
$dimension_v2Option[1] = "Anzahl";
$dimension_v2Option[2] = "Dimenson";
$dimension_v2Option[3] = "Farben";
$starting_pointOption[1] = "Greenfield";
$starting_pointOption[2] = "POP";
$starting_pointOption[3] = "Building";
$starting_pointOption[4] = "Schacht-Verteiler";
$statusOption[10] = "Geplant";
$statusOption[20] = "Umsetzung";
$statusOption[30] = "Fertiggestellt";
$responsibleOption[1] = "(F)";
$responsibleOption[2] = "(P)";
foreach ($networks as $network) {
$Network[$network->id] = $network->name;
}
foreach ($pipworkeraddresses as $pipworkeraddress) {
$Pipeworker[$pipworkeraddress->id] = $pipworkeraddress->company;
}
?>
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php"); ?>
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= date('U') ?>" rel="stylesheet"
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= $git_merge_ts ?>" rel="stylesheet"
type="text/css"/>
<!-- start page title -->
<style>
@@ -71,121 +37,40 @@ foreach ($pipworkeraddresses as $pipworkeraddress) {
class="fas fa-plus"></i> Neuen Rohrverzeichnis anlegen</a>
</div>
</div>
</div>
<table id="datatable" class="table table-striped table-hover table-sm font-13">
<thead>
<tr>
<th class="text-center">Bezeichnung</th>
<th class="text-center">Type/Bezeichnung</th>
<th class="text-center">Länge (m)</th>
<th>Netzgebiet(e)</th>
<th class="text-center">Anfangspunkt</th>
<th class="text-center">Endpunkt</th>
<th class="text-center">Zuständig</th>
<th class="text-center">Status</th>
<th class="edit-width"></th>
</tr>
<tr id="filterrow">
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<?php foreach ($fiberplanpipes as $fiberplanpipe):
unset($networks);
unset($endpoints);
foreach ($fiberplanpipeEndpoints[$fiberplanpipe->id] as $fiberplanpipeEndpoint) {
if ($fiberplanpipeEndpoint->pop_id) {
$networks[$fiberplanpipeEndpoint->pop->network->name] = $fiberplanpipeEndpoint->pop->network->name;
$endpoints[] = '<span title="POP">(P) </span>' . $fiberplanpipeEndpoint->pop->name;
} else if ($fiberplanpipeEndpoint->building_id) {
$networks[$fiberplanpipeEndpoint->building->network->name] = $fiberplanpipeEndpoint->building->network->name;
$endpoints[] = '<span title="Building">(B) </span>' . $fiberplanpipeEndpoint->building->street . " " . $fiberplanpipeEndpoint->building->number;
} else if ($fiberplanpipeEndpoint->fiberPlanDispatcher_id) {
$networks[$fiberplanpipeEndpoint->fiberPlanDispatcher->network->name] = $fiberplanpipeEndpoint->fiberPlanDispatcher->network->name;
if ($fiberplanpipeEndpoint->fiberPlanDispatcher->object_type == "1") {
$endpoints[] = '<span title="Verteiler">(V) </span>' . $fiberplanpipeEndpoint->fiberPlanDispatcher->description;
} elseif ($fiberplanpipeEndpoint->fiberPlanDispatcher->object_type == "2") {
$endpoints[] = '<span title="Schacht">(S) </span>' . $fiberplanpipeEndpoint->fiberPlanDispatcher->description;
} else if ($fiberplanpipeEndpoint->fiberPlanDispatcher->object_type == "3") {
$endpoints[] = '<span title="Greenfield">(G) </span>' . $fiberplanpipeEndpoint->fiberPlanDispatcher->description;
} else if ($fiberplanpipeEndpoint->fiberPlanDispatcher->object_type == "4") {
$endpoints[] = '<span title="Abzweigepunkt">(A) </span>' . $fiberplanpipeEndpoint->fiberPlanDispatcher->description;
}
}
}
if ($fiberplanpipe->type == "3") {
$name = "";
if ($fiberplanpipe->fiberPlanPipeTemplate->pipe7x4 && $fiberplanpipe->fiberPlanPipeTemplate->pipe14x10) {
$name = $fiberplanpipe->fiberPlanPipeTemplate->fiberPlanPipeManufacturer->name . " " . $fiberplanpipe->fiberPlanPipeTemplate->pipe7x4 . "*7x4" . "/" . $fiberplanpipe->fiberPlanPipeTemplate->pipe14x10 . "*14x10";
} else if ($fiberplanpipe->fiberPlanPipeTemplate->pipe7x4) {
$name = $fiberplanpipe->fiberPlanPipeTemplate->fiberPlanPipeManufacturer->name . " " . $fiberplanpipe->fiberPlanPipeTemplate->pipe7x4 . "*7x4";
} else if ($fiberplanpipe->fiberPlanPipeTemplate->pipe14x10) {
$name = $fiberplanpipe->fiberPlanPipeTemplate->fiberPlanPipeManufacturer->name . " " . $fiberplanpipe->fiberPlanPipeTemplate->pipe14x10 . "*14x10";
}
$typeDescription = $name;
//
} else {
$typeDescription = $dimension_v1Option[$fiberplanpipe->type_description];
}
$startpoint = '<span class="startpoint" data-toggle="modal" data-target="#pipemap" data-gpslat="' . $buildings[$fiberplanpipe->startpoint_type][$fiberplanpipe->startpoint]['gps_lat'] . '" data-gpslong="' . $buildings[$fiberplanpipe->startpoint_type][$fiberplanpipe->startpoint]['gps_long'] . '">' . $starting_pointOption[$fiberplanpipe->startpoint_type] . "/" . $buildings[$fiberplanpipe->startpoint_type][$fiberplanpipe->startpoint]['name'] . '</span>';
$endpoint = '<span class="endpoint" data-toggle="modal" data-target="#pipemap" data-gpslat="' . $buildings[$fiberplanpipe->entpoint_type][$fiberplanpipe->endpoint]['gps_lat'] . '" data-gpslong="' . $buildings[$fiberplanpipe->entpoint_type][$fiberplanpipe->endpoint]['gps_long'] . '">' . $starting_pointOption[$fiberplanpipe->entpoint_type] . "/" . $buildings[$fiberplanpipe->entpoint_type][$fiberplanpipe->endpoint]['name'] . '</span>';
$responsible = $responsibleOption[$fiberplanpipe->responsible];
if ($fiberplanpipe->address_id) {
$responsible .= " " . $Pipeworker[$fiberplanpipe->address_id];
if ($fiberplanpipe->responsible_text) {
$responsible .= " (" . $fiberplanpipe->responsible_text . ")";
}
} else {
$responsible .= " " . $fiberplanpipe->responsible_text;
}
if ($fiberplanpipe->startpoint_network_id == $fiberplanpipe->endpoint_network_id) {
$networkName = $Network[$fiberplanpipe->startpoint_network_id];
} else {
$networkName = $Network[$fiberplanpipe->startpoint_network_id] . " / " . $Network[$fiberplanpipe->endpoint_network_id];
}
?>
<table id="datatable" class="table table-striped table-hover table-sm font-13 w-100">
<thead>
<tr>
<td>
<a href="<?= self::getUrl("FiberPlanPipe", "Detail", ["id" => $fiberplanpipe->id]) ?>"><?= $fiberplanpipe->description ?></a>
</td>
<td style="white-space: nowrap"><?= $typeOption[$fiberplanpipe->type] . " / " . $typeDescription ?></td>
<td class="text-center"><?= $fiberplanpipe->length ?></td>
<td><?= implode(',', $networks) ?></td>
<td><?= $endpoints[0] ?></td>
<td><?= $endpoints[count($endpoints) - 1] ?></td>
<td><?= $responsible ?></td>
<td><?= $statusOption[$fiberplanpipe->status] ?></td>
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
<a href="<?= self::getUrl("FiberPlanPipe", "edit", ["id" => $fiberplanpipe->id]) ?>"><i
class="far fa-edit" title="Bearbeiten"></i></a>
<a href="<?= self::getUrl("FiberPlanPipe", "delete", ["id" => $fiberplanpipe->id]) ?>"
onclick="if(!confirm('Rohrverzeichnis wirklich löschen?')) return false;"
class="text-danger"
title="Löschen"><i class="fas fa-trash"></i></a>
</td>
<th class="text-center">Bezeichnung</th>
<th class="text-center">Type/Bezeichnung</th>
<th class="text-center">Länge (m)</th>
<th>Netzgebiet(e)</th>
<th class="text-center">Anfangspunkt</th>
<th class="text-center">Endpunkt</th>
<th class="text-center">Zuständig</th>
<th class="text-center">Status</th>
<th class="edit-width text-center"></th>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<tr id="filterrow">
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="pipemap" tabindex="-1" role="dialog" aria-labelledby="pipemap"
aria-hidden="true">
@@ -206,10 +91,14 @@ foreach ($pipworkeraddresses as $pipworkeraddress) {
</div>
</div>
</div>
<script type="text/javascript"></script>
<script type="text/javascript">
var hidesearch = [8];
let requestUrl = "<?= self::getUrl("FiberPlanPipe", "api", ['do' => 'getFiberPlanPipes']) ?>";
</script>
<script type="text/javascript"
src="<?= self::getResourcePath() ?>assets/js/datatables-std.js?<?= date('U') ?>"></script>
src="<?= self::getResourcePath() ?>js/pages/FiberPlanPipe/index.js?<?= $git_merge_ts ?>"></script>
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>

View File

@@ -74,7 +74,9 @@
}
$offdays .= "<div>";
if ($value < 100) {
$offdays .= $category . ": " . $value . " Tag(e) ";
if ($value > 0) {
$offdays .= $category . ": " . $value . " Tag(e) ";
}
} else {
$offdays .= $category . ": " . sprintf('%02dh:%02dm', floor($value / 3600), floor($value / 60 % 60));

View File

@@ -4,7 +4,8 @@
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= $git_merge_ts ?>" rel="stylesheet"
type="text/css"/>
<link href="<?= self::getResourcePath() ?>datatables/DataTables-2x/datatables.min.css?<?= $git_merge_ts ?>" rel="stylesheet"
<link href="<?= self::getResourcePath() ?>datatables/DataTables-2x/datatables.min.css?<?= $git_merge_ts ?>"
rel="stylesheet"
type="text/css"/>
<style>
.fa-arrow-right-from-bracket {
@@ -136,7 +137,7 @@
<th class="text-center">Sollst.</th>
<th class="text-center">Sollabweichung</th>
<th class="text-center min-w-100">Mehrst.</th>
<th class="text-center min-w-100">Ges. Überst.</th>
<th class="text-center min-w-100" title="Gesamte Gutstunden">Gutstunden</th>
<?php if ($me->superexpertEnabled()): ?>
<th class="text-center min-w-70">Black P. St.</th>
<?php endif; ?>
@@ -144,7 +145,7 @@
<th title="Überstunden 50%" class="text-center min-w-70">Ü50</th>
<th title="Überstunden 100%" class="text-center min-w-70">Ü100</th>
<th class="text-center">Diäten</th>
<th class="text-center">HO</th>
<th class="text-center" title="Homeoffice">HO</th>
</tr>
<tr id="filterrow">
<th></th>
@@ -192,8 +193,7 @@
}
?>
<tr>
<td class="text-nowrap">(<?= $employee_number ?>
) <?= $timerecording->timerecordingEmployee->user->name ?> </td>
<td class="text-nowrap">(<?= $employee_number ?>) <?= $timerecording->timerecordingEmployee->user->name ?> <?= ($timerecording->timerecordingEmployee->jobbike == 1) ? '<div class="float-right"><i title="Jobrad" class="fa-sharp fa-regular fa-person-biking"></i></div>' : '' ?></td>
<td class="text-center"><?= number_format(round($timerecording->ishours / 3600, 2), "2", ",", ".") ?></td>
<td class="text-center"><?= $nlz ?></td>
<td class="text-center"><?= number_format(round($timerecording->ishourssum / 3600, 2), "2", ",", ".") ?></td>
@@ -250,6 +250,9 @@
<div class="row">
<div class="col-12">
<table class="table ">
<tr>
<td colspan="2" id="modal-user-info"></td>
</tr>
<tr id="overtimes">
</tr>
<tr class="transfer-tr transfer-tr tr-plushours" style="display: none">
@@ -415,7 +418,11 @@
$('#submit-button').data('type', 'bpa');
$('#overtimeModal').data('id', button.data('id'));
}
console.log(button.closest('tr').find('.fa-person-biking').length);
$('#modal-user-info').html('<span class="font-weight-500 font-15">'+ button.closest('tr').find('td').eq(0).text()+'</span>');
if (button.closest('tr').find('.fa-person-biking').length) {
$('#modal-user-info').append('<div class="float-right font-15">'+button.closest('tr').find('.fa-person-biking').closest('div').html()+'</div>');
}
});

View File

@@ -4,7 +4,8 @@
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= $git_merge_ts ?>" rel="stylesheet"
type="text/css"/>
<link href="<?= self::getResourcePath() ?>datatables/DataTables-2x/datatables.min.css?<?= $git_merge_ts ?>" rel="stylesheet"
<link href="<?= self::getResourcePath() ?>datatables/DataTables-2x/datatables.min.css?<?= $git_merge_ts ?>"
rel="stylesheet"
type="text/css"/>
<!-- start page title -->
<div class="row">
@@ -67,7 +68,9 @@
</thead>
<tbody>
<?php foreach ($timerecordingbillingsemployees as $timerecordingbillingsemployee):
<?php
$oldEmployee_id = "";
foreach ($timerecordingbillingsemployees as $timerecordingbillingsemployee):
$user = new User($timerecordingbillingsemployee->timerecordingEmployee->user->id);
$employee_number = (string)$user->getFlag('employee_number');
unset ($nlz);
@@ -86,6 +89,16 @@
} else {
$nlz = "";
}
if ($oldEmployee_id != $timerecordingbillingsemployee->timerecordingEmployee_id) {
$bpadiff = 0;
$overtimediff = 0;
$plushoursdiff = 0;
}
$bpadiff = $bpadiff + $timerecordingbillingsemployee->transfer_bpahours;
$overtimediff = $overtimediff + $timerecordingbillingsemployee->transfer_overtime;
$plushoursdiff = $plushoursdiff + $timerecordingbillingsemployee->transfer_plushours;
?>
<tr>
<td class="text-center"><?= $timerecordingbillingsemployee->timerecordingBilling->month ?></td>
@@ -98,13 +111,15 @@
<td class="text-center"
data-order="<?= $timerecordingbillingsemployee->plushours_all + $timerecordingbillingsemployee->transfer_plushours ?>"><?= number_format(round(($timerecordingbillingsemployee->plushours_all + $timerecordingbillingsemployee->transfer_plushours) / 3600, 2), "2", ",", ".") ?></td>
<td class="text-center"
data-order="<?= $timerecordingbillingsemployee->timerecordingEmployee->overtime_now + $timerecordingbillingsemployee->transfer_overtime ?>"><?= number_format(round(($timerecordingbillingsemployee->timerecordingEmployee->overtime_now + $timerecordingbillingsemployee->transfer_overtime) / 3600, 2), "2", ",", ".") ?></td>
data-order="<?= $timerecordingbillingsemployee->timerecordingEmployee->overtime_now + $overtimediff?>"><?= number_format(round(($timerecordingbillingsemployee->timerecordingEmployee->overtime_now + $overtimediff) / 3600, 2), "2", ",", ".") ?></td>
<?php if ($me->superexpertEnabled()): ?>
<td class="text-center"
data-order="<?= $timerecordingbillingsemployee->timerecordingEmployee->bpahours ?>"><?= number_format(round($timerecordingbillingsemployee->timerecordingEmployee->bpahours / 3600, 2), "2", ",", ".") ?></td>
data-order="<?= $timerecordingbillingsemployee->timerecordingEmployee->bpahours + $bpadiff ?>"><?= number_format(round(($timerecordingbillingsemployee->timerecordingEmployee->bpahours + $bpadiff) / 3600, 2), "2", ",", ".") ?></td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
<?php
$oldEmployee_id = $timerecordingbillingsemployee->timerecordingEmployee_id;
endforeach; ?>
</tbody>
</table>

View File

@@ -1,7 +1,7 @@
<?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"
<link href="<?= self::getResourcePath() ?>assets/css/select2-cstm.css?<?= $git_merge_ts ?>" rel="stylesheet"
type="text/css"/>
<style>
.fc-event {
@@ -187,15 +187,15 @@ $daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
}
</style>
<script type="text/javascript"
src="<?= self::getResourcePath() ?>assets/js/calendar/moment/moment.min.js?<?= date('U') ?>"></script>
src="<?= self::getResourcePath() ?>assets/js/calendar/moment/moment.min.js?<?= $git_merge_ts ?>"></script>
<script type="text/javascript"
src="<?= self::getResourcePath() ?>assets/js/calendar/index.global.min.js?<?= date('U') ?>"></script>
src="<?= self::getResourcePath() ?>assets/js/calendar/index.global.min.js?<?= $git_merge_ts ?>"</script>
<script type="text/javascript"
src="<?= self::getResourcePath() ?>assets/js/calendar/moment/index.global.min.js?<?= date('U') ?>"></script>
src="<?= self::getResourcePath() ?>assets/js/calendar/moment/index.global.min.js?<?= $git_merge_ts ?>"></script>
<script type="text/javascript"
src="<?= self::getResourcePath() ?>assets/js/calendar/locales-all.global.min.js?<?= date('U') ?>"></script>
src="<?= self::getResourcePath() ?>assets/js/calendar/locales-all.global.min.js?<?= $git_merge_ts ?>"></script>
<script type="text/javascript"
src="<?= self::getResourcePath() ?>assets/js/calendar/tooltip.min.js?<?= date('U') ?>"></script>
src="<?= self::getResourcePath() ?>assets/js/calendar/tooltip.min.js?<?= $git_merge_ts ?>"></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
@@ -258,7 +258,6 @@ $daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
oldname = value.user.user;
}
if (value.ccategory.ccategory == "Sterbefall") {
console.log('cool');
category = "Sonderurlaub";
} else {
category = value.ccategory.ccategory;
@@ -391,7 +390,7 @@ $daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
</style>
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= date('U') ?>" rel="stylesheet"
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= $git_merge_ts ?>" rel="stylesheet"
type="text/css"/>
<!-- start page title -->
<div class="row">
@@ -444,7 +443,7 @@ $daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
</script>
<script type="text/javascript"
src="<?= self::getResourcePath() ?>assets/js/datatables-std.js?<?= date('U') ?>"></script>
src="<?= self::getResourcePath() ?>assets/js/datatables-std.js?<?= $git_merge_ts ?>"></script>
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>

View File

@@ -180,6 +180,17 @@ $daysSelect .= "</select>";
</div>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label"
for="auto_workinghours">Jobrad</label>
<div class="col-lg-3">
<div class="form-check">
<input id="jobbike"
class="form-check-input" <?php if ($timerecordingemployees->jobbike) echo 'checked="checked"'; ?>
type="checkbox" name="jobbike" value="1"/>
</div>
</div>
</div>
<div id="workinghours_div">
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="workinghours">Sollzeiten

View File

@@ -67,6 +67,7 @@ $type[3] = "Lehrling";
<?php endif; ?>
<th class="text-center" title="Offene Urlaube">Urlaubstage</th>
<th class="text-center edit-width">Schnellb.</th>
<th class="text-center edit-width">Jobrad</th>
<th class="edit-width"></th>
</tr>
<tr id="filterrow">
@@ -86,6 +87,7 @@ $type[3] = "Lehrling";
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@@ -137,8 +139,9 @@ $type[3] = "Lehrling";
data-order="<?= $timerecordingemployees[$timerecordinguser->id]['bpahours'] ?>"><?= sprintf('%02dh:%02dm', floor($timerecordingemployees[$timerecordinguser->id]['bpahours'] / 3600), floor($timerecordingemployees[$timerecordinguser->id]['bpahours'] / 60 % 60)) ?></td>
<?php endif; ?>
<td class="text-center"
data-order="<?= ($timerecordingemployees[$timerecordinguser->id]['holidays_now']) ? $timerecordingemployees[$timerecordinguser->id]['holidays_now'] : '' ?>"><?= ($timerecordingemployees[$timerecordinguser->id]['holidays_now']) ? $timerecordingemployees[$timerecordinguser->id]['holidays_now'] . ' Tage' : '' ?> </td>
data-order="<?= ($timerecordingemployees[$timerecordinguser->id]['holidays_now']) ? $timerecordingemployees[$timerecordinguser->id]['holidays_now'] : $timerecordingemployees[$timerecordinguser->id]['holidays_now'] ?>"><?= ($timerecordingemployees[$timerecordinguser->id]['holidays_now']) ? $timerecordingemployees[$timerecordinguser->id]['holidays_now'] . ' Tage' : '0 Tage' ?> </td>
<td class="text-center pr-3"><?= ($timerecordingemployees[$timerecordinguser->id]['auto_workinghours'] == '1') ? 'Ja' : 'Nein' ?></td>
<td class="text-center pr-3"><?= ($timerecordingemployees[$timerecordinguser->id]['jobbike'] == '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
class="far fa-edit" title="Bearbeiten"></i></a>
@@ -157,11 +160,11 @@ $type[3] = "Lehrling";
src="<?= self::getResourcePath() ?>datatables/DataTables-2x/datatables.min.js?<?= $git_merge_ts ?>"></script>
<script type="text/javascript">
var hidesearch = [ 6, 7, 8, 9, 10,12];
var columnfilter = [0,11];
var hidesearch = [ 6, 7, 8, 9, 10,13];
var columnfilter = [0,11,12];
<?php if ($me->superexpertEnabled()): ?>
var columnfilter = [0,12];
hidesearch = [ 6, 7, 8, 9, 10, 11,13];
hidesearch = [ 6, 7, 8, 9, 10, 11,14];
<?php endif; ?>
var columnoptions = '<option value=""></option><option value="Ja">Ja</option><option value="Nein">Nein</option>';

View File

@@ -19,14 +19,6 @@ class FiberPlanPipeController extends mfBaseController
protected function indexAction()
{
$this->layout()->setTemplate("FiberPlanPipe/Index");
$fiberplanpipes = FiberPlanPipeModel::getAll();
$pipworkeraddresses = FiberPlanPipeModel::getPipeworkerAddresses();
$fiberplanpipeEndpoints = FiberPlanPipeEndpointModel::getAll();
$this->layout()->set("fiberplanpipeEndpoints", $fiberplanpipeEndpoints);
$this->layout()->set("pipworkeraddresses", $pipworkeraddresses);
$this->layout()->set("fiberplanpipes", $fiberplanpipes);
}
protected function addAction()
@@ -56,6 +48,9 @@ class FiberPlanPipeController extends mfBaseController
case "getPops":
$return = $this->getPops($network);
break;
case "getFiberPlanPipes":
$return = $this->getFiberPlanPipes();
break;
default:
$return = false;
}
@@ -283,4 +278,110 @@ class FiberPlanPipeController extends mfBaseController
{
FiberPlanPipeModel::getBuildingInfo($network, $bdtype);
}
protected function getFiberPlanPipes()
{
$fiberplanpipes = FiberPlanPipeModel::getAll();
$pipworkeraddresses = FiberPlanPipeModel::getPipeworkerAddresses();
$fiberplanpipeEndpoints = FiberPlanPipeEndpointModel::getAll();
$typeOption = FiberPlanPipeModel::$type_definition;
$statusOption = FiberPlanPipeModel::$status_definition;
$dimension_v1Option = FiberPlanPipeModel::$type_descrition_definition;
$responsibleOption[1] = "(F)";
$responsibleOption[2] = "(P)";
foreach ($pipworkeraddresses as $pipworkeraddress) {
$Pipeworker[$pipworkeraddress->id] = $pipworkeraddress->company;
}
$responsecount = count($fiberplanpipes);
foreach ($fiberplanpipes as $fiberplanpipe) {
unset($networks);
unset($endpoints);
// Performance Killer muss bereinigt werden
foreach ($fiberplanpipeEndpoints[$fiberplanpipe->id] as $fiberplanpipeEndpoint) {
if ($fiberplanpipeEndpoint->pop_id) {
$networks[$fiberplanpipeEndpoint->pop->network->name] = $fiberplanpipeEndpoint->pop->network->name;
$endpoints[] = '<span title="POP">(P) </span>' . $fiberplanpipeEndpoint->pop->name;
} else if ($fiberplanpipeEndpoint->building_id) {
$networks[$fiberplanpipeEndpoint->building->network->name] = $fiberplanpipeEndpoint->building->network->name;
$endpoints[] = '<span title="Building">(B) </span>' . $fiberplanpipeEndpoint->building->street . " " . $fiberplanpipeEndpoint->building->number;
} else if ($fiberplanpipeEndpoint->fiberPlanDispatcher_id) {
$networks[$fiberplanpipeEndpoint->fiberPlanDispatcher->network->name] = $fiberplanpipeEndpoint->fiberPlanDispatcher->network->name;
if ($fiberplanpipeEndpoint->fiberPlanDispatcher->object_type == "1") {
$endpoints[] = '<span title="Verteiler">(V) </span>' . $fiberplanpipeEndpoint->fiberPlanDispatcher->description;
} elseif ($fiberplanpipeEndpoint->fiberPlanDispatcher->object_type == "2") {
$endpoints[] = '<span title="Schacht">(S) </span>' . $fiberplanpipeEndpoint->fiberPlanDispatcher->description;
} else if ($fiberplanpipeEndpoint->fiberPlanDispatcher->object_type == "3") {
$endpoints[] = '<span title="Greenfield">(G) </span>' . $fiberplanpipeEndpoint->fiberPlanDispatcher->description;
} else if ($fiberplanpipeEndpoint->fiberPlanDispatcher->object_type == "4") {
$endpoints[] = '<span title="Abzweigepunkt">(A) </span>' . $fiberplanpipeEndpoint->fiberPlanDispatcher->description;
}
}
}
//....
if ($fiberplanpipe->type == "3") {
$name = "";
if ($fiberplanpipe->fiberPlanPipeTemplate->pipe7x4 && $fiberplanpipe->fiberPlanPipeTemplate->pipe14x10) {
$name = $fiberplanpipe->fiberPlanPipeTemplate->fiberPlanPipeManufacturer->name . " " . $fiberplanpipe->fiberPlanPipeTemplate->pipe7x4 . "*7x4" . "/" . $fiberplanpipe->fiberPlanPipeTemplate->pipe14x10 . "*14x10";
} else if ($fiberplanpipe->fiberPlanPipeTemplate->pipe7x4) {
$name = $fiberplanpipe->fiberPlanPipeTemplate->fiberPlanPipeManufacturer->name . " " . $fiberplanpipe->fiberPlanPipeTemplate->pipe7x4 . "*7x4";
} else if ($fiberplanpipe->fiberPlanPipeTemplate->pipe14x10) {
$name = $fiberplanpipe->fiberPlanPipeTemplate->fiberPlanPipeManufacturer->name . " " . $fiberplanpipe->fiberPlanPipeTemplate->pipe14x10 . "*14x10";
}
$typeDescription = $name;
//
} else {
$typeDescription = $dimension_v1Option[$fiberplanpipe->type_description];
}
$startpoint = '<span class="startpoint" data-toggle="modal" data-target="#pipemap" data-gpslat="' . $buildings[$fiberplanpipe->startpoint_type][$fiberplanpipe->startpoint]['gps_lat'] . '" data-gpslong="' . $buildings[$fiberplanpipe->startpoint_type][$fiberplanpipe->startpoint]['gps_long'] . '">' . $starting_pointOption[$fiberplanpipe->startpoint_type] . "/" . $buildings[$fiberplanpipe->startpoint_type][$fiberplanpipe->startpoint]['name'] . '</span>';
$endpoint = '<span class="endpoint" data-toggle="modal" data-target="#pipemap" data-gpslat="' . $buildings[$fiberplanpipe->entpoint_type][$fiberplanpipe->endpoint]['gps_lat'] . '" data-gpslong="' . $buildings[$fiberplanpipe->entpoint_type][$fiberplanpipe->endpoint]['gps_long'] . '">' . $starting_pointOption[$fiberplanpipe->entpoint_type] . "/" . $buildings[$fiberplanpipe->entpoint_type][$fiberplanpipe->endpoint]['name'] . '</span>';
$responsible = $responsibleOption[$fiberplanpipe->responsible];
if ($fiberplanpipe->address_id) {
$responsible .= " " . $Pipeworker[$fiberplanpipe->address_id];
if ($fiberplanpipe->responsible_text) {
$responsible .= " (" . $fiberplanpipe->responsible_text . ")";
}
} else {
$responsible .= " " . $fiberplanpipe->responsible_text;
}
if ($fiberplanpipe->startpoint_network_id == $fiberplanpipe->endpoint_network_id) {
$networkName = $Network[$fiberplanpipe->startpoint_network_id];
} else {
$networkName = $Network[$fiberplanpipe->startpoint_network_id] . " / " . $Network[$fiberplanpipe->endpoint_network_id];
}
$edit = '<a href="' . self::getUrl("FiberPlanPipe", "edit", ["id" => $fiberplanpipe->id]) . '"><i
class="far fa-edit" title="Bearbeiten"></i></a><a href="' . self::getUrl("FiberPlanPipe", "delete", ["id" => $fiberplanpipe->id]) . '"
onclick="if(!confirm(\'Rohrverzeichnis wirklich löschen?\')) return false;"
class="text-danger"
title="Löschen"><i class="fas fa-trash"></i></a>';
$rows[] = array(
'description' => array('description' => '<a href="' . self::getUrl("FiberPlanPipe", "Detail", ["id" => $fiberplanpipe->id]) . '">' . $fiberplanpipe->description . '</a>', 'order' => $fiberplanpipe->description),
'typeOption' => array('typeOption' => $typeOption[$fiberplanpipe->type] . " / " . $typeDescription, 'order' => $typeOption[$fiberplanpipe->type] . " / " . $typeDescription),
'length' => array('length' => $fiberplanpipe->length, 'order' => $fiberplanpipe->length),
'networks' => array('networks' => implode(',', $networks), 'order' => implode(',', $networks)),
'startpoint' => array('startpoint' => $endpoints[0], 'order' => $endpoints[0]),
'endpoint' => array('endpoint' => $endpoints[count($endpoints) - 1], 'order' => $endpoints[count($endpoints) - 1]),
'responsible' => array('responsible' => $responsible, 'order' => $responsible),
'state' => array('state' => $statusOption[$fiberplanpipe->status], 'order' => $statusOption[$fiberplanpipe->status]),
'edit' => array('edit' => $edit, 'order' => ''),
);
}
$json['success'] = true;
$json['data'] = $rows;
$json['recordsFiltered'] = $responsecount;
$json['recordsTotal'] = $responsecount;
$json = json_encode($json);
echo trim($json);
die();
}
}

View File

@@ -16,6 +16,7 @@ class FiberPlanPipeModel
private $comment;
public static $type_descrition_definition = array(1 => "MR7", 2 => "MR14", 3 => "MR16", 4 => "MR20", 5 => "PE32", 6 => "PE40", 7 => "PE50", 8 => "KSR50", 9 => "KSR80", 10 => "KSR100");
public static $type_definition = array(1 => "Enzel", 2 => "Schutzrohr", 3 => "Verband");
public static $status_definition = array(10 => "Geplant", 20 => "Umsetzung", 30 => "Fertiggestellt");
public static function find($data)
{

View File

@@ -41,7 +41,7 @@ class TimerecordingBillingController extends mfBaseController
protected function overviewAction()
{
$timerecordingBillings = TimerecordingBillingModel::getAll();
$timerecordingBillingsEmployees = TimerecordingBillingEmployeeModel::getAll();
$timerecordingBillingsEmployees = TimerecordingBillingEmployeeModel::getAllOrderbyNameDate();
$this->layout()->setTemplate("TimerecordingBilling/Overview");
$this->layout()->set("timerecordingbillings", $timerecordingBillings);
$this->layout()->set("timerecordingbillingsemployees", $timerecordingBillingsEmployees);
@@ -224,9 +224,9 @@ class TimerecordingBillingController extends mfBaseController
$file = fopen("php://output", 'w');
header('Content-Type: text/csv; charset=utf-8');
header('Content-Disposition: attachment; filename=' . $filename);
$monthunix=(strtotime("01." .$month));
$monthunix = (strtotime("01." . $month));
$monthbmd = date("n", $monthunix);
$monthend = date("d.m.Y", strtotime("last day of this month",$monthunix));
$monthend = date("d.m.Y", strtotime("last day of this month", $monthunix));
$companybmd = "1";
if ($nlz == 0) {
$headerarray = ["Monat", "Firma", "Mitarbeiter", "Lohnart", "Menge", "Satz", "Betrag", "Kostenstelle", "NLZ-Kennzeichen", "NLZ Von-Datum", "NLZ Bis-Datum"];
@@ -269,6 +269,12 @@ class TimerecordingBillingController extends mfBaseController
if ($timerecordingBillingEmployee->overtime50free > 64800) {
$bodyarray = [$monthbmd, "1", $employee_number, "3110", "18", "", "", "", "", "", ""];
fputcsv($file, $bodyarray, ";");
if ($timerecordingBillingEmployee->timerecordingEmployee->jobbike == 1) {
$bodyarray = [$monthbmd, "1", $employee_number, "3115", "18", "", "", "", "", "", ""];
fputcsv($file, $bodyarray, ";");
$bodyarray = [$monthbmd, "1", $employee_number, "3116", "18", "", "", "", "", "", ""];
fputcsv($file, $bodyarray, ";");
}
$diffsum = $timerecordingBillingEmployee->overtime50free - 64800;
$diffsum = $diffsum / 3600;
$diffsum = round($diffsum, 2);
@@ -279,6 +285,12 @@ class TimerecordingBillingController extends mfBaseController
$overtime50free = str_replace(".", ",", $overtime50free);
$bodyarray = [$monthbmd, "1", $employee_number, "3110", $overtime50free, "", "", "", "", "", ""];
fputcsv($file, $bodyarray, ";");
if ($timerecordingBillingEmployee->timerecordingEmployee->jobbike == 1) {
$bodyarray = [$monthbmd, "1", $employee_number, "3115", $overtime50free, "", "", "", "", "", ""];
fputcsv($file, $bodyarray, ";");
$bodyarray = [$monthbmd, "1", $employee_number, "3116", $overtime50free, "", "", "", "", "", ""];
fputcsv($file, $bodyarray, ";");
}
}
@@ -291,6 +303,12 @@ class TimerecordingBillingController extends mfBaseController
if ($timerecordingBillingEmployee->overtime100free > 64800) {
$bodyarray = [$monthbmd, "1", $employee_number, "3160", "18", "", "", "", "", "", ""];
fputcsv($file, $bodyarray, ";");
if ($timerecordingBillingEmployee->timerecordingEmployee->jobbike == 1) {
$bodyarray = [$monthbmd, "1", $employee_number, "3165", "18", "", "", "", "", "", ""];
fputcsv($file, $bodyarray, ";");
$bodyarray = [$monthbmd, "1", $employee_number, "3166", "18", "", "", "", "", "", ""];
fputcsv($file, $bodyarray, ";");
}
$diffsum = $timerecordingBillingEmployee->overtime100free - 64800;
$diffsum = $diffsum / 3600;
$diffsum = round($diffsum, 2);
@@ -300,6 +318,12 @@ class TimerecordingBillingController extends mfBaseController
} else {
$bodyarray = [$monthbmd, "1", $employee_number, "3160", $overtime100free, "", "", "", "", "", ""];
fputcsv($file, $bodyarray, ";");
if ($timerecordingBillingEmployee->timerecordingEmployee->jobbike == 1) {
$bodyarray = [$monthbmd, "1", $employee_number, "3165", $overtime100free, "", "", "", "", "", ""];
fputcsv($file, $bodyarray, ";");
$bodyarray = [$monthbmd, "1", $employee_number, "3166", $overtime100free, "", "", "", "", "", ""];
fputcsv($file, $bodyarray, ";");
}
}
}
@@ -333,16 +357,16 @@ class TimerecordingBillingController extends mfBaseController
} else {
if ($timerecordingBillingEmployee->nlz_detail) {
foreach (json_decode($timerecordingBillingEmployee->nlz_detail, true) as $nlztime) {
$bodyarray = [$companybmd, $employee_number, 1, $nlztime['categoryshort'], $nlztime['catExtended'], "3", $nlztime['start'], $nlztime['end'], $nlztime['time'], $nlztime['pay']];
fputcsv($file, $bodyarray, ";");
if ($nlztime['categoryshort'] != "99") {
$bodyarray = [$companybmd, $employee_number, 1, $nlztime['categoryshort'], $nlztime['catExtended'], "3", $nlztime['start'], $nlztime['end'], $nlztime['time'], $nlztime['pay']];
fputcsv($file, $bodyarray, ";");
}
}
}
if ($timerecordingBillingEmployee->holidays>0) {
if ($timerecordingBillingEmployee->holidays > 0) {
//last day of month
$bodyarray = [$companybmd, $employee_number, 1, "1", "", "4", $monthend, $monthend, $timerecordingBillingEmployee->holidays, '0'];
fputcsv($file, $bodyarray, ";");
@@ -584,11 +608,8 @@ class TimerecordingBillingController extends mfBaseController
if ($timerecording['homeoffice']) {
$data['homeoffice'] = $timerecording['homeoffice'];
}
if (!$data['diet']) {
$data['diet'] = 0;
}
$timerecordingbillingemployee = TimerecordingBillingEmployeeModel::create($data);

View File

@@ -93,6 +93,22 @@ class TimerecordingBillingEmployeeModel
}
public static function getAllOrderbyNameDate()
{
$items = [];
$db = FronkDB::singleton();
$res = $db->select("TimerecordingBillingEmployee", "*", "1=1 ORDER by `timerecordingEmployee_id`,`timerecordingBilling_id` DESC ");
if ($db->num_rows($res)) {
while ($data = $db->fetch_object($res)) {
$items[] = new TimerecordingBillingEmployee($data);
}
}
return $items;
}
public static function getFirst()
{
$db = FronkDB::singleton();

View File

@@ -123,6 +123,7 @@ class TimerecordingEmployeeController extends mfBaseController
$data = [];
$data['user_id'] = trim($r->user_id);
$data['auto_workinghours'] = trim($r->auto_workinghours);
$data['jobbike'] = trim($r->jobbike);
$data['holidays'] = trim($r->holidays);
$data['plushours'] = $plushours;
$data['startdate'] = strtotime($r->startdate);
@@ -172,6 +173,9 @@ class TimerecordingEmployeeController extends mfBaseController
if (!$data['auto_workinghours']) {
$data['auto_workinghours'] = 0;
}
if (!$data['jobbike']) {
$data['jobbike'] = 0;
}
if ($mode == "edit") {
$timerecordingemployees->update($data);

View File

@@ -19,6 +19,7 @@ class TimerecordingEmployeeModel
private $startdate;
private $enddate;
private $bmd_active;
private $jobbike;
private $birthday;
public static $employeetypesbmd = array('1' => '1000', '2' => '1200', '3' => '1400');

View File

@@ -157,7 +157,7 @@ private $holidays ;
$enddate = "";
$sum = "-";
$day = "";
$enddatecend="";
$enddatecend = "";
$orderdate = $timerecording->start;
if ($timerecording->timerecordingCategory->hourday == 1) {
$date = date("d.m.Y", $timerecording->start);
@@ -225,7 +225,7 @@ private $holidays ;
$enddatetemp = date("Y-m-d", time());
$enddatetemp = strtotime($enddatetemp . " 23:59:59");
$enddate = date("Y-m-d", $enddatetemp + 7200);
$enddatecend= date("Y-m-d", $enddatetemp + 1216800);
$enddatecend = date("Y-m-d", $enddatetemp + 1216800);
$start = "-";
$end = "-";
$day = $daysgerm[date("w", $timerecording->start)];
@@ -266,6 +266,7 @@ private $holidays ;
$date = date("d.m.Y", $timerecording->start);
$start = "-";
$end = "-";
$datadate = date("Y-m-d", $timerecording->start);
$day = $daysgerm[date("w", $timerecording->start)];
if ($timerecording->days > 0) {
if ($timerecording->days == 1) {
@@ -357,9 +358,8 @@ private $holidays ;
endif;
if ($datatype == 3 && ($timerecording->timerecordingCategory->hourday == 1 || $timerecording->timerecordingCategory->hourday == 7 || $timerecording->timerecordingCategory->hourday == 5)) {
} else {
if (!$enddatecend)
{
$enddatecend=$enddate;
if (!$enddatecend) {
$enddatecend = $enddate;
}
$rows[] = array(
@@ -588,7 +588,7 @@ private $holidays ;
$O100pfl = 0;
$O50free = 0;
$O50pfl = 0;
$Osum=0;
$Osum = 0;
foreach ($timerecordings as $timerecording):
$state = "";
@@ -599,9 +599,10 @@ private $holidays ;
if ($oldday != date('Y-m-d', $timerecording->start)) {
if ($homeoffice == 1) {
$homeofficesum++;
$homeofficesum ++;
$homeoffice = false;
}
$homeoffice = false;
if ($diet > 10800) {
if ($diet >= 43200) {
$diet = 43200;
@@ -613,14 +614,13 @@ private $holidays ;
$diet = 0;
}
if ($timerecording->homeoffice == 1 && (!$homeoffice || $homeoffice == 1)) {
$homeoffice = 1;
} else {
$homeoffice = 0;
} else if ($timerecording->timerecordingCategory_id != '9') { //Speziallösung für Arztbesuch (zusätzlich Homeoffice erlaubt)
$homeoffice = 'NOK';
}
if ($timerecording->businesstrip == 1 && $timerecording->timerecordingCategory->hourday == 1) {
$diet = $diet + $timerecording->end - $timerecording->start;
}
@@ -664,7 +664,7 @@ private $holidays ;
$O100free = $O100free + $overtimes['O100free'];
$O50free = $O50free + $overtimes['O50free'];
$O50pfl = $O50pfl + $overtimes['O50pfl'];
$Osum=$Osum+$overtimes['sum'];
$Osum = $Osum + $overtimes['sum'];
}
} else if ($timerecording->timerecordingCategory->hourday == 2 || ($timerecording->timerecordingCategory->hourday == 3 && $timerecording->end)) {
$date = date("d.m.", $timerecording->start) . " - " . $daysgerm[date("w", $timerecording->end)] . " " . date("d.m.Y", $timerecording->end);
@@ -760,7 +760,8 @@ private $holidays ;
$sum = sprintf("%02d", $hours) . ":" . sprintf("%02d", $minutes);
} else if ($timerecording->timerecordingCategory->hourday == 5) {
$date = date("d.m.Y", $timerecording->start);
$datadate = date("Y-m-d", $timerecording->start);
$start = "-";
$end = "-";
$day = $daysgerm[date("w", $timerecording->start)];
@@ -770,7 +771,12 @@ private $holidays ;
} else {
$daysum[$timerecording->timerecordingCategory->name] = $daysum[$timerecording->timerecordingCategory->name] + $timerecording->days;
}
$nlzTimes[$timerecording->id]['start'] = date("d.m.Y", $timerecording->start);
$nlzTimes[$timerecording->id]['end'] = date("d.m.Y", $timerecording->end);
$nlzTimes[$timerecording->id]['days'] = $sumdays;
$nlzTimes[$timerecording->id]['unpaid'] = $timerecording->timerecordingCategory->unpaid;
$nlzTimes[$timerecording->id]['category'] = $timerecording->timerecordingCategory->name;
$nlzTimes[$timerecording->id]['categoryshort'] = '99';
} else if ($timerecording->timerecordingCategory->hourday == 6) {
$date = date("d.m.Y", $timerecording->start);
$datadate = date("Y-m-d", $timerecording->start);
@@ -826,7 +832,6 @@ private $holidays ;
endforeach;
if ($homeoffice == 1) {
$homeofficesum++;
$homeoffice = 0;
}
if ($diet > 10800) {
if ($diet >= 43200) {
@@ -883,7 +888,7 @@ private $holidays ;
$json['time']['daysum'] = $daysum;
$json['recordsFiltered'] = $responsecount;
$json['recordsTotal'] = $responsecount;
$json['time']['overtimes'] = ['O100free' => $O100free, 'O100pfl' => $O100pfl, 'O50free' => $O50free, 'O50pfl' => $O50pfl,'Osum'=>$Osum];
$json['time']['overtimes'] = ['O100free' => $O100free, 'O100pfl' => $O100pfl, 'O50free' => $O50free, 'O50pfl' => $O50pfl, 'Osum' => $Osum];
if ($ajax == 1) {
$json = json_encode($json);

View File

@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class TimerecordingEmployeeAddFieldjobbike extends AbstractMigration
{
public function up(): void
{
if ($this->getEnvironment() == "thetool") {
$table = $this->table("TimerecordingEmployee", ["signed" => true]);
$table->addColumn("jobbike", "integer", ["null" => false, "default" => 0, "after" => "bmd_active"]);
$table->update();
}
if ($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if ($this->getEnvironment() == "thetool") {
$this->table("TimerecordingEmployee")->removeColumn("jobbike")->save();
}
if ($this->getEnvironment() == "addressdb") {
}
}
}

View File

@@ -0,0 +1,169 @@
let table;
if (typeof hidesearch === "undefined") {
var hidesearch;
hidesearch = [100];
}
if (typeof cstmdom === "undefined") {
var cstmdom;
cstmdom = "flBrtip";
}
if (typeof columndefs === "undefined") {
var columndefs;
columndefs = "";
}
if (typeof columnfilter === "undefined") {
var columnfilter;
columnfilter = "";
}
if (typeof columnoptions === "undefined") {
var columnoptions;
columnoptions = "";
}
$('#filterrow th').each(function (i) {
let title = $('#datatable thead th').eq($(this).index()).text();
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 {
$(this).html('<input type="text" placeholder="' + title + '" class="form-control" data-index="' + i + '" value="" />');
}
});
table = $('#datatable').DataTable({
responsive: true,
"order": [[0, "desc"]],
buttons: [
{
extend: 'excelHtml5',
text: 'XLSX Export',
className: 'btn-success margina d-none d-lg-block',
exportOptions: {
columns: ['th:not(:last-child)']
}
}
], columnDefs: [
columndefs
],
"language": {
"url": "/datatables/json/german.json?v1"
},
orderCellsTop: true,
stateSave: true,
stateDuration: 60 * 60 * 24 * 30,
"initComplete": function () {
$('#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('');
table.search('').columns().search('').draw();
});
},
"dom": cstmdom,
"ajax": {
"url": requestUrl,
"type": "POST",
"data": function (d) {
},
"dataSrc": function (json) {
return json.data;
}
},
"columns": [
{
"data": {
_: "description.description",
"sort": "description.order"
},
className: "text-nowrap"
}, {
"data": {
_: "typeOption.typeOption",
"sort": "typeOption.order"
},
className: "text-center"
}, {
"data": {
_: "length.length",
"sort": "length.order"
},
className: "text-center"
}, {
"data": {
_: "networks.networks",
"sort": "networks.order"
},
className: "text-center"
}, {
"data": {
_: "startpoint.startpoint",
"sort": "startpoint.order"
},
className: ""
}
, {
"data": {
_: "endpoint.endpoint",
"sort": "endpoint.order"
},
className: "text-left"
},{
"data": {
_: "responsible.responsible",
"sort": "responsible.order"
},
className: "text-left"
}, {
"data": {
_: "state.state",
"sort": "state.order"
},
className: "text-left"
},{
"data": {
_: "edit.edit",
"sort": "edit.order"
},
className: "edit-td"
}
]
});
$('#filterrow').on('keyup', 'input', function () {
table
.column($(this).data('index'))
.search(this.value)
.draw();
});
$('#selectsearch').change(function () {
table
.column($(this).data('index'))
.search(this.value)
.draw();
});
let state = table.state.loaded();
if (state) {
table.columns().eq(0).each(function (colIdx) {
var colSearch = state.columns[colIdx].search;
if (colSearch.search) {
$('#filterrow').find("[data-index='" + colIdx + "']").val(colSearch.search);
}
});
table.draw();
}